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-24 15:08:30 +00:00
Родитель 4f48f9317d
Коммит 9d6013aa66
5 изменённых файлов: 14 добавлений и 19 удалений

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

@ -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);

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

@ -4,7 +4,7 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>pageloader@mozilla.org</em:id>
<em:version>1.0.13</em:version>
<em:version>1.0.15</em:version>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>

Двоичный файл не отображается.

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

@ -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);
/**