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 37879af679bc6c3cb7d8dd889577a61e9fb242de..58383f044d1afc4beee035e5d9dfd58825290a2d 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.h |
+++ b/content/browser/renderer_host/render_widget_host_view_android.h |
@@ -175,6 +175,8 @@ class RenderWidgetHostViewAndroid |
const SkBitmap& zoomed_bitmap) OVERRIDE; |
virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() |
OVERRIDE; |
+ virtual void LockCompositingSurface() OVERRIDE; |
+ virtual void UnlockCompositingSurface() OVERRIDE; |
// Implementation of BrowserAccessibilityDelegate: |
virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; |
@@ -220,9 +222,6 @@ class RenderWidgetHostViewAndroid |
void OnSetNeedsBeginFrame(bool enabled); |
void OnSmartClipDataExtracted(const base::string16& result); |
- void LockResources(); |
- void UnlockResources(); |
- |
long GetNativeImeAdapter(); |
void WasResized(); |
@@ -297,6 +296,19 @@ class RenderWidgetHostViewAndroid |
bool IsReadbackConfigSupported(SkBitmap::Config bitmap_config); |
+ // If we have locks on a frame during a ContentViewCore swap or a context |
+ // lost, the frame is no longer valid and we can safely release all the locks. |
+ // Use this method to release all the locks. |
+ void ReleaseLocksOnSurface(); |
+ |
+ // Drop any incoming frames from the renderer when there are locks on the |
+ // current frame. |
+ void RetainFrame(uint32 output_surface_id, |
+ scoped_ptr<cc::CompositorFrame> frame); |
+ |
+ void InternalSwapCompositorFrame(uint32 output_surface_id, |
+ scoped_ptr<cc::CompositorFrame> frame); |
+ |
// The model object. |
RenderWidgetHostImpl* host_; |
@@ -362,6 +374,18 @@ class RenderWidgetHostViewAndroid |
bool using_delegated_renderer_; |
+ size_t locks_on_frame_count_; |
+ |
+ struct LastFrameInfo { |
+ LastFrameInfo(uint32 output_id, |
+ scoped_ptr<cc::CompositorFrame> output_frame); |
+ ~LastFrameInfo(); |
+ uint32 output_surface_id; |
+ scoped_ptr<cc::CompositorFrame> frame; |
+ }; |
+ |
+ scoped_ptr<LastFrameInfo> last_frame_info_; |
+ |
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |
}; |