Bug 930970 - add nullcheck because of bug 938694 and flushing, to ensure the migration works correctly, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 14 Nov 2013 19:42:36 +0100
changeset 155154 6b335ebfebd96bc75f7c5babde2c403347c0058d
parent 155153 c09869a048828e92809958e9e402a2362e21aebe
child 155155 8c20a3bb8b818680e4b8851c67bc67ec4af8f0d8
child 156045 d8173efa5e8c1cbe12b8e967dd3e0c70b8a85c5a
push id25664
push useremorley@mozilla.com
push dateMon, 18 Nov 2013 10:56:38 +0000
treeherdermozilla-central@8c20a3bb8b81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs930970, 938694
milestone28.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 930970 - add nullcheck because of bug 938694 and flushing, to ensure the migration works correctly, r=jaws
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1301,31 +1301,39 @@ BrowserGlue.prototype = {
 
     // No version check for this as this code should run until we have Australis everywhere:
     if (wasCustomizedAndOnAustralis) {
       // This profile's been on australis! If it's missing the back/fwd button
       // or go/stop/reload button, then put them back:
       let currentsetResource = this._rdf.GetResource("currentset");
       let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
       let currentset = this._getPersist(toolbarResource, currentsetResource);
-      if (currentset.indexOf("unified-back-forward-button") == -1) {
-        currentset = currentset.replace("urlbar-container",
-                                        "unified-back-forward-button,urlbar-container");
+      let oldCurrentset = currentset;
+      if (currentset) {
+        if (currentset.indexOf("unified-back-forward-button") == -1) {
+          currentset = currentset.replace("urlbar-container",
+                                          "unified-back-forward-button,urlbar-container");
+        }
+        if (currentset.indexOf("reload-button") == -1) {
+          currentset = currentset.replace("urlbar-container", "urlbar-container,reload-button");
+        }
+        if (currentset.indexOf("stop-button") == -1) {
+          currentset = currentset.replace("reload-button", "reload-button,stop-button");
+        }
       }
-      if (currentset.indexOf("reload-button") == -1) {
-        currentset = currentset.replace("urlbar-container", "urlbar-container,reload-button");
-      }
-      if (currentset.indexOf("stop-button") == -1) {
-        currentset = currentset.replace("reload-button", "reload-button,stop-button");
-      }
-      this._setPersist(toolbarResource, currentsetResource, currentset);
       Services.prefs.clearUserPref("browser.uiCustomization.state");
 
+      if (oldCurrentset != currentset) {
+        this._setPersist(toolbarResource, currentsetResource, currentset);
+      }
       // If we don't have anything else to do, we can bail here:
       if (currentUIVersion >= UI_VERSION) {
+        if (this._dirty) {
+          this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
+        }
         delete this._rdf;
         delete this._dataSource;
         return;
       }
     }
 
 
     this._dirty = false;