Handle MDNS resolution of candidates through libwebrtc directly
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2018 21:31:16 +0000 (21:31 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Oct 2018 21:31:16 +0000 (21:31 +0000)
commita6c890fa4a875fb8eec73d564227fe89a0744f23
tree412ab323c3dcbdb4ba2a574456d5576debe4c79e
parent8959aac00763c5eb6f086045392dc044cb6ab206
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

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

Source/WebCore:

Remove the previous MDNS resolution mechanism.
Instead, add support for the AsyncResolver mechanism added to libwebrtc.
Covered by current mdns webrtc test that is unflaked.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:

Source/WebKit:

Add support for AsyncResolver to resolve MDNS.
This basically reuse the code path used to resolve STUN server addresses.
Removed MDNS specific resolution.
Use existing CFHost resolution mechanism to do the actual resolution.

Make sure that a resolver is kept alive while iterating through its clients when signaling done.
Some of its clients may indeed call Destroy() on the resolver during that iteration.

* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):
* NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCResolver::Destroy):
(WebKit::LibWebRTCResolver::doDestroy):
(WebKit::LibWebRTCResolver::setResolvedAddress):
(WebKit::LibWebRTCResolver::setError):
(WebKit::LibWebRTCProvider::createPeerConnection):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
* WebProcess/Network/webrtc/WebMDNSRegister.cpp:
* WebProcess/Network/webrtc/WebMDNSRegister.h:
* WebProcess/Network/webrtc/WebMDNSRegister.messages.in:

LayoutTests:

* TestExpectations:
Test should no longer be flaky as we no longer enforce a timer for resolving MDNS candidates.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp
Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h
Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp
Source/WebCore/testing/MockLibWebRTCPeerConnection.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/webrtc/NetworkMDNSRegister.cpp
Source/WebKit/NetworkProcess/webrtc/NetworkMDNSRegister.messages.in
Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp
Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.h
Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.cpp
Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.h
Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h
Source/WebKit/WebProcess/Network/webrtc/WebMDNSRegister.cpp
Source/WebKit/WebProcess/Network/webrtc/WebMDNSRegister.h
Source/WebKit/WebProcess/Network/webrtc/WebMDNSRegister.messages.in