Skip to content
Permalink
Browse files
Bump default cache storage quota to 20MB
https://bugs.webkit.org/show_bug.cgi?id=178132

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-11
Reviewed by Alex Christensen.

Source/WebCore:

Covered by http/wpt/cache-storage/cache-quota.any.html.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const):
(WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota):

Source/WebKit:

Adding the ability to set the quota per origin through WebsiteDataStore.
Moving cache storage directory setting also in WebsiteDataStore.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
(-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
(-[WKWebsiteDataStore _cacheStorageDirectory]):
(-[WKWebsiteDataStore _setCacheStorageDirectory:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
(WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
(WebKit::WebsiteDataStore::cacheStorageDirectory const):
(WebKit::WebsiteDataStore::setCacheStorageDirectory):

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration): Setting quota to 400kb

Canonical link: https://commits.webkit.org/194437@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Oct 11, 2017
1 parent 1bd4940 commit 36c331fec8f4dd2fd253d4d1928582e3b50b1032
Showing 21 changed files with 128 additions and 49 deletions.
@@ -1,3 +1,16 @@
2017-10-11 Youenn Fablet <youenn@apple.com>

Bump default cache storage quota to 20MB
https://bugs.webkit.org/show_bug.cgi?id=178132

Reviewed by Alex Christensen.

Covered by http/wpt/cache-storage/cache-quota.any.html.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const):
(WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota):

2017-10-11 Myles C. Maxfield <mmaxfield@apple.com>

Allow PAL to log messages
@@ -79,6 +79,8 @@ class NetworkStorageSession {

const String& cacheStorageDirectory() const { return m_cacheStorageDirectory; }
void setCacheStorageDirectory(String&& path) { m_cacheStorageDirectory = WTFMove(path); }
uint64_t cacheStoragePerOriginQuota() const { return m_cacheStoragePerOriginQuota; }
void setCacheStoragePerOriginQuota(uint64_t quota) { m_cacheStoragePerOriginQuota = quota; }

#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
WEBCORE_EXPORT static void ensureSession(PAL::SessionID, const String& identifierBase, RetainPtr<CFHTTPCookieStorageRef>&&);
@@ -146,6 +148,7 @@ class NetworkStorageSession {
CredentialStorage m_credentialStorage;

String m_cacheStorageDirectory;
uint64_t m_cacheStoragePerOriginQuota { 0 };

#if HAVE(CFNETWORK_STORAGE_PARTITIONING)
bool shouldPartitionCookies(const String& topPrivatelyControlledDomain) const;
@@ -1,3 +1,49 @@
2017-10-11 Youenn Fablet <youenn@apple.com>

Bump default cache storage quota to 20MB
https://bugs.webkit.org/show_bug.cgi?id=178132

Reviewed by Alex Christensen.

Adding the ability to set the quota per origin through WebsiteDataStore.
Moving cache storage directory setting also in WebsiteDataStore.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::encode const):
(WebKit::WebsiteDataStoreParameters::decode):
* Shared/WebsiteDataStoreParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
(-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
(-[WKWebsiteDataStore _cacheStorageDirectory]):
(-[WKWebsiteDataStore _setCacheStorageDirectory:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
(WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
(WebKit::WebsiteDataStore::cacheStorageDirectory const):
(WebKit::WebsiteDataStore::setCacheStorageDirectory):

2017-10-11 Myles C. Maxfield <mmaxfield@apple.com>

Allow PAL to log messages
@@ -48,6 +48,7 @@
#include "SessionTracker.h"
#include "WebCoreArgumentCoders.h"
#include "WebErrors.h"
#include "WebsiteDataStore.h"
#include "WebsiteDataStoreParameters.h"
#include <WebCore/NetworkStorageSession.h>
#include <WebCore/PingHandle.h>
@@ -467,7 +468,7 @@ void NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled(boo

void NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession()
{
NetworkProcess::singleton().ensurePrivateBrowsingSession({PAL::SessionID::legacyPrivateSessionID(), { }, { }, { }, { }, { }});
NetworkProcess::singleton().ensurePrivateBrowsingSession({PAL::SessionID::legacyPrivateSessionID(), { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }});
}

} // namespace WebKit
@@ -50,6 +50,7 @@
#include "WebProcessPoolMessages.h"
#include "WebsiteData.h"
#include "WebsiteDataFetchOption.h"
#include "WebsiteDataStore.h"
#include "WebsiteDataStoreParameters.h"
#include "WebsiteDataType.h"
#include <WebCore/DNS.h>
@@ -238,7 +239,7 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&&

// FIXME: instead of handling this here, a message should be sent later (scales to multiple sessions)
if (parameters.privateBrowsingEnabled)
RemoteNetworkingContext::ensurePrivateBrowsingSession({PAL::SessionID::legacyPrivateSessionID(), { }, { }, { }, { }, { }});
RemoteNetworkingContext::ensurePrivateBrowsingSession({PAL::SessionID::legacyPrivateSessionID(), { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }});

if (parameters.shouldUseTestingNetworkSession)
NetworkStorageSession::switchToNewTestingSession();
@@ -131,6 +131,7 @@
if (!parameters.cacheStorageDirectory.isNull()) {
SandboxExtension::consumePermanently(parameters.cacheStorageDirectoryExtensionHandle);
session->setCacheStorageDirectory(WTFMove(parameters.cacheStorageDirectory));
session->setCacheStoragePerOriginQuota(parameters.cacheStoragePerOriginQuota);
}

#if USE(NETWORK_SESSION)
@@ -41,6 +41,7 @@ void WebsiteDataStoreParameters::encode(IPC::Encoder& encoder) const
encoder << cookieStoragePathExtensionHandle;
encoder << pendingCookies;
encoder << cacheStorageDirectory;
encoder << cacheStoragePerOriginQuota;
encoder << cacheStorageDirectoryExtensionHandle;
}

@@ -64,6 +65,9 @@ bool WebsiteDataStoreParameters::decode(IPC::Decoder& decoder, WebsiteDataStoreP
if (!decoder.decode(parameters.cacheStorageDirectory))
return false;

if (!decoder.decode(parameters.cacheStoragePerOriginQuota))
return false;

if (!decoder.decode(parameters.cacheStorageDirectoryExtensionHandle))
return false;

@@ -51,6 +51,7 @@ struct WebsiteDataStoreParameters {
SandboxExtension::Handle cookieStoragePathExtensionHandle;
Vector<WebCore::Cookie> pendingCookies;
String cacheStorageDirectory;
uint64_t cacheStoragePerOriginQuota { 0 };
SandboxExtension::Handle cacheStorageDirectoryExtensionHandle;
};

@@ -46,9 +46,6 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithLegacyOptions(

configuration->m_applicationCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory();
configuration->m_applicationCacheFlatFileSubdirectoryName = "ApplicationCache";
#if PLATFORM(COCOA)
configuration->m_cacheStorageDirectory = WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory();
#endif
configuration->m_diskCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory();
configuration->m_mediaCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory();
configuration->m_indexedDBDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory();
@@ -66,7 +63,6 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithWebsiteDataSto

configuration->m_applicationCacheDirectory = legacyConfiguration.applicationCacheDirectory;
configuration->m_applicationCacheFlatFileSubdirectoryName = legacyConfiguration.applicationCacheFlatFileSubdirectoryName;
configuration->m_cacheStorageDirectory = legacyConfiguration.cacheStorageDirectory;
configuration->m_diskCacheDirectory = legacyConfiguration.networkCacheDirectory;
configuration->m_mediaCacheDirectory = legacyConfiguration.mediaCacheDirectory;
configuration->m_indexedDBDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory();
@@ -81,9 +77,6 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithWebsiteDataSto
ProcessPoolConfiguration::ProcessPoolConfiguration()
: m_applicationCacheDirectory(WebsiteDataStore::defaultApplicationCacheDirectory())
, m_applicationCacheFlatFileSubdirectoryName("Files")
#if PLATFORM(COCOA)
, m_cacheStorageDirectory(WebsiteDataStore::defaultCacheStorageDirectory())
#endif
, m_diskCacheDirectory(WebsiteDataStore::defaultNetworkCacheDirectory())
, m_mediaCacheDirectory(WebsiteDataStore::defaultMediaCacheDirectory())
, m_indexedDBDatabaseDirectory(WebsiteDataStore::defaultIndexedDBDatabaseDirectory())
@@ -110,9 +103,6 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::copy()
copy->m_diskCacheSizeOverride = this->m_diskCacheSizeOverride;
copy->m_applicationCacheDirectory = this->m_applicationCacheDirectory;
copy->m_applicationCacheFlatFileSubdirectoryName = this->m_applicationCacheFlatFileSubdirectoryName;
copy->m_cacheStorageDirectory = this->m_cacheStorageDirectory;
copy->m_cacheStorageDirectory = this->m_cacheStorageDirectory;
copy->m_cacheStoragePerOriginQuota = this->m_cacheStoragePerOriginQuota;
copy->m_mediaCacheDirectory = this->m_mediaCacheDirectory;
copy->m_indexedDBDatabaseDirectory = this->m_indexedDBDatabaseDirectory;
copy->m_injectedBundlePath = this->m_injectedBundlePath;
@@ -137,7 +127,7 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::copy()
copy->m_ctDataConnectionServiceType = this->m_ctDataConnectionServiceType;
#endif
copy->m_presentingApplicationPID = this->m_presentingApplicationPID;

return copy;
}

@@ -67,10 +67,6 @@ class ProcessPoolConfiguration final : public ObjectImpl<Object::Type::ProcessPo

const WTF::String& applicationCacheFlatFileSubdirectoryName() const { return m_applicationCacheFlatFileSubdirectoryName; }

const WTF::String& cacheStorageDirectory() const { return m_cacheStorageDirectory; }
void setCacheStorageDirectory(WTF::String&& cacheStorageDirectory) { m_cacheStorageDirectory = WTFMove(cacheStorageDirectory); }
uint64_t cacheStoragePerOriginQuota() const { return m_cacheStoragePerOriginQuota; }

const WTF::String& diskCacheDirectory() const { return m_diskCacheDirectory; }
void setDiskCacheDirectory(const WTF::String& diskCacheDirectory) { m_diskCacheDirectory = diskCacheDirectory; }

@@ -152,8 +148,6 @@ class ProcessPoolConfiguration final : public ObjectImpl<Object::Type::ProcessPo

WTF::String m_applicationCacheDirectory;
WTF::String m_applicationCacheFlatFileSubdirectoryName;
WTF::String m_cacheStorageDirectory;
uint64_t m_cacheStoragePerOriginQuota { 400 * 1024 };
WTF::String m_diskCacheDirectory;
WTF::String m_mediaCacheDirectory;
WTF::String m_indexedDBDatabaseDirectory;
@@ -58,16 +58,6 @@ void WKContextConfigurationSetDiskCacheDirectory(WKContextConfigurationRef confi
toImpl(configuration)->setDiskCacheDirectory(toImpl(diskCacheDirectory)->string());
}

WKStringRef WKContextConfigurationCopyCacheStorageDirectory(WKContextConfigurationRef configuration)
{
return toCopiedAPI(toImpl(configuration)->cacheStorageDirectory());
}

void WKContextConfigurationSetCacheStorageDirectory(WKContextConfigurationRef configuration, WKStringRef cacheStorageDirectory)
{
toImpl(configuration)->setCacheStorageDirectory(toImpl(cacheStorageDirectory)->string());
}

WKStringRef WKContextConfigurationCopyApplicationCacheDirectory(WKContextConfigurationRef configuration)
{
return toCopiedAPI(toImpl(configuration)->applicationCacheDirectory());
@@ -41,9 +41,6 @@ WK_EXPORT void WKContextConfigurationSetApplicationCacheDirectory(WKContextConfi
WK_EXPORT WKStringRef WKContextConfigurationCopyDiskCacheDirectory(WKContextConfigurationRef configuration);
WK_EXPORT void WKContextConfigurationSetDiskCacheDirectory(WKContextConfigurationRef configuration, WKStringRef diskCacheDirectory);

WK_EXPORT WKStringRef WKContextConfigurationCopyCacheStorageDirectory(WKContextConfigurationRef configuration);
WK_EXPORT void WKContextConfigurationSetCacheStorageDirectory(WKContextConfigurationRef configuration, WKStringRef cacheStorageDirectory);

WK_EXPORT WKStringRef WKContextConfigurationCopyIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration);
WK_EXPORT void WKContextConfigurationSetIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef indexedDBDatabaseDirectory);

@@ -231,6 +231,26 @@ - (void)_setResourceLoadStatisticsEnabled:(BOOL)enabled
_websiteDataStore->websiteDataStore().setResourceLoadStatisticsEnabled(enabled);
}

- (NSUInteger)_cacheStoragePerOriginQuota
{
return _websiteDataStore->websiteDataStore().cacheStoragePerOriginQuota();
}

- (void)_setCacheStoragePerOriginQuota:(NSUInteger)size
{
_websiteDataStore->websiteDataStore().setCacheStoragePerOriginQuota(size);
}

- (NSString *)_cacheStorageDirectory
{
return _websiteDataStore->websiteDataStore().cacheStorageDirectory();
}

- (void)_setCacheStorageDirectory:(NSString *)directory
{
_websiteDataStore->websiteDataStore().setCacheStorageDirectory(directory);
}

- (void)_resourceLoadStatisticsSetLastSeen:(double)seconds forHost:(NSString *)host
{
auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
@@ -45,6 +45,8 @@ typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) {
- (void)_fetchDataRecordsOfTypes:(NSSet<NSString *> *)dataTypes withOptions:(_WKWebsiteDataStoreFetchOptions)options completionHandler:(void (^)(NSArray<WKWebsiteDataRecord *> *))completionHandler;

@property (nonatomic, setter=_setResourceLoadStatisticsEnabled:) BOOL _resourceLoadStatisticsEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@property (nonatomic, setter=_setCacheStoragePerOriginQuota:) NSUInteger _cacheStoragePerOriginQuota WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_MAC_TBA));
@property (nonatomic, setter=_setCacheStorageDirectory:) NSString* _cacheStorageDirectory WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_MAC_TBA));

// ResourceLoadStatistics SPI for testing.
- (void)_resourceLoadStatisticsSetLastSeen:(double)seconds forHost:(NSString *)host WK_API_AVAILABLE(macosx(10.13), ios(11.0));
@@ -446,15 +446,6 @@ static void registerUserDefaultsIfNeeded()
return stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
}

String WebProcessPool::legacyPlatformDefaultCacheStorageDirectory()
{
RetainPtr<NSString> cacheStoragePath = adoptNS((NSString *)_CFURLCacheCopyCacheDirectory([[NSURLCache sharedURLCache] _CFURLCache]));
if (!cacheStoragePath)
cacheStoragePath = @"~/Library/WebKit/CacheStorage";

return stringByResolvingSymlinksInPath([cacheStoragePath stringByStandardizingPath]);
}

String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
{
RetainPtr<NSString> cachePath = adoptNS((NSString *)_CFURLCacheCopyCacheDirectory([[NSURLCache sharedURLCache] _CFURLCache]));
@@ -196,7 +196,6 @@ static WebsiteDataStore::Configuration legacyWebsiteDataStoreConfiguration(API::
configuration.mediaCacheDirectory = processPoolConfiguration.mediaCacheDirectory();
configuration.mediaKeysStorageDirectory = processPoolConfiguration.mediaKeysStorageDirectory();
configuration.resourceLoadStatisticsDirectory = processPoolConfiguration.resourceLoadStatisticsDirectory();
configuration.cacheStorageDirectory = processPoolConfiguration.cacheStorageDirectory();
configuration.networkCacheDirectory = processPoolConfiguration.diskCacheDirectory();
configuration.javaScriptConfigurationDirectory = processPoolConfiguration.javaScriptConfigurationDirectory();

@@ -433,10 +432,11 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with
for (auto& scheme : m_urlSchemesRegisteredForCustomProtocols)
parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);

parameters.cacheStorageDirectory = m_configuration->cacheStorageDirectory();
parameters.cacheStoragePerOriginQuota = m_configuration->cacheStoragePerOriginQuota();
if (!parameters.cacheStorageDirectory.isEmpty())
parameters.cacheStorageDirectory = m_websiteDataStore ? m_websiteDataStore->websiteDataStore().cacheStorageDirectory() : String { };
if (!parameters.cacheStorageDirectory.isEmpty()) {
SandboxExtension::createHandleForReadWriteDirectory(parameters.cacheStorageDirectory, parameters.cacheStorageDirectoryExtensionHandle);
parameters.cacheStoragePerOriginQuota = m_websiteDataStore ? m_websiteDataStore->websiteDataStore().cacheStoragePerOriginQuota() : WebsiteDataStore::defaultCacheStoragePerOriginQuota;
}

parameters.diskCacheDirectory = m_configuration->diskCacheDirectory();
if (!parameters.diskCacheDirectory.isEmpty())
@@ -620,7 +620,7 @@ void WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool private
{
if (networkProcess()) {
if (privateBrowsingEnabled)
networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession({PAL::SessionID::legacyPrivateSessionID(), { }, { }, { }, { }, { }}), 0);
networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession({PAL::SessionID::legacyPrivateSessionID(), { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }}), 0);
else
networkProcess()->send(Messages::NetworkProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID()), 0);
}
@@ -388,7 +388,6 @@ class WebProcessPool final : public API::ObjectImpl<API::Object::Type::ProcessPo
static String legacyPlatformDefaultMediaKeysStorageDirectory();
static String legacyPlatformDefaultMediaCacheDirectory();
static String legacyPlatformDefaultApplicationCacheDirectory();
static String legacyPlatformDefaultCacheStorageDirectory();
static String legacyPlatformDefaultNetworkCacheDirectory();
static String legacyPlatformDefaultJavaScriptConfigurationDirectory();
static bool isNetworkCacheEnabled();
@@ -69,7 +69,7 @@ class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessL
public:
struct Configuration {
String cacheStorageDirectory;
String cacheStorageSubdirectoryName;
uint64_t cacheStoragePerOriginQuota;
String networkCacheDirectory;
String applicationCacheDirectory;
String applicationCacheFlatFileSubdirectoryName;
@@ -87,11 +87,19 @@ class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessL
static Ref<WebsiteDataStore> create(Configuration, PAL::SessionID);
virtual ~WebsiteDataStore();

constexpr static uint64_t defaultCacheStoragePerOriginQuota = 20 * 1024 * 1024;

bool isPersistent() const { return !m_sessionID.isEphemeral(); }
PAL::SessionID sessionID() const { return m_sessionID; }

bool resourceLoadStatisticsEnabled() const;
void setResourceLoadStatisticsEnabled(bool);

uint64_t cacheStoragePerOriginQuota() const { return m_resolvedConfiguration.cacheStoragePerOriginQuota; }
void setCacheStoragePerOriginQuota(uint64_t quota) { m_resolvedConfiguration.cacheStoragePerOriginQuota = quota; }
const String& cacheStorageDirectory() const { return m_resolvedConfiguration.cacheStorageDirectory; }
void setCacheStorageDirectory(String&& directory) { m_resolvedConfiguration.cacheStorageDirectory = WTFMove(directory); }

WebResourceLoadStatisticsStore* resourceLoadStatistics() const { return m_resourceLoadStatistics.get(); }
void clearResourceLoadStatisticsInWebProcesses();

0 comments on commit 36c331f

Please sign in to comment.