Bug 1612376 - P5. Remove HasStoragePermission from WindowContext r=timhuang,baku
authorDimi Lee <dlee@mozilla.com>
Wed, 29 Apr 2020 14:48:39 +0000
changeset 526675 6400cd18a2972f4eb48774b4dcc46325ad9ee109
parent 526674 e2eb63c3ce5caf55069da424079d9ad293bf5999
child 526676 dd05e268e6ec0bad1ee3574f8e7eb92fc02535f4
push id37361
push usermalexandru@mozilla.com
push dateWed, 29 Apr 2020 21:55:39 +0000
treeherdermozilla-central@bc0932b38478 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstimhuang, baku
bugs1612376
milestone77.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 1612376 - P5. Remove HasStoragePermission from WindowContext r=timhuang,baku We don't access HasStoragePermission across process, so we don't need to store the permission in WindowContext. After this patch, HasStoragePermission will only be stored in the channel's LoadInfo, which is set when a channel is created in the parent and it won't be updated. Depends on D71985 Differential Revision: https://phabricator.services.mozilla.com/D72305
docshell/base/WindowContext.h
dom/base/nsGlobalWindowOuter.cpp
--- a/docshell/base/WindowContext.h
+++ b/docshell/base/WindowContext.h
@@ -15,17 +15,16 @@
 namespace mozilla {
 namespace dom {
 
 class WindowGlobalParent;
 
 #define MOZ_EACH_WC_FIELD(FIELD)                                       \
   FIELD(OuterWindowId, uint64_t)                                       \
   FIELD(CookieJarSettings, Maybe<mozilla::net::CookieJarSettingsArgs>) \
-  FIELD(HasStoragePermission, bool)                                    \
   /* Whether the given window hierarchy is third party. See            \
    * ThirdPartyUtil::IsThirdPartyWindow for details */                 \
   FIELD(IsThirdPartyWindow, bool)                                      \
   /* Whether this window's channel has been marked as a third-party    \
    * tracking resource */                                              \
   FIELD(IsThirdPartyTrackingResourceWindow, bool)
 
 class WindowContext : public nsISupports, public nsWrapperCache {
@@ -103,21 +102,16 @@ class WindowContext : public nsISupports
   }
 
   bool CanSet(FieldIndex<IDX_CookieJarSettings>,
               const Maybe<mozilla::net::CookieJarSettingsArgs>& aValue,
               ContentParent* aSource) {
     return true;
   }
 
-  bool CanSet(FieldIndex<IDX_HasStoragePermission>, const bool& aValue,
-              ContentParent* aSource) {
-    return true;
-  }
-
   bool CanSet(FieldIndex<IDX_IsThirdPartyWindow>,
               const bool& IsThirdPartyWindow, ContentParent* aSource);
   bool CanSet(FieldIndex<IDX_IsThirdPartyTrackingResourceWindow>,
               const bool& aIsThirdPartyTrackingResourceWindow,
               ContentParent* aSource);
 
   // Overload `DidSet` to get notifications for a particular field being set.
   //
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -2410,22 +2410,16 @@ nsresult nsGlobalWindowOuter::SetNewDocu
       newInnerWindow->InitDocumentDependentState(cx);
 
       // Initialize DOM classes etc on the inner window.
       JS::Rooted<JSObject*> obj(cx, newInnerGlobal);
       rv = kungFuDeathGrip->InitClasses(obj);
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
-    // We would check the storage access in below function, so we need to
-    // set the flag before it.
-    newInnerWindow->GetWindowGlobalChild()
-        ->WindowContext()
-        ->SetHasStoragePermission(aDocument->HasStoragePermission());
-
     // When replacing an initial about:blank document we call
     // ExecutionReady again to update the client creation URL.
     rv = newInnerWindow->ExecutionReady();
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (mArguments) {
       newInnerWindow->DefineArgumentsProperty(mArguments);
       mArguments = nullptr;