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 |