| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/FirstMeaningfulPaintDetector.h" | 5 #include "core/paint/FirstMeaningfulPaintDetector.h" |
| 6 | 6 |
| 7 #include "core/css/FontFaceSet.h" | 7 #include "core/css/FontFaceSet.h" |
| 8 #include "core/dom/TaskRunnerHelper.h" | 8 #include "core/dom/TaskRunnerHelper.h" |
| 9 #include "core/paint/PaintTiming.h" | 9 #include "core/paint/PaintTiming.h" |
| 10 #include "platform/Histogram.h" | 10 #include "platform/Histogram.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (m_paintTiming->firstPaint() == 0.0) | 92 if (m_paintTiming->firstPaint() == 0.0) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 m_provisionalFirstMeaningfulPaint = monotonicallyIncreasingTime(); | 95 m_provisionalFirstMeaningfulPaint = monotonicallyIncreasingTime(); |
| 96 m_nextPaintIsMeaningful = false; | 96 m_nextPaintIsMeaningful = false; |
| 97 | 97 |
| 98 if (m_network2QuietReached) | 98 if (m_network2QuietReached) |
| 99 return; | 99 return; |
| 100 | 100 |
| 101 TRACE_EVENT_MARK_WITH_TIMESTAMP1( | 101 TRACE_EVENT_MARK_WITH_TIMESTAMP1( |
| 102 "loading", "firstMeaningfulPaintCandidate", | 102 "loading,devtools.timeline", "firstMeaningfulPaintCandidate", |
| 103 TraceEvent::toTraceTimestamp(m_provisionalFirstMeaningfulPaint), "frame", | 103 TraceEvent::toTraceTimestamp(m_provisionalFirstMeaningfulPaint), "frame", |
| 104 document()->frame()); | 104 document()->frame()); |
| 105 // Ignore the first meaningful paint candidate as this generally is the first | 105 // Ignore the first meaningful paint candidate as this generally is the first |
| 106 // contentful paint itself. | 106 // contentful paint itself. |
| 107 if (!m_seenFirstMeaningfulPaintCandidate) { | 107 if (!m_seenFirstMeaningfulPaintCandidate) { |
| 108 m_seenFirstMeaningfulPaintCandidate = true; | 108 m_seenFirstMeaningfulPaintCandidate = true; |
| 109 return; | 109 return; |
| 110 } | 110 } |
| 111 m_paintTiming->setFirstMeaningfulPaintCandidate( | 111 m_paintTiming->setFirstMeaningfulPaintCandidate( |
| 112 m_provisionalFirstMeaningfulPaint); | 112 m_provisionalFirstMeaningfulPaint); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } else if (m_firstMeaningfulPaint2Quiet) { | 221 } else if (m_firstMeaningfulPaint2Quiet) { |
| 222 hadNetworkQuietHistogram.count(HadNetwork2Quiet); | 222 hadNetworkQuietHistogram.count(HadNetwork2Quiet); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 DEFINE_TRACE(FirstMeaningfulPaintDetector) { | 226 DEFINE_TRACE(FirstMeaningfulPaintDetector) { |
| 227 visitor->trace(m_paintTiming); | 227 visitor->trace(m_paintTiming); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |