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

Unified Diff: webrtc/p2p/base/transportcontroller.cc

Issue 2285453002: Add parameter to TransportController to not change ICE role on restart. (Closed)
Patch Set: Fixing copy-pasted comment. Created 4 years, 4 months 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/transportcontroller.h ('k') | webrtc/p2p/base/transportcontroller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transportcontroller.cc
diff --git a/webrtc/p2p/base/transportcontroller.cc b/webrtc/p2p/base/transportcontroller.cc
index b5021cceccb73c18592b7a8f8bd7d97861e09cce..ec4c3f129307cf37c097472e0d6b63a97ef48eda 100644
--- a/webrtc/p2p/base/transportcontroller.cc
+++ b/webrtc/p2p/base/transportcontroller.cc
@@ -44,10 +44,20 @@ struct CandidatesData : public rtc::MessageData {
TransportController::TransportController(rtc::Thread* signaling_thread,
rtc::Thread* network_thread,
- PortAllocator* port_allocator)
+ PortAllocator* port_allocator,
+ bool redetermine_role_on_ice_restart)
: signaling_thread_(signaling_thread),
network_thread_(network_thread),
- port_allocator_(port_allocator) {}
+ port_allocator_(port_allocator),
+ redetermine_role_on_ice_restart_(redetermine_role_on_ice_restart) {}
+
+TransportController::TransportController(rtc::Thread* signaling_thread,
+ rtc::Thread* network_thread,
+ PortAllocator* port_allocator)
+ : TransportController(signaling_thread,
+ network_thread,
+ port_allocator,
+ true) {}
TransportController::~TransportController() {
network_thread_->Invoke<void>(
@@ -448,11 +458,12 @@ bool TransportController::SetLocalTransportDescription_n(
// Older versions of Chrome expect the ICE role to be re-determined when an
// ICE restart occurs, and also don't perform conflict resolution correctly,
- // so for now we can't safely stop doing this.
+ // so for now we can't safely stop doing this, unless the application opts in
+ // by setting |redetermine_role_on_ice_restart_| to false.
// See: https://bugs.chromium.org/p/chromium/issues/detail?id=628676
// TODO(deadbeef): Remove this when these old versions of Chrome reach a low
// enough population.
- if (transport->local_description() &&
+ if (redetermine_role_on_ice_restart_ && transport->local_description() &&
IceCredentialsChanged(transport->local_description()->ice_ufrag,
transport->local_description()->ice_pwd,
tdesc.ice_ufrag, tdesc.ice_pwd)) {
« no previous file with comments | « webrtc/p2p/base/transportcontroller.h ('k') | webrtc/p2p/base/transportcontroller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698