Commit graph

3467 commits

Author SHA1 Message Date
trop[bot]
6626557902
refactor: remove unnecessary constructor code (#44826)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-11-24 11:53:51 -06:00
trop[bot]
63cb4f4481
fix: big endian bug in V8 serialization (#44795)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-11-22 13:30:58 -05:00
trop[bot]
85a3ed32d9
fix: ensure context-menu emitted for draggable regions (#44798)
* fix: ensure context-menu emitted for draggable regions

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

* chore: address suggestions from review

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>
2024-11-22 10:11:29 -05:00
trop[bot]
3137994b4a
fix: performance-no-automatic-move clang-tidy warnings (#44772)
* fix: performance-no-automatic-move in GetLogFileName()

remove `const` from log_filename.

Warning fixed by this commit:

../../electron/shell/common/logging.cc:40:12: warning: constness of 'log_filename' prevents automatic move [performance-no-automatic-move]

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

* fix: performance-no-automatic-move in GetBundleResourcePath()

remove `const` from request_relative_path.

Warning fixed by this commit:

electron/shell/browser/extensions/electron_extensions_browser_client.cc:187:10: warning: constness of 'request_relative_path' prevents automatic move [performance-no-automatic-move]

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-11-22 10:23:05 +01:00
Charles Kerr
0e001fc45a
fix: cyclical #include dependency between autofill_popup.h and autofill_popup_view.h (32-x-y) (#44747)
fix: cyclical #include dependency between autofill_popup.h and autofill_popup_view.h (#44705)

fix: AutofillPopup warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]

refactor: reduce #indclude scope in autofill_popup.h and autofill_popup_view.h
2024-11-22 10:22:27 +01:00
trop[bot]
d9d6ba180c
fix: bugprone-narrowing-conversions warnings in NativeImage (#44739)
* fix: bugprone-narrowing-conversions warning in NativeImage::memory_usage_

- fix signed / unsigned math by using base/numerics/safe_conversions

- make memory_usage_ an int64_t so it can safely take the size_t
  returned by computeByteSize()

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-11-20 11:15:22 -06:00
trop[bot]
6cc9aa57fe
fix: tooltips in WCO caption buttons (#44758)
fix: tooltips in WCO capton buttons

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-11-20 15:34:54 +01:00
Robo
c90509c2bc
fix: utility process exit code for graceful termination (#44749) 2024-11-20 23:23:10 +09:00
Charles Kerr
ee66bf9381
chore: remove use of banned absl::optional (#44513) (#44745)
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5805666
2024-11-20 10:14:01 +01:00
trop[bot]
42c88eba7c
fix: destroy url loader wrapper when JS env exits (#44730)
* fix: destroy url loader wrapper when JS env exits

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

* Revert "fix: destroy url loader wrapper when JS env exits"

This reverts commit 419151a98a16814ea63e9abc197c6ae27f48128c.

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

* Revert "Revert "fix: destroy url loader wrapper when JS env exits""

This reverts commit 4b401b03c62aca79498660f995825491ae52f179.

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

* fix: double free of JSChunkedDataPipeGetter

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

* fix: crash on process exit after stream completes

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>
2024-11-19 22:08:28 +01:00
trop[bot]
50edc9bfe2
fix: improve single-pixel resize handling on Windows (#44724)
* fix: improve single-pixel resize handling

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

* Update spec/api-browser-window-spec.ts

Co-authored-by: Niklas Wenzel <dev@nikwen.de>

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

* Update shell/browser/native_window_views.cc

Co-authored-by: Niklas Wenzel <dev@nikwen.de>

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>
2024-11-19 10:58:06 -05:00
trop[bot]
313f9030d2
fix: utilityProcess pid should be undefined after exit (#44693)
fix: utilityProcess pid should be undefined after exit

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-11-18 13:43:23 -06:00
John Kleinschmidt
8f88aae33c
fix: WebContentsView removal should compare directly (#44672)
fix: `WebContentsView` removal should compare directly (#44656)

* fix: WebContentsView removal should compare directly

* fixup view comparision

* chore: use erase_if

* Apply review suggestions

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-11-15 13:09:42 +01:00
BILL SHEN
39a24d96fc
fix: add theme data source for devtools.(32-x-y) (#44639)
fix: add theme data source for devtools.
2024-11-14 12:45:08 +01:00
trop[bot]
85289c8218
fix: WCO buttons hidden on Linux in fullscreen (#44642)
Closes https://github.com/electron/electron/issues/44569.

Fixes an issue where the WCO buttons were hidden on Linux in  fullscreen mode
but not on Windows or macOS. The Windows behavior is the expected one, so this
commit makes the Linux behavior consistent.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-11-13 15:59:29 -05:00
trop[bot]
f06f6d565e
fix: segfault when moving WebContentsView between BrowserWindows (#44615)
* fix: segfault when moving WebContentsView between BrowserWindows

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

* chore: actually enable fix

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

* fixup segfault when moving WebContentsView between BrowserWindows

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>
2024-11-12 11:42:42 -05:00
trop[bot]
2f524dfb1d
fix: remove use of banned std::to_string() (#44561)
Use base::NumberToString() instead

Xref: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md#std_sto_i_l_ul_ll_ull_f_d_ld_to_string_banned

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-11-04 20:31:08 -06:00
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