| 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/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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 MachBroker* broker = MachBroker::GetInstance(); | 281 MachBroker* broker = MachBroker::GetInstance(); |
| 282 broker->GetLock().Acquire(); | 282 broker->GetLock().Acquire(); |
| 283 | 283 |
| 284 // Make sure the MachBroker is running, and inform it to expect a | 284 // Make sure the MachBroker is running, and inform it to expect a |
| 285 // check-in from the new process. | 285 // check-in from the new process. |
| 286 broker->EnsureRunning(); | 286 broker->EnsureRunning(); |
| 287 | 287 |
| 288 const int bootstrap_sandbox_policy = delegate->GetSandboxType(); | 288 const int bootstrap_sandbox_policy = delegate->GetSandboxType(); |
| 289 if (ShouldEnableBootstrapSandbox() && | 289 if (ShouldEnableBootstrapSandbox() && |
| 290 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { | 290 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { |
| 291 options.replacement_bootstrap_name = |
| 292 GetBootstrapSandbox()->server_bootstrap_name(); |
| 291 GetBootstrapSandbox()->PrepareToForkWithPolicy( | 293 GetBootstrapSandbox()->PrepareToForkWithPolicy( |
| 292 bootstrap_sandbox_policy); | 294 bootstrap_sandbox_policy); |
| 293 } | 295 } |
| 294 #endif // defined(OS_MACOSX) | 296 #endif // defined(OS_MACOSX) |
| 295 | 297 |
| 296 bool launched = base::LaunchProcess(*cmd_line, options, &handle); | 298 bool launched = base::LaunchProcess(*cmd_line, options, &handle); |
| 297 if (!launched) | 299 if (!launched) |
| 298 handle = base::kNullProcessHandle; | 300 handle = base::kNullProcessHandle; |
| 299 | 301 |
| 300 #if defined(OS_MACOSX) | 302 #if defined(OS_MACOSX) |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 GetHandle(), background)); | 517 GetHandle(), background)); |
| 516 } | 518 } |
| 517 | 519 |
| 518 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 520 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 519 bool terminate_on_shutdown) { | 521 bool terminate_on_shutdown) { |
| 520 if (context_.get()) | 522 if (context_.get()) |
| 521 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 523 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 522 } | 524 } |
| 523 | 525 |
| 524 } // namespace content | 526 } // namespace content |
| OLD | NEW |