Title: [218903] trunk/Source
Revision
218903
Author
commit-qu...@webkit.org
Date
2017-06-28 16:24:42 -0700 (Wed, 28 Jun 2017)

Log Message

Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
https://bugs.webkit.org/show_bug.cgi?id=169389

Patch by Youenn Fablet <you...@apple.com> on 2017-06-28
Reviewed by Alex Christensen.

Source/WebCore:

Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
Previously, we were creating a libwebrtc peer connection and then setting its configuration.
libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setConfiguration):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith):
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
(WebCore::LibWebRTCMediaEndpoint::setConfiguration):
(WebCore::LibWebRTCMediaEndpoint::stop):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration):
(WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::createActualPeerConnection):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

Source/WebKit2:

Updating according new WebCore LIbWebRTCProvider API.

* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCProvider::createPeerConnection):
* WebProcess/Network/webrtc/LibWebRTCProvider.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (218902 => 218903)


--- trunk/Source/WebCore/ChangeLog	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/ChangeLog	2017-06-28 23:24:42 UTC (rev 218903)
@@ -1,3 +1,39 @@
+2017-06-28  Youenn Fablet  <you...@apple.com>
+
+        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
+        https://bugs.webkit.org/show_bug.cgi?id=169389
+
+        Reviewed by Alex Christensen.
+
+        Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
+        Previously, we were creating a libwebrtc peer connection and then setting its configuration.
+        libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
+        Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
+
+        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
+        (WebCore::MediaEndpointPeerConnection::setConfiguration):
+        * Modules/mediastream/MediaEndpointPeerConnection.h:
+        * Modules/mediastream/PeerConnectionBackend.h:
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::initializeWith):
+        (WebCore::iceServersFromConfiguration):
+        (WebCore::RTCPeerConnection::initializeConfiguration):
+        (WebCore::RTCPeerConnection::setConfiguration):
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
+        (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
+        (WebCore::LibWebRTCMediaEndpoint::stop):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::configurationFromMediaEndpointConfiguration):
+        (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
+        (WebCore::createActualPeerConnection):
+        (WebCore::LibWebRTCProvider::createPeerConnection):
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
+
 2017-06-28  Brent Fulgham  <bfulg...@apple.com>
 
         Teach ResourceLoadStatistics to recognize changes in the file system

Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (218902 => 218903)


--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp	2017-06-28 23:24:42 UTC (rev 218903)
@@ -602,9 +602,10 @@
     return createRTCSessionDescription(m_pendingRemoteDescription.get());
 }
 
-void MediaEndpointPeerConnection::setConfiguration(MediaEndpointConfiguration&& configuration)
+bool MediaEndpointPeerConnection::setConfiguration(MediaEndpointConfiguration&& configuration)
 {
     m_mediaEndpoint->setConfiguration(WTFMove(configuration));
+    return true;
 }
 
 void MediaEndpointPeerConnection::doAddIceCandidate(RTCIceCandidate& rtcCandidate)

Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h (218902 => 218903)


--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -56,7 +56,7 @@
     RefPtr<RTCSessionDescription> currentRemoteDescription() const final;
     RefPtr<RTCSessionDescription> pendingRemoteDescription() const final;
 
-    void setConfiguration(MediaEndpointConfiguration&&) final;
+    bool setConfiguration(MediaEndpointConfiguration&&) final;
 
     void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) final;
 

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (218902 => 218903)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -88,7 +88,7 @@
     virtual RefPtr<RTCSessionDescription> currentRemoteDescription() const = 0;
     virtual RefPtr<RTCSessionDescription> pendingRemoteDescription() const = 0;
 
-    virtual void setConfiguration(MediaEndpointConfiguration&&) = 0;
+    virtual bool setConfiguration(MediaEndpointConfiguration&&) = 0;
 
     virtual void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) = 0;
 

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (218902 => 218903)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2017-06-28 23:24:42 UTC (rev 218903)
@@ -97,7 +97,7 @@
     if (!m_backend)
         return Exception { NOT_SUPPORTED_ERR };
 
-    return setConfiguration(WTFMove(configuration));
+    return initializeConfiguration(WTFMove(configuration));
 }
 
 ExceptionOr<Ref<RTCRtpSender>> RTCPeerConnection::addTrack(Ref<MediaStreamTrack>&& track, const Vector<std::reference_wrapper<MediaStream>>& streams)
@@ -298,40 +298,61 @@
     m_backend->addIceCandidate(rtcCandidate, WTFMove(promise));
 }
 
-ExceptionOr<void> RTCPeerConnection::setConfiguration(RTCConfiguration&& configuration)
+static inline std::optional<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& configuration)
 {
-    if (isClosed())
-        return Exception { INVALID_STATE_ERR };
-
     Vector<MediaEndpointConfiguration::IceServerInfo> servers;
     if (configuration.iceServers) {
         servers.reserveInitialCapacity(configuration.iceServers->size());
         for (auto& server : configuration.iceServers.value()) {
             Vector<URL> serverURLs;
-            WTF::switchOn(server.urls,
-                [&serverURLs] (const String& string) {
-                    serverURLs.reserveInitialCapacity(1);
+            WTF::switchOn(server.urls, [&serverURLs] (const String& string) {
+                serverURLs.reserveInitialCapacity(1);
+                serverURLs.uncheckedAppend(URL { URL { }, string });
+            }, [&serverURLs] (const Vector<String>& vector) {
+                serverURLs.reserveInitialCapacity(vector.size());
+                for (auto& string : vector)
                     serverURLs.uncheckedAppend(URL { URL { }, string });
-                },
-                [&serverURLs] (const Vector<String>& vector) {
-                    serverURLs.reserveInitialCapacity(vector.size());
-                    for (auto& string : vector)
-                        serverURLs.uncheckedAppend(URL { URL { }, string });
-                }
-            );
+            });
             for (auto& serverURL : serverURLs) {
                 if (!(serverURL.protocolIs("turn") || serverURL.protocolIs("turns") || serverURL.protocolIs("stun")))
-                    return Exception { INVALID_ACCESS_ERR };
+                    return std::nullopt;
             }
             servers.uncheckedAppend({ WTFMove(serverURLs), server.credential, server.username });
         }
     }
+    return servers;
+}
 
-    m_backend->setConfiguration({ WTFMove(servers), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize });
+ExceptionOr<void> RTCPeerConnection::initializeConfiguration(RTCConfiguration&& configuration)
+{
+    auto servers = iceServersFromConfiguration(configuration);
+    if (!servers)
+        return Exception { INVALID_ACCESS_ERR };
+
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=173938
+    // Also decide whether to report an exception or output a message in the console log if setting configuration fails.
+    m_backend->setConfiguration({ WTFMove(servers.value()), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize });
+
     m_configuration = WTFMove(configuration);
     return { };
 }
 
+ExceptionOr<void> RTCPeerConnection::setConfiguration(RTCConfiguration&& configuration)
+{
+    if (isClosed())
+        return Exception { INVALID_STATE_ERR };
+
+    auto servers = iceServersFromConfiguration(configuration);
+    if (!servers)
+        return Exception { INVALID_ACCESS_ERR };
+
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=173938
+    // Also decide whether to report an exception or output a message in the console log if setting configuration fails.
+    m_backend->setConfiguration({ WTFMove(servers.value()), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize });
+    m_configuration = WTFMove(configuration);
+    return { };
+}
+
 void RTCPeerConnection::getStats(MediaStreamTrack* selector, Ref<DeferredPromise>&& promise)
 {
     m_backend->getStats(selector, WTFMove(promise));

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (218902 => 218903)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -153,6 +153,7 @@
 private:
     RTCPeerConnection(ScriptExecutionContext&);
 
+    ExceptionOr<void> initializeConfiguration(RTCConfiguration&&);
     Ref<RTCRtpTransceiver> completeAddTransceiver(Ref<RTCRtpSender>&&, const RTCRtpTransceiverInit&, const String& trackId, const String& trackKind);
 
     void registerToController(RTCController&);

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


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2017-06-28 23:24:42 UTC (rev 218903)
@@ -59,16 +59,23 @@
 LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint(LibWebRTCPeerConnectionBackend& peerConnection, LibWebRTCProvider& client)
     : m_peerConnectionBackend(peerConnection)
     , m_peerConnectionFactory(*client.factory())
-    , m_backend(client.createPeerConnection(*this))
     , m_createSessionDescriptionObserver(*this)
     , m_setLocalSessionDescriptionObserver(*this)
     , m_setRemoteSessionDescriptionObserver(*this)
     , m_statsLogTimer(*this, &LibWebRTCMediaEndpoint::gatherStatsForLogging)
 {
-    ASSERT(m_backend);
     ASSERT(client.factory());
 }
 
+bool LibWebRTCMediaEndpoint::setConfiguration(LibWebRTCProvider& client, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
+{
+    if (!m_backend) {
+        m_backend = client.createPeerConnection(*this, WTFMove(configuration));
+        return !!m_backend;
+    }
+    return m_backend->SetConfiguration(WTFMove(configuration));
+}
+
 // FIXME: unify with MediaEndpointSessionDescription::typeString()
 static inline const char* sessionDescriptionType(RTCSdpType sdpType)
 {
@@ -766,9 +773,11 @@
 
 void LibWebRTCMediaEndpoint::stop()
 {
+    if (!m_backend)
+        return;
+
     stopLoggingStats();
 
-    ASSERT(m_backend);
     m_backend->Close();
     m_backend = nullptr;
     m_streams.clear();

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


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -62,6 +62,8 @@
     static Ref<LibWebRTCMediaEndpoint> create(LibWebRTCPeerConnectionBackend& peerConnection, LibWebRTCProvider& client) { return adoptRef(*new LibWebRTCMediaEndpoint(peerConnection, client)); }
     virtual ~LibWebRTCMediaEndpoint() { }
 
+    bool setConfiguration(LibWebRTCProvider&, webrtc::PeerConnectionInterface::RTCConfiguration&&);
+
     webrtc::PeerConnectionInterface& backend() const { ASSERT(m_backend); return *m_backend.get(); }
     void doSetLocalDescription(RTCSessionDescription&);
     void doSetRemoteDescription(RTCSessionDescription&);

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


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2017-06-28 23:24:42 UTC (rev 218903)
@@ -71,20 +71,35 @@
 {
 }
 
+static inline webrtc::PeerConnectionInterface::BundlePolicy bundlePolicyfromConfiguration(const MediaEndpointConfiguration& configuration)
+{
+    switch (configuration.bundlePolicy) {
+    case RTCBundlePolicy::MaxCompat:
+        return webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat;
+    case RTCBundlePolicy::MaxBundle:
+        return webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle;
+    case RTCBundlePolicy::Balanced:
+        return webrtc::PeerConnectionInterface::kBundlePolicyBalanced;
+    }
+}
+
+static inline webrtc::PeerConnectionInterface::IceTransportsType iceTransportPolicyfromConfiguration(const MediaEndpointConfiguration& configuration)
+{
+    switch (configuration.iceTransportPolicy) {
+    case RTCIceTransportPolicy::Relay:
+        return webrtc::PeerConnectionInterface::kRelay;
+    case RTCIceTransportPolicy::All:
+        return webrtc::PeerConnectionInterface::kAll;
+    }
+}
+
 static webrtc::PeerConnectionInterface::RTCConfiguration configurationFromMediaEndpointConfiguration(MediaEndpointConfiguration&& configuration)
 {
     webrtc::PeerConnectionInterface::RTCConfiguration rtcConfiguration;
 
-    if (configuration.iceTransportPolicy == RTCIceTransportPolicy::Relay)
-        rtcConfiguration.type = webrtc::PeerConnectionInterface::kRelay;
+    rtcConfiguration.type = iceTransportPolicyfromConfiguration(configuration);
+    rtcConfiguration.bundle_policy = bundlePolicyfromConfiguration(configuration);
 
-    // FIXME: Support PeerConnectionStates::BundlePolicy::MaxBundle.
-    // LibWebRTC does not like it and will fail to set any configuration field otherwise.
-    // See https://bugs.webkit.org/show_bug.cgi?id=169389.
-
-    if (configuration.bundlePolicy == RTCBundlePolicy::MaxCompat)
-        rtcConfiguration.bundle_policy = webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat;
-
     for (auto& server : configuration.iceServers) {
         webrtc::PeerConnectionInterface::IceServer iceServer;
         iceServer.username = server.username.utf8().data();
@@ -100,9 +115,9 @@
     return rtcConfiguration;
 }
 
-void LibWebRTCPeerConnectionBackend::setConfiguration(MediaEndpointConfiguration&& configuration)
+bool LibWebRTCPeerConnectionBackend::setConfiguration(MediaEndpointConfiguration&& configuration)
 {
-    m_endpoint->backend().SetConfiguration(configurationFromMediaEndpointConfiguration(WTFMove(configuration)));
+    return m_endpoint->setConfiguration(libWebRTCProvider(m_peerConnection), configurationFromMediaEndpointConfiguration(WTFMove(configuration)));
 }
 
 void LibWebRTCPeerConnectionBackend::getStats(MediaStreamTrack* track, Ref<DeferredPromise>&& promise)

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


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -60,7 +60,7 @@
     void doAddIceCandidate(RTCIceCandidate&) final;
     void doStop() final;
     std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final;
-    void setConfiguration(MediaEndpointConfiguration&&) final;
+    bool setConfiguration(MediaEndpointConfiguration&&) final;
     void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) final;
     Ref<RTCRtpReceiver> createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId) final;
 

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (218902 => 218903)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp	2017-06-28 23:24:42 UTC (rev 218903)
@@ -168,16 +168,14 @@
     staticFactoryAndThreads().factory = webrtc::PeerConnectionFactoryProxy::Create(staticFactoryAndThreads().signalingThread.get(), WTFMove(factory));
 }
 
-static rtc::scoped_refptr<webrtc::PeerConnectionInterface> createActualPeerConnection(webrtc::PeerConnectionObserver& observer, std::unique_ptr<cricket::BasicPortAllocator>&& portAllocator)
+static rtc::scoped_refptr<webrtc::PeerConnectionInterface> createActualPeerConnection(webrtc::PeerConnectionObserver& observer, std::unique_ptr<cricket::BasicPortAllocator>&& portAllocator, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
 {
     ASSERT(staticFactoryAndThreads().factory);
 
-    webrtc::PeerConnectionInterface::RTCConfiguration config;
-    // FIXME: Add a default configuration.
-    return staticFactoryAndThreads().factory->CreatePeerConnection(config, WTFMove(portAllocator), nullptr, &observer);
+    return staticFactoryAndThreads().factory->CreatePeerConnection(configuration, WTFMove(portAllocator), nullptr, &observer);
 }
 
-rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer)
+rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
 {
     // Default WK1 implementation.
     auto& factoryAndThreads = staticFactoryAndThreads();
@@ -187,10 +185,10 @@
     }
     ASSERT(staticFactoryAndThreads().networkThreadWithSocketServer);
 
-    return createActualPeerConnection(observer, nullptr);
+    return createActualPeerConnection(observer, nullptr, WTFMove(configuration));
 }
 
-rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, rtc::NetworkManager& networkManager, rtc::PacketSocketFactory& packetSocketFactory)
+rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, rtc::NetworkManager& networkManager, rtc::PacketSocketFactory& packetSocketFactory, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
 {
     ASSERT(!staticFactoryAndThreads().networkThreadWithSocketServer);
 
@@ -206,7 +204,7 @@
         portAllocator = WTFMove(basicPortAllocator);
     });
 
-    return createActualPeerConnection(observer, WTFMove(portAllocator));
+    return createActualPeerConnection(observer, WTFMove(portAllocator), WTFMove(configuration));
 }
 
 #endif // USE(LIBWEBRTC)

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


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -52,7 +52,7 @@
 
     static bool webRTCAvailable();
 #if USE(LIBWEBRTC)
-    WEBCORE_EXPORT virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&);
+    WEBCORE_EXPORT virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, webrtc::PeerConnectionInterface::RTCConfiguration&&);
 
     WEBCORE_EXPORT webrtc::PeerConnectionFactoryInterface* factory();
 
@@ -69,7 +69,7 @@
     void enableEnumeratingAllNetworkInterfaces() { m_enableEnumeratingAllNetworkInterfaces = true; }
 
 protected:
-    WEBCORE_EXPORT rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, rtc::NetworkManager&, rtc::PacketSocketFactory&);
+    WEBCORE_EXPORT rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, rtc::NetworkManager&, rtc::PacketSocketFactory&, webrtc::PeerConnectionInterface::RTCConfiguration&&);
 
     bool m_enableEnumeratingAllNetworkInterfaces { false };
     bool m_useNetworkThreadWithSocketServer { true };

Modified: trunk/Source/WebKit2/ChangeLog (218902 => 218903)


--- trunk/Source/WebKit2/ChangeLog	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-28 23:24:42 UTC (rev 218903)
@@ -1,3 +1,16 @@
+2017-06-28  Youenn Fablet  <you...@apple.com>
+
+        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
+        https://bugs.webkit.org/show_bug.cgi?id=169389
+
+        Reviewed by Alex Christensen.
+
+        Updating according new WebCore LIbWebRTCProvider API.
+
+        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
+        (WebKit::LibWebRTCProvider::createPeerConnection):
+        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
+
 2017-06-28  Chris Dumez  <cdu...@apple.com>
 
         [iOS] Allow WKWebView clients to play audio in the background

Modified: trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp (218902 => 218903)


--- trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp	2017-06-28 23:24:42 UTC (rev 218903)
@@ -34,9 +34,9 @@
 
 namespace WebKit {
 
-rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer)
+rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
 {
-    return WebCore::LibWebRTCProvider::createPeerConnection(observer, WebProcess::singleton().libWebRTCNetwork().monitor(), WebProcess::singleton().libWebRTCNetwork().socketFactory());
+    return WebCore::LibWebRTCProvider::createPeerConnection(observer, WebProcess::singleton().libWebRTCNetwork().monitor(), WebProcess::singleton().libWebRTCNetwork().socketFactory(), WTFMove(configuration));
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h (218902 => 218903)


--- trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h	2017-06-28 23:22:29 UTC (rev 218902)
+++ trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h	2017-06-28 23:24:42 UTC (rev 218903)
@@ -36,7 +36,7 @@
     LibWebRTCProvider() { m_useNetworkThreadWithSocketServer = false; }
 
 private:
-    rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&) final;
+    rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, webrtc::PeerConnectionInterface::RTCConfiguration&&) final;
 };
 #else
 using LibWebRTCProvider = WebCore::LibWebRTCProvider;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to