OLD | NEW |
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 public: | 364 public: |
365 EventHandlerImplementation(); | 365 EventHandlerImplementation(); |
366 virtual ~EventHandlerImplementation(); | 366 virtual ~EventHandlerImplementation(); |
367 | 367 |
368 void SendData(intptr_t id, Dart_Port dart_port, int64_t data); | 368 void SendData(intptr_t id, Dart_Port dart_port, int64_t data); |
369 void Start(EventHandler* handler); | 369 void Start(EventHandler* handler); |
370 void Shutdown(); | 370 void Shutdown(); |
371 | 371 |
372 static void EventHandlerEntry(uword args); | 372 static void EventHandlerEntry(uword args); |
373 | 373 |
374 DWORD GetTimeout(); | 374 int64_t GetTimeout(); |
375 void HandleInterrupt(InterruptMessage* msg); | 375 void HandleInterrupt(InterruptMessage* msg); |
376 void HandleTimeout(); | 376 void HandleTimeout(); |
377 void HandleAccept(ListenSocket* listen_socket, IOBuffer* buffer); | 377 void HandleAccept(ListenSocket* listen_socket, IOBuffer* buffer); |
378 void HandleClosed(Handle* handle); | 378 void HandleClosed(Handle* handle); |
379 void HandleError(Handle* handle); | 379 void HandleError(Handle* handle); |
380 void HandleRead(Handle* handle, int bytes, IOBuffer* buffer); | 380 void HandleRead(Handle* handle, int bytes, IOBuffer* buffer); |
381 void HandleWrite(Handle* handle, int bytes, IOBuffer* buffer); | 381 void HandleWrite(Handle* handle, int bytes, IOBuffer* buffer); |
382 void HandleDisconnect(ClientSocket* client_socket, | 382 void HandleDisconnect(ClientSocket* client_socket, |
383 int bytes, | 383 int bytes, |
384 IOBuffer* buffer); | 384 IOBuffer* buffer); |
385 void HandleIOCompletion(DWORD bytes, ULONG_PTR key, OVERLAPPED* overlapped); | 385 void HandleIOCompletion(DWORD bytes, ULONG_PTR key, OVERLAPPED* overlapped); |
386 | 386 |
387 HANDLE completion_port() { return completion_port_; } | 387 HANDLE completion_port() { return completion_port_; } |
388 | 388 |
389 private: | 389 private: |
390 ClientSocket* client_sockets_head_; | 390 ClientSocket* client_sockets_head_; |
391 | 391 |
392 int64_t timeout_; // Time for next timeout. | 392 int64_t timeout_; // Time for next timeout. |
393 Dart_Port timeout_port_; | 393 Dart_Port timeout_port_; |
394 bool shutdown_; | 394 bool shutdown_; |
395 HANDLE completion_port_; | 395 HANDLE completion_port_; |
396 }; | 396 }; |
397 | 397 |
398 } // namespace bin | 398 } // namespace bin |
399 } // namespace dart | 399 } // namespace dart |
400 | 400 |
401 #endif // BIN_EVENTHANDLER_WIN_H_ | 401 #endif // BIN_EVENTHANDLER_WIN_H_ |
OLD | NEW |