| 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 "mojo/shell/child_process_host.h" | 5 #include "mojo/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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return rv; | 63 return rv; |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool ChildProcessHost::DoLaunch() { | 66 bool ChildProcessHost::DoLaunch() { |
| 67 static const char* kForwardSwitches[] = { | 67 static const char* kForwardSwitches[] = { |
| 68 switches::kTraceToConsole, | 68 switches::kTraceToConsole, |
| 69 switches::kV, | 69 switches::kV, |
| 70 switches::kVModule, | 70 switches::kVModule, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 const CommandLine* parent_command_line = CommandLine::ForCurrentProcess(); | 73 const base::CommandLine* parent_command_line = |
| 74 CommandLine child_command_line(parent_command_line->GetProgram()); | 74 base::CommandLine::ForCurrentProcess(); |
| 75 base::CommandLine child_command_line(parent_command_line->GetProgram()); |
| 75 child_command_line.CopySwitchesFrom(*parent_command_line, kForwardSwitches, | 76 child_command_line.CopySwitchesFrom(*parent_command_line, kForwardSwitches, |
| 76 arraysize(kForwardSwitches)); | 77 arraysize(kForwardSwitches)); |
| 77 child_command_line.AppendSwitchASCII( | 78 child_command_line.AppendSwitchASCII( |
| 78 switches::kChildProcessType, base::IntToString(static_cast<int>(type_))); | 79 switches::kChildProcessType, base::IntToString(static_cast<int>(type_))); |
| 79 | 80 |
| 80 embedder::HandlePassingInformation handle_passing_info; | 81 embedder::HandlePassingInformation handle_passing_info; |
| 81 platform_channel_pair_.PrepareToPassClientHandleToChildProcess( | 82 platform_channel_pair_.PrepareToPassClientHandleToChildProcess( |
| 82 &child_command_line, &handle_passing_info); | 83 &child_command_line, &handle_passing_info); |
| 83 | 84 |
| 84 base::LaunchOptions options; | 85 base::LaunchOptions options; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 95 platform_channel_pair_.ChildProcessLaunched(); | 96 platform_channel_pair_.ChildProcessLaunched(); |
| 96 return true; | 97 return true; |
| 97 } | 98 } |
| 98 | 99 |
| 99 void ChildProcessHost::DidLaunch(bool success) { | 100 void ChildProcessHost::DidLaunch(bool success) { |
| 100 delegate_->DidStart(success); | 101 delegate_->DidStart(success); |
| 101 } | 102 } |
| 102 | 103 |
| 103 } // namespace shell | 104 } // namespace shell |
| 104 } // namespace mojo | 105 } // namespace mojo |
| OLD | NEW |