Index: Source/core/dom/DocumentTiming.cpp |
diff --git a/Source/core/dom/DocumentTiming.cpp b/Source/core/dom/DocumentTiming.cpp |
index 33356c277d1648357bf2eb5f3fcf51e8fab1b28a..8359b9cc801e8ec15b002b38a4a36980cc715173 100644 |
--- a/Source/core/dom/DocumentTiming.cpp |
+++ b/Source/core/dom/DocumentTiming.cpp |
@@ -5,54 +5,69 @@ |
#include "config.h" |
#include "core/dom/DocumentTiming.h" |
+#include "core/dom/Document.h" |
+#include "core/loader/DocumentLoader.h" |
#include "platform/TraceEvent.h" |
namespace blink { |
-DocumentTiming::DocumentTiming() |
+DocumentTiming::DocumentTiming(WeakPtrWillBeRawPtr<Document> document) |
: m_domLoading(0.0) |
, m_domInteractive(0.0) |
, m_domContentLoadedEventStart(0.0) |
, m_domContentLoadedEventEnd(0.0) |
, m_domComplete(0.0) |
, m_firstLayout(0.0) |
+ , m_document(document) |
{ |
} |
+void DocumentTiming::notifyDocumentTimingChanged() |
+{ |
+ if (m_document && m_document->loader()) |
+ m_document->loader()->didChangePerformanceTiming(); |
+} |
+ |
void DocumentTiming::markDomLoading() |
{ |
m_domLoading = monotonicallyIncreasingTime(); |
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domLoading", m_domLoading); |
+ notifyDocumentTimingChanged(); |
} |
void DocumentTiming::markDomInteractive() |
{ |
m_domInteractive = monotonicallyIncreasingTime(); |
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domInteractive", m_domInteractive); |
+ notifyDocumentTimingChanged(); |
} |
void DocumentTiming::markDomContentLoadedEventStart() |
{ |
m_domContentLoadedEventStart = monotonicallyIncreasingTime(); |
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domContentLoadedEventStart", m_domContentLoadedEventStart); |
+ notifyDocumentTimingChanged(); |
} |
void DocumentTiming::markDomContentLoadedEventEnd() |
{ |
m_domContentLoadedEventEnd = monotonicallyIncreasingTime(); |
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domContentLoadedEventEnd", m_domContentLoadedEventEnd); |
+ notifyDocumentTimingChanged(); |
} |
void DocumentTiming::markDomComplete() |
{ |
m_domComplete = monotonicallyIncreasingTime(); |
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domComplete", m_domComplete); |
+ notifyDocumentTimingChanged(); |
} |
void DocumentTiming::markFirstLayout() |
{ |
m_firstLayout = monotonicallyIncreasingTime(); |
TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstLayout", m_firstLayout); |
+ notifyDocumentTimingChanged(); |
} |
} // namespace blink |