Index: base/files/file_path_watcher_fsevents.h |
diff --git a/base/files/file_path_watcher_fsevents.h b/base/files/file_path_watcher_fsevents.h |
index 800c5b43f6879aa0d5d66eb1164f2f69edb3d5a8..da26a941b33c26eb47ce214deba7ef68f3853d5e 100644 |
--- a/base/files/file_path_watcher_fsevents.h |
+++ b/base/files/file_path_watcher_fsevents.h |
@@ -24,9 +24,35 @@ class FilePathWatcherFSEvents : public FilePathWatcher::PlatformDelegate { |
public: |
FilePathWatcherFSEvents(); |
- // Called from the FSEvents callback whenever there is a change to the paths. |
+ // FilePathWatcher::PlatformDelegate overrides. |
+ bool Watch(const FilePath& path, |
+ bool recursive, |
+ const FilePathWatcher::Callback& callback) override; |
+ void Cancel() override; |
+ |
+ private: |
+ static void FSEventsCallback(ConstFSEventStreamRef stream, |
+ void* event_watcher, |
+ size_t num_events, |
+ void* event_paths, |
+ const FSEventStreamEventFlags flags[], |
+ const FSEventStreamEventId event_ids[]); |
+ |
+ ~FilePathWatcherFSEvents() override; |
+ |
+ // Called from FSEventsCallback whenever there is a change to the paths. |
void OnFilePathsChanged(const std::vector<FilePath>& paths); |
+ // Called on the message_loop() thread to dispatch path events. Can't access |
+ // target_ and resolved_target_ directly as those are modified on the |
+ // libdispatch thread. |
+ void DispatchEvents(const std::vector<FilePath>& paths, |
+ const FilePath& target, |
+ const FilePath& resolved_target); |
+ |
+ // Cleans up and stops the event stream. |
+ void CancelOnMessageLoopThread() override; |
+ |
// (Re-)Initialize the event stream to start reporting events from |
// |start_event|. |
void UpdateEventStream(FSEventStreamEventId start_event); |
@@ -35,23 +61,14 @@ class FilePathWatcherFSEvents : public FilePathWatcher::PlatformDelegate { |
// last time it was done. |
bool ResolveTargetPath(); |
- // FilePathWatcher::PlatformDelegate overrides. |
- bool Watch(const FilePath& path, |
- bool recursive, |
- const FilePathWatcher::Callback& callback) override; |
- void Cancel() override; |
- |
- private: |
- ~FilePathWatcherFSEvents() override; |
+ // Report an error watching the given target. |
+ void ReportError(const FilePath& target); |
// Destroy the event stream. |
void DestroyEventStream(); |
// Start watching the FSEventStream. |
- void StartEventStream(FSEventStreamEventId start_event); |
- |
- // Cleans up and stops the event stream. |
- void CancelOnMessageLoopThread() override; |
+ void StartEventStream(FSEventStreamEventId start_event, const FilePath& path); |
// Callback to notify upon changes. |
Mattias Nissler (ping if slow)
2015/04/10 09:15:51
3rd attempt: Please document in the comments which
Reilly Grant (use Gerrit)
2015/04/10 18:32:47
My mistake. I put in comments but must not have sa
|
FilePathWatcher::Callback callback_; |