Bug 1331467: Enable chrome.storage.sync by default, r=kmag
☠☠ backed out by 68abeaaf3a2e ☠ ☠
authorEthan Glasser-Camp <eglassercamp@mozilla.com>
Wed, 18 Jan 2017 11:44:17 -0500
changeset 358479 442d75009799000429ce0f0b012dbccda63e37d4
parent 358478 c69a94671a4afc639d5969b7a744ba4ae6e0b239
child 358480 0d944258ba3ff8ecab9d0fce7b1c211d1985d52b
push id10621
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 16:02:43 +0000
treeherdermozilla-aurora@dca7b42e6c67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1331467
milestone53.0a1
Bug 1331467: Enable chrome.storage.sync by default, r=kmag MozReview-Commit-ID: 76wXwJGobIt
modules/libpref/init/all.js
toolkit/components/extensions/ExtensionStorageSync.jsm
toolkit/components/extensions/test/xpcshell/test_ext_storage.js
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5449,23 +5449,18 @@ pref("toolkit.pageThumbs.screenSizeDivis
 pref("toolkit.pageThumbs.minWidth", 0);
 pref("toolkit.pageThumbs.minHeight", 0);
 
 pref("webextensions.tests", false);
 
 // 16MB default non-parseable upload limit for requestBody.raw.bytes
 pref("webextensions.webRequest.requestBodyMaxRawBytes", 16777216);
 
-// This functionality is still experimental
-pref("webextensions.storage.sync.enabled", false);
-#ifdef RELEASE_OR_BETA
+pref("webextensions.storage.sync.enabled", true);
 pref("webextensions.storage.sync.serverURL", "https://webextensions.settings.services.mozilla.com/v1");
-#else
-pref("webextensions.storage.sync.serverURL", "https://webextensions.dev.mozaws.net/v1");
-#endif
 
 // Allow customization of the fallback directory for file uploads
 pref("dom.input.fallbackUploadDir", "");
 
 // Turn rewriting of youtube embeds on/off
 pref("plugins.rewrite_youtube_embeds", true);
 
 // Don't hide Flash from navigator.plugins when it is click-to-activate
--- a/toolkit/components/extensions/ExtensionStorageSync.jsm
+++ b/toolkit/components/extensions/ExtensionStorageSync.jsm
@@ -14,18 +14,17 @@ this.EXPORTED_SYMBOLS = ["ExtensionStora
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 const Cr = Components.results;
 const global = this;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 const KINTO_PROD_SERVER_URL = "https://webextensions.settings.services.mozilla.com/v1";
-const KINTO_DEV_SERVER_URL = "https://webextensions.dev.mozaws.net/v1";
-const KINTO_DEFAULT_SERVER_URL = AppConstants.RELEASE_OR_BETA ? KINTO_PROD_SERVER_URL : KINTO_DEV_SERVER_URL;
+const KINTO_DEFAULT_SERVER_URL = KINTO_PROD_SERVER_URL;
 
 const STORAGE_SYNC_ENABLED_PREF = "webextensions.storage.sync.enabled";
 const STORAGE_SYNC_SERVER_URL_PREF = "webextensions.storage.sync.serverURL";
 const STORAGE_SYNC_SCOPE = "sync:addon_storage";
 const STORAGE_SYNC_CRYPTO_COLLECTION_NAME = "storage-sync-crypto";
 const STORAGE_SYNC_CRYPTO_KEYRING_RECORD_ID = "keys";
 const FXA_OAUTH_OPTIONS = {
   scope: STORAGE_SYNC_SCOPE,
@@ -64,17 +63,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://services-common/observers.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
                                   "resource://gre/modules/Sqlite.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "KeyRingEncryptionRemoteTransformer",
                                   "resource://services-sync/engines/extension-storage.js");
 XPCOMUtils.defineLazyPreferenceGetter(this, "prefPermitsStorageSync",
-                                      STORAGE_SYNC_ENABLED_PREF, false);
+                                      STORAGE_SYNC_ENABLED_PREF, true);
 XPCOMUtils.defineLazyPreferenceGetter(this, "prefStorageSyncServerURL",
                                       STORAGE_SYNC_SERVER_URL_PREF,
                                       KINTO_DEFAULT_SERVER_URL);
 
 /* globals prefPermitsStorageSync, prefStorageSyncServerURL */
 
 // Map of Extensions to Set<Contexts> to track contexts that are still
 // "live" and use storage.sync.
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage.js
@@ -87,27 +87,29 @@ add_task(function* test_config_flag_need
         browser.storage.sync[testDef.method](...testDef.args),
         "Please set webextensions.storage.sync.enabled to true in about:config",
         `storage.sync.${testDef.method} is behind a flag`));
     });
 
     Promise.all(promises).then(() => browser.test.notifyPass("flag needed"));
   }
 
+  Preferences.set(STORAGE_SYNC_PREF, false);
   ok(!Preferences.get(STORAGE_SYNC_PREF));
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: ["storage"],
     },
     background: `(${background})(${checkGetImpl})`,
   });
 
   yield extension.startup();
   yield extension.awaitFinish("flag needed");
   yield extension.unload();
+  Preferences.reset(STORAGE_SYNC_PREF);
 });
 
 add_task(function* test_reloading_extensions_works() {
   // Just some random extension ID that we can re-use
   const extensionId = "my-extension-id@1";
 
   function loadExtension() {
     function background() {