Backed out 12 changesets (bug 1547813) for failures in browser_partitionedIndexedDB.js CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Thu, 09 May 2019 20:04:16 +0300
changeset 532071 8fea661662875f667e79d9204438ce3cbfacbb46
parent 532070 804d239e671bc7572641c0c864fa7a147c338b3e
child 532072 667010d35e3418a9b9b2a21086dd411cb931d6e9
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1547813
milestone68.0a1
backs out98989127264bd94ee0030809e1a9019832198a8f
f9d790139a26b2733cb1f83bdecce06633f4f94a
a29f58cef0224159623273401d17c769ab98fc6d
c1288949de1cc38beee2a6cea0704f59c46f2551
8cad4fd197b1bdbee9e36bc54a12c48dd8c8e269
807ce59e7e6eecbbb83b02d1ff45ecbda9896835
06943593738cbfb00527317c54f8b58d324060ab
4ced8d49ddc37cd3ecdb62c38e7df51f5603f475
77a040f527e9903657ccc0910adb760aef281619
b4651cfaff307a7f3f05538907045b1e24a07923
279c140a4d71c537afd5eee36f3b9262f97c819b
0e0241f3d366f10b5eab0209897c2494064fadfb
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 12 changesets (bug 1547813) for failures in browser_partitionedIndexedDB.js CLOSED TREE Backed out changeset 98989127264b (bug 1547813) Backed out changeset f9d790139a26 (bug 1547813) Backed out changeset a29f58cef022 (bug 1547813) Backed out changeset c1288949de1c (bug 1547813) Backed out changeset 8cad4fd197b1 (bug 1547813) Backed out changeset 807ce59e7e6e (bug 1547813) Backed out changeset 06943593738c (bug 1547813) Backed out changeset 4ced8d49ddc3 (bug 1547813) Backed out changeset 77a040f527e9 (bug 1547813) Backed out changeset b4651cfaff30 (bug 1547813) Backed out changeset 279c140a4d71 (bug 1547813) Backed out changeset 0e0241f3d366 (bug 1547813)
browser/app/profile/firefox.js
browser/base/content/browser-contentblocking.js
browser/components/BrowserGlue.jsm
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/tests/browser_contentblocking.js
browser/components/preferences/in-content/tests/browser_contentblocking_categories.js
dom/base/Document.cpp
dom/base/Document.h
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowOuter.cpp
dom/broadcastchannel/BroadcastChannel.cpp
dom/clients/manager/ClientIPCUtils.h
dom/indexedDB/IDBFactory.cpp
dom/security/ReferrerInfo.cpp
dom/workers/RuntimeService.cpp
dom/workers/WorkerScope.cpp
dom/workers/sharedworkers/SharedWorker.cpp
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/CookieServiceChild.h
netwerk/cookie/CookieServiceParent.cpp
netwerk/cookie/CookieServiceParent.h
netwerk/cookie/CookieSettings.cpp
netwerk/cookie/PCookieService.ipdl
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsCookieService.h
netwerk/cookie/nsICookieService.idl
netwerk/cookie/nsICookieSettings.idl
netwerk/protocol/http/nsHttpChannel.cpp
toolkit/components/antitracking/AntiTrackingCommon.cpp
toolkit/components/antitracking/StorageAccess.cpp
toolkit/components/antitracking/StorageAccess.h
toolkit/components/antitracking/StoragePrincipalHelper.cpp
toolkit/components/antitracking/moz.build
toolkit/components/antitracking/test/browser/3rdPartyStorage.html
toolkit/components/antitracking/test/browser/browser.ini
toolkit/components/antitracking/test/browser/browser_partitionedCookies.js
toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js
toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js
toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js
toolkit/components/antitracking/test/browser/dynamicfpi_head.js
toolkit/components/antitracking/test/browser/head.js
toolkit/components/antitracking/test/browser/partitionedstorage_head.js
toolkit/components/antitracking/test/browser/storageprincipal_head.js
uriloader/base/nsIWebProgressListener.idl
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1605,17 +1605,16 @@ pref("browser.contentblocking.fingerprin
 //     "cm": cryptomining blocking enabled
 //     "-cm": cryptomining blocking disabled
 //   Cookie behavior:
 //     "cookieBehavior0": cookie behaviour BEHAVIOR_ACCEPT
 //     "cookieBehavior1": cookie behaviour BEHAVIOR_REJECT_FOREIGN
 //     "cookieBehavior2": cookie behaviour BEHAVIOR_REJECT
 //     "cookieBehavior3": cookie behaviour BEHAVIOR_LIMIT_FOREIGN
 //     "cookieBehavior4": cookie behaviour BEHAVIOR_REJECT_TRACKER
-//     "cookieBehavior5": cookie behaviour BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN
 // One value from each section must be included in each browser.contentblocking.features.* pref.
 pref("browser.contentblocking.features.strict", "tp,tpPrivate,cookieBehavior4,cm,fp");
 // Enable blocking access to storage from tracking resources only in nightly
 // and early beta. By default the value is "cookieBehavior0": BEHAVIOR_ACCEPT
 // Enable cryptomining blocking in standard in nightly and early beta.
 // Enable fingerprinting blocking in standard in nightly and early beta.
 #ifdef EARLY_BETA_OR_EARLIER
 pref("browser.contentblocking.features.standard", "-tp,tpPrivate,cookieBehavior4,cm,fp");
--- a/browser/base/content/browser-contentblocking.js
+++ b/browser/base/content/browser-contentblocking.js
@@ -493,18 +493,16 @@ var ThirdPartyCookies = {
       return "allcookiesblocked";
     case Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN:
       return "cookiesfromunvisitedsitesblocked";
     default:
       Cu.reportError(`Error: Unknown cookieBehavior pref observed: ${this.behaviorPref}`);
       // fall through
     case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
       return "cookierestrictions";
-    case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN:
-      return "cookierestrictionsforeignpartitioned";
     }
   },
 
   updateCategoryLabel() {
     let label;
     switch (this.behaviorPref) {
     case Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN:
       label = ContentBlocking.showBlockedLabels ? "contentBlocking.cookies.blocking3rdParty.label" : null;
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -3081,19 +3081,16 @@ var ContentBlockingCategoriesPrefs = {
           this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT;
           break;
         case "cookieBehavior3":
           this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN;
           break;
         case "cookieBehavior4":
           this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
           break;
-        case "cookieBehavior5":
-          this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN;
-          break;
         default:
           Cu.reportError(`Error: Unknown rule observed ${item}`);
         }
       }
     }
   },
 
   /**
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -560,19 +560,16 @@ var gPrivacyPane = {
           document.querySelector(selector + " .all-cookies-option").hidden = false;
           break;
         case "cookieBehavior3":
           document.querySelector(selector + " .unvisited-cookies-option").hidden = false;
           break;
         case "cookieBehavior4":
           document.querySelector(selector + " .third-party-tracking-cookies-option").hidden = false;
           break;
-        case "cookieBehavior5":
-          // No UI support for this cookie policy yet
-          break;
         }
       }
       // Hide the "tracking protection in private browsing" list item
       // if the "tracking protection enabled in all windows" list item is showing.
       if (!document.querySelector(selector + " .trackers-option").hidden) {
         document.querySelector(selector + " .pb-trackers-option").hidden = true;
       }
     }
--- a/browser/components/preferences/in-content/tests/browser_contentblocking.js
+++ b/browser/components/preferences/in-content/tests/browser_contentblocking.js
@@ -268,19 +268,16 @@ add_task(async function testContentBlock
       is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT, `${NCB_PREF} has been set to ${Ci.nsICookieService.BEHAVIOR_REJECT}`);
       break;
     case "cookieBehavior3":
       is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN, `${NCB_PREF} has been set to ${Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN}`);
       break;
     case "cookieBehavior4":
       is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER, `${NCB_PREF} has been set to ${Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER}`);
       break;
-    case "cookieBehavior5":
-      is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN, `${NCB_PREF} has been set to ${Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN}`);
-      break;
     default:
       ok(false, "unknown option was added to the strict pref");
       break;
     }
   }
 
   gBrowser.removeCurrentTab();
 });
@@ -323,17 +320,16 @@ add_task(async function testContentBlock
   // Changing the NCB_PREF should necessarily set CAT_PREF to "custom"
   let defaultNCB = defaults.get(NCB_PREF);
   let nonDefaultNCB;
   switch (defaultNCB) {
   case Ci.nsICookieService.BEHAVIOR_ACCEPT:
     nonDefaultNCB = Ci.nsICookieService.BEHAVIOR_REJECT;
     break;
   case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
-  case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN:
     nonDefaultNCB = Ci.nsICookieService.BEHAVIOR_ACCEPT;
     break;
   default:
     ok(false, "Unexpected default value found for " + NCB_PREF + ": " + defaultNCB);
     break;
   }
   Services.prefs.setIntPref(NCB_PREF, nonDefaultNCB);
   await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(NCB_PREF));
--- a/browser/components/preferences/in-content/tests/browser_contentblocking_categories.js
+++ b/browser/components/preferences/in-content/tests/browser_contentblocking_categories.js
@@ -37,23 +37,16 @@ add_task(async function testContentBlock
   // backup if a mistake is made. The UI will not respond correctly.
   defaults.setStringPref(STANDARD_DEF_PREF, "");
   ok(!Services.prefs.prefHasUserValue(TP_PREF), `${TP_PREF} pref has the default value`);
   ok(!Services.prefs.prefHasUserValue(TP_PBM_PREF), `${TP_PBM_PREF} pref has the default value`);
   ok(!Services.prefs.prefHasUserValue(FP_PREF), `${FP_PREF} pref has the default value`);
   ok(!Services.prefs.prefHasUserValue(CM_PREF), `${CM_PREF} pref has the default value`);
   ok(!Services.prefs.prefHasUserValue(NCB_PREF), `${NCB_PREF} pref has the default value`);
 
-  defaults.setStringPref(STANDARD_DEF_PREF, "tp,-tpPrivate,fp,-cm,cookieBehavior5");
-  is(Services.prefs.getBoolPref(TP_PREF), true, `${TP_PREF} pref has been set to true`);
-  is(Services.prefs.getBoolPref(TP_PBM_PREF), false, `${TP_PBM_PREF} pref has been set to true`);
-  is(Services.prefs.getBoolPref(FP_PREF), true, `${CM_PREF} pref has been set to true`);
-  is(Services.prefs.getBoolPref(CM_PREF), false, `${CM_PREF} pref has been set to true`);
-  is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN, `${NCB_PREF} has been set to BEHAVIOR_REJECT_TRACKER`);
-
   defaults.setStringPref(STANDARD_DEF_PREF, "-tpPrivate,-fp,-cm,-tp,cookieBehavior2");
   is(Services.prefs.getBoolPref(TP_PREF), false, `${TP_PREF} pref has been set to false`);
   is(Services.prefs.getBoolPref(TP_PBM_PREF), false, `${TP_PBM_PREF} pref has been set to false`);
   is(Services.prefs.getBoolPref(FP_PREF), false, `${FP_PREF} pref has been set to false`);
   is(Services.prefs.getBoolPref(CM_PREF), false, `${CM_PREF} pref has been set to false`);
   is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT, `${NCB_PREF} has been set to BEHAVIOR_REJECT_TRACKER`);
 
   // cleanup
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -23,17 +23,16 @@
 #include "mozilla/IdentifierMapEntry.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Likely.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/PresShellInlines.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/StaticPrefs.h"
-#include "mozilla/StorageAccess.h"
 #include "mozilla/URLExtraData.h"
 #include <algorithm>
 
 #include "mozilla/Logging.h"
 #include "plstr.h"
 #include "mozilla/Sprintf.h"
 
 #include "mozilla/Telemetry.h"
@@ -3475,18 +3474,18 @@ void Document::GetCookie(nsAString& aCoo
   }
 
   nsContentUtils::StorageAccess storageAccess =
       nsContentUtils::StorageAllowedForDocument(this);
   if (storageAccess == nsContentUtils::StorageAccess::eDeny) {
     return;
   }
 
-  if (ShouldPartitionStorage(storageAccess) &&
-      !StoragePartitioningEnabled(storageAccess, CookieSettings())) {
+  if (storageAccess == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+      !StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
     return;
   }
 
   // If the document is a cookie-averse Document... return the empty string.
   if (IsCookieAverse()) {
     return;
   }
 
@@ -3535,18 +3534,18 @@ void Document::SetCookie(const nsAString
   }
 
   nsContentUtils::StorageAccess storageAccess =
       nsContentUtils::StorageAllowedForDocument(this);
   if (storageAccess == nsContentUtils::StorageAccess::eDeny) {
     return;
   }
 
-  if (ShouldPartitionStorage(storageAccess) &&
-      !StoragePartitioningEnabled(storageAccess, CookieSettings())) {
+  if (storageAccess == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+      !StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
     return;
   }
 
   // If the document is a cookie-averse Document... do nothing.
   if (IsCookieAverse()) {
     return;
   }
 
@@ -11577,50 +11576,16 @@ Document* Document::GetTopLevelContentDo
     }
 
     parent = parent->GetParentDocument();
   } while (parent);
 
   return parent;
 }
 
-const Document* Document::GetTopLevelContentDocument() const {
-  const Document* parent;
-
-  if (!mLoadedAsData) {
-    parent = this;
-  } else {
-    nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(GetScopeObject());
-    if (!window) {
-      return nullptr;
-    }
-
-    parent = window->GetExtantDoc();
-    if (!parent) {
-      return nullptr;
-    }
-  }
-
-  do {
-    if (parent->IsTopLevelContentDocument()) {
-      break;
-    }
-
-    // If we ever have a non-content parent before we hit a toplevel content
-    // parent, then we're never going to find one.  Just bail.
-    if (!parent->IsContentDocument()) {
-      return nullptr;
-    }
-
-    parent = parent->GetParentDocument();
-  } while (parent);
-
-  return parent;
-}
-
 static bool MightBeChromeScheme(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   bool isChrome = true;
   aURI->SchemeIs("chrome", &isChrome);
   return isChrome;
 }
 
 static bool MightBeAboutOrChromeScheme(nsIURI* aURI) {
@@ -12191,17 +12156,18 @@ void Document::SetDocTreeHadPlayRevoked(
   }
 }
 
 DocumentAutoplayPolicy Document::AutoplayPolicy() const {
   return AutoplayPolicy::IsAllowedToPlay(*this);
 }
 
 void Document::MaybeAllowStorageForOpenerAfterUserInteraction() {
-  if (!CookieSettings()->GetRejectThirdPartyTrackers()) {
+  if (CookieSettings()->GetCookieBehavior() !=
+      nsICookieService::BEHAVIOR_REJECT_TRACKER) {
     return;
   }
 
   // This will probably change for project fission, but currently this document
   // and the opener are on the same process. In the future, we should make this
   // part async.
 
   nsPIDOMWindowInner* inner = GetInnerWindow();
@@ -12728,17 +12694,18 @@ already_AddRefed<mozilla::dom::Promise> 
 
   // Step 2. If the document has a null origin, reject.
   if (NodePrincipal()->GetIsNullPrincipal()) {
     promise->MaybeRejectWithUndefined();
     return promise.forget();
   }
 
   // Only enforce third-party checks when there is a reason to enforce them.
-  if (!CookieSettings()->GetRejectThirdPartyTrackers()) {
+  if (CookieSettings()->GetCookieBehavior() !=
+      nsICookieService::BEHAVIOR_REJECT_TRACKER) {
     // Step 3. If the document's frame is the main frame, resolve.
     if (IsTopLevelContentDocument()) {
       promise->MaybeResolveWithUndefined();
       return promise.forget();
     }
 
     // Step 4. If the sub frame's origin is equal to the main frame's, resolve.
     nsCOMPtr<Document> topLevelDoc = GetTopLevelContentDocument();
@@ -12780,17 +12747,19 @@ already_AddRefed<mozilla::dom::Promise> 
 
   if (nsContentUtils::IsInPrivateBrowsing(this)) {
     // If the document is in PB mode, it doesn't have access to its persistent
     // cookie jar, so reject the promise here.
     promise->MaybeRejectWithUndefined();
     return promise.forget();
   }
 
-  if (CookieSettings()->GetRejectThirdPartyTrackers() && inner) {
+  if (CookieSettings()->GetCookieBehavior() ==
+          nsICookieService::BEHAVIOR_REJECT_TRACKER &&
+      inner) {
     // Only do something special for third-party tracking content.
     if (nsContentUtils::StorageDisabledByAntiTracking(this, nullptr)) {
       // Note: If this has returned true, the top-level document is guaranteed
       // to not be on the Content Blocking allow list.
       DebugOnly<bool> isOnAllowList = false;
       // If we have a parent document, it has to be non-private since we
       // verified earlier that our own document is non-private and a private
       // document can never have a non-private document as its child.
@@ -13048,36 +13017,27 @@ nsICookieSettings* Document::CookieSetti
   if (!mCookieSettings) {
     mCookieSettings = net::CookieSettings::Create();
   }
 
   return mCookieSettings;
 }
 
 nsIPrincipal* Document::EffectiveStoragePrincipal() const {
-  const Document* toplevel = GetTopLevelContentDocument();
-  nsPIDOMWindowInner* inner = GetInnerWindow();
-  if (!toplevel || !inner) {
+  if (!StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
     return NodePrincipal();
   }
 
-  // We use the lower-level AntiTrackingCommon API here to ensure this
-  // check doesn't send notifications.
-  uint32_t rejectedReason = 0;
-  if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-          inner, toplevel->GetDocumentURI(), &rejectedReason)) {
-    return NodePrincipal();
-  }
+  nsContentUtils::StorageAccess access =
+      nsContentUtils::StorageAllowedForDocument(this);
 
   // Let's use the storage principal only if we need to partition the cookie
   // jar. When the permission is granted, access will be different and the
   // normal principal will be used.
-  if (!ShouldPartitionStorage(rejectedReason) ||
-      !StoragePartitioningEnabled(
-          rejectedReason, const_cast<Document*>(this)->CookieSettings())) {
+  if (access != nsContentUtils::StorageAccess::ePartitionedOrDeny) {
     return NodePrincipal();
   }
 
   return mIntrinsicStoragePrincipal;
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -3172,17 +3172,16 @@ class Document : public nsINode,
     eConnected,
     eDisconnected,
     eAdopted,
     eAttributeChanged,
     eGetCustomInterface
   };
 
   Document* GetTopLevelContentDocument();
-  const Document* GetTopLevelContentDocument() const;
 
   // Returns the associated XUL window if this is a top-level chrome document,
   // null otherwise.
   already_AddRefed<nsIXULWindow> GetXULWindowIfToplevelChrome() const;
 
   already_AddRefed<Element> CreateElement(
       const nsAString& aTagName, const ElementCreationOptionsOrString& aOptions,
       ErrorResult& rv);
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -8465,23 +8465,17 @@ nsContentUtils::StorageAccess nsContentU
   if (!StorageDisabledByAntiTracking(aWindow, aChannel, aPrincipal, aURI,
                                      aRejectedReason)) {
     return access;
   }
 
   // We want to have a partitioned storage only for trackers.
   if (aRejectedReason ==
       nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER) {
-    return StorageAccess::ePartitionTrackersOrDeny;
-  }
-
-  // We want to have a partitioned storage for all third parties.
-  if (aRejectedReason ==
-      nsIWebProgressListener::STATE_COOKIES_PARTITIONED_FOREIGN) {
-    return StorageAccess::ePartitionForeignOrDeny;
+    return StorageAccess::ePartitionedOrDeny;
   }
 
   return StorageAccess::eDeny;
 }
 
 namespace {
 
 // We put StringBuilder in the anonymous namespace to prevent anything outside
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -2879,22 +2879,19 @@ class nsContentUtils {
   static bool IsNonSubresourceRequest(nsIChannel* aChannel);
 
   static bool IsNonSubresourceInternalPolicyType(nsContentPolicyType aType);
 
   // The order of these entries matters, as we use std::min for total ordering
   // of permissions. Private Browsing is considered to be more limiting
   // then session scoping
   enum class StorageAccess {
-    // The storage should be partitioned for third-party resources. if the
-    // caller is unable to do it, deny the storage access.
-    ePartitionForeignOrDeny = -2,
-    // The storage should be partitioned for third-party trackers. if the caller
-    // is unable to do it, deny the storage access.
-    ePartitionTrackersOrDeny = -1,
+    // The storage should be partitioned. if the caller is unable to do it, deny
+    // the storage access.
+    ePartitionedOrDeny = -1,
     // Don't allow access to the storage
     eDeny = 0,
     // Allow access to the storage, but only if it is secure to do so in a
     // private browsing context.
     ePrivateBrowsing = 1,
     // Allow access to the storage, but only persist it for the current session
     eSessionScoped = 2,
     // Allow access to the storage
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -77,17 +77,16 @@
 #include "js/Wrapper.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsReadableUtils.h"
 #include "nsJSEnvironment.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Likely.h"
 #include "mozilla/Sprintf.h"
-#include "mozilla/StorageAccess.h"
 #include "mozilla/Unused.h"
 
 // Other Classes
 #include "mozilla/dom/BarProps.h"
 #include "nsContentCID.h"
 #include "nsLayoutStatics.h"
 #include "nsCCUncollectableMarker.h"
 #include "mozilla/dom/WorkerCommon.h"
@@ -4324,18 +4323,18 @@ Storage* nsGlobalWindowInner::GetSession
     // STATE_COOKIES_BLOCKED_ALL.
     //
     // 2. Third-party cookies are limited via BEHAVIOR_REJECT_FOREIGN and
     // BEHAVIOR_LIMIT_FOREIGN and this is a third-party window. This will return
     // eDeny with a reason of STATE_COOKIES_BLOCKED_FOREIGN.
     //
     // 3. Tracking protection (BEHAVIOR_REJECT_TRACKER) is in effect and
     // IsThirdPartyTrackingResourceWindow() returned true and there wasn't a
-    // permission that allows it. This will return ePartitionTrackersOrDeny with
-    // a reason of STATE_COOKIES_BLOCKED_TRACKER.
+    // permission that allows it. This will return ePartitionedOrDeny with a
+    // reason of STATE_COOKIES_BLOCKED_TRACKER.
     //
     // In the 1st case, the user has explicitly indicated that they don't want
     // to allow any storage to the origin or all origins and so we throw an
     // error and deny access to SessionStorage. In the 2nd case, a legacy
     // decision reasoned that there's no harm in providing SessionStorage
     // because the information is not durable and cannot escape the current tab.
     // The rationale is similar for the 3rd case.
     if (access == nsContentUtils::StorageAccess::eDeny &&
@@ -4399,17 +4398,17 @@ Storage* nsGlobalWindowInner::GetLocalSt
   // privacy.restrict3rdpartystorage.partitionedHosts pref. See
   // nsContentUtils::IsURIInPrefList to know the syntax for the pref value.
   // This is a temporary web-compatibility hack.
 
   nsContentUtils::StorageAccess access =
       nsContentUtils::StorageAllowedForWindow(this);
 
   // We allow partitioned localStorage only to some hosts.
-  if (ShouldPartitionStorage(access)) {
+  if (access == nsContentUtils::StorageAccess::ePartitionedOrDeny) {
     if (!mDoc) {
       access = nsContentUtils::StorageAccess::eDeny;
     } else {
       nsCOMPtr<nsIURI> uri;
       Unused << mDoc->NodePrincipal()->GetURI(getter_AddRefs(uri));
       static const char* kPrefName =
           "privacy.restrict3rdpartystorage.partitionedHosts";
       if (!uri || !nsContentUtils::IsURIInPrefList(uri, kPrefName)) {
@@ -4428,17 +4427,17 @@ Storage* nsGlobalWindowInner::GetLocalSt
     }
     return nullptr;
   }
 
   // Note that this behavior is observable: if we grant storage permission to a
   // tracker, we pass from the partitioned LocalStorage to the 'normal'
   // LocalStorage. The previous data is lost and the 2 window.localStorage
   // objects, before and after the permission granted, will be different.
-  if (!ShouldPartitionStorage(access) &&
+  if (access != nsContentUtils::StorageAccess::ePartitionedOrDeny &&
       (!mLocalStorage ||
        mLocalStorage->Type() == Storage::ePartitionedLocalStorage)) {
     RefPtr<Storage> storage;
 
     if (NextGenLocalStorageEnabled()) {
       aError = LSObject::CreateForWindow(this, getter_AddRefs(storage));
     } else {
       nsresult rv;
@@ -4471,27 +4470,28 @@ Storage* nsGlobalWindowInner::GetLocalSt
     if (aError.Failed()) {
       return nullptr;
     }
 
     mLocalStorage = storage;
     MOZ_ASSERT(mLocalStorage);
   }
 
-  if (ShouldPartitionStorage(access) && !mLocalStorage) {
+  if (access == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+      !mLocalStorage) {
     nsIPrincipal* principal = GetPrincipal();
     if (!principal) {
       aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
       return nullptr;
     }
 
     mLocalStorage = new PartitionedLocalStorage(this, principal);
   }
 
-  MOZ_ASSERT(ShouldPartitionStorage(access) ==
+  MOZ_ASSERT((access == nsContentUtils::StorageAccess::ePartitionedOrDeny) ==
              (mLocalStorage->Type() == Storage::ePartitionedLocalStorage));
 
   return mLocalStorage;
 }
 
 IDBFactory* nsGlobalWindowInner::GetIndexedDB(ErrorResult& aError) {
   if (!mIndexedDB) {
     // This may keep mIndexedDB null without setting an error.
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -2288,17 +2288,18 @@ nsresult nsGlobalWindowOuter::SetNewDocu
   // If we have a recorded interesting Large-Allocation header status, report it
   // to the newly attached document.
   ReportLargeAllocStatus();
   mLargeAllocStatus = LargeAllocStatus::NONE;
 
   mHasStorageAccess = false;
   nsIURI* uri = aDocument->GetDocumentURI();
   if (newInnerWindow &&
-      aDocument->CookieSettings()->GetRejectThirdPartyTrackers() &&
+      aDocument->CookieSettings()->GetCookieBehavior() ==
+          nsICookieService::BEHAVIOR_REJECT_TRACKER &&
       nsContentUtils::IsThirdPartyWindowOrChannel(newInnerWindow, nullptr,
                                                   uri) &&
       nsContentUtils::IsTrackingResourceWindow(newInnerWindow)) {
     // Grant storage access by default if the first-party storage access
     // permission has been granted already.
     // Don't notify in this case, since we would be notifying the user
     // needlessly.
     mHasStorageAccess = AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
--- a/dom/broadcastchannel/BroadcastChannel.cpp
+++ b/dom/broadcastchannel/BroadcastChannel.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/dom/StructuredCloneHolder.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerRef.h"
 #include "mozilla/dom/WorkerRunnable.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
-#include "mozilla/StorageAccess.h"
 #include "nsContentUtils.h"
 
 #include "nsIBFCacheEntry.h"
 #include "nsICookieService.h"
 #include "mozilla/dom/Document.h"
 #include "nsISupportsPrimitives.h"
 
 #ifdef XP_WIN
@@ -229,17 +228,16 @@ already_AddRefed<BroadcastChannel> Broad
 
   RefPtr<BroadcastChannel> bc = new BroadcastChannel(global, aChannel);
 
   nsAutoCString origin;
   PrincipalInfo storagePrincipalInfo;
 
   nsContentUtils::StorageAccess storageAccess;
 
-  nsCOMPtr<nsICookieSettings> cs;
   if (NS_IsMainThread()) {
     nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(global);
     if (NS_WARN_IF(!window)) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
 
     nsCOMPtr<nsIGlobalObject> incumbent = mozilla::dom::GetIncumbentGlobal();
@@ -267,21 +265,16 @@ already_AddRefed<BroadcastChannel> Broad
     }
 
     aRv = PrincipalToPrincipalInfo(storagePrincipal, &storagePrincipalInfo);
     if (NS_WARN_IF(aRv.Failed())) {
       return nullptr;
     }
 
     storageAccess = nsContentUtils::StorageAllowedForWindow(window);
-
-    Document* doc = window->GetExtantDoc();
-    if (doc) {
-      cs = doc->CookieSettings();
-    }
   } else {
     JSContext* cx = aGlobal.Context();
 
     WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(cx);
     MOZ_ASSERT(workerPrivate);
 
     RefPtr<StrongWorkerRef> workerRef = StrongWorkerRef::Create(
         workerPrivate, "BroadcastChannel", [bc]() { bc->Shutdown(); });
@@ -298,25 +291,23 @@ already_AddRefed<BroadcastChannel> Broad
         new InitializeRunnable(tsr, origin, storagePrincipalInfo, aRv);
     runnable->Dispatch(Canceling, aRv);
     if (aRv.Failed()) {
       return nullptr;
     }
 
     storageAccess = workerPrivate->StorageAccess();
     bc->mWorkerRef = workerRef;
-
-    cs = workerPrivate->CookieSettings();
   }
 
   // We want to allow opaque origins.
   if (storagePrincipalInfo.type() != PrincipalInfo::TNullPrincipalInfo &&
       (storageAccess == nsContentUtils::StorageAccess::eDeny ||
-       (ShouldPartitionStorage(storageAccess) &&
-        !StoragePartitioningEnabled(storageAccess, cs)))) {
+       (storageAccess == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+        !StaticPrefs::privacy_storagePrincipal_enabledForTrackers()))) {
     aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
     return nullptr;
   }
 
   // Register this component to PBackground.
   PBackgroundChild* actorChild = BackgroundChild::GetOrCreateForCurrentThread();
   if (NS_WARN_IF(!actorChild)) {
     // Firefox is probably shutting down. Let's return a 'generic' error.
--- a/dom/clients/manager/ClientIPCUtils.h
+++ b/dom/clients/manager/ClientIPCUtils.h
@@ -31,13 +31,13 @@ struct ParamTraits<mozilla::dom::Visibil
     : public ContiguousEnumSerializer<
           mozilla::dom::VisibilityState, mozilla::dom::VisibilityState::Hidden,
           mozilla::dom::VisibilityState::EndGuard_> {};
 
 template <>
 struct ParamTraits<nsContentUtils::StorageAccess>
     : public ContiguousEnumSerializer<
           nsContentUtils::StorageAccess,
-          nsContentUtils::StorageAccess::ePartitionForeignOrDeny,
+          nsContentUtils::StorageAccess::ePartitionedOrDeny,
           nsContentUtils::StorageAccess::eNumValues> {};
 }  // namespace IPC
 
 #endif  // _mozilla_dom_ClientIPCUtils_h
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -16,17 +16,16 @@
 #include "mozilla/dom/IDBFactoryBinding.h"
 #include "mozilla/dom/quota/QuotaManager.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackground.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/StaticPrefs.h"
-#include "mozilla/StorageAccess.h"
 #include "mozilla/Telemetry.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsIAboutModule.h"
 #include "nsILoadContext.h"
 #include "nsIPrincipal.h"
@@ -301,19 +300,18 @@ nsresult IDBFactory::AllowedForWindowInt
 
   // the factory callsite records whether the browser is in private browsing.
   // and thus we don't have to respect that setting here. IndexedDB has no
   // concept of session-local storage, and thus ignores it.
   if (access == nsContentUtils::StorageAccess::eDeny) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
-  if (ShouldPartitionStorage(access) &&
-      !StoragePartitioningEnabled(access,
-                                  aWindow->GetExtantDoc()->CookieSettings())) {
+  if (access == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+      !StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(aWindow);
   MOZ_ASSERT(sop);
 
   nsCOMPtr<nsIPrincipal> principal = sop->GetEffectiveStoragePrincipal();
   if (NS_WARN_IF(!principal)) {
--- a/dom/security/ReferrerInfo.cpp
+++ b/dom/security/ReferrerInfo.cpp
@@ -13,17 +13,16 @@
 #include "nsIURIFixup.h"
 #include "nsIURL.h"
 #include "nsIURIMutator.h"
 
 #include "nsAlgorithm.h"
 #include "ReferrerInfo.h"
 
 #include "mozilla/AntiTrackingCommon.h"
-#include "mozilla/net/CookieSettings.h"
 #include "mozilla/net/HttpBaseChannel.h"
 
 static mozilla::LazyLogModule gReferrerInfoLog("ReferrerInfo");
 #define LOG(msg) MOZ_LOG(gReferrerInfoLog, mozilla::LogLevel::Debug, msg)
 #define LOG_ENABLED() MOZ_LOG_TEST(gReferrerInfoLog, mozilla::LogLevel::Debug)
 
 using namespace mozilla::net;
 
@@ -116,28 +115,19 @@ bool ReferrerInfo::HideOnionReferrerSour
 }
 
 /* static */
 uint32_t ReferrerInfo::GetDefaultReferrerPolicy(nsIHttpChannel* aChannel,
                                                 nsIURI* aURI,
                                                 bool privateBrowsing) {
   CachePreferrenceValue();
   bool thirdPartyTrackerIsolated = false;
-  nsCOMPtr<nsILoadInfo> loadInfo;
-  if (aChannel) {
-    loadInfo = aChannel->LoadInfo();
-  }
-  nsCOMPtr<nsICookieSettings> cs;
-  if (loadInfo) {
-    Unused << loadInfo->GetCookieSettings(getter_AddRefs(cs));
-  }
-  if (!cs) {
-    cs = net::CookieSettings::Create();
-  }
-  if (aChannel && aURI && cs->GetRejectThirdPartyTrackers()) {
+  if (StaticPrefs::network_cookie_cookieBehavior() ==
+          nsICookieService::BEHAVIOR_REJECT_TRACKER &&
+      aChannel && aURI) {
     uint32_t rejectedReason = 0;
     thirdPartyTrackerIsolated =
         !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
             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.)
   }
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -2025,17 +2025,18 @@ void RuntimeService::ResumeWorkersForWin
 }
 
 void RuntimeService::PropagateFirstPartyStorageAccessGranted(
     nsPIDOMWindowInner* aWindow) {
   AssertIsOnMainThread();
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT_IF(
       aWindow->GetExtantDoc(),
-      aWindow->GetExtantDoc()->CookieSettings()->GetRejectThirdPartyTrackers());
+      aWindow->GetExtantDoc()->CookieSettings()->GetCookieBehavior() ==
+          nsICookieService::BEHAVIOR_REJECT_TRACKER);
 
   nsTArray<WorkerPrivate*> workers;
   GetWorkersForWindow(aWindow, workers);
 
   for (uint32_t index = 0; index < workers.Length(); index++) {
     workers[index]->PropagateFirstPartyStorageAccessGranted();
   }
 }
@@ -2425,17 +2426,18 @@ void ResumeWorkersForWindow(nsPIDOMWindo
   }
 }
 
 void PropagateFirstPartyStorageAccessGrantedToWorkers(
     nsPIDOMWindowInner* aWindow) {
   AssertIsOnMainThread();
   MOZ_ASSERT_IF(
       aWindow->GetExtantDoc(),
-      aWindow->GetExtantDoc()->CookieSettings()->GetRejectThirdPartyTrackers());
+      aWindow->GetExtantDoc()->CookieSettings()->GetCookieBehavior() ==
+          nsICookieService::BEHAVIOR_REJECT_TRACKER);
 
   RuntimeService* runtime = RuntimeService::GetService();
   if (runtime) {
     runtime->PropagateFirstPartyStorageAccessGranted(aWindow);
   }
 }
 
 WorkerPrivate* GetWorkerPrivateFromContext(JSContext* aCx) {
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -27,17 +27,16 @@
 #include "mozilla/dom/SharedWorkerGlobalScopeBinding.h"
 #include "mozilla/dom/SimpleGlobalObject.h"
 #include "mozilla/dom/WorkerDebuggerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerLocation.h"
 #include "mozilla/dom/WorkerNavigator.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/StaticPrefs.h"
-#include "mozilla/StorageAccess.h"
 #include "nsServiceManagerUtils.h"
 
 #include "mozilla/dom/Document.h"
 #include "nsIServiceWorkerManager.h"
 #include "nsIScriptError.h"
 #include "nsIScriptTimeoutHandler.h"
 
 #ifdef ANDROID
@@ -402,18 +401,18 @@ already_AddRefed<IDBFactory> WorkerGloba
     nsContentUtils::StorageAccess access = mWorkerPrivate->StorageAccess();
 
     if (access == nsContentUtils::StorageAccess::eDeny) {
       NS_WARNING("IndexedDB is not allowed in this worker!");
       aErrorResult = NS_ERROR_DOM_SECURITY_ERR;
       return nullptr;
     }
 
-    if (ShouldPartitionStorage(access) &&
-        !StoragePartitioningEnabled(access, mWorkerPrivate->CookieSettings())) {
+    if (access == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+        !StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
       NS_WARNING("IndexedDB is not allowed in this worker!");
       aErrorResult = NS_ERROR_DOM_SECURITY_ERR;
       return nullptr;
     }
 
     const PrincipalInfo& principalInfo =
         mWorkerPrivate->GetEffectiveStoragePrincipalInfo();
 
--- a/dom/workers/sharedworkers/SharedWorker.cpp
+++ b/dom/workers/sharedworkers/SharedWorker.cpp
@@ -19,17 +19,16 @@
 #include "mozilla/dom/SharedWorkerChild.h"
 #include "mozilla/dom/WorkerBinding.h"
 #include "mozilla/dom/WorkerLoadInfo.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/ipc/URIUtils.h"
-#include "mozilla/StorageAccess.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindowInner.h"
 #include "nsPIDOMWindow.h"
 
 #ifdef XP_WIN
 #  undef PostMessage
 #endif
 
@@ -104,19 +103,18 @@ already_AddRefed<SharedWorker> SharedWor
   MOZ_ASSERT(window);
 
   auto storageAllowed = nsContentUtils::StorageAllowedForWindow(window);
   if (storageAllowed == nsContentUtils::StorageAccess::eDeny) {
     aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
     return nullptr;
   }
 
-  if (ShouldPartitionStorage(storageAllowed) &&
-      !StoragePartitioningEnabled(storageAllowed,
-                                  window->GetExtantDoc()->CookieSettings())) {
+  if (storageAllowed == nsContentUtils::StorageAccess::ePartitionedOrDeny &&
+      !StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
     aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
     return nullptr;
   }
 
   // Assert that the principal private browsing state matches the
   // StorageAccess value.
 #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
   if (storageAllowed == nsContentUtils::StorageAccess::ePrivateBrowsing) {
@@ -176,17 +174,17 @@ already_AddRefed<SharedWorker> SharedWor
                                            loadingPrincipalPreloadCSP);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   // Here, the StoragePrincipal is always equal to the SharedWorker's principal
   // because the channel is not opened yet, and, because of this, it's not
   // classified. We need to force the correct originAttributes.
-  if (ShouldPartitionStorage(storageAllowed)) {
+  if (storageAllowed == nsContentUtils::StorageAccess::ePartitionedOrDeny) {
     nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(window);
     if (!sop) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
 
     nsIPrincipal* windowPrincipal = sop->GetPrincipal();
     if (!windowPrincipal) {
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -143,29 +143,29 @@ void CookieServiceChild::ActorDestroy(Ac
 void CookieServiceChild::TrackCookieLoad(nsIChannel* aChannel) {
   if (!mIPCOpen) {
     return;
   }
 
   bool isForeign = false;
   bool isTrackingResource = false;
   bool firstPartyStorageAccessGranted = false;
-  uint32_t rejectedReason = 0;
   nsCOMPtr<nsIURI> uri;
   aChannel->GetURI(getter_AddRefs(uri));
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
   if (RequireThirdPartyCheck(loadInfo)) {
     mThirdPartyUtil->IsThirdPartyChannel(aChannel, uri, &isForeign);
   }
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     isTrackingResource = httpChannel->IsTrackingResource();
     // Check first-party storage access even for non-tracking resources, since
     // we will need the result when computing the access rights for the reject
     // foreign cookie behavior mode.
+    uint32_t rejectedReason = 0;
     if (isForeign && AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
                          httpChannel, uri, &rejectedReason)) {
       firstPartyStorageAccessGranted = true;
     }
 
     // We need to notify about the outcome of the content blocking check here
     // since the parent process can't do it for us as it won't have a channel
     // object handy.
@@ -177,18 +177,18 @@ void CookieServiceChild::TrackCookieLoad
   }
   mozilla::OriginAttributes attrs = loadInfo->GetOriginAttributes();
   StoragePrincipalHelper::PrepareOriginAttributes(aChannel, attrs);
   URIParams uriParams;
   SerializeURI(uri, uriParams);
   bool isSafeTopLevelNav = NS_IsSafeTopLevelNav(aChannel);
   bool isSameSiteForeign = NS_IsSameSiteForeign(aChannel, uri);
   SendPrepareCookieList(uriParams, isForeign, isTrackingResource,
-                        firstPartyStorageAccessGranted, rejectedReason,
-                        isSafeTopLevelNav, isSameSiteForeign, attrs);
+                        firstPartyStorageAccessGranted, isSafeTopLevelNav,
+                        isSameSiteForeign, attrs);
 }
 
 mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveAll() {
   mCookiesMap.Clear();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveCookie(
@@ -278,19 +278,18 @@ void CookieServiceChild::PrefChanged(nsI
     if (mCookieTimer) {
       mCookieTimer->SetDelay(gMoveCookiesIntervalSeconds * 1000);
     }
   }
 }
 
 void CookieServiceChild::GetCookieStringFromCookieHashTable(
     nsIURI* aHostURI, bool aIsForeign, bool aIsTrackingResource,
-    bool aFirstPartyStorageAccessGranted, uint32_t aRejectedReason,
-    bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, nsIChannel* aChannel,
-    nsCString& aCookieString) {
+    bool aFirstPartyStorageAccessGranted, bool aIsSafeTopLevelNav,
+    bool aIsSameSiteForeign, nsIChannel* aChannel, nsCString& aCookieString) {
   nsCOMPtr<nsIEffectiveTLDService> TLDService =
       do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
   NS_ASSERTION(TLDService, "Can't get TLDService");
   bool requireHostMatch;
   nsAutoCString baseDomain;
 
   nsCOMPtr<nsILoadInfo> loadInfo;
   mozilla::OriginAttributes attrs;
@@ -319,17 +318,17 @@ void CookieServiceChild::GetCookieString
   int64_t currentTime = currentTimeInUsec / PR_USEC_PER_SEC;
 
   nsCOMPtr<nsICookieSettings> cookieSettings =
       nsCookieService::GetCookieSettings(aChannel);
 
   CookieStatus cookieStatus = nsCookieService::CheckPrefs(
       cookieSettings, mThirdPartySession, mThirdPartyNonsecureSession, aHostURI,
       aIsForeign, aIsTrackingResource, aFirstPartyStorageAccessGranted, nullptr,
-      CountCookiesFromHashTable(baseDomain, attrs), attrs, &aRejectedReason);
+      CountCookiesFromHashTable(baseDomain, attrs), attrs, nullptr);
 
   if (cookieStatus != STATUS_ACCEPTED &&
       cookieStatus != STATUS_ACCEPT_SESSION) {
     return;
   }
 
   cookiesList->Sort(CompareCookiesForSending());
   for (uint32_t i = 0; i < cookiesList->Length(); i++) {
@@ -419,18 +418,16 @@ bool CookieServiceChild::RequireThirdPar
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
   uint32_t cookieBehavior = cookieSettings->GetCookieBehavior();
   return cookieBehavior == nsICookieService::BEHAVIOR_REJECT_FOREIGN ||
          cookieBehavior == nsICookieService::BEHAVIOR_LIMIT_FOREIGN ||
          cookieBehavior == nsICookieService::BEHAVIOR_REJECT_TRACKER ||
-         cookieBehavior ==
-             nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN ||
          mThirdPartySession || mThirdPartyNonsecureSession;
 }
 
 void CookieServiceChild::RecordDocumentCookie(nsCookie* aCookie,
                                               const OriginAttributes& aAttrs) {
   nsAutoCString baseDomain;
   nsCookieService::GetBaseDomainFromHost(mTLDService, aCookie->Host(),
                                          baseDomain);
@@ -487,36 +484,35 @@ nsresult CookieServiceChild::GetCookieSt
   bool isForeign = true;
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel ? aChannel->LoadInfo() : nullptr;
   if (RequireThirdPartyCheck(loadInfo)) {
     mThirdPartyUtil->IsThirdPartyChannel(aChannel, aHostURI, &isForeign);
   }
 
   bool isTrackingResource = false;
   bool firstPartyStorageAccessGranted = false;
-  uint32_t rejectedReason = 0;
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     isTrackingResource = httpChannel->IsTrackingResource();
     // Check first-party storage access even for non-tracking resources, since
     // we will need the result when computing the access rights for the reject
     // foreign cookie behavior mode.
     if (isForeign && AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-                         httpChannel, aHostURI, &rejectedReason)) {
+                         httpChannel, aHostURI, nullptr)) {
       firstPartyStorageAccessGranted = true;
     }
   }
 
   bool isSafeTopLevelNav = NS_IsSafeTopLevelNav(aChannel);
   bool isSameSiteForeign = NS_IsSameSiteForeign(aChannel, aHostURI);
 
   nsAutoCString result;
   GetCookieStringFromCookieHashTable(
       aHostURI, isForeign, isTrackingResource, firstPartyStorageAccessGranted,
-      rejectedReason, isSafeTopLevelNav, isSameSiteForeign, aChannel, result);
+      isSafeTopLevelNav, isSameSiteForeign, aChannel, result);
 
   if (!result.IsEmpty()) *aCookieString = ToNewCString(result);
 
   return NS_OK;
 }
 
 nsresult CookieServiceChild::SetCookieStringInternal(nsIURI* aHostURI,
                                                      nsIChannel* aChannel,
@@ -536,25 +532,24 @@ nsresult CookieServiceChild::SetCookieSt
   bool isForeign = true;
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel ? aChannel->LoadInfo() : nullptr;
   if (RequireThirdPartyCheck(loadInfo)) {
     mThirdPartyUtil->IsThirdPartyChannel(aChannel, aHostURI, &isForeign);
   }
 
   bool isTrackingResource = false;
   bool firstPartyStorageAccessGranted = false;
-  uint32_t rejectedReason = 0;
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     isTrackingResource = httpChannel->IsTrackingResource();
     // Check first-party storage access even for non-tracking resources, since
     // we will need the result when computing the access rights for the reject
     // foreign cookie behavior mode.
     if (isForeign && AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-                         httpChannel, aHostURI, &rejectedReason)) {
+                         httpChannel, aHostURI, nullptr)) {
       firstPartyStorageAccessGranted = true;
     }
   }
 
   nsDependentCString cookieString(aCookieString);
   nsDependentCString stringServerTime;
   if (aServerTime) stringServerTime.Rebind(aServerTime);
 
@@ -577,33 +572,33 @@ nsresult CookieServiceChild::SetCookieSt
 
   Maybe<LoadInfoArgs> optionalLoadInfoArgs;
   LoadInfoToLoadInfoArgs(loadInfo, &optionalLoadInfoArgs);
 
   // Asynchronously call the parent.
   if (mIPCOpen) {
     SendSetCookieString(hostURIParams, channelURIParams, optionalLoadInfoArgs,
                         isForeign, isTrackingResource,
-                        firstPartyStorageAccessGranted, rejectedReason, attrs,
-                        cookieString, stringServerTime, aFromHttp);
+                        firstPartyStorageAccessGranted, attrs, cookieString,
+                        stringServerTime, aFromHttp);
   }
 
   bool requireHostMatch;
   nsCString baseDomain;
   nsCookieService::GetBaseDomain(mTLDService, aHostURI, baseDomain,
                                  requireHostMatch);
 
   nsCOMPtr<nsICookieSettings> cookieSettings =
       nsCookieService::GetCookieSettings(aChannel);
 
   CookieStatus cookieStatus = nsCookieService::CheckPrefs(
       cookieSettings, mThirdPartySession, mThirdPartyNonsecureSession, aHostURI,
       isForeign, isTrackingResource, firstPartyStorageAccessGranted,
       aCookieString, CountCookiesFromHashTable(baseDomain, attrs), attrs,
-      &rejectedReason);
+      nullptr);
 
   if (cookieStatus != STATUS_ACCEPTED &&
       cookieStatus != STATUS_ACCEPT_SESSION) {
     return NS_OK;
   }
 
   nsCookieKey key(baseDomain, attrs);
   CookiesList* cookies = mCookiesMap.Get(key);
--- a/netwerk/cookie/CookieServiceChild.h
+++ b/netwerk/cookie/CookieServiceChild.h
@@ -58,19 +58,18 @@ class CookieServiceChild : public PCooki
                      nsCString& aOriginatingSpec,
                      nsCString& aOriginatingCharset);
 
   nsresult GetCookieStringInternal(nsIURI* aHostURI, nsIChannel* aChannel,
                                    char** aCookieString);
 
   void GetCookieStringFromCookieHashTable(
       nsIURI* aHostURI, bool aIsForeign, bool aIsTrackingResource,
-      bool aFirstPartyStorageAccessGranted, uint32_t aRejectedReason,
-      bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, nsIChannel* aChannel,
-      nsCString& aCookieString);
+      bool aFirstPartyStorageAccessGranted, bool aIsSafeTopLevelNav,
+      bool aIsSameSiteForeign, nsIChannel* aChannel, nsCString& aCookieString);
 
   nsresult SetCookieStringInternal(nsIURI* aHostURI, nsIChannel* aChannel,
                                    const char* aCookieString,
                                    const char* aServerTime, bool aFromHttp);
 
   void RecordDocumentCookie(nsCookie* aCookie, const OriginAttributes& aAttrs);
 
   void SetCookieInternal(nsCookieAttributes& aCookieAttributes,
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -132,34 +132,32 @@ void CookieServiceParent::TrackCookieLoa
   // Send matching cookies to Child.
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil;
   thirdPartyUtil = do_GetService(THIRDPARTYUTIL_CONTRACTID);
   bool isForeign = true;
   thirdPartyUtil->IsThirdPartyChannel(aChannel, uri, &isForeign);
 
   bool isTrackingResource = false;
   bool storageAccessGranted = false;
-  uint32_t rejectedReason = 0;
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     isTrackingResource = httpChannel->IsTrackingResource();
     // Check first-party storage access even for non-tracking resources, since
     // we will need the result when computing the access rights for the reject
     // foreign cookie behavior mode.
-    if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-            httpChannel, uri, &rejectedReason)) {
+    if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(httpChannel,
+                                                                uri, nullptr)) {
       storageAccessGranted = true;
     }
   }
 
   nsTArray<nsCookie*> foundCookieList;
-  mCookieService->GetCookiesForURI(uri, aChannel, isForeign, isTrackingResource,
-                                   storageAccessGranted, rejectedReason,
-                                   isSafeTopLevelNav, aIsSameSiteForeign, false,
-                                   attrs, foundCookieList);
+  mCookieService->GetCookiesForURI(
+      uri, aChannel, isForeign, isTrackingResource, storageAccessGranted,
+      isSafeTopLevelNav, aIsSameSiteForeign, false, attrs, foundCookieList);
   nsTArray<CookieStruct> matchingCookiesList;
   SerialializeCookieList(foundCookieList, matchingCookiesList, uri);
   Unused << SendTrackCookiesLoad(matchingCookiesList, attrs);
 }
 
 void CookieServiceParent::SerialializeCookieList(
     const nsTArray<nsCookie*>& aFoundCookieList,
     nsTArray<CookieStruct>& aCookiesList, nsIURI* aHostURI) {
@@ -179,47 +177,45 @@ void CookieServiceParent::SerialializeCo
     cookieStruct->isSecure() = cookie->IsSecure();
     cookieStruct->sameSite() = cookie->SameSite();
   }
 }
 
 mozilla::ipc::IPCResult CookieServiceParent::RecvPrepareCookieList(
     const URIParams& aHost, const bool& aIsForeign,
     const bool& aIsTrackingResource,
-    const bool& aFirstPartyStorageAccessGranted,
-    const uint32_t& aRejectedReason, const bool& aIsSafeTopLevelNav,
+    const bool& aFirstPartyStorageAccessGranted, const bool& aIsSafeTopLevelNav,
     const bool& aIsSameSiteForeign, const OriginAttributes& aAttrs) {
   nsCOMPtr<nsIURI> hostURI = DeserializeURI(aHost);
 
   // Send matching cookies to Child.
   nsTArray<nsCookie*> foundCookieList;
   // Note: passing nullptr as aChannel to GetCookiesForURI() here is fine since
   // this argument is only used for proper reporting of cookie loads, but the
   // child process already does the necessary reporting in this case for us.
   mCookieService->GetCookiesForURI(
       hostURI, nullptr, aIsForeign, aIsTrackingResource,
-      aFirstPartyStorageAccessGranted, aRejectedReason, aIsSafeTopLevelNav,
-      aIsSameSiteForeign, false, aAttrs, foundCookieList);
+      aFirstPartyStorageAccessGranted, aIsSafeTopLevelNav, aIsSameSiteForeign,
+      false, aAttrs, foundCookieList);
   nsTArray<CookieStruct> matchingCookiesList;
   SerialializeCookieList(foundCookieList, matchingCookiesList, hostURI);
   Unused << SendTrackCookiesLoad(matchingCookiesList, aAttrs);
   return IPC_OK();
 }
 
 void CookieServiceParent::ActorDestroy(ActorDestroyReason aWhy) {
   // Nothing needed here. Called right before destructor since this is a
   // non-refcounted class.
 }
 
 mozilla::ipc::IPCResult CookieServiceParent::RecvSetCookieString(
     const URIParams& aHost, const Maybe<URIParams>& aChannelURI,
     const Maybe<LoadInfoArgs>& aLoadInfoArgs, const bool& aIsForeign,
     const bool& aIsTrackingResource,
-    const bool& aFirstPartyStorageAccessGranted,
-    const uint32_t& aRejectedReason, const OriginAttributes& aAttrs,
+    const bool& aFirstPartyStorageAccessGranted, const OriginAttributes& aAttrs,
     const nsCString& aCookieString, const nsCString& aServerTime,
     const bool& aFromHttp) {
   if (!mCookieService) return IPC_OK();
 
   // Deserialize URI. Having a host URI is mandatory and should always be
   // provided by the child; thus we consider failure fatal.
   nsCOMPtr<nsIURI> hostURI = DeserializeURI(aHost);
   if (!hostURI) return IPC_FAIL_NO_REASON(this);
@@ -248,16 +244,15 @@ mozilla::ipc::IPCResult CookieServicePar
   // NB: dummyChannel could be null if something failed in CreateDummyChannel.
   nsDependentCString cookieString(aCookieString, 0);
 
   // We set this to true while processing this cookie update, to make sure
   // we don't send it back to the same content process.
   mProcessingCookie = true;
   mCookieService->SetCookieStringInternal(
       hostURI, aIsForeign, aIsTrackingResource, aFirstPartyStorageAccessGranted,
-      aRejectedReason, cookieString, aServerTime, aFromHttp, aAttrs,
-      dummyChannel);
+      cookieString, aServerTime, aFromHttp, aAttrs, dummyChannel);
   mProcessingCookie = false;
   return IPC_OK();
 }
 
 }  // namespace net
 }  // namespace mozilla
--- a/netwerk/cookie/CookieServiceParent.h
+++ b/netwerk/cookie/CookieServiceParent.h
@@ -44,26 +44,25 @@ class CookieServiceParent : public PCook
  protected:
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   mozilla::ipc::IPCResult RecvSetCookieString(
       const URIParams& aHost, const Maybe<URIParams>& aChannelURI,
       const Maybe<LoadInfoArgs>& aLoadInfoArgs, const bool& aIsForeign,
       const bool& aIsTrackingResource,
       const bool& aFirstPartyStorageAccessGranted,
-      const uint32_t& aRejectedReason, const OriginAttributes& aAttrs,
-      const nsCString& aCookieString, const nsCString& aServerTime,
-      const bool& aFromHttp);
+      const OriginAttributes& aAttrs, const nsCString& aCookieString,
+      const nsCString& aServerTime, const bool& aFromHttp);
 
   mozilla::ipc::IPCResult RecvPrepareCookieList(
       const URIParams& aHost, const bool& aIsForeign,
       const bool& aIsTrackingResource,
       const bool& aFirstPartyStorageAccessGranted,
-      const uint32_t& aRejectedReason, const bool& aIsSafeTopLevelNav,
-      const bool& aIsSameSiteForeign, const OriginAttributes& aAttrs);
+      const bool& aIsSafeTopLevelNav, const bool& aIsSameSiteForeign,
+      const OriginAttributes& aAttrs);
 
   void SerialializeCookieList(const nsTArray<nsCookie*>& aFoundCookieList,
                               nsTArray<CookieStruct>& aCookiesList,
                               nsIURI* aHostURI);
 
   RefPtr<nsCookieService> mCookieService;
   bool mProcessingCookie;
 };
--- a/netwerk/cookie/CookieSettings.cpp
+++ b/netwerk/cookie/CookieSettings.cpp
@@ -100,25 +100,16 @@ CookieSettings::~CookieSettings() {
 
 NS_IMETHODIMP
 CookieSettings::GetCookieBehavior(uint32_t* aCookieBehavior) {
   *aCookieBehavior = mCookieBehavior;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-CookieSettings::GetRejectThirdPartyTrackers(bool* aRejectThirdPartyTrackers) {
-  *aRejectThirdPartyTrackers =
-      mCookieBehavior == nsICookieService::BEHAVIOR_REJECT_TRACKER ||
-      mCookieBehavior ==
-          nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 CookieSettings::CookiePermission(nsIPrincipal* aPrincipal,
                                  uint32_t* aCookiePermission) {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_ARG_POINTER(aPrincipal);
   NS_ENSURE_ARG_POINTER(aCookiePermission);
 
   *aCookiePermission = nsIPermissionManager::UNKNOWN_ACTION;
 
--- a/netwerk/cookie/PCookieService.ipdl
+++ b/netwerk/cookie/PCookieService.ipdl
@@ -70,27 +70,25 @@ parent:
    * @see mozIThirdPartyUtil.isThirdPartyChannel
    */
   nested(inside_cpow) async SetCookieString(URIParams host,
                                             URIParams? channelURI,
                                             LoadInfoArgs? loadInfoArgs,
                                             bool isForeign,
                                             bool isTrackingResource,
                                             bool firstPartyStorageAccessGranted,
-                                            uint32_t rejectedReason,
                                             OriginAttributes aStoragePrincipalAttrs,
                                             nsCString cookieString,
                                             nsCString serverTime,
                                             bool aFromHttp);
 
   async PrepareCookieList(URIParams host,
                           bool isForeign,
                           bool isTrackingResource,
                           bool firstPartyStorageAccessGranted,
-                          uint32_t rejectedReason,
                           bool isSafeTopLevelNav,
                           bool isSameSiteForeign,
                           OriginAttributes attrs);
 
   async __delete__();
 
 child:
   async TrackCookiesLoad(CookieStruct[] cookiesList,
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/AntiTrackingCommon.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Likely.h"
 #include "mozilla/Printf.h"
-#include "mozilla/StorageAccess.h"
 #include "mozilla/Unused.h"
 
 #include "mozilla/net/CookieSettings.h"
 #include "mozilla/net/CookieServiceChild.h"
 #include "mozilla/net/NeckoCommon.h"
 
 #include "nsCookieService.h"
 #include "nsContentUtils.h"
@@ -1970,43 +1969,41 @@ nsresult nsCookieService::GetCookieStrin
   NS_ENSURE_ARG(aCookie);
 
   // Determine whether the request is foreign. Failure is acceptable.
   bool isForeign = true;
   mThirdPartyUtil->IsThirdPartyChannel(aChannel, aHostURI, &isForeign);
 
   bool isTrackingResource = false;
   bool firstPartyStorageAccessGranted = false;
-  uint32_t rejectedReason = 0;
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     isTrackingResource = httpChannel->IsTrackingResource();
 
     // Check first-party storage access even for non-tracking resources, since
     // we will need the result when computing the access rights for the reject
     // foreign cookie behavior mode.
     if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-            httpChannel, aHostURI, &rejectedReason)) {
+            httpChannel, aHostURI, nullptr)) {
       firstPartyStorageAccessGranted = true;
     }
   }
 
   OriginAttributes attrs;
   if (aChannel) {
     NS_GetOriginAttributes(aChannel, attrs,
                            true /* considering storage principal */);
   }
 
   bool isSafeTopLevelNav = NS_IsSafeTopLevelNav(aChannel);
   bool isSameSiteForeign = NS_IsSameSiteForeign(aChannel, aHostURI);
   nsAutoCString result;
   GetCookieStringInternal(aHostURI, aChannel, isForeign, isTrackingResource,
-                          firstPartyStorageAccessGranted, rejectedReason,
-                          isSafeTopLevelNav, isSameSiteForeign, aHttpBound,
-                          attrs, result);
+                          firstPartyStorageAccessGranted, isSafeTopLevelNav,
+                          isSameSiteForeign, aHttpBound, attrs, result);
   *aCookie = result.IsEmpty() ? nullptr : ToNewCString(result);
   return NS_OK;
 }
 
 // static
 already_AddRefed<nsICookieSettings> nsCookieService::GetCookieSettings(
     nsIChannel* aChannel) {
   nsCOMPtr<nsICookieSettings> cookieSettings;
@@ -2092,50 +2089,48 @@ nsresult nsCookieService::SetCookieStrin
   NS_ENSURE_ARG(aCookieHeader);
 
   // Determine whether the request is foreign. Failure is acceptable.
   bool isForeign = true;
   mThirdPartyUtil->IsThirdPartyChannel(aChannel, aHostURI, &isForeign);
 
   bool isTrackingResource = false;
   bool firstPartyStorageAccessGranted = false;
-  uint32_t rejectedReason = 0;
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     isTrackingResource = httpChannel->IsTrackingResource();
 
     // Check first-party storage access even for non-tracking resources, since
     // we will need the result when computing the access rights for the reject
     // foreign cookie behavior mode.
     if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-            httpChannel, aHostURI, &rejectedReason)) {
+            httpChannel, aHostURI, nullptr)) {
       firstPartyStorageAccessGranted = true;
     }
   }
 
   OriginAttributes attrs;
   if (aChannel) {
     NS_GetOriginAttributes(aChannel, attrs,
                            true /* considering storage principal */);
   }
 
   nsDependentCString cookieString(aCookieHeader);
   nsDependentCString serverTime(aServerTime ? aServerTime : "");
   SetCookieStringInternal(aHostURI, isForeign, isTrackingResource,
-                          firstPartyStorageAccessGranted, rejectedReason,
-                          cookieString, serverTime, aFromHttp, attrs, aChannel);
+                          firstPartyStorageAccessGranted, cookieString,
+                          serverTime, aFromHttp, attrs, aChannel);
   return NS_OK;
 }
 
 void nsCookieService::SetCookieStringInternal(
     nsIURI* aHostURI, bool aIsForeign, bool aIsTrackingResource,
-    bool aFirstPartyStorageAccessGranted, uint32_t aRejectedReason,
-    nsDependentCString& aCookieHeader, const nsCString& aServerTime,
-    bool aFromHttp, const OriginAttributes& aOriginAttrs,
-    nsIChannel* aChannel) {
+    bool aFirstPartyStorageAccessGranted, nsDependentCString& aCookieHeader,
+    const nsCString& aServerTime, bool aFromHttp,
+    const OriginAttributes& aOriginAttrs, nsIChannel* aChannel) {
   NS_ASSERTION(aHostURI, "null host!");
 
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return;
   }
 
   EnsureReadComplete(true);
@@ -2159,17 +2154,17 @@ void nsCookieService::SetCookieStringInt
     return;
   }
 
   nsCookieKey key(baseDomain, aOriginAttrs);
   nsCOMPtr<nsICookieSettings> cookieSettings = GetCookieSettings(aChannel);
 
   // check default prefs
   uint32_t priorCookieCount = 0;
-  uint32_t rejectedReason = aRejectedReason;
+  uint32_t rejectedReason = 0;
   nsAutoCString hostFromURI;
   aHostURI->GetHost(hostFromURI);
   CountCookiesFromHost(hostFromURI, &priorCookieCount);
   CookieStatus cookieStatus = CheckPrefs(
       cookieSettings, mThirdPartySession, mThirdPartyNonsecureSession, aHostURI,
       aIsForeign, aIsTrackingResource, aFirstPartyStorageAccessGranted,
       aCookieHeader.get(), priorCookieCount, aOriginAttrs, &rejectedReason);
 
@@ -3019,19 +3014,18 @@ bool nsCookieService::PathMatches(nsCook
   // either the paths match exactly, or the cookie path is a prefix of
   // the given path.
   return true;
 }
 
 void nsCookieService::GetCookiesForURI(
     nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
     bool aIsTrackingResource, bool aFirstPartyStorageAccessGranted,
-    uint32_t aRejectedReason, bool aIsSafeTopLevelNav, bool aIsSameSiteForeign,
-    bool aHttpBound, const OriginAttributes& aOriginAttrs,
-    nsTArray<nsCookie*>& aCookieList) {
+    bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, bool aHttpBound,
+    const OriginAttributes& aOriginAttrs, nsTArray<nsCookie*>& aCookieList) {
   NS_ASSERTION(aHostURI, "null host!");
 
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return;
   }
 
   EnsureReadComplete(true);
@@ -3055,17 +3049,17 @@ void nsCookieService::GetCookiesForURI(
     COOKIE_LOGFAILURE(GET_COOKIE, aHostURI, nullptr,
                       "invalid host/path from URI");
     return;
   }
 
   nsCOMPtr<nsICookieSettings> cookieSettings = GetCookieSettings(aChannel);
 
   // check default prefs
-  uint32_t rejectedReason = aRejectedReason;
+  uint32_t rejectedReason = 0;
   uint32_t priorCookieCount = 0;
   CountCookiesFromHost(hostFromURI, &priorCookieCount);
   CookieStatus cookieStatus = CheckPrefs(
       cookieSettings, mThirdPartySession, mThirdPartyNonsecureSession, aHostURI,
       aIsForeign, aIsTrackingResource, aFirstPartyStorageAccessGranted, nullptr,
       priorCookieCount, aOriginAttrs, &rejectedReason);
 
   MOZ_ASSERT_IF(rejectedReason, cookieStatus == STATUS_REJECTED);
@@ -3194,24 +3188,23 @@ void nsCookieService::GetCookiesForURI(
   // this is required per RFC2109.  if cookies match in length,
   // then sort by creation time (see bug 236772).
   aCookieList.Sort(CompareCookiesForSending());
 }
 
 void nsCookieService::GetCookieStringInternal(
     nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
     bool aIsTrackingResource, bool aFirstPartyStorageAccessGranted,
-    uint32_t aRejectedReason, bool aIsSafeTopLevelNav, bool aIsSameSiteForeign,
-    bool aHttpBound, const OriginAttributes& aOriginAttrs,
-    nsCString& aCookieString) {
+    bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, bool aHttpBound,
+    const OriginAttributes& aOriginAttrs, nsCString& aCookieString) {
   AutoTArray<nsCookie*, 8> foundCookieList;
   GetCookiesForURI(aHostURI, aChannel, aIsForeign, aIsTrackingResource,
-                   aFirstPartyStorageAccessGranted, aRejectedReason,
-                   aIsSafeTopLevelNav, aIsSameSiteForeign, aHttpBound,
-                   aOriginAttrs, foundCookieList);
+                   aFirstPartyStorageAccessGranted, aIsSafeTopLevelNav,
+                   aIsSameSiteForeign, aHttpBound, aOriginAttrs,
+                   foundCookieList);
 
   nsCookie* cookie;
   for (uint32_t i = 0; i < foundCookieList.Length(); ++i) {
     cookie = foundCookieList.ElementAt(i);
 
     // check if we have anything to write
     if (!cookie->Name().IsEmpty() || !cookie->Value().IsEmpty()) {
       // if we've already added a cookie to the return list, append a "; " so
@@ -4003,19 +3996,22 @@ static inline bool IsSubdomainOf(const n
 CookieStatus nsCookieService::CheckPrefs(
     nsICookieSettings* aCookieSettings, bool aThirdPartySession,
     bool aThirdPartyNonsecureSession, nsIURI* aHostURI, bool aIsForeign,
     bool aIsTrackingResource, bool aFirstPartyStorageAccessGranted,
     const char* aCookieHeader, const int aNumOfCookies,
     const OriginAttributes& aOriginAttrs, uint32_t* aRejectedReason) {
   nsresult rv;
 
-  MOZ_ASSERT(aRejectedReason);
-
-  uint32_t aInputRejectedReason = *aRejectedReason;
+  // Let's use a internal value in order to avoid a null check on
+  // aRejectedReason everywhere.
+  uint32_t rejectedReason = 0;
+  if (!aRejectedReason) {
+    aRejectedReason = &rejectedReason;
+  }
 
   *aRejectedReason = 0;
 
   // don't let ftp sites get/set cookies (could be a security issue)
   bool ftp;
   if (NS_SUCCEEDED(aHostURI->SchemeIs("ftp", &ftp)) && ftp) {
     COOKIE_LOGFAILURE(aCookieHeader ? SET_COOKIE : GET_COOKIE, aHostURI,
                       aCookieHeader, "ftp sites cannot read cookies");
@@ -4049,18 +4045,19 @@ CookieStatus nsCookieService::CheckPrefs
         return STATUS_ACCEPTED;
     }
   }
 
   // No cookies allowed if this request comes from a tracker, in a 3rd party
   // context, when anti-tracking protection is enabled and when we don't have
   // access to the first-party cookie jar.
   if (aIsForeign && aIsTrackingResource && !aFirstPartyStorageAccessGranted &&
-      aCookieSettings->GetRejectThirdPartyTrackers()) {
-    if (StoragePartitioningEnabled(aInputRejectedReason, aCookieSettings)) {
+      aCookieSettings->GetCookieBehavior() ==
+          nsICookieService::BEHAVIOR_REJECT_TRACKER) {
+    if (StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
       MOZ_ASSERT(!aOriginAttrs.mFirstPartyDomain.IsEmpty(),
                  "We must have a StoragePrincipal here!");
       return STATUS_ACCEPTED;
     }
 
     COOKIE_LOGFAILURE(aCookieHeader ? SET_COOKIE : GET_COOKIE, aHostURI,
                       aCookieHeader, "cookies are disabled in trackers");
     *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER;
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -268,19 +268,18 @@ class nsCookieService final : public nsI
   static int64_t ParseServerTime(const nsCString& aServerTime);
 
   static already_AddRefed<nsICookieSettings> GetCookieSettings(
       nsIChannel* aChannel);
 
   void GetCookiesForURI(nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
                         bool aIsTrackingResource,
                         bool aFirstPartyStorageAccessGranted,
-                        uint32_t aRejectedReason, bool aIsSafeTopLevelNav,
-                        bool aIsSameSiteForeign, bool aHttpBound,
-                        const OriginAttributes& aOriginAttrs,
+                        bool aIsSafeTopLevelNav, bool aIsSameSiteForeign,
+                        bool aHttpBound, const OriginAttributes& aOriginAttrs,
                         nsTArray<nsCookie*>& aCookieList);
 
  protected:
   virtual ~nsCookieService();
 
   void PrefChanged(nsIPrefBranch* aPrefBranch);
   void InitDBStates();
   OpenDBResult TryInitDB(bool aDeleteExistingDB);
@@ -302,28 +301,26 @@ class nsCookieService final : public nsI
       mozIStorageStatement* aRow, const OriginAttributes& aOriginAttributes);
   void EnsureReadComplete(bool aInitDBConn);
   nsresult NormalizeHost(nsCString& aHost);
   nsresult GetCookieStringCommon(nsIURI* aHostURI, nsIChannel* aChannel,
                                  bool aHttpBound, char** aCookie);
   void GetCookieStringInternal(nsIURI* aHostURI, nsIChannel* aChannel,
                                bool aIsForeign, bool aIsTrackingResource,
                                bool aFirstPartyStorageAccessGranted,
-                               uint32_t aRejectedReason,
                                bool aIsSafeTopLevelNav, bool aIsSameSiteForeign,
                                bool aHttpBound,
                                const OriginAttributes& aOriginAttrs,
                                nsCString& aCookie);
   nsresult SetCookieStringCommon(nsIURI* aHostURI, const char* aCookieHeader,
                                  const char* aServerTime, nsIChannel* aChannel,
                                  bool aFromHttp);
   void SetCookieStringInternal(nsIURI* aHostURI, bool aIsForeign,
                                bool aIsTrackingResource,
                                bool aFirstPartyStorageAccessGranted,
-                               uint32_t aRejectedReason,
                                nsDependentCString& aCookieHeader,
                                const nsCString& aServerTime, bool aFromHttp,
                                const OriginAttributes& aOriginAttrs,
                                nsIChannel* aChannel);
   bool SetCookieInternal(nsIURI* aHostURI, const nsCookieKey& aKey,
                          bool aRequireHostMatch, CookieStatus aStatus,
                          nsDependentCString& aCookieHeader, int64_t aServerTime,
                          bool aFromHttp, nsIChannel* aChannel);
--- a/netwerk/cookie/nsICookieService.idl
+++ b/netwerk/cookie/nsICookieService.idl
@@ -85,19 +85,18 @@ interface nsICookieService : nsISupports
    * Possible values for the "network.cookie.cookieBehavior" preference.
    */
   const uint32_t BEHAVIOR_ACCEPT         = 0; // allow all cookies
   const uint32_t BEHAVIOR_REJECT_FOREIGN = 1; // reject all third-party cookies
   const uint32_t BEHAVIOR_REJECT         = 2; // reject all cookies
   const uint32_t BEHAVIOR_LIMIT_FOREIGN  = 3; // reject third-party cookies unless the
                                               // eTLD already has at least one cookie
   const uint32_t BEHAVIOR_REJECT_TRACKER = 4; // reject trackers
-  const uint32_t BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN = 5; // reject trackers, partition third-party cookies
   // When adding a new cookie behavior, please increase this value!
-  const uint32_t BEHAVIOR_LAST           = 5;
+  const uint32_t BEHAVIOR_LAST           = 4;
 
   /*
    * Possible values for the "network.cookie.lifetimePolicy" preference.
    */
   const uint32_t ACCEPT_NORMALLY   = 0; // accept normally
   // Value = 1 is considered the same as 0 (See Bug 606655).
   const uint32_t ACCEPT_SESSION    = 2; // downgrade to session
   // Value = 3 is considered the same as 0
--- a/netwerk/cookie/nsICookieSettings.idl
+++ b/netwerk/cookie/nsICookieSettings.idl
@@ -17,19 +17,14 @@ interface nsICookieSettings : nsISupport
   /**
    * CookieBehavior at the loading of the document. Any other loadInfo
    * inherits it from its document's loadInfo. If there is not a document
    * involved, cookieBehavior is reject.
    */
   [infallible] readonly attribute unsigned long cookieBehavior;
 
   /**
-   * Whether our cookie behavior mandates rejecting third-party trackers.
-   */
-  [infallible] readonly attribute boolean rejectThirdPartyTrackers;
-
-  /**
    * CookiePermission at the loading of the document for a particular
    * principal. It returns the same cookiePermission also in case it changes
    * during the life-time of the top document.
    */
   unsigned long cookiePermission(in nsIPrincipal aPrincipal);
 };
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -117,17 +117,16 @@
 #include "nsIMultiplexInputStream.h"
 #include "../../cache2/CacheFileUtils.h"
 #include "../../cache2/CacheHashUtils.h"
 #include "nsINetworkLinkService.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ServiceWorkerUtils.h"
 #include "mozilla/net/AsyncUrlChannelClassifier.h"
-#include "mozilla/net/CookieSettings.h"
 #include "mozilla/net/NeckoChannelParams.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "nsIWebNavigation.h"
 #include "HttpTrafficAnalyzer.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/WindowGlobalParent.h"
 
 #ifdef MOZ_TASK_TRACER
@@ -10219,24 +10218,18 @@ nsresult nsHttpChannel::RedirectToInterc
 
     PopRedirectAsyncFunc(&nsHttpChannel::ContinueAsyncRedirectChannelToURI);
   }
 
   return rv;
 }
 
 void nsHttpChannel::ReEvaluateReferrerAfterTrackingStatusIsKnown() {
-  nsCOMPtr<nsICookieSettings> cs;
-  if (mLoadInfo) {
-    Unused << mLoadInfo->GetCookieSettings(getter_AddRefs(cs));
-  }
-  if (!cs) {
-    cs = net::CookieSettings::Create();
-  }
-  if (cs->GetRejectThirdPartyTrackers()) {
+  if (StaticPrefs::network_cookie_cookieBehavior() ==
+      nsICookieService::BEHAVIOR_REJECT_TRACKER) {
     bool isPrivate =
         mLoadInfo && mLoadInfo->GetOriginAttributes().mPrivateBrowsingId > 0;
     // If our referrer has been set before, and our referrer policy is unset
     // (default policy) if we thought the channel wasn't a third-party
     // tracking channel, we may need to set our referrer with referrer policy
     // once again to ensure our defaults properly take effect now.
     if (mReferrerInfo) {
       dom::ReferrerInfo* referrerInfo =
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -420,18 +420,16 @@ void ReportBlockingToConsole(nsPIDOMWind
                              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_PARTITIONED_FOREIGN ||
       aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
       aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN);
 
   nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();
   if (NS_WARN_IF(!docShell)) {
     return;
   }
 
@@ -781,21 +779,22 @@ AntiTrackingCommon::AddFirstPartyStorage
   LOG(("Adding a first-party storage exception for %s...",
        PromiseFlatCString(origin).get()));
 
   Document* parentDoc = aParentWindow->GetExtantDoc();
   if (!parentDoc) {
     LOG(("Parent window has no doc"));
     return StorageAccessGrantPromise::CreateAndReject(false, __func__);
   }
-  if (!parentDoc->CookieSettings()->GetRejectThirdPartyTrackers()) {
+  auto cookieBehavior = parentDoc->CookieSettings()->GetCookieBehavior();
+  if (cookieBehavior != nsICookieService::BEHAVIOR_REJECT_TRACKER) {
     LOG(
         ("Disabled by network.cookie.cookieBehavior pref (%d), bailing out "
          "early",
-         parentDoc->CookieSettings()->GetCookieBehavior()));
+         cookieBehavior));
     return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
   }
 
   if (CheckContentBlockingAllowList(aParentWindow)) {
     return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
   }
 
   nsCOMPtr<nsIPrincipal> topLevelStoragePrincipal;
@@ -1184,21 +1183,18 @@ 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 and BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN,
-  // third-partiness is implicily checked later below.
-  if (behavior != nsICookieService::BEHAVIOR_REJECT_TRACKER &&
-      behavior !=
-          nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN) {
+  // 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;
     }
   }
 
   if (behavior == nsICookieService::BEHAVIOR_REJECT_FOREIGN ||
@@ -1207,41 +1203,21 @@ bool AntiTrackingCommon::IsFirstPartySto
     // 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.
     LOG(("Nothing more to do due to the behavior code %d", int(behavior)));
     *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN;
     return false;
   }
 
-  MOZ_ASSERT(
-      behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER ||
-      behavior ==
-          nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN);
+  MOZ_ASSERT(behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER);
 
-  if (behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER) {
-    if (!nsContentUtils::IsThirdPartyTrackingResourceWindow(aWindow)) {
-      LOG(("Our window isn't a third-party tracking window"));
-      return true;
-    }
-  } else {
-    MOZ_ASSERT(behavior ==
-               nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN);
-    if (nsContentUtils::IsThirdPartyTrackingResourceWindow(aWindow)) {
-      // fall through
-    } else if (nsContentUtils::IsThirdPartyWindowOrChannel(aWindow, nullptr,
-                                                           aURI)) {
-      LOG(("We're in the third-party context, storage should be partitioned"));
-      *aRejectedReason =
-          nsIWebProgressListener::STATE_COOKIES_PARTITIONED_FOREIGN;
-      return false;
-    } else {
-      LOG(("Our window isn't a third-party window, storage is allowed"));
-      return true;
-    }
+  if (!nsContentUtils::IsThirdPartyTrackingResourceWindow(aWindow)) {
+    LOG(("Our window isn't a third-party tracking window"));
+    return true;
   }
 
 #ifdef DEBUG
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil = services::GetThirdPartyUtil();
   if (thirdPartyUtil) {
     bool thirdParty = false;
     nsresult rv = thirdPartyUtil->IsThirdPartyWindow(aWindow->GetOuterWindow(),
                                                      aURI, &thirdParty);
@@ -1464,42 +1440,22 @@ bool AntiTrackingCommon::IsFirstPartySto
     // 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.
     LOG(("Nothing more to do due to the behavior code %d", int(behavior)));
     *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN;
     return false;
   }
 
-  MOZ_ASSERT(
-      behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER ||
-      behavior ==
-          nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN);
+  MOZ_ASSERT(behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER);
 
   // Not a tracker.
-  if (behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER) {
-    if (!aChannel->IsThirdPartyTrackingResource()) {
-      LOG(("Our channel isn't a third-party tracking channel"));
-      return true;
-    }
-  } else {
-    MOZ_ASSERT(behavior ==
-               nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN);
-    if (aChannel->IsThirdPartyTrackingResource()) {
-      // fall through
-    } else if (nsContentUtils::IsThirdPartyWindowOrChannel(nullptr, aChannel,
-                                                           aURI)) {
-      LOG(("We're in the third-party context, storage should be partitioned"));
-      *aRejectedReason =
-          nsIWebProgressListener::STATE_COOKIES_PARTITIONED_FOREIGN;
-      return false;
-    } else {
-      LOG(("Our channel isn't a third-party channel, storage is allowed"));
-      return true;
-    }
+  if (!aChannel->IsThirdPartyTrackingResource()) {
+    LOG(("Our channel isn't a third-party tracking channel"));
+    return true;
   }
 
   nsIPrincipal* parentPrincipal = loadInfo->GetTopLevelStorageAreaPrincipal();
   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.
@@ -1611,19 +1567,19 @@ bool AntiTrackingCommon::MaybeIsFirstPar
 
   Document* parentDocument =
       nsGlobalWindowInner::Cast(aFirstPartyWindow)->GetExtantDoc();
   if (NS_WARN_IF(!parentDocument)) {
     LOG(("Failed to get the first party window's document"));
     return false;
   }
 
-  if (!parentDocument->CookieSettings()->GetRejectThirdPartyTrackers()) {
-    LOG(("Disabled by the pref (%d), bail out early",
-         parentDocument->CookieSettings()->GetCookieBehavior()));
+  auto cookieBehavior = parentDocument->CookieSettings()->GetCookieBehavior();
+  if (cookieBehavior != nsICookieService::BEHAVIOR_REJECT_TRACKER) {
+    LOG(("Disabled by the pref (%d), bail out early", cookieBehavior));
     return true;
   }
 
   if (CheckContentBlockingAllowList(aFirstPartyWindow)) {
     return true;
   }
 
   if (!nsContentUtils::IsThirdPartyWindowOrChannel(aFirstPartyWindow, nullptr,
@@ -1763,18 +1719,16 @@ void AntiTrackingCommon::NotifyBlockingD
                                                 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_PARTITIONED_FOREIGN ||
       aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
       aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN);
   MOZ_ASSERT(aDecision == BlockingDecision::eBlock ||
              aDecision == BlockingDecision::eAllow);
 
   if (!aChannel) {
     return;
   }
@@ -1833,18 +1787,16 @@ void AntiTrackingCommon::NotifyBlockingD
                                                 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_PARTITIONED_FOREIGN ||
       aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
       aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN);
   MOZ_ASSERT(aDecision == BlockingDecision::eBlock ||
              aDecision == BlockingDecision::eAllow);
 
   nsCOMPtr<nsPIDOMWindowOuter> pwin = GetTopWindow(aWindow);
   if (!pwin) {
     return;
deleted file mode 100644
--- a/toolkit/components/antitracking/StorageAccess.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/StorageAccess.h"
-#include "nsICookieService.h"
-#include "nsICookieSettings.h"
-#include "nsIWebProgressListener.h"
-
-namespace mozilla {
-
-bool ShouldPartitionStorage(nsContentUtils::StorageAccess aAccess) {
-  return aAccess == nsContentUtils::StorageAccess::ePartitionTrackersOrDeny ||
-         aAccess == nsContentUtils::StorageAccess::ePartitionForeignOrDeny;
-}
-
-bool ShouldPartitionStorage(uint32_t aRejectedReason) {
-  return aRejectedReason ==
-             nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
-         aRejectedReason ==
-             nsIWebProgressListener::STATE_COOKIES_PARTITIONED_FOREIGN;
-}
-
-bool StoragePartitioningEnabled(nsContentUtils::StorageAccess aAccess,
-                                nsICookieSettings* aCookieSettings) {
-  if (aAccess == nsContentUtils::StorageAccess::ePartitionTrackersOrDeny) {
-    return aCookieSettings->GetCookieBehavior() ==
-               nsICookieService::BEHAVIOR_REJECT_TRACKER &&
-           StaticPrefs::privacy_storagePrincipal_enabledForTrackers();
-  }
-  if (aAccess == nsContentUtils::StorageAccess::ePartitionForeignOrDeny) {
-    return aCookieSettings->GetCookieBehavior() ==
-           nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN;
-  }
-  return false;
-}
-
-bool StoragePartitioningEnabled(uint32_t aRejectedReason,
-                                nsICookieSettings* aCookieSettings) {
-  if (aRejectedReason ==
-      nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER) {
-    return aCookieSettings->GetCookieBehavior() ==
-               nsICookieService::BEHAVIOR_REJECT_TRACKER &&
-           StaticPrefs::privacy_storagePrincipal_enabledForTrackers();
-  }
-  if (aRejectedReason ==
-      nsIWebProgressListener::STATE_COOKIES_PARTITIONED_FOREIGN) {
-    return aCookieSettings->GetCookieBehavior() ==
-           nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN;
-  }
-  return false;
-}
-
-}  // namespace mozilla
deleted file mode 100644
--- a/toolkit/components/antitracking/StorageAccess.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_StorageAccess_h
-#define mozilla_StorageAccess_h
-
-#include "nsContentUtils.h"
-
-class nsICookieSettings;
-
-namespace mozilla {
-
-bool ShouldPartitionStorage(nsContentUtils::StorageAccess aAccess);
-
-bool ShouldPartitionStorage(uint32_t aRejectedReason);
-
-bool StoragePartitioningEnabled(nsContentUtils::StorageAccess aAccess,
-                                nsICookieSettings* aCookieSettings);
-
-bool StoragePartitioningEnabled(uint32_t aRejectedReason,
-                                nsICookieSettings* aCookieSettings);
-
-}  // namespace mozilla
-
-#endif  // mozilla_StorageAccess_h
--- a/toolkit/components/antitracking/StoragePrincipalHelper.cpp
+++ b/toolkit/components/antitracking/StoragePrincipalHelper.cpp
@@ -1,68 +1,55 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "StoragePrincipalHelper.h"
 
-#include "mozilla/AntiTrackingCommon.h"
 #include "mozilla/ScopeExit.h"
-#include "mozilla/StorageAccess.h"
 #include "mozilla/StaticPrefs.h"
 #include "nsContentUtils.h"
 #include "nsIHttpChannel.h"
 
 namespace mozilla {
 
 namespace {
 
 already_AddRefed<nsIURI> MaybeGetFirstPartyURI(nsIChannel* aChannel) {
   MOZ_ASSERT(aChannel);
 
-  nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
-  nsCOMPtr<nsICookieSettings> cs;
-  if (NS_FAILED(loadInfo->GetCookieSettings(getter_AddRefs(cs)))) {
+  if (!StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
     return nullptr;
   }
 
-  nsCOMPtr<nsIURI> uri;
-  nsresult rv = aChannel->GetURI(getter_AddRefs(uri));
-  if (NS_FAILED(rv)) {
+  // Let's use the storage principal only if we need to partition the cookie
+  // jar.
+  nsContentUtils::StorageAccess access =
+      nsContentUtils::StorageAllowedForChannel(aChannel);
+  if (access != nsContentUtils::StorageAccess::ePartitionedOrDeny) {
     return nullptr;
   }
 
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (!httpChannel) {
     return nullptr;
   }
 
-  uint32_t rejectedReason = 0;
-  if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
-          httpChannel, uri, &rejectedReason)) {
-    return nullptr;
-  }
+  MOZ_ASSERT(httpChannel->IsThirdPartyTrackingResource());
 
-  // Let's use the storage principal only if we need to partition the cookie
-  // jar.  We use the lower-level AntiTrackingCommon API here to ensure this
-  // check doesn't send notifications.
-  if (!ShouldPartitionStorage(rejectedReason) ||
-      !StoragePartitioningEnabled(rejectedReason, cs)) {
-    return nullptr;
-  }
-
+  nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
   nsCOMPtr<nsIPrincipal> toplevelPrincipal = loadInfo->GetTopLevelPrincipal();
   if (!toplevelPrincipal) {
     return nullptr;
   }
 
   nsCOMPtr<nsIURI> principalURI;
-  rv = toplevelPrincipal->GetURI(getter_AddRefs(principalURI));
+  nsresult rv = toplevelPrincipal->GetURI(getter_AddRefs(principalURI));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return nullptr;
   }
 
   return principalURI.forget();
 }
 
 }  // namespace
--- a/toolkit/components/antitracking/moz.build
+++ b/toolkit/components/antitracking/moz.build
@@ -4,23 +4,21 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files('**'):
     BUG_COMPONENT = ('Core', 'DOM: Security')
 
 EXPORTS.mozilla = [
     'AntiTrackingCommon.h',
-    'StorageAccess.h',
     'StoragePrincipalHelper.h',
 ]
 
 UNIFIED_SOURCES += [
     'AntiTrackingCommon.cpp',
-    'StorageAccess.cpp',
     'StoragePrincipalHelper.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/extensions/permissions',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
--- a/toolkit/components/antitracking/test/browser/3rdPartyStorage.html
+++ b/toolkit/components/antitracking/test/browser/3rdPartyStorage.html
@@ -14,36 +14,30 @@ function info(msg) {
 function ok(what, msg) {
   parent.postMessage({ type: "ok", what: !!what, msg }, "*");
 }
 
 function is(a, b, msg) {
   ok(a === b, msg);
 }
 
-let areWeFourthParty = location.search == "?4th";
-
 onmessage = function(e) {
   let data = e.data;
   let runnableStr = `(() => {return (${data});})();`;
   let runnable = eval(runnableStr); // eslint-disable-line no-eval
 
   let win = window.open("3rdPartyStorageWO.html");
   win.onload = async _ => {
     /* import-globals-from storageAccessAPIHelpers.js */
     await noStorageAccessInitially();
 
     await runnable.call(this, this, win, false /* allowed */);
     /* import-globals-from storageAccessAPIHelpers.js */
     await callRequestStorageAccess();
-    // If we're "fourth party" (which is true when running dynamic FPI tests)
-    // then assume that the storage access API doesn't grant first-party
-    // storage yet.
-    // TODO: Make sure storage access API is available for dynamic FPI too.
-    await runnable.call(this, this, win, !areWeFourthParty /* allowed */);
+    await runnable.call(this, this, win, true /* allowed */);
 
     win.close();
     parent.postMessage({ type: "finish" }, "*");
   };
 };
 
 </script>
 </body>
--- a/toolkit/components/antitracking/test/browser/browser.ini
+++ b/toolkit/components/antitracking/test/browser/browser.ini
@@ -5,18 +5,16 @@ prefs =
   dom.storage_access.prompt.testing.allow=true
   dom.testing.sync-content-blocking-notifications=true
 
 support-files =
   container.html
   embedder.html
   head.js
   antitracking_head.js
-  dynamicfpi_head.js
-  partitionedstorage_head.js
   storageprincipal_head.js
   image.sjs
   imageCacheWorker.js
   page.html
   3rdParty.html
   3rdPartySVG.html
   3rdPartyUI.html
   3rdPartyWO.html
--- a/toolkit/components/antitracking/test/browser/browser_partitionedCookies.js
+++ b/toolkit/components/antitracking/test/browser/browser_partitionedCookies.js
@@ -1,11 +1,11 @@
-/* import-globals-from partitionedstorage_head.js */
+/* import-globals-from storageprincipal_head.js */
 
-PartitionedStorageHelper.runTest("HTTP Cookies",
+StoragePrincipalHelper.runTest("HTTP Cookies",
   async (win3rdParty, win1stParty, allowed) => {
     await win3rdParty.fetch("cookies.sjs?3rd").then(r => r.text());
     await win3rdParty.fetch("cookies.sjs").then(r => r.text()).then(text => {
       is(text, "cookie:foopy=3rd", "3rd party cookie set");
     });
 
     await win1stParty.fetch("cookies.sjs?first").then(r => r.text());
     await win1stParty.fetch("cookies.sjs").then(r => r.text()).then(text => {
@@ -22,17 +22,17 @@ PartitionedStorageHelper.runTest("HTTP C
   },
 
   async _ => {
     await new Promise(resolve => {
       Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
     });
   });
 
-PartitionedStorageHelper.runTest("DOM Cookies",
+StoragePrincipalHelper.runTest("DOM Cookies",
   async (win3rdParty, win1stParty, allowed) => {
     win3rdParty.document.cookie = "foo=3rd";
     is(win3rdParty.document.cookie, "foo=3rd", "3rd party cookie set");
 
     win1stParty.document.cookie = "foo=first";
     is(win1stParty.document.cookie, "foo=first", "First party cookie set");
 
     if (allowed) {
--- a/toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js
+++ b/toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js
@@ -1,11 +1,11 @@
-/* import-globals-from partitionedstorage_head.js */
+/* import-globals-from storageprincipal_head.js */
 
-PartitionedStorageHelper.runTest("IndexedDB",
+StoragePrincipalHelper.runTest("IndexedDB",
   async (win3rdParty, win1stParty, allowed) => {
     await new Promise(resolve => {
       let a = win1stParty.indexedDB.open("test", 1);
       ok(!!a, "IDB should not be blocked in 1st party contexts");
 
       a.onsuccess = e => {
         let db = e.target.result;
         is(db.objectStoreNames.length, 1, "We have 1 objectStore");
--- a/toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js
+++ b/toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js
@@ -1,11 +1,11 @@
-/* import-globals-from partitionedstorage_head.js */
+/* import-globals-from storageprincipal_head.js */
 
-PartitionedStorageHelper.runTest("BroadcastChannel",
+StoragePrincipalHelper.runTest("BroadcastChannel",
   async (win3rdParty, win1stParty, allowed) => {
     let a = new win3rdParty.BroadcastChannel("hello");
     ok(!!a, "BroadcastChannel should be created by 3rd party iframe");
 
     let b = new win1stParty.BroadcastChannel("hello");
     ok(!!b, "BroadcastChannel should be created by 1st party iframe");
 
     // BroadcastChannel uses the incument global, this means that its CTOR will
--- a/toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js
+++ b/toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js
@@ -1,11 +1,11 @@
-/* import-globals-from partitionedstorage_head.js */
+/* import-globals-from storageprincipal_head.js */
 
-PartitionedStorageHelper.runTest("ServiceWorkers",
+StoragePrincipalHelper.runTest("ServiceWorkers",
   async (win3rdParty, win1stParty, allowed) => {
     // ServiceWorkers are not supported. Always blocked.
     await win3rdParty.navigator.serviceWorker.register("empty.js").then(
       _ => { ok(allowed, "Success: ServiceWorker cannot be used!"); },
       _ => { ok(!allowed, "Failed: ServiceWorker cannot be used!"); });
 
     await win1stParty.navigator.serviceWorker.register("empty.js").then(
       _ => { ok(true, "Success: ServiceWorker should be available!"); },
@@ -18,17 +18,17 @@ PartitionedStorageHelper.runTest("Servic
     });
   },
 
   [["dom.serviceWorkers.exemptFromPerDomainMax", true],
    ["dom.ipc.processCount", 1],
    ["dom.serviceWorkers.enabled", true],
    ["dom.serviceWorkers.testing.enabled", true]]);
 
-PartitionedStorageHelper.runTest("ServiceWorkers - MatchAll",
+StoragePrincipalHelper.runTest("ServiceWorkers - MatchAll",
   async (win3rdParty, win1stParty, allowed) => {
     if (!win1stParty.sw) {
       let reg = await win1stParty.navigator.serviceWorker.register("matchAll.js");
       if (reg.installing.state !== "activated") {
         await new Promise(resolve => {
             let w = reg.installing;
             w.addEventListener("statechange", function onStateChange() {
               if (w.state === "activated") {
deleted file mode 100644
--- a/toolkit/components/antitracking/test/browser/dynamicfpi_head.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* import-globals-from head.js */
-
-"use strict";
-
-this.DynamicFPIHelper = {
-  runTest(name, callback, cleanupFunction, extraPrefs) {
-    add_task(async _ => {
-      info("Starting test `" + name + "' with dynamic FPI...");
-
-      await SpecialPowers.flushPrefEnv();
-      await SpecialPowers.pushPrefEnv({"set": [
-        ["dom.storage_access.enabled", true],
-        ["network.cookie.cookieBehavior", Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN],
-        ["privacy.trackingprotection.enabled", false],
-        ["privacy.trackingprotection.pbmode.enabled", false],
-        ["privacy.trackingprotection.annotate_channels", true],
-        ["privacy.storagePrincipal.enabledForTrackers", false],
-        ["privacy.restrict3rdpartystorage.userInteractionRequiredForHosts", "tracking.example.com,tracking.example.org"],
-      ]});
-
-      if (extraPrefs && Array.isArray(extraPrefs) && extraPrefs.length) {
-        await SpecialPowers.pushPrefEnv({"set": 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);
-
-      info("Creating a 3rd party content");
-      await ContentTask.spawn(browser, {
-                                page: TEST_4TH_PARTY_STORAGE_PAGE,
-                                callback: callback.toString(),
-                              },
-                              async obj => {
-        await new content.Promise(resolve => {
-          let ifr = content.document.createElement("iframe");
-          ifr.onload = __ => {
-            is(ifr.contentWindow.document.nodePrincipal.originAttributes.firstPartyDomain, "", "We don't have first-party set on nodePrincipal");
-            is(ifr.contentWindow.document.effectiveStoragePrincipal.originAttributes.firstPartyDomain, "example.net", "We have first-party set on storagePrincipal");
-            info("Sending code to the 3rd party content");
-            ifr.contentWindow.postMessage(obj.callback, "*");
-          };
-
-          content.addEventListener("message", function msg(event) {
-            if (event.data.type == "finish") {
-              content.removeEventListener("message", msg);
-              resolve();
-              return;
-            }
-
-            if (event.data.type == "ok") {
-              ok(event.data.what, event.data.msg);
-              return;
-            }
-
-            if (event.data.type == "info") {
-              info(event.data.msg);
-              return;
-            }
-
-            ok(false, "Unknown message");
-          });
-
-          content.document.body.appendChild(ifr);
-          ifr.src = obj.page;
-        });
-      });
-
-      info("Removing the tab");
-      BrowserTestUtils.removeTab(tab);
-    });
-
-    add_task(async _ => {
-      info("Cleaning up.");
-      if (cleanupFunction) {
-        await cleanupFunction();
-        UrlClassifierTestUtils.cleanupTestTrackers();
-      }
-    });
-  },
-};
--- a/toolkit/components/antitracking/test/browser/head.js
+++ b/toolkit/components/antitracking/test/browser/head.js
@@ -28,27 +28,26 @@ const TEST_EMBEDDER_PAGE = TEST_DOMAIN +
 const TEST_POPUP_PAGE = TEST_DOMAIN + TEST_PATH + "popup.html";
 const TEST_3RD_PARTY_PAGE = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdParty.html";
 const TEST_3RD_PARTY_PAGE_WO = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdPartyWO.html";
 const TEST_3RD_PARTY_PAGE_UI = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdPartyUI.html";
 const TEST_3RD_PARTY_PAGE_WITH_SVG = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdPartySVG.html";
 const TEST_4TH_PARTY_PAGE = TEST_4TH_PARTY_DOMAIN + TEST_PATH + "3rdParty.html";
 const TEST_ANOTHER_3RD_PARTY_PAGE = TEST_ANOTHER_3RD_PARTY_DOMAIN + TEST_PATH + "3rdParty.html";
 const TEST_3RD_PARTY_STORAGE_PAGE = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdPartyStorage.html";
-const TEST_4TH_PARTY_STORAGE_PAGE = TEST_4TH_PARTY_DOMAIN + TEST_PATH + "3rdPartyStorage.html?4th";
 
 const BEHAVIOR_ACCEPT         = Ci.nsICookieService.BEHAVIOR_ACCEPT;
 const BEHAVIOR_REJECT         = Ci.nsICookieService.BEHAVIOR_REJECT;
 const BEHAVIOR_LIMIT_FOREIGN  = Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN;
 const BEHAVIOR_REJECT_FOREIGN = Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN;
 const BEHAVIOR_REJECT_TRACKER = Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
 
 requestLongerTimeout(3);
 
 const {UrlClassifierTestUtils} = ChromeUtils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
 
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/antitracking_head.js",
   this);
 
 Services.scriptloader.loadSubScript(
-  "chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/partitionedstorage_head.js",
+  "chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/storageprincipal_head.js",
   this);
deleted file mode 100644
--- a/toolkit/components/antitracking/test/browser/partitionedstorage_head.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* import-globals-from head.js */
-
-"use strict";
-
-/* import-globals-from dynamicfpi_head.js */
-Services.scriptloader.loadSubScript(
-  "chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/dynamicfpi_head.js",
-  this);
-
-/* import-globals-from storageprincipal_head.js */
-Services.scriptloader.loadSubScript(
-  "chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/storageprincipal_head.js",
-  this);
-
-this.PartitionedStorageHelper = {
-  runTest(name, callback, cleanupFunction, extraPrefs) {
-    DynamicFPIHelper.runTest(name, callback, cleanupFunction, extraPrefs);
-    StoragePrincipalHelper.runTest(name, callback, cleanupFunction, extraPrefs);
-  },
-};
--- a/toolkit/components/antitracking/test/browser/storageprincipal_head.js
+++ b/toolkit/components/antitracking/test/browser/storageprincipal_head.js
@@ -5,17 +5,17 @@
 
 /* import-globals-from head.js */
 
 "use strict";
 
 this.StoragePrincipalHelper = {
   runTest(name, callback, cleanupFunction, extraPrefs) {
     add_task(async _ => {
-      info("Starting test `" + name + "' with storage principal...");
+      info("Starting test `" + name + "'...");
 
       await SpecialPowers.flushPrefEnv();
       await SpecialPowers.pushPrefEnv({"set": [
         ["dom.storage_access.enabled", true],
         ["network.cookie.cookieBehavior", Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER],
         ["privacy.trackingprotection.enabled", false],
         ["privacy.trackingprotection.pbmode.enabled", false],
         ["privacy.trackingprotection.annotate_channels", true],
@@ -79,13 +79,12 @@ this.StoragePrincipalHelper = {
       info("Removing the tab");
       BrowserTestUtils.removeTab(tab);
     });
 
     add_task(async _ => {
       info("Cleaning up.");
       if (cleanupFunction) {
         await cleanupFunction();
-        UrlClassifierTestUtils.cleanupTestTrackers();
       }
     });
   },
 };
--- a/uriloader/base/nsIWebProgressListener.idl
+++ b/uriloader/base/nsIWebProgressListener.idl
@@ -287,20 +287,16 @@ interface nsIWebProgressListener : nsISu
    *
    * STATE_COOKIES_BLOCKED_BY_PERMISSION
    *   Rejected for custom site permission.
    *
    * STATE_COOKIES_BLOCKED_TRACKER
    *   Rejected because the resource is a tracker and cookie policy doesn't
    *   allow its loading.
    *
-   * STATE_COOKIES_PARTITIONED_FOREIGN
-   *   Rejected because the resource is a third-party and cookie policy forces
-   *   third-party resources to be partitioned.
-   *
    * STATE_COOKIES_BLOCKED_ALL
    *   Rejected because cookie policy blocks all cookies.
    *
    * STATE_COOKIES_BLOCKED_FOREIGN
    *   Rejected because cookie policy blocks 3rd party cookies.
    */
   const unsigned long STATE_BLOCKED_TRACKING_CONTENT       = 0x00001000;
   const unsigned long STATE_LOADED_TRACKING_CONTENT        = 0x00002000;
@@ -308,17 +304,16 @@ interface nsIWebProgressListener : nsISu
   const unsigned long STATE_LOADED_FINGERPRINTING_CONTENT  = 0x00000400;
   const unsigned long STATE_BLOCKED_CRYPTOMINING_CONTENT   = 0x00000800;
   const unsigned long STATE_LOADED_CRYPTOMINING_CONTENT    = 0x00200000;
   const unsigned long STATE_BLOCKED_UNSAFE_CONTENT         = 0x00004000;
   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_PARTITIONED_FOREIGN    = 0x80000000;
   const unsigned long STATE_COOKIES_BLOCKED_FOREIGN        = 0x00000080;
 
   /**
    * Notification indicating the state has changed for one of the requests
    * associated with aWebProgress.
    *
    * @param aWebProgress
    *        The nsIWebProgress instance that fired the notification