[webkit-changes] [WebKit/WebKit] f7563e: [Cocoa] Calculate quota based on disk space by def...

Sihui noreply at github.com
Fri Apr 21 11:02:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f7563eebd868af7f20acf3c2352c0243266e52d2
      https://github.com/WebKit/WebKit/commit/f7563eebd868af7f20acf3c2352c0243266e52d2
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2023-04-21 (Fri, 21 Apr 2023)

  Changed paths:
    M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp
    M Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp
    M Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
    M Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm
    M Tools/WebKitTestRunner/TestController.cpp

  Log Message:
  -----------
  [Cocoa] Calculate quota based on disk space by default
https://bugs.webkit.org/show_bug.cgi?id=255095
rdar://107711361

Reviewed by Youenn Fablet.

Make quota calculated based on total disk space by setting default value of originQuotaRatio and totalQuotaRatio to be
non-null. Client could change it to null and fall back to old behavior (i.e. requesting quota to be value specified by
perOriginStorageQuota). The default values are picked based on current implementation of other browsers.
WebKitTestRunner still has old behavior as we have quite a few layout tests depending on the fixed quota value.

This patch also makes sure an exception is thrown if ratio argument is invalid (not in range [0, 1]).

* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::NetworkStorageManager::donePrepareForEviction):
(WebKit::NetworkStorageManager::performEviction):
(WebKit::NetworkStorageManager::evictDataByTopOrigin):
(WebKit::NetworkStorageManager::getOriginDirectory):
* Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
(WKWebsiteDataStoreConfigurationHasOriginQuotaRatio):
(WKWebsiteDataStoreConfigurationClearOriginQuotaRatio):
(WKWebsiteDataStoreConfigurationHasTotalQuotaRatio):
(WKWebsiteDataStoreConfigurationClearTotalQuotaRatio):
* Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration originQuotaRatio]):
(-[_WKWebsiteDataStoreConfiguration setOriginQuotaRatio:]):
(-[_WKWebsiteDataStoreConfiguration totalQuotaRatio]):
(-[_WKWebsiteDataStoreConfiguration setTotalQuotaRatio:]):
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::defaultOriginQuotaRatio):
(WebKit::WebsiteDataStore::defaultTotalQuotaRatio):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::defaultOriginQuotaRatio):
(WebKit::WebsiteDataStore::defaultTotalQuotaRatio):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::configureWebsiteDataStoreTemporaryDirectories):

Canonical link: https://commits.webkit.org/263250@main




More information about the webkit-changes mailing list