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

Unified Diff: runtime/bin/file_patch.dart

Issue 23483030: Make file system watcher compile on Mac OS 106, and add a runtime-call to test if the system suppor… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/file_patch.dart
diff --git a/runtime/bin/file_patch.dart b/runtime/bin/file_patch.dart
index be13c3f742f706cf6441d4fa1f96f44a675c47e3..f8933a44c84bd8510341277a746c4d9bd383f702 100644
--- a/runtime/bin/file_patch.dart
+++ b/runtime/bin/file_patch.dart
@@ -46,6 +46,8 @@ patch class _FileSystemWatcher {
/* patch */ factory _FileSystemWatcher(
String path, int events, bool recursive)
=> new _FileSystemWatcherImpl(path, events, recursive);
+
+ /* patch */ static bool get isSupported => _FileSystemWatcherImpl.isSupported;
kustermann 2013/09/03 15:18:58 Wouldn't it make sense to cache the 'isSupported'
Anders Johnsen 2013/09/03 15:32:56 As this is not performance critical, I'll not cach
}
class _FileSystemWatcherImpl
@@ -59,6 +61,11 @@ class _FileSystemWatcherImpl
StreamSubscription _subscription;
_FileSystemWatcherImpl(this._path, this._events, this._recursive) {
+ if (!isSupported) {
+ throw new FileException(
+ "File system watching is not supported on this system",
+ _path);
+ }
_controller = new StreamController(onListen: _listen, onCancel: _cancel);
}
@@ -140,6 +147,8 @@ class _FileSystemWatcherImpl
Stream<FileSystemEvent> get stream => _controller.stream;
+ static bool get isSupported native "FileSystemWatcher_IsSupported";
+
int _watchPath(String path, int events, bool recursive)
native "FileSystemWatcher_WatchPath";
void _unwatchPath() native "FileSystemWatcher_UnwatchPath";

Powered by Google App Engine
This is Rietveld 408576698