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

Unified Diff: storage/browser/fileapi/copy_or_move_operation_delegate.cc

Issue 1546243002: Convert Pass()→std::move() in //storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « storage/browser/fileapi/async_file_util_adapter.cc ('k') | storage/browser/fileapi/file_system_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/fileapi/copy_or_move_operation_delegate.cc
diff --git a/storage/browser/fileapi/copy_or_move_operation_delegate.cc b/storage/browser/fileapi/copy_or_move_operation_delegate.cc
index f3072a119e3e2cbba6f4cf8dbc615274aa09bba8..157727852922f57f888da8156daeb13e3d021d3d 100644
--- a/storage/browser/fileapi/copy_or_move_operation_delegate.cc
+++ b/storage/browser/fileapi/copy_or_move_operation_delegate.cc
@@ -5,6 +5,7 @@
#include "storage/browser/fileapi/copy_or_move_operation_delegate.h"
#include <stdint.h>
+#include <utility>
#include "base/bind.h"
#include "base/files/file_path.h"
@@ -382,8 +383,8 @@ class StreamCopyOrMoveImpl
src_url_(src_url),
dest_url_(dest_url),
option_(option),
- reader_(reader.Pass()),
- writer_(writer.Pass()),
+ reader_(std::move(reader)),
+ writer_(std::move(writer)),
file_progress_callback_(file_progress_callback),
cancel_requested_(false),
weak_factory_(this) {}
@@ -502,8 +503,9 @@ class StreamCopyOrMoveImpl
NotifyOnStartUpdate(dest_url_);
DCHECK(!copy_helper_);
copy_helper_.reset(new CopyOrMoveOperationDelegate::StreamCopyHelper(
- reader_.Pass(), writer_.Pass(), dest_url_.mount_option().flush_policy(),
- kReadBufferSize, file_progress_callback_,
+ std::move(reader_), std::move(writer_),
+ dest_url_.mount_option().flush_policy(), kReadBufferSize,
+ file_progress_callback_,
base::TimeDelta::FromMilliseconds(
kMinProgressCallbackInvocationSpanInMilliseconds)));
copy_helper_->Run(
@@ -593,8 +595,8 @@ CopyOrMoveOperationDelegate::StreamCopyHelper::StreamCopyHelper(
int buffer_size,
const FileSystemOperation::CopyFileProgressCallback& file_progress_callback,
const base::TimeDelta& min_progress_callback_invocation_span)
- : reader_(reader.Pass()),
- writer_(writer.Pass()),
+ : reader_(std::move(reader)),
+ writer_(std::move(writer)),
flush_policy_(flush_policy),
file_progress_callback_(file_progress_callback),
io_buffer_(new net::IOBufferWithSize(buffer_size)),
@@ -603,8 +605,7 @@ CopyOrMoveOperationDelegate::StreamCopyHelper::StreamCopyHelper(
min_progress_callback_invocation_span_(
min_progress_callback_invocation_span),
cancel_requested_(false),
- weak_factory_(this) {
-}
+ weak_factory_(this) {}
CopyOrMoveOperationDelegate::StreamCopyHelper::~StreamCopyHelper() {
}
@@ -824,17 +825,10 @@ void CopyOrMoveOperationDelegate::ProcessFile(
file_system_context()->CreateFileStreamWriter(dest_url, 0);
if (reader && writer) {
impl = new StreamCopyOrMoveImpl(
- operation_runner(),
- file_system_context(),
- operation_type_,
- src_url,
- dest_url,
- option_,
- reader.Pass(),
- writer.Pass(),
+ operation_runner(), file_system_context(), operation_type_, src_url,
+ dest_url, option_, std::move(reader), std::move(writer),
base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress,
- weak_factory_.GetWeakPtr(),
- src_url));
+ weak_factory_.GetWeakPtr(), src_url));
}
}
« no previous file with comments | « storage/browser/fileapi/async_file_util_adapter.cc ('k') | storage/browser/fileapi/file_system_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698