OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/quic_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "crypto/secure_hash.h" | 8 #include "crypto/secure_hash.h" |
9 #include "net/quic/crypto/cached_network_parameters.h" | 9 #include "net/quic/crypto/cached_network_parameters.h" |
10 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 QuicCryptoServerStream::QuicCryptoServerStream( | 28 QuicCryptoServerStream::QuicCryptoServerStream( |
29 const QuicCryptoServerConfig& crypto_config, | 29 const QuicCryptoServerConfig& crypto_config, |
30 QuicSession* session) | 30 QuicSession* session) |
31 : QuicCryptoStream(session), | 31 : QuicCryptoStream(session), |
32 crypto_config_(crypto_config), | 32 crypto_config_(crypto_config), |
33 validate_client_hello_cb_(nullptr), | 33 validate_client_hello_cb_(nullptr), |
34 num_handshake_messages_(0), | 34 num_handshake_messages_(0), |
35 num_server_config_update_messages_sent_(0) { | 35 num_server_config_update_messages_sent_(0) { |
36 DCHECK(session->connection()->is_server()); | 36 DCHECK_EQ(Perspective::IS_SERVER, session->connection()->perspective()); |
37 } | 37 } |
38 | 38 |
39 QuicCryptoServerStream::~QuicCryptoServerStream() { | 39 QuicCryptoServerStream::~QuicCryptoServerStream() { |
40 CancelOutstandingCallbacks(); | 40 CancelOutstandingCallbacks(); |
41 } | 41 } |
42 | 42 |
43 void QuicCryptoServerStream::CancelOutstandingCallbacks() { | 43 void QuicCryptoServerStream::CancelOutstandingCallbacks() { |
44 // Detach from the validation callback. Calling this multiple times is safe. | 44 // Detach from the validation callback. Calling this multiple times is safe. |
45 if (validate_client_hello_cb_ != nullptr) { | 45 if (validate_client_hello_cb_ != nullptr) { |
46 validate_client_hello_cb_->Cancel(); | 46 validate_client_hello_cb_->Cancel(); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 void QuicCryptoServerStream::ValidateCallback::RunImpl( | 253 void QuicCryptoServerStream::ValidateCallback::RunImpl( |
254 const CryptoHandshakeMessage& client_hello, | 254 const CryptoHandshakeMessage& client_hello, |
255 const Result& result) { | 255 const Result& result) { |
256 if (parent_ != nullptr) { | 256 if (parent_ != nullptr) { |
257 parent_->FinishProcessingHandshakeMessage(client_hello, result); | 257 parent_->FinishProcessingHandshakeMessage(client_hello, result); |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 } // namespace net | 261 } // namespace net |
OLD | NEW |