WebsiteDataStore should clean up its storage in the network process when destroyed.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jul 2015 03:26:53 +0000 (03:26 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jul 2015 03:26:53 +0000 (03:26 +0000)
<https://webkit.org/b/147349>
<rdar://problem/21838764>

Reviewed by Darin Adler.

Have ~WebsiteDataStore() send a DestroyPrivateBrowsingSession message to all networking processes
for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
CFNetwork object graph.

This complements r187115 which did the same for network process storage owned by
API::Session objects.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::~WebsiteDataStore):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187478 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp

index e383d69..d45a80f 100644 (file)
@@ -1,3 +1,21 @@
+2015-07-27  Andreas Kling  <akling@apple.com>
+
+        WebsiteDataStore should clean up its storage in the network process when destroyed.
+        <https://webkit.org/b/147349>
+        <rdar://problem/21838764>
+
+        Reviewed by Darin Adler.
+
+        Have ~WebsiteDataStore() send a DestroyPrivateBrowsingSession message to all networking processes
+        for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
+        CFNetwork object graph.
+
+        This complements r187115 which did the same for network process storage owned by
+        API::Session objects.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::~WebsiteDataStore):
+
 2015-07-27  Tim Horton  <timothy_horton@apple.com>
 
         First in-window viewStateChange synchronously blocks despite not previously being in-window
index 0c89f59..92ed61e 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "APIProcessPoolConfiguration.h"
 #include "APIWebsiteDataRecord.h"
+#include "NetworkProcessMessages.h"
 #include "StorageManager.h"
 #include "WebProcessPool.h"
 #include "WebsiteData.h"
@@ -92,6 +93,13 @@ WebsiteDataStore::WebsiteDataStore(WebCore::SessionID sessionID)
 WebsiteDataStore::~WebsiteDataStore()
 {
     platformDestroy();
+
+#if ENABLE(NETWORK_PROCESS)
+    if (m_sessionID.isEphemeral()) {
+        for (auto& processPool : WebProcessPool::allProcessPools())
+            processPool->sendToNetworkingProcess(Messages::NetworkProcess::DestroyPrivateBrowsingSession(m_sessionID));
+    }
+#endif
 }
 
 void WebsiteDataStore::cloneSessionData(WebPageProxy& sourcePage, WebPageProxy& newPage)