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

Unified Diff: chrome/browser/media_gallery/media_device_notifications_linux.h

Issue 10829228: [LINUX] Extract the name and id of the device and send it along the device attach message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years, 4 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/media_gallery/media_device_notifications_linux.h
diff --git a/chrome/browser/media_gallery/media_device_notifications_linux.h b/chrome/browser/media_gallery/media_device_notifications_linux.h
index 67393ae70615f59c88d5702b265075b70fb74386..dccb9a6a55ba811aca7a1bee687e01a4b87ab9b8 100644
--- a/chrome/browser/media_gallery/media_device_notifications_linux.h
+++ b/chrome/browser/media_gallery/media_device_notifications_linux.h
@@ -45,6 +45,11 @@ class MediaDeviceNotificationsLinux
virtual void OnFilePathChanged(const FilePath& path, bool error);
+ // Get mounted device properties. This function is exposed for unit test.
+ virtual bool GetDeviceInfo(const std::string& dev_path,
Lei Zhang 2012/08/09 03:47:16 I suspect you can make this private.
kmadhusu 2012/08/09 08:10:03 Done.
+ std::string* device_label,
+ string16* device_name);
+
private:
friend class base::RefCountedThreadSafe<MediaDeviceNotificationsLinux>;
friend class base::DeleteHelper<MediaDeviceNotificationsLinux>;
@@ -56,13 +61,17 @@ class MediaDeviceNotificationsLinux
// Mapping of mount points to MountDeviceAndId.
typedef std::map<std::string, MountDeviceAndId> MountMap;
+ // (mount point, mount device)
+ // Helper map to get new entries from mtab file.
+ typedef std::map<std::string, std::string> MountPointDeviceMap;
+
void InitOnFileThread();
// Parse the mtab file and find all changes.
void UpdateMtab();
// Read the mtab file entries into |mtab|.
- void ReadMtab(MountMap* mtab);
+ void ReadMtab(MountPointDeviceMap* mtab);
// Add a media device with a given device and mount device. Assign it a device
// id as well.
@@ -87,10 +96,6 @@ class MediaDeviceNotificationsLinux
// and multiple devices can be mounted at a mount point.
MountMap mtab_;
- // The lowest available device id number.
- // TODO(thestig) Remove this and use a real per-device unique id instead.
- int current_device_id_;
-
// Set of known file systems that we care about.
std::set<std::string> known_file_systems_;

Powered by Google App Engine
This is Rietveld 408576698