Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adjust heuristics for reported quota
https://bugs.webkit.org/show_bug.cgi?id=256615 rdar://problem/109173368 Reviewed by Youenn Fablet. In existing implementation, StorageManager API returns a fixed value when existing usage is smaller than the fixed value (standardReportedQuota, and default value is 10 GB). This patch makes a few improvements: 1. Calculate standardReportedQuota based on originQuotaRatio and standardVolumeCapacity, instead of directly setting value for standardReportedQuota -- standardReportedQuota = standardVolumeCapacity * originQuotaRatio. 2. Unlike defaultStandardReportedQuota, defaultStandardVolumeCapacity is different on different platforms by default, which will make the reported quota value more reasonable. 3. Ensure reported quota is at least twice the current usage. A problem in existing implementation is client needs to store over 10 GB to find out the quota that is bigger than 10 GB, but if client sees the reported quota as 10 GB, they may never store over that. 4. OriginQuotaManager::reportedQuota() uses reported usage (`OriginQuotaManager::usage()`) instead of actual disk usage (`m_usage`). Reported usage tracks the realtime usage which includes the granted space, and we use that in quota check for storage operation. Test: WKWebsiteDataStoreConfiguration.StandardVolumeCapacity * Source/WebKit/NetworkProcess/NetworkSession.cpp: (WebKit::createNetworkStorageManager): * Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h: * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::create): (WebKit::NetworkStorageManager::NetworkStorageManager): (WebKit::NetworkStorageManager::originStorageManager): * Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h: * Source/WebKit/NetworkProcess/storage/OriginQuotaManager.cpp: (WebKit::OriginQuotaManager::reportedQuota): (WebKit::OriginQuotaManager::reportedQuota const): Deleted. * Source/WebKit/NetworkProcess/storage/OriginQuotaManager.h: * Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration standardVolumeCapacity]): (-[_WKWebsiteDataStoreConfiguration setStandardVolumeCapacity:]): * Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::defaultStandardVolumeCapacity): * Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): (WebKit::WebsiteDataStoreConfiguration::copy const): * Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::standardVolumeCapacity const): (WebKit::WebsiteDataStoreConfiguration::setStandardVolumeCapacity): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/264446@main
- Loading branch information
Showing
14 changed files
with
150 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.