Index: android_webview/browser/child_frame.h |
diff --git a/android_webview/browser/child_frame.h b/android_webview/browser/child_frame.h |
index c0f9a71911ce06e02a06d6b38ad07bb7b6bc4d8f..13ce37960904357ae130be264634120ca8738fd2 100644 |
--- a/android_webview/browser/child_frame.h |
+++ b/android_webview/browser/child_frame.h |
@@ -9,6 +9,7 @@ |
#include "android_webview/browser/compositor_id.h" |
#include "base/macros.h" |
+#include "content/public/browser/android/synchronous_compositor.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/geometry/size.h" |
#include "ui/gfx/transform.h" |
@@ -21,15 +22,23 @@ namespace android_webview { |
class ChildFrame { |
public: |
- ChildFrame(uint32_t compositor_frame_sink_id, |
- std::unique_ptr<cc::CompositorFrame> frame, |
- const CompositorID& compositor_id, |
- bool viewport_rect_for_tile_priority_empty, |
- const gfx::Transform& transform_for_tile_priority, |
- bool offscreen_pre_raster, |
- bool is_layer); |
+ ChildFrame( |
+ scoped_refptr<content::SynchronousCompositor::FrameFuture> frame_future, |
+ uint32_t compositor_frame_sink_id, |
+ std::unique_ptr<cc::CompositorFrame> frame, |
+ const CompositorID& compositor_id, |
+ bool viewport_rect_for_tile_priority_empty, |
+ const gfx::Transform& transform_for_tile_priority, |
+ bool offscreen_pre_raster, |
+ bool is_layer); |
~ChildFrame(); |
+ // Helper to move frame from |frame_future| to |frame|. |
+ void WaitOnFutureIfNeeded(); |
+ |
+ // This is used in async ondraw path. The frame is either in |frame_future| |
+ // or |frame|. It's illegal if both are non-null. |
+ scoped_refptr<content::SynchronousCompositor::FrameFuture> frame_future; |
// These two fields are not const to make async path easier. |
uint32_t compositor_frame_sink_id; |
std::unique_ptr<cc::CompositorFrame> frame; |