Skip to content

Commit

Permalink
Bug 1620322 - Part 8: Rename AntiTrackingCommon to ContentBlocking; r…
Browse files Browse the repository at this point in the history
…=baku

Differential Revision: https://phabricator.services.mozilla.com/D65821

--HG--
rename : toolkit/components/antitracking/AntiTrackingCommon.cpp => toolkit/components/antitracking/ContentBlocking.cpp
rename : toolkit/components/antitracking/AntiTrackingCommon.h => toolkit/components/antitracking/ContentBlocking.h
extra : moz-landing-system : lando
  • Loading branch information
ehsan committed Mar 9, 2020
1 parent 3510632 commit 5200d03
Show file tree
Hide file tree
Showing 40 changed files with 116 additions and 182 deletions.
5 changes: 0 additions & 5 deletions build/win32/orderfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19404,7 +19404,6 @@ Gecko_BeginWritingCString
?ShouldEnableClassifier@UrlClassifierCommon@net@mozilla@@SA_NPAVnsIChannel@@@Z
?AddonMayLoad@UrlClassifierCommon@net@mozilla@@SA_NPAVnsIChannel@@PAVnsIURI@@@Z
?GetTopWindowURI@HttpBaseChannel@net@mozilla@@UAG?AW4nsresult@@PAPAVnsIURI@@@Z
?MaybeGetDocumentURIBeingLoaded@AntiTrackingCommon@mozilla@@SA?AU?$already_AddRefed@VnsIURI@@@@PAVnsIChannel@@@Z
?GetTopWindowURI@HttpBaseChannel@net@mozilla@@IAE?AW4nsresult@@PAVnsIURI@@PAPAV5@@Z
XPCOMService_GetThirdPartyUtil
?GetTopWindowForChannel@ThirdPartyUtil@@UAG?AW4nsresult@@PAVnsIChannel@@PAVnsIURI@@PAPAVmozIDOMWindowProxy@@@Z
Expand Down Expand Up @@ -19532,7 +19531,6 @@ XPCOMService_GetThirdPartyUtil
?IsTrackingClassificationFlag@UrlClassifierCommon@net@mozilla@@SA_NI@Z
?DeQueue@nsHostResolver@@AAEXAAV?$LinkedList@V?$RefPtr@VnsHostRecord@@@@@mozilla@@PAPAVAddrHostRecord@@@Z
?popFirst@?$LinkedList@V?$RefPtr@VnsHostRecord@@@@@mozilla@@QAE?AV?$RefPtr@VnsHostRecord@@@@XZ
?IsFirstPartyStorageAccessGrantedFor@AntiTrackingCommon@mozilla@@SA_NPAVnsIHttpChannel@@PAVnsIURI@@PAI@Z
?GetTopLevelPrincipal@LoadInfo@net@mozilla@@UAEPAVnsIPrincipal@@XZ
?GetIsMainDocumentChannel@HttpBaseChannel@net@mozilla@@UAG?AW4nsresult@@PA_N@Z
?GetAddrInfo@net@mozilla@@YA?AW4nsresult@@ABV?$nsTSubstring@D@@GGPAPAVAddrInfo@12@_N@Z
Expand All @@ -19548,12 +19546,10 @@ XPCOMService_GetThirdPartyUtil
?extensions_cookiesBehavior_overrideOnTopLevel@StaticPrefs@mozilla@@SA_NXZ
?GetChannelId@HttpBaseChannel@net@mozilla@@UAG?AW4nsresult@@PA_K@Z
??$?0PAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@@?$PairHelper@PAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@$00$0A@@detail@mozilla@@IAE@$$QAPAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@$$QAV?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@2@@Z
?OnAntiTrackingSettingsChanged@AntiTrackingCommon@mozilla@@SAXABV?$function@$$A6AXXZ@std@@@Z
?first@?$PairHelper@PAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@$00$0A@@detail@mozilla@@IBEABQAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@XZ
??4?$UniquePtr@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@@mozilla@@QAEAAV01@$$QAV01@@Z
??$AppendElement@ABV?$function@$$A6AXXZ@std@@UnsTArrayInfallibleAllocator@@@?$nsTArray_Impl@V?$function@$$A6AXXZ@std@@UnsTArrayInfallibleAllocator@@@@IAEPAV?$function@$$A6AXXZ@std@@ABV12@@Z
??$EnsureCapacity@UnsTArrayInfallibleAllocator@@@?$nsTArray_base@UnsTArrayInfallibleAllocator@@U?$nsTArray_CopyWithConstructors@V?$function@$$A6AXXZ@std@@@@@@IAE?AUnsTArrayInfallibleResult@@II@Z
?IsOnContentBlockingAllowList@AntiTrackingCommon@mozilla@@SA?AW4nsresult@@PAVnsIURI@@_NW4ContentBlockingAllowListPurpose@12@AA_N@Z
?TestPermissionOriginNoSuffix@nsPermissionManager@@UAG?AW4nsresult@@ABV?$nsTSubstring@D@@0PAI@Z
?NS_IsSafeTopLevelNav@@YA_NPAVnsIChannel@@@Z
?IsSafeMethod@nsHttpRequestHead@net@mozilla@@QAE_NXZ
Expand Down Expand Up @@ -26368,7 +26364,6 @@ Gecko_AppendPropertyValuePair
?QueryInterface@imgLoader@@UAG?AW4nsresult@@ABUnsID@@PAPAX@Z
?FindEntryProperties@imgLoader@@UAG?AW4nsresult@@PAVnsIURI@@PAVDocument@dom@mozilla@@PAPAVnsIProperties@@@Z
?IsThirdPartyTrackingResourceWindow@nsContentUtils@@SA_NPAVnsPIDOMWindowInner@@@Z
?MaybeIsFirstPartyStorageAccessGrantedFor@AntiTrackingCommon@mozilla@@SA_NPAVnsPIDOMWindowInner@@PAVnsIURI@@@Z
??$CreateAndResolve@_N@?$MozPromise@H_N$00@mozilla@@SA?AV?$RefPtr@V?$MozPromise@H_N$00@mozilla@@@@$$QA_NPBD@Z
?AdjustPriority@HttpBaseChannel@net@mozilla@@UAG?AW4nsresult@@H@Z
?SetTimingEnabled@imgRequestProxy@@UAG?AW4nsresult@@_N@Z
Expand Down
6 changes: 0 additions & 6 deletions build/win64/orderfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19322,7 +19322,6 @@ Gecko_BeginWritingCString
?ShouldEnableClassifier@UrlClassifierCommon@net@mozilla@@SA_NPEAVnsIChannel@@@Z
?AddonMayLoad@UrlClassifierCommon@net@mozilla@@SA_NPEAVnsIChannel@@PEAVnsIURI@@@Z
?GetTopWindowURI@HttpBaseChannel@net@mozilla@@UEAA?AW4nsresult@@PEAPEAVnsIURI@@@Z
?MaybeGetDocumentURIBeingLoaded@AntiTrackingCommon@mozilla@@SA?AU?$already_AddRefed@VnsIURI@@@@PEAVnsIChannel@@@Z
?GetTopWindowURI@HttpBaseChannel@net@mozilla@@IEAA?AW4nsresult@@PEAVnsIURI@@PEAPEAV5@@Z
XPCOMService_GetThirdPartyUtil
?GetTopWindowForChannel@ThirdPartyUtil@@UEAA?AW4nsresult@@PEAVnsIChannel@@PEAVnsIURI@@PEAPEAVmozIDOMWindowProxy@@@Z
Expand Down Expand Up @@ -19443,7 +19442,6 @@ XPCOMService_GetThirdPartyUtil
?IsThirdPartyInternal@ThirdPartyUtil@@AEAA?AW4nsresult@@AEBV?$nsTString@D@@PEAVnsIURI@@PEA_N@Z
?IsTrackingResource@HttpBaseChannel@net@mozilla@@UEAA?AW4nsresult@@PEA_N@Z
?IsTrackingClassificationFlag@UrlClassifierCommon@net@mozilla@@SA_NI@Z
?IsFirstPartyStorageAccessGrantedFor@AntiTrackingCommon@mozilla@@SA_NPEAVnsIHttpChannel@@PEAVnsIURI@@PEAI@Z
?GetTopLevelPrincipal@LoadInfo@net@mozilla@@UEAAPEAVnsIPrincipal@@XZ
?GetIsMainDocumentChannel@HttpBaseChannel@net@mozilla@@UEAA?AW4nsresult@@PEA_N@Z
?GetIsContentPrincipal@BasePrincipal@mozilla@@UEAA?AW4nsresult@@PEA_N@Z
Expand All @@ -19464,12 +19462,10 @@ XPCOMService_GetThirdPartyUtil
?extensions_cookiesBehavior_overrideOnTopLevel@StaticPrefs@mozilla@@SA_NXZ
?GetChannelId@HttpBaseChannel@net@mozilla@@UEAA?AW4nsresult@@PEA_K@Z
??$?0PEAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@@?$PairHelper@PEAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@$00$0A@@detail@mozilla@@IEAA@$$QEAPEAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@$$QEAV?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@2@@Z
?OnAntiTrackingSettingsChanged@AntiTrackingCommon@mozilla@@SAXAEBV?$function@$$A6AXXZ@std@@@Z
?first@?$PairHelper@PEAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@$00$0A@@detail@mozilla@@IEBAAEBQEAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@XZ
?reset@?$UniquePtr@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@V?$DefaultDelete@V?$nsTArray@V?$function@$$A6AXXZ@std@@@@@mozilla@@@mozilla@@QEAAXPEAV?$nsTArray@V?$function@$$A6AXXZ@std@@@@@Z
??$AppendElement@AEBV?$function@$$A6AXXZ@std@@UnsTArrayInfallibleAllocator@@@?$nsTArray_Impl@V?$function@$$A6AXXZ@std@@UnsTArrayInfallibleAllocator@@@@IEAAPEAV?$function@$$A6AXXZ@std@@AEBV12@@Z
??$EnsureCapacity@UnsTArrayInfallibleAllocator@@@?$nsTArray_base@UnsTArrayInfallibleAllocator@@U?$nsTArray_CopyWithConstructors@V?$function@$$A6AXXZ@std@@@@@@IEAA?AUnsTArrayInfallibleResult@@_K0@Z
?IsOnContentBlockingAllowList@AntiTrackingCommon@mozilla@@SA?AW4nsresult@@PEAVnsIURI@@_NW4ContentBlockingAllowListPurpose@12@AEA_N@Z
?TestPermissionOriginNoSuffix@nsPermissionManager@@UEAA?AW4nsresult@@AEBV?$nsTSubstring@D@@0PEAI@Z
?NS_IsSafeTopLevelNav@@YA_NPEAVnsIChannel@@@Z
?IsSafeMethod@nsHttpRequestHead@net@mozilla@@QEAA_NXZ
Expand Down Expand Up @@ -26335,7 +26331,6 @@ UnregisterWeakMemoryReporter
?ExplicitSetUploadStreamLength@HttpBaseChannel@net@mozilla@@AEAA?AW4nsresult@@_K_N@Z
??$ReplaceChar@_SX@?$nsTString@_S@@QEAAXPEBD_S@Z
?Set@URLParams@dom@mozilla@@QEAAXAEBV?$nsTSubstring@_S@@0@Z
?NotifyBlockingDecision@AntiTrackingCommon@mozilla@@SAXPEAVnsIChannel@@W4BlockingDecision@12@I@Z
?ConstructorEnabled@ChannelWrapper_Binding@dom@mozilla@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@@Z
?CreateInterfaceObjects@ChannelWrapper_Binding@dom@mozilla@@YAXPEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@AEAVProtoAndIfaceCache@23@_N@Z
?Id@ChannelWrapper@extensions@mozilla@@QEBA_KXZ
Expand Down Expand Up @@ -26670,7 +26665,6 @@ Gecko_AppendPropertyValuePair
?IsImageInCache@nsContentUtils@@SA_NPEAVnsIURI@@PEAVDocument@dom@mozilla@@@Z
?FindEntryProperties@imgLoader@@UEAA?AW4nsresult@@PEAVnsIURI@@PEAVDocument@dom@mozilla@@PEAPEAVnsIProperties@@@Z
?IsThirdPartyTrackingResourceWindow@nsContentUtils@@SA_NPEAVnsPIDOMWindowInner@@@Z
?MaybeIsFirstPartyStorageAccessGrantedFor@AntiTrackingCommon@mozilla@@SA_NPEAVnsPIDOMWindowInner@@PEAVnsIURI@@@Z
??$CreateAndResolve@_N@?$MozPromise@H_N$00@mozilla@@SA?AV?$RefPtr@V?$MozPromise@H_N$00@mozilla@@@@$$QEA_NPEBD@Z
?AdjustPriority@HttpBaseChannel@net@mozilla@@UEAA?AW4nsresult@@H@Z
?SetTimingEnabled@imgRequestProxy@@UEAA?AW4nsresult@@_N@Z
Expand Down
29 changes: 15 additions & 14 deletions dom/base/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "AudioChannelService.h"
#include "mozilla/dom/Document.h"
#include "DocumentInlines.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/AntiTrackingUtils.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/BinarySearch.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/ContentBlockingAllowList.h"
#include "mozilla/ContentBlockingUserInteraction.h"
#include "mozilla/CSSEnabledState.h"
Expand Down Expand Up @@ -15066,7 +15066,7 @@ void Document::MaybeAllowStorageForOpenerAfterUserInteraction() {
}

// We don't care when the asynchronous work finishes here.
Unused << AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
Unused << ContentBlocking::AllowAccessFor(
NodePrincipal(), openerInner,
ContentBlockingNotifier::eOpenerAfterUserInteraction);
}
Expand Down Expand Up @@ -15639,10 +15639,11 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(

RefPtr<Document> self(this);

auto performFinalChecks = [inner, self]()
-> RefPtr<AntiTrackingCommon::StorageAccessFinalCheckPromise> {
RefPtr<AntiTrackingCommon::StorageAccessFinalCheckPromise::Private> p =
new AntiTrackingCommon::StorageAccessFinalCheckPromise::Private(
auto performFinalChecks =
[inner,
self]() -> RefPtr<ContentBlocking::StorageAccessFinalCheckPromise> {
RefPtr<ContentBlocking::StorageAccessFinalCheckPromise::Private> p =
new ContentBlocking::StorageAccessFinalCheckPromise::Private(
__func__);
RefPtr<StorageAccessPermissionRequest> sapr =
StorageAccessPermissionRequest::Create(
Expand All @@ -15651,7 +15652,7 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
[p] {
Telemetry::AccumulateCategorical(
Telemetry::LABELS_STORAGE_ACCESS_API_UI::Allow);
p->Resolve(AntiTrackingCommon::eAllow, __func__);
p->Resolve(ContentBlocking::eAllow, __func__);
},
// Block
[p] {
Expand Down Expand Up @@ -15696,10 +15697,10 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
MOZ_ASSERT_IF(pr2 != PromptResult::Granted,
pr2 == PromptResult::Denied);
if (pr2 == PromptResult::Granted) {
AntiTrackingCommon::StorageAccessPromptChoices choice =
AntiTrackingCommon::eAllow;
ContentBlocking::StorageAccessPromptChoices choice =
ContentBlocking::eAllow;
if (autoGrant) {
choice = AntiTrackingCommon::eAllowAutoGrant;
choice = ContentBlocking::eAllowAutoGrant;
}
if (!autoGrant) {
p->Resolve(choice, __func__);
Expand All @@ -15722,7 +15723,7 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(

return std::move(p);
};
AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
ContentBlocking::AllowAccessFor(
NodePrincipal(), inner, ContentBlockingNotifier::eStorageAccessAPI,
performFinalChecks)
->Then(
Expand Down Expand Up @@ -16046,11 +16047,11 @@ nsIPrincipal* Document::EffectiveStoragePrincipal() const {
return mActiveStoragePrincipal;
}

// We use the lower-level AntiTrackingCommon API here to ensure this
// We use the lower-level ContentBlocking API here to ensure this
// check doesn't send notifications.
uint32_t rejectedReason = 0;
if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
inner, GetDocumentURI(), &rejectedReason)) {
if (ContentBlocking::ShouldAllowAccessFor(inner, GetDocumentURI(),
&rejectedReason)) {
return mActiveStoragePrincipal = NodePrincipal();
}

Expand Down
6 changes: 3 additions & 3 deletions dom/base/Navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "nsIXULAppInfo.h"
#include "nsPluginArray.h"
#include "nsMimeTypeArray.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/ContentBlockingNotifier.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/BodyExtractor.h"
Expand Down Expand Up @@ -528,8 +528,8 @@ bool Navigator::CookieEnabled() {
}

uint32_t rejectedReason = 0;
bool granted = AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
mWindow, contentURI, &rejectedReason);
bool granted = ContentBlocking::ShouldAllowAccessFor(mWindow, contentURI,
&rejectedReason);

ContentBlockingNotifier::OnDecision(
mWindow,
Expand Down
5 changes: 3 additions & 2 deletions dom/base/ThirdPartyUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "nsReadableUtils.h"
#include "nsThreadUtils.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/ContentBlockingAllowList.h"
#include "mozilla/dom/Document.h"
#include "mozilla/Logging.h"
Expand Down Expand Up @@ -493,8 +494,8 @@ ThirdPartyUtil::AnalyzeChannel(nsIChannel* aChannel, bool aNotify, nsIURI* aURI,
aRequireThirdPartyCheck ? result.contains(ThirdPartyAnalysis::IsForeign)
: true;
if (performStorageChecks &&
AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
aChannel, aURI ? aURI : uri.get(), aRejectedReason)) {
ContentBlocking::ShouldAllowAccessFor(aChannel, aURI ? aURI : uri.get(),
aRejectedReason)) {
result += ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted;
}

Expand Down
1 change: 0 additions & 1 deletion dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "gfxDrawable.h"
#include "ImageOps.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/net/UrlClassifierCommon.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Attributes.h"
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsGlobalWindowInner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4400,8 +4400,8 @@ Storage* nsGlobalWindowInner::GetSessionStorage(ErrorResult& aError) {
// it may be okay to provide SessionStorage even when we receive a value of
// eDeny.
//
// AntiTrackingCommon::IsFirstPartyStorageAccessGranted will return false
// for 3 main reasons.
// ContentBlocking::ShouldAllowAccessFor will return false for 3 main
// reasons.
//
// 1. Cookies are entirely blocked due to a per-origin permission
// (nsICookiePermission::ACCESS_DENY for the top-level principal or this
Expand Down
10 changes: 5 additions & 5 deletions dom/base/nsGlobalWindowOuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "nsIPermissionManager.h"
#include "nsISecureBrowserUI.h"
#include "nsIWebProgressListener.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/AntiTrackingUtils.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/BrowserChild.h"
#include "mozilla/dom/BrowsingContextBinding.h"
Expand Down Expand Up @@ -2482,8 +2482,8 @@ nsresult nsGlobalWindowOuter::SetNewDocument(Document* aDocument,
// permission has been granted already.
// Don't notify in this case, since we would be notifying the user
// needlessly.
mHasStorageAccess = AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
newInnerWindow, uri, nullptr);
mHasStorageAccess =
ContentBlocking::ShouldAllowAccessFor(newInnerWindow, uri, nullptr);
}

return NS_OK;
Expand Down Expand Up @@ -7184,8 +7184,8 @@ void nsGlobalWindowOuter::MaybeAllowStorageForOpenedWindow(nsIURI* aURI) {
aURI, doc->NodePrincipal()->OriginAttributesRef());

// We don't care when the asynchronous work finishes here.
Unused << AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
principal, inner, ContentBlockingNotifier::eOpener);
Unused << ContentBlocking::AllowAccessFor(principal, inner,
ContentBlockingNotifier::eOpener);
}

//*****************************************************************************
Expand Down
1 change: 0 additions & 1 deletion dom/base/nsPIDOMWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/Maybe.h"
#include "mozilla/TaskCategory.h"
#include "js/TypeDecls.h"
Expand Down
24 changes: 12 additions & 12 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "URIUtils.h"
#include "gfxPlatform.h"
#include "gfxPlatformFontList.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/BenchmarkStorageParent.h"
#include "mozilla/ContentBlockingUserInteraction.h"
Expand Down Expand Up @@ -5822,17 +5822,17 @@ ContentParent::RecvFirstPartyStorageAccessGrantedForOrigin(
const Principal& aParentPrincipal, const Principal& aTrackingPrincipal,
const nsCString& aTrackingOrigin, const int& aAllowMode,
FirstPartyStorageAccessGrantedForOriginResolver&& aResolver) {
AntiTrackingCommon::
SaveFirstPartyStorageAccessGrantedForOriginOnParentProcess(
aParentPrincipal, aTrackingPrincipal, aTrackingOrigin, aAllowMode)
->Then(GetCurrentThreadSerialEventTarget(), __func__,
[aResolver = std::move(aResolver)](
AntiTrackingCommon::FirstPartyStorageAccessGrantPromise::
ResolveOrRejectValue&& aValue) {
bool success = aValue.IsResolve() &&
NS_SUCCEEDED(aValue.ResolveValue());
aResolver(success);
});
ContentBlocking::SaveAccessForOriginOnParentProcess(
aParentPrincipal, aTrackingPrincipal, aTrackingOrigin, aAllowMode)
->Then(
GetCurrentThreadSerialEventTarget(), __func__,
[aResolver = std::move(aResolver)](
ContentBlocking::ParentAccessGrantPromise::ResolveOrRejectValue&&
aValue) {
bool success =
aValue.IsResolve() && NS_SUCCEEDED(aValue.ResolveValue());
aResolver(success);
});
return IPC_OK();
}

Expand Down
5 changes: 2 additions & 3 deletions dom/security/ReferrerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "nsCharSeparatedTokenizer.h"
#include "ReferrerInfo.h"

#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/net/CookieJarSettings.h"
#include "mozilla/net/HttpBaseChannel.h"
#include "mozilla/dom/Element.h"
Expand Down Expand Up @@ -205,8 +205,7 @@ ReferrerPolicy ReferrerInfo::GetDefaultReferrerPolicy(nsIHttpChannel* aChannel,
if (aChannel && aURI && cjs->GetRejectThirdPartyTrackers()) {
uint32_t rejectedReason = 0;
thirdPartyTrackerIsolated =
!AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
aChannel, aURI, &rejectedReason);
!ContentBlocking::ShouldAllowAccessFor(aChannel, aURI, &rejectedReason);
// Here we intentionally do not notify about the rejection reason, if any
// in order to avoid this check to have any visible side-effects (e.g. a
// web console report.)
Expand Down
1 change: 0 additions & 1 deletion dom/workers/RuntimeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "js/ContextOptions.h"
#include "js/LocaleSensitive.h"
#include "mozilla/AbstractThread.h"
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Atomics.h"
#include "mozilla/Attributes.h"
Expand Down
4 changes: 2 additions & 2 deletions image/ImageCacheKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <utility>

#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/ContentBlocking.h"
#include "mozilla/HashFunctions.h"
#include "mozilla/StorageAccess.h"
#include "mozilla/Unused.h"
Expand Down Expand Up @@ -185,7 +185,7 @@ nsCString ImageCacheKey::GetTopLevelBaseDomain(Document* aDocument,
// this point. The best approach here is to be conservative: if we are sure
// that the permission is granted, let's return 0. Otherwise, let's make a
// unique image cache per the top-level document eTLD+1.
if (!AntiTrackingCommon::MaybeIsFirstPartyStorageAccessGrantedFor(
if (!ContentBlocking::ApproximateAllowAccessForWithoutChannel(
aDocument->GetInnerWindow(), aURI)) {
nsPIDOMWindowOuter* top =
aDocument->GetInnerWindow()->GetInProcessScriptableTop();
Expand Down
1 change: 1 addition & 0 deletions media/webrtc/signaling/src/peerconnection/RTCStatsReport.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/UniquePtr.h"
#include "prtime.h" // PR_Now
#include "mozilla/MozPromise.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/dom/RTCStatsReportBinding.h" // RTCStatsCollection

Expand Down
1 change: 0 additions & 1 deletion netwerk/base/nsNetUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "nsNetUtil.h"

#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/Atomics.h"
#include "mozilla/Encoding.h"
#include "mozilla/LoadContext.h"
Expand Down
Loading

0 comments on commit 5200d03

Please sign in to comment.