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

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: 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.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..df284a12907fa01787b94d88aab019ceecda669e 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();
@@ -48,6 +50,7 @@ class MTPDeviceTaskHelper {
// |callback| is called when the OpenStorage request completes. |callback|
// runs on the IO thread.
void OpenStorage(const std::string& storage_name,
+ const bool read_only,
const OpenStorageCallback& callback);
// Dispatches the GetFileInfo request to the MediaTransferProtocolManager.
@@ -95,6 +98,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 int 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 +171,13 @@ class MTPDeviceTaskHelper {
const std::string& data,
bool error) const;
+ // Called when CopyFileFromLocal completed no matter if it 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