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

Unified Diff: content/renderer/scheduler/task_queue_manager.h

Issue 966813003: [content]: Ensure TaskQueueManager AFTER_WAKEUP autopump policy wakes only on newer tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Sami's comments Created 5 years, 10 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: 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 79df04d91eba9c6edd99c153443a516d6a324a09..8f32b93a0ace6674cfa227db573ca5bad6f4540d 100644
--- a/content/renderer/scheduler/task_queue_manager.h
+++ b/content/renderer/scheduler/task_queue_manager.h
@@ -116,8 +116,6 @@ class CONTENT_EXPORT TaskQueueManager {
private:
friend class internal::TaskQueue;
- enum class WorkQueueUpdateEventType { BEFORE_WAKEUP, AFTER_WAKEUP };
-
// Called by the task queue to register a new pending task and allocate a
// sequence number for it.
void DidQueueTask(base::PendingTask* pending_task);
@@ -131,12 +129,13 @@ class CONTENT_EXPORT TaskQueueManager {
void DoWork(bool posted_from_main_thread);
// Reloads any empty work queues which have automatic pumping enabled and
- // which are eligible to be auto pumped at the given |event_type|.
- // Returns true if any work queue has tasks after doing this.
+ // 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,
- WorkQueueUpdateEventType event_type);
+ const base::PendingTask* previous_task);
// Chooses the next work queue to service. Returns true if |out_queue_index|
// indicates the queue from which the next task should be run, false to
« no previous file with comments | « no previous file | content/renderer/scheduler/task_queue_manager.cc » ('j') | content/renderer/scheduler/task_queue_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698