Commit graph

28914 commits

Author SHA1 Message Date
Charles Kerr
a19f617ab0
refactor: make URLPipeLoader private (34-x-y) (#46168)
refactor: make URLPipeLoader private

Move the URLPipeLoader class into an anonymous namespace in
electron_url_loader_factory.cc. Manual backport of 1b5db99.
2025-03-20 21:02:00 -05:00
trop[bot]
f008b0d0b2
fix: APNS token ids are lowercase ASCII (#46150)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-20 16:52:03 -05:00
trop[bot]
ce2f471e9d
refactor: Add ElectronBrowserContext::BrowserContexts() (#46159)
* refactor: add ElectronBrowserContext::BrowserContexts()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronBrowserMainParts::PostMainMessageLoopRun()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronExtensionsBrowserClient::IsValidContext()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronExtensionsBrowserClient::BroadcastEventToRenderers()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: move PartitionKey, BrowserContextMap private

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: add ElectronBrowserContext::IsValidContext()

decouple ElectronExtensionsBrowserClient from the internals of ElectronBrowserContext

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-20 16:51:28 -05:00
trop[bot]
5cda3d226c
refactor: use base::NumberToString() (#46152)
base::NumberToString() is slightly more efficient than
absl::StrFormat("%u").

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-20 13:47:41 -05:00
Charles Kerr
30358180c7
refactor: remove unused system header includes (34-x-y) (#46135)
refactor: remove unused system header includes (#46015)

* chore: remove unused #include <string>

* chore: remove unused #include <optional>

* chore: remove unused #include <vector>

* chore: remove unused #include <string_view>

* chore: remove unused #include <memory>

* chore: remove unused #include <utility>

* chore: remove unused #include <tuple>

* chore: remove unused #include <unordered_set>

* chore: remove unused #include <functional>

* chore: iwyu <set>

* chore: iwyu <map>
2025-03-20 07:57:29 +01:00
Charles Kerr
e151aae7a3
refactor: add ElectronBrowserContext::GetDefaultBrowserContext() (34-x-y) (#46136)
refactor: add `ElectronBrowserContext::GetDefaultBrowserContext()` (#46065)

* refactor: add ElectronBrowserContext::DestroyAllContexts()

Simpler semantics than previous implementation; also hides the
"default context must be destroyed last" implementation detail.

* refactor: add ElectronBrowserContext::GetDefaultBrowserContext()

clearer semantics than everyone calling From("", false)
2025-03-19 17:25:35 -05:00
trop[bot]
bc9b5af26e
build: fix compound bash conditional in patchup (#46057)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-17 12:48:42 +01:00
trop[bot]
952b9c0b46
fix: warning in file picker UI (#46076)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-16 23:28:30 -05:00
trop[bot]
5705ce1d6e
fix: take Snapped status into account when showing a window (#46039)
* fix: take Snapped status into account when showing a window

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

* fixup! fix: take Snapped status into account when showing a window

fix: bad trop

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-16 11:15:55 +01:00
trop[bot]
c8ac7b0efd
perf: avoid redundant map lookup in ElectronBrowserContext::From() (#46060)
perf: avoid redundant map lookup in ElectronBrowserContext::FromPath()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-15 13:46:49 -05:00
trop[bot]
dbeed26c0d
fix: ElectronBrowserContext raw_ptr bug + remove dead code (#46054)
refactor: remove unused ElectronBrowserContext::extension_system()

Last use removed on Jul 21, 2020 by 2fb14f5 in PR #24575

This fixes a raw_ptr warning by letting us remove the raw_ptr field
`ElectronBrowserContext::extension_system_`.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-15 11:39:19 -05:00
trop[bot]
99e589c2cf
fix: prevent title change for within page navigation (#46034)
* fix: prevent title change for on page navigation

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* add back and forward testing

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* update Chromium comment

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

* remove errant script tag

Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <mlaurencin@electronjs.org>
2025-03-14 09:53:52 -05:00
trop[bot]
3782fe51ff
fix: don't crash Web Workers on unhandled rejections (#46019)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-14 09:58:37 +01:00
trop[bot]
be7b06108e
refactor: make a variadic gin_helper::internal::InvokeFactory() (#46029)
refactor: make a variadic gin_helper::internal::InvokeFactory()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-13 23:41:02 -05:00
Pedro Pontes
6b956d036d
chore: cherry-pick 1 changes from 3-M133 (#46008)
chore: [34-x-y] cherry-pick 1 changes from 3-M133

* 91343bb45c78 from v8

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-13 16:27:22 -05:00
Pedro Pontes
370ffe0df5
chore: cherry-pick 3 changes from 0-M134 (#46009) 2025-03-13 11:31:56 -05:00
Pedro Pontes
14456ecfbc
chore: cherry-pick 1 changes from 1-M134 (#46011)
chore: [34-x-y] cherry-pick 1 changes from 1-M134

* 2b4812d502b2 from v8
2025-03-13 10:19:23 -05:00
trop[bot]
974c8f5150
refactor: use private inheritance from mojo::MessageReceiver (#45994)
* refactor: make UtilityProcessWrapper inherit privately from mojo::MessageReceiver

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make ParentPort inherit privately from mojo::MessageReceiver

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: make MessagePort inherit privately from mojo::MessageReceiver

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-12 22:49:24 -05:00
trop[bot]
ac5b5995e8
build: roll sysroots to pick up glibc fix (#45982)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-12 09:26:33 +01:00
trop[bot]
5ccd41cf5c
test: fix timing issue in utilityProcess test fixtures (#45976)
* fix: potential timing issue in utilityProcess test

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fix: potential timing issue in utilityProcess esm test

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-11 17:31:16 -04:00
Michaela Laurencin
060cfb94e9
fix: cherry-pick 3a72ebf7ec6f0 from chromium (#45966)
* fix: backport chromium revert 6262017

* add reasoning for patch
2025-03-11 10:09:32 -05:00
trop[bot]
587e115527
fix: remove redundant MediaCaptureDevicesDispatcher::GetInstance() call (#45959)
fix: remove redundant MediaCaptureDevicesDispatcher::GetInstance() call

This appears to be a copy-paste error introduced in 465dee2c

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 14:50:37 -05:00
trop[bot]
a56b2acadd
fix: race condition in utilityProcess tests (#45954)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 14:49:21 -05:00
trop[bot]
58479848b2
refactor: eliminate duplicate code in spec/api-process-spec.ts (#45949)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2025-03-10 11:39:12 -05:00
trop[bot]
ba2cad1670
perf: prefer base::SplitStringPiece() over base::SplitString() (#45948)
* perf: use base::SplitStringPiece() in SetNodeOptions()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: use base::SplitStringPiece() in StringToAccelerator()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: StringToAccelerator() now takes a std::string_view

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 09:50:03 -05:00
Samuel Attard
f98501308a
chore: cherry-pick 521faebc8a7c from chromium (#45944) 2025-03-09 17:01:50 -07:00
Samuel Attard
1d9f1a4cd4
chore: cherry-pick 9dacf5694dfd from chromium (#45939)
* chore: cherry-pick 9dacf5694dfd from chromium

* chore: update patch for <=34
2025-03-09 17:01:20 -07:00
trop[bot]
7d01169091
fix: resolve font list in default prefernce values (#45917)
* fix: resolve font list in default prefernce values

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: fix unsafe buffer usage

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* docs: add code comment

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2025-03-07 16:01:49 +01:00
trop[bot]
ad496c9958
fix: setContentProtection(true) after hide on Windows (#45890)
fix: content protection after hide on Windows

5789117

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-05 10:48:03 -05:00
trop[bot]
b04c4505c4
fix: correct electron gin embedder indices (#45880)
fix: correct gin embedder indices.

Move electron extra embedders to the end of the enum so they do not
interfere with chromium embedders indices.
Also use kEmbedderBlinkTag directly in its index calculation without
adding extra indices from other tags.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Marek Haranczyk <marek@openfin.co>
2025-03-04 12:43:48 +01:00
Shelley Vohr
c3fd3afa24
build: define NOMINMAX in common.gypi (#45870)
build: define NOMINMAX in common.gypi

https://github.com/nodejs/node/pull/52794
2025-03-03 19:48:37 +01:00
trop[bot]
4516469312
fix: context-menu event emitted in draggable regions (#45840)
* fix: context-menu event emitted in draggable regions

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

* fix: only trigger on mouse release

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-02-28 11:20:42 +01:00
Charles Kerr
b4bb928224
refactor: use C++20's contains() method (#45814)
refactor: use C++20's contains() method (#45742)

* chore: use std::map<>::contains() instead of count() or find()

* chore: use std::map<>::contains() instead of base::Contains()
2025-02-27 10:38:30 +01:00
trop[bot]
4ed1ac6ab0
refactor: simplify Invoker::IsOK() (#45819)
* refactor: simplify Invoker::IsOK()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: might as well make it [[nodiscard]] as well

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-27 00:46:14 -06:00
Pedro Pontes
289a1861fc
chore: cherry-pick 1 changes from 0-M133 (#45704)
chore: [34-x-y] cherry-pick 3 changes from 0-M133

* 51cd241b7b13 from chromium
* 1c7ff4d5477f from v8
* 8834c16acfcc from v8
* ee9db7d1348f from skia

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-02-26 15:48:57 +01:00
trop[bot]
b19995e623
refactor: remove unused gin_helper::WrappableBase::GetWrapper(v8::Isolate*) (#45807)
refactor: remove unused EventEmitter::GetWrapper(v8::Isolate*)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-25 22:52:04 -06:00
electron-roller[bot]
47ab952bb1
chore: bump chromium to 132.0.6834.210 (34-x-y) (#45805)
chore: bump chromium in DEPS to 132.0.6834.210

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2025-02-25 22:23:02 -05:00
trop[bot]
0c73c66438
refactor: remove unused v8::Isolate* arg from GlobalShortcut constructor (#45794)
refactor: remove unused isolate arg from GlobalShortcut constructor

has not been used since f1a0d5e811 (#22755)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-24 22:15:49 -06:00
trop[bot]
289168a1ad
fix: drag and drop icons on Windows (#45778)
* fix: drag and drop icons on Windows

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* chore: fix patch merge conflict

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-02-24 21:02:09 -06:00
trop[bot]
9f27479a11
refactor: do not use AdaptCallbackForRepeating() in electron_api_url_loader.cc (#45782)
refactor: do not use AdaptCallbackForRepeating in electron_api_url_loader.cc

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-24 14:42:50 -06:00
trop[bot]
01b8069ada
docs: clarify navigationhistory offsets (#45765)
* docs: clarify navigationhistory offsets

Co-authored-by: Erick Zhao <ezhao@slack-corp.com>

* "relative offset"

Co-authored-by: Erick Zhao <ezhao@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <ezhao@slack-corp.com>
2025-02-21 18:13:29 -06:00
trop[bot]
31a95f7857
refactor: use base's map utills in WebFrameMain (#45759)
refactor: use base::FindPtrOrNull() in WebFrameMain::FromFrameTreeNodeId()

refactor: use base::FindPtrOrNull() in WebFrameMain::FromFrameToken()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-21 18:04:06 -06:00
trop[bot]
70b354643e
fix: crash on getUserMedia with invalid chromeMediaSourceId (#45756)
* fix: crash on getUserMedia with invalid chromeMediaSourceId

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

* test: add a test

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-02-21 22:18:59 +01:00
trop[bot]
4fdfc66706
refactor: use base::as_byte_span() in EncodeToken(). (#45750)
This matches the change in upstream's serial_chooser_context.cc.

5247305

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-21 10:56:27 -06:00
trop[bot]
9d7c3a65fe
build: skip chromium git cookie on forks (#45736)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
2025-02-21 11:53:00 -05:00
trop[bot]
66d1227cc4
refactor: use base::as_bytes() in WriteAsciiChunk() (#45749)
refactor: use base::as_bytes() in WriteAsciiChunk()

this avoids a reinterpret_cast and a static_cast

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-21 10:40:00 -06:00
trop[bot]
ccb7fc05b3
refactor: bluetooth in serial chooser when exclusively wireless serial ports are expected (#45744)
* refactor: bluetooth in serial chooser when exclusively wireless serial ports are expected

5737296

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

* chore: review feedback

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-02-21 10:30:44 -06:00
trop[bot]
d507cf63d1
feat: allow setting roundedCorners on Windows (#45739)
* feat: allow setting roundedCorners on Windows

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

* Update docs/api/structures/base-window-options.md

Co-authored-by: Will Anderson <will@itsananderson.com>

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-02-21 10:15:14 -06:00
trop[bot]
95bce0bce1
refactor: use base::as_string_view() (#45746)
Use `base::as_string_view()` as a safer alternative to `reinterpret_cast`
in a couple of places.

Xref: 5472408

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-21 10:14:12 -06:00
trop[bot]
727e218c47
fix: possible timing issue in utility-process spec (#45728)
This fixture has been calling process.exit() immediately after writing
to stdout and stderr, which the Node.js docs say is risky behavior:

> Calling process.exit() will force the process to exit as quickly as
> possible even if there are still asynchronous operations pending that
> have not yet completed fully, including I/O operations to
> process.stdout and process.stderr.

This fixture's been around for years without problems (AFAIK).
The writes are very small ('hello\n' and 'world') and finish quickly.
But recently I've been testing on a very slow CI machine. There, I see
this spec flaking when it expects stderr to be 'world' but it gets ''.

This PR changes the fixture to wait for stdout & stderr to flush
before calling process.exit().

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-20 08:54:45 +01:00