Index: storage/browser/fileapi/copy_or_move_operation_delegate.cc |
diff --git a/storage/browser/fileapi/copy_or_move_operation_delegate.cc b/storage/browser/fileapi/copy_or_move_operation_delegate.cc |
index 1cb92f5a838d371443aa749598db26de68449003..cf4692bfa5725ee731eddf9e15dda096c8eab9f6 100644 |
--- a/storage/browser/fileapi/copy_or_move_operation_delegate.cc |
+++ b/storage/browser/fileapi/copy_or_move_operation_delegate.cc |
@@ -730,6 +730,7 @@ CopyOrMoveOperationDelegate::CopyOrMoveOperationDelegate( |
const FileSystemURL& dest_root, |
OperationType operation_type, |
CopyOrMoveOption option, |
+ ErrorBehavior error_behavior, |
const CopyProgressCallback& progress_callback, |
const StatusCallback& callback) |
: RecursiveOperationDelegate(file_system_context), |
@@ -737,6 +738,7 @@ CopyOrMoveOperationDelegate::CopyOrMoveOperationDelegate( |
dest_root_(dest_root), |
operation_type_(operation_type), |
option_(option), |
+ error_behavior_(error_behavior), |
progress_callback_(progress_callback), |
callback_(callback), |
weak_factory_(this) { |
@@ -773,7 +775,7 @@ void CopyOrMoveOperationDelegate::RunRecursively() { |
// TODO(kinuko): This could be too expensive for same_file_system_==true |
// and operation==MOVE case, probably we can just rename the root directory. |
// http://crbug.com/172187 |
- StartRecursiveOperation(src_root_, callback_); |
+ StartRecursiveOperation(src_root_, error_behavior_, callback_); |
} |
void CopyOrMoveOperationDelegate::ProcessFile( |
@@ -802,6 +804,10 @@ void CopyOrMoveOperationDelegate::ProcessFile( |
file_system_context()->GetCopyOrMoveFileValidatorFactory( |
dest_root_.type(), &error); |
if (error != base::File::FILE_OK) { |
+ if (!progress_callback_.is_null()) |
+ progress_callback_.Run(FileSystemOperation::ERROR_COPY_ENTRY, src_url, |
+ dest_url, 0); |
+ |
callback.Run(error); |
return; |
} |
@@ -900,6 +906,11 @@ void CopyOrMoveOperationDelegate::DidCopyOrMoveFile( |
running_copy_set_.erase(impl); |
delete impl; |
+ if (!progress_callback_.is_null() && error != base::File::FILE_OK && |
+ error != base::File::FILE_ERROR_NOT_A_FILE) |
+ progress_callback_.Run(FileSystemOperation::ERROR_COPY_ENTRY, src_url, |
+ dest_url, 0); |
+ |
if (!progress_callback_.is_null() && error == base::File::FILE_OK) { |
progress_callback_.Run( |
FileSystemOperation::END_COPY_ENTRY, src_url, dest_url, 0); |