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

Unified Diff: pkg/watcher/lib/src/directory_watcher/mac_os.dart

Issue 94093007: Add stack chain support to pkg/watcher and pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: pkg/watcher/lib/src/directory_watcher/mac_os.dart
diff --git a/pkg/watcher/lib/src/directory_watcher/mac_os.dart b/pkg/watcher/lib/src/directory_watcher/mac_os.dart
index 5b1feb342f2a220316c339af1e01dd8a3f6eba23..16de1d93f40c5b11d54b69095db726eba7df0e7b 100644
--- a/pkg/watcher/lib/src/directory_watcher/mac_os.dart
+++ b/pkg/watcher/lib/src/directory_watcher/mac_os.dart
@@ -73,7 +73,7 @@ class _MacOSDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
_files = new PathSet(directory) {
_startWatch();
- _listen(new Directory(directory).list(recursive: true),
+ _listen(Chain.track(new Directory(directory).list(recursive: true)),
(entity) {
if (entity is! Directory) _files.add(entity.path);
},
@@ -109,7 +109,8 @@ class _MacOSDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
continue;
}
- _listen(new Directory(path).list(recursive: true), (entity) {
+ _listen(Chain.track(new Directory(path).list(recursive: true)),
+ (entity) {
if (entity is Directory) return;
_emitEvent(ChangeType.ADD, entity.path);
_files.add(entity.path);
@@ -314,8 +315,9 @@ class _MacOSDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
/// Start or restart the underlying [Directory.watch] stream.
void _startWatch() {
// Batch the FSEvent changes together so that we can dedup events.
- var innerStream = new Directory(directory).watch(recursive: true).transform(
- new BatchedStreamTransformer<FileSystemEvent>());
+ var innerStream =
+ Chain.track(new Directory(directory).watch(recursive: true))
+ .transform(new BatchedStreamTransformer<FileSystemEvent>());
_watchSubscription = innerStream.listen(_onBatch,
onError: _eventsController.addError,
onDone: _onDone);

Powered by Google App Engine
This is Rietveld 408576698