Bug 753289 - Pre: rename WEAVE_SYNC_PREFS to PREF_SYNC_PREFS_PREFIX.
authorRichard Newman <rnewman@mozilla.com>
Thu, 10 Sep 2015 17:33:50 +0100
changeset 294278 4378a00214c5b591c4c4dce77e03a87619539f64
parent 294277 716d75dec80535b1a0f1c45badabd5f72c39bac2
child 294279 06f396c07ac9ae10158eec2834faf4d5febbb167
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs753289
milestone43.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 753289 - Pre: rename WEAVE_SYNC_PREFS to PREF_SYNC_PREFS_PREFIX.
services/sync/modules/engines/prefs.js
--- a/services/sync/modules/engines/prefs.js
+++ b/services/sync/modules/engines/prefs.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ['PrefsEngine', 'PrefRec'];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-const WEAVE_SYNC_PREFS = "services.sync.prefs.sync.";
+const PREF_SYNC_PREFS_PREFIX = "services.sync.prefs.sync.";
 
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://gre/modules/LightweightThemeManager.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
@@ -81,26 +81,26 @@ PrefStore.prototype = {
     if (!this.__prefs)
       this.__prefs = new Preferences();
     return this.__prefs;
   },
 
   _getSyncPrefs: function _getSyncPrefs() {
     let syncPrefs = Cc["@mozilla.org/preferences-service;1"]
                       .getService(Ci.nsIPrefService)
-                      .getBranch(WEAVE_SYNC_PREFS)
+                      .getBranch(PREF_SYNC_PREFS_PREFIX)
                       .getChildList("", {});
     // Also sync preferences that determine which prefs get synced.
     return syncPrefs.concat(
-      syncPrefs.map(function (pref) { return WEAVE_SYNC_PREFS + pref; }));
+      syncPrefs.map(function (pref) { return PREF_SYNC_PREFS_PREFIX + pref; }));
   },
 
   _isSynced: function _isSyncedPref(pref) {
-    return (pref.indexOf(WEAVE_SYNC_PREFS) == 0)
-            || this._prefs.get(WEAVE_SYNC_PREFS + pref, false);
+    return (pref.indexOf(PREF_SYNC_PREFS_PREFIX) == 0)
+            || this._prefs.get(PREF_SYNC_PREFS_PREFIX + pref, false);
   },
 
   _getAllPrefs: function () {
     let values = {};
     for each (let pref in this._getSyncPrefs()) {
       if (this._isSynced(pref)) {
         // Missing prefs get the null value.
         values[pref] = this._prefs.get(pref, null);
@@ -236,18 +236,18 @@ PrefTracker.prototype = {
 
     switch (topic) {
       case "profile-before-change":
         this.stopTracking();
         break;
       case "nsPref:changed":
         // Trigger a sync for MULTI-DEVICE for a change that determines
         // which prefs are synced or a regular pref change.
-        if (data.indexOf(WEAVE_SYNC_PREFS) == 0 ||
-            this._prefs.get(WEAVE_SYNC_PREFS + data, false)) {
+        if (data.indexOf(PREF_SYNC_PREFS_PREFIX) == 0 ||
+            this._prefs.get(PREF_SYNC_PREFS_PREFIX + data, false)) {
           this.score += SCORE_INCREMENT_XLARGE;
           this.modified = true;
           this._log.trace("Preference " + data + " changed");
         }
         break;
     }
   }
 };