| 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 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return; | 61 return; |
| 62 m_firstImagePaint = monotonicallyIncreasingTime(); | 62 m_firstImagePaint = monotonicallyIncreasingTime(); |
| 63 setFirstContentfulPaint(m_firstImagePaint); | 63 setFirstContentfulPaint(m_firstImagePaint); |
| 64 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing", "firstImagePaint", m_f
irstImagePaint, "frame", frame()); | 64 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing", "firstImagePaint", m_f
irstImagePaint, "frame", frame()); |
| 65 notifyPaintTimingChanged(); | 65 notifyPaintTimingChanged(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 DEFINE_TRACE(PaintTiming) | 68 DEFINE_TRACE(PaintTiming) |
| 69 { | 69 { |
| 70 visitor->trace(m_document); | 70 visitor->trace(m_document); |
| 71 Supplement<Document>::trace(visitor); |
| 71 } | 72 } |
| 72 | 73 |
| 73 PaintTiming::PaintTiming(Document& document) | 74 PaintTiming::PaintTiming(Document& document) |
| 74 : m_document(document) | 75 : m_document(document) |
| 75 { | 76 { |
| 76 } | 77 } |
| 77 | 78 |
| 78 LocalFrame* PaintTiming::frame() const | 79 LocalFrame* PaintTiming::frame() const |
| 79 { | 80 { |
| 80 return m_document ? m_document->frame() : nullptr; | 81 return m_document ? m_document->frame() : nullptr; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 97 void PaintTiming::setFirstContentfulPaint(double stamp) | 98 void PaintTiming::setFirstContentfulPaint(double stamp) |
| 98 { | 99 { |
| 99 if (m_firstContentfulPaint != 0.0) | 100 if (m_firstContentfulPaint != 0.0) |
| 100 return; | 101 return; |
| 101 setFirstPaint(stamp); | 102 setFirstPaint(stamp); |
| 102 m_firstContentfulPaint = stamp; | 103 m_firstContentfulPaint = stamp; |
| 103 TRACE_EVENT_INSTANT1("blink.user_timing", "firstContentfulPaint", TRACE_EVEN
T_SCOPE_PROCESS, "frame", frame()); | 104 TRACE_EVENT_INSTANT1("blink.user_timing", "firstContentfulPaint", TRACE_EVEN
T_SCOPE_PROCESS, "frame", frame()); |
| 104 } | 105 } |
| 105 | 106 |
| 106 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |