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

Side by Side 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, 3 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 26 matching lines...) Expand all
37 CandidatesData(const std::string& transport_name, 37 CandidatesData(const std::string& transport_name,
38 const Candidates& candidates) 38 const Candidates& candidates)
39 : transport_name(transport_name), candidates(candidates) {} 39 : transport_name(transport_name), candidates(candidates) {}
40 40
41 std::string transport_name; 41 std::string transport_name;
42 Candidates candidates; 42 Candidates candidates;
43 }; 43 };
44 44
45 TransportController::TransportController(rtc::Thread* signaling_thread, 45 TransportController::TransportController(rtc::Thread* signaling_thread,
46 rtc::Thread* network_thread, 46 rtc::Thread* network_thread,
47 PortAllocator* port_allocator,
48 bool redetermine_role_on_ice_restart)
49 : signaling_thread_(signaling_thread),
50 network_thread_(network_thread),
51 port_allocator_(port_allocator),
52 redetermine_role_on_ice_restart_(redetermine_role_on_ice_restart) {}
53
54 TransportController::TransportController(rtc::Thread* signaling_thread,
55 rtc::Thread* network_thread,
47 PortAllocator* port_allocator) 56 PortAllocator* port_allocator)
48 : signaling_thread_(signaling_thread), 57 : TransportController(signaling_thread,
49 network_thread_(network_thread), 58 network_thread,
50 port_allocator_(port_allocator) {} 59 port_allocator,
60 true) {}
51 61
52 TransportController::~TransportController() { 62 TransportController::~TransportController() {
53 network_thread_->Invoke<void>( 63 network_thread_->Invoke<void>(
54 RTC_FROM_HERE, 64 RTC_FROM_HERE,
55 rtc::Bind(&TransportController::DestroyAllTransports_n, this)); 65 rtc::Bind(&TransportController::DestroyAllTransports_n, this));
56 signaling_thread_->Clear(this); 66 signaling_thread_->Clear(this);
57 } 67 }
58 68
59 bool TransportController::SetSslMaxProtocolVersion( 69 bool TransportController::SetSslMaxProtocolVersion(
60 rtc::SSLProtocolVersion version) { 70 rtc::SSLProtocolVersion version) {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if (!transport) { 451 if (!transport) {
442 // If we didn't find a transport, that's not an error; 452 // If we didn't find a transport, that's not an error;
443 // it could have been deleted as a result of bundling. 453 // it could have been deleted as a result of bundling.
444 // TODO(deadbeef): Make callers smarter so they won't attempt to set a 454 // TODO(deadbeef): Make callers smarter so they won't attempt to set a
445 // description on a deleted transport. 455 // description on a deleted transport.
446 return true; 456 return true;
447 } 457 }
448 458
449 // Older versions of Chrome expect the ICE role to be re-determined when an 459 // Older versions of Chrome expect the ICE role to be re-determined when an
450 // ICE restart occurs, and also don't perform conflict resolution correctly, 460 // ICE restart occurs, and also don't perform conflict resolution correctly,
451 // so for now we can't safely stop doing this. 461 // so for now we can't safely stop doing this, unless the application opts in
462 // by setting |redetermine_role_on_ice_restart_| to false.
452 // See: https://bugs.chromium.org/p/chromium/issues/detail?id=628676 463 // See: https://bugs.chromium.org/p/chromium/issues/detail?id=628676
453 // TODO(deadbeef): Remove this when these old versions of Chrome reach a low 464 // TODO(deadbeef): Remove this when these old versions of Chrome reach a low
454 // enough population. 465 // enough population.
455 if (transport->local_description() && 466 if (redetermine_role_on_ice_restart_ && transport->local_description() &&
456 IceCredentialsChanged(transport->local_description()->ice_ufrag, 467 IceCredentialsChanged(transport->local_description()->ice_ufrag,
457 transport->local_description()->ice_pwd, 468 transport->local_description()->ice_pwd,
458 tdesc.ice_ufrag, tdesc.ice_pwd)) { 469 tdesc.ice_ufrag, tdesc.ice_pwd)) {
459 IceRole new_ice_role = 470 IceRole new_ice_role =
460 (action == CA_OFFER) ? ICEROLE_CONTROLLING : ICEROLE_CONTROLLED; 471 (action == CA_OFFER) ? ICEROLE_CONTROLLING : ICEROLE_CONTROLLED;
461 SetIceRole(new_ice_role); 472 SetIceRole(new_ice_role);
462 } 473 }
463 474
464 return transport->SetLocalTransportDescription(tdesc, action, err); 475 return transport->SetLocalTransportDescription(tdesc, action, err);
465 } 476 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 690 }
680 if (gathering_state_ != new_gathering_state) { 691 if (gathering_state_ != new_gathering_state) {
681 gathering_state_ = new_gathering_state; 692 gathering_state_ = new_gathering_state;
682 signaling_thread_->Post( 693 signaling_thread_->Post(
683 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, 694 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE,
684 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); 695 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state));
685 } 696 }
686 } 697 }
687 698
688 } // namespace cricket 699 } // namespace cricket
OLDNEW
« 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