2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
However Chromium then disallowed scripting in willReleaseScriptContext
|
|
|
|
in https://codereview.chromium.org/1657583002, and crash will happen
|
|
|
|
when there is code doing that.
|
|
|
|
|
|
|
|
This patch reverts the change to fix the crash in Electron.
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
2019-06-12 19:34:07 +00:00
|
|
|
index d1922a486fb0143d688a26f954462e3a915af2b5..b1e800f51e44a7a5d3fabd66563d5bdb6a7aa280 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
|
|
|
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
2019-06-04 03:44:12 +00:00
|
|
|
@@ -393,10 +393,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
CHECK(!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;
|
|
|
|
|
2019-06-04 03:44:12 +00:00
|
|
|
@@ -414,6 +410,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
2018-09-14 05:02:16 +00:00
|
|
|
// Notify ScriptController that the frame is closing, since its cleanup ends
|
|
|
|
// up calling back to LocalFrameClient via WindowProxy.
|
|
|
|
GetScriptController().ClearForClose();
|
|
|
|
+ // 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());
|