| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
| 9 | 9 |
| 10 #include <winsock2.h> // NOLINT | 10 #include <winsock2.h> // NOLINT |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 static void ReadFileThread(uword args) { | 229 static void ReadFileThread(uword args) { |
| 230 Handle* handle = reinterpret_cast<Handle*>(args); | 230 Handle* handle = reinterpret_cast<Handle*>(args); |
| 231 handle->ReadSyncCompleteAsync(); | 231 handle->ReadSyncCompleteAsync(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 | 234 |
| 235 void Handle::ReadSyncCompleteAsync() { | 235 void Handle::ReadSyncCompleteAsync() { |
| 236 ScopedLock lock(this); | |
| 237 ASSERT(pending_read_ != NULL); | 236 ASSERT(pending_read_ != NULL); |
| 238 ASSERT(pending_read_->GetBufferSize() >= kStdOverlappedBufferSize); | 237 ASSERT(pending_read_->GetBufferSize() >= kStdOverlappedBufferSize); |
| 239 | 238 |
| 240 DWORD buffer_size = pending_read_->GetBufferSize(); | 239 DWORD buffer_size = pending_read_->GetBufferSize(); |
| 241 if (GetFileType(handle_) == FILE_TYPE_CHAR) { | 240 if (GetFileType(handle_) == FILE_TYPE_CHAR) { |
| 242 buffer_size = kStdOverlappedBufferSize; | 241 buffer_size = kStdOverlappedBufferSize; |
| 243 } | 242 } |
| 244 DWORD bytes_read = 0; | 243 DWORD bytes_read = 0; |
| 245 BOOL ok = ReadFile(handle_, | 244 BOOL ok = ReadFile(handle_, |
| 246 pending_read_->GetBufferStart(), | 245 pending_read_->GetBufferStart(), |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 | 1299 |
| 1301 | 1300 |
| 1302 void EventHandlerImplementation::Shutdown() { | 1301 void EventHandlerImplementation::Shutdown() { |
| 1303 Notify(kShutdownId, 0, 0); | 1302 Notify(kShutdownId, 0, 0); |
| 1304 } | 1303 } |
| 1305 | 1304 |
| 1306 } // namespace bin | 1305 } // namespace bin |
| 1307 } // namespace dart | 1306 } // namespace dart |
| 1308 | 1307 |
| 1309 #endif // defined(TARGET_OS_WINDOWS) | 1308 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |