Diff
Modified: trunk/Source/WebKit/ChangeLog (235215 => 235216)
--- trunk/Source/WebKit/ChangeLog 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/ChangeLog 2018-08-23 05:52:57 UTC (rev 235216)
@@ -1,3 +1,85 @@
+2018-08-22 Sihui Liu <sihui_...@apple.com>
+
+ Move legacy directory configuration from WebProcessPool to API::WebsiteDataStore
+ https://bugs.webkit.org/show_bug.cgi?id=188765
+
+ Reviewed by Geoffrey Garen.
+
+ Diretories are parameters of websiteDataStore instead of webProcessPool, so we should move
+ legacy default paths to API::WebsiteDataStore, which already stores default paths for
+ non-legacy cases.
+
+ * UIProcess/API/APIProcessPoolConfiguration.cpp:
+ (API::ProcessPoolConfiguration::createWithLegacyOptions):
+ (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
+ * UIProcess/API/APIWebsiteDataStore.cpp:
+ (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
+ * UIProcess/API/APIWebsiteDataStore.h:
+ * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+ (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
+ (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
+ (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
+ (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
+ (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
+ * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
+ (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
+ (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
+ (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
+ (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
+ (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
+ * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
+ (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
+ (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
+ (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
+ (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
+ (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
+ (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
+ * UIProcess/WebProcessPool.h:
+ * UIProcess/gtk/WebProcessPoolGtk.cpp:
+ (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
+ * UIProcess/win/WebProcessPoolWin.cpp:
+ (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
+ * UIProcess/wpe/WebProcessPoolWPE.cpp:
+ (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
+ (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
+
2018-08-22 John Wilander <wilan...@apple.com>
The Storage Access API prompt should show the eTLD+1s, not the full host names
Modified: trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -38,22 +38,12 @@
Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithLegacyOptions()
{
- auto configuration = ProcessPoolConfiguration::create();
+ auto configuration = ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration(WebsiteDataStore::legacyDefaultDataStoreConfiguration());
configuration->m_shouldHaveLegacyDataStore = true;
configuration->m_maximumProcessCount = 1;
configuration->m_cacheModel = WebKit::CacheModelDocumentViewer;
- configuration->m_applicationCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory();
- configuration->m_applicationCacheFlatFileSubdirectoryName = "ApplicationCache";
- configuration->m_diskCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory();
- configuration->m_mediaCacheDirectory = WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory();
- configuration->m_indexedDBDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory();
- configuration->m_localStorageDirectory = WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory();
- configuration->m_mediaKeysStorageDirectory = WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory();
- configuration->m_webSQLDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory();
- configuration->m_javaScriptConfigurationDirectory = WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory();
-
return configuration;
}
@@ -65,7 +55,7 @@
configuration->m_applicationCacheFlatFileSubdirectoryName = legacyConfiguration.applicationCacheFlatFileSubdirectoryName;
configuration->m_diskCacheDirectory = legacyConfiguration.networkCacheDirectory;
configuration->m_mediaCacheDirectory = legacyConfiguration.mediaCacheDirectory;
- configuration->m_indexedDBDatabaseDirectory = WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory();
+ configuration->m_indexedDBDatabaseDirectory = WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory();
configuration->m_localStorageDirectory = legacyConfiguration.localStorageDirectory;
configuration->m_mediaKeysStorageDirectory = legacyConfiguration.mediaKeysStorageDirectory;
configuration->m_resourceLoadStatisticsDirectory = legacyConfiguration.resourceLoadStatisticsDirectory;
Modified: trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -119,4 +119,19 @@
}
#endif
+WebKit::WebsiteDataStore::Configuration WebsiteDataStore::legacyDefaultDataStoreConfiguration()
+{
+ WebKit::WebsiteDataStore::Configuration configuration;
+ configuration.applicationCacheDirectory = legacyDefaultApplicationCacheDirectory();
+ configuration.applicationCacheFlatFileSubdirectoryName = "ApplicationCache";
+ configuration.networkCacheDirectory = legacyDefaultNetworkCacheDirectory();
+ configuration.mediaCacheDirectory = legacyDefaultMediaCacheDirectory();
+ configuration.mediaKeysStorageDirectory = legacyDefaultMediaKeysStorageDirectory();
+ configuration.indexedDBDatabaseDirectory = legacyDefaultIndexedDBDatabaseDirectory();
+ configuration.webSQLDatabaseDirectory = legacyDefaultWebSQLDatabaseDirectory();
+ configuration._javascript_ConfigurationDirectory = legacyDefaultJavaScriptConfigurationDirectory();
+
+ return configuration;
}
+
+} // namespace API
Modified: trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.h (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.h 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/API/APIWebsiteDataStore.h 2018-08-23 05:52:57 UTC (rev 235216)
@@ -57,7 +57,6 @@
static String defaultCacheStorageDirectory();
static String defaultNetworkCacheDirectory();
static String defaultMediaCacheDirectory();
-
static String defaultIndexedDBDatabaseDirectory();
static String defaultServiceWorkerRegistrationDirectory();
static String defaultLocalStorageDirectory();
@@ -64,11 +63,21 @@
static String defaultMediaKeysStorageDirectory();
static String defaultWebSQLDatabaseDirectory();
static String defaultResourceLoadStatisticsDirectory();
-
static String defaultJavaScriptConfigurationDirectory();
static WebKit::WebsiteDataStore::Configuration defaultDataStoreConfiguration();
+ static String legacyDefaultApplicationCacheDirectory();
+ static String legacyDefaultNetworkCacheDirectory();
+ static String legacyDefaultLocalStorageDirectory();
+ static String legacyDefaultIndexedDBDatabaseDirectory();
+ static String legacyDefaultWebSQLDatabaseDirectory();
+ static String legacyDefaultMediaKeysStorageDirectory();
+ static String legacyDefaultMediaCacheDirectory();
+ static String legacyDefaultJavaScriptConfigurationDirectory();
+
+ static WebKit::WebsiteDataStore::Configuration legacyDefaultDataStoreConfiguration();
+
private:
enum ShouldCreateDirectory { CreateDirectory, DontCreateDirectory };
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm 2018-08-23 05:52:57 UTC (rev 235216)
@@ -29,6 +29,9 @@
#include "SandboxExtension.h"
#include "SandboxUtilities.h"
+#include <Foundation/Foundation.h>
+#include <WebCore/FileSystem.h>
+
#if PLATFORM(IOS)
#import <WebCore/RuntimeApplicationChecks.h>
#endif
@@ -35,6 +38,11 @@
namespace API {
+NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
+NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey";
+NSString *WebKitMediaCacheDirectoryDefaultsKey = @"WebKitMediaCacheDirectory";
+NSString *WebKitMediaKeysStorageDirectoryDefaultsKey = @"WebKitMediaKeysStorageDirectory";
+
String WebsiteDataStore::defaultApplicationCacheDirectory()
{
#if PLATFORM(IOS)
@@ -102,6 +110,113 @@
return tempDirectoryFileSystemRepresentation("_javascript_CoreDebug", DontCreateDirectory);
}
+String WebsiteDataStore::legacyDefaultApplicationCacheDirectory()
+{
+ NSString *appName = [[NSBundle mainBundle] bundleIdentifier];
+ if (!appName)
+ appName = [[NSProcessInfo processInfo] processName];
+#if PLATFORM(IOS)
+ // This quirk used to make these apps share application cache storage, but doesn't accomplish that any more.
+ // Preserving it avoids the need to migrate data when upgrading.
+ if (WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isWebApp())
+ appName = @"com.apple.WebAppCache";
+#endif
+
+ ASSERT(appName);
+
+#if PLATFORM(IOS)
+ NSString *cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
+#else
+ char cacheDirectory[MAXPATHLEN];
+ size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN);
+ if (!cacheDirectoryLen)
+ return String();
+
+ NSString *cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1];
+#endif
+ NSString* cachePath = [cacheDir stringByAppendingPathComponent:appName];
+ return WebKit::stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
+}
+
+String WebsiteDataStore::legacyDefaultNetworkCacheDirectory()
+{
+ NSString *cachePath = CFBridgingRelease(_CFURLCacheCopyCacheDirectory([[NSURLCache sharedURLCache] _CFURLCache]));
+ if (!cachePath)
+ cachePath = @"~/Library/Caches/com.apple.WebKit.WebProcess";
+
+ cachePath = [cachePath stringByAppendingPathComponent:@"WebKitCache"];
+
+ return WebKit::stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
+}
+
+String WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory()
+{
+ NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebDatabaseDirectoryDefaultsKey];
+ if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
+ databasesDirectory = @"~/Library/WebKit/Databases";
+ return WebKit::stringByResolvingSymlinksInPath([databasesDirectory stringByStandardizingPath]);
+}
+
+String WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory()
+{
+ // Indexed databases exist in a subdirectory of the "database directory path."
+ // Currently, the top level of that directory contains entities related to WebSQL databases.
+ // We should fix this, and move WebSQL into a subdirectory (https://bugs.webkit.org/show_bug.cgi?id=124807)
+ // In the meantime, an entity name prefixed with three underscores will not conflict with any WebSQL entities.
+ return WebCore::FileSystem::pathByAppendingComponent(legacyDefaultWebSQLDatabaseDirectory(), "___IndexedDB");
+}
+
+String WebsiteDataStore::legacyDefaultLocalStorageDirectory()
+{
+ NSString *localStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebStorageDirectoryDefaultsKey];
+ if (!localStorageDirectory || ![localStorageDirectory isKindOfClass:[NSString class]])
+ localStorageDirectory = @"~/Library/WebKit/LocalStorage";
+ return WebKit::stringByResolvingSymlinksInPath([localStorageDirectory stringByStandardizingPath]);
+}
+
+String WebsiteDataStore::legacyDefaultMediaCacheDirectory()
+{
+ NSString *mediaKeysCacheDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitMediaCacheDirectoryDefaultsKey];
+ if (!mediaKeysCacheDirectory || ![mediaKeysCacheDirectory isKindOfClass:[NSString class]]) {
+ mediaKeysCacheDirectory = NSTemporaryDirectory();
+
+ if (!WebKit::processHasContainer()) {
+ NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier;
+ if (!bundleIdentifier)
+ bundleIdentifier = [NSProcessInfo processInfo].processName;
+ mediaKeysCacheDirectory = [mediaKeysCacheDirectory stringByAppendingPathComponent:bundleIdentifier];
+ }
+ mediaKeysCacheDirectory = [mediaKeysCacheDirectory stringByAppendingPathComponent:@"WebKit/MediaCache"];
+ }
+ return WebKit::stringByResolvingSymlinksInPath([mediaKeysCacheDirectory stringByStandardizingPath]);
+}
+
+String WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory()
+{
+ NSString *mediaKeysStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitMediaKeysStorageDirectoryDefaultsKey];
+ if (!mediaKeysStorageDirectory || ![mediaKeysStorageDirectory isKindOfClass:[NSString class]])
+ mediaKeysStorageDirectory = @"~/Library/WebKit/MediaKeys";
+ return WebKit::stringByResolvingSymlinksInPath([mediaKeysStorageDirectory stringByStandardizingPath]);
+}
+
+String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
+{
+#if PLATFORM(IOS)
+ String path = WebKit::pathForProcessContainer();
+ if (path.isEmpty())
+ path = NSHomeDirectory();
+
+ path = path + "/Library/WebKit/_javascript_CoreDebug";
+ path = WebKit::stringByResolvingSymlinksInPath(path);
+
+ return path;
+#else
+ RetainPtr<NSString> _javascript_ConfigPath = @"~/Library/WebKit/_javascript_CoreDebug";
+
+ return WebKit::stringByResolvingSymlinksInPath([_javascript_ConfigPath stringByStandardizingPath]);
+#endif
+}
+
String WebsiteDataStore::tempDirectoryFileSystemRepresentation(const String& directoryName, ShouldCreateDirectory shouldCreateDirectory)
{
static dispatch_once_t onceToken;
@@ -209,4 +324,4 @@
return configuration;
}
-}
+} // namespace API
Modified: trunk/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -93,6 +93,75 @@
return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::stringFromFileSystemRepresentation(g_get_user_data_dir()), directoryName);
}
+String WebsiteDataStore::legacyDefaultApplicationCacheDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "wpe", "appcache", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(cacheDirectory.get());
+#endif
+ return defaultApplicationCacheDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultNetworkCacheDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<char> diskCacheDirectory(g_build_filename(g_get_user_cache_dir(), "wpe", "cache", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(diskCacheDirectory.get());
+#endif
+ return defaultNetworkCacheDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "databases", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(databaseDirectory.get());
+#endif
+ return defaultWebSQLDatabaseDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<gchar> indexedDBDatabaseDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "databases", "indexeddb", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(indexedDBDatabaseDirectory.get());
+#endif
+ return defaultIndexedDBDatabaseDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultLocalStorageDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<gchar> storageDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "localstorage", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(storageDirectory.get());
+#endif
+ return defaultLocalStorageDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultMediaCacheDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "wpe", "mediacache", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(cacheDirectory.get());
+#endif
+ return defaultMediaCacheDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory()
+{
+#if PLATFORM(WPE)
+ GUniquePtr<gchar> mediaKeysStorageDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "mediakeys", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(mediaKeysStorageDirectory.get());
+#endif
+ return defaultMediaKeysStorageDirectory();
+}
+
+String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
+{
+ GUniquePtr<gchar> _javascript_CoreConfigDirectory(g_build_filename(g_get_user_data_dir(), BASE_DIRECTORY, "_javascript_CoreDebug", nullptr));
+ return WebCore::FileSystem::stringFromFileSystemRepresentation(_javascript_CoreConfigDirectory.get());
+}
+
WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
{
WebKit::WebsiteDataStore::Configuration configuration;
Modified: trunk/Source/WebKit/UIProcess/API/win/APIWebsiteDataStoreWin.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/API/win/APIWebsiteDataStoreWin.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/API/win/APIWebsiteDataStoreWin.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -85,6 +85,46 @@
return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), directoryName);
}
+String WebsiteDataStore::legacyDefaultApplicationCacheDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "ApplicationCache");
+}
+
+String WebsiteDataStore::legacyDefaultNetworkCacheDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "NetworkCache");
+}
+
+String WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "WebSQL");
+}
+
+String WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "IndexedDB");
+}
+
+String WebsiteDataStore::legacyDefaultLocalStorageDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "LocalStorage");
+}
+
+String WebsiteDataStore::legacyDefaultMediaCacheDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "MediaCache");
+}
+
+String WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "MediaKeyStorage");
+}
+
+String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
+{
+ return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "_javascript_CoreDebug");
+}
+
WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
{
WebKit::WebsiteDataStore::Configuration configuration;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2018-08-23 05:52:57 UTC (rev 235216)
@@ -62,14 +62,10 @@
using namespace WebCore;
-NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
NSString *WebServiceWorkerRegistrationDirectoryDefaultsKey = @"WebServiceWorkerRegistrationDirectory";
NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache";
-NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey";
NSString *WebKitJSCJITEnabledDefaultsKey = @"WebKitJSCJITEnabledDefaultsKey";
NSString *WebKitJSCFTLJITEnabledDefaultsKey = @"WebKitJSCFTLJITEnabledDefaultsKey";
-NSString *WebKitMediaKeysStorageDirectoryDefaultsKey = @"WebKitMediaKeysStorageDirectory";
-NSString *WebKitMediaCacheDirectoryDefaultsKey = @"WebKitMediaCacheDirectory";
#if !PLATFORM(IOS)
static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification = @"NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification";
@@ -393,122 +389,7 @@
}
#endif
-String WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory()
-{
- registerUserDefaultsIfNeeded();
-
- NSString *databasesDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebDatabaseDirectoryDefaultsKey];
- if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
- databasesDirectory = @"~/Library/WebKit/Databases";
- return stringByResolvingSymlinksInPath([databasesDirectory stringByStandardizingPath]);
-}
-
-String WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory()
-{
- // Indexed databases exist in a subdirectory of the "database directory path."
- // Currently, the top level of that directory contains entities related to WebSQL databases.
- // We should fix this, and move WebSQL into a subdirectory (https://bugs.webkit.org/show_bug.cgi?id=124807)
- // In the meantime, an entity name prefixed with three underscores will not conflict with any WebSQL entities.
- return FileSystem::pathByAppendingComponent(legacyPlatformDefaultWebSQLDatabaseDirectory(), "___IndexedDB");
-}
-
-String WebProcessPool::legacyPlatformDefaultLocalStorageDirectory()
-{
- registerUserDefaultsIfNeeded();
-
- NSString *localStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebStorageDirectoryDefaultsKey];
- if (!localStorageDirectory || ![localStorageDirectory isKindOfClass:[NSString class]])
- localStorageDirectory = @"~/Library/WebKit/LocalStorage";
- return stringByResolvingSymlinksInPath([localStorageDirectory stringByStandardizingPath]);
-}
-
-String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
-{
- registerUserDefaultsIfNeeded();
-
- NSString *mediaKeysCacheDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitMediaCacheDirectoryDefaultsKey];
- if (!mediaKeysCacheDirectory || ![mediaKeysCacheDirectory isKindOfClass:[NSString class]]) {
- mediaKeysCacheDirectory = NSTemporaryDirectory();
-
- if (!WebKit::processHasContainer()) {
- NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier;
- if (!bundleIdentifier)
- bundleIdentifier = [NSProcessInfo processInfo].processName;
- mediaKeysCacheDirectory = [mediaKeysCacheDirectory stringByAppendingPathComponent:bundleIdentifier];
- }
- mediaKeysCacheDirectory = [mediaKeysCacheDirectory stringByAppendingPathComponent:@"WebKit/MediaCache"];
- }
- return stringByResolvingSymlinksInPath([mediaKeysCacheDirectory stringByStandardizingPath]);
-}
-
-String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory()
-{
- registerUserDefaultsIfNeeded();
-
- NSString *mediaKeysStorageDirectory = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitMediaKeysStorageDirectoryDefaultsKey];
- if (!mediaKeysStorageDirectory || ![mediaKeysStorageDirectory isKindOfClass:[NSString class]])
- mediaKeysStorageDirectory = @"~/Library/WebKit/MediaKeys";
- return stringByResolvingSymlinksInPath([mediaKeysStorageDirectory stringByStandardizingPath]);
-}
-
-String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
-{
- NSString *appName = [[NSBundle mainBundle] bundleIdentifier];
- if (!appName)
- appName = [[NSProcessInfo processInfo] processName];
#if PLATFORM(IOS)
- // This quirk used to make these apps share application cache storage, but doesn't accomplish that any more.
- // Preserving it avoids the need to migrate data when upgrading.
- if (IOSApplication::isMobileSafari() || IOSApplication::isWebApp())
- appName = @"com.apple.WebAppCache";
-#endif
-
- ASSERT(appName);
-
-#if PLATFORM(IOS)
- NSString *cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
-#else
- char cacheDirectory[MAXPATHLEN];
- size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN);
- if (!cacheDirectoryLen)
- return String();
-
- NSString *cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1];
-#endif
- NSString* cachePath = [cacheDir stringByAppendingPathComponent:appName];
- return stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
-}
-
-String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
-{
- NSString *cachePath = CFBridgingRelease(_CFURLCacheCopyCacheDirectory([[NSURLCache sharedURLCache] _CFURLCache]));
- if (!cachePath)
- cachePath = @"~/Library/Caches/com.apple.WebKit.WebProcess";
-
- cachePath = [cachePath stringByAppendingPathComponent:@"WebKitCache"];
-
- return stringByResolvingSymlinksInPath([cachePath stringByStandardizingPath]);
-}
-
-String WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory()
-{
-#if PLATFORM(IOS)
- String path = pathForProcessContainer();
- if (path.isEmpty())
- path = NSHomeDirectory();
-
- path = path + "/Library/WebKit/_javascript_CoreDebug";
- path = stringByResolvingSymlinksInPath(path);
-
- return path;
-#else
- RetainPtr<NSString> _javascript_ConfigPath = @"~/Library/WebKit/_javascript_CoreDebug";
-
- return stringByResolvingSymlinksInPath([_javascript_ConfigPath stringByStandardizingPath]);
-#endif
-}
-
-#if PLATFORM(IOS)
void WebProcessPool::setJavaScriptConfigurationFileEnabledFromDefaults()
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.h 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h 2018-08-23 05:52:57 UTC (rev 235216)
@@ -417,16 +417,6 @@
return m_hiddenPageThrottlingAutoIncreasesCounter.count();
}
- // FIXME: Move these to API::WebsiteDataStore.
- static String legacyPlatformDefaultLocalStorageDirectory();
- static String legacyPlatformDefaultIndexedDBDatabaseDirectory();
- static String legacyPlatformDefaultWebSQLDatabaseDirectory();
- static String legacyPlatformDefaultMediaKeysStorageDirectory();
- static String legacyPlatformDefaultMediaCacheDirectory();
- static String legacyPlatformDefaultApplicationCacheDirectory();
- static String legacyPlatformDefaultNetworkCacheDirectory();
- static String legacyPlatformDefaultJavaScriptConfigurationDirectory();
-
void setResourceLoadStatisticsEnabled(bool);
void clearResourceLoadStatistics();
Modified: trunk/Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -77,16 +77,6 @@
#endif
}
-WTF::String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
-{
- return API::WebsiteDataStore::defaultApplicationCacheDirectory();
-}
-
-WTF::String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
-{
- return API::WebsiteDataStore::defaultMediaCacheDirectory();
-}
-
void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
{
parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModelDocumentViewer;
@@ -110,37 +100,6 @@
{
}
-String WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory()
-{
- return API::WebsiteDataStore::defaultWebSQLDatabaseDirectory();
-}
-
-String WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory()
-{
- return API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory();
-}
-
-String WebProcessPool::legacyPlatformDefaultLocalStorageDirectory()
-{
- return API::WebsiteDataStore::defaultLocalStorageDirectory();
-}
-
-String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory()
-{
- return API::WebsiteDataStore::defaultMediaKeysStorageDirectory();
-}
-
-String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
-{
- return API::WebsiteDataStore::defaultNetworkCacheDirectory();
-}
-
-String WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory()
-{
- GUniquePtr<gchar> _javascript_CoreConfigDirectory(g_build_filename(g_get_user_data_dir(), "webkitgtk", "_javascript_CoreDebug", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(_javascript_CoreConfigDirectory.get());
-}
-
void WebProcessPool::platformResolvePathsForSandboxExtensions()
{
}
Modified: trunk/Source/WebKit/UIProcess/win/WebProcessPoolWin.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/win/WebProcessPoolWin.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/win/WebProcessPoolWin.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -53,46 +53,6 @@
notImplemented();
}
-String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "ApplicationCache");
-}
-
-String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "MediaCache");
-}
-
-String WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "WebSQL");
-}
-
-String WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "IndexedDB");
-}
-
-String WebProcessPool::legacyPlatformDefaultLocalStorageDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "LocalStorage");
-}
-
-String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "MediaKeyStorage");
-}
-
-String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "NetworkCache");
-}
-
-String WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory()
-{
- return WebCore::FileSystem::pathByAppendingComponent(WebCore::FileSystem::localUserSpecificStorageDirectory(), "_javascript_CoreDebug");
-}
-
void WebProcessPool::platformResolvePathsForSandboxExtensions()
{
}
Modified: trunk/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp (235215 => 235216)
--- trunk/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp 2018-08-23 03:01:40 UTC (rev 235215)
+++ trunk/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp 2018-08-23 05:52:57 UTC (rev 235216)
@@ -78,18 +78,6 @@
#endif
}
-WTF::String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
-{
- GUniquePtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "wpe", "appcache", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(cacheDirectory.get());
-}
-
-WTF::String WebProcessPool::legacyPlatformDefaultMediaCacheDirectory()
-{
- GUniquePtr<gchar> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "wpe", "mediacache", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(cacheDirectory.get());
-}
-
void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
{
parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModelDocumentViewer;
@@ -109,42 +97,6 @@
notImplemented();
}
-String WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory()
-{
- GUniquePtr<gchar> databaseDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "databases", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(databaseDirectory.get());
-}
-
-String WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory()
-{
- GUniquePtr<gchar> indexedDBDatabaseDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "databases", "indexeddb", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(indexedDBDatabaseDirectory.get());
-}
-
-String WebProcessPool::legacyPlatformDefaultLocalStorageDirectory()
-{
- GUniquePtr<gchar> storageDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "localstorage", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(storageDirectory.get());
-}
-
-String WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory()
-{
- GUniquePtr<gchar> mediaKeysStorageDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "mediakeys", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(mediaKeysStorageDirectory.get());
-}
-
-String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
-{
- GUniquePtr<char> diskCacheDirectory(g_build_filename(g_get_user_cache_dir(), "wpe", "cache", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(diskCacheDirectory.get());
-}
-
-String WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory()
-{
- GUniquePtr<gchar> _javascript_CoreConfigDirectory(g_build_filename(g_get_user_data_dir(), "wpe", "_javascript_CoreDebug", nullptr));
- return WebCore::FileSystem::stringFromFileSystemRepresentation(_javascript_CoreConfigDirectory.get());
-}
-
void WebProcessPool::platformResolvePathsForSandboxExtensions()
{
}