chore: bump chromium to 138.0.7204.23 (37-x-y) (#47455)

* chore: bump chromium in DEPS to 138.0.7204.23

* chore: update patches

* test: fixup api-desktop-capturer-spec.ts for linux

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
electron-roller[bot] 2025-06-17 11:38:13 -04:00 committed by GitHub
commit 5bd18aac95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 97 additions and 117 deletions

2
DEPS
View file

@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'138.0.7204.15',
'138.0.7204.23',
'node_version':
'v22.16.0',
'nan_version':

View file

@ -33,10 +33,10 @@ index 72c637f9f3ba48bb7ab06678fe833f33d2cfddc8..e9c8ae3cdb7ba400c59cc469a1a80b50
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index efb9b948aca15ae8b4d6257fa685e758d2e3acc1..0e14d0eb15bfcd86831599678eb0f76fe0a803cc 100644
index 36fe07a692e9be5b99f9e59157b90963a6485f8b..d8cf68e953213f309537e74d954d874950ede24a 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4716,7 +4716,7 @@ static_library("browser") {
@@ -4715,7 +4715,7 @@ static_library("browser") {
[ "//chrome/browser/ui/webui/signin:profile_impl" ]
}

View file

@ -21,10 +21,10 @@ index 23cd457563d7d534e924428ac6da2b475e579326..d8698f9f37eefa50bf4e29a164b2cc30
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e57951543e9f2b0be5164dde3d4b629b081457cc..811d137c4b77d3347dc8de5bb6207646c952f23b 100644
index f3204a39253652a906f8976c666395e8afa033a8..a45bf004f5096809b5fc7b70faa0b7fa7b257049 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5317,6 +5317,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5293,6 +5293,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
// Sets the newly created WebContents WindowOpenDisposition.
new_contents_impl->original_window_open_disposition_ = params.disposition;
@ -37,7 +37,7 @@ index e57951543e9f2b0be5164dde3d4b629b081457cc..811d137c4b77d3347dc8de5bb6207646
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -5358,12 +5364,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5334,12 +5340,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}

View file

@ -34,10 +34,10 @@ index 39b5a8fdd165efd74b00256552b51b5413107958..bfc4ef4f50efff4a77f2aef64335bb7e
class ScrollEvent;
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index b687c8505f1afc918fc4994dd6fbb8b6520e3e8a..d8168622ee2e0d42f8d4486d8f9391b4508aff54 100644
index cc9f13770da77d9522a48abeb9d831b7b8b742f9..a415140b94e467adfbc3dbbaa026e897a0f66c06 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -1360,6 +1360,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
@@ -1358,6 +1358,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds);
}
@ -49,10 +49,10 @@ index b687c8505f1afc918fc4994dd6fbb8b6520e3e8a..d8168622ee2e0d42f8d4486d8f9391b4
DesktopWindowTreeHostWin::GetSingletonDesktopNativeCursorManager() {
return new DesktopNativeCursorManagerWin();
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
index 28cbd63261275e252381d88c13c1a3b4067d197f..45e47bae0e8b3369072c6e179206aa6d222e0ec5 100644
index c8339591dc55a792fd20f6c4340eac49f56a7f50..b85d1cdec49b10628d2f3d3d2e07513beb830456 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -272,6 +272,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
@@ -271,6 +271,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
void HandleWindowSizeUnchanged() override;
void HandleWindowScaleFactorChanged(float window_scale_factor) override;
void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) override;
@ -61,10 +61,10 @@ index 28cbd63261275e252381d88c13c1a3b4067d197f..45e47bae0e8b3369072c6e179206aa6d
Widget* GetWidget();
const Widget* GetWidget() const;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 418dc47b6d4df097e8f0cfd61de8485af2a8d2c2..8c13b9db078e690240eca0a48a7c546dcdac3c11 100644
index 011448d24c557059423f6901b7e1100e476f0c9f..06fc8190385139f165bad0c2da2fb22d7a2c3d76 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3171,15 +3171,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3161,15 +3161,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
}
// We must let Windows handle the caption buttons if it's drawing them, or
// they won't work.
@ -86,7 +86,7 @@ index 418dc47b6d4df097e8f0cfd61de8485af2a8d2c2..8c13b9db078e690240eca0a48a7c546d
return 0;
}
}
@@ -3202,6 +3206,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3192,6 +3196,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
// handle alt-space, or in the frame itself.
is_right_mouse_pressed_on_caption_ = false;
ReleaseCapture();
@ -94,7 +94,7 @@ index 418dc47b6d4df097e8f0cfd61de8485af2a8d2c2..8c13b9db078e690240eca0a48a7c546d
// |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu()
// expect screen coordinates.
POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
@@ -3209,7 +3214,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3199,7 +3204,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
w_param = static_cast<WPARAM>(SendMessage(
hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)));
if (w_param == HTCAPTION || w_param == HTSYSMENU) {
@ -114,10 +114,10 @@ index 418dc47b6d4df097e8f0cfd61de8485af2a8d2c2..8c13b9db078e690240eca0a48a7c546d
}
} else if (message == WM_NCLBUTTONDOWN &&
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
index 252d7ce78ad49596fb030160cb69d9bf3dc0951f..5e7975cf5cb3435b844fda58d7582d54cb583a72 100644
index 320b3263875807ccca2f013d51bc67a0c341cba3..67c761715aa2cc2ad52a5105a485af0514a4148f 100644
--- a/ui/views/win/hwnd_message_handler_delegate.h
+++ b/ui/views/win/hwnd_message_handler_delegate.h
@@ -255,6 +255,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
@@ -252,6 +252,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
// Called when the headless window bounds has changed.
virtual void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) = 0;

View file

@ -14,10 +14,10 @@ track down the source of this problem & figure out if we can fix it
by changing something in Electron.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index fbe6b5d24185c0b0e664db05c7801434737d4d8d..51798b8ceb81cf9d374cf594aa6afbcb366f4732 100644
index 0fba6e8b5f1f9ecde06b9d846b4ace984cdfc943..b50e3c2ecb6f9f3322cfd16fc7bcbd8935f863a2 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5233,7 +5233,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5209,7 +5209,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
: IsGuest();
// While some guest types do not have a guest SiteInstance, the ones that
// don't all override WebContents creation above.

View file

@ -222,10 +222,10 @@ index b969f1d97b7e3396119b579cfbe61e19ff7d2dd4..b8d6169652da28266a514938b45b39c5
content::WebContents* AddNewContents(
content::WebContents* source,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 33abfcd326148f32eff2266a4545345e4a561a4e..4bb69438947fff73a6905a1ecc1b711986a89124 100644
index c034b546289ba069194ad65d3d3bc0703a3afe9c..e603c0fddbf4efaeb225686c1791ffb581e9e6c0 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5196,8 +5196,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5172,8 +5172,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ &&
delegate_->IsWebContentsCreationOverridden(
opener, source_site_instance, params.window_container_type,

View file

@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index b4c984e0dd22f148a426ce0ea04988798ed95aaa..5fd099b6396fc51d29fce2843531d5fc89642d35 100644
index bc49553c298d548a3c09a5e65a44cac1a42e893e..fd11dbf8117cc173fd8bb268b391ddbb8ad36f49 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1961,6 +1961,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1972,6 +1972,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
loader_factory_bundle_info =
context()->loader_factory_bundle_for_update_check()->Clone();
@ -38,7 +38,7 @@ index b4c984e0dd22f148a426ce0ea04988798ed95aaa..5fd099b6396fc51d29fce2843531d5fc
if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
browser_context(), scope)) {
// If this is a Service Worker for a WebUI, the WebUI's URLDataSource
@@ -1980,9 +2000,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1991,9 +2011,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
features::kEnableServiceWorkersForChromeScheme) &&
scope.scheme_piece() == kChromeUIScheme) {
config->RegisterURLDataSource(browser_context());
@ -49,7 +49,7 @@ index b4c984e0dd22f148a426ce0ea04988798ed95aaa..5fd099b6396fc51d29fce2843531d5fc
.emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
browser_context(), kChromeUIScheme,
base::flat_set<std::string>()));
@@ -1990,9 +2008,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -2001,9 +2019,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
features::kEnableServiceWorkersForChromeUntrusted) &&
scope.scheme_piece() == kChromeUIUntrustedScheme) {
config->RegisterURLDataSource(browser_context());

View file

@ -6,7 +6,7 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 52f772876a8878a7dbc95bb8f243d1442d30977f..cdfdd322ffb2e61d5480ac7c88dba35a1cc1b5b9 100644
index 252edf0bb40ba4c16061425013d9e4c559b91e78..624094ba6459f3663a12f868c4cb47dfa9f8dce1 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -833,6 +833,10 @@ void RenderWidgetHostImpl::WasHidden() {
@ -21,10 +21,10 @@ index 52f772876a8878a7dbc95bb8f243d1442d30977f..cdfdd322ffb2e61d5480ac7c88dba35a
// Prompts should remain open and functional across tab switches.
if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) {
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 0bc94f2246a9357915423d1954cb240fad602a22..4663f18c832c12e8704fbb99a5aea824cd44aa5b 100644
index f24d02054c89c8bc6b75e127146cb97a72e3f94a..9b8919ab2d8c9432c5d908337e7a19bd055b440e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -1017,6 +1017,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -1021,6 +1021,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// Requests a commit and forced redraw in the renderer compositor.
void ForceRedrawForTesting();

View file

@ -6,7 +6,7 @@ Subject: feat: enable setting aspect ratio to 0
Make SetAspectRatio accept 0 as valid input, which would reset to null.
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index 18cd413e8780161d2c1d1993e12e8d87eb12a33f..b687c8505f1afc918fc4994dd6fbb8b6520e3e8a 100644
index 93cede29651ef2fc0a77c6a7a569f9b8d1fe4ba9..cc9f13770da77d9522a48abeb9d831b7b8b742f9 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -609,7 +609,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
@ -19,7 +19,7 @@ index 18cd413e8780161d2c1d1993e12e8d87eb12a33f..b687c8505f1afc918fc4994dd6fbb8b6
excluded_margin);
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index cb66f6e84abd95080a2051b39d86b1838a6df9bb..c38b58ed16b14ff765f24d0bb8bdf34b8de3a901 100644
index 1a8943c86cb1bb79f83bfd867619b805aaa0c329..6df5e54cefe71393cb6189cc15240d21d2262059 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -993,8 +993,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,

View file

@ -597,7 +597,7 @@ index e063835e87f08e6a2359886a96d7b78954e3d5b2..34bcf67726f64466d11a56d7a315ce7e
// Sends the created child window to the browser process so that it can be
diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
index 4828bfcb0c221ce9de3f1fe9952849c542e7e3df..4d3667deff36216db4d51ae3f01f732d691f4866 100644
index 3066550e422058eec23d5fe3e655625f5446d694..7358b05a646a2f80717a91182c4929776a404179 100644
--- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
+++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
@@ -39,6 +39,7 @@ struct RootCompositorFrameSinkParams {

View file

@ -14,7 +14,7 @@ This patch likely can't be upstreamed as-is, as Chromium doesn't have
this use case in mind currently.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 30399c8a81819a57f07702a97f85e3edd7df9d69..1559eb26fb86ac6172509785afff1e0bbd226ee7 100644
index 1a10bd1a6c527633f97d6eee6525b1e45a3fcd3d..2b983ae3ec3e1d17951add818c2610582d586377 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -937,13 +937,13 @@ void HWNDMessageHandler::FrameTypeChanged() {

View file

@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
BrowserWindow.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index c38b58ed16b14ff765f24d0bb8bdf34b8de3a901..418dc47b6d4df097e8f0cfd61de8485af2a8d2c2 100644
index 6df5e54cefe71393cb6189cc15240d21d2262059..011448d24c557059423f6901b7e1100e476f0c9f 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3775,15 +3775,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
@@ -3765,15 +3765,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
min_window_size = delegate_->DIPToScreenSize(min_window_size);
max_window_size = delegate_->DIPToScreenSize(max_window_size);

View file

@ -87,10 +87,10 @@ index 75df43e3cd2721a92c90c18154d53d5c203e2465..ce42c75c8face36d21f53f44c0201ac4
// The view with active text input state, i.e., a focused <input> element.
// It will be nullptr if no such view exists. Note that the active view
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index eefecd6b3b9c940c3ae3e9ef40075c4a109878ef..fbe6b5d24185c0b0e664db05c7801434737d4d8d 100644
index 374d5f1a1685229865d0f1f1032f36bbcd54e92e..0fba6e8b5f1f9ecde06b9d846b4ace984cdfc943 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -10171,7 +10171,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -10071,7 +10071,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View file

@ -18,7 +18,7 @@ or resizing, but Electron does not seem to run into that issue
for opaque frameless windows even with that block commented out.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 8c13b9db078e690240eca0a48a7c546dcdac3c11..30399c8a81819a57f07702a97f85e3edd7df9d69 100644
index 06fc8190385139f165bad0c2da2fb22d7a2c3d76..1a10bd1a6c527633f97d6eee6525b1e45a3fcd3d 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1800,7 +1800,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {

View file

@ -11,10 +11,10 @@ This patch should be upstreamed as a conditional revert of the logic in desktop
vs mobile runtimes. i.e. restore the old logic only on desktop platforms
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index a3cbb6cb369c2f250c702a0117e36e9aee04068c..05afca0c5560297b3fc4b993e872b6f296971615 100644
index eed851d277c5efa2d5ca594e18eaf7dff3a5d11d..372c81bdfcf4d70dbd5b131a1b02af6b5c878cbe 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2134,9 +2134,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
@@ -2135,9 +2135,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
// The resize message (which may not happen immediately) will carry with it
// the screen info as well as the new size (if the screen has changed scale

View file

@ -582,7 +582,7 @@ index d83f420d25e2c108ad400ebecae02b1ac327c058..77852c5c315ac09dddb7227adf3b840e
return kAttributes;
}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 933abcca124aed9d1d621ff02533b2f7cc71c7d7..1f77801262614d36b7803837ce43ef2a499a7a97 100644
index 6d414afa34803b997ccd363f45fab073c736a5ff..5e31cf33f58efe376396f8d178e0f9930832466a 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -342,6 +342,7 @@ source_set("browser") {

View file

@ -887,10 +887,10 @@ index 97cb6458bc9eec767db89b56abfc5f4b4136ff7b..d9a0b343158b8464b5c9aa8e0e655c0b
ScriptingThrottler scripting_throttler_;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 1f77801262614d36b7803837ce43ef2a499a7a97..de5e27c2960ffd7253aa1dfae46dbc51ca57d2ce 100644
index 5e31cf33f58efe376396f8d178e0f9930832466a..4468d19c0a2587dc678873aef949f54fdf4cb27f 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -3171,8 +3171,9 @@ source_set("browser") {
@@ -3173,8 +3173,9 @@ source_set("browser") {
"//ppapi/shared_impl",
]

View file

@ -8,7 +8,7 @@ Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about `
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index a54a0dedf8ef1cfffa4e80a4707debed0e83d277..e66e71fdbabb40a5307b12cd8965e773e76c04fd 100644
index 09eadc003aab03151a303b648a16e3ea50472f3e..c03ab618ca94e871558408f7bcf432ddc6fadc68 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -28,6 +28,7 @@
@ -30,10 +30,10 @@ index a54a0dedf8ef1cfffa4e80a4707debed0e83d277..e66e71fdbabb40a5307b12cd8965e773
// RenderWidgetHost on the primary main frame, and false otherwise.
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index cdfdd322ffb2e61d5480ac7c88dba35a1cc1b5b9..a3cbb6cb369c2f250c702a0117e36e9aee04068c 100644
index 624094ba6459f3663a12f868c4cb47dfa9f8dce1..eed851d277c5efa2d5ca594e18eaf7dff3a5d11d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2068,6 +2068,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
@@ -2069,6 +2069,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
if (view_) {
view_->UpdateCursor(cursor);
}
@ -44,10 +44,10 @@ index cdfdd322ffb2e61d5480ac7c88dba35a1cc1b5b9..a3cbb6cb369c2f250c702a0117e36e9a
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 811d137c4b77d3347dc8de5bb6207646c952f23b..33abfcd326148f32eff2266a4545345e4a561a4e 100644
index a45bf004f5096809b5fc7b70faa0b7fa7b257049..c034b546289ba069194ad65d3d3bc0703a3afe9c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -6069,6 +6069,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -6045,6 +6045,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}
@ -60,10 +60,10 @@ index 811d137c4b77d3347dc8de5bb6207646c952f23b..33abfcd326148f32eff2266a4545345e
RenderWidgetHostImpl* render_widget_host) {
return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 478c9dfd9019e7acfa2ad63219a268aa5879670e..54c2a41b7ee21f1e6f022c5818e56e24a52ccbef 100644
index 183643a2c6658a5821cb8699d5c8b5d33666a5e0..5117a762c0778f54f392b8ffbb400ef4dbd6a323 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -1193,6 +1193,7 @@ class CONTENT_EXPORT WebContentsImpl
@@ -1191,6 +1191,7 @@ class CONTENT_EXPORT WebContentsImpl
void SendScreenRects() override;
void SendActiveState(bool active) override;
TextInputManager* GetTextInputManager() override;

View file

@ -15,10 +15,10 @@ This CL removes these filters so the unresponsive event can still be
accessed from our JS event. The filtering is moved into Electron's code.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 51798b8ceb81cf9d374cf594aa6afbcb366f4732..bacfca5b2f54e2db7700bb871fff4f66712f5c32 100644
index b50e3c2ecb6f9f3322cfd16fc7bcbd8935f863a2..d7afac20523d2900cbefa5ab3ea9f0863780b704 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -10308,25 +10308,13 @@ void WebContentsImpl::RendererUnresponsive(
@@ -10208,25 +10208,13 @@ void WebContentsImpl::RendererUnresponsive(
base::RepeatingClosure hang_monitor_restarter) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
"render_widget_host", render_widget_host);

View file

@ -9,10 +9,10 @@ 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 4bb69438947fff73a6905a1ecc1b711986a89124..e745a26a4e877ace994be80c2134147500205d0b 100644
index e603c0fddbf4efaeb225686c1791ffb581e9e6c0..88d7b948d57f53fcd681856587f79ece991ee8fa 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4103,6 +4103,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -4079,6 +4079,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
params.main_frame_name, GetOpener(), primary_main_frame_policy,
base::UnguessableToken::Create());
@ -26,7 +26,7 @@ index 4bb69438947fff73a6905a1ecc1b711986a89124..e745a26a4e877ace994be80c21341475
std::unique_ptr<WebContentsViewDelegate> delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -4113,6 +4120,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -4089,6 +4096,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
view_ = CreateWebContentsView(this, std::move(delegate),
&render_view_host_delegate_view_);
}

View file

@ -37,10 +37,10 @@ index d8698f9f37eefa50bf4e29a164b2cc302c32ecdf..3a8dc82b882aa00e9a5430bc8b7ba409
if (had_fullscreen_token && !GetView()->HasFocus())
GetView()->Focus();
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e745a26a4e877ace994be80c2134147500205d0b..eefecd6b3b9c940c3ae3e9ef40075c4a109878ef 100644
index 88d7b948d57f53fcd681856587f79ece991ee8fa..374d5f1a1685229865d0f1f1032f36bbcd54e92e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4393,21 +4393,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
@@ -4369,21 +4369,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
const input::NativeWebKeyboardEvent& event) {
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
"WebContentsImpl::PreHandleKeyboardEvent");
@ -78,7 +78,7 @@ index e745a26a4e877ace994be80c2134147500205d0b..eefecd6b3b9c940c3ae3e9ef40075c4a
}
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
@@ -4566,7 +4570,7 @@ void WebContentsImpl::EnterFullscreenMode(
@@ -4542,7 +4546,7 @@ void WebContentsImpl::EnterFullscreenMode(
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
DCHECK(CanEnterFullscreenMode(requesting_frame));
DCHECK(requesting_frame->IsActive());

View file

@ -8,18 +8,16 @@ import { setTimeout } from 'node:timers/promises';
import { ifdescribe, ifit } from './lib/spec-helpers';
import { closeAllWindows } from './lib/window-helpers';
function getSourceTypes (): ('window' | 'screen')[] {
if (process.platform === 'linux') {
return ['screen'];
}
return ['window', 'screen'];
}
ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('desktopCapturer', () => {
let w: BrowserWindow;
before(async () => {
w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
await w.loadURL('about:blank');
});
after(closeAllWindows);
it('should return a non-empty array of sources', async () => {
const sources = await desktopCapturer.getSources({ types: ['window', 'screen'] });
const sources = await desktopCapturer.getSources({ types: getSourceTypes() });
expect(sources).to.be.an('array').that.is.not.empty();
});
@ -29,14 +27,15 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
});
it('does not throw an error when called more than once (regression)', async () => {
const sources1 = await desktopCapturer.getSources({ types: ['window', 'screen'] });
const sources1 = await desktopCapturer.getSources({ types: getSourceTypes() });
expect(sources1).to.be.an('array').that.is.not.empty();
const sources2 = await desktopCapturer.getSources({ types: ['window', 'screen'] });
const sources2 = await desktopCapturer.getSources({ types: getSourceTypes() });
expect(sources2).to.be.an('array').that.is.not.empty();
});
it('responds to subsequent calls of different options', async () => {
// Linux doesn't return any window sources.
ifit(process.platform !== 'linux')('responds to subsequent calls of different options', async () => {
const promise1 = desktopCapturer.getSources({ types: ['window'] });
await expect(promise1).to.eventually.be.fulfilled();
@ -46,11 +45,11 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
// Linux doesn't return any window sources.
ifit(process.platform !== 'linux')('returns an empty display_id for window sources', async () => {
const w = new BrowserWindow({ width: 200, height: 200 });
await w.loadURL('about:blank');
const w2 = new BrowserWindow({ width: 200, height: 200 });
await w2.loadURL('about:blank');
const sources = await desktopCapturer.getSources({ types: ['window'] });
w.destroy();
w2.destroy();
expect(sources).to.be.an('array').that.is.not.empty();
for (const { display_id: displayId } of sources) {
expect(displayId).to.be.a('string').and.be.empty();
@ -74,7 +73,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
await wShown;
const isNonEmpties: boolean[] = (await desktopCapturer.getSources({
types: ['window', 'screen'],
types: getSourceTypes(),
thumbnailSize: { width: 100, height: 100 }
})).map(s => s.thumbnail.constructor.name === 'NativeImage' && !s.thumbnail.isEmpty());
@ -90,7 +89,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
await wShown;
const isEmpties: boolean[] = (await desktopCapturer.getSources({
types: ['window', 'screen'],
types: getSourceTypes(),
thumbnailSize: { width: 0, height: 0 }
})).map(s => s.thumbnail.constructor.name === 'NativeImage' && s.thumbnail.isEmpty());
@ -99,29 +98,22 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
expect(isEmpties.every(e => e === true)).to.be.true();
});
it('getMediaSourceId should match DesktopCapturerSource.id', async function () {
const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
const wShown = once(w, 'show');
const wFocused = once(w, 'focus');
w.show();
w.focus();
// Linux doesn't return any window sources.
ifit(process.platform !== 'linux')('getMediaSourceId should match DesktopCapturerSource.id', async function () {
const w2 = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
const wShown = once(w2, 'show');
const wFocused = once(w2, 'focus');
w2.show();
w2.focus();
await wShown;
await wFocused;
const mediaSourceId = w.getMediaSourceId();
const mediaSourceId = w2.getMediaSourceId();
const sources = await desktopCapturer.getSources({
types: ['window'],
thumbnailSize: { width: 0, height: 0 }
});
w.destroy();
// TODO(julien.isorce): investigate why |sources| is empty on the linux
// bots while it is not on my workstation, as expected, with and without
// the --ci parameter.
if (process.platform === 'linux' && sources.length === 0) {
this.skip();
return;
}
w2.destroy();
expect(sources).to.be.an('array').that.is.not.empty();
const foundSource = sources.find((source) => {
@ -130,18 +122,19 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
expect(mediaSourceId).to.equal(foundSource!.id);
});
it('getSources should not incorrectly duplicate window_id', async function () {
const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
const wShown = once(w, 'show');
const wFocused = once(w, 'focus');
w.show();
w.focus();
// Linux doesn't return any window sources.
ifit(process.platform !== 'linux')('getSources should not incorrectly duplicate window_id', async function () {
const w2 = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
const wShown = once(w2, 'show');
const wFocused = once(w2, 'focus');
w2.show();
w2.focus();
await wShown;
await wFocused;
// ensure window_id isn't duplicated in getMediaSourceId,
// which uses a different method than getSources
const mediaSourceId = w.getMediaSourceId();
const mediaSourceId = w2.getMediaSourceId();
const ids = mediaSourceId.split(':');
expect(ids[1]).to.not.equal(ids[2]);
@ -149,15 +142,7 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
types: ['window'],
thumbnailSize: { width: 0, height: 0 }
});
w.destroy();
// TODO(julien.isorce): investigate why |sources| is empty on the linux
// bots while it is not on my workstation, as expected, with and without
// the --ci parameter.
if (process.platform === 'linux' && sources.length === 0) {
this.skip();
return;
}
w2.destroy();
expect(sources).to.be.an('array').that.is.not.empty();
for (const source of sources) {
@ -168,19 +153,23 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
// Regression test - see https://github.com/electron/electron/issues/43002
it('does not affect window resizable state', async () => {
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true, contextIsolation: false } });
await w.loadURL('about:blank');
w.resizable = false;
const wShown = once(w, 'show');
w.show();
await wShown;
const sources = await desktopCapturer.getSources({ types: ['window', 'screen'] });
const sources = await desktopCapturer.getSources({ types: getSourceTypes() });
expect(sources).to.be.an('array').that.is.not.empty();
expect(w.resizable).to.be.false();
await closeAllWindows();
});
it('moveAbove should move the window at the requested place', async function () {
// Linux doesn't return any window sources.
ifit(process.platform !== 'linux')('moveAbove should move the window at the requested place', async function () {
// DesktopCapturer.getSources() is guaranteed to return in the correct
// z-order from foreground to background.
const MAX_WIN = 4;
@ -220,15 +209,6 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt
thumbnailSize: { width: 0, height: 0 }
});
// TODO(julien.isorce): investigate why |sources| is empty on the linux
// bots while it is not on my workstation, as expected, with and without
// the --ci parameter.
if (process.platform === 'linux' && sources.length === 0) {
destroyWindows();
this.skip();
return;
}
expect(sources).to.be.an('array').that.is.not.empty();
expect(sources.length).to.gte(MAX_WIN);