* 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
* 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.
* 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>
* 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
* refactor: extract-method GetAddedFileSystems()
* refactor: use GetAddedFileSystems() in GetAddedFileSystemPaths()
* refactor: use GetAddedFileSystems() in IsDevToolsFileSystemAdded()
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.
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.
* 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
* 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
* 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
* refactor: decouple api::Protocol from ElectronBrowserContext
now they do not know about each other
* refactor: make electron::api::ProtocolError private
* refactor: remove unused isolate arg in Protocol constructor
* refactor: use =default for trivial destructor
* refactor: add ElectronBrowserContext::BrowserContexts()
* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronBrowserMainParts::PostMainMessageLoopRun()
* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronExtensionsBrowserClient::IsValidContext()
* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronExtensionsBrowserClient::BroadcastEventToRenderers()
* refactor: move PartitionKey, BrowserContextMap private
* refactor: add ElectronBrowserContext::IsValidContext()
decouple ElectronExtensionsBrowserClient from the internals of ElectronBrowserContext
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