| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "storage/browser/fileapi/copy_or_move_operation_delegate.h" | 5 #include "storage/browser/fileapi/copy_or_move_operation_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 progress_callback_.Run( | 792 progress_callback_.Run( |
| 793 FileSystemOperation::BEGIN_COPY_ENTRY, src_url, FileSystemURL(), 0); | 793 FileSystemOperation::BEGIN_COPY_ENTRY, src_url, FileSystemURL(), 0); |
| 794 } | 794 } |
| 795 | 795 |
| 796 FileSystemURL dest_url = CreateDestURL(src_url); | 796 FileSystemURL dest_url = CreateDestURL(src_url); |
| 797 CopyOrMoveImpl* impl = NULL; | 797 CopyOrMoveImpl* impl = NULL; |
| 798 if (same_file_system_ && | 798 if (same_file_system_ && |
| 799 (file_system_context() | 799 (file_system_context() |
| 800 ->GetFileSystemBackend(src_url.type()) | 800 ->GetFileSystemBackend(src_url.type()) |
| 801 ->HasInplaceCopyImplementation(src_url.type()) || | 801 ->HasInplaceCopyImplementation(src_url.type()) || |
| 802 operation_type_ == OperationType::OPERATION_MOVE)) { | 802 operation_type_ == OPERATION_MOVE)) { |
| 803 impl = new CopyOrMoveOnSameFileSystemImpl( | 803 impl = new CopyOrMoveOnSameFileSystemImpl( |
| 804 operation_runner(), operation_type_, src_url, dest_url, option_, | 804 operation_runner(), operation_type_, src_url, dest_url, option_, |
| 805 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, | 805 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, |
| 806 weak_factory_.GetWeakPtr(), src_url)); | 806 weak_factory_.GetWeakPtr(), src_url)); |
| 807 } else { | 807 } else { |
| 808 // Cross filesystem case. | 808 // Cross filesystem case. |
| 809 base::File::Error error = base::File::FILE_ERROR_FAILED; | 809 base::File::Error error = base::File::FILE_ERROR_FAILED; |
| 810 CopyOrMoveFileValidatorFactory* validator_factory = | 810 CopyOrMoveFileValidatorFactory* validator_factory = |
| 811 file_system_context()->GetCopyOrMoveFileValidatorFactory( | 811 file_system_context()->GetCopyOrMoveFileValidatorFactory( |
| 812 dest_root_.type(), &error); | 812 dest_root_.type(), &error); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 base::FilePath relative = dest_root_.virtual_path(); | 1025 base::FilePath relative = dest_root_.virtual_path(); |
| 1026 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), | 1026 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), |
| 1027 &relative); | 1027 &relative); |
| 1028 return file_system_context()->CreateCrackedFileSystemURL( | 1028 return file_system_context()->CreateCrackedFileSystemURL( |
| 1029 dest_root_.origin(), | 1029 dest_root_.origin(), |
| 1030 dest_root_.mount_type(), | 1030 dest_root_.mount_type(), |
| 1031 relative); | 1031 relative); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 } // namespace storage | 1034 } // namespace storage |
| OLD | NEW |