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

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: Fixed a dcheck. Created 6 years, 4 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 file_system_context()->GetCopyOrMoveFileValidatorFactory( 752 file_system_context()->GetCopyOrMoveFileValidatorFactory(
753 dest_root_.type(), &error); 753 dest_root_.type(), &error);
754 if (error != base::File::FILE_OK) { 754 if (error != base::File::FILE_OK) {
755 callback.Run(error); 755 callback.Run(error);
756 return; 756 return;
757 } 757 }
758 758
759 if (!validator_factory) { 759 if (!validator_factory) {
760 scoped_ptr<webkit_blob::FileStreamReader> reader = 760 scoped_ptr<webkit_blob::FileStreamReader> reader =
761 file_system_context()->CreateFileStreamReader( 761 file_system_context()->CreateFileStreamReader(
762 src_url, 0, base::Time()); 762 src_url, 0 /* offset */, -1 /* length */, base::Time());
763 scoped_ptr<FileStreamWriter> writer = 763 scoped_ptr<FileStreamWriter> writer =
764 file_system_context()->CreateFileStreamWriter(dest_url, 0); 764 file_system_context()->CreateFileStreamWriter(dest_url, 0);
765 if (reader && writer) { 765 if (reader && writer) {
766 impl = new StreamCopyOrMoveImpl( 766 impl = new StreamCopyOrMoveImpl(
767 operation_runner(), operation_type_, src_url, dest_url, option_, 767 operation_runner(), operation_type_, src_url, dest_url, option_,
768 reader.Pass(), writer.Pass(), 768 reader.Pass(), writer.Pass(),
769 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, 769 base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress,
770 weak_factory_.GetWeakPtr(), src_url)); 770 weak_factory_.GetWeakPtr(), src_url));
771 } 771 }
772 } 772 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 base::FilePath relative = dest_root_.virtual_path(); 959 base::FilePath relative = dest_root_.virtual_path();
960 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(), 960 src_root_.virtual_path().AppendRelativePath(src_url.virtual_path(),
961 &relative); 961 &relative);
962 return file_system_context()->CreateCrackedFileSystemURL( 962 return file_system_context()->CreateCrackedFileSystemURL(
963 dest_root_.origin(), 963 dest_root_.origin(),
964 dest_root_.mount_type(), 964 dest_root_.mount_type(),
965 relative); 965 relative);
966 } 966 }
967 967
968 } // namespace fileapi 968 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698