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

Unified Diff: content/browser/renderer_host/render_process_host_impl.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/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 8646cc48d900ccecd4baf34320e918edc44c6857..13daab69b11b8f5b49861e381f51586a495789c9 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2805,14 +2805,20 @@ void RenderProcessHostImpl::OnProcessLaunched() {
// Not all platforms launch processes in the same backgrounded state. Make
// sure |is_process_backgrounded_| reflects this platform's initial process
// state.
+#if defined(OS_MACOSX)
+ is_process_backgrounded_ =
+ child_process_launcher_->GetProcess().IsProcessBackgrounded(
+ MachBroker::GetInstance());
+#else
is_process_backgrounded_ =
child_process_launcher_->GetProcess().IsProcessBackgrounded();
+#endif // defined(OS_MACOSX)
- // Disable updating process priority on startup for now as it incorrectly
- // results in backgrounding foreground navigations until their first commit
- // is made. A better long term solution would be to be aware of the tab's
- // visibility at this point. https://crbug.com/560446.
- // Except on Android for now because of https://crbug.com/601184 :-(.
+// Disable updating process priority on startup for now as it incorrectly
shrike 2016/10/31 17:26:05 It seems like this comment should stay at its curr
lgrey 2016/10/31 19:22:02 This was from git cl format. Is it OK to override
shrike 2016/10/31 20:32:36 As long as your change follows the spec it should
Nico 2016/11/01 02:07:27 `git cl format` aligns comments in front of a prep
+// results in backgrounding foreground navigations until their first commit
+// is made. A better long term solution would be to be aware of the tab's
+// visibility at this point. https://crbug.com/560446.
+// Except on Android for now because of https://crbug.com/601184 :-(.
#if defined(OS_ANDROID)
UpdateProcessPriority();
#endif

Powered by Google App Engine
This is Rietveld 408576698