зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1619602 - Part 2: Don't overwrite the existing ContentBlockingAllowListPrincipal when doing a recomputation in the Document. r=dimi,Ehsan
It is incorrect to overwrite the existing ContentBlockingAllowListPrincipal when doing a recomputaion in the Document. The ContentBlockingAllowListPrincipal in the document should be updated in Document::SetPrincipals(). Differential Revision: https://phabricator.services.mozilla.com/D65406 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
93e600f428
Коммит
1e0e0346b8
|
@ -16177,16 +16177,5 @@ bool Document::HasRecentlyStartedForegroundLoads() {
|
|||
return false;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal>
|
||||
Document::RecomputeContentBlockingAllowListPrincipal(
|
||||
nsIURI* aURIBeingLoaded, const OriginAttributes& aAttrs) {
|
||||
AntiTrackingCommon::RecomputeContentBlockingAllowListPrincipal(
|
||||
aURIBeingLoaded, aAttrs,
|
||||
getter_AddRefs(mContentBlockingAllowListPrincipal));
|
||||
|
||||
nsCOMPtr<nsIPrincipal> copy = mContentBlockingAllowListPrincipal;
|
||||
return copy.forget();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -585,9 +585,6 @@ class Document : public nsINode,
|
|||
return mContentBlockingAllowListPrincipal;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal> RecomputeContentBlockingAllowListPrincipal(
|
||||
nsIURI* aURIBeingLoaded, const OriginAttributes& aAttrs);
|
||||
|
||||
// EventTarget
|
||||
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
||||
EventListenerManager* GetOrCreateListenerManager() override;
|
||||
|
|
|
@ -162,8 +162,8 @@ ThirdPartyUtil::GetContentBlockingAllowListPrincipalFromWindow(
|
|||
OriginAttributes attrs =
|
||||
docShell ? nsDocShell::Cast(docShell)->GetOriginAttributes()
|
||||
: OriginAttributes();
|
||||
principal =
|
||||
doc->RecomputeContentBlockingAllowListPrincipal(aURIBeingLoaded, attrs);
|
||||
AntiTrackingCommon::RecomputeContentBlockingAllowListPrincipal(
|
||||
aURIBeingLoaded, attrs, getter_AddRefs(principal));
|
||||
}
|
||||
|
||||
if (!principal || !principal->GetIsContentPrincipal()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче