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

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: Created 4 years, 8 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 f241d7bb755b5c2ca1f66aeb42c9d38581ed7d3f..9f3bbd9548f009fe8ebf06d7e356474dcacbcc0e 100644
--- a/components/scheduler/renderer/renderer_scheduler_impl.cc
+++ b/components/scheduler/renderer/renderer_scheduler_impl.cc
@@ -384,6 +384,14 @@ void RendererSchedulerImpl::OnRendererForegrounded() {
ResumeTimerQueueWhenForegrounded();
}
+void RendererSchedulerImpl::OnRendererPurgeAndSuspend() {
+ helper_.CheckOnValidThread();
+ if (helper_.IsShutdown() || !MainThreadOnly().renderer_backgrounded)
Sami 2016/04/27 15:44:43 We should probably cancel suspend_timers_when_back
hajimehoshi 2016/04/28 10:26:58 Done.
+ return;
+ // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077)
Sami 2016/04/27 15:44:43 Have you thought about what kind of interfaces wou
hajimehoshi 2016/04/28 10:26:58 Right. Moved this comment to RenderThreadImpl and
+ SuspendTimerQueueWhenBackgrounded();
Sami 2016/04/27 15:44:43 We should think about whether we need to suspend o
hajimehoshi 2016/04/28 10:26:58 Good point, we might need to do what you suggest.
+}
+
void RendererSchedulerImpl::EndIdlePeriod() {
if (MainThreadOnly().in_idle_period_for_testing)
return;
« no previous file with comments | « components/scheduler/renderer/renderer_scheduler_impl.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698