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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_ |
6 #define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "net/tools/epoll_server/epoll_server.h" | 9 #include "net/tools/epoll_server/epoll_server.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 WaitForEventsAndExecuteCallbacks(); | 78 WaitForEventsAndExecuteCallbacks(); |
79 } | 79 } |
80 | 80 |
81 base::hash_set<AlarmCB*>::size_type NumberOfAlarms() const { | 81 base::hash_set<AlarmCB*>::size_type NumberOfAlarms() const { |
82 return all_alarms_.size(); | 82 return all_alarms_.size(); |
83 } | 83 } |
84 | 84 |
85 protected: // functions | 85 protected: // functions |
86 // These functions do nothing here, as we're not actually | 86 // These functions do nothing here, as we're not actually |
87 // using the epoll_* syscalls. | 87 // using the epoll_* syscalls. |
88 virtual void DelFD(int fd) const OVERRIDE { } | 88 virtual void DelFD(int fd) const OVERRIDE {} |
89 virtual void AddFD(int fd, int event_mask) const OVERRIDE { } | 89 virtual void AddFD(int fd, int event_mask) const OVERRIDE {} |
90 virtual void ModFD(int fd, int event_mask) const OVERRIDE { } | 90 virtual void ModFD(int fd, int event_mask) const OVERRIDE {} |
91 | 91 |
92 // Replaces the epoll_server's epoll_wait_impl. | 92 // Replaces the epoll_server's epoll_wait_impl. |
93 virtual int epoll_wait_impl(int epfd, | 93 virtual int epoll_wait_impl(int epfd, |
94 struct epoll_event* events, | 94 struct epoll_event* events, |
95 int max_events, | 95 int max_events, |
96 int timeout_in_ms) OVERRIDE; | 96 int timeout_in_ms) OVERRIDE; |
97 virtual void SetNonblocking (int fd) OVERRIDE { } | 97 virtual void SetNonblocking (int fd) OVERRIDE {} |
98 | 98 |
99 private: // members | 99 private: // members |
100 EventQueue event_queue_; | 100 EventQueue event_queue_; |
101 int64 until_in_usec_; | 101 int64 until_in_usec_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(MockEpollServer); | 103 DISALLOW_COPY_AND_ASSIGN(MockEpollServer); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace test | 106 } // namespace test |
107 } // namespace tools | 107 } // namespace tools |
108 } // namespace net | 108 } // namespace net |
109 | 109 |
110 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_ | 110 #endif // NET_TOOLS_QUIC_TEST_TOOLS_MOCK_EPOLL_SERVER_H_ |
OLD | NEW |