Commit graph

3450 commits

Author SHA1 Message Date
trop[bot]
2e33636033
refactor: remove unused C string ToV8() gin converter (#44523)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-11-02 13:56:55 -05:00
trop[bot]
faa1910ffe
perf: use v8::String::NewFromUtf8Literal in ToV8() gin converter (#44518)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-11-01 16:56:09 -05:00
trop[bot]
85272b00a4
fix: EventSource undefined in Renderer/Worker (#44497)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-10-31 16:44:00 -05:00
trop[bot]
310319b00a
perf: remove isolate scope from DidProcessTask() (#44472)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-31 11:30:10 +01:00
Charles Kerr
1cbd5f451a
fix: -Wunsafe-buffer-usage warning in ChunkedDataPipeReadableStream (32-x-y) (#44440)
* fix: -Wunsafe-buffer-usage warning in ChunkedDataPipeReadableStream (#44211)

* chore: rename v8_value_serializer.cc,h to v8_util.cc,h

* feat: add electron::util::as_byte_span(v8::Local<v8::ArrayBuffer>)

* fix: -Wunsafe-buffer-usage warnings in ChunkedDataPipeReadableStream::ReadInternal()

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5619253

* refactor: restore node buffer span util

* refactor: remove redundant span wrapper

* empty commit to force the Valid Backport check to rerun 🤷
2024-10-29 14:51:59 -05:00
trop[bot]
91fb7ff6e3
fix: keep gdk_pixbuf a dynamic dependency (#44437)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2024-10-28 21:46:47 -05:00
trop[bot]
e781fe50df
fix: crash on netlog connection error (#44419)
* fix: crash on netlog connection error

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

* refactor: remove default PromiseBase constructor

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

* Revert "refactor: remove default PromiseBase constructor"

This reverts commit 9292324a0d5f9e63ba8f73f63dfff1d48eb2f38f.

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

* remove dcheck

Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
2024-10-28 12:35:32 -04:00
trop[bot]
1a2015c87d
perf: prefer NewFromUtf8Literal() over NewFromUtf8() for string literals (#44427)
* perf: prefer NewFromUtf8Literal() over NewFromUtf8() for string literals

the string length is known at compile time and no need to call ToLocalChecked()

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

* perf: string length is known when calling NewFromUtf8(), so use it

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

* perf: remove unnecessary calls to c_str()

these just force the code being called to have to recalculate the string length

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>
2024-10-28 10:51:41 -05:00
trop[bot]
15486ec73d
fix: respect setAlwaysOnTop before showInactive on Linux under X11 (#44325)
fix: respect setAlwaysOnTop before showInactive on Linux under X11 (#44078)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Beutner <31829097+cptpcrd@users.noreply.github.com>
2024-10-18 16:19:43 -04:00
Robo
d5d936d078
fix: trace-startup crashing child process on macOS (32-x-y) (#44292)
* fix: trace-startup crashing child process on macOS (32-x-y)

* chore: disable test on linux arm

* chore: also disable on linux arm64
2024-10-18 11:16:53 -04:00
trop[bot]
b39ba84e87
fix: ensure utilityProcess only emits one 'exit' event (#44268)
fix: ensure utilityProcess only emits one exit

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-10-16 17:11:25 -04:00
trop[bot]
2e63ae0cfb
fix: -Wunsafe-buffer-usage warnings when read()ing and write()ing integers (#44207)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-11 20:15:03 -05:00
trop[bot]
0e9722dc50
fix: -Wunsafe-buffer-usage warning in WriteAsciiChunk() (#44167)
* fix: -Wunsafe-buffer-usage warning in WriteAsciiChunk()

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

* chore: add // SAFETY comment to explain UNSAFE_BUFFERS() use

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>
2024-10-09 20:38:19 -05:00
trop[bot]
ca8479d859
fix: -Wunsafe-buffer-usage warning in HasWordCharacters() (#44170)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-09 17:07:20 -05:00
trop[bot]
b30973a5de
fix: -Wunsafe-buffer-usage warnings in GetNextZoomLevel() (#44164)
fixup e8948397 really fix the warning this time

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-09 13:01:22 -05:00
trop[bot]
bf8de29f9b
fix: remove use of deprecated API base::Hash() (#44102)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-02 17:56:49 -05:00
Charles Kerr
058a616135
perf: use ArrayBuffer::Data() instead of GetBackingStore()->Data() (32-x-y) (#44095)
perf: use ArrayBuffer::Data() instead of GetBackingStore()->Data() (#44067)

perf: use ArrayBuffer::Data() API

Replace our `GetBackingStore()->Data()` calls with this instead.
Explained by the V8 docs, ArrayBuffer.Data() is

> More efficient shortcut for GetBackingStore()->Data(). The
> returned pointer is valid as long as the ArrayBuffer is alive.
2024-10-02 16:37:54 -04:00
Charles Kerr
bd8b9daa74
fix: -Wunsafe-buffer-usage warnings in WebFrameRenderer::ExecuteJavaScript() (32-x-y) (#44097)
fix: -Wunsafe-buffer-usage warnings in WebFrameRenderer::ExecuteJavaScript() (#44053)
2024-10-02 16:35:26 -04:00
Charles Kerr
956677b66a
fix: -Wunsafe-buffer-usage in electron::SetFontDefaults() (32-x-y) (#44030)
* fix: -Wunsafe-buffer-usage in electron::SetFontDefaults() (#44014)

* refactor: reduce code duplication in WebContentsPreferences::OverrideWebkitPrefs()

* refactor: limit scope of web_preferences temporary in ElectronBrowserClient::OverrideWebkitPrefs()

* chore: remove redundant static keyword on function in anonymous namespace

* refactor: slightly more explicit typing

* refactor: remove unnecessary utf16 -> utf8 -> utf16 conversion steps

* chore: remove unused #includes

* refactor: use string_view.rfind() instead of base::RSplitStringOnce()

base::RSplitStringOnce() does not exist in Chromium 128
2024-09-30 14:47:57 -04:00
trop[bot]
e69f5bc850
fix: ensure correct WebContents when checking PDFReadyToPrint (32-x-y) (#44011)
* fix: ensure correct `WebContents` when checking `PDFReadyToPrint` (#43943)

* fix: ensure correct WebContents when checking PDFReadyToPrint

* test: fix paths on Windows

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

* Update spec/api-web-contents-spec.ts

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

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

---------

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>
2024-09-29 15:38:22 +02:00
trop[bot]
21a8a97c28
fix: replace deprecated libnotify API calls (#43984)
notify_notification_set_hint_string() is deprecated, so let's use
notify_notification_set_hint() instead.

Xref: 2fe1748295

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-26 17:08:20 -05:00
trop[bot]
ebf189b304
perf: build g_dgettext domain name at compile time (#43988)
perf: build GettextPackage name at compile time

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-26 17:07:02 -05:00
trop[bot]
5e87aa0eb2
fix: -Wunsafe-buffer-usage warnings in GdkPixbufFromSkBitmap() (#43979)
* fix: -Wunsafe-buffer-usage warnings in GdkPixbufFromSkBitmap()

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

* refactor: don't change previous behavior for 0-height images

Is a 0x0 image even a thing? I'm not sure; but just in case, let's
treat it the same way the previous implementation did.

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>
2024-09-26 10:20:08 -05:00
trop[bot]
3e95df701a
test: ensure sender-pid hint is set in Linux notifications (#43950)
test: expect a `sender-pid` hint in Linux notifications.

This PR ensures that the `sender-pid` hint is set for new notifications.
It also updates the spec to confirm that DBus receives the hint and that
it has the correct value.

This fixes a spec failure when running libnotify >= 0.7.12 (2022-05-05).
Starting with that version, libnotify started injecting `sender-pid` if
not provided by the client. So our tests received a slightly different
DBus payload depending on what version of libnotify was installed,
causing our deep-equals tests to fail.

By always providing and testing the `sender-pid` hint, our behavior and
tests should be consistent across distros.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-25 12:13:07 -05:00
trop[bot]
5e32d32913
fix: close all open sheets before closing window on macOS (#43954)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Beutner <beutner.john@gmail.com>
2024-09-25 12:12:14 -05:00
trop[bot]
497ecca01e
fix: detach native view when its removed from parent on macOS (#43923)
Right now DelayedNativeViewHost attaches its underlying native view
when it's being attached to a widget but it doesn't detach it when
it's being detached. It may lead to use-after-free and crash.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cezary Kulakowski <cezary@openfin.co>
2024-09-25 13:17:53 +02:00
trop[bot]
ff94658d46
fix: crash when focusing WebView webContents (#43934)
fix: crash when focusing WebView

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-09-25 13:17:37 +02:00
trop[bot]
241288d3cc
fix: -Wunsafe-buffer-usage warning in asar_util's ReadFileToString() (#43931)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-25 11:22:24 +02:00
Charles Kerr
f4a8d8a094
refactor: remove C-style void arg type for no-arg functions (32-x-y) (#43925)
refactor: remove C-style void arg type for no-arg functions (#43884)

A small cleanup to remove use of the C-style function declaration idiom.
2024-09-25 11:21:24 +02:00
Charles Kerr
4e74793433
fix: -Wunsafe-buffer-usage warnings in GetNextZoomLevel() (#43894)
fix: -Wunsafe-buffer-usage warnings in GetNextZoomLevel() (#43803)
2024-09-23 22:36:51 -07:00
trop[bot]
192226d793
fix: -Wunsafe-buffer-usage warnings in Clipboard::WriteBuffer() (#43811)
* fix: -Wunsafe-buffer-usage warnings in Clipboard::WriteBuffer()

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

* chore: add a DCHECK to confirm the BigBuffer is full

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>
2024-09-20 08:48:14 -05:00
trop[bot]
2bc8797fed
refactor: NotificationPresenter::Create() returns a std::unique_ptr<> (#43806)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-19 22:11:59 -05:00
trop[bot]
08579bdcd5
chore: fix compile issue about ambiguous error of multiple methods named 'highlight'. (#43801)
chore: fix ambiguous error of multiple methods named 'highlight'

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: bill.shen <shenyb32768@gmail.com>
2024-09-19 09:33:28 -05:00
Charles Kerr
bd9e00968b
refactor: remove use of deprecated API BuildServiceInstanceFor() (32-x-y) (#43780)
* refactor: remove use of deprecated API BuildServiceInstanceFor() (#43690)

* refactor: update BadgeManagerFactory

* refactor: update NetworkContextServiceFactory

* refactor: update ElectronExtensionSystemFactory

* refactor: update UsbChooserContextFactory

* refactor: update UsbHidChooserContextFactory

* refactor: update SerialChooserContextFactory

* refactor: update FileSystemAccessPermissionContextFactory

* empty commit
2024-09-19 09:59:57 +02:00
Charles Kerr
8b49ba1084
fix: EyeDropper working in devtools (32-x-y) (#43786)
fix: EyeDropper working in devtools (#43685)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-09-19 09:55:54 +02:00
trop[bot]
3b29efb232
fix: in Emit(), don't leak converted Arg Local<Values> into caller's scope (#43747)
fix: Emit() should not leak converted arg handles into caller's HandleScope

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-17 11:16:53 -05:00
trop[bot]
42048ddc57
fix: resizing border on Linux WCO caption buttons (#43743)
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.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-09-17 11:21:41 -04:00
trop[bot]
6c670c3f1f
refactor: avoid minor code repetition in native_image.cc (#43703)
chore: delegate handle creation in NativeImage::Resize()

chore: delegate handle creation in NativeImage::Crop()

chore: delegate handle creation in NativeImage::CreateEmpty()

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-12 17:10:01 -05:00
trop[bot]
763d3983a1
fix: native View wrapper crash missing when adding child view (#43698)
fix: native View wrapper crash missing when adding child view

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-09-12 12:48:12 +02:00
trop[bot]
097c6b796d
feat: add support for system picker in setDisplayMediaRequestHandler (#43679)
* tmp

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* feat: add support for system picker in setDisplayMediaRequestHandler

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* oops

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* Apply suggestions from code review

Co-authored-by: Erick Zhao <erick@hotmail.ca>

Co-authored-by: Samuel Attard <sam@electronjs.org>

* stuff

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* well...

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* seems legit

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* chore: update patch to handle screenCapturer

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* feat: modify API to use useSystemPicker

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fix: gate ScreenCaptureKitPicker to macos 15 or higher

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fix: don't use native picker with legacy media selection

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* chore: code review, boolean set & docs update

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fix: add cancelCallback

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* docs: clarify session & desktopCapturer docs

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* chore: remove incorrect backport patches

* chore: update SCKP patch

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2024-09-11 09:56:47 -07:00
trop[bot]
fa1311e550
fix: ensure SetPluginCanSave updated in PDFs (#43687)
fix: ensure SetPluginCanSave updated in PDFs

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-09-11 17:56:26 +02:00
trop[bot]
5b933e941e
fix: -Wunsafe-buffer-usage warning in V8Serializer::Serialize() (#43676)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-10 19:00:33 -05:00
trop[bot]
017ba5bf46
fix: restore Chromium default Content-Disposition header parsing (#43668)
* fix: restore Chromium default Content-Disposition header parsing

Co-authored-by: Milan Burda <milan.burda@gmail.com>

* Update api-web-request-spec.ts

Co-authored-by: Milan Burda <milan.burda@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2024-09-10 16:15:18 -04:00
Shelley Vohr
7034537852
perf: use v8::Local<v8::Object> as the key in ObjectCache (#43662)
* perf: use v8::Object* as direct keys instead of using hash + a linked list

* refactor: use v8::Local<v8::Object> as the key

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-10 09:21:21 -05:00
Shelley Vohr
01ef05580f
fix: ensure bounds stability in OnWidgetBoundsChanged (#43644)
fix: ensure bounds stability in OnWidgetBoundsChanged
2024-09-09 19:35:29 -05:00
trop[bot]
f74c353abf
fix: out-of-scope Local handle in node::CallbackScope (#43639)
refactor: use an EscapableHandleScope

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-09 18:27:39 -05:00
Shelley Vohr
5e2e8feb9e
chore: remove unused ConvertableToTraceFormatWrapper (#43646) 2024-09-09 18:00:37 -05:00
Shelley Vohr
a4938311cd
test: add -pdf-ready-to-print event to WebContents for testing (#43647) 2024-09-09 17:59:19 -05:00
trop[bot]
f427e05d82
fix: -Wunsafe-buffer-usage warnings in asar file IO (#43648)
* fix: -Wunsafe-buffer-usage warnings in ScopedTemporaryFile::InitFromFile()

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

* fix: -Wunsafe-buffer-usage warnings in Archive::Init()

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>
2024-09-09 17:58:57 -05:00
trop[bot]
8cb44915d8
fix: UvHandle move semantics (#43633)
reassign the uv_handle_t of the source

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-09 10:36:11 -05:00