* refactor: CallMethodWithArgs() now takes a span of value handles
* perf: use std::array instead of std::vector to hold Emit arg parameter packs
* chore: remove unused gin_helper::EmitEvent(iso, obj, name, span<Local>)
* chore: iwyu mojom.h headers
* fixup! chore: iwyu mojom.h headers
make previously-indirect include dependency direct
* fixup! fixup! chore: iwyu mojom.h headers
make previously-indirect include dependency direct
Closes https://github.com/electron/electron/issues/43714.
Fixes an issue where the resizing border was not being handled correctly on Linux WCO
caption buttons. This is now taken into account as a part of the NonClientHitTest.
* refactor: move scope scaffolding into SettletScope
idea stolen from SpellCheckScope
* refactor: move impl of PromiseBase::RejectPromise() to the cc file
* chore: remove unused #include
* feat: hide menu bar on windows fullscreen
* test: state prior to html fullscreen transition
* refactor: restore `#ifdef` for readability
Reference: https://github.com/electron/electron/pull/43402#discussion_r1729356262
* docs: menu bar behavior changed
---------
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
refactor: avoid redundant Promise.GetContext calls
Several Promise methods call `GetContext()` multiple times. From looking
at the assembly in obj/electron/electron_lib/promise.o, these redundant
calls are actually being made -- they aren't optmized out.
This PR keeps the return value in a local variable to avoid extra calls.
refactor: take a uint8_t span in ValidateIntegrityOrDie()
Doing some groundwork for fixing unsafe base::File() APIs:
- Change ValidateIntegrityOrDie() to take a span<const uint8_t> arg.
We'll need this to migrate asar's base::File API calls away from the
ones tagged `UNSAFE_BUFFER_USAGE` because the safe counterparts use
span<uint8_t> too.
- Simplify ValidateIntegrityOrDie()'s implementation by using
crypto::SHA256Hash() instead of reinventing the wheel.
Use v8::ArrayBufferView::CopyContents() instead of doing the pointer
math + memcpy() ourselves. This not only solves the buffer warnings,
but may also avoid some additional overhead:
> Copy the contents of the ArrayBufferView's buffer to an
> embedder defined memory without additional overhead that
> calling ArrayBufferView::Buffer might incur.
* fix: Launch apps with XDG_ACTIVATION_TOKEN in ozone/wayland
Ensure apps are launched with the activation token received from
xdg_activation_v1 protocol.
* add focus_launched_process option
* fix: remove use of deprecated v8::String::Value
Upstream marked v8::String::Value as `V8_DEPRECATE_SOON` last month,
so let's stop using it.
The replacement code mostly does the same as v8::String::Value();
but since our test only cares about the length and not the contents,
we get a small perf win of not needing to allocate a char array and
not needing to call Local::String::Write().
Upstream V8_DEPRECATE_SOON:
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5667299kkk
v8::String::Value() implementation:
20226b740b/src/api/api.cc (10883)
History on why we used it:
80c1a9739df49ed30f72
* Update shell/common/gin_converters/file_path_converter.h
Co-authored-by: Robo <hop2deep@gmail.com>
* fixup! Update shell/common/gin_converters/file_path_converter.h
do not return success for all non-Null non-Strings
---------
Co-authored-by: Robo <hop2deep@gmail.com>
When an electron app is launched by another app ensure that the
XDG_ACTIVATION_TOKEN env var is read and used for activation using
xdg_activation_v1 protocol.
* fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera
* Revert "fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera"
This reverts commit e9cc67216558263402867056ed332f8781da3153.
* should only do these checks for audio or video, but not screenshare
* no service
* oops
---------
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* fix: -Wunsafe-buffer-usage warnings in IsUrlArg()
* chore: improve code comments for CheckCommandLineArguments()
* chore: reduce diffs from main
* refactor: CheckCommandLineArguments takes a StringVector arg
Fixes another buffer warning!
* chore: avoid double-call to url.scheme() in WebContentsZoomController::SetZoomMode()
* perf: use gurl.scheme_piece() in GetAppInfoHelperForProtocol()
* perf: use gurl.scheme_piece() in Browser::GetApplicationNameForProtocol()
* refactor: add std::less<> to HandlersMap
This lets us search it using string_view keys
* refactor: ProtocolRegistry::FindRegistered() now takes a std::string_view
* perf: use gurl.scheme_piece() in InspectableWebContents::LoadNetworkResource()
* refactor: ProtocolRegistry::FindIntercepted() now takes a std::string_view
* perf: use gurl.scheme_piece() in SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL()
* perf: use gurl.scheme_piece() in ProxyingURLLoaderFactory::CreateLoaderAndStart()
* perf: use gurl.host_piece() in ElectronWebUIControllerFactory::GetWebUIType()
* perf: use gurl.host_piece() in ElectronWebUIControllerFactory::CreateWebUIControllerForURL()