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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 926663002: Handle RenderProcessHostImpl::SetBackgrounded on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@908473002_ps2
Patch Set: as an experiment Created 5 years, 10 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
« no previous file with comments | « chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 00d37918c961f27e71f9367671ac5ca4d9840154..fc4851d0bf72a845f3cd493dcc0cd9c3f48b38fc 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2205,17 +2205,25 @@ void RenderProcessHostImpl::SetBackgrounded(bool backgrounded) {
return;
#endif // OS_WIN
+#if defined(OS_WIN)
+ // Same as below, but bound to an experiment initially on Windows
+ // (http://crbug.com/458594). Enabled by default in the asbence of field
+ // trials to get coverage on the perf waterfall.
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find("BackgroundRendererProcesses");
+ if (!trial || trial->group_name() != "Disallow")
+ child_process_launcher_->SetProcessBackgrounded(backgrounded);
+#else
+ // Control the background state from the browser process, otherwise the task
+ // telling the renderer to "unbackground" itself may be preempted by other
+ // tasks executing at lowered priority ahead of it or simply by not being
+ // switfly scheduled by the OS per the low process priority
jam 2015/02/17 23:15:25 nit: swiftly
gab 2015/02/18 14:42:22 Done.
+ // (http://crbug.com/398103).
+ child_process_launcher_->SetProcessBackgrounded(backgrounded);
+#endif // OS_WIN
+
// Notify the child process of background state.
Send(new ChildProcessMsg_SetProcessBackgrounded(backgrounded));
-
-#if !defined(OS_WIN)
- // Backgrounding may require elevated privileges not available to renderer
- // processes, so control backgrounding from the process host.
-
- // Windows Vista+ has a fancy process backgrounding mode that can only be set
- // from within the process.
- child_process_launcher_->SetProcessBackgrounded(backgrounded);
-#endif // !OS_WIN
}
void RenderProcessHostImpl::OnProcessLaunched() {
« no previous file with comments | « chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698