Title: [218759] trunk/Source/WebKit2
Revision
218759
Author
[email protected]
Date
2017-06-23 13:43:41 -0700 (Fri, 23 Jun 2017)

Log Message

LibWebRTCSocketClient should not destroy its socket within signalClose callback
https://bugs.webkit.org/show_bug.cgi?id=173739

Patch by Youenn Fablet <[email protected]> on 2017-06-23
Reviewed by Brent Fulgham.

* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::signalClose): Destroy 'this' asynchronously to make the caller of signalClose valid until it is not used.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218758 => 218759)


--- trunk/Source/WebKit2/ChangeLog	2017-06-23 20:12:05 UTC (rev 218758)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-23 20:43:41 UTC (rev 218759)
@@ -1,3 +1,13 @@
+2017-06-23  Youenn Fablet  <[email protected]>
+
+        LibWebRTCSocketClient should not destroy its socket within signalClose callback
+        https://bugs.webkit.org/show_bug.cgi?id=173739
+
+        Reviewed by Brent Fulgham.
+
+        * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
+        (WebKit::LibWebRTCSocketClient::signalClose): Destroy 'this' asynchronously to make the caller of signalClose valid until it is not used.
+
 2017-06-23  Chris Dumez  <[email protected]>
 
         Fix typo in WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() naming

Modified: trunk/Source/WebKit2/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp (218758 => 218759)


--- trunk/Source/WebKit2/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp	2017-06-23 20:12:05 UTC (rev 218758)
+++ trunk/Source/WebKit2/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp	2017-06-23 20:43:41 UTC (rev 218759)
@@ -136,7 +136,9 @@
     m_rtcProvider.sendFromMainThread([identifier = m_identifier, error](IPC::Connection& connection) {
         connection.send(Messages::WebRTCSocket::SignalClose(error), identifier);
     });
-    m_rtcProvider.takeSocket(m_identifier);
+    // We want to remove 'this' from the socket map now but we will destroy it asynchronously
+    // so that the socket parameter of signalClose remains alive as the caller of signalClose may actually being using it afterwards.
+    m_rtcProvider.callOnRTCNetworkThread([socket = m_rtcProvider.takeSocket(m_identifier)] { });
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to