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

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

Issue 2815513012: Negotiate the same SRTP crypto suites for every DTLS association formed. (Closed)
Patch Set: Merge with master Created 3 years, 8 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/pc/channel.h » ('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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE, 882 RTC_FROM_HERE, this, MSG_ICEGATHERINGSTATE,
888 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); 883 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state));
889 } 884 }
890 } 885 }
891 886
892 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) { 887 void TransportController::OnDtlsHandshakeError(rtc::SSLHandshakeError error) {
893 SignalDtlsHandshakeError(error); 888 SignalDtlsHandshakeError(error);
894 } 889 }
895 890
896 } // namespace cricket 891 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/transportcontroller.h ('k') | webrtc/pc/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698