Bug 1509555 - Part 4: Remove nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 27 Nov 2018 08:56:39 +0000
changeset 507532 52afd894ca9eb8bf0596c7ac318a0d4e93233f84
parent 507531 4374fb0c23357edfe09c1901fd745ec6393e77f2
child 507533 9555f6d408f1d030380052ddae2491869aa1031b
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1509555
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509555 - Part 4: Remove nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT r=baku Depends on D12830 Differential Revision: https://phabricator.services.mozilla.com/D12831
docshell/base/nsDocShell.cpp
docshell/base/nsIDocShell.idl
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsIDocument.h
netwerk/locales/en-US/necko.properties
security/manager/ssl/nsSecureBrowserUIImpl.cpp
toolkit/components/antitracking/AntiTrackingCommon.cpp
toolkit/components/antitracking/AntiTrackingCommon.h
uriloader/base/nsIWebProgressListener.idl
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1454,24 +1454,16 @@ NS_IMETHODIMP
 nsDocShell::GetHasTrackingContentBlocked(bool* aHasTrackingContentBlocked)
 {
   nsCOMPtr<nsIDocument> doc(GetDocument());
   *aHasTrackingContentBlocked = doc && doc->GetHasTrackingContentBlocked();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetHasSlowTrackingContentBlocked(bool* aHasSlowTrackingContentBlocked)
-{
-  nsCOMPtr<nsIDocument> doc(GetDocument());
-  *aHasSlowTrackingContentBlocked = doc && doc->GetHasSlowTrackingContentBlocked();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsDocShell::GetHasTrackingContentLoaded(bool* aHasTrackingContentLoaded)
 {
   nsCOMPtr<nsIDocument> doc(GetDocument());
   *aHasTrackingContentLoaded = doc && doc->GetHasTrackingContentLoaded();
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -619,22 +619,16 @@ interface nsIDocShell : nsIDocShellTreeI
    /**
    * This attribute determines whether Tracking Content is loaded on the
    * document. When it is true, tracking content was not blocked and has
    * loaded (or is about to load) on the page.
    */
   [infallible] readonly attribute boolean hasTrackingContentLoaded;
 
    /**
-   * This attribute determines whether a document has Slow Tracking Content
-   * that has been blocked from loading.
-   */
-   [infallible] readonly attribute boolean hasSlowTrackingContentBlocked;
-
-   /**
    * This attribute determines whether a document seen cookies or storage
    * blocked due to a site permission being denied.
    */
    [infallible] readonly attribute boolean hasCookiesBlockedByPermission;
 
    /**
    * This attribute determines whether a document seen cookies or storage
    * blocked due to a the request being made by a tracker.
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -5348,21 +5348,16 @@ nsGlobalWindowOuter::NotifyContentBlocki
     if (!aBlocked) {
       unblocked = !doc->GetHasTrackingContentBlocked();
     }
   } else if (aState == nsIWebProgressListener::STATE_LOADED_TRACKING_CONTENT) {
     doc->SetHasTrackingContentLoaded(aBlocked, origin);
     if (!aBlocked) {
       unblocked = !doc->GetHasTrackingContentLoaded();
     }
-  } else if (aState == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT) {
-    doc->SetHasSlowTrackingContentBlocked(aBlocked, origin);
-    if (!aBlocked) {
-      unblocked = !doc->GetHasSlowTrackingContentBlocked();
-    }
   } else if (aState == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION) {
     doc->SetHasCookiesBlockedByPermission(aBlocked, origin);
     if (!aBlocked) {
       unblocked = !doc->GetHasCookiesBlockedByPermission();
     }
   } else if (aState == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER) {
     doc->SetHasTrackingCookiesBlocked(aBlocked, origin);
     if (!aBlocked) {
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -995,25 +995,16 @@ public:
    */
   bool GetHasTrackingContentBlocked()
   {
     return mContentBlockingLog.HasBlockedAnyOfType(
         nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT);
   }
 
   /**
-   * Get slow tracking content blocked flag for this document.
-   */
-  bool GetHasSlowTrackingContentBlocked()
-  {
-    return mContentBlockingLog.HasBlockedAnyOfType(
-        nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
-  }
-
-  /**
    * Get all cookies blocked flag for this document.
    */
   bool GetHasAllCookiesBlocked()
   {
     return mContentBlockingLog.HasBlockedAnyOfType(
         nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL);
   }
 
@@ -1051,27 +1042,16 @@ public:
                                     const nsAString& aOriginBlocked)
   {
     RecordContentBlockingLog(aOriginBlocked,
                              nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT,
                              aHasTrackingContentBlocked);
   }
 
   /**
-   * Set the slow tracking content blocked flag for this document.
-   */
-  void SetHasSlowTrackingContentBlocked(bool aHasSlowTrackingContentBlocked,
-                                        const nsAString& aOriginBlocked)
-  {
-    RecordContentBlockingLog(aOriginBlocked,
-                             nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT,
-                             aHasSlowTrackingContentBlocked);
-  }
-
-  /**
    * Set the all cookies blocked flag for this document.
    */
   void SetHasAllCookiesBlocked(bool aHasAllCookiesBlocked,
                                const nsAString& aOriginBlocked)
   {
     RecordContentBlockingLog(aOriginBlocked,
                              nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL,
                              aHasAllCookiesBlocked);
--- a/netwerk/locales/en-US/necko.properties
+++ b/netwerk/locales/en-US/necko.properties
@@ -41,17 +41,16 @@ SuperfluousAuth=You are about to log in to the site “%1$S” with the username “%2$S”, but the website does not require authentication. This may be an attempt to trick you.\n\nIs “%1$S” the site you want to visit?
 AutomaticAuth=You are about to log in to the site “%1$S” with the username “%2$S”.
 
 TrackerUriBlocked=The resource at “%1$S” was blocked because content blocking is enabled.
 UnsafeUriBlocked=The resource at “%1$S” was blocked by Safe Browsing.
 CookieBlockedByPermission=Request to access cookies or storage on “%1$S” was blocked because of custom cookie permission.
 CookieBlockedTracker=Request to access cookie or storage on “%1$S” was blocked because it came from a tracker and content blocking is enabled.
 CookieBlockedAll=Request to access cookie or storage on “%1$S” was blocked because we are blocking all storage access requests.
 CookieBlockedForeign=Request to access cookie or storage on “%1$S” was blocked because we are blocking all third-party storage access requests and content blocking is enabled.
-CookieBlockedSlowTrackingContent=The resource at “%1$S” was blocked because content blocking is enabled and the resource was classified as a slow tracking resource.
 
 # LOCALIZATION NOTE (CookieAllowedForOriginOnTrackerByStorageAccessAPI): %3$S, %2$S and %1$S are URLs.
 CookieAllowedForOriginOnTrackerByStorageAccessAPI=Storage access granted for “%3$S” opened by tracker “%2$S” on “%1$S”.
 # LOCALIZATION NOTE (CookieAllowedForTrackerByStorageAccessAPI): %2$S and %1$S are URLs.
 CookieAllowedForTrackerByStorageAccessAPI=Storage access granted for tracker “%2$S” on “%1$S”.
 # LOCALIZATION NOTE (CookieAllowedForOriginOnTrackerByHeuristic): %3$S, %2$S and %1$S are URLs.
 CookieAllowedForOriginOnTrackerByHeuristic=Storage access automatically granted for “%3$S” opened by tracker “%2$S” on “%1$S”.
 # LOCALIZATION NOTE (CookieAllowedForTrackerByHeuristic): %2$S and %1$S are URLs.
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -180,20 +180,16 @@ nsSecureBrowserUIImpl::CheckForBlockedCo
     }
   }
 
   // Has tracking content been blocked or loaded?
   if (docShell->GetHasTrackingContentBlocked()) {
     mState |= STATE_BLOCKED_TRACKING_CONTENT;
   }
 
-  if (docShell->GetHasSlowTrackingContentBlocked()) {
-    mState |= STATE_BLOCKED_SLOW_TRACKING_CONTENT;
-  }
-
   if (docShell->GetHasTrackingContentLoaded()) {
     mState |= STATE_LOADED_TRACKING_CONTENT;
   }
 
   if (docShell->GetHasCookiesBlockedByPermission()) {
     mState |= STATE_COOKIES_BLOCKED_BY_PERMISSION;
   }
 
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -229,18 +229,17 @@ void
 ReportBlockingToConsole(nsPIDOMWindowOuter* aWindow, nsIURI* aURI,
                         uint32_t aRejectedReason)
 {
   MOZ_ASSERT(aWindow && aURI);
   MOZ_ASSERT(aRejectedReason == 0 ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
-             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN ||
-             aRejectedReason == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
+             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN);
 
   nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();
   if (NS_WARN_IF(!docShell)) {
     return;
   }
 
   nsCOMPtr<nsIDocument> doc = docShell->GetDocument();
   if (NS_WARN_IF(!doc)) {
@@ -260,20 +259,16 @@ ReportBlockingToConsole(nsPIDOMWindowOut
     case nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL:
       message = "CookieBlockedAll";
       break;
 
     case nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN:
       message = "CookieBlockedForeign";
       break;
 
-    case nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT:
-      message = "CookieBlockedSlowTrackingContent";
-      break;
-
     default:
       return;
   }
 
   MOZ_ASSERT(message);
 
   // Strip the URL of any possible username/password and make it ready to be
   // presented in the UI.
@@ -1316,41 +1311,33 @@ AntiTrackingCommon::IsOnContentBlockingA
 AntiTrackingCommon::NotifyBlockingDecision(nsIChannel* aChannel,
                                            BlockingDecision aDecision,
                                            uint32_t aRejectedReason)
 {
   MOZ_ASSERT(aRejectedReason == 0 ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
-             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN ||
-             aRejectedReason == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
+             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN);
   MOZ_ASSERT(aDecision == BlockingDecision::eBlock ||
              aDecision == BlockingDecision::eAllow);
 
   if (!aChannel) {
     return;
   }
 
-  // When we allow loads, collapse all cookie related reason codes into STATE_COOKIES_LOADED.
-  bool sendCookieLoadedNotification = false;
-  if (aRejectedReason != nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT) {
-    sendCookieLoadedNotification = true;
-  }
-
   // Can be called in EITHER the parent or child process.
   nsCOMPtr<nsIParentChannel> parentChannel;
   NS_QueryNotificationCallbacks(aChannel, parentChannel);
   if (parentChannel) {
     // This channel is a parent-process proxy for a child process request.
     // Tell the child process channel to do this instead.
     if (aDecision == BlockingDecision::eBlock) {
       parentChannel->NotifyTrackingCookieBlocked(aRejectedReason);
-    } else if (sendCookieLoadedNotification) {
-      // Ignore the code related to fastblock
+    } else {
       parentChannel->NotifyCookieAllowed();
     }
     return;
   }
 
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil = services::GetThirdPartyUtil();
   if (!thirdPartyUtil) {
     return;
@@ -1370,43 +1357,34 @@ AntiTrackingCommon::NotifyBlockingDecisi
   aChannel->GetURI(getter_AddRefs(uri));
 
   if (aDecision == BlockingDecision::eBlock) {
     pwin->NotifyContentBlockingState(aRejectedReason, aChannel, true, uri);
 
     ReportBlockingToConsole(pwin, uri, aRejectedReason);
   }
 
-  if (sendCookieLoadedNotification) {
-    pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
-                                     aChannel, false, uri);
-  }
+  pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
+                                   aChannel, false, uri);
 }
 
 /* static */ void
 AntiTrackingCommon::NotifyBlockingDecision(nsPIDOMWindowInner* aWindow,
                                            BlockingDecision aDecision,
                                            uint32_t aRejectedReason)
 {
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(aRejectedReason == 0 ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
-             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN ||
-             aRejectedReason == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
+             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN);
   MOZ_ASSERT(aDecision == BlockingDecision::eBlock ||
              aDecision == BlockingDecision::eAllow);
 
-  // When we allow loads, collapse all cookie related reason codes into STATE_COOKIES_LOADED.
-  bool sendCookieLoadedNotification = false;
-  if (aRejectedReason != nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT) {
-    sendCookieLoadedNotification = true;
-  }
-
   nsCOMPtr<nsPIDOMWindowOuter> pwin = GetTopWindow(aWindow);
   if (!pwin) {
     return;
   }
 
   nsPIDOMWindowInner* inner = pwin->GetCurrentInnerWindow();
   if (!inner) {
     return;
@@ -1427,20 +1405,18 @@ AntiTrackingCommon::NotifyBlockingDecisi
   nsIURI* uri = document->GetDocumentURI();
 
   if (aDecision == BlockingDecision::eBlock) {
     pwin->NotifyContentBlockingState(aRejectedReason, channel, true, uri);
 
     ReportBlockingToConsole(pwin, uri, aRejectedReason);
   }
 
-  if (sendCookieLoadedNotification) {
-    pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
-                                     channel, false, uri);
-  }
+  pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
+                                   channel, false, uri);
 }
 
 /* static */ void
 AntiTrackingCommon::StoreUserInteractionFor(nsIPrincipal* aPrincipal)
 {
   if (XRE_IsParentProcess()) {
     nsCOMPtr<nsIURI> uri;
     Unused << aPrincipal->GetURI(getter_AddRefs(uri));
--- a/toolkit/components/antitracking/AntiTrackingCommon.h
+++ b/toolkit/components/antitracking/AntiTrackingCommon.h
@@ -147,17 +147,16 @@ public:
   // aDecision can be eBlock if we have decided to block some content, or eAllow
   // if we have decided to allow the content through.
   //
   // aRejectedReason must be one of these values:
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN
-  //  * nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT
   static void
   NotifyBlockingDecision(nsIChannel* aChannel, BlockingDecision aDecision,
                          uint32_t aRejectedReason);
 
   static void
   NotifyBlockingDecision(nsPIDOMWindowInner* aWindow, BlockingDecision aDecision,
                          uint32_t aRejectedReason);
 };
--- a/uriloader/base/nsIWebProgressListener.idl
+++ b/uriloader/base/nsIWebProgressListener.idl
@@ -318,26 +318,22 @@ interface nsIWebProgressListener : nsISu
    *   Rejected because the resource is a tracker and cookie policy doesn't
    *   allow its loading.
    *
    * STATE_COOKIES_BLOCKED_ALL
    *   Rejected because cookie policy blocks all cookies.
    *
    * STATE_COOKIES_BLOCKED_FOREIGN
    *   Rejected because cookie policy blocks 3rd party cookies.
-   *
-   * STATE_BLOCKED_SLOW_TRACKING_CONTENT
-   *   Rejected because of the FastBlock feature.
    */
   const unsigned long STATE_COOKIES_LOADED                = 0x00008000;
   const unsigned long STATE_COOKIES_BLOCKED_BY_PERMISSION = 0x10000000;
   const unsigned long STATE_COOKIES_BLOCKED_TRACKER       = 0x20000000;
   const unsigned long STATE_COOKIES_BLOCKED_ALL           = 0x40000000;
   const unsigned long STATE_COOKIES_BLOCKED_FOREIGN       = 0x00000080;
-  const unsigned long STATE_BLOCKED_SLOW_TRACKING_CONTENT = 0x00000040;
 
   /**
    * Notification indicating the state has changed for one of the requests
    * associated with aWebProgress.
    *
    * @param aWebProgress
    *        The nsIWebProgress instance that fired the notification
    * @param aRequest