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

Unified Diff: content/child/child_thread_impl.cc

Issue 1133143003: [Android] Suspend shared timers for hidden renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_remove_suspend
Patch Set: Move logic to the scheduler Created 5 years, 4 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/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 3978af0b74a438b49b1758b62803fa11f0f28ca1..d1766e7c995d4552398dde73423542fb95defc26 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -627,6 +627,14 @@ bool ChildThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
return false;
}
+void ChildThreadImpl::OnProcessBackgrounded(bool backgrounded) {
Sami 2015/08/28 14:15:01 Nothing changed here -- you just moved this around
jdduke (slow) 2015/08/31 18:36:08 Yep, moved it to preserve ordering as I moved the
+ // Set timer slack to maximum on main thread when in background.
+ base::TimerSlack timer_slack = base::TIMER_SLACK_NONE;
+ if (backgrounded)
+ timer_slack = base::TIMER_SLACK_MAXIMUM;
+ base::MessageLoop::current()->SetTimerSlack(timer_slack);
+}
+
void ChildThreadImpl::OnShutdown() {
base::MessageLoop::current()->Quit();
}
@@ -705,12 +713,4 @@ bool ChildThreadImpl::IsInBrowserProcess() const {
return browser_process_io_runner_;
}
-void ChildThreadImpl::OnProcessBackgrounded(bool background) {
- // Set timer slack to maximum on main thread when in background.
- base::TimerSlack timer_slack = base::TIMER_SLACK_NONE;
- if (background)
- timer_slack = base::TIMER_SLACK_MAXIMUM;
- base::MessageLoop::current()->SetTimerSlack(timer_slack);
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698