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 #ifndef NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ | 5 #ifndef NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ |
6 #define NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ | 6 #define NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "net/quic/core/crypto/crypto_handshake.h" | 13 #include "net/quic/core/crypto/crypto_handshake.h" |
14 #include "net/quic/core/crypto/quic_compressed_certs_cache.h" | 14 #include "net/quic/core/crypto/quic_compressed_certs_cache.h" |
15 #include "net/quic/core/crypto/quic_crypto_server_config.h" | 15 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
16 #include "net/quic/core/proto/source_address_token.pb.h" | 16 #include "net/quic/core/proto/source_address_token.pb.h" |
17 #include "net/quic/core/quic_config.h" | 17 #include "net/quic/core/quic_config.h" |
18 #include "net/quic/core/quic_crypto_stream.h" | 18 #include "net/quic/core/quic_crypto_stream.h" |
19 #include "net/quic/platform/api/quic_export.h" | 19 #include "net/quic/platform/api/quic_export.h" |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class CachedNetworkParameters; | 23 class CachedNetworkParameters; |
24 class CryptoHandshakeMessage; | 24 class CryptoHandshakeMessage; |
25 class QuicCryptoServerConfig; | 25 class QuicCryptoServerConfig; |
26 class QuicCryptoServerStreamBase; | 26 class QuicCryptoServerStreamBase; |
27 | 27 |
28 namespace test { | 28 namespace test { |
29 class CryptoTestUtils; | |
30 class QuicCryptoServerStreamPeer; | 29 class QuicCryptoServerStreamPeer; |
31 } // namespace test | 30 } // namespace test |
32 | 31 |
33 // TODO(alyssar) see what can be moved out of QuicCryptoServerStream with | 32 // TODO(alyssar) see what can be moved out of QuicCryptoServerStream with |
34 // various code and test refactoring. | 33 // various code and test refactoring. |
35 class QUIC_EXPORT_PRIVATE QuicCryptoServerStreamBase : public QuicCryptoStream { | 34 class QUIC_EXPORT_PRIVATE QuicCryptoServerStreamBase : public QuicCryptoStream { |
36 public: | 35 public: |
37 explicit QuicCryptoServerStreamBase(QuicSession* session); | 36 explicit QuicCryptoServerStreamBase(QuicSession* session); |
38 | 37 |
39 ~QuicCryptoServerStreamBase() override {} | 38 ~QuicCryptoServerStreamBase() override {} |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result> | 131 QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result> |
133 result, | 132 result, |
134 std::unique_ptr<ProofSource::Details> proof_source_details, | 133 std::unique_ptr<ProofSource::Details> proof_source_details, |
135 std::unique_ptr<ProcessClientHelloResultCallback> done_cb); | 134 std::unique_ptr<ProcessClientHelloResultCallback> done_cb); |
136 | 135 |
137 // Hook that allows the server to set QuicConfig defaults just | 136 // Hook that allows the server to set QuicConfig defaults just |
138 // before going through the parameter negotiation step. | 137 // before going through the parameter negotiation step. |
139 virtual void OverrideQuicConfigDefaults(QuicConfig* config); | 138 virtual void OverrideQuicConfigDefaults(QuicConfig* config); |
140 | 139 |
141 private: | 140 private: |
142 friend class test::CryptoTestUtils; | |
143 friend class test::QuicCryptoServerStreamPeer; | 141 friend class test::QuicCryptoServerStreamPeer; |
144 | 142 |
145 class ValidateCallback : public ValidateClientHelloResultCallback { | 143 class ValidateCallback : public ValidateClientHelloResultCallback { |
146 public: | 144 public: |
147 explicit ValidateCallback(QuicCryptoServerStream* parent); | 145 explicit ValidateCallback(QuicCryptoServerStream* parent); |
148 // To allow the parent to detach itself from the callback before deletion. | 146 // To allow the parent to detach itself from the callback before deletion. |
149 void Cancel(); | 147 void Cancel(); |
150 | 148 |
151 // From ValidateClientHelloResultCallback | 149 // From ValidateClientHelloResultCallback |
152 void Run(QuicReferenceCountedPointer<Result> result, | 150 void Run(QuicReferenceCountedPointer<Result> result, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // ProcessClientHello and forward it to | 273 // ProcessClientHello and forward it to |
276 // FinishProcessingHandshakeMessageAfterProcessClientHello. | 274 // FinishProcessingHandshakeMessageAfterProcessClientHello. |
277 ProcessClientHelloCallback* process_client_hello_cb_; | 275 ProcessClientHelloCallback* process_client_hello_cb_; |
278 | 276 |
279 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); | 277 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); |
280 }; | 278 }; |
281 | 279 |
282 } // namespace net | 280 } // namespace net |
283 | 281 |
284 #endif // NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ | 282 #endif // NET_QUIC_CORE_QUIC_CRYPTO_SERVER_STREAM_H_ |
OLD | NEW |