OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_ | 5 #ifndef BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_ |
6 #define BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_ | 6 #define BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_ |
7 | 7 |
8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 30 matching lines...) Expand all Loading... | |
41 const FilePathWatcher::Callback& callback) override; | 41 const FilePathWatcher::Callback& callback) override; |
42 void Cancel() override; | 42 void Cancel() override; |
43 | 43 |
44 private: | 44 private: |
45 ~FilePathWatcherFSEvents() override; | 45 ~FilePathWatcherFSEvents() override; |
46 | 46 |
47 // Destroy the event stream. | 47 // Destroy the event stream. |
48 void DestroyEventStream(); | 48 void DestroyEventStream(); |
49 | 49 |
50 // Start watching the FSEventStream. | 50 // Start watching the FSEventStream. |
51 void StartEventStream(FSEventStreamEventId start_event); | 51 void StartEventStream(FSEventStreamEventId start_event, |
52 const FilePath& path, | |
53 const FilePathWatcher::Callback& callback); | |
52 | 54 |
53 // Cleans up and stops the event stream. | 55 // Cleans up and stops the event stream. |
54 void CancelOnMessageLoopThread() override; | 56 void CancelOnMessageLoopThread() override; |
55 | 57 |
56 // Callback to notify upon changes. | 58 // Callback to notify upon changes. |
Mattias Nissler (ping if slow)
2015/04/02 17:35:45
Please also document here which thread the members
| |
57 FilePathWatcher::Callback callback_; | 59 FilePathWatcher::Callback callback_; |
58 | 60 |
59 // Target path to watch (passed to callback). | 61 // Target path to watch (passed to callback). |
60 FilePath target_; | 62 FilePath target_; |
61 | 63 |
62 // Target path with all symbolic links resolved. | 64 // Target path with all symbolic links resolved. |
63 FilePath resolved_target_; | 65 FilePath resolved_target_; |
64 | 66 |
65 // Backend stream we receive event callbacks from (strong reference). | 67 // Backend stream we receive event callbacks from (strong reference). |
66 FSEventStreamRef fsevent_stream_; | 68 FSEventStreamRef fsevent_stream_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherFSEvents); | 70 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherFSEvents); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace base | 73 } // namespace base |
72 | 74 |
73 #endif // BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_ | 75 #endif // BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_ |
OLD | NEW |