Title: [250726] trunk
Revision
250726
Author
[email protected]
Date
2019-10-04 09:30:17 -0700 (Fri, 04 Oct 2019)

Log Message

Allow to suspend RTCPeerConnection when not connected
https://bugs.webkit.org/show_bug.cgi?id=202403

Reviewed by Chris Dumez.

Source/ThirdParty/libwebrtc:

Export rtc::TimeMillis()

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
which suspends/resumes its socket factory.

We allow suspension when the connection is not connected.
Pages with connected connections will not go in page cache yet.

Tests: webrtc/datachannel/datachannel-page-cache-send.html
       webrtc/datachannel/datachannel-page-cache.html

* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::suspend):
(WebCore::PeerConnectionBackend::resume):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
(WebCore::RTCPeerConnection::suspend):
(WebCore::RTCPeerConnection::resume):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::suspend):
(WebCore::LibWebRTCMediaEndpoint::resume):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::suspend):
(WebCore::LibWebRTCPeerConnectionBackend::resume):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

Source/WebKit:

Implement suspend/resume of sockets by doing the following:
- For UDP sockets, we simulate as if being sent data is queued when being suspended.
the webrtc backend will then stop sending packets until the queue is emptied.
At resume time, we do as if the queue is emptied and packets sent (even though packets are not sent).
For incoming traffic, we ignore it when being suspended.
- For TCP sockets, we close them at suspend time. We then notify at resume time that an error happeneded
for these sockets to the webrtc backend. We cannot simulate packet dropping like in the UDP case.

To manage resume/suspend, each socket now has a isSuspended state and a socket group.
The socket group is per peer connection.
A peer connection will notify the factory that it is suspended/resumed.
The factory will iterate through all sockets and will suspend/resume each socket of the socket group.

* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::RTCSocketFactory::RTCSocketFactory):
(WebKit::RTCSocketFactory::CreateUdpSocket):
(WebKit::RTCSocketFactory::CreateServerTcpSocket):
(WebKit::RTCSocketFactory::CreateClientTcpSocket):
(WebKit::RTCSocketFactory::CreateAsyncResolver):
(WebKit::RTCSocketFactory::suspend):
(WebKit::RTCSocketFactory::resume):
(WebKit::LibWebRTCProvider::createSocketFactory):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::LibWebRTCSocket):
(WebKit::LibWebRTCSocket::~LibWebRTCSocket):
(WebKit::LibWebRTCSocket::signalReadPacket):
(WebKit::LibWebRTCSocket::signalSentPacket):
(WebKit::LibWebRTCSocket::SendTo):
(WebKit::LibWebRTCSocket::Close):
(WebKit::LibWebRTCSocket::SetOption):
(WebKit::LibWebRTCSocket::resume):
(WebKit::LibWebRTCSocket::suspend):
* WebProcess/Network/webrtc/LibWebRTCSocket.h:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
(WebKit::LibWebRTCSocketFactory::createUdpSocket):
(WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
(WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
(WebKit::LibWebRTCSocketFactory::addSocket):
(WebKit::LibWebRTCSocketFactory::removeSocket):
(WebKit::LibWebRTCSocketFactory::forSocketInGroup):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

LayoutTests:

* webrtc/datachannel/datachannel-page-cache-expected.txt: Added.
* webrtc/datachannel/datachannel-page-cache-send-expected.txt: Added.
* webrtc/datachannel/datachannel-page-cache-send.html: Added.
* webrtc/datachannel/datachannel-page-cache.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250725 => 250726)


--- trunk/LayoutTests/ChangeLog	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/LayoutTests/ChangeLog	2019-10-04 16:30:17 UTC (rev 250726)
@@ -1,3 +1,15 @@
+2019-10-04  youenn fablet  <[email protected]>
+
+        Allow to suspend RTCPeerConnection when not connected
+        https://bugs.webkit.org/show_bug.cgi?id=202403
+
+        Reviewed by Chris Dumez.
+
+        * webrtc/datachannel/datachannel-page-cache-expected.txt: Added.
+        * webrtc/datachannel/datachannel-page-cache-send-expected.txt: Added.
+        * webrtc/datachannel/datachannel-page-cache-send.html: Added.
+        * webrtc/datachannel/datachannel-page-cache.html: Added.
+
 2019-10-04  Chris Lord  <[email protected]>
 
         Import 2dcontext Web Platform Tests

Added: trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-expected.txt (0 => 250726)


--- trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-expected.txt	2019-10-04 16:30:17 UTC (rev 250726)
@@ -0,0 +1,3 @@
+
+PASS datachannel-page-cache 
+

Added: trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-send-expected.txt (0 => 250726)


--- trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-send-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-send-expected.txt	2019-10-04 16:30:17 UTC (rev 250726)
@@ -0,0 +1,3 @@
+
+PASS datachannel-page-cache-send 
+

Added: trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-send.html (0 => 250726)


--- trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-send.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache-send.html	2019-10-04 16:30:17 UTC (rev 250726)
@@ -0,0 +1,43 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<script>
+t = async_test();
+
+const pc1 = new RTCPeerConnection();
+const pc2 = new RTCPeerConnection();
+
+pc1._onicecandidate_ = (e) => pc2.addIceCandidate(e.candidate);
+pc2._onicecandidate_ = (e) => pc1.addIceCandidate(e.candidate);
+pc2._ondatachannel_ = (e) =>  { e.channel._onmessage_ = t.done(); };
+
+window.addEventListener("pageshow", async function(event) {
+    if (!event.persisted)
+        return;
+
+    const answer = await pc2.createAnswer();
+    await pc2.setLocalDescription(answer);
+    await pc1.setRemoteDescription(answer);
+});
+
+window.addEventListener("pagehide", t.step_func((event) => {
+    if (!event.persisted)
+        assert_uneached("Page failed to enter page cache");
+}));
+
+_onload_ = () => {
+    setTimeout(async () => {
+        localChannel = pc1.createDataChannel("test");
+        localChannel._onopen_ = () => localChannel.send("ok");
+
+        const offer = await pc1.createOffer();
+        await pc1.setLocalDescription(offer);
+        await pc2.setRemoteDescription(offer);
+        window.location = "../../fast/history/resources/page-cache-helper.html";
+    }, 0);
+};
+</script>
+</html>

Added: trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache.html (0 => 250726)


--- trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/datachannel-page-cache.html	2019-10-04 16:30:17 UTC (rev 250726)
@@ -0,0 +1,30 @@
+<!-- webkit-test-runner [ enablePageCache=true ] -->
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<script>
+t = async_test();
+
+window.addEventListener("pageshow", function(event) {
+    if (event.persisted)
+        t.done();
+});
+
+window.addEventListener("pagehide", t.step_func((event) => {
+    if (!event.persisted)
+        assert_uneached("Page failed to enter page cache");
+}));
+
+_onload_ = () => {
+    setTimeout(async () => {
+        const pc = new RTCPeerConnection();
+        const channel = pc.createDataChannel("test");
+        const offer = await pc.createOffer();
+        await pc.setLocalDescription(offer);
+        window.location = "../../fast/history/resources/page-cache-helper.html";
+    }, 0);
+};
+</script>
+</html>

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (250725 => 250726)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2019-10-04 16:30:17 UTC (rev 250726)
@@ -1,3 +1,16 @@
+2019-10-04  youenn fablet  <[email protected]>
+
+        Allow to suspend RTCPeerConnection when not connected
+        https://bugs.webkit.org/show_bug.cgi?id=202403
+
+        Reviewed by Chris Dumez.
+
+        Export rtc::TimeMillis()
+
+        * Configurations/libwebrtc.iOS.exp:
+        * Configurations/libwebrtc.iOSsim.exp:
+        * Configurations/libwebrtc.mac.exp:
+
 2019-09-11  Youenn Fablet  <[email protected]>
 
         Disable DTLS1.0

Modified: trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp (250725 => 250726)


--- trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -13,6 +13,7 @@
 __ZN3rtc6Thread7SleepMsEi
 __ZN3rtc8LocationC1EPKcS2_
 __ZN3rtc8LocationC1Ev
+__ZN3rtc10TimeMillisEv
 __ZN6webrtc10I420Buffer12MutableDataUEv
 __ZN6webrtc10I420Buffer12MutableDataVEv
 __ZN6webrtc10I420Buffer12MutableDataYEv

Modified: trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp (250725 => 250726)


--- trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -13,6 +13,7 @@
 __ZN3rtc6Thread7SleepMsEi
 __ZN3rtc8LocationC1EPKcS2_
 __ZN3rtc8LocationC1Ev
+__ZN3rtc10TimeMillisEv
 __ZN6webrtc10I420Buffer12MutableDataUEv
 __ZN6webrtc10I420Buffer12MutableDataVEv
 __ZN6webrtc10I420Buffer12MutableDataYEv

Modified: trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp (250725 => 250726)


--- trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -13,6 +13,7 @@
 __ZN3rtc6Thread7SleepMsEi
 __ZN3rtc8LocationC1EPKcS2_
 __ZN3rtc8LocationC1Ev
+__ZN3rtc10TimeMillisEv
 __ZN6webrtc10I420Buffer12MutableDataUEv
 __ZN6webrtc10I420Buffer12MutableDataVEv
 __ZN6webrtc10I420Buffer12MutableDataYEv

Modified: trunk/Source/WebCore/ChangeLog (250725 => 250726)


--- trunk/Source/WebCore/ChangeLog	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/ChangeLog	2019-10-04 16:30:17 UTC (rev 250726)
@@ -1,3 +1,36 @@
+2019-10-04  youenn fablet  <[email protected]>
+
+        Allow to suspend RTCPeerConnection when not connected
+        https://bugs.webkit.org/show_bug.cgi?id=202403
+
+        Reviewed by Chris Dumez.
+
+        Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
+        which suspends/resumes its socket factory.
+
+        We allow suspension when the connection is not connected.
+        Pages with connected connections will not go in page cache yet.
+
+        Tests: webrtc/datachannel/datachannel-page-cache-send.html
+               webrtc/datachannel/datachannel-page-cache.html
+
+        * Modules/mediastream/PeerConnectionBackend.h:
+        (WebCore::PeerConnectionBackend::suspend):
+        (WebCore::PeerConnectionBackend::resume):
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
+        (WebCore::RTCPeerConnection::suspend):
+        (WebCore::RTCPeerConnection::resume):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::suspend):
+        (WebCore::LibWebRTCMediaEndpoint::resume):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::LibWebRTCPeerConnectionBackend::suspend):
+        (WebCore::LibWebRTCPeerConnectionBackend::resume):
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
+
 2019-10-04  Truitt Savell  <[email protected]>
 
         Unreviewed, rolling out r250583.

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (250725 => 250726)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -172,6 +172,9 @@
     ScriptExecutionContext* context() const;
     RTCRtpTransceiver* transceiverFromSender(const RTCRtpSender&);
 
+    virtual void suspend() { }
+    virtual void resume() { }
+
 protected:
     void fireICECandidateEvent(RefPtr<RTCIceCandidate>&&, String&& url);
     void doneGatheringCandidates();

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (250725 => 250726)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -497,10 +497,10 @@
     return "RTCPeerConnection";
 }
 
-// FIXME: We should do better here, it is way too easy to prevent PageCache.
 bool RTCPeerConnection::canSuspendForDocumentSuspension() const
 {
-    return !hasPendingActivity();
+    // FIXME: Evaluate whether to extend this to connected cases as well.
+    return m_iceConnectionState != RTCIceConnectionState::Completed && m_iceConnectionState != RTCIceConnectionState::Connected;
 }
 
 void RTCPeerConnection::suspend(ReasonForSuspension reason)
@@ -509,6 +509,7 @@
         return;
 
     m_shouldDelayTasks = true;
+    m_backend->suspend();
 }
 
 void RTCPeerConnection::resume()
@@ -517,6 +518,8 @@
         return;
 
     m_shouldDelayTasks = false;
+    m_backend->resume();
+
     scriptExecutionContext()->postTask([this, protectedThis = makeRef(*this)](auto&) {
         if (m_isStopped || m_shouldDelayTasks)
             return;

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (250725 => 250726)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -98,6 +98,18 @@
     return m_backend->SetConfiguration(WTFMove(configuration));
 }
 
+void LibWebRTCMediaEndpoint::suspend()
+{
+    if (m_rtcSocketFactory)
+        m_rtcSocketFactory->suspend();
+}
+
+void LibWebRTCMediaEndpoint::resume()
+{
+    if (m_rtcSocketFactory)
+        m_rtcSocketFactory->resume();
+}
+
 static inline const char* sessionDescriptionType(RTCSdpType sdpType)
 {
     switch (sdpType) {

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h (250725 => 250726)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -113,6 +113,9 @@
     void setSenderSourceFromTrack(LibWebRTCRtpSenderBackend&, MediaStreamTrack&);
     void collectTransceivers();
 
+    void suspend();
+    void resume();
+
 private:
     LibWebRTCMediaEndpoint(LibWebRTCPeerConnectionBackend&, LibWebRTCProvider&);
 
@@ -198,7 +201,7 @@
 
     HashMap<String, rtc::scoped_refptr<webrtc::MediaStreamInterface>> m_localStreams;
 
-    std::unique_ptr<rtc::PacketSocketFactory> m_rtcSocketFactory;
+    std::unique_ptr<LibWebRTCProvider::SuspendableSocketFactory> m_rtcSocketFactory;
 #if !RELEASE_LOG_DISABLED
     int64_t m_statsFirstDeliveredTimestamp { 0 };
     Ref<const Logger> m_logger;

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (250725 => 250726)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -90,6 +90,16 @@
 
 LibWebRTCPeerConnectionBackend::~LibWebRTCPeerConnectionBackend() = default;
 
+void LibWebRTCPeerConnectionBackend::suspend()
+{
+    m_endpoint->suspend();
+}
+
+void LibWebRTCPeerConnectionBackend::resume()
+{
+    m_endpoint->resume();
+}
+
 static inline webrtc::PeerConnectionInterface::BundlePolicy bundlePolicyfromConfiguration(const MediaEndpointConfiguration& configuration)
 {
     switch (configuration.bundlePolicy) {

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h (250725 => 250726)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -124,6 +124,9 @@
 
     Ref<RTCRtpReceiver> createReceiverForSource(Ref<RealtimeMediaSource>&&, std::unique_ptr<RTCRtpReceiverBackend>&&);
 
+    void suspend() final;
+    void resume() final;
+
     Ref<LibWebRTCMediaEndpoint> m_endpoint;
     bool m_isLocalDescriptionSet { false };
     bool m_isRemoteDescriptionSet { false };

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h (250725 => 250726)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -119,7 +119,13 @@
     void setEnableWebRTCEncryption(bool);
     void setUseDTLS10(bool);
 
-    virtual std::unique_ptr<rtc::PacketSocketFactory> createSocketFactory(String&& /* userAgent */) { return nullptr; }
+    class SuspendableSocketFactory : public rtc::PacketSocketFactory {
+    public:
+        virtual ~SuspendableSocketFactory() = default;
+        virtual void suspend() { };
+        virtual void resume() { };
+    };
+    virtual std::unique_ptr<SuspendableSocketFactory> createSocketFactory(String&& /* userAgent */) { return nullptr; }
 
 protected:
     LibWebRTCProvider() = default;

Modified: trunk/Source/WebKit/ChangeLog (250725 => 250726)


--- trunk/Source/WebKit/ChangeLog	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/ChangeLog	2019-10-04 16:30:17 UTC (rev 250726)
@@ -1,3 +1,54 @@
+2019-10-04  youenn fablet  <[email protected]>
+
+        Allow to suspend RTCPeerConnection when not connected
+        https://bugs.webkit.org/show_bug.cgi?id=202403
+
+        Reviewed by Chris Dumez.
+
+        Implement suspend/resume of sockets by doing the following:
+        - For UDP sockets, we simulate as if being sent data is queued when being suspended.
+        the webrtc backend will then stop sending packets until the queue is emptied.
+        At resume time, we do as if the queue is emptied and packets sent (even though packets are not sent).
+        For incoming traffic, we ignore it when being suspended.
+        - For TCP sockets, we close them at suspend time. We then notify at resume time that an error happeneded
+        for these sockets to the webrtc backend. We cannot simulate packet dropping like in the UDP case.
+
+        To manage resume/suspend, each socket now has a isSuspended state and a socket group.
+        The socket group is per peer connection.
+        A peer connection will notify the factory that it is suspended/resumed.
+        The factory will iterate through all sockets and will suspend/resume each socket of the socket group.
+
+        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
+        (WebKit::RTCSocketFactory::RTCSocketFactory):
+        (WebKit::RTCSocketFactory::CreateUdpSocket):
+        (WebKit::RTCSocketFactory::CreateServerTcpSocket):
+        (WebKit::RTCSocketFactory::CreateClientTcpSocket):
+        (WebKit::RTCSocketFactory::CreateAsyncResolver):
+        (WebKit::RTCSocketFactory::suspend):
+        (WebKit::RTCSocketFactory::resume):
+        (WebKit::LibWebRTCProvider::createSocketFactory):
+        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
+        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
+        (WebKit::LibWebRTCSocket::LibWebRTCSocket):
+        (WebKit::LibWebRTCSocket::~LibWebRTCSocket):
+        (WebKit::LibWebRTCSocket::signalReadPacket):
+        (WebKit::LibWebRTCSocket::signalSentPacket):
+        (WebKit::LibWebRTCSocket::SendTo):
+        (WebKit::LibWebRTCSocket::Close):
+        (WebKit::LibWebRTCSocket::SetOption):
+        (WebKit::LibWebRTCSocket::resume):
+        (WebKit::LibWebRTCSocket::suspend):
+        * WebProcess/Network/webrtc/LibWebRTCSocket.h:
+        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
+        (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
+        (WebKit::LibWebRTCSocketFactory::createUdpSocket):
+        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
+        (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
+        (WebKit::LibWebRTCSocketFactory::addSocket):
+        (WebKit::LibWebRTCSocketFactory::removeSocket):
+        (WebKit::LibWebRTCSocketFactory::forSocketInGroup):
+        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
+
 2019-10-04  Alex Christensen  <[email protected]>
 
         Simplify sandbox enabling macros

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp (250725 => 250726)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -65,43 +65,69 @@
     WebProcess::singleton().libWebRTCNetwork().mdnsRegister().registerMDNSName(documentIdentifier, ipAddress, WTFMove(callback));
 }
 
-class RTCSocketFactory final : public rtc::PacketSocketFactory {
+class RTCSocketFactory final : public LibWebRTCProvider::SuspendableSocketFactory {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit RTCSocketFactory(String&& userAgent)
-        : m_userAgent(WTFMove(userAgent))
-    {
-    }
+    explicit RTCSocketFactory(String&& userAgent);
 
 private:
-    rtc::AsyncPacketSocket* CreateUdpSocket(const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort) final
-    {
-        return factory().createUdpSocket(address, minPort, maxPort);
-    }
+    // SuspendableSocketFactory
+    rtc::AsyncPacketSocket* CreateUdpSocket(const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort) final;
+    rtc::AsyncPacketSocket* CreateServerTcpSocket(const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort, int options) final;
+    rtc::AsyncPacketSocket* CreateClientTcpSocket(const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, const rtc::ProxyInfo&, const std::string&, int options) final;
+    rtc::AsyncResolverInterface* CreateAsyncResolver() final;
+    void suspend() final;
+    void resume() final;
 
-    rtc::AsyncPacketSocket* CreateServerTcpSocket(const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort, int options) final
-    {
-        return factory().createServerTcpSocket(address, minPort, maxPort, options);
-    }
+private:
+    String m_userAgent;
+};
 
-    rtc::AsyncPacketSocket* CreateClientTcpSocket(const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, const rtc::ProxyInfo&, const std::string&, int options) final
-    {
-        return factory().createClientTcpSocket(localAddress, remoteAddress, String { m_userAgent }, options);
-    }
+RTCSocketFactory::RTCSocketFactory(String&& userAgent)
+    : m_userAgent(WTFMove(userAgent))
+{
+}
 
-    rtc::AsyncResolverInterface* CreateAsyncResolver() final
-    {
-        return factory().createAsyncResolver();
-    }
+rtc::AsyncPacketSocket* RTCSocketFactory::CreateUdpSocket(const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort)
+{
+    return WebProcess::singleton().libWebRTCNetwork().socketFactory().createUdpSocket(this, address, minPort, maxPort);
+}
 
-    LibWebRTCSocketFactory& factory() { return WebProcess::singleton().libWebRTCNetwork().socketFactory(); }
+rtc::AsyncPacketSocket* RTCSocketFactory::CreateServerTcpSocket(const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort, int options)
+{
+    return WebProcess::singleton().libWebRTCNetwork().socketFactory().createServerTcpSocket(this, address, minPort, maxPort, options);
+}
 
-private:
-    String m_userAgent;
-};
+rtc::AsyncPacketSocket* RTCSocketFactory::CreateClientTcpSocket(const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, const rtc::ProxyInfo&, const std::string&, int options)
+{
+    return WebProcess::singleton().libWebRTCNetwork().socketFactory().createClientTcpSocket(this, localAddress, remoteAddress, String { m_userAgent }, options);
+}
 
-std::unique_ptr<rtc::PacketSocketFactory> LibWebRTCProvider::createSocketFactory(String&& userAgent)
+rtc::AsyncResolverInterface* RTCSocketFactory::CreateAsyncResolver()
 {
+    return WebProcess::singleton().libWebRTCNetwork().socketFactory().createAsyncResolver();
+}
+
+void RTCSocketFactory::suspend()
+{
+    WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread([socketGroup = this] {
+        WebProcess::singleton().libWebRTCNetwork().socketFactory().forSocketInGroup(socketGroup, [](auto& socket) {
+            socket.suspend();
+        });
+    });
+}
+
+void RTCSocketFactory::resume()
+{
+    WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread([socketGroup = this] {
+        WebProcess::singleton().libWebRTCNetwork().socketFactory().forSocketInGroup(socketGroup, [](auto& socket) {
+            socket.resume();
+        });
+    });
+}
+
+std::unique_ptr<LibWebRTCProvider::SuspendableSocketFactory> LibWebRTCProvider::createSocketFactory(String&& userAgent)
+{
     return makeUnique<RTCSocketFactory>(WTFMove(userAgent));
 }
 

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.h (250725 => 250726)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -50,7 +50,7 @@
     LibWebRTCProvider() { m_useNetworkThreadWithSocketServer = false; }
 
 private:
-    std::unique_ptr<rtc::PacketSocketFactory> createSocketFactory(String&& /* userAgent */) final;
+    std::unique_ptr<SuspendableSocketFactory> createSocketFactory(String&& /* userAgent */) final;
 
     rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, rtc::PacketSocketFactory*, webrtc::PeerConnectionInterface::RTCConfiguration&&) final;
 

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp (250725 => 250726)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -40,19 +40,21 @@
 
 namespace WebKit {
 
-LibWebRTCSocket::LibWebRTCSocket(LibWebRTCSocketFactory& factory, Type type, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress)
+LibWebRTCSocket::LibWebRTCSocket(LibWebRTCSocketFactory& factory, const void* socketGroup, Type type, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress)
     : m_factory(factory)
     , m_identifier(WebCore::LibWebRTCSocketIdentifier::generate())
     , m_type(type)
     , m_localAddress(localAddress)
     , m_remoteAddress(remoteAddress)
+    , m_socketGroup(socketGroup)
 {
+    m_factory.addSocket(*this);
 }
 
 LibWebRTCSocket::~LibWebRTCSocket()
 {
     Close();
-    m_factory.detach(*this);
+    m_factory.removeSocket(*this);
 }
 
 void LibWebRTCSocket::sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
@@ -81,6 +83,9 @@
 
 void LibWebRTCSocket::signalReadPacket(const WebCore::SharedBuffer& buffer, rtc::SocketAddress&& address, int64_t timestamp)
 {
+    if (m_isSuspended)
+        return;
+
     m_remoteAddress = WTFMove(address);
     SignalReadPacket(this, buffer.data(), buffer.size(), m_remoteAddress, timestamp);
 }
@@ -87,6 +92,9 @@
 
 void LibWebRTCSocket::signalSentPacket(int rtcPacketID, int64_t sendTimeMs)
 {
+    if (m_beingSentPacketSizes.isEmpty())
+        return;
+
     m_availableSendingBytes += m_beingSentPacketSizes.takeFirst();
     SignalSentPacket(this, rtc::SentPacket(rtcPacketID, sendTimeMs));
     if (m_shouldSignalReadyToSend) {
@@ -130,10 +138,13 @@
     if (!willSend(size))
         return -1;
 
+    if (m_isSuspended)
+        return size;
+
     auto buffer = WebCore::SharedBuffer::create(static_cast<const uint8_t*>(value), size);
     auto identifier = this->identifier();
 
-    sendOnMainThread([identifier, buffer = WTFMove(buffer), address, options](IPC::Connection& connection) {
+    sendOnMainThread([identifier, buffer = WTFMove(buffer), address, options](auto& connection) {
         IPC::DataReference data(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
         connection.send(Messages::NetworkRTCSocket::SendTo { data, RTCNetwork::SocketAddress { address }, RTCPacketOptions { options } }, identifier);
     });
@@ -146,8 +157,8 @@
         return 0;
 
     m_state = STATE_CLOSED;
-    auto identifier = this->identifier();
-    sendOnMainThread([identifier](IPC::Connection& connection) {
+
+    sendOnMainThread([identifier = identifier()](auto& connection) {
         connection.send(Messages::NetworkRTCSocket::Close(), identifier);
     });
     return 0;
@@ -169,13 +180,40 @@
 
     m_options[option] = value;
 
-    auto identifier = this->identifier();
-    sendOnMainThread([identifier, option, value](IPC::Connection& connection) {
+    sendOnMainThread([identifier = identifier(), option, value](auto& connection) {
         connection.send(Messages::NetworkRTCSocket::SetOption(option, value), identifier);
     });
     return 0;
 }
 
+void LibWebRTCSocket::resume()
+{
+    m_isSuspended = false;
+
+    // On resume, we notify libwebrtc that TCP sockets are errored.
+    // We notify libwebrtc that all pending UDP packets have been sent even though we actually dropped them.
+    if (m_type != Type::UDP) {
+        signalClose(-1);
+        return;
+    }
+
+    auto currentTime = rtc::TimeMillis();
+    while (!m_beingSentPacketSizes.isEmpty())
+        signalSentPacket(-1, currentTime);
+}
+
+void LibWebRTCSocket::suspend()
+{
+    m_isSuspended = true;
+
+    // On suspend, we close TCP sockets as we cannot make sure packets are delivered reliably.
+    if (m_type != Type::UDP) {
+        sendOnMainThread([identifier = identifier()](auto& connection) {
+            connection.send(Messages::NetworkRTCSocket::Close { }, identifier);
+        });
+    }
+}
+
 } // namespace WebKit
 
 #endif // USE(LIBWEBRTC)

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h (250725 => 250726)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -52,9 +52,10 @@
 public:
     enum class Type { UDP, ServerTCP, ClientTCP, ServerConnectionTCP };
 
-    LibWebRTCSocket(LibWebRTCSocketFactory&, Type, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress);
+    LibWebRTCSocket(LibWebRTCSocketFactory&, const void* socketGroup, Type, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress);
     ~LibWebRTCSocket();
 
+    const void* socketGroup() const { return m_socketGroup; }
     WebCore::LibWebRTCSocketIdentifier identifier() const { return m_identifier; }
     const rtc::SocketAddress& localAddress() const { return m_localAddress; }
     const rtc::SocketAddress& remoteAddress() const { return m_remoteAddress; }
@@ -62,6 +63,9 @@
     void setError(int error) { m_error = error; }
     void setState(State state) { m_state = state; }
 
+    void suspend();
+    void resume();
+
 private:
     bool willSend(size_t);
 
@@ -102,6 +106,8 @@
     Deque<size_t> m_beingSentPacketSizes;
     size_t m_availableSendingBytes { 65536 };
     bool m_shouldSignalReadyToSend { false };
+    bool m_isSuspended { false };
+    const void* m_socketGroup { nullptr };
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp (250725 => 250726)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp	2019-10-04 16:30:17 UTC (rev 250726)
@@ -48,10 +48,9 @@
     return result;
 }
 
-rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createServerTcpSocket(const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort, int options)
+rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createServerTcpSocket(const void* socketGroup, const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort, int options)
 {
-    auto socket = makeUnique<LibWebRTCSocket>(*this, LibWebRTCSocket::Type::ServerTCP, address, rtc::SocketAddress());
-    m_sockets.set(socket->identifier(), socket.get());
+    auto socket = makeUnique<LibWebRTCSocket>(*this, socketGroup, LibWebRTCSocket::Type::ServerTCP, address, rtc::SocketAddress());
 
     callOnMainThread([identifier = socket->identifier(), address = prepareSocketAddress(address, m_disableNonLocalhostConnections), minPort, maxPort, options]() {
         if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateServerTCPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort, options), 0)) {
@@ -60,14 +59,12 @@
         }
 
     });
-
     return socket.release();
 }
 
-rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createUdpSocket(const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort)
+rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createUdpSocket(const void* socketGroup, const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort)
 {
-    auto socket = makeUnique<LibWebRTCSocket>(*this, LibWebRTCSocket::Type::UDP, address, rtc::SocketAddress());
-    m_sockets.set(socket->identifier(), socket.get());
+    auto socket = makeUnique<LibWebRTCSocket>(*this, socketGroup, LibWebRTCSocket::Type::UDP, address, rtc::SocketAddress());
 
     callOnMainThread([identifier = socket->identifier(), address = prepareSocketAddress(address, m_disableNonLocalhostConnections), minPort, maxPort]() {
         if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateUDPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort), 0)) {
@@ -78,11 +75,10 @@
     return socket.release();
 }
 
-rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createClientTcpSocket(const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, int options)
+rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createClientTcpSocket(const void* socketGroup, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, int options)
 {
-    auto socket = makeUnique<LibWebRTCSocket>(*this, LibWebRTCSocket::Type::ClientTCP, localAddress, remoteAddress);
+    auto socket = makeUnique<LibWebRTCSocket>(*this, socketGroup, LibWebRTCSocket::Type::ClientTCP, localAddress, remoteAddress);
     socket->setState(LibWebRTCSocket::STATE_CONNECTING);
-    m_sockets.set(socket->identifier(), socket.get());
 
     callOnMainThread([identifier = socket->identifier(), localAddress = prepareSocketAddress(localAddress, m_disableNonLocalhostConnections), remoteAddress = prepareSocketAddress(remoteAddress, m_disableNonLocalhostConnections), userAgent = WTFMove(userAgent).isolatedCopy(), options]() {
         if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, RTCNetwork::SocketAddress(localAddress), RTCNetwork::SocketAddress(remoteAddress), userAgent, options), 0)) {
@@ -90,15 +86,13 @@
             return;
         }
     });
-
     return socket.release();
 }
 
 rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createNewConnectionSocket(LibWebRTCSocket& serverSocket, LibWebRTCSocketIdentifier newConnectionSocketIdentifier, const rtc::SocketAddress& remoteAddress)
 {
-    auto socket = makeUnique<LibWebRTCSocket>(*this, LibWebRTCSocket::Type::ServerConnectionTCP, serverSocket.localAddress(), remoteAddress);
+    auto socket = makeUnique<LibWebRTCSocket>(*this, serverSocket.socketGroup(), LibWebRTCSocket::Type::ServerConnectionTCP, serverSocket.localAddress(), remoteAddress);
     socket->setState(LibWebRTCSocket::STATE_CONNECTED);
-    m_sockets.set(socket->identifier(), socket.get());
 
     callOnMainThread([identifier = socket->identifier(), newConnectionSocketIdentifier]() {
         if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::WrapNewTCPConnection(identifier, newConnectionSocketIdentifier), 0)) {
@@ -109,12 +103,26 @@
     return socket.release();
 }
 
-void LibWebRTCSocketFactory::detach(LibWebRTCSocket& socket)
+void LibWebRTCSocketFactory::addSocket(LibWebRTCSocket& socket)
 {
+    ASSERT(!m_sockets.contains(socket.identifier()));
+    m_sockets.add(socket.identifier(), &socket);
+}
+
+void LibWebRTCSocketFactory::removeSocket(LibWebRTCSocket& socket)
+{
     ASSERT(m_sockets.contains(socket.identifier()));
     m_sockets.remove(socket.identifier());
 }
 
+void LibWebRTCSocketFactory::forSocketInGroup(const void* socketGroup, const Function<void(LibWebRTCSocket&)>& callback)
+{
+    for (auto* socket : m_sockets.values()) {
+        if (socket->socketGroup() == socketGroup)
+            callback(*socket);
+    }
+}
+
 rtc::AsyncResolverInterface* LibWebRTCSocketFactory::createAsyncResolver()
 {
     auto resolver = makeUnique<LibWebRTCResolver>(++s_uniqueResolverIdentifier);

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h (250725 => 250726)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h	2019-10-04 15:35:03 UTC (rev 250725)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h	2019-10-04 16:30:17 UTC (rev 250726)
@@ -37,16 +37,19 @@
 
 namespace WebKit {
 
+class LibWebRTCSocket;
+
 class LibWebRTCSocketFactory {
 public:
     LibWebRTCSocketFactory() { }
 
-    void detach(LibWebRTCSocket&);
+    void addSocket(LibWebRTCSocket&);
+    void removeSocket(LibWebRTCSocket&);
     LibWebRTCSocket* socket(WebCore::LibWebRTCSocketIdentifier identifier) { return m_sockets.get(identifier); }
 
-    rtc::AsyncPacketSocket* createUdpSocket(const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort);
-    rtc::AsyncPacketSocket* createServerTcpSocket(const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort, int options);
-    rtc::AsyncPacketSocket* createClientTcpSocket(const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, int options);
+    rtc::AsyncPacketSocket* createUdpSocket(const void* socketGroup, const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort);
+    rtc::AsyncPacketSocket* createServerTcpSocket(const void* socketGroup, const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort, int options);
+    rtc::AsyncPacketSocket* createClientTcpSocket(const void* socketGroup, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, int options);
     rtc::AsyncPacketSocket* createNewConnectionSocket(LibWebRTCSocket&, WebCore::LibWebRTCSocketIdentifier newConnectionSocketIdentifier, const rtc::SocketAddress&);
 
     LibWebRTCResolver* resolver(uint64_t identifier) { return m_resolvers.get(identifier); }
@@ -55,6 +58,8 @@
     
     void disableNonLocalhostConnections() { m_disableNonLocalhostConnections = true; }
 
+    void forSocketInGroup(const void* socketGroup, const Function<void(LibWebRTCSocket&)>&);
+
 private:
     // We cannot own sockets, clients of the factory are responsible to free them.
     HashMap<WebCore::LibWebRTCSocketIdentifier, LibWebRTCSocket*> m_sockets;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to