Bug 1392929 - Temporary Fix for contentPrefService removal. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Mon, 02 Oct 2017 16:37:03 +0200
changeset 29080 0ca324fbb10640c93c41c6284ef81f855cb87bc1
parent 29079 5ee768e3a01b47060e05f956bacc5c8c4ff2a618
child 29081 763550197515c986ef8d8b958cb4037371ededa0
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1392929
Bug 1392929 - Temporary Fix for contentPrefService removal. r=IanN This is just a workaround to avoid js errors during startup until a final fix is ready.
suite/common/dataman/dataman.js
suite/common/viewZoomOverlay.js
--- a/suite/common/dataman/dataman.js
+++ b/suite/common/dataman/dataman.js
@@ -50,17 +50,17 @@ var gDataman = {
       this.debug = Services.prefs.getBoolPref("data_manager.debug");
     }
     catch (e) {}
     this.bundle = document.getElementById("datamanBundle");
 
     Services.obs.addObserver(this, "cookie-changed", false);
     Services.obs.addObserver(this, "perm-changed", false);
     Services.obs.addObserver(this, "passwordmgr-storage-changed", false);
-    Services.contentPrefs.addObserver(null, this);
+    // Services.contentPrefs.addObserver(null, this);
     Services.obs.addObserver(this, "satchel-storage-changed", false);
     Services.obs.addObserver(this, "dom-storage-changed", false);
     Services.obs.addObserver(this, "dom-storage2-changed", false);
 
     this.timer = Components.classes["@mozilla.org/timer;1"]
                            .createInstance(Components.interfaces.nsITimer);
 
     gTabs.initialize();
@@ -72,17 +72,17 @@ var gDataman = {
       this.loadView(window.arguments[0])
     }
   },
 
   shutdown: function dataman_shutdown() {
     Services.obs.removeObserver(this, "cookie-changed");
     Services.obs.removeObserver(this, "perm-changed");
     Services.obs.removeObserver(this, "passwordmgr-storage-changed");
-    Services.contentPrefs.removeObserver(null, this);
+    // Services.contentPrefs.removeObserver(null, this);
     Services.obs.removeObserver(this, "satchel-storage-changed");
     Services.obs.removeObserver(this, "dom-storage-changed");
     Services.obs.removeObserver(this, "dom-storage2-changed");
 
     gDomains.shutdown();
   },
 
   loadView: function dataman_loadView(aView) {
@@ -254,17 +254,17 @@ var gDomains = {
 
     this.selectfield = document.getElementById("typeSelect");
     this.searchfield = document.getElementById("domainSearch");
 
     // global "domain"
     this.domainObjects["*"] = {title: "*",
                                displayTitle: "*",
                                hasPermissions: true,
-                               hasPreferences: Services.contentPrefs.getPrefs(null, null).enumerator.hasMoreElements(),
+//                               hasPreferences: Services.contentPrefs.getPrefs(null, null).enumerator.hasMoreElements(),
                                hasFormData: true};
     this.search("");
     if (!gDataman.viewToLoad.length)
       this.tree.view.selection.select(0);
 
     let loaderInstance;
 
     function nextStep() {
--- a/suite/common/viewZoomOverlay.js
+++ b/suite/common/viewZoomOverlay.js
@@ -7,17 +7,18 @@
 // One of the possible values for the mousewheel.* preferences.
 // From nsEventStateManager.cpp.
 const MOUSE_SCROLL_ZOOM = 3;
 
 /**
  * Controls the "full zoom" setting and its site-specific preferences.
  */
 var FullZoom = FullZoom || {
-  contentPrefs: Services.contentPrefs.QueryInterface(Components.interfaces.nsIContentPrefService2),
+  contentPrefs: Components.classes["@mozilla.org/content-pref/service;1"]
+                          .getService(Components.interfaces.nsIContentPrefService2),
 
   // Identifies the setting in the content prefs database.
   name: "browser.content.full-zoom",
 
   // The global value (if any) for the setting. Asynchronously loaded from the
   // service when first requested, then updated by the pref change listener as
   // it changes. If there is no global value, then this should be undefined.
   globalValue: undefined,