| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic/quic_time_wait_list_manager.h" | 5 #include "net/quic/quic_time_wait_list_manager.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // A very simple alarm that just informs the QuicTimeWaitListManager to clean | 35 // A very simple alarm that just informs the QuicTimeWaitListManager to clean |
| 36 // up old connection_ids. This alarm should be unregistered and deleted before | 36 // up old connection_ids. This alarm should be unregistered and deleted before |
| 37 // the QuicTimeWaitListManager is deleted. | 37 // the QuicTimeWaitListManager is deleted. |
| 38 class ConnectionIdCleanUpAlarm : public QuicAlarm::Delegate { | 38 class ConnectionIdCleanUpAlarm : public QuicAlarm::Delegate { |
| 39 public: | 39 public: |
| 40 explicit ConnectionIdCleanUpAlarm( | 40 explicit ConnectionIdCleanUpAlarm( |
| 41 QuicTimeWaitListManager* time_wait_list_manager) | 41 QuicTimeWaitListManager* time_wait_list_manager) |
| 42 : time_wait_list_manager_(time_wait_list_manager) {} | 42 : time_wait_list_manager_(time_wait_list_manager) {} |
| 43 | 43 |
| 44 virtual QuicTime OnAlarm() OVERRIDE { | 44 virtual QuicTime OnAlarm() override { |
| 45 time_wait_list_manager_->CleanUpOldConnectionIds(); | 45 time_wait_list_manager_->CleanUpOldConnectionIds(); |
| 46 // Let the time wait manager register the alarm at appropriate time. | 46 // Let the time wait manager register the alarm at appropriate time. |
| 47 return QuicTime::Zero(); | 47 return QuicTime::Zero(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // Not owned. | 51 // Not owned. |
| 52 QuicTimeWaitListManager* time_wait_list_manager_; | 52 QuicTimeWaitListManager* time_wait_list_manager_; |
| 53 }; | 53 }; |
| 54 | 54 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 break; | 274 break; |
| 275 } | 275 } |
| 276 // This connection_id has lived its age, retire it now. | 276 // This connection_id has lived its age, retire it now. |
| 277 delete it->second.close_packet; | 277 delete it->second.close_packet; |
| 278 connection_id_map_.erase(it); | 278 connection_id_map_.erase(it); |
| 279 } | 279 } |
| 280 SetConnectionIdCleanUpAlarm(); | 280 SetConnectionIdCleanUpAlarm(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace net | 283 } // namespace net |
| OLD | NEW |