| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/epoll_server/epoll_server.h" | 5 #include "net/tools/epoll_server/epoll_server.h" |
| 6 | 6 |
| 7 #include <unistd.h> // For read, pipe, close and write. | 7 #include <unistd.h> // For read, pipe, close and write. |
| 8 #include <stdlib.h> // for abort | 8 #include <stdlib.h> // for abort |
| 9 #include <errno.h> // for errno and strerror_r | 9 #include <errno.h> // for errno and strerror_r |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 void EpollServer::VerifyReadyList() const { | 431 void EpollServer::VerifyReadyList() const { |
| 432 int count = 0; | 432 int count = 0; |
| 433 CBAndEventMask* cur = ready_list_.lh_first; | 433 CBAndEventMask* cur = ready_list_.lh_first; |
| 434 for (; cur; cur = cur->entry.le_next) { | 434 for (; cur; cur = cur->entry.le_next) { |
| 435 ++count; | 435 ++count; |
| 436 } | 436 } |
| 437 for (cur = tmp_list_.lh_first; cur; cur = cur->entry.le_next) { | 437 for (cur = tmp_list_.lh_first; cur; cur = cur->entry.le_next) { |
| 438 ++count; | 438 ++count; |
| 439 } | 439 } |
| 440 CHECK_EQ(ready_list_size_, count) << "Ready list size does not match count"; | 440 // Ready list size does not match count |
| 441 CHECK_EQ(ready_list_size_, count); |
| 441 } | 442 } |
| 442 | 443 |
| 443 void EpollServer::RegisterAlarm(int64_t timeout_time_in_us, AlarmCB* ac) { | 444 void EpollServer::RegisterAlarm(int64_t timeout_time_in_us, AlarmCB* ac) { |
| 444 CHECK(ac); | 445 CHECK(ac); |
| 445 if (base::ContainsKey(all_alarms_, ac)) { | 446 if (base::ContainsKey(all_alarms_, ac)) { |
| 446 LOG(FATAL) << "Alarm already exists " << ac; | 447 LOG(FATAL) << "Alarm already exists " << ac; |
| 447 } | 448 } |
| 448 VLOG(4) << "RegisteringAlarm at : " << timeout_time_in_us; | 449 VLOG(4) << "RegisteringAlarm at : " << timeout_time_in_us; |
| 449 | 450 |
| 450 TimeToAlarmCBMap::iterator alarm_iter = | 451 TimeToAlarmCBMap::iterator alarm_iter = |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 | 796 |
| 796 // If the alarm was registered, unregister it. | 797 // If the alarm was registered, unregister it. |
| 797 void EpollAlarm::UnregisterIfRegistered() { | 798 void EpollAlarm::UnregisterIfRegistered() { |
| 798 if (!registered_) { | 799 if (!registered_) { |
| 799 return; | 800 return; |
| 800 } | 801 } |
| 801 eps_->UnregisterAlarm(token_); | 802 eps_->UnregisterAlarm(token_); |
| 802 } | 803 } |
| 803 | 804 |
| 804 } // namespace net | 805 } // namespace net |
| OLD | NEW |