| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_client_stream_factory.h" | 5 #include "net/quic/quic_crypto_client_stream_factory.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "net/quic/crypto/proof_verifier_chromium.h" | 8 #include "net/quic/crypto/proof_verifier_chromium.h" |
| 9 #include "net/quic/quic_chromium_client_session.h" | 9 #include "net/quic/quic_chromium_client_session.h" |
| 10 #include "net/quic/quic_crypto_client_stream.h" | 10 #include "net/quic/quic_crypto_client_stream.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class DefaultCryptoStreamFactory : public QuicCryptoClientStreamFactory { | 16 class DefaultCryptoStreamFactory : public QuicCryptoClientStreamFactory { |
| 17 public: | 17 public: |
| 18 QuicCryptoClientStream* CreateQuicCryptoClientStream( | 18 QuicCryptoClientStream* CreateQuicCryptoClientStream( |
| 19 const QuicServerId& server_id, | 19 const QuicServerId& server_id, |
| 20 QuicChromiumClientSession* session, | 20 QuicChromiumClientSession* session, |
| 21 scoped_ptr<ProofVerifyContext> proof_verify_context, | 21 scoped_ptr<ProofVerifyContext> proof_verify_context, |
| 22 QuicCryptoClientConfig* crypto_config) override { | 22 QuicCryptoClientConfig* crypto_config) override { |
| 23 return new QuicCryptoClientStream( | 23 return new QuicCryptoClientStream(server_id, session, |
| 24 server_id, session, proof_verify_context.release(), crypto_config); | 24 proof_verify_context.release(), |
| 25 crypto_config, session); |
| 25 } | 26 } |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 static base::LazyInstance<DefaultCryptoStreamFactory>::Leaky | 29 static base::LazyInstance<DefaultCryptoStreamFactory>::Leaky |
| 29 g_default_crypto_stream_factory = LAZY_INSTANCE_INITIALIZER; | 30 g_default_crypto_stream_factory = LAZY_INSTANCE_INITIALIZER; |
| 30 | 31 |
| 31 } // namespace | 32 } // namespace |
| 32 | 33 |
| 33 // static | 34 // static |
| 34 QuicCryptoClientStreamFactory* | 35 QuicCryptoClientStreamFactory* |
| 35 QuicCryptoClientStreamFactory::GetDefaultFactory() { | 36 QuicCryptoClientStreamFactory::GetDefaultFactory() { |
| 36 return g_default_crypto_stream_factory.Pointer(); | 37 return g_default_crypto_stream_factory.Pointer(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 } // namespace net | 40 } // namespace net |
| OLD | NEW |