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/utility_process_host_impl.h" | 5 #include "content/browser/utility_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/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 12 #include "content/browser/browser_child_process_host_impl.h" | 13 #include "content/browser/browser_child_process_host_impl.h" |
| 13 #include "content/common/child_process_host_impl.h" | 14 #include "content/common/child_process_host_impl.h" |
| 14 #include "content/common/utility_messages.h" | 15 #include "content/common/utility_messages.h" |
| 15 #include "content/public/browser/content_browser_client.h" | 16 #include "content/public/browser/content_browser_client.h" |
| 16 #include "content/public/browser/utility_process_host_client.h" | 17 #include "content/public/browser/utility_process_host_client.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 if (has_cmd_prefix) { | 159 if (has_cmd_prefix) { |
| 159 // launch the utility child process with some prefix (usually "xterm -e gdb | 160 // launch the utility child process with some prefix (usually "xterm -e gdb |
| 160 // --args"). | 161 // --args"). |
| 161 cmd_line->PrependWrapper(browser_command_line.GetSwitchValueNative( | 162 cmd_line->PrependWrapper(browser_command_line.GetSwitchValueNative( |
| 162 switches::kUtilityCmdPrefix)); | 163 switches::kUtilityCmdPrefix)); |
| 163 } | 164 } |
| 164 | 165 |
| 165 cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, exposed_dir_); | 166 cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, exposed_dir_); |
| 166 #endif | 167 #endif |
| 167 | 168 |
| 169 static const char* kForwardSwitches[] = { | |
| 170 switches::kEnableLogging, // Support, e.g., --enable-logging=stderr | |
|
piman
2012/10/12 17:00:33
nit: I don't think this comment adds anything. Ple
| |
| 171 switches::kV, | |
| 172 switches::kVModule, | |
| 173 }; | |
|
piman
2012/10/12 17:00:33
Could you move the flags handling above into here,
| |
| 174 cmd_line->CopySwitchesFrom(browser_command_line, kForwardSwitches, | |
| 175 arraysize(kForwardSwitches)); | |
| 176 | |
| 168 bool use_zygote = false; | 177 bool use_zygote = false; |
| 169 | 178 |
| 170 #if defined(OS_LINUX) | 179 #if defined(OS_LINUX) |
| 171 use_zygote = !no_sandbox_ && use_linux_zygote_; | 180 use_zygote = !no_sandbox_ && use_linux_zygote_; |
| 172 #endif | 181 #endif |
| 173 | 182 |
| 174 process_->Launch( | 183 process_->Launch( |
| 175 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
| 176 exposed_dir_, | 185 exposed_dir_, |
| 177 #elif defined(OS_POSIX) | 186 #elif defined(OS_POSIX) |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 191 message)); | 200 message)); |
| 192 return true; | 201 return true; |
| 193 } | 202 } |
| 194 | 203 |
| 195 void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { | 204 void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { |
| 196 BrowserThread::PostTask( | 205 BrowserThread::PostTask( |
| 197 client_thread_id_, FROM_HERE, | 206 client_thread_id_, FROM_HERE, |
| 198 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), | 207 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), |
| 199 exit_code)); | 208 exit_code)); |
| 200 } | 209 } |
| OLD | NEW |