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

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

Issue 2615533002: Remove duplicate domHighResTimestamp conversion in NavigationTiming (Closed)
Patch Set: fixed layout test failures Created 3 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
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 660507eee11d03eae3d5bff86da2a268791a26b1..995c7eb671c0e218f340f43dbc78430d06d43f51 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -556,16 +556,23 @@ double PerformanceBase::clampTimeResolution(double timeSeconds) {
}
DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp(
- double monotonicTime) const {
+ double timeOrigin,
+ double monotonicTime) {
// Avoid exposing raw platform timestamps.
- if (m_timeOrigin == 0.0)
+ if (!monotonicTime || !timeOrigin)
return 0.0;
- double timeInSeconds = monotonicTime - m_timeOrigin;
+ double timeInSeconds = monotonicTime - timeOrigin;
+ DCHECK_GE(timeInSeconds, 0);
return convertSecondsToDOMHighResTimeStamp(
clampTimeResolution(timeInSeconds));
}
+DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp(
+ double monotonicTime) const {
+ return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, monotonicTime);
+}
+
DOMHighResTimeStamp PerformanceBase::now() const {
return monotonicTimeToDOMHighResTimeStamp(monotonicallyIncreasingTime());
}
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.h ('k') | third_party/WebKit/Source/core/timing/PerformanceEntry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698