Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc |
| diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc |
| index 350cf27aeda21ebf609921dd9dda65315bc0e88f..4bc43446b22dee9eb15549bec7fb355ff4a3e54a 100644 |
| --- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc |
| +++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc |
| @@ -317,23 +317,28 @@ TaskQueueThrottler::~TaskQueueThrottler() { |
| void TaskQueueThrottler::SetQueueEnabled(TaskQueue* task_queue, bool enabled) { |
| TaskQueueMap::iterator find_it = queue_details_.find(task_queue); |
| + // If TaskQueueThrottler does not know about this queue, just call |
|
alex clarke (OOO till 29th)
2016/11/24 14:45:07
Please add a comment in here saying:
Both the Tas
altimin
2016/11/24 15:00:55
Done.
|
| + // SetQueueEnabled directly. |
| if (find_it == queue_details_.end()) { |
| task_queue->SetQueueEnabled(enabled); |
| return; |
| } |
| + // Even when this queue is not throttled by task queue throttler, we |
|
alex clarke (OOO till 29th)
2016/11/24 14:45:07
Maybe:
// Remember the caller's preference so we
altimin
2016/11/24 15:00:55
Done.
|
| + // need to remember this setting for the times when it wil.. |
| find_it->second.enabled = enabled; |
| + // If this queue is not throttled by task queue throttler, just call |
| + // SetQueueEnabled directly. |
| if (!find_it->second.IsThrottled()) { |
| task_queue->SetQueueEnabled(enabled); |
| return; |
| } |
| - // We don't enable the queue here because it's throttled and there might be |
| - // tasks in it's work queue that would execute immediatly rather than after |
| - // PumpThrottledTasks runs. |
| - if (!enabled) { |
| - task_queue->SetQueueEnabled(false); |
| + // Task queue should be disabled here because it is throttled. |
| + // If it is enabled, a call to PumpThrottledTask will be scheduled. |
| + task_queue->SetQueueEnabled(false); |
|
alex clarke (OOO till 29th)
2016/11/24 14:45:07
That doesn't look right to me. I think it should
altimin
2016/11/24 15:00:55
That's intentional. Even when queue is enabled, we
|
| + if (enabled) { |
| MaybeSchedulePumpQueue(FROM_HERE, tick_clock_->NowTicks(), task_queue, |
| base::nullopt); |
| } |