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

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

Issue 2528513003: first-paint and first-contentful paint (Closed)
Patch Set: updated layout tests Created 4 years 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 "core/timing/PerformancePaintTiming.h"
10 #include "platform/Supplementable.h" 11 #include "platform/Supplementable.h"
11 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
12 #include "wtf/Noncopyable.h" 13 #include "wtf/Noncopyable.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 class LocalFrame; 17 class LocalFrame;
17 18
18 // PaintTiming is responsible for tracking paint-related timings for a given 19 // PaintTiming is responsible for tracking paint-related timings for a given
19 // document. 20 // document.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void notifyPaintTimingChanged(); 83 void notifyPaintTimingChanged();
83 84
84 // set*() set the timing for the given paint event to the given timestamp 85 // set*() set the timing for the given paint event to the given timestamp
85 // and record a trace event if the value is currently zero, but do not 86 // and record a trace event if the value is currently zero, but do not
86 // notify that paint timing changed. These methods can be invoked from other 87 // notify that paint timing changed. These methods can be invoked from other
87 // mark*() or set*() methods to make sure that first paint is marked as part 88 // mark*() or set*() methods to make sure that first paint is marked as part
88 // of marking first contentful paint, or that first contentful paint is 89 // of marking first contentful paint, or that first contentful paint is
89 // marked as part of marking first text/image paint, for example. 90 // marked as part of marking first text/image paint, for example.
90 void setFirstPaint(double stamp); 91 void setFirstPaint(double stamp);
91 92
93 void addPaintTimingToPerformance(PerformancePaintTiming::PaintType,
94 double stamp) const;
95
92 // setFirstContentfulPaint will also set first paint time if first paint 96 // setFirstContentfulPaint will also set first paint time if first paint
93 // time has not yet been recorded. 97 // time has not yet been recorded.
94 void setFirstContentfulPaint(double stamp); 98 void setFirstContentfulPaint(double stamp);
95 99
96 double m_firstPaint = 0.0; 100 double m_firstPaint = 0.0;
97 double m_firstTextPaint = 0.0; 101 double m_firstTextPaint = 0.0;
98 double m_firstImagePaint = 0.0; 102 double m_firstImagePaint = 0.0;
99 double m_firstContentfulPaint = 0.0; 103 double m_firstContentfulPaint = 0.0;
100 double m_firstMeaningfulPaint = 0.0; 104 double m_firstMeaningfulPaint = 0.0;
101 105
102 Member<Document> m_document; 106 Member<Document> m_document;
103 Member<FirstMeaningfulPaintDetector> m_fmpDetector; 107 Member<FirstMeaningfulPaintDetector> m_fmpDetector;
104 }; 108 };
105 109
106 } // namespace blink 110 } // namespace blink
107 111
108 #endif 112 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698