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

Unified Diff: third_party/WebKit/Source/core/paint/PaintTiming.h

Issue 2835763002: Use swap-promise to improve first* paint times (Closed)
Patch Set: address nit Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintTiming.h
diff --git a/third_party/WebKit/Source/core/paint/PaintTiming.h b/third_party/WebKit/Source/core/paint/PaintTiming.h
index ba2d02f7cd96fcccf423c505dcdc4fa2b7bbe70e..a9105d58ed9f5b87bb012b428be2086c9f5cbd23 100644
--- a/third_party/WebKit/Source/core/paint/PaintTiming.h
+++ b/third_party/WebKit/Source/core/paint/PaintTiming.h
@@ -26,6 +26,12 @@ class CORE_EXPORT PaintTiming final
public:
virtual ~PaintTiming() {}
+ enum class PaintEvent {
+ kFirstPaint,
+ kFirstContentfulPaint,
+ kFirstMeaningfulPaint
+ };
+
static PaintTiming& From(Document&);
// mark*() methods record the time for the given paint event, record a trace
@@ -82,6 +88,8 @@ class CORE_EXPORT PaintTiming final
return *fmp_detector_;
}
+ void ReportSwapTime(PaintEvent, bool did_swap, double timestamp);
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -101,11 +109,16 @@ class CORE_EXPORT PaintTiming final
// time has not yet been recorded.
void SetFirstContentfulPaint(double stamp);
+ void RegisterNotifySwapTime(PaintEvent);
+
double first_paint_ = 0.0;
+ double first_paint_swap_ = 0.0;
double first_text_paint_ = 0.0;
double first_image_paint_ = 0.0;
double first_contentful_paint_ = 0.0;
+ double first_contentful_paint_swap_ = 0.0;
double first_meaningful_paint_ = 0.0;
+ double first_meaningful_paint_swap_ = 0.0;
double first_meaningful_paint_candidate_ = 0.0;
Member<FirstMeaningfulPaintDetector> fmp_detector_;
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | third_party/WebKit/Source/core/paint/PaintTiming.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698