⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 292010 in webkit


Ignore:
Timestamp:
Mar 28, 2022, 5:00:29 PM (5 years ago)
Author:
sihui_liu@apple.com
Message:

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:
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r291992 r292010  
     12022-03-28  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Disable custom storage paths for IndexedDB and LocalStorage by default
     4        https://bugs.webkit.org/show_bug.cgi?id=236977
     5        <rdar://problem/89559929>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add an internal debug feature for using genreal directory for storage.
     10
     11        * Scripts/Preferences/WebPreferencesInternal.yaml:
     12
    1132022-03-28  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml

    r291938 r292010  
    981981      default: WebKit::defaultUseGPUProcessForMediaEnabled()
    982982
     983UseGeneralDirectoryForStorage:
     984  type: bool
     985  humanReadableName: "Use General Directory For Storage"
     986  humanReadableDescription: "Use general storage directory for IndexedDB and LocalStorage"
     987  webcoreBinding: none
     988  exposed: [ WebKit ]
     989  defaultValue:
     990    WebKit:
     991      default: true
     992
    983993UseSceneKitForModel:
    984994  type: bool
  • trunk/Source/WebKit/ChangeLog

    r292008 r292010  
     12022-03-28  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Disable custom storage paths for IndexedDB and LocalStorage by default
     4        https://bugs.webkit.org/show_bug.cgi?id=236977
     5        <rdar://problem/89559929>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Developers can enable them by disabling "general directory for storage" via internal debug feature or system
     10        feature flag.
     11
     12        * FeatureFlags/WebKit-appletvos.plist:
     13        * FeatureFlags/WebKit-ios.plist:
     14        * FeatureFlags/WebKit-macos.plist:
     15        * FeatureFlags/WebKit-watchos.plist:
     16        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     17        (WebKit::internalFeatureEnabled):
     18        (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
     19
    1202022-03-28  Commit Queue  <commit-queue@webkit.org>
    221
  • trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist

    r291940 r292010  
    9696        <dict>
    9797                <key>Enabled</key>
    98                 <false/>
     98                <true/>
    9999        </dict>
    100100</dict>
  • trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist

    r291940 r292010  
    9696        <dict>
    9797                <key>Enabled</key>
    98                 <false/>
     98                <true/>
    9999        </dict>
    100100</dict>
  • trunk/Source/WebKit/FeatureFlags/WebKit-macos.plist

    r291940 r292010  
    101101        <dict>
    102102                <key>Enabled</key>
    103                 <false/>
     103                <true/>
    104104        </dict>
    105105</dict>
  • trunk/Source/WebKit/FeatureFlags/WebKit-watchos.plist

    r291940 r292010  
    9696        <dict>
    9797                <key>Enabled</key>
    98                 <false/>
     98                <true/>
    9999        </dict>
    100100</dict>
  • trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r291940 r292010  
    9494#endif
    9595
     96static bool internalFeatureEnabled(const String& key, bool defaultValue = false)
     97{
     98    auto defaultsKey = adoptNS([[NSString alloc] initWithFormat:@"InternalDebug%@", static_cast<NSString *>(key)]);
     99    if ([[NSUserDefaults standardUserDefaults] objectForKey:defaultsKey.get()] != nil)
     100        return [[NSUserDefaults standardUserDefaults] boolForKey:defaultsKey.get()];
     101
     102    return defaultValue;
     103}
     104
    96105static bool experimentalFeatureEnabled(const String& key)
    97106{
    … …  
    620629bool WebsiteDataStore::defaultShouldUseCustomStoragePaths()
    621630{
    622     static const bool useGeneralStorageDirectory = isFeatureFlagEnabled("general_directory_for_storage"_s);
    623     return !useGeneralStorageDirectory;
    624 }
    625 
    626 }
     631    bool useGeneralDirectoryForStorageFeatureFlag = isFeatureFlagEnabled("general_directory_for_storage"_s, true);
     632    return !internalFeatureEnabled(WebPreferencesKey::useGeneralDirectoryForStorageKey(), useGeneralDirectoryForStorageFeatureFlag);
     633}
     634
     635}
Note: See TracChangeset for help on using the changeset viewer.