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

Unified Diff: sandbox/win/src/broker_services.cc

Issue 1752233002: Convert Pass()→std::move() on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/emf_win.cc ('k') | sandbox/win/src/job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/broker_services.cc
diff --git a/sandbox/win/src/broker_services.cc b/sandbox/win/src/broker_services.cc
index 53edf035f951af265a7c42d281d160d12e8a7896..c3b490931d5c4bf84940a4a05111b5358c048cc9 100644
--- a/sandbox/win/src/broker_services.cc
+++ b/sandbox/win/src/broker_services.cc
@@ -6,6 +6,7 @@
#include <AclAPI.h>
#include <stddef.h>
+#include <utility>
#include "base/logging.h"
#include "base/macros.h"
@@ -59,8 +60,7 @@ enum {
// with a job object and with a policy.
struct JobTracker {
JobTracker(base::win::ScopedHandle job, sandbox::PolicyBase* policy)
- : job(job.Pass()), policy(policy) {
- }
+ : job(std::move(job)), policy(policy) {}
~JobTracker() {
FreeResources();
}
@@ -437,8 +437,8 @@ ResultCode BrokerServicesBase::SpawnTarget(const wchar_t* exe_path,
// Brokerservices does not own the target object. It is owned by the Policy.
base::win::ScopedProcessInformation process_info;
TargetProcess* target =
- new TargetProcess(initial_token.Pass(), lockdown_token.Pass(),
- lowbox_token.Pass(), job.Get(), thread_pool_);
+ new TargetProcess(std::move(initial_token), std::move(lockdown_token),
+ std::move(lowbox_token), job.Get(), thread_pool_);
DWORD win_result = target->Create(exe_path, command_line, inherit_handles,
startup_info, &process_info);
@@ -457,7 +457,7 @@ ResultCode BrokerServicesBase::SpawnTarget(const wchar_t* exe_path,
// the job object generates notifications using the completion port.
policy_base->AddRef();
if (job.IsValid()) {
- scoped_ptr<JobTracker> tracker(new JobTracker(job.Pass(), policy_base));
+ scoped_ptr<JobTracker> tracker(new JobTracker(std::move(job), policy_base));
// There is no obvious recovery after failure here. Previous version with
// SpawnCleanup() caused deletion of TargetProcess twice. crbug.com/480639
« no previous file with comments | « printing/emf_win.cc ('k') | sandbox/win/src/job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698