forked from mirrors/gecko-dev
Bug 1888494 - Make CanonicalBrowsingContext::FixupAndLoadURIString check set the correct TRR mode a=RyanVM
It would seem sometimes in Firefox 77 we regressed the ability to set the TRR mode for a browsing context when opening a new tab. I confirmed that this bug didn't happen in Fx 77 when setting the `browser.tabs.documentchannel.parent-initiated` pref to `false`. The nsIWebNavigation::LOAD_FLAGS_DISABLE_TRR is correctly passed into CanonicalBrowsingContext, but it doesn't end up getting used. This sets the appropriate DefaultLoadFlags for BrowsingContext when the LOAD_FLAGS_DISABLE_TRR or LOAD_TRR_ONLY_MODE flags are present in nsDocShellLoadState::LoadFlags() Original Revision: https://phabricator.services.mozilla.com/D220550 Differential Revision: https://phabricator.services.mozilla.com/D225964
This commit is contained in:
parent
2972cd11ac
commit
f5d7929c1b
2 changed files with 15 additions and 1 deletions
|
|
@ -1958,6 +1958,17 @@ nsresult BrowsingContext::LoadURI(nsDocShellLoadState* aLoadState,
|
||||||
"Targeting occurs in InternalLoad");
|
"Targeting occurs in InternalLoad");
|
||||||
aLoadState->AssertProcessCouldTriggerLoadIfSystem();
|
aLoadState->AssertProcessCouldTriggerLoadIfSystem();
|
||||||
|
|
||||||
|
// When this tab sets these load flags, we disable or force TRR for the
|
||||||
|
// browsing context ensuring subsequent navigations will keep the same
|
||||||
|
// TRR mode.
|
||||||
|
if (aLoadState->HasLoadFlags(nsIWebNavigation::LOAD_FLAGS_DISABLE_TRR)) {
|
||||||
|
Unused << SetDefaultLoadFlags(GetDefaultLoadFlags() |
|
||||||
|
nsIRequest::LOAD_TRR_DISABLED_MODE);
|
||||||
|
} else if (aLoadState->HasLoadFlags(nsIWebNavigation::LOAD_FLAGS_FORCE_TRR)) {
|
||||||
|
Unused << SetDefaultLoadFlags(GetDefaultLoadFlags() |
|
||||||
|
nsIRequest::LOAD_TRR_ONLY_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
if (mDocShell) {
|
if (mDocShell) {
|
||||||
nsCOMPtr<nsIDocShell> docShell = mDocShell;
|
nsCOMPtr<nsIDocShell> docShell = mDocShell;
|
||||||
return docShell->LoadURI(aLoadState, aSetNavigating);
|
return docShell->LoadURI(aLoadState, aSetNavigating);
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,10 @@ interface nsIWebNavigation : nsISupports
|
||||||
const unsigned long LOAD_FLAGS_IS_REDIRECT = 0x800000;
|
const unsigned long LOAD_FLAGS_IS_REDIRECT = 0x800000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These flags force TRR modes 1 or 3 for the load.
|
* These flags force TRR_DISABLED_MODE or TRR_ONLY_MODE on the
|
||||||
|
* browsingContext's defaultLoadFlags.
|
||||||
|
* The basic use case for this is the captive portal login tab
|
||||||
|
* that needs skip TRR even when the browser defaults to TRR-only mode.
|
||||||
*/
|
*/
|
||||||
const unsigned long LOAD_FLAGS_DISABLE_TRR = 0x1000000;
|
const unsigned long LOAD_FLAGS_DISABLE_TRR = 0x1000000;
|
||||||
const unsigned long LOAD_FLAGS_FORCE_TRR = 0x2000000;
|
const unsigned long LOAD_FLAGS_FORCE_TRR = 0x2000000;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue