electron/patches/chromium/blink_local_frame.patch
trop[bot] c92a02ea17
chore: bump chromium to 134.0.6998.10 (35-x-y) (#45585)
* chore: bump chromium to 134.0.6992.0

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: add BrowserProcessImpl::CreateGlobalFeaturesForTesting() stub

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6216193

Remove GlobalFeatures from TestingBrowserProcess::Init

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium to 134.0.6994.0

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* 6208630: Mac sandbox: don't use protobuf for policy serialization | https://chromium-review.googlesource.com/c/chromium/src/+/6208630

Co-authored-by: alice <alice@makenotion.com>

* Remove HasUnsupportedFeature Mojo interface

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6220800

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* 6217444: Remove scoped_gdi_object.h type aliases. | https://chromium-review.googlesource.com/c/chromium/src/+/6217444

Co-authored-by: alice <alice@makenotion.com>

* chore: bump chromium to 134.0.6998.10

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* 6221378: Revert [OBC] Exclude Aliasing Cookies in FilterCookiesWithOptions() | https://chromium-review.googlesource.com/c/chromium/src/+/6221378

Co-authored-by: alice <alice@makenotion.com>

* Update ExtensionPrefs::GetDisableReasons to return DisableReasonSet

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6218840

change copied from 6218840 extensions/shell/browser/shell_extension_loader.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* 6218402: Typemap ui.gfx.DXGIHandle <=> gfx::DXGIHandle | https://chromium-review.googlesource.com/c/chromium/src/+/6218402

Co-authored-by: alice <alice@makenotion.com>

* chore: disable flaky contentTracing test

not new to this roll; it is happening in main as well

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! chore: disable flaky contentTracing test

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update patches

* chore: disable flaky content tracing tests on Linux (#45612)

(cherry picked from commit a1e4550c9e5b2b220530a9238795286bd028dbfb)

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-02-19 12:09:35 +01:00

77 lines
3.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:45:03 -0700
Subject: blink_local_frame.patch
According to electron/electron#3699, it is unreliable to use |unload|
event for process.exit('exit'), so we have to do that in
willReleaseScriptContext.
Refs changes in:
* https://codereview.chromium.org/1657583002
* https://chromium-review.googlesource.com/c/chromium/src/+/2596880
* https://chromium-review.googlesource.com/c/chromium/src/+/2597169
This patch reverts the changes to fix associated crashes in Electron.
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
index e662d4d61595735a30d5c721147a95698d4da3d9..6a0388aad469422dd1c0c2164f8aa858c55cce70 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -134,14 +134,6 @@ bool Frame::Detach(FrameDetachType type) {
DCHECK(!IsDetached());
- // TODO(dcheng): FocusController::FrameDetached() *should* fire JS events,
- // hence the above check for `client_` being null. However, when this was
- // previously placed before the `FrameDetached()` call, nothing crashes, which
- // is suspicious. Investigate if we really don't need to fire JS events--and
- // if we don't, move `forbid_scripts` up to be instantiated sooner and
- // simplify this code.
- ScriptForbiddenScope forbid_scripts;
-
if (type == FrameDetachType::kRemove) {
if (provisional_frame_) {
provisional_frame_->Detach(FrameDetachType::kRemove);
@@ -165,6 +157,14 @@ bool Frame::Detach(FrameDetachType type) {
GetWindowProxyManager()->ClearForSwap();
}
+ // TODO(dcheng): FocusController::FrameDetached() *should* fire JS events,
+ // hence the above check for `client_` being null. However, when this was
+ // previously placed before the `FrameDetached()` call, nothing crashes, which
+ // is suspicious. Investigate if we really don't need to fire JS events--and
+ // if we don't, move `forbid_scripts` up to be instantiated sooner and
+ // simplify this code.
+ ScriptForbiddenScope forbid_scripts;
+
// After this, we must no longer talk to the client since this clears
// its owning reference back to our owning LocalFrame.
client_->Detached(type);
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index ac54c9ef09fe7a4a94737e76aa186ce6bd4f1f21..79ec1e2b1274160cca97d14a69c36eac4bc36b0f 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -748,10 +748,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
- // This is the earliest that scripting can be disabled:
- // - FrameLoader::Detach() can fire XHR abort events
- // - Document::Shutdown() can dispose plugins which can run script.
- ScriptForbiddenScope forbid_script;
if (!Client())
return false;
@@ -805,6 +801,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();
+ // This is the earliest that scripting can be disabled:
+ // - FrameLoader::Detach() can fire XHR abort events
+ // - Document::Shutdown() can dispose plugins which can run script.
+ ScriptForbiddenScope forbid_script;
+
// TODO(crbug.com/729196): Trace why LocalFrameView::DetachFromLayout crashes.
CHECK(!view_->IsAttached());
SetView(nullptr);