| 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_MACOS_H_ | 5 #ifndef BIN_EVENTHANDLER_MACOS_H_ |
| 6 #define BIN_EVENTHANDLER_MACOS_H_ | 6 #define BIN_EVENTHANDLER_MACOS_H_ |
| 7 | 7 |
| 8 #if !defined(BIN_EVENTHANDLER_H_) | 8 #if !defined(BIN_EVENTHANDLER_H_) |
| 9 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_macos.h directly; use eventhandler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 SocketData* GetSocketData(intptr_t fd); | 89 SocketData* GetSocketData(intptr_t fd); |
| 90 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data); | 90 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data); |
| 91 void StartEventHandler(); | 91 void StartEventHandler(); |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 intptr_t GetTimeout(); | 94 intptr_t GetTimeout(); |
| 95 bool GetInterruptMessage(InterruptMessage* msg); | 95 bool GetInterruptMessage(InterruptMessage* msg); |
| 96 struct pollfd* GetPollFds(intptr_t* size); | 96 struct pollfd* GetPollFds(intptr_t* size); |
| 97 void HandleEvents(struct pollfd* pollfds, int pollfds_size, int result_size); | 97 void HandleEvents(struct pollfd* pollfds, int pollfds_size, int result_size); |
| 98 void HandleTimeout(); | 98 void HandleTimeout(); |
| 99 static void* Poll(void* args); | 99 static void Poll(uword args); |
| 100 void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data); | 100 void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data); |
| 101 void HandleInterruptFd(); | 101 void HandleInterruptFd(); |
| 102 void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); | 102 void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); |
| 103 intptr_t GetPollEvents(struct pollfd* pollfd); | 103 intptr_t GetPollEvents(struct pollfd* pollfd); |
| 104 | 104 |
| 105 SocketData* socket_map_; | 105 SocketData* socket_map_; |
| 106 intptr_t socket_map_size_; | 106 intptr_t socket_map_size_; |
| 107 int64_t timeout_; // Time for next timeout. | 107 int64_t timeout_; // Time for next timeout. |
| 108 Dart_Port timeout_port_; | 108 Dart_Port timeout_port_; |
| 109 int interrupt_fds_[2]; | 109 int interrupt_fds_[2]; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 | 112 |
| 113 #endif // BIN_EVENTHANDLER_MACOS_H_ | 113 #endif // BIN_EVENTHANDLER_MACOS_H_ |
| OLD | NEW |