Bug 785233 - Don't overwrite indexeddb property. r=mrbkap
authorGregor Wagner <gwagner@mozilla.com>
Wed, 29 Aug 2012 15:52:48 -0300
changeset 105828 706174d31a02090effd97222dd174dbf2a2954c5
parent 105827 f8254a69dff0c1b4843524947b045f8caf8f5176
child 105829 7bf95bb092331b1db96ba9d561400fcdfb9f09d6
child 105861 1dce4807ad0182d424b296815de85f3de884ec29
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersmrbkap
bugs785233
milestone18.0a1
Bug 785233 - Don't overwrite indexeddb property. r=mrbkap
dom/settings/SettingsManager.js
--- a/dom/settings/SettingsManager.js
+++ b/dom/settings/SettingsManager.js
@@ -212,18 +212,20 @@ const SETTINGSMANAGER_CONTRACTID = "@moz
 const SETTINGSMANAGER_CID        = Components.ID("{dd9f5380-a454-11e1-b3dd-0800200c9a66}");
 const nsIDOMSettingsManager      = Ci.nsIDOMSettingsManager;
 
 let myGlobal = this;
 
 function SettingsManager()
 {
   this._locks = new Queue();
-  var idbManager = Components.classes["@mozilla.org/dom/indexeddb/manager;1"].getService(Ci.nsIIndexedDatabaseManager);
-  idbManager.initWindowless(myGlobal);
+  if (!("indexedDB" in myGlobal)) {
+    let idbManager = Components.classes["@mozilla.org/dom/indexeddb/manager;1"].getService(Ci.nsIIndexedDatabaseManager);
+    idbManager.initWindowless(myGlobal);
+  }
   this._settingsDB = new SettingsDB();
   this._settingsDB.init(myGlobal);
 }
 
 SettingsManager.prototype = {
   _onsettingchange: null,
   _callbacks: null,