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

Unified Diff: pkg/watcher/lib/src/directory_watcher/polling.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/polling.dart
diff --git a/pkg/watcher/lib/src/directory_watcher/polling.dart b/pkg/watcher/lib/src/directory_watcher/polling.dart
index e50a0c05c148e1601088f94c074e390b9bed0454..684f7aad8ba21ef665739d0f1184ddb1281ce20f 100644
--- a/pkg/watcher/lib/src/directory_watcher/polling.dart
+++ b/pkg/watcher/lib/src/directory_watcher/polling.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import 'dart:io';
import 'package:crypto/crypto.dart';
+import 'package:stack_trace/stack_trace.dart';
import '../async_queue.dart';
import '../stat.dart';
@@ -105,7 +106,7 @@ class _PollingDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
_filesToProcess.add(null);
}
- var stream = new Directory(directory).list(recursive: true);
+ var stream = Chain.track(new Directory(directory).list(recursive: true));
_listSubscription = stream.listen((entity) {
assert(!_events.isClosed);
@@ -185,7 +186,7 @@ class _PollingDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
/// Calculates the SHA-1 hash of the file at [path].
Future<List<int>> _hashFile(String path) {
- return new File(path).readAsBytes().then((bytes) {
+ return Chain.track(new File(path).readAsBytes()).then((bytes) {
var sha1 = new SHA1();
sha1.add(bytes);
return sha1.close();

Powered by Google App Engine
This is Rietveld 408576698