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

Side by Side Diff: runtime/bin/eventhandler_win.h

Issue 316813006: Fix previous fix, by still making 'handle' the socket. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_EVENTHANDLER_WIN_H_ 5 #ifndef BIN_EVENTHANDLER_WIN_H_
6 #define BIN_EVENTHANDLER_WIN_H_ 6 #define BIN_EVENTHANDLER_WIN_H_
7 7
8 #if !defined(BIN_EVENTHANDLER_H_) 8 #if !defined(BIN_EVENTHANDLER_H_)
9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. 9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead.
10 #endif 10 #endif
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 virtual void EnsureInitialized( 222 virtual void EnsureInitialized(
223 EventHandlerImplementation* event_handler) = 0; 223 EventHandlerImplementation* event_handler) = 0;
224 224
225 HANDLE handle() { return handle_; } 225 HANDLE handle() { return handle_; }
226 Dart_Port port() { return port_; } 226 Dart_Port port() { return port_; }
227 227
228 void Lock(); 228 void Lock();
229 void Unlock(); 229 void Unlock();
230 230
231 bool DoCreateCompletionPort(HANDLE handle, HANDLE completion_port); 231 bool CreateCompletionPort(HANDLE completion_port);
232 virtual bool CreateCompletionPort(HANDLE completion_port);
233 232
234 void Close(); 233 void Close();
235 virtual void DoClose(); 234 virtual void DoClose();
236 virtual bool IsClosed() = 0; 235 virtual bool IsClosed() = 0;
237 236
238 bool IsHandleClosed() const { return handle_ == INVALID_HANDLE_VALUE; } 237 bool IsHandleClosed() const { return handle_ == INVALID_HANDLE_VALUE; }
239 238
240 void SetPortAndMask(Dart_Port port, intptr_t mask) { 239 void SetPortAndMask(Dart_Port port, intptr_t mask) {
241 port_ = port; 240 port_ = port;
242 mask_ = mask; 241 mask_ = mask;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 private: 356 private:
358 int events_; 357 int events_;
359 bool recursive_; 358 bool recursive_;
360 }; 359 };
361 360
362 361
363 class SocketHandle : public Handle { 362 class SocketHandle : public Handle {
364 public: 363 public:
365 SOCKET socket() const { return socket_; } 364 SOCKET socket() const { return socket_; }
366 365
367 virtual bool CreateCompletionPort(HANDLE completion_port);
368
369 protected: 366 protected:
370 explicit SocketHandle(SOCKET s) 367 explicit SocketHandle(SOCKET s)
371 : Handle(INVALID_HANDLE_VALUE), 368 : Handle(reinterpret_cast<HANDLE>(s)),
372 socket_(s) {} 369 socket_(s) {}
373 SocketHandle(SOCKET s, Dart_Port port) 370 SocketHandle(SOCKET s, Dart_Port port)
374 : Handle(INVALID_HANDLE_VALUE, port), 371 : Handle(reinterpret_cast<HANDLE>(s), port),
375 socket_(s) {} 372 socket_(s) {}
376 373
377 virtual void HandleIssueError(); 374 virtual void HandleIssueError();
378 375
379 private: 376 private:
380 const SOCKET socket_; 377 const SOCKET socket_;
381 }; 378 };
382 379
383 380
384 // Information on listen sockets. 381 // Information on listen sockets.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 539
543 TimeoutQueue timeout_queue_; // Time for next timeout. 540 TimeoutQueue timeout_queue_; // Time for next timeout.
544 bool shutdown_; 541 bool shutdown_;
545 HANDLE completion_port_; 542 HANDLE completion_port_;
546 }; 543 };
547 544
548 } // namespace bin 545 } // namespace bin
549 } // namespace dart 546 } // namespace dart
550 547
551 #endif // BIN_EVENTHANDLER_WIN_H_ 548 #endif // BIN_EVENTHANDLER_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/eventhandler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698