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

Unified Diff: third_party/WebKit/public/platform/WebTaskRunner.h

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile 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
« no previous file with comments | « third_party/WebKit/Source/web/web.gypi ('k') | third_party/WebKit/public/platform/WebViewScheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebTaskRunner.h
diff --git a/third_party/WebKit/public/platform/WebTaskRunner.h b/third_party/WebKit/public/platform/WebTaskRunner.h
index defe4a1aedac05b2ce2dd8c4850f1455b2b3bb8d..5763817588e9e9bd9082418e5c2764b648b0d54b 100644
--- a/third_party/WebKit/public/platform/WebTaskRunner.h
+++ b/third_party/WebKit/public/platform/WebTaskRunner.h
@@ -37,6 +37,24 @@ public:
// Returns a clone of the WebTaskRunner.
virtual WebTaskRunner* clone() = 0;
+ // ---
+
+ // Headless Chrome virtualises time for determinism and performance (fast forwarding
+ // of timers). To make this work some parts of blink (e.g. Timers) need to use virtual
+ // time, however by default new code should use the normal non-virtual time APIs.
+
+ // Returns a double which is the number of seconds since epoch (Jan 1, 1970).
+ // This may represent either the real time, or a virtual time depending on
+ // whether or not the WebTaskRunner is associated with a virtual time domain or a
+ // real time domain.
+ virtual double virtualTimeSeconds() const = 0;
+
+ // Returns a microsecond resolution platform dependant time source.
+ // This may represent either the real time, or a virtual time depending on
+ // whether or not the WebTaskRunner is associated with a virtual time domain or a
+ // real time domain.
+ virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0;
+
#ifdef INSIDE_BLINK
// Helpers for posting bound functions as tasks.
typedef Function<void()> ClosureTask;
« no previous file with comments | « third_party/WebKit/Source/web/web.gypi ('k') | third_party/WebKit/public/platform/WebViewScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698