Make WebsiteDataStoreConfiguration a proper API object
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2018 18:42:21 +0000 (18:42 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2018 18:42:21 +0000 (18:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192380

Reviewed by Youenn Fablet.

In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
like all our other ObjC API objects are.

* Shared/API/APIObject.h:
(API::Object::wrapper const):
(API::Object::wrapper): Deleted.
* Shared/Cocoa/APIObject.mm:
(API::Object::ref const):
(API::Object::deref const):
(API::Object::newObject):
(API::Object::ref): Deleted.
(API::Object::deref): Deleted.
* Sources.txt:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::createLegacy):
(API::WebsiteDataStore::WebsiteDataStore):
(API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
(-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
(-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
(-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
(-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
(-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
(-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
(-[_WKWebsiteDataStoreConfiguration _apiObject]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
(WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::create):
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
(WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
(WebKit::WebsiteDataStore::cacheStorageDirectory const):
(WebKit::WebsiteDataStore::setCacheStorageDirectory):
(WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
(WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
(WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
(WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
(WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
(WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
(WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
(WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
(WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
(WebKit::WebsiteDataStoreConfiguration::create):
(WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
(WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
(WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
(WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
(WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
(WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
(WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
(WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
(WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
(WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/APIObject.h
Source/WebKit/Shared/Cocoa/APIObject.mm
Source/WebKit/Sources.txt
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp
Source/WebKit/UIProcess/API/APIWebsiteDataStore.h
Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManager.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h
Source/WebKit/UIProcess/API/win/APIWebsiteDataStoreWin.cpp
Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h [new file with mode: 0644]
Source/WebKit/UIProcess/wpe/WebInspectorProxyWPE.cpp
Source/WebKit/WebKit.xcodeproj/project.pbxproj

index 76b59fb..58256a4 100644 (file)
@@ -1,3 +1,128 @@
+2018-12-05  Alex Christensen  <achristensen@webkit.org>
+
+        Make WebsiteDataStoreConfiguration a proper API object
+        https://bugs.webkit.org/show_bug.cgi?id=192380
+
+        Reviewed by Youenn Fablet.
+
+        In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
+        Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
+        like all our other ObjC API objects are.
+
+        * Shared/API/APIObject.h:
+        (API::Object::wrapper const):
+        (API::Object::wrapper): Deleted.
+        * Shared/Cocoa/APIObject.mm:
+        (API::Object::ref const):
+        (API::Object::deref const):
+        (API::Object::newObject):
+        (API::Object::ref): Deleted.
+        (API::Object::deref): Deleted.
+        * Sources.txt:
+        * UIProcess/API/APIProcessPoolConfiguration.cpp:
+        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        * UIProcess/API/APIWebsiteDataStore.cpp:
+        (API::WebsiteDataStore::createLegacy):
+        (API::WebsiteDataStore::WebsiteDataStore):
+        (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
+        * UIProcess/API/APIWebsiteDataStore.h:
+        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+        (API::WebsiteDataStore::defaultDataStoreConfiguration):
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore _initWithConfiguration:]):
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
+        (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
+        (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
+        (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
+        (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
+        (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
+        (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
+        (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
+        (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
+        (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
+        (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
+        (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
+        (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
+        (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
+        (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
+        (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
+        (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
+        (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
+        (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
+        (-[_WKWebsiteDataStoreConfiguration _apiObject]):
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::legacyWebsiteDataStoreConfiguration):
+        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::parameters):
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::create):
+        (WebKit::WebsiteDataStore::WebsiteDataStore):
+        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
+        (WebKit::WebsiteDataStore::fetchDataAndApply):
+        (WebKit::WebsiteDataStore::removeData):
+        (WebKit::WebsiteDataStore::parameters):
+        (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
+        (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
+        (WebKit::WebsiteDataStore::cacheStorageDirectory const):
+        (WebKit::WebsiteDataStore::setCacheStorageDirectory):
+        (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
+        (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
+        (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
+        (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
+        (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
+        (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
+        (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
+        (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
+        (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
+        (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
+        (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
+        (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
+        (WebKit::WebsiteDataStoreConfiguration::create):
+        (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
+        (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
+        (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
+        (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
+        (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
+        (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
+        (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
+        (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
+        (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
+        (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
+        (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
+        (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Turn WritingDirection into an enum class
index cbe5476..f589e69 100644 (file)
@@ -163,6 +163,7 @@ public:
         WebResourceLoadStatisticsManager,
         WebsiteDataRecord,
         WebsiteDataStore,
+        WebsiteDataStoreConfiguration,
         WebsitePolicies,
         WindowFeatures,
 
@@ -215,10 +216,10 @@ public:
     }
 #endif
 
-    NSObject *wrapper() { return m_wrapper; }
+    NSObject *wrapper() const { return m_wrapper; }
 
-    void ref();
-    void deref();
+    void ref() const;
+    void deref() const;
 #endif // DELEGATE_REF_COUNTING_TO_COCOA
 
     static void* wrap(API::Object*);
index db77d80..57f1d44 100644 (file)
@@ -82,6 +82,7 @@
 #import "_WKUserInitiatedActionInternal.h"
 #import "_WKUserStyleSheetInternal.h"
 #import "_WKVisitedLinkStoreInternal.h"
+#import "_WKWebsiteDataStoreConfigurationInternal.h"
 #import "_WKWebsitePoliciesInternal.h"
 
 #if ENABLE(APPLICATION_MANIFEST)
@@ -94,12 +95,12 @@ static const size_t maximumExtraSpaceForAlignment = minimumObjectAlignment - ali
 
 namespace API {
 
-void Object::ref()
+void Object::ref() const
 {
     CFRetain((__bridge CFTypeRef)wrapper());
 }
 
-void Object::deref()
+void Object::deref() const
 {
     CFRelease((__bridge CFTypeRef)wrapper());
 }
@@ -336,6 +337,10 @@ void* Object::newObject(size_t size, Type type)
     case Type::WebsiteDataStore:
         wrapper = [WKWebsiteDataStore alloc];
         break;
+        
+    case Type::WebsiteDataStoreConfiguration:
+        wrapper = [_WKWebsiteDataStoreConfiguration alloc];
+        break;
 
     case Type::WebsitePolicies:
         wrapper = [_WKWebsitePolicies alloc];
index 6f63f43..055ec5e 100644 (file)
@@ -396,6 +396,7 @@ UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp
 
 UIProcess/WebsiteData/WebsiteDataRecord.cpp
 UIProcess/WebsiteData/WebsiteDataStore.cpp
+UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
 
 WebProcess/WebConnectionToUIProcess.cpp
 WebProcess/WebProcess.cpp
index 3d5bcb9..9e881c7 100644 (file)
@@ -47,20 +47,20 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithLegacyOptions(
     return configuration;
 }
 
-Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration(const WebKit::WebsiteDataStore::Configuration& legacyConfiguration)
+Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration(const WebKit::WebsiteDataStoreConfiguration& legacyConfiguration)
 {
     auto configuration = ProcessPoolConfiguration::create();
 
-    configuration->m_applicationCacheDirectory = legacyConfiguration.applicationCacheDirectory;
-    configuration->m_applicationCacheFlatFileSubdirectoryName = legacyConfiguration.applicationCacheFlatFileSubdirectoryName;
-    configuration->m_diskCacheDirectory = legacyConfiguration.networkCacheDirectory;
-    configuration->m_mediaCacheDirectory = legacyConfiguration.mediaCacheDirectory;
+    configuration->m_applicationCacheDirectory = legacyConfiguration.applicationCacheDirectory();
+    configuration->m_applicationCacheFlatFileSubdirectoryName = legacyConfiguration.applicationCacheFlatFileSubdirectoryName();
+    configuration->m_diskCacheDirectory = legacyConfiguration.networkCacheDirectory();
+    configuration->m_mediaCacheDirectory = legacyConfiguration.mediaCacheDirectory();
     configuration->m_indexedDBDatabaseDirectory = WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory();
-    configuration->m_localStorageDirectory = legacyConfiguration.localStorageDirectory;
-    configuration->m_mediaKeysStorageDirectory = legacyConfiguration.mediaKeysStorageDirectory;
-    configuration->m_resourceLoadStatisticsDirectory = legacyConfiguration.resourceLoadStatisticsDirectory;
-    configuration->m_webSQLDatabaseDirectory = legacyConfiguration.webSQLDatabaseDirectory;
-    configuration->m_javaScriptConfigurationDirectory = legacyConfiguration.javaScriptConfigurationDirectory;
+    configuration->m_localStorageDirectory = legacyConfiguration.localStorageDirectory();
+    configuration->m_mediaKeysStorageDirectory = legacyConfiguration.mediaKeysStorageDirectory();
+    configuration->m_resourceLoadStatisticsDirectory = legacyConfiguration.resourceLoadStatisticsDirectory();
+    configuration->m_webSQLDatabaseDirectory = legacyConfiguration.webSQLDatabaseDirectory();
+    configuration->m_javaScriptConfigurationDirectory = legacyConfiguration.javaScriptConfigurationDirectory();
 
     return configuration;
 }
index dfec534..c34573e 100644 (file)
@@ -46,7 +46,7 @@ class ProcessPoolConfiguration final : public ObjectImpl<Object::Type::ProcessPo
 public:
     static Ref<ProcessPoolConfiguration> create();
     static Ref<ProcessPoolConfiguration> createWithLegacyOptions();
-    static Ref<ProcessPoolConfiguration> createWithWebsiteDataStoreConfiguration(const WebKit::WebsiteDataStore::Configuration&);
+    static Ref<ProcessPoolConfiguration> createWithWebsiteDataStoreConfiguration(const WebKit::WebsiteDataStoreConfiguration&);
 
     explicit ProcessPoolConfiguration();
     virtual ~ProcessPoolConfiguration();
index edd51f8..e5308b6 100644 (file)
@@ -64,7 +64,7 @@ Ref<WebsiteDataStore> WebsiteDataStore::createNonPersistentDataStore()
     return adoptRef(*new WebsiteDataStore);
 }
 
-Ref<WebsiteDataStore> WebsiteDataStore::createLegacy(WebKit::WebsiteDataStore::Configuration configuration)
+Ref<WebsiteDataStore> WebsiteDataStore::createLegacy(Ref<WebKit::WebsiteDataStoreConfiguration>&& configuration)
 {
     return adoptRef(*new WebsiteDataStore(WTFMove(configuration), PAL::SessionID::defaultSessionID()));
 }
@@ -74,7 +74,7 @@ WebsiteDataStore::WebsiteDataStore()
 {
 }
 
-WebsiteDataStore::WebsiteDataStore(WebKit::WebsiteDataStore::Configuration configuration, PAL::SessionID sessionID)
+WebsiteDataStore::WebsiteDataStore(Ref<WebKit::WebsiteDataStoreConfiguration>&& configuration, PAL::SessionID sessionID)
     : m_websiteDataStore(WebKit::WebsiteDataStore::create(WTFMove(configuration), sessionID))
 {
 }
@@ -130,19 +130,19 @@ WTF::String WebsiteDataStore::defaultJavaScriptConfigurationDirectory()
 }
 #endif
 
-WebKit::WebsiteDataStore::Configuration WebsiteDataStore::legacyDefaultDataStoreConfiguration()
+Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::legacyDefaultDataStoreConfiguration()
 {
-    WebKit::WebsiteDataStore::Configuration configuration = defaultDataStoreConfiguration();
+    auto configuration = defaultDataStoreConfiguration();
 
-    configuration.applicationCacheDirectory = legacyDefaultApplicationCacheDirectory();
-    configuration.applicationCacheFlatFileSubdirectoryName = "ApplicationCache";
-    configuration.networkCacheDirectory = legacyDefaultNetworkCacheDirectory();
-    configuration.mediaCacheDirectory = legacyDefaultMediaCacheDirectory();
-    configuration.mediaKeysStorageDirectory = legacyDefaultMediaKeysStorageDirectory();
-    configuration.indexedDBDatabaseDirectory = legacyDefaultIndexedDBDatabaseDirectory();
-    configuration.webSQLDatabaseDirectory = legacyDefaultWebSQLDatabaseDirectory();
-    configuration.localStorageDirectory = legacyDefaultLocalStorageDirectory();
-    configuration.javaScriptConfigurationDirectory = legacyDefaultJavaScriptConfigurationDirectory();
+    configuration->setApplicationCacheDirectory(legacyDefaultApplicationCacheDirectory());
+    configuration->setApplicationCacheFlatFileSubdirectoryName("ApplicationCache");
+    configuration->setNetworkCacheDirectory(legacyDefaultNetworkCacheDirectory());
+    configuration->setMediaCacheDirectory(legacyDefaultMediaCacheDirectory());
+    configuration->setMediaKeysStorageDirectory(legacyDefaultMediaKeysStorageDirectory());
+    configuration->setIndexedDBDatabaseDirectory(legacyDefaultIndexedDBDatabaseDirectory());
+    configuration->setWebSQLDatabaseDirectory(legacyDefaultWebSQLDatabaseDirectory());
+    configuration->setLocalStorageDirectory(legacyDefaultLocalStorageDirectory());
+    configuration->setJavaScriptConfigurationDirectory(legacyDefaultJavaScriptConfigurationDirectory());
     
     return configuration;
 }
index c238df8..b857d69 100644 (file)
@@ -39,9 +39,9 @@ public:
     static void deleteDefaultDataStoreForTesting();
 
     static Ref<WebsiteDataStore> createNonPersistentDataStore();
-    static Ref<WebsiteDataStore> createLegacy(WebKit::WebsiteDataStore::Configuration);
+    static Ref<WebsiteDataStore> createLegacy(Ref<WebKit::WebsiteDataStoreConfiguration>&&);
 
-    explicit WebsiteDataStore(WebKit::WebsiteDataStore::Configuration, PAL::SessionID);
+    explicit WebsiteDataStore(Ref<WebKit::WebsiteDataStoreConfiguration>&&, PAL::SessionID);
     virtual ~WebsiteDataStore();
 
     bool isPersistent();
@@ -66,7 +66,7 @@ public:
     static WTF::String defaultResourceLoadStatisticsDirectory();
     static WTF::String defaultJavaScriptConfigurationDirectory();
 
-    static WebKit::WebsiteDataStore::Configuration defaultDataStoreConfiguration();
+    static Ref<WebKit::WebsiteDataStoreConfiguration> defaultDataStoreConfiguration();
 
     static WTF::String legacyDefaultApplicationCacheDirectory();
     static WTF::String legacyDefaultNetworkCacheDirectory();
@@ -77,7 +77,7 @@ public:
     static WTF::String legacyDefaultMediaCacheDirectory();
     static WTF::String legacyDefaultJavaScriptConfigurationDirectory();
 
-    static WebKit::WebsiteDataStore::Configuration legacyDefaultDataStoreConfiguration();
+    static Ref<WebKit::WebsiteDataStoreConfiguration> legacyDefaultDataStoreConfiguration();
 
 private:
     enum ShouldCreateDirectory { CreateDirectory, DontCreateDirectory };
index df93c5f..97647ce 100644 (file)
@@ -302,24 +302,24 @@ WTF::String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const
     return url.absoluteURL.path.fileSystemRepresentation;
 }
 
-WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
+Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
 {
-    WebKit::WebsiteDataStore::Configuration configuration;
-
-    configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
-    configuration.applicationCacheFlatFileSubdirectoryName = "Files";
-    configuration.cacheStorageDirectory = defaultCacheStorageDirectory();
-    configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
-    configuration.mediaCacheDirectory = defaultMediaCacheDirectory();
-
-    configuration.indexedDBDatabaseDirectory = defaultIndexedDBDatabaseDirectory();
-    configuration.serviceWorkerRegistrationDirectory = defaultServiceWorkerRegistrationDirectory();
-    configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
-    configuration.localStorageDirectory = defaultLocalStorageDirectory();
-    configuration.mediaKeysStorageDirectory = defaultMediaKeysStorageDirectory();
-    configuration.resourceLoadStatisticsDirectory = defaultResourceLoadStatisticsDirectory();
+    auto configuration = WebKit::WebsiteDataStoreConfiguration::create();
+
+    configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory());
+    configuration->setApplicationCacheFlatFileSubdirectoryName("Files");
+    configuration->setCacheStorageDirectory(defaultCacheStorageDirectory());
+    configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory());
+    configuration->setMediaCacheDirectory(defaultMediaCacheDirectory());
+
+    configuration->setIndexedDBDatabaseDirectory(defaultIndexedDBDatabaseDirectory());
+    configuration->setServiceWorkerRegistrationDirectory(defaultServiceWorkerRegistrationDirectory());
+    configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory());
+    configuration->setLocalStorageDirectory(defaultLocalStorageDirectory());
+    configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory());
+    configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory());
     
-    configuration.javaScriptConfigurationDirectory = defaultJavaScriptConfigurationDirectory();
+    configuration->setJavaScriptConfigurationDirectory(defaultJavaScriptConfigurationDirectory());
 
     return configuration;
 }
index 3122d5d..74bf659 100644 (file)
@@ -197,25 +197,25 @@ static Vector<WebKit::WebsiteDataRecord> toWebsiteDataRecords(NSArray *dataRecor
     auto config = API::WebsiteDataStore::defaultDataStoreConfiguration();
 
     if (configuration._webStorageDirectory)
-        config.localStorageDirectory = configuration._webStorageDirectory.path;
+        config->setLocalStorageDirectory(configuration._webStorageDirectory.path);
     if (configuration._webSQLDatabaseDirectory)
-        config.webSQLDatabaseDirectory = configuration._webSQLDatabaseDirectory.path;
+        config->setWebSQLDatabaseDirectory(configuration._webSQLDatabaseDirectory.path);
     if (configuration._indexedDBDatabaseDirectory)
-        config.indexedDBDatabaseDirectory = configuration._indexedDBDatabaseDirectory.path;
+        config->setIndexedDBDatabaseDirectory(configuration._indexedDBDatabaseDirectory.path);
     if (configuration._cookieStorageFile)
-        config.cookieStorageFile = configuration._cookieStorageFile.path;
+        config->setCookieStorageFile(configuration._cookieStorageFile.path);
     if (configuration._resourceLoadStatisticsDirectory)
-        config.resourceLoadStatisticsDirectory = configuration._resourceLoadStatisticsDirectory.path;
+        config->setResourceLoadStatisticsDirectory(configuration._resourceLoadStatisticsDirectory.path);
     if (configuration._cacheStorageDirectory)
-        config.cacheStorageDirectory = configuration._cacheStorageDirectory.path;
+        config->setCacheStorageDirectory(configuration._cacheStorageDirectory.path);
     if (configuration._serviceWorkerRegistrationDirectory)
-        config.serviceWorkerRegistrationDirectory = configuration._serviceWorkerRegistrationDirectory.path;
+        config->setServiceWorkerRegistrationDirectory(configuration._serviceWorkerRegistrationDirectory.path);
     if (configuration.sourceApplicationBundleIdentifier)
-        config.sourceApplicationBundleIdentifier = configuration.sourceApplicationBundleIdentifier;
+        config->setSourceApplicationBundleIdentifier(configuration.sourceApplicationBundleIdentifier);
     if (configuration.sourceApplicationSecondaryIdentifier)
-        config.sourceApplicationSecondaryIdentifier = configuration.sourceApplicationSecondaryIdentifier;
+        config->setSourceApplicationSecondaryIdentifier(configuration.sourceApplicationSecondaryIdentifier);
 
-    API::Object::constructInWrapper<API::WebsiteDataStore>(self, config, PAL::SessionID::generatePersistentSessionID());
+    API::Object::constructInWrapper<API::WebsiteDataStore>(self, WTFMove(config), PAL::SessionID::generatePersistentSessionID());
 
     return self;
 }
index 52d650a..1747bb1 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #import "config.h"
-#import "_WKWebsiteDataStoreConfiguration.h"
+#import "_WKWebsiteDataStoreConfigurationInternal.h"
 
 #if WK_API_ENABLED
 
@@ -36,54 +36,44 @@ static void checkURLArgument(NSURL *url)
         [NSException raise:NSInvalidArgumentException format:@"%@ is not a file URL", url];
 }
 
-@implementation _WKWebsiteDataStoreConfiguration {
-    RetainPtr<NSURL> _webStorageDirectoryURL;
-    RetainPtr<NSURL> _indexedDBDatabaseDirectoryURL;
-    RetainPtr<NSURL> _webSQLDatabaseDirectoryURL;
-    RetainPtr<NSURL> _cookieStorageFileURL;
-    RetainPtr<NSURL> _resourceLoadStatisticsDirectoryURL;
-    RetainPtr<NSURL> _cacheStorageDirectoryURL;
-    RetainPtr<NSURL> _serviceWorkerRegistrationDirectoryURL;
-    RetainPtr<NSString> _sourceApplicationBundleIdentifier;
-    RetainPtr<NSString> _sourceApplicationSecondaryIdentifier;
-}
+@implementation _WKWebsiteDataStoreConfiguration
 
 - (NSURL *)_webStorageDirectory
 {
-    return _webStorageDirectoryURL.get();
+    return [NSURL fileURLWithPath:_configuration->webStorageDirectory() isDirectory:YES];
 }
 
 - (void)_setWebStorageDirectory:(NSURL *)url
 {
     checkURLArgument(url);
-    _webStorageDirectoryURL = adoptNS([url copy]);
+    _configuration->setWebStorageDirectory(url.path);
 }
 
 - (NSURL *)_indexedDBDatabaseDirectory
 {
-    return _indexedDBDatabaseDirectoryURL.get();
+    return [NSURL fileURLWithPath:_configuration->indexedDBDatabaseDirectory() isDirectory:YES];
 }
 
 - (void)_setIndexedDBDatabaseDirectory:(NSURL *)url
 {
     checkURLArgument(url);
-    _indexedDBDatabaseDirectoryURL = adoptNS([url copy]);
+    _configuration->setIndexedDBDatabaseDirectory(url.path);
 }
 
 - (NSURL *)_webSQLDatabaseDirectory
 {
-    return _webSQLDatabaseDirectoryURL.get();
+    return [NSURL fileURLWithPath:_configuration->webSQLDatabaseDirectory() isDirectory:YES];
 }
 
 - (void)_setWebSQLDatabaseDirectory:(NSURL *)url
 {
     checkURLArgument(url);
-    _webSQLDatabaseDirectoryURL = adoptNS([url copy]);
+    _configuration->setWebSQLDatabaseDirectory(url.path);
 }
 
 - (NSURL *)_cookieStorageFile
 {
-    return _cookieStorageFileURL.get();
+    return [NSURL fileURLWithPath:_configuration->cookieStorageFile() isDirectory:NO];
 }
 
 - (void)_setCookieStorageFile:(NSURL *)url
@@ -92,60 +82,65 @@ static void checkURLArgument(NSURL *url)
     if ([url hasDirectoryPath])
         [NSException raise:NSInvalidArgumentException format:@"The cookie storage path must point to a file, not a directory."];
 
-    _cookieStorageFileURL = adoptNS([url copy]);
+    _configuration->setCookieStorageFile(url.path);
 }
 
 - (NSURL *)_resourceLoadStatisticsDirectory
 {
-    return _resourceLoadStatisticsDirectoryURL.get();
+    return [NSURL fileURLWithPath:_configuration->resourceLoadStatisticsDirectory() isDirectory:YES];
 }
 
 - (void)_setResourceLoadStatisticsDirectory:(NSURL *)url
 {
     checkURLArgument(url);
-    _resourceLoadStatisticsDirectoryURL = adoptNS([url copy]);
+    _configuration->setResourceLoadStatisticsDirectory(url.path);
 }
 
 - (NSURL *)_cacheStorageDirectory
 {
-    return _cacheStorageDirectoryURL.get();
+    return [NSURL fileURLWithPath:_configuration->cacheStorageDirectory() isDirectory:YES];
 }
 
 - (void)_setCacheStorageDirectory:(NSURL *)url
 {
     checkURLArgument(url);
-    _cacheStorageDirectoryURL = adoptNS([url copy]);
+    _configuration->setCacheStorageDirectory(url.path);
 }
 
 - (NSURL *)_serviceWorkerRegistrationDirectory
 {
-    return _serviceWorkerRegistrationDirectoryURL.get();
+    return [NSURL fileURLWithPath:_configuration->serviceWorkerRegistrationDirectory() isDirectory:YES];
 }
 
 - (void)_setServiceWorkerRegistrationDirectory:(NSURL *)url
 {
     checkURLArgument(url);
-    _serviceWorkerRegistrationDirectoryURL = adoptNS([url copy]);
+    _configuration->setServiceWorkerRegistrationDirectory(url.path);
 }
 
 - (void)setSourceApplicationBundleIdentifier:(NSString *)identifier
 {
-    _sourceApplicationBundleIdentifier = identifier;
+    _configuration->setSourceApplicationBundleIdentifier(identifier);
 }
 
 - (NSString *)sourceApplicationBundleIdentifier
 {
-    return _sourceApplicationBundleIdentifier.get();
+    return _configuration->sourceApplicationBundleIdentifier();
 }
 
 - (NSString *)sourceApplicationSecondaryIdentifier
 {
-    return _sourceApplicationSecondaryIdentifier.get();
+    return _configuration->sourceApplicationSecondaryIdentifier();
 }
 
 - (void)setSourceApplicationSecondaryIdentifier:(NSString *)identifier
 {
-    _sourceApplicationSecondaryIdentifier = identifier;
+    _configuration->setSourceApplicationSecondaryIdentifier(identifier);
+}
+
+- (API::Object&)_apiObject
+{
+    return *_configuration;
 }
 
 @end
diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h
new file mode 100644 (file)
index 0000000..b5cccb8
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "_WKWebsiteDataStoreConfiguration.h"
+
+#if WK_API_ENABLED
+
+#import "WKObject.h"
+#import "WebsiteDataStoreConfiguration.h"
+
+namespace WebKit {
+
+template<> struct WrapperTraits<WebsiteDataStoreConfiguration> {
+    using WrapperClass = _WKWebsiteDataStoreConfiguration;
+};
+
+}
+
+@interface _WKWebsiteDataStoreConfiguration () <WKObject> {
+@package
+    API::ObjectStorage<WebKit::WebsiteDataStoreConfiguration> _configuration;
+}
+@end
+
+#endif
index 7ff7062..17d2a40 100644 (file)
@@ -163,19 +163,19 @@ WTF::String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
     return WebCore::FileSystem::stringFromFileSystemRepresentation(javaScriptCoreConfigDirectory.get());
 }
 
-WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
+Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
 {
-    WebKit::WebsiteDataStore::Configuration configuration;
+    auto configuration = WebKit::WebsiteDataStoreConfiguration::create();
 
-    configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
-    configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
+    configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory());
+    configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory());
 
-    configuration.indexedDBDatabaseDirectory = defaultIndexedDBDatabaseDirectory();
-    configuration.serviceWorkerRegistrationDirectory = defaultServiceWorkerRegistrationDirectory();
-    configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
-    configuration.localStorageDirectory = defaultLocalStorageDirectory();
-    configuration.mediaKeysStorageDirectory = defaultMediaKeysStorageDirectory();
-    configuration.resourceLoadStatisticsDirectory = defaultResourceLoadStatisticsDirectory();
+    configuration->setIndexedDBDatabaseDirectory(defaultIndexedDBDatabaseDirectory());
+    configuration->setServiceWorkerRegistrationDirectory(defaultServiceWorkerRegistrationDirectory());
+    configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory());
+    configuration->setLocalStorageDirectory(defaultLocalStorageDirectory());
+    configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory());
+    configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory());
 
     return configuration;
 }
index 39f3c08..7afa79c 100644 (file)
@@ -314,14 +314,14 @@ static void webkitWebContextSetProperty(GObject* object, guint propID, const GVa
     }
 }
 
-static inline WebsiteDataStore::Configuration websiteDataStoreConfigurationForWebProcessPoolConfiguration(const API::ProcessPoolConfiguration& processPoolconfigurarion)
-{
-    WebsiteDataStore::Configuration configuration;
-    configuration.applicationCacheDirectory = processPoolconfigurarion.applicationCacheDirectory();
-    configuration.networkCacheDirectory = processPoolconfigurarion.diskCacheDirectory();
-    configuration.webSQLDatabaseDirectory = processPoolconfigurarion.webSQLDatabaseDirectory();
-    configuration.localStorageDirectory = processPoolconfigurarion.localStorageDirectory();
-    configuration.mediaKeysStorageDirectory = processPoolconfigurarion.mediaKeysStorageDirectory();
+static inline Ref<WebsiteDataStoreConfiguration> websiteDataStoreConfigurationForWebProcessPoolConfiguration(const API::ProcessPoolConfiguration& processPoolconfigurarion)
+{
+    auto configuration = WebsiteDataStoreConfiguration::create();
+    configuration->setApplicationCacheDirectory(String(processPoolconfigurarion.applicationCacheDirectory()));
+    configuration->setNetworkCacheDirectory(String(processPoolconfigurarion.diskCacheDirectory()));
+    configuration->setWebSQLDatabaseDirectory(String(processPoolconfigurarion.webSQLDatabaseDirectory()));
+    configuration->setLocalStorageDirectory(String(processPoolconfigurarion.localStorageDirectory()));
+    configuration->setMediaKeysStorageDirectory(String(processPoolconfigurarion.mediaKeysStorageDirectory()));
     return configuration;
 }
 
index 4491524..7d0999d 100644 (file)
@@ -349,7 +349,7 @@ static void webkit_website_data_manager_class_init(WebKitWebsiteDataManagerClass
             static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
 }
 
-WebKitWebsiteDataManager* webkitWebsiteDataManagerCreate(WebsiteDataStore::Configuration&& configuration)
+WebKitWebsiteDataManager* webkitWebsiteDataManagerCreate(Ref<WebsiteDataStoreConfiguration>&& configuration)
 {
     WebKitWebsiteDataManager* manager = WEBKIT_WEBSITE_DATA_MANAGER(g_object_new(WEBKIT_TYPE_WEBSITE_DATA_MANAGER, nullptr));
     manager->priv->websiteDataStore = API::WebsiteDataStore::createLegacy(WTFMove(configuration));
@@ -361,16 +361,16 @@ API::WebsiteDataStore& webkitWebsiteDataManagerGetDataStore(WebKitWebsiteDataMan
 {
     WebKitWebsiteDataManagerPrivate* priv = manager->priv;
     if (!priv->websiteDataStore) {
-        WebsiteDataStore::Configuration configuration;
-        configuration.localStorageDirectory = !priv->localStorageDirectory ?
-            API::WebsiteDataStore::defaultLocalStorageDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->localStorageDirectory.get());
-        configuration.networkCacheDirectory = !priv->diskCacheDirectory ?
-            API::WebsiteDataStore::defaultNetworkCacheDirectory() : WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::stringFromFileSystemRepresentation(priv->diskCacheDirectory.get()), networkCacheSubdirectory);
-        configuration.applicationCacheDirectory = !priv->applicationCacheDirectory ?
-            API::WebsiteDataStore::defaultApplicationCacheDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->applicationCacheDirectory.get());
-        configuration.webSQLDatabaseDirectory = !priv->webSQLDirectory ?
-            API::WebsiteDataStore::defaultWebSQLDatabaseDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->webSQLDirectory.get());
-        configuration.mediaKeysStorageDirectory = API::WebsiteDataStore::defaultMediaKeysStorageDirectory();
+        auto configuration = WebsiteDataStoreConfiguration::create();
+        configuration->setLocalStorageDirectory(!priv->localStorageDirectory ?
+            API::WebsiteDataStore::defaultLocalStorageDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->localStorageDirectory.get()));
+        configuration->setNetworkCacheDirectory(!priv->diskCacheDirectory ?
+            API::WebsiteDataStore::defaultNetworkCacheDirectory() : WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::stringFromFileSystemRepresentation(priv->diskCacheDirectory.get()), networkCacheSubdirectory));
+        configuration->setApplicationCacheDirectory(!priv->applicationCacheDirectory ?
+            API::WebsiteDataStore::defaultApplicationCacheDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->applicationCacheDirectory.get()));
+        configuration->setWebSQLDatabaseDirectory(!priv->webSQLDirectory ?
+            API::WebsiteDataStore::defaultWebSQLDatabaseDirectory() : WebCore::FileSystem::stringFromFileSystemRepresentation(priv->webSQLDirectory.get()));
+        configuration->setMediaKeysStorageDirectory(API::WebsiteDataStore::defaultMediaKeysStorageDirectory());
         priv->websiteDataStore = API::WebsiteDataStore::createLegacy(WTFMove(configuration));
     }
 
index 7d928f0..854118a 100644 (file)
@@ -23,7 +23,7 @@
 #include "WebProcessPool.h"
 #include "WebsiteDataStore.h"
 
-WebKitWebsiteDataManager* webkitWebsiteDataManagerCreate(WebKit::WebsiteDataStore::Configuration&&);
+WebKitWebsiteDataManager* webkitWebsiteDataManagerCreate(Ref<WebKit::WebsiteDataStoreConfiguration>&&);
 API::WebsiteDataStore& webkitWebsiteDataManagerGetDataStore(WebKitWebsiteDataManager*);
 void webkitWebsiteDataManagerAddProcessPool(WebKitWebsiteDataManager*, WebKit::WebProcessPool&);
 void webkitWebsiteDataManagerRemoveProcessPool(WebKitWebsiteDataManager*, WebKit::WebProcessPool&);
index 50df2aa..285bb6d 100644 (file)
@@ -125,16 +125,16 @@ String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
     return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "JavaScriptCoreDebug");
 }
 
-WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
+Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
 {
-    WebKit::WebsiteDataStore::Configuration configuration;
+    auto configuration = WebKit::WebsiteDataStoreConfiguration::create();
 
-    configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
-    configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
-    configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
-    configuration.localStorageDirectory = defaultLocalStorageDirectory();
-    configuration.mediaKeysStorageDirectory = defaultMediaKeysStorageDirectory();
-    configuration.resourceLoadStatisticsDirectory = defaultResourceLoadStatisticsDirectory();
+    configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory());
+    configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory());
+    configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory());
+    configuration->setLocalStorageDirectory(defaultLocalStorageDirectory());
+    configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory());
+    configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory());
 
     return configuration;
 }
index 08ebad7..d8e7ae4 100644 (file)
@@ -264,7 +264,7 @@ bool WebPaymentCoordinatorProxy::platformCanMakePayments()
 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler)
 {
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
-    PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.websiteDataStore().configuration().sourceApplicationSecondaryIdentifier, BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {
+    PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.websiteDataStore().configuration().sourceApplicationSecondaryIdentifier(), BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {
         if (error)
             LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
 
@@ -508,11 +508,11 @@ RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const
     // FIXME: Instead of using respondsToSelector, this should use a proper #if version check.
     auto& configuration = webPageProxy.websiteDataStore().configuration();
 
-    if (!configuration.sourceApplicationBundleIdentifier.isEmpty() && [result respondsToSelector:@selector(setSourceApplicationBundleIdentifier:)])
-        [result setSourceApplicationBundleIdentifier:configuration.sourceApplicationBundleIdentifier];
+    if (!configuration.sourceApplicationBundleIdentifier().isEmpty() && [result respondsToSelector:@selector(setSourceApplicationBundleIdentifier:)])
+        [result setSourceApplicationBundleIdentifier:configuration.sourceApplicationBundleIdentifier()];
 
-    if (!configuration.sourceApplicationSecondaryIdentifier.isEmpty() && [result respondsToSelector:@selector(setSourceApplicationSecondaryIdentifier:)])
-        [result setSourceApplicationSecondaryIdentifier:configuration.sourceApplicationSecondaryIdentifier];
+    if (!configuration.sourceApplicationSecondaryIdentifier().isEmpty() && [result respondsToSelector:@selector(setSourceApplicationSecondaryIdentifier:)])
+        [result setSourceApplicationSecondaryIdentifier:configuration.sourceApplicationSecondaryIdentifier()];
 
 #if PLATFORM(IOS_FAMILY)
     if (!webPageProxy.process().processPool().configuration().ctDataConnectionServiceType().isEmpty() && [result respondsToSelector:@selector(setCTDataConnectionServiceType:)])
index fd986c2..9d31b59 100644 (file)
@@ -657,7 +657,7 @@ void NetworkProcessProxy::retrieveCacheStorageParameters(PAL::SessionID sessionI
 
     if (!store) {
         RELEASE_LOG_ERROR(CacheStorage, "%p - NetworkProcessProxy is unable to retrieve CacheStorage parameters from the given session ID %" PRIu64, this, sessionID.sessionID());
-        auto quota = m_processPool.websiteDataStore() ? m_processPool.websiteDataStore()->websiteDataStore().cacheStoragePerOriginQuota() : WebsiteDataStore::defaultCacheStoragePerOriginQuota;
+        auto quota = m_processPool.websiteDataStore() ? m_processPool.websiteDataStore()->websiteDataStore().cacheStoragePerOriginQuota() : WebsiteDataStoreConfiguration::defaultCacheStoragePerOriginQuota;
         send(Messages::NetworkProcess::SetCacheStorageParameters { sessionID, quota, { }, { } }, 0);
         return;
     }
index 413a974..2cd4c1a 100644 (file)
@@ -199,21 +199,21 @@ const Vector<WebProcessPool*>& WebProcessPool::allProcessPools()
     return processPools();
 }
 
-static WebsiteDataStore::Configuration legacyWebsiteDataStoreConfiguration(API::ProcessPoolConfiguration& processPoolConfiguration)
-{
-    WebsiteDataStore::Configuration configuration;
-
-    configuration.cacheStorageDirectory = API::WebsiteDataStore::defaultCacheStorageDirectory();
-    configuration.serviceWorkerRegistrationDirectory = API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory();
-    configuration.localStorageDirectory = processPoolConfiguration.localStorageDirectory();
-    configuration.webSQLDatabaseDirectory = processPoolConfiguration.webSQLDatabaseDirectory();
-    configuration.applicationCacheDirectory = processPoolConfiguration.applicationCacheDirectory();
-    configuration.applicationCacheFlatFileSubdirectoryName = processPoolConfiguration.applicationCacheFlatFileSubdirectoryName();
-    configuration.mediaCacheDirectory = processPoolConfiguration.mediaCacheDirectory();
-    configuration.mediaKeysStorageDirectory = processPoolConfiguration.mediaKeysStorageDirectory();
-    configuration.resourceLoadStatisticsDirectory = processPoolConfiguration.resourceLoadStatisticsDirectory();
-    configuration.networkCacheDirectory = processPoolConfiguration.diskCacheDirectory();
-    configuration.javaScriptConfigurationDirectory = processPoolConfiguration.javaScriptConfigurationDirectory();
+static Ref<WebsiteDataStoreConfiguration> legacyWebsiteDataStoreConfiguration(API::ProcessPoolConfiguration& processPoolConfiguration)
+{
+    auto configuration = WebsiteDataStoreConfiguration::create();
+
+    configuration->setCacheStorageDirectory(String(API::WebsiteDataStore::defaultCacheStorageDirectory()));
+    configuration->setServiceWorkerRegistrationDirectory(String(API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory()));
+    configuration->setLocalStorageDirectory(String(processPoolConfiguration.localStorageDirectory()));
+    configuration->setWebSQLDatabaseDirectory(String(processPoolConfiguration.webSQLDatabaseDirectory()));
+    configuration->setApplicationCacheDirectory(String(processPoolConfiguration.applicationCacheDirectory()));
+    configuration->setApplicationCacheFlatFileSubdirectoryName(String(processPoolConfiguration.applicationCacheFlatFileSubdirectoryName()));
+    configuration->setMediaCacheDirectory(String(processPoolConfiguration.mediaCacheDirectory()));
+    configuration->setMediaKeysStorageDirectory(String(processPoolConfiguration.mediaKeysStorageDirectory()));
+    configuration->setResourceLoadStatisticsDirectory(String(processPoolConfiguration.resourceLoadStatisticsDirectory()));
+    configuration->setNetworkCacheDirectory(String(processPoolConfiguration.diskCacheDirectory()));
+    configuration->setJavaScriptConfigurationDirectory(String(processPoolConfiguration.javaScriptConfigurationDirectory()));
 
     return configuration;
 }
@@ -1167,7 +1167,7 @@ bool WebProcessPool::mayHaveRegisteredServiceWorkers(const WebsiteDataStore& sto
 
     String serviceWorkerRegistrationDirectory = store.resolvedServiceWorkerRegistrationDirectory();
     if (serviceWorkerRegistrationDirectory.isEmpty())
-        serviceWorkerRegistrationDirectory = API::WebsiteDataStore::defaultDataStoreConfiguration().serviceWorkerRegistrationDirectory;
+        serviceWorkerRegistrationDirectory = API::WebsiteDataStore::defaultDataStoreConfiguration()->serviceWorkerRegistrationDirectory();
 
     return m_mayHaveRegisteredServiceWorkers.ensure(serviceWorkerRegistrationDirectory, [&] {
         // FIXME: Make this computation on a background thread.
index f90c417..4ded753 100644 (file)
@@ -73,8 +73,8 @@ WebsiteDataStoreParameters WebsiteDataStore::parameters()
         m_boundInterfaceIdentifier,
         m_allowsCellularAccess,
         m_proxyConfiguration,
-        m_configuration.sourceApplicationBundleIdentifier,
-        m_configuration.sourceApplicationSecondaryIdentifier,
+        m_configuration->sourceApplicationBundleIdentifier(),
+        m_configuration->sourceApplicationSecondaryIdentifier(),
         shouldLogCookieInformation,
         Seconds { [defaults integerForKey:WebKitNetworkLoadThrottleLatencyMillisecondsDefaultsKey] / 1000. }
     };
@@ -89,8 +89,8 @@ WebsiteDataStoreParameters WebsiteDataStore::parameters()
     }
 
     parameters.uiProcessCookieStorageIdentifier = m_uiProcessCookieStorageIdentifier;
-    parameters.networkSessionParameters.sourceApplicationBundleIdentifier = m_configuration.sourceApplicationBundleIdentifier;
-    parameters.networkSessionParameters.sourceApplicationSecondaryIdentifier = m_configuration.sourceApplicationSecondaryIdentifier;
+    parameters.networkSessionParameters.sourceApplicationBundleIdentifier = m_configuration->sourceApplicationBundleIdentifier();
+    parameters.networkSessionParameters.sourceApplicationSecondaryIdentifier = m_configuration->sourceApplicationSecondaryIdentifier();
 
     parameters.pendingCookies = copyToVector(m_pendingCookies);
 
index b90c142..14960d3 100644 (file)
@@ -82,20 +82,16 @@ Ref<WebsiteDataStore> WebsiteDataStore::createNonPersistent()
     return adoptRef(*new WebsiteDataStore(PAL::SessionID::generateEphemeralSessionID()));
 }
 
-Ref<WebsiteDataStore> WebsiteDataStore::create(Configuration configuration, PAL::SessionID sessionID)
+Ref<WebsiteDataStore> WebsiteDataStore::create(Ref<WebsiteDataStoreConfiguration>&& configuration, PAL::SessionID sessionID)
 {
     return adoptRef(*new WebsiteDataStore(WTFMove(configuration), sessionID));
 }
 
-WebsiteDataStore::Configuration::Configuration()
-    : resourceLoadStatisticsDirectory(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory())
-{
-}
-
-WebsiteDataStore::WebsiteDataStore(Configuration configuration, PAL::SessionID sessionID)
+WebsiteDataStore::WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&& configuration, PAL::SessionID sessionID)
     : m_sessionID(sessionID)
-    , m_configuration(WTFMove(configuration))
-    , m_storageManager(StorageManager::create(m_configuration.localStorageDirectory))
+    , m_resolvedConfiguration(WTFMove(configuration))
+    , m_configuration(m_resolvedConfiguration->copy())
+    , m_storageManager(StorageManager::create(m_configuration->localStorageDirectory()))
     , m_deviceIdHashSaltStorage(DeviceIdHashSaltStorage::create())
     , m_queue(WorkQueue::create("com.apple.WebKit.WebsiteDataStore"))
 #if ENABLE(WEB_AUTHN)
@@ -111,7 +107,8 @@ WebsiteDataStore::WebsiteDataStore(Configuration configuration, PAL::SessionID s
 
 WebsiteDataStore::WebsiteDataStore(PAL::SessionID sessionID)
     : m_sessionID(sessionID)
-    , m_configuration()
+    , m_resolvedConfiguration(WebsiteDataStoreConfiguration::create())
+    , m_configuration(m_resolvedConfiguration->copy())
     , m_queue(WorkQueue::create("com.apple.WebKit.WebsiteDataStore"))
 #if ENABLE(WEB_AUTHN)
     , m_authenticatorManager(makeUniqueRef<AuthenticatorManager>())
@@ -167,29 +164,29 @@ void WebsiteDataStore::resolveDirectoriesIfNecessary()
     m_hasResolvedDirectories = true;
 
     // Resolve directory paths.
-    if (!m_configuration.applicationCacheDirectory.isEmpty())
-        m_resolvedConfiguration.applicationCacheDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.applicationCacheDirectory);
-    if (!m_configuration.mediaCacheDirectory.isEmpty())
-        m_resolvedConfiguration.mediaCacheDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.mediaCacheDirectory);
-    if (!m_configuration.mediaKeysStorageDirectory.isEmpty())
-        m_resolvedConfiguration.mediaKeysStorageDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.mediaKeysStorageDirectory);
-    if (!m_configuration.webSQLDatabaseDirectory.isEmpty())
-        m_resolvedConfiguration.webSQLDatabaseDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.webSQLDatabaseDirectory);
-    if (!m_configuration.indexedDBDatabaseDirectory.isEmpty())
-        m_resolvedConfiguration.indexedDBDatabaseDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.indexedDBDatabaseDirectory);
-    if (!m_configuration.resourceLoadStatisticsDirectory.isEmpty())
-        m_resolvedConfiguration.resourceLoadStatisticsDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.resourceLoadStatisticsDirectory);
-    if (!m_configuration.serviceWorkerRegistrationDirectory.isEmpty() && m_resolvedConfiguration.serviceWorkerRegistrationDirectory.isEmpty())
-        m_resolvedConfiguration.serviceWorkerRegistrationDirectory = resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration.serviceWorkerRegistrationDirectory);
-    if (!m_configuration.javaScriptConfigurationDirectory.isEmpty())
-        m_resolvedConfiguration.javaScriptConfigurationDirectory = resolvePathForSandboxExtension(m_configuration.javaScriptConfigurationDirectory);
-    if (!m_configuration.cacheStorageDirectory.isEmpty() && m_resolvedConfiguration.cacheStorageDirectory.isEmpty())
-        m_resolvedConfiguration.cacheStorageDirectory = resolvePathForSandboxExtension(m_configuration.cacheStorageDirectory);
+    if (!m_configuration->applicationCacheDirectory().isEmpty())
+        m_resolvedConfiguration->setApplicationCacheDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->applicationCacheDirectory()));
+    if (!m_configuration->mediaCacheDirectory().isEmpty())
+        m_resolvedConfiguration->setMediaCacheDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->mediaCacheDirectory()));
+    if (!m_configuration->mediaKeysStorageDirectory().isEmpty())
+        m_resolvedConfiguration->setMediaKeysStorageDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->mediaKeysStorageDirectory()));
+    if (!m_configuration->webSQLDatabaseDirectory().isEmpty())
+        m_resolvedConfiguration->setWebSQLDatabaseDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->webSQLDatabaseDirectory()));
+    if (!m_configuration->indexedDBDatabaseDirectory().isEmpty())
+        m_resolvedConfiguration->setIndexedDBDatabaseDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->indexedDBDatabaseDirectory()));
+    if (!m_configuration->resourceLoadStatisticsDirectory().isEmpty())
+        m_resolvedConfiguration->setResourceLoadStatisticsDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->resourceLoadStatisticsDirectory()));
+    if (!m_configuration->serviceWorkerRegistrationDirectory().isEmpty() && m_resolvedConfiguration->serviceWorkerRegistrationDirectory().isEmpty())
+        m_resolvedConfiguration->setServiceWorkerRegistrationDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->serviceWorkerRegistrationDirectory()));
+    if (!m_configuration->javaScriptConfigurationDirectory().isEmpty())
+        m_resolvedConfiguration->setJavaScriptConfigurationDirectory(resolvePathForSandboxExtension(m_configuration->javaScriptConfigurationDirectory()));
+    if (!m_configuration->cacheStorageDirectory().isEmpty() && m_resolvedConfiguration->cacheStorageDirectory().isEmpty())
+        m_resolvedConfiguration->setCacheStorageDirectory(resolvePathForSandboxExtension(m_configuration->cacheStorageDirectory()));
 
     // Resolve directories for file paths.
-    if (!m_configuration.cookieStorageFile.isEmpty()) {
-        m_resolvedConfiguration.cookieStorageFile = resolveAndCreateReadWriteDirectoryForSandboxExtension(WebCore::FileSystem::directoryName(m_configuration.cookieStorageFile));
-        m_resolvedConfiguration.cookieStorageFile = WebCore::FileSystem::pathByAppendingComponent(m_resolvedConfiguration.cookieStorageFile, WebCore::FileSystem::pathGetFileName(m_configuration.cookieStorageFile));
+    if (!m_configuration->cookieStorageFile().isEmpty()) {
+        m_resolvedConfiguration->setCookieStorageFile(resolveAndCreateReadWriteDirectoryForSandboxExtension(WebCore::FileSystem::directoryName(m_configuration->cookieStorageFile())));
+        m_resolvedConfiguration->setCookieStorageFile(WebCore::FileSystem::pathByAppendingComponent(m_resolvedConfiguration->cookieStorageFile(), WebCore::FileSystem::pathGetFileName(m_configuration->cookieStorageFile())));
     }
 }
 
@@ -395,7 +392,7 @@ void WebsiteDataStore::fetchDataAndApply(OptionSet<WebsiteDataType> dataTypes, O
 #if ENABLE(VIDEO)
     if (dataTypes.contains(WebsiteDataType::DiskCache)) {
         callbackAggregator->addPendingCallback();
-        m_queue->dispatch([mediaCacheDirectory = m_configuration.mediaCacheDirectory.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([mediaCacheDirectory = m_configuration->mediaCacheDirectory().isolatedCopy(), callbackAggregator] {
             // FIXME: Make HTMLMediaElement::originsInMediaCache return a collection of SecurityOriginDatas.
             HashSet<RefPtr<WebCore::SecurityOrigin>> origins = WebCore::HTMLMediaElement::originsInMediaCache(mediaCacheDirectory);
             WebsiteData websiteData;
@@ -503,7 +500,7 @@ void WebsiteDataStore::fetchDataAndApply(OptionSet<WebsiteDataType> dataTypes, O
     if (dataTypes.contains(WebsiteDataType::OfflineWebApplicationCache) && isPersistent()) {
         callbackAggregator->addPendingCallback();
 
-        m_queue->dispatch([fetchOptions, applicationCacheDirectory = m_configuration.applicationCacheDirectory.isolatedCopy(), applicationCacheFlatFileSubdirectoryName = m_configuration.applicationCacheFlatFileSubdirectoryName.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([fetchOptions, applicationCacheDirectory = m_configuration->applicationCacheDirectory().isolatedCopy(), applicationCacheFlatFileSubdirectoryName = m_configuration->applicationCacheFlatFileSubdirectoryName().isolatedCopy(), callbackAggregator] {
             auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory, applicationCacheFlatFileSubdirectoryName);
 
             WebsiteData websiteData;
@@ -527,7 +524,7 @@ void WebsiteDataStore::fetchDataAndApply(OptionSet<WebsiteDataType> dataTypes, O
     if (dataTypes.contains(WebsiteDataType::WebSQLDatabases) && isPersistent()) {
         callbackAggregator->addPendingCallback();
 
-        m_queue->dispatch([webSQLDatabaseDirectory = m_configuration.webSQLDatabaseDirectory.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([webSQLDatabaseDirectory = m_configuration->webSQLDatabaseDirectory().isolatedCopy(), callbackAggregator] {
             auto origins = WebCore::DatabaseTracker::trackerWithDatabasePath(webSQLDatabaseDirectory)->origins();
             RunLoop::main().dispatch([callbackAggregator, origins = WTFMove(origins)]() mutable {
                 WebsiteData websiteData;
@@ -541,7 +538,7 @@ void WebsiteDataStore::fetchDataAndApply(OptionSet<WebsiteDataType> dataTypes, O
     if (dataTypes.contains(WebsiteDataType::MediaKeys) && isPersistent()) {
         callbackAggregator->addPendingCallback();
 
-        m_queue->dispatch([mediaKeysStorageDirectory = m_configuration.mediaKeysStorageDirectory.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([mediaKeysStorageDirectory = m_configuration->mediaKeysStorageDirectory().isolatedCopy(), callbackAggregator] {
             auto origins = mediaKeyOrigins(mediaKeysStorageDirectory);
 
             RunLoop::main().dispatch([callbackAggregator, origins = WTFMove(origins)]() mutable {
@@ -740,7 +737,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, WallTime
 #if ENABLE(VIDEO)
     if (dataTypes.contains(WebsiteDataType::DiskCache)) {
         callbackAggregator->addPendingCallback();
-        m_queue->dispatch([modifiedSince, mediaCacheDirectory = m_configuration.mediaCacheDirectory.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([modifiedSince, mediaCacheDirectory = m_configuration->mediaCacheDirectory().isolatedCopy(), callbackAggregator] {
             WebCore::HTMLMediaElement::clearMediaCache(mediaCacheDirectory, modifiedSince);
             
             WTF::RunLoop::main().dispatch([callbackAggregator] {
@@ -826,7 +823,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, WallTime
     if (dataTypes.contains(WebsiteDataType::OfflineWebApplicationCache) && isPersistent()) {
         callbackAggregator->addPendingCallback();
 
-        m_queue->dispatch([applicationCacheDirectory = m_configuration.applicationCacheDirectory.isolatedCopy(), applicationCacheFlatFileSubdirectoryName = m_configuration.applicationCacheFlatFileSubdirectoryName.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([applicationCacheDirectory = m_configuration->applicationCacheDirectory().isolatedCopy(), applicationCacheFlatFileSubdirectoryName = m_configuration->applicationCacheFlatFileSubdirectoryName().isolatedCopy(), callbackAggregator] {
             auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory, applicationCacheFlatFileSubdirectoryName);
 
             storage->deleteAllCaches();
@@ -840,7 +837,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, WallTime
     if (dataTypes.contains(WebsiteDataType::WebSQLDatabases) && isPersistent()) {
         callbackAggregator->addPendingCallback();
 
-        m_queue->dispatch([webSQLDatabaseDirectory = m_configuration.webSQLDatabaseDirectory.isolatedCopy(), callbackAggregator, modifiedSince] {
+        m_queue->dispatch([webSQLDatabaseDirectory = m_configuration->webSQLDatabaseDirectory().isolatedCopy(), callbackAggregator, modifiedSince] {
             WebCore::DatabaseTracker::trackerWithDatabasePath(webSQLDatabaseDirectory)->deleteDatabasesModifiedSince(modifiedSince);
 
             RunLoop::main().dispatch([callbackAggregator] {
@@ -852,7 +849,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, WallTime
     if (dataTypes.contains(WebsiteDataType::MediaKeys) && isPersistent()) {
         callbackAggregator->addPendingCallback();
 
-        m_queue->dispatch([mediaKeysStorageDirectory = m_configuration.mediaKeysStorageDirectory.isolatedCopy(), callbackAggregator, modifiedSince] {
+        m_queue->dispatch([mediaKeysStorageDirectory = m_configuration->mediaKeysStorageDirectory().isolatedCopy(), callbackAggregator, modifiedSince] {
             removeMediaKeys(mediaKeysStorageDirectory, modifiedSince);
 
             RunLoop::main().dispatch([callbackAggregator] {
@@ -1006,7 +1003,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve
         
 #if ENABLE(VIDEO)
         callbackAggregator->addPendingCallback();
-        m_queue->dispatch([origins = WTFMove(origins), mediaCacheDirectory = m_configuration.mediaCacheDirectory.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([origins = WTFMove(origins), mediaCacheDirectory = m_configuration->mediaCacheDirectory().isolatedCopy(), callbackAggregator] {
 
             // FIXME: Move SecurityOrigin::toRawString to SecurityOriginData and
             // make HTMLMediaElement::clearMediaCacheForOrigins take SecurityOriginData.
@@ -1113,7 +1110,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve
         }
 
         callbackAggregator->addPendingCallback();
-        m_queue->dispatch([origins = WTFMove(origins), applicationCacheDirectory = m_configuration.applicationCacheDirectory.isolatedCopy(), applicationCacheFlatFileSubdirectoryName = m_configuration.applicationCacheFlatFileSubdirectoryName.isolatedCopy(), callbackAggregator] {
+        m_queue->dispatch([origins = WTFMove(origins), applicationCacheDirectory = m_configuration->applicationCacheDirectory().isolatedCopy(), applicationCacheFlatFileSubdirectoryName = m_configuration->applicationCacheFlatFileSubdirectoryName().isolatedCopy(), callbackAggregator] {
             auto storage = WebCore::ApplicationCacheStorage::create(applicationCacheDirectory, applicationCacheFlatFileSubdirectoryName);
 
             for (const auto& origin : origins)
@@ -1133,7 +1130,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve
         }
 
         callbackAggregator->addPendingCallback();
-        m_queue->dispatch([origins = WTFMove(origins), callbackAggregator, webSQLDatabaseDirectory = m_configuration.webSQLDatabaseDirectory.isolatedCopy()] {
+        m_queue->dispatch([origins = WTFMove(origins), callbackAggregator, webSQLDatabaseDirectory = m_configuration->webSQLDatabaseDirectory().isolatedCopy()] {
             auto databaseTracker = WebCore::DatabaseTracker::trackerWithDatabasePath(webSQLDatabaseDirectory);
             for (auto& origin : origins)
                 databaseTracker->deleteOrigin(origin);
@@ -1151,7 +1148,7 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve
         }
 
         callbackAggregator->addPendingCallback();
-        m_queue->dispatch([mediaKeysStorageDirectory = m_configuration.mediaKeysStorageDirectory.isolatedCopy(), callbackAggregator, origins = WTFMove(origins)] {
+        m_queue->dispatch([mediaKeysStorageDirectory = m_configuration->mediaKeysStorageDirectory().isolatedCopy(), callbackAggregator, origins = WTFMove(origins)] {
 
             removeMediaKeys(mediaKeysStorageDirectory, origins);
 
index 65cc01b..40f575a 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "NetworkSessionCreationParameters.h"
 #include "WebProcessLifetimeObserver.h"
+#include "WebsiteDataStoreConfiguration.h"
 #include <WebCore/Cookie.h>
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/SecurityOriginHash.h>
@@ -80,32 +81,8 @@ struct PluginModuleInfo;
 
 class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessLifetimeObserver, public Identified<WebsiteDataStore>, public CanMakeWeakPtr<WebsiteDataStore>  {
 public:
-    constexpr static uint64_t defaultCacheStoragePerOriginQuota = 50 * 1024 * 1024;
-
-    struct Configuration {
-        String cacheStorageDirectory;
-        uint64_t cacheStoragePerOriginQuota { defaultCacheStoragePerOriginQuota };
-        String networkCacheDirectory;
-        String applicationCacheDirectory;
-        String applicationCacheFlatFileSubdirectoryName;
-
-        String mediaCacheDirectory;
-        String indexedDBDatabaseDirectory;
-        String serviceWorkerRegistrationDirectory;
-        String webSQLDatabaseDirectory;
-        String localStorageDirectory;
-        String mediaKeysStorageDirectory;
-        String deviceIdHashSaltsStorageDirectory;
-        String resourceLoadStatisticsDirectory;
-        String javaScriptConfigurationDirectory;
-        String cookieStorageFile;
-        String sourceApplicationBundleIdentifier;
-        String sourceApplicationSecondaryIdentifier;
-
-        explicit Configuration();
-    };
     static Ref<WebsiteDataStore> createNonPersistent();
-    static Ref<WebsiteDataStore> create(Configuration, PAL::SessionID);
+    static Ref<WebsiteDataStore> create(Ref<WebsiteDataStoreConfiguration>&&, PAL::SessionID);
     virtual ~WebsiteDataStore();
 
     static WebsiteDataStore* existingNonDefaultDataStoreForSessionID(PAL::SessionID);
@@ -119,12 +96,12 @@ public:
     void setResourceLoadStatisticsDebugMode(bool);
     void setResourceLoadStatisticsDebugMode(bool, CompletionHandler<void()>&&);
 
-    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); }
-    const String& serviceWorkerRegistrationDirectory() const { return m_resolvedConfiguration.serviceWorkerRegistrationDirectory; }
-    void setServiceWorkerRegistrationDirectory(String&& directory) { m_resolvedConfiguration.serviceWorkerRegistrationDirectory = WTFMove(directory); }
+    uint64_t cacheStoragePerOriginQuota() const { return m_resolvedConfiguration->cacheStoragePerOriginQuota(); }
+    void setCacheStoragePerOriginQuota(uint64_t quota) { m_resolvedConfiguration->setCacheStoragePerOriginQuota(quota); }
+    const String& cacheStorageDirectory() const { return m_resolvedConfiguration->cacheStorageDirectory(); }
+    void setCacheStorageDirectory(String&& directory) { m_resolvedConfiguration->setCacheStorageDirectory(WTFMove(directory)); }
+    const String& serviceWorkerRegistrationDirectory() const { return m_resolvedConfiguration->serviceWorkerRegistrationDirectory(); }
+    void setServiceWorkerRegistrationDirectory(String&& directory) { m_resolvedConfiguration->setServiceWorkerRegistrationDirectory(WTFMove(directory)); }
 
     WebResourceLoadStatisticsStore* resourceLoadStatistics() const { return m_resourceLoadStatistics.get(); }
     void clearResourceLoadStatisticsInWebProcesses(CompletionHandler<void()>&&);
@@ -153,15 +130,15 @@ public:
     void setCacheMaxAgeCapForPrevalentResources(Seconds, CompletionHandler<void()>&&);
     void resetCacheMaxAgeCapForPrevalentResources(CompletionHandler<void()>&&);
     void resolveDirectoriesIfNecessary();
-    const String& resolvedApplicationCacheDirectory() const { return m_resolvedConfiguration.applicationCacheDirectory; }
-    const String& resolvedMediaCacheDirectory() const { return m_resolvedConfiguration.mediaCacheDirectory; }
-    const String& resolvedMediaKeysDirectory() const { return m_resolvedConfiguration.mediaKeysStorageDirectory; }
-    const String& resolvedDatabaseDirectory() const { return m_resolvedConfiguration.webSQLDatabaseDirectory; }
-    const String& resolvedJavaScriptConfigurationDirectory() const { return m_resolvedConfiguration.javaScriptConfigurationDirectory; }
-    const String& resolvedCookieStorageFile() const { return m_resolvedConfiguration.cookieStorageFile; }
-    const String& resolvedIndexedDatabaseDirectory() const { return m_resolvedConfiguration.indexedDBDatabaseDirectory; }
-    const String& resolvedServiceWorkerRegistrationDirectory() const { return m_resolvedConfiguration.serviceWorkerRegistrationDirectory; }
-    const String& resolvedResourceLoadStatisticsDirectory() const { return m_resolvedConfiguration.resourceLoadStatisticsDirectory; }
+    const String& resolvedApplicationCacheDirectory() const { return m_resolvedConfiguration->applicationCacheDirectory(); }
+    const String& resolvedMediaCacheDirectory() const { return m_resolvedConfiguration->mediaCacheDirectory(); }
+    const String& resolvedMediaKeysDirectory() const { return m_resolvedConfiguration->mediaKeysStorageDirectory(); }
+    const String& resolvedDatabaseDirectory() const { return m_resolvedConfiguration->webSQLDatabaseDirectory(); }
+    const String& resolvedJavaScriptConfigurationDirectory() const { return m_resolvedConfiguration->javaScriptConfigurationDirectory(); }
+    const String& resolvedCookieStorageFile() const { return m_resolvedConfiguration->cookieStorageFile(); }
+    const String& resolvedIndexedDatabaseDirectory() const { return m_resolvedConfiguration->indexedDBDatabaseDirectory(); }
+    const String& resolvedServiceWorkerRegistrationDirectory() const { return m_resolvedConfiguration->serviceWorkerRegistrationDirectory(); }
+    const String& resolvedResourceLoadStatisticsDirectory() const { return m_resolvedConfiguration->resourceLoadStatisticsDirectory(); }
 
     StorageManager* storageManager() { return m_storageManager.get(); }
 
@@ -209,11 +186,11 @@ public:
 
     void didCreateNetworkProcess();
 
-    const Configuration& configuration() { return m_configuration; }
+    const WebsiteDataStoreConfiguration& configuration() { return m_configuration.get(); }
 
 private:
     explicit WebsiteDataStore(PAL::SessionID);
-    explicit WebsiteDataStore(Configuration, PAL::SessionID);
+    explicit WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&&, PAL::SessionID);
 
     void fetchDataAndApply(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, RefPtr<WorkQueue>&&, Function<void(Vector<WebsiteDataRecord>)>&& apply);
 
@@ -246,8 +223,8 @@ private:
 
     const PAL::SessionID m_sessionID;
 
-    const Configuration m_configuration;
-    Configuration m_resolvedConfiguration;
+    Ref<WebsiteDataStoreConfiguration> m_resolvedConfiguration;
+    Ref<const WebsiteDataStoreConfiguration> m_configuration;
     bool m_hasResolvedDirectories { false };
 
     const RefPtr<StorageManager> m_storageManager;
diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
new file mode 100644 (file)
index 0000000..32ee94a
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebsiteDataStoreConfiguration.h"
+
+namespace WebKit {
+
+WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration()
+    : m_resourceLoadStatisticsDirectory(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory())
+{
+}
+
+Ref<WebsiteDataStoreConfiguration> WebsiteDataStoreConfiguration::copy()
+{
+    auto copy = WebsiteDataStoreConfiguration::create();
+
+    copy->m_cacheStorageDirectory = this->m_cacheStorageDirectory;
+    copy->m_cacheStoragePerOriginQuota = this->m_cacheStoragePerOriginQuota;
+    copy->m_networkCacheDirectory = this->m_networkCacheDirectory;
+    copy->m_applicationCacheDirectory = this->m_applicationCacheDirectory;
+    copy->m_applicationCacheFlatFileSubdirectoryName = this->m_applicationCacheFlatFileSubdirectoryName;
+    copy->m_webStorageDirectory = this->m_webStorageDirectory;
+    copy->m_mediaCacheDirectory = this->m_mediaCacheDirectory;
+    copy->m_indexedDBDatabaseDirectory = this->m_indexedDBDatabaseDirectory;
+    copy->m_serviceWorkerRegistrationDirectory = this->m_serviceWorkerRegistrationDirectory;
+    copy->m_webSQLDatabaseDirectory = this->m_webSQLDatabaseDirectory;
+    copy->m_localStorageDirectory = this->m_localStorageDirectory;
+    copy->m_mediaKeysStorageDirectory = this->m_mediaKeysStorageDirectory;
+    copy->m_deviceIdHashSaltsStorageDirectory = this->m_deviceIdHashSaltsStorageDirectory;
+    copy->m_resourceLoadStatisticsDirectory = this->m_resourceLoadStatisticsDirectory;
+    copy->m_javaScriptConfigurationDirectory = this->m_javaScriptConfigurationDirectory;
+    copy->m_cookieStorageFile = this->m_cookieStorageFile;
+    copy->m_sourceApplicationBundleIdentifier = this->m_sourceApplicationBundleIdentifier;
+    copy->m_sourceApplicationSecondaryIdentifier = this->m_sourceApplicationSecondaryIdentifier;
+
+    return copy;
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h
new file mode 100644 (file)
index 0000000..ebfaf5f
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "APIObject.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+
+class WebsiteDataStoreConfiguration : public API::ObjectImpl<API::Object::Type::WebsiteDataStoreConfiguration> {
+public:
+    static Ref<WebsiteDataStoreConfiguration> create() { return adoptRef(*new WebsiteDataStoreConfiguration); }
+
+    Ref<WebsiteDataStoreConfiguration> copy();
+
+    uint64_t cacheStoragePerOriginQuota() { return m_cacheStoragePerOriginQuota; }
+    void setCacheStoragePerOriginQuota(uint64_t quota) { m_cacheStoragePerOriginQuota = quota; }
+
+    const String& applicationCacheDirectory() const { return m_applicationCacheDirectory; }
+    void setApplicationCacheDirectory(String&& directory) { m_applicationCacheDirectory = WTFMove(directory); }
+    
+    const String& mediaCacheDirectory() const { return m_mediaCacheDirectory; }
+    void setMediaCacheDirectory(String&& directory) { m_mediaCacheDirectory = WTFMove(directory); }
+    
+    const String& mediaKeysStorageDirectory() const { return m_mediaKeysStorageDirectory; }
+    void setMediaKeysStorageDirectory(String&& directory) { m_mediaKeysStorageDirectory = WTFMove(directory); }
+    
+    const String& javaScriptConfigurationDirectory() const { return m_javaScriptConfigurationDirectory; }
+    void setJavaScriptConfigurationDirectory(String&& directory) { m_javaScriptConfigurationDirectory = WTFMove(directory); }
+    
+    const String& webStorageDirectory() const { return m_webStorageDirectory; }
+    void setWebStorageDirectory(String&& directory) { m_webStorageDirectory = WTFMove(directory); }
+
+    const String& indexedDBDatabaseDirectory() const { return m_indexedDBDatabaseDirectory; }
+    void setIndexedDBDatabaseDirectory(String&& directory) { m_indexedDBDatabaseDirectory = WTFMove(directory); }
+
+    const String& webSQLDatabaseDirectory() const { return m_webSQLDatabaseDirectory; }
+    void setWebSQLDatabaseDirectory(String&& directory) { m_webSQLDatabaseDirectory = WTFMove(directory); }
+
+    const String& localStorageDirectory() const { return m_localStorageDirectory; }
+    void setLocalStorageDirectory(String&& directory) { m_localStorageDirectory = WTFMove(directory); }
+    
+    const String& cookieStorageFile() const { return m_cookieStorageFile; }
+    void setCookieStorageFile(String&& directory) { m_cookieStorageFile = WTFMove(directory); }
+    
+    const String& resourceLoadStatisticsDirectory() const { return m_resourceLoadStatisticsDirectory; }
+    void setResourceLoadStatisticsDirectory(String&& directory) { m_resourceLoadStatisticsDirectory = WTFMove(directory); }
+
+    const String& networkCacheDirectory() const { return m_networkCacheDirectory; }
+    void setNetworkCacheDirectory(String&& directory) { m_networkCacheDirectory = WTFMove(directory); }
+    
+    const String& cacheStorageDirectory() const { return m_cacheStorageDirectory; }
+    void setCacheStorageDirectory(String&& directory) { m_cacheStorageDirectory = WTFMove(directory); }
+    
+    const String& applicationCacheFlatFileSubdirectoryName() const { return m_applicationCacheFlatFileSubdirectoryName; }
+    void setApplicationCacheFlatFileSubdirectoryName(String&& directory) { m_applicationCacheFlatFileSubdirectoryName = WTFMove(directory); }
+    
+    const String& serviceWorkerRegistrationDirectory() const { return m_serviceWorkerRegistrationDirectory; }
+    void setServiceWorkerRegistrationDirectory(String&& directory) { m_serviceWorkerRegistrationDirectory = WTFMove(directory); }
+    
+    const String& sourceApplicationBundleIdentifier() const { return m_sourceApplicationBundleIdentifier; }
+    void setSourceApplicationBundleIdentifier(String&& identifier) { m_sourceApplicationBundleIdentifier = WTFMove(identifier); }
+
+    const String& sourceApplicationSecondaryIdentifier() const { return m_sourceApplicationSecondaryIdentifier; }
+    void setSourceApplicationSecondaryIdentifier(String&& identifier) { m_sourceApplicationSecondaryIdentifier = WTFMove(identifier); }
+
+    constexpr static uint64_t defaultCacheStoragePerOriginQuota = 50 * 1024 * 1024;
+
+private:
+    WebsiteDataStoreConfiguration();
+
+    String m_cacheStorageDirectory;
+    uint64_t m_cacheStoragePerOriginQuota { defaultCacheStoragePerOriginQuota };
+    String m_networkCacheDirectory;
+    String m_applicationCacheDirectory;
+    String m_applicationCacheFlatFileSubdirectoryName;
+    String m_webStorageDirectory;
+    String m_mediaCacheDirectory;
+    String m_indexedDBDatabaseDirectory;
+    String m_serviceWorkerRegistrationDirectory;
+    String m_webSQLDatabaseDirectory;
+    String m_localStorageDirectory;
+    String m_mediaKeysStorageDirectory;
+    String m_deviceIdHashSaltsStorageDirectory;
+    String m_resourceLoadStatisticsDirectory;
+    String m_javaScriptConfigurationDirectory;
+    String m_cookieStorageFile;
+    String m_sourceApplicationBundleIdentifier;
+    String m_sourceApplicationSecondaryIdentifier;
+};
+
+}
index 8dd5c19..f0657f4 100644 (file)
@@ -82,7 +82,7 @@ void WebInspectorProxy::platformInspectedURLChanged(const String&)
     notImplemented();
 }
 
-void WebInspectorProxy::platformShowCertificate(const CertificateInfo&)
+void WebInspectorProxy::platformShowCertificate(const WebCore::CertificateInfo&)
 {
     notImplemented();
 }
index 627c52b..6b18900 100644 (file)
                5C298D9E1C3DEF2900470AFE /* PendingDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PendingDownload.h; sourceTree = "<group>"; };
                5C359C0C21547321009E7948 /* WKDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDeprecated.h; sourceTree = "<group>"; };
                5C3AEA8E1FE1F1DF002318D3 /* WebsitePoliciesData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsitePoliciesData.cpp; sourceTree = "<group>"; };
+               5C46C0AC21B7198B00BC5991 /* WebsiteDataStoreConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsiteDataStoreConfiguration.cpp; sourceTree = "<group>"; };
+               5C46C0AD21B7198C00BC5991 /* WebsiteDataStoreConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataStoreConfiguration.h; sourceTree = "<group>"; };
+               5C46C0AE21B71AE200BC5991 /* _WKWebsiteDataStoreConfigurationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsiteDataStoreConfigurationInternal.h; sourceTree = "<group>"; };
                5C4B9D8A210A8C46008F14D1 /* UndoOrRedo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UndoOrRedo.h; sourceTree = "<group>"; };
                5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskPrivate.h; sourceTree = "<group>"; };
                5C6CE6D01F59BC460007C6CB /* PageClientImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImplCocoa.mm; sourceTree = "<group>"; };
                                1A4832CF1A9BD821008B4DFE /* WebsiteDataRecord.h */,
                                1A53C2A41A32569F004E8C70 /* WebsiteDataStore.cpp */,
                                1A53C2A51A32569F004E8C70 /* WebsiteDataStore.h */,
+                               5C46C0AC21B7198B00BC5991 /* WebsiteDataStoreConfiguration.cpp */,
+                               5C46C0AD21B7198C00BC5991 /* WebsiteDataStoreConfiguration.h */,
                        );
                        path = WebsiteData;
                        sourceTree = "<group>";
                                1AE2867F1C7F92BF0069AC4F /* _WKWebsiteDataSizeInternal.h */,
                                5120C8331E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.h */,
                                5120C8341E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.mm */,
+                               5C46C0AE21B71AE200BC5991 /* _WKWebsiteDataStoreConfigurationInternal.h */,
                                5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */,
                                5CB2378A1DF0DD4300117AA3 /* _WKWebsitePolicies.mm */,
                                5CB2378D1DF0E0C200117AA3 /* _WKWebsitePoliciesInternal.h */,