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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 496 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
497 zygote_, | 497 zygote_, |
498 #endif | 498 #endif |
499 base::Passed(&process_))); | 499 base::Passed(&process_))); |
500 } | 500 } |
501 | 501 |
502 // static | 502 // static |
503 void ChildProcessLauncher::Context::SetProcessBackgroundedInternal( | 503 void ChildProcessLauncher::Context::SetProcessBackgroundedInternal( |
504 base::Process process, | 504 base::Process process, |
505 bool background) { | 505 bool background) { |
506 #if defined(OS_MACOSX) | |
507 MachBroker* broker = MachBroker::GetInstance(); | |
508 process.SetProcessBackgrounded(broker->TaskForPid(process.Pid()), background); | |
gab
2015/03/09 15:34:50
To analyze the impact of this you'll want to put t
| |
509 #else | |
506 process.SetProcessBackgrounded(background); | 510 process.SetProcessBackgrounded(background); |
511 #endif // defined(OS_MACOSX) | |
507 #if defined(OS_ANDROID) | 512 #if defined(OS_ANDROID) |
508 SetChildProcessInForeground(process.Handle(), !background); | 513 SetChildProcessInForeground(process.Handle(), !background); |
509 #endif | 514 #endif |
510 } | 515 } |
511 | 516 |
512 // static | 517 // static |
513 void ChildProcessLauncher::Context::TerminateInternal( | 518 void ChildProcessLauncher::Context::TerminateInternal( |
514 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 519 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
515 bool zygote, | 520 bool zygote, |
516 #endif | 521 #endif |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 context_->SetProcessBackgrounded(background); | 600 context_->SetProcessBackgrounded(background); |
596 } | 601 } |
597 | 602 |
598 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 603 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
599 bool terminate_on_shutdown) { | 604 bool terminate_on_shutdown) { |
600 if (context_.get()) | 605 if (context_.get()) |
601 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 606 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
602 } | 607 } |
603 | 608 |
604 } // namespace content | 609 } // namespace content |
OLD | NEW |