Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: webrtc/api/webrtcsessiondescriptionfactory.cc

Issue 2563153002: Implement the "needs-ice-restart" logic for SetConfiguration. (Closed)
Patch Set: Fixing signed/unsigned comparison warning. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/webrtcsession.cc ('k') | webrtc/p2p/base/jseptransport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsessiondescriptionfactory.cc
diff --git a/webrtc/api/webrtcsessiondescriptionfactory.cc b/webrtc/api/webrtcsessiondescriptionfactory.cc
index 29da6f2c022bf5dfc34b525833bb4ff716ac2cac..1f811f59117afd539e2349d5010c52fd0aa0fc22 100644
--- a/webrtc/api/webrtcsessiondescriptionfactory.cc
+++ b/webrtc/api/webrtcsessiondescriptionfactory.cc
@@ -338,6 +338,18 @@ void WebRtcSessionDescriptionFactory::OnMessage(rtc::Message* msg) {
void WebRtcSessionDescriptionFactory::InternalCreateOffer(
CreateSessionDescriptionRequest request) {
+ if (session_->local_description()) {
+ for (const cricket::TransportInfo& transport :
+ session_->local_description()->description()->transport_infos()) {
+ // If the needs-ice-restart flag is set as described by JSEP, we should
+ // generate an offer with a new ufrag/password to trigger an ICE restart.
+ if (session_->NeedsIceRestart(transport.content_name)) {
+ request.options.transport_options[transport.content_name].ice_restart =
+ true;
+ }
+ }
+ }
+
cricket::SessionDescription* desc(session_desc_factory_.CreateOffer(
request.options, session_->local_description()
? session_->local_description()->description()
« no previous file with comments | « webrtc/api/webrtcsession.cc ('k') | webrtc/p2p/base/jseptransport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698