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 "core/paint/PaintTiming.h" | 5 #include "core/paint/PaintTiming.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/loader/DocumentLoader.h" | 8 #include "core/loader/DocumentLoader.h" |
9 #include "platform/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
10 #include "wtf/RawPtr.h" | |
11 | 10 |
12 namespace blink { | 11 namespace blink { |
13 | 12 |
14 static const char kSupplementName[] = "PaintTiming"; | 13 static const char kSupplementName[] = "PaintTiming"; |
15 | 14 |
16 PaintTiming& PaintTiming::from(Document& document) | 15 PaintTiming& PaintTiming::from(Document& document) |
17 { | 16 { |
18 PaintTiming* timing = static_cast<PaintTiming*>(Supplement<Document>::from(d
ocument, kSupplementName)); | 17 PaintTiming* timing = static_cast<PaintTiming*>(Supplement<Document>::from(d
ocument, kSupplementName)); |
19 if (!timing) { | 18 if (!timing) { |
20 timing = new PaintTiming(document); | 19 timing = new PaintTiming(document); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 void PaintTiming::setFirstContentfulPaint(double stamp) | 97 void PaintTiming::setFirstContentfulPaint(double stamp) |
99 { | 98 { |
100 if (m_firstContentfulPaint != 0.0) | 99 if (m_firstContentfulPaint != 0.0) |
101 return; | 100 return; |
102 setFirstPaint(stamp); | 101 setFirstPaint(stamp); |
103 m_firstContentfulPaint = stamp; | 102 m_firstContentfulPaint = stamp; |
104 TRACE_EVENT_INSTANT1("blink.user_timing", "firstContentfulPaint", TRACE_EVEN
T_SCOPE_PROCESS, "frame", frame()); | 103 TRACE_EVENT_INSTANT1("blink.user_timing", "firstContentfulPaint", TRACE_EVEN
T_SCOPE_PROCESS, "frame", frame()); |
105 } | 104 } |
106 | 105 |
107 } // namespace blink | 106 } // namespace blink |
OLD | NEW |