Backed out 2 changesets (bug 1486185)for build bustages on Logging.h CLOSED TREE
authorarthur.iakab <aiakab@mozilla.com>
Mon, 27 Aug 2018 17:25:31 +0300
changeset 433470 028c9eeaf27e553883ada6ef5f591917a2bc4524
parent 433469 fc7618dd27c9812296e00fe7f5c91f32ce5b222e
child 433471 14926b250441f89308f971dbcaa2b03ac99dafda
push id107082
push useraiakab@mozilla.com
push dateMon, 27 Aug 2018 14:26:00 +0000
treeherdermozilla-inbound@028c9eeaf27e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1486185
milestone63.0a1
backs outfc7618dd27c9812296e00fe7f5c91f32ce5b222e
83388bace8ff0150e4811777180e51c24ddcbbc4
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
Backed out 2 changesets (bug 1486185)for build bustages on Logging.h CLOSED TREE Backed out changeset fc7618dd27c9 (bug 1486185) Backed out changeset 83388bace8ff (bug 1486185)
toolkit/components/antitracking/AntiTrackingCommon.cpp
toolkit/components/antitracking/test/browser/browser.ini
toolkit/components/antitracking/test/browser/browser_imageCache1.js
toolkit/components/antitracking/test/browser/browser_imageCache2.js
toolkit/components/antitracking/test/browser/browser_imageCache3.js
toolkit/components/antitracking/test/browser/browser_imageCache4.js
toolkit/components/antitracking/test/browser/head.js
toolkit/components/antitracking/test/browser/imageCacheWorker.js
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/AbstractThread.h"
 #include "mozilla/Logging.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindowInner.h"
 #include "nsICookiePermission.h"
 #include "nsICookieService.h"
-#include "nsIHttpChannelInternal.h"
 #include "nsIIOService.h"
 #include "nsIPermissionManager.h"
 #include "nsIPrincipal.h"
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsPIDOMWindow.h"
 #include "nsScriptSecurityManager.h"
 #include "prtime.h"
@@ -128,65 +127,16 @@ CookiesBehavior(nsIPrincipal* aPrincipal
   // (See Bug 1406675 for rationale).
   if (BasePrincipal::Cast(aPrincipal)->AddonPolicy()) {
     return nsICookieService::BEHAVIOR_ACCEPT;
   }
 
   return StaticPrefs::network_cookie_cookieBehavior();
 }
 
-bool
-CheckContentBlockingAllowList(nsIURI* aTopWinURI)
-{
-  bool isAllowed = false;
-  nsresult rv =
-    AntiTrackingCommon::IsOnContentBlockingAllowList(aTopWinURI, isAllowed);
-  if (NS_SUCCEEDED(rv) && isAllowed) {
-    LOG_SPEC(("The top-level window (%s) is on the content blocking allow list, "
-              "bail out early", _spec), aTopWinURI);
-    return true;
-  }
-  if (NS_FAILED(rv)) {
-    LOG_SPEC(("Checking the content blocking allow list for %s failed with %x",
-              _spec, rv), aTopWinURI);
-  }
-  return false;
-}
-
-bool
-CheckContentBlockingAllowList(nsPIDOMWindowInner* aWindow)
-{
-  nsPIDOMWindowOuter* top = aWindow->GetScriptableTop();
-  if (top) {
-    nsIURI* topWinURI = top->GetDocumentURI();
-    return CheckContentBlockingAllowList(topWinURI);
-  }
-
-  LOG(("Could not check the content blocking allow list because the top "
-       "window wasn't accessible"));
-  return false;
-}
-
-bool
-CheckContentBlockingAllowList(nsIHttpChannel* aChannel)
-{
-  nsCOMPtr<nsIHttpChannelInternal> chan = do_QueryInterface(aChannel);
-  if (chan) {
-    nsCOMPtr<nsIURI> topWinURI;
-    nsresult rv = chan->GetTopWindowURI(getter_AddRefs(topWinURI));
-    if (NS_SUCCEEDED(rv)) {
-      return CheckContentBlockingAllowList(topWinURI);
-    }
-  }
-
-  LOG(("Could not check the content blocking allow list because the top "
-       "window wasn't accessible"));
-  return false;
-}
-
 } // anonymous
 
 /* static */ RefPtr<AntiTrackingCommon::StorageAccessGrantPromise>
 AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(const nsAString& aOrigin,
                                                          nsPIDOMWindowInner* aParentWindow)
 {
   MOZ_ASSERT(aParentWindow);
 
@@ -200,20 +150,16 @@ AntiTrackingCommon::AddFirstPartyStorage
     return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
   }
 
   if (!StaticPrefs::browser_contentblocking_enabled()) {
     LOG(("The content blocking pref has been disabled, bail out early"));
     return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
   }
 
-  if (CheckContentBlockingAllowList(aParentWindow)) {
-    return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
-  }
-
   nsCOMPtr<nsIPrincipal> topLevelStoragePrincipal;
   nsAutoCString trackingOrigin;
 
   nsGlobalWindowInner* parentWindow = nsGlobalWindowInner::Cast(aParentWindow);
   nsGlobalWindowOuter* outerParentWindow =
     nsGlobalWindowOuter::Cast(parentWindow->GetOuterWindow());
   if (NS_WARN_IF(!outerParentWindow)) {
     LOG(("No outer window found for our parent window, bailing out early"));
@@ -386,20 +332,16 @@ AntiTrackingCommon::IsFirstPartyStorageA
 
   // Now, we have to also honour the Content Blocking pref.
   if (!StaticPrefs::browser_contentblocking_enabled()) {
     LOG(("The content blocking pref has been disabled, bail out early by "
          "by pretending our window isn't a tracking window"));
     return true;
   }
 
-  if (CheckContentBlockingAllowList(aWindow)) {
-    return true;
-  }
-
   if (!nsContentUtils::IsTrackingResourceWindow(aWindow)) {
     LOG(("Our window isn't a tracking window"));
     return true;
   }
 
   nsCOMPtr<nsIPrincipal> parentPrincipal;
   nsAutoCString trackingOrigin;
   if (!GetParentPrincipalAndTrackingOrigin(nsGlobalWindowInner::Cast(aWindow),
@@ -557,20 +499,16 @@ AntiTrackingCommon::IsFirstPartyStorageA
 
   // Now, we have to also honour the Content Blocking pref.
   if (!StaticPrefs::browser_contentblocking_enabled()) {
     LOG(("The content blocking pref has been disabled, bail out early by "
          "pretending our channel isn't a tracking channel"));
     return true;
   }
 
-  if (CheckContentBlockingAllowList(aChannel)) {
-    return true;
-  }
-
   nsIPrincipal* parentPrincipal = loadInfo->TopLevelStorageAreaPrincipal();
   if (!parentPrincipal) {
     LOG(("No top-level storage area principal at hand"));
 
     // parentPrincipal can be null if the parent window is not the top-level
     // window.
     if (loadInfo->TopLevelPrincipal()) {
       LOG(("Parent window is the top-level window, bail out early"));
@@ -674,20 +612,16 @@ AntiTrackingCommon::MaybeIsFirstPartySto
   }
 
   // Now, we have to also honour the Content Blocking pref.
   if (!StaticPrefs::browser_contentblocking_enabled()) {
     LOG(("The content blocking pref has been disabled, bail out early"));
     return true;
   }
 
-  if (CheckContentBlockingAllowList(aFirstPartyWindow)) {
-    return true;
-  }
-
   if (!nsContentUtils::IsThirdPartyWindowOrChannel(aFirstPartyWindow,
                                                    nullptr, aURI)) {
     LOG(("Our window isn't a third-party window"));
     return true;
   }
 
   nsCOMPtr<nsIPrincipal> parentPrincipal =
     nsGlobalWindowInner::Cast(aFirstPartyWindow)->GetPrincipal();
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -21,15 +21,14 @@ support-files = server.sjs
 [browser_blockingStorage.js]
 [browser_blockingWorkers.js]
 [browser_blockingMessaging.js]
 [browser_blockingNoOpener.js]
 [browser_existingCookiesForSubresources.js]
 [browser_imageCache1.js]
 [browser_imageCache2.js]
 [browser_imageCache3.js]
-[browser_imageCache4.js]
 [browser_onBeforeRequestNotificationForTrackingResources.js]
 [browser_onModifyRequestNotificationForTrackingResources.js]
 [browser_subResources.js]
 support-files = subResources.sjs
 [browser_script.js]
 support-files = tracker.js
--- a/toolkit/components/antitracking/test/browser/browser_imageCache1.js
+++ b/toolkit/components/antitracking/test/browser/browser_imageCache1.js
@@ -1,13 +1,12 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 let blockingByCookieBehavior = true;
 let blockingByContentBlocking = false;
-let blockingByAllowList = false;
 
 let rootDir = getRootDirectory(gTestPath);
 let jar = getJar(rootDir);
 if (jar) {
   let tmpdir = extractJarToTmp(jar);
   rootDir = "file://" + tmpdir.path + "/";
 }
 /* import-globals-from imageCacheWorker.js */
--- a/toolkit/components/antitracking/test/browser/browser_imageCache2.js
+++ b/toolkit/components/antitracking/test/browser/browser_imageCache2.js
@@ -1,13 +1,12 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 let blockingByCookieBehavior = false;
 let blockingByContentBlocking = true;
-let blockingByAllowList = false;
 
 let rootDir = getRootDirectory(gTestPath);
 let jar = getJar(rootDir);
 if (jar) {
   let tmpdir = extractJarToTmp(jar);
   rootDir = "file://" + tmpdir.path + "/";
 }
 /* import-globals-from imageCacheWorker.js */
--- a/toolkit/components/antitracking/test/browser/browser_imageCache3.js
+++ b/toolkit/components/antitracking/test/browser/browser_imageCache3.js
@@ -1,13 +1,12 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 let blockingByCookieBehavior = false;
 let blockingByContentBlocking = false;
-let blockingByAllowList = false;
 
 let rootDir = getRootDirectory(gTestPath);
 let jar = getJar(rootDir);
 if (jar) {
   let tmpdir = extractJarToTmp(jar);
   rootDir = "file://" + tmpdir.path + "/";
 }
 /* import-globals-from imageCacheWorker.js */
deleted file mode 100644
--- a/toolkit/components/antitracking/test/browser/browser_imageCache4.js
+++ /dev/null
@@ -1,15 +0,0 @@
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-let blockingByCookieBehavior = true;
-let blockingByContentBlocking = true;
-let blockingByAllowList = true;
-
-let rootDir = getRootDirectory(gTestPath);
-let jar = getJar(rootDir);
-if (jar) {
-  let tmpdir = extractJarToTmp(jar);
-  rootDir = "file://" + tmpdir.path + "/";
-}
-/* import-globals-from imageCacheWorker.js */
-Services.scriptloader.loadSubScript(rootDir + "imageCacheWorker.js", this);
-
--- a/toolkit/components/antitracking/test/browser/head.js
+++ b/toolkit/components/antitracking/test/browser/head.js
@@ -14,17 +14,17 @@ const TEST_3RD_PARTY_PAGE_WITH_SVG = TES
 
 var gFeatures = undefined;
 
 let {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
 
 this.AntiTracking = {
   runTest(name, callbackTracking, callbackNonTracking, cleanupFunction, extraPrefs, windowOpenTest = true, userInteractionTest = true) {
     // Here we want to test that a 3rd party context is simply blocked.
-    this._createTask(name, true, true, false, callbackTracking, extraPrefs);
+    this._createTask(name, true, true, callbackTracking, extraPrefs);
     this._createCleanupTask(cleanupFunction);
 
     if (callbackNonTracking) {
       let runExtraTests = true;
       let options = {};
       if (typeof callbackNonTracking == "object") {
         callbackNonTracking = callbackNonTracking.callback;
         runExtraTests = callbackNonTracking.runExtraTests;
@@ -35,47 +35,36 @@ this.AntiTracking = {
           options.blockingByCookieBehavior = false;
         }
         if ("blockingByContentBlocking" in callbackNonTracking) {
           options.blockingByContentBlocking =
             callbackNonTracking.blockingByContentBlocking;
         } else {
           options.blockingByContentBlocking = false;
         }
-        if ("blockingByAllowList" in callbackNonTracking) {
-          options.blockingByAllowList =
-            callbackNonTracking.blockingByAllowList;
-        } else {
-          options.blockingByAllowList = false;
-        }
       }
 
       // Phase 1: Here we want to test that a 3rd party context is not blocked if pref is off.
       if (runExtraTests) {
-        // There are four ways in which the third-party context may be blocked:
+        // There are three ways in which the third-party context may be blocked:
         //   * If the cookieBehavior pref causes it to not be blocked.
         //   * If the contentBlocking pref causes it to not be blocked.
         //   * If both of these prefs cause it to not be blocked.
-        //   * If the top-level page is on the content blocking allow list.
         // All of these cases are tested here.
-        this._createTask(name, false, true, false, callbackNonTracking);
+        this._createTask(name, false, true, callbackNonTracking);
         this._createCleanupTask(cleanupFunction);
 
-        this._createTask(name, true, false, false, callbackNonTracking);
+        this._createTask(name, true, false, callbackNonTracking);
         this._createCleanupTask(cleanupFunction);
 
-        this._createTask(name, false, false, false, callbackNonTracking);
-        this._createCleanupTask(cleanupFunction);
-
-        this._createTask(name, true, true, true, callbackNonTracking);
+        this._createTask(name, false, false, callbackNonTracking);
         this._createCleanupTask(cleanupFunction);
       } else {
         this._createTask(name, options.blockingByCookieBehavior,
                          options.blockingByContentBlocking,
-                         options.blockingByAllowList,
                          callbackNonTracking);
         this._createCleanupTask(cleanupFunction);
       }
 
       // Phase 2: Here we want to test that a third-party context doesn't
       // get blocked with when the same origin is opened through window.open().
       if (windowOpenTest) {
         this._createWindowOpenTask(name, callbackTracking, callbackNonTracking, extraPrefs);
@@ -94,50 +83,39 @@ this.AntiTracking = {
   async _setupTest(blockingByCookieBehavior, blockingByContentBlocking, extraPrefs) {
     await SpecialPowers.flushPrefEnv();
     await SpecialPowers.pushPrefEnv({"set": [
       ["browser.contentblocking.enabled", blockingByContentBlocking],
       ["network.cookie.cookieBehavior", blockingByCookieBehavior ? Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER : Ci.nsICookieService.BEHAVIOR_ACCEPT],
       ["privacy.trackingprotection.enabled", false],
       ["privacy.trackingprotection.pbmode.enabled", false],
       ["privacy.trackingprotection.annotate_channels", blockingByCookieBehavior],
-      [ContentBlocking.prefIntroCount, ContentBlocking.MAX_INTROS],
     ]});
 
     if (extraPrefs && Array.isArray(extraPrefs) && extraPrefs.length) {
       await SpecialPowers.pushPrefEnv({"set": extraPrefs });
     }
 
     await UrlClassifierTestUtils.addTestTrackers();
   },
 
-  _createTask(name, blockingByCookieBehavior, blockingByContentBlocking,
-              allowList, callback, extraPrefs) {
+  _createTask(name, blockingByCookieBehavior, blockingByContentBlocking, callback, extraPrefs) {
     add_task(async function() {
       info("Starting " + (blockingByCookieBehavior ? "blocking" : "non-blocking") + " cookieBehavior and " +
-                         (blockingByContentBlocking ? "blocking" : "non-blocking") + " contentBlocking with" +
-                         (allowList ? "" : "out") + " allow list test " + name);
+                         (blockingByContentBlocking ? "blocking" : "non-blocking") + " contentBlocking test " + name);
 
       await AntiTracking._setupTest(blockingByCookieBehavior, blockingByContentBlocking, extraPrefs);
 
       info("Creating a new tab");
       let tab = BrowserTestUtils.addTab(gBrowser, TEST_TOP_PAGE);
       gBrowser.selectedTab = tab;
 
       let browser = gBrowser.getBrowserForTab(tab);
       await BrowserTestUtils.browserLoaded(browser);
 
-      if (allowList) {
-        info("Disabling content blocking for this page");
-        ContentBlocking.disableForCurrentPage();
-
-        // The previous function reloads the browser, so wait for it to load again!
-        await BrowserTestUtils.browserLoaded(browser);
-      }
-
       info("Creating a 3rd party content");
       await ContentTask.spawn(browser,
                               { page: TEST_3RD_PARTY_PAGE,
                                 callback: callback.toString() },
                               async function(obj) {
         await new content.Promise(resolve => {
           let ifr = content.document.createElement("iframe");
           ifr.onload = function() {
@@ -165,24 +143,16 @@ this.AntiTracking = {
             ok(false, "Unknown message");
           });
 
           content.document.body.appendChild(ifr);
           ifr.src = obj.page;
         });
       });
 
-      if (allowList) {
-        info("Enabling content blocking for this page");
-        ContentBlocking.enableForCurrentPage();
-
-        // The previous function reloads the browser, so wait for it to load again!
-        await BrowserTestUtils.browserLoaded(browser);
-      }
-
       info("Removing the tab");
       BrowserTestUtils.removeTab(tab);
 
       UrlClassifierTestUtils.cleanupTestTrackers();
     });
   },
 
   _createCleanupTask(cleanupFunction) {
--- a/toolkit/components/antitracking/test/browser/imageCacheWorker.js
+++ b/toolkit/components/antitracking/test/browser/imageCacheWorker.js
@@ -19,17 +19,16 @@ AntiTracking.runTest("Image cache - shou
     ok(true, "Image 2 loaded");
   },
 
   // non-blocking callback
   {
     runExtraTests: false,
     blockingByCookieBehavior,
     blockingByContentBlocking,
-    blockingByAllowList,
     callback: async _ => {
       // Let's load the image twice here as well.
       let img = document.createElement("img");
       document.body.appendChild(img);
       img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs",
       await new Promise(resolve => { img.onload = resolve; });
       ok(true, "Image 3 loaded");