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/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
| 6 | 6 |
| 7 #include <string> | |
|
Charlie Reis
2014/11/10 19:57:25
Is this necessary?
sramajay
2014/11/11 14:16:05
Done.
| |
| 7 #include <utility> // For std::pair. | 8 #include <utility> // For std::pair. |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 12 #include "base/files/scoped_file.h" | 13 #include "base/files/scoped_file.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 16 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 if (!launched) | 313 if (!launched) |
| 313 handle = base::kNullProcessHandle; | 314 handle = base::kNullProcessHandle; |
| 314 | 315 |
| 315 #if defined(OS_MACOSX) | 316 #if defined(OS_MACOSX) |
| 316 if (ShouldEnableBootstrapSandbox() && | 317 if (ShouldEnableBootstrapSandbox() && |
| 317 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { | 318 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { |
| 318 GetBootstrapSandbox()->FinishedFork(handle); | 319 GetBootstrapSandbox()->FinishedFork(handle); |
| 319 } | 320 } |
| 320 | 321 |
| 321 if (launched) | 322 if (launched) |
| 322 broker->AddPlaceholderForPid(handle); | 323 broker->AddPlaceholderForPid(handle, child_process_id); |
| 323 | 324 |
| 324 // After updating the broker, release the lock and let the child's | 325 // After updating the broker, release the lock and let the child's |
| 325 // messasge be processed on the broker's thread. | 326 // messasge be processed on the broker's thread. |
| 326 broker->GetLock().Release(); | 327 broker->GetLock().Release(); |
| 327 #endif // defined(OS_MACOSX) | 328 #endif // defined(OS_MACOSX) |
| 328 } | 329 } |
| 329 #endif // else defined(OS_POSIX) | 330 #endif // else defined(OS_POSIX) |
| 330 #if !defined(OS_ANDROID) | 331 #if !defined(OS_ANDROID) |
| 331 if (handle) | 332 if (handle) |
| 332 RecordHistograms(begin_launch_time); | 333 RecordHistograms(begin_launch_time); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 524 context_->SetProcessBackgrounded(background); | 525 context_->SetProcessBackgrounded(background); |
| 525 } | 526 } |
| 526 | 527 |
| 527 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 528 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 528 bool terminate_on_shutdown) { | 529 bool terminate_on_shutdown) { |
| 529 if (context_.get()) | 530 if (context_.get()) |
| 530 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 531 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 531 } | 532 } |
| 532 | 533 |
| 533 } // namespace content | 534 } // namespace content |
| OLD | NEW |