Title: [185317] trunk/Source/WebKit2
- Revision
- 185317
- Author
- [email protected]
- Date
- 2015-06-08 08:59:14 -0700 (Mon, 08 Jun 2015)
Log Message
REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
https://bugs.webkit.org/show_bug.cgi?id=145751
Reviewed by Darin Adler.
In r185251 the CFNetwork cache was disabled in the web process,
but it also removed the disk cache directory web process
initialization parameter. While we support networking in the web
process when shared secondary process model is used, the network
cache should still work. We can remove this if we eventually
switch to use the network process unconditionally.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
(WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
* Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (185316 => 185317)
--- trunk/Source/WebKit2/ChangeLog 2015-06-08 14:36:47 UTC (rev 185316)
+++ trunk/Source/WebKit2/ChangeLog 2015-06-08 15:59:14 UTC (rev 185317)
@@ -1,3 +1,26 @@
+2015-06-08 Carlos Garcia Campos <[email protected]>
+
+ REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
+ https://bugs.webkit.org/show_bug.cgi?id=145751
+
+ Reviewed by Darin Adler.
+
+ In r185251 the CFNetwork cache was disabled in the web process,
+ but it also removed the disk cache directory web process
+ initialization parameter. While we support networking in the web
+ process when shared secondary process model is used, the network
+ cache should still work. We can remove this if we eventually
+ switch to use the network process unconditionally.
+
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
+ (WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
+ * Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
+ * UIProcess/gtk/WebProcessPoolGtk.cpp:
+ (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
+ * WebProcess/soup/WebProcessSoup.cpp:
+ (WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
+
2015-06-08 Csaba Osztrogonác <[email protected]>
[GTK] Remove the unused scroll function from WebPageGtk.cpp
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (185316 => 185317)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp 2015-06-08 14:36:47 UTC (rev 185316)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp 2015-06-08 15:59:14 UTC (rev 185317)
@@ -96,6 +96,7 @@
#endif
encoder << urlSchemesRegisteredForCustomProtocols;
#if USE(SOUP)
+ encoder << diskCacheDirectory;
encoder << cookiePersistentStoragePath;
encoder << cookiePersistentStorageType;
encoder.encodeEnum(cookieAcceptPolicy);
@@ -217,6 +218,8 @@
if (!decoder.decode(parameters.urlSchemesRegisteredForCustomProtocols))
return false;
#if USE(SOUP)
+ if (!decoder.decode(parameters.diskCacheDirectory))
+ return false;
if (!decoder.decode(parameters.cookiePersistentStoragePath))
return false;
if (!decoder.decode(parameters.cookiePersistentStorageType))
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (185316 => 185317)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2015-06-08 14:36:47 UTC (rev 185316)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2015-06-08 15:59:14 UTC (rev 185317)
@@ -101,6 +101,7 @@
#endif
Vector<String> urlSchemesRegisteredForCustomProtocols;
#if USE(SOUP)
+ String diskCacheDirectory;
String cookiePersistentStoragePath;
uint32_t cookiePersistentStorageType;
HTTPCookieAcceptPolicy cookieAcceptPolicy;
Modified: trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp (185316 => 185317)
--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp 2015-06-08 14:36:47 UTC (rev 185316)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp 2015-06-08 15:59:14 UTC (rev 185317)
@@ -28,6 +28,7 @@
#include "config.h"
#include "WebProcessPool.h"
+#include "APIProcessPoolConfiguration.h"
#include "Logging.h"
#include "WebCookieManagerProxy.h"
#include "WebInspectorServer.h"
@@ -105,6 +106,7 @@
parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
parameters.ignoreTLSErrors = m_ignoreTLSErrors;
+ parameters.diskCacheDirectory = m_configuration->diskCacheDirectory();
}
}
Modified: trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (185316 => 185317)
--- trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp 2015-06-08 14:36:47 UTC (rev 185316)
+++ trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp 2015-06-08 15:59:14 UTC (rev 185317)
@@ -31,7 +31,6 @@
#include "SeccompFiltersWebProcessEfl.h"
#endif
-#include "APIProcessPoolConfiguration.h"
#include "CertificateInfo.h"
#include "WebCookieManager.h"
#include "WebProcessCreationParameters.h"
@@ -136,16 +135,20 @@
if (usesNetworkProcess())
return;
- auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
+ ASSERT(!parameters.diskCacheDirectory.isEmpty());
- ASSERT(!configuration->diskCacheDirectory().isEmpty());
-
// We used to use the given cache directory for the soup cache, but now we use a subdirectory to avoid
// conflicts with other cache files in the same directory. Remove the old cache files if they still exist.
- WebCore::SoupNetworkSession::defaultSession().clearCache(configuration->diskCacheDirectory());
+ WebCore::SoupNetworkSession::defaultSession().clearCache(WebCore::directoryName(parameters.diskCacheDirectory));
- String diskCachePath = WebCore::pathByAppendingComponent(configuration->diskCacheDirectory(), "webkit");
- GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(diskCachePath.utf8().data(), SOUP_CACHE_SINGLE_USER));
+#if ENABLE(NETWORK_CACHE)
+ // When network cache is enabled, the disk cache directory is the network process one.
+ CString diskCachePath = WebCore::pathByAppendingComponent(WebCore::directoryName(parameters.diskCacheDirectory), "webkit").utf8();
+#else
+ CString diskCachePath = parameters.diskCacheDirectory.utf8();
+#endif
+
+ GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(diskCachePath.data(), SOUP_CACHE_SINGLE_USER));
WebCore::SoupNetworkSession::defaultSession().setCache(soupCache.get());
// Set an initial huge max_size for the SoupCache so the call to soup_cache_load() won't evict any cached
// resource. The final size of the cache will be set by NetworkProcess::platformSetCacheModel().
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes