<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[218973] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/218973">218973</a></dd>
<dt>Author</dt> <dd>jlewis3@apple.com</dd>
<dt>Date</dt> <dd>2017-06-29 17:15:56 -0700 (Thu, 29 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/218903">r218903</a>.

This patch and its fix cause immediate flakiness on all WK2
testers

Reverted changeset:

"Support PeerConnectionStates::BundlePolicy::MaxBundle when
setting rtc configuration"
https://bugs.webkit.org/show_bug.cgi?id=169389
http://trac.webkit.org/changeset/218903</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectionh">trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamPeerConnectionBackendh">trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointcpp">trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointh">trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCPeerConnectionBackendcpp">trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCPeerConnectionBackendh">trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCProvidercpp">trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCProviderh">trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkwebrtcLibWebRTCProvidercpp">trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkwebrtcLibWebRTCProviderh">trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/ChangeLog      2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2017-06-29  Matt Lewis  <jlewis3@apple.com>
</span><span class="cx"> 
</span><ins>+        Unreviewed, rolling out r218903.
+
+        This patch and its fix cause immediate flakiness on all WK2
+        testers
+
+        Reverted changeset:
+
+        "Support PeerConnectionStates::BundlePolicy::MaxBundle when
+        setting rtc configuration"
+        https://bugs.webkit.org/show_bug.cgi?id=169389
+        http://trac.webkit.org/changeset/218903
+
+2017-06-29  Matt Lewis  <jlewis3@apple.com>
+
</ins><span class="cx">         Unreviewed, rolling out r218963.
</span><span class="cx"> 
</span><span class="cx">         This patch and its fix cause immediate flakiness on all WK2
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp 2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp    2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -602,10 +602,9 @@
</span><span class="cx">     return createRTCSessionDescription(m_pendingRemoteDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool MediaEndpointPeerConnection::setConfiguration(MediaEndpointConfiguration&& configuration)
</del><ins>+void MediaEndpointPeerConnection::setConfiguration(MediaEndpointConfiguration&& configuration)
</ins><span class="cx"> {
</span><span class="cx">     m_mediaEndpoint->setConfiguration(WTFMove(configuration));
</span><del>-    return true;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaEndpointPeerConnection::doAddIceCandidate(RTCIceCandidate& rtcCandidate)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h   2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h      2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     RefPtr<RTCSessionDescription> currentRemoteDescription() const final;
</span><span class="cx">     RefPtr<RTCSessionDescription> pendingRemoteDescription() const final;
</span><span class="cx"> 
</span><del>-    bool setConfiguration(MediaEndpointConfiguration&&) final;
</del><ins>+    void setConfiguration(MediaEndpointConfiguration&&) final;
</ins><span class="cx"> 
</span><span class="cx">     void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamPeerConnectionBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h 2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h    2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     virtual RefPtr<RTCSessionDescription> currentRemoteDescription() const = 0;
</span><span class="cx">     virtual RefPtr<RTCSessionDescription> pendingRemoteDescription() const = 0;
</span><span class="cx"> 
</span><del>-    virtual bool setConfiguration(MediaEndpointConfiguration&&) = 0;
</del><ins>+    virtual void setConfiguration(MediaEndpointConfiguration&&) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp   2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp      2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">     if (!m_backend)
</span><span class="cx">         return Exception { NOT_SUPPORTED_ERR };
</span><span class="cx"> 
</span><del>-    return initializeConfiguration(WTFMove(configuration));
</del><ins>+    return setConfiguration(WTFMove(configuration));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<Ref<RTCRtpSender>> RTCPeerConnection::addTrack(Ref<MediaStreamTrack>&& track, const Vector<std::reference_wrapper<MediaStream>>& streams)
</span><span class="lines">@@ -298,61 +298,40 @@
</span><span class="cx">     m_backend->addIceCandidate(rtcCandidate, WTFMove(promise));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline std::optional<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& configuration)
</del><ins>+ExceptionOr<void> RTCPeerConnection::setConfiguration(RTCConfiguration&& configuration)
</ins><span class="cx"> {
</span><ins>+    if (isClosed())
+        return Exception { INVALID_STATE_ERR };
+
</ins><span class="cx">     Vector<MediaEndpointConfiguration::IceServerInfo> servers;
</span><span class="cx">     if (configuration.iceServers) {
</span><span class="cx">         servers.reserveInitialCapacity(configuration.iceServers->size());
</span><span class="cx">         for (auto& server : configuration.iceServers.value()) {
</span><span class="cx">             Vector<URL> serverURLs;
</span><del>-            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)
</del><ins>+            WTF::switchOn(server.urls,
+                [&serverURLs] (const String& string) {
+                    serverURLs.reserveInitialCapacity(1);
</ins><span class="cx">                     serverURLs.uncheckedAppend(URL { URL { }, string });
</span><del>-            });
</del><ins>+                },
+                [&serverURLs] (const Vector<String>& vector) {
+                    serverURLs.reserveInitialCapacity(vector.size());
+                    for (auto& string : vector)
+                        serverURLs.uncheckedAppend(URL { URL { }, string });
+                }
+            );
</ins><span class="cx">             for (auto& serverURL : serverURLs) {
</span><span class="cx">                 if (!(serverURL.protocolIs("turn") || serverURL.protocolIs("turns") || serverURL.protocolIs("stun")))
</span><del>-                    return std::nullopt;
</del><ins>+                    return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">             }
</span><span class="cx">             servers.uncheckedAppend({ WTFMove(serverURLs), server.credential, server.username });
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return servers;
-}
</del><span class="cx"> 
</span><del>-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 });
-
</del><ins>+    m_backend->setConfiguration({ WTFMove(servers), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize });
</ins><span class="cx">     m_configuration = WTFMove(configuration);
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-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 { };
-}
-
</del><span class="cx"> void RTCPeerConnection::getStats(MediaStreamTrack* selector, Ref<DeferredPromise>&& promise)
</span><span class="cx"> {
</span><span class="cx">     m_backend->getStats(selector, WTFMove(promise));
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h     2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -153,7 +153,6 @@
</span><span class="cx"> private:
</span><span class="cx">     RTCPeerConnection(ScriptExecutionContext&);
</span><span class="cx"> 
</span><del>-    ExceptionOr<void> initializeConfiguration(RTCConfiguration&&);
</del><span class="cx">     Ref<RTCRtpTransceiver> completeAddTransceiver(Ref<RTCRtpSender>&&, const RTCRtpTransceiverInit&, const String& trackId, const String& trackKind);
</span><span class="cx"> 
</span><span class="cx">     void registerToController(RTCController&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp    2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp       2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -59,23 +59,16 @@
</span><span class="cx"> LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint(LibWebRTCPeerConnectionBackend& peerConnection, LibWebRTCProvider& client)
</span><span class="cx">     : m_peerConnectionBackend(peerConnection)
</span><span class="cx">     , m_peerConnectionFactory(*client.factory())
</span><ins>+    , m_backend(client.createPeerConnection(*this))
</ins><span class="cx">     , m_createSessionDescriptionObserver(*this)
</span><span class="cx">     , m_setLocalSessionDescriptionObserver(*this)
</span><span class="cx">     , m_setRemoteSessionDescriptionObserver(*this)
</span><span class="cx">     , m_statsLogTimer(*this, &LibWebRTCMediaEndpoint::gatherStatsForLogging)
</span><span class="cx"> {
</span><ins>+    ASSERT(m_backend);
</ins><span class="cx">     ASSERT(client.factory());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-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));
-}
-
</del><span class="cx"> // FIXME: unify with MediaEndpointSessionDescription::typeString()
</span><span class="cx"> static inline const char* sessionDescriptionType(RTCSdpType sdpType)
</span><span class="cx"> {
</span><span class="lines">@@ -773,11 +766,9 @@
</span><span class="cx"> 
</span><span class="cx"> void LibWebRTCMediaEndpoint::stop()
</span><span class="cx"> {
</span><del>-    if (!m_backend)
-        return;
-
</del><span class="cx">     stopLoggingStats();
</span><span class="cx"> 
</span><ins>+    ASSERT(m_backend);
</ins><span class="cx">     m_backend->Close();
</span><span class="cx">     m_backend = nullptr;
</span><span class="cx">     m_streams.clear();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h      2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h 2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -62,8 +62,6 @@
</span><span class="cx">     static Ref<LibWebRTCMediaEndpoint> create(LibWebRTCPeerConnectionBackend& peerConnection, LibWebRTCProvider& client) { return adoptRef(*new LibWebRTCMediaEndpoint(peerConnection, client)); }
</span><span class="cx">     virtual ~LibWebRTCMediaEndpoint() { }
</span><span class="cx"> 
</span><del>-    bool setConfiguration(LibWebRTCProvider&, webrtc::PeerConnectionInterface::RTCConfiguration&&);
-
</del><span class="cx">     webrtc::PeerConnectionInterface& backend() const { ASSERT(m_backend); return *m_backend.get(); }
</span><span class="cx">     void doSetLocalDescription(RTCSessionDescription&);
</span><span class="cx">     void doSetRemoteDescription(RTCSessionDescription&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCPeerConnectionBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp    2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp       2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -71,35 +71,20 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-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;
-    }
-}
-
</del><span class="cx"> static webrtc::PeerConnectionInterface::RTCConfiguration configurationFromMediaEndpointConfiguration(MediaEndpointConfiguration&& configuration)
</span><span class="cx"> {
</span><span class="cx">     webrtc::PeerConnectionInterface::RTCConfiguration rtcConfiguration;
</span><span class="cx"> 
</span><del>-    rtcConfiguration.type = iceTransportPolicyfromConfiguration(configuration);
-    rtcConfiguration.bundle_policy = bundlePolicyfromConfiguration(configuration);
</del><ins>+    if (configuration.iceTransportPolicy == RTCIceTransportPolicy::Relay)
+        rtcConfiguration.type = webrtc::PeerConnectionInterface::kRelay;
</ins><span class="cx"> 
</span><ins>+    // 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;
+
</ins><span class="cx">     for (auto& server : configuration.iceServers) {
</span><span class="cx">         webrtc::PeerConnectionInterface::IceServer iceServer;
</span><span class="cx">         iceServer.username = server.username.utf8().data();
</span><span class="lines">@@ -115,9 +100,9 @@
</span><span class="cx">     return rtcConfiguration;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool LibWebRTCPeerConnectionBackend::setConfiguration(MediaEndpointConfiguration&& configuration)
</del><ins>+void LibWebRTCPeerConnectionBackend::setConfiguration(MediaEndpointConfiguration&& configuration)
</ins><span class="cx"> {
</span><del>-    return m_endpoint->setConfiguration(libWebRTCProvider(m_peerConnection), configurationFromMediaEndpointConfiguration(WTFMove(configuration)));
</del><ins>+    m_endpoint->backend().SetConfiguration(configurationFromMediaEndpointConfiguration(WTFMove(configuration)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LibWebRTCPeerConnectionBackend::getStats(MediaStreamTrack* track, Ref<DeferredPromise>&& promise)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCPeerConnectionBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h      2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h 2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     void doAddIceCandidate(RTCIceCandidate&) final;
</span><span class="cx">     void doStop() final;
</span><span class="cx">     std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final;
</span><del>-    bool setConfiguration(MediaEndpointConfiguration&&) final;
</del><ins>+    void setConfiguration(MediaEndpointConfiguration&&) final;
</ins><span class="cx">     void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) final;
</span><span class="cx">     Ref<RTCRtpReceiver> createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId) final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp        2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp   2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -168,14 +168,16 @@
</span><span class="cx">     staticFactoryAndThreads().factory = webrtc::PeerConnectionFactoryProxy::Create(staticFactoryAndThreads().signalingThread.get(), WTFMove(factory));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static rtc::scoped_refptr<webrtc::PeerConnectionInterface> createActualPeerConnection(webrtc::PeerConnectionObserver& observer, std::unique_ptr<cricket::BasicPortAllocator>&& portAllocator, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
</del><ins>+static rtc::scoped_refptr<webrtc::PeerConnectionInterface> createActualPeerConnection(webrtc::PeerConnectionObserver& observer, std::unique_ptr<cricket::BasicPortAllocator>&& portAllocator)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(staticFactoryAndThreads().factory);
</span><span class="cx"> 
</span><del>-    return staticFactoryAndThreads().factory->CreatePeerConnection(configuration, WTFMove(portAllocator), nullptr, &observer);
</del><ins>+    webrtc::PeerConnectionInterface::RTCConfiguration config;
+    // FIXME: Add a default configuration.
+    return staticFactoryAndThreads().factory->CreatePeerConnection(config, WTFMove(portAllocator), nullptr, &observer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
</del><ins>+rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer)
</ins><span class="cx"> {
</span><span class="cx">     // Default WK1 implementation.
</span><span class="cx">     auto& factoryAndThreads = staticFactoryAndThreads();
</span><span class="lines">@@ -185,10 +187,10 @@
</span><span class="cx">     }
</span><span class="cx">     ASSERT(staticFactoryAndThreads().networkThreadWithSocketServer);
</span><span class="cx"> 
</span><del>-    return createActualPeerConnection(observer, nullptr, WTFMove(configuration));
</del><ins>+    return createActualPeerConnection(observer, nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, rtc::NetworkManager& networkManager, rtc::PacketSocketFactory& packetSocketFactory, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
</del><ins>+rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, rtc::NetworkManager& networkManager, rtc::PacketSocketFactory& packetSocketFactory)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!staticFactoryAndThreads().networkThreadWithSocketServer);
</span><span class="cx"> 
</span><span class="lines">@@ -204,7 +206,7 @@
</span><span class="cx">         portAllocator = WTFMove(basicPortAllocator);
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    return createActualPeerConnection(observer, WTFMove(portAllocator), WTFMove(configuration));
</del><ins>+    return createActualPeerConnection(observer, WTFMove(portAllocator));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(LIBWEBRTC)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamlibwebrtcLibWebRTCProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h  2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.h     2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">     static bool webRTCAvailable();
</span><span class="cx"> #if USE(LIBWEBRTC)
</span><del>-    WEBCORE_EXPORT virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, webrtc::PeerConnectionInterface::RTCConfiguration&&);
</del><ins>+    WEBCORE_EXPORT virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT webrtc::PeerConnectionFactoryInterface* factory();
</span><span class="cx"> 
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     void enableEnumeratingAllNetworkInterfaces() { m_enableEnumeratingAllNetworkInterfaces = true; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    WEBCORE_EXPORT rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, rtc::NetworkManager&, rtc::PacketSocketFactory&, webrtc::PeerConnectionInterface::RTCConfiguration&&);
</del><ins>+    WEBCORE_EXPORT rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, rtc::NetworkManager&, rtc::PacketSocketFactory&);
</ins><span class="cx"> 
</span><span class="cx">     bool m_enableEnumeratingAllNetworkInterfaces { false };
</span><span class="cx">     bool m_useNetworkThreadWithSocketServer { true };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog   2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebKit2/ChangeLog      2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-06-29  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r218903.
+
+        This patch and its fix cause immediate flakiness on all WK2
+        testers
+
+        Reverted changeset:
+
+        "Support PeerConnectionStates::BundlePolicy::MaxBundle when
+        setting rtc configuration"
+        https://bugs.webkit.org/show_bug.cgi?id=169389
+        http://trac.webkit.org/changeset/218903
+
</ins><span class="cx"> 2017-06-29  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkwebrtcLibWebRTCProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp     2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.cpp        2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -34,9 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer, webrtc::PeerConnectionInterface::RTCConfiguration&& configuration)
</del><ins>+rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPeerConnection(webrtc::PeerConnectionObserver& observer)
</ins><span class="cx"> {
</span><del>-    return WebCore::LibWebRTCProvider::createPeerConnection(observer, WebProcess::singleton().libWebRTCNetwork().monitor(), WebProcess::singleton().libWebRTCNetwork().socketFactory(), WTFMove(configuration));
</del><ins>+    return WebCore::LibWebRTCProvider::createPeerConnection(observer, WebProcess::singleton().libWebRTCNetwork().monitor(), WebProcess::singleton().libWebRTCNetwork().socketFactory());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkwebrtcLibWebRTCProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h (218972 => 218973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h       2017-06-30 00:14:55 UTC (rev 218972)
+++ trunk/Source/WebKit2/WebProcess/Network/webrtc/LibWebRTCProvider.h  2017-06-30 00:15:56 UTC (rev 218973)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     LibWebRTCProvider() { m_useNetworkThreadWithSocketServer = false; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&, webrtc::PeerConnectionInterface::RTCConfiguration&&) final;
</del><ins>+    rtc::scoped_refptr<webrtc::PeerConnectionInterface> createPeerConnection(webrtc::PeerConnectionObserver&) final;
</ins><span class="cx"> };
</span><span class="cx"> #else
</span><span class="cx"> using LibWebRTCProvider = WebCore::LibWebRTCProvider;
</span></span></pre>
</div>
</div>

</body>
</html>