Performance Timing: Convert WTF::MonotonicTime and WTF::Seconds
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Feb 2017 03:23:53 +0000 (03:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Feb 2017 03:23:53 +0000 (03:23 +0000)
commitfb294d2d5bbc301e639d32846540b1802bd89b18
tree9a141bb52ff1196b806d85b07216026c56ccd498
parent672d7d8525b2a8580fe5756b9de65e59dedba6f7
Performance Timing: Convert WTF::MonotonicTime and WTF::Seconds
https://bugs.webkit.org/show_bug.cgi?id=167768

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-03
Reviewed by Geoffrey Garen.

Source/WebCore:

The public APIs still return double (DOMHighResTimeStamp), which
is milliseconds since a time origin:
https://w3c.github.io/hr-time/#dom-domhighrestimestamp

* loader/LoadTiming.cpp:
(WebCore::LoadTiming::secondsSinceStartTime):
(WebCore::LoadTiming::monotonicTimeToPseudoWallTime):
(WebCore::LoadTiming::markStartTime):
(WebCore::LoadTiming::addRedirect):
(WebCore::LoadTiming::monotonicTimeToZeroBasedDocumentTime): Deleted.
* loader/LoadTiming.h:
(WebCore::LoadTiming::markUnloadEventStart):
(WebCore::LoadTiming::markUnloadEventEnd):
(WebCore::LoadTiming::markRedirectStart):
(WebCore::LoadTiming::markRedirectEnd):
(WebCore::LoadTiming::markFetchStart):
(WebCore::LoadTiming::setResponseEnd):
(WebCore::LoadTiming::markLoadEventStart):
(WebCore::LoadTiming::markLoadEventEnd):
(WebCore::LoadTiming::startTime):
(WebCore::LoadTiming::unloadEventStart):
(WebCore::LoadTiming::unloadEventEnd):
(WebCore::LoadTiming::redirectStart):
(WebCore::LoadTiming::redirectEnd):
(WebCore::LoadTiming::fetchStart):
(WebCore::LoadTiming::responseEnd):
(WebCore::LoadTiming::loadEventStart):
(WebCore::LoadTiming::loadEventEnd):
(WebCore::LoadTiming::redirectCount):
(WebCore::LoadTiming::referenceMonotonicTime):
(WebCore::LoadTiming::referenceWallTime):
Use MonotonicTime and WallTime for timestamps and references.

* dom/Document.cpp:
(WebCore::Document::setReadyState):
(WebCore::Document::finishedParsing):
(WebCore::Document::monotonicTimestamp):
* dom/DocumentTiming.h:
(WebCore::DocumentTiming::DocumentTiming): Deleted.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::dataReceived):
* loader/DocumentLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::performance):
Use new types instead of raw doubles.

* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::now):
(WebCore::Performance::reduceTimeResolution):
(WebCore::Performance::addResourceTiming):
* page/Performance.h:
Do time arithmatic with WTF::Time classes.
This clarifies that we reduce our timestamps to 100us
resolution instead of the maximum 5us allowed by the spec.

* page/PerformanceResourceTiming.cpp:
(WebCore::monotonicTimeToDOMHighResTimeStamp):
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
* page/PerformanceResourceTiming.h:
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
(WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
(WebCore::toIntegerMilliseconds): Deleted.
* page/PerformanceTiming.h:
Do time arithmatic with WTF::Time classes.

* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:
Pass time origin as MonotonicTime.

* workers/Worker.cpp:
(WebCore::Worker::create):
(WebCore::Worker::notifyFinished):
* workers/Worker.h:
Rename creation timestamp member. This matches Document's m_documentCreationTime.

Source/WTF:

* wtf/Stopwatch.h:
(WTF::Stopwatch::elapsedTimeSince):
(WTF::Stopwatch::elapsedTimeSinceMonotonicTime): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Stopwatch.h
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/DocumentTiming.h
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/inspector/InspectorNetworkAgent.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/LoadTiming.cpp
Source/WebCore/loader/LoadTiming.h
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/page/DOMWindow.cpp
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/workers/DedicatedWorkerGlobalScope.cpp
Source/WebCore/workers/DedicatedWorkerGlobalScope.h
Source/WebCore/workers/DedicatedWorkerThread.cpp
Source/WebCore/workers/DedicatedWorkerThread.h
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/Worker.h
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerGlobalScopeProxy.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerMessagingProxy.h
Source/WebCore/workers/WorkerThread.cpp
Source/WebCore/workers/WorkerThread.h