| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 void MarkClosing() { flags_ |= (1 << kClosing); } | 217 void MarkClosing() { flags_ |= (1 << kClosing); } |
| 218 void MarkClosedRead() { flags_ |= (1 << kCloseRead); } | 218 void MarkClosedRead() { flags_ |= (1 << kCloseRead); } |
| 219 void MarkClosedWrite() { flags_ |= (1 << kCloseWrite); } | 219 void MarkClosedWrite() { flags_ |= (1 << kCloseWrite); } |
| 220 void MarkError() { flags_ |= (1 << kError); } | 220 void MarkError() { flags_ |= (1 << kError); } |
| 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 EventHandlerImplementation* event_handler() { return event_handler_; } | |
| 228 | 227 |
| 229 void Lock(); | 228 void Lock(); |
| 230 void Unlock(); | 229 void Unlock(); |
| 231 | 230 |
| 232 bool CreateCompletionPort(HANDLE completion_port); | 231 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 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 closed_(false) { | 431 closed_(false) { |
| 433 LoadDisconnectEx(); | 432 LoadDisconnectEx(); |
| 434 type_ = kClientSocket; | 433 type_ = kClientSocket; |
| 435 } | 434 } |
| 436 | 435 |
| 437 virtual ~ClientSocket() { | 436 virtual ~ClientSocket() { |
| 438 // Don't delete this object until all pending requests have been handled. | 437 // Don't delete this object until all pending requests have been handled. |
| 439 ASSERT(!HasPendingRead()); | 438 ASSERT(!HasPendingRead()); |
| 440 ASSERT(!HasPendingWrite()); | 439 ASSERT(!HasPendingWrite()); |
| 441 ASSERT(next_ == NULL); | 440 ASSERT(next_ == NULL); |
| 441 ASSERT(closed_ == true); |
| 442 }; | 442 }; |
| 443 | 443 |
| 444 void Shutdown(int how); | 444 void Shutdown(int how); |
| 445 | 445 |
| 446 // Internal interface used by the event handler. | 446 // Internal interface used by the event handler. |
| 447 virtual bool IssueRead(); | 447 virtual bool IssueRead(); |
| 448 virtual bool IssueWrite(); | 448 virtual bool IssueWrite(); |
| 449 void IssueDisconnect(); | 449 void IssueDisconnect(); |
| 450 void DisconnectComplete(OverlappedBuffer* buffer); | 450 void DisconnectComplete(OverlappedBuffer* buffer); |
| 451 | 451 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 531 |
| 532 TimeoutQueue timeout_queue_; // Time for next timeout. | 532 TimeoutQueue timeout_queue_; // Time for next timeout. |
| 533 bool shutdown_; | 533 bool shutdown_; |
| 534 HANDLE completion_port_; | 534 HANDLE completion_port_; |
| 535 }; | 535 }; |
| 536 | 536 |
| 537 } // namespace bin | 537 } // namespace bin |
| 538 } // namespace dart | 538 } // namespace dart |
| 539 | 539 |
| 540 #endif // BIN_EVENTHANDLER_WIN_H_ | 540 #endif // BIN_EVENTHANDLER_WIN_H_ |
| OLD | NEW |