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

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

Issue 2644553002: Refactor TimeDomain::MaybeAdvanceTime in preparation for DoWork deduping (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/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 f7f31b05a8218132d88c7e6c034c10d79af661a6..13914bd372d2507f9e19b92223631970ab3ef370 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
@@ -62,9 +62,12 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
// Evaluate this TimeDomain's Now. Can be called from any thread.
virtual base::TimeTicks Now() const = 0;
- // Some TimeDomains support virtual time, this method tells us to advance time
- // if possible and return true if time was advanced.
- virtual bool MaybeAdvanceTime() = 0;
+ // Computes the delay until the next task the TimeDomain is aware of, if any.
+ // Note virtual time domains may return base::TimeDelta() if they have any
+ // delayed tasks they deem eligible to run. Virtual time domains are allowed
+ // to advance their internal clock when this method is called.
+ virtual base::Optional<base::TimeDelta> DelayTillNextTask(
+ LazyNow* lazy_now) = 0;
// Returns the name of this time domain for tracing.
virtual const char* GetName() const = 0;
@@ -108,7 +111,7 @@ class BLINK_PLATFORM_EXPORT TimeDomain {
void UnregisterQueue(internal::TaskQueueImpl* queue);
// Updates active queues associated with this TimeDomain.
- void UpdateWorkQueues(LazyNow lazy_now);
+ void UpdateWorkQueues(LazyNow* lazy_now);
// Called by the TaskQueueManager when the TimeDomain is registered.
virtual void OnRegisterWithTaskQueueManager(

Powered by Google App Engine
This is Rietveld 408576698