Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintTiming.h

Issue 2883273003: Move the user interaction policy for FirstMeaningfulPaint UMA into renderer (Closed)
Patch Set: crash fix Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(double stamp, bool was_after_user_input);
kinuko 2017/06/14 07:58:41 nit: can we use enum over bool? (Maybe define it
Kunihiko Sakamoto 2017/06/15 03:53:57 Done.
54 void NotifyPaint(bool is_first_paint, bool text_painted, bool image_painted); 54 void NotifyPaint(bool is_first_paint, bool text_painted, bool image_painted);
55 55
56 // The getters below return monotonically-increasing seconds, or zero if the 56 // The getters below return monotonically-increasing seconds, or zero if the
57 // given paint event has not yet occurred. See the comments for 57 // given paint event has not yet occurred. See the comments for
58 // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details. 58 // monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details.
59 59
60 // firstPaint returns the first time that anything was painted for the 60 // firstPaint returns the first time that anything was painted for the
61 // current document. 61 // current document.
62 double FirstPaint() const { return first_paint_; } 62 double FirstPaint() const { return first_paint_; }
63 63
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // mark*() or set*() methods to make sure that first paint is marked as part 103 // 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 104 // of marking first contentful paint, or that first contentful paint is
105 // marked as part of marking first text/image paint, for example. 105 // marked as part of marking first text/image paint, for example.
106 void SetFirstPaint(double stamp); 106 void SetFirstPaint(double stamp);
107 107
108 // setFirstContentfulPaint will also set first paint time if first paint 108 // setFirstContentfulPaint will also set first paint time if first paint
109 // time has not yet been recorded. 109 // time has not yet been recorded.
110 void SetFirstContentfulPaint(double stamp); 110 void SetFirstContentfulPaint(double stamp);
111 111
112 void RegisterNotifySwapTime(PaintEvent); 112 void RegisterNotifySwapTime(PaintEvent);
113 void ReportUserInputHistogram(bool had_input);
113 114
114 double first_paint_ = 0.0; 115 double first_paint_ = 0.0;
115 double first_paint_swap_ = 0.0; 116 double first_paint_swap_ = 0.0;
116 double first_text_paint_ = 0.0; 117 double first_text_paint_ = 0.0;
117 double first_image_paint_ = 0.0; 118 double first_image_paint_ = 0.0;
118 double first_contentful_paint_ = 0.0; 119 double first_contentful_paint_ = 0.0;
119 double first_contentful_paint_swap_ = 0.0; 120 double first_contentful_paint_swap_ = 0.0;
120 double first_meaningful_paint_ = 0.0; 121 double first_meaningful_paint_ = 0.0;
121 double first_meaningful_paint_swap_ = 0.0; 122 double first_meaningful_paint_swap_ = 0.0;
122 double first_meaningful_paint_candidate_ = 0.0; 123 double first_meaningful_paint_candidate_ = 0.0;
123 124
124 Member<FirstMeaningfulPaintDetector> fmp_detector_; 125 Member<FirstMeaningfulPaintDetector> fmp_detector_;
125 }; 126 };
126 127
127 } // namespace blink 128 } // namespace blink
128 129
129 #endif 130 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698