electron/patches/chromium/web_contents.patch
electron-roller[bot] 5db776f1ec
chore: bump chromium to 128.0.6613.7 (32-x-y) (#42823)
* chore: bump chromium in DEPS to 128.0.6583.1

* chore: bump chromium in DEPS to 128.0.6585.0

* chore: bump chromium in DEPS to 128.0.6587.0

* chore: bump chromium in DEPS to 128.0.6589.1

* chore: bump chromium in DEPS to 128.0.6591.1

* chore: bump chromium in DEPS to 128.0.6593.0

* chore: bump chromium in DEPS to 128.0.6595.0

* chore: bump chromium in DEPS to 128.0.6597.1

* chore: bump chromium in DEPS to 128.0.6598.0

* chore: bump chromium in DEPS to 128.0.6601.1

* chore: bump chromium in DEPS to 128.0.6603.1

* chore: bump chromium in DEPS to 128.0.6605.2

* chore: bump chromium in DEPS to 128.0.6606.1

* chore: bump chromium in DEPS to 128.0.6607.1

* chore: bump chromium in DEPS to 128.0.6609.0

* chore: bump chromium in DEPS to 128.0.6611.0

* chore: bump chromium in DEPS to 128.0.6613.0

* chore: bump chromium in DEPS to 128.0.6613.7

* chore: update patches

* chore: 5725076: Update EventType names | https://chromium-review.googlesource.com/c/chromium/src/+/5725076

(cherry picked from commit 639d741ba5ac50e800ca46138557c7a32d1b7752)

* chore: 5725076: Update EventType names | https://chromium-review.googlesource.com/c/chromium/src/+/5725076 for windows

(cherry picked from commit 744c17fe92911baa0c7355af905aabb9d12bae18)

* 5730656: Show an error dialog when UpdatePrintSettings() fails

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

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Alice Zhao <alice@makenotion.com>
2024-07-29 12:00:10 +02:00

65 lines
2.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Sat, 24 Apr 2021 18:07:09 -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 b4c3117a56002d8ead12611f0a386d477f0597b1..6db07118cc7f00bd226873541a17f4f94cb97165 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3601,6 +3601,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
params.main_frame_name, GetOpener(), primary_main_frame_policy,
base::UnguessableToken::Create());
+ if (params.view && params.delegate_view) {
+ view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view;
+ }
+
+ if (!view_) {
+
std::unique_ptr<WebContentsViewDelegate> delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -3611,6 +3618,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
view_ = CreateWebContentsView(this, std::move(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 d7403bb66b94540a0a717b7b969c9d801b10c63a..9cc338e9b446cd9c91b8e54089c42cdc73ed57db 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -109,10 +109,13 @@ class BrowserContext;
class BrowserPluginGuestDelegate;
class RenderFrameHost;
class RenderViewHost;
+class RenderViewHostDelegateView;
class RenderWidgetHostView;
+class RenderWidgetHostViewBase;
class ScreenOrientationDelegate;
class SiteInstance;
class WebContentsDelegate;
+class WebContentsView;
class WebUI;
struct DropData;
struct MHTMLGenerationParams;
@@ -259,6 +262,10 @@ class WebContents : public PageNavigator,
network::mojom::WebSandboxFlags starting_sandbox_flags =
network::mojom::WebSandboxFlags::kNone;
+ // Optionally specify the view and delegate view.
+ raw_ptr<content::WebContentsView> view = nullptr;
+ raw_ptr<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