Export the standardized IceConnectionState.
Since a lot of native users have taken dependencies on our old, non-standard behaviour
we'll have to have two ice connection states living side by side until we can get rid
of the old one.
Bug: webrtc:6145
Change-Id: I9b673bffeb1dfcf410f7c56d4def5912121e644c
Reviewed-on: https://webrtc-review.googlesource.com/c/113421
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25929}
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index 4a7b051..4be3d2f 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -1041,12 +1041,16 @@
// Returns the current SignalingState.
virtual SignalingState signaling_state() = 0;
- // Returns the aggregate state of all ICE *and* DTLS transports.
- // TODO(jonasolsson): Replace with standardized_ice_connection_state once it
- // is ready, see crbug.com/webrtc/6145
+ // Returns an aggregate state of all ICE *and* DTLS transports.
+ // This is left in place to avoid breaking native clients who expect our old,
+ // nonstandard behavior.
+ // TODO(jonasolsson): deprecate and remove this.
virtual IceConnectionState ice_connection_state() = 0;
- // Returns the aggregated state of all ICE and DTLS transports.
+ // Returns an aggregated state of all ICE transports.
+ virtual IceConnectionState standardized_ice_connection_state();
+
+ // Returns an aggregated state of all ICE and DTLS transports.
virtual PeerConnectionState peer_connection_state();
virtual IceGatheringState ice_gathering_state() = 0;
@@ -1108,15 +1112,21 @@
// has begun.
virtual void OnRenegotiationNeeded() = 0;
- // Called any time the IceConnectionState changes.
+ // Called any time the legacy IceConnectionState changes.
//
// Note that our ICE states lag behind the standard slightly. The most
// notable differences include the fact that "failed" occurs after 15
// seconds, not 30, and this actually represents a combination ICE + DTLS
// state, so it may be "failed" if DTLS fails while ICE succeeds.
+ //
+ // TODO(jonasolsson): deprecate and remove this.
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) = 0;
+ // Called any time the standards-compliant IceConnectionState changes.
+ virtual void OnStandardizedIceConnectionChange(
+ PeerConnectionInterface::IceConnectionState new_state) {}
+
// Called any time the PeerConnectionState changes.
virtual void OnConnectionChange(
PeerConnectionInterface::PeerConnectionState new_state) {}