Commit graph

28958 commits

Author SHA1 Message Date
trop[bot]
ab71a179ec
perf: have ErrorThrower lazily lookup the current isolate (#46416)
perf: have ErrorThrower lazy-lookup the current isolate

ErrorThrower's default constructor is marked as "should rarely if ever
be used" because it's expensive to call.

Unfortunately, nearly every instance of ErrorThrower comes as an argument
in gin_helper's JS-->C++ function marshalling where a thrower is
default-constructed and then populated in gin_helper::GetNextArgument()
with an assignment operator to a temporary ErrorThrower constructed
with the gin::Arguments' isolate.

tldr: most of the time we use the slow constructor first, then throw
that work away unused by overwriting with a fast-constructed one.

This refactor avoids that cost by deferring the expensive work to
`ErrorThrower::isolate()`, where it happens only as a fallback iff
isolate_ hasn't been set.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 15:29:42 -05:00
trop[bot]
dc5091680c
fix: leaked gfx::Canvas in AutofillPopupView::OnPaint() (#46411)
* perf: avoid redundant call to popup_bounds_in_view()

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

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

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

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

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

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

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

* refactor: remove unnecessary draw_canvas variable

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

* refactor: rename bitmap to offscreen_bitmap for symmetry

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

* refactor: avoid another redundant call to popup_bounds_in_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-04-01 15:29:30 -05:00
electron-roller[bot]
8bfd7f05ac
chore: bump node to v20.19.0 (34-x-y) (#46037)
* chore: bump node in DEPS to v20.19.0

* deps, src: simplifying base64 encoding

https://github.com/nodejs/node/pull/52714

* module: simplify --inspect-brk handling

https://github.com/nodejs/node/pull/55679

* test: make test-crypto-hash compatible with OpenSSL > 3.4.0

https://github.com/nodejs/node/pull/56160

* module: refactor ESM loader for adding future synchronous hooks

https://github.com/nodejs/node/pull/54769

* module: detect ESM syntax by trying to recompile as SourceTextModule

https://github.com/nodejs/node/pull/52413

* worker: add postMessageToThread

https://github.com/nodejs/node/pull/53682

* backport unflagging of require(esm) to v20

https://github.com/nodejs/node/pull/56927

* module: detect ESM syntax by trying to recompile as SourceTextModule

https://github.com/nodejs/node/pull/52413

* chore: fixup patch indices

* chore: handle filename.json changes

- https://github.com/nodejs/node/pull/51711
- https://github.com/nodejs/node/pull/53573

* src: refactor embedded entrypoint loading

https://github.com/nodejs/node/pull/53573

* lib: allow CJS source map cache to be reclaimed

https://github.com/nodejs/node/pull/51711

* test: make eval snapshot tests more flexible

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-01 20:51:57 +02:00
trop[bot]
b241c0d98a
fix: UtilityProcess.fork crash before app ready (#46405)
fix: UtilityProcess.fork crash before app ready

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-04-01 09:32:22 -05:00
trop[bot]
75f5c91ad4
perf: avoid unnecessary vector copy in GetMimeTypeToExtensionIdMap() (#46397)
* 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.

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

* 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.

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

* perf: avoid redundant map lookup

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

* refactor: const correctness

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

* refactor: cleanup

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-04-01 08:55:26 -05:00
trop[bot]
b1a378ba26
refactor: use v8::String::Empty() when creating empty strings (#46370)
refactor: use v8::String::Empty() when creating empty strings

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-31 09:26:46 -05:00
trop[bot]
ab1d266535
perf: prefer absl::flat_hash_set over std::unordered_set (#46376)
* perf: use absl::flat_hash_set in SpellCheckClient::SpellCheckText()

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

* perf: use absl::flat_hash_set in MessagePort::DisentanglePorts()

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-31 10:39:42 +02:00
trop[bot]
b4540e013d
perf: avoid double map lookup in HidChooserContext::DeviceRemoved() (#46360)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-29 08:12:22 -05:00
trop[bot]
b4568e63aa
perf: avoid 3x call to GetID() in RegisterPendingSiteInstance() (#46357)
perf: avoid 3x call to GetID() in RegisterPendingSiteInstance()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-29 08:12:11 -05:00
trop[bot]
db034229c4
perf: avoid a double-map lookup in NotificationPresenter::RemoveNotification() (#46355)
perf: avoid a double-map lokup in NotificationPresenter::RemoveNotification()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-29 08:10:06 -05:00
trop[bot]
6f58c2ab8e
perf: avoid redundant map lookups in GetStorageMask() (#46344)
* perf: avoid a redundant map lookuop in GetStorageMask()

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

* perf: avoid a redundant map lookup in GetDataTypeMask()

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-28 10:58:11 -05:00
trop[bot]
d046aacb00
fix: allow NSMenuItems to be disabled (#46340)
* fix: disable NSMenu autoenable feature to allow disabling of NSMenuItems

Co-authored-by: Hailey Schauman <hschauman@slack-corp.com>

* style: fix linter issues and update comments

Co-authored-by: Hailey Schauman <hschauman@slack-corp.com>

* chore: remove unneeded comment

Co-authored-by: Hailey <hschauman@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Hailey Schauman <hschauman@slack-corp.com>
2025-03-28 00:04:07 -05:00
trop[bot]
0410455878
build: validate Chromium cookie authentication (#46325)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-27 17:45:41 -07:00
trop[bot]
ef8c4f283d
perf: avoid double map lookup in WebFrameMain::UpdateRenderFrameHost() (#46330)
perf: avoid double map lookup in WebFrameMain::UpdateRenderFrameHost()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-27 19:21:04 -05:00
Robo
9e2af54b40
fix: emit context-menu event in Windows draggable regions (#46328)
fix: emit `context-menu` event in Windows draggable regions (#46032)

fix: emit context-menu event in Windows draggable regions

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-27 18:14:55 -05:00
trop[bot]
d7fabf348f
perf: avoid a triple-redundant map lookup in ViewsDelegate::GetAppbarAutohideEdges() (#46332)
perf: avoid a triple-redundant map lookup in ViewsDelegate::GetAppbarAutohideEdges()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-27 18:10:57 -05:00
trop[bot]
e87dc57071
build: roll build-images SHAs (#46318)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-27 17:32:44 +01:00
Pedro Pontes
cd7644ff00
chore: cherry-pick 1 changes from 3-M134 (#46304)
* chore: [34-x-y] cherry-pick 1 changes from 3-M134

* b8f80176b163 from chromium

* chore: update patches

---------

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2025-03-27 10:56:37 +01:00
trop[bot]
8d77d66e5a
fix: set userAgent on navigationHistory.restore() (#46298)
fix: set userAgent on navigationHistory restore

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-26 19:53:18 -05:00
trop[bot]
3d51ce2ca5
perf: avoid std::map temporaries in WebContents::DevToolsRequestFileSystems() (#46310)
* perf: move the GetDevToolsWebContents() call outside of the loop

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

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

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

* refactor: remove unused GetAddedFileSystemPaths()

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

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

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-26 19:25:34 -05:00
trop[bot]
5daff5468b
perf: avoid redundant map lookup in AddComponentResourceEntries() (#46289)
* perf: avoid double map lookup in ElectronComponentExtensionResourceManager::AddComponentResourceEntries()

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

* perf: move the path key when calling try_emplace()

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-26 19:11:09 -05:00
trop[bot]
09a9b419b8
perf: avoid redundant map lookup in WebContents::DevToolsIndexPath() (#46297)
perf: avoid double map lookup in WebContents::DevToolsIndexPath()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-26 18:34:26 -05:00
Shelley Vohr
9049d01bd6
fix: build failure when printing is disabled (#46286)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-26 09:46:58 -05:00
trop[bot]
42c8938c9a
perf: avoid redundant map lookup in WebFrameMain constructor (#46277)
perf: avoid double map lookup in WebFrameMain constructor

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-25 22:00:40 -04:00
trop[bot]
b5f8c7554a
perf: avoid std::map temporaries in IsDevToolsFileSystemAdded() (#46266)
* refactor: extract-method GetAddedFileSystems()

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

* refactor: use GetAddedFileSystems() in GetAddedFileSystemPaths()

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

* refactor: use GetAddedFileSystems() in IsDevToolsFileSystemAdded()

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-25 23:40:42 +01:00
trop[bot]
0b34f5b45e
build: fixup windows source cache for release (#46269)
* build: fixup ffmpeg gn gen

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: add build-tools depot_tools to PATH

There are some cases where it is still expected that depot_tools be in the path

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* put back regular gn gen for ffmpeg

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: add retry to moving source cache

This resolves the error: `Move-Item : The process cannot access the file because it is being used by another process.`

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-03-25 16:34:00 -05:00
trop[bot]
2b7f32428f
fix: webContents.printToPDF() with cross-process subframes (#46258)
fix: webContents.printToPDF() with cross-process subframes

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-25 13:09:38 -05:00
trop[bot]
2d7cfd3de2
perf: don't wait for thumbnails if they were not requested on macOS (#46250)
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.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Beutner <beutner.john@gmail.com>
2025-03-25 16:44:25 +01:00
trop[bot]
06c84f35bd
fix: oob string read when parsing node_options (#46246)
* fix: oob string read when parsing node_options

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

* chore: re-enable test

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

* fix: missing linux server env for tests

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-25 08:14:59 -05:00
Robo
cfb7237c6c
fix: system-context-menu should only fire in draggable regions (34-x-y) (#46175) 2025-03-25 12:20:57 +01:00
trop[bot]
fa4462341a
fix: NODE_OPTIONS parsing for child processes on macOS (#46242)
* fix: NODE_OPTIONS parsing for child processes on macOS

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

* chore: temporarily disable test

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

* chore: apply review feedback

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

* chore: fix build

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-25 19:32:04 +09:00
trop[bot]
19069ead12
feat: add ffmpeg.dll to delay load configuration (#46174)
feat: set ffmpeg.dll as a delay-loaded DLL

Updated the /DELAYLOAD linker config in BUILD.gn to set ffmpeg.dll
as a delay-loaded DLL. This reduces startup overhead and prevents unnecessary
loading when ffmpeg-related functionality is not used (e.g., the browser process
was unnecessarily loading it).

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Zonglong Liu <83216456+mai-121@users.noreply.github.com>
2025-03-24 23:15:05 -05:00
trop[bot]
6da5666aa5
build: fixup release builds (#46232)
* build: fixup release builds

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: fixup windows source cache for release

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-03-24 17:19:28 -04:00
trop[bot]
fcdf08ce75
fix: Wayland resizing border (#46223)
* 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.

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

* fix: border insets when fullscreen

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-03-24 10:54:32 -05:00
trop[bot]
fe9e90af7b
refactor: remove unused weak_factory_ in electron_management_api_delegate.cc (#46219)
refactor: remove unused weak_factory_

Appears to have been added in 3745b76da but never used

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-24 15:03:08 +01:00
trop[bot]
ef9cd3464d
build: Use windows src cache (#46187)
build: use source cache on windows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-03-24 09:33:37 -04:00
trop[bot]
51f771224a
refactor: remove unused method ProxyingWebSocket::web_request_api() (#46216)
Appears to have been added in c608d6d7 but never used

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-24 08:21:59 -05:00
trop[bot]
23d574152e
refactor: remove unused method ElectronBrowserContext::GetWeakPtr() (#46197)
* refactor: use forward declaration of MediaDeviceIDSalt in electron_browser_context.h

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

* refactor: remove unused #include from browser_context.h

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

* refactor: remove unused ElectronBrowserContext::GetWeakPtr()

last use removed in Aug 2020 by bac2f46

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-22 14:22:19 -05:00
trop[bot]
4bee1eaded
refactor: use = default to define trivial destructors (#46192)
refactor: use '= default' to define trivial destructors

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-22 10:14:28 -05:00
Pedro Pontes
88f4deb3a3
chore: restore forced LF for patch files with exception (#45902)
chore: restore forced LF for patch files and add exception
2025-03-21 14:11:36 -04:00
trop[bot]
165ea64314
build: fail for out of date patches on forks (#46125)
* build: fail for out of date patches on forks

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

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-03-21 19:04:34 +01:00
trop[bot]
8961eb074b
build: move set chromium cookie before build tools step (#46096)
build: move set cookie before build tools

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
2025-03-21 12:43:59 -04:00
trop[bot]
b194cb1486
refactor: reduce coupling in electron::api::Protocol (#46181)
* refactor: decouple api::Protocol from ElectronBrowserContext

now they do not know about each other

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

* refactor: make electron::api::ProtocolError private

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

* refactor: remove unused isolate arg in Protocol constructor

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

* refactor: use =default for trivial destructor

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-21 11:09:19 -05:00
trop[bot]
470a82869c
refactor: use GetDefaultStoragePartition() instead of GetStoragePartition(nullptr) (#46082)
refactor: use GetDefaultStoragePartition()

Use GetDefaultStorageParition() instead of GetStoragePartition(nullptr)

- It improves code uniformity, since we use get-default everywhere else
- It's more readable
- It's marginally faster, since GetStoragePartition() has more steps

Added in 49b0a1bf4a

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-20 23:06:39 -05:00
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