fix: potential draggable regions crash in DevTools (#43200)
* fix: potential draggable regions crash in DevTools Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * chore: update patch after rebase --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
17cb664e39
commit
8fb3a04eee
2 changed files with 36 additions and 0 deletions
|
@ -133,3 +133,4 @@ x11_use_localized_display_label_only_for_browser_process.patch
|
|||
feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
|
||||
cherry-pick-99cafbf4b4b9.patch
|
||||
cherry-pick-44b7fbf35b10.patch
|
||||
fix_potential_draggable_region_crash_when_no_mainframeimpl.patch
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 15:30:32 +0200
|
||||
Subject: Fix potential draggable region crash when no MainFrameImpl
|
||||
|
||||
Fix a crash that can occur when SetSupportsDraggableRegions
|
||||
is called with `true` and there is no MainFrameImpl. When MainFrameImpl
|
||||
is nullptr, logic currently correctly returns early, but
|
||||
supports_draggable_regions_ is set before that happens. As a
|
||||
result, when SupportsDraggableRegions() is called, it will return
|
||||
true, and thus LocalFrameView::UpdateDocumentDraggableRegions() will
|
||||
call DraggableRegionsChanged(). This will trigger a crash in
|
||||
WebViewImpl::DraggableRegionsChanged(), as it assumes that
|
||||
MainFrameImpl is not null.
|
||||
|
||||
Upstreamed in https://chromium-review.googlesource.com/c/chromium/src/+/5756619
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index b6c1bbe08e8e2b3bb85b5c91eac512078cd3f1b4..f234a5f3a412d9c6976018ac81d6fee8cbc51d32 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -4039,11 +4039,12 @@ bool WebViewImpl::IsFencedFrameRoot() const {
|
||||
}
|
||||
|
||||
void WebViewImpl::SetSupportsDraggableRegions(bool supports_draggable_regions) {
|
||||
- supports_draggable_regions_ = supports_draggable_regions;
|
||||
if (!MainFrameImpl() || !MainFrameImpl()->GetFrame()) {
|
||||
return;
|
||||
}
|
||||
|
||||
+ supports_draggable_regions_ = supports_draggable_regions;
|
||||
+
|
||||
LocalFrame* local_frame = MainFrameImpl()->GetFrame();
|
||||
|
||||
if (supports_draggable_regions_) {
|
Loading…
Reference in a new issue