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
This commit is contained in:
Tim Huang
2020-03-05 19:04:31 +00:00
parent e3844b5a01
commit bfff80aa14
3 changed files with 2 additions and 16 deletions

View File

@@ -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()) {