Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h

Issue 2647643004: Report nav timing 2 instance as soon as it's requested. (Closed)
Patch Set: add TODO Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
index c26ba4b1d3aa00270416844ff3e17241c1ff14df..62f2f15c6a54b2884eeada9d80b4d9d939316d2e 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h
+++ b/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h
@@ -7,43 +7,38 @@
#include "core/CoreExport.h"
#include "core/dom/DOMHighResTimeStamp.h"
+#include "core/loader/FrameLoaderTypes.h"
#include "core/timing/PerformanceResourceTiming.h"
namespace blink {
+class Document;
+class DocumentTiming;
+class DocumentLoader;
+class DocumentLoadTiming;
+class LocalFrame;
+class ExecutionContext;
+class ResourceTimingInfo;
+class ResourceLoadTiming;
+
class CORE_EXPORT PerformanceNavigationTiming final
: public PerformanceResourceTiming {
DEFINE_WRAPPERTYPEINFO();
+ friend class PerformanceNavigationTimingTest;
public:
enum class NavigationType { Navigate, Reload, BackForward, Prerender };
- PerformanceNavigationTiming(double timeOrigin,
- const String& requestedUrl,
- double unloadEventStart,
- double unloadEventEnd,
- double loadEventStart,
- double loadEventEnd,
- unsigned short redirectCount,
- double domInteractive,
- double domContentLoadedEventStart,
- double domContentLoadedEventEnd,
- double domComplete,
- NavigationType,
- double redirectStart,
- double redirectEnd,
- double fetchStart,
- double responseEnd,
- bool allowRedirectDetails,
- bool hasSameOriginAsPreviousDocument,
- ResourceLoadTiming*,
- double lastRedirectEndTime,
- double finishTime,
- unsigned long long transferSize,
- unsigned long long encodedBodyLength,
- unsigned long long decodedBodyLength,
- bool didReuseConnection);
+ PerformanceNavigationTiming(LocalFrame*,
+ ResourceTimingInfo*,
+ double timeOrigin);
+
+ // Attributes inheritted from PerformanceEntry.
+ DOMHighResTimeStamp duration() const override;
+ AtomicString initiatorType() const override;
+
+ // PerformanceNavigationTiming's unique attributes.
DOMHighResTimeStamp unloadEventStart() const;
DOMHighResTimeStamp unloadEventEnd() const;
DOMHighResTimeStamp domInteractive() const;
@@ -61,29 +56,31 @@ class CORE_EXPORT PerformanceNavigationTiming final
DOMHighResTimeStamp redirectEnd() const override;
DOMHighResTimeStamp responseEnd() const override;
+ DECLARE_VIRTUAL_TRACE();
+
protected:
void buildJSONValue(V8ObjectBuilder&) const override;
private:
~PerformanceNavigationTiming() override;
+ const DocumentTiming* documentTiming() const;
+ DocumentLoader* documentLoader() const;
+ DocumentLoadTiming* documentLoadTiming() const;
+
+ virtual ResourceLoadTiming* resourceLoadTiming() const;
+ virtual bool allowTimingDetails() const;
+ virtual bool didReuseConnection() const;
+ virtual unsigned long long getTransferSize() const;
+ virtual unsigned long long getEncodedBodySize() const;
+ virtual unsigned long long getDecodedBodySize() const;
+
+ bool getAllowRedirectDetails() const;
+
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;
- NavigationType m_type;
- double m_redirectStart;
- double m_redirectEnd;
- double m_fetchStart;
- double m_responseEnd;
- bool m_allowRedirectDetails;
- bool m_hasSameOriginAsPreviousDocument;
+ RefPtr<ResourceTimingInfo> m_resourceTimingInfo;
+ // TODO(sunjian): Investigate why not using a Member instead.
+ WeakMember<LocalFrame> m_frame;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698