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; |