electron/patches/common/chromium/webview_reattach.patch
Milan Burda d56617e5d0 chore: avoid appending git version to the exported patches (#15389)
* chore: avoid appending git version to the exported patches

* fix no-eol at end of v8 patch
2018-10-26 12:52:59 +05:30

25 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:49:13 -0700
Subject: webview_reattach.patch
Backports https://chromium-review.googlesource.com/c/chromium/src/+/1161391
Fixes webview not working after renderer process restarted.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 88211169a7d731cb805f34c48ae4caf2fdcd1c84..7b2715aea2afb9e939a6d5cf7fa7ec23f330194a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4906,6 +4906,12 @@ void WebContentsImpl::NotifyViewSwapped(RenderViewHost* old_host,
view_->RenderViewHostChanged(old_host, new_host);
+ // If this is an inner WebContents that has swapped views, we need to reattach
+ // it to its outer WebContents.
+ if (node_.outer_web_contents())
+ ReattachToOuterWebContentsFrame();
+
+
// Ensure that the associated embedder gets cleared after a RenderViewHost
// gets swapped, so we don't reuse the same embedder next time a
// RenderViewHost is attached to this WebContents.