Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 22:18:22 +0000 (22:18 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 22:18:22 +0000 (22:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194844

Reviewed by Youenn Fablet.

Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
a crash in Windows when running a Service Worker.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
* UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
(API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
(API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp
Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm
Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp
Source/WebKit/UIProcess/API/win/APIWebsiteDataStoreWin.cpp

index bc666f1..32602fe 100644 (file)
@@ -1,3 +1,26 @@
+2019-03-01  Don Olmstead  <don.olmstead@sony.com>
+
+        Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
+        https://bugs.webkit.org/show_bug.cgi?id=194844
+
+        Reviewed by Youenn Fablet.
+
+        Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
+        append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
+        a crash in Windows when running a Service Worker.
+
+        * UIProcess/API/APIWebsiteDataStore.cpp:
+        (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
+        (API::WebsiteDataStore::defaultDataStoreConfiguration):
+        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+        (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
+        (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
+        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
+        (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
+        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
+        (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
+        (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
+
 2019-03-01  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
index 2797c8c..f74b2c5 100644 (file)
@@ -133,6 +133,37 @@ WTF::String WebsiteDataStore::defaultJavaScriptConfigurationDirectory()
 }
 #endif
 
+#if !USE(GLIB)
+WTF::String WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory()
+{
+    // Not implemented.
+    return WTF::String();
+}
+#endif
+
+Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
+{
+    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->setDeviceIdHashSaltsStorageDirectory(defaultDeviceIdHashSaltsStorageDirectory());
+
+    configuration->setJavaScriptConfigurationDirectory(defaultJavaScriptConfigurationDirectory());
+
+    return configuration;
+}
+
 Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::legacyDefaultDataStoreConfiguration()
 {
     auto configuration = defaultDataStoreConfiguration();
index 3884f43..3ae8845 100644 (file)
@@ -94,12 +94,6 @@ WTF::String WebsiteDataStore::defaultMediaKeysStorageDirectory()
     return websiteDataDirectoryFileSystemRepresentation("MediaKeys");
 }
 
-WTF::String WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory()
-{
-    // Not implemented.
-    return String();
-}
-
 WTF::String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
 {
     return websiteDataDirectoryFileSystemRepresentation("WebSQL");
@@ -313,26 +307,4 @@ WTF::String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const
     return url.absoluteURL.path.fileSystemRepresentation;
 }
 
-Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
-{
-    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->setJavaScriptConfigurationDirectory(defaultJavaScriptConfigurationDirectory());
-
-    return configuration;
-}
-
 } // namespace API
index f5ab931..d572c54 100644 (file)
@@ -177,23 +177,4 @@ WTF::String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
     return FileSystem::stringFromFileSystemRepresentation(javaScriptCoreConfigDirectory.get());
 }
 
-Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
-{
-    auto configuration = WebKit::WebsiteDataStoreConfiguration::create();
-
-    configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory());
-    configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory());
-
-    configuration->setIndexedDBDatabaseDirectory(defaultIndexedDBDatabaseDirectory());
-    configuration->setServiceWorkerRegistrationDirectory(defaultServiceWorkerRegistrationDirectory());
-    configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory());
-    configuration->setLocalStorageDirectory(defaultLocalStorageDirectory());
-    configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory());
-    configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory());
-    configuration->setDeviceIdHashSaltsStorageDirectory(defaultDeviceIdHashSaltsStorageDirectory());
-
-    return configuration;
-}
-
 } // namespace API
-
index 3225b92..287b756 100644 (file)
@@ -65,12 +65,6 @@ String WebsiteDataStore::defaultMediaKeysStorageDirectory()
     return FileSystem::pathByAppendingComponent(FileSystem::localUserSpecificStorageDirectory(), "MediaKeyStorage");
 }
 
-String WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory()
-{
-    // Not Implemented.
-    return String();
-}
-
 String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
 {
     return FileSystem::pathByAppendingComponent(FileSystem::localUserSpecificStorageDirectory(), "WebSQL");
@@ -137,18 +131,4 @@ String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
     return FileSystem::pathByAppendingComponent(FileSystem::localUserSpecificStorageDirectory(), "JavaScriptCoreDebug");
 }
 
-Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
-{
-    auto configuration = WebKit::WebsiteDataStoreConfiguration::create();
-
-    configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory());
-    configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory());
-    configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory());
-    configuration->setLocalStorageDirectory(defaultLocalStorageDirectory());
-    configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory());
-    configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory());
-
-    return configuration;
-}
-
 } // namespace API