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

Unified Diff: remoting/host/win/unprivileged_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: include <utility> 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 | « remoting/host/win/session_input_injector.cc ('k') | remoting/host/win/worker_process_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/unprivileged_process_delegate.cc
diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc
index 3290d9d8a8b4ae309d8b1e9142f2713f0ae85586..b7fb879393d380089958819485944b52ed2e9b97 100644
--- a/remoting/host/win/unprivileged_process_delegate.cc
+++ b/remoting/host/win/unprivileged_process_delegate.cc
@@ -10,6 +10,8 @@
#include <sddl.h>
+#include <utility>
+
#include "base/command_line.h"
#include "base/files/file.h"
#include "base/logging.h"
@@ -237,9 +239,8 @@ UnprivilegedProcessDelegate::UnprivilegedProcessDelegate(
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_ptr<base::CommandLine> target_command)
: io_task_runner_(io_task_runner),
- target_command_(target_command.Pass()),
- event_handler_(nullptr) {
-}
+ target_command_(std::move(target_command)),
+ event_handler_(nullptr) {}
UnprivilegedProcessDelegate::~UnprivilegedProcessDelegate() {
DCHECK(CalledOnValidThread());
@@ -316,7 +317,7 @@ void UnprivilegedProcessDelegate::LaunchProcess(
// Create our own window station and desktop accessible by |logon_sid|.
WindowStationAndDesktop handles;
- if (!CreateWindowStationAndDesktop(logon_sid.Pass(), &handles)) {
+ if (!CreateWindowStationAndDesktop(std::move(logon_sid), &handles)) {
PLOG(ERROR) << "Failed to create a window station and desktop";
ReportFatalError();
return;
@@ -325,23 +326,17 @@ void UnprivilegedProcessDelegate::LaunchProcess(
// Try to launch the worker process. The launched process inherits
// the window station, desktop and pipe handles, created above.
ScopedHandle worker_thread;
- if (!LaunchProcessWithToken(command_line.GetProgram(),
- command_line.GetCommandLineString(),
- token.Get(),
- &process_attributes,
- &thread_attributes,
- true,
- 0,
- nullptr,
- &worker_process,
- &worker_thread)) {
+ if (!LaunchProcessWithToken(
+ command_line.GetProgram(), command_line.GetCommandLineString(),
+ token.Get(), &process_attributes, &thread_attributes, true, 0,
+ nullptr, &worker_process, &worker_thread)) {
ReportFatalError();
return;
}
}
- channel_ = server.Pass();
- ReportProcessLaunched(worker_process.Pass());
+ channel_ = std::move(server);
+ ReportProcessLaunched(std::move(worker_process));
}
void UnprivilegedProcessDelegate::Send(IPC::Message* message) {
@@ -415,19 +410,15 @@ void UnprivilegedProcessDelegate::ReportProcessLaunched(
DCHECK(CalledOnValidThread());
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();
@@ -435,7 +426,7 @@ void UnprivilegedProcessDelegate::ReportProcessLaunched(
}
ScopedHandle limited_handle(temp_handle);
- event_handler_->OnProcessLaunched(limited_handle.Pass());
+ event_handler_->OnProcessLaunched(std::move(limited_handle));
}
} // namespace remoting
« no previous file with comments | « remoting/host/win/session_input_injector.cc ('k') | remoting/host/win/worker_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698