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(); |
} |