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

Unified Diff: dart/runtime/bin/eventhandler_macos.h

Issue 900363004: Introduce a kSetEventMaskCommand, some cleanups in windows eventhandler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 5 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 | « dart/runtime/bin/eventhandler_linux.cc ('k') | dart/runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/bin/eventhandler_macos.h
diff --git a/dart/runtime/bin/eventhandler_macos.h b/dart/runtime/bin/eventhandler_macos.h
index 1fffff00fc48d7ae60499137e65b7dc5c5d83346..ebfe251b35718cf228d15042a55fff179ede5840 100644
--- a/dart/runtime/bin/eventhandler_macos.h
+++ b/dart/runtime/bin/eventhandler_macos.h
@@ -23,19 +23,20 @@ namespace bin {
class SocketData {
public:
- explicit SocketData(intptr_t fd)
+ explicit SocketData(intptr_t fd, bool is_listening)
: fd_(fd),
port_(0),
mask_(0),
tracked_by_kqueue_(false),
- tokens_(16) {
+ tokens_(16),
+ is_listening_(is_listening) {
ASSERT(fd_ != -1);
}
bool HasReadEvent();
bool HasWriteEvent();
- bool IsListeningSocket() { return (mask_ & (1 << kListeningSocket)) != 0; }
+ bool IsListeningSocket() { return is_listening_; }
void SetPortAndMask(Dart_Port port, intptr_t mask) {
ASSERT(fd_ != -1);
@@ -69,6 +70,7 @@ class SocketData {
intptr_t mask_;
bool tracked_by_kqueue_;
int tokens_;
+ bool is_listening_;
};
@@ -79,7 +81,7 @@ class 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);
+ SocketData* GetSocketData(intptr_t fd, bool is_listening);
void SendData(intptr_t id, Dart_Port dart_port, int64_t data);
void Start(EventHandler* handler);
void Shutdown();
« no previous file with comments | « dart/runtime/bin/eventhandler_linux.cc ('k') | dart/runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698