Source/WebCore:
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2017 15:00:43 +0000 (15:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2017 15:00:43 +0000 (15:00 +0000)
       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/).
       Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
underlying libwebrtc backend.

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.

ICE candidate pool size is disabled as it is creating issues with running tests on bots.

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-30

* 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:
Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
https://bugs.webkit.org/show_bug.cgi?id=169389

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

* fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@218994 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp
Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp
Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h

index 3b6d5a0..a3c11f7 100644 (file)
@@ -1,3 +1,45 @@
+2017-06-30  Youenn Fablet  <youenn@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/).
+       Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
+        underlying libwebrtc backend.
+
+        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.
+
+        ICE candidate pool size is disabled as it is creating issues with running tests on bots.
+
+        * 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-30  Antoine Quint  <graouts@apple.com>
 
         Top controls bars should invert with right-to-left user interface layout direction locale
index c73182e..8357ed9 100644 (file)
@@ -602,9 +602,10 @@ RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::pendingRemoteDescript
     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)
index 1e31cd4..bb81312 100644 (file)
@@ -56,7 +56,7 @@ private:
     RefPtr<RTCSessionDescription> currentRemoteDescription() const final;
     RefPtr<RTCSessionDescription> pendingRemoteDescription() const final;
 
-    void setConfiguration(MediaEndpointConfiguration&&) final;
+    bool setConfiguration(MediaEndpointConfiguration&&) final;
 
     void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) final;
 
index ce9c745..5abad98 100644 (file)
@@ -88,7 +88,7 @@ public:
     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;
 
index 90744c4..ab4ee5c 100644 (file)
@@ -97,7 +97,7 @@ ExceptionOr<void> RTCPeerConnection::initializeWith(Document& document, RTCConfi
     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,36 +298,57 @@ void RTCPeerConnection::queuedAddIceCandidate(RTCIceCandidate* rtcCandidate, DOM
     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;
+}
+
+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 };
 
-    m_backend->setConfiguration({ WTFMove(servers), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize });
+    // 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 { };
 }
index 373aa6d..8e68649 100644 (file)
@@ -153,6 +153,7 @@ public:
 private:
     RTCPeerConnection(ScriptExecutionContext&);
 
+    ExceptionOr<void> initializeConfiguration(RTCConfiguration&&);
     Ref<RTCRtpTransceiver> completeAddTransceiver(Ref<RTCRtpSender>&&, const RTCRtpTransceiverInit&, const String& trackId, const String& trackKind);
 
     void registerToController(RTCController&);
index f41e901..cc006aa 100644 (file)
@@ -59,16 +59,23 @@ namespace WebCore {
 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::OnDataChannel(rtc::scoped_refptr<webrtc::DataChanne
 
 void LibWebRTCMediaEndpoint::stop()
 {
+    if (!m_backend)
+        return;
+
     stopLoggingStats();
 
-    ASSERT(m_backend);
     m_backend->Close();
     m_backend = nullptr;
     m_streams.clear();
index f8b3cf4..c1fb334 100644 (file)
@@ -62,6 +62,8 @@ public:
     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&);
index dce8648..60d48e2 100644 (file)
@@ -71,19 +71,34 @@ LibWebRTCPeerConnectionBackend::~LibWebRTCPeerConnectionBackend()
 {
 }
 
+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;
-
-    // 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;
+    rtcConfiguration.type = iceTransportPolicyfromConfiguration(configuration);
+    rtcConfiguration.bundle_policy = bundlePolicyfromConfiguration(configuration);
 
     for (auto& server : configuration.iceServers) {
         webrtc::PeerConnectionInterface::IceServer iceServer;
@@ -95,14 +110,15 @@ static webrtc::PeerConnectionInterface::RTCConfiguration configurationFromMediaE
     }
 
     rtcConfiguration.set_cpu_adaptation(false);
-    rtcConfiguration.ice_candidate_pool_size = configuration.iceCandidatePoolSize;
+    // FIXME: Activate ice candidate pool size once it no longer bothers test bots.
+    // rtcConfiguration.ice_candidate_pool_size = configuration.iceCandidatePoolSize;
 
     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)
index 0c5212b..4f49d71 100644 (file)
@@ -60,7 +60,7 @@ private:
     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;
 
index cb23cc0..7e0867b 100644 (file)
@@ -168,16 +168,14 @@ void LibWebRTCProvider::setPeerConnectionFactory(rtc::scoped_refptr<webrtc::Peer
     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 @@ rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPee
     }
     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 @@ rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPee
         portAllocator = WTFMove(basicPortAllocator);
     });
 
-    return createActualPeerConnection(observer, WTFMove(portAllocator));
+    return createActualPeerConnection(observer, WTFMove(portAllocator), WTFMove(configuration));
 }
 
 #endif // USE(LIBWEBRTC)
index 9355e5a..e726c60 100644 (file)
@@ -52,7 +52,7 @@ public:
 
     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 @@ public:
     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 };
index d28a79d..dea7acb 100644 (file)
@@ -1,3 +1,12 @@
+2017-06-30  Youenn Fablet  <youenn@apple.com>
+
+        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
+        https://bugs.webkit.org/show_bug.cgi?id=169389
+
+        Reviewed by Alex Christensen.
+
+        * fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt:
+
 2017-06-29  Ryosuke Niwa  <rniwa@webkit.org>
 
         Assert that callback ID is not 0 or -1 during encoding and decoding
index fe497ab..1c259d2 100644 (file)
@@ -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
index 20f8c0d..f516b7f 100644 (file)
@@ -36,7 +36,7 @@ public:
     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;