зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1281730 Restore timeouts before thawing workers to avoid running script on frozen timers. r=khuey
This commit is contained in:
Родитель
867e2c403e
Коммит
498431cc2a
|
@ -13078,13 +13078,6 @@ nsGlobalWindow::ResumeTimeouts(bool aThawChildren, bool aThawWorkers)
|
|||
RefPtr<Promise> d = mAudioContexts[i]->Resume(dummy);
|
||||
}
|
||||
|
||||
// Thaw or resume all of the workers for this window.
|
||||
if (aThawWorkers) {
|
||||
mozilla::dom::workers::ThawWorkersForWindow(AsInner());
|
||||
} else {
|
||||
mozilla::dom::workers::ResumeWorkersForWindow(AsInner());
|
||||
}
|
||||
|
||||
// Restore all of the timeouts, using the stored time remaining
|
||||
// (stored in timeout->mTimeRemaining).
|
||||
|
||||
|
@ -13129,6 +13122,15 @@ nsGlobalWindow::ResumeTimeouts(bool aThawChildren, bool aThawWorkers)
|
|||
// Add a reference for the new timer's closure.
|
||||
t->AddRef();
|
||||
}
|
||||
|
||||
// Thaw or resume all of the workers for this window. We must do this
|
||||
// after timeouts since workers may have queued events that can trigger
|
||||
// a setTimeout().
|
||||
if (aThawWorkers) {
|
||||
mozilla::dom::workers::ThawWorkersForWindow(AsInner());
|
||||
} else {
|
||||
mozilla::dom::workers::ResumeWorkersForWindow(AsInner());
|
||||
}
|
||||
}
|
||||
|
||||
// Resume our children as well.
|
||||
|
|
Загрузка…
Ссылка в новой задаче