Title: [175038] releases/WebKitGTK/webkit-2.4/Source/WebKit2
Revision
175038
Author
[email protected]
Date
2014-10-22 03:12:54 -0700 (Wed, 22 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.4/Source/WebKit2/ChangeLog (175037 => 175038)


--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/ChangeLog	2014-10-22 10:11:58 UTC (rev 175037)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/ChangeLog	2014-10-22 10:12:54 UTC (rev 175038)
@@ -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-05  Lorenzo Tilve  <[email protected]>
 
         [GTK] Fix build when DRAG_SUPPORT is disabled

Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp (175037 => 175038)


--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp	2014-10-22 10:11:58 UTC (rev 175037)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp	2014-10-22 10:12:54 UTC (rev 175038)
@@ -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.4/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (175037 => 175038)


--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp	2014-10-22 10:11:58 UTC (rev 175037)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp	2014-10-22 10:12:54 UTC (rev 175038)
@@ -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