OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/common/file_path_watcher/file_path_watcher.h" | 5 #include "base/files/file_path_watcher.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/event.h> | 8 #include <sys/event.h> |
9 #include <sys/param.h> | 9 #include <sys/param.h> |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/message_loop_proxy.h" | 15 #include "base/message_loop_proxy.h" |
16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
17 | 17 |
| 18 using ::base::files::FilePathWatcher; |
| 19 |
18 namespace { | 20 namespace { |
19 | 21 |
20 // Mac-specific file watcher implementation based on kqueue. | 22 // Mac-specific file watcher implementation based on kqueue. |
21 // Originally it was based on FSEvents so that the semantics were equivalent | 23 // Originally it was based on FSEvents so that the semantics were equivalent |
22 // on Linux, OSX and Windows where it was able to detect: | 24 // on Linux, OSX and Windows where it was able to detect: |
23 // - file creation/deletion/modification in a watched directory | 25 // - file creation/deletion/modification in a watched directory |
24 // - file creation/deletion/modification for a watched file | 26 // - file creation/deletion/modification for a watched file |
25 // - modifications to the paths to a watched object that would affect the | 27 // - modifications to the paths to a watched object that would affect the |
26 // object such as renaming/attibute changes etc. | 28 // object such as renaming/attibute changes etc. |
27 // The FSEvents version did all of the above except handling attribute changes | 29 // The FSEvents version did all of the above except handling attribute changes |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 MessageLoop::current()->RemoveDestructionObserver(this); | 480 MessageLoop::current()->RemoveDestructionObserver(this); |
479 delegate_ = NULL; | 481 delegate_ = NULL; |
480 } | 482 } |
481 } | 483 } |
482 | 484 |
483 } // namespace | 485 } // namespace |
484 | 486 |
485 FilePathWatcher::FilePathWatcher() { | 487 FilePathWatcher::FilePathWatcher() { |
486 impl_ = new FilePathWatcherImpl(); | 488 impl_ = new FilePathWatcherImpl(); |
487 } | 489 } |
OLD | NEW |