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

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

Issue 71013004: Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add constructor Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file implements the Windows service controlling Me2Me host processes 5 // This file implements the Windows service controlling Me2Me host processes
6 // running within user sessions. 6 // running within user sessions.
7 7
8 #include "remoting/host/win/wts_session_process_delegate.h" 8 #include "remoting/host/win/wts_session_process_delegate.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 base::win::ScopedHandle worker_process) { 506 base::win::ScopedHandle worker_process) {
507 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 507 DCHECK(caller_task_runner_->BelongsToCurrentThread());
508 DCHECK(!worker_process_.IsValid()); 508 DCHECK(!worker_process_.IsValid());
509 509
510 worker_process_ = worker_process.Pass(); 510 worker_process_ = worker_process.Pass();
511 511
512 // Report a handle that can be used to wait for the worker process completion, 512 // Report a handle that can be used to wait for the worker process completion,
513 // query information about the process and duplicate handles. 513 // query information about the process and duplicate handles.
514 DWORD desired_access = 514 DWORD desired_access =
515 SYNCHRONIZE | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION; 515 SYNCHRONIZE | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION;
516 ScopedHandle limited_handle; 516 HANDLE temp_handle;
517 if (!DuplicateHandle(GetCurrentProcess(), 517 if (!DuplicateHandle(GetCurrentProcess(),
518 worker_process_, 518 worker_process_,
519 GetCurrentProcess(), 519 GetCurrentProcess(),
520 limited_handle.Receive(), 520 &temp_handle,
521 desired_access, 521 desired_access,
522 FALSE, 522 FALSE,
523 0)) { 523 0)) {
524 LOG_GETLASTERROR(ERROR) << "Failed to duplicate a handle"; 524 LOG_GETLASTERROR(ERROR) << "Failed to duplicate a handle";
525 ReportFatalError(); 525 ReportFatalError();
526 return; 526 return;
527 } 527 }
528 ScopedHandle limited_handle;
529 limited_handle.Set(temp_handle);
528 530
529 event_handler_->OnProcessLaunched(limited_handle.Pass()); 531 event_handler_->OnProcessLaunched(limited_handle.Pass());
530 } 532 }
531 533
532 WtsSessionProcessDelegate::WtsSessionProcessDelegate( 534 WtsSessionProcessDelegate::WtsSessionProcessDelegate(
533 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 535 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
534 scoped_ptr<CommandLine> target_command, 536 scoped_ptr<CommandLine> target_command,
535 bool launch_elevated, 537 bool launch_elevated,
536 const std::string& channel_security) { 538 const std::string& channel_security) {
537 core_ = new Core(io_task_runner, 539 core_ = new Core(io_task_runner,
(...skipping 21 matching lines...) Expand all
559 561
560 void WtsSessionProcessDelegate::CloseChannel() { 562 void WtsSessionProcessDelegate::CloseChannel() {
561 core_->CloseChannel(); 563 core_->CloseChannel();
562 } 564 }
563 565
564 void WtsSessionProcessDelegate::KillProcess() { 566 void WtsSessionProcessDelegate::KillProcess() {
565 core_->KillProcess(); 567 core_->KillProcess();
566 } 568 }
567 569
568 } // namespace remoting 570 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698