Bug 1068962 - Fix settings lock ownership array splice; r=bent a=bbajaj
authorKyle Machulis <kyle@nonpolynomial.com>
Fri, 19 Sep 2014 10:34:43 -0700
changeset 224955 b51bf05a133f931b42cea229fa8d9376545f42aa
parent 224954 1f4e00fce272bb830b51020898a9a91453f65191
child 224956 2c38a719e7a7e9089c4fbc1b956435b469763adb
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, bbajaj
bugs1068962
milestone34.0a2
Bug 1068962 - Fix settings lock ownership array splice; r=bent a=bbajaj
dom/settings/SettingsManager.js
dom/settings/SettingsRequestManager.jsm
--- a/dom/settings/SettingsManager.js
+++ b/dom/settings/SettingsManager.js
@@ -259,17 +259,17 @@ SettingsManager.prototype = {
     this._locks.push(lock._id);
     return lock;
   },
 
   unregisterLock: function(aLockID) {
     let lock_index = this._locks.indexOf(aLockID);
     if (lock_index != -1) {
       if (DEBUG) debug("Unregistering lock " + aLockID);
-      this._locks.splice(lock_index, -1);
+      this._locks.splice(lock_index, 1);
     }
   },
   
   receiveMessage: function(aMessage) {
     if (DEBUG) debug("Settings::receiveMessage: " + aMessage.name);
     let msg = aMessage.json;
 
     switch (aMessage.name) {
--- a/dom/settings/SettingsRequestManager.jsm
+++ b/dom/settings/SettingsRequestManager.jsm
@@ -577,17 +577,17 @@ let SettingsRequestManager = {
     }
     let currentTask = lock.tasks.shift();
     let promises = [];
     while (currentTask) {
       if (DEBUG) debug("Running Operation " + currentTask.operation);
       if (lock.finalizing) {
         // We should really never get to this point, but if we do,
         // fail every task that happens.
-        Cu.reportError("Settings lock trying to run more tasks after finalizing. Ignoring tasks, but this is bad. Lock: " + aLockID);
+        Cu.reportError("Settings lock " + aLockID + " trying to run task '" + currentTask.operation + "' after finalizing. Ignoring tasks, but this is bad. Lock: " + aLockID);
         currentTask.defer.reject("Cannot call new task after finalizing");
       } else {
       let p;
       switch (currentTask.operation) {
         case "get":
           p = this.taskGet(currentTask);
           break;
         case "set":