From feffedbae999031505b2bbe0224c622df7c3f76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Riku=20Palom=C3=A4ki?= Date: Thu, 7 Mar 2019 22:03:35 +0000 Subject: [PATCH] Fix a crash when resizing an OSR browser window (issue #2614) --- libcef/browser/osr/render_widget_host_view_osr.cc | 11 +++++++++++ libcef/browser/osr/render_widget_host_view_osr.h | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index b070b74c5..c8b362b3e 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -1139,6 +1139,17 @@ CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() { new content::SyntheticGestureTargetBase(host())); } +#if !defined(OS_MACOSX) +viz::ScopedSurfaceIdAllocator +CefRenderWidgetHostViewOSR::DidUpdateVisualProperties( + const cc::RenderFrameMetadata& metadata) { + base::OnceCallback allocation_task = + base::BindOnce(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties, + weak_ptr_factory_.GetWeakPtr()); + return viz::ScopedSurfaceIdAllocator(std::move(allocation_task)); +} +#endif + void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) { SetFrameRate(); diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index eaa111b71..391325ee1 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -174,10 +174,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void GetScreenInfo(content::ScreenInfo* results) const override; void TransformPointToRootSurface(gfx::PointF* point) override; gfx::Rect GetBoundsInRootWindow() override; -#if defined(OS_MACOSX) viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties( const cc::RenderFrameMetadata& metadata) override; -#endif viz::SurfaceId GetCurrentSurfaceId() const override; content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager( content::BrowserAccessibilityDelegate* delegate,