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 "webkit/browser/fileapi/copy_or_move_operation_delegate.h" | 5 #include "webkit/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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 file_system_context()->GetCopyOrMoveFileValidatorFactory( | 750 file_system_context()->GetCopyOrMoveFileValidatorFactory( |
751 dest_root_.type(), &error); | 751 dest_root_.type(), &error); |
752 if (error != base::File::FILE_OK) { | 752 if (error != base::File::FILE_OK) { |
753 callback.Run(error); | 753 callback.Run(error); |
754 return; | 754 return; |
755 } | 755 } |
756 | 756 |
757 if (!validator_factory) { | 757 if (!validator_factory) { |
758 scoped_ptr<storage::FileStreamReader> reader = | 758 scoped_ptr<storage::FileStreamReader> reader = |
759 file_system_context()->CreateFileStreamReader( | 759 file_system_context()->CreateFileStreamReader( |
760 src_url, 0, base::Time()); | 760 src_url, 0 /* offset */, -1 /* length */, base::Time()); |
761 scoped_ptr<FileStreamWriter> writer = | 761 scoped_ptr<FileStreamWriter> writer = |
762 file_system_context()->CreateFileStreamWriter(dest_url, 0); | 762 file_system_context()->CreateFileStreamWriter(dest_url, 0); |
763 if (reader && writer) { | 763 if (reader && writer) { |
764 impl = new StreamCopyOrMoveImpl( | 764 impl = new StreamCopyOrMoveImpl( |
765 operation_runner(), operation_type_, src_url, dest_url, option_, | 765 operation_runner(), operation_type_, src_url, dest_url, option_, |
766 reader.Pass(), writer.Pass(), | 766 reader.Pass(), writer.Pass(), |
767 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, | 767 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, |
768 weak_factory_.GetWeakPtr(), src_url)); | 768 weak_factory_.GetWeakPtr(), src_url)); |
769 } | 769 } |
770 } | 770 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 base::FilePath relative = dest_root_.virtual_path(); | 957 base::FilePath relative = dest_root_.virtual_path(); |
958 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), | 958 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), |
959 &relative); | 959 &relative); |
960 return file_system_context()->CreateCrackedFileSystemURL( | 960 return file_system_context()->CreateCrackedFileSystemURL( |
961 dest_root_.origin(), | 961 dest_root_.origin(), |
962 dest_root_.mount_type(), | 962 dest_root_.mount_type(), |
963 relative); | 963 relative); |
964 } | 964 } |
965 | 965 |
966 } // namespace storage | 966 } // namespace storage |
OLD | NEW |