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

Unified Diff: runtime/bin/file_system_watcher_macos.cc

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_system_watcher_macos.cc
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc
index c06572f30e8e066507b2b3228e50341c8c1f24d7..7140b3fb416b2d148f6f51574528e32a248109d4 100644
--- a/runtime/bin/file_system_watcher_macos.cc
+++ b/runtime/bin/file_system_watcher_macos.cc
@@ -18,6 +18,26 @@
#include "bin/thread.h"
+#ifndef MAC_OS_X_VERSION_10_7
+enum {
+ kFSEventStreamCreateFlagFileEvents = 0x00000010
+};
+enum {
+ kFSEventStreamEventFlagItemCreated = 0x00000100,
+ kFSEventStreamEventFlagItemRemoved = 0x00000200,
+ kFSEventStreamEventFlagItemInodeMetaMod = 0x00000400,
+ kFSEventStreamEventFlagItemRenamed = 0x00000800,
+ kFSEventStreamEventFlagItemModified = 0x00001000,
+ kFSEventStreamEventFlagItemFinderInfoMod = 0x00002000,
+ kFSEventStreamEventFlagItemChangeOwner = 0x00004000,
+ kFSEventStreamEventFlagItemXattrMod = 0x00008000,
+ kFSEventStreamEventFlagItemIsFile = 0x00010000,
+ kFSEventStreamEventFlagItemIsDir = 0x00020000,
+ kFSEventStreamEventFlagItemIsSymlink = 0x00040000
+};
+#endif
+
+
namespace dart {
namespace bin {
@@ -191,6 +211,13 @@ class FSEventsWatcher {
};
+bool FileSystemWatcher::IsSupported() {
+ SInt32 version = 0;
+ Gestalt(gestaltSystemVersion, &version);
kustermann 2013/09/03 15:18:58 Seems like 'Gestalt' is deprecated / will be remov
Anders Johnsen 2013/09/03 15:32:56 Nicely spotted, changed.
+ return version >= 0x1070;
+}
+
+
intptr_t FileSystemWatcher::WatchPath(const char* path,
int events,
bool recursive) {

Powered by Google App Engine
This is Rietveld 408576698