Backing out 6d28e030fd7b (bug 1058180) due to causing crashes on desktop on a CLOSED TREE
authorKyle Machulis <kyle@nonpolynomial.com>
Mon, 22 Sep 2014 16:01:50 -0700
changeset 206574 5f06a3b5fd4220cab39dd7e0b42dd51fbe641b26
parent 206573 eebae6301ad39b90d97cf8413bb203d87a6e0c5b
child 206575 4cdc4b9e583231ab88fb69b81da46af971dfa50f
child 206632 eae3a4ef42fc08c24f5e8f184fb77e9d68bbe186
push id27531
push userkwierso@gmail.com
push dateTue, 23 Sep 2014 01:41:36 +0000
treeherdermozilla-central@4cdc4b9e5832 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1058180
milestone35.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
Backing out 6d28e030fd7b (bug 1058180) due to causing crashes on desktop on a CLOSED TREE
b2g/components/B2GAppMigrator.js
b2g/components/B2GComponents.manifest
dom/apps/Webapps.jsm
--- a/b2g/components/B2GAppMigrator.js
+++ b/b2g/components/B2GAppMigrator.js
@@ -22,16 +22,18 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "appsService",
                                    "@mozilla.org/AppsService;1",
                                    "nsIAppsService");
 
 function B2GAppMigrator() {
+  Services.obs.addObserver(this, kMigrationMessageName, false);
+  Services.obs.addObserver(this, "xpcom-shutdown", false);
 }
 
 B2GAppMigrator.prototype = {
   classID:         Components.ID('{7211ece0-b458-4635-9afc-f8d7f376ee95}'),
   QueryInterface:  XPCOMUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
   executeBrowserMigration: function() {
     // The browser db name is hashed the same way everywhere, so it
@@ -112,16 +114,21 @@ B2GAppMigrator.prototype = {
     }
     if (DEBUG) debug("Browser DB copied successfully");
   },
 
   observe: function(subject, topic, data) {
     switch (topic) {
       case kMigrationMessageName:
         this.executeBrowserMigration();
+        Services.obs.removeObserver(this, kMigrationMessageName);
+        break;
+      case "xpcom-shutdown":
+        Services.obs.removeObserver(this, kMigrationMessageName);
+        Services.obs.removeObserver(this, "xpcom-shutdown");
         break;
       default:
         debug("Unhandled topic: " + topic);
         break;
     }
   }
 };
 
--- a/b2g/components/B2GComponents.manifest
+++ b/b2g/components/B2GComponents.manifest
@@ -103,10 +103,10 @@ category command-line-handler m-b2gcmds 
 #endif
 
 # MobileIdentityUIGlue.js
 component {83dbe26a-81f3-4a75-9541-3d0b7ca496b5} MobileIdentityUIGlue.js
 contract @mozilla.org/services/mobileid-ui-glue;1 {83dbe26a-81f3-4a75-9541-3d0b7ca496b5}
 
 # B2GAppMigrator.js
 component {7211ece0-b458-4635-9afc-f8d7f376ee95} B2GAppMigrator.js
-contract @mozilla.org/app-migrator;1 {7211ece0-b458-4635-9afc-f8d7f376ee95}
-
+contract @mozilla.org/b2g-app-migrator;1 {7211ece0-b458-4635-9afc-f8d7f376ee95}
+category profile-after-change B2GAppMigrator @mozilla.org/b2g-app-migrator;1
--- a/dom/apps/Webapps.jsm
+++ b/dom/apps/Webapps.jsm
@@ -656,20 +656,19 @@ this.DOMApplicationRegistry = {
         // We configured a system app but can't find it. That prevents us
         // from starting so we clear our registry to start again from scratch.
         if (!systemAppFound) {
           runUpdate = true;
         }
       } catch(e) {} // getCharPref will throw on non-b2g platforms. That's ok.
 
       if (runUpdate) {
+
         // Run migration before uninstall of core apps happens.
-        var appMigrator = Components.classes["@mozilla.org/app-migrator;1"]
-                           .createInstance(Components.interfaces.nsIObserver);
-        appMigrator.observe(null, "webapps-before-update-merge", null);
+        Services.obs.notifyObservers(null, "webapps-before-update-merge", null);
 
 #ifdef MOZ_WIDGET_GONK
         yield this.installSystemApps();
 #endif
 
         // At first run, install preloaded apps and set up their permissions.
         for (let id in this.webapps) {
           let isPreinstalled = this.installPreinstalledApp(id);