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

Unified Diff: webrtc/p2p/base/jseptransport.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/p2p/base/jseptransport.h ('k') | webrtc/p2p/base/jseptransport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/jseptransport.cc
diff --git a/webrtc/p2p/base/jseptransport.cc b/webrtc/p2p/base/jseptransport.cc
index abfe0449a48f93e9d5a15806133f7d17e01e43be..bf4d86c3afc85db76bd62b1fee91595c764bc6e4 100644
--- a/webrtc/p2p/base/jseptransport.cc
+++ b/webrtc/p2p/base/jseptransport.cc
@@ -176,6 +176,11 @@ bool JsepTransport::SetLocalTransportDescription(
error_desc);
}
+ bool ice_restarting =
+ local_description_set_ &&
+ IceCredentialsChanged(local_description_->ice_ufrag,
+ local_description_->ice_pwd, description.ice_ufrag,
+ description.ice_pwd);
local_description_.reset(new TransportDescription(description));
rtc::SSLFingerprint* local_fp =
@@ -199,11 +204,17 @@ bool JsepTransport::SetLocalTransportDescription(
if (action == CA_PRANSWER || action == CA_ANSWER) {
ret &= NegotiateTransportDescription(action, error_desc);
}
- if (ret) {
- local_description_set_ = true;
+ if (!ret) {
+ return false;
}
- return ret;
+ if (needs_ice_restart_ && ice_restarting) {
+ needs_ice_restart_ = false;
+ LOG(LS_VERBOSE) << "needs-ice-restart flag cleared for transport " << mid();
+ }
+
+ local_description_set_ = true;
+ return true;
}
bool JsepTransport::SetRemoteTransportDescription(
@@ -233,6 +244,17 @@ bool JsepTransport::SetRemoteTransportDescription(
return ret;
}
+void JsepTransport::SetNeedsIceRestartFlag() {
+ if (!needs_ice_restart_) {
+ needs_ice_restart_ = true;
+ LOG(LS_VERBOSE) << "needs-ice-restart flag set for transport " << mid();
+ }
+}
+
+bool JsepTransport::NeedsIceRestart() const {
+ return needs_ice_restart_;
+}
+
void JsepTransport::GetSslRole(rtc::SSLRole* ssl_role) const {
RTC_DCHECK(ssl_role);
*ssl_role = secure_role_;
« no previous file with comments | « webrtc/p2p/base/jseptransport.h ('k') | webrtc/p2p/base/jseptransport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698