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

Unified Diff: chrome/browser/system_monitor/portable_device_watcher_win.h

Issue 11297002: [Media Gallery] Added code to support mtp device media file system on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed DCHECK, added lock in PortableDeviceWatcherWin and fixed tests. Created 8 years 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/system_monitor/portable_device_watcher_win.h
diff --git a/chrome/browser/system_monitor/portable_device_watcher_win.h b/chrome/browser/system_monitor/portable_device_watcher_win.h
index dca68cba6faa050b4407208ae733d85b70923d1a..6f7aa6dc44872ef815b9506a0137bd218bb18b6b 100644
--- a/chrome/browser/system_monitor/portable_device_watcher_win.h
+++ b/chrome/browser/system_monitor/portable_device_watcher_win.h
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/string16.h"
+#include "base/synchronization/lock.h"
#include "base/system_monitor/system_monitor.h"
namespace base {
@@ -71,6 +72,14 @@ class PortableDeviceWatcherWin {
// SystemMonitor notification if appropriate.
void OnWindowMessage(UINT event_type, LPARAM data);
+ // Gets the information of the MTP storage specified by |storage_device_id|.
+ // On success, returns true and fills in |device_location| with device
+ // interface details and |storage_object_id| with storage object temporary
+ // identifier.
+ bool GetMTPStorageInfoFromDeviceId(const std::string& storage_device_id,
+ string16* device_location,
+ string16* storage_object_id);
+
private:
friend class TestPortableDeviceWatcherWin;
@@ -105,6 +114,10 @@ class PortableDeviceWatcherWin {
// Attached media transfer protocol device storage objects map.
MTPStorageMap storage_map_;
+ // The lock to protect |device_map_| and |storage_map_|.
+ // TODO(kmadhusu): Remove this after fixing crbug.com/154835.
+ base::Lock lock_;
+
// The task runner used to execute tasks that may take a long time and thus
// should not be performed on the UI thread.
scoped_refptr<base::SequencedTaskRunner> media_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698