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 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h" | 5 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "net/quic/chromium/quic_chromium_client_session.h" | 8 #include "net/quic/chromium/quic_chromium_client_session.h" |
9 #include "net/quic/quic_crypto_client_stream.h" | 9 #include "net/quic/core/quic_crypto_client_stream.h" |
10 | 10 |
11 using std::string; | 11 using std::string; |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 MockCryptoClientStreamFactory::~MockCryptoClientStreamFactory() {} | 15 MockCryptoClientStreamFactory::~MockCryptoClientStreamFactory() {} |
16 | 16 |
17 MockCryptoClientStreamFactory::MockCryptoClientStreamFactory() | 17 MockCryptoClientStreamFactory::MockCryptoClientStreamFactory() |
18 : handshake_mode_(MockCryptoClientStream::CONFIRM_HANDSHAKE), | 18 : handshake_mode_(MockCryptoClientStream::CONFIRM_HANDSHAKE), |
19 last_stream_(nullptr) {} | 19 last_stream_(nullptr) {} |
20 | 20 |
21 QuicCryptoClientStream* | 21 QuicCryptoClientStream* |
22 MockCryptoClientStreamFactory::CreateQuicCryptoClientStream( | 22 MockCryptoClientStreamFactory::CreateQuicCryptoClientStream( |
23 const QuicServerId& server_id, | 23 const QuicServerId& server_id, |
24 QuicChromiumClientSession* session, | 24 QuicChromiumClientSession* session, |
25 std::unique_ptr<ProofVerifyContext> /*proof_verify_context*/, | 25 std::unique_ptr<ProofVerifyContext> /*proof_verify_context*/, |
26 QuicCryptoClientConfig* crypto_config) { | 26 QuicCryptoClientConfig* crypto_config) { |
27 const ProofVerifyDetailsChromium* proof_verify_details = nullptr; | 27 const ProofVerifyDetailsChromium* proof_verify_details = nullptr; |
28 if (!proof_verify_details_queue_.empty()) { | 28 if (!proof_verify_details_queue_.empty()) { |
29 proof_verify_details = proof_verify_details_queue_.front(); | 29 proof_verify_details = proof_verify_details_queue_.front(); |
30 proof_verify_details_queue_.pop(); | 30 proof_verify_details_queue_.pop(); |
31 } | 31 } |
32 last_stream_ = | 32 last_stream_ = |
33 new MockCryptoClientStream(server_id, session, nullptr, crypto_config, | 33 new MockCryptoClientStream(server_id, session, nullptr, crypto_config, |
34 handshake_mode_, proof_verify_details); | 34 handshake_mode_, proof_verify_details); |
35 return last_stream_; | 35 return last_stream_; |
36 } | 36 } |
37 | 37 |
38 } // namespace net | 38 } // namespace net |
OLD | NEW |