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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 process = base::LaunchProcess(*cmd_line, options); | 434 process = base::LaunchProcess(*cmd_line, options); |
435 | 435 |
436 #if defined(OS_MACOSX) | 436 #if defined(OS_MACOSX) |
437 if (ShouldEnableBootstrapSandbox() && | 437 if (ShouldEnableBootstrapSandbox() && |
438 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { | 438 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { |
439 GetBootstrapSandbox()->FinishedFork(process.Handle()); | 439 GetBootstrapSandbox()->FinishedFork(process.Handle()); |
440 } | 440 } |
441 | 441 |
442 if (process.IsValid()) | 442 if (process.IsValid()) |
443 broker->AddPlaceholderForPid(process.pid(), child_process_id); | 443 broker->AddPlaceholderForPid(process.Pid(), child_process_id); |
444 | 444 |
445 // After updating the broker, release the lock and let the child's | 445 // After updating the broker, release the lock and let the child's |
446 // messasge be processed on the broker's thread. | 446 // messasge be processed on the broker's thread. |
447 broker->GetLock().Release(); | 447 broker->GetLock().Release(); |
448 #endif // defined(OS_MACOSX) | 448 #endif // defined(OS_MACOSX) |
449 } | 449 } |
450 #endif // else defined(OS_POSIX) | 450 #endif // else defined(OS_POSIX) |
451 #if !defined(OS_ANDROID) | 451 #if !defined(OS_ANDROID) |
452 if (process.IsValid()) | 452 if (process.IsValid()) |
453 RecordHistograms(begin_launch_time); | 453 RecordHistograms(begin_launch_time); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 context_->SetProcessBackgrounded(background); | 604 context_->SetProcessBackgrounded(background); |
605 } | 605 } |
606 | 606 |
607 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 607 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
608 bool terminate_on_shutdown) { | 608 bool terminate_on_shutdown) { |
609 if (context_.get()) | 609 if (context_.get()) |
610 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 610 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
611 } | 611 } |
612 | 612 |
613 } // namespace content | 613 } // namespace content |
OLD | NEW |