Bug 1645406 - Remove getContentBlockingAllowListPrincipalFromWindow from mozIThirdPartyUtil.idl r=timhuang,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D79464
This commit is contained in:
Dimi Lee 2020-06-17 15:34:21 +00:00
Родитель 7571dc2667
Коммит a10e95cd91
2 изменённых файлов: 0 добавлений и 46 удалений

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

@ -150,43 +150,6 @@ ThirdPartyUtil::GetURIFromWindow(mozIDOMWindowProxy* aWin, nsIURI** result) {
return basePrin->GetURI(result);
}
NS_IMETHODIMP
ThirdPartyUtil::GetContentBlockingAllowListPrincipalFromWindow(
mozIDOMWindowProxy* aWin, nsIURI* aURIBeingLoaded, nsIPrincipal** result) {
nsPIDOMWindowOuter* outerWindow = nsPIDOMWindowOuter::From(aWin);
nsPIDOMWindowInner* innerWindow = outerWindow->GetCurrentInnerWindow();
Document* doc = innerWindow ? innerWindow->GetExtantDoc() : nullptr;
if (!doc) {
return GetPrincipalFromWindow(aWin, result);
}
nsCOMPtr<nsIPrincipal> principal =
doc->GetContentBlockingAllowListPrincipal();
if (aURIBeingLoaded && principal && principal->GetIsNullPrincipal()) {
// If we have an initial principal during navigation, recompute it to get
// the real content blocking allow list principal.
nsIDocShell* docShell = doc->GetDocShell();
OriginAttributes attrs =
docShell ? nsDocShell::Cast(docShell)->GetOriginAttributes()
: OriginAttributes();
ContentBlockingAllowList::RecomputePrincipal(aURIBeingLoaded, attrs,
getter_AddRefs(principal));
}
if (!principal || !principal->GetIsContentPrincipal()) {
// This is for compatibility with GetURIFromWindow. Null principals are
// explicitly special cased there. GetURI returns nullptr for
// SystemPrincipal and ExpandedPrincipal.
LOG(
("ThirdPartyUtil::GetContentBlockingAllowListPrincipalFromWindow can't "
"use null principal\n"));
return NS_ERROR_INVALID_ARG;
}
principal.forget(result);
return NS_OK;
}
// Determine if aFirstURI is third party with respect to aSecondURI. See docs
// for mozIThirdPartyUtil.
NS_IMETHODIMP

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

@ -198,15 +198,6 @@ interface mozIThirdPartyUtil : nsISupports
*/
nsIPrincipal getPrincipalFromWindow(in mozIDOMWindowProxy aWindow);
/**
* getContentBlockingAllowListPrincipalFromWindow
*
* Returns the content blocking allow list principal for the window.
*/
[noscript]
nsIPrincipal getContentBlockingAllowListPrincipalFromWindow(in mozIDOMWindowProxy aWindow,
[optional] in nsIURI aURIBeingLoaded);
/**
* getTopWindowForChannel
*