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 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 DocumentTiming::DocumentTiming(WeakPtrWillBeRawPtr<Document> document) | 14 DocumentTiming::DocumentTiming(WeakPtrWillBeRawPtr<Document> document) |
15 : m_domLoading(0.0) | 15 : m_domLoading(0.0) |
16 , m_domInteractive(0.0) | 16 , m_domInteractive(0.0) |
17 , m_domContentLoadedEventStart(0.0) | 17 , m_domContentLoadedEventStart(0.0) |
18 , m_domContentLoadedEventEnd(0.0) | 18 , m_domContentLoadedEventEnd(0.0) |
19 , m_domComplete(0.0) | 19 , m_domComplete(0.0) |
20 , m_firstLayout(0.0) | 20 , m_firstLayout(0.0) |
21 , m_document(document) | 21 , m_document(document) |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
| 25 DEFINE_TRACE(DocumentTiming) |
| 26 { |
| 27 visitor->trace(m_document); |
| 28 } |
| 29 |
25 void DocumentTiming::notifyDocumentTimingChanged() | 30 void DocumentTiming::notifyDocumentTimingChanged() |
26 { | 31 { |
27 if (m_document && m_document->loader()) | 32 if (m_document && m_document->loader()) |
28 m_document->loader()->didChangePerformanceTiming(); | 33 m_document->loader()->didChangePerformanceTiming(); |
29 } | 34 } |
30 | 35 |
31 void DocumentTiming::markDomLoading() | 36 void DocumentTiming::markDomLoading() |
32 { | 37 { |
33 m_domLoading = monotonicallyIncreasingTime(); | 38 m_domLoading = monotonicallyIncreasingTime(); |
34 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domLoading", m_domLoad
ing); | 39 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "domLoading", m_domLoad
ing); |
(...skipping 29 matching lines...) Expand all Loading... |
64 } | 69 } |
65 | 70 |
66 void DocumentTiming::markFirstLayout() | 71 void DocumentTiming::markFirstLayout() |
67 { | 72 { |
68 m_firstLayout = monotonicallyIncreasingTime(); | 73 m_firstLayout = monotonicallyIncreasingTime(); |
69 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstLayout", m_firstL
ayout); | 74 TRACE_EVENT_MARK_WITH_TIMESTAMP("blink.user_timing", "firstLayout", m_firstL
ayout); |
70 notifyDocumentTimingChanged(); | 75 notifyDocumentTimingChanged(); |
71 } | 76 } |
72 | 77 |
73 } // namespace blink | 78 } // namespace blink |
OLD | NEW |