electron/patches/chromium/web_contents.patch
trop[bot] dbd7840254
chore: bump chromium to 130.0.6669.0 (33-x-y) (#43403)
* chore: bump chromium in DEPS to 130.0.6669.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* 5789734: Consolidate all the accessibility scale factor utility code into one file

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 5798543: [autofill] Don't emit autofill audit reports if inspector not connected

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

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 5797073: [wasm] Spill all loop inputs before entering loop

https://chromium-review.googlesource.com/c/v8/v8/+/5797073

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: fixup patch indices

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* 5795224: Version 13.0.0

https://chromium-review.googlesource.com/c/v8/v8/+/5795224

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-08-21 20:20:13 +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 fd884becfbb7b36e99e9df3dfe00602bf3ddb8a6..4897344f95e10c8a94c4b0cf71dfe772e71ad104 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3638,6 +3638,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);
@@ -3648,6 +3655,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 571819688a32b9bf9cd8f7511bd6645b9d13ebff..b7ded85102b79ea7290b7a27936b9e78348ca14d 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;
@@ -258,6 +261,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