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