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

Unified Diff: base/files/file_path_watcher.cc

Issue 313083007: Use FSEvents for recursive file watch on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include fix for iOS Created 6 years, 6 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
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path_watcher.cc
diff --git a/base/files/file_path_watcher.cc b/base/files/file_path_watcher.cc
index 49e0a237f69a71680e8611b97bdd34f379874ef0..b17354197d4fda6239a178c97f64b2dcf221ab62 100644
--- a/base/files/file_path_watcher.cc
+++ b/base/files/file_path_watcher.cc
@@ -10,6 +10,10 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+#include "base/mac/mac_util.h"
+#endif
+
namespace base {
FilePathWatcher::~FilePathWatcher() {
@@ -22,6 +26,19 @@ void FilePathWatcher::CancelWatch(
delegate->CancelOnMessageLoopThread();
}
+// static
+bool FilePathWatcher::RecursiveWatchAvailable() {
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ // FSEvents isn't available on iOS and is broken on OSX 10.6 and earlier.
+ // See http://crbug.com/54822#c31
+ return mac::IsOSLionOrLater();
+#elif defined(OS_WIN) || defined(OS_LINUX)
+ return true;
+#else
+ return false;
+#endif
+}
+
FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
}
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698