| 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/tools/quic/quic_simple_dispatcher.h" | 5 #include "net/tools/quic/quic_simple_dispatcher.h" |
| 6 | 6 |
| 7 #include "net/tools/quic/quic_simple_server_session.h" | 7 #include "net/tools/quic/quic_simple_server_session.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 QuicSimpleDispatcher::QuicSimpleDispatcher( | 11 QuicSimpleDispatcher::QuicSimpleDispatcher( |
| 12 const QuicConfig& config, | 12 const QuicConfig& config, |
| 13 const QuicCryptoServerConfig* crypto_config, | 13 const QuicCryptoServerConfig* crypto_config, |
| 14 QuicVersionManager* version_manager, | 14 QuicVersionManager* version_manager, |
| 15 std::unique_ptr<QuicConnectionHelperInterface> helper, | 15 std::unique_ptr<QuicConnectionHelperInterface> helper, |
| 16 std::unique_ptr<QuicCryptoServerStream::Helper> session_helper, | 16 std::unique_ptr<QuicCryptoServerStream::Helper> session_helper, |
| 17 std::unique_ptr<QuicAlarmFactory> alarm_factory, | 17 std::unique_ptr<QuicAlarmFactory> alarm_factory, |
| 18 QuicInMemoryCache* in_memory_cache) | 18 QuicHttpResponseCache* response_cache) |
| 19 : QuicDispatcher(config, | 19 : QuicDispatcher(config, |
| 20 crypto_config, | 20 crypto_config, |
| 21 version_manager, | 21 version_manager, |
| 22 std::move(helper), | 22 std::move(helper), |
| 23 std::move(session_helper), | 23 std::move(session_helper), |
| 24 std::move(alarm_factory)), | 24 std::move(alarm_factory)), |
| 25 in_memory_cache_(in_memory_cache) {} | 25 response_cache_(response_cache) {} |
| 26 | 26 |
| 27 QuicSimpleDispatcher::~QuicSimpleDispatcher() {} | 27 QuicSimpleDispatcher::~QuicSimpleDispatcher() {} |
| 28 | 28 |
| 29 QuicServerSessionBase* QuicSimpleDispatcher::CreateQuicSession( | 29 QuicServerSessionBase* QuicSimpleDispatcher::CreateQuicSession( |
| 30 QuicConnectionId connection_id, | 30 QuicConnectionId connection_id, |
| 31 const QuicSocketAddress& client_address) { | 31 const QuicSocketAddress& client_address) { |
| 32 // The QuicServerSessionBase takes ownership of |connection| below. | 32 // The QuicServerSessionBase takes ownership of |connection| below. |
| 33 QuicConnection* connection = new QuicConnection( | 33 QuicConnection* connection = new QuicConnection( |
| 34 connection_id, client_address, helper(), alarm_factory(), | 34 connection_id, client_address, helper(), alarm_factory(), |
| 35 CreatePerConnectionWriter(), | 35 CreatePerConnectionWriter(), |
| 36 /* owns_writer= */ true, Perspective::IS_SERVER, GetSupportedVersions()); | 36 /* owns_writer= */ true, Perspective::IS_SERVER, GetSupportedVersions()); |
| 37 | 37 |
| 38 QuicServerSessionBase* session = new QuicSimpleServerSession( | 38 QuicServerSessionBase* session = new QuicSimpleServerSession( |
| 39 config(), connection, this, session_helper(), crypto_config(), | 39 config(), connection, this, session_helper(), crypto_config(), |
| 40 compressed_certs_cache(), in_memory_cache_); | 40 compressed_certs_cache(), response_cache_); |
| 41 session->Initialize(); | 41 session->Initialize(); |
| 42 return session; | 42 return session; |
| 43 } | 43 } |
| 44 | 44 |
| 45 } // namespace net | 45 } // namespace net |
| OLD | NEW |