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 <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <sys/inotify.h> | 9 #include <sys/inotify.h> |
10 #include <sys/ioctl.h> | 10 #include <sys/ioctl.h> |
11 #include <sys/select.h> | 11 #include <sys/select.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <set> | 15 #include <set> |
16 #include <utility> | 16 #include <utility> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/eintr_wrapper.h" | 19 #include "base/eintr_wrapper.h" |
20 #include "base/file_path.h" | 20 #include "base/file_path.h" |
21 #include "base/file_util.h" | 21 #include "base/file_util.h" |
22 #include "base/hash_tables.h" | 22 #include "base/hash_tables.h" |
23 #include "base/lazy_instance.h" | 23 #include "base/lazy_instance.h" |
24 #include "base/logging.h" | 24 #include "base/logging.h" |
25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
26 #include "base/message_loop.h" | 26 #include "base/message_loop.h" |
27 #include "base/message_loop_proxy.h" | 27 #include "base/message_loop_proxy.h" |
28 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
29 #include "base/task.h" | 29 #include "base/task.h" |
30 #include "base/threading/thread.h" | 30 #include "base/threading/thread.h" |
31 | 31 |
| 32 namespace base { |
| 33 namespace files { |
| 34 |
32 namespace { | 35 namespace { |
33 | 36 |
34 class FilePathWatcherImpl; | 37 class FilePathWatcherImpl; |
35 | 38 |
36 // Singleton to manage all inotify watches. | 39 // Singleton to manage all inotify watches. |
37 // TODO(tony): It would be nice if this wasn't a singleton. | 40 // TODO(tony): It would be nice if this wasn't a singleton. |
38 // http://crbug.com/38174 | 41 // http://crbug.com/38174 |
39 class InotifyReader { | 42 class InotifyReader { |
40 public: | 43 public: |
41 typedef int Watch; // Watch descriptor used by AddWatch and RemoveWatch. | 44 typedef int Watch; // Watch descriptor used by AddWatch and RemoveWatch. |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 } | 450 } |
448 | 451 |
449 return true; | 452 return true; |
450 } | 453 } |
451 | 454 |
452 } // namespace | 455 } // namespace |
453 | 456 |
454 FilePathWatcher::FilePathWatcher() { | 457 FilePathWatcher::FilePathWatcher() { |
455 impl_ = new FilePathWatcherImpl(); | 458 impl_ = new FilePathWatcherImpl(); |
456 } | 459 } |
| 460 |
| 461 } // namespace files |
| 462 } // namespace base |
OLD | NEW |