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

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

Issue 2017763003: Suspend more task queues for background renderers (experimental) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Sami's review 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
« no previous file with comments | « components/scheduler/renderer/renderer_scheduler_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9936a69f9fa5b9489f626e9bc478d8b8048f80a0..a09d89dc0ee541b20460cf5e620519897704dd89 100644
--- a/components/scheduler/renderer/renderer_scheduler_impl.cc
+++ b/components/scheduler/renderer/renderer_scheduler_impl.cc
@@ -119,6 +119,7 @@ RendererSchedulerImpl::MainThreadOnly::MainThreadOnly(
expensive_task_policy(ExpensiveTaskPolicy::RUN),
renderer_hidden(false),
renderer_backgrounded(false),
+ renderer_suspended(false),
timer_queue_suspension_when_backgrounded_enabled(false),
timer_queue_suspended_when_backgrounded(false),
was_shutdown(false),
@@ -832,6 +833,11 @@ void RendererSchedulerImpl::UpdatePolicyLocked(UpdateType update_type) {
new_policy.timer_queue_policy.is_enabled = false;
}
+ if (MainThreadOnly().renderer_suspended) {
+ new_policy.loading_queue_policy.is_enabled = false;
+ DCHECK(!new_policy.timer_queue_policy.is_enabled);
+ }
+
// Tracing is done before the early out check, because it's quite possible we
// will otherwise miss this information in traces.
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
@@ -1214,6 +1220,7 @@ void RendererSchedulerImpl::SuspendTimerQueueWhenBackgrounded() {
return;
MainThreadOnly().timer_queue_suspended_when_backgrounded = true;
+ MainThreadOnly().renderer_suspended = true;
Sami 2016/05/31 10:11:21 I guess this is just for testing, but ultimately y
hajimehoshi 2016/05/31 11:10:07 Ah, this was my mistake: Setting this variable sho
ForceUpdatePolicy();
}
@@ -1223,6 +1230,7 @@ void RendererSchedulerImpl::ResumeTimerQueueWhenForegrounded() {
return;
MainThreadOnly().timer_queue_suspended_when_backgrounded = false;
+ MainThreadOnly().renderer_suspended = false;
ForceUpdatePolicy();
}
« no previous file with comments | « components/scheduler/renderer/renderer_scheduler_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698