Chromium Code Reviews| 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 // StorageMonitorLinux listens for mount point changes, notifies listeners | 5 // StorageMonitorLinux listens for mount point changes, notifies listeners |
| 6 // about the addition and deletion of media devices, and answers queries about | 6 // about the addition and deletion of media devices, and answers queries about |
| 7 // mounted devices. | 7 // mounted devices. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ | 9 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ |
| 10 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ | 10 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 // (mount point, priority) | 98 // (mount point, priority) |
| 99 // For devices that are mounted to multiple mount points, this helps us track | 99 // For devices that are mounted to multiple mount points, this helps us track |
| 100 // which one we've notified system monitor about. | 100 // which one we've notified system monitor about. |
| 101 typedef std::map<base::FilePath, bool> ReferencedMountPoint; | 101 typedef std::map<base::FilePath, bool> ReferencedMountPoint; |
| 102 | 102 |
| 103 // (mount device, map of known mount points) | 103 // (mount device, map of known mount points) |
| 104 // For each mount device, track the places it is mounted and which one (if | 104 // For each mount device, track the places it is mounted and which one (if |
| 105 // any) we have notified system monitor about. | 105 // any) we have notified system monitor about. |
| 106 typedef std::map<base::FilePath, ReferencedMountPoint> MountPriorityMap; | 106 typedef std::map<base::FilePath, ReferencedMountPoint> MountPriorityMap; |
| 107 | 107 |
| 108 // Returns true if this StorageMonitorLinux instance is used for a test. | |
| 109 virtual bool IsRunningTest() const; | |
|
Greg Billock
2013/03/26 16:03:43
Instead of this, can we make some virtuals that se
| |
| 110 | |
| 108 // Do initialization on the File Thread. | 111 // Do initialization on the File Thread. |
| 109 void InitOnFileThread(); | 112 void InitOnFileThread(); |
| 110 | 113 |
| 111 // Parses mtab file and find all changes. | 114 // Parses mtab file and find all changes. |
| 112 void UpdateMtab(); | 115 void UpdateMtab(); |
| 113 | 116 |
| 114 // Adds |mount_device| as mounted on |mount_point|. If the device is a new | 117 // Adds |mount_device| as mounted on |mount_point|. If the device is a new |
| 115 // device any listeners are notified. | 118 // device any listeners are notified. |
| 116 void AddNewMount(const base::FilePath& mount_device, | 119 void AddNewMount(const base::FilePath& mount_device, |
| 117 const base::FilePath& mount_point); | 120 const base::FilePath& mount_point); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 145 | 148 |
| 146 scoped_ptr<MediaTransferProtocolDeviceObserverLinux> | 149 scoped_ptr<MediaTransferProtocolDeviceObserverLinux> |
| 147 media_transfer_protocol_device_observer_; | 150 media_transfer_protocol_device_observer_; |
| 148 | 151 |
| 149 DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux); | 152 DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux); |
| 150 }; | 153 }; |
| 151 | 154 |
| 152 } // namespace chrome | 155 } // namespace chrome |
| 153 | 156 |
| 154 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ | 157 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ |
| OLD | NEW |