| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include <process.h> | 5 #include <process.h> |
| 6 #include <winsock2.h> | 6 #include <winsock2.h> |
| 7 #include <ws2tcpip.h> | 7 #include <ws2tcpip.h> |
| 8 #include <mswsock.h> | 8 #include <mswsock.h> |
| 9 | 9 |
| 10 #include "bin/builtin.h" | 10 #include "bin/builtin.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 event_handler_->HandleClosed(this); | 294 event_handler_->HandleClosed(this); |
| 295 IOBuffer::DisposeBuffer(buffer); | 295 IOBuffer::DisposeBuffer(buffer); |
| 296 return false; | 296 return false; |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 void FileHandle::EnsureInitialized(EventHandlerImplementation* event_handler) { | 300 void FileHandle::EnsureInitialized(EventHandlerImplementation* event_handler) { |
| 301 ScopedLock lock(this); | 301 ScopedLock lock(this); |
| 302 event_handler_ = event_handler; | 302 event_handler_ = event_handler; |
| 303 if (SupportsOverlappedIO() && completion_port_ == INVALID_HANDLE_VALUE) { | 303 if (SupportsOverlappedIO() && completion_port_ == INVALID_HANDLE_VALUE) { |
| 304 ASSERT(event_handler_ == NULL); | |
| 305 CreateCompletionPort(event_handler_->completion_port()); | 304 CreateCompletionPort(event_handler_->completion_port()); |
| 306 } | 305 } |
| 307 } | 306 } |
| 308 | 307 |
| 309 | 308 |
| 310 bool FileHandle::IsClosed() { | 309 bool FileHandle::IsClosed() { |
| 311 return false; | 310 return false; |
| 312 } | 311 } |
| 313 | 312 |
| 314 | 313 |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 _beginthreadex(NULL, 32 * 1024, EventHandlerThread, this, 0, &tid); | 882 _beginthreadex(NULL, 32 * 1024, EventHandlerThread, this, 0, &tid); |
| 884 if (thread_handle == -1) { | 883 if (thread_handle == -1) { |
| 885 FATAL("Failed to start event handler thread"); | 884 FATAL("Failed to start event handler thread"); |
| 886 } | 885 } |
| 887 | 886 |
| 888 // Initialize Winsock32 | 887 // Initialize Winsock32 |
| 889 if (!Socket::Initialize()) { | 888 if (!Socket::Initialize()) { |
| 890 FATAL("Failed to initialized Windows sockets"); | 889 FATAL("Failed to initialized Windows sockets"); |
| 891 } | 890 } |
| 892 } | 891 } |
| OLD | NEW |