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

Unified Diff: device/media_transfer_protocol/media_transfer_protocol_manager.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: device/media_transfer_protocol/media_transfer_protocol_manager.h
diff --git a/device/media_transfer_protocol/media_transfer_protocol_manager.h b/device/media_transfer_protocol/media_transfer_protocol_manager.h
index 39eea9bb899307fc36b91c850bbdc74e9a1d9a38..1915ce205cf5a3657feb2ece66c6316b3a049f14 100644
--- a/device/media_transfer_protocol/media_transfer_protocol_manager.h
+++ b/device/media_transfer_protocol/media_transfer_protocol_manager.h
@@ -63,6 +63,10 @@ class MediaTransferProtocolManager {
// The first argument is true if there was an error.
typedef base::Callback<void(bool error)> CopyFileFromLocalCallback;
+ // A callback to handle the result of DeleteObject.
+ // The first argument is true if there was an error.
+ typedef base::Callback<void(bool error)> DeleteObjectCallback;
+
// Implement this interface to be notified about MTP storage
// attachment / detachment events.
class Observer {
@@ -100,9 +104,10 @@ class MediaTransferProtocolManager {
const CloseStorageCallback& callback) = 0;
// Reads directory entries from |file_id| on |storage_handle| and runs
- // |callback|.
+ // |callback|. |max_size| is a maximum number of files to be read.
virtual void ReadDirectory(const std::string& storage_handle,
- uint32 file_id,
+ const uint32 file_id,
+ const size_t max_size,
const ReadDirectoryCallback& callback) = 0;
// Reads file data from |file_id| on |storage_handle| and runs |callback|.
@@ -127,6 +132,11 @@ class MediaTransferProtocolManager {
const std::string& file_name,
const CopyFileFromLocalCallback& callback) = 0;
+ // Deletes |object_id|.
+ virtual void DeleteObject(const std::string& storage_handle,
+ const uint32 object_id,
+ const DeleteObjectCallback& callback) = 0;
+
// Creates and returns the global MediaTransferProtocolManager instance.
// On Linux, |task_runner| specifies the task runner to process asynchronous
// operations.

Powered by Google App Engine
This is Rietveld 408576698