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

Unified Diff: sky/engine/wtf/CurrentTime.cpp

Issue 887883002: WTF should get time from base directly (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/wtf/CurrentTime.h ('k') | sky/engine/wtf/WTF.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/wtf/CurrentTime.cpp
diff --git a/sky/engine/wtf/CurrentTime.cpp b/sky/engine/wtf/CurrentTime.cpp
index b9e9e5e6154a63e0d48f4413e8d4dd4773baa583..638f4bcb242550c16788c213678049503b4d1898 100644
--- a/sky/engine/wtf/CurrentTime.cpp
+++ b/sky/engine/wtf/CurrentTime.cpp
@@ -28,32 +28,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "base/time/time.h"
#include "sky/engine/config.h"
#include "sky/engine/wtf/CurrentTime.h"
namespace WTF {
-static TimeFunction currentTimeFunction;
-static TimeFunction monotonicallyIncreasingTimeFunction;
-
-void setCurrentTimeFunction(TimeFunction func)
-{
- currentTimeFunction = func;
-}
-
-void setMonotonicallyIncreasingTimeFunction(TimeFunction func)
-{
- monotonicallyIncreasingTimeFunction = func;
-}
-
double currentTime()
{
- return (*currentTimeFunction)();
+ return base::Time::Now().ToDoubleT();
}
double monotonicallyIncreasingTime()
{
- return (*monotonicallyIncreasingTimeFunction)();
+ return base::TimeTicks::Now().ToInternalValue() /
+ static_cast<double>(base::Time::kMicrosecondsPerSecond);
}
} // namespace WTF
« no previous file with comments | « sky/engine/wtf/CurrentTime.h ('k') | sky/engine/wtf/WTF.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698