Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: storage/browser/fileapi/copy_or_move_operation_delegate.cc

Issue 470323003: [fsp] Improve performance for reading small chunks of data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 file_system_context()->GetCopyOrMoveFileValidatorFactory( 811 file_system_context()->GetCopyOrMoveFileValidatorFactory(
812 dest_root_.type(), &error); 812 dest_root_.type(), &error);
813 if (error != base::File::FILE_OK) { 813 if (error != base::File::FILE_OK) {
814 callback.Run(error); 814 callback.Run(error);
815 return; 815 return;
816 } 816 }
817 817
818 if (!validator_factory) { 818 if (!validator_factory) {
819 scoped_ptr<storage::FileStreamReader> reader = 819 scoped_ptr<storage::FileStreamReader> reader =
820 file_system_context()->CreateFileStreamReader( 820 file_system_context()->CreateFileStreamReader(
821 src_url, 0, base::Time()); 821 src_url, 0 /* offset */, storage::kMaximumLength, base::Time());
822 scoped_ptr<FileStreamWriter> writer = 822 scoped_ptr<FileStreamWriter> writer =
823 file_system_context()->CreateFileStreamWriter(dest_url, 0); 823 file_system_context()->CreateFileStreamWriter(dest_url, 0);
824 if (reader && writer) { 824 if (reader && writer) {
825 impl = new StreamCopyOrMoveImpl( 825 impl = new StreamCopyOrMoveImpl(
826 operation_runner(), 826 operation_runner(),
827 file_system_context(), 827 file_system_context(),
828 operation_type_, 828 operation_type_,
829 src_url, 829 src_url,
830 dest_url, 830 dest_url,
831 option_, 831 option_,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698