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

Side by Side Diff: webrtc/p2p/base/transportcontroller.cc

Issue 1516993002: Properly handle different transports having different SSL roles. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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 unified diff | Download patch
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 void TransportController::SetIceConfig(const IceConfig& config) { 59 void TransportController::SetIceConfig(const IceConfig& config) {
60 worker_thread_->Invoke<void>( 60 worker_thread_->Invoke<void>(
61 rtc::Bind(&TransportController::SetIceConfig_w, this, config)); 61 rtc::Bind(&TransportController::SetIceConfig_w, this, config));
62 } 62 }
63 63
64 void TransportController::SetIceRole(IceRole ice_role) { 64 void TransportController::SetIceRole(IceRole ice_role) {
65 worker_thread_->Invoke<void>( 65 worker_thread_->Invoke<void>(
66 rtc::Bind(&TransportController::SetIceRole_w, this, ice_role)); 66 rtc::Bind(&TransportController::SetIceRole_w, this, ice_role));
67 } 67 }
68 68
69 bool TransportController::GetSslRole(rtc::SSLRole* role) { 69 bool TransportController::GetSslRole(const std::string& transport_name,
70 return worker_thread_->Invoke<bool>( 70 rtc::SSLRole* role) {
71 rtc::Bind(&TransportController::GetSslRole_w, this, role)); 71 return worker_thread_->Invoke<bool>(rtc::Bind(
72 &TransportController::GetSslRole_w, this, transport_name, role));
72 } 73 }
73 74
74 bool TransportController::SetLocalCertificate( 75 bool TransportController::SetLocalCertificate(
75 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { 76 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
76 return worker_thread_->Invoke<bool>(rtc::Bind( 77 return worker_thread_->Invoke<bool>(rtc::Bind(
77 &TransportController::SetLocalCertificate_w, this, certificate)); 78 &TransportController::SetLocalCertificate_w, this, certificate));
78 } 79 }
79 80
80 bool TransportController::GetLocalCertificate( 81 bool TransportController::GetLocalCertificate(
81 const std::string& transport_name, 82 const std::string& transport_name,
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 337 }
337 338
338 void TransportController::SetIceRole_w(IceRole ice_role) { 339 void TransportController::SetIceRole_w(IceRole ice_role) {
339 RTC_DCHECK(worker_thread_->IsCurrent()); 340 RTC_DCHECK(worker_thread_->IsCurrent());
340 ice_role_ = ice_role; 341 ice_role_ = ice_role;
341 for (const auto& kv : transports_) { 342 for (const auto& kv : transports_) {
342 kv.second->SetIceRole(ice_role_); 343 kv.second->SetIceRole(ice_role_);
343 } 344 }
344 } 345 }
345 346
346 bool TransportController::GetSslRole_w(rtc::SSLRole* role) { 347 bool TransportController::GetSslRole_w(const std::string& transport_name,
348 rtc::SSLRole* role) {
347 RTC_DCHECK(worker_thread()->IsCurrent()); 349 RTC_DCHECK(worker_thread()->IsCurrent());
348 350
349 if (transports_.empty()) { 351 Transport* t = GetTransport_w(transport_name);
352 if (!t) {
350 return false; 353 return false;
351 } 354 }
352 return transports_.begin()->second->GetSslRole(role); 355
356 return t->GetSslRole(role);
353 } 357 }
354 358
355 bool TransportController::SetLocalCertificate_w( 359 bool TransportController::SetLocalCertificate_w(
356 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { 360 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
357 RTC_DCHECK(worker_thread_->IsCurrent()); 361 RTC_DCHECK(worker_thread_->IsCurrent());
358 362
359 if (certificate_) { 363 if (certificate_) {
360 return false; 364 return false;
361 } 365 }
362 if (!certificate) { 366 if (!certificate) {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 } 600 }
597 if (gathering_state_ != new_gathering_state) { 601 if (gathering_state_ != new_gathering_state) {
598 gathering_state_ = new_gathering_state; 602 gathering_state_ = new_gathering_state;
599 signaling_thread_->Post( 603 signaling_thread_->Post(
600 this, MSG_ICEGATHERINGSTATE, 604 this, MSG_ICEGATHERINGSTATE,
601 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); 605 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state));
602 } 606 }
603 } 607 }
604 608
605 } // namespace cricket 609 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698