OLD | NEW |
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 // Wrap the pipe into an IPC channel. | 381 // Wrap the pipe into an IPC channel. |
382 scoped_ptr<IPC::ChannelProxy> channel(new IPC::ChannelProxy( | 382 scoped_ptr<IPC::ChannelProxy> channel(new IPC::ChannelProxy( |
383 IPC::ChannelHandle(pipe), | 383 IPC::ChannelHandle(pipe), |
384 IPC::Channel::MODE_SERVER, | 384 IPC::Channel::MODE_SERVER, |
385 this, | 385 this, |
386 io_task_runner_)); | 386 io_task_runner_)); |
387 | 387 |
388 // Pass the name of the IPC channel to use. | 388 // Pass the name of the IPC channel to use. |
389 command_line.AppendSwitchNative(kDaemonPipeSwitchName, | 389 command_line.AppendSwitchNative(kDaemonPipeSwitchName, |
390 UTF8ToWide(channel_name)); | 390 base::UTF8ToWide(channel_name)); |
391 | 391 |
392 // Try to launch the process. | 392 // Try to launch the process. |
393 ScopedHandle worker_process; | 393 ScopedHandle worker_process; |
394 ScopedHandle worker_thread; | 394 ScopedHandle worker_thread; |
395 if (!LaunchProcessWithToken(command_line.GetProgram(), | 395 if (!LaunchProcessWithToken(command_line.GetProgram(), |
396 command_line.GetCommandLineString(), | 396 command_line.GetCommandLineString(), |
397 session_token_, | 397 session_token_, |
398 NULL, | 398 NULL, |
399 NULL, | 399 NULL, |
400 false, | 400 false, |
401 CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, | 401 CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, |
402 UTF8ToUTF16(kDefaultDesktopName).c_str(), | 402 base::UTF8ToUTF16(kDefaultDesktopName).c_str(), |
403 &worker_process, | 403 &worker_process, |
404 &worker_thread)) { | 404 &worker_thread)) { |
405 ReportFatalError(); | 405 ReportFatalError(); |
406 return; | 406 return; |
407 } | 407 } |
408 | 408 |
409 if (launch_elevated_) { | 409 if (launch_elevated_) { |
410 if (!AssignProcessToJobObject(job_, worker_process)) { | 410 if (!AssignProcessToJobObject(job_, worker_process)) { |
411 LOG_GETLASTERROR(ERROR) | 411 LOG_GETLASTERROR(ERROR) |
412 << "Failed to assign the worker to the job object"; | 412 << "Failed to assign the worker to the job object"; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 void WtsSessionProcessDelegate::CloseChannel() { | 561 void WtsSessionProcessDelegate::CloseChannel() { |
562 core_->CloseChannel(); | 562 core_->CloseChannel(); |
563 } | 563 } |
564 | 564 |
565 void WtsSessionProcessDelegate::KillProcess() { | 565 void WtsSessionProcessDelegate::KillProcess() { |
566 core_->KillProcess(); | 566 core_->KillProcess(); |
567 } | 567 } |
568 | 568 |
569 } // namespace remoting | 569 } // namespace remoting |
OLD | NEW |