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

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

Issue 1456883002: Move paint-related timings out of DocumentTiming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
new file mode 100644
index 0000000000000000000000000000000000000000..63366093a7348dd97222defbcca5ce569d86c399
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/PaintTiming.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PaintTiming_h
+#define PaintTiming_h
+
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class Document;
+class LocalFrame;
+
+class PaintTiming final : public NoBaseWillBeGarbageCollectedFinalized<PaintTiming>, public WillBeHeapSupplement<Document> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PaintTiming);
+public:
+ virtual ~PaintTiming() { }
+
+ static PaintTiming& from(Document&);
+
+ void markFirstPaint();
+ void markFirstTextPaint();
+ void markFirstImagePaint();
+
+ // These return monotonically-increasing seconds.
+ double firstPaint() const { return m_firstPaint; }
+ double firstTextPaint() const { return m_firstTextPaint; }
+ double firstImagePaint() const { return m_firstImagePaint; }
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ explicit PaintTiming(Document&);
+ LocalFrame* frame() const;
+ void notifyPaintTimingChanged();
+
+ double m_firstPaint = 0.0;
+ double m_firstTextPaint = 0.0;
+ double m_firstImagePaint = 0.0;
+
+ RawPtrWillBeMember<Document> m_document;
+};
+
+}
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintTiming.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698