From 7abba8b86d0aa3e28c5e067440ba6f69040123df Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 15 Nov 2024 12:51:53 -0500 Subject: [PATCH] osr: Fix crash in RenderWidgetHostImpl::WasHidden (fixes #3834) --- patch/patch.cfg | 3 +++ patch/patches/osr_fling_2745.patch | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/patch/patch.cfg b/patch/patch.cfg index 220446549..467aa88f0 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -518,6 +518,9 @@ patches = [ # Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling # scrolling in OSR mode. # https://github.com/chromiumembedded/cef/issues/2745 + # + # Fix crash in RenderWidgetHostImpl::WasHidden when closing OSR browser. + # https://github.com/chromiumembedded/cef/issues/3834 'name': 'osr_fling_2745', }, { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index f3ddc882b..f86bf79e6 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -56,9 +56,18 @@ index f1030a744809c..c222a209949e6 100644 return nullptr; } diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index e8f68eca2104c..dded892de5ce4 100644 +index e8f68eca2104c..c579cff86fbbb 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc +@@ -791,7 +791,7 @@ void RenderWidgetHostImpl::WasHidden() { + + // Cancel pending pointer lock requests, unless there's an open user prompt. + // Prompts should remain open and functional across tab switches. +- if (!delegate_->IsWaitingForPointerLockPrompt(this)) { ++ if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) { + RejectPointerLockOrUnlockIfNecessary( + blink::mojom::PointerLockResult::kWrongDocument); + } @@ -3248,6 +3248,11 @@ void RenderWidgetHostImpl::DecrementInFlightEventCount( } }