Bug 1315260 - Don't schedule idle callbacks when suspended. r=smaug

MozReview-Commit-ID: 5uFUhchpntJ
This commit is contained in:
Andreas Farre 2017-02-13 11:04:18 +01:00
parent 60f5594a6e
commit 3f3767a201

View File

@ -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);