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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc

Issue 2523673003: [scheduler] Fix bug in task queue throttler (Closed)
Patch Set: Created 4 years, 1 month 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: 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 803cf4e82cba882c257e953857ff71bed594826c..58d5697300d1a88b47be07d36e7b964fd0da62f9 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
@@ -332,13 +332,10 @@ void TaskQueueThrottler::SetQueueEnabled(TaskQueue* task_queue, bool enabled) {
void TaskQueueThrottler::IncreaseThrottleRefCount(TaskQueue* task_queue) {
DCHECK_NE(task_queue, task_runner_.get());
- std::pair<TaskQueueMap::iterator, bool> insert_result =
- queue_details_.insert(std::make_pair(task_queue, Metadata()));
+ std::pair<TaskQueueMap::iterator, bool> insert_result = queue_details_.insert(
+ std::make_pair(task_queue, Metadata(0, task_queue->IsQueueEnabled())));
Sami 2016/11/22 19:27:35 0 /* ref_count */ (I had to look it up)
altimin 2016/11/23 11:11:29 Done.
if (!insert_result.first->second.IsThrottled()) {
- // The insert was successful so we need to throttle the queue.
- insert_result.first->second.enabled = task_queue->IsQueueEnabled();
-
if (allow_throttling_) {
task_queue->SetTimeDomain(time_domain_.get());
task_queue->RemoveFence();
@@ -381,6 +378,9 @@ void TaskQueueThrottler::DecreaseThrottleRefCount(TaskQueue* task_queue) {
}
bool TaskQueueThrottler::IsThrottled(TaskQueue* task_queue) const {
+ if (!allow_throttling_)
Sami 2016/11/22 19:27:35 Is this a necessary change? To me this query says
altimin 2016/11/23 11:11:29 Yes, this is the source of the bug. I think that
Sami 2016/11/23 11:52:06 I think this is still pretty confusing. Based on t
altimin 2016/11/23 14:29:17 It is very confusing indeed! I took another look a
+ return false;
+
auto find_it = queue_details_.find(task_queue);
if (find_it == queue_details_.end())
return false;

Powered by Google App Engine
This is Rietveld 408576698