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_epoll_connection_helper.h" | 5 #include "net/tools/quic/quic_epoll_connection_helper.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 void CancelImpl() override { | 37 void CancelImpl() override { |
38 DCHECK(!deadline().IsInitialized()); | 38 DCHECK(!deadline().IsInitialized()); |
39 epoll_alarm_impl_.UnregisterIfRegistered(); | 39 epoll_alarm_impl_.UnregisterIfRegistered(); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 class EpollAlarmImpl : public EpollAlarm { | 43 class EpollAlarmImpl : public EpollAlarm { |
44 public: | 44 public: |
45 explicit EpollAlarmImpl(QuicEpollAlarm* alarm) : alarm_(alarm) {} | 45 explicit EpollAlarmImpl(QuicEpollAlarm* alarm) : alarm_(alarm) {} |
46 | 46 |
47 int64 OnAlarm() override { | 47 int64_t OnAlarm() override { |
48 EpollAlarm::OnAlarm(); | 48 EpollAlarm::OnAlarm(); |
49 alarm_->Fire(); | 49 alarm_->Fire(); |
50 // Fire will take care of registering the alarm, if needed. | 50 // Fire will take care of registering the alarm, if needed. |
51 return 0; | 51 return 0; |
52 } | 52 } |
53 | 53 |
54 private: | 54 private: |
55 QuicEpollAlarm* alarm_; | 55 QuicEpollAlarm* alarm_; |
56 }; | 56 }; |
57 | 57 |
(...skipping 18 matching lines...) Expand all Loading... |
76 return random_generator_; | 76 return random_generator_; |
77 } | 77 } |
78 | 78 |
79 QuicAlarm* QuicEpollConnectionHelper::CreateAlarm( | 79 QuicAlarm* QuicEpollConnectionHelper::CreateAlarm( |
80 QuicAlarm::Delegate* delegate) { | 80 QuicAlarm::Delegate* delegate) { |
81 return new QuicEpollAlarm(epoll_server_, delegate); | 81 return new QuicEpollAlarm(epoll_server_, delegate); |
82 } | 82 } |
83 | 83 |
84 } // namespace tools | 84 } // namespace tools |
85 } // namespace net | 85 } // namespace net |
OLD | NEW |