Backed out changeset 481a655f835e (bug 1510909) for assertion failures on AntiTrackingCommon.cpp. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Fri, 30 Nov 2018 19:03:25 +0200
changeset 505406 66f69c1eb0c2b81acce633c98960bbce974f018e
parent 505405 647ade4da0fba74a268aab079677cb47f20f036e
child 505407 d28d9a723d2441bcd168303a3e990be573f13e65
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1510909
milestone65.0a1
backs out481a655f835e07fa9e533ba27b92d10ed784f11c
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 changeset 481a655f835e (bug 1510909) for assertion failures on AntiTrackingCommon.cpp. CLOSED TREE
toolkit/components/antitracking/AntiTrackingCommon.cpp
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -880,25 +880,20 @@ bool AntiTrackingCommon::IsFirstPartySto
   }
 
   if (behavior == nsICookieService::BEHAVIOR_REJECT) {
     LOG(("The cookie behavior pref mandates rejecting all cookies!"));
     *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL;
     return false;
   }
 
-  // As a performance optimization, we only perform this check for
-  // BEHAVIOR_REJECT_FOREIGN and BEHAVIOR_LIMIT_FOREIGN.  For
-  // BEHAVIOR_REJECT_TRACKER, third-partiness is implicily checked later below.
-  if (behavior != nsICookieService::BEHAVIOR_REJECT_TRACKER) {
-    // Let's check if this is a 3rd party context.
-    if (!nsContentUtils::IsThirdPartyWindowOrChannel(aWindow, nullptr, aURI)) {
-      LOG(("Our window isn't a third-party window"));
-      return true;
-    }
+  // Let's check if this is a 3rd party context.
+  if (!nsContentUtils::IsThirdPartyWindowOrChannel(aWindow, nullptr, aURI)) {
+    LOG(("Our window isn't a third-party window"));
+    return true;
   }
 
   if (behavior == nsICookieService::BEHAVIOR_REJECT_FOREIGN ||
       behavior == nsICookieService::BEHAVIOR_LIMIT_FOREIGN) {
     // XXX For non-cookie forms of storage, we handle BEHAVIOR_LIMIT_FOREIGN by
     // simply rejecting the request to use the storage. In the future, if we
     // change the meaning of BEHAVIOR_LIMIT_FOREIGN to be one which makes sense
     // for non-cookie storage types, this may change.
@@ -909,19 +904,16 @@ bool AntiTrackingCommon::IsFirstPartySto
 
   MOZ_ASSERT(behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER);
 
   if (!nsContentUtils::IsThirdPartyTrackingResourceWindow(aWindow)) {
     LOG(("Our window isn't a third-party tracking window"));
     return true;
   }
 
-  MOZ_ASSERT(
-      !nsContentUtils::IsThirdPartyWindowOrChannel(aWindow, nullptr, aURI));
-
   nsCOMPtr<nsIPrincipal> parentPrincipal;
   nsCOMPtr<nsIURI> parentPrincipalURI;
   nsCOMPtr<nsIURI> trackingURI;
   nsAutoCString trackingOrigin;
   if (!GetParentPrincipalAndTrackingOrigin(
           nsGlobalWindowInner::Cast(aWindow), getter_AddRefs(parentPrincipal),
           trackingOrigin, getter_AddRefs(trackingURI), nullptr)) {
     LOG(("Failed to obtain the parent principal and the tracking origin"));