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 "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/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } else | 306 } else |
307 #endif // !OS_MACOSX | 307 #endif // !OS_MACOSX |
308 base::EnsureProcessTerminated(process.Pass()); | 308 base::EnsureProcessTerminated(process.Pass()); |
309 #endif // OS_POSIX | 309 #endif // OS_POSIX |
310 #endif // defined(OS_ANDROID) | 310 #endif // defined(OS_ANDROID) |
311 } | 311 } |
312 | 312 |
313 void SetProcessBackgroundedOnLauncherThread(base::Process process, | 313 void SetProcessBackgroundedOnLauncherThread(base::Process process, |
314 bool background) { | 314 bool background) { |
315 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); | 315 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); |
316 process.SetProcessBackgrounded(background); | 316 if (process.CanBackgroundProcesses()) { |
| 317 process.SetProcessBackgrounded(background); |
| 318 } |
317 #if defined(OS_ANDROID) | 319 #if defined(OS_ANDROID) |
318 SetChildProcessInForeground(process.Handle(), !background); | 320 SetChildProcessInForeground(process.Handle(), !background); |
319 #endif | 321 #endif |
320 } | 322 } |
321 | 323 |
322 } // anonymous namespace | 324 } // anonymous namespace |
323 | 325 |
324 ChildProcessLauncher::ChildProcessLauncher( | 326 ChildProcessLauncher::ChildProcessLauncher( |
325 SandboxedProcessLauncherDelegate* delegate, | 327 SandboxedProcessLauncherDelegate* delegate, |
326 base::CommandLine* cmd_line, | 328 base::CommandLine* cmd_line, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 543 } |
542 | 544 |
543 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 545 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
544 Client* client) { | 546 Client* client) { |
545 Client* ret = client_; | 547 Client* ret = client_; |
546 client_ = client; | 548 client_ = client; |
547 return ret; | 549 return ret; |
548 } | 550 } |
549 | 551 |
550 } // namespace content | 552 } // namespace content |
OLD | NEW |