Bug 1618445 - pt 6. Add some logging to shouldLoadUri r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D66525

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Paul Bone 2020-03-20 03:17:16 +00:00
Родитель 21a864adbb
Коммит b23a50a475
1 изменённых файлов: 25 добавлений и 17 удалений

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

@ -822,19 +822,21 @@ var E10SUtils = {
shouldLoadURIInThisProcess(aURI, aRemoteSubframes) {
let remoteType = Services.appinfo.remoteType;
return (
remoteType ==
this.getRemoteTypeForURIObject(
aURI,
/* remote */ true,
aRemoteSubframes,
remoteType
)
let wantRemoteType = this.getRemoteTypeForURIObject(
aURI,
/* remote */ true,
aRemoteSubframes,
remoteType
);
this.log().info(
`shouldLoadURIInThisProcess: have ${remoteType} want ${wantRemoteType}`
);
return remoteType == wantRemoteType;
},
shouldLoadURI(aDocShell, aURI, aHasPostData) {
let { useRemoteSubframes } = aDocShell;
this.log().debug(`shouldLoadURI(${this._uriStr(aURI)})`);
// Inner frames should always load in the current process
// XXX(nika): Handle shouldLoadURI-triggered process switches for remote
@ -886,32 +888,38 @@ var E10SUtils = {
!aDocShell.awaitingLargeAlloc &&
isOnlyToplevelBrowsingContext
) {
this.log().info(
"returning false to throw away large allocation process\n"
);
return false;
}
// Allow history load if loaded in this process before.
let requestedIndex = sessionHistory.legacySHistory.requestedIndex;
if (requestedIndex >= 0) {
this.log().debug("Checking history case\n");
if (
sessionHistory.legacySHistory.getEntryAtIndex(requestedIndex)
.loadedInThisProcess
) {
this.log().info("History entry loaded in this process");
return true;
}
// If not originally loaded in this process allow it if the URI would
// normally be allowed to load in this process by default.
let remoteType = Services.appinfo.remoteType;
return (
remoteType ==
this.getRemoteTypeForURIObject(
aURI,
true,
useRemoteSubframes,
remoteType,
webNav.currentURI
)
let wantRemoteType = this.getRemoteTypeForURIObject(
aURI,
true,
useRemoteSubframes,
remoteType,
webNav.currentURI
);
this.log().debug(
`Checking remote type, got: ${remoteType} want: ${wantRemoteType}\n`
);
return remoteType == wantRemoteType;
}
// If the URI can be loaded in the current process then continue