From 688f40008cef77f00b79aa5e665e652e4b23c188 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Thu, 20 Feb 2020 07:30:30 +0000 Subject: [PATCH] Bug 1577040 - Part 7: Get rid of nsIClassifiedChanel::IsTrackingResource(), r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D63305 --HG-- extra : moz-landing-system : lando --- dom/ipc/RemoteWebProgressRequest.cpp | 5 ---- netwerk/base/nsIClassifiedChannel.idl | 25 ------------------- .../protocol/http/ClassifierDummyChannel.cpp | 11 -------- netwerk/protocol/http/HttpBaseChannel.cpp | 11 -------- 4 files changed, 52 deletions(-) diff --git a/dom/ipc/RemoteWebProgressRequest.cpp b/dom/ipc/RemoteWebProgressRequest.cpp index 3fba32575100..18212b39a5f5 100644 --- a/dom/ipc/RemoteWebProgressRequest.cpp +++ b/dom/ipc/RemoteWebProgressRequest.cpp @@ -241,11 +241,6 @@ NS_IMETHODIMP RemoteWebProgressRequest::SetLoadFlags(nsLoadFlags aLoadFlags) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP -RemoteWebProgressRequest::IsTrackingResource(bool* aIsTrackingResource) { - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP RemoteWebProgressRequest::IsThirdPartyTrackingResource( bool* aIsTrackingResource) { diff --git a/netwerk/base/nsIClassifiedChannel.idl b/netwerk/base/nsIClassifiedChannel.idl index f9fec575d58c..7108e0be6b9d 100644 --- a/netwerk/base/nsIClassifiedChannel.idl +++ b/netwerk/base/nsIClassifiedChannel.idl @@ -146,31 +146,6 @@ interface nsIClassifiedChannel : nsISupports CLASSIFIED_SOCIALTRACKING_LINKEDIN | CLASSIFIED_SOCIALTRACKING_TWITTER, }; - /** - * Returns true if the channel has loaded a resource that is classified as - * tracker. - * This is a helper attribute which returns the same value of - * (classificationFlags & CLASSIFIED_ANY_BASIC_TRACKING) or - * (classificationFlags & CLASSIFIED_ANY_STRICT_TRACKING) or - * (classificationFlags & CLASSIFIED_ANY_SOCIAL_TRACKING) - * - * Note that top-level channels could be marked as tracking - * resource. In order to identify third-party tracking resources - * specifically, use isThirdPartyTrackingResource(). - */ - boolean isTrackingResource(); - -%{ C++ - inline bool IsTrackingResource() - { - bool value = false; - if (NS_SUCCEEDED(IsTrackingResource(&value)) && value) { - return true; - } - return false; - } -%} - /** * Returns true if the channel has been processed by URL-Classifier features * and is considered third-party with the top window URI, and if it has loaded diff --git a/netwerk/protocol/http/ClassifierDummyChannel.cpp b/netwerk/protocol/http/ClassifierDummyChannel.cpp index 8ec6f9574f67..34e58110bf5e 100644 --- a/netwerk/protocol/http/ClassifierDummyChannel.cpp +++ b/netwerk/protocol/http/ClassifierDummyChannel.cpp @@ -727,17 +727,6 @@ NS_IMETHODIMP ClassifierDummyChannel::GetClassificationFlags( return NS_OK; } -NS_IMETHODIMP ClassifierDummyChannel::IsTrackingResource( - bool* aIsTrackingResource) { - MOZ_ASSERT(!mFirstPartyClassificationFlags || - !mThirdPartyClassificationFlags); - *aIsTrackingResource = UrlClassifierCommon::IsTrackingClassificationFlag( - mThirdPartyClassificationFlags) || - UrlClassifierCommon::IsTrackingClassificationFlag( - mFirstPartyClassificationFlags); - return NS_OK; -} - NS_IMETHODIMP ClassifierDummyChannel::IsThirdPartyTrackingResource( bool* aIsTrackingResource) { MOZ_ASSERT( diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 85b5a69174ba..88f7de5255d2 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1474,17 +1474,6 @@ NS_IMETHODIMP HttpBaseChannel::SetTopLevelContentWindowId(uint64_t aWindowId) { return NS_OK; } -NS_IMETHODIMP -HttpBaseChannel::IsTrackingResource(bool* aIsTrackingResource) { - MOZ_ASSERT(!mFirstPartyClassificationFlags || - !mThirdPartyClassificationFlags); - *aIsTrackingResource = UrlClassifierCommon::IsTrackingClassificationFlag( - mThirdPartyClassificationFlags) || - UrlClassifierCommon::IsTrackingClassificationFlag( - mFirstPartyClassificationFlags); - return NS_OK; -} - NS_IMETHODIMP HttpBaseChannel::IsThirdPartyTrackingResource(bool* aIsTrackingResource) { MOZ_ASSERT(