OLD | NEW |
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 rtc::Bind(&TransportController::DestroyAllTransports_w, this)); | 46 rtc::Bind(&TransportController::DestroyAllTransports_w, this)); |
47 signaling_thread_->Clear(this); | 47 signaling_thread_->Clear(this); |
48 } | 48 } |
49 | 49 |
50 bool TransportController::SetSslMaxProtocolVersion( | 50 bool TransportController::SetSslMaxProtocolVersion( |
51 rtc::SSLProtocolVersion version) { | 51 rtc::SSLProtocolVersion version) { |
52 return worker_thread_->Invoke<bool>(rtc::Bind( | 52 return worker_thread_->Invoke<bool>(rtc::Bind( |
53 &TransportController::SetSslMaxProtocolVersion_w, this, version)); | 53 &TransportController::SetSslMaxProtocolVersion_w, this, version)); |
54 } | 54 } |
55 | 55 |
56 void TransportController::SetIceConnectionReceivingTimeout(int timeout_ms) { | 56 void TransportController::SetIceConfig(const IceConfig& config) { |
57 worker_thread_->Invoke<void>( | 57 worker_thread_->Invoke<void>( |
58 rtc::Bind(&TransportController::SetIceConnectionReceivingTimeout_w, this, | 58 rtc::Bind(&TransportController::SetIceConfig_w, this, config)); |
59 timeout_ms)); | |
60 } | 59 } |
61 | 60 |
62 void TransportController::SetIceRole(IceRole ice_role) { | 61 void TransportController::SetIceRole(IceRole ice_role) { |
63 worker_thread_->Invoke<void>( | 62 worker_thread_->Invoke<void>( |
64 rtc::Bind(&TransportController::SetIceRole_w, this, ice_role)); | 63 rtc::Bind(&TransportController::SetIceRole_w, this, ice_role)); |
65 } | 64 } |
66 | 65 |
67 bool TransportController::GetSslRole(rtc::SSLRole* role) { | 66 bool TransportController::GetSslRole(rtc::SSLRole* role) { |
68 return worker_thread_->Invoke<bool>( | 67 return worker_thread_->Invoke<bool>( |
69 rtc::Bind(&TransportController::GetSslRole_w, this, role)); | 68 rtc::Bind(&TransportController::GetSslRole_w, this, role)); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 227 |
229 Transport* transport = GetTransport_w(transport_name); | 228 Transport* transport = GetTransport_w(transport_name); |
230 if (transport) { | 229 if (transport) { |
231 return transport; | 230 return transport; |
232 } | 231 } |
233 | 232 |
234 transport = CreateTransport_w(transport_name); | 233 transport = CreateTransport_w(transport_name); |
235 // The stuff below happens outside of CreateTransport_w so that unit tests | 234 // The stuff below happens outside of CreateTransport_w so that unit tests |
236 // can override CreateTransport_w to return a different type of transport. | 235 // can override CreateTransport_w to return a different type of transport. |
237 transport->SetSslMaxProtocolVersion(ssl_max_version_); | 236 transport->SetSslMaxProtocolVersion(ssl_max_version_); |
238 transport->SetChannelReceivingTimeout(ice_receiving_timeout_ms_); | 237 transport->SetIceConfig(ice_config_); |
239 transport->SetIceRole(ice_role_); | 238 transport->SetIceRole(ice_role_); |
240 transport->SetIceTiebreaker(ice_tiebreaker_); | 239 transport->SetIceTiebreaker(ice_tiebreaker_); |
241 if (certificate_) { | 240 if (certificate_) { |
242 transport->SetLocalCertificate(certificate_); | 241 transport->SetLocalCertificate(certificate_); |
243 } | 242 } |
244 transport->SignalConnecting.connect( | 243 transport->SignalConnecting.connect( |
245 this, &TransportController::OnTransportConnecting_w); | 244 this, &TransportController::OnTransportConnecting_w); |
246 transport->SignalWritableState.connect( | 245 transport->SignalWritableState.connect( |
247 this, &TransportController::OnTransportWritableState_w); | 246 this, &TransportController::OnTransportWritableState_w); |
248 transport->SignalReceivingState.connect( | 247 transport->SignalReceivingState.connect( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 289 |
291 // Max SSL version can only be set before transports are created. | 290 // Max SSL version can only be set before transports are created. |
292 if (!transports_.empty()) { | 291 if (!transports_.empty()) { |
293 return false; | 292 return false; |
294 } | 293 } |
295 | 294 |
296 ssl_max_version_ = version; | 295 ssl_max_version_ = version; |
297 return true; | 296 return true; |
298 } | 297 } |
299 | 298 |
300 void TransportController::SetIceConnectionReceivingTimeout_w(int timeout_ms) { | 299 void TransportController::SetIceConfig_w(const IceConfig& config) { |
301 RTC_DCHECK(worker_thread_->IsCurrent()); | 300 RTC_DCHECK(worker_thread_->IsCurrent()); |
302 ice_receiving_timeout_ms_ = timeout_ms; | 301 ice_config_ = config; |
303 for (const auto& kv : transports_) { | 302 for (const auto& kv : transports_) { |
304 kv.second->SetChannelReceivingTimeout(timeout_ms); | 303 kv.second->SetIceConfig(ice_config_); |
305 } | 304 } |
306 } | 305 } |
307 | 306 |
308 void TransportController::SetIceRole_w(IceRole ice_role) { | 307 void TransportController::SetIceRole_w(IceRole ice_role) { |
309 RTC_DCHECK(worker_thread_->IsCurrent()); | 308 RTC_DCHECK(worker_thread_->IsCurrent()); |
310 ice_role_ = ice_role; | 309 ice_role_ = ice_role; |
311 for (const auto& kv : transports_) { | 310 for (const auto& kv : transports_) { |
312 kv.second->SetIceRole(ice_role_); | 311 kv.second->SetIceRole(ice_role_); |
313 } | 312 } |
314 } | 313 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 bool TransportController::HasChannels_w() { | 565 bool TransportController::HasChannels_w() { |
567 for (const auto& kv : transports_) { | 566 for (const auto& kv : transports_) { |
568 if (kv.second->HasChannels()) { | 567 if (kv.second->HasChannels()) { |
569 return true; | 568 return true; |
570 } | 569 } |
571 } | 570 } |
572 return false; | 571 return false; |
573 } | 572 } |
574 | 573 |
575 } // namespace cricket | 574 } // namespace cricket |
OLD | NEW |