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

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: Created 5 years 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 c0489f5065c68fb619226e8db34f6aa6bff3c5d0..a975ac57a1919228437f2b2931a1398d4ec20791 100644
--- a/third_party/WebKit/Source/wtf/CurrentTime.h
+++ b/third_party/WebKit/Source/wtf/CurrentTime.h
@@ -55,11 +55,12 @@ WTF_EXPORT double monotonicallyIncreasingTime();
// system.
WTF_EXPORT double systemTraceTime();
-typedef double(*TimeFunction)(void);
-void setCurrentTimeFunction(TimeFunction);
-WTF_EXPORT void setMonotonicallyIncreasingTimeFunction(TimeFunction);
-void setSystemTraceTimeFunction(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
@@ -67,5 +68,7 @@ using WTF::currentTime;
using WTF::currentTimeMS;
using WTF::monotonicallyIncreasingTime;
using WTF::systemTraceTime;
+using WTF::TimeFunction;
+using WTF::setTimeFunctionsForTesting;
#endif // CurrentTime_h

Powered by Google App Engine
This is Rietveld 408576698