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

Side by Side Diff: remoting/host/win/unprivileged_process_delegate.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
OLDNEW
1 1
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 // 5 //
6 // This file implements the Windows service controlling Me2Me host processes 6 // This file implements the Windows service controlling Me2Me host processes
7 // running within user sessions. 7 // running within user sessions.
8 8
9 #include "remoting/host/win/unprivileged_process_delegate.h" 9 #include "remoting/host/win/unprivileged_process_delegate.h"
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 232
233 handles.Swap(*handles_out); 233 handles.Swap(*handles_out);
234 return true; 234 return true;
235 } 235 }
236 236
237 } // namespace 237 } // namespace
238 238
239 UnprivilegedProcessDelegate::UnprivilegedProcessDelegate( 239 UnprivilegedProcessDelegate::UnprivilegedProcessDelegate(
240 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 240 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
241 scoped_ptr<base::CommandLine> target_command) 241 std::unique_ptr<base::CommandLine> target_command)
242 : io_task_runner_(io_task_runner), 242 : io_task_runner_(io_task_runner),
243 target_command_(std::move(target_command)), 243 target_command_(std::move(target_command)),
244 event_handler_(nullptr) {} 244 event_handler_(nullptr) {}
245 245
246 UnprivilegedProcessDelegate::~UnprivilegedProcessDelegate() { 246 UnprivilegedProcessDelegate::~UnprivilegedProcessDelegate() {
247 DCHECK(CalledOnValidThread()); 247 DCHECK(CalledOnValidThread());
248 DCHECK(!channel_); 248 DCHECK(!channel_);
249 DCHECK(!worker_process_.IsValid()); 249 DCHECK(!worker_process_.IsValid());
250 } 250 }
251 251
252 void UnprivilegedProcessDelegate::LaunchProcess( 252 void UnprivilegedProcessDelegate::LaunchProcess(
253 WorkerProcessLauncher* event_handler) { 253 WorkerProcessLauncher* event_handler) {
254 DCHECK(CalledOnValidThread()); 254 DCHECK(CalledOnValidThread());
255 DCHECK(!event_handler_); 255 DCHECK(!event_handler_);
256 256
257 event_handler_ = event_handler; 257 event_handler_ = event_handler;
258 258
259 scoped_ptr<IPC::ChannelProxy> server; 259 std::unique_ptr<IPC::ChannelProxy> server;
260 260
261 // Create a restricted token that will be used to run the worker process. 261 // Create a restricted token that will be used to run the worker process.
262 ScopedHandle token; 262 ScopedHandle token;
263 if (!CreateRestrictedToken(&token)) { 263 if (!CreateRestrictedToken(&token)) {
264 PLOG(ERROR) << "Failed to create a restricted LocalService token"; 264 PLOG(ERROR) << "Failed to create a restricted LocalService token";
265 ReportFatalError(); 265 ReportFatalError();
266 return; 266 return;
267 } 267 }
268 268
269 // Determine our logon SID, so we can grant it access to our window station 269 // Determine our logon SID, so we can grant it access to our window station
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 PLOG(ERROR) << "Failed to duplicate a handle"; 432 PLOG(ERROR) << "Failed to duplicate a handle";
433 ReportFatalError(); 433 ReportFatalError();
434 return; 434 return;
435 } 435 }
436 ScopedHandle limited_handle(temp_handle); 436 ScopedHandle limited_handle(temp_handle);
437 437
438 event_handler_->OnProcessLaunched(std::move(limited_handle)); 438 event_handler_->OnProcessLaunched(std::move(limited_handle));
439 } 439 }
440 440
441 } // namespace remoting 441 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/win/unprivileged_process_delegate.h ('k') | remoting/host/win/worker_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698