Bug 791799 - Settings: Remove mozSettings.getLock. r=fabrice
authorGregor Wagner <anygregor@gmail.com>
Wed, 19 Sep 2012 10:21:30 -0700
changeset 107620 847fc3deee986429546e2016ad89a915b28f1ce4
parent 107619 c0d1f69cc901b06c8febfc12f3363aa8de28694b
child 107621 6d3db18ef4cd0c4442e642db583dbb36e1e45bff
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersfabrice
bugs791799
milestone18.0a1
Bug 791799 - Settings: Remove mozSettings.getLock. r=fabrice
dom/interfaces/settings/nsIDOMSettingsManager.idl
dom/settings/SettingsManager.js
dom/settings/SettingsManager.manifest
--- a/dom/interfaces/settings/nsIDOMSettingsManager.idl
+++ b/dom/interfaces/settings/nsIDOMSettingsManager.idl
@@ -15,19 +15,18 @@ interface nsIDOMSettingsLock : nsISuppor
   nsIDOMDOMRequest set(in nsIVariant settings);
 
   // result contains the value of the setting.
   nsIDOMDOMRequest get(in jsval name);
 
   nsIDOMDOMRequest clear();
 };
 
-[scriptable, uuid(0694f5e0-f777-11e1-a21f-0800200c9a66)]
+[scriptable, uuid(c40b1c70-00fb-11e2-a21f-0800200c9a66)]
 interface nsIDOMSettingsManager : nsISupports
 {
   nsIDOMSettingsLock createLock();
-  nsIDOMSettingsLock getLock();
 
   void addObserver(in DOMString name, in jsval callback);
   void removeObserver(in DOMString name, in jsval callback);
 
   attribute nsIDOMEventListener onsettingchange;
 };
--- a/dom/settings/SettingsManager.js
+++ b/dom/settings/SettingsManager.js
@@ -204,17 +204,17 @@ SettingsLock.prototype = {
   classInfo : XPCOMUtils.generateCI({classID: SETTINGSLOCK_CID,
                                      contractID: SETTINGSLOCK_CONTRACTID,
                                      classDescription: "SettingsLock",
                                      interfaces: [nsIDOMSettingsLock],
                                      flags: nsIClassInfo.DOM_OBJECT})
 };
 
 const SETTINGSMANAGER_CONTRACTID = "@mozilla.org/settingsManager;1";
-const SETTINGSMANAGER_CID        = Components.ID("{0694f5e0-f777-11e1-a21f-0800200c9a66}");
+const SETTINGSMANAGER_CID        = Components.ID("{c40b1c70-00fb-11e2-a21f-0800200c9a66}");
 const nsIDOMSettingsManager      = Ci.nsIDOMSettingsManager;
 
 let myGlobal = this;
 
 function SettingsManager()
 {
   this._locks = new Queue();
   if (!("indexedDB" in myGlobal)) {
@@ -254,21 +254,16 @@ SettingsManager.prototype = {
     this._settingsDB.ensureDB(
       function() { lock.createTransactionAndProcess(); },
       function() { dump("ensureDB error cb!\n"); },
       myGlobal );
     this.nextTick(function() { this._open = false; }, lock);
     return lock;
   },
 
-  getLock: function() {
-    dump("WARNING: Use createLock instead of getLock!");
-    return this.createLock();
-  },
-
   receiveMessage: function(aMessage) {
     debug("Settings::receiveMessage: " + aMessage.name);
     let msg = aMessage.json;
 
     switch (aMessage.name) {
       case "Settings:Change:Return:OK":
         debug("Settings:Change:Return:OK");
         if (this._onsettingchange || this._callbacks) {
--- a/dom/settings/SettingsManager.manifest
+++ b/dom/settings/SettingsManager.manifest
@@ -1,6 +1,6 @@
-component {0694f5e0-f777-11e1-a21f-0800200c9a66} SettingsManager.js
-contract @mozilla.org/settingsManager;1 {0694f5e0-f777-11e1-a21f-0800200c9a66}
+component {c40b1c70-00fb-11e2-a21f-0800200c9a66} SettingsManager.js
+contract @mozilla.org/settingsManager;1 {c40b1c70-00fb-11e2-a21f-0800200c9a66}
 category JavaScript-navigator-property mozSettings @mozilla.org/settingsManager;1
 
 component {ef95ddd0-6308-11e1-b86c-0800200c9a66} SettingsManager.js
 contract @mozilla.org/settingsLock;1 {ef95ddd0-6308-11e1-b86c-0800200c9a66}