diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc index c493f40c9c..c675015ac9 100644 --- a/webrtc/api/peerconnection.cc +++ b/webrtc/api/peerconnection.cc @@ -568,6 +568,7 @@ PeerConnection::PeerConnection(PeerConnectionFactory* factory) observer_(NULL), uma_observer_(NULL), signaling_state_(kStable), + ice_state_(kIceNew), ice_connection_state_(kIceConnectionNew), ice_gathering_state_(kIceGatheringNew), rtcp_cname_(GenerateRtcpCname()), @@ -887,6 +888,10 @@ PeerConnectionInterface::SignalingState PeerConnection::signaling_state() { return signaling_state_; } +PeerConnectionInterface::IceState PeerConnection::ice_state() { + return ice_state_; +} + PeerConnectionInterface::IceConnectionState PeerConnection::ice_connection_state() { return ice_connection_state_; diff --git a/webrtc/api/peerconnection.h b/webrtc/api/peerconnection.h index a777c72629..c4a9a60053 100644 --- a/webrtc/api/peerconnection.h +++ b/webrtc/api/peerconnection.h @@ -105,6 +105,8 @@ class PeerConnection : public PeerConnectionInterface, SignalingState signaling_state() override; + // TODO(bemasc): Remove ice_state() when callers are removed. + IceState ice_state() override; IceConnectionState ice_connection_state() override; IceGatheringState ice_gathering_state() override; @@ -379,6 +381,8 @@ class PeerConnection : public PeerConnectionInterface, PeerConnectionObserver* observer_; UMAObserver* uma_observer_; SignalingState signaling_state_; + // TODO(bemasc): Remove ice_state_. + IceState ice_state_; IceConnectionState ice_connection_state_; IceGatheringState ice_gathering_state_; diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h index 8f40a55f92..fdf9cef51e 100644 --- a/webrtc/api/peerconnectioninterface.h +++ b/webrtc/api/peerconnectioninterface.h @@ -151,6 +151,19 @@ class PeerConnectionInterface : public rtc::RefCountInterface { kClosed, }; + // TODO(bemasc): Remove IceState when callers are changed to + // IceConnection/GatheringState. + enum IceState { + kIceNew, + kIceGathering, + kIceWaiting, + kIceChecking, + kIceConnected, + kIceCompleted, + kIceFailed, + kIceClosed, + }; + enum IceGatheringState { kIceGatheringNew, kIceGatheringGathering, @@ -474,6 +487,10 @@ class PeerConnectionInterface : public rtc::RefCountInterface { // Returns the current SignalingState. virtual SignalingState signaling_state() = 0; + // TODO(bemasc): Remove ice_state when callers are changed to + // IceConnection/GatheringState. + // Returns the current IceState. + virtual IceState ice_state() = 0; virtual IceConnectionState ice_connection_state() = 0; virtual IceGatheringState ice_gathering_state() = 0; diff --git a/webrtc/api/peerconnectionproxy.h b/webrtc/api/peerconnectionproxy.h index 2e827802bb..37f2e89f9b 100644 --- a/webrtc/api/peerconnectionproxy.h +++ b/webrtc/api/peerconnectionproxy.h @@ -71,6 +71,7 @@ BEGIN_SIGNALING_PROXY_MAP(PeerConnection) const std::vector&); PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*) PROXY_METHOD0(SignalingState, signaling_state) + PROXY_METHOD0(IceState, ice_state) PROXY_METHOD0(IceConnectionState, ice_connection_state) PROXY_METHOD0(IceGatheringState, ice_gathering_state) PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)