Bug 1625513 - Part 1: Perform onMayChangeProcess handling within DocumentLoadListener, r=mattwoodrow,pbone,droeh,necko-reviewers,valentin

When I first added this method last year, I added it in JS, handled from within
SessionStore.jsm, as that was the easiest place to do it. Now that
DocumentLoadListener exists, it makes more sense to handle this logic directly
from within that code.

Many parts of the process switch are still handled by frontend JS, such as
selecting remote types, and performing toplevel process switches.

Differential Revision: https://phabricator.services.mozilla.com/D68594
This commit is contained in:
Nika Layzell
2020-04-20 16:57:01 +00:00
parent fcb0847341
commit e5267e854c
12 changed files with 302 additions and 374 deletions

View File

@@ -2052,6 +2052,41 @@
}
return origins;
}
get canPerformProcessSwitch() {
return this.getTabBrowser() != null;
}
performProcessSwitch(
remoteType,
redirectLoadSwitchId,
replaceBrowsingContext
) {
return this.getTabBrowser().performProcessSwitch(
this,
remoteType,
redirectLoadSwitchId,
replaceBrowsingContext
);
}
getRemoteTypeForPrincipal(
principal,
remoteTabs,
remoteSubframes,
preferredRemoteType,
currentPrincipal,
isSubframe
) {
return E10SUtils.getRemoteTypeForPrincipal(
principal,
remoteTabs,
remoteSubframes,
preferredRemoteType,
currentPrincipal,
isSubframe
);
}
}
MozXULElement.implementCustomInterface(MozBrowser, [Ci.nsIBrowser]);