Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_linux.h

Issue 15896007: [SystemInfo API] Rewrite storage info provider using storage monitor impl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix comments from thestig Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 processes mount point change events, notifies listeners 5 // StorageMonitorLinux processes mount point change events, 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 // StorageMonitorLinux lives on the UI thread, and uses a MtabWatcherLinux on 8 // StorageMonitorLinux lives on the UI thread, and uses a MtabWatcherLinux on
9 // the FILE thread to get mount point change events. 9 // the FILE thread to get mount point change events.
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // For devices that are mounted to multiple mount points, this helps us track 83 // For devices that are mounted to multiple mount points, this helps us track
84 // which one we've notified system monitor about. 84 // which one we've notified system monitor about.
85 typedef std::map<base::FilePath, bool> ReferencedMountPoint; 85 typedef std::map<base::FilePath, bool> ReferencedMountPoint;
86 86
87 // (mount device, map of known mount points) 87 // (mount device, map of known mount points)
88 // For each mount device, track the places it is mounted and which one (if 88 // For each mount device, track the places it is mounted and which one (if
89 // any) we have notified system monitor about. 89 // any) we have notified system monitor about.
90 typedef std::map<base::FilePath, ReferencedMountPoint> MountPriorityMap; 90 typedef std::map<base::FilePath, ReferencedMountPoint> MountPriorityMap;
91 91
92 // StorageMonitor implementation. 92 // StorageMonitor implementation.
93 virtual std::vector<StorageInfo> GetAllAvailableStorages() const OVERRIDE;
93 virtual bool GetStorageInfoForPath(const base::FilePath& path, 94 virtual bool GetStorageInfoForPath(const base::FilePath& path,
94 StorageInfo* device_info) const OVERRIDE; 95 StorageInfo* device_info) const OVERRIDE;
95 virtual void EjectDevice(const std::string& device_id, 96 virtual void EjectDevice(const std::string& device_id,
96 base::Callback<void(EjectStatus)> callback) OVERRIDE; 97 base::Callback<void(EjectStatus)> callback) OVERRIDE;
97 virtual device::MediaTransferProtocolManager* 98 virtual device::MediaTransferProtocolManager*
98 media_transfer_protocol_manager() OVERRIDE; 99 media_transfer_protocol_manager() OVERRIDE;
99 100
100 // Called when the MtabWatcher has been created. 101 // Called when the MtabWatcher has been created.
101 void OnMtabWatcherCreated(MtabWatcherLinux* watcher); 102 void OnMtabWatcherCreated(MtabWatcherLinux* watcher);
102 103
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 scoped_ptr<MtabWatcherLinux, MtabWatcherLinuxDeleter> mtab_watcher_; 138 scoped_ptr<MtabWatcherLinux, MtabWatcherLinuxDeleter> mtab_watcher_;
138 139
139 base::WeakPtrFactory<StorageMonitorLinux> weak_ptr_factory_; 140 base::WeakPtrFactory<StorageMonitorLinux> weak_ptr_factory_;
140 141
141 DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux); 142 DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux);
142 }; 143 };
143 144
144 } // namespace chrome 145 } // namespace chrome
145 146
146 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ 147 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698