mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 897221 - Support JS objects and avoid negative delay in nsUpdateTimerManager; r=rstrong
This commit is contained in:
parent
cea88b0387
commit
6371bea45f
@ -222,7 +222,7 @@ TimerManager.prototype = {
|
||||
Services.prefs.setIntPref(prefLastUpdate, timerData.lastUpdateTime);
|
||||
}
|
||||
tryFire(function() {
|
||||
if (timerData.callback instanceof Ci.nsITimerCallback) {
|
||||
if (timerData.callback && timerData.callback.notify) {
|
||||
try {
|
||||
timerData.callback.notify(timer);
|
||||
LOG("TimerManager:notify - notified timerID: " + timerID);
|
||||
@ -272,7 +272,7 @@ TimerManager.prototype = {
|
||||
this.lastTimerReset = Date.now();
|
||||
} else {
|
||||
if (Date.now() + interval < this.lastTimerReset + this._timer.delay)
|
||||
this._timer.delay = this.lastTimerReset + interval - Date.now();
|
||||
this._timer.delay = Math.max(this.lastTimerReset + interval - Date.now(), 0);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user