| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // markFirstTextPaint, markFirstImagePaint, and markFirstContentfulPaint | 43 // markFirstTextPaint, markFirstImagePaint, and markFirstContentfulPaint |
| 44 // will also record first paint if first paint hasn't been recorded yet. | 44 // will also record first paint if first paint hasn't been recorded yet. |
| 45 void MarkFirstContentfulPaint(); | 45 void MarkFirstContentfulPaint(); |
| 46 | 46 |
| 47 // markFirstTextPaint and markFirstImagePaint will also record first | 47 // markFirstTextPaint and markFirstImagePaint will also record first |
| 48 // contentful paint if first contentful paint hasn't been recorded yet. | 48 // contentful paint if first contentful paint hasn't been recorded yet. |
| 49 void MarkFirstTextPaint(); | 49 void MarkFirstTextPaint(); |
| 50 void MarkFirstImagePaint(); | 50 void MarkFirstImagePaint(); |
| 51 | 51 |
| 52 void SetFirstMeaningfulPaintCandidate(double timestamp); | 52 void SetFirstMeaningfulPaintCandidate(double timestamp); |
| 53 void SetFirstMeaningfulPaint(double stamp); | 53 void SetFirstMeaningfulPaint( |
| 54 double stamp, |
| 55 FirstMeaningfulPaintDetector::HadUserInput had_input); |
| 54 void NotifyPaint(bool is_first_paint, bool text_painted, bool image_painted); | 56 void NotifyPaint(bool is_first_paint, bool text_painted, bool image_painted); |
| 55 | 57 |
| 56 // The getters below return monotonically-increasing seconds, or zero if the | 58 // The getters below return monotonically-increasing seconds, or zero if the |
| 57 // given paint event has not yet occurred. See the comments for | 59 // given paint event has not yet occurred. See the comments for |
| 58 // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details. | 60 // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details. |
| 59 | 61 |
| 60 // firstPaint returns the first time that anything was painted for the | 62 // firstPaint returns the first time that anything was painted for the |
| 61 // current document. | 63 // current document. |
| 62 double FirstPaint() const { return first_paint_; } | 64 double FirstPaint() const { return first_paint_; } |
| 63 | 65 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // mark*() or set*() methods to make sure that first paint is marked as part | 105 // mark*() or set*() methods to make sure that first paint is marked as part |
| 104 // of marking first contentful paint, or that first contentful paint is | 106 // of marking first contentful paint, or that first contentful paint is |
| 105 // marked as part of marking first text/image paint, for example. | 107 // marked as part of marking first text/image paint, for example. |
| 106 void SetFirstPaint(double stamp); | 108 void SetFirstPaint(double stamp); |
| 107 | 109 |
| 108 // setFirstContentfulPaint will also set first paint time if first paint | 110 // setFirstContentfulPaint will also set first paint time if first paint |
| 109 // time has not yet been recorded. | 111 // time has not yet been recorded. |
| 110 void SetFirstContentfulPaint(double stamp); | 112 void SetFirstContentfulPaint(double stamp); |
| 111 | 113 |
| 112 void RegisterNotifySwapTime(PaintEvent); | 114 void RegisterNotifySwapTime(PaintEvent); |
| 115 void ReportUserInputHistogram( |
| 116 FirstMeaningfulPaintDetector::HadUserInput had_input); |
| 113 | 117 |
| 114 double first_paint_ = 0.0; | 118 double first_paint_ = 0.0; |
| 115 double first_paint_swap_ = 0.0; | 119 double first_paint_swap_ = 0.0; |
| 116 double first_text_paint_ = 0.0; | 120 double first_text_paint_ = 0.0; |
| 117 double first_image_paint_ = 0.0; | 121 double first_image_paint_ = 0.0; |
| 118 double first_contentful_paint_ = 0.0; | 122 double first_contentful_paint_ = 0.0; |
| 119 double first_contentful_paint_swap_ = 0.0; | 123 double first_contentful_paint_swap_ = 0.0; |
| 120 double first_meaningful_paint_ = 0.0; | 124 double first_meaningful_paint_ = 0.0; |
| 121 double first_meaningful_paint_swap_ = 0.0; | 125 double first_meaningful_paint_swap_ = 0.0; |
| 122 double first_meaningful_paint_candidate_ = 0.0; | 126 double first_meaningful_paint_candidate_ = 0.0; |
| 123 | 127 |
| 124 Member<FirstMeaningfulPaintDetector> fmp_detector_; | 128 Member<FirstMeaningfulPaintDetector> fmp_detector_; |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 } // namespace blink | 131 } // namespace blink |
| 128 | 132 |
| 129 #endif | 133 #endif |
| OLD | NEW |