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/fetch/ResourceFetcher.h" | |
10 #include "core/paint/PaintTiming.h" | 9 #include "core/paint/PaintTiming.h" |
11 #include "platform/instrumentation/tracing/TraceEvent.h" | 10 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 11 #include "platform/loader/fetch/ResourceFetcher.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Web fonts that laid out more than this number of characters block First | 17 // Web fonts that laid out more than this number of characters block First |
18 // Meaningful Paint. | 18 // Meaningful Paint. |
19 const int kBlankCharactersThreshold = 200; | 19 const int kBlankCharactersThreshold = 200; |
20 | 20 |
21 // FirstMeaningfulPaintDetector stops observing layouts and reports First | 21 // FirstMeaningfulPaintDetector stops observing layouts and reports First |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 if (m_provisionalFirstMeaningfulPaint) | 125 if (m_provisionalFirstMeaningfulPaint) |
126 m_paintTiming->setFirstMeaningfulPaint(m_provisionalFirstMeaningfulPaint); | 126 m_paintTiming->setFirstMeaningfulPaint(m_provisionalFirstMeaningfulPaint); |
127 m_state = Reported; | 127 m_state = Reported; |
128 } | 128 } |
129 | 129 |
130 DEFINE_TRACE(FirstMeaningfulPaintDetector) { | 130 DEFINE_TRACE(FirstMeaningfulPaintDetector) { |
131 visitor->trace(m_paintTiming); | 131 visitor->trace(m_paintTiming); |
132 } | 132 } |
133 | 133 |
134 } // namespace blink | 134 } // namespace blink |
OLD | NEW |