Title: [174644] releases/WebKitGTK/webkit-2.6/Source/WebKit2
Revision
174644
Author
[email protected]
Date
2014-10-13 02:19:44 -0700 (Mon, 13 Oct 2014)

Log Message

Merge r174639 - [SOUP] [WK2] WebProcess and NetworkProcess initialization clears cache contents
https://bugs.webkit.org/show_bug.cgi?id=137489

Reviewed by Carlos Garcia Campos.

Temporarily set the SoupCache's maximum size to a huge value
before calling soup_cache_load() so that the cache is not shrinked
to the default value.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog (174643 => 174644)


--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog	2014-10-13 08:44:24 UTC (rev 174643)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/ChangeLog	2014-10-13 09:19:44 UTC (rev 174644)
@@ -1,3 +1,19 @@
+2014-10-12  Sergio Villar Senin  <[email protected]>
+
+        [SOUP] [WK2] WebProcess and NetworkProcess initialization clears cache contents
+        https://bugs.webkit.org/show_bug.cgi?id=137489
+
+        Reviewed by Carlos Garcia Campos.
+
+        Temporarily set the SoupCache's maximum size to a huge value
+        before calling soup_cache_load() so that the cache is not shrinked
+        to the default value.
+
+        * NetworkProcess/soup/NetworkProcessSoup.cpp:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        * WebProcess/soup/WebProcessSoup.cpp:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2014-10-08  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Make forwarding headers generation depend on source code

Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp (174643 => 174644)


--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp	2014-10-13 08:44:24 UTC (rev 174643)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp	2014-10-13 09:19:44 UTC (rev 174644)
@@ -85,7 +85,12 @@
     ASSERT(!parameters.diskCacheDirectory.isEmpty());
     GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(parameters.diskCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER));
     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().
+    unsigned initialMaxSize = soup_cache_get_max_size(soupCache.get());
+    soup_cache_set_max_size(soupCache.get(), G_MAXUINT);
     soup_cache_load(soupCache.get());
+    soup_cache_set_max_size(soupCache.get(), initialMaxSize);
 
     if (!parameters.cookiePersistentStoragePath.isEmpty()) {
         supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath,

Modified: releases/WebKitGTK/webkit-2.6/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (174643 => 174644)


--- releases/WebKitGTK/webkit-2.6/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp	2014-10-13 08:44:24 UTC (rev 174643)
+++ releases/WebKitGTK/webkit-2.6/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp	2014-10-13 09:19:44 UTC (rev 174644)
@@ -159,7 +159,12 @@
     ASSERT(!parameters.diskCacheDirectory.isEmpty());
     GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(parameters.diskCacheDirectory.utf8().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().
+    unsigned initialMaxSize = soup_cache_get_max_size(soupCache.get());
+    soup_cache_set_max_size(soupCache.get(), G_MAXUINT);
     soup_cache_load(soupCache.get());
+    soup_cache_set_max_size(soupCache.get(), initialMaxSize);
 
     if (!parameters.cookiePersistentStoragePath.isEmpty()) {
         supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to