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

Unified Diff: content/common/file_path_watcher/file_path_watcher.h

Issue 6731064: kqueue implementation of FilePathWatcher on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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: content/common/file_path_watcher/file_path_watcher.h
diff --git a/content/common/file_path_watcher/file_path_watcher.h b/content/common/file_path_watcher/file_path_watcher.h
index 1a8da912d087d37f2ae08a04ddaf23be2a650a5c..a1bc91d9175b4ee53902e275004b468f4789e03a 100644
--- a/content/common/file_path_watcher/file_path_watcher.h
+++ b/content/common/file_path_watcher/file_path_watcher.h
@@ -16,8 +16,12 @@
// This class lets you register interest in changes on a FilePath.
// The delegate will get called whenever the file or directory referenced by the
// FilePath is changed, including created or deleted. Due to limitations in the
-// underlying OS APIs, spurious notifications might occur that don't relate to
-// an actual change to the watch target.
+// underlying OS APIs, FilePathWatcher has slightly different semantics on OS X
+// than on Windows or Linux. FilePathWatcher on Linux and Windows will detect
+// modifications to files in a watched directory. FilePathWatcher on Mac will
+// detect the creation and deletion of files in a watched directory, but will
+// not detect modifications to those files. See file_path_watcher_mac.cc for
+// details.
Mark Mentovai 2011/03/29 21:27:25 Thanks for revising this comment to match the new
class FilePathWatcher {
public:
// Declares the callback client code implements to receive notifications. Note
@@ -36,15 +40,10 @@ class FilePathWatcher {
~FilePathWatcher();
// Register interest in any changes on |path|. OnPathChanged will be called
- // back for each change. Returns true on success. |loop| is only used
- // by the Mac implementation right now, and must be backed by a CFRunLoop
- // based MessagePump. This is usually going to be a MessageLoop of type
- // TYPE_UI.
+ // back for each change. Returns true on success.
// OnFilePathChanged() will be called on the same thread as Watch() is called,
// which should have a MessageLoop of TYPE_IO.
- bool Watch(const FilePath& path,
- Delegate* delegate,
- base::MessageLoopProxy* loop) WARN_UNUSED_RESULT;
+ bool Watch(const FilePath& path, Delegate* delegate) WARN_UNUSED_RESULT;
class PlatformDelegate;
@@ -73,13 +72,8 @@ class FilePathWatcher {
PlatformDelegate();
// Start watching for the given |path| and notify |delegate| about changes.
- // |loop| is only used by the Mac implementation right now, and must be
- // backed by a CFRunLoop based MessagePump. This is usually going to be a
- // MessageLoop of type TYPE_UI.
- virtual bool Watch(
- const FilePath& path,
- Delegate* delegate,
- base::MessageLoopProxy* loop) WARN_UNUSED_RESULT = 0;
+ virtual bool Watch(const FilePath& path,
+ Delegate* delegate) WARN_UNUSED_RESULT = 0;
// Stop watching. This is called from FilePathWatcher's dtor in order to
// allow to shut down properly while the object is still alive.

Powered by Google App Engine
This is Rietveld 408576698