OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "shell/child_process_host.h" | 5 #include "shell/child_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 child_command_line.CopySwitchesFrom(*parent_command_line, kForwardSwitches, | 68 child_command_line.CopySwitchesFrom(*parent_command_line, kForwardSwitches, |
69 arraysize(kForwardSwitches)); | 69 arraysize(kForwardSwitches)); |
70 child_command_line.AppendSwitchASCII( | 70 child_command_line.AppendSwitchASCII( |
71 switches::kChildProcessType, base::IntToString(static_cast<int>(type_))); | 71 switches::kChildProcessType, base::IntToString(static_cast<int>(type_))); |
72 | 72 |
73 embedder::HandlePassingInformation handle_passing_info; | 73 embedder::HandlePassingInformation handle_passing_info; |
74 platform_channel_pair_.PrepareToPassClientHandleToChildProcess( | 74 platform_channel_pair_.PrepareToPassClientHandleToChildProcess( |
75 &child_command_line, &handle_passing_info); | 75 &child_command_line, &handle_passing_info); |
76 | 76 |
77 base::LaunchOptions options; | 77 base::LaunchOptions options; |
78 #if defined(OS_WIN) | |
79 options.start_hidden = true; | |
80 options.handles_to_inherit = &handle_passing_info; | |
81 #elif defined(OS_POSIX) | |
82 options.fds_to_remap = &handle_passing_info; | 78 options.fds_to_remap = &handle_passing_info; |
83 #endif | |
84 child_process_ = base::LaunchProcess(child_command_line, options); | 79 child_process_ = base::LaunchProcess(child_command_line, options); |
85 if (!child_process_.IsValid()) | 80 if (!child_process_.IsValid()) |
86 return false; | 81 return false; |
87 | 82 |
88 platform_channel_pair_.ChildProcessLaunched(); | 83 platform_channel_pair_.ChildProcessLaunched(); |
89 return true; | 84 return true; |
90 } | 85 } |
91 | 86 |
92 void ChildProcessHost::DidLaunch(bool success) { | 87 void ChildProcessHost::DidLaunch(bool success) { |
93 delegate_->DidStart(success); | 88 delegate_->DidStart(success); |
94 } | 89 } |
95 | 90 |
96 } // namespace shell | 91 } // namespace shell |
97 } // namespace mojo | 92 } // namespace mojo |
OLD | NEW |