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

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

Issue 305533006: Control process backgrounding from within the child process on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Disable test. Created 6 years, 7 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
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 ef0fea26dba8b8e0b20ed6cf2c16d23d0ed90dc9..9225a30a7fd2f19f35d9618afe9c1a14f9de7f27 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1969,9 +1969,16 @@ void RenderProcessHostImpl::SetBackgrounded(bool backgrounded) {
// is to not invoke the SetPriorityClass API if the dll is loaded.
if (GetModuleHandle(L"cbstext.dll"))
return;
-#endif // OS_WIN
+ // Windows Vista+ has a fancy process backgrounding mode that can only be set
+ // from within the process. So notify the child process of background state.
+ Send(new ChildProcessMsg_SetProcessBackgrounded(backgrounded));
+#else
+
+ // Backgrounding may require elevated privileges not available to renderer
+ // processes, so control backgrounding from the process host.
child_process_launcher_->SetProcessBackgrounded(backgrounded);
+#endif // OS_WIN
}
void RenderProcessHostImpl::OnProcessLaunched() {
@@ -1988,7 +1995,7 @@ void RenderProcessHostImpl::OnProcessLaunched() {
return;
}
- child_process_launcher_->SetProcessBackgrounded(backgrounded_);
+ SetBackgrounded(backgrounded_);
}
// NOTE: This needs to be before sending queued messages because
« no previous file with comments | « chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc ('k') | content/child/child_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698