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 #ifndef PaintTiming_h | 5 #ifndef PaintTiming_h |
6 #define PaintTiming_h | 6 #define PaintTiming_h |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/paint/FirstMeaningfulPaintDetector.h" | 9 #include "core/paint/FirstMeaningfulPaintDetector.h" |
10 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 // markFirstTextPaint, markFirstImagePaint, and markFirstContentfulPaint | 37 // markFirstTextPaint, markFirstImagePaint, and markFirstContentfulPaint |
38 // will also record first paint if first paint hasn't been recorded yet. | 38 // will also record first paint if first paint hasn't been recorded yet. |
39 void markFirstContentfulPaint(); | 39 void markFirstContentfulPaint(); |
40 | 40 |
41 // markFirstTextPaint and markFirstImagePaint will also record first | 41 // markFirstTextPaint and markFirstImagePaint will also record first |
42 // contentful paint if first contentful paint hasn't been recorded yet. | 42 // contentful paint if first contentful paint hasn't been recorded yet. |
43 void markFirstTextPaint(); | 43 void markFirstTextPaint(); |
44 void markFirstImagePaint(); | 44 void markFirstImagePaint(); |
45 | 45 |
46 void markFirstMeaningfulPaintCandidate(); | |
46 void setFirstMeaningfulPaint(double stamp); | 47 void setFirstMeaningfulPaint(double stamp); |
47 void notifyPaint(bool isFirstPaint, bool textPainted, bool imagePainted); | 48 void notifyPaint(bool isFirstPaint, bool textPainted, bool imagePainted); |
48 | 49 |
49 // The getters below return monotonically-increasing seconds, or zero if the | 50 // The getters below return monotonically-increasing seconds, or zero if the |
50 // given paint event has not yet occurred. See the comments for | 51 // given paint event has not yet occurred. See the comments for |
51 // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details. | 52 // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details. |
52 | 53 |
53 // firstPaint returns the first time that anything was painted for the | 54 // firstPaint returns the first time that anything was painted for the |
54 // current document. | 55 // current document. |
55 double firstPaint() const { return m_firstPaint; } | 56 double firstPaint() const { return m_firstPaint; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 // setFirstContentfulPaint will also set first paint time if first paint | 93 // setFirstContentfulPaint will also set first paint time if first paint |
93 // time has not yet been recorded. | 94 // time has not yet been recorded. |
94 void setFirstContentfulPaint(double stamp); | 95 void setFirstContentfulPaint(double stamp); |
95 | 96 |
96 double m_firstPaint = 0.0; | 97 double m_firstPaint = 0.0; |
97 double m_firstTextPaint = 0.0; | 98 double m_firstTextPaint = 0.0; |
98 double m_firstImagePaint = 0.0; | 99 double m_firstImagePaint = 0.0; |
99 double m_firstContentfulPaint = 0.0; | 100 double m_firstContentfulPaint = 0.0; |
100 double m_firstMeaningfulPaint = 0.0; | 101 double m_firstMeaningfulPaint = 0.0; |
101 | 102 |
103 bool m_seenFirstMeaningfulPaintCandidate = false; | |
kouhei (in TOK)
2016/11/30 01:30:20
We prefer this flag/logic to be inside FirstMeanin
kouhei (in TOK)
2016/11/30 01:36:52
Chatted offline w/ ksakamoto.
I think we have two
Sami
2016/11/30 18:07:09
Great example :)
| |
104 | |
102 Member<Document> m_document; | 105 Member<Document> m_document; |
103 Member<FirstMeaningfulPaintDetector> m_fmpDetector; | 106 Member<FirstMeaningfulPaintDetector> m_fmpDetector; |
104 }; | 107 }; |
105 | 108 |
106 } // namespace blink | 109 } // namespace blink |
107 | 110 |
108 #endif | 111 #endif |
OLD | NEW |