| OLD | NEW |
| 1 // Copyright (c) 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } else | 262 } else |
| 263 #endif // !OS_MACOSX | 263 #endif // !OS_MACOSX |
| 264 base::EnsureProcessTerminated(process.Pass()); | 264 base::EnsureProcessTerminated(process.Pass()); |
| 265 #endif // OS_POSIX | 265 #endif // OS_POSIX |
| 266 #endif // defined(OS_ANDROID) | 266 #endif // defined(OS_ANDROID) |
| 267 } | 267 } |
| 268 | 268 |
| 269 void SetProcessBackgroundedOnLauncherThread(base::Process process, | 269 void SetProcessBackgroundedOnLauncherThread(base::Process process, |
| 270 bool background) { | 270 bool background) { |
| 271 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); | 271 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); |
| 272 #if defined(OS_MACOSX) |
| 273 MachBroker* broker = MachBroker::GetInstance(); |
| 274 process.SetProcessBackgrounded(broker->TaskForPid(process.Pid()), background); |
| 275 #else |
| 272 process.SetProcessBackgrounded(background); | 276 process.SetProcessBackgrounded(background); |
| 277 #endif // defined(OS_MACOSX) |
| 273 #if defined(OS_ANDROID) | 278 #if defined(OS_ANDROID) |
| 274 SetChildProcessInForeground(process.Handle(), !background); | 279 SetChildProcessInForeground(process.Handle(), !background); |
| 275 #endif | 280 #endif |
| 276 } | 281 } |
| 277 | 282 |
| 278 } // anonymous namespace | 283 } // anonymous namespace |
| 279 | 284 |
| 280 ChildProcessLauncher::ChildProcessLauncher( | 285 ChildProcessLauncher::ChildProcessLauncher( |
| 281 SandboxedProcessLauncherDelegate* delegate, | 286 SandboxedProcessLauncherDelegate* delegate, |
| 282 base::CommandLine* cmd_line, | 287 base::CommandLine* cmd_line, |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 498 } |
| 494 | 499 |
| 495 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 500 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
| 496 Client* client) { | 501 Client* client) { |
| 497 Client* ret = client_; | 502 Client* ret = client_; |
| 498 client_ = client; | 503 client_ = client; |
| 499 return ret; | 504 return ret; |
| 500 } | 505 } |
| 501 | 506 |
| 502 } // namespace content | 507 } // namespace content |
| OLD | NEW |