| OLD | NEW |
| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 IPC::Channel::MODE_SERVER, this, io_task_runner_); | 291 IPC::Channel::MODE_SERVER, this, io_task_runner_); |
| 292 base::CommandLine command_line(target_command_->argv()); | 292 base::CommandLine command_line(target_command_->argv()); |
| 293 command_line.AppendSwitchASCII(kMojoPipeToken, mojo_message_pipe_token); | 293 command_line.AppendSwitchASCII(kMojoPipeToken, mojo_message_pipe_token); |
| 294 | 294 |
| 295 base::HandlesToInheritVector handles_to_inherit = { | 295 base::HandlesToInheritVector handles_to_inherit = { |
| 296 handles.desktop(), handles.window_station(), | 296 handles.desktop(), handles.window_station(), |
| 297 }; | 297 }; |
| 298 mojo::edk::PlatformChannelPair mojo_channel; | 298 mojo::edk::PlatformChannelPair mojo_channel; |
| 299 mojo_channel.PrepareToPassClientHandleToChildProcess(&command_line, | 299 mojo_channel.PrepareToPassClientHandleToChildProcess(&command_line, |
| 300 &handles_to_inherit); | 300 &handles_to_inherit); |
| 301 event_handler_->AppendSwitches(&command_line); |
| 301 | 302 |
| 302 // Try to launch the worker process. The launched process inherits | 303 // Try to launch the worker process. The launched process inherits |
| 303 // the window station, desktop and pipe handles, created above. | 304 // the window station, desktop and pipe handles, created above. |
| 304 ScopedHandle worker_process; | 305 ScopedHandle worker_process; |
| 305 ScopedHandle worker_thread; | 306 ScopedHandle worker_thread; |
| 306 if (!LaunchProcessWithToken( | 307 if (!LaunchProcessWithToken( |
| 307 command_line.GetProgram(), command_line.GetCommandLineString(), | 308 command_line.GetProgram(), command_line.GetCommandLineString(), |
| 308 token.Get(), &process_attributes, &thread_attributes, | 309 token.Get(), &process_attributes, &thread_attributes, |
| 309 handles_to_inherit, /* creation_flags= */ 0, | 310 handles_to_inherit, /* creation_flags= */ 0, |
| 310 /* thread_attributes= */ nullptr, &worker_process, &worker_thread)) { | 311 /* thread_attributes= */ nullptr, &worker_process, &worker_thread)) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 PLOG(ERROR) << "Failed to duplicate a handle"; | 405 PLOG(ERROR) << "Failed to duplicate a handle"; |
| 405 ReportFatalError(); | 406 ReportFatalError(); |
| 406 return; | 407 return; |
| 407 } | 408 } |
| 408 ScopedHandle limited_handle(temp_handle); | 409 ScopedHandle limited_handle(temp_handle); |
| 409 | 410 |
| 410 event_handler_->OnProcessLaunched(std::move(limited_handle)); | 411 event_handler_->OnProcessLaunched(std::move(limited_handle)); |
| 411 } | 412 } |
| 412 | 413 |
| 413 } // namespace remoting | 414 } // namespace remoting |
| OLD | NEW |