Closed Bug 647178 Opened 9 years ago Closed 9 years ago

Warnings with mIsPending and mSuspendCount when running content/media tests

Categories

(Core :: Audio/Video, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: cajbir, Assigned: cajbir)

Details

Attachments

(1 file)

When running the content/media tests I get the following warnings logged periodically:

WARNING: NS_ENSURE_TRUE(mIsPending) failed: file netwerk/protocol/http/nsHttpChannel.cpp, line 3567
WARNING: NS_ENSURE_TRUE(mSuspendCount > 0) failed: file netwerk/protocol/http/nsHttpChannel.cpp, line 3584

These occur when Suspend and Resume are called on the nsMediaStream. If the channel has downloaded all the data before Suspend is called then the first warning occurs as a result of nsHttpChannel expecting the channel to be downloading data. It bails early due to the NS_ENSURE_TRUE check and doesn't actually suspend.

When the Resume method is called on nsMediaStream it calls the nsHttpChannel's Resume method which checks a count of the number of times Suspend has been called. Since the last suspend bailed early the count can reach 0 where Resume expects it to be 1. This is the reason for the second warning.

Steps to Reproduce:

1) Run test_playback.html a few times.

Expected Results:

1) The warnings shown above don't appear in the console log

Actual Results:

1) The warnings above do appear in the console log
Attached patch FixSplinter Review
To fix this I check the isPending status of the channel before calling Suspend. If it is false (ie. not downloading) then I don't call suspend and set a flag to note that I shouldn't Resume later.
Assignee: nobody → chris.double
Status: NEW → ASSIGNED
Attachment #523544 - Flags: review?(roc)
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/43cddadd2a45
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.