| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // Not owned. | 36 // Not owned. |
| 37 QuicDispatcher* dispatcher_; | 37 QuicDispatcher* dispatcher_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(DeleteSessionsAlarm); | 39 DISALLOW_COPY_AND_ASSIGN(DeleteSessionsAlarm); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 QuicDispatcher::QuicDispatcher(const QuicConfig& config, | 44 QuicDispatcher::QuicDispatcher( |
| 45 const QuicCryptoServerConfig* crypto_config, | 45 const QuicConfig& config, |
| 46 const QuicVersionVector& supported_versions, | 46 const QuicCryptoServerConfig* crypto_config, |
| 47 QuicConnectionHelperInterface* helper) | 47 const QuicVersionVector& supported_versions, |
| 48 std::unique_ptr<QuicConnectionHelperInterface> helper) |
| 48 : config_(config), | 49 : config_(config), |
| 49 crypto_config_(crypto_config), | 50 crypto_config_(crypto_config), |
| 50 compressed_certs_cache_( | 51 compressed_certs_cache_( |
| 51 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), | 52 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize), |
| 52 helper_(helper), | 53 helper_(std::move(helper)), |
| 53 delete_sessions_alarm_( | 54 delete_sessions_alarm_( |
| 54 helper_->CreateAlarm(new DeleteSessionsAlarm(this))), | 55 helper_->CreateAlarm(new DeleteSessionsAlarm(this))), |
| 55 supported_versions_(supported_versions), | 56 supported_versions_(supported_versions), |
| 56 current_packet_(nullptr), | 57 current_packet_(nullptr), |
| 57 framer_(supported_versions, | 58 framer_(supported_versions, |
| 58 /*unused*/ QuicTime::Zero(), | 59 /*unused*/ QuicTime::Zero(), |
| 59 Perspective::IS_SERVER), | 60 Perspective::IS_SERVER), |
| 60 last_error_(QUIC_NO_ERROR) { | 61 last_error_(QUIC_NO_ERROR) { |
| 61 framer_.set_visitor(this); | 62 framer_.set_visitor(this); |
| 62 } | 63 } |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 482 |
| 482 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { | 483 QuicPacketWriter* QuicDispatcher::CreatePerConnectionWriter() { |
| 483 return new QuicPerConnectionPacketWriter(writer_.get()); | 484 return new QuicPerConnectionPacketWriter(writer_.get()); |
| 484 } | 485 } |
| 485 | 486 |
| 486 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 487 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
| 487 last_error_ = error; | 488 last_error_ = error; |
| 488 } | 489 } |
| 489 | 490 |
| 490 } // namespace net | 491 } // namespace net |
| OLD | NEW |