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

Unified Diff: runtime/bin/eventhandler_win.h

Issue 8437090: Change the handling of closing sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by ager@ Created 9 years, 1 month 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_macos.cc ('k') | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_win.h
diff --git a/runtime/bin/eventhandler_win.h b/runtime/bin/eventhandler_win.h
index 7eb664e9391f320b5ad2b31cca26c536b558adde..619a65a4ed53a479972129ff73d0bbd4fdf5d764 100644
--- a/runtime/bin/eventhandler_win.h
+++ b/runtime/bin/eventhandler_win.h
@@ -275,11 +275,13 @@ class ClientSocket : public SocketHandle {
public:
explicit ClientSocket(SOCKET s)
: SocketHandle(s),
- next_(NULL) { type_ = kClientSocket; }
+ next_(NULL),
+ flags_(0) { type_ = kClientSocket; }
ClientSocket(SOCKET s, Dart_Port port)
: SocketHandle(s, port),
- next_(NULL) { type_ = kClientSocket; }
+ next_(NULL),
+ flags_(0) { type_ = kClientSocket; }
virtual ~ClientSocket() {
// Don't delete this object until all pending requests have been handled.
@@ -288,6 +290,13 @@ class ClientSocket : public SocketHandle {
ASSERT(next_ == NULL);
};
+ void Shutdown(int how);
+ bool IsClosedRead() { return (flags_ & (1 << kCloseRead)) != 0; }
+ bool IsClosedWrite() { return (flags_ & (1 << kCloseWrite)) != 0; }
+
+ void MarkClosedRead() { flags_ |= (1 << kCloseRead); }
+ void MarkClosedWrite() { flags_ |= (1 << kCloseWrite); }
+
// Internal interface used by the event handler.
virtual bool IssueRead();
virtual bool IssueWrite();
@@ -300,9 +309,15 @@ class ClientSocket : public SocketHandle {
void set_next(ClientSocket* next) { next_ = next; }
private:
+ enum Flags {
+ kCloseRead = 0,
+ kCloseWrite = 1
+ };
+
virtual void AfterClose();
ClientSocket* next_;
+ int flags_;
};
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698