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

Unified Diff: Source/core/dom/DocumentTiming.cpp

Issue 1288973002: Observing DocumentTiming and sending data to RenderFrameImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: minor edits from review Created 5 years, 4 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: 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

Powered by Google App Engine
This is Rietveld 408576698