Bug 1373408 - Make nsUpdateTimerManager notify callbacks on idle. r=rhelmer

MozReview-Commit-ID: INSvHMEXOxt

--HG--
extra : rebase_source : f91bc401f283b593d0c4bdf012923450676d7cbc
This commit is contained in:
Mike Conley 2018-07-12 14:38:38 -04:00
Родитель eafdeadedf
Коммит c045933e61
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -219,13 +219,15 @@ TimerManager.prototype = {
}
tryFire(function() {
if (timerData.callback && timerData.callback.notify) {
try {
timerData.callback.notify(timer);
LOG("TimerManager:notify - notified timerID: " + timerID);
} catch (e) {
LOG("TimerManager:notify - error notifying timerID: " + timerID +
", error: " + e);
}
ChromeUtils.idleDispatch(() => {
try {
timerData.callback.notify(timer);
LOG("TimerManager:notify - notified timerID: " + timerID);
} catch (e) {
LOG("TimerManager:notify - error notifying timerID: " + timerID +
", error: " + e);
}
});
} else {
LOG("TimerManager:notify - timerID: " + timerID + " doesn't " +
"implement nsITimerCallback - skipping");