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

Unified Diff: components/scheduler/renderer/renderer_scheduler_impl.cc

Issue 1914143002: Experimental 'purging and suspending' backgrounded tabs behind the flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on reviews Created 4 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: components/scheduler/renderer/renderer_scheduler_impl.cc
diff --git a/components/scheduler/renderer/renderer_scheduler_impl.cc b/components/scheduler/renderer/renderer_scheduler_impl.cc
index 3ae7991381cf6b59f152c4dbce6d4b3b2a3a95e5..7d9ef4ff7a8c31f4a4eb62a00b3027dd7d2e31ef 100644
--- a/components/scheduler/renderer/renderer_scheduler_impl.cc
+++ b/components/scheduler/renderer/renderer_scheduler_impl.cc
@@ -387,6 +387,15 @@ void RendererSchedulerImpl::OnRendererForegrounded() {
ResumeTimerQueueWhenForegrounded();
}
+void RendererSchedulerImpl::SuspendRenderer() {
+ helper_.CheckOnValidThread();
+ DCHECK(MainThreadOnly().renderer_backgrounded);
+ if (helper_.IsShutdown())
+ return;
+ suspend_timers_when_backgrounded_closure_.Cancel();
Sami 2016/05/12 11:31:35 Could you add a TODO about possibly suspending oth
hajimehoshi 2016/05/13 06:07:45 Done.
+ SuspendTimerQueueWhenBackgrounded();
+}
+
void RendererSchedulerImpl::EndIdlePeriod() {
if (MainThreadOnly().in_idle_period_for_testing)
return;

Powered by Google App Engine
This is Rietveld 408576698