Title: [292038] branches/safari-614.1.8-branch/Source
Revision
292038
Author
[email protected]
Date
2022-03-29 10:29:42 -0700 (Tue, 29 Mar 2022)

Log Message

Cherry-pick r292010. rdar://problem/89559929

    Disable custom storage paths for IndexedDB and LocalStorage by default
    https://bugs.webkit.org/show_bug.cgi?id=236977
    <rdar://problem/89559929>

    Reviewed by Geoffrey Garen.

    Source/WebKit:

    Developers can enable them by disabling "general directory for storage" via internal debug feature or system
    feature flag.

    * FeatureFlags/WebKit-appletvos.plist:
    * FeatureFlags/WebKit-ios.plist:
    * FeatureFlags/WebKit-macos.plist:
    * FeatureFlags/WebKit-watchos.plist:
    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
    (WebKit::internalFeatureEnabled):
    (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):

    Source/WTF:

    Add an internal debug feature for using genreal directory for storage.

    * Scripts/Preferences/WebPreferencesInternal.yaml:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292010 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-614.1.8-branch/Source/WTF/ChangeLog (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WTF/ChangeLog	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WTF/ChangeLog	2022-03-29 17:29:42 UTC (rev 292038)
@@ -1,3 +1,47 @@
+2022-03-29  Russell Epstein  <[email protected]>
+
+        Cherry-pick r292010. rdar://problem/89559929
+
+    Disable custom storage paths for IndexedDB and LocalStorage by default
+    https://bugs.webkit.org/show_bug.cgi?id=236977
+    <rdar://problem/89559929>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Source/WebKit:
+    
+    Developers can enable them by disabling "general directory for storage" via internal debug feature or system
+    feature flag.
+    
+    * FeatureFlags/WebKit-appletvos.plist:
+    * FeatureFlags/WebKit-ios.plist:
+    * FeatureFlags/WebKit-macos.plist:
+    * FeatureFlags/WebKit-watchos.plist:
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::internalFeatureEnabled):
+    (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
+    
+    Source/WTF:
+    
+    Add an internal debug feature for using genreal directory for storage.
+    
+    * Scripts/Preferences/WebPreferencesInternal.yaml:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-28  Sihui Liu  <[email protected]>
+
+            Disable custom storage paths for IndexedDB and LocalStorage by default
+            https://bugs.webkit.org/show_bug.cgi?id=236977
+            <rdar://problem/89559929>
+
+            Reviewed by Geoffrey Garen.
+
+            Add an internal debug feature for using genreal directory for storage.
+
+            * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2022-03-28  Russell Epstein  <[email protected]>
 
         Cherry-pick r291979. rdar://problem/90616651

Modified: branches/safari-614.1.8-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2022-03-29 17:29:42 UTC (rev 292038)
@@ -980,6 +980,16 @@
     WebKit:
       default: WebKit::defaultUseGPUProcessForMediaEnabled()
 
+UseGeneralDirectoryForStorage:
+  type: bool
+  humanReadableName: "Use General Directory For Storage"
+  humanReadableDescription: "Use general storage directory for IndexedDB and LocalStorage"
+  webcoreBinding: none
+  exposed: [ WebKit ]
+  defaultValue:
+    WebKit:
+      default: true
+
 UseSceneKitForModel:
   type: bool
   humanReadableName: "Use SceneKit for <model>"

Modified: branches/safari-614.1.8-branch/Source/WebKit/ChangeLog (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WebKit/ChangeLog	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WebKit/ChangeLog	2022-03-29 17:29:42 UTC (rev 292038)
@@ -1,3 +1,54 @@
+2022-03-29  Russell Epstein  <[email protected]>
+
+        Cherry-pick r292010. rdar://problem/89559929
+
+    Disable custom storage paths for IndexedDB and LocalStorage by default
+    https://bugs.webkit.org/show_bug.cgi?id=236977
+    <rdar://problem/89559929>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Source/WebKit:
+    
+    Developers can enable them by disabling "general directory for storage" via internal debug feature or system
+    feature flag.
+    
+    * FeatureFlags/WebKit-appletvos.plist:
+    * FeatureFlags/WebKit-ios.plist:
+    * FeatureFlags/WebKit-macos.plist:
+    * FeatureFlags/WebKit-watchos.plist:
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::internalFeatureEnabled):
+    (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
+    
+    Source/WTF:
+    
+    Add an internal debug feature for using genreal directory for storage.
+    
+    * Scripts/Preferences/WebPreferencesInternal.yaml:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-28  Sihui Liu  <[email protected]>
+
+            Disable custom storage paths for IndexedDB and LocalStorage by default
+            https://bugs.webkit.org/show_bug.cgi?id=236977
+            <rdar://problem/89559929>
+
+            Reviewed by Geoffrey Garen.
+
+            Developers can enable them by disabling "general directory for storage" via internal debug feature or system
+            feature flag.
+
+            * FeatureFlags/WebKit-appletvos.plist:
+            * FeatureFlags/WebKit-ios.plist:
+            * FeatureFlags/WebKit-macos.plist:
+            * FeatureFlags/WebKit-watchos.plist:
+            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+            (WebKit::internalFeatureEnabled):
+            (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
+
 2022-03-28  Russell Epstein  <[email protected]>
 
         Cherry-pick r291982. rdar://problem/90927474

Modified: branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-appletvos.plist (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-appletvos.plist	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-appletvos.plist	2022-03-29 17:29:42 UTC (rev 292038)
@@ -95,7 +95,7 @@
 	<key>general_directory_for_storage</key>
 	<dict>
 		<key>Enabled</key>
-		<false/>
+		<true/>
 	</dict>
 </dict>
 </plist>

Modified: branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-ios.plist (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-ios.plist	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-ios.plist	2022-03-29 17:29:42 UTC (rev 292038)
@@ -95,7 +95,7 @@
 	<key>general_directory_for_storage</key>
 	<dict>
 		<key>Enabled</key>
-		<false/>
+		<true/>
 	</dict>
 </dict>
 </plist>

Modified: branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-macos.plist (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-macos.plist	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-macos.plist	2022-03-29 17:29:42 UTC (rev 292038)
@@ -100,7 +100,7 @@
 	<key>general_directory_for_storage</key>
 	<dict>
 		<key>Enabled</key>
-		<false/>
+		<true/>
 	</dict>
 </dict>
 </plist>

Modified: branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-watchos.plist (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-watchos.plist	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-watchos.plist	2022-03-29 17:29:42 UTC (rev 292038)
@@ -95,7 +95,7 @@
 	<key>general_directory_for_storage</key>
 	<dict>
 		<key>Enabled</key>
-		<false/>
+		<true/>
 	</dict>
 </dict>
 </plist>

Modified: branches/safari-614.1.8-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (292037 => 292038)


--- branches/safari-614.1.8-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2022-03-29 17:26:24 UTC (rev 292037)
+++ branches/safari-614.1.8-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2022-03-29 17:29:42 UTC (rev 292038)
@@ -93,6 +93,15 @@
 }
 #endif
 
+static bool internalFeatureEnabled(const String& key, bool defaultValue = false)
+{
+    auto defaultsKey = adoptNS([[NSString alloc] initWithFormat:@"InternalDebug%@", static_cast<NSString *>(key)]);
+    if ([[NSUserDefaults standardUserDefaults] objectForKey:defaultsKey.get()] != nil)
+        return [[NSUserDefaults standardUserDefaults] boolForKey:defaultsKey.get()];
+
+    return defaultValue;
+}
+
 static bool experimentalFeatureEnabled(const String& key)
 {
 #if PLATFORM(MAC)
@@ -619,8 +628,8 @@
 
 bool WebsiteDataStore::defaultShouldUseCustomStoragePaths()
 {
-    static const bool useGeneralStorageDirectory = isFeatureFlagEnabled("general_directory_for_storage"_s);
-    return !useGeneralStorageDirectory;
+    bool useGeneralDirectoryForStorageFeatureFlag = isFeatureFlagEnabled("general_directory_for_storage"_s, true);
+    return !internalFeatureEnabled(WebPreferencesKey::useGeneralDirectoryForStorageKey(), useGeneralDirectoryForStorageFeatureFlag);
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to