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

Unified Diff: content/browser/child_process_launcher.cc

Issue 989703002: Add support for backgrounding processes on the Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile issue, wrap process backgrounding in an experiment Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« base/process/process_mac.cc ('K') | « base/process/process_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/child_process_launcher.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index e5c93ee3562bbecd378d96c671d77c4fe219c39e..53499b99170e99b3a5feade3b8b6a8c79415f92b 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -12,6 +12,7 @@
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/process/process.h"
#include "base/synchronization/lock.h"
@@ -503,7 +504,17 @@ void ChildProcessLauncher::Context::Terminate() {
void ChildProcessLauncher::Context::SetProcessBackgroundedInternal(
base::Process process,
bool background) {
+#if defined(OS_MACOSX)
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find("BackgroundMacRendererProcesses");
Alexei Svitkine (slow) 2015/03/11 15:30:54 Nit: You can just use FindFullName() and then the
shrike 2015/03/11 21:38:21 Done.
+ if (trial && trial->group_name() == "On") {
gab 2015/03/10 12:33:02 I would suggest taking this path by default in the
shrike 2015/03/10 18:00:33 OK. Will Finch flags be available soon enough afte
gab 2015/03/10 19:43:50 Yes, Finch is brought up before creating any threa
Alexei Svitkine (slow) 2015/03/11 15:30:54 Correct.
+ MachBroker* broker = MachBroker::GetInstance();
+ process.SetProcessBackgrounded(broker->TaskForPid(process.Pid()),
+ background);
+ }
+#else
process.SetProcessBackgrounded(background);
+#endif // defined(OS_MACOSX)
#if defined(OS_ANDROID)
SetChildProcessInForeground(process.Handle(), !background);
#endif
« base/process/process_mac.cc ('K') | « base/process/process_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698