From e3da3bec40b001650ff4beca247623ab55432cf0 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 17 Mar 2018 11:09:13 +0100 Subject: Round down to the nearest 2ms (instead of 1ms) Issue #67 https://github.com/MoonchildProductions/UXP/pull/34/commits/c8355b22c047c9737e32f096b816edbb8b0fa181 https://github.com/MoonchildProductions/UXP/commit/a32b7f7c4e4e31669e0787e6321d74e4db71e514 https://github.com/MoonchildProductions/UXP/commit/f0b727eac28244e0fa24a6107dee44e83ad0f561 --- dom/performance/PerformanceTiming.cpp | 8 ++------ dom/tests/browser/browser_performanceAPI.js | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'dom') diff --git a/dom/performance/PerformanceTiming.cpp b/dom/performance/PerformanceTiming.cpp index 97bbcb0ca..5f771f0aa 100755 --- a/dom/performance/PerformanceTiming.cpp +++ b/dom/performance/PerformanceTiming.cpp @@ -307,12 +307,8 @@ PerformanceTiming::SecureConnectionStartHighRes() if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) { return mZeroTime; } - - // Round down to the nearest 1ms - const double maxResolutionMs = 1; - return mSecureConnectionStart.IsNull() - ? mZeroTime - : floor(TimeStampToDOMHighRes(mSecureConnectionStart) / maxResolutionMs) * maxResolutionMs; + return mSecureConnectionStart.IsNull() ? mZeroTime + : TimerClamping::ReduceMsTimeValue(TimeStampToDOMHighRes(mSecureConnectionStart)); } DOMTimeMilliSec diff --git a/dom/tests/browser/browser_performanceAPI.js b/dom/tests/browser/browser_performanceAPI.js index 2c28fe3d1..0705fec49 100755 --- a/dom/tests/browser/browser_performanceAPI.js +++ b/dom/tests/browser/browser_performanceAPI.js @@ -17,6 +17,7 @@ const PERFORMANCE_TIMINGS = [ "domainLookupEnd", "connectStart", "connectEnd", + "secureConnectionStart", "requestStart", "responseStart", "responseEnd", -- cgit v1.2.3