Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PerformanceNavigationTiming_h | 5 #ifndef PerformanceNavigationTiming_h |
| 6 #define PerformanceNavigationTiming_h | 6 #define PerformanceNavigationTiming_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/dom/DOMHighResTimeStamp.h" | 9 #include "core/dom/DOMHighResTimeStamp.h" |
| 10 #include "core/loader/FrameLoaderTypes.h" | |
| 10 #include "core/timing/PerformanceResourceTiming.h" | 11 #include "core/timing/PerformanceResourceTiming.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 15 class Document; | |
| 16 class DocumentTiming; | |
| 17 class DocumentLoader; | |
| 18 class DocumentLoadTiming; | |
| 19 class LocalFrame; | |
| 20 class ExecutionContext; | |
| 21 class ResourceTimingInfo; | |
| 22 | |
| 14 class CORE_EXPORT PerformanceNavigationTiming final | 23 class CORE_EXPORT PerformanceNavigationTiming final |
| 15 : public PerformanceResourceTiming { | 24 : public PerformanceResourceTiming { |
| 16 DEFINE_WRAPPERTYPEINFO(); | 25 DEFINE_WRAPPERTYPEINFO(); |
| 26 friend class PerformanceNavigationTimingTest; | |
| 17 | 27 |
| 18 public: | 28 public: |
| 19 enum class NavigationType { Navigate, Reload, BackForward, Prerender }; | 29 PerformanceNavigationTiming(LocalFrame*, |
| 30 ResourceTimingInfo*, | |
| 31 double timeOrigin); | |
| 20 | 32 |
| 21 PerformanceNavigationTiming(double timeOrigin, | 33 // Attributes inheritted from PerformanceEntry. |
| 22 const String& requestedUrl, | 34 DOMHighResTimeStamp duration() const override; |
| 23 double unloadEventStart, | |
| 24 double unloadEventEnd, | |
| 25 double loadEventStart, | |
| 26 double loadEventEnd, | |
| 27 unsigned short redirectCount, | |
| 28 double domInteractive, | |
| 29 double domContentLoadedEventStart, | |
| 30 double domContentLoadedEventEnd, | |
| 31 double domComplete, | |
| 32 NavigationType, | |
| 33 double redirectStart, | |
| 34 double redirectEnd, | |
| 35 double fetchStart, | |
| 36 double responseEnd, | |
| 37 bool allowRedirectDetails, | |
| 38 bool hasSameOriginAsPreviousDocument, | |
| 39 ResourceLoadTiming*, | |
| 40 double lastRedirectEndTime, | |
| 41 double finishTime, | |
| 42 unsigned long long transferSize, | |
| 43 unsigned long long encodedBodyLength, | |
| 44 unsigned long long decodedBodyLength, | |
| 45 bool didReuseConnection); | |
| 46 | 35 |
| 36 // Attributes inherrited from PerformanceResourceTiming. | |
| 37 // Related doc explaining why we decide to override: | |
| 38 // https://goo.gl/uNecAj. | |
|
Kunihiko Sakamoto
2017/02/13 08:22:29
Can you make this doc publicly visible?
sunjian
2017/02/14 21:29:03
Done.
| |
| 39 AtomicString initiatorType() const override; | |
| 40 DOMHighResTimeStamp workerStart() const override; | |
| 41 DOMHighResTimeStamp domainLookupStart() const override; | |
| 42 DOMHighResTimeStamp domainLookupEnd() const override; | |
| 43 DOMHighResTimeStamp connectStart() const override; | |
| 44 DOMHighResTimeStamp connectEnd() const override; | |
| 45 DOMHighResTimeStamp secureConnectionStart() const override; | |
| 46 DOMHighResTimeStamp requestStart() const override; | |
| 47 DOMHighResTimeStamp responseStart() const override; | |
| 48 unsigned long long transferSize() const override; | |
| 49 unsigned long long encodedBodySize() const override; | |
| 50 unsigned long long decodedBodySize() const override; | |
| 51 | |
| 52 // PerformanceNavigationTiming's unique attributes. | |
| 47 DOMHighResTimeStamp unloadEventStart() const; | 53 DOMHighResTimeStamp unloadEventStart() const; |
| 48 DOMHighResTimeStamp unloadEventEnd() const; | 54 DOMHighResTimeStamp unloadEventEnd() const; |
| 49 DOMHighResTimeStamp domInteractive() const; | 55 DOMHighResTimeStamp domInteractive() const; |
| 50 DOMHighResTimeStamp domContentLoadedEventStart() const; | 56 DOMHighResTimeStamp domContentLoadedEventStart() const; |
| 51 DOMHighResTimeStamp domContentLoadedEventEnd() const; | 57 DOMHighResTimeStamp domContentLoadedEventEnd() const; |
| 52 DOMHighResTimeStamp domComplete() const; | 58 DOMHighResTimeStamp domComplete() const; |
| 53 DOMHighResTimeStamp loadEventStart() const; | 59 DOMHighResTimeStamp loadEventStart() const; |
| 54 DOMHighResTimeStamp loadEventEnd() const; | 60 DOMHighResTimeStamp loadEventEnd() const; |
| 55 AtomicString type() const; | 61 AtomicString type() const; |
| 56 unsigned short redirectCount() const; | 62 unsigned short redirectCount() const; |
| 57 | 63 |
| 58 // PerformanceResourceTiming overrides: | 64 // PerformanceResourceTiming overrides: |
| 59 DOMHighResTimeStamp fetchStart() const override; | 65 DOMHighResTimeStamp fetchStart() const override; |
| 60 DOMHighResTimeStamp redirectStart() const override; | 66 DOMHighResTimeStamp redirectStart() const override; |
| 61 DOMHighResTimeStamp redirectEnd() const override; | 67 DOMHighResTimeStamp redirectEnd() const override; |
| 62 DOMHighResTimeStamp responseEnd() const override; | 68 DOMHighResTimeStamp responseEnd() const override; |
| 63 | 69 |
| 70 DECLARE_VIRTUAL_TRACE(); | |
| 71 | |
| 64 protected: | 72 protected: |
| 65 void buildJSONValue(V8ObjectBuilder&) const override; | 73 void buildJSONValue(V8ObjectBuilder&) const override; |
| 66 | 74 |
| 67 private: | 75 private: |
| 68 ~PerformanceNavigationTiming() override; | 76 ~PerformanceNavigationTiming() override; |
| 69 | 77 |
| 78 static AtomicString getNavigationType(NavigationType, const Document*); | |
| 79 | |
| 80 const DocumentTiming* documentTiming() const; | |
| 81 DocumentLoader* documentLoader() const; | |
| 82 DocumentLoadTiming* documentLoadTiming() const; | |
| 83 ExecutionContext* getExecutionContext() const; | |
| 84 | |
| 85 bool getAllowRedirectDetails() const; | |
| 86 | |
| 87 ResourceLoadTiming* resourceLoadTiming() const; | |
| 88 | |
| 70 double m_timeOrigin; | 89 double m_timeOrigin; |
| 71 double m_unloadEventStart; | 90 RefPtr<ResourceTimingInfo> m_resourceTimingInfo; |
| 72 double m_unloadEventEnd; | 91 WeakMember<LocalFrame> m_frame; |
| 73 double m_loadEventStart; | |
| 74 double m_loadEventEnd; | |
| 75 unsigned short m_redirectCount; | |
| 76 double m_domInteractive; | |
| 77 double m_domContentLoadedEventStart; | |
| 78 double m_domContentLoadedEventEnd; | |
| 79 double m_domComplete; | |
| 80 NavigationType m_type; | |
| 81 double m_redirectStart; | |
| 82 double m_redirectEnd; | |
| 83 double m_fetchStart; | |
| 84 double m_responseEnd; | |
| 85 bool m_allowRedirectDetails; | |
| 86 bool m_hasSameOriginAsPreviousDocument; | |
| 87 }; | 92 }; |
| 88 } // namespace blink | 93 } // namespace blink |
| 89 | 94 |
| 90 #endif // PerformanceNavigationTiming_h | 95 #endif // PerformanceNavigationTiming_h |
| OLD | NEW |