Diff
Modified: trunk/LayoutTests/ChangeLog (214292 => 214293)
--- trunk/LayoutTests/ChangeLog 2017-03-23 02:37:08 UTC (rev 214292)
+++ trunk/LayoutTests/ChangeLog 2017-03-23 02:44:57 UTC (rev 214293)
@@ -1,3 +1,14 @@
+2017-03-22 Youenn Fablet <[email protected]>
+
+ 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:
+
2017-03-22 Carlos Alberto Lopez Perez <[email protected]>
[GTK] Enable CSS filters related tests.
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (214292 => 214293)
--- 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)
@@ -1,3 +1,12 @@
+2017-03-22 Youenn Fablet <[email protected]>
+
+ Support RTCPeerConnectionState
+ https://bugs.webkit.org/show_bug.cgi?id=169978
+
+ Reviewed by Jon Lee.
+
+ * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
+
2017-03-22 Chris Dumez <[email protected]>
WebKit should disallow beforeunload alerts from web pages users have never interacted with
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt (214292 => 214293)
--- 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)
@@ -100,6 +100,6 @@
PASS signalingState initial value
PASS iceGatheringState initial value
PASS iceConnectionState initial value
-FAIL connectionState initial value assert_equals: expected (string) "new" but got (undefined) undefined
+PASS connectionState initial value
FAIL canTrickleIceCandidates initial value assert_equals: expected (object) null but got (undefined) undefined
Added: trunk/LayoutTests/webrtc/connection-state-expected.txt (0 => 214293)
--- 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)
@@ -0,0 +1,4 @@
+
+PASS Checking various connection state for video exchange
+PASS Checking connection state event when closing peer connetion
+
Added: trunk/LayoutTests/webrtc/connection-state.html (0 => 214293)
--- trunk/LayoutTests/webrtc/connection-state.html (rev 0)
+++ trunk/LayoutTests/webrtc/connection-state.html 2017-03-23 02:44:57 UTC (rev 214293)
@@ -0,0 +1,83 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Testing basic video exchange from offerer to receiver</title>
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script src =""
+ <script>
+promise_test((test) => {
+ if (window.testRunner)
+ testRunner.setUserMediaPermission(true);
+
+ var firstConnection, secondConnection;
+ var localConnectionStates = ["new"];
+ var remoteConnectionStates = ["new"];
+ var localIceConnectionStates = ["new"];
+ var remoteIceConnectionStates = ["new"];
+ var localGatheringStates = ["new"];
+ var remoteGatheringStates = ["new"];
+ return navigator.mediaDevices.getUserMedia({ video: true}).then((stream) => {
+ return new Promise((resolve, reject) => {
+ if (window.internals)
+ internals.useMockRTCPeerConnectionFactory("TwoRealPeerConnections");
+
+ createConnections((connection) => {
+ firstConnection = connection;
+ firstConnection.addTrack(stream.getVideoTracks()[0], stream);
+ assert_equals(firstConnection.connectionState, "new");
+ firstConnection._onconnectionstatechange_ = () => {
+ localConnectionStates.push(firstConnection.connectionState);
+ }
+ firstConnection._onicegatheringstatechange_ = () => {
+ localGatheringStates.push(firstConnection.iceGatheringState);
+ }
+ firstConnection._oniceconnectionstatechange_ = () => {
+ localIceConnectionStates.push(firstConnection.iceConnectionState);
+ }
+ }, (connection) => {
+ secondConnection = connection;
+ assert_equals(secondConnection.connectionState, "new");
+ secondConnection._onconnectionstatechange_ = () => {
+ remoteConnectionStates.push(secondConnection.connectionState);
+ }
+ secondConnection._onicegatheringstatechange_ = () => {
+ remoteGatheringStates.push(secondConnection.iceGatheringState);
+ }
+ secondConnection._oniceconnectionstatechange_ = () => {
+ remoteIceConnectionStates.push(secondConnection.iceConnectionState);
+ }
+ secondConnection._ontrack_ = (trackEvent) => {
+ resolve(trackEvent.streams[0]);
+ };
+ });
+ setTimeout(() => reject("Test timed out"), 5000);
+ });
+ }).then((stream) => {
+ return waitFor(500);
+ }).then(() => {
+ assert_array_equals(localConnectionStates, ["new", "connecting", "connected"]);
+ assert_array_equals(remoteConnectionStates, ["new", "connecting", "connected"]);
+ assert_array_equals(localGatheringStates, ["new", "gathering", "complete"]);
+ assert_array_equals(remoteGatheringStates, ["new", "gathering", "complete"]);
+ assert_array_equals(localIceConnectionStates, ["new", "checking", "connected", "completed"]);
+ assert_array_equals(remoteIceConnectionStates, ["new", "checking", "connected"]);
+ });
+}, "Checking various connection state for video exchange");
+
+promise_test((test) => {
+ return new Promise((resolve, reject) => {
+ var pc = new RTCPeerConnection();
+ pc._onconnectionstatechange_ = () => {
+ assert_equals(pc.connectionState, "closed");
+ resolve();
+ };
+ pc.close();
+ })
+}, "Checking connection state event when closing peer connetion");
+ </script>
+ </body>
+</html>
Modified: trunk/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt (214292 => 214293)
--- 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)
@@ -7,7 +7,7 @@
TypeError: The RTCPeerConnection.signalingState getter can only be used on instances of RTCPeerConnection
TypeError: The RTCPeerConnection.iceGatheringState getter can only be used on instances of RTCPeerConnection
TypeError: The RTCPeerConnection.iceConnectionState getter can only be used on instances of RTCPeerConnection
-[object RTCPeerConnection] has no property named connectionState
+TypeError: The RTCPeerConnection.connectionState getter can only be used on instances of RTCPeerConnection
[object RTCPeerConnection] has no property named canTrickleIceCandidates
[object RTCPeerConnection] has no property named defaultIceServers
TypeError: Can only call RTCPeerConnection.getConfiguration on instances of RTCPeerConnection
@@ -19,7 +19,7 @@
TypeError: The RTCPeerConnection.onsignalingstatechange getter can only be used on instances of RTCPeerConnection
TypeError: The RTCPeerConnection.oniceconnectionstatechange getter can only be used on instances of RTCPeerConnection
TypeError: The RTCPeerConnection.onicegatheringstatechange getter can only be used on instances of RTCPeerConnection
-[object RTCPeerConnection] has no property named onconnectionstatechange
+TypeError: The RTCPeerConnection.onconnectionstatechange getter can only be used on instances of RTCPeerConnection
Promise rejected with: TypeError: Can only call RTCPeerConnection.createOffer on instances of RTCPeerConnection
Promise rejected with: TypeError: Can only call RTCPeerConnection.createAnswer on instances of RTCPeerConnection
Promise rejected with: TypeError: Can only call RTCPeerConnection.setLocalDescription on instances of RTCPeerConnection
Modified: trunk/Source/WebCore/CMakeLists.txt (214292 => 214293)
--- 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)
@@ -249,6 +249,7 @@
Modules/mediastream/RTCOfferAnswerOptions.idl
Modules/mediastream/RTCOfferOptions.idl
Modules/mediastream/RTCPeerConnection.idl
+ Modules/mediastream/RTCPeerConnectionState.idl
Modules/mediastream/RTCRtpReceiver.idl
Modules/mediastream/RTCRtpSender.idl
Modules/mediastream/RTCRtpTransceiver.idl
Modified: trunk/Source/WebCore/ChangeLog (214292 => 214293)
--- 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)
@@ -1,3 +1,38 @@
+2017-03-22 Youenn Fablet <[email protected]>
+
+ 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.
+
2017-03-22 Jiewen Tan <[email protected]>
ASSERT_WITH_SECURITY_IMPLICATION hit when removing an <input type="range"> while dragging on iOS
Modified: trunk/Source/WebCore/DerivedSources.make (214292 => 214293)
--- 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)
@@ -193,6 +193,7 @@
$(WebCore)/Modules/mediastream/RTCOfferAnswerOptions.idl \
$(WebCore)/Modules/mediastream/RTCOfferOptions.idl \
$(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
+ $(WebCore)/Modules/mediastream/RTCPeerConnectionState.idl \
$(WebCore)/Modules/mediastream/RTCRtpReceiver.idl \
$(WebCore)/Modules/mediastream/RTCRtpSender.idl \
$(WebCore)/Modules/mediastream/RTCRtpTransceiver.idl \
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (214292 => 214293)
--- 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)
@@ -353,10 +353,10 @@
return RTCDataChannel::create(context, WTFMove(channelHandler), WTFMove(label), WTFMove(options));
}
-void RTCPeerConnection::close()
+bool RTCPeerConnection::doClose()
{
if (m_signalingState == RTCSignalingState::Closed)
- return;
+ return false;
m_iceConnectionState = RTCIceConnectionState::Closed;
m_signalingState = RTCSignalingState::Closed;
@@ -366,10 +366,20 @@
for (RTCRtpSender& sender : m_transceiverSet->senders())
sender.stop();
- unregisterFromController();
- unsetPendingActivity(this);
+ return true;
}
+void RTCPeerConnection::close()
+{
+ if (!doClose())
+ return;
+
+ updateConnectionState();
+ scriptExecutionContext()->postTask([protectedThis = makeRef(*this)](ScriptExecutionContext&) {
+ protectedThis->doStop();
+ });
+}
+
void RTCPeerConnection::emulatePlatformEvent(const String& action)
{
m_backend->emulatePlatformEvent(action);
@@ -377,9 +387,22 @@
void RTCPeerConnection::stop()
{
- close();
+ if (!doClose())
+ return;
+
+ doStop();
}
+void RTCPeerConnection::doStop()
+{
+ if (m_isStopped)
+ return;
+
+ m_isStopped = true;
+ unregisterFromController();
+ unsetPendingActivity(this);
+}
+
RTCController& RTCPeerConnection::rtcController()
{
ASSERT(scriptExecutionContext());
@@ -427,6 +450,7 @@
protectedThis->m_iceGatheringState = newState;
protectedThis->dispatchEvent(Event::create(eventNames().icegatheringstatechangeEvent, false, false));
+ protectedThis->updateConnectionState();
});
}
@@ -438,9 +462,36 @@
protectedThis->m_iceConnectionState = newState;
protectedThis->dispatchEvent(Event::create(eventNames().iceconnectionstatechangeEvent, false, false));
+ protectedThis->updateConnectionState();
});
}
+void RTCPeerConnection::updateConnectionState()
+{
+ RTCPeerConnectionState state;
+
+ if (m_iceConnectionState == RTCIceConnectionState::New && 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) && 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));
+}
+
void RTCPeerConnection::scheduleNegotiationNeededEvent()
{
scriptExecutionContext()->postTask([protectedThis = makeRef(*this)](ScriptExecutionContext&) {
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (214292 => 214293)
--- 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)
@@ -42,6 +42,7 @@
#include "RTCDataChannel.h"
#include "RTCIceConnectionState.h"
#include "RTCIceGatheringState.h"
+#include "RTCPeerConnectionState.h"
#include "RTCRtpTransceiver.h"
#include "RTCSignalingState.h"
@@ -89,6 +90,7 @@
RTCSignalingState signalingState() const { return m_signalingState; }
RTCIceGatheringState iceGatheringState() const { return m_iceGatheringState; }
RTCIceConnectionState iceConnectionState() const { return m_iceConnectionState; }
+ RTCPeerConnectionState connectionState() const { return m_connectionState; }
const RTCConfiguration& getConfiguration() const { return m_configuration; }
ExceptionOr<void> setConfiguration(RTCConfiguration&&);
@@ -159,9 +161,15 @@
// RTCRtpSenderClient
void replaceTrack(RTCRtpSender&, Ref<MediaStreamTrack>&&, DOMPromise<void>&&) final;
+ void updateConnectionState();
+ bool doClose();
+ void doStop();
+
+ bool m_isStopped { false };
RTCSignalingState m_signalingState { RTCSignalingState::Stable };
RTCIceGatheringState m_iceGatheringState { RTCIceGatheringState::New };
RTCIceConnectionState m_iceConnectionState { RTCIceConnectionState::New };
+ RTCPeerConnectionState m_connectionState { RTCPeerConnectionState::New };
std::unique_ptr<RtpTransceiverSet> m_transceiverSet { std::unique_ptr<RtpTransceiverSet>(new RtpTransceiverSet()) };
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (214292 => 214293)
--- 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)
@@ -75,8 +75,7 @@
[JSBuiltin] Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions offerOptions);
[JSBuiltin] Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions answerOptions);
- // FIXME 169644: change to RTCSessionDescriptionInit
- [JSBuiltin] Promise<void> setLocalDescription(RTCSessionDescription description);
+ [JSBuiltin] Promise<void> setLocalDescription(RTCSessionDescriptionInit description);
// FIXME 169644: change to nullable
readonly attribute RTCSessionDescription localDescription;
// FIXME 169644: change to nullable
@@ -99,8 +98,7 @@
readonly attribute RTCSignalingState signalingState;
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCIceConnectionState iceConnectionState;
-
- // FIXME 169644: missing connectionState
+ readonly attribute RTCPeerConnectionState connectionState;
// FIXME 169644: missing canTrickleIceCandidates
// FIXME 169644: missing defaultIceServers
@@ -110,12 +108,11 @@
attribute EventHandler onnegotiationneeded;
attribute EventHandler onicecandidate;
- // FIXME 169644: missing onicecandidateerror
attribute EventHandler onsignalingstatechange;
attribute EventHandler oniceconnectionstatechange;
attribute EventHandler onicegatheringstatechange;
- // FIXME 169644: missing onconnectionstatechanged
- // FIXME 169644: missing onfingerprintfailure
+ attribute EventHandler onconnectionstatechange;
+ // FIXME 169644: missing onfingerprintfailure and onicecandidateerror
// Private API used to implement the overloaded operations above. Queued functions are called by runQueuedOperation().
// See RTCPeerConnectionInternals.js.
@@ -126,11 +123,6 @@
[PrivateIdentifier] Promise<void> queuedAddIceCandidate(RTCIceCandidate candidate);
- // 4.3.3.1 Legacy extensions supported
- // JSBuiltin attributes above handles support of the extensions
- // FIXME 169646: wrap legacy calls in runtime flag
-
-
// 4.11 Certificate management
// FIXME 169644: missing generateCertificate
@@ -144,7 +136,6 @@
[PrivateIdentifier, PublicIdentifier, MayThrowException] RTCRtpSender addTrack(MediaStreamTrack track, MediaStream... streams);
[PrivateIdentifier, PublicIdentifier, MayThrowException] void removeTrack(RTCRtpSender sender);
- // FIXME 169644: convert to (MediaStreamTrack or DOMString)
[MayThrowException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
[MayThrowException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js (214292 => 214293)
--- 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)
@@ -184,7 +184,7 @@
const peerConnection = this;
- // FIXME: According the spec, we should throw when receiving a RTCSessionDescription.
+ // FIXME 169644: According the spec, we should throw when receiving a RTCSessionDescription.
const objectInfo = {
"constructor": @RTCSessionDescription,
"argName": "description",
@@ -215,7 +215,7 @@
const peerConnection = this;
- // FIXME: According the spec, we should throw when receiving a RTCSessionDescription.
+ // FIXME: According the spec, we should only expect RTCSessionDescriptionInit.
const objectInfo = {
"constructor": @RTCSessionDescription,
"argName": "description",
Added: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionState.idl (0 => 214293)
--- 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)
@@ -0,0 +1,36 @@
+/*
+ * 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 {
+ "new",
+ "connecting",
+ "connected",
+ "disconnected",
+ "failed",
+ "closed"
+};
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (214292 => 214293)
--- 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)
@@ -585,13 +585,14 @@
void LibWebRTCMediaEndpoint::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState state)
{
- if (state == webrtc::PeerConnectionInterface::kIceGatheringComplete) {
- callOnMainThread([protectedThis = makeRef(*this)] {
- if (protectedThis->isStopped())
- return;
+ callOnMainThread([protectedThis = makeRef(*this), state] {
+ if (protectedThis->isStopped())
+ return;
+ if (state == webrtc::PeerConnectionInterface::kIceGatheringComplete)
protectedThis->m_peerConnectionBackend.doneGatheringCandidates();
- });
- }
+ else if (state == webrtc::PeerConnectionInterface::kIceGatheringGathering)
+ protectedThis->m_peerConnectionBackend.connection().updateIceGatheringState(RTCIceGatheringState::Gathering);
+ });
}
void LibWebRTCMediaEndpoint::OnIceCandidate(const webrtc::IceCandidateInterface *rtcCandidate)
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (214292 => 214293)
--- 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)
@@ -1465,6 +1465,7 @@
319AE064142D6B24006563A1 /* StyleFilterData.h in Headers */ = {isa = PBXBuildFile; fileRef = 319AE062142D6B24006563A1 /* StyleFilterData.h */; settings = {ATTRIBUTES = (Private, ); }; };
319BDE511E7A860400BA296C /* JSRTCIceTransport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319BDE4F1E7A858A00BA296C /* JSRTCIceTransport.cpp */; };
319BDE541E7A86CA00BA296C /* JSRTCIceTransportState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319BDE521E7A86C100BA296C /* JSRTCIceTransportState.cpp */; };
+ 319BDE541E7A86CA00BA296D /* JSRTCPeerConnectionState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319BDE521E7A86C100BA296D /* JSRTCPeerConnectionState.cpp */; };
319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 319FBD5D15D2F444009640A6 /* CachedImageClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
31A089041E737D51003B6609 /* WebGPUBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A088C61E737B4D003B6609 /* WebGPUBuffer.cpp */; };
31A089051E737D51003B6609 /* WebGPUCommandBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A088C91E737B4D003B6609 /* WebGPUCommandBuffer.cpp */; };
@@ -8982,7 +8983,9 @@
319BDE4F1E7A858A00BA296C /* JSRTCIceTransport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceTransport.cpp; sourceTree = "<group>"; };
319BDE501E7A858A00BA296C /* JSRTCIceTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceTransport.h; sourceTree = "<group>"; };
319BDE521E7A86C100BA296C /* JSRTCIceTransportState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCIceTransportState.cpp; sourceTree = "<group>"; };
+ 319BDE521E7A86C100BA296D /* JSRTCPeerConnectionState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCPeerConnectionState.cpp; sourceTree = "<group>"; };
319BDE531E7A86C100BA296C /* JSRTCIceTransportState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceTransportState.h; sourceTree = "<group>"; };
+ 319BDE531E7A86C100BA296D /* JSRTCPeerConnectionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCPeerConnectionState.h; sourceTree = "<group>"; };
319FBD5D15D2F444009640A6 /* CachedImageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedImageClient.h; sourceTree = "<group>"; };
31A088C41E737B2C003B6609 /* JSWebGPURenderingContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPURenderingContextCustom.cpp; sourceTree = "<group>"; };
31A088C51E737B2C003B6609 /* JSWebGPURenderPassAttachmentDescriptorCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPURenderPassAttachmentDescriptorCustom.cpp; sourceTree = "<group>"; };
@@ -9323,6 +9326,8 @@
41A1B01B1E542396007F3769 /* JSDOMGuardedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGuardedObject.cpp; sourceTree = "<group>"; };
41A3D58C101C152D00316D07 /* DedicatedWorkerThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DedicatedWorkerThread.cpp; sourceTree = "<group>"; };
41A3D58D101C152D00316D07 /* DedicatedWorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DedicatedWorkerThread.h; sourceTree = "<group>"; };
+ 41A48A9C1E83129100D2AC2D /* RTCPeerConnectionState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCPeerConnectionState.idl; sourceTree = "<group>"; };
+ 41A48A9D1E8312EB00D2AC2D /* RTCPeerConnectionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionState.h; sourceTree = "<group>"; };
41ABE6791D0580D5006D862D /* CrossOriginPreflightChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossOriginPreflightChecker.cpp; sourceTree = "<group>"; };
41ABE67A1D0580D5006D862D /* CrossOriginPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossOriginPreflightChecker.h; sourceTree = "<group>"; };
41AD75391CEF6BCE00A31486 /* FetchOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchOptions.h; sourceTree = "<group>"; };
@@ -15907,6 +15912,7 @@
316DCB2C1E78F3A9001B5F87 /* RTCAnswerOptions.idl */,
07AB996518DA3C010018771E /* RTCConfiguration.h */,
07AB996618DA3C010018771E /* RTCConfiguration.idl */,
+ 41A48A9C1E83129100D2AC2D /* RTCPeerConnectionState.idl */,
418205481E53EAAD00D62207 /* RTCController.cpp */,
418205451E53C8CD00D62207 /* RTCController.h */,
07221B6317CEC32700848E51 /* RTCDataChannel.cpp */,
@@ -16020,6 +16026,7 @@
313591021E7DDC6000F30630 /* RTCIceTransportPolicy.h */,
313591031E7DDC6000F30630 /* RTCIceTransportState.h */,
07221BAA17CF0AD400848E51 /* RTCPeerConnectionHandlerClient.h */,
+ 41A48A9D1E8312EB00D2AC2D /* RTCPeerConnectionState.h */,
31EB54DD1E7DC74400C1623B /* RTCRtpTransceiverDirection.h */,
313591041E7DDC6000F30630 /* RTCSdpType.h */,
07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */,
@@ -16171,6 +16178,8 @@
319BDE501E7A858A00BA296C /* JSRTCIceTransport.h */,
319BDE521E7A86C100BA296C /* JSRTCIceTransportState.cpp */,
319BDE531E7A86C100BA296C /* JSRTCIceTransportState.h */,
+ 319BDE521E7A86C100BA296D /* JSRTCPeerConnectionState.cpp */,
+ 319BDE531E7A86C100BA296D /* JSRTCPeerConnectionState.h */,
316DCB191E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp */,
316DCB1A1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h */,
316DCB2F1E78F496001B5F87 /* JSRTCOfferOptions.cpp */,
@@ -31240,6 +31249,7 @@
0F3C725E1974874B00AEDD0C /* ImageSource.cpp in Sources */,
4B3480930EEF50D400AC1B41 /* ImageSourceCGMac.mm in Sources */,
319BDE541E7A86CA00BA296C /* JSRTCIceTransportState.cpp in Sources */,
+ 319BDE541E7A86CA00BA296D /* JSRTCPeerConnectionState.cpp in Sources */,
316FE1170E6E1DA700BF6088 /* ImplicitAnimation.cpp in Sources */,
BE961C5418AD338500D07DC5 /* InbandDataTextTrack.cpp in Sources */,
BE16C59217CFE17200852C04 /* InbandGenericTextTrack.cpp in Sources */,
Modified: trunk/Source/WebCore/dom/EventNames.h (214292 => 214293)
--- 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)
@@ -83,6 +83,7 @@
macro(compositionstart) \
macro(compositionupdate) \
macro(connect) \
+ macro(connectionstatechange) \
macro(connecting) \
macro(contextmenu) \
macro(copy) \
Added: trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h (0 => 214293)
--- 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)
@@ -0,0 +1,42 @@
+/*
+ * 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