| 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/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 25 matching lines...) Expand all Loading... |
| 36 // A very simple alarm that just informs the QuicTimeWaitListManager to clean | 36 // A very simple alarm that just informs the QuicTimeWaitListManager to clean |
| 37 // up old connection_ids. This alarm should be unregistered and deleted before | 37 // up old connection_ids. This alarm should be unregistered and deleted before |
| 38 // the QuicTimeWaitListManager is deleted. | 38 // the QuicTimeWaitListManager is deleted. |
| 39 class ConnectionIdCleanUpAlarm : public EpollAlarm { | 39 class ConnectionIdCleanUpAlarm : public EpollAlarm { |
| 40 public: | 40 public: |
| 41 explicit ConnectionIdCleanUpAlarm( | 41 explicit ConnectionIdCleanUpAlarm( |
| 42 QuicTimeWaitListManager* time_wait_list_manager) | 42 QuicTimeWaitListManager* time_wait_list_manager) |
| 43 : time_wait_list_manager_(time_wait_list_manager) { | 43 : time_wait_list_manager_(time_wait_list_manager) { |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual int64 OnAlarm() OVERRIDE { | 46 virtual int64 OnAlarm() override { |
| 47 EpollAlarm::OnAlarm(); | 47 EpollAlarm::OnAlarm(); |
| 48 time_wait_list_manager_->CleanUpOldConnectionIds(); | 48 time_wait_list_manager_->CleanUpOldConnectionIds(); |
| 49 // Let the time wait manager register the alarm at appropriate time. | 49 // Let the time wait manager register the alarm at appropriate time. |
| 50 return 0; | 50 return 0; |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // Not owned. | 54 // Not owned. |
| 55 QuicTimeWaitListManager* time_wait_list_manager_; | 55 QuicTimeWaitListManager* time_wait_list_manager_; |
| 56 }; | 56 }; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 // This connection_id has lived its age, retire it now. | 282 // This connection_id has lived its age, retire it now. |
| 283 delete it->second.close_packet; | 283 delete it->second.close_packet; |
| 284 connection_id_map_.erase(it); | 284 connection_id_map_.erase(it); |
| 285 } | 285 } |
| 286 SetConnectionIdCleanUpAlarm(); | 286 SetConnectionIdCleanUpAlarm(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace tools | 289 } // namespace tools |
| 290 } // namespace net | 290 } // namespace net |
| OLD | NEW |