| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
| 6 | 6 |
| 7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // This call to |PrepareForFork()| will start the MachBroker listener | 167 // This call to |PrepareForFork()| will start the MachBroker listener |
| 168 // thread, if it is not already running. Therefore the browser process | 168 // thread, if it is not already running. Therefore the browser process |
| 169 // will be listening for Mach IPC before LaunchProcess() is called. | 169 // will be listening for Mach IPC before LaunchProcess() is called. |
| 170 broker->PrepareForFork(); | 170 broker->PrepareForFork(); |
| 171 #endif | 171 #endif |
| 172 | 172 |
| 173 // Actually launch the app. | 173 // Actually launch the app. |
| 174 base::LaunchOptions options; | 174 base::LaunchOptions options; |
| 175 options.environ = &env; | 175 options.environ = &env; |
| 176 options.fds_to_remap = &fds_to_map; | 176 options.fds_to_remap = &fds_to_map; |
| 177 options.process_handle = &handle; | 177 launched = base::LaunchProcess(*cmd_line, options, &handle); |
| 178 launched = base::LaunchProcess(*cmd_line, options); | |
| 179 | 178 |
| 180 #if defined(OS_MACOSX) | 179 #if defined(OS_MACOSX) |
| 181 if (launched) | 180 if (launched) |
| 182 broker->AddPlaceholderForPid(handle); | 181 broker->AddPlaceholderForPid(handle); |
| 183 } // end scope for AutoLock | 182 } // end scope for AutoLock |
| 184 #endif | 183 #endif |
| 185 if (!launched) | 184 if (!launched) |
| 186 handle = base::kNullProcessHandle; | 185 handle = base::kNullProcessHandle; |
| 187 } | 186 } |
| 188 #endif // else defined(OS_POSIX) | 187 #endif // else defined(OS_POSIX) |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 372 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
| 374 background)); | 373 background)); |
| 375 } | 374 } |
| 376 | 375 |
| 377 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 376 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 378 bool terminate_on_shutdown) { | 377 bool terminate_on_shutdown) { |
| 379 if (context_) | 378 if (context_) |
| 380 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 379 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 381 } | 380 } |
| 382 | 381 |
| OLD | NEW |