Make NetworkLoadTiming use double for higher precision in Resource Timing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2016 20:28:39 +0000 (20:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2016 20:28:39 +0000 (20:28 +0000)
commitf5948a6d9b1569ea595b2390fafc9f2ec66b0c08
tree09cd688af348843df1b816267509117562e24ace
parent2b33de076e8c5516d973bca1f9daf9841e532e52
Make NetworkLoadTiming use double for higher precision in Resource Timing
https://bugs.webkit.org/show_bug.cgi?id=161051

Patch by Johan K. Jensen <johan_jensen@apple.com> on 2016-08-22
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/misc/resource-timing-resolution.html

* page/Performance.h:
* page/Performance.cpp:
(WebCore::Performance::now):
(WebCore::Performance::reduceTimeResolution):
Add new function to reduce time resolution.

* page/PerformanceResourceTiming.cpp:
(WebCore::monotonicTimeToDocumentMilliseconds):
(WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
Only use the reduced timing resolution for full timestamps and deltas.

(WebCore::PerformanceResourceTiming::connectStart): Use doubles.
* page/PerformanceResourceTiming.h: Use doubles.
* page/PerformanceTiming.cpp: Use doubles.
(WebCore::toIntegerMilliseconds): Use doubles.
(WebCore::PerformanceTiming::connectStart): Use doubles.
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart): Use doubles.
* page/PerformanceTiming.h: Use doubles.
* platform/network/NetworkLoadTiming.h: Use doubles.
* platform/network/curl/ResourceHandleManager.cpp: Use doubles.
(WebCore::milisecondsSinceRequest): Use doubles.
(WebCore::calculateWebTimingInformations): Use doubles.
* platform/network/soup/ResourceHandleSoup.cpp: Use doubles.
(WebCore::milisecondsSinceRequest): Use doubles.
(WebCore::networkEventCallback): Use doubles.

LayoutTests:

Test that resources timing information are close deltas to a multiple of expected resolution.

* http/tests/misc/resource-timing-resolution-expected.txt: Added.
* http/tests/misc/resource-timing-resolution.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/misc/resource-timing-resolution-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/resource-timing-resolution.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Performance.cpp
Source/WebCore/page/Performance.h
Source/WebCore/page/PerformanceResourceTiming.cpp
Source/WebCore/page/PerformanceResourceTiming.h
Source/WebCore/page/PerformanceTiming.cpp
Source/WebCore/page/PerformanceTiming.h
Source/WebCore/platform/network/NetworkLoadTiming.h
Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp