osr: Fix crash in RenderWidgetHostImpl::WasHidden (fixes #3834)

This commit is contained in:
Marshall Greenblatt 2024-11-15 12:51:53 -05:00
parent 34dbad30db
commit 7abba8b86d
2 changed files with 13 additions and 1 deletions

View File

@ -518,6 +518,9 @@ patches = [
# Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling # Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling
# scrolling in OSR mode. # scrolling in OSR mode.
# https://github.com/chromiumembedded/cef/issues/2745 # 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', 'name': 'osr_fling_2745',
}, },
{ {

View File

@ -56,9 +56,18 @@ index f1030a744809c..c222a209949e6 100644
return nullptr; return nullptr;
} }
diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc 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
+++ 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( @@ -3248,6 +3248,11 @@ void RenderWidgetHostImpl::DecrementInFlightEventCount(
} }
} }