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

Changeset 292038 in webkit


Ignore:
Timestamp:
Mar 29, 2022, 10:29:42 AM (5 years ago)
Author:
Russell Epstein
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

Location:
branches/safari-614.1.8-branch/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-614.1.8-branch/Source/WTF/ChangeLog

    r291985 r292038  
     12022-03-29  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r292010. rdar://problem/89559929
     4
     5    Disable custom storage paths for IndexedDB and LocalStorage by default
     6    https://bugs.webkit.org/show_bug.cgi?id=236977
     7    <rdar://problem/89559929>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/WebKit:
     12   
     13    Developers can enable them by disabling "general directory for storage" via internal debug feature or system
     14    feature flag.
     15   
     16    * FeatureFlags/WebKit-appletvos.plist:
     17    * FeatureFlags/WebKit-ios.plist:
     18    * FeatureFlags/WebKit-macos.plist:
     19    * FeatureFlags/WebKit-watchos.plist:
     20    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     21    (WebKit::internalFeatureEnabled):
     22    (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
     23   
     24    Source/WTF:
     25   
     26    Add an internal debug feature for using genreal directory for storage.
     27   
     28    * Scripts/Preferences/WebPreferencesInternal.yaml:
     29   
     30   
     31    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     32
     33    2022-03-28  Sihui Liu  <sihui_liu@apple.com>
     34
     35            Disable custom storage paths for IndexedDB and LocalStorage by default
     36            https://bugs.webkit.org/show_bug.cgi?id=236977
     37            <rdar://problem/89559929>
     38
     39            Reviewed by Geoffrey Garen.
     40
     41            Add an internal debug feature for using genreal directory for storage.
     42
     43            * Scripts/Preferences/WebPreferencesInternal.yaml:
     44
    1452022-03-28  Russell Epstein  <repstein@apple.com>
    246
  • branches/safari-614.1.8-branch/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml

    r291938 r292038  
    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
  • branches/safari-614.1.8-branch/Source/WebKit/ChangeLog

    r292023 r292038  
     12022-03-29  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r292010. rdar://problem/89559929
     4
     5    Disable custom storage paths for IndexedDB and LocalStorage by default
     6    https://bugs.webkit.org/show_bug.cgi?id=236977
     7    <rdar://problem/89559929>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/WebKit:
     12   
     13    Developers can enable them by disabling "general directory for storage" via internal debug feature or system
     14    feature flag.
     15   
     16    * FeatureFlags/WebKit-appletvos.plist:
     17    * FeatureFlags/WebKit-ios.plist:
     18    * FeatureFlags/WebKit-macos.plist:
     19    * FeatureFlags/WebKit-watchos.plist:
     20    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     21    (WebKit::internalFeatureEnabled):
     22    (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
     23   
     24    Source/WTF:
     25   
     26    Add an internal debug feature for using genreal directory for storage.
     27   
     28    * Scripts/Preferences/WebPreferencesInternal.yaml:
     29   
     30   
     31    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     32
     33    2022-03-28  Sihui Liu  <sihui_liu@apple.com>
     34
     35            Disable custom storage paths for IndexedDB and LocalStorage by default
     36            https://bugs.webkit.org/show_bug.cgi?id=236977
     37            <rdar://problem/89559929>
     38
     39            Reviewed by Geoffrey Garen.
     40
     41            Developers can enable them by disabling "general directory for storage" via internal debug feature or system
     42            feature flag.
     43
     44            * FeatureFlags/WebKit-appletvos.plist:
     45            * FeatureFlags/WebKit-ios.plist:
     46            * FeatureFlags/WebKit-macos.plist:
     47            * FeatureFlags/WebKit-watchos.plist:
     48            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     49            (WebKit::internalFeatureEnabled):
     50            (WebKit::WebsiteDataStore::defaultShouldUseCustomStoragePaths):
     51
    1522022-03-28  Russell Epstein  <repstein@apple.com>
    253
  • branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-appletvos.plist

    r291940 r292038  
    9696        <dict>
    9797                <key>Enabled</key>
    98                 <false/>
     98                <true/>
    9999        </dict>
    100100</dict>
  • branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-ios.plist

    r291940 r292038  
    9696        <dict>
    9797                <key>Enabled</key>
    98                 <false/>
     98                <true/>
    9999        </dict>
    100100</dict>
  • branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-macos.plist

    r291940 r292038  
    101101        <dict>
    102102                <key>Enabled</key>
    103                 <false/>
     103                <true/>
    104104        </dict>
    105105</dict>
  • branches/safari-614.1.8-branch/Source/WebKit/FeatureFlags/WebKit-watchos.plist

    r291940 r292038  
    9696        <dict>
    9797                <key>Enabled</key>
    98                 <false/>
     98                <true/>
    9999        </dict>
    100100</dict>
  • branches/safari-614.1.8-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r291940 r292038  
    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.