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

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

Issue 2353473003: Revert of Prevent redundant DoWorks due to canceled delayed tasks (Closed)
Patch Set: Created 4 years, 3 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/time_domain.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
index 360ec49950021659203e9d00fb4db875281d92d4..a9659b3aec17d700fa7f99b6e27272f221aabfe0 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
@@ -24,17 +24,13 @@
class TaskQueueManager;
class TaskQueueManagerDelegate;
-// The TimeDomain's job is to wake task queues up when their next delayed tasks
-// are due to fire. TaskQueues request a wake up via ScheduleDelayedWork, when
-// the WakeUp is due the TimeDomain calls TaskQueue::WakeUpForDelayedWork which
-// schedules the next non-canceled wakeup.
+// The TimeDomain's job is to keep track of moments when delayed tasks have been
+// scheduled to fire and to notify their TaskQueues via UpdateDelayedWorkQueue.
//
-// To prevent spurious wake-ups for canceled tasks the TaskQueue should only
-// have a single wake up registered with its TimeDomain. If should call
-// CancelDelayedWork as needed to ensure this. The TimeDomain communicates with
-// the TaskQueueManager to actually schedule the wake-ups on the underlying
-// base::MessageLoop. Various levels of de-duping are employed to prevent
-// unnecessary posting of TaskQueueManager::DoWork.
+// The time domain keeps track of the next wakeup required to pump delayed tasks
+// and issues |RequestWakeup| calls to the subclass as needed. Where possible
+// it tried to de-dupe these wakeups. Ideally it would be possible to cancel
+// them, but that's not currently supported by the base message loop.
//
// The clock itself is provided by subclasses of the TimeDomain and it may be
// the real wall clock or a synthetic (virtual) time base.
@@ -93,13 +89,13 @@
// UpdateWorkQueue on.
void RegisterAsUpdatableTaskQueue(internal::TaskQueueImpl* queue);
- // Schedules a call to TaskQueueImpl::WakeUpForDelayedWork
+ // Schedules a call to TaskQueueImpl::MoveReadyDelayedTasksToDelayedWorkQueue
// when this TimeDomain reaches |delayed_run_time|.
void ScheduleDelayedWork(internal::TaskQueueImpl* queue,
base::TimeTicks delayed_run_time,
base::TimeTicks now);
- // Cancels a call to TaskQueueImpl::WakeUpForDelayedWork
+ // Cancels a call to TaskQueueImpl::MoveReadyDelayedTasksToDelayedWorkQueue
// previously requested with ScheduleDelayedWork. Note this only works if
// delayed_run_time is _not_ the next scheduled run time.
void CancelDelayedWork(internal::TaskQueueImpl* queue,

Powered by Google App Engine
This is Rietveld 408576698