| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 #endif // !OS_MACOSX | 378 #endif // !OS_MACOSX |
| 379 base::EnsureProcessTerminated(std::move(process)); | 379 base::EnsureProcessTerminated(std::move(process)); |
| 380 #endif // OS_POSIX | 380 #endif // OS_POSIX |
| 381 #endif // defined(OS_ANDROID) | 381 #endif // defined(OS_ANDROID) |
| 382 } | 382 } |
| 383 | 383 |
| 384 void SetProcessBackgroundedOnLauncherThread(base::Process process, | 384 void SetProcessBackgroundedOnLauncherThread(base::Process process, |
| 385 bool background) { | 385 bool background) { |
| 386 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); | 386 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); |
| 387 if (process.CanBackgroundProcesses()) { | 387 if (process.CanBackgroundProcesses()) { |
| 388 #if defined(OS_MACOSX) |
| 389 process.SetProcessBackgrounded(MachBroker::GetInstance(), background); |
| 390 #else |
| 388 process.SetProcessBackgrounded(background); | 391 process.SetProcessBackgrounded(background); |
| 392 #endif // defined(OS_MACOSX) |
| 389 } | 393 } |
| 390 #if defined(OS_ANDROID) | 394 #if defined(OS_ANDROID) |
| 391 SetChildProcessInForeground(process.Handle(), !background); | 395 SetChildProcessInForeground(process.Handle(), !background); |
| 392 #endif | 396 #endif |
| 393 } | 397 } |
| 394 | 398 |
| 395 } // namespace | 399 } // namespace |
| 396 | 400 |
| 397 ChildProcessLauncher::ChildProcessLauncher( | 401 ChildProcessLauncher::ChildProcessLauncher( |
| 398 SandboxedProcessLauncherDelegate* delegate, | 402 SandboxedProcessLauncherDelegate* delegate, |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 } | 626 } |
| 623 | 627 |
| 624 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 628 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
| 625 Client* client) { | 629 Client* client) { |
| 626 Client* ret = client_; | 630 Client* ret = client_; |
| 627 client_ = client; | 631 client_ = client; |
| 628 return ret; | 632 return ret; |
| 629 } | 633 } |
| 630 | 634 |
| 631 } // namespace content | 635 } // namespace content |
| OLD | NEW |