Title: [245913] trunk/Source/WebKit
Revision
245913
Author
[email protected]
Date
2019-05-30 17:08:04 -0700 (Thu, 30 May 2019)

Log Message

REGRESSION (r245873) [Mac WK2] Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash after running new test
https://bugs.webkit.org/show_bug.cgi?id=198379
<rdar://problem/51264361>

Reviewed by Alex Christensen.

This case can happen when network process is crashing.
Given the WebSWClientConnection may be kept alive, it might reregister itself but in that case will never be unregistered.
Remove the WebSWClientConnection from the NetworkProcessConnection corresponding map on destruction time.
Covered by no longer crashing tests.

* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::removeSWClientConnection):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::~WebSWClientConnection):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (245912 => 245913)


--- trunk/Source/WebKit/ChangeLog	2019-05-31 00:02:59 UTC (rev 245912)
+++ trunk/Source/WebKit/ChangeLog	2019-05-31 00:08:04 UTC (rev 245913)
@@ -1,3 +1,22 @@
+2019-05-30  Youenn Fablet  <[email protected]>
+
+        REGRESSION (r245873) [Mac WK2] Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash after running new test
+        https://bugs.webkit.org/show_bug.cgi?id=198379
+        <rdar://problem/51264361>
+
+        Reviewed by Alex Christensen.
+
+        This case can happen when network process is crashing.
+        Given the WebSWClientConnection may be kept alive, it might reregister itself but in that case will never be unregistered.
+        Remove the WebSWClientConnection from the NetworkProcessConnection corresponding map on destruction time.
+        Covered by no longer crashing tests.
+
+        * WebProcess/Network/NetworkProcessConnection.cpp:
+        (WebKit::NetworkProcessConnection::removeSWClientConnection):
+        * WebProcess/Network/NetworkProcessConnection.h:
+        * WebProcess/Storage/WebSWClientConnection.cpp:
+        (WebKit::WebSWClientConnection::~WebSWClientConnection):
+
 2019-05-30  Chris Dumez  <[email protected]>
 
         Network process crash when decoding SecItemResponseData

Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp (245912 => 245913)


--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp	2019-05-31 00:02:59 UTC (rev 245912)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp	2019-05-31 00:08:04 UTC (rev 245913)
@@ -265,6 +265,12 @@
     }).iterator->value;
 }
 
+void NetworkProcessConnection::removeSWClientConnection(WebSWClientConnection& connection)
+{
+    ASSERT(m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier()));
+    m_swConnectionsByIdentifier.remove(connection.serverConnectionIdentifier());
+}
+
 SWServerConnectionIdentifier NetworkProcessConnection::initializeSWClientConnection(WebSWClientConnection& connection)
 {
     SWServerConnectionIdentifier identifier;

Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h (245912 => 245913)


--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h	2019-05-31 00:02:59 UTC (rev 245912)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h	2019-05-31 00:08:04 UTC (rev 245913)
@@ -77,6 +77,7 @@
     WebSWClientConnection& serviceWorkerConnectionForSession(PAL::SessionID);
 
     WebCore::SWServerConnectionIdentifier initializeSWClientConnection(WebSWClientConnection&);
+    void removeSWClientConnection(WebSWClientConnection&);
 #endif
 
 private:

Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp (245912 => 245913)


--- trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp	2019-05-31 00:02:59 UTC (rev 245912)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp	2019-05-31 00:08:04 UTC (rev 245913)
@@ -62,6 +62,8 @@
 
 WebSWClientConnection::~WebSWClientConnection()
 {
+    if (m_connection)
+        WebProcess::singleton().ensureNetworkProcessConnection().removeSWClientConnection(*this);
 }
 
 void WebSWClientConnection::initializeConnectionIfNeeded()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to