electron/patches/chromium/web_contents.patch
electron-roller[bot] adbd25f699
chore: bump chromium to 132.0.6820.0 (main) (#44544)
* chore: bump chromium in DEPS to 132.0.6817.0

* chore: update chromium patches

* 5979290: Temoporarily disable crel on arm. | https://chromium-review.googlesource.com/c/chromium/src/+/5979290

* 5981701: Include callback.h instead of callback_forward.h | https://chromium-review.googlesource.com/c/chromium/src/+/5981701

* 5964918: [v8 code cache] Add a wpt_internal test demonstrating the code cache 304 problem | https://chromium-review.googlesource.com/c/chromium/src/+/5964918

* 5969697: Add NetworkTrafficAnnotationTag to PreconnectManager | https://chromium-review.googlesource.com/c/chromium/src/+/5969697

* chore: update remaining patches

* chore: bump chromium in DEPS to 132.0.6818.0

* chore: update patches

* 5983492: MPArch GuestView: Have executeScript target correct frame | https://chromium-review.googlesource.com/c/chromium/src/+/5983492

* chore: bump chromium in DEPS to 132.0.6820.0

* chore: update patches

* 5989717: Revert "win: Remove special check for 10.0.22621.2428 Win SDK version" | https://chromium-review.googlesource.com/c/chromium/src/+/5989717

* 5968218: Send PDF Searchifier running state to browser to show UX elements. | https://chromium-review.googlesource.com/c/chromium/src/+/5968218

* build: also update the MSVS_HASH for WOA

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2024-11-05 16:46:57 -08: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 6aacacf3c08803b48fa6df8d6d81463a84d9673e..a1b654f5916503f4018ade7e7cfc80ddf8c1367e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3752,6 +3752,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);
@@ -3762,6 +3769,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 a0a13547fe05410525ff122ba08600997c2e2bc8..b1b0be781a7b480dff896d9e34e41048908d61df 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -111,10 +111,13 @@ class BrowserPluginGuestDelegate;
class GuestPageHolder;
class RenderFrameHost;
class RenderViewHost;
+class RenderViewHostDelegateView;
class RenderWidgetHostView;
+class RenderWidgetHostViewBase;
class ScreenOrientationDelegate;
class SiteInstance;
class WebContentsDelegate;
+class WebContentsView;
class WebUI;
struct DropData;
struct MHTMLGenerationParams;
@@ -275,6 +278,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData {
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 GetLastActiveTimeTicks(). If this is
// left default initialized then the value is not passed on to the