The problem is that WebProcess::platformTerminate(), where the cache is currently dumped, is not always called for the reasons explained here https://bugs.webkit.org/show_bug.cgi?id=94783. 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 mina loop quits.
Created attachment 165647 [details] Patch
Comment on attachment 165647 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=165647&action=review > Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp:107 > + soup_cache_flush(soupCache); > + soup_cache_dump(soupCache); > + g_object_unref(soupCache); > + I'm surprised that g_object_unref doesn't flush and dump the cache as a side-effect. Maybe Dan or Sergio can comment on that? If that's the case, we can just call g_object_unref here. > Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp:90 > + soup_cache_flush(soupCache.get()); > + soup_cache_dump(soupCache.get()); > + Assuming that the soup cache destructor takes care of this, this could just become: soupCache = nullptr; And with a comment explaining why it's important to do that.
(In reply to comment #2) > (From update of attachment 165647 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=165647&action=review > > > Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp:107 > > + soup_cache_flush(soupCache); > > + soup_cache_dump(soupCache); > > + g_object_unref(soupCache); > > + > > I'm surprised that g_object_unref doesn't flush and dump the cache as a side-effect. Maybe Dan or Sergio can comment on that? If that's the case, we can just call g_object_unref here. No, finalize() only frees the internal hash table, but the cache needs to be flushed and dumped manually. Serio told me it's expected to be done when the process finishes and the cache is not going to be used more, because there isn't a way to block the cache while flush/dump.
Committed r129541: <http://trac.webkit.org/changeset/129541>