Bug 1147911 Part 3: Add remote type parameter to forceInitialBrowserRemote. r=gijs

Also change talos pageloader.js to force type to match test URLs.
This commit is contained in:
Bob Owen 2016-11-17 15:48:52 +00:00
Родитель 8c7b20c42d
Коммит c9055e97ff
3 изменённых файлов: 13 добавлений и 18 удалений

Просмотреть файл

@ -4209,10 +4209,10 @@ var XULBrowserWindow = {
// unsupported
},
forceInitialBrowserRemote: function() {
forceInitialBrowserRemote: function(aRemoteType) {
let initBrowser =
document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
return initBrowser.frameLoader.tabParent;
gBrowser.updateBrowserRemoteness(initBrowser, true, aRemoteType, null);
},
forceInitialBrowserNonRemote: function(aOpener) {

Просмотреть файл

@ -221,10 +221,6 @@ function plInit() {
var browserLoadFunc = function (ev) {
browserWindow.removeEventListener('load', browserLoadFunc, true);
function firstPageCanLoadAsRemote() {
return E10SUtils.canLoadURIInProcess(pageUrls[0], Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
}
// do this half a second after load, because we need to be
// able to resize the window and not have it get clobbered
// by the persisted values
@ -232,20 +228,20 @@ function plInit() {
// For e10s windows, since bug 1261842, the initial browser is remote unless
// it attempts to browse to a URI that should be non-remote (landed at bug 1047603).
//
// However, when it loads such URI and reinitializes as non-remote, we lose the
// load listener and the injected tpRecordTime.
//
// The preferred pageloader behaviour in e10s is to run the pages as as remote,
// so if the page can load as remote, we will load it as remote.
// However, when it loads a URI that requires a different remote type,
// we lose the load listener and the injected tpRecordTime.remote,
//
// It also probably means that per test (or, in fact, per pageloader browser
// instance which adds the load listener and injects tpRecordTime), all the
// pages should be able to load in the same mode as the initial page - due
// to this reinitialization on the switch.
if (browserWindow.gMultiProcessBrowser) {
if (!firstPageCanLoadAsRemote())
let remoteType = E10SUtils.getRemoteTypeForURI(pageUrls[0], true);
if (remoteType) {
browserWindow.XULBrowserWindow.forceInitialBrowserRemote(remoteType);
} else {
browserWindow.XULBrowserWindow.forceInitialBrowserNonRemote(null);
// Implicit else: initial browser in e10s is remote by default.
}
}
browserWindow.resizeTo(winWidth, winHeight);

Просмотреть файл

@ -43,12 +43,11 @@ interface nsIXULBrowserWindow : nsISupports
in boolean isAppTab);
/**
* Find the initial browser of the window and set its remote attribute.
* This can be used to ensure that there is a remote browser in a new
* window when it first spawns.
*
* Find the initial browser of the window and set its remote attributes.
* This can be used to ensure that there is a browser in a new window of the
* correct type when it first spawns.
*/
nsITabParent forceInitialBrowserRemote();
void forceInitialBrowserRemote(in AString aRemoteType);
void forceInitialBrowserNonRemote(in mozIDOMWindowProxy openerWindow);
/**