Changeset 63878 in webkit


Ignore:
Timestamp:
Jul 22, 2010 12:40:52 AM (14 years ago)
Author:
tonyg@chromium.org
Message:

2010-07-22 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Darin Fisher.

webkitPerformance.timing.responseEnd should not include document parse time
https://bugs.webkit.org/show_bug.cgi?id=42797

No new tests because timing based test would be flaky.

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::finishedLoading): finishedLoading() is called by the platform at the right time, but didReceiveData() synchronously invokes parsing without returning to the event loop prior to this. So by the time the didFinishLoading() method is executed, parsing is finished. The solution is to move this time to didReceiveData() prior to parsing.
  • loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveData): Update the time each time didReceiveData() is called. (WebCore::MainResourceLoader::didFinishLoading): When finished, and after parsing, set responseEnd appropriately.
  • loader/MainResourceLoader.h:
  • page/Timing.cpp: (WebCore::Timing::resourceLoadTimeRelativeToAbsolute): Now that responseEnd is set correctly, it can be much shorter for very fast loads (like local files). This exposed the fact that this skew check was not tight enough. We need to make sure that the whole range of values from the ResourceLoadTiming API fit within fetchStart-responseEnd, not just that requestTime fits in this range.
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63876 r63878  
     12010-07-22  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        webkitPerformance.timing.responseEnd should not include document parse time
     6        https://bugs.webkit.org/show_bug.cgi?id=42797
     7
     8        No new tests because timing based test would be flaky.
     9
     10        * loader/FrameLoader.cpp:
     11        (WebCore::FrameLoader::finishedLoading): finishedLoading() is called by the platform at the right time, but didReceiveData() synchronously invokes parsing without returning to the event loop prior to this. So by the time the didFinishLoading() method is executed, parsing is finished. The solution is to move this time to didReceiveData() prior to parsing.
     12        * loader/MainResourceLoader.cpp:
     13        (WebCore::MainResourceLoader::didReceiveData): Update the time each time didReceiveData() is called.
     14        (WebCore::MainResourceLoader::didFinishLoading): When finished, and after parsing, set responseEnd appropriately.
     15        * loader/MainResourceLoader.h:
     16        * page/Timing.cpp:
     17        (WebCore::Timing::resourceLoadTimeRelativeToAbsolute): Now that responseEnd is set correctly, it can be much shorter for very fast loads (like local files). This exposed the fact that this skew check was not tight enough. We need to make sure that the whole range of values from the ResourceLoadTiming API fit within fetchStart-responseEnd, not just that requestTime fits in this range.
     18
    1192010-07-21  Kent Tamura  <tkent@chromium.org>
    220
  • trunk/WebCore/loader/FrameLoader.cpp

    r63863 r63878  
    22222222
    22232223    RefPtr<DocumentLoader> dl = activeDocumentLoader();
    2224     ASSERT(!dl->timing()->responseEnd);
    2225     dl->timing()->responseEnd = currentTime();
    22262224    dl->finishedLoading();
    22272225    if (!dl->mainDocumentError().isNull() || !dl->frameLoader())
  • trunk/WebCore/loader/MainResourceLoader.cpp

    r63689 r63878  
    414414    RefPtr<MainResourceLoader> protect(this);
    415415
     416    m_timeOfLastDataReceived = currentTime();
     417
    416418    ResourceLoader::didReceiveData(data, length, lengthReceived, allAtOnce);
    417419}
     
    433435#endif
    434436
     437    ASSERT(!documentLoader()->timing()->responseEnd);
     438    documentLoader()->timing()->responseEnd = m_timeOfLastDataReceived;
    435439    frameLoader()->finishedLoading();
    436440    ResourceLoader::didFinishLoading();
  • trunk/WebCore/loader/MainResourceLoader.h

    r55237 r63878  
    108108        bool m_loadingMultipartContent;
    109109        bool m_waitingForContentPolicy;
     110        double m_timeOfLastDataReceived;
    110111    };
    111112
  • trunk/WebCore/page/Timing.cpp

    r63689 r63878  
    291291    // Since ResourceLoadTimings came from the network platform layer, we must
    292292    // check them for skew because they may be from another thread/process.
    293     double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd);
     293    double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd - (resourceTiming->receiveHeadersEnd / 1000.0));
    294294    return toIntegerMilliseconds(baseTime) + relativeSeconds;
    295295}
Note: See TracChangeset for help on using the changeset viewer.