| Index: storage/browser/fileapi/file_system_operation_runner.cc
|
| diff --git a/storage/browser/fileapi/file_system_operation_runner.cc b/storage/browser/fileapi/file_system_operation_runner.cc
|
| index 8dc39e6c747c33452a8888b128f5823ac7eed208..469b756537a7aadede969cea9471b854b6a27a9b 100644
|
| --- a/storage/browser/fileapi/file_system_operation_runner.cc
|
| +++ b/storage/browser/fileapi/file_system_operation_runner.cc
|
| @@ -86,6 +86,8 @@ OperationID FileSystemOperationRunner::Copy(
|
| const FileSystemURL& src_url,
|
| const FileSystemURL& dest_url,
|
| CopyOrMoveOption option,
|
| + const bool continue_with_error,
|
| + const CopyOrMoveErrorCallback& error_callback,
|
| const CopyProgressCallback& progress_callback,
|
| const StatusCallback& callback) {
|
| base::File::Error error = base::File::FILE_OK;
|
| @@ -100,13 +102,17 @@ OperationID FileSystemOperationRunner::Copy(
|
| PrepareForWrite(handle.id, dest_url);
|
| PrepareForRead(handle.id, src_url);
|
| operation->Copy(
|
| - src_url, dest_url, option,
|
| - progress_callback.is_null() ?
|
| - CopyProgressCallback() :
|
| - base::Bind(&FileSystemOperationRunner::OnCopyProgress, AsWeakPtr(),
|
| - handle, progress_callback),
|
| - base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
|
| - handle, callback));
|
| + src_url, dest_url, option, continue_with_error,
|
| + error_callback.is_null()
|
| + ? CopyOrMoveErrorCallback()
|
| + : base::Bind(&FileSystemOperationRunner::OnCopyOrMoveError,
|
| + AsWeakPtr(), handle, error_callback),
|
| + progress_callback.is_null()
|
| + ? CopyProgressCallback()
|
| + : base::Bind(&FileSystemOperationRunner::OnCopyProgress, AsWeakPtr(),
|
| + handle, progress_callback),
|
| + base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), handle,
|
| + callback));
|
| return handle.id;
|
| }
|
|
|
| @@ -611,6 +617,22 @@ void FileSystemOperationRunner::DidCreateSnapshot(
|
| FinishOperation(handle.id);
|
| }
|
|
|
| +void FileSystemOperationRunner::OnCopyOrMoveError(
|
| + const OperationHandle& handle,
|
| + const CopyOrMoveErrorCallback& callback,
|
| + base::File::Error error,
|
| + const FileSystemURL& source_url,
|
| + const FileSystemURL& dest_url) {
|
| + if (handle.scope) {
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&FileSystemOperationRunner::OnCopyOrMoveError, AsWeakPtr(),
|
| + handle, callback, error, source_url, dest_url));
|
| + return;
|
| + }
|
| + callback.Run(error, source_url, dest_url);
|
| +}
|
| +
|
| void FileSystemOperationRunner::OnCopyProgress(
|
| const OperationHandle& handle,
|
| const CopyProgressCallback& callback,
|
|
|