cef/patch/patches/browser_child_frame_2507.patch
Alexander Guettler 725ed88529 Update to Chromium version 74.0.3729.0 (#638880)
- Windows: 10.0.17763.0 SDK is now required.
- Mac: 10.13 SDK is now required.
- Removed CefRequestContext::ResolveHostCached which is no longer supported by Chromium.
2019-03-13 21:27:37 +00:00

41 lines
1.9 KiB
Diff

diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc
index 1e2a66d449be..639bb2096cf4 100644
--- content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -650,6 +650,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
"RenderWidgetHostViewChildFrame::OnSwapCompositorFrame");
support_->SubmitCompositorFrame(local_surface_id, std::move(frame),
std::move(hit_test_region_list));
+ ProcessFrameSwappedCallbacks();
}
void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
@@ -658,6 +659,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
support_->DidNotProduceFrame(ack);
}
+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
@@ -842,6 +852,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
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,