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

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: moved layout test to external/wpt directory 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..713f0d60a0e4a85e046b0c0364d3e1c63ac3de05 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h
+++ b/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h
@@ -7,43 +7,36 @@
#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 +54,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;
+ static AtomicString getNavigationType(NavigationType, const Document*);
+ 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;
+ WeakMember<LocalFrame> m_frame;
haraken 2017/03/14 20:10:40 I guess this should just be a Member. Is there an
sunjian 2017/03/14 23:59:53 I guess i wasn't taking who outlives whom into con
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698