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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceBase.cpp

Issue 1352523002: Use high precision timestamp for Event.timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and introduce new type Created 5 years, 3 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/core/timing/PerformanceBase.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
index ad653c600a557a110a2ed88b301a6fd6c0e36149..bed17a883a8353edb1bcc4fbd2b770642adcdf5f 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -422,10 +422,15 @@ double PerformanceBase::clampTimeResolution(double timeSeconds)
return floor(timeSeconds / resolutionSeconds) * resolutionSeconds;
}
-double PerformanceBase::now() const
+DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp(double monotonicTime) const
{
- double nowSeconds = monotonicallyIncreasingTime() - m_timeOrigin;
- return 1000.0 * clampTimeResolution(nowSeconds);
+ double timeInSeconds = monotonicTime - m_timeOrigin;
+ return convertSecondsToDOMHighResTimeStamp(clampTimeResolution(timeInSeconds));
+}
+
+DOMHighResTimeStamp PerformanceBase::now() const
+{
+ return monotonicTimeToDOMHighResTimeStamp(monotonicallyIncreasingTime()); // in milliseconds
Rick Byers 2015/09/29 15:57:59 nit: this comment seems redundant (it's clear you'
majidvp 2015/10/01 20:57:19 Done.
}
DEFINE_TRACE(PerformanceBase)

Powered by Google App Engine
This is Rietveld 408576698