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

Side by Side Diff: webkit/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: Cleaned up. 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 "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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 file_system_context()->GetCopyOrMoveFileValidatorFactory( 779 file_system_context()->GetCopyOrMoveFileValidatorFactory(
780 dest_root_.type(), &error); 780 dest_root_.type(), &error);
781 if (error != base::File::FILE_OK) { 781 if (error != base::File::FILE_OK) {
782 callback.Run(error); 782 callback.Run(error);
783 return; 783 return;
784 } 784 }
785 785
786 if (!validator_factory) { 786 if (!validator_factory) {
787 scoped_ptr<storage::FileStreamReader> reader = 787 scoped_ptr<storage::FileStreamReader> reader =
788 file_system_context()->CreateFileStreamReader( 788 file_system_context()->CreateFileStreamReader(
789 src_url, 0, base::Time()); 789 src_url, 0 /* offset */, storage::kMaximumLength, base::Time());
790 scoped_ptr<FileStreamWriter> writer = 790 scoped_ptr<FileStreamWriter> writer =
791 file_system_context()->CreateFileStreamWriter(dest_url, 0); 791 file_system_context()->CreateFileStreamWriter(dest_url, 0);
792 if (reader && writer) { 792 if (reader && writer) {
793 impl = new StreamCopyOrMoveImpl( 793 impl = new StreamCopyOrMoveImpl(
794 operation_runner(), operation_type_, src_url, dest_url, option_, 794 operation_runner(), operation_type_, src_url, dest_url, option_,
795 reader.Pass(), writer.Pass(), 795 reader.Pass(), writer.Pass(),
796 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, 796 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress,
797 weak_factory_.GetWeakPtr(), src_url)); 797 weak_factory_.GetWeakPtr(), src_url));
798 } 798 }
799 } 799 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 base::FilePath relative = dest_root_.virtual_path(); 986 base::FilePath relative = dest_root_.virtual_path();
987 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), 987 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(),
988 &relative); 988 &relative);
989 return file_system_context()->CreateCrackedFileSystemURL( 989 return file_system_context()->CreateCrackedFileSystemURL(
990 dest_root_.origin(), 990 dest_root_.origin(),
991 dest_root_.mount_type(), 991 dest_root_.mount_type(),
992 relative); 992 relative);
993 } 993 }
994 994
995 } // namespace storage 995 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698