Bug 1097697 - Backout changeset 126811256577 to fix talos regression r=me
authorTim Taubert <ttaubert@mozilla.com>
Sun, 23 Nov 2014 11:37:20 +0100
changeset 216975 fc4f585ae3a16fe1babf7d6ba59ba0f5274cf15d
parent 216974 80426d13feca88f7c2ec7200d04db7e9d05c3e15
child 216976 c294ed0b5502b2a904e8b2f985aaa85172b42870
push id10105
push userttaubert@mozilla.com
push dateSun, 23 Nov 2014 10:37:39 +0000
treeherderfx-team@fc4f585ae3a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1097697
milestone36.0a1
Bug 1097697 - Backout changeset 126811256577 to fix talos regression r=me
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -643,18 +643,31 @@ let SessionStoreInternal = {
           let tabData = browser.__SS_data;
 
           // wall-paper fix for bug 439675: make sure that the URL to be loaded
           // is always visible in the address bar
           let activePageData = tabData.entries[tabData.index - 1] || null;
           let uri = activePageData ? activePageData.url || null : null;
           browser.userTypedValue = uri;
 
-          // Update tab label and icon again after the tab history was updated.
-          this.updateTabLabelAndIcon(tab, tabData);
+          // If the page has a title, set it.
+          if (activePageData) {
+            if (activePageData.title) {
+              tab.label = activePageData.title;
+              tab.crop = "end";
+            } else if (activePageData.url != "about:blank") {
+              tab.label = activePageData.url;
+              tab.crop = "center";
+            }
+          }
+
+          // Restore the tab icon.
+          if ("image" in tabData) {
+            win.gBrowser.setIcon(tab, tabData.image);
+          }
 
           let event = win.document.createEvent("Events");
           event.initEvent("SSTabRestoring", true, false);
           tab.dispatchEvent(event);
         }
         break;
       case "SessionStore:restoreTabContentStarted":
         if (this.isCurrentEpoch(browser, aMessage.data.epoch)) {
@@ -1855,36 +1868,16 @@ let SessionStoreInternal = {
   },
 
   persistTabAttribute: function ssi_persistTabAttribute(aName) {
     if (TabAttributes.persist(aName)) {
       this.saveStateDelayed();
     }
   },
 
-  updateTabLabelAndIcon(tab, tabData) {
-    let activePageData = tabData.entries[tabData.index - 1] || null;
-
-    // If the page has a title, set it.
-    if (activePageData) {
-      if (activePageData.title) {
-        tab.label = activePageData.title;
-        tab.crop = "end";
-      } else if (activePageData.url != "about:blank") {
-        tab.label = activePageData.url;
-        tab.crop = "center";
-      }
-    }
-
-    // Restore the tab icon.
-    if ("image" in tabData) {
-      tab.ownerDocument.defaultView.gBrowser.setIcon(tab, tabData.image);
-    }
-  },
-
   /**
    * Restores the session state stored in LastSession. This will attempt
    * to merge data into the current session. If a window was opened at startup
    * with pinned tab(s), then the remaining data from the previous session for
    * that window will be opened into that winddow. Otherwise new windows will
    * be opened.
    */
   restoreLastSession: function ssi_restoreLastSession() {
@@ -2547,27 +2540,19 @@ let SessionStoreInternal = {
     // If provided, set the selected tab.
     if (aSelectTab > 0 && aSelectTab <= aTabs.length) {
       tabbrowser.selectedTab = aTabs[aSelectTab - 1];
 
       // Update the window state in case we shut down without being notified.
       this._windows[aWindow.__SSi].selected = aSelectTab;
     }
 
-    // If we restore the selected tab, make sure it goes first.
-    let selectedIndex = aTabs.indexOf(tabbrowser.selectedTab);
-    if (selectedIndex > -1) {
-      this.restoreTab(tabbrowser.selectedTab, aTabData[selectedIndex]);
-    }
-
     // Restore all tabs.
     for (let t = 0; t < aTabs.length; t++) {
-      if (t != selectedIndex) {
-        this.restoreTab(aTabs[t], aTabData[t]);
-      }
+      this.restoreTab(aTabs[t], aTabData[t]);
     }
   },
 
   // Restores the given tab state for a given tab.
   restoreTab(tab, tabData, options = {}) {
     let restoreImmediately = options.restoreImmediately;
     let loadArguments = options.loadArguments;
     let browser = tab.linkedBrowser;
@@ -2663,20 +2648,16 @@ let SessionStoreInternal = {
       formdata: tabData.formdata || null,
       disallow: tabData.disallow || null,
       pageStyle: tabData.pageStyle || null
     });
 
     browser.messageManager.sendAsyncMessage("SessionStore:restoreHistory",
                                             {tabData: tabData, epoch: epoch});
 
-    // Update tab label and icon to show something
-    // while we wait for the messages to be processed.
-    this.updateTabLabelAndIcon(tab, tabData);
-
     // Restore tab attributes.
     if ("attributes" in tabData) {
       TabAttributes.set(tab, tabData.attributes);
     }
 
     // This could cause us to ignore MAX_CONCURRENT_TAB_RESTORES a bit, but
     // it ensures each window will have its selected tab loaded.
     if (restoreImmediately || tabbrowser.selectedBrowser == browser || loadArguments) {