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

Unified Diff: third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc

Issue 2419793002: [Reland] Optimize blink scheduler with an intrusive heap (Closed)
Patch Set: Fixed perf test and increaced test coverage Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc b/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
index 06e075864af63bf7989df54d9c32a5b589eb0688..a34edb2157bf0e6b65be050ff4a205073bff97b0 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/auto_advancing_virtual_time_domain.cc
@@ -25,8 +25,9 @@ bool AutoAdvancingVirtualTimeDomain::MaybeAdvanceTime() {
void AutoAdvancingVirtualTimeDomain::RequestWakeup(base::TimeTicks now,
base::TimeDelta delay) {
- base::TimeTicks dummy;
- if (can_advance_virtual_time_ && !NextScheduledRunTime(&dummy))
+ // Avoid posting pointless DoWorks. I.e. if the time domain has more then one
+ // scheduled wake up then we don't need to do anything.
+ if (can_advance_virtual_time_ && NumberOfScheduledWakeups() == 1u)
RequestDoWork();
}
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698