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

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: Use ContentRendererClient Created 5 years, 3 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 | « content/child/child_thread_impl.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index e720fa4869dd600377d2ae6cee0305923cd7f05b..8f0d93c67c36a9dbc2261ee635b734c0143e15ea 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -660,6 +660,14 @@ bool ChildThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
return false;
}
+void ChildThreadImpl::OnProcessBackgrounded(bool backgrounded) {
+ // 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();
}
@@ -738,12 +746,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
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698