2018-09-27 16:00:45 +02:00
|
|
|
diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc
|
2019-09-04 17:13:32 +02:00
|
|
|
index fbb86a38a7ac..bd1c70e53371 100644
|
2018-09-27 16:00:45 +02:00
|
|
|
--- content/browser/renderer_host/render_widget_host_view_child_frame.cc
|
|
|
|
+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc
|
2019-09-04 17:13:32 +02:00
|
|
|
@@ -613,6 +613,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
|
2018-09-27 16:00:45 +02:00
|
|
|
"RenderWidgetHostViewChildFrame::OnSwapCompositorFrame");
|
|
|
|
support_->SubmitCompositorFrame(local_surface_id, std::move(frame),
|
|
|
|
std::move(hit_test_region_list));
|
|
|
|
+ ProcessFrameSwappedCallbacks();
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
|
2019-09-04 17:13:32 +02:00
|
|
|
@@ -621,6 +622,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
|
2018-11-30 23:21:07 +01:00
|
|
|
support_->DidNotProduceFrame(ack);
|
2018-09-27 16:00:45 +02:00
|
|
|
}
|
|
|
|
|
2018-11-30 23:21:07 +01:00
|
|
|
+void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() {
|
|
|
|
+ std::vector<base::OnceClosure> process_callbacks;
|
|
|
|
+ // Swap the vectors to avoid re-entrancy issues due to calls to
|
|
|
|
+ // RegisterFrameSwappedCallback() while running the OnceClosures.
|
|
|
|
+ process_callbacks.swap(frame_swapped_callbacks_);
|
|
|
|
+ for (base::OnceClosure& callback : process_callbacks)
|
|
|
|
+ std::move(callback).Run();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void RenderWidgetHostViewChildFrame::TransformPointToRootSurface(
|
|
|
|
gfx::PointF* point) {
|
|
|
|
// This function is called by RenderWidgetHostInputEventRouter only for
|
2019-09-04 17:13:32 +02:00
|
|
|
@@ -818,6 +828,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
|
2018-11-30 23:21:07 +01:00
|
|
|
void RenderWidgetHostViewChildFrame::SpeakSelection() {}
|
|
|
|
#endif // defined(OS_MACOSX)
|
|
|
|
|
|
|
|
+void RenderWidgetHostViewChildFrame::RegisterFrameSwappedCallback(
|
|
|
|
+ base::OnceClosure callback) {
|
|
|
|
+ frame_swapped_callbacks_.emplace_back(std::move(callback));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void RenderWidgetHostViewChildFrame::CopyFromSurface(
|
|
|
|
const gfx::Rect& src_subrect,
|
|
|
|
const gfx::Size& output_size,
|