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

Side by Side Diff: pkg/watcher/lib/src/directory_watcher/linux.dart

Issue 65533005: Fix an analyzer error in the linux directory watcher. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | 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 library watcher.directory_watcher.linux; 5 library watcher.directory_watcher.linux;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import '../directory_watcher.dart'; 10 import '../directory_watcher.dart';
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 }, onDone: () { 75 }, onDone: () {
76 _waitUntilReady().then((_) => _readyCompleter.complete()); 76 _waitUntilReady().then((_) => _readyCompleter.complete());
77 }, cancelOnError: true); 77 }, cancelOnError: true);
78 } 78 }
79 79
80 /// Returns a [Future] that completes once all the subdirectory watchers are 80 /// Returns a [Future] that completes once all the subdirectory watchers are
81 /// fully initialized. 81 /// fully initialized.
82 Future _waitUntilReady() { 82 Future _waitUntilReady() {
83 return Future.wait(_subWatchers.values.map((watcher) => watcher.ready)) 83 return Future.wait(_subWatchers.values.map((watcher) => watcher.ready))
84 .then((_) { 84 .then((_) {
85 if (_subWatchers.values.every((watcher) => watcher.isReady)) return; 85 if (_subWatchers.values.every((watcher) => watcher.isReady)) return null;
86 return _waitUntilReady(); 86 return _waitUntilReady();
87 }); 87 });
88 } 88 }
89 89
90 void close() { 90 void close() {
91 for (var subscription in _subscriptions) { 91 for (var subscription in _subscriptions) {
92 subscription.cancel(); 92 subscription.cancel();
93 } 93 }
94 for (var watcher in _subWatchers.values) { 94 for (var watcher in _subWatchers.values) {
95 watcher.close(); 95 watcher.close();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 static const DIRECTORY = const _EntryState._("directory"); 289 static const DIRECTORY = const _EntryState._("directory");
290 290
291 const _EntryState._(this._name); 291 const _EntryState._(this._name);
292 292
293 /// Returns [DIRECTORY] if [isDir] is true, and [FILE] otherwise. 293 /// Returns [DIRECTORY] if [isDir] is true, and [FILE] otherwise.
294 factory _EntryState(bool isDir) => 294 factory _EntryState(bool isDir) =>
295 isDir ? _EntryState.DIRECTORY : _EntryState.FILE; 295 isDir ? _EntryState.DIRECTORY : _EntryState.FILE;
296 296
297 String toString() => _name; 297 String toString() => _name;
298 } 298 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698