diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-03-17 13:26:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-17 13:26:47 +0100 |
commit | a24511ca8e19afe4d19008ba903e1edab0af3223 (patch) | |
tree | 2bcc3a87b20b9dedacd38b7b6d447abb15184f3e /dom | |
parent | 11bdaa144d8a38ecd897dde278cb1db9b8313961 (diff) | |
parent | bdaacef069f954129ecc84365351af3a84de4463 (diff) | |
download | UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar.gz UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar.lz UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar.xz UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.zip |
Merge pull request #68 from janekptacijarabaci/js_dom_performancetiming_1
Round down to the nearest 2ms (instead of 1ms) by using timerclamping function
Diffstat (limited to 'dom')
-rwxr-xr-x | dom/performance/PerformanceTiming.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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 |