Bug 1745484 - Pass full nsIReferrerInfo through nsITopLevelNavigationDelegate. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D133511
This commit is contained in:
Mike Conley 2021-12-12 18:02:07 +00:00
Родитель e157ce6047
Коммит 4646b826a2
3 изменённых файлов: 5 добавлений и 8 удалений

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

@ -9309,13 +9309,9 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
do_GetInterface(mTreeOwner);
if (delegate) {
bool shouldNavigate = false;
nsCOMPtr<nsIURI> referrer;
nsIReferrerInfo* referrerInfo = aLoadState->GetReferrerInfo();
if (referrerInfo) {
referrerInfo->GetOriginalReferrer(getter_AddRefs(referrer));
}
rv = delegate->ShouldNavigate(
this, aLoadState->URI(), aLoadState->LoadType(), referrer,
this, aLoadState->URI(), aLoadState->LoadType(), referrerInfo,
!!aLoadState->PostDataStream(), aLoadState->TriggeringPrincipal(),
aLoadState->Csp(), &shouldNavigate);
if (NS_SUCCEEDED(rv) && !shouldNavigate) {

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

@ -33,7 +33,7 @@ class TopLevelNavigationDelegateChild extends JSWindowActorChild {
docShell,
URI,
loadType,
referrer,
referrerInfo,
hasPostData,
triggeringPrincipal,
csp

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

@ -7,6 +7,7 @@
interface nsIContentSecurityPolicy;
interface nsIDocShell;
interface nsIPrincipal;
interface nsIReferrerInfo;
interface nsIURI;
/**
@ -25,7 +26,7 @@ interface nsITopLevelNavigationDelegate : nsISupports
* navigate to.
* @param unsigned long loadType Contains a load type for the navigation as
* specified by the load constants in nsIDocShell:LoadCommand.
* @param nsIURI referrer
* @param nsIReferrerInfo referrerInfo
* The referrer of the load.
* @param boolean hasPostData
* True if the load which is being asked about has associated post data
@ -41,7 +42,7 @@ interface nsITopLevelNavigationDelegate : nsISupports
bool shouldNavigate(in nsIDocShell docShell,
in nsIURI linkURI,
in unsigned long loadType,
in nsIURI referrer,
in nsIReferrerInfo referrerInfo,
in boolean hasPostData,
in nsIPrincipal triggeringPrincipal,
in nsIContentSecurityPolicy csp);