Bug 1388628 - Disable reusing the selected tab for session restore. r=mikedeboer a=sylvestre
authorDão Gottwald <dao@mozilla.com>
Fri, 11 Aug 2017 14:46:43 +0200
changeset 423501 f7e05dffb1ab4e0b9ed46fa2350c3b5fd4b9efe4
parent 423500 2638feb177dd9104a3887fae2ce05931a6b41d6c
child 423502 f6d3f258b0437feecde76f28c0bd9903303f20fc
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, sylvestre
bugs1388628
milestone56.0
Bug 1388628 - Disable reusing the selected tab for session restore. r=mikedeboer a=sylvestre
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3284,29 +3284,32 @@ var SessionStoreInternal = {
 
     for (var t = 0; t < newTabCount; t++) {
       let tabData = winData.tabs[t];
 
       let userContextId = tabData.userContextId;
       let select = t == selectTab - 1;
       let tab;
 
+      /* Disabled because of bug 1388628:
+
       // Re-use existing selected tab if possible to avoid the overhead of
       // selecting a new tab.
       if (select &&
           tabbrowser.selectedTab.userContextId == userContextId) {
         tab = tabbrowser.selectedTab;
         if (!tabData.pinned) {
           tabbrowser.unpinTab(tab);
         }
         tabbrowser.moveTabToEnd();
         if (aWindow.gMultiProcessBrowser && !tab.linkedBrowser.isRemoteBrowser) {
           tabbrowser.updateBrowserRemoteness(tab.linkedBrowser, true);
         }
       }
+      */
 
       // Add a new tab if needed.
       if (!tab) {
         let createLazyBrowser = restoreTabsLazily && !select && !tabData.pinned;
 
         let url = "about:blank";
         if (createLazyBrowser && tabData.entries && tabData.entries.length) {
           // Let tabbrowser know the future URI because progress listeners won't
@@ -3332,17 +3335,17 @@ var SessionStoreInternal = {
           let leftoverTab = tabbrowser.selectedTab;
           tabbrowser.selectedTab = tab;
           tabbrowser.removeTab(leftoverTab);
         }
 
         // Prepare connection to the host when users hover mouse over this
         // tab. If we're not restoring on demand, we'll prepare connection
         // when we're restoring next tab.
-        if (!tabData.pinned && restoreOnDemand) {
+        if (!select && !tabData.pinned && restoreOnDemand) {
           this.speculativeConnectOnTabHover(tab, url);
         }
       }
 
       tabs.push(tab);
 
       if (tabData.hidden) {
         tabbrowser.hideTab(tab);