Title: [129541] trunk/Source/WebKit2
Revision
129541
Author
[email protected]
Date
2012-09-25 12:30:20 -0700 (Tue, 25 Sep 2012)

Log Message

[GTK][EFL] Disk cache is never dumped to disk in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=97583

Reviewed by Martin Robinson.

The problem is that WebProcess::platformTerminate(), where the
cache is currently dumped, is not called when the web process
finishes because the UI process closes the connection. The cache
is created and loaded in the main() so it can also be flushed and
dumped there, so that we also make sure it's always called when
the process finishes normally when the main loop quits.

* WebProcess/efl/WebProcessMainEfl.cpp:
(WebKit::WebProcessMainEfl): Flush and dump the disk cache when
the main loop returns.
* WebProcess/gtk/WebProcessMainGtk.cpp:
(WebKit::WebProcessMainGtk): Ditto.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformTerminate): Do not flush and dump
the disk cache.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (129540 => 129541)


--- trunk/Source/WebKit2/ChangeLog	2012-09-25 19:21:23 UTC (rev 129540)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-25 19:30:20 UTC (rev 129541)
@@ -1,3 +1,26 @@
+2012-09-25  Carlos Garcia Campos  <[email protected]>
+
+        [GTK][EFL] Disk cache is never dumped to disk in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=97583
+
+        Reviewed by Martin Robinson.
+
+        The problem is that WebProcess::platformTerminate(), where the
+        cache is currently dumped, is not called when the web process
+        finishes because the UI process closes the connection. The cache
+        is created and loaded in the main() so it can also be flushed and
+        dumped there, so that we also make sure it's always called when
+        the process finishes normally when the main loop quits.
+
+        * WebProcess/efl/WebProcessMainEfl.cpp:
+        (WebKit::WebProcessMainEfl): Flush and dump the disk cache when
+        the main loop returns.
+        * WebProcess/gtk/WebProcessMainGtk.cpp:
+        (WebKit::WebProcessMainGtk): Ditto.
+        * WebProcess/soup/WebProcessSoup.cpp:
+        (WebKit::WebProcess::platformTerminate): Do not flush and dump
+        the disk cache.
+
 2012-09-25  Benjamin Poulain  <[email protected]>
 
         Add missing support for Geolocation tests on WebKit2

Modified: trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp (129540 => 129541)


--- trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp	2012-09-25 19:21:23 UTC (rev 129540)
+++ trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp	2012-09-25 19:30:20 UTC (rev 129541)
@@ -90,7 +90,6 @@
     SoupCache* soupCache = soup_cache_new(soupCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER);
     soup_session_add_feature(session, SOUP_SESSION_FEATURE(soupCache));
     soup_cache_load(soupCache);
-    g_object_unref(soupCache);
 
 #if USE(COORDINATED_GRAPHICS)
     CoordinatedGraphicsLayer::initFactory();
@@ -102,6 +101,10 @@
     WebProcess::shared().initialize(socket, RunLoop::main());
     RunLoop::run();
 
+    soup_cache_flush(soupCache);
+    soup_cache_dump(soupCache);
+    g_object_unref(soupCache);
+
     return 0;
 
 }

Modified: trunk/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp (129540 => 129541)


--- trunk/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp	2012-09-25 19:21:23 UTC (rev 129540)
+++ trunk/Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp	2012-09-25 19:30:20 UTC (rev 129541)
@@ -85,6 +85,9 @@
 
     RunLoop::run();
 
+    soup_cache_flush(soupCache.get());
+    soup_cache_dump(soupCache.get());
+
     return 0;
 }
 

Modified: trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (129540 => 129541)


--- trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp	2012-09-25 19:21:23 UTC (rev 129540)
+++ trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp	2012-09-25 19:30:20 UTC (rev 129541)
@@ -171,11 +171,6 @@
 
 void WebProcess::platformTerminate()
 {
-    SoupSession* session = WebCore::ResourceHandle::defaultSession();
-    SoupCache* cache = SOUP_CACHE(soup_session_get_feature(session, SOUP_TYPE_CACHE));
-    soup_cache_flush(cache);
-    soup_cache_dump(cache);
-
     WebCore::removeLanguageChangeObserver(this);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to