| Index: content/renderer/scheduler/task_queue_manager.h
|
| diff --git a/content/renderer/scheduler/task_queue_manager.h b/content/renderer/scheduler/task_queue_manager.h
|
| index 8f32b93a0ace6674cfa227db573ca5bad6f4540d..7f4e772e95673b26732d988bd0ff30b46cf33827 100644
|
| --- a/content/renderer/scheduler/task_queue_manager.h
|
| +++ b/content/renderer/scheduler/task_queue_manager.h
|
| @@ -15,6 +15,7 @@
|
| #include "base/synchronization/lock.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "content/common/content_export.h"
|
| +#include "content/renderer/scheduler/task_queue_selector.h"
|
|
|
| namespace base {
|
| namespace trace_event {
|
| @@ -45,7 +46,8 @@ class TaskQueueSelector;
|
| // the incoming task queue (if any) are moved here. The work queues are
|
| // registered with the selector as input to the scheduling decision.
|
| //
|
| -class CONTENT_EXPORT TaskQueueManager {
|
| +class CONTENT_EXPORT TaskQueueManager
|
| + : public TaskQueueSelector::TaskQueueSelectorObserver {
|
| public:
|
| // Keep TaskQueue::PumpPolicyToString in sync with this enum.
|
| enum class PumpPolicy {
|
| @@ -71,7 +73,7 @@ class CONTENT_EXPORT TaskQueueManager {
|
| TaskQueueManager(size_t task_queue_count,
|
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
|
| TaskQueueSelector* selector);
|
| - ~TaskQueueManager();
|
| + ~TaskQueueManager() override;
|
|
|
| // Returns the task runner which targets the queue selected by |queue_index|.
|
| scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForQueue(
|
| @@ -113,6 +115,9 @@ class CONTENT_EXPORT TaskQueueManager {
|
|
|
| void SetTimeSourceForTesting(scoped_refptr<cc::TestNowSource> time_source);
|
|
|
| + // TaskQueueSelectorObserver implementation
|
| + void OnTaskQueueEnabled() override;
|
| +
|
| private:
|
| friend class internal::TaskQueue;
|
|
|
| @@ -128,13 +133,14 @@ class CONTENT_EXPORT TaskQueueManager {
|
| // Use the selector to choose a pending task and run it.
|
| void DoWork(bool posted_from_main_thread);
|
|
|
| + // Delayed Tasks with run_times <= |now| are enqueued onto their work queues.
|
| // Reloads any empty work queues which have automatic pumping enabled and
|
| // which are eligible to be auto pumped based on the |previous_task| which was
|
| // run. Call with an empty |previous_task| if no task was just run. Returns
|
| // true if any work queue has tasks after doing this.
|
| // |next_pending_delayed_task| should be the time of the next known delayed
|
| // task. It is updated if any task is found which should run earlier.
|
| - bool UpdateWorkQueues(base::TimeTicks* next_pending_delayed_task,
|
| + bool UpdateWorkQueues(base::TimeTicks now,
|
| const base::PendingTask* previous_task);
|
|
|
| // Chooses the next work queue to service. Returns true if |out_queue_index|
|
|
|