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

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: Fix other platforms. 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
« no previous file with comments | « no previous file | content/child/child_thread.h » ('j') | content/child/child_thread.cc » ('J')
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 6f45e67a50e8481e5fb2a3df79722d87ca6108d7..24ab01ccd921b533b83f2ffeb857bec6477007a6 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1947,9 +1947,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() {
@@ -1966,7 +1973,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 | « no previous file | content/child/child_thread.h » ('j') | content/child/child_thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698