Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: runtime/bin/eventhandler_linux.h

Issue 171503009: Remove SocketData and now only pass the dart port to epoll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler_android.cc ('k') | runtime/bin/eventhandler_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_linux.h
diff --git a/runtime/bin/eventhandler_linux.h b/runtime/bin/eventhandler_linux.h
index bec36ce3ece8c0ab112384f29f23b027a4cda344..f5386c34fbca8a1808a12ae8e5ace1899759f223 100644
--- a/runtime/bin/eventhandler_linux.h
+++ b/runtime/bin/eventhandler_linux.h
@@ -20,80 +20,26 @@
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_;
-};
-
-
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 Notify(intptr_t id, Dart_Port dart_port, int64_t data);
void Start(EventHandler* handler);
void Shutdown();
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
« no previous file with comments | « runtime/bin/eventhandler_android.cc ('k') | runtime/bin/eventhandler_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698