Bug 1271607 - Pinned tabs should not restore as non-remote. r?mikedeboer draft
authorMike Conley <mconley@mozilla.com>
Wed, 29 Jun 2016 13:49:57 -0400
changeset 382451 40f3d9326e0d9df0e1959817785b2a6f6a1e06e2
parent 382301 dc77b6514b806fab46ca71c91d22d520612d40e0
child 524193 0b4424b3da29cc34fd48e4911f3bcd2763abf6ea
push id21722
push usermconley@mozilla.com
push dateWed, 29 Jun 2016 17:51:17 +0000
reviewersmikedeboer
bugs1271607
milestone50.0a1
Bug 1271607 - Pinned tabs should not restore as non-remote. r?mikedeboer App tabs load immediately, and so there's no point in causing the remoteness flipping machinery to kick off by making the pinned tabs non-remote by default. MozReview-Commit-ID: 48O2mJSHurr
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -2928,20 +2928,24 @@ var SessionStoreInternal = {
     let numVisibleTabs = 0;
 
     for (var t = 0; t < newTabCount; t++) {
       // When trying to restore into existing tab, we also take the userContextId
       // into account if present.
       let userContextId = winData.tabs[t].userContextId;
       let reuseExisting = t < openTabCount &&
                           (tabbrowser.tabs[t].getAttribute("usercontextid") == (userContextId || ""));
+      // If the tab is pinned, then we'll be loading it right away, and
+      // there's no need to cause a remoteness flip by loading it initially
+      // non-remote.
+      let forceNotRemote = !winData.tabs[t].pinned;
       let tab = reuseExisting ? tabbrowser.tabs[t] :
                                 tabbrowser.addTab("about:blank",
                                                   {skipAnimation: true,
-                                                   forceNotRemote: true,
+                                                   forceNotRemote,
                                                    userContextId});
 
       // If we inserted a new tab because the userContextId didn't match with the
       // open tab, even though `t < openTabCount`, we need to remove that open tab
       // and put the newly added tab in its place.
       if (!reuseExisting && t < openTabCount) {
         tabbrowser.removeTab(tabbrowser.tabs[t]);
         tabbrowser.moveTabTo(tab, t);