OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 |
11 #ifndef WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ | 11 #ifndef WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ |
12 #define WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ | 12 #define WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include <string> | 15 #include <string> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "net/quic/quic_crypto_client_stream.h" | 18 #include "net/quic/quic_crypto_client_stream.h" |
18 #include "net/quic/quic_packet_writer.h" | 19 #include "net/quic/quic_packet_writer.h" |
19 #include "webrtc/base/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
20 #include "webrtc/base/optional.h" | 21 #include "webrtc/base/optional.h" |
21 #include "webrtc/base/scoped_ptr.h" | 22 #include "webrtc/base/scoped_ptr.h" |
22 #include "webrtc/p2p/base/transportchannelimpl.h" | 23 #include "webrtc/p2p/base/transportchannelimpl.h" |
23 #include "webrtc/p2p/quic/quicconnectionhelper.h" | 24 #include "webrtc/p2p/quic/quicconnectionhelper.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // this extracts the keys negotiated during the QUIC handshake, for use | 111 // this extracts the keys negotiated during the QUIC handshake, for use |
111 // in external encryption such as for extracting SRTP keys. | 112 // in external encryption such as for extracting SRTP keys. |
112 bool ExportKeyingMaterial(const std::string& label, | 113 bool ExportKeyingMaterial(const std::string& label, |
113 const uint8_t* context, | 114 const uint8_t* context, |
114 size_t context_len, | 115 size_t context_len, |
115 bool use_context, | 116 bool use_context, |
116 uint8_t* result, | 117 uint8_t* result, |
117 size_t result_len) override; | 118 size_t result_len) override; |
118 // TODO(mikescarlett): Remove this method once TransportChannel does not | 119 // TODO(mikescarlett): Remove this method once TransportChannel does not |
119 // require defining it. | 120 // require defining it. |
120 rtc::scoped_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() | 121 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() |
121 const override { | 122 const override { |
122 return nullptr; | 123 return nullptr; |
123 } | 124 } |
124 | 125 |
125 // TransportChannelImpl overrides that we forward to the wrapped transport. | 126 // TransportChannelImpl overrides that we forward to the wrapped transport. |
126 void SetIceRole(IceRole role) override { channel_->SetIceRole(role); } | 127 void SetIceRole(IceRole role) override { channel_->SetIceRole(role); } |
127 IceRole GetIceRole() const override { return channel_->GetIceRole(); } | 128 IceRole GetIceRole() const override { return channel_->GetIceRole(); } |
128 int SetOption(rtc::Socket::Option opt, int value) override { | 129 int SetOption(rtc::Socket::Option opt, int value) override { |
129 return channel_->SetOption(opt, value); | 130 return channel_->SetOption(opt, value); |
130 } | 131 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 271 |
271 // Everything should occur on this thread. | 272 // Everything should occur on this thread. |
272 rtc::Thread* worker_thread_; | 273 rtc::Thread* worker_thread_; |
273 // Underlying channel which is responsible for connecting with the remote peer | 274 // Underlying channel which is responsible for connecting with the remote peer |
274 // and sending/receiving packets across the network. | 275 // and sending/receiving packets across the network. |
275 TransportChannelImpl* const channel_; | 276 TransportChannelImpl* const channel_; |
276 // Connectivity state of QuicTransportChannel. | 277 // Connectivity state of QuicTransportChannel. |
277 QuicTransportState quic_state_ = QUIC_TRANSPORT_NEW; | 278 QuicTransportState quic_state_ = QUIC_TRANSPORT_NEW; |
278 // QUIC session which establishes the crypto handshake and converts data | 279 // QUIC session which establishes the crypto handshake and converts data |
279 // to/from QUIC packets. | 280 // to/from QUIC packets. |
280 rtc::scoped_ptr<QuicSession> quic_; | 281 std::unique_ptr<QuicSession> quic_; |
281 // Non-crypto config for |quic_|. | 282 // Non-crypto config for |quic_|. |
282 net::QuicConfig config_; | 283 net::QuicConfig config_; |
283 // Helper for net::QuicConnection that provides timing and | 284 // Helper for net::QuicConnection that provides timing and |
284 // random number generation. | 285 // random number generation. |
285 QuicConnectionHelper helper_; | 286 QuicConnectionHelper helper_; |
286 // This peer's role in the QUIC crypto handshake. SSL_CLIENT implies this peer | 287 // This peer's role in the QUIC crypto handshake. SSL_CLIENT implies this peer |
287 // initiates the handshake, while SSL_SERVER implies the remote peer initiates | 288 // initiates the handshake, while SSL_SERVER implies the remote peer initiates |
288 // the handshake. This must be set before we start QUIC. | 289 // the handshake. This must be set before we start QUIC. |
289 rtc::Optional<rtc::SSLRole> ssl_role_; | 290 rtc::Optional<rtc::SSLRole> ssl_role_; |
290 // Config for QUIC crypto client stream, used when |ssl_role_| is SSL_CLIENT. | 291 // Config for QUIC crypto client stream, used when |ssl_role_| is SSL_CLIENT. |
291 rtc::scoped_ptr<net::QuicCryptoClientConfig> quic_crypto_client_config_; | 292 std::unique_ptr<net::QuicCryptoClientConfig> quic_crypto_client_config_; |
292 // Config for QUIC crypto server stream, used when |ssl_role_| is SSL_SERVER. | 293 // Config for QUIC crypto server stream, used when |ssl_role_| is SSL_SERVER. |
293 rtc::scoped_ptr<net::QuicCryptoServerConfig> quic_crypto_server_config_; | 294 std::unique_ptr<net::QuicCryptoServerConfig> quic_crypto_server_config_; |
294 // This peer's certificate. | 295 // This peer's certificate. |
295 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; | 296 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_; |
296 // Fingerprint of the remote peer. This must be set before we start QUIC. | 297 // Fingerprint of the remote peer. This must be set before we start QUIC. |
297 rtc::Optional<RemoteFingerprint> remote_fingerprint_; | 298 rtc::Optional<RemoteFingerprint> remote_fingerprint_; |
298 | 299 |
299 RTC_DISALLOW_COPY_AND_ASSIGN(QuicTransportChannel); | 300 RTC_DISALLOW_COPY_AND_ASSIGN(QuicTransportChannel); |
300 }; | 301 }; |
301 | 302 |
302 } // namespace cricket | 303 } // namespace cricket |
303 | 304 |
304 #endif // WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ | 305 #endif // WEBRTC_P2P_QUIC_QUICTRANSPORTCHANNEL_H_ |
OLD | NEW |