| 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_time_wait_list_manager.h" | 5 #include "net/tools/quic/quic_time_wait_list_manager.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 const IPEndPoint server_address_; | 69 const IPEndPoint server_address_; |
| 70 const IPEndPoint client_address_; | 70 const IPEndPoint client_address_; |
| 71 std::unique_ptr<QuicEncryptedPacket> packet_; | 71 std::unique_ptr<QuicEncryptedPacket> packet_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(QueuedPacket); | 73 DISALLOW_COPY_AND_ASSIGN(QueuedPacket); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 QuicTimeWaitListManager::QuicTimeWaitListManager( | 76 QuicTimeWaitListManager::QuicTimeWaitListManager( |
| 77 QuicPacketWriter* writer, | 77 QuicPacketWriter* writer, |
| 78 QuicServerSessionVisitor* visitor, | 78 QuicServerSessionVisitor* visitor, |
| 79 QuicConnectionHelperInterface* helper) | 79 QuicConnectionHelperInterface* helper, |
| 80 QuicAlarmFactory* alarm_factory) |
| 80 : time_wait_period_( | 81 : time_wait_period_( |
| 81 QuicTime::Delta::FromSeconds(FLAGS_quic_time_wait_list_seconds)), | 82 QuicTime::Delta::FromSeconds(FLAGS_quic_time_wait_list_seconds)), |
| 82 connection_id_clean_up_alarm_( | 83 connection_id_clean_up_alarm_( |
| 83 helper->CreateAlarm(new ConnectionIdCleanUpAlarm(this))), | 84 alarm_factory->CreateAlarm(new ConnectionIdCleanUpAlarm(this))), |
| 84 clock_(helper->GetClock()), | 85 clock_(helper->GetClock()), |
| 85 writer_(writer), | 86 writer_(writer), |
| 86 visitor_(visitor) { | 87 visitor_(visitor) { |
| 87 SetConnectionIdCleanUpAlarm(); | 88 SetConnectionIdCleanUpAlarm(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 QuicTimeWaitListManager::~QuicTimeWaitListManager() { | 91 QuicTimeWaitListManager::~QuicTimeWaitListManager() { |
| 91 connection_id_clean_up_alarm_->Cancel(); | 92 connection_id_clean_up_alarm_->Cancel(); |
| 92 STLDeleteElements(&pending_packets_queue_); | 93 STLDeleteElements(&pending_packets_queue_); |
| 93 for (ConnectionIdMap::iterator it = connection_id_map_.begin(); | 94 for (ConnectionIdMap::iterator it = connection_id_map_.begin(); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 version(version_), | 334 version(version_), |
| 334 time_added(time_added_), | 335 time_added(time_added_), |
| 335 connection_rejected_statelessly(connection_rejected_statelessly) {} | 336 connection_rejected_statelessly(connection_rejected_statelessly) {} |
| 336 | 337 |
| 337 QuicTimeWaitListManager::ConnectionIdData::ConnectionIdData( | 338 QuicTimeWaitListManager::ConnectionIdData::ConnectionIdData( |
| 338 const ConnectionIdData& other) = default; | 339 const ConnectionIdData& other) = default; |
| 339 | 340 |
| 340 QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() {} | 341 QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() {} |
| 341 | 342 |
| 342 } // namespace net | 343 } // namespace net |
| OLD | NEW |