| 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 "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // A very simple alarm that just informs the QuicTimeWaitListManager to clean | 28 // A very simple alarm that just informs the QuicTimeWaitListManager to clean |
| 29 // up old connection_ids. This alarm should be cancelled and deleted before | 29 // up old connection_ids. This alarm should be cancelled and deleted before |
| 30 // the QuicTimeWaitListManager is deleted. | 30 // the QuicTimeWaitListManager is deleted. |
| 31 class ConnectionIdCleanUpAlarm : public QuicAlarm::Delegate { | 31 class ConnectionIdCleanUpAlarm : public QuicAlarm::Delegate { |
| 32 public: | 32 public: |
| 33 explicit ConnectionIdCleanUpAlarm( | 33 explicit ConnectionIdCleanUpAlarm( |
| 34 QuicTimeWaitListManager* time_wait_list_manager) | 34 QuicTimeWaitListManager* time_wait_list_manager) |
| 35 : time_wait_list_manager_(time_wait_list_manager) {} | 35 : time_wait_list_manager_(time_wait_list_manager) {} |
| 36 | 36 |
| 37 QuicTime OnAlarm() override { | 37 void OnAlarm() override { |
| 38 time_wait_list_manager_->CleanUpOldConnectionIds(); | 38 time_wait_list_manager_->CleanUpOldConnectionIds(); |
| 39 // Let the time wait manager register the alarm at appropriate time. | |
| 40 return QuicTime::Zero(); | |
| 41 } | 39 } |
| 42 | 40 |
| 43 private: | 41 private: |
| 44 // Not owned. | 42 // Not owned. |
| 45 QuicTimeWaitListManager* time_wait_list_manager_; | 43 QuicTimeWaitListManager* time_wait_list_manager_; |
| 46 | 44 |
| 47 DISALLOW_COPY_AND_ASSIGN(ConnectionIdCleanUpAlarm); | 45 DISALLOW_COPY_AND_ASSIGN(ConnectionIdCleanUpAlarm); |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 // This class stores pending public reset packets to be sent to clients. | 48 // This class stores pending public reset packets to be sent to clients. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 version(version_), | 333 version(version_), |
| 336 time_added(time_added_), | 334 time_added(time_added_), |
| 337 connection_rejected_statelessly(connection_rejected_statelessly) {} | 335 connection_rejected_statelessly(connection_rejected_statelessly) {} |
| 338 | 336 |
| 339 QuicTimeWaitListManager::ConnectionIdData::ConnectionIdData( | 337 QuicTimeWaitListManager::ConnectionIdData::ConnectionIdData( |
| 340 const ConnectionIdData& other) = default; | 338 const ConnectionIdData& other) = default; |
| 341 | 339 |
| 342 QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() {} | 340 QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() {} |
| 343 | 341 |
| 344 } // namespace net | 342 } // namespace net |
| OLD | NEW |