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

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: Remove some unneeded changes 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..726ecf58ac39c8890b8face3eb90d3f605c6b685 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;
}
@@ -86,6 +86,11 @@ private:
NO_LAZY_SWEEP_SANITIZE_ADDRESS
virtual bool canFire() const { return true; }
+ double timerMonotonicallyIncreasingTime() const
+ {
+ return m_thread->monotonicallyIncreasingVirtualTimeSeconds();
+ }
+
void setNextFireTime(double now, double delay);
void runInternal();
@@ -125,11 +130,8 @@ private:
double m_repeatInterval; // 0 if not repeating
WebTraceLocation m_location;
CancellableTimerTask* m_cancellableTimerTask; // NOT OWNED
- WebTaskRunner* m_webTaskRunner; // Not owned.
-
-#if ENABLE(ASSERT)
- ThreadIdentifier m_thread;
-#endif
+ WebThread* m_thread; // NOT OWNED
+ WebTaskRunner* m_webTaskRunner; // NOT OWNED
friend class ThreadTimers;
friend class TimerHeapLessThanFunction;
@@ -210,7 +212,7 @@ public:
NO_LAZY_SWEEP_SANITIZE_ADDRESS
inline bool TimerBase::isActive() const
{
- ASSERT(m_thread == currentThread());
+ ASSERT(m_thread->isCurrentThread());
return m_cancellableTimerTask;
}

Powered by Google App Engine
This is Rietveld 408576698