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 // MtabWatcherLinux listens for mount point changes from a mtab file and | 5 // MtabWatcherLinux listens for mount point changes from a mtab file and |
6 // notifies a StorageMonitorLinux about them. | 6 // notifies a StorageMonitorLinux about them. |
7 // MtabWatcherLinux lives on the FILE thread. | 7 // MtabWatcherLinux lives on the FILE thread. |
8 | 8 |
9 #ifndef COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ | 9 #ifndef COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ |
10 #define COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ | 10 #define COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ |
11 | 11 |
12 #if defined(OS_CHROMEOS) | 12 #if defined(OS_CHROMEOS) |
13 #error "ChromeOS does not use MtabWatcherLinux." | 13 #error "ChromeOS does not use MtabWatcherLinux." |
14 #endif | 14 #endif |
15 | 15 |
16 #include <map> | 16 #include <map> |
17 | 17 |
18 #include "base/basictypes.h" | |
19 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
20 #include "base/files/file_path_watcher.h" | 19 #include "base/files/file_path_watcher.h" |
| 20 #include "base/macros.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| 22 #include "build/build_config.h" |
22 | 23 |
23 namespace storage_monitor { | 24 namespace storage_monitor { |
24 | 25 |
25 class MtabWatcherLinux { | 26 class MtabWatcherLinux { |
26 public: | 27 public: |
27 // (mount point, mount device) | 28 // (mount point, mount device) |
28 // A mapping from mount point to mount device, as extracted from the mtab | 29 // A mapping from mount point to mount device, as extracted from the mtab |
29 // file. | 30 // file. |
30 typedef std::map<base::FilePath, base::FilePath> MountPointDeviceMap; | 31 typedef std::map<base::FilePath, base::FilePath> MountPointDeviceMap; |
31 | 32 |
(...skipping 25 matching lines...) Expand all Loading... |
57 base::WeakPtr<Delegate> delegate_; | 58 base::WeakPtr<Delegate> delegate_; |
58 | 59 |
59 base::WeakPtrFactory<MtabWatcherLinux> weak_ptr_factory_; | 60 base::WeakPtrFactory<MtabWatcherLinux> weak_ptr_factory_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(MtabWatcherLinux); | 62 DISALLOW_COPY_AND_ASSIGN(MtabWatcherLinux); |
62 }; | 63 }; |
63 | 64 |
64 } // namespace storage_monitor | 65 } // namespace storage_monitor |
65 | 66 |
66 #endif // COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ | 67 #endif // COMPONENTS_STORAGE_MONITOR_MTAB_WATCHER_LINUX_H_ |
OLD | NEW |