Bug 1047603 - Fix passing xul:tab in the initialization of a new e10s window. r=Mossop.

We need to force the initial browser window to be remote right away if the browser
being torn into a new window is remote.

--HG--
extra : rebase_source : e7a5b90139d04a86edcc0f2349a05cfb77d73c03
This commit is contained in:
Mike Conley 2015-01-14 14:22:01 -05:00
parent d60724b6fe
commit 0bc0f3a106

View File

@ -1193,13 +1193,29 @@ var gBrowserInit = {
else if (uriToLoad instanceof XULElement) {
// swap the given tab with the default about:blank tab and then close
// the original tab in the other window.
let tabToOpen = uriToLoad;
// Stop the about:blank load
gBrowser.stop();
// make sure it has a docshell
gBrowser.docShell;
gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, uriToLoad);
// If the browser that we're swapping in was remote, then we'd better
// be able to support remote browsers, and then make our selectedTab
// remote.
try {
if (tabToOpen.linkedBrowser.isRemoteBrowser) {
if (!gMultiProcessBrowser) {
throw new Error("Cannot drag a remote browser into a window " +
"without the remote tabs load context.");
}
gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
}
gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, tabToOpen);
} catch(e) {
Cu.reportError(e);
}
}
// window.arguments[2]: referrer (nsIURI)
// [3]: postData (nsIInputStream)