<!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>[214293] trunk</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/214293">214293</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-22 19:44:57 -0700 (Wed, 22 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Support RTCPeerConnectionState
https://bugs.webkit.org/show_bug.cgi?id=169978

Patch by Youenn Fablet &lt;youenn@apple.com&gt; on 2017-03-22
Reviewed by Jon Lee.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:

Source/WebCore:

Test: webrtc/connection-state.html

Implementing https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum.
Its state and event is based on changes made to ice gathering state and ice connection state.

* CMakeLists.txt: Adding RTCPeerConnectionState idl.
* DerivedSources.make: Ditto.
* Modules/mediastream/RTCPeerConnection.cpp: Splitting close in doClose/doStop so that we can send closed event
in case close is called, but not if stopped.
(WebCore::RTCPeerConnection::doClose):
(WebCore::RTCPeerConnection::close):
(WebCore::RTCPeerConnection::stop):
(WebCore::RTCPeerConnection::doStop):
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::RTCPeerConnection::updateIceConnectionState):
(WebCore::RTCPeerConnection::updateConnectionState):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl: Fixing IDL and minor cosmetic changes
* Modules/mediastream/RTCPeerConnection.js:
(setLocalDescription): Cosmetic change.
(setRemoteDescription):
* Modules/mediastream/RTCPeerConnectionState.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnIceGatheringChange): Adding 'gathering' state
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* platform/mediastream/RTCPeerConnectionState.h: Added.

LayoutTests:

* webrtc/connection-state-expected.txt: Added.
* webrtc/connection-state.html: Added.
* webrtc/rtcpeerconnection-error-messages-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestswebrtcrtcpeerconnectionrtcpeerconnectionconstructorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebrtcrtcpeerconnectionerrormessagesexpectedtxt">trunk/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</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="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionjs">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointcpp">trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomEventNamesh">trunk/Source/WebCore/dom/EventNames.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestswebrtcconnectionstateexpectedtxt">trunk/LayoutTests/webrtc/connection-state-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebrtcconnectionstatehtml">trunk/LayoutTests/webrtc/connection-state.html</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionStateidl">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionState.idl</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRTCPeerConnectionStateh">trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/LayoutTests/ChangeLog        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-22  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Support RTCPeerConnectionState
+        https://bugs.webkit.org/show_bug.cgi?id=169978
+
+        Reviewed by Jon Lee.
+
+        * webrtc/connection-state-expected.txt: Added.
+        * webrtc/connection-state.html: Added.
+        * webrtc/rtcpeerconnection-error-messages-expected.txt:
+
</ins><span class="cx"> 2017-03-22  Carlos Alberto Lopez Perez  &lt;clopez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Enable CSS filters related tests.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2017-03-22  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Support RTCPeerConnectionState
+        https://bugs.webkit.org/show_bug.cgi?id=169978
+
+        Reviewed by Jon Lee.
+
+        * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
+
</ins><span class="cx"> 2017-03-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit should disallow beforeunload alerts from web pages users have never interacted with
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestswebrtcrtcpeerconnectionrtcpeerconnectionconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -100,6 +100,6 @@
</span><span class="cx"> PASS signalingState initial value 
</span><span class="cx"> PASS iceGatheringState initial value 
</span><span class="cx"> PASS iceConnectionState initial value 
</span><del>-FAIL connectionState initial value assert_equals: expected (string) &quot;new&quot; but got (undefined) undefined
</del><ins>+PASS connectionState initial value 
</ins><span class="cx"> FAIL canTrickleIceCandidates initial value assert_equals: expected (object) null but got (undefined) undefined
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestswebrtcconnectionstateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/webrtc/connection-state-expected.txt (0 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webrtc/connection-state-expected.txt                                (rev 0)
+++ trunk/LayoutTests/webrtc/connection-state-expected.txt        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+
+PASS Checking various connection state for video exchange 
+PASS Checking connection state event when closing peer connetion 
+
</ins></span></pre></div>
<a id="trunkLayoutTestswebrtcconnectionstatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/webrtc/connection-state.html (0 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webrtc/connection-state.html                                (rev 0)
+++ trunk/LayoutTests/webrtc/connection-state.html        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta charset=&quot;utf-8&quot;&gt;
+        &lt;title&gt;Testing basic video exchange from offerer to receiver&lt;/title&gt;
+        &lt;script src=&quot;../resources/testharness.js&quot;&gt;&lt;/script&gt;
+        &lt;script src=&quot;../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;script src =&quot;routines.js&quot;&gt;&lt;/script&gt;
+        &lt;script&gt;
+promise_test((test) =&gt; {
+    if (window.testRunner)
+        testRunner.setUserMediaPermission(true);
+
+    var firstConnection, secondConnection;
+    var localConnectionStates = [&quot;new&quot;];
+    var remoteConnectionStates = [&quot;new&quot;];
+    var localIceConnectionStates = [&quot;new&quot;];
+    var remoteIceConnectionStates = [&quot;new&quot;];
+    var localGatheringStates = [&quot;new&quot;];
+    var remoteGatheringStates = [&quot;new&quot;];
+    return navigator.mediaDevices.getUserMedia({ video: true}).then((stream) =&gt; {
+        return new Promise((resolve, reject) =&gt; {
+            if (window.internals)
+                internals.useMockRTCPeerConnectionFactory(&quot;TwoRealPeerConnections&quot;);
+
+            createConnections((connection) =&gt; {
+                firstConnection = connection;
+                firstConnection.addTrack(stream.getVideoTracks()[0], stream);
+                assert_equals(firstConnection.connectionState, &quot;new&quot;);
+                firstConnection.onconnectionstatechange = () =&gt; {
+                    localConnectionStates.push(firstConnection.connectionState);
+                }
+                firstConnection.onicegatheringstatechange = () =&gt; {
+                    localGatheringStates.push(firstConnection.iceGatheringState);
+                }
+                firstConnection.oniceconnectionstatechange = () =&gt; {
+                    localIceConnectionStates.push(firstConnection.iceConnectionState);
+                }
+            }, (connection) =&gt; {
+                secondConnection = connection;
+                assert_equals(secondConnection.connectionState, &quot;new&quot;);
+                secondConnection.onconnectionstatechange = () =&gt; {
+                    remoteConnectionStates.push(secondConnection.connectionState);
+                }
+                secondConnection.onicegatheringstatechange = () =&gt; {
+                    remoteGatheringStates.push(secondConnection.iceGatheringState);
+                }
+                secondConnection.oniceconnectionstatechange = () =&gt; {
+                    remoteIceConnectionStates.push(secondConnection.iceConnectionState);
+                }
+                secondConnection.ontrack = (trackEvent) =&gt; {
+                    resolve(trackEvent.streams[0]);
+                };
+            });
+            setTimeout(() =&gt; reject(&quot;Test timed out&quot;), 5000);
+        });
+    }).then((stream) =&gt; {
+        return waitFor(500);
+    }).then(() =&gt; {
+        assert_array_equals(localConnectionStates, [&quot;new&quot;, &quot;connecting&quot;, &quot;connected&quot;]);
+        assert_array_equals(remoteConnectionStates, [&quot;new&quot;, &quot;connecting&quot;, &quot;connected&quot;]);
+        assert_array_equals(localGatheringStates, [&quot;new&quot;, &quot;gathering&quot;, &quot;complete&quot;]);
+        assert_array_equals(remoteGatheringStates, [&quot;new&quot;, &quot;gathering&quot;, &quot;complete&quot;]);
+        assert_array_equals(localIceConnectionStates, [&quot;new&quot;, &quot;checking&quot;, &quot;connected&quot;, &quot;completed&quot;]);
+        assert_array_equals(remoteIceConnectionStates, [&quot;new&quot;, &quot;checking&quot;, &quot;connected&quot;]);
+    });
+}, &quot;Checking various connection state for video exchange&quot;);
+
+promise_test((test) =&gt; {
+    return new Promise((resolve, reject) =&gt; {
+        var pc = new RTCPeerConnection();
+        pc.onconnectionstatechange = () =&gt; {
+            assert_equals(pc.connectionState, &quot;closed&quot;);
+            resolve();
+        };
+        pc.close();
+    })
+}, &quot;Checking connection state event when closing peer connetion&quot;);
+        &lt;/script&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestswebrtcrtcpeerconnectionerrormessagesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> TypeError: The RTCPeerConnection.signalingState getter can only be used on instances of RTCPeerConnection
</span><span class="cx"> TypeError: The RTCPeerConnection.iceGatheringState getter can only be used on instances of RTCPeerConnection
</span><span class="cx"> TypeError: The RTCPeerConnection.iceConnectionState getter can only be used on instances of RTCPeerConnection
</span><del>-[object RTCPeerConnection] has no property named connectionState
</del><ins>+TypeError: The RTCPeerConnection.connectionState getter can only be used on instances of RTCPeerConnection
</ins><span class="cx"> [object RTCPeerConnection] has no property named canTrickleIceCandidates
</span><span class="cx"> [object RTCPeerConnection] has no property named defaultIceServers
</span><span class="cx"> TypeError: Can only call RTCPeerConnection.getConfiguration on instances of RTCPeerConnection
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> TypeError: The RTCPeerConnection.onsignalingstatechange getter can only be used on instances of RTCPeerConnection
</span><span class="cx"> TypeError: The RTCPeerConnection.oniceconnectionstatechange getter can only be used on instances of RTCPeerConnection
</span><span class="cx"> TypeError: The RTCPeerConnection.onicegatheringstatechange getter can only be used on instances of RTCPeerConnection
</span><del>-[object RTCPeerConnection] has no property named onconnectionstatechange
</del><ins>+TypeError: The RTCPeerConnection.onconnectionstatechange getter can only be used on instances of RTCPeerConnection
</ins><span class="cx"> Promise rejected with: TypeError: Can only call RTCPeerConnection.createOffer on instances of RTCPeerConnection
</span><span class="cx"> Promise rejected with: TypeError: Can only call RTCPeerConnection.createAnswer on instances of RTCPeerConnection
</span><span class="cx"> Promise rejected with: TypeError: Can only call RTCPeerConnection.setLocalDescription on instances of RTCPeerConnection
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -249,6 +249,7 @@
</span><span class="cx">     Modules/mediastream/RTCOfferAnswerOptions.idl
</span><span class="cx">     Modules/mediastream/RTCOfferOptions.idl
</span><span class="cx">     Modules/mediastream/RTCPeerConnection.idl
</span><ins>+    Modules/mediastream/RTCPeerConnectionState.idl
</ins><span class="cx">     Modules/mediastream/RTCRtpReceiver.idl
</span><span class="cx">     Modules/mediastream/RTCRtpSender.idl
</span><span class="cx">     Modules/mediastream/RTCRtpTransceiver.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/ChangeLog        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2017-03-22  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Support RTCPeerConnectionState
+        https://bugs.webkit.org/show_bug.cgi?id=169978
+
+        Reviewed by Jon Lee.
+
+        Test: webrtc/connection-state.html
+
+        Implementing https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum.
+        Its state and event is based on changes made to ice gathering state and ice connection state.
+
+        * CMakeLists.txt: Adding RTCPeerConnectionState idl.
+        * DerivedSources.make: Ditto.
+        * Modules/mediastream/RTCPeerConnection.cpp: Splitting close in doClose/doStop so that we can send closed event
+        in case close is called, but not if stopped.
+        (WebCore::RTCPeerConnection::doClose):
+        (WebCore::RTCPeerConnection::close):
+        (WebCore::RTCPeerConnection::stop):
+        (WebCore::RTCPeerConnection::doStop):
+        (WebCore::RTCPeerConnection::updateIceGatheringState):
+        (WebCore::RTCPeerConnection::updateIceConnectionState):
+        (WebCore::RTCPeerConnection::updateConnectionState):
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCPeerConnection.idl: Fixing IDL and minor cosmetic changes
+        * Modules/mediastream/RTCPeerConnection.js:
+        (setLocalDescription): Cosmetic change.
+        (setRemoteDescription):
+        * Modules/mediastream/RTCPeerConnectionState.idl: Added.
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::OnIceGatheringChange): Adding 'gathering' state
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/EventNames.h:
+        * platform/mediastream/RTCPeerConnectionState.h: Added.
+
</ins><span class="cx"> 2017-03-22  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION hit when removing an &lt;input type=&quot;range&quot;&gt; while dragging on iOS
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/DerivedSources.make        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -193,6 +193,7 @@
</span><span class="cx">     $(WebCore)/Modules/mediastream/RTCOfferAnswerOptions.idl \
</span><span class="cx">     $(WebCore)/Modules/mediastream/RTCOfferOptions.idl \
</span><span class="cx">     $(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
</span><ins>+    $(WebCore)/Modules/mediastream/RTCPeerConnectionState.idl \
</ins><span class="cx">     $(WebCore)/Modules/mediastream/RTCRtpReceiver.idl \
</span><span class="cx">     $(WebCore)/Modules/mediastream/RTCRtpSender.idl \
</span><span class="cx">     $(WebCore)/Modules/mediastream/RTCRtpTransceiver.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -353,10 +353,10 @@
</span><span class="cx">     return RTCDataChannel::create(context, WTFMove(channelHandler), WTFMove(label), WTFMove(options));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::close()
</del><ins>+bool RTCPeerConnection::doClose()
</ins><span class="cx"> {
</span><span class="cx">     if (m_signalingState == RTCSignalingState::Closed)
</span><del>-        return;
</del><ins>+        return false;
</ins><span class="cx"> 
</span><span class="cx">     m_iceConnectionState = RTCIceConnectionState::Closed;
</span><span class="cx">     m_signalingState = RTCSignalingState::Closed;
</span><span class="lines">@@ -366,10 +366,20 @@
</span><span class="cx">     for (RTCRtpSender&amp; sender : m_transceiverSet-&gt;senders())
</span><span class="cx">         sender.stop();
</span><span class="cx"> 
</span><del>-    unregisterFromController();
-    unsetPendingActivity(this);
</del><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RTCPeerConnection::close()
+{
+    if (!doClose())
+        return;
+
+    updateConnectionState();
+    scriptExecutionContext()-&gt;postTask([protectedThis = makeRef(*this)](ScriptExecutionContext&amp;) {
+        protectedThis-&gt;doStop();
+    });
+}
+
</ins><span class="cx"> void RTCPeerConnection::emulatePlatformEvent(const String&amp; action)
</span><span class="cx"> {
</span><span class="cx">     m_backend-&gt;emulatePlatformEvent(action);
</span><span class="lines">@@ -377,9 +387,22 @@
</span><span class="cx"> 
</span><span class="cx"> void RTCPeerConnection::stop()
</span><span class="cx"> {
</span><del>-    close();
</del><ins>+    if (!doClose())
+        return;
+
+    doStop();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RTCPeerConnection::doStop()
+{
+    if (m_isStopped)
+        return;
+
+    m_isStopped = true;
+    unregisterFromController();
+    unsetPendingActivity(this);
+}
+
</ins><span class="cx"> RTCController&amp; RTCPeerConnection::rtcController()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(scriptExecutionContext());
</span><span class="lines">@@ -427,6 +450,7 @@
</span><span class="cx"> 
</span><span class="cx">         protectedThis-&gt;m_iceGatheringState = newState;
</span><span class="cx">         protectedThis-&gt;dispatchEvent(Event::create(eventNames().icegatheringstatechangeEvent, false, false));
</span><ins>+        protectedThis-&gt;updateConnectionState();
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -438,9 +462,36 @@
</span><span class="cx"> 
</span><span class="cx">         protectedThis-&gt;m_iceConnectionState = newState;
</span><span class="cx">         protectedThis-&gt;dispatchEvent(Event::create(eventNames().iceconnectionstatechangeEvent, false, false));
</span><ins>+        protectedThis-&gt;updateConnectionState();
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RTCPeerConnection::updateConnectionState()
+{
+    RTCPeerConnectionState state;
+
+    if (m_iceConnectionState == RTCIceConnectionState::New &amp;&amp; m_iceGatheringState == RTCIceGatheringState::New)
+        state = RTCPeerConnectionState::New;
+    else if (m_iceConnectionState == RTCIceConnectionState::Checking || m_iceGatheringState == RTCIceGatheringState::Gathering)
+        state = RTCPeerConnectionState::Connecting;
+    else if ((m_iceConnectionState == RTCIceConnectionState::Completed || m_iceConnectionState == RTCIceConnectionState::Connected) &amp;&amp; m_iceGatheringState == RTCIceGatheringState::Complete)
+        state = RTCPeerConnectionState::Connected;
+    else if (m_iceConnectionState == RTCIceConnectionState::Disconnected)
+        state = RTCPeerConnectionState::Disconnected;
+    else if (m_iceConnectionState == RTCIceConnectionState::Failed)
+        state = RTCPeerConnectionState::Failed;
+    else if (m_iceConnectionState == RTCIceConnectionState::Closed)
+        state = RTCPeerConnectionState::Closed;
+    else
+        return;
+
+    if (state == m_connectionState)
+        return;
+
+    m_connectionState = state;
+    dispatchEvent(Event::create(eventNames().connectionstatechangeEvent, false, false));
+}
+
</ins><span class="cx"> void RTCPeerConnection::scheduleNegotiationNeededEvent()
</span><span class="cx"> {
</span><span class="cx">     scriptExecutionContext()-&gt;postTask([protectedThis = makeRef(*this)](ScriptExecutionContext&amp;) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;RTCDataChannel.h&quot;
</span><span class="cx"> #include &quot;RTCIceConnectionState.h&quot;
</span><span class="cx"> #include &quot;RTCIceGatheringState.h&quot;
</span><ins>+#include &quot;RTCPeerConnectionState.h&quot;
</ins><span class="cx"> #include &quot;RTCRtpTransceiver.h&quot;
</span><span class="cx"> #include &quot;RTCSignalingState.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -89,6 +90,7 @@
</span><span class="cx">     RTCSignalingState signalingState() const { return m_signalingState; }
</span><span class="cx">     RTCIceGatheringState iceGatheringState() const { return m_iceGatheringState; }
</span><span class="cx">     RTCIceConnectionState iceConnectionState() const { return m_iceConnectionState; }
</span><ins>+    RTCPeerConnectionState connectionState() const { return m_connectionState; }
</ins><span class="cx"> 
</span><span class="cx">     const RTCConfiguration&amp; getConfiguration() const { return m_configuration; }
</span><span class="cx">     ExceptionOr&lt;void&gt; setConfiguration(RTCConfiguration&amp;&amp;);
</span><span class="lines">@@ -159,9 +161,15 @@
</span><span class="cx">     // RTCRtpSenderClient
</span><span class="cx">     void replaceTrack(RTCRtpSender&amp;, Ref&lt;MediaStreamTrack&gt;&amp;&amp;, DOMPromise&lt;void&gt;&amp;&amp;) final;
</span><span class="cx"> 
</span><ins>+    void updateConnectionState();
+    bool doClose();
+    void doStop();
+
+    bool m_isStopped { false };
</ins><span class="cx">     RTCSignalingState m_signalingState { RTCSignalingState::Stable };
</span><span class="cx">     RTCIceGatheringState m_iceGatheringState { RTCIceGatheringState::New };
</span><span class="cx">     RTCIceConnectionState m_iceConnectionState { RTCIceConnectionState::New };
</span><ins>+    RTCPeerConnectionState m_connectionState { RTCPeerConnectionState::New };
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;RtpTransceiverSet&gt; m_transceiverSet { std::unique_ptr&lt;RtpTransceiverSet&gt;(new RtpTransceiverSet()) };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -75,8 +75,7 @@
</span><span class="cx">     [JSBuiltin] Promise&lt;RTCSessionDescriptionInit&gt; createOffer(optional RTCOfferOptions offerOptions);
</span><span class="cx">     [JSBuiltin] Promise&lt;RTCSessionDescriptionInit&gt; createAnswer(optional RTCAnswerOptions answerOptions);
</span><span class="cx"> 
</span><del>-    // FIXME 169644: change to RTCSessionDescriptionInit
-    [JSBuiltin] Promise&lt;void&gt; setLocalDescription(RTCSessionDescription description);
</del><ins>+    [JSBuiltin] Promise&lt;void&gt; setLocalDescription(RTCSessionDescriptionInit description);
</ins><span class="cx">     // FIXME 169644: change to nullable
</span><span class="cx">     readonly attribute RTCSessionDescription localDescription;
</span><span class="cx">     // FIXME 169644: change to nullable
</span><span class="lines">@@ -99,8 +98,7 @@
</span><span class="cx">     readonly attribute RTCSignalingState signalingState;
</span><span class="cx">     readonly attribute RTCIceGatheringState iceGatheringState;
</span><span class="cx">     readonly attribute RTCIceConnectionState iceConnectionState;
</span><del>-
-    // FIXME 169644: missing connectionState
</del><ins>+    readonly attribute RTCPeerConnectionState connectionState;
</ins><span class="cx">     // FIXME 169644: missing canTrickleIceCandidates
</span><span class="cx">     // FIXME 169644: missing defaultIceServers
</span><span class="cx"> 
</span><span class="lines">@@ -110,12 +108,11 @@
</span><span class="cx"> 
</span><span class="cx">     attribute EventHandler onnegotiationneeded;
</span><span class="cx">     attribute EventHandler onicecandidate;
</span><del>-    // FIXME 169644: missing onicecandidateerror
</del><span class="cx">     attribute EventHandler onsignalingstatechange;
</span><span class="cx">     attribute EventHandler oniceconnectionstatechange;
</span><span class="cx">     attribute EventHandler onicegatheringstatechange;
</span><del>-    // FIXME 169644: missing onconnectionstatechanged
-    // FIXME 169644: missing onfingerprintfailure
</del><ins>+    attribute EventHandler onconnectionstatechange;
+    // FIXME 169644: missing onfingerprintfailure and onicecandidateerror
</ins><span class="cx"> 
</span><span class="cx">     // Private API used to implement the overloaded operations above. Queued functions are called by runQueuedOperation().
</span><span class="cx">     // See RTCPeerConnectionInternals.js.
</span><span class="lines">@@ -126,11 +123,6 @@
</span><span class="cx">     [PrivateIdentifier] Promise&lt;void&gt; queuedAddIceCandidate(RTCIceCandidate candidate);
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    // 4.3.3.1 Legacy extensions supported
-    // JSBuiltin attributes above handles support of the extensions
-    // FIXME 169646: wrap legacy calls in runtime flag
-
-
</del><span class="cx">     // 4.11 Certificate management
</span><span class="cx">     // FIXME 169644: missing generateCertificate
</span><span class="cx"> 
</span><span class="lines">@@ -144,7 +136,6 @@
</span><span class="cx">     [PrivateIdentifier, PublicIdentifier, MayThrowException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
</span><span class="cx">     [PrivateIdentifier, PublicIdentifier, MayThrowException] void removeTrack(RTCRtpSender sender);
</span><span class="cx"> 
</span><del>-    // FIXME 169644: convert to (MediaStreamTrack or DOMString)
</del><span class="cx">     [MayThrowException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
</span><span class="cx">     [MayThrowException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> 
</span><span class="cx">     const peerConnection = this;
</span><span class="cx"> 
</span><del>-    // FIXME: According the spec, we should throw when receiving a RTCSessionDescription.
</del><ins>+    // FIXME 169644: According the spec, we should throw when receiving a RTCSessionDescription.
</ins><span class="cx">     const objectInfo = {
</span><span class="cx">         &quot;constructor&quot;: @RTCSessionDescription,
</span><span class="cx">         &quot;argName&quot;: &quot;description&quot;,
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx"> 
</span><span class="cx">     const peerConnection = this;
</span><span class="cx"> 
</span><del>-    // FIXME: According the spec, we should throw when receiving a RTCSessionDescription.
</del><ins>+    // FIXME: According the spec, we should only expect RTCSessionDescriptionInit.
</ins><span class="cx">     const objectInfo = {
</span><span class="cx">         &quot;constructor&quot;: @RTCSessionDescription,
</span><span class="cx">         &quot;argName&quot;: &quot;description&quot;,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionStateidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionState.idl (0 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionState.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionState.idl        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=WEB_RTC,
+    EnabledAtRuntime=PeerConnection
+] enum RTCPeerConnectionState {
+    &quot;new&quot;,
+    &quot;connecting&quot;,
+    &quot;connected&quot;,
+    &quot;disconnected&quot;,
+    &quot;failed&quot;,
+    &quot;closed&quot;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -585,13 +585,14 @@
</span><span class="cx"> 
</span><span class="cx"> void LibWebRTCMediaEndpoint::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState state)
</span><span class="cx"> {
</span><del>-    if (state == webrtc::PeerConnectionInterface::kIceGatheringComplete) {
-        callOnMainThread([protectedThis = makeRef(*this)] {
-            if (protectedThis-&gt;isStopped())
-                return;
</del><ins>+    callOnMainThread([protectedThis = makeRef(*this), state] {
+        if (protectedThis-&gt;isStopped())
+            return;
+        if (state == webrtc::PeerConnectionInterface::kIceGatheringComplete)
</ins><span class="cx">             protectedThis-&gt;m_peerConnectionBackend.doneGatheringCandidates();
</span><del>-        });
-    }
</del><ins>+        else if (state == webrtc::PeerConnectionInterface::kIceGatheringGathering)
+            protectedThis-&gt;m_peerConnectionBackend.connection().updateIceGatheringState(RTCIceGatheringState::Gathering);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LibWebRTCMediaEndpoint::OnIceCandidate(const webrtc::IceCandidateInterface *rtcCandidate)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -1465,6 +1465,7 @@
</span><span class="cx">                 319AE064142D6B24006563A1 /* StyleFilterData.h in Headers */ = {isa = PBXBuildFile; fileRef = 319AE062142D6B24006563A1 /* StyleFilterData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 319BDE511E7A860400BA296C /* JSRTCIceTransport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319BDE4F1E7A858A00BA296C /* JSRTCIceTransport.cpp */; };
</span><span class="cx">                 319BDE541E7A86CA00BA296C /* JSRTCIceTransportState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319BDE521E7A86C100BA296C /* JSRTCIceTransportState.cpp */; };
</span><ins>+                319BDE541E7A86CA00BA296D /* JSRTCPeerConnectionState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319BDE521E7A86C100BA296D /* JSRTCPeerConnectionState.cpp */; };
</ins><span class="cx">                 319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 319FBD5D15D2F444009640A6 /* CachedImageClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 31A089041E737D51003B6609 /* WebGPUBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A088C61E737B4D003B6609 /* WebGPUBuffer.cpp */; };
</span><span class="cx">                 31A089051E737D51003B6609 /* WebGPUCommandBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A088C91E737B4D003B6609 /* WebGPUCommandBuffer.cpp */; };
</span><span class="lines">@@ -8982,7 +8983,9 @@
</span><span class="cx">                 319BDE4F1E7A858A00BA296C /* JSRTCIceTransport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceTransport.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 319BDE501E7A858A00BA296C /* JSRTCIceTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceTransport.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 319BDE521E7A86C100BA296C /* JSRTCIceTransportState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceTransportState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                319BDE521E7A86C100BA296D /* JSRTCPeerConnectionState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCPeerConnectionState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 319BDE531E7A86C100BA296C /* JSRTCIceTransportState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceTransportState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                319BDE531E7A86C100BA296D /* JSRTCPeerConnectionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCPeerConnectionState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 319FBD5D15D2F444009640A6 /* CachedImageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedImageClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31A088C41E737B2C003B6609 /* JSWebGPURenderingContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPURenderingContextCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31A088C51E737B2C003B6609 /* JSWebGPURenderPassAttachmentDescriptorCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPURenderPassAttachmentDescriptorCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9323,6 +9326,8 @@
</span><span class="cx">                 41A1B01B1E542396007F3769 /* JSDOMGuardedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGuardedObject.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41A3D58C101C152D00316D07 /* DedicatedWorkerThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DedicatedWorkerThread.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41A3D58D101C152D00316D07 /* DedicatedWorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DedicatedWorkerThread.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                41A48A9C1E83129100D2AC2D /* RTCPeerConnectionState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCPeerConnectionState.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                41A48A9D1E8312EB00D2AC2D /* RTCPeerConnectionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 41ABE6791D0580D5006D862D /* CrossOriginPreflightChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossOriginPreflightChecker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41ABE67A1D0580D5006D862D /* CrossOriginPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossOriginPreflightChecker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41AD75391CEF6BCE00A31486 /* FetchOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchOptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15907,6 +15912,7 @@
</span><span class="cx">                                 316DCB2C1E78F3A9001B5F87 /* RTCAnswerOptions.idl */,
</span><span class="cx">                                 07AB996518DA3C010018771E /* RTCConfiguration.h */,
</span><span class="cx">                                 07AB996618DA3C010018771E /* RTCConfiguration.idl */,
</span><ins>+                                41A48A9C1E83129100D2AC2D /* RTCPeerConnectionState.idl */,
</ins><span class="cx">                                 418205481E53EAAD00D62207 /* RTCController.cpp */,
</span><span class="cx">                                 418205451E53C8CD00D62207 /* RTCController.h */,
</span><span class="cx">                                 07221B6317CEC32700848E51 /* RTCDataChannel.cpp */,
</span><span class="lines">@@ -16020,6 +16026,7 @@
</span><span class="cx">                                 313591021E7DDC6000F30630 /* RTCIceTransportPolicy.h */,
</span><span class="cx">                                 313591031E7DDC6000F30630 /* RTCIceTransportState.h */,
</span><span class="cx">                                 07221BAA17CF0AD400848E51 /* RTCPeerConnectionHandlerClient.h */,
</span><ins>+                                41A48A9D1E8312EB00D2AC2D /* RTCPeerConnectionState.h */,
</ins><span class="cx">                                 31EB54DD1E7DC74400C1623B /* RTCRtpTransceiverDirection.h */,
</span><span class="cx">                                 313591041E7DDC6000F30630 /* RTCSdpType.h */,
</span><span class="cx">                                 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */,
</span><span class="lines">@@ -16171,6 +16178,8 @@
</span><span class="cx">                                 319BDE501E7A858A00BA296C /* JSRTCIceTransport.h */,
</span><span class="cx">                                 319BDE521E7A86C100BA296C /* JSRTCIceTransportState.cpp */,
</span><span class="cx">                                 319BDE531E7A86C100BA296C /* JSRTCIceTransportState.h */,
</span><ins>+                                319BDE521E7A86C100BA296D /* JSRTCPeerConnectionState.cpp */,
+                                319BDE531E7A86C100BA296D /* JSRTCPeerConnectionState.h */,
</ins><span class="cx">                                 316DCB191E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp */,
</span><span class="cx">                                 316DCB1A1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h */,
</span><span class="cx">                                 316DCB2F1E78F496001B5F87 /* JSRTCOfferOptions.cpp */,
</span><span class="lines">@@ -31240,6 +31249,7 @@
</span><span class="cx">                                 0F3C725E1974874B00AEDD0C /* ImageSource.cpp in Sources */,
</span><span class="cx">                                 4B3480930EEF50D400AC1B41 /* ImageSourceCGMac.mm in Sources */,
</span><span class="cx">                                 319BDE541E7A86CA00BA296C /* JSRTCIceTransportState.cpp in Sources */,
</span><ins>+                                319BDE541E7A86CA00BA296D /* JSRTCPeerConnectionState.cpp in Sources */,
</ins><span class="cx">                                 316FE1170E6E1DA700BF6088 /* ImplicitAnimation.cpp in Sources */,
</span><span class="cx">                                 BE961C5418AD338500D07DC5 /* InbandDataTextTrack.cpp in Sources */,
</span><span class="cx">                                 BE16C59217CFE17200852C04 /* InbandGenericTextTrack.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventNames.h (214292 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventNames.h        2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/Source/WebCore/dom/EventNames.h        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     macro(compositionstart) \
</span><span class="cx">     macro(compositionupdate) \
</span><span class="cx">     macro(connect) \
</span><ins>+    macro(connectionstatechange) \
</ins><span class="cx">     macro(connecting) \
</span><span class="cx">     macro(contextmenu) \
</span><span class="cx">     macro(copy) \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRTCPeerConnectionStateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h (0 => 214293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h        2017-03-23 02:44:57 UTC (rev 214293)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+namespace WebCore {
+
+enum class RTCPeerConnectionState {
+    New,
+    Connecting,
+    Connected,
+    Disconnected,
+    Failed,
+    Closed
+};
+
+}; // namespace WebCore
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>