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

Unified Diff: Source/wtf/CurrentTime.cpp

Issue 15861022: Build WTF as dll in component build (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix AutoDrainedPool ctor and ThreadSpecificThreadExit exports Created 7 years, 7 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 | « Source/wtf/CurrentTime.h ('k') | Source/wtf/DateMath.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/CurrentTime.cpp
diff --git a/Source/wtf/CurrentTime.cpp b/Source/wtf/CurrentTime.cpp
index 8f6e07060323a12d7235f149f553dfb2303e7457..8586efee3373d9d16114199b015216b5e9fb2f68 100644
--- a/Source/wtf/CurrentTime.cpp
+++ b/Source/wtf/CurrentTime.cpp
@@ -31,18 +31,29 @@
#include "config.h"
#include "wtf/CurrentTime.h"
-#include <public/Platform.h>
-
namespace WTF {
+static TimeFunction currentTimeFunction;
+static TimeFunction monotonicallyIncreasingTimeFunction;
+
+void setCurrentTimeFunction(TimeFunction func)
+{
+ currentTimeFunction = func;
+}
+
+void setMonotonicallyIncreasingTimeFunction(TimeFunction func)
+{
+ monotonicallyIncreasingTimeFunction = func;
+}
+
double currentTime()
{
- return WebKit::Platform::current()->currentTime();
+ return (*currentTimeFunction)();
}
double monotonicallyIncreasingTime()
{
- return WebKit::Platform::current()->monotonicallyIncreasingTime();
+ return (*monotonicallyIncreasingTimeFunction)();
}
} // namespace WTF
« no previous file with comments | « Source/wtf/CurrentTime.h ('k') | Source/wtf/DateMath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698