mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 22:07:41 +00:00
Bug 1315260 - Don't schedule idle callbacks when suspended. r=smaug
MozReview-Commit-ID: 5uFUhchpntJ
This commit is contained in:
parent
60f5594a6e
commit
3f3767a201
@ -833,9 +833,10 @@ nsGlobalWindow::RequestIdleCallback(JSContext* aCx,
|
||||
}
|
||||
|
||||
// If the list of idle callback requests is not empty it means that
|
||||
// we've already dispatched the first idle request. It is the
|
||||
// responsibility of that to dispatch the next.
|
||||
bool needsScheduling = mIdleRequestCallbacks.isEmpty();
|
||||
// we've already dispatched the first idle request. If we're
|
||||
// suspended we should only queue the idle callback and not schedule
|
||||
// it to run, that will be done in ResumeIdleRequest.
|
||||
bool needsScheduling = !IsSuspended() && mIdleRequestCallbacks.isEmpty();
|
||||
// mIdleRequestCallbacks now owns request
|
||||
InsertIdleCallback(request);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user