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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2454073003: Allow backgrounding processes on Mac (Closed)
Patch Set: Remove unnecessary forward declare 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/child_process_launcher.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 92a3b0e78fe265556e83dffefe4b08d7d26d56ae..76c31cba3a3777e7f3a01d025b15220c04b46b5a 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -38,8 +38,10 @@
#include "content/public/common/sandbox_init.h"
#include "sandbox/win/src/sandbox_types.h"
#elif defined(OS_MACOSX)
+#include "base/feature_list.h"
#include "content/browser/bootstrap_sandbox_manager_mac.h"
#include "content/browser/mach_broker_mac.h"
+#include "content/public/common/content_features.h"
#include "sandbox/mac/bootstrap_sandbox.h"
#include "sandbox/mac/pre_exec_delegate.h"
#elif defined(OS_ANDROID)
@@ -385,7 +387,12 @@ void SetProcessBackgroundedOnLauncherThread(base::Process process,
bool background) {
DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER);
if (process.CanBackgroundProcesses()) {
+#if defined(OS_MACOSX)
+ if (base::FeatureList::IsEnabled(features::kMacBackgroundInactiveTabs))
shrike 2016/10/31 17:26:05 Is this the only place you need to check for the e
lgrey 2016/10/31 19:22:02 Moved to CanBackgroundProcesses and moved the feat
+ process.SetProcessBackgrounded(MachBroker::GetInstance(), background);
+#else
process.SetProcessBackgrounded(background);
+#endif // defined(OS_MACOSX)
}
#if defined(OS_ANDROID)
SetChildProcessInForeground(process.Handle(), !background);

Powered by Google App Engine
This is Rietveld 408576698