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

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

Issue 10693039: Terminate event handler thread on isolate shutdown. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding new file to gyp file Created 8 years, 5 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 | « runtime/bin/eventhandler_macos.cc ('k') | 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 }; 340 };
341 341
342 342
343 // Event handler. 343 // Event handler.
344 class EventHandlerImplementation { 344 class EventHandlerImplementation {
345 public: 345 public:
346 EventHandlerImplementation(); 346 EventHandlerImplementation();
347 virtual ~EventHandlerImplementation() {} 347 virtual ~EventHandlerImplementation() {}
348 348
349 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data); 349 void SendData(intptr_t id, Dart_Port dart_port, intptr_t data);
350 void StartEventHandler(); 350 void Start();
351 void Shutdown();
352
353 static void EventHandlerEntry(uword args);
351 354
352 DWORD GetTimeout(); 355 DWORD GetTimeout();
353 void HandleInterrupt(InterruptMessage* msg); 356 void HandleInterrupt(InterruptMessage* msg);
354 void HandleTimeout(); 357 void HandleTimeout();
355 void HandleAccept(ListenSocket* listen_socket, IOBuffer* buffer); 358 void HandleAccept(ListenSocket* listen_socket, IOBuffer* buffer);
356 void HandleClosed(Handle* handle); 359 void HandleClosed(Handle* handle);
357 void HandleError(Handle* handle); 360 void HandleError(Handle* handle);
358 void HandleRead(Handle* handle, int bytes, IOBuffer* buffer); 361 void HandleRead(Handle* handle, int bytes, IOBuffer* buffer);
359 void HandleWrite(Handle* handle, int bytes, IOBuffer* buffer); 362 void HandleWrite(Handle* handle, int bytes, IOBuffer* buffer);
360 void HandleClose(ClientSocket* client_socket); 363 void HandleClose(ClientSocket* client_socket);
361 void HandleIOCompletion(DWORD bytes, ULONG_PTR key, OVERLAPPED* overlapped); 364 void HandleIOCompletion(DWORD bytes, ULONG_PTR key, OVERLAPPED* overlapped);
362 365
363 HANDLE completion_port() { return completion_port_; } 366 HANDLE completion_port() { return completion_port_; }
364 367
365 private: 368 private:
366 ClientSocket* client_sockets_head_; 369 ClientSocket* client_sockets_head_;
367 370
368 int64_t timeout_; // Time for next timeout. 371 int64_t timeout_; // Time for next timeout.
369 Dart_Port timeout_port_; 372 Dart_Port timeout_port_;
373 bool shutdown_;
370 HANDLE completion_port_; 374 HANDLE completion_port_;
371 }; 375 };
372 376
373 377
374 #endif // BIN_EVENTHANDLER_WIN_H_ 378 #endif // BIN_EVENTHANDLER_WIN_H_
OLDNEW
« 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