Commit graph

3306 commits

Author SHA1 Message Date
electron-roller[bot]
9c019b6147
chore: bump chromium to 136.0.7095.0 (main) (#46118)
* chore: bump chromium in DEPS to 136.0.7076.0

* chore: bump chromium in DEPS to 136.0.7077.0

* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856

* 6356528: Clean up LegacyRenderWidgetHostHWND code | 6356528

* chore: export patches

* 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | 6339113

* 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | 6352169

* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856

* 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| 6360858

* chore: bump chromium in DEPS to 136.0.7079.0

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7081.0

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7083.0

* 6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | 6361987

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7087.0

* chore: export patches

* fix: include node patch for missing AtomicsWaitEvent
6385540

* build: add depot_tools python to path

* fix: cppgc init and unregistering v8 isolate

6333562

CppGc is now initialized earlier so Node can skip reinitializing it.

Additionally, gin::IsolateHandle was attempting to destruct an already destructed
v8::Isolate upon electron::JavaScriptEnvironment destruction. By removing the call
to NodePlatform::UnregisterIsolate, this fixes the crash on app shutdown.

* fix: unregister isolate after destruction

See code comment.

* chore: bump chromium in DEPS to 136.0.7095.0

* chore: sync patches

* fix: add script_parsing::ContentScriptType parameter
6298395

* fix: migrate content::BrowserAccessibilityState methods
6401437
6383275

* feat: enableHappyEyeballs option for host resolver
6332599

* fix: add new cookie exclusion reason
6343479

* fix: add new url loader method
6337340

* fix: add new cppgc header file for electron_node headers
6348644

* fix: disable CREL on Linux ARM64
https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9

* fixup! fix: add new cppgc header file for electron_node headers 6348644

* chore: update corner smoothing patch

* fixup! chore: update corner smoothing patch

* chore: disable NAN weak tests

These two tests are incompatible with a V8 change that disallows running JS code from a weak finalizer callback.

Ref: 4733273

* test: fix task starvation in node test

A V8 change makes these contexts get collected in a task that is posted
and run asynchronously. The tests were synchronously GC'ing in an
infinite loop, preventing the task loop from running the task that would
GC these contexts.

This change should be upstreamed in some way.

Ref: 4733273

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
2025-04-03 19:02:49 -05:00
Charles Kerr
0a5da83a1b
perf: avoid redundant map lookup in HidChooserContext::DeviceChanged() (#46451)
perf: avoid redundant map lookup in HidChooserContext::DeviceChanged()
2025-04-03 17:51:37 -05:00
yangllu
e46b0c8ddc
fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8 (#46434)
* fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8

* fix: use CleanedUpAtExit to control the lifetime of GPUInfoManager
2025-04-03 10:12:12 -07:00
Samuel Attard
0e3246e20d
fix: ensure maximize is emitted when reduce motion is enabled on macOS (#46459)
* fix: ensure maximize is emitted when reduce motion is enabled on macOS

* Revert "build: reenable graphics effects for macOS tests (#46454)"

This reverts commit 682ea345ac.
2025-04-03 11:14:16 -05:00
Charles Kerr
0ff98810ba
fix: NativeWindowViews::GetRestoredState() can return wrong state when maximized (#46450)
fix: NativeWindowViews::GetRestoredState() returning wrong state

Introduced by the af58931 Chromium 131.0.6744.0 roll, specifically
9840662 (diff-f9d7ef7)

98406626
2025-04-03 08:55:04 -05:00
Charles Kerr
a21c805ece
perf: avoid redundant call to virtual methods GetProcess() and GetID() (#46409) 2025-04-02 11:57:09 -05:00
Charles Kerr
6f24dbaab4
perf: prefer absl::flat_hash_set over std::set when sorted order is not needed (#46410)
* perf: use an absl::flat_hash_set for UsbChooserContext::ephemeral_devices_

* perf: use an absl::flat_hash_set for GlobalMenuBarRegistrarX11::live_windows_

* perf: use an absl::flat_hash_set for NativeWindowViews::forwarding_windows_

* perf: use an absl::flat_hash_set for OffScreenRenderWidgetHostView::guest_host_views_

perf: use an absl::flat_hash_set for OffScreenRenderWidgetHostView::proxy_views_

* perf: use an absl::flat_hash_set for NativeWindow::injected_frames_

* perf: use an absl::flat_hash_set for NativeWindow::background_throttling_sources_
2025-04-02 11:03:36 -05:00
Charles Kerr
36e233797c
perf: cache the return value of IsX11() (#46391)
* perf: cache the return value of IsX11()

* fix: mark as nodiscard for those who call, but mark as maybe_unused for Windows
2025-04-01 15:28:01 -05:00
Charles Kerr
5499c800a7
perf: avoid redundant map lookup in UsbChooserContext::OnDeviceRemoved() (#46387) 2025-04-01 12:39:34 -05:00
Charles Kerr
ac1ffb1bff
fix: leaked gfx::Canvas in AutofillPopupView::OnPaint() (#46384)
* perf: avoid redundant call to popup_bounds_in_view()

* refactor: use a std::optional<> for paint_canvas local

* fix: fix leaked gfx::Canvas in AutofillPopupView::OnPaint()

* refactor: remove redundant get() call when testing smart pointer for nonempty

* refactor: remove unnecessary draw_canvas variable

* refactor: rename bitmap to offscreen_bitmap for symmetry

* refactor: avoid another redundant call to popup_bounds_in_view()
2025-04-01 11:22:26 -05:00
Charles Kerr
5a6f1ede6a
feat!: remove support for ProtocolResponse.session null value (#46264)
BREAKING CHANGE

This was deprecated in f7ba0d3b & is now being removed for Electron 37.
2025-04-01 08:52:12 -05:00
zoy
0e687d3082
fix: rounded corners disappear momentarily on window close (#46382)
fix: Explicitly set rounded corners in borderless mode on Windows 11

Signed-off-by: zoy <zoy-l@outlook.com>
2025-04-01 15:43:54 +02:00
Shelley Vohr
9c4720766d
fix: UtilityProcess.fork crash before app ready (#46380)
fix: UtilityProcess.fork crash before app ready
2025-04-01 13:42:03 +02:00
Shelley Vohr
5da75c4a97
feat: support system-context-menu on Linux (#45848)
feat: support system-context-menu on Linux
2025-04-01 11:00:39 +02:00
Charles Kerr
77833eddfb
perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46373)
* perf: avoid making an unnecessary copy of the vector

MimeTypesHandler::GetMIMETypeAllowlist() returns a const&, so we can
iterate that directly instead of making a temporary copy of it.

* perf: move the call to ExtensionRegistry::Get() outside of the loop

Also, keep the previous behavior of not calling it at all if there
aren't any whitelisted extensions.

* perf: avoid redundant map lookup

* refactor: const correctness

* refactor: cleanup
2025-03-31 21:52:49 -05:00
Calvin
1730062c8f
fix: flicker and ghosting in transparent windows on macOS (#46353)
* fix: transparent flicker on MAS

* Gate condition on `IsTranslucent` instead
2025-03-31 18:12:35 -05:00
Calvin
09135443a0
feat: Corner Smoothing CSS rule (Reland) (#46278)
* feat: Corner Smoothing CSS rule (Reland)

Reland of #45185

* Fix patch conflicts

* fixup! Fix patch conflicts

* Update expected image

The dashed border is subtly different. The new version is correct and the old one was incorrect.
2025-03-31 11:22:23 -05:00
Charles Kerr
fcd836e34f
refactor: remove field unused weak_factory_ (#46363)
refactor: remove unused weak_factory_

Appears to have been added in e3f61b46 but never used
2025-03-31 10:39:21 +02:00
Charles Kerr
ae6930030a
perf: prefer absl::flat_hash_set over std::unordered_set (#46348)
* perf: use absl::flat_hash_set in SpellCheckClient::SpellCheckText()

* perf: use absl::flat_hash_set in MessagePort::DisentanglePorts()
2025-03-30 23:21:18 -05:00
Charles Kerr
2fa4fb0da9
refactor: use v8::String::Empty() when creating empty strings (#46349)
refactor: use v8::String::Empty() when creating empty strings
2025-03-30 21:14:18 -05:00
Charles Kerr
bf93427cbb
perf: avoid double map lookup in HidChooserContext::DeviceRemoved() (#46343) 2025-03-28 21:34:24 -05:00
Charles Kerr
72fc65d2c5
perf: avoid 3x call to GetID() in RegisterPendingSiteInstance() (#46339)
perf: avoid 3x call to GetID() in RegisterPendingSiteInstance()
2025-03-28 21:33:45 -05:00
Charles Kerr
2baa4a3514
perf: avoid a double-map lookup in NotificationPresenter::RemoveNotification() (#46338)
perf: avoid a double-map lokup in NotificationPresenter::RemoveNotification()
2025-03-28 21:33:11 -05:00
Samuel Attard
49aba471dc
feat: add support for associating a Menu with a WebFrameMain (#45138)
* feat: add support for associating a Menu with a WebFrameMain

This allows certain OS level features to activate such as Writing Tools, Autofill.. and Services.

There appears to be a bug in macOS where the responder chain isn't traversed if the menu is not popped up using an event, as such we spoof a fake mouse event at the write coordinates in the right window and use that to open the menu.

* build: fix build on non-mac

* build: oops missed a header

* fix: safely handle optional T* by checking nullptr too

* build: fix gn check and build errors

* docs: suggested changes

* feat: default `frame` to `window.webContents.mainFrame` when possible

* fix: avoid deref nullptr view

* Revert "feat: default `frame` to `window.webContents.mainFrame` when possible"

This reverts commit 2e888368199317d67f6ad931a7e9eff0295c4b1b.

* fix: lint

* Remove redundant scoped objects

This code, including the comments, matches almost exactly the behavior of this argument to the function.

* Add ScopedPumpMessagesInPrivateModes patch

* More null pointer safety

---------

Co-authored-by: clavin <clavin@electronjs.org>
2025-03-28 11:50:07 -07:00
Charles Kerr
46b108e9a4
perf: avoid redundant map lookups in GetStorageMask() (#46315)
* perf: avoid a redundant map lookuop in GetStorageMask()

* perf: avoid a redundant map lookup in GetDataTypeMask()
2025-03-28 00:25:25 -05:00
Hailey
ac616ef41d
fix: allow NSMenuItems to be disabled (#46307)
* fix: disable NSMenu autoenable feature to allow disabling of NSMenuItems

* style: fix linter issues and update comments

* chore: remove unneeded comment
2025-03-27 17:43:46 -07:00
Charles Kerr
e09712f0e1
perf: avoid a triple-redundant map lookup in ViewsDelegate::GetAppbarAutohideEdges() (#46306)
perf: avoid a triple-redundant map lookup in ViewsDelegate::GetAppbarAutohideEdges()
2025-03-27 14:32:27 -05:00
Charles Kerr
35c90fd807
perf: avoid double map lookup in WebFrameMain::UpdateRenderFrameHost() (#46293)
perf: avoid double map lookup in WebFrameMain::UpdateRenderFrameHost()
2025-03-27 14:32:01 -05:00
Charles Kerr
3ae285b614
perf: avoid std::map temporaries in WebContents::DevToolsRequestFileSystems() (#46268)
* perf: move the GetDevToolsWebContents() call outside of the loop

* perf: remove std::map temporary in WebContents::DevToolsRequestFileSystems()

* refactor: remove unused GetAddedFileSystemPaths()

* perf: remove std::vector temporary in WebContents::DevToolsRequestFileSystems()
2025-03-26 16:26:56 -05:00
Shelley Vohr
3212f60d69
fix: set userAgent on navigationHistory.restore() (#46260)
fix: set userAgent on navigationHistory restore
2025-03-26 10:59:19 -05:00
Charles Kerr
a5076a663b
perf: avoid redundant map lookup in WebContents::DevToolsIndexPath() (#46254)
perf: avoid double map lookup in WebContents::DevToolsIndexPath()
2025-03-26 10:30:02 -05:00
Charles Kerr
8412d78310
perf: avoid redundant map lookup in AddComponentResourceEntries() (#46255)
* perf: avoid double map lookup in ElectronComponentExtensionResourceManager::AddComponentResourceEntries()

* perf: move the path key when calling try_emplace()
2025-03-26 08:12:16 -05:00
Charles Kerr
48a38c0289
fix: build failure when printing is disabled (#46283)
fix: ftbfs when printing is disabled
2025-03-26 10:04:39 +01:00
Charles Kerr
6e44662f15
perf: avoid redundant map lookup in WebFrameMain constructor (#46238)
perf: avoid double map lookup in WebFrameMain constructor
2025-03-25 16:53:24 -05:00
Charles Kerr
c8d3184a95
refactor: migrate hashing code to new upstream crypto::hash API (#46237)
* refactor: migrate AsarFileValidator to crypto::hash

This change migrates AsarFileValidator's uses of crypto::secure_hash
to the new crypto::hash API, which has more memory safety and less
heap allocations.

Xref: 6287609

* refactor: migrate ValidateIntegrityOrDie to crypto::hash

This change migrates ValidateIntegrityOrDie's use of crypto::SHA256Hash
to the new crypto::hash API, which has more memory safety and less heap
allocations.

Xref: 6287609
2025-03-25 15:01:17 -05:00
Charles Kerr
ced8fdbce8
perf: avoid std::map temporaries in IsDevToolsFileSystemAdded() (#46230)
* refactor: extract-method GetAddedFileSystems()

* refactor: use GetAddedFileSystems() in GetAddedFileSystemPaths()

* refactor: use GetAddedFileSystems() in IsDevToolsFileSystemAdded()
2025-03-25 11:42:58 -05:00
Charles Kerr
4f4e23a3b3
perf: avoid redundant map lookups in GlobalShortcut (#46229)
* perf: avoid redundant map lookup in GlobalShortcut::OnKeyPressed()

* perf: avoid redundant map lookup in GlobalShortcut::ExecuteCommand()
2025-03-25 09:46:03 -05:00
Shelley Vohr
1d6cb348b4
fix: webContents.printToPDF() with cross-process subframes (#46218)
fix: webContents.printToPDF() with cross-process subframes
2025-03-25 08:16:47 -05:00
John Beutner
cf82c3215f
perf: don't wait for thumbnails if they were not requested on macOS (#46138)
When using the SCK thumbnail capturer, the first refresh has the list of
sources, and the second refresh has the thumbnails. If thumbnails are
not needed, only wait for the first refresh.
2025-03-25 12:20:38 +01:00
Robo
a86e44b176
fix: NODE_OPTIONS parsing for child processes on macOS (#46209)
* fix: NODE_OPTIONS parsing for child processes on macOS

* chore: temporarily disable test

* chore: apply review feedback

* chore: fix build
2025-03-25 13:01:37 +09:00
Calvin
abaef13c0b
fix: Revert "feat: Corner Smoothing CSS rule" (#46231)
Revert "feat: Corner Smoothing CSS rule (#45185)"

This reverts commit b75e802280.
2025-03-24 20:36:49 +01:00
John Beutner
cfd64b5f89
fix: handle OnDelegatedSourceListDismissed asynchronously (#46112)
This fixes a crash with the PipeWire capturer caused by a Chromium
change introduced in
5783826.

DesktopMediaListBase now calls Refresh(true) after dispatching
DesktopMediaListObserver::OnDelegatedSourceListDismissed, so it's
important not to call DesktopCapturer::HandleFailure (which deallocates
the DesktopMediaList) synchronously from OnDelegatedSourceListDismissed.
2025-03-24 20:09:11 +01:00
Calvin
b75e802280
feat: Corner Smoothing CSS rule (#45185)
* feat: Corner Smoothing

* Patch Blink to add CSS rule and Painting

* Add `system-ui` keyword

* Add `cornerSmoothingCSS` web preference

* Add tests

* Documentation

* fixup! Documentation

* fix: initialize smoothness value

* Use a 1.0 scale factor in tests

* Fix tests for CI

* Fix tests

* fixup! Merge branch 'main' into clavin/corner-smoothing

* Add code docs

* Document `system-ui` keyword values

* Address review comments

* fixup! Address review comments

* Address review comments

* Update patch to address upstream changes

The patch went from 694 lines to 505 lines, which is a 27.2% smaller!

* fixup! Update patch to address upstream changes
2025-03-24 11:46:12 -04:00
Shelley Vohr
9ec14b91e7
feat: add BrowserWindow.isSnapped() (#46079)
* feat: add BrowserWindow.isSnapped() on Windows

* docs: mark _Readonly_
2025-03-24 12:09:14 +01:00
Shelley Vohr
47cf4e7bfd
fix: Wayland resizing border (#46155)
* fix: Wayland resizing border

Closes https://github.com/electron/electron/issues/44543
Refs CL:5180720

Fixes an issue where the resizing border didn't work as expected on Wayland windows.

* fix: border insets when fullscreen
2025-03-24 12:08:24 +01:00
Charles Kerr
b8150f33db
refactor: remove unused weak_factory_ in electron_management_api_delegate.cc (#46200)
refactor: remove unused weak_factory_

Appears to have been added in 3745b76da but never used
2025-03-24 12:07:49 +01:00
Charles Kerr
02a4bd5942
refactor: remove unused method ProxyingWebSocket::web_request_api() (#46201)
Appears to have been added in c608d6d7 but never used
2025-03-24 10:09:24 +01:00
Charles Kerr
7ed4f0ca27
perf: use absl::flat_hash_map instead of std::unordered_map (#46202)
* perf: make ElectronUsbDelegate::controller_map_ an absl::flat_hash_map

* perf: make ElectronSerialDelegate::controller_map_ an absl::flat_hash_map

* perf: make ElectronHidDelegate::controller_map_ an absl::flat_hash_map

* perf: make FrameTreeNodeIdMap an absl::flat_hash_map

* perf: make AutofillDriverFactory::driver_map_ an absl::flat_hash_map

* perf: make asar::Archive::external_files_ an absl::flat_hash_map

* perf: make VersionIdMap an absl::flat_hash_map

* perf: make ObjectCache::proxy_map_ an absl::flat_hash_map

* docs: add TODO to investigate absl map in KeyWeakMap
2025-03-24 10:09:14 +01:00
Charles Kerr
5623c96dd7
refactor: remove unused field ServiceWorkerMain::weak_factory_ (#46171)
refactor: remove unused field ServiceWorkerMain::weak_factory_

Added in a467d06, appears to have never been used
2025-03-23 10:14:45 +01:00
Charles Kerr
3fd35abe98
refactor: remove unused method ElectronBrowserContext::GetWeakPtr() (#46170)
* refactor: use forward declaration of MediaDeviceIDSalt in electron_browser_context.h

* refactor: remove unused #include from browser_context.h

* refactor: remove unused ElectronBrowserContext::GetWeakPtr()

last use removed in Aug 2020 by bac2f46
2025-03-22 10:15:15 -05:00