| 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_KQUEUE_H_ | 5 #ifndef BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ |
| 6 #define BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ | 6 #define BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ |
| 7 | 7 |
| 8 #include <sys/event.h> | 8 #include <sys/event.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public: | 54 public: |
| 55 EventData(const FilePath& path, const FilePath::StringType& subdir) | 55 EventData(const FilePath& path, const FilePath::StringType& subdir) |
| 56 : path_(path), subdir_(subdir) { } | 56 : path_(path), subdir_(subdir) { } |
| 57 FilePath path_; // Full path to this item. | 57 FilePath path_; // Full path to this item. |
| 58 FilePath::StringType subdir_; // Path to any sub item. | 58 FilePath::StringType subdir_; // Path to any sub item. |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 typedef std::vector<struct kevent> EventVector; | 61 typedef std::vector<struct kevent> EventVector; |
| 62 | 62 |
| 63 // Can only be called on |io_task_runner_|'s thread. | 63 // Can only be called on |io_task_runner_|'s thread. |
| 64 void CancelOnMessageLoopThread() override; | 64 void CancelOnMessageLoopThread(); |
| 65 | 65 |
| 66 // Returns true if the kevent values are error free. | 66 // Returns true if the kevent values are error free. |
| 67 bool AreKeventValuesValid(struct kevent* kevents, int count); | 67 bool AreKeventValuesValid(struct kevent* kevents, int count); |
| 68 | 68 |
| 69 // Respond to a change of attributes of the path component represented by | 69 // Respond to a change of attributes of the path component represented by |
| 70 // |event|. Sets |target_file_affected| to true if |target_| is affected. | 70 // |event|. Sets |target_file_affected| to true if |target_| is affected. |
| 71 // Sets |update_watches| to true if |events_| need to be updated. | 71 // Sets |update_watches| to true if |events_| need to be updated. |
| 72 void HandleAttributesChange(const EventVector::iterator& event, | 72 void HandleAttributesChange(const EventVector::iterator& event, |
| 73 bool* target_file_affected, | 73 bool* target_file_affected, |
| 74 bool* update_watches); | 74 bool* update_watches); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 FilePathWatcher::Callback callback_; | 124 FilePathWatcher::Callback callback_; |
| 125 FilePath target_; | 125 FilePath target_; |
| 126 int kqueue_; | 126 int kqueue_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherKQueue); | 128 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherKQueue); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace base | 131 } // namespace base |
| 132 | 132 |
| 133 #endif // BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ | 133 #endif // BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ |
| OLD | NEW |