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

Unified Diff: third_party/WebKit/Source/platform/Timer.h

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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: third_party/WebKit/Source/platform/Timer.h
diff --git a/third_party/WebKit/Source/platform/Timer.h b/third_party/WebKit/Source/platform/Timer.h
index d46a1e60f78b1297a39e1497db1c36df62d16215..5046ebfd83a4e06d6343d25463729bc224b35168 100644
--- a/third_party/WebKit/Source/platform/Timer.h
+++ b/third_party/WebKit/Source/platform/Timer.h
@@ -66,7 +66,7 @@ public:
double repeatInterval() const { return m_repeatInterval; }
void augmentRepeatInterval(double delta) {
- double now = monotonicallyIncreasingTime();
+ double now = timerMonotonicallyIncreasingTime();
setNextFireTime(now, m_nextFireTime - now + delta);
m_repeatInterval += delta;
}
@@ -81,11 +81,16 @@ protected:
private:
virtual void fired() = 0;
- virtual WebTaskRunner* timerTaskRunner();
+ virtual WebTaskRunner* timerTaskRunner() const;
NO_LAZY_SWEEP_SANITIZE_ADDRESS
virtual bool canFire() const { return true; }
+ double timerMonotonicallyIncreasingTime() const
+ {
+ return timerTaskRunner()->monotonicallyIncreasingVirtualTimeSeconds();
+ }
+
void setNextFireTime(double now, double delay);
void runInternal();

Powered by Google App Engine
This is Rietveld 408576698