| 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/file_system_watcher.h" | 8 #include "bin/file_system_watcher.h" |
| 9 #include "bin/eventhandler.h" | 9 #include "bin/eventhandler.h" |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Issue a read directly, to be sure events are tracked from now on. This is | 66 // Issue a read directly, to be sure events are tracked from now on. This is |
| 67 // okay, since in Dart, we create the socket and start reading immidiately. | 67 // okay, since in Dart, we create the socket and start reading immidiately. |
| 68 handle->EnsureInitialized(EventHandler::delegate()); | 68 handle->EnsureInitialized(EventHandler::delegate()); |
| 69 handle->IssueRead(); | 69 handle->IssueRead(); |
| 70 return reinterpret_cast<intptr_t>(handle); | 70 return reinterpret_cast<intptr_t>(handle); |
| 71 } | 71 } |
| 72 | 72 |
| 73 | 73 |
| 74 void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) { | 74 void FileSystemWatcher::UnwatchPath(intptr_t id, intptr_t path_id) { |
| 75 USE(id); | 75 USE(id); |
| 76 USE(path_id); | 76 DirectoryWatchHandle* handle = |
| 77 reinterpret_cast<DirectoryWatchHandle*>(path_id); |
| 78 handle->Stop(); |
| 77 } | 79 } |
| 78 | 80 |
| 79 | 81 |
| 80 intptr_t FileSystemWatcher::GetSocketId(intptr_t id, intptr_t path_id) { | 82 intptr_t FileSystemWatcher::GetSocketId(intptr_t id, intptr_t path_id) { |
| 81 USE(id); | 83 USE(id); |
| 82 return path_id; | 84 return path_id; |
| 83 } | 85 } |
| 84 | 86 |
| 85 | 87 |
| 86 Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { | 88 Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 offset += e->NextEntryOffset; | 120 offset += e->NextEntryOffset; |
| 119 } | 121 } |
| 120 delete[] buffer; | 122 delete[] buffer; |
| 121 return events; | 123 return events; |
| 122 } | 124 } |
| 123 | 125 |
| 124 } // namespace bin | 126 } // namespace bin |
| 125 } // namespace dart | 127 } // namespace dart |
| 126 | 128 |
| 127 #endif // defined(TARGET_OS_WINDOWS) | 129 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |