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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 mojo::edk::OutgoingBrokerClientInvitation invitation; | 287 mojo::edk::OutgoingBrokerClientInvitation invitation; |
288 std::string mojo_message_pipe_token = mojo::edk::GenerateRandomToken(); | 288 std::string mojo_message_pipe_token = mojo::edk::GenerateRandomToken(); |
289 std::unique_ptr<IPC::ChannelProxy> server = IPC::ChannelProxy::Create( | 289 std::unique_ptr<IPC::ChannelProxy> server = IPC::ChannelProxy::Create( |
290 invitation.AttachMessagePipe(mojo_message_pipe_token).release(), | 290 invitation.AttachMessagePipe(mojo_message_pipe_token).release(), |
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 std::vector<HANDLE> 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 | 301 |
302 // Try to launch the worker process. The launched process inherits | 302 // Try to launch the worker process. The launched process inherits |
303 // the window station, desktop and pipe handles, created above. | 303 // the window station, desktop and pipe handles, created above. |
304 ScopedHandle worker_process; | 304 ScopedHandle worker_process; |
305 ScopedHandle worker_thread; | 305 ScopedHandle worker_thread; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 PLOG(ERROR) << "Failed to duplicate a handle"; | 404 PLOG(ERROR) << "Failed to duplicate a handle"; |
405 ReportFatalError(); | 405 ReportFatalError(); |
406 return; | 406 return; |
407 } | 407 } |
408 ScopedHandle limited_handle(temp_handle); | 408 ScopedHandle limited_handle(temp_handle); |
409 | 409 |
410 event_handler_->OnProcessLaunched(std::move(limited_handle)); | 410 event_handler_->OnProcessLaunched(std::move(limited_handle)); |
411 } | 411 } |
412 | 412 |
413 } // namespace remoting | 413 } // namespace remoting |
OLD | NEW |