| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_EVENTHANDLER_LINUX_H_ | 5 #ifndef BIN_EVENTHANDLER_LINUX_H_ |
| 6 #define BIN_EVENTHANDLER_LINUX_H_ | 6 #define BIN_EVENTHANDLER_LINUX_H_ |
| 7 | 7 |
| 8 #if !defined(BIN_EVENTHANDLER_H_) | 8 #if !defined(BIN_EVENTHANDLER_H_) |
| 9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_linux.h directly; use eventhandler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 SocketData* GetSocketData(intptr_t fd); | 91 SocketData* GetSocketData(intptr_t fd); |
| 92 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data); | 92 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data); |
| 93 void StartEventHandler(); | 93 void StartEventHandler(); |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 intptr_t GetTimeout(); | 96 intptr_t GetTimeout(); |
| 97 bool GetInterruptMessage(InterruptMessage* msg); | 97 bool GetInterruptMessage(InterruptMessage* msg); |
| 98 struct pollfd* GetPollFds(intptr_t* size); | 98 struct pollfd* GetPollFds(intptr_t* size); |
| 99 void HandleEvents(struct pollfd* pollfds, int pollfds_size, int result_size); | 99 void HandleEvents(struct pollfd* pollfds, int pollfds_size, int result_size); |
| 100 void HandleTimeout(); | 100 void HandleTimeout(); |
| 101 static void* Poll(void* args); | 101 static void Poll(uword args); |
| 102 void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data); | 102 void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data); |
| 103 void HandleInterruptFd(); | 103 void HandleInterruptFd(); |
| 104 void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); | 104 void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); |
| 105 intptr_t GetPollEvents(struct pollfd* pollfd); | 105 intptr_t GetPollEvents(struct pollfd* pollfd); |
| 106 | 106 |
| 107 SocketData* socket_map_; | 107 SocketData* socket_map_; |
| 108 intptr_t socket_map_size_; | 108 intptr_t socket_map_size_; |
| 109 int64_t timeout_; // Time for next timeout. | 109 int64_t timeout_; // Time for next timeout. |
| 110 Dart_Port timeout_port_; | 110 Dart_Port timeout_port_; |
| 111 int interrupt_fds_[2]; | 111 int interrupt_fds_[2]; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 | 114 |
| 115 #endif // BIN_EVENTHANDLER_LINUX_H_ | 115 #endif // BIN_EVENTHANDLER_LINUX_H_ |
| OLD | NEW |