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

Unified Diff: chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h

Issue 947943002: Implement CopyFileFromLocal of MTPDeviceAsyncDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 10 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_galleries/linux/mtp_device_task_helper_map_service.h
diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h
index d13920c22702fd0f9bbfc39f9cb0d3a2a60b9933..6b02b094a3996e2e885ca560dcf7495013f264e1 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h
+++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper_map_service.h
@@ -20,25 +20,36 @@ class MTPDeviceTaskHelperMapService {
// Creates and returns the MTPDeviceTaskHelper object for the storage device
// specified by the |storage_name|.
- MTPDeviceTaskHelper* CreateDeviceTaskHelper(const std::string& storage_name);
+ MTPDeviceTaskHelper* CreateDeviceTaskHelper(const std::string& storage_name,
+ const bool read_only);
// Destroys the MTPDeviceTaskHelper object created by
// CreateDeviceTaskHelper().
// |storage_name| specifies the name of the storage device.
- void DestroyDeviceTaskHelper(const std::string& storage_name);
+ void DestroyDeviceTaskHelper(const std::string& storage_name,
+ const bool read_only);
// Gets the MTPDeviceTaskHelper object associated with the device storage.
// |storage_name| specifies the name of the storage device.
// Return NULL if the |storage_name| is no longer valid (e.g. because the
// corresponding storage device is detached, etc).
- MTPDeviceTaskHelper* GetDeviceTaskHelper(const std::string& storage_name);
+ MTPDeviceTaskHelper* GetDeviceTaskHelper(const std::string& storage_name,
+ const bool read_only);
private:
friend struct base::DefaultLazyInstanceTraits<MTPDeviceTaskHelperMapService>;
- // Key: Storage name.
+ // A key to be used in TaskHelperMap.
+ typedef std::string MTPDeviceTaskHelperKey;
+
+ // Gets a key from |storage_name| and |read_only|.
+ static MTPDeviceTaskHelperKey GetMTPDeviceTaskHelperKey(
+ const std::string& storage_name,
+ const bool read_only);
+
+ // Key: A combined value with storage_name and read_only.
// Value: MTPDeviceTaskHelper object.
- typedef std::map<std::string, MTPDeviceTaskHelper*> TaskHelperMap;
+ typedef std::map<MTPDeviceTaskHelperKey, MTPDeviceTaskHelper*> TaskHelperMap;
// Get access to this class using GetInstance() method.
MTPDeviceTaskHelperMapService();

Powered by Google App Engine
This is Rietveld 408576698