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

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

Issue 947943002: Implement CopyFileFromLocal of MTPDeviceAsyncDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failed test case. 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.h
diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
index 31ac534c52454a0e6155e54f789abddd7c0ed27e..1825e8b85db9a907ff8d6da19ee612edc2a3c5f8 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
+++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
@@ -36,6 +36,8 @@ class MTPDeviceTaskHelper {
typedef base::Callback<void(const storage::AsyncFileUtil::EntryList& entries,
bool has_more)> ReadDirectorySuccessCallback;
+ typedef base::Closure CopyFileFromLocalSuccessCallback;
+
typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback;
MTPDeviceTaskHelper();
@@ -95,6 +97,15 @@ class MTPDeviceTaskHelper {
// called on the IO thread to notify the caller about success or failure.
void ReadBytes(const MTPDeviceAsyncDelegate::ReadBytesRequest& request);
+ // Forwards CopyFileFromLocal request to the MediaTransferProtocolManager.
+ void CopyFileFromLocal(
+ const std::string& storage_name,
+ const uint32 source_file_descriptor,
+ const uint32 parent_id,
+ const std::string& file_name,
+ const CopyFileFromLocalSuccessCallback& success_callback,
+ const ErrorCallback& error_callback);
+
// Dispatches the CloseStorage request to the MediaTransferProtocolManager.
void CloseStorage() const;
@@ -159,6 +170,12 @@ class MTPDeviceTaskHelper {
const std::string& data,
bool error) const;
+ // Called when CopyFileFromLocal completed either succeeded or failed.
+ void OnCopyFileFromLocal(
+ const CopyFileFromLocalSuccessCallback& success_callback,
+ const ErrorCallback& error_callback,
+ const bool error) const;
+
// Called when the device is uninitialized.
//
// Runs |error_callback| on the IO thread to notify the caller about the

Powered by Google App Engine
This is Rietveld 408576698