Bug 1160263: Don't allow add-ons to override the periodic XPI signature check. r=rstrong
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 30 Apr 2015 13:17:32 -0700
changeset 273228 2e1d5dc5393f8a273efc48523fc81eaac3b16ef8
parent 273227 a375bdb7fb5d38a5d8829d226a1a3090d2952d5e
child 273229 6404e6d64787f793aed2a388c08bdfc9ed43421b
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs1160263
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1160263: Don't allow add-ons to override the periodic XPI signature check. r=rstrong
toolkit/components/timermanager/nsUpdateTimerManager.js
--- a/toolkit/components/timermanager/nsUpdateTimerManager.js
+++ b/toolkit/components/timermanager/nsUpdateTimerManager.js
@@ -287,16 +287,20 @@ TimerManager.prototype = {
     }
   },
 
   /**
    * See nsIUpdateTimerManager.idl
    */
   registerTimer: function TM_registerTimer(id, callback, interval) {
     LOG("TimerManager:registerTimer - id: " + id);
+    if (id in this._timers && callback != this._timers[id].callback) {
+      LOG("TimerManager:registerTimer - Ignoring second registration for " + id);
+      return;
+    }
     let prefLastUpdate = PREF_APP_UPDATE_LASTUPDATETIME_FMT.replace(/%ID%/, id);
     // Initialize the last update time to 0 when the preference isn't set so
     // the timer will be notified soon after a new profile's first use.
     let lastUpdateTime = getPref("getIntPref", prefLastUpdate, 0);
     let now = Math.round(Date.now() / 1000);
     if (lastUpdateTime > now)
       lastUpdateTime = 0;
     if (lastUpdateTime == 0)