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

Unified Diff: remoting/host/win/wts_session_process_delegate.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
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
Index: remoting/host/win/wts_session_process_delegate.cc
diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc
index 5895f1fd198d045a85f1f93b06912e7dec377462..4b5e4e58fdce681c3ffb498282b1336283b50299 100644
--- a/remoting/host/win/wts_session_process_delegate.cc
+++ b/remoting/host/win/wts_session_process_delegate.cc
@@ -154,8 +154,7 @@ WtsSessionProcessDelegate::Core::Core(
get_named_pipe_client_pid_(nullptr),
launch_elevated_(launch_elevated),
launch_pending_(false),
- target_command_(target_command.Pass()) {
-}
+ target_command_(std::move(target_command)) {}
bool WtsSessionProcessDelegate::Core::Initialize(uint32 session_id) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
@@ -200,7 +199,7 @@ bool WtsSessionProcessDelegate::Core::Initialize(uint32 session_id) {
// ScopedHandle is not compatible with base::Passed, so we wrap it to
// a scoped pointer.
scoped_ptr<ScopedHandle> job_wrapper(new ScopedHandle());
- *job_wrapper = job.Pass();
+ *job_wrapper = std::move(job);
// To receive job object notifications the job object is registered with
// the completion port represented by |io_task_runner|. The registration has
@@ -330,7 +329,7 @@ void WtsSessionProcessDelegate::Core::OnChannelConnected(int32 peer_pid) {
return;
}
- ReportProcessLaunched(worker_process.Pass());
+ ReportProcessLaunched(std::move(worker_process));
}
if (event_handler_)
@@ -421,14 +420,14 @@ void WtsSessionProcessDelegate::Core::DoLaunchProcess() {
return;
}
- channel_ = channel.Pass();
- pipe_ = pipe.Pass();
+ channel_ = std::move(channel);
+ pipe_ = std::move(pipe);
// Report success if the worker process is lauched directly. Otherwise, PID of
// the client connected to the pipe will be used later. See
// OnChannelConnected().
if (!launch_elevated_)
- ReportProcessLaunched(worker_process.Pass());
+ ReportProcessLaunched(std::move(worker_process));
}
void WtsSessionProcessDelegate::Core::DrainJobNotifications() {
@@ -506,19 +505,15 @@ void WtsSessionProcessDelegate::Core::ReportProcessLaunched(
DCHECK(caller_task_runner_->BelongsToCurrentThread());
DCHECK(!worker_process_.IsValid());
- worker_process_ = worker_process.Pass();
+ worker_process_ = std::move(worker_process);
// Report a handle that can be used to wait for the worker process completion,
// query information about the process and duplicate handles.
DWORD desired_access =
SYNCHRONIZE | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION;
HANDLE temp_handle;
- if (!DuplicateHandle(GetCurrentProcess(),
- worker_process_.Get(),
- GetCurrentProcess(),
- &temp_handle,
- desired_access,
- FALSE,
+ if (!DuplicateHandle(GetCurrentProcess(), worker_process_.Get(),
+ GetCurrentProcess(), &temp_handle, desired_access, FALSE,
0)) {
PLOG(ERROR) << "Failed to duplicate a handle";
ReportFatalError();
@@ -526,7 +521,7 @@ void WtsSessionProcessDelegate::Core::ReportProcessLaunched(
}
ScopedHandle limited_handle(temp_handle);
- event_handler_->OnProcessLaunched(limited_handle.Pass());
+ event_handler_->OnProcessLaunched(std::move(limited_handle));
}
WtsSessionProcessDelegate::WtsSessionProcessDelegate(
@@ -534,9 +529,7 @@ WtsSessionProcessDelegate::WtsSessionProcessDelegate(
scoped_ptr<base::CommandLine> target_command,
bool launch_elevated,
const std::string& channel_security) {
- core_ = new Core(io_task_runner,
- target_command.Pass(),
- launch_elevated,
+ core_ = new Core(io_task_runner, std::move(target_command), launch_elevated,
channel_security);
}

Powered by Google App Engine
This is Rietveld 408576698