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

Unified Diff: chrome/browser/storage_monitor/storage_monitor.h

Issue 15988011: Refine StorageMonitor storage device getter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/storage_monitor/storage_monitor.h
diff --git a/chrome/browser/storage_monitor/storage_monitor.h b/chrome/browser/storage_monitor/storage_monitor.h
index b330a29de9c16bdb42d1c48fce6317717d5fb276..4af9a3c2540726c12d2fecee0d89d8ef76e9ce15 100644
--- a/chrome/browser/storage_monitor/storage_monitor.h
+++ b/chrome/browser/storage_monitor/storage_monitor.h
@@ -67,7 +67,7 @@ class StorageMonitor {
// Initialize the storage monitor. The provided callback, if non-null,
// will be called when initialization is complete. If initialization has
// already completed, this callback will be invoked within the calling stack.
- // Before the callback is run, calls to |GetAttachedStorage| and
+ // Before the callback is run, calls to |GetAllAvailableStorages| and
// |GetStorageInfoForPath| may not return the correct results. In addition,
// registered observers will not be notified on device attachment/detachment.
// Should be invoked on the UI thread; callbacks will be run on the UI thread.
@@ -102,8 +102,9 @@ class StorageMonitor {
media_transfer_protocol_manager() = 0;
#endif
- // Returns information for attached removable storage.
- std::vector<StorageInfo> GetAttachedStorage() const;
+ // Returns information for all known storages on the system,
+ // including fixed and removable storages.
+ std::vector<StorageInfo> GetAllAvailableStorages() const;
void AddObserver(RemovableStorageObserver* obs);
void RemoveObserver(RemovableStorageObserver* obs);
@@ -143,7 +144,7 @@ class StorageMonitor {
friend class ReceiverImpl;
// Key: device id.
- typedef std::map<std::string, StorageInfo> RemovableStorageMap;
+ typedef std::map<std::string, StorageInfo> AllAvailableStorageMap;
Hongbo Min 2013/06/04 02:52:29 StorageMap might be a better name.
Haojian Wu 2013/06/04 03:52:09 Done.
void ProcessAttach(const StorageInfo& storage);
void ProcessDetach(const std::string& id);
@@ -160,7 +161,7 @@ class StorageMonitor {
mutable base::Lock storage_lock_;
// Map of all the attached removable storage devices.
- RemovableStorageMap storage_map_;
+ AllAvailableStorageMap storage_map_;
scoped_ptr<TransientDeviceIds> transient_device_ids_;
};

Powered by Google App Engine
This is Rietveld 408576698