Changeset 131001 in webkit
- Timestamp:
- Oct 10, 2012 8:06:24 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r131000 r131001 1 2012-10-10 James Simonsen <simonjam@chromium.org> 2 3 High res times should start at 0 4 https://bugs.webkit.org/show_bug.cgi?id=84912 5 6 Reviewed by Tony Gentilcore. 7 8 Test: Existing Navigation Timing tests. 9 10 * inspector/InspectorInstrumentation.cpp: Use legacy document time, pending 98223. 11 (WebCore): 12 (WebCore::InspectorInstrumentation::didFinishLoadingImpl): 13 * inspector/InspectorResourceAgent.cpp: 14 (WebCore::buildObjectForTiming): 15 * loader/DocumentLoadTiming.cpp: 16 (WebCore::DocumentLoadTiming::convertMonotonicTimeToLegacyDocumentTime): 17 (WebCore): 18 (WebCore::DocumentLoadTiming::convertMonotonicTimeToZeroBasedDocumentTime): 19 (WebCore::DocumentLoadTiming::markNavigationStart): 20 * loader/DocumentLoadTiming.h: 21 (DocumentLoadTiming): 22 (WebCore::DocumentLoadTiming::navigationStart): These just report raw monotonic times now. 23 (WebCore::DocumentLoadTiming::unloadEventStart): 24 (WebCore::DocumentLoadTiming::unloadEventEnd): 25 (WebCore::DocumentLoadTiming::redirectStart): 26 (WebCore::DocumentLoadTiming::redirectEnd): 27 (WebCore::DocumentLoadTiming::fetchStart): 28 (WebCore::DocumentLoadTiming::responseEnd): 29 (WebCore::DocumentLoadTiming::loadEventStart): 30 (WebCore::DocumentLoadTiming::loadEventEnd): 31 * page/PerformanceTiming.cpp: 32 (WebCore::PerformanceTiming::navigationStart): Convert these back to legacy document times. 33 (WebCore::PerformanceTiming::unloadEventStart): 34 (WebCore::PerformanceTiming::unloadEventEnd): 35 (WebCore::PerformanceTiming::redirectStart): 36 (WebCore::PerformanceTiming::redirectEnd): 37 (WebCore::PerformanceTiming::fetchStart): 38 (WebCore::PerformanceTiming::responseEnd): 39 (WebCore::PerformanceTiming::loadEventStart): 40 (WebCore::PerformanceTiming::loadEventEnd): 41 (WebCore::PerformanceTiming::resourceLoadTimeRelativeToAbsolute): 42 (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds): 43 * platform/network/ResourceLoadTiming.cpp: 44 (WebCore::ResourceLoadTiming::convertResourceLoadTimeToMonotonicTime): 45 * platform/network/ResourceLoadTiming.h: 46 (ResourceLoadTiming): 47 1 48 2012-10-10 Levi Weintraub <leviw@chromium.org> 2 49 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r130021 r131001 747 747 // FIXME: Expose all of the timing details to inspector and have it calculate finishTime. 748 748 if (monotonicFinishTime) 749 finishTime = loader->timing()-> convertMonotonicTimeToDocumentTime(monotonicFinishTime);749 finishTime = loader->timing()->monotonicTimeToPseudoWallTime(monotonicFinishTime); 750 750 751 751 if (timelineAgent) -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r130612 r131001 113 113 { 114 114 return TypeBuilder::Network::ResourceTiming::create() 115 .setRequestTime( timing.convertResourceLoadTimeToDocumentTime(loader->timing(), 0))115 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(timing.convertResourceLoadTimeToMonotonicTime(0))) 116 116 .setProxyStart(timing.proxyStart) 117 117 .setProxyEnd(timing.proxyEnd) -
trunk/Source/WebCore/loader/DocumentLoadTiming.cpp
r115503 r131001 55 55 } 56 56 57 void DocumentLoadTiming::markNavigationStart(Frame* frame) 57 double DocumentLoadTiming::monotonicTimeToZeroBasedDocumentTime(double monotonicTime) const 58 58 { 59 ASSERT(frame); 59 if (!monotonicTime) 60 return 0.0; 61 return monotonicTime - m_referenceMonotonicTime; 62 } 63 64 double DocumentLoadTiming::monotonicTimeToPseudoWallTime(double monotonicTime) const 65 { 66 if (!monotonicTime) 67 return 0.0; 68 return m_referenceWallTime + monotonicTime - m_referenceMonotonicTime; 69 } 70 71 void DocumentLoadTiming::markNavigationStart() 72 { 60 73 ASSERT(!m_navigationStart && !m_referenceMonotonicTime && !m_referenceWallTime); 61 74 62 if (frame->page()->mainFrame() == frame) { 63 m_navigationStart = m_referenceMonotonicTime = monotonicallyIncreasingTime(); 64 m_referenceWallTime = currentTime(); 65 } else { 66 Document* rootDocument = frame->page()->mainFrame()->document(); 67 ASSERT(rootDocument); 68 DocumentLoadTiming* rootTiming = rootDocument->loader()->timing(); 69 m_referenceMonotonicTime = rootTiming->m_referenceMonotonicTime; 70 m_referenceWallTime = rootTiming->m_referenceWallTime; 71 m_navigationStart = monotonicallyIncreasingTime(); 72 } 75 m_navigationStart = m_referenceMonotonicTime = monotonicallyIncreasingTime(); 76 m_referenceWallTime = currentTime(); 73 77 } 74 78 … … 90 94 } 91 95 92 double DocumentLoadTiming::convertMonotonicTimeToDocumentTime(double monotonicTime) const93 {94 if (!monotonicTime)95 return 0.0;96 return m_referenceWallTime + monotonicTime - m_referenceMonotonicTime;97 }98 99 double DocumentLoadTiming::convertMonotonicTimeToZeroBasedDocumentTime(double monotonicTime) const100 {101 if (!monotonicTime)102 return 0.0;103 return monotonicTime - m_referenceMonotonicTime;104 }105 106 96 } // namespace WebCore -
trunk/Source/WebCore/loader/DocumentLoadTiming.h
r115503 r131001 38 38 DocumentLoadTiming(); 39 39 40 void markNavigationStart(Frame*); 40 double monotonicTimeToZeroBasedDocumentTime(double) const; 41 double monotonicTimeToPseudoWallTime(double) const; 42 43 void markNavigationStart(); 41 44 void setNavigationStart(double); 42 45 void addRedirect(const KURL& redirectingUrl, const KURL& redirectedUrl); 43 double convertMonotonicTimeToDocumentTime(double) const;44 45 // FIXME: Once convertMonotonicTimeToDocumentTime is zero-based, then this46 // function and convertMonotonicTimeToDocumentTime can be merged. See47 // https://bugs.webkit.org/show_bug.cgi?id=84912 for more details.48 double convertMonotonicTimeToZeroBasedDocumentTime(double) const;49 46 50 47 void markUnloadEventStart() { m_unloadEventStart = monotonicallyIncreasingTime(); } … … 59 56 void setHasSameOriginAsPreviousDocument(bool value) { m_hasSameOriginAsPreviousDocument = value; } 60 57 61 double navigationStart() const { return convertMonotonicTimeToDocumentTime(m_navigationStart); }62 double unloadEventStart() const { return convertMonotonicTimeToDocumentTime(m_unloadEventStart); }63 double unloadEventEnd() const { return convertMonotonicTimeToDocumentTime(m_unloadEventEnd); }64 double redirectStart() const { return convertMonotonicTimeToDocumentTime(m_redirectStart); }65 double redirectEnd() const { return convertMonotonicTimeToDocumentTime(m_redirectEnd); }58 double navigationStart() const { return m_navigationStart; } 59 double unloadEventStart() const { return m_unloadEventStart; } 60 double unloadEventEnd() const { return m_unloadEventEnd; } 61 double redirectStart() const { return m_redirectStart; } 62 double redirectEnd() const { return m_redirectEnd; } 66 63 short redirectCount() const { return m_redirectCount; } 67 double fetchStart() const { return convertMonotonicTimeToDocumentTime(m_fetchStart); }68 double responseEnd() const { return convertMonotonicTimeToDocumentTime(m_responseEnd); }69 double loadEventStart() const { return convertMonotonicTimeToDocumentTime(m_loadEventStart); }70 double loadEventEnd() const { return convertMonotonicTimeToDocumentTime(m_loadEventEnd); }64 double fetchStart() const { return m_fetchStart; } 65 double responseEnd() const { return m_responseEnd; } 66 double loadEventStart() const { return m_loadEventStart; } 67 double loadEventEnd() const { return m_loadEventEnd; } 71 68 bool hasCrossOriginRedirect() const { return m_hasCrossOriginRedirect; } 72 69 bool hasSameOriginAsPreviousDocument() const { return m_hasSameOriginAsPreviousDocument; } -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r130947 r131001 843 843 { 844 844 m_mainDocumentError = ResourceError(); 845 timing()->markNavigationStart( m_frame);845 timing()->markNavigationStart(); 846 846 ASSERT(!m_mainResourceLoader); 847 847 m_mainResourceLoader = MainResourceLoader::create(m_frame); -
trunk/Source/WebCore/loader/FrameLoader.cpp
r130651 r131001 2953 2953 ASSERT(provisionalLoader->timing()->navigationStart()); 2954 2954 provisionalLoader->resetTiming(); 2955 provisionalLoader->timing()->markNavigationStart( frame());2955 provisionalLoader->timing()->markNavigationStart(); 2956 2956 2957 2957 provisionalLoader->setCommitted(true); -
trunk/Source/WebCore/page/Performance.cpp
r120962 r131001 168 168 double Performance::webkitNow() const 169 169 { 170 return 1000.0 * m_frame->document()->loader()->timing()-> convertMonotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime());170 return 1000.0 * m_frame->document()->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime()); 171 171 } 172 172 -
trunk/Source/WebCore/page/PerformanceTiming.cpp
r104380 r131001 62 62 return 0; 63 63 64 return toIntegerMilliseconds(timing->navigationStart());64 return monotonicTimeToIntegerMilliseconds(timing->navigationStart()); 65 65 } 66 66 … … 74 74 return 0; 75 75 76 return toIntegerMilliseconds(timing->unloadEventStart());76 return monotonicTimeToIntegerMilliseconds(timing->unloadEventStart()); 77 77 } 78 78 … … 86 86 return 0; 87 87 88 return toIntegerMilliseconds(timing->unloadEventEnd());88 return monotonicTimeToIntegerMilliseconds(timing->unloadEventEnd()); 89 89 } 90 90 … … 98 98 return 0; 99 99 100 return toIntegerMilliseconds(timing->redirectStart());100 return monotonicTimeToIntegerMilliseconds(timing->redirectStart()); 101 101 } 102 102 … … 110 110 return 0; 111 111 112 return toIntegerMilliseconds(timing->redirectEnd());112 return monotonicTimeToIntegerMilliseconds(timing->redirectEnd()); 113 113 } 114 114 … … 119 119 return 0; 120 120 121 return toIntegerMilliseconds(timing->fetchStart());121 return monotonicTimeToIntegerMilliseconds(timing->fetchStart()); 122 122 } 123 123 … … 244 244 return 0; 245 245 246 return toIntegerMilliseconds(timing->responseEnd());246 return monotonicTimeToIntegerMilliseconds(timing->responseEnd()); 247 247 } 248 248 … … 298 298 return 0; 299 299 300 return toIntegerMilliseconds(timing->loadEventStart());300 return monotonicTimeToIntegerMilliseconds(timing->loadEventStart()); 301 301 } 302 302 … … 307 307 return 0; 308 308 309 return toIntegerMilliseconds(timing->loadEventEnd());309 return monotonicTimeToIntegerMilliseconds(timing->loadEventEnd()); 310 310 } 311 311 … … 353 353 ResourceLoadTiming* resourceTiming = resourceLoadTiming(); 354 354 ASSERT(resourceTiming); 355 return toIntegerMilliseconds(resourceTiming->convertResourceLoadTimeToDocumentTime(documentLoadTiming(),relativeMilliseconds));355 return monotonicTimeToIntegerMilliseconds(resourceTiming->convertResourceLoadTimeToMonotonicTime(relativeMilliseconds)); 356 356 } 357 357 … … 361 361 const DocumentLoadTiming* timing = documentLoadTiming(); 362 362 ASSERT(timing); 363 return toIntegerMilliseconds(timing-> convertMonotonicTimeToDocumentTime(monotonicSeconds));363 return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonicSeconds)); 364 364 } 365 365 -
trunk/Source/WebCore/platform/network/ResourceLoadTiming.cpp
r102961 r131001 27 27 #include "ResourceLoadTiming.h" 28 28 29 #include "DocumentLoadTiming.h"30 31 29 namespace WebCore { 32 30 33 double ResourceLoadTiming::convertResourceLoadTimeTo DocumentTime(const DocumentLoadTiming* documentTiming,int deltaMilliseconds) const31 double ResourceLoadTiming::convertResourceLoadTimeToMonotonicTime(int deltaMilliseconds) const 34 32 { 35 if (!documentTiming) 36 return 0.0; 37 38 return documentTiming->convertMonotonicTimeToDocumentTime(requestTime + deltaMilliseconds / 1000.0); 33 return requestTime + deltaMilliseconds / 1000.0; 39 34 } 40 35 -
trunk/Source/WebCore/platform/network/ResourceLoadTiming.h
r102961 r131001 86 86 // using the following equation: 87 87 // pseudo time = document wall reference + (resource request time - document monotonic reference) + deltaMilliseconds / 1000.0. 88 double convertResourceLoadTimeTo DocumentTime(const DocumentLoadTiming* documentTiming,int deltaMilliseconds) const;88 double convertResourceLoadTimeToMonotonicTime(int deltaMilliseconds) const; 89 89 90 90 double requestTime; // monotonicallyIncreasingTime() when the port started handling this request.
Note: See TracChangeset
for help on using the changeset viewer.