| Index: Source/core/dom/DocumentTiming.cpp
|
| diff --git a/Source/core/dom/DocumentTiming.cpp b/Source/core/dom/DocumentTiming.cpp
|
| index 33356c277d1648357bf2eb5f3fcf51e8fab1b28a..199426fbb07a4b7eb005fb8a2a03e923214e6dfe 100644
|
| --- a/Source/core/dom/DocumentTiming.cpp
|
| +++ b/Source/core/dom/DocumentTiming.cpp
|
| @@ -4,21 +4,28 @@
|
|
|
| #include "config.h"
|
| #include "core/dom/DocumentTiming.h"
|
| +#include "core/dom/Document.h"
|
|
|
| #include "platform/TraceEvent.h"
|
|
|
| namespace blink {
|
|
|
| -DocumentTiming::DocumentTiming()
|
| +DocumentTiming::DocumentTiming(Observer* 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_observer(document)
|
| {
|
| }
|
|
|
| +void DocumentTiming::notifyDocumentTimingChanged()
|
| +{
|
| + m_observer->onDocumentTimingChanged();
|
| +}
|
| +
|
| void DocumentTiming::markDomLoading()
|
| {
|
| m_domLoading = monotonicallyIncreasingTime();
|
| @@ -29,30 +36,35 @@ 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
|
|
|