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

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

Issue 315003002: Fix double-closing of handles in Windows EventHandler. (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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 void Lock(); 228 void Lock();
229 void Unlock(); 229 void Unlock();
230 230
231 bool CreateCompletionPort(HANDLE completion_port); 231 bool CreateCompletionPort(HANDLE completion_port);
232 232
233 void Close(); 233 void Close();
234 virtual void DoClose(); 234 virtual void DoClose();
235 virtual bool IsClosed() = 0; 235 virtual bool IsClosed() = 0;
236 236
237 bool IsHandleClosed() const { return handle_ == INVALID_HANDLE_VALUE; }
238
237 void SetPortAndMask(Dart_Port port, intptr_t mask) { 239 void SetPortAndMask(Dart_Port port, intptr_t mask) {
238 port_ = port; 240 port_ = port;
239 mask_ = mask; 241 mask_ = mask;
240 } 242 }
241 Type type() { return type_; } 243 Type type() { return type_; }
242 bool is_file() { return type_ == kFile; } 244 bool is_file() { return type_ == kFile; }
243 bool is_socket() { return type_ == kListenSocket || 245 bool is_socket() { return type_ == kListenSocket ||
244 type_ == kClientSocket || 246 type_ == kClientSocket ||
245 type_ == kDatagramSocket; } 247 type_ == kDatagramSocket; }
246 bool is_listen_socket() { return type_ == kListenSocket; } 248 bool is_listen_socket() { return type_ == kListenSocket; }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 533
532 TimeoutQueue timeout_queue_; // Time for next timeout. 534 TimeoutQueue timeout_queue_; // Time for next timeout.
533 bool shutdown_; 535 bool shutdown_;
534 HANDLE completion_port_; 536 HANDLE completion_port_;
535 }; 537 };
536 538
537 } // namespace bin 539 } // namespace bin
538 } // namespace dart 540 } // namespace dart
539 541
540 #endif // BIN_EVENTHANDLER_WIN_H_ 542 #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