Title: [184686] trunk/Source/WebKit2
Revision
184686
Author
[email protected]
Date
2015-05-20 18:30:18 -0700 (Wed, 20 May 2015)

Log Message

WKWebsiteDataStore API doesn't report webkit.org as using Databases or App Cache after visiting http://www.webkit.org/demos/sticky-notes/
https://bugs.webkit.org/show_bug.cgi?id=145238
rdar://problem/20581175

Reviewed by Tim Horton.

Make sure to set the application cache and WebSQL directories when using the legacy data store.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
(WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory):
Rename this and move it to the right place.

* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
Rename this and add the application cache and WebSQL directories.

(WebKit::WebProcessPool::WebProcessPool):
Call legacyWebsiteDataStoreConfiguration.

(WebKit::WebProcessPool::applicationCacheDirectory):
Call legacyPlatformDefaultApplicationCacheDirectory.

* UIProcess/WebProcessPool.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (184685 => 184686)


--- trunk/Source/WebKit2/ChangeLog	2015-05-21 01:28:31 UTC (rev 184685)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-21 01:30:18 UTC (rev 184686)
@@ -1,3 +1,30 @@
+2015-05-20  Anders Carlsson  <[email protected]>
+
+        WKWebsiteDataStore API doesn't report webkit.org as using Databases or App Cache after visiting http://www.webkit.org/demos/sticky-notes/
+        https://bugs.webkit.org/show_bug.cgi?id=145238
+        rdar://problem/20581175
+
+        Reviewed by Tim Horton.
+
+        Make sure to set the application cache and WebSQL directories when using the legacy data store.
+
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
+        (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory):
+        Rename this and move it to the right place.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::legacyWebsiteDataStoreConfiguration):
+        Rename this and add the application cache and WebSQL directories.
+
+        (WebKit::WebProcessPool::WebProcessPool):
+        Call legacyWebsiteDataStoreConfiguration.
+
+        (WebKit::WebProcessPool::applicationCacheDirectory):
+        Call legacyPlatformDefaultApplicationCacheDirectory.
+
+        * UIProcess/WebProcessPool.h:
+
 2015-05-20  Enrica Casucci  <[email protected]>
 
         [iOS] Using CSS viewport units causes incorrect layout.

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm (184685 => 184686)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2015-05-21 01:28:31 UTC (rev 184685)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2015-05-21 01:30:18 UTC (rev 184686)
@@ -147,35 +147,7 @@
 #endif
 }
 
-String WebProcessPool::platformDefaultApplicationCacheDirectory() const
-{
-    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 (applicationIsMobileSafari() || applicationIsWebApp())
-        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]);
-}
-
-#if PLATFORM(IOS)
 String WebProcessPool::cookieStorageDirectory() const
 {
     String path = pathForProcessContainer();
@@ -392,7 +364,34 @@
     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 (applicationIsMobileSafari() || applicationIsWebApp())
+        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::platformDefaultIconDatabasePath() const
 {
     // FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String.

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (184685 => 184686)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2015-05-21 01:28:31 UTC (rev 184685)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2015-05-21 01:30:18 UTC (rev 184686)
@@ -130,11 +130,13 @@
     return processPools();
 }
 
-static WebsiteDataStore::Configuration websiteDataStoreConfiguration(API::ProcessPoolConfiguration& processPoolConfiguration)
+static WebsiteDataStore::Configuration legacyWebsiteDataStoreConfiguration(API::ProcessPoolConfiguration& processPoolConfiguration)
 {
     WebsiteDataStore::Configuration configuration;
 
     configuration.localStorageDirectory = processPoolConfiguration.localStorageDirectory();
+    configuration.webSQLDatabaseDirectory = processPoolConfiguration.webSQLDatabaseDirectory();
+    configuration.applicationCacheDirectory = WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory();
 
     return configuration;
 }
@@ -158,7 +160,7 @@
     , m_diskCacheSizeOverride(m_configuration->diskCacheSizeOverride())
     , m_memorySamplerEnabled(false)
     , m_memorySamplerInterval(1400.0)
-    , m_websiteDataStore(m_configuration->shouldHaveLegacyDataStore() ? API::WebsiteDataStore::create(websiteDataStoreConfiguration(m_configuration)) : nullptr)
+    , m_websiteDataStore(m_configuration->shouldHaveLegacyDataStore() ? API::WebsiteDataStore::create(legacyWebsiteDataStoreConfiguration(m_configuration)) : nullptr)
 #if USE(SOUP)
     , m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain)
 #endif
@@ -1170,7 +1172,7 @@
     if (!m_overrideApplicationCacheDirectory.isEmpty())
         return m_overrideApplicationCacheDirectory;
 
-    return platformDefaultApplicationCacheDirectory();
+    return legacyPlatformDefaultApplicationCacheDirectory();
 }
 
 void WebProcessPool::setIconDatabasePath(const String& path)

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (184685 => 184686)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2015-05-21 01:28:31 UTC (rev 184685)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2015-05-21 01:30:18 UTC (rev 184686)
@@ -364,6 +364,7 @@
     static String legacyPlatformDefaultIndexedDBDatabaseDirectory();
     static String legacyPlatformDefaultWebSQLDatabaseDirectory();
     static String legacyPlatformDefaultMediaKeysStorageDirectory();
+    static String legacyPlatformDefaultApplicationCacheDirectory();
 
 private:
     void platformInitialize();
@@ -394,7 +395,6 @@
     void languageChanged();
 
     String applicationCacheDirectory() const;
-    String platformDefaultApplicationCacheDirectory() const;
 
     String platformDefaultIconDatabasePath() const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to