electron/patches/common/chromium/disable_detach_webview_frame.patch
Cheng Zhao 03d499bf34 fix: detach webview instead of destroying it
Chromium no longer cleans up everything when a guest webcontents is
destroyed, we have to force detaching it and let Chromium destroy everything.
2019-01-22 10:32:06 -08:00

30 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: zcbenz <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:50:27 -0700
Subject: disable_detach_webview_frame.patch
Don't detach the frame for webview, we will manage the WebContents
manually.
This is part of the fixes for https://github.com/electron/electron/issues/14211.
We should revisit this bug after upgrading to newer versions of Chrome,
this patch was introduced in Chrome 66.
Update(zcbenz): The bug is still in Chrome 72.
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
index cfa3fd15714c3743cb9d2900b35570c94545fa87..80785902890c57ffae2fa841831d3bd60a8fa11a 100644
--- a/content/browser/frame_host/render_frame_proxy_host.cc
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -259,6 +259,12 @@ void RenderFrameProxyHost::SetDestructionCallback(
void RenderFrameProxyHost::OnDetach() {
if (frame_tree_node_->render_manager()->ForInnerDelegate()) {
+ // Don't detach the frame for webview, we will manage the WebContents
+ // manually.
+ // We should revisit this bug after upgrading to newer versions of Chrome,
+ // this patch was introduced in Chrome 66.
+ return;
+
// Only main frame proxy can detach for inner WebContents.
DCHECK(frame_tree_node_->IsMainFrame());
frame_tree_node_->render_manager()->RemoveOuterDelegateFrame();