Changeset 256009 in webkit
- Timestamp:
- Feb 7, 2020 12:46:32 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r256001 r256009 1 2020-02-07 youenn fablet <youenn@apple.com> 2 3 Do not process newly gathered ICE candidates if document is suspended 4 https://bugs.webkit.org/show_bug.cgi?id=207326 5 <rdar://problem/57336453> 6 7 Reviewed by Alex Christensen. 8 9 * fast/history/resources/page-cache-helper-100ms.html: Added. 10 * webrtc/peerconnection-new-candidate-page-cache-expected.txt: Added. 11 * webrtc/peerconnection-new-candidate-page-cache.html: Added. 12 1 13 2020-02-06 Jiewen Tan <jiewen_tan@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r256008 r256009 1 2020-02-07 youenn fablet <youenn@apple.com> 2 3 Do not process newly gathered ICE candidates if document is suspended 4 https://bugs.webkit.org/show_bug.cgi?id=207326 5 <rdar://problem/57336453> 6 7 Reviewed by Alex Christensen. 8 9 We should not register MDNS candidates for suspended documents. 10 For that reason, enqueue a task when receiving a new candidate. 11 If document is not suspended, it will be executed immediately. 12 Otherwise, we will wait until document gets unsuspended. 13 14 Add a mock endpoint that delays gathering of candidates until document is suspended. 15 16 Test: webrtc/peerconnection-new-candidate-page-cache.html 17 18 * Modules/mediastream/PeerConnectionBackend.cpp: 19 (WebCore::PeerConnectionBackend::newICECandidate): 20 * testing/MockLibWebRTCPeerConnection.cpp: 21 (WebCore::MockLibWebRTCPeerConnection::GetTransceivers const): 22 (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::MockLibWebRTCPeerConnectionForIceCandidates): 23 (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription): 24 (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::sendCandidates): 25 (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection): 26 1 27 2020-02-06 Myles C. Maxfield <mmaxfield@apple.com> 2 28 -
trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
r254007 r256009 438 438 void PeerConnectionBackend::newICECandidate(String&& sdp, String&& mid, unsigned short sdpMLineIndex, String&& serverURL) 439 439 { 440 ALWAYS_LOG(LOGIDENTIFIER, "Gathered ice candidate:", sdp); 441 m_finishedGatheringCandidates = false; 442 443 if (!m_shouldFilterICECandidates) { 444 fireICECandidateEvent(RTCIceCandidate::create(WTFMove(sdp), WTFMove(mid), sdpMLineIndex), WTFMove(serverURL)); 445 return; 446 } 447 if (sdp.find(" host ", 0) != notFound) { 448 // FIXME: We might need to clear all pending candidates when setting again local description. 449 m_pendingICECandidates.append(PendingICECandidate { String { sdp }, WTFMove(mid), sdpMLineIndex, WTFMove(serverURL) }); 450 if (RuntimeEnabledFeatures::sharedFeatures().webRTCMDNSICECandidatesEnabled()) { 451 auto ipAddress = extractIPAddres(sdp); 452 // We restrict to IPv4 candidates for now. 453 if (ipAddress.contains('.')) 454 registerMDNSName(ipAddress); 440 m_peerConnection.doTask([logSiteIdentifier = LOGIDENTIFIER, this, sdp = WTFMove(sdp), mid = WTFMove(mid), sdpMLineIndex, serverURL = WTFMove(serverURL)]() mutable { 441 UNUSED_PARAM(logSiteIdentifier); 442 ALWAYS_LOG(logSiteIdentifier, "Gathered ice candidate:", sdp); 443 m_finishedGatheringCandidates = false; 444 445 if (!m_shouldFilterICECandidates) { 446 fireICECandidateEvent(RTCIceCandidate::create(WTFMove(sdp), WTFMove(mid), sdpMLineIndex), WTFMove(serverURL)); 447 return; 455 448 } 456 return; 457 } 458 fireICECandidateEvent(RTCIceCandidate::create(filterICECandidate(WTFMove(sdp)), WTFMove(mid), sdpMLineIndex), WTFMove(serverURL)); 449 if (sdp.find(" host ", 0) != notFound) { 450 // FIXME: We might need to clear all pending candidates when setting again local description. 451 m_pendingICECandidates.append(PendingICECandidate { String { sdp }, WTFMove(mid), sdpMLineIndex, WTFMove(serverURL) }); 452 if (RuntimeEnabledFeatures::sharedFeatures().webRTCMDNSICECandidatesEnabled()) { 453 auto ipAddress = extractIPAddres(sdp); 454 // We restrict to IPv4 candidates for now. 455 if (ipAddress.contains('.')) 456 registerMDNSName(ipAddress); 457 } 458 return; 459 } 460 fireICECandidateEvent(RTCIceCandidate::create(filterICECandidate(WTFMove(sdp)), WTFMove(mid), sdpMLineIndex), WTFMove(serverURL)); 461 }); 459 462 } 460 463 -
trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp
r252472 r256009 87 87 class MockLibWebRTCPeerConnectionForIceCandidates : public MockLibWebRTCPeerConnection { 88 88 public: 89 explicit MockLibWebRTCPeerConnectionForIceCandidates(webrtc::PeerConnectionObserver& observer) : MockLibWebRTCPeerConnection(observer) { }89 explicit MockLibWebRTCPeerConnectionForIceCandidates(webrtc::PeerConnectionObserver&, unsigned delayCount = 0); 90 90 virtual ~MockLibWebRTCPeerConnectionForIceCandidates() = default; 91 91 private: 92 92 void gotLocalDescription() final; 93 void sendCandidates(); 94 95 unsigned m_delayCount { 0 }; 93 96 }; 94 97 98 MockLibWebRTCPeerConnectionForIceCandidates::MockLibWebRTCPeerConnectionForIceCandidates(webrtc::PeerConnectionObserver& observer, unsigned delayCount) 99 : MockLibWebRTCPeerConnection(observer) 100 , m_delayCount(delayCount) 101 { 102 } 103 95 104 void MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription() 96 105 { 106 AddRef(); 107 sendCandidates(); 108 } 109 110 void MockLibWebRTCPeerConnectionForIceCandidates::sendCandidates() 111 { 112 if (m_delayCount > 0) { 113 m_delayCount--; 114 callOnMainThread([this] { 115 LibWebRTCProvider::callOnWebRTCNetworkThread([this] { 116 sendCandidates(); 117 }); 118 }); 119 return; 120 } 121 97 122 // Let's gather candidates 98 123 LibWebRTCProvider::callOnWebRTCSignalingThread([this]() { … … 100 125 m_observer.OnIceCandidate(&candidate); 101 126 }); 127 102 128 LibWebRTCProvider::callOnWebRTCSignalingThread([this]() { 103 129 MockLibWebRTCIceCandidate candidate("1019216383 1 tcp 1019216384 192.168.0.100 9 typ host tcptype passive generation 0", "1"); 104 130 m_observer.OnIceCandidate(&candidate); 105 131 }); 132 106 133 LibWebRTCProvider::callOnWebRTCSignalingThread([this]() { 107 134 MockLibWebRTCIceCandidate candidate("1677722111 1 tcp 1677722112 172.18.0.1 47989 typ srflx raddr 192.168.0.100 rport 47989 generation 0", "1"); 108 135 m_observer.OnIceCandidate(&candidate); 109 136 }); 137 110 138 LibWebRTCProvider::callOnWebRTCSignalingThread([this]() { 111 139 m_observer.OnIceGatheringChange(webrtc::PeerConnectionInterface::kIceGatheringComplete); 112 140 }); 141 142 Release(); 113 143 } 114 144 … … 190 220 if (m_testCase == "ICECandidates") 191 221 return new rtc::RefCountedObject<MockLibWebRTCPeerConnectionForIceCandidates>(*dependencies.observer); 222 223 if (m_testCase == "ICECandidatesWithDelay") 224 return new rtc::RefCountedObject<MockLibWebRTCPeerConnectionForIceCandidates>(*dependencies.observer, 1000); 192 225 193 226 if (m_testCase == "ICEConnectionState")
Note: See TracChangeset
for help on using the changeset viewer.