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

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

Issue 2780713004: Hide compositor_frame_sink_id from RenderWidgetHostView* (Closed)
Patch Set: Added a comment in android Created 3 years, 9 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.cc
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index 1b4f61a7010e598c613a836b8b5fce431c2808ba..c591e8514b3c15e5fb256ae44feb0ec07a0230ca 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -54,7 +54,6 @@ RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame(
base::checked_cast<uint32_t>(widget_host->GetProcess()->GetID()),
base::checked_cast<uint32_t>(widget_host->GetRoutingID())),
next_surface_sequence_(1u),
- last_compositor_frame_sink_id_(0),
current_surface_scale_factor_(1.f),
frame_connector_(nullptr),
weak_factory_(this) {
@@ -343,23 +342,19 @@ void RenderWidgetHostViewChildFrame::GestureEventAck(
void RenderWidgetHostViewChildFrame::DidReceiveCompositorFrameAck() {
if (!host_)
return;
- host_->Send(new ViewMsg_ReclaimCompositorResources(
- host_->GetRoutingID(), last_compositor_frame_sink_id_,
- true /* is_swap_ack */, cc::ReturnedResourceArray()));
+ host_->SendReclaimCompositorResources(true /* is_swap_ack */,
+ cc::ReturnedResourceArray());
+}
+
+void RenderWidgetHostViewChildFrame::DidCreateNewRendererCompositorFrameSink() {
+ ResetCompositorFrameSinkSupport();
+ CreateCompositorFrameSinkSupport();
+ has_frame_ = false;
}
void RenderWidgetHostViewChildFrame::ProcessCompositorFrame(
- uint32_t compositor_frame_sink_id,
const cc::LocalSurfaceId& local_surface_id,
cc::CompositorFrame frame) {
- // If the renderer changed its frame sink, reset the
- // CompositorFrameSinkSupport to avoid returning stale resources.
- if (compositor_frame_sink_id != last_compositor_frame_sink_id_) {
- ResetCompositorFrameSinkSupport();
- CreateCompositorFrameSinkSupport();
- last_compositor_frame_sink_id_ = compositor_frame_sink_id;
- }
-
current_surface_size_ = frame.render_pass_list.back()->output_rect.size();
current_surface_scale_factor_ = frame.metadata.device_scale_factor;
@@ -393,8 +388,7 @@ void RenderWidgetHostViewChildFrame::SendSurfaceInfoToEmbedderImpl(
frame_connector_->SetChildFrameSurface(surface_info, sequence);
}
-void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame(
- uint32_t compositor_frame_sink_id,
+void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
const cc::LocalSurfaceId& local_surface_id,
cc::CompositorFrame frame) {
TRACE_EVENT0("content",
@@ -402,8 +396,7 @@ void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame(
last_scroll_offset_ = frame.metadata.root_scroll_offset;
if (!frame_connector_)
return;
- ProcessCompositorFrame(compositor_frame_sink_id, local_surface_id,
- std::move(frame));
+ ProcessCompositorFrame(local_surface_id, std::move(frame));
}
void RenderWidgetHostViewChildFrame::OnBeginFrameDidNotSwap(
@@ -619,9 +612,7 @@ void RenderWidgetHostViewChildFrame::ReclaimResources(
const cc::ReturnedResourceArray& resources) {
if (!host_)
return;
- host_->Send(new ViewMsg_ReclaimCompositorResources(
- host_->GetRoutingID(), last_compositor_frame_sink_id_,
- false /* is_swap_ack */, resources));
+ host_->SendReclaimCompositorResources(false /* is_swap_ack */, resources);
}
void RenderWidgetHostViewChildFrame::OnBeginFrame(

Powered by Google App Engine
This is Rietveld 408576698