| Index: runtime/bin/eventhandler_linux.h
|
| diff --git a/runtime/bin/eventhandler_linux.h b/runtime/bin/eventhandler_linux.h
|
| index 7f2ee25518f7e6b55a45e738b5d511b5dcaea58d..cd5f48a163369ac5b5f7314f622b465e4b45c300 100644
|
| --- a/runtime/bin/eventhandler_linux.h
|
| +++ b/runtime/bin/eventhandler_linux.h
|
| @@ -20,61 +20,11 @@
|
| namespace dart {
|
| namespace bin {
|
|
|
| -class InterruptMessage {
|
| - public:
|
| - intptr_t id;
|
| - Dart_Port dart_port;
|
| - int64_t data;
|
| -};
|
| -
|
| -
|
| -class SocketData {
|
| - public:
|
| - explicit SocketData(intptr_t fd)
|
| - : tracked_by_epoll_(false), fd_(fd), port_(0) {
|
| - ASSERT(fd_ != -1);
|
| - }
|
| -
|
| - void ShutdownRead() {
|
| - shutdown(fd_, SHUT_RD);
|
| - }
|
| -
|
| - void ShutdownWrite() {
|
| - shutdown(fd_, SHUT_WR);
|
| - }
|
| -
|
| - void Close() {
|
| - port_ = 0;
|
| - close(fd_);
|
| - fd_ = -1;
|
| - }
|
| -
|
| - void SetPort(Dart_Port port) {
|
| - ASSERT(fd_ != -1);
|
| - port_ = port;
|
| - }
|
| -
|
| - intptr_t fd() { return fd_; }
|
| - Dart_Port port() { return port_; }
|
| - bool tracked_by_epoll() { return tracked_by_epoll_; }
|
| - void set_tracked_by_epoll(bool value) { tracked_by_epoll_ = value; }
|
| -
|
| - private:
|
| - bool tracked_by_epoll_;
|
| - intptr_t fd_;
|
| - Dart_Port port_;
|
| - intptr_t mask_;
|
| -};
|
| -
|
| -
|
| class EventHandlerImplementation {
|
| public:
|
| EventHandlerImplementation();
|
| ~EventHandlerImplementation();
|
|
|
| - // Gets the socket data structure for a given file
|
| - // descriptor. Creates a new one if one is not found.
|
| - SocketData* GetSocketData(intptr_t fd, bool* is_new);
|
| void SendData(intptr_t id, Dart_Port dart_port, int64_t data);
|
| void Start(EventHandler* handler);
|
| void Shutdown();
|
| @@ -82,19 +32,14 @@ class EventHandlerImplementation {
|
| private:
|
| void HandleEvents(struct epoll_event* events, int size);
|
| static void Poll(uword args);
|
| - void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data);
|
| - void HandleInterruptFd();
|
| void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask);
|
| - intptr_t GetPollEvents(intptr_t events, SocketData* sd);
|
| - static void* GetHashmapKeyFromFd(intptr_t fd);
|
| - static uint32_t GetHashmapHashFromFd(intptr_t fd);
|
| + intptr_t GetPollEvents(intptr_t events);
|
|
|
| - HashMap socket_map_;
|
| TimeoutQueue timeout_queue_;
|
| bool shutdown_;
|
| - int interrupt_fds_[2];
|
| int epoll_fd_;
|
| int timer_fd_;
|
| + Mutex timer_mutex_;
|
| };
|
|
|
| } // namespace bin
|
|
|