- Revision
- 220408
- Author
- ape...@igalia.com
- Date
- 2017-08-08 09:49:15 -0700 (Tue, 08 Aug 2017)
Log Message
[WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends
https://bugs.webkit.org/show_bug.cgi?id=175322
Reviewed by Carlos Garcia Campos.
This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of
the base directory inside the user XDG cache directory.
* PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp.
* PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources.
* UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code.
* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp.
(API::WebsiteDataStore::defaultApplicationCacheDirectory):
(API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(API::WebsiteDataStore::defaultLocalStorageDirectory):
(API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
Modified Paths
Added Paths
Removed Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (220407 => 220408)
--- trunk/Source/WebKit/ChangeLog 2017-08-08 16:41:50 UTC (rev 220407)
+++ trunk/Source/WebKit/ChangeLog 2017-08-08 16:49:15 UTC (rev 220408)
@@ -1,3 +1,24 @@
+2017-08-08 Adrian Perez de Castro <ape...@igalia.com>
+
+ [WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends
+ https://bugs.webkit.org/show_bug.cgi?id=175322
+
+ Reviewed by Carlos Garcia Campos.
+
+ This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of
+ the base directory inside the user XDG cache directory.
+
+ * PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp.
+ * PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources.
+ * UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code.
+ * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp.
+ (API::WebsiteDataStore::defaultApplicationCacheDirectory):
+ (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
+ (API::WebsiteDataStore::defaultLocalStorageDirectory):
+ (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
+ (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
+ (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
+
2017-08-08 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r220368.
Modified: trunk/Source/WebKit/PlatformGTK.cmake (220407 => 220408)
--- trunk/Source/WebKit/PlatformGTK.cmake 2017-08-08 16:41:50 UTC (rev 220407)
+++ trunk/Source/WebKit/PlatformGTK.cmake 2017-08-08 16:49:15 UTC (rev 220408)
@@ -116,6 +116,7 @@
UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
UIProcess/API/C/gtk/WKView.cpp
+ UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp
UIProcess/API/glib/IconDatabase.cpp
UIProcess/API/glib/WebKitApplicationInfo.cpp
UIProcess/API/glib/WebKitAuthenticationRequest.cpp
@@ -172,7 +173,6 @@
UIProcess/API/glib/WebKitWebsiteDataManager.cpp
UIProcess/API/glib/WebKitWindowProperties.cpp
- UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp
UIProcess/API/gtk/PageClientImpl.cpp
UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
UIProcess/API/gtk/WebKitColorChooser.cpp
Modified: trunk/Source/WebKit/PlatformWPE.cmake (220407 => 220408)
--- trunk/Source/WebKit/PlatformWPE.cmake 2017-08-08 16:41:50 UTC (rev 220407)
+++ trunk/Source/WebKit/PlatformWPE.cmake 2017-08-08 16:49:15 UTC (rev 220408)
@@ -131,6 +131,7 @@
UIProcess/API/C/wpe/WKView.cpp
+ UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp
UIProcess/API/glib/IconDatabase.cpp
UIProcess/API/glib/WebKitApplicationInfo.cpp
UIProcess/API/glib/WebKitAuthenticationRequest.cpp
Modified: trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp (220407 => 220408)
--- trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp 2017-08-08 16:41:50 UTC (rev 220407)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp 2017-08-08 16:49:15 UTC (rev 220408)
@@ -87,65 +87,6 @@
m_websiteDataStore->setResourceLoadStatisticsEnabled(enabled);
}
-#if !PLATFORM(COCOA) && !PLATFORM(GTK)
-WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
-{
- // FIXME: Fill everything in.
- WebKit::WebsiteDataStore::Configuration configuration;
-
- return configuration;
-}
-
-String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String&)
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultLocalStorageDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultNetworkCacheDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultApplicationCacheDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultMediaKeysStorageDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-String WebsiteDataStore::defaultResourceLoadStatisticsDirectory()
-{
- // FIXME: Implement.
- return String();
-}
-
-#endif
-
#if !PLATFORM(COCOA)
String WebsiteDataStore::defaultMediaCacheDirectory()
{
Copied: trunk/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp (from rev 220407, trunk/Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp) (0 => 220408)
--- trunk/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp 2017-08-08 16:49:15 UTC (rev 220408)
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2015-2017 Igalia S.L.
+ *
+ * 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 "APIWebsiteDataStore.h"
+
+#include <WebCore/FileSystem.h>
+
+#if PLATFORM(GTK)
+#define BASE_DIRECTORY "webkitgtk"
+#elif PLATFORM(WPE)
+#define BASE_DIRECTORY "wpe"
+#endif
+
+namespace API {
+
+String WebsiteDataStore::defaultApplicationCacheDirectory()
+{
+ return cacheDirectoryFileSystemRepresentation(BASE_DIRECTORY G_DIR_SEPARATOR_S "applications");
+}
+
+// FIXME: The other directories in this file are shared between all applications using WebKitGTK+.
+// Why is only this directory namespaced to a particular application?
+String WebsiteDataStore::defaultNetworkCacheDirectory()
+{
+ return cacheDirectoryFileSystemRepresentation(WebCore::pathByAppendingComponent(WebCore::stringFromFileSystemRepresentation(g_get_prgname()), "WebKitCache"));
+}
+
+String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
+{
+ return websiteDataDirectoryFileSystemRepresentation(BASE_DIRECTORY G_DIR_SEPARATOR_S "databases" G_DIR_SEPARATOR_S "indexeddb");
+}
+
+String WebsiteDataStore::defaultLocalStorageDirectory()
+{
+ return websiteDataDirectoryFileSystemRepresentation(BASE_DIRECTORY G_DIR_SEPARATOR_S "localstorage");
+}
+
+String WebsiteDataStore::defaultMediaKeysStorageDirectory()
+{
+ return websiteDataDirectoryFileSystemRepresentation(BASE_DIRECTORY G_DIR_SEPARATOR_S "mediakeys");
+}
+
+String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
+{
+ return websiteDataDirectoryFileSystemRepresentation(BASE_DIRECTORY G_DIR_SEPARATOR_S "databases");
+}
+
+String WebsiteDataStore::defaultResourceLoadStatisticsDirectory()
+{
+ return websiteDataDirectoryFileSystemRepresentation(BASE_DIRECTORY G_DIR_SEPARATOR_S "ResourceLoadStatistics");
+}
+
+String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String& directoryName)
+{
+ return WebCore::pathByAppendingComponent(WebCore::stringFromFileSystemRepresentation(g_get_user_cache_dir()), directoryName);
+}
+
+String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String& directoryName)
+{
+ return WebCore::pathByAppendingComponent(WebCore::stringFromFileSystemRepresentation(g_get_user_data_dir()), directoryName);
+}
+
+WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
+{
+ WebKit::WebsiteDataStore::Configuration configuration;
+
+ configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
+ configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
+
+ configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
+ configuration.localStorageDirectory = defaultLocalStorageDirectory();
+ configuration.mediaKeysStorageDirectory = defaultMediaKeysStorageDirectory();
+ configuration.resourceLoadStatisticsDirectory = defaultResourceLoadStatisticsDirectory();
+
+ return configuration;
+}
+
+} // namespace API
Deleted: trunk/Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp (220407 => 220408)
--- trunk/Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp 2017-08-08 16:41:50 UTC (rev 220407)
+++ trunk/Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp 2017-08-08 16:49:15 UTC (rev 220408)
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2015 Igalia S.L.
- *
- * 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 "APIWebsiteDataStore.h"
-
-#include <WebCore/FileSystem.h>
-
-namespace API {
-
-String WebsiteDataStore::defaultApplicationCacheDirectory()
-{
- return cacheDirectoryFileSystemRepresentation("webkitgtk" G_DIR_SEPARATOR_S "applications");
-}
-
-// FIXME: The other directories in this file are shared between all applications using WebKitGTK+.
-// Why is only this directory namespaced to a particular application?
-String WebsiteDataStore::defaultNetworkCacheDirectory()
-{
- return cacheDirectoryFileSystemRepresentation(WebCore::pathByAppendingComponent(WebCore::stringFromFileSystemRepresentation(g_get_prgname()), "WebKitCache"));
-}
-
-String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
-{
- return websiteDataDirectoryFileSystemRepresentation("webkitgtk" G_DIR_SEPARATOR_S "databases" G_DIR_SEPARATOR_S "indexeddb");
-}
-
-String WebsiteDataStore::defaultLocalStorageDirectory()
-{
- return websiteDataDirectoryFileSystemRepresentation("webkitgtk" G_DIR_SEPARATOR_S "localstorage");
-}
-
-String WebsiteDataStore::defaultMediaKeysStorageDirectory()
-{
- return websiteDataDirectoryFileSystemRepresentation("webkitgtk" G_DIR_SEPARATOR_S "mediakeys");
-}
-
-String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
-{
- return websiteDataDirectoryFileSystemRepresentation("webkitgtk" G_DIR_SEPARATOR_S "databases");
-}
-
-String WebsiteDataStore::defaultResourceLoadStatisticsDirectory()
-{
- return websiteDataDirectoryFileSystemRepresentation("webkitgtk" G_DIR_SEPARATOR_S "ResourceLoadStatistics");
-}
-
-String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String& directoryName)
-{
- return WebCore::pathByAppendingComponent(WebCore::stringFromFileSystemRepresentation(g_get_user_cache_dir()), directoryName);
-}
-
-String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String& directoryName)
-{
- return WebCore::pathByAppendingComponent(WebCore::stringFromFileSystemRepresentation(g_get_user_data_dir()), directoryName);
-}
-
-WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
-{
- WebKit::WebsiteDataStore::Configuration configuration;
-
- configuration.applicationCacheDirectory = defaultApplicationCacheDirectory();
- configuration.networkCacheDirectory = defaultNetworkCacheDirectory();
-
- configuration.webSQLDatabaseDirectory = defaultWebSQLDatabaseDirectory();
- configuration.localStorageDirectory = defaultLocalStorageDirectory();
- configuration.mediaKeysStorageDirectory = defaultMediaKeysStorageDirectory();
- configuration.resourceLoadStatisticsDirectory = defaultResourceLoadStatisticsDirectory();
-
- return configuration;
-}
-
-} // namespace API