electron/patches/chromium/web_contents.patch
electron-roller[bot] 26e1bda335
chore: bump chromium to 140.0.7301.0 (main) (#47747)
* chore: bump chromium in DEPS to 140.0.7296.0

* chore: update patches

* 6702959: Remove OwnedByWidgetPassKey usage from content analysis dialog tests | https://chromium-review.googlesource.com/c/chromium/src/+/6702959

* 6722750: Remove un-used `stream_id` argument for `AidaCodeComplete` | https://chromium-review.googlesource.com/c/chromium/src/+/6722750

* 6696478: Reland Reland [video pip] Add fade in/out animation to controls visibility changes | https://chromium-review.googlesource.com/c/chromium/src/+/6696478

* chore: update libc++-filenames

* build: explicitly include cstdlib in Boyer-Moore patch

* chore: bump chromium in DEPS to 140.0.7297.0

* chore: update patches

* 6729537: [FPF] Pipe flag state from the browser to the renderer | https://chromium-review.googlesource.com/c/chromium/src/+/6729537

* 6727996: [Win] Detect pre-IPC crashes in sandboxed utility processes | https://chromium-review.googlesource.com/c/chromium/src/+/6727996

* 6707182: Move wtf/cross_thread_copier*.* to "blink" namespace | https://chromium-review.googlesource.com/c/chromium/src/+/6707182

* 6730796: extensions: Extract safe browsing/telemetry methods to new client class | https://chromium-review.googlesource.com/c/chromium/src/+/6730796

* chore: bump chromium in DEPS to 140.0.7299.0

* chore: update patches

* chore: update main patches

* build: reset the minimum macOS SDK to 15 to match upstream

This reverts commit 499e987c77.

* 6730215: Remove IPC_MESSAGE_LOG_ENABLED ifdef blocks. | https://chromium-review.googlesource.com/c/chromium/src/+/6730215

* 6690442: Delete ppapi/buildflags/buildflags.h | https://chromium-review.googlesource.com/c/chromium/src/+/6690442

* [wip]: 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681

* chore: bump chromium in DEPS to 140.0.7301.0

* chore: update patches

* 6656309: extensions: Port proxy API to desktop Android | https://chromium-review.googlesource.com/c/chromium/src/+/6656309

* 6758510: Reland 'Move GN enable_plugins variable out of //ppapi' | https://chromium-review.googlesource.com/c/chromium/src/+/6758510

* 6701466: [Extensions] Remove NaCl arch info from Update Client URLs | https://chromium-review.googlesource.com/c/chromium/src/+/6701466

* 6735979: [FSA] Replace `request_writable` with a new enum `FileSystemAccessPermissionMode`. | https://chromium-review.googlesource.com/c/chromium/src/+/6735979

* 6712080: Reland "Turn on gender translation PAK generation everywhere" | https://chromium-review.googlesource.com/c/chromium/src/+/6712080

* 6730796: extensions: Extract safe browsing/telemetry methods to new client class | https://chromium-review.googlesource.com/c/chromium/src/+/6730796

* build: restore minimum macOS SDK to 10, restore patch

This reverts commit a04c579b994d5f4a782b793a69f34ff7a260e74f.

* fixup! 6701466: [Extensions] Remove NaCl arch info from Update Client URLs | https://chromium-review.googlesource.com/c/chromium/src/+/6701466

* chore: correct node patches

* fixup! 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681

---------

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: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com>
2025-07-21 09:32:53 -07:00

66 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 6edba4b1fb3c60effb3f42736ec7ff35aebd98e5..a783afcda81f97504425de4224ed40f711852d18 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4110,6 +4110,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);
@@ -4120,6 +4127,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 4a0bc0e58db7054b4d89d227a6c6d3339c6b0add..6939841b8df5da608c6cd7bcdd92bd6ac93c6242 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -126,11 +126,14 @@ class GuestPageHolder;
class RenderFrameHost;
class RenderViewHost;
class RenderWidgetHost;
+class RenderViewHostDelegateView;
class RenderWidgetHostView;
+class RenderWidgetHostViewBase;
class ScreenOrientationDelegate;
class SiteInstance;
class UnownedInnerWebContentsClient;
class WebContentsDelegate;
+class WebContentsView;
class WebUI;
struct DropData;
struct MHTMLGenerationParams;
@@ -284,6 +287,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