[PeerConnection] Implement restartIce().
This is part of "Perfect Negotiation" (https://crbug.com/980872).
Spec PR here (merged): https://github.com/w3c/webrtc-pc/pull/2169
Spec: https://w3c.github.io/webrtc-pc/#dfn-localufragstoreplace
The restartIce() makes the next createOffer() generate new ICE
credentials, as if {iceRestart:true} was passed in as options. It also
causes negotiationneeded. This is better than manually restarting ICE
because it survives rollbacks (when that is implemented) and
restartIce() can be called regardless of current signalingState.
Bug: chromium:980881
Change-Id: I8e70bec31ce9d4d6a303bd35e91b2dcc28fcad60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144941
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28596}
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index 69935d2..8ffb8ae 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -935,6 +935,14 @@
virtual const SessionDescriptionInterface* pending_local_description() const;
virtual const SessionDescriptionInterface* pending_remote_description() const;
+ // Tells the PeerConnection that ICE should be restarted. This triggers a need
+ // for negotiation and subsequent CreateOffer() calls will act as if
+ // RTCOfferAnswerOptions::ice_restart is true.
+ // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-restartice
+ // TODO(hbos): Remove default implementation when downstream projects
+ // implement this.
+ virtual void RestartIce() {}
+
// Create a new offer.
// The CreateSessionDescriptionObserver callback will be called when done.
virtual void CreateOffer(CreateSessionDescriptionObserver* observer,