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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Issue 2546423002: [Try # 3] Scheduler refactoring to virtually eliminate redundant DoWorks (Closed)
Patch Set: Rebased Created 3 years, 11 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: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
index 94694b6b54e2884ab4580436370ed988d28582f6..762f079bfccb32600c6b51b777f00741c92f19d8 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -336,7 +336,7 @@ void TaskQueueImpl::PushOntoImmediateIncomingQueueLocked(
RunsTasksOnCurrentThread() &&
(!IsQueueEnabled() || main_thread_only().current_fence);
any_thread().task_queue_manager->OnQueueHasIncomingImmediateWork(
- this, queue_is_blocked);
+ this, sequence_number, queue_is_blocked);
any_thread().time_domain->OnQueueHasImmediateWork(this);
}
any_thread().immediate_incoming_queue.emplace_back(
@@ -678,6 +678,16 @@ bool TaskQueueImpl::BlockedByFence() const {
main_thread_only().current_fence;
}
+bool TaskQueueImpl::CouldTaskRun(EnqueueOrder enqueue_order) const {
+ if (!IsQueueEnabled())
+ return false;
+
+ if (!main_thread_only().current_fence)
+ return true;
+
+ return enqueue_order < main_thread_only().current_fence;
+}
+
EnqueueOrder TaskQueueImpl::GetFenceForTest() const {
return main_thread_only().current_fence;
}

Powered by Google App Engine
This is Rietveld 408576698