diff options
Diffstat (limited to 'dom/performance/PerformanceTiming.h')
-rwxr-xr-x[-rw-r--r--] | dom/performance/PerformanceTiming.h | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/dom/performance/PerformanceTiming.h b/dom/performance/PerformanceTiming.h index 0bc73fd3f..435e1bca1 100644..100755 --- a/dom/performance/PerformanceTiming.h +++ b/dom/performance/PerformanceTiming.h @@ -10,6 +10,7 @@ #include "mozilla/Attributes.h" #include "nsContentUtils.h" #include "nsDOMNavigationTiming.h" +#include "mozilla/TimerClamping.h" #include "nsWrapperCache.h" #include "Performance.h" @@ -68,10 +69,10 @@ public: * page), if the given TimeStamp is valid. Otherwise, it will return * the FetchStart timing value. */ - inline DOMHighResTimeStamp TimeStampToDOMHighResOrFetchStart(TimeStamp aStamp) + inline DOMHighResTimeStamp TimeStampToReducedDOMHighResOrFetchStart(TimeStamp aStamp) { return (!aStamp.IsNull()) - ? TimeStampToDOMHighRes(aStamp) + ? TimerClamping::ReduceMsTimeValue(TimeStampToDOMHighRes(aStamp)) : FetchStartHighRes(); } @@ -119,7 +120,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetNavigationStart(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetNavigationStart()); } DOMTimeMilliSec UnloadEventStart() @@ -127,7 +128,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetUnloadEventStart(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetUnloadEventStart()); } DOMTimeMilliSec UnloadEventEnd() @@ -135,10 +136,10 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetUnloadEventEnd(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetUnloadEventEnd()); } - uint16_t GetRedirectCount() const; + uint8_t GetRedirectCount() const; // Checks if the resource is either same origin as the page that started // the load, or if the response contains the Timing-Allow-Origin header @@ -154,7 +155,12 @@ public: // the timing-allow-origin check in HttpBaseChannel::TimingAllowCheck bool ShouldReportCrossOriginRedirect() const; + // The last channel's AsyncOpen time. This may occur before the FetchStart + // in some cases. + DOMHighResTimeStamp AsyncOpenHighRes(); + // High resolution (used by resource timing) + DOMHighResTimeStamp WorkerStartHighRes(); DOMHighResTimeStamp FetchStartHighRes(); DOMHighResTimeStamp RedirectStartHighRes(); DOMHighResTimeStamp RedirectEndHighRes(); @@ -185,7 +191,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetDomLoading(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomLoading()); } DOMTimeMilliSec DomInteractive() const @@ -193,7 +199,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetDomInteractive(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomInteractive()); } DOMTimeMilliSec DomContentLoadedEventStart() const @@ -201,7 +207,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetDomContentLoadedEventStart(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomContentLoadedEventStart()); } DOMTimeMilliSec DomContentLoadedEventEnd() const @@ -209,7 +215,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetDomContentLoadedEventEnd(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomContentLoadedEventEnd()); } DOMTimeMilliSec DomComplete() const @@ -217,7 +223,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetDomComplete(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomComplete()); } DOMTimeMilliSec LoadEventStart() const @@ -225,7 +231,7 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetLoadEventStart(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetLoadEventStart()); } DOMTimeMilliSec LoadEventEnd() const @@ -233,7 +239,15 @@ public: if (!nsContentUtils::IsPerformanceTimingEnabled()) { return 0; } - return GetDOMTiming()->GetLoadEventEnd(); + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetLoadEventEnd()); + } + + DOMTimeMilliSec TimeToNonBlankPaint() const + { + if (!nsContentUtils::IsPerformanceTimingEnabled()) { + return 0; + } + return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetTimeToNonBlankPaint()); } private: @@ -252,6 +266,7 @@ private: DOMHighResTimeStamp mZeroTime; TimeStamp mAsyncOpen; + TimeStamp mWorkerStart; TimeStamp mRedirectStart; TimeStamp mRedirectEnd; TimeStamp mDomainLookupStart; @@ -264,7 +279,7 @@ private: TimeStamp mCacheReadStart; TimeStamp mResponseEnd; TimeStamp mCacheReadEnd; - uint16_t mRedirectCount; + uint8_t mRedirectCount; bool mTimingAllowed; bool mAllRedirectsSameOrigin; bool mInitialized; @@ -273,6 +288,8 @@ private: // redirectEnd attributes. It is false if there were no redirects, or if // any of the responses didn't pass the timing-allow-check bool mReportCrossOriginRedirect; + + bool mSecureConnection; }; } // namespace dom |