| 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 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/files/file_descriptor_watcher_posix.h" | 13 #include "base/files/file_descriptor_watcher_posix.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/files/file_path_watcher.h" | 15 #include "base/files/file_path_watcher.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/single_thread_task_runner.h" | |
| 18 | 17 |
| 19 namespace base { | 18 namespace base { |
| 20 | 19 |
| 21 // Mac-specific file watcher implementation based on kqueue. | 20 // Mac-specific file watcher implementation based on kqueue. |
| 22 // The Linux and Windows versions are able to detect: | 21 // The Linux and Windows versions are able to detect: |
| 23 // - file creation/deletion/modification in a watched directory | 22 // - file creation/deletion/modification in a watched directory |
| 24 // - file creation/deletion/modification for a watched file | 23 // - file creation/deletion/modification for a watched file |
| 25 // - modifications to the paths to a watched object that would affect the | 24 // - modifications to the paths to a watched object that would affect the |
| 26 // object such as renaming/attibute changes etc. | 25 // object such as renaming/attibute changes etc. |
| 27 // The kqueue implementation will handle all of the items in the list above | 26 // The kqueue implementation will handle all of the items in the list above |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Throughout the lifetime of this, OnKQueueReadable() will be called when | 118 // Throughout the lifetime of this, OnKQueueReadable() will be called when |
| 120 // data is available in |kqueue_|. | 119 // data is available in |kqueue_|. |
| 121 std::unique_ptr<FileDescriptorWatcher::Controller> kqueue_watch_controller_; | 120 std::unique_ptr<FileDescriptorWatcher::Controller> kqueue_watch_controller_; |
| 122 | 121 |
| 123 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherKQueue); | 122 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherKQueue); |
| 124 }; | 123 }; |
| 125 | 124 |
| 126 } // namespace base | 125 } // namespace base |
| 127 | 126 |
| 128 #endif // BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ | 127 #endif // BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_ |
| OLD | NEW |