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

Unified Diff: content/browser/frame_host/render_widget_host_view_child_frame.h

Issue 1635513003: Implement webview.captureVisibleRegion() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove WaitForFirstFrame() from browser_test_utils (cleanup). Created 4 years, 11 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: content/browser/frame_host/render_widget_host_view_child_frame.h
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h
index 4bacd21f3d8aa0a7d73a590537f9c03b58e4c085..f8fcdb877d60f9f6fd8afe89950e2627f1ba348e 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.h
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.h
@@ -8,8 +8,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <deque>
#include <vector>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
@@ -58,6 +60,12 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
frame_connector_ = frame_connector;
}
+ // This functions registers single-use callbacks that want to be notified when
+ // the next frame is drawn. Once called, the callback pointer is released.
+ // TODO(wjmaclean): We should consider making this available in other view
+ // types, such as RenderWidgetHostViewAura.
ncarter (slow) 2016/01/27 21:08:25 This seems fairly similar in purpose to RenderWidg
wjmaclean 2016/01/27 21:28:01 Are you suggesting we re-write RenderWidgetHostVie
ncarter (slow) 2016/01/28 20:49:58 My main intent was to call attention to the Render
miu 2016/02/04 20:19:11 Agreed. I have it on my roadmap this year to do s
+ void RegisterFrameDrawnCallback(scoped_ptr<base::Closure> callback);
ncarter (slow) 2016/01/27 21:08:25 In the webview case, is there really necessarily a
wjmaclean 2016/01/27 21:28:01 I'm not entirely sure, though I suspect the surfac
ncarter (slow) 2016/01/28 20:49:58 OK.
miu 2016/02/04 20:19:10 My understanding here is that the Compositor will
+
// RenderWidgetHostView implementation.
void InitAsChild(gfx::NativeView parent_view) override;
RenderWidgetHost* GetRenderWidgetHost() const override;
@@ -206,6 +214,15 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
}
private:
+ void SubmitSurfaceCopyRequest(const gfx::Rect& src_subrect,
+ const gfx::Size& dst_size,
+ const ReadbackRequestCallback& callback,
+ const SkColorType preferred_color_type);
+
+ using FrameDrawnCallbackList = std::deque<scoped_ptr<base::Closure>>;
+ // Since frame-drawn callbacks are "fire once", we use std::deque to make
+ // it convenient to swap() when processing the list.
+ FrameDrawnCallbackList frame_drawn_callbacks_;
base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame);
};

Powered by Google App Engine
This is Rietveld 408576698