OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/files/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 <map> | 15 #include <map> |
16 #include <set> | 16 #include <set> |
17 #include <utility> | 17 #include <utility> |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
20 #include "base/bind.h" | 20 #include "base/bind.h" |
21 #include "base/containers/hash_tables.h" | 21 #include "base/containers/hash_tables.h" |
22 #include "base/debug/trace_event.h" | |
23 #include "base/files/file_enumerator.h" | 22 #include "base/files/file_enumerator.h" |
24 #include "base/files/file_path.h" | 23 #include "base/files/file_path.h" |
25 #include "base/files/file_util.h" | 24 #include "base/files/file_util.h" |
26 #include "base/lazy_instance.h" | 25 #include "base/lazy_instance.h" |
27 #include "base/location.h" | 26 #include "base/location.h" |
28 #include "base/logging.h" | 27 #include "base/logging.h" |
29 #include "base/memory/scoped_ptr.h" | 28 #include "base/memory/scoped_ptr.h" |
30 #include "base/message_loop/message_loop.h" | 29 #include "base/message_loop/message_loop.h" |
31 #include "base/message_loop/message_loop_proxy.h" | 30 #include "base/message_loop/message_loop_proxy.h" |
32 #include "base/posix/eintr_wrapper.h" | 31 #include "base/posix/eintr_wrapper.h" |
33 #include "base/synchronization/lock.h" | 32 #include "base/synchronization/lock.h" |
34 #include "base/threading/thread.h" | 33 #include "base/threading/thread.h" |
| 34 #include "base/trace_event/trace_event.h" |
35 | 35 |
36 namespace base { | 36 namespace base { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 class FilePathWatcherImpl; | 40 class FilePathWatcherImpl; |
41 | 41 |
42 // Singleton to manage all inotify watches. | 42 // Singleton to manage all inotify watches. |
43 // TODO(tony): It would be nice if this wasn't a singleton. | 43 // TODO(tony): It would be nice if this wasn't a singleton. |
44 // http://crbug.com/38174 | 44 // http://crbug.com/38174 |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 return watches_[watches_.size() - 1].subdir.empty(); | 683 return watches_[watches_.size() - 1].subdir.empty(); |
684 } | 684 } |
685 | 685 |
686 } // namespace | 686 } // namespace |
687 | 687 |
688 FilePathWatcher::FilePathWatcher() { | 688 FilePathWatcher::FilePathWatcher() { |
689 impl_ = new FilePathWatcherImpl(); | 689 impl_ = new FilePathWatcherImpl(); |
690 } | 690 } |
691 | 691 |
692 } // namespace base | 692 } // namespace base |
OLD | NEW |