OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/dom/DocumentTiming.h" | 6 #include "core/dom/DocumentTiming.h" |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/loader/DocumentLoader.h" | 9 #include "core/loader/DocumentLoader.h" |
10 #include "platform/TraceEvent.h" | 10 #include "platform/TraceEvent.h" |
11 #include "wtf/RawPtr.h" | 11 #include "wtf/RawPtr.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 DocumentTiming::DocumentTiming(Document& document) | 15 DocumentTiming::DocumentTiming(Document& document) |
16 : m_domLoading(0.0) | 16 : m_domLoading(0.0) |
17 , m_domInteractive(0.0) | 17 , m_domInteractive(0.0) |
18 , m_domContentLoadedEventStart(0.0) | 18 , m_domContentLoadedEventStart(0.0) |
19 , m_domContentLoadedEventEnd(0.0) | 19 , m_domContentLoadedEventEnd(0.0) |
20 , m_domComplete(0.0) | 20 , m_domComplete(0.0) |
21 , m_firstLayout(0.0) | 21 , m_firstLayout(0.0) |
| 22 , m_firstNonBlankText(0.0) |
| 23 , m_firstCustomFontText(0.0) |
22 , m_document(document) | 24 , m_document(document) |
23 { | 25 { |
24 } | 26 } |
25 | 27 |
26 DEFINE_TRACE(DocumentTiming) | 28 DEFINE_TRACE(DocumentTiming) |
27 { | 29 { |
28 visitor->trace(m_document); | 30 visitor->trace(m_document); |
29 } | 31 } |
30 | 32 |
31 void DocumentTiming::notifyDocumentTimingChanged() | 33 void DocumentTiming::notifyDocumentTimingChanged() |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 notifyDocumentTimingChanged(); | 71 notifyDocumentTimingChanged(); |
70 } | 72 } |
71 | 73 |
72 void DocumentTiming::markFirstLayout() | 74 void DocumentTiming::markFirstLayout() |
73 { | 75 { |
74 m_firstLayout = monotonicallyIncreasingTime(); | 76 m_firstLayout = monotonicallyIncreasingTime(); |
75 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstLayout", m_firstL
ayout); | 77 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstLayout", m_firstL
ayout); |
76 notifyDocumentTimingChanged(); | 78 notifyDocumentTimingChanged(); |
77 } | 79 } |
78 | 80 |
| 81 void DocumentTiming::markFirstNonBlankText() |
| 82 { |
| 83 m_firstNonBlankText = monotonicallyIncreasingTime(); |
| 84 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstNonBlankText", m_
firstNonBlankText); |
| 85 notifyDocumentTimingChanged(); |
| 86 } |
| 87 |
| 88 void DocumentTiming::markFirstCustomFontText() |
| 89 { |
| 90 m_firstCustomFontText = monotonicallyIncreasingTime(); |
| 91 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstCustomFontText",
m_firstCustomFontText); |
| 92 notifyDocumentTimingChanged(); |
| 93 } |
| 94 |
79 } // namespace blink | 95 } // namespace blink |
OLD | NEW |