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

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

Issue 2872793002: Notify paint for each frame (Closed)
Patch Set: remove one comment 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/FramePaintTiming.h
diff --git a/third_party/WebKit/Source/core/paint/FramePaintTiming.h b/third_party/WebKit/Source/core/paint/FramePaintTiming.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c7e22630bb42005fd3f5139f605747cfcd1b899
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/FramePaintTiming.h
@@ -0,0 +1,41 @@
+// Copyright 2017 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 FramePaintTiming_h
+#define FramePaintTiming_h
+
+#include "core/frame/LocalFrame.h"
+#include "core/paint/PaintTiming.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/paint/PaintController.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class FramePaintTiming {
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(FramePaintTiming);
+
+ public:
+ FramePaintTiming(GraphicsContext& context, const LocalFrame* frame)
+ : context_(context), frame_(frame) {
+ context_.GetPaintController().BeginFrame(frame_);
+ }
+
+ ~FramePaintTiming() {
+ DCHECK(frame_->GetDocument());
+ FrameFirstPaint result = context_.GetPaintController().EndFrame(frame_);
+ PaintTiming::From(*frame_->GetDocument())
+ .NotifyPaint(result.first_painted, result.text_painted,
+ result.image_painted);
+ }
+
+ private:
+ GraphicsContext& context_;
+ Member<const LocalFrame> frame_;
+};
+
+} // namespace blink
+
+#endif // FramePaintTiming_h
« no previous file with comments | « third_party/WebKit/Source/core/paint/BUILD.gn ('k') | third_party/WebKit/Source/core/paint/FramePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698