Index: content/browser/renderer_host/render_widget_host_view_android.h |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h |
index 7601adc1fa752a5ef6551c50d25171c5a68f824d..7ed5bcbf664cfb6c8eddf7a922e37d1f178e2b2f 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.h |
+++ b/content/browser/renderer_host/render_widget_host_view_android.h |
@@ -58,6 +58,29 @@ class RenderWidgetHostImpl; |
struct DidOverscrollParams; |
struct NativeWebKeyboardEvent; |
+class ReadbackRequest { |
+ public: |
+ explicit ReadbackRequest( |
+ float scale, |
+ SkColorType color_type, |
+ gfx::Rect src_subrect, |
+ const base::Callback<void(bool, const SkBitmap&)>& result_callback); |
+ ~ReadbackRequest(); |
+ float GetScale() { return scale_; } |
+ SkColorType GetColorFormat() { return color_type_; } |
+ const gfx::Rect GetCaptureRect() { return src_subrect_; } |
+ const base::Callback<void(bool, const SkBitmap&)>& GetResultCallback() { |
+ return result_callback_; |
+ } |
+ |
+ private: |
+ ReadbackRequest(); |
+ float scale_; |
+ SkColorType color_type_; |
+ gfx::Rect src_subrect_; |
+ base::Callback<void(bool, const SkBitmap&)> result_callback_; |
+}; |
+ |
// ----------------------------------------------------------------------------- |
// See comments in render_widget_host_view.h about this class and its members. |
// ----------------------------------------------------------------------------- |
@@ -317,6 +340,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
float GetDpiScale() const; |
+ // Handles all unprocessed and pending readback requests. |
+ void AbortPendingReadbackRequests(); |
+ |
// The model object. |
RenderWidgetHostImpl* host_; |
@@ -393,6 +419,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
+ // List of readbackrequests waiting for arrival of a valid frame. |
+ std::queue<ReadbackRequest> readbacks_waiting_for_frame_; |
+ |
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
}; |