Bug 1764790 - Remove TopLevelNavigationDelegate support. r=nika

Depends on D143926

Differential Revision: https://phabricator.services.mozilla.com/D143927
This commit is contained in:
Mike Conley
2022-04-18 17:46:10 +00:00
parent a1b70c97b9
commit 360fc14ba5
5 changed files with 0 additions and 89 deletions

View File

@@ -9448,23 +9448,6 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
return rv;
}
if (mBrowsingContext->IsTopContent() &&
!aLoadState->GetPendingRedirectedChannel()) {
nsCOMPtr<nsITopLevelNavigationDelegate> delegate =
do_GetInterface(mTreeOwner);
if (delegate) {
bool shouldNavigate = false;
nsIReferrerInfo* referrerInfo = aLoadState->GetReferrerInfo();
rv = delegate->ShouldNavigate(
this, aLoadState->URI(), aLoadState->LoadType(), referrerInfo,
!!aLoadState->PostDataStream(), aLoadState->TriggeringPrincipal(),
aLoadState->Csp(), &shouldNavigate);
if (NS_SUCCEEDED(rv) && !shouldNavigate) {
return NS_OK;
}
}
}
// mContentViewer->PermitUnload can destroy |this| docShell, which
// causes the next call of CanSavePresentation to crash.
// Hold onto |this| until we return, to prevent a crash from happening.