| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ | 6 #define NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "net/quic/crypto/proof_verifier_chromium.h" |
| 12 #include "net/quic/quic_crypto_client_stream.h" | 13 #include "net/quic/quic_crypto_client_stream.h" |
| 13 #include "net/quic/quic_crypto_client_stream_factory.h" | 14 #include "net/quic/quic_crypto_client_stream_factory.h" |
| 14 #include "net/quic/test_tools/mock_crypto_client_stream.h" | 15 #include "net/quic/test_tools/mock_crypto_client_stream.h" |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 | 18 |
| 18 class QuicServerId; | 19 class QuicServerId; |
| 19 | 20 |
| 20 class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory { | 21 class MockCryptoClientStreamFactory : public QuicCryptoClientStreamFactory { |
| 21 public: | 22 public: |
| 22 MockCryptoClientStreamFactory(); | 23 MockCryptoClientStreamFactory(); |
| 23 ~MockCryptoClientStreamFactory() override; | 24 ~MockCryptoClientStreamFactory() override; |
| 24 | 25 |
| 25 QuicCryptoClientStream* CreateQuicCryptoClientStream( | 26 QuicCryptoClientStream* CreateQuicCryptoClientStream( |
| 26 const QuicServerId& server_id, | 27 const QuicServerId& server_id, |
| 27 QuicChromiumClientSession* session, | 28 QuicChromiumClientSession* session, |
| 28 scoped_ptr<ProofVerifyContext> proof_verify_context, | 29 scoped_ptr<ProofVerifyContext> proof_verify_context, |
| 29 QuicCryptoClientConfig* crypto_config) override; | 30 QuicCryptoClientConfig* crypto_config) override; |
| 30 | 31 |
| 31 void set_handshake_mode( | 32 void set_handshake_mode( |
| 32 MockCryptoClientStream::HandshakeMode handshake_mode) { | 33 MockCryptoClientStream::HandshakeMode handshake_mode) { |
| 33 handshake_mode_ = handshake_mode; | 34 handshake_mode_ = handshake_mode; |
| 34 } | 35 } |
| 35 | 36 |
| 36 // The caller keeps ownership of |proof_verify_details|. | 37 // The caller keeps ownership of |proof_verify_details|. |
| 37 void AddProofVerifyDetails(const ProofVerifyDetails* proof_verify_details) { | 38 void AddProofVerifyDetails( |
| 39 const ProofVerifyDetailsChromium* proof_verify_details) { |
| 38 proof_verify_details_queue_.push(proof_verify_details); | 40 proof_verify_details_queue_.push(proof_verify_details); |
| 39 } | 41 } |
| 40 | 42 |
| 41 MockCryptoClientStream* last_stream() const { return last_stream_; } | 43 MockCryptoClientStream* last_stream() const { return last_stream_; } |
| 42 | 44 |
| 43 private: | 45 private: |
| 44 MockCryptoClientStream::HandshakeMode handshake_mode_; | 46 MockCryptoClientStream::HandshakeMode handshake_mode_; |
| 45 MockCryptoClientStream* last_stream_; | 47 MockCryptoClientStream* last_stream_; |
| 46 std::queue<const ProofVerifyDetails*> proof_verify_details_queue_; | 48 std::queue<const ProofVerifyDetailsChromium*> proof_verify_details_queue_; |
| 47 | 49 |
| 48 DISALLOW_COPY_AND_ASSIGN(MockCryptoClientStreamFactory); | 50 DISALLOW_COPY_AND_ASSIGN(MockCryptoClientStreamFactory); |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 } // namespace net | 53 } // namespace net |
| 52 | 54 |
| 53 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ | 55 #endif // NET_QUIC_TEST_TOOLS_MOCK_CRYPTO_CLIENT_STREAM_FACTORY_H_ |
| OLD | NEW |