Chromium Code Reviews| Index: third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h |
| diff --git a/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h b/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1c3592ea14e9eda3fe13948f8b35e9767423ba37 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h |
| @@ -0,0 +1,159 @@ |
| +/* |
| + * Copyright (C) 2016 Google Inc. All rights reserved. |
| + * |
| + * Redistribution and use in source and binary forms, with or without |
| + * modification, are permitted provided that the following conditions are |
| + * met: |
| + * |
| + * * Redistributions of source code must retain the above copyright |
| + * notice, this list of conditions and the following disclaimer. |
| + * * Redistributions in binary form must reproduce the above |
| + * copyright notice, this list of conditions and the following disclaimer |
| + * in the documentation and/or other materials provided with the |
| + * distribution. |
| + * * Neither the name of Google Inc. nor the names of its |
| + * contributors may be used to endorse or promote products derived from |
| + * this software without specific prior written permission. |
| + * |
| + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| + */ |
| + |
| +#ifndef PerformanceNavigationTiming_h |
| +#define PerformanceNavigationTiming_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "core/frame/DOMWindowProperty.h" |
| +#include "core/timing/PerformanceResourceTiming.h" |
| +#include "wtf/Forward.h" |
| + |
| +namespace blink { |
| + |
| +class DocumentLoadTiming; |
| +class DocumentLoader; |
| +class DocumentTiming; |
|
panicker
2016/11/04 18:55:32
Could you add a basic layout test?
You can follow
sunjian
2016/11/04 22:25:19
Will add tests in the follow-up cl. Added a TODO
|
| + |
| +class CORE_EXPORT PerformanceNavigationTiming final |
| + : public PerformanceResourceTiming { |
| + DEFINE_WRAPPERTYPEINFO(); |
| + |
| + public: |
| + static PerformanceNavigationTiming* create( |
| + double timeOrigin, |
| + double unloadEventStart, |
| + double unloadEventEnd, |
| + double loadEventStart, |
| + double loadEventEnd, |
| + unsigned short redirectCount, |
| + double domInteractive, |
| + double domContentLoadedEventStart, |
| + double domContentLoadedEventEnd, |
| + double domComplete, |
| + AtomicString type, |
| + double redirectStart, |
| + double redirectEnd, |
| + double fetchStart, |
| + double responseEnd, |
| + bool hasCrossOriginRedirect, |
| + bool hasSameOriginAsPreviousDocument, |
| + ResourceLoadTiming* timing, |
| + double lastRedirectEndTime, |
| + double finishTime, |
| + unsigned long long transferSize, |
| + unsigned long long encodedBodyLength, |
| + unsigned long long decodedBodyLength, |
| + bool didReuseConnection) { |
| + return new PerformanceNavigationTiming( |
| + timeOrigin, unloadEventStart, unloadEventEnd, loadEventStart, |
| + loadEventEnd, redirectCount, domInteractive, domContentLoadedEventStart, |
| + domContentLoadedEventEnd, domComplete, type, redirectStart, redirectEnd, |
| + fetchStart, responseEnd, hasCrossOriginRedirect, |
| + hasSameOriginAsPreviousDocument, "", timing, lastRedirectEndTime, |
| + finishTime, transferSize, encodedBodyLength, decodedBodyLength, |
| + didReuseConnection, true /*allowTimingDetails*/, |
| + true /*allowRediectDetails*/, "document", "navigation", timeOrigin); |
| + } |
| + |
| + double unloadEventStart() const; |
| + double unloadEventEnd() const; |
| + double domInteractive() const; |
| + double domContentLoadedEventStart() const; |
| + double domContentLoadedEventEnd() const; |
| + double domComplete() const; |
| + double loadEventStart() const; |
| + double loadEventEnd() const; |
| + AtomicString type() const; |
| + unsigned short redirectCount() const; |
| + |
| + double fetchStart() const override; |
| + double redirectStart() const override; |
| + double redirectEnd() const override; |
| + double responseEnd() const override; |
| + |
| + protected: |
| + void buildJSONValue(V8ObjectBuilder&) const override; |
| + |
| + private: |
| + explicit PerformanceNavigationTiming(double timeOrigin, |
| + double unloadEventStart, |
| + double unloadEventEnd, |
| + double loadEventStart, |
| + double loadEventEnd, |
| + unsigned short redirectCount, |
| + double domInteractive, |
| + double domContentLoadedEventStart, |
| + double domContentLoadedEventEnd, |
| + double domComplete, |
| + AtomicString type, |
| + double redirectStart, |
| + double redirectEnd, |
| + double fetchStart, |
| + double responseEnd, |
| + bool hasCrossOriginRedirect, |
| + bool hasSameOriginAsPreviousDocument, |
| + const AtomicString& initiatorType, |
| + ResourceLoadTiming*, |
| + double lastRedirectEndTime, |
| + double finishTime, |
| + unsigned long long transferSize, |
| + unsigned long long encodedBodyLength, |
| + unsigned long long decodedBodyLength, |
| + bool didReuseConnection, |
| + bool allowTimingDetails, |
| + bool allowRedirectDetails, |
| + const String& name, |
| + const String& entryType, |
| + double startTime); |
| + |
| + ~PerformanceNavigationTiming() override; |
| + |
| + double m_timeOrigin; |
| + double m_unloadEventStart; |
| + double m_unloadEventEnd; |
| + double m_loadEventStart; |
| + double m_loadEventEnd; |
| + unsigned short m_redirectCount; |
| + double m_domInteractive; |
| + double m_domContentLoadedEventStart; |
| + double m_domContentLoadedEventEnd; |
| + double m_domComplete; |
| + AtomicString m_type; |
| + double m_redirectStart; |
| + double m_redirectEnd; |
| + double m_fetchStart; |
| + double m_responseEnd; |
| + bool m_hasCrossOriginRedirect; |
| + bool m_hasSameOriginAsPreviousDocument; |
| +}; |
| +} // namespace blink |
| + |
| +#endif // PerformanceNavigationTiming_h |