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

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') | runtime/bin/eventhandler_win.cc » ('J')
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 bool write_thread_running_; 333 bool write_thread_running_;
334 dart::Monitor* write_monitor_; 334 dart::Monitor* write_monitor_;
335 }; 335 };
336 336
337 337
338 class DirectoryWatchHandle : public Handle { 338 class DirectoryWatchHandle : public Handle {
339 public: 339 public:
340 DirectoryWatchHandle(HANDLE handle, int events, bool recursive) 340 DirectoryWatchHandle(HANDLE handle, int events, bool recursive)
341 : Handle(handle), 341 : Handle(handle),
342 events_(events), 342 events_(events),
343 recursive_(recursive) { 343 recursive_(recursive),
344 closed_(false) {
344 type_ = kDirectoryWatch; 345 type_ = kDirectoryWatch;
345 } 346 }
346 347
347 virtual void EnsureInitialized(EventHandlerImplementation* event_handler); 348 virtual void EnsureInitialized(EventHandlerImplementation* event_handler);
348 virtual bool IsClosed(); 349 virtual bool IsClosed();
350 virtual void DoClose();
349 351
350 virtual bool IssueRead(); 352 virtual bool IssueRead();
351 353
352 void Stop(); 354 void Stop();
353 355
354 private: 356 private:
355 int events_; 357 int events_;
356 bool recursive_; 358 bool recursive_;
359 bool closed_;
357 }; 360 };
358 361
359 362
360 class SocketHandle : public Handle { 363 class SocketHandle : public Handle {
361 public: 364 public:
362 SOCKET socket() { return reinterpret_cast<SOCKET>(handle_); } 365 SOCKET socket() { return reinterpret_cast<SOCKET>(handle_); }
363 366
364 protected: 367 protected:
365 explicit SocketHandle(SOCKET s) : Handle(reinterpret_cast<HANDLE>(s)) {} 368 explicit SocketHandle(SOCKET s) : Handle(reinterpret_cast<HANDLE>(s)) {}
366 SocketHandle(SOCKET s, Dart_Port port) 369 SocketHandle(SOCKET s, Dart_Port port)
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 534
532 TimeoutQueue timeout_queue_; // Time for next timeout. 535 TimeoutQueue timeout_queue_; // Time for next timeout.
533 bool shutdown_; 536 bool shutdown_;
534 HANDLE completion_port_; 537 HANDLE completion_port_;
535 }; 538 };
536 539
537 } // namespace bin 540 } // namespace bin
538 } // namespace dart 541 } // namespace dart
539 542
540 #endif // BIN_EVENTHANDLER_WIN_H_ 543 #endif // BIN_EVENTHANDLER_WIN_H_
OLDNEW
« 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