Backed out changeset b3bcf26d4dad (bug 1252831) for xpcshell failures in uriloader/exthandler/tests/unit/test_handlerService.js CLOSED TREE
authorshindli <shindli@mozilla.com>
Fri, 08 Feb 2019 22:57:20 +0200
changeset 458305 3038495b95fce6afbefda1d080acc92eaef963ee
parent 458304 3c3b09d5cadd1ab4c93168f4062c6b2bc5c1310d
child 458306 4e56ef85817af48b9aaea60d9dfbfa56350ee493
push id77793
push usershindli@mozilla.com
push dateFri, 08 Feb 2019 20:59:01 +0000
treeherderautoland@3038495b95fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1252831
milestone67.0a1
backs outb3bcf26d4dadae5a6861db58a42f3a8c42eba9cf
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
Backed out changeset b3bcf26d4dad (bug 1252831) for xpcshell failures in uriloader/exthandler/tests/unit/test_handlerService.js CLOSED TREE
browser/components/nsBrowserGlue.js
browser/locales/en-US/chrome/browser-region/region.properties
mobile/android/chrome/content/browser.js
mobile/locales/en-US/chrome/region.properties
uriloader/exthandler/HandlerService.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2214,17 +2214,17 @@ BrowserGlue.prototype = {
       }
     }
   },
 
   // eslint-disable-next-line complexity
   _migrateUI: function BG__migrateUI() {
     // Use an increasing number to keep track of the current migration state.
     // Completely unrelated to the current Firefox release number.
-    const UI_VERSION = 79;
+    const UI_VERSION = 78;
     const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
 
     let currentUIVersion;
     if (Services.prefs.prefHasUserValue("browser.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } else {
       // This is a new profile, nothing to migrate.
       Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -2583,22 +2583,16 @@ BrowserGlue.prototype = {
         xulStore.removeValue(BROWSER_DOCURL, toolbarId, "currentset");
       }
     }
 
     if (currentUIVersion < 78) {
       Services.prefs.clearUserPref("browser.search.region");
     }
 
-    if (currentUIVersion < 79) {
-      // The handler app service will read this. We need to wait with migrating
-      // until the handler service has started up, so just set a pref here.
-      Services.prefs.setCharPref("browser.handlers.migrations", "30boxes");
-    }
-
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   _checkForDefaultBrowser() {
     // Perform default browser checking.
     if (!ShellService) {
       return;
--- a/browser/locales/en-US/chrome/browser-region/region.properties
+++ b/browser/locales/en-US/chrome/browser-region/region.properties
@@ -4,16 +4,20 @@
 
 # increment this number when anything gets changed in the list below.  This will
 # cause Firefox to re-read these prefs and inject any new handlers into the 
 # profile database.  Note that "new" is defined as "has a different URL"; this
 # means that it's not possible to update the name of existing handler, so 
 # don't make any spelling errors here.
 gecko.handlerService.defaultHandlersVersion=4
 
+# The default set of protocol handlers for webcal:
+gecko.handlerService.schemes.webcal.0.name=30 Boxes
+gecko.handlerService.schemes.webcal.0.uriTemplate=https://30boxes.com/external/widget?refer=ff&url=%s
+
 # The default set of protocol handlers for mailto:
 gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail
 gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s
 gecko.handlerService.schemes.mailto.1.name=Gmail
 gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s
 
 # The default set of protocol handlers for irc:
 gecko.handlerService.schemes.irc.0.name=Mibbit
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -981,17 +981,17 @@ var BrowserApp = {
     GlobalEventDispatcher.dispatch("Passwords:Init", null);
 
     if (this._startupStatus === "upgrade") {
       this._migrateUI();
     }
   },
 
   _migrateUI: function() {
-    const UI_VERSION = 4;
+    const UI_VERSION = 3;
     let currentUIVersion = Services.prefs.getIntPref("browser.migration.version", 0);
     if (currentUIVersion >= UI_VERSION) {
       return;
     }
 
     if (currentUIVersion < 1) {
       // Migrate the "privacy.donottrackheader.value" pref. See bug 1042135.
       if (Services.prefs.prefHasUserValue("privacy.donottrackheader.value")) {
@@ -1050,22 +1050,16 @@ var BrowserApp = {
         Services.prefs.setBoolPref("browser.safebrowsing.phishing.enabled",
                                    false);
         // Should just remove support for the pref entirely, even if it's
         // only in about:config
         Services.prefs.clearUserPref(kOldSafeBrowsingPref);
       }
     }
 
-    if (currentUIVersion < 4) {
-      // The handler app service will read this. We need to wait with migrating
-      // until the handler service has started up, so just set a pref here.
-      Services.prefs.setCharPref("browser.handlers.migrations", "30boxes");
-    }
-
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   // This function returns false during periods where the browser displayed document is
   // different from the browser content document, so user actions and some kinds of viewport
   // updates should be ignored. This period starts when we start loading a new page or
   // switch tabs, and ends when the new browser content document has been drawn and handed
--- a/mobile/locales/en-US/chrome/region.properties
+++ b/mobile/locales/en-US/chrome/region.properties
@@ -4,16 +4,20 @@
 
 # Increment this number when anything gets changed in the list below.  This will
 # cause Firefox to re-read these prefs and inject any new handlers into the
 # profile database.  Note that "new" is defined as "has a different URL"; this
 # means that it's not possible to update the name of existing handler, so
 # don't make any spelling errors here.
 gecko.handlerService.defaultHandlersVersion=3
 
+# The default set of protocol handlers for webcal:
+gecko.handlerService.schemes.webcal.0.name=30 Boxes
+gecko.handlerService.schemes.webcal.0.uriTemplate=https://30boxes.com/external/widget?refer=ff&url=%s
+
 # The default set of protocol handlers for mailto:
 gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail
 gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s
 gecko.handlerService.schemes.mailto.1.name=Gmail
 gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s
 
 # This is the default set of web based feed handlers shown in the reader
 # selection UI
--- a/uriloader/exthandler/HandlerService.js
+++ b/uriloader/exthandler/HandlerService.js
@@ -49,17 +49,16 @@ HandlerService.prototype = {
 
   __storeInitialized: false,
   _ensureStoreInitialized() {
     if (!this.__storeInitialized) {
       this.__storeInitialized = true;
       this.__store.ensureDataReady();
 
       this._injectDefaultProtocolHandlersIfNeeded();
-      this._migrateProtocolHandlersIfNeeded();
 
       Services.obs.notifyObservers(null, "handlersvc-store-initialized");
     }
   },
 
   _dataPostProcessor(data) {
     return data.defaultHandlersVersion ? data : {
       defaultHandlersVersion: {},
@@ -142,76 +141,16 @@ HandlerService.prototype = {
         // URL, the newly added one will be ignored when saving.
         possibleHandlers.appendElement(handlerApp, false);
       }
 
       this.store(protoInfo);
     }
   },
 
-  /**
-   * Execute any migrations. Migrations are defined here for any changes or removals for
-   * existing handlers. Additions are still handled via the localized prefs infrastructure.
-   *
-   * This depends on the browser.handlers.migrations pref being set by migrateUI in
-   * nsBrowserGlue (for Fx Desktop) or similar mechanisms for other products.
-   * This is a comma-separated list of identifiers of migrations that need running.
-   * This avoids both re-running older migrations and keeping an additional
-   * pref around permanently.
-   */
-  _migrateProtocolHandlersIfNeeded() {
-    const kMigrations = {
-      "30boxes": () => {
-        const k30BoxesRegex = /^https?:\/\/(?:www\.)?30boxes.com\/external\/widget/i;
-        let webcalHandler = gExternalProtocolService.getProtocolHandlerInfo("webcal");
-        if (this.exists(webcalHandler)) {
-          this.fillHandlerInfo(webcalHandler, "");
-          let shouldStore = false;
-          // First remove 30boxes from possible handlers.
-          let handlers = webcalHandler.possibleApplicationHandlers;
-          for (let i = handlers.length - 1; i >= 0; i--) {
-            let app = handlers.queryElementAt(i, Ci.nsIHandlerApp);
-            if (app instanceof Ci.nsIWebHandlerApp &&
-                k30BoxesRegex.test(app.uriTemplate)) {
-              shouldStore = true;
-              handlers.removeElementAt(i);
-            }
-          }
-          // Then remove as a preferred handler.
-          if (webcalHandler.preferredApplicationHandler) {
-            let app = webcalHandler.preferredApplicationHandler;
-            if (app instanceof Ci.nsIWebHandlerApp &&
-                k30BoxesRegex.test(app.uriTemplate)) {
-              webcalHandler.preferredApplicationHandler = null;
-              shouldStore = true;
-            }
-          }
-          // Then store, if we changed anything.
-          if (shouldStore) {
-            this.store(webcalHandler);
-          }
-        }
-      },
-    };
-    let migrationsToRun = Services.prefs.getCharPref("browser.handlers.migrations", "");
-    migrationsToRun = migrationsToRun ? migrationsToRun.split(",") : [];
-    for (let migration of migrationsToRun) {
-      migration.trim();
-      try {
-        kMigrations[migration]();
-      } catch (ex) {
-        Cu.reportError(ex);
-      }
-    }
-
-    if (migrationsToRun.length) {
-      Services.prefs.clearUserPref("browser.handlers.migrations");
-    }
-  },
-
   _onDBChange() {
     return (async () => {
       if (this.__store) {
         await this.__store.finalize();
       }
       this.__store = null;
       this.__storeInitialized = false;
     })().catch(Cu.reportError);