Title: [224438] trunk/Source/WebKit
Revision
224438
Author
[email protected]
Date
2017-11-03 16:02:16 -0700 (Fri, 03 Nov 2017)

Log Message

REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
https://bugs.webkit.org/show_bug.cgi?id=179123
<rdar://problem/35294685>

Reviewed by Geoffrey Garen.

Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
go away at there is no use keeping it running at this point. Also, this prevents
leaking the WebProcessPool since the WebProcessProxy holds a strong reference
to the WebProcessPool.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::disconnectProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (224437 => 224438)


--- trunk/Source/WebKit/ChangeLog	2017-11-03 22:49:17 UTC (rev 224437)
+++ trunk/Source/WebKit/ChangeLog	2017-11-03 23:02:16 UTC (rev 224438)
@@ -1,3 +1,19 @@
+2017-11-03  Chris Dumez  <[email protected]>
+
+        REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
+        https://bugs.webkit.org/show_bug.cgi?id=179123
+        <rdar://problem/35294685>
+
+        Reviewed by Geoffrey Garen.
+
+        Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
+        go away at there is no use keeping it running at this point. Also, this prevents
+        leaking the WebProcessPool since the WebProcessProxy holds a strong reference
+        to the WebProcessPool.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::disconnectProcess):
+
 2017-11-03  Youenn Fablet  <[email protected]>
 
         Implement Service Worker Matching Registration algorithm

Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.cpp (224437 => 224438)


--- trunk/Source/WebKit/StorageProcess/StorageProcess.cpp	2017-11-03 22:49:17 UTC (rev 224437)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.cpp	2017-11-03 23:02:16 UTC (rev 224438)
@@ -76,8 +76,16 @@
     return true;
 }
 
-void StorageProcess::didClose(IPC::Connection&)
+void StorageProcess::didClose(IPC::Connection& connection)
 {
+#if ENABLE(SERVICE_WORKER)
+    if (m_workerContextProcessConnection == &connection) {
+        m_workerContextProcessConnection = nullptr;
+        return;
+    }
+#else
+    UNUSED_PARAM(connection);
+#endif
     stopRunLoop();
 }
 

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (224437 => 224438)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2017-11-03 22:49:17 UTC (rev 224437)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2017-11-03 23:02:16 UTC (rev 224438)
@@ -935,6 +935,15 @@
     if (m_processesUsingGamepads.contains(process))
         processStoppedUsingGamepads(*process);
 #endif
+
+#if ENABLE(SERVICE_WORKER)
+    // FIXME: We should do better than this. For now, we just destroy the ServiceWorker process
+    // whenever there is no regular WebContent process remaining.
+    if (m_processes.size() == 1 && m_processes[0] == m_serviceWorkerProcess) {
+        m_serviceWorkerProcess = nullptr;
+        m_processes.clear();
+    }
+#endif
 }
 
 WebProcessProxy& WebProcessPool::createNewWebProcessRespectingProcessCountLimit(WebsiteDataStore& websiteDataStore)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to