Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | |
| 7 #include "base/bind.h" | 8 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 13 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 14 #include "base/process_util.h" | 15 #include "base/process_util.h" |
| 15 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 #elif defined(OS_POSIX) | 115 #elif defined(OS_POSIX) |
| 115 bool use_zygote, | 116 bool use_zygote, |
| 116 const base::EnvironmentVector& environ, | 117 const base::EnvironmentVector& environ, |
| 117 #endif | 118 #endif |
| 118 CommandLine* cmd_line) { | 119 CommandLine* cmd_line) { |
| 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 120 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 120 | 121 |
| 121 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 122 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
| 122 cmd_line, data_.id); | 123 cmd_line, data_.id); |
| 123 | 124 |
| 125 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | |
| 126 static const char* kForwardSwitches[] = { | |
|
piman
2012/10/17 06:10:25
nit: can you add:
#if defined(OS_POSIX)
switch
qiankun
2012/10/17 09:47:37
Done.
| |
| 127 switches::kDisableLogging, | |
| 128 switches::kEnableDCHECK, | |
| 129 switches::kEnableLogging, | |
| 130 switches::kLoggingLevel, | |
| 131 switches::kV, | |
| 132 switches::kVModule, | |
| 133 }; | |
| 134 cmd_line->CopySwitchesFrom(browser_command_line, kForwardSwitches, | |
| 135 arraysize(kForwardSwitches)); | |
| 136 | |
| 137 | |
| 124 #if defined(OS_POSIX) | 138 #if defined(OS_POSIX) |
| 125 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChildCleanExit)) | 139 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChildCleanExit)) |
| 126 cmd_line->AppendSwitch(switches::kChildCleanExit); | 140 cmd_line->AppendSwitch(switches::kChildCleanExit); |
| 127 #endif | 141 #endif |
| 128 | 142 |
| 129 child_process_.reset(new ChildProcessLauncher( | 143 child_process_.reset(new ChildProcessLauncher( |
| 130 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
| 131 exposed_dir, | 145 exposed_dir, |
| 132 #elif defined(OS_POSIX) | 146 #elif defined(OS_POSIX) |
| 133 use_zygote, | 147 use_zygote, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 } | 270 } |
| 257 | 271 |
| 258 void BrowserChildProcessHostImpl::OnProcessLaunched() { | 272 void BrowserChildProcessHostImpl::OnProcessLaunched() { |
| 259 if (!child_process_->GetHandle()) { | 273 if (!child_process_->GetHandle()) { |
| 260 delete delegate_; // Will delete us | 274 delete delegate_; // Will delete us |
| 261 return; | 275 return; |
| 262 } | 276 } |
| 263 data_.handle = child_process_->GetHandle(); | 277 data_.handle = child_process_->GetHandle(); |
| 264 delegate_->OnProcessLaunched(); | 278 delegate_->OnProcessLaunched(); |
| 265 } | 279 } |
| OLD | NEW |