Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/browser/child_process_launcher.cc

Issue 2454073003: Allow backgrounding processes on Mac (Closed)
Patch Set: Address review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/sampling/task_group_sampler.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698