| 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_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 QuicDispatcher::QuicDispatcher(const QuicConfig& config, | 48 QuicDispatcher::QuicDispatcher(const QuicConfig& config, |
| 49 const QuicCryptoServerConfig* crypto_config, | 49 const QuicCryptoServerConfig* crypto_config, |
| 50 const QuicVersionVector& supported_versions, | 50 const QuicVersionVector& supported_versions, |
| 51 QuicConnectionHelperInterface* helper) | 51 QuicConnectionHelperInterface* helper) |
| 52 : config_(config), | 52 : config_(config), |
| 53 crypto_config_(crypto_config), | 53 crypto_config_(crypto_config), |
| 54 compressed_certs_cache_( |
| 55 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), |
| 54 helper_(helper), | 56 helper_(helper), |
| 55 delete_sessions_alarm_( | 57 delete_sessions_alarm_( |
| 56 helper_->CreateAlarm(new DeleteSessionsAlarm(this))), | 58 helper_->CreateAlarm(new DeleteSessionsAlarm(this))), |
| 57 supported_versions_(supported_versions), | 59 supported_versions_(supported_versions), |
| 58 current_packet_(nullptr), | 60 current_packet_(nullptr), |
| 59 framer_(supported_versions, | 61 framer_(supported_versions, |
| 60 /*unused*/ QuicTime::Zero(), | 62 /*unused*/ QuicTime::Zero(), |
| 61 Perspective::IS_SERVER), | 63 Perspective::IS_SERVER), |
| 62 last_error_(QUIC_NO_ERROR) { | 64 last_error_(QUIC_NO_ERROR) { |
| 63 framer_.set_visitor(this); | 65 framer_.set_visitor(this); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } | 446 } |
| 445 | 447 |
| 446 QuicServerSessionBase* QuicDispatcher::CreateQuicSession( | 448 QuicServerSessionBase* QuicDispatcher::CreateQuicSession( |
| 447 QuicConnectionId connection_id, | 449 QuicConnectionId connection_id, |
| 448 const IPEndPoint& client_address) { | 450 const IPEndPoint& client_address) { |
| 449 // The QuicServerSessionBase takes ownership of |connection| below. | 451 // The QuicServerSessionBase takes ownership of |connection| below. |
| 450 QuicConnection* connection = new QuicConnection( | 452 QuicConnection* connection = new QuicConnection( |
| 451 connection_id, client_address, helper_.get(), CreatePerConnectionWriter(), | 453 connection_id, client_address, helper_.get(), CreatePerConnectionWriter(), |
| 452 /* owns_writer= */ true, Perspective::IS_SERVER, supported_versions_); | 454 /* owns_writer= */ true, Perspective::IS_SERVER, supported_versions_); |
| 453 | 455 |
| 454 QuicServerSessionBase* session = | 456 QuicServerSessionBase* session = new QuicSimpleServerSession( |
| 455 new QuicSimpleServerSession(config_, connection, this, crypto_config_); | 457 config_, connection, this, crypto_config_, &compressed_certs_cache_); |
| 456 session->Initialize(); | 458 session->Initialize(); |
| 457 return session; | 459 return session; |
| 458 } | 460 } |
| 459 | 461 |
| 460 QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() { | 462 QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() { |
| 461 return new QuicTimeWaitListManager(writer_.get(), this, helper_.get()); | 463 return new QuicTimeWaitListManager(writer_.get(), this, helper_.get()); |
| 462 } | 464 } |
| 463 | 465 |
| 464 bool QuicDispatcher::HandlePacketForTimeWait( | 466 bool QuicDispatcher::HandlePacketForTimeWait( |
| 465 const QuicPacketPublicHeader& header) { | 467 const QuicPacketPublicHeader& header) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 480 | 482 |
| 481 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { | 483 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { |
| 482 return new QuicPerConnectionPacketWriter(writer_.get()); | 484 return new QuicPerConnectionPacketWriter(writer_.get()); |
| 483 } | 485 } |
| 484 | 486 |
| 485 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 487 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
| 486 last_error_ = error; | 488 last_error_ = error; |
| 487 } | 489 } |
| 488 | 490 |
| 489 } // namespace net | 491 } // namespace net |
| OLD | NEW |