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

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

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Created 3 years, 5 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698