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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/real_time_domain.cc

Issue 2590593002: Revert of [Reland] Scheduler refactoring to virtually eliminate redundant DoWorks (Closed)
Patch Set: Created 4 years 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/real_time_domain.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/real_time_domain.cc b/third_party/WebKit/Source/platform/scheduler/base/real_time_domain.cc
index 8614d7ac849ee2a0b9c9bac0b309e34abef5476e..80f18b998d923b8c4b8eb22719be8c42e99f6da4 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/real_time_domain.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/real_time_domain.cc
@@ -46,23 +46,23 @@
task_queue_manager_->MaybeScheduleDelayedWork(FROM_HERE, now, delay);
}
-base::Optional<base::TimeDelta> RealTimeDomain::DelayTillNextTask(
- LazyNow* lazy_now) {
+bool RealTimeDomain::MaybeAdvanceTime() {
base::TimeTicks next_run_time;
if (!NextScheduledRunTime(&next_run_time))
- return base::Optional<base::TimeDelta>();
+ return false;
- base::TimeTicks now = lazy_now->Now();
+ base::TimeTicks now = Now();
if (now >= next_run_time)
- return base::TimeDelta(); // Makes DoWork post an immediate continuation.
+ return true; // Causes DoWork to post a continuation.
base::TimeDelta delay = next_run_time - now;
- TRACE_EVENT1(tracing_category_, "RealTimeDomain::DelayTillNextTask",
+ TRACE_EVENT1(tracing_category_, "RealTimeDomain::MaybeAdvanceTime",
"delay_ms", delay.InMillisecondsF());
- // The next task is sometime in the future. DoWork will make sure it gets
- // run at the right time..
- return delay;
+ // The next task is sometime in the future, make sure we schedule a DoWork to
+ // run it.
+ task_queue_manager_->MaybeScheduleDelayedWork(FROM_HERE, now, delay);
+ return false;
}
void RealTimeDomain::AsValueIntoInternal(

Powered by Google App Engine
This is Rietveld 408576698