Bug 1555564 - Part 1: Support the privacy.restrict3rdpartystorage.partitionedHosts pref for both dynamic FPI and storage principal; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 30 May 2019 12:09:42 +0000
changeset 476231 7b3e1ab23b288e9e08c3d7a2e50d8071b826b44b
parent 476230 d740ef198b052859e25c4a49dce78a5be14035ff
child 476232 441094863251d25debebf98ad09cf02e665a6eed
push id86736
push usereakhgari@mozilla.com
push dateThu, 30 May 2019 16:45:20 +0000
treeherderautoland@9cd79017eae8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1555564
milestone69.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 1555564 - Part 1: Support the privacy.restrict3rdpartystorage.partitionedHosts pref for both dynamic FPI and storage principal; r=baku Differential Revision: https://phabricator.services.mozilla.com/D33116
dom/base/nsGlobalWindowInner.cpp
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -4444,17 +4444,17 @@ Storage* nsGlobalWindowInner::GetLocalSt
   // This is a temporary web-compatibility hack.
 
   StorageAccess access = StorageAllowedForWindow(this);
 
   // We allow partitioned localStorage only to some hosts.
   if (ShouldPartitionStorage(access)) {
     if (!mDoc) {
       access = StorageAccess::eDeny;
-    } else if (!StaticPrefs::privacy_storagePrincipal_enabledForTrackers()) {
+    } else if (!StoragePartitioningEnabled(access, mDoc->CookieSettings())) {
       nsCOMPtr<nsIURI> uri;
       Unused << mDoc->NodePrincipal()->GetURI(getter_AddRefs(uri));
       static const char* kPrefName =
           "privacy.restrict3rdpartystorage.partitionedHosts";
       if (!uri || !nsContentUtils::IsURIInPrefList(uri, kPrefName)) {
         access = StorageAccess::eDeny;
       }
     }