зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1251276 part 1. Change WorkerPrivate::CancelAllTimeouts to no longer call RunExpiredTimeouts. r=khuey
If you walk through what RunExpiredTimeouts used to when called from here do carefully, it used to do the following: 1) If mRunningExpiredTimeouts, no-op. 2) Not run anything, because everything is canceled. 3) Remove everything from mTimeouts, since everything is canceled. 4) Since mTimeouts is now empty, modify the busy count and set mTimerRunning to false. None of this could report a JS exception, so the JS_ReportPendingException call in CancelAllTimouts was dead code. Note that the return value of RunExpiredTimeouts only affected whether JS_ReportPendingException is called, so we don't even need to worry about ModifyBusyCountFromWorker failing: that failure used to be silently swallowed.
This commit is contained in:
Родитель
d71c9dd868
Коммит
7dc5bbf023
|
@ -5186,10 +5186,18 @@ WorkerPrivate::CancelAllTimeouts(JSContext* aCx)
|
|||
mTimeouts[index]->mCanceled = true;
|
||||
}
|
||||
|
||||
if (!RunExpiredTimeouts(aCx)) {
|
||||
JS_ReportPendingException(aCx);
|
||||
// If mRunningExpiredTimeouts, then the fact that they are all canceled now
|
||||
// means that the currently executing RunExpiredTimeouts will deal with
|
||||
// them. Otherwise, we need to clean them up ourselves.
|
||||
if (!mRunningExpiredTimeouts) {
|
||||
mTimeouts.Clear();
|
||||
ModifyBusyCountFromWorker(false);
|
||||
}
|
||||
|
||||
// Set mTimerRunning false even if mRunningExpiredTimeouts is true, so that
|
||||
// if we get reentered under this same RunExpiredTimeouts call we don't
|
||||
// assert above that !mTimeouts().IsEmpty(), because that's clearly false
|
||||
// now.
|
||||
mTimerRunning = false;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче