| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 setFirstContentfulPaint(monotonicallyIncreasingTime()); | 44 setFirstContentfulPaint(monotonicallyIncreasingTime()); |
| 45 notifyPaintTimingChanged(); | 45 notifyPaintTimingChanged(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void PaintTiming::markFirstTextPaint() | 48 void PaintTiming::markFirstTextPaint() |
| 49 { | 49 { |
| 50 if (m_firstTextPaint != 0.0) | 50 if (m_firstTextPaint != 0.0) |
| 51 return; | 51 return; |
| 52 m_firstTextPaint = monotonicallyIncreasingTime(); | 52 m_firstTextPaint = monotonicallyIncreasingTime(); |
| 53 setFirstContentfulPaint(m_firstTextPaint); | 53 setFirstContentfulPaint(m_firstTextPaint); |
| 54 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing", "firstTextPaint", m_fi
rstTextPaint, "frame", frame()); | 54 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "firstTextPaint",
m_firstTextPaint, "frame", frame()); |
| 55 notifyPaintTimingChanged(); | 55 notifyPaintTimingChanged(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void PaintTiming::markFirstImagePaint() | 58 void PaintTiming::markFirstImagePaint() |
| 59 { | 59 { |
| 60 if (m_firstImagePaint != 0.0) | 60 if (m_firstImagePaint != 0.0) |
| 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,rail", "firstImagePaint"
, m_firstImagePaint, "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 Supplement<Document>::trace(visitor); |
| 72 } | 72 } |
| 73 | 73 |
| 74 PaintTiming::PaintTiming(Document& document) | 74 PaintTiming::PaintTiming(Document& document) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 85 { | 85 { |
| 86 if (m_document && m_document->loader()) | 86 if (m_document && m_document->loader()) |
| 87 m_document->loader()->didChangePerformanceTiming(); | 87 m_document->loader()->didChangePerformanceTiming(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void PaintTiming::setFirstPaint(double stamp) | 90 void PaintTiming::setFirstPaint(double stamp) |
| 91 { | 91 { |
| 92 if (m_firstPaint != 0.0) | 92 if (m_firstPaint != 0.0) |
| 93 return; | 93 return; |
| 94 m_firstPaint = stamp; | 94 m_firstPaint = stamp; |
| 95 TRACE_EVENT_INSTANT1("blink.user_timing", "firstPaint", TRACE_EVENT_SCOPE_PR
OCESS, "frame", frame()); | 95 TRACE_EVENT_INSTANT1("blink.user_timing,rail", "firstPaint", TRACE_EVENT_SCO
PE_PROCESS, "frame", frame()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void PaintTiming::setFirstContentfulPaint(double stamp) | 98 void PaintTiming::setFirstContentfulPaint(double stamp) |
| 99 { | 99 { |
| 100 if (m_firstContentfulPaint != 0.0) | 100 if (m_firstContentfulPaint != 0.0) |
| 101 return; | 101 return; |
| 102 setFirstPaint(stamp); | 102 setFirstPaint(stamp); |
| 103 m_firstContentfulPaint = stamp; | 103 m_firstContentfulPaint = stamp; |
| 104 TRACE_EVENT_INSTANT1("blink.user_timing", "firstContentfulPaint", TRACE_EVEN
T_SCOPE_PROCESS, "frame", frame()); | 104 TRACE_EVENT_INSTANT1("blink.user_timing,rail", "firstContentfulPaint", TRACE
_EVENT_SCOPE_PROCESS, "frame", frame()); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |