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

Unified Diff: third_party/WebKit/Source/wtf/CurrentTime.h

Issue 1550563002: Blink Platform: Remove time functions from Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merrrge agaaain. 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/wtf/CurrentTime.h
diff --git a/third_party/WebKit/Source/wtf/CurrentTime.h b/third_party/WebKit/Source/wtf/CurrentTime.h
index e41ccad8755e3803efcb9a4f8cedc4c3e53cdd02..a7e9829c5c011e71f1ba4ad2aabde9687019c427 100644
--- a/third_party/WebKit/Source/wtf/CurrentTime.h
+++ b/third_party/WebKit/Source/wtf/CurrentTime.h
@@ -51,14 +51,19 @@ inline double currentTimeMS()
// On unsupported platforms, this function only guarantees the result will be non-decreasing.
WTF_EXPORT double monotonicallyIncreasingTime();
-typedef double(*TimeFunction)(void);
-void setCurrentTimeFunction(TimeFunction);
-WTF_EXPORT void setMonotonicallyIncreasingTimeFunction(TimeFunction);
+using TimeFunction = double (*)();
+
+// Make all the time functions (currentTime(), monotonicallyIncreasingTime(), systemTraceTime()) return the result
+// of the supplied function. Returns the pointer to the old time function. For both setting and getting, nullptr means
+// using the default timing function returning the actual time.
+WTF_EXPORT TimeFunction setTimeFunctionsForTesting(TimeFunction);
} // namespace WTF
using WTF::currentTime;
using WTF::currentTimeMS;
using WTF::monotonicallyIncreasingTime;
+using WTF::TimeFunction;
+using WTF::setTimeFunctionsForTesting;
#endif // CurrentTime_h
« no previous file with comments | « third_party/WebKit/Source/web/tests/TextFinderTest.cpp ('k') | third_party/WebKit/Source/wtf/CurrentTime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698