Bug 1261842 - When putting the initial tab into the restored background state, flip it to non-remote. r=mikedeboer
☠☠ backed out by ad32bf1994e9 ☠ ☠
authorMike Conley <mconley@mozilla.com>
Fri, 03 Jun 2016 14:12:21 -0400 (2016-06-03)
changeset 305479 2a1acfd17baf3a269719c70cdd5b273e8b344b41
parent 305478 968e7b3b73fbc288cdda9b0ba82857065e00d956
child 305480 d6ffc9db53461550f8965e3587244b5b9d68eab6
push id79584
push usermconley@mozilla.com
push dateTue, 19 Jul 2016 02:39:59 +0000 (2016-07-19)
treeherdermozilla-inbound@bb6c6889b802 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1261842
milestone50.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 1261842 - When putting the initial tab into the restored background state, flip it to non-remote. r=mikedeboer MozReview-Commit-ID: BX8XbYjJHGf
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3209,16 +3209,28 @@ var SessionStoreInternal = {
 
     let restoreImmediately = options.restoreImmediately;
     let loadArguments = options.loadArguments;
     let browser = tab.linkedBrowser;
     let window = tab.ownerGlobal;
     let tabbrowser = window.gBrowser;
     let forceOnDemand = options.forceOnDemand;
 
+    // If the browser we're attempting to restore happens to be
+    // remote, we need to flip it back to non-remote if it's going
+    // to go into the pending background tab state. This is to make
+    // sure that the background tab can't crash if it hasn't yet
+    // been restored. Normally, when a window is restored, the tabs
+    // that SessionStore inserts are non-remote - but the initial
+    // browser is, by default, remote, so this check and flip is
+    // mostly for that case.
+    if (browser.isRemoteBrowser && (!restoreImmediately || forceOnDemand)) {
+      tabbrowser.updateBrowserRemoteness(browser, false);
+    }
+
     // Increase the busy state counter before modifying the tab.
     this._setWindowStateBusy(window);
 
     // It's important to set the window state to dirty so that
     // we collect their data for the first time when saving state.
     DirtyWindows.add(window);
 
     // In case we didn't collect/receive data for any tabs yet we'll have to