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 namespace base { |
| 19 namespace files { |
| 20 |
18 namespace { | 21 namespace { |
19 | 22 |
20 // Mac-specific file watcher implementation based on kqueue. | 23 // Mac-specific file watcher implementation based on kqueue. |
21 // Originally it was based on FSEvents so that the semantics were equivalent | 24 // Originally it was based on FSEvents so that the semantics were equivalent |
22 // on Linux, OSX and Windows where it was able to detect: | 25 // on Linux, OSX and Windows where it was able to detect: |
23 // - file creation/deletion/modification in a watched directory | 26 // - file creation/deletion/modification in a watched directory |
24 // - file creation/deletion/modification for a watched file | 27 // - file creation/deletion/modification for a watched file |
25 // - modifications to the paths to a watched object that would affect the | 28 // - modifications to the paths to a watched object that would affect the |
26 // object such as renaming/attibute changes etc. | 29 // object such as renaming/attibute changes etc. |
27 // The FSEvents version did all of the above except handling attribute changes | 30 // 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); | 481 MessageLoop::current()->RemoveDestructionObserver(this); |
479 delegate_ = NULL; | 482 delegate_ = NULL; |
480 } | 483 } |
481 } | 484 } |
482 | 485 |
483 } // namespace | 486 } // namespace |
484 | 487 |
485 FilePathWatcher::FilePathWatcher() { | 488 FilePathWatcher::FilePathWatcher() { |
486 impl_ = new FilePathWatcherImpl(); | 489 impl_ = new FilePathWatcherImpl(); |
487 } | 490 } |
| 491 |
| 492 } // namespace files |
| 493 } // namespace base |
OLD | NEW |