Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 4 - Renaming storage access permission methods, r=dimi
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 03 Jun 2020 06:12:06 +0000
changeset 597748 399c1423e90adb7647628ea6c97a91d8c9b57edf
parent 597747 08c6e70f7541d7e23ba14d2f0981918bccf6ade5
child 597749 d77619f078aaa11a1fd4eb1977b896c0927b2c85
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdimi
bugs1639833
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 4 - Renaming storage access permission methods, r=dimi Differential Revision: https://phabricator.services.mozilla.com/D76917
dom/base/Document.cpp
dom/base/Document.h
dom/base/ThirdPartyUtil.cpp
dom/ipc/BrowserChild.cpp
dom/ipc/BrowserChild.h
dom/ipc/BrowserParent.cpp
dom/ipc/BrowserParent.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PBrowser.ipdl
dom/ipc/PContent.ipdl
dom/ipc/PWindowGlobal.ipdl
dom/ipc/WindowGlobalChild.cpp
dom/ipc/WindowGlobalChild.h
dom/ipc/WindowGlobalParent.cpp
dom/ipc/WindowGlobalParent.h
netwerk/base/mozIThirdPartyUtil.idl
netwerk/cookie/CookieService.cpp
netwerk/cookie/CookieService.h
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/CookieServiceParent.cpp
netwerk/cookie/CookieServiceParent.h
netwerk/cookie/PCookieService.ipdl
toolkit/components/antitracking/AntiTrackingIPCUtils.h
toolkit/components/antitracking/ContentBlocking.cpp
toolkit/components/antitracking/ContentBlocking.h
toolkit/components/antitracking/ContentBlockingLog.cpp
toolkit/components/antitracking/ContentBlockingLog.h
toolkit/components/antitracking/ContentBlockingNotifier.cpp
toolkit/components/antitracking/ContentBlockingNotifier.h
toolkit/components/antitracking/StoragePrincipalHelper.h
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -15863,21 +15863,21 @@ already_AddRefed<mozilla::dom::Promise> 
         PromptResult pr = sapr->CheckPromptPrefs();
 
         if (pr == PromptResult::Pending) {
           // We're about to show a prompt, record the request attempt
           Telemetry::AccumulateCategorical(
               Telemetry::LABELS_STORAGE_ACCESS_API_UI::Request);
         }
 
-        self->AutomaticStorageAccessCanBeGranted()->Then(
+        self->AutomaticStorageAccessPermissionCanBeGranted()->Then(
             GetCurrentThreadSerialEventTarget(), __func__,
-            [p, pr, sapr, inner](
-                const AutomaticStorageAccessGrantPromise::ResolveOrRejectValue&
-                    aValue) -> void {
+            [p, pr, sapr,
+             inner](const AutomaticStorageAccessPermissionGrantPromise::
+                        ResolveOrRejectValue& aValue) -> void {
               // Make a copy because we can't modified copy-captured lambda
               // variables.
               PromptResult pr2 = pr;
 
               bool storageAccessCanBeGrantedAutomatically =
                   aValue.IsResolve() && aValue.ResolveValue();
 
               bool autoGrant = false;
@@ -15943,52 +15943,55 @@ already_AddRefed<mozilla::dom::Promise> 
     }
   }
 
   outer->SetStorageAccessPermissionGranted(true);
   promise->MaybeResolveWithUndefined();
   return promise.forget();
 }
 
-RefPtr<Document::AutomaticStorageAccessGrantPromise>
-Document::AutomaticStorageAccessCanBeGranted() {
+RefPtr<Document::AutomaticStorageAccessPermissionGrantPromise>
+Document::AutomaticStorageAccessPermissionCanBeGranted() {
   if (XRE_IsContentProcess()) {
     // In the content process, we need to ask the parent process to compute
     // this.  The reason is that nsIPermissionManager::GetAllWithTypePrefix()
     // isn't accessible in the content process.
     ContentChild* cc = ContentChild::GetSingleton();
     MOZ_ASSERT(cc);
 
     return cc
-        ->SendAutomaticStorageAccessCanBeGranted(
+        ->SendAutomaticStorageAccessPermissionCanBeGranted(
             IPC::Principal(NodePrincipal()))
-        ->Then(
-            GetCurrentThreadSerialEventTarget(), __func__,
-            [](const ContentChild::AutomaticStorageAccessCanBeGrantedPromise::
-                   ResolveOrRejectValue& aValue) {
-              if (aValue.IsResolve()) {
-                return AutomaticStorageAccessGrantPromise::CreateAndResolve(
-                    aValue.ResolveValue(), __func__);
-              }
-
-              return AutomaticStorageAccessGrantPromise::CreateAndReject(
-                  false, __func__);
-            });
+        ->Then(GetCurrentThreadSerialEventTarget(), __func__,
+               [](const ContentChild::
+                      AutomaticStorageAccessPermissionCanBeGrantedPromise::
+                          ResolveOrRejectValue& aValue) {
+                 if (aValue.IsResolve()) {
+                   return AutomaticStorageAccessPermissionGrantPromise::
+                       CreateAndResolve(aValue.ResolveValue(), __func__);
+                 }
+
+                 return AutomaticStorageAccessPermissionGrantPromise::
+                     CreateAndReject(false, __func__);
+               });
   }
 
   if (XRE_IsParentProcess()) {
     // In the parent process, we can directly compute this.
-    return AutomaticStorageAccessGrantPromise::CreateAndResolve(
-        AutomaticStorageAccessCanBeGranted(NodePrincipal()), __func__);
-  }
-
-  return AutomaticStorageAccessGrantPromise::CreateAndReject(false, __func__);
-}
-
-bool Document::AutomaticStorageAccessCanBeGranted(nsIPrincipal* aPrincipal) {
+    return AutomaticStorageAccessPermissionGrantPromise::CreateAndResolve(
+        AutomaticStorageAccessPermissionCanBeGranted(NodePrincipal()),
+        __func__);
+  }
+
+  return AutomaticStorageAccessPermissionGrantPromise::CreateAndReject(
+      false, __func__);
+}
+
+bool Document::AutomaticStorageAccessPermissionCanBeGranted(
+    nsIPrincipal* aPrincipal) {
   nsAutoCString prefix;
   AntiTrackingUtils::CreateStoragePermissionKey(aPrincipal, prefix);
 
   PermissionManager* permManager = PermissionManager::GetInstance();
   if (NS_WARN_IF(!permManager)) {
     return false;
   }
 
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -3875,17 +3875,18 @@ class Document : public nsINode,
   StylePrefersColorScheme PrefersColorScheme(IgnoreRFP aIgnoreRFP = IgnoreRFP::No) const;
 
   // Returns true if we use overlay scrollbars on the system wide or on the
   // given document.
   static bool UseOverlayScrollbars(const Document* aDocument);
 
   static bool HasRecentlyStartedForegroundLoads();
 
-  static bool AutomaticStorageAccessCanBeGranted(nsIPrincipal* aPrincipal);
+  static bool AutomaticStorageAccessPermissionCanBeGranted(
+      nsIPrincipal* aPrincipal);
 
   already_AddRefed<Promise> AddCertException(bool aIsTemporary);
 
   // Subframes need to be static cloned after the main document has been
   // embedded within a script global. A `PendingFrameStaticClone` is a static
   // clone which has not yet been performed.
   //
   // The getter returns a direct reference to an internal array which is
@@ -4169,19 +4170,20 @@ class Document : public nsINode,
 
   // Helpers for GetElementsByName.
   static bool MatchNameAttribute(Element* aElement, int32_t aNamespaceID,
                                  nsAtom* aAtom, void* aData);
   static void* UseExistingNameString(nsINode* aRootNode, const nsString* aName);
 
   void MaybeResolveReadyForIdle();
 
-  typedef MozPromise<bool, bool, true> AutomaticStorageAccessGrantPromise;
-  MOZ_MUST_USE RefPtr<AutomaticStorageAccessGrantPromise>
-  AutomaticStorageAccessCanBeGranted();
+  typedef MozPromise<bool, bool, true>
+      AutomaticStorageAccessPermissionGrantPromise;
+  MOZ_MUST_USE RefPtr<AutomaticStorageAccessPermissionGrantPromise>
+  AutomaticStorageAccessPermissionCanBeGranted();
 
   static void AddToplevelLoadingDocument(Document* aDoc);
   static void RemoveToplevelLoadingDocument(Document* aDoc);
   static AutoTArray<Document*, 8>* sLoadingForegroundTopLevelContentDocument;
   friend class cycleCollection;
 
   nsCOMPtr<nsIReferrerInfo> mPreloadReferrerInfo;
   nsCOMPtr<nsIReferrerInfo> mReferrerInfo;
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -528,21 +528,21 @@ ThirdPartyUtil::AnalyzeChannel(nsIChanne
     // If the caller has requested third-party checks, we will only perform the
     // storage access check once we know we're in the third-party context.
     bool performStorageChecks =
         aRequireThirdPartyCheck ? result.contains(ThirdPartyAnalysis::IsForeign)
                                 : true;
     if (performStorageChecks &&
         ContentBlocking::ShouldAllowAccessFor(aChannel, aURI ? aURI : uri.get(),
                                               aRejectedReason)) {
-      result += ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted;
+      result += ThirdPartyAnalysis::IsStorageAccessPermissionGranted;
     }
 
     if (aNotify && !result.contains(
-                       ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted)) {
+                       ThirdPartyAnalysis::IsStorageAccessPermissionGranted)) {
       ContentBlockingNotifier::OnDecision(
           aChannel, ContentBlockingNotifier::BlockingDecision::eBlock,
           *aRejectedReason);
     }
   }
 
   return result;
 }
--- a/dom/ipc/BrowserChild.cpp
+++ b/dom/ipc/BrowserChild.cpp
@@ -3888,17 +3888,18 @@ BrowserChild::DoesWindowSupportProtected
           });
 }
 #endif
 
 void BrowserChild::NotifyContentBlockingEvent(
     uint32_t aEvent, nsIChannel* aChannel, bool aBlocked,
     const nsACString& aTrackingOrigin,
     const nsTArray<nsCString>& aTrackingFullHashes,
-    const Maybe<mozilla::ContentBlockingNotifier::StorageAccessGrantedReason>&
+    const Maybe<
+        mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
         aReason) {
   if (!IPCOpen()) {
     return;
   }
 
   Maybe<WebProgressData> webProgressData;
   RequestData requestData;
   nsresult rv = PrepareProgressListenerData(nullptr, aChannel, webProgressData,
--- a/dom/ipc/BrowserChild.h
+++ b/dom/ipc/BrowserChild.h
@@ -697,17 +697,18 @@ class BrowserChild final : public nsMess
 
   // Notify the content blocking event in the parent process. This sends an IPC
   // message to the BrowserParent in the parent. The BrowserParent will find the
   // top-level WindowGlobalParent and notify the event from it.
   void NotifyContentBlockingEvent(
       uint32_t aEvent, nsIChannel* aChannel, bool aBlocked,
       const nsACString& aTrackingOrigin,
       const nsTArray<nsCString>& aTrackingFullHashes,
-      const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>&
+      const Maybe<
+          ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
           aReason);
 
  protected:
   virtual ~BrowserChild();
 
   mozilla::ipc::IPCResult RecvDestroy();
 
   mozilla::ipc::IPCResult RecvSetDocShellIsActive(const bool& aIsActive);
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -2752,17 +2752,18 @@ mozilla::ipc::IPCResult BrowserParent::R
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvNotifyContentBlockingEvent(
     const uint32_t& aEvent, const RequestData& aRequestData,
     const bool aBlocked, const nsACString& aTrackingOrigin,
     nsTArray<nsCString>&& aTrackingFullHashes,
-    const Maybe<mozilla::ContentBlockingNotifier::StorageAccessGrantedReason>&
+    const Maybe<
+        mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
         aReason) {
   MOZ_ASSERT(aRequestData.elapsedLoadTimeMS().isNothing());
 
   RefPtr<BrowsingContext> bc = GetBrowsingContext();
 
   if (!bc || bc->IsDiscarded()) {
     return IPC_OK();
   }
--- a/dom/ipc/BrowserParent.h
+++ b/dom/ipc/BrowserParent.h
@@ -306,18 +306,18 @@ class BrowserParent final : public PBrow
       const Maybe<WebProgressData>& aWebProgressData,
       const RequestData& aRequestData, const nsresult aStatus,
       const nsString& aMessage);
 
   mozilla::ipc::IPCResult RecvNotifyContentBlockingEvent(
       const uint32_t& aEvent, const RequestData& aRequestData,
       const bool aBlocked, const nsACString& aTrackingOrigin,
       nsTArray<nsCString>&& aTrackingFullHashes,
-      const Maybe<mozilla::ContentBlockingNotifier::StorageAccessGrantedReason>&
-          aReason);
+      const Maybe<mozilla::ContentBlockingNotifier::
+                      StorageAccessPermissionGrantedReason>& aReason);
 
   mozilla::ipc::IPCResult RecvReportBlockedEmbedderNodeByClassifier();
 
   mozilla::ipc::IPCResult RecvNavigationFinished();
 
   bool GetWebProgressListener(nsIBrowser** aOutBrowser,
                               nsIWebProgress** aOutManager,
                               nsIWebProgressListener** aOutListener);
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -3503,17 +3503,18 @@ mozilla::ipc::IPCResult ContentChild::Re
     NS_WARNING("Got session storage data for a discarded session");
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvOnAllowAccessFor(
     const MaybeDiscarded<BrowsingContext>& aContext,
     const nsCString& aTrackingOrigin, uint32_t aCookieBehavior,
-    const ContentBlockingNotifier::StorageAccessGrantedReason& aReason) {
+    const ContentBlockingNotifier::StorageAccessPermissionGrantedReason&
+        aReason) {
   MOZ_ASSERT(!aContext.IsNull(), "Browsing context cannot be null");
 
   ContentBlocking::OnAllowAccessFor(aContext.GetMaybeDiscarded(),
                                     aTrackingOrigin, aCookieBehavior, aReason);
 
   return IPC_OK();
 }
 
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -650,17 +650,18 @@ class ContentChild final : public PConte
   mozilla::ipc::IPCResult RecvSessionStorageData(
       uint64_t aTopContextId, const nsACString& aOriginAttrs,
       const nsACString& aOriginKey, const nsTArray<KeyValuePair>& aDefaultData,
       const nsTArray<KeyValuePair>& aSessionData);
 
   mozilla::ipc::IPCResult RecvOnAllowAccessFor(
       const MaybeDiscarded<BrowsingContext>& aContext,
       const nsCString& aTrackingOrigin, uint32_t aCookieBehavior,
-      const ContentBlockingNotifier::StorageAccessGrantedReason& aReason);
+      const ContentBlockingNotifier::StorageAccessPermissionGrantedReason&
+          aReason);
 
   mozilla::ipc::IPCResult RecvOnContentBlockingDecision(
       const MaybeDiscarded<BrowsingContext>& aContext,
       const ContentBlockingNotifier::BlockingDecision& aDecision,
       uint32_t aRejectedReason);
 
 #ifdef NIGHTLY_BUILD
   // Fetch the current number of pending input events.
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -5961,30 +5961,31 @@ mozilla::ipc::IPCResult ContentParent::R
                                                        aFlags, aIsTemporary);
       }
     }
   }
   aResolver(rv);
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult ContentParent::RecvAutomaticStorageAccessCanBeGranted(
+mozilla::ipc::IPCResult
+ContentParent::RecvAutomaticStorageAccessPermissionCanBeGranted(
     const Principal& aPrincipal,
-    AutomaticStorageAccessCanBeGrantedResolver&& aResolver) {
-  aResolver(Document::AutomaticStorageAccessCanBeGranted(aPrincipal));
+    AutomaticStorageAccessPermissionCanBeGrantedResolver&& aResolver) {
+  aResolver(Document::AutomaticStorageAccessPermissionCanBeGranted(aPrincipal));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-ContentParent::RecvFirstPartyStorageAccessGrantedForOrigin(
+ContentParent::RecvStorageAccessPermissionGrantedForOrigin(
     uint64_t aTopLevelWindowId,
     const MaybeDiscarded<BrowsingContext>& aParentContext,
     const Principal& aTrackingPrincipal, const nsCString& aTrackingOrigin,
     const int& aAllowMode,
-    FirstPartyStorageAccessGrantedForOriginResolver&& aResolver) {
+    StorageAccessPermissionGrantedForOriginResolver&& aResolver) {
   if (aParentContext.IsNullOrDiscarded()) {
     return IPC_OK();
   }
 
   ContentBlocking::SaveAccessForOriginOnParentProcess(
       aTopLevelWindowId, aParentContext.get_canonical(), aTrackingPrincipal,
       aTrackingOrigin, aAllowMode)
       ->Then(
@@ -5998,37 +5999,37 @@ ContentParent::RecvFirstPartyStorageAcce
           });
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvCompleteAllowAccessFor(
     const MaybeDiscarded<BrowsingContext>& aParentContext,
     uint64_t aTopLevelWindowId, const Principal& aTrackingPrincipal,
     const nsCString& aTrackingOrigin, uint32_t aCookieBehavior,
-    const ContentBlockingNotifier::StorageAccessGrantedReason& aReason,
+    const ContentBlockingNotifier::StorageAccessPermissionGrantedReason&
+        aReason,
     CompleteAllowAccessForResolver&& aResolver) {
   if (aParentContext.IsNullOrDiscarded()) {
     return IPC_OK();
   }
 
   ContentBlocking::CompleteAllowAccessFor(
       aParentContext.get_canonical(), aTopLevelWindowId, aTrackingPrincipal,
       aTrackingOrigin, aCookieBehavior, aReason, nullptr)
-      ->Then(
-          GetCurrentThreadSerialEventTarget(), __func__,
-          [aResolver = std::move(aResolver)](
-              ContentBlocking::StorageAccessGrantPromise::ResolveOrRejectValue&&
-                  aValue) {
-            Maybe<StorageAccessPromptChoices> choice;
-            if (aValue.IsResolve()) {
-              choice.emplace(static_cast<StorageAccessPromptChoices>(
-                  aValue.ResolveValue()));
-            }
-            aResolver(choice);
-          });
+      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
+             [aResolver = std::move(aResolver)](
+                 ContentBlocking::StorageAccessPermissionGrantPromise::
+                     ResolveOrRejectValue&& aValue) {
+               Maybe<StorageAccessPromptChoices> choice;
+               if (aValue.IsResolve()) {
+                 choice.emplace(static_cast<StorageAccessPromptChoices>(
+                     aValue.ResolveValue()));
+               }
+               aResolver(choice);
+             });
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvStoreUserInteractionAsPermission(
     const Principal& aPrincipal) {
   ContentBlockingUserInteraction::Observe(aPrincipal);
   return IPC_OK();
 }
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -1218,32 +1218,33 @@ class ContentParent final
 
   mozilla::ipc::IPCResult RecvBHRThreadHang(const HangDetails& aHangDetails);
 
   mozilla::ipc::IPCResult RecvAddCertException(
       const nsACString& aSerializedCert, uint32_t aFlags,
       const nsACString& aHostName, int32_t aPort, bool aIsTemporary,
       AddCertExceptionResolver&& aResolver);
 
-  mozilla::ipc::IPCResult RecvAutomaticStorageAccessCanBeGranted(
+  mozilla::ipc::IPCResult RecvAutomaticStorageAccessPermissionCanBeGranted(
       const Principal& aPrincipal,
-      AutomaticStorageAccessCanBeGrantedResolver&& aResolver);
+      AutomaticStorageAccessPermissionCanBeGrantedResolver&& aResolver);
 
-  mozilla::ipc::IPCResult RecvFirstPartyStorageAccessGrantedForOrigin(
+  mozilla::ipc::IPCResult RecvStorageAccessPermissionGrantedForOrigin(
       uint64_t aTopLevelWindowId,
       const MaybeDiscarded<BrowsingContext>& aParentContext,
       const Principal& aTrackingPrincipal, const nsCString& aTrackingOrigin,
       const int& aAllowMode,
-      FirstPartyStorageAccessGrantedForOriginResolver&& aResolver);
+      StorageAccessPermissionGrantedForOriginResolver&& aResolver);
 
   mozilla::ipc::IPCResult RecvCompleteAllowAccessFor(
       const MaybeDiscarded<BrowsingContext>& aParentContext,
       uint64_t aTopLevelWindowId, const Principal& aTrackingPrincipal,
       const nsCString& aTrackingOrigin, uint32_t aCookieBehavior,
-      const ContentBlockingNotifier::StorageAccessGrantedReason& aReason,
+      const ContentBlockingNotifier::StorageAccessPermissionGrantedReason&
+          aReason,
       CompleteAllowAccessForResolver&& aResolver);
 
   mozilla::ipc::IPCResult RecvStoreUserInteractionAsPermission(
       const Principal& aPrincipal);
 
   mozilla::ipc::IPCResult RecvNotifyMediaPlaybackChanged(
       const MaybeDiscarded<BrowsingContext>& aContext,
       MediaPlaybackState aState);
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -89,17 +89,17 @@ using mozilla::FontRange from "ipc/nsGUI
 using mozilla::a11y::IAccessibleHolder from "mozilla/a11y/IPCTypes.h";
 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
 using mozilla::dom::EffectsInfo from "mozilla/dom/TabMessageUtils.h";
 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
 using mozilla::ScrollAxis from "mozilla/PresShellForwards.h";
 using mozilla::ScrollFlags from "mozilla/PresShellForwards.h";
 using struct InputFormData from "mozilla/dom/SessionStoreMessageUtils.h";
 using struct CollectedInputDataValue from "mozilla/dom/SessionStoreMessageUtils.h";
-using mozilla::ContentBlockingNotifier::StorageAccessGrantedReason from "mozilla/ContentBlockingNotifier.h";
+using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
 using CallerType from "mozilla/dom/BindingDeclarations.h";
 using mozilla::dom::EmbedderElementEventType from "mozilla/dom/TabMessageUtils.h";
 
 namespace mozilla {
 namespace dom {
 
 struct WebProgressData
 {
@@ -574,17 +574,17 @@ parent:
 
     async OnStatusChange(WebProgressData? aWebProgressData,
                          RequestData aRequestData, nsresult aStatus,
                          nsString aMessage);
 
     async NotifyContentBlockingEvent(uint32_t aEvent, RequestData aRequestData,
                                      bool aBlocked, nsCString aTrackingOrigin,
                                      nsCString[] aTrackingFullHashes,
-                                     StorageAccessGrantedReason? aReason);
+                                     StorageAccessPermissionGrantedReason? aReason);
 
     async NavigationFinished();
 
     async SessionStoreUpdate(nsCString? aDocShellCaps, bool? aPrivatedMode,
                              nsCString[] aPositions, int32_t[] aPositionDescendants,
                              InputFormData[] aInputs, CollectedInputDataValue[] aIdVals,
                              CollectedInputDataValue[] aXPathVals,
                              nsCString[] aOrigins, nsString[] aKeys,
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -114,17 +114,17 @@ using gfxSparseBitSet from "gfxFontUtils
 using FontVisibility from "gfxFontEntry.h";
 using mozilla::dom::MediaControlKeysEvent from "ipc/MediaControlIPC.h";
 using mozilla::dom::MediaPlaybackState from "ipc/MediaControlIPC.h";
 using mozilla::dom::MediaAudibleState from "ipc/MediaControlIPC.h";
 using mozilla::dom::MaybeMediaMetadataBase from "mozilla/dom/MediaSessionIPCUtils.h";
 using mozilla::dom::MediaSessionPlaybackState from "mozilla/dom/MediaSessionBinding.h";
 using refcounted class nsDocShellLoadState from "nsDocShellLoadState.h";
 using mozilla::dom::ServiceWorkerShutdownState::Progress from "mozilla/dom/ServiceWorkerShutdownState.h";
-using mozilla::ContentBlockingNotifier::StorageAccessGrantedReason from "mozilla/ContentBlockingNotifier.h";
+using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
 using mozilla::ContentBlockingNotifier::BlockingDecision from "mozilla/ContentBlockingNotifier.h";
 using mozilla::ContentBlocking::StorageAccessPromptChoices from "mozilla/ContentBlocking.h";
 using JSActorMessageKind from "mozilla/dom/JSActor.h";
 using JSActorMessageMeta from "mozilla/dom/PWindowGlobal.h";
 
 union ChromeRegistryItem
 {
     ChromePackage;
@@ -873,17 +873,17 @@ child:
 
     async InternalLoad(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aTakeFocus);
 
     async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
 
     async OnAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
                            nsCString aTrackingOrigin,
                            uint32_t aCookieBehavior,
-                           StorageAccessGrantedReason aReason);
+                           StorageAccessPermissionGrantedReason aReason);
 
     async OnContentBlockingDecision(MaybeDiscardedBrowsingContext aContext,
                                     BlockingDecision aReason,
                                     uint32_t aRejectedReason);
 
     /**
      * Abort orientationPendingPromises for documents in the child which
      * are part of a BrowsingContextGroup.
@@ -1487,36 +1487,36 @@ parent:
                            nsCString aHostName, int32_t aPort,
                            bool aIsTemporary)
           returns (nsresult success);
 
     /*
      * Determines whether storage access can be granted automatically by the
      * storage access API without showing a user prompt.
      */
-    async AutomaticStorageAccessCanBeGranted(Principal aPrincipal)
+    async AutomaticStorageAccessPermissionCanBeGranted(Principal aPrincipal)
           returns (bool success);
 
     /*
      * A 3rd party tracking origin (aTrackingOrigin) has received the permission
      * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
      */
-    async FirstPartyStorageAccessGrantedForOrigin(uint64_t aTopLevelWindowId,
+    async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
                                                   MaybeDiscardedBrowsingContext aParentContext,
                                                   Principal aTrackingPrincipal,
                                                   nsCString aTrackingOrigin,
                                                   int aAllowMode)
           returns (bool unused);
 
     async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
                                  uint64_t aTopLevelWindowId,
                                  Principal aTrackingPrincipal,
                                  nsCString aTrackingOrigin,
                                  uint32_t aCookieBehavior,
-                                 StorageAccessGrantedReason aReason)
+                                 StorageAccessPermissionGrantedReason aReason)
           returns (StorageAccessPromptChoices? choice);
 
     async StoreUserInteractionAsPermission(Principal aPrincipal);
 
    /**
     * When media element's controlled state changed in the content process, we
     * have to notify the chrome process in order to update the status of the
     * corresponding media controller, which is used to control all media in the
--- a/dom/ipc/PWindowGlobal.ipdl
+++ b/dom/ipc/PWindowGlobal.ipdl
@@ -65,17 +65,17 @@ child:
 
   /**
    * Returns the serialized security info associated with this window.
    */
   async GetSecurityInfo() returns(nsCString? serializedSecInfo);
 
   async DispatchSecurityPolicyViolation(nsString aViolationEventJSON);
 
-  async SaveStorageAccessGranted();
+  async SaveStorageAccessPermissionGranted();
 
 both:
   async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData aData,
                    ClonedMessageData aStack);
 
 parent:
   // Load the given URI load state into the current owner process of the given
   // BrowsingContext. aTargetBC must be in the same BrowsingContextGroup as this
--- a/dom/ipc/WindowGlobalChild.cpp
+++ b/dom/ipc/WindowGlobalChild.cpp
@@ -480,17 +480,18 @@ mozilla::ipc::IPCResult WindowGlobalChil
       NS_SerializeToString(secInfoSer, result.ref());
     }
   }
 
   aResolve(result);
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult WindowGlobalChild::RecvSaveStorageAccessGranted() {
+mozilla::ipc::IPCResult
+WindowGlobalChild::RecvSaveStorageAccessPermissionGranted() {
   nsCOMPtr<nsPIDOMWindowInner> inner = GetWindowGlobal();
   if (inner) {
     inner->SaveStorageAccessPermissionGranted();
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> outer =
       nsPIDOMWindowOuter::GetFromCurrentInner(inner);
   if (outer) {
--- a/dom/ipc/WindowGlobalChild.h
+++ b/dom/ipc/WindowGlobalChild.h
@@ -139,17 +139,17 @@ class WindowGlobalChild final : public W
                                            DrawSnapshotResolver&& aResolve);
 
   mozilla::ipc::IPCResult RecvDispatchSecurityPolicyViolation(
       const nsString& aViolationEventJSON);
 
   mozilla::ipc::IPCResult RecvGetSecurityInfo(
       GetSecurityInfoResolver&& aResolve);
 
-  mozilla::ipc::IPCResult RecvSaveStorageAccessGranted();
+  mozilla::ipc::IPCResult RecvSaveStorageAccessPermissionGranted();
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
  private:
   WindowGlobalChild(dom::WindowContext* aWindowContext,
                     nsIPrincipal* aPrincipal, nsIURI* aURI);
 
   ~WindowGlobalChild();
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -442,17 +442,18 @@ const nsAString& WindowGlobalParent::Get
 
   return VoidString();
 }
 
 void WindowGlobalParent::NotifyContentBlockingEvent(
     uint32_t aEvent, nsIRequest* aRequest, bool aBlocked,
     const nsACString& aTrackingOrigin,
     const nsTArray<nsCString>& aTrackingFullHashes,
-    const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>& aReason) {
+    const Maybe<ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
+        aReason) {
   MOZ_ASSERT(NS_IsMainThread());
   DebugOnly<bool> isCookiesBlocked =
       aEvent == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
       aEvent == nsIWebProgressListener::STATE_COOKIES_BLOCKED_SOCIALTRACKER ||
       (aEvent == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN &&
        StaticPrefs::network_cookie_rejectForeignWithExceptions_enabled());
   MOZ_ASSERT_IF(aBlocked, aReason.isNothing());
   MOZ_ASSERT_IF(!isCookiesBlocked, aReason.isNothing());
--- a/dom/ipc/WindowGlobalParent.h
+++ b/dom/ipc/WindowGlobalParent.h
@@ -162,17 +162,18 @@ class WindowGlobalParent final : public 
   nsIGlobalObject* GetParentObject();
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 
   void NotifyContentBlockingEvent(
       uint32_t aEvent, nsIRequest* aRequest, bool aBlocked,
       const nsACString& aTrackingOrigin,
       const nsTArray<nsCString>& aTrackingFullHashes,
-      const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>&
+      const Maybe<
+          ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
           aReason = Nothing());
 
   ContentBlockingLog* GetContentBlockingLog() { return &mContentBlockingLog; }
 
   nsIContentParent* GetContentParent();
 
   nsICookieJarSettings* CookieJarSettings() { return mCookieJarSettings; }
 
--- a/netwerk/base/mozIThirdPartyUtil.idl
+++ b/netwerk/base/mozIThirdPartyUtil.idl
@@ -13,17 +13,17 @@ interface nsILoadInfo;
 %{C++
 
 #include "mozilla/EnumSet.h"
 
 enum class ThirdPartyAnalysis {
   IsForeign,
   IsThirdPartyTrackingResource,
   IsThirdPartySocialTrackingResource,
-  IsFirstPartyStorageAccessGranted,
+  IsStorageAccessPermissionGranted,
 };
 
 using ThirdPartyAnalysisResult = mozilla::EnumSet<ThirdPartyAnalysis>;
 
 typedef bool (*RequireThirdPartyCheck)(nsILoadInfo*);
 
 %}
 
--- a/netwerk/cookie/CookieService.cpp
+++ b/netwerk/cookie/CookieService.cpp
@@ -415,17 +415,17 @@ CookieService::GetCookieStringFromHttp(n
   bool isSafeTopLevelNav = CookieCommons::IsSafeTopLevelNav(aChannel);
   bool isSameSiteForeign = CookieCommons::IsSameSiteForeign(aChannel, aHostURI);
 
   AutoTArray<Cookie*, 8> foundCookieList;
   GetCookiesForURI(
       aHostURI, aChannel, result.contains(ThirdPartyAnalysis::IsForeign),
       result.contains(ThirdPartyAnalysis::IsThirdPartyTrackingResource),
       result.contains(ThirdPartyAnalysis::IsThirdPartySocialTrackingResource),
-      result.contains(ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted),
+      result.contains(ThirdPartyAnalysis::IsStorageAccessPermissionGranted),
       rejectedReason, isSafeTopLevelNav, isSameSiteForeign, true, attrs,
       foundCookieList);
 
   ComposeCookieString(foundCookieList, aCookieString);
 
   if (!aCookieString.IsEmpty()) {
     COOKIE_LOGSUCCESS(GET_COOKIE, aHostURI, aCookieString, nullptr, false);
   }
@@ -536,17 +536,17 @@ CookieService::SetCookieStringFromHttp(n
   uint32_t priorCookieCount = storage->CountCookiesFromHost(
       baseDomainFromURI, attrs.mPrivateBrowsingId);
 
   CookieStatus cookieStatus = CheckPrefs(
       cookieJarSettings, aHostURI,
       result.contains(ThirdPartyAnalysis::IsForeign),
       result.contains(ThirdPartyAnalysis::IsThirdPartyTrackingResource),
       result.contains(ThirdPartyAnalysis::IsThirdPartySocialTrackingResource),
-      result.contains(ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted),
+      result.contains(ThirdPartyAnalysis::IsStorageAccessPermissionGranted),
       aCookieHeader, priorCookieCount, attrs, &rejectedReason);
 
   MOZ_ASSERT_IF(rejectedReason, cookieStatus == STATUS_REJECTED);
 
   // fire a notification if third party or if cookie was rejected
   // (but not if there was an error)
   switch (cookieStatus) {
     case STATUS_REJECTED:
@@ -805,17 +805,17 @@ CookieService::RemoveNative(const nsACSt
 
   return NS_OK;
 }
 
 void CookieService::GetCookiesForURI(
     nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
     bool aIsThirdPartyTrackingResource,
     bool aIsThirdPartySocialTrackingResource,
-    bool aFirstPartyStorageAccessGranted, uint32_t aRejectedReason,
+    bool aStorageAccessPermissionGranted, uint32_t aRejectedReason,
     bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, bool aHttpBound,
     const OriginAttributes& aOriginAttrs, nsTArray<Cookie*>& aCookieList) {
   NS_ASSERTION(aHostURI, "null host!");
 
   if (!IsInitialized()) {
     return;
   }
 
@@ -860,17 +860,17 @@ void CookieService::GetCookiesForURI(
 
   // check default prefs
   uint32_t rejectedReason = aRejectedReason;
   uint32_t priorCookieCount = storage->CountCookiesFromHost(
       baseDomainFromURI, aOriginAttrs.mPrivateBrowsingId);
 
   CookieStatus cookieStatus = CheckPrefs(
       cookieJarSettings, aHostURI, aIsForeign, aIsThirdPartyTrackingResource,
-      aIsThirdPartySocialTrackingResource, aFirstPartyStorageAccessGranted,
+      aIsThirdPartySocialTrackingResource, aStorageAccessPermissionGranted,
       VoidCString(), priorCookieCount, aOriginAttrs, &rejectedReason);
 
   MOZ_ASSERT_IF(rejectedReason, cookieStatus == STATUS_REJECTED);
 
   // for GetCookie(), we only fire acceptance/rejection notifications
   // (but not if there was an error)
   switch (cookieStatus) {
     case STATUS_REJECTED:
@@ -1462,17 +1462,17 @@ static inline bool IsSubdomainOf(const n
   }
   return false;
 }
 
 CookieStatus CookieService::CheckPrefs(nsICookieJarSettings* aCookieJarSettings,
                                        nsIURI* aHostURI, bool aIsForeign,
                                        bool aIsThirdPartyTrackingResource,
                                        bool aIsThirdPartySocialTrackingResource,
-                                       bool aFirstPartyStorageAccessGranted,
+                                       bool aStorageAccessPermissionGranted,
                                        const nsACString& aCookieHeader,
                                        const int aNumOfCookies,
                                        const OriginAttributes& aOriginAttrs,
                                        uint32_t* aRejectedReason) {
   nsresult rv;
 
   MOZ_ASSERT(aRejectedReason);
 
@@ -1515,17 +1515,17 @@ CookieStatus CookieService::CheckPrefs(n
         break;
     }
   }
 
   // No cookies allowed if this request comes from a resource 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 && aIsThirdPartyTrackingResource &&
-      !aFirstPartyStorageAccessGranted &&
+      !aStorageAccessPermissionGranted &&
       aCookieJarSettings->GetRejectThirdPartyContexts()) {
     bool rejectThirdPartyWithExceptions =
         CookieJarSettings::IsRejectThirdPartyWithExceptions(
             aCookieJarSettings->GetCookieBehavior());
 
     uint32_t rejectReason =
         rejectThirdPartyWithExceptions
             ? nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN
@@ -1546,41 +1546,41 @@ CookieStatus CookieService::CheckPrefs(n
       *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN;
     } else {
       *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER;
     }
     return STATUS_REJECTED;
   }
 
   // check default prefs.
-  // Check aFirstPartyStorageAccessGranted when checking aCookieBehavior
+  // Check aStorageAccessPermissionGranted when checking aCookieBehavior
   // so that we take things such as the content blocking allow list into
   // account.
   if (aCookieJarSettings->GetCookieBehavior() ==
           nsICookieService::BEHAVIOR_REJECT &&
-      !aFirstPartyStorageAccessGranted) {
+      !aStorageAccessPermissionGranted) {
     COOKIE_LOGFAILURE(aCookieHeader.IsVoid() ? GET_COOKIE : SET_COOKIE,
                       aHostURI, aCookieHeader, "cookies are disabled");
     *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL;
     return STATUS_REJECTED;
   }
 
   // check if cookie is foreign
   if (aIsForeign) {
     if (aCookieJarSettings->GetCookieBehavior() ==
             nsICookieService::BEHAVIOR_REJECT_FOREIGN &&
-        !aFirstPartyStorageAccessGranted) {
+        !aStorageAccessPermissionGranted) {
       COOKIE_LOGFAILURE(aCookieHeader.IsVoid() ? GET_COOKIE : SET_COOKIE,
                         aHostURI, aCookieHeader, "context is third party");
       *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN;
       return STATUS_REJECTED;
     }
 
     if (aCookieJarSettings->GetLimitForeignContexts() &&
-        !aFirstPartyStorageAccessGranted && aNumOfCookies == 0) {
+        !aStorageAccessPermissionGranted && aNumOfCookies == 0) {
       COOKIE_LOGFAILURE(aCookieHeader.IsVoid() ? GET_COOKIE : SET_COOKIE,
                         aHostURI, aCookieHeader, "context is third party");
       *aRejectedReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN;
       return STATUS_REJECTED;
     }
 
     if (StaticPrefs::network_cookie_thirdparty_sessionOnly()) {
       return STATUS_ACCEPT_SESSION;
--- a/netwerk/cookie/CookieService.h
+++ b/netwerk/cookie/CookieService.h
@@ -70,26 +70,26 @@ class CookieService final : public nsICo
                            CookieStruct& aCookieData, bool aRequireHostMatch,
                            CookieStatus aStatus, nsCString& aCookieHeader,
                            bool aFromHttp, bool aIsForeignAndNotAddon,
                            nsIConsoleReportCollector* aCRC, bool& aSetCookie);
   static CookieStatus CheckPrefs(nsICookieJarSettings* aCookieJarSettings,
                                  nsIURI* aHostURI, bool aIsForeign,
                                  bool aIsThirdPartyTrackingResource,
                                  bool aIsThirdPartySocialTrackingResource,
-                                 bool aFirstPartyStorageAccessGranted,
+                                 bool aStorageAccessPermissionGranted,
                                  const nsACString& aCookieHeader,
                                  const int aNumOfCookies,
                                  const OriginAttributes& aOriginAttrs,
                                  uint32_t* aRejectedReason);
 
   void GetCookiesForURI(nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
                         bool aIsThirdPartyTrackingResource,
                         bool aIsThirdPartySocialTrackingResource,
-                        bool aFirstPartyStorageAccessGranted,
+                        bool aStorageAccessPermissionGranted,
                         uint32_t aRejectedReason, bool aIsSafeTopLevelNav,
                         bool aIsSameSiteForeign, bool aHttpBound,
                         const OriginAttributes& aOriginAttrs,
                         nsTArray<Cookie*>& aCookieList);
 
   /**
    * This method is a helper that allows calling nsICookieManager::Remove()
    * with OriginAttributes parameter.
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -136,17 +136,17 @@ void CookieServiceChild::TrackCookieLoad
       aChannel, attrs);
 
   bool isSafeTopLevelNav = CookieCommons::IsSafeTopLevelNav(aChannel);
   bool isSameSiteForeign = CookieCommons::IsSameSiteForeign(aChannel, uri);
   SendPrepareCookieList(
       uri, result.contains(ThirdPartyAnalysis::IsForeign),
       result.contains(ThirdPartyAnalysis::IsThirdPartyTrackingResource),
       result.contains(ThirdPartyAnalysis::IsThirdPartySocialTrackingResource),
-      result.contains(ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted),
+      result.contains(ThirdPartyAnalysis::IsStorageAccessPermissionGranted),
       rejectedReason, isSafeTopLevelNav, isSameSiteForeign, attrs);
 }
 
 IPCResult CookieServiceChild::RecvRemoveAll() {
   mCookiesMap.Clear();
   return IPC_OK();
 }
 
@@ -534,17 +534,17 @@ CookieServiceChild::SetCookieStringFromH
   nsCOMPtr<nsICookieJarSettings> cookieJarSettings =
       CookieCommons::GetCookieJarSettings(aChannel);
 
   CookieStatus cookieStatus = CookieService::CheckPrefs(
       cookieJarSettings, aHostURI,
       result.contains(ThirdPartyAnalysis::IsForeign),
       result.contains(ThirdPartyAnalysis::IsThirdPartyTrackingResource),
       result.contains(ThirdPartyAnalysis::IsThirdPartySocialTrackingResource),
-      result.contains(ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted),
+      result.contains(ThirdPartyAnalysis::IsStorageAccessPermissionGranted),
       aCookieString, CountCookiesFromHashTable(baseDomain, attrs), attrs,
       &rejectedReason);
 
   if (cookieStatus != STATUS_ACCEPTED &&
       cookieStatus != STATUS_ACCEPT_SESSION) {
     return NS_OK;
   }
 
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -95,17 +95,17 @@ void CookieServiceParent::TrackCookieLoa
   ThirdPartyAnalysisResult result = thirdPartyUtil->AnalyzeChannel(
       aChannel, false, nullptr, nullptr, &rejectedReason);
 
   nsTArray<Cookie*> foundCookieList;
   mCookieService->GetCookiesForURI(
       uri, aChannel, result.contains(ThirdPartyAnalysis::IsForeign),
       result.contains(ThirdPartyAnalysis::IsThirdPartyTrackingResource),
       result.contains(ThirdPartyAnalysis::IsThirdPartySocialTrackingResource),
-      result.contains(ThirdPartyAnalysis::IsFirstPartyStorageAccessGranted),
+      result.contains(ThirdPartyAnalysis::IsStorageAccessPermissionGranted),
       rejectedReason, isSafeTopLevelNav, aIsSameSiteForeign, false, attrs,
       foundCookieList);
   nsTArray<CookieStruct> matchingCookiesList;
   SerialializeCookieList(foundCookieList, matchingCookiesList);
   Unused << SendTrackCookiesLoad(matchingCookiesList, attrs);
 }
 
 // static
@@ -122,31 +122,31 @@ void CookieServiceParent::SerialializeCo
     }
   }
 }
 
 IPCResult CookieServiceParent::RecvPrepareCookieList(
     nsIURI* aHost, const bool& aIsForeign,
     const bool& aIsThirdPartyTrackingResource,
     const bool& aIsThirdPartySocialTrackingResource,
-    const bool& aFirstPartyStorageAccessGranted,
+    const bool& aStorageAccessPermissionGranted,
     const uint32_t& aRejectedReason, const bool& aIsSafeTopLevelNav,
     const bool& aIsSameSiteForeign, const OriginAttributes& aAttrs) {
   // Send matching cookies to Child.
   if (!aHost) {
     return IPC_FAIL(this, "aHost must not be null");
   }
 
   nsTArray<Cookie*> 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(
       aHost, nullptr, aIsForeign, aIsThirdPartyTrackingResource,
-      aIsThirdPartySocialTrackingResource, aFirstPartyStorageAccessGranted,
+      aIsThirdPartySocialTrackingResource, aStorageAccessPermissionGranted,
       aRejectedReason, aIsSafeTopLevelNav, aIsSameSiteForeign, false, aAttrs,
       foundCookieList);
   nsTArray<CookieStruct> matchingCookiesList;
   SerialializeCookieList(foundCookieList, matchingCookiesList);
   Unused << SendTrackCookiesLoad(matchingCookiesList, aAttrs);
   return IPC_OK();
 }
 
--- a/netwerk/cookie/CookieServiceParent.h
+++ b/netwerk/cookie/CookieServiceParent.h
@@ -48,17 +48,17 @@ class CookieServiceParent : public PCook
   mozilla::ipc::IPCResult RecvSetCookies(
       const nsCString& aBaseDomain, const OriginAttributes& aOriginAttributes,
       nsIURI* aHost, bool aFromHttp, const nsTArray<CookieStruct>& aCookies);
 
   mozilla::ipc::IPCResult RecvPrepareCookieList(
       nsIURI* aHost, const bool& aIsForeign,
       const bool& aIsThirdPartyTrackingResource,
       const bool& aIsThirdPartySocialTrackingResource,
-      const bool& aFirstPartyStorageAccessGranted,
+      const bool& aStorageAccessPermissionGranted,
       const uint32_t& aRejectedReason, const bool& aIsSafeTopLevelNav,
       const bool& aIsSameSiteForeign, const OriginAttributes& aAttrs);
 
   static void SerialializeCookieList(const nsTArray<Cookie*>& aFoundCookieList,
                                      nsTArray<CookieStruct>& aCookiesList);
 
   RefPtr<CookieService> mCookieService;
   bool mProcessingCookie;
--- a/netwerk/cookie/PCookieService.ipdl
+++ b/netwerk/cookie/PCookieService.ipdl
@@ -37,17 +37,17 @@ parent:
                                        nsIURI host,
                                        bool fromHttp,
                                        CookieStruct[] cookies);
 
   async PrepareCookieList(nsIURI host,
                           bool isForeign,
                           bool isThirdPartyTrackingResource,
                           bool isThirdPartySocialTrackingResource,
-                          bool firstPartyStorageAccessGranted,
+                          bool firstPartyStorageAccessPermissionGranted,
                           uint32_t rejectedReason,
                           bool isSafeTopLevelNav,
                           bool isSameSiteForeign,
                           OriginAttributes attrs);
 
   async __delete__();
 
 child:
--- a/toolkit/components/antitracking/AntiTrackingIPCUtils.h
+++ b/toolkit/components/antitracking/AntiTrackingIPCUtils.h
@@ -10,25 +10,27 @@
 #include "ipc/IPCMessageUtils.h"
 
 #include "mozilla/ContentBlockingNotifier.h"
 #include "mozilla/ContentBlocking.h"
 
 namespace IPC {
 
 // For allowing passing the enum
-// ContentBlockingNotifier::StorageAccessGrantedReason over IPC.
+// ContentBlockingNotifier::StorageAccessPermissionGrantedReason over IPC.
 template <>
-struct ParamTraits<mozilla::ContentBlockingNotifier::StorageAccessGrantedReason>
+struct ParamTraits<
+    mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason>
     : public ContiguousEnumSerializerInclusive<
-          mozilla::ContentBlockingNotifier::StorageAccessGrantedReason,
-          mozilla::ContentBlockingNotifier::StorageAccessGrantedReason::
-              eStorageAccessAPI,
-          mozilla::ContentBlockingNotifier::StorageAccessGrantedReason::
-              eOpener> {};
+          mozilla::ContentBlockingNotifier::
+              StorageAccessPermissionGrantedReason,
+          mozilla::ContentBlockingNotifier::
+              StorageAccessPermissionGrantedReason::eStorageAccessAPI,
+          mozilla::ContentBlockingNotifier::
+              StorageAccessPermissionGrantedReason::eOpener> {};
 
 // ContentBlockingNotifier::BlockingDecision over IPC.
 template <>
 struct ParamTraits<mozilla::ContentBlockingNotifier::BlockingDecision>
     : public ContiguousEnumSerializerInclusive<
           mozilla::ContentBlockingNotifier::BlockingDecision,
           mozilla::ContentBlockingNotifier::BlockingDecision::eBlock,
           mozilla::ContentBlockingNotifier::BlockingDecision::eAllow> {};
--- a/toolkit/components/antitracking/ContentBlocking.cpp
+++ b/toolkit/components/antitracking/ContentBlocking.cpp
@@ -123,42 +123,44 @@ int32_t CookiesBehavior(nsIPrincipal* aP
   if (BasePrincipal::Cast(aPrincipal)->AddonPolicy()) {
     return nsICookieService::BEHAVIOR_ACCEPT;
   }
 
   return aCookieJarSettings->GetCookieBehavior();
 }
 }  // namespace
 
-/* static */ RefPtr<ContentBlocking::StorageAccessGrantPromise>
+/* static */ RefPtr<ContentBlocking::StorageAccessPermissionGrantPromise>
 ContentBlocking::AllowAccessFor(
     nsIPrincipal* aPrincipal, dom::BrowsingContext* aParentContext,
-    ContentBlockingNotifier::StorageAccessGrantedReason aReason,
+    ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason,
     const ContentBlocking::PerformFinalChecks& aPerformFinalChecks) {
   MOZ_ASSERT(aParentContext);
 
   switch (aReason) {
     case ContentBlockingNotifier::eOpener:
       if (!StaticPrefs::
               privacy_restrict3rdpartystorage_heuristic_window_open()) {
         LOG(
             ("Bailing out early because the "
              "privacy.restrict3rdpartystorage.heuristic.window_open preference "
              "has been disabled"));
-        return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+        return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                    __func__);
       }
       break;
     case ContentBlockingNotifier::eOpenerAfterUserInteraction:
       if (!StaticPrefs::
               privacy_restrict3rdpartystorage_heuristic_opened_window_after_interaction()) {
         LOG(
             ("Bailing out early because the "
              "privacy.restrict3rdpartystorage.heuristic.opened_window_after_"
              "interaction preference has been disabled"));
-        return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+        return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                    __func__);
       }
       break;
     default:
       break;
   }
 
   if (MOZ_LOG_TEST(gAntiTrackingLog, mozilla::LogLevel::Debug)) {
     nsAutoCString origin;
@@ -168,116 +170,127 @@ ContentBlocking::AllowAccessFor(
   }
 
   RefPtr<dom::WindowContext> parentWindowContext =
       aParentContext->GetCurrentWindowContext();
   if (!parentWindowContext) {
     LOG(
         ("No window context found for our parent browsing context, bailing out "
          "early"));
-    return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                __func__);
   }
 
   if (parentWindowContext->GetCookieBehavior().isNothing()) {
     LOG(
         ("No cookie behaviour found for our parent window context, bailing "
          "out early"));
-    return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                __func__);
   }
 
   // Only add storage permission when there is a reason to do so.
   uint32_t behavior = *parentWindowContext->GetCookieBehavior();
   if (!CookieJarSettings::IsRejectThirdPartyContexts(behavior)) {
     LOG(
         ("Disabled by network.cookie.cookieBehavior pref (%d), bailing out "
          "early",
          behavior));
-    return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndResolve(true,
+                                                                 __func__);
   }
 
   MOZ_ASSERT(
       CookieJarSettings::IsRejectThirdPartyWithExceptions(behavior) ||
       behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER ||
       behavior ==
           nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN);
 
   // No need to continue when we are already in the allow list.
   if (parentWindowContext->GetIsOnContentBlockingAllowList()) {
-    return StorageAccessGrantPromise::CreateAndResolve(true, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndResolve(true,
+                                                                 __func__);
   }
 
   bool isParentTopLevel = aParentContext->IsTopContent();
 
   // Make sure storage access isn't disabled
   if (!isParentTopLevel &&
       Document::StorageAccessSandboxed(aParentContext->GetSandboxFlags())) {
     LOG(("Our document is sandboxed"));
-    return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                __func__);
   }
 
   uint64_t topLevelWindowId;
   nsAutoCString trackingOrigin;
   nsCOMPtr<nsIPrincipal> trackingPrincipal;
 
   LOG(("The current resource is %s-party",
        isParentTopLevel ? "first" : "third"));
 
   // We are a first party resource.
   if (isParentTopLevel) {
     nsAutoCString origin;
     nsresult rv = aPrincipal->GetAsciiOrigin(origin);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       LOG(("Can't get the origin from the URI"));
-      return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+      return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                  __func__);
     }
 
     trackingOrigin = origin;
     trackingPrincipal = aPrincipal;
     topLevelWindowId = aParentContext->GetCurrentInnerWindowId();
     if (NS_WARN_IF(!topLevelWindowId)) {
       LOG(("Top-level storage area window id not found, bailing out early"));
-      return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+      return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                  __func__);
     }
 
   } else {
     // We should be a 3rd party source.
     if (behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER &&
         !parentWindowContext->GetIsThirdPartyTrackingResourceWindow()) {
       LOG(("Our window isn't a third-party tracking window"));
-      return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+      return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                  __func__);
     }
     if ((CookieJarSettings::IsRejectThirdPartyWithExceptions(behavior) ||
          behavior ==
              nsICookieService::BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN) &&
         !parentWindowContext->GetIsThirdPartyWindow()) {
       LOG(("Our window isn't a third-party window"));
-      return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+      return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                  __func__);
     }
 
     if (!GetTopLevelWindowId(aParentContext,
                              // Don't request the ETP specific behaviour of
                              // allowing only singly-nested iframes here,
                              // because we are recording an allow permission.
                              nsICookieService::BEHAVIOR_ACCEPT,
                              topLevelWindowId)) {
       LOG(("Error while retrieving the parent window id, bailing out early"));
-      return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+      return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                  __func__);
     }
 
     // If we can't get the principal and tracking origin at this point, the
     // tracking principal will be gotten while running ::CompleteAllowAccessFor
     // in the parent.
     if (aParentContext->IsInProcess()) {
       if (!AntiTrackingUtils::GetPrincipalAndTrackingOrigin(
               aParentContext, getter_AddRefs(trackingPrincipal),
               trackingOrigin)) {
         LOG(
             ("Error while computing the parent principal and tracking origin, "
              "bailing out early"));
-        return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+        return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                    __func__);
       }
     }
   }
 
   // We MAY need information that is only accessible in the parent,
   // so we need to determine whether we can run it in the current process (in
   // most of cases it should be a child process).
   //
@@ -306,17 +319,18 @@ ContentBlocking::AllowAccessFor(
     // in-process and tracking origin is not third-party with respect to
     // the parent window.
     if (aParentContext->IsInProcess()) {
       bool isThirdParty;
       nsCOMPtr<nsIPrincipal> principal =
           AntiTrackingUtils::GetPrincipal(aParentContext);
       if (!principal) {
         LOG(("Can't get the principal from the browsing context"));
-        return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+        return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                    __func__);
       }
       Unused << trackingPrincipal->IsThirdPartyPrincipal(principal,
                                                          &isThirdParty);
       runInSameProcess = !isThirdParty;
     } else {
       runInSameProcess = false;
     }
   }
@@ -350,21 +364,21 @@ ContentBlocking::AllowAccessFor(
                  // triggered by the opener heuristic, so we have to do it here.
                  // See storePermission below for the reason.
                  if (aReason == ContentBlockingNotifier::eOpener &&
                      !bc->IsDiscarded()) {
                    MOZ_ASSERT(bc->IsInProcess());
                    ContentBlocking::OnAllowAccessFor(bc, trackingOrigin,
                                                      behavior, aReason);
                  }
-                 return StorageAccessGrantPromise::CreateAndResolve(
+                 return StorageAccessPermissionGrantPromise::CreateAndResolve(
                      aValue.ResolveValue().value(), __func__);
                }
-               return StorageAccessGrantPromise::CreateAndReject(false,
-                                                                 __func__);
+               return StorageAccessPermissionGrantPromise::CreateAndReject(
+                   false, __func__);
              });
 }
 
 // CompleteAllowAccessFor is used to process the remaining work in
 // AllowAccessFor that may need to access information not accessible
 // in the current process.
 // This API supports running running in the child process and the
 // parent process. When running in the child, aParentContext must be in-process.
@@ -383,22 +397,22 @@ ContentBlocking::AllowAccessFor(
 //    origin of the third-party window. In this case, we should
 //    run this API in the parent, as for the other cases, we can run in the
 //    same process.
 //
 // 3. eOpenerAfterUserInteraction
 //    aParentContext is the browsing context of the opener window, but
 //    AllowAccessFor is called by the opened window. So as long as
 //    aParentContext is not in-process, we should run in the parent.
-/* static */ RefPtr<ContentBlocking::StorageAccessGrantPromise>
+/* static */ RefPtr<ContentBlocking::StorageAccessPermissionGrantPromise>
 ContentBlocking::CompleteAllowAccessFor(
     dom::BrowsingContext* aParentContext, uint64_t aTopLevelWindowId,
     nsIPrincipal* aTrackingPrincipal, const nsCString& aTrackingOrigin,
     uint32_t aCookieBehavior,
-    ContentBlockingNotifier::StorageAccessGrantedReason aReason,
+    ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason,
     const PerformFinalChecks& aPerformFinalChecks) {
   MOZ_ASSERT(aParentContext);
   MOZ_ASSERT_IF(XRE_IsContentProcess(), aParentContext->IsInProcess());
 
   nsCOMPtr<nsIPrincipal> trackingPrincipal;
   nsAutoCString trackingOrigin;
   if (!aTrackingPrincipal) {
     // User interaction is the only case that tracking principal is not
@@ -407,17 +421,18 @@ ContentBlocking::CompleteAllowAccessFor(
                aReason == ContentBlockingNotifier::eOpenerAfterUserInteraction);
 
     if (!AntiTrackingUtils::GetPrincipalAndTrackingOrigin(
             aParentContext, getter_AddRefs(trackingPrincipal),
             trackingOrigin)) {
       LOG(
           ("Error while computing the parent principal and tracking origin, "
            "bailing out early"));
-      return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+      return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                  __func__);
     }
   } else {
     trackingPrincipal = aTrackingPrincipal;
     trackingOrigin = aTrackingOrigin;
   }
 
   // We hardcode this block reason since the first-party storage access
   // permission is granted for the purpose of blocking trackers.
@@ -438,34 +453,36 @@ ContentBlocking::CompleteAllowAccessFor(
               "refusing to add a first-party storage permission to access it",
               _spec),
              trackingPrincipal);
     ContentBlockingNotifier::OnDecision(
         aParentContext, ContentBlockingNotifier::BlockingDecision::eBlock,
         CookieJarSettings::IsRejectThirdPartyWithExceptions(aCookieBehavior)
             ? nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN
             : nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER);
-    return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                __func__);
   }
 
   // Ensure we can find the window before continuing, so we can safely
   // execute storePermission.
   if (aParentContext->IsInProcess() &&
       (!aParentContext->GetDOMWindow() ||
        !aParentContext->GetDOMWindow()->GetCurrentInnerWindow())) {
     LOG(
         ("No window found for our parent browsing context, bailing out "
          "early"));
-    return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+    return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                __func__);
   }
 
   auto storePermission =
       [aParentContext, aTopLevelWindowId, trackingOrigin, trackingPrincipal,
        aCookieBehavior,
-       aReason](int aAllowMode) -> RefPtr<StorageAccessGrantPromise> {
+       aReason](int aAllowMode) -> RefPtr<StorageAccessPermissionGrantPromise> {
     // Inform the window we granted permission for. This has to be done in the
     // window's process.
     if (aParentContext->IsInProcess()) {
       ContentBlocking::OnAllowAccessFor(aParentContext, trackingOrigin,
                                         aCookieBehavior, aReason);
     } else {
       MOZ_ASSERT(XRE_IsParentProcess());
 
@@ -483,72 +500,75 @@ ContentBlocking::CompleteAllowAccessFor(
     ContentBlockingNotifier::ReportUnblockingToConsole(
         aParentContext, NS_ConvertUTF8toUTF16(trackingOrigin), aReason);
 
     if (XRE_IsParentProcess()) {
       LOG(("Saving the permission: trackingOrigin=%s", trackingOrigin.get()));
       return SaveAccessForOriginOnParentProcess(
                  aTopLevelWindowId, aParentContext, trackingPrincipal,
                  trackingOrigin, aAllowMode)
-          ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-                 [](ParentAccessGrantPromise::ResolveOrRejectValue&& aValue) {
-                   if (aValue.IsResolve()) {
-                     return StorageAccessGrantPromise::CreateAndResolve(
-                         ContentBlocking::eAllow, __func__);
-                   }
-                   return StorageAccessGrantPromise::CreateAndReject(false,
-                                                                     __func__);
-                 });
+          ->Then(
+              GetCurrentThreadSerialEventTarget(), __func__,
+              [](ParentAccessGrantPromise::ResolveOrRejectValue&& aValue) {
+                if (aValue.IsResolve()) {
+                  return StorageAccessPermissionGrantPromise::CreateAndResolve(
+                      ContentBlocking::eAllow, __func__);
+                }
+                return StorageAccessPermissionGrantPromise::CreateAndReject(
+                    false, __func__);
+              });
     }
 
     ContentChild* cc = ContentChild::GetSingleton();
     MOZ_ASSERT(cc);
 
     LOG(
         ("Asking the parent process to save the permission for us: "
          "trackingOrigin=%s",
          trackingOrigin.get()));
 
     // This is not really secure, because here we have the content process
     // sending the request of storing a permission.
     return cc
-        ->SendFirstPartyStorageAccessGrantedForOrigin(
+        ->SendStorageAccessPermissionGrantedForOrigin(
             aTopLevelWindowId, aParentContext,
             IPC::Principal(trackingPrincipal), trackingOrigin, aAllowMode)
         ->Then(GetCurrentThreadSerialEventTarget(), __func__,
                [](const ContentChild::
-                      FirstPartyStorageAccessGrantedForOriginPromise::
+                      StorageAccessPermissionGrantedForOriginPromise::
                           ResolveOrRejectValue& aValue) {
                  if (aValue.IsResolve()) {
-                   return StorageAccessGrantPromise::CreateAndResolve(
+                   return StorageAccessPermissionGrantPromise::CreateAndResolve(
                        aValue.ResolveValue(), __func__);
                  }
-                 return StorageAccessGrantPromise::CreateAndReject(false,
-                                                                   __func__);
+                 return StorageAccessPermissionGrantPromise::CreateAndReject(
+                     false, __func__);
                });
   };
 
   if (aPerformFinalChecks) {
     return aPerformFinalChecks()->Then(
         GetCurrentThreadSerialEventTarget(), __func__,
         [storePermission](
-            StorageAccessGrantPromise::ResolveOrRejectValue&& aValue) {
+            StorageAccessPermissionGrantPromise::ResolveOrRejectValue&&
+                aValue) {
           if (aValue.IsResolve()) {
             return storePermission(aValue.ResolveValue());
           }
-          return StorageAccessGrantPromise::CreateAndReject(false, __func__);
+          return StorageAccessPermissionGrantPromise::CreateAndReject(false,
+                                                                      __func__);
         });
   }
   return storePermission(false);
 }
 
 /* static */ void ContentBlocking::OnAllowAccessFor(
     dom::BrowsingContext* aParentContext, const nsCString& aTrackingOrigin,
     uint32_t aCookieBehavior,
-    ContentBlockingNotifier::StorageAccessGrantedReason aReason) {
+    ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason) {
   MOZ_ASSERT(aParentContext->IsInProcess());
 
   // Let's inform the parent window and the other windows having the
   // same tracking origin about the stroage permission is granted.
   ContentBlocking::UpdateAllowAccessOnCurrentProcess(aParentContext,
                                                      aTrackingOrigin);
 
   // Let's inform the parent window.
@@ -759,17 +779,17 @@ void ContentBlocking::UpdateAllowAccessO
     if (behavior == nsICookieService::BEHAVIOR_REJECT_TRACKER &&
         !AntiTrackingUtils::IsFirstLevelSubContext(aContext)) {
       return;
     }
 
     nsAutoCString origin;
     AntiTrackingUtils::GetPrincipalAndTrackingOrigin(aContext, nullptr, origin);
     if (aTrackingOrigin == origin) {
-      Unused << wgp->SendSaveStorageAccessGranted();
+      Unused << wgp->SendSaveStorageAccessPermissionGranted();
     }
   });
 }
 
 bool ContentBlocking::ShouldAllowAccessFor(nsPIDOMWindowInner* aWindow,
                                            nsIURI* aURI,
                                            uint32_t* aRejectedReason) {
   MOZ_ASSERT(aWindow);
--- a/toolkit/components/antitracking/ContentBlocking.h
+++ b/toolkit/components/antitracking/ContentBlocking.h
@@ -84,28 +84,29 @@ class ContentBlocking final {
   //   want to grant the permission for the 3rd party context to have access to
   //   the first party stoage when loaded in aParentWindow.
   //   Ex: example.net import tracker.com/script.js which does opens a popup and
   //   the user interacts with it. tracker.com is allowed when loaded by
   //   example.net.
   typedef MozPromise<int, bool, true> StorageAccessFinalCheckPromise;
   typedef std::function<RefPtr<StorageAccessFinalCheckPromise>()>
       PerformFinalChecks;
-  typedef MozPromise<int, bool, true> StorageAccessGrantPromise;
-  static MOZ_MUST_USE RefPtr<StorageAccessGrantPromise> AllowAccessFor(
+  typedef MozPromise<int, bool, true> StorageAccessPermissionGrantPromise;
+  static MOZ_MUST_USE RefPtr<StorageAccessPermissionGrantPromise>
+  AllowAccessFor(
       nsIPrincipal* aPrincipal, dom::BrowsingContext* aParentContext,
-      ContentBlockingNotifier::StorageAccessGrantedReason aReason,
+      ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason,
       const PerformFinalChecks& aPerformFinalChecks = nullptr);
 
   // This function handles tasks that have to be done in the process
   // of the window that we just grant permission for.
   static void OnAllowAccessFor(
       dom::BrowsingContext* aParentContext, const nsCString& aTrackingOrigin,
       uint32_t aCookieBehavior,
-      ContentBlockingNotifier::StorageAccessGrantedReason aReason);
+      ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason);
 
   // For IPC only.
   typedef MozPromise<nsresult, bool, true> ParentAccessGrantPromise;
   static RefPtr<ParentAccessGrantPromise> SaveAccessForOriginOnParentProcess(
       nsIPrincipal* aParentPrincipal, nsIPrincipal* aTrackingPrinciapl,
       const nsCString& aTrackingOrigin, int aAllowMode,
       uint64_t aExpirationTime =
           StaticPrefs::privacy_restrict3rdpartystorage_expiration());
@@ -116,21 +117,22 @@ class ContentBlocking final {
       int aAllowMode,
       uint64_t aExpirationTime =
           StaticPrefs::privacy_restrict3rdpartystorage_expiration());
 
  private:
   friend class dom::ContentParent;
   // This should be running either in the parent process or in the child
   // processes with an in-process browsing context.
-  static MOZ_MUST_USE RefPtr<StorageAccessGrantPromise> CompleteAllowAccessFor(
+  static MOZ_MUST_USE RefPtr<StorageAccessPermissionGrantPromise>
+  CompleteAllowAccessFor(
       dom::BrowsingContext* aParentContext, uint64_t aTopLevelWindowId,
       nsIPrincipal* aTrackingPrincipal, const nsCString& aTrackingOrigin,
       uint32_t aCookieBehavior,
-      ContentBlockingNotifier::StorageAccessGrantedReason aReason,
+      ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason,
       const PerformFinalChecks& aPerformFinalChecks = nullptr);
 
   static void UpdateAllowAccessOnCurrentProcess(
       dom::BrowsingContext* aParentContext, const nsACString& aTrackingOrigin);
 
   static void UpdateAllowAccessOnParentProcess(
       dom::BrowsingContext* aParentContext, const nsACString& aTrackingOrigin);
 };
--- a/toolkit/components/antitracking/ContentBlockingLog.cpp
+++ b/toolkit/components/antitracking/ContentBlockingLog.cpp
@@ -100,17 +100,18 @@ static void ReportOriginSingleHash(Origi
        Telemetry::MetricIDToString[static_cast<uint32_t>(aId)]));
   LOG(("ReportOriginSingleHash origin=%s", PromiseFlatCString(aOrigin).get()));
 
   Telemetry::RecordOrigin(aId, aOrigin);
 }
 
 Maybe<uint32_t> ContentBlockingLog::RecordLogParent(
     const nsACString& aOrigin, uint32_t aType, bool aBlocked,
-    const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>& aReason,
+    const Maybe<ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
+        aReason,
     const nsTArray<nsCString>& aTrackingFullHashes) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   uint32_t events = GetContentBlockingEventsInLog();
 
   bool blockedValue = aBlocked;
   bool unblocked = false;
 
@@ -237,45 +238,47 @@ void ContentBlockingLog::ReportOrigins()
                nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER &&
            logEntry.mType !=
                nsIWebProgressListener::STATE_COOKIES_BLOCKED_SOCIALTRACKER) ||
           logEntry.mTrackingFullHashes.IsEmpty()) {
         continue;
       }
 
       const bool isBlocked = logEntry.mBlocked;
-      Maybe<StorageAccessGrantedReason> reason = logEntry.mReason;
+      Maybe<StorageAccessPermissionGrantedReason> reason = logEntry.mReason;
 
       metricId = testMode ? OriginMetricID::ContentBlocking_Blocked_TestOnly
                           : OriginMetricID::ContentBlocking_Blocked;
       if (!isBlocked) {
         MOZ_ASSERT(reason.isSome());
         switch (reason.value()) {
-          case StorageAccessGrantedReason::eStorageAccessAPI:
+          case StorageAccessPermissionGrantedReason::eStorageAccessAPI:
             metricId =
                 testMode
                     ? OriginMetricID::
                           ContentBlocking_StorageAccessAPIExempt_TestOnly
                     : OriginMetricID::ContentBlocking_StorageAccessAPIExempt;
             break;
-          case StorageAccessGrantedReason::eOpenerAfterUserInteraction:
+          case StorageAccessPermissionGrantedReason::
+              eOpenerAfterUserInteraction:
             metricId =
                 testMode
                     ? OriginMetricID::
                           ContentBlocking_OpenerAfterUserInteractionExempt_TestOnly
                     : OriginMetricID::
                           ContentBlocking_OpenerAfterUserInteractionExempt;
             break;
-          case StorageAccessGrantedReason::eOpener:
+          case StorageAccessPermissionGrantedReason::eOpener:
             metricId =
                 testMode ? OriginMetricID::ContentBlocking_OpenerExempt_TestOnly
                          : OriginMetricID::ContentBlocking_OpenerExempt;
             break;
           default:
-            MOZ_ASSERT_UNREACHABLE("Unknown StorageAccessGrantedReason");
+            MOZ_ASSERT_UNREACHABLE(
+                "Unknown StorageAccessPermissionGrantedReason");
         }
       }
 
       for (const auto& hash : logEntry.mTrackingFullHashes) {
         HashNumber key = AddToHash(HashString(hash.get(), hash.Length()),
                                    static_cast<uint32_t>(metricId));
         if (lookupTable.Contains(key)) {
           continue;
--- a/toolkit/components/antitracking/ContentBlockingLog.h
+++ b/toolkit/components/antitracking/ContentBlockingLog.h
@@ -18,24 +18,25 @@
 #include "nsTArray.h"
 #include "nsWindowSizes.h"
 
 class nsIPrincipal;
 
 namespace mozilla {
 
 class ContentBlockingLog final {
-  typedef ContentBlockingNotifier::StorageAccessGrantedReason
-      StorageAccessGrantedReason;
+  typedef ContentBlockingNotifier::StorageAccessPermissionGrantedReason
+      StorageAccessPermissionGrantedReason;
 
   struct LogEntry {
     uint32_t mType;
     uint32_t mRepeatCount;
     bool mBlocked;
-    Maybe<ContentBlockingNotifier::StorageAccessGrantedReason> mReason;
+    Maybe<ContentBlockingNotifier::StorageAccessPermissionGrantedReason>
+        mReason;
     nsTArray<nsCString> mTrackingFullHashes;
   };
 
   struct OriginDataEntry {
     OriginDataEntry()
         : mHasLevel1TrackingContentLoaded(false),
           mHasLevel2TrackingContentLoaded(false) {}
 
@@ -86,22 +87,26 @@ class ContentBlockingLog final {
   ContentBlockingLog() = default;
   ~ContentBlockingLog() = default;
 
   // Record the log in the parent process. This should be called only in the
   // parent process and will replace the RecordLog below after we remove the
   // ContentBlockingLog from content processes.
   Maybe<uint32_t> RecordLogParent(
       const nsACString& aOrigin, uint32_t aType, bool aBlocked,
-      const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>& aReason,
+      const Maybe<
+          ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
+          aReason,
       const nsTArray<nsCString>& aTrackingFullHashes);
 
   void RecordLog(
       const nsACString& aOrigin, uint32_t aType, bool aBlocked,
-      const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>& aReason,
+      const Maybe<
+          ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
+          aReason,
       const nsTArray<nsCString>& aTrackingFullHashes) {
     RecordLogInternal(aOrigin, aType, aBlocked, aReason, aTrackingFullHashes);
   }
 
   void ReportOrigins();
   void ReportLog(nsIPrincipal* aFirstPartyPrincipal);
 
   nsAutoCString Stringify() {
@@ -240,17 +245,18 @@ class ContentBlockingLog final {
     }
 
     return events;
   }
 
  private:
   void RecordLogInternal(
       const nsACString& aOrigin, uint32_t aType, bool aBlocked,
-      const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>&
+      const Maybe<
+          ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
           aReason = Nothing(),
       const nsTArray<nsCString>& aTrackingFullHashes = nsTArray<nsCString>()) {
     DebugOnly<bool> isCookiesBlockedTracker =
         aType == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
         aType == nsIWebProgressListener::STATE_COOKIES_BLOCKED_SOCIALTRACKER;
     MOZ_ASSERT_IF(aBlocked, aReason.isNothing());
     MOZ_ASSERT_IF(!isCookiesBlockedTracker, aReason.isNothing());
     MOZ_ASSERT_IF(isCookiesBlockedTracker && !aBlocked, aReason.isSome());
--- a/toolkit/components/antitracking/ContentBlockingNotifier.cpp
+++ b/toolkit/components/antitracking/ContentBlockingNotifier.cpp
@@ -46,17 +46,17 @@ void RunConsoleReportingRunnable(already
       return;
     }
   }
 }
 
 void ReportUnblockingToConsole(
     uint64_t aWindowID, nsIPrincipal* aPrincipal,
     const nsAString& aTrackingOrigin,
-    ContentBlockingNotifier::StorageAccessGrantedReason aReason) {
+    ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason) {
   MOZ_ASSERT(aWindowID);
   MOZ_ASSERT(aPrincipal);
 
   nsAutoString sourceLine;
   uint32_t lineNumber = 0, columnNumber = 0;
   JSContext* cx = nsContentUtils::GetCurrentJSContext();
   if (cx) {
     nsJSUtils::GetCallingLocation(cx, sourceLine, &lineNumber, &columnNumber);
@@ -286,17 +286,18 @@ void NotifyBlockingDecision(nsIChannel* 
   }
 }
 
 // Send a message to notify OnContentBlockingEvent in the parent, which will
 // update the ContentBlockingLog in the parent.
 void NotifyEventInChild(
     nsIChannel* aTrackingChannel, bool aBlocked, uint32_t aRejectedReason,
     const nsACString& aTrackingOrigin,
-    const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>& aReason) {
+    const Maybe<ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
+        aReason) {
   MOZ_ASSERT(XRE_IsContentProcess());
 
   // We don't need to find the top-level window here because the
   // parent will do that for us.
   nsCOMPtr<nsILoadContext> loadContext;
   NS_QueryNotificationCallbacks(aTrackingChannel, loadContext);
   if (!loadContext) {
     return;
@@ -325,17 +326,18 @@ void NotifyEventInChild(
                                            trackingFullHashes, aReason);
 }
 
 // Update the ContentBlockingLog of the top-level WindowGlobalParent of
 // the tracking channel.
 void NotifyEventInParent(
     nsIChannel* aTrackingChannel, bool aBlocked, uint32_t aRejectedReason,
     const nsACString& aTrackingOrigin,
-    const Maybe<ContentBlockingNotifier::StorageAccessGrantedReason>& aReason) {
+    const Maybe<ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
+        aReason) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   nsCOMPtr<nsILoadInfo> loadInfo = aTrackingChannel->LoadInfo();
   RefPtr<dom::BrowsingContext> bc;
   loadInfo->GetBrowsingContext(getter_AddRefs(bc));
 
   if (!bc || bc->IsDiscarded()) {
     return;
@@ -359,17 +361,17 @@ void NotifyEventInParent(
                                   aTrackingOrigin, trackingFullHashes, aReason);
 }
 
 }  // namespace
 
 /* static */
 void ContentBlockingNotifier::ReportUnblockingToConsole(
     BrowsingContext* aBrowsingContext, const nsAString& aTrackingOrigin,
-    ContentBlockingNotifier::StorageAccessGrantedReason aReason) {
+    ContentBlockingNotifier::StorageAccessPermissionGrantedReason aReason) {
   MOZ_ASSERT(aBrowsingContext);
 
   uint64_t windowID = aBrowsingContext->GetCurrentInnerWindowId();
 
   nsCOMPtr<nsIPrincipal> principal =
       AntiTrackingUtils::GetPrincipal(aBrowsingContext);
   if (NS_WARN_IF(!principal)) {
     return;
@@ -492,17 +494,17 @@ void ContentBlockingNotifier::OnEvent(ns
   return ContentBlockingNotifier::OnEvent(aTrackingChannel, true,
                                           aRejectedReason, trackingOrigin);
 }
 
 /* static */
 void ContentBlockingNotifier::OnEvent(
     nsIChannel* aTrackingChannel, bool aBlocked, uint32_t aRejectedReason,
     const nsACString& aTrackingOrigin,
-    const Maybe<StorageAccessGrantedReason>& aReason) {
+    const Maybe<StorageAccessPermissionGrantedReason>& aReason) {
   if (XRE_IsParentProcess()) {
     NotifyEventInParent(aTrackingChannel, aBlocked, aRejectedReason,
                         aTrackingOrigin, aReason);
   } else {
     NotifyEventInChild(aTrackingChannel, aBlocked, aRejectedReason,
                        aTrackingOrigin, aReason);
   }
 }
--- a/toolkit/components/antitracking/ContentBlockingNotifier.h
+++ b/toolkit/components/antitracking/ContentBlockingNotifier.h
@@ -22,17 +22,17 @@ class BrowsingContext;
 }  // namespace dom
 
 class ContentBlockingNotifier final {
  public:
   enum class BlockingDecision {
     eBlock,
     eAllow,
   };
-  enum StorageAccessGrantedReason {
+  enum StorageAccessPermissionGrantedReason {
     eStorageAccessAPI,
     eOpenerAfterUserInteraction,
     eOpener
   };
 
   // This method can be called on the parent process or on the content process.
   // The notification is propagated to the child channel if aChannel is a parent
   // channel proxy.
@@ -55,18 +55,18 @@ class ContentBlockingNotifier final {
   static void OnDecision(dom::BrowsingContext* aBrowsingContext,
                          BlockingDecision aDecision, uint32_t aRejectedReason);
 
   static void OnEvent(nsIChannel* aChannel, uint32_t aRejectedReason);
 
   static void OnEvent(
       nsIChannel* aChannel, bool aBlocked, uint32_t aRejectedReason,
       const nsACString& aTrackingOrigin,
-      const Maybe<StorageAccessGrantedReason>& aReason = Nothing());
+      const Maybe<StorageAccessPermissionGrantedReason>& aReason = Nothing());
 
-  static void ReportUnblockingToConsole(dom::BrowsingContext* aBrowsingContext,
-                                        const nsAString& aTrackingOrigin,
-                                        StorageAccessGrantedReason aReason);
+  static void ReportUnblockingToConsole(
+      dom::BrowsingContext* aBrowsingContext, const nsAString& aTrackingOrigin,
+      StorageAccessPermissionGrantedReason aReason);
 };
 
 }  // namespace mozilla
 
 #endif  // mozilla_contentblockingnotifier_h
--- a/toolkit/components/antitracking/StoragePrincipalHelper.h
+++ b/toolkit/components/antitracking/StoragePrincipalHelper.h
@@ -115,18 +115,18 @@
  *     (https://bugzilla.mozilla.org/show_bug.cgi?id=1616585#c12)
  *
  * There are several ways to receive storage-permission notifications. You can
  * use these notifications to re-initialize components, to nullify or enable
  them
  * to use the “new” effective StoragePrincipal. The list of the notifications
  is:
  *
- * - Add some code in nsGlobalWindowInner::StorageAccessGranted().
- * - WorkerScope::FirstPartyStorageAccessGranted for Workers.
+ * - Add some code in nsGlobalWindowInner::StorageAccessPermissionGranted().
+ * - WorkerScope::StorageAccessPermissionGranted for Workers.
  * - observe the permission changes (not recommended)
  *
  * Scope of Storage Access
  * ~~~~~~~~~~~~~~~~~~~~~~~
  *
  * Immediately after access is granted, the permission is propagated and
  notified
  * to any contexts (windows and workers) in the same agent-cluster