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

Unified Diff: android_webview/browser/child_frame.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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
« no previous file with comments | « android_webview/browser/child_frame.h ('k') | android_webview/browser/compositor_frame_consumer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/child_frame.cc
diff --git a/android_webview/browser/child_frame.cc b/android_webview/browser/child_frame.cc
index 560e20c4b0c18cb350e34f7aca33c29f24520547..62963518a54d5bf159be3136620a2b5216d85266 100644
--- a/android_webview/browser/child_frame.cc
+++ b/android_webview/browser/child_frame.cc
@@ -4,18 +4,24 @@
#include "android_webview/browser/child_frame.h"
+#include <utility>
+
+#include "base/trace_event/trace_event.h"
#include "cc/output/compositor_frame.h"
namespace android_webview {
-ChildFrame::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)
- : compositor_frame_sink_id(compositor_frame_sink_id),
+ChildFrame::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)
+ : frame_future(std::move(frame_future)),
+ compositor_frame_sink_id(compositor_frame_sink_id),
frame(std::move(frame)),
compositor_id(compositor_id),
viewport_rect_for_tile_priority_empty(
@@ -27,4 +33,18 @@ ChildFrame::ChildFrame(uint32_t compositor_frame_sink_id,
ChildFrame::~ChildFrame() {
}
+void ChildFrame::WaitOnFutureIfNeeded() {
+ if (!frame_future)
+ return;
+
+ TRACE_EVENT0("android_webview", "GetFrame");
+ DCHECK(!frame);
+ auto frame_ptr = frame_future->GetFrame();
+ if (frame_ptr) {
+ compositor_frame_sink_id = frame_ptr->compositor_frame_sink_id;
+ frame = std::move(frame_ptr->frame);
+ }
+ frame_future = nullptr;
+}
+
} // namespace webview
« no previous file with comments | « android_webview/browser/child_frame.h ('k') | android_webview/browser/compositor_frame_consumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698