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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h

Issue 2653643002: Move has_incoming_immediate_work to the TaskQueueManager (Closed)
Patch Set: Don't try to be quite so clever in TaskQueueManager::ComputeDelayTillNextTask 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_manager.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
index 76103b4bf68f2f575b8e6ce3ac3ce0de37ddcc91..801682779e7a8d1e5dae8293f92cfe8533691fc0 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
@@ -180,7 +180,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueManager
// Delayed Tasks with run_times <= Now() are enqueued onto the work queue and
// reloads any empty work queues.
- void UpdateWorkQueues(LazyNow* lazy_now);
+ void WakeupReadyDelayedQueues(LazyNow* lazy_now);
// Chooses the next work queue to service. Returns true if |out_queue|
// indicates the queue from which the next task should be run, false to
@@ -222,6 +222,17 @@ class BLINK_PLATFORM_EXPORT TaskQueueManager
AsValueWithSelectorResult(bool should_run,
internal::WorkQueue* selected_work_queue) const;
+ // Adds |queue| to |any_thread().has_incoming_immediate_work_| and if
+ // |queue_is_blocked| is false it makes sure a DoWork is posted.
+ // Can be called from any thread.
+ void OnQueueHasIncomingImmediateWork(internal::TaskQueueImpl* queue,
+ bool queue_is_blocked);
+
+ // Calls |ReloadImmediateWorkQueueIfEmpty| on all queues in
+ // |queues_to_reload|.
+ void ReloadEmptyWorkQueues(const std::unordered_set<internal::TaskQueueImpl*>&
+ queues_to_reload) const;
+
std::set<TimeDomain*> time_domains_;
std::unique_ptr<RealTimeDomain> real_time_domain_;
@@ -250,6 +261,9 @@ class BLINK_PLATFORM_EXPORT TaskQueueManager
struct AnyThread {
AnyThread();
+ // Set of task queues with newly available work on the incoming queue.
+ std::unordered_set<internal::TaskQueueImpl*> has_incoming_immediate_work;
+
bool other_thread_pending_wakeup;
};

Powered by Google App Engine
This is Rietveld 408576698