Bug 595972 - Fix event queue state invariants on HTTP channel resume. r=jduell a=blocking-fennec

This commit is contained in:
Josh Matthews 2010-09-17 00:23:25 -07:00
parent b89691f173
commit ad7e8474d6

View File

@ -790,8 +790,15 @@ HttpChannelChild::Resume()
NS_ENSURE_TRUE(mSuspendCount > 0, NS_ERROR_UNEXPECTED);
SendResume();
mSuspendCount--;
if (!mSuspendCount)
if (!mSuspendCount) {
// If we were suspended outside of an event handler (bug 595972) we'll
// consider ourselves unqueued. This is a legal state of affairs but
// FlushEventQueue() can't easily ensure this fact, so we'll do some
// fudging to set the invariants correctly.
if (mQueuePhase == PHASE_UNQUEUED)
mQueuePhase = PHASE_FINISHED_QUEUEING;
FlushEventQueue();
}
return NS_OK;
}