Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: runtime/bin/file_system_watcher_win.cc

Issue 312743002: Use 'Directory.watch' on Windows in pkg/watcher, instead of pooling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« runtime/bin/eventhandler_win.cc ('K') | « runtime/bin/file_patch.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« runtime/bin/eventhandler_win.cc ('K') | « runtime/bin/file_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698