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 |
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 | |
85 TransportController::~TransportController() { | 79 TransportController::~TransportController() { |
86 // Channel destructors may try to send packets, so this needs to happen on | 80 // Channel destructors may try to send packets, so this needs to happen on |
87 // the network thread. | 81 // the network thread. |
88 network_thread_->Invoke<void>( | 82 network_thread_->Invoke<void>( |
89 RTC_FROM_HERE, | 83 RTC_FROM_HERE, |
90 rtc::Bind(&TransportController::DestroyAllChannels_n, this)); | 84 rtc::Bind(&TransportController::DestroyAllChannels_n, this)); |
91 } | 85 } |
92 | 86 |
93 bool TransportController::SetSslMaxProtocolVersion( | 87 bool TransportController::SetSslMaxProtocolVersion( |
94 rtc::SSLProtocolVersion version) { | 88 rtc::SSLProtocolVersion version) { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 IceTransportInternal* TransportController::CreateIceTransportChannel_n( | 349 IceTransportInternal* TransportController::CreateIceTransportChannel_n( |
356 const std::string& transport_name, | 350 const std::string& transport_name, |
357 int component) { | 351 int component) { |
358 return new P2PTransportChannel(transport_name, component, port_allocator_); | 352 return new P2PTransportChannel(transport_name, component, port_allocator_); |
359 } | 353 } |
360 | 354 |
361 DtlsTransportInternal* TransportController::CreateDtlsTransportChannel_n( | 355 DtlsTransportInternal* TransportController::CreateDtlsTransportChannel_n( |
362 const std::string&, | 356 const std::string&, |
363 int, | 357 int, |
364 IceTransportInternal* ice) { | 358 IceTransportInternal* ice) { |
365 DtlsTransport* dtls = new DtlsTransport(ice); | 359 DtlsTransport* dtls = new DtlsTransport(ice, crypto_options_); |
366 dtls->SetSslMaxProtocolVersion(ssl_max_version_); | 360 dtls->SetSslMaxProtocolVersion(ssl_max_version_); |
367 return dtls; | 361 return dtls; |
368 } | 362 } |
369 | 363 |
370 void TransportController::OnMessage(rtc::Message* pmsg) { | 364 void TransportController::OnMessage(rtc::Message* pmsg) { |
371 RTC_DCHECK(signaling_thread_->IsCurrent()); | 365 RTC_DCHECK(signaling_thread_->IsCurrent()); |
372 | 366 |
373 switch (pmsg->message_id) { | 367 switch (pmsg->message_id) { |
374 case MSG_ICECONNECTIONSTATE: { | 368 case MSG_ICECONNECTIONSTATE: { |
375 rtc::TypedMessageData<IceConnectionState>* data = | 369 rtc::TypedMessageData<IceConnectionState>* data = |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, | 877 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, |
884 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); | 878 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); |
885 } | 879 } |
886 } | 880 } |
887 | 881 |
888 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { | 882 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { |
889 SignalDtlsHandshakeError(error); | 883 SignalDtlsHandshakeError(error); |
890 } | 884 } |
891 | 885 |
892 } // namespace cricket | 886 } // namespace cricket |
OLD | NEW |