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

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 Created 5 years, 2 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 abe2d9fd2a4ed68419a3294d2b5404aa33174ed8..7af6fcad01b906b9d4412b0ecfbaee0abb49a0f0 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -422,14 +422,19 @@ double PerformanceBase::clampTimeResolution(double timeSeconds)
return floor(timeSeconds / resolutionSeconds) * resolutionSeconds;
}
-double PerformanceBase::now() const
+DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp(double monotonicTime) const
{
// Avoid exposing raw platform timestamps.
if (m_timeOrigin == 0.0)
return 0.0;
- 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());
}
DEFINE_TRACE(PerformanceBase)

Powered by Google App Engine
This is Rietveld 408576698