[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}
This commit is contained in:
Henrik Boström
2019-07-18 11:16:56 +02:00
committed by Commit Bot
parent b41d5f1f40
commit 79b6980020
6 changed files with 333 additions and 11 deletions

View File

@ -935,6 +935,14 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
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,