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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const IceTransportInternal* ice() const { return ice_.get(); } | 58 const IceTransportInternal* ice() const { return ice_.get(); } |
59 IceTransportInternal* ice() { return ice_.get(); } | 59 IceTransportInternal* ice() { return ice_.get(); } |
60 | 60 |
61 private: | 61 private: |
62 std::unique_ptr<IceTransportInternal> ice_; | 62 std::unique_ptr<IceTransportInternal> ice_; |
63 std::unique_ptr<DtlsTransportInternal> dtls_; | 63 std::unique_ptr<DtlsTransportInternal> dtls_; |
64 | 64 |
65 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelPair); | 65 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelPair); |
66 }; | 66 }; |
67 | 67 |
68 TransportController::TransportController(rtc::Thread* signaling_thread, | 68 TransportController::TransportController( |
69 rtc::Thread* network_thread, | 69 rtc::Thread* signaling_thread, |
70 PortAllocator* port_allocator, | 70 rtc::Thread* network_thread, |
71 bool redetermine_role_on_ice_restart) | 71 PortAllocator* port_allocator, |
| 72 bool redetermine_role_on_ice_restart, |
| 73 const rtc::CryptoOptions& crypto_options) |
72 : signaling_thread_(signaling_thread), | 74 : signaling_thread_(signaling_thread), |
73 network_thread_(network_thread), | 75 network_thread_(network_thread), |
74 port_allocator_(port_allocator), | 76 port_allocator_(port_allocator), |
75 redetermine_role_on_ice_restart_(redetermine_role_on_ice_restart) {} | 77 redetermine_role_on_ice_restart_(redetermine_role_on_ice_restart), |
76 | 78 crypto_options_(crypto_options) {} |
77 TransportController::TransportController(rtc::Thread* signaling_thread, | |
78 rtc::Thread* network_thread, | |
79 PortAllocator* port_allocator) | |
80 : TransportController(signaling_thread, | |
81 network_thread, | |
82 port_allocator, | |
83 true) {} | |
84 | 79 |
85 TransportController::~TransportController() { | 80 TransportController::~TransportController() { |
86 // Channel destructors may try to send packets, so this needs to happen on | 81 // Channel destructors may try to send packets, so this needs to happen on |
87 // the network thread. | 82 // the network thread. |
88 network_thread_->Invoke<void>( | 83 network_thread_->Invoke<void>( |
89 RTC_FROM_HERE, | 84 RTC_FROM_HERE, |
90 rtc::Bind(&TransportController::DestroyAllChannels_n, this)); | 85 rtc::Bind(&TransportController::DestroyAllChannels_n, this)); |
91 } | 86 } |
92 | 87 |
93 bool TransportController::SetSslMaxProtocolVersion( | 88 bool TransportController::SetSslMaxProtocolVersion( |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 IceTransportInternal* TransportController::CreateIceTransportChannel_n( | 350 IceTransportInternal* TransportController::CreateIceTransportChannel_n( |
356 const std::string& transport_name, | 351 const std::string& transport_name, |
357 int component) { | 352 int component) { |
358 return new P2PTransportChannel(transport_name, component, port_allocator_); | 353 return new P2PTransportChannel(transport_name, component, port_allocator_); |
359 } | 354 } |
360 | 355 |
361 DtlsTransportInternal* TransportController::CreateDtlsTransportChannel_n( | 356 DtlsTransportInternal* TransportController::CreateDtlsTransportChannel_n( |
362 const std::string&, | 357 const std::string&, |
363 int, | 358 int, |
364 IceTransportInternal* ice) { | 359 IceTransportInternal* ice) { |
365 DtlsTransport* dtls = new DtlsTransport(ice); | 360 DtlsTransport* dtls = new DtlsTransport(ice, crypto_options_); |
366 dtls->SetSslMaxProtocolVersion(ssl_max_version_); | 361 dtls->SetSslMaxProtocolVersion(ssl_max_version_); |
367 return dtls; | 362 return dtls; |
368 } | 363 } |
369 | 364 |
370 void TransportController::OnMessage(rtc::Message* pmsg) { | 365 void TransportController::OnMessage(rtc::Message* pmsg) { |
371 RTC_DCHECK(signaling_thread_->IsCurrent()); | 366 RTC_DCHECK(signaling_thread_->IsCurrent()); |
372 | 367 |
373 switch (pmsg->message_id) { | 368 switch (pmsg->message_id) { |
374 case MSG_ICECONNECTIONSTATE: { | 369 case MSG_ICECONNECTIONSTATE: { |
375 rtc::TypedMessageData<IceConnectionState>* data = | 370 rtc::TypedMessageData<IceConnectionState>* data = |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, | 878 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, |
884 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 879 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
885 } | 880 } |
886 } | 881 } |
887 | 882 |
888 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { | 883 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { |
889 SignalDtlsHandshakeError(error); | 884 SignalDtlsHandshakeError(error); |
890 } | 885 } |
891 | 886 |
892 } // namespace cricket | 887 } // namespace cricket |
OLD | NEW |