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

Unified Diff: storage/browser/fileapi/file_system_operation.h

Issue 1194783002: Add fileManagerPrivate.onCopyError event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove const and rename enum. Created 5 years, 6 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: storage/browser/fileapi/file_system_operation.h
diff --git a/storage/browser/fileapi/file_system_operation.h b/storage/browser/fileapi/file_system_operation.h
index bc5bc879a845d2df25d569d6f6c459a979b121d1..b9e6f95cf26c7829276f63e72a8319a86ad94908 100644
--- a/storage/browser/fileapi/file_system_operation.h
+++ b/storage/browser/fileapi/file_system_operation.h
@@ -68,12 +68,6 @@ class FileSystemOperation {
// Used for CreateFile(), etc. |result| is the return code of the operation.
typedef base::Callback<void(base::File::Error result)> StatusCallback;
- // Called when an error had happened during operation.
- // |url| is the url of processed entry.
- // |error| is the error code of the failed operation.
- typedef base::Callback<void(const FileSystemURL& url,
- base::File::Error error)> ErrorCallback;
-
// Used for GetMetadata(). |result| is the return code of the operation,
// |file_info| is the obtained file info.
typedef base::Callback<
@@ -126,6 +120,13 @@ class FileSystemOperation {
const scoped_refptr<storage::ShareableFileReference>& file_ref)>
SnapshotFileCallback;
+ // Used to specify how recursive operation delegate behaves for errors.
+ // With ERROR_BEHAVIOR_ABORT, it stops following operation when it fails an
+ // operation.
+ // With ERROR_BEHAVIOR_SKIP, it continues following operation even when it
+ // fails some of the operations.
+ enum ErrorBehavior { ERROR_BEHAVIOR_ABORT, ERROR_BEHAVIOR_SKIP };
+
// Used for progress update callback for Copy().
//
// BEGIN_COPY_ENTRY is fired for each copy creation beginning (for both
@@ -199,6 +200,7 @@ class FileSystemOperation {
BEGIN_COPY_ENTRY,
END_COPY_ENTRY,
PROGRESS,
+ ERROR_COPY_ENTRY
};
typedef base::Callback<void(CopyProgressType type,
const FileSystemURL& source_url,
@@ -251,6 +253,8 @@ class FileSystemOperation {
// |dest_path| as needed.
// |option| specifies the minor behavior of Copy(). See CopyOrMoveOption's
// comment for details.
+ // |error_behavior| specifies whether this continues operation after it
+ // failed an operation or not.
// |progress_callback| is periodically called to report the progress
// update. See also the comment of CopyProgressCallback. This callback is
// optional.
@@ -266,6 +270,7 @@ class FileSystemOperation {
virtual void Copy(const FileSystemURL& src_path,
const FileSystemURL& dest_path,
CopyOrMoveOption option,
+ ErrorBehavior error_behavior,
const CopyProgressCallback& progress_callback,
const StatusCallback& callback) = 0;
« no previous file with comments | « storage/browser/fileapi/copy_or_move_operation_delegate.cc ('k') | storage/browser/fileapi/file_system_operation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698