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

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

Issue 982283002: Implement DeleteFile and DeleteDirectory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 9 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 df284a12907fa01787b94d88aab019ceecda669e..ab99e3fae2dc786f13ba4963db1c67750d1d46c6 100644
--- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
+++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h
@@ -38,6 +38,8 @@ class MTPDeviceTaskHelper {
typedef base::Closure CopyFileFromLocalSuccessCallback;
+ typedef base::Closure DeleteObjectSuccessCallback;
+
typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback;
MTPDeviceTaskHelper();
@@ -78,7 +80,8 @@ class MTPDeviceTaskHelper {
//
// If there is an error, |error_callback| is invoked on the IO thread to
// notify the caller about the file error.
- void ReadDirectory(uint32 dir_id,
+ void ReadDirectory(const uint32 directory_id,
+ const size_t max_size,
const ReadDirectorySuccessCallback& success_callback,
const ErrorCallback& error_callback);
@@ -107,6 +110,11 @@ class MTPDeviceTaskHelper {
const CopyFileFromLocalSuccessCallback& success_callback,
const ErrorCallback& error_callback);
+ // Forwards DeleteObject request to the MediaTransferProtocolManager.
+ void DeleteObject(const uint32 object_id,
+ const DeleteObjectSuccessCallback& success_callback,
+ const ErrorCallback& error_callback);
+
// Dispatches the CloseStorage request to the MediaTransferProtocolManager.
void CloseStorage() const;
@@ -171,13 +179,17 @@ class MTPDeviceTaskHelper {
const std::string& data,
bool error) const;
- // Called when CopyFileFromLocal completed no matter if it succeeded or
- // failed.
+ // Called when CopyFileFromLocal completes.
void OnCopyFileFromLocal(
const CopyFileFromLocalSuccessCallback& success_callback,
const ErrorCallback& error_callback,
const bool error) const;
+ // Called when DeleteObject completes.
+ void OnDeleteObject(const DeleteObjectSuccessCallback& 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