Esempio n. 1
0
unsigned long long PerformanceTiming::monotonicTimeToIntegerMilliseconds(double monotonicSeconds) const
{
    ASSERT(monotonicSeconds >= 0);
    const DocumentLoadTiming* timing = documentLoadTiming();
    ASSERT(timing);
    return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonicSeconds));
}
Esempio n. 2
0
unsigned long long PerformanceTiming::parseBlockedOnScriptLoadDuration() const {
  const DocumentParserTiming* timing = documentParserTiming();
  if (!timing)
    return 0;

  return toIntegerMilliseconds(timing->parserBlockedOnScriptLoadDuration());
}
unsigned long long PerformanceTiming::navigationStart() const
{
    DocumentLoadTiming* timing = documentLoadTiming();
    if (!timing)
        return 0;

    return toIntegerMilliseconds(timing->navigationStart);
}
unsigned long long PerformanceTiming::loadEventEnd() const
{
    DocumentLoadTiming* timing = documentLoadTiming();
    if (!timing)
        return 0;

    return toIntegerMilliseconds(timing->loadEventEnd);
}
unsigned long long PerformanceTiming::domComplete() const
{
    const DocumentTiming* timing = documentTiming();
    if (!timing)
        return 0;

    return toIntegerMilliseconds(timing->domComplete);
}
unsigned long long PerformanceTiming::domContentLoadedEventEnd() const
{
    const DocumentTiming* timing = documentTiming();
    if (!timing)
        return 0;

    return toIntegerMilliseconds(timing->domContentLoadedEventEnd);
}
unsigned long long PerformanceTiming::domLoading() const
{
    const DocumentTiming* timing = documentTiming();
    if (!timing)
        return fetchStart();

    return toIntegerMilliseconds(timing->domLoading);
}
unsigned long long PerformanceTiming::redirectEnd() const
{
    DocumentLoadTiming* timing = documentLoadTiming();
    if (!timing)
        return 0;

    if (timing->hasCrossOriginRedirect)
        return 0;

    return toIntegerMilliseconds(timing->redirectEnd);
}
unsigned long long PerformanceTiming::unloadEventEnd() const
{
    DocumentLoadTiming* timing = documentLoadTiming();
    if (!timing)
        return 0;

    if (timing->hasCrossOriginRedirect || !timing->hasSameOriginAsPreviousDocument)
        return 0;

    return toIntegerMilliseconds(timing->unloadEventEnd);
}
unsigned long long PerformanceTiming::resourceLoadTimeRelativeToAbsolute(int relativeSeconds) const
{
    ASSERT(relativeSeconds >= 0);
    ResourceLoadTiming* resourceTiming = resourceLoadTiming();
    ASSERT(resourceTiming);
    DocumentLoadTiming* documentTiming = documentLoadTiming();
    ASSERT(documentTiming);

    // The ResourceLoadTiming API's requestTime is the base time to which all
    // other marks are relative. So to get an absolute time, we must add it to
    // the relative marks.
    //
    // Since ResourceLoadTimings came from the network platform layer, we must
    // check them for skew because they may be from another thread/process.
    double baseTime = getPossiblySkewedTimeInKnownRange(resourceTiming->requestTime, documentTiming->fetchStart, documentTiming->responseEnd);
    return toIntegerMilliseconds(baseTime) + relativeSeconds;
}