| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 391 |
| 392 bool DirectoryWatchHandle::IsClosed() { | 392 bool DirectoryWatchHandle::IsClosed() { |
| 393 return IsClosing() && pending_read_ == NULL; | 393 return IsClosing() && pending_read_ == NULL; |
| 394 } | 394 } |
| 395 | 395 |
| 396 | 396 |
| 397 bool DirectoryWatchHandle::IssueRead() { | 397 bool DirectoryWatchHandle::IssueRead() { |
| 398 ScopedLock lock(this); | 398 ScopedLock lock(this); |
| 399 // It may have been started before, as we start the directory-handler when | 399 // It may have been started before, as we start the directory-handler when |
| 400 // we create it. | 400 // we create it. |
| 401 if (pending_read_ != NULL) return true; | 401 if (pending_read_ != NULL || data_ready_ != NULL) return true; |
| 402 OverlappedBuffer* buffer = OverlappedBuffer::AllocateReadBuffer(kBufferSize); | 402 OverlappedBuffer* buffer = OverlappedBuffer::AllocateReadBuffer(kBufferSize); |
| 403 ASSERT(completion_port_ != INVALID_HANDLE_VALUE); | 403 ASSERT(completion_port_ != INVALID_HANDLE_VALUE); |
| 404 BOOL ok = ReadDirectoryChangesW(handle_, | 404 BOOL ok = ReadDirectoryChangesW(handle_, |
| 405 buffer->GetBufferStart(), | 405 buffer->GetBufferStart(), |
| 406 buffer->GetBufferSize(), | 406 buffer->GetBufferSize(), |
| 407 recursive_, | 407 recursive_, |
| 408 events_, | 408 events_, |
| 409 NULL, | 409 NULL, |
| 410 buffer->GetCleanOverlapped(), | 410 buffer->GetCleanOverlapped(), |
| 411 NULL); | 411 NULL); |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1364 |
| 1365 | 1365 |
| 1366 void EventHandlerImplementation::Shutdown() { | 1366 void EventHandlerImplementation::Shutdown() { |
| 1367 SendData(kShutdownId, 0, 0); | 1367 SendData(kShutdownId, 0, 0); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 } // namespace bin | 1370 } // namespace bin |
| 1371 } // namespace dart | 1371 } // namespace dart |
| 1372 | 1372 |
| 1373 #endif // defined(TARGET_OS_WINDOWS) | 1373 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |