electron/patches/chromium/web_contents.patch
Electron Bot 1bbb407dc9
chore: bump chromium to 2600291d041c530698616a4716cdf (master) (#23122)
* chore: bump chromium in DEPS to 99e60beb593ecf98f8a441e3f03a13b68cfcb311

* update patches

* chore: bump chromium in DEPS to b1abadda21f417ba5e8276c4dd779d31445d16cd

* update patches

* 2146532: gtkui: Fix standalone Ozone/Wayland configuration

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

* 2145152: Pass source URL when setting a cookie

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

* lint

* chore: bump chromium in DEPS to 8897189f1da5a3670bbe32d343767fd71f80d779

* chore: bump chromium in DEPS to 8ac51eeee93a02ed5b81f47e28627079edeecde0

* chore: bump chromium in DEPS to e897b8003f3a5f3c8d654eee9b03c513046ae7ea

* chore: bump chromium in DEPS to 7b80f9c82122600291d041c530698616a4716cdf

* Update patches

* Move definition of WebInputEvent enums into mojo

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

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-04-20 20:25:38 -04:00

63 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Fri, 10 Apr 2020 15:14:49 -0700
Subject: web_contents.patch
This allows overriding the RenderViewHostDelegateView of a WebContents, which
is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 0312eff770307ee7d66c8ef950a4992c07f56d8f..55d8d11648ac7ac912f9c0f805d82bc908f1fe60 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2084,6 +2084,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
+ if (params.view && params.delegate_view) {
+ view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view;
+ }
+
+ if (!view_) {
WebContentsViewDelegate* delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -2094,6 +2100,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
view_.reset(CreateWebContentsView(this, delegate,
&render_view_host_delegate_view_));
}
+ } // !view_
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 4133778e3945550698e1b1e01367abf6fb2351d9..f906446a8aac1705473de83503c8317f06bbb8fa 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -83,9 +83,12 @@ class BrowserPluginGuestDelegate;
class InterstitialPage;
class RenderFrameHost;
class RenderViewHost;
+class RenderViewHostDelegateView;
class RenderWidgetHost;
class RenderWidgetHostView;
+class RenderWidgetHostViewBase;
class WebContentsDelegate;
+class WebContentsView;
class WebUI;
struct CustomContextMenuContext;
struct DropData;
@@ -213,6 +216,10 @@ class WebContents : public PageNavigator,
// Sandboxing flags set on the new WebContents.
network::mojom::WebSandboxFlags starting_sandbox_flags;
+ // Optionally specify the view and delegate view.
+ content::WebContentsView* view = nullptr;
+ content::RenderViewHostDelegateView* delegate_view = nullptr;
+
// Value used to set the last time the WebContents was made active, this is
// the value that'll be returned by GetLastActiveTime(). If this is left
// default initialized then the value is not passed on to the WebContents