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

Unified Diff: runtime/bin/eventhandler_win.h

Issue 313083004: Don't use same value for socket() and handle(), as they are different concepts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | runtime/bin/eventhandler_win.cc » ('J')
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 121cee43f8e5bd0a972725cc45c770d1f8287971..a09b503fa9b74209dc6939e560c52043e0a1c67e 100644
--- a/runtime/bin/eventhandler_win.h
+++ b/runtime/bin/eventhandler_win.h
@@ -228,7 +228,8 @@ class Handle {
void Lock();
void Unlock();
- bool CreateCompletionPort(HANDLE completion_port);
+ bool DoCreateCompletionPort(HANDLE handle, HANDLE completion_port);
+ virtual bool CreateCompletionPort(HANDLE completion_port);
void Close();
virtual void DoClose();
@@ -361,14 +362,22 @@ class DirectoryWatchHandle : public Handle {
class SocketHandle : public Handle {
public:
- SOCKET socket() { return reinterpret_cast<SOCKET>(handle_); }
+ SOCKET socket() const { return socket_; }
+
+ bool CreateCompletionPort(HANDLE completion_port);
kasperl 2014/06/04 14:09:19 Maybe also mark this virtual? (like it's done with
Anders Johnsen 2014/06/04 14:16:32 Done.
protected:
- explicit SocketHandle(SOCKET s) : Handle(reinterpret_cast<HANDLE>(s)) {}
+ explicit SocketHandle(SOCKET s)
+ : Handle(INVALID_HANDLE_VALUE),
+ socket_(s) {}
SocketHandle(SOCKET s, Dart_Port port)
- : Handle(reinterpret_cast<HANDLE>(s), port) {}
+ : Handle(INVALID_HANDLE_VALUE, port),
+ socket_(s) {}
virtual void HandleIssueError();
+
+ private:
+ const SOCKET socket_;
};
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | runtime/bin/eventhandler_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698