Compare commits

..

32 Commits

Author SHA1 Message Date
trop[bot]
5c70bd768a docs: add bypassCustomProtocolHandlers to ses.fetch (#40424)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Brandon Fowler <brandfowl@gmail.com>
2023-11-02 07:11:02 -04:00
John Kleinschmidt
3934f72496 chore: bump chromium to 120.0.6099.0 (28-x-y) (#40413)
* chore: bump chromium to 120.0.6078.0 (main) (#40114)

* chore: bump chromium in DEPS to 120.0.6049.0

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6050.0

* chore: update patches

* 4910494: Reland "[autopip] Show autopip UI for video pip"

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

* 4812338: Move partition_alloc into a "partition_alloc" dir.

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

* [Extensions Cleanup] Remove mojom ViewType::kExtensionDialog

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

* 4894923: Force enable raw_ptrs pointer arithmetic check.

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

* gin: Prevent wrappables from being constructed from author code.

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

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6052.0

* chore: bump chromium in DEPS to 120.0.6054.0

* chore: bump chromium in DEPS to 120.0.6056.0

* chore: fix patches

* 4918545: Reland "[autopip] Add permissions embargo"
https://chromium-review.googlesource.com/c/chromium/src/+/4918545

* 4881761: UI bindings for visual logging with structured metrics.

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

* chore: bump chromium in DEPS to 120.0.6058.0

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6060.0

* chore: bump chromium in DEPS to 120.0.6061.0

* chore: bump chromium in DEPS to 120.0.6062.0

* chore: gen libc++ filenames

* chore: update patches

* 4911894: Move //c/b/ui/views/eye_dropper to //components
https://chromium-review.googlesource.com/c/chromium/src/+/4911894

* chore: bump chromium in DEPS to 120.0.6064.0

* chore: bump chromium in DEPS to 120.0.6066.0

* chore: bump chromium in DEPS to 120.0.6068.0

* chore: bump chromium in DEPS to 120.0.6070.0

* chore: remove temp_prevent_unused_function_error.patch

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

* chore: add TransferDragSecurityInfo()

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

* mark TransferDragSecurityInfo() as NOTREACHED

A follow-up to previous commit. I think this is commit is correct (i.e.
that this function shouldn't get called) but am not positive, so I'm
including it in a standalone commit in case we need to revert.

* chore: update signature of OnPrivateNetworkAccessPermissionRequired()

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

Our impl is a no-op, so updating the signature is the only change.

* chore: rebuild patches

* chore: bump chromium in DEPS to 120.0.6072.0

* chore: update patches

* chore: sync ParseMatchPattern() param order with upstream change

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

* chore: update fix_crash_loading_non-standard_schemes_in_iframes.patch

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

* chore: rebuild patches

* chore: bump chromium in DEPS to 120.0.6073.0

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6074.0

* chore: update disable_color_correct_rendering.patch

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

no manual changes; patch applied with fuzz 1

* chore: update fix_handle_no_top_level_aura_window_in_webcontentsimpl.patch

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

minor manual sync to upstream code shear

* chore: rebuild patches

* chore: update ClearHttpAuthCache arguments

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

adding ClearDataFilterPtr arg. Upstream added this arg, which is already
present in other NetworkContext methods. Our code uses `nullptr` there.

* chore: bump chromium in DEPS to 120.0.6076.0

* chore: update mas_disable_remote_accessibility.patch

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

minor manual sync to upstream code shear

* chore: update disable_color_correct_rendering.patch

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

minor manual sync to upstream code shear

* fix: move x11_util.h include to top of source file

This is a short-term fix to unblock the roll. I will follow up a better fix in a standalone PR.

* chore: rebuild patches

* chore: bump chromium in DEPS to 120.0.6077.0

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6078.0

* chore: update patches

* refactor: add BrowserProcessImpl::os_crypt_async()

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

This is one to keep an eye on. This commit copies the upstream impl,
which appears to be an interim step with more upstream code changes
still forthcoming.

Xref: https://bugs.chromium.org/p/chromium/issues/detail?id=1373092

* fixup! refactor: add BrowserProcessImpl::os_crypt_async()

chore: make 'gn check' happy

* chore: remove ensure_messageports_get_gced_when_not_referenced.patch

Xref: ensure_messageports_get_gced_when_not_referenced.patch

no longer needed because upstreamed

* chore: remove webrtc/pipewire_capturer_make_restore_tokens_re-usable_more_than_one_time.patch

Xref: https://webrtc-review.googlesource.com/c/src/+/322621

no longer needed because upstreamed

* chore: add //components/compose:buildflags dep

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

needed by browser/ui/browser_dialogs.h

* chore: update filenames.libcxx.gni

node ./script/gen-libc++-filenames.js

* test: fix UI.InspectorView -> UI.InspectorView.instance()

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit be44a2c5b7)

* chore: bump chromium to 120.0.6099.0 (main) (#40316)

* chore: bump chromium in DEPS to 120.0.6086.0

* chore: update patches

* chore: rename FrameSubscriber::OnNewCropVersion()

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

just a simple renaming

* chore: rename ToJsTime() to .InMillisecondsFSinceUnixEpoch()

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

function renamed upstream

* chore: rename ToDoubleT() to .InSecondsFSinceUnixEpoch()

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

function renamed upstream

* chore: rename FromDoubleT() to .FromSecondsSinceUnixEpoch()

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

function renamed upstream

* chore: bump chromium in DEPS to 120.0.6088.2

* chore: update patches

* chore: regen filenames.libcxx.gni

* chore: migrate from (removed upstream) inputFormType to formControlType

* chore: bump chromium in DEPS to 120.0.6089.0

* chore: update allow_disabling_blink_scheduler_throttling_per_renderview.patch

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

manually sync to upstream changes + reduce diff size

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6090.0

* chore: update fix_disabling_background_throttling_in_compositor.patch

no manual changes; patch applied with fuzz 2 (4 lines)

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

* chore: update fix_handle_no_top_level_aura_window_in_webcontentsimpl.patch

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

do not patch WebContentsImpl::SetWindowShowState() any longer because it has been removed

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6091.0

* chore: update patches

* chore: bump chromium in DEPS to 120.0.6093.0

* chore: bump chromium in DEPS to 120.0.6095.0

* chore: bump chromium in DEPS to 120.0.6096.0

* chore: bump chromium in DEPS to 120.0.6097.0

* chore: update patches

* chore: update patch after rebase

* 4961495: [document pip] Focus the window when opened manually

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

* [Extensions UserScripts] Store extensions with user scripts in tracker

 | https://chromium-review.googlesource.com/c/chromium/src/+/4950530

* chore: bump chromium in DEPS to 120.0.6099.0

* chore: update patches

* chore: update filenames.libcxx.gni

* chore: remove trailing space

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
(cherry picked from commit bc1ba1fe9d)

* build: update appveyor image to latest version (#40325)

* build: update appveyor image to latest version

* chore: update version to e-120.0.6099.0

* chore: rename base image for bakes

---------

Co-authored-by: jkleinsc <jkleinsc@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
(cherry picked from commit 878c6e3062)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-01 19:46:39 -04:00
trop[bot]
8d5a15316f docs: avoid leaking the IpcRendererEvent in contextBridge examples (#40412)
* docs: avoid leaking the `IpcRendererEvent` in `contextBridge` examples

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

* Update docs/fiddles/ipc/pattern-3/preload.js

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

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

* Update docs/tutorial/ipc.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

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

* Update docs/tutorial/ipc.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

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>
2023-11-01 18:55:47 -04:00
Shelley Vohr
6916e19ce1 refactor: remove DevTools legacy UI patching (#40409)
* refactor: remove DevTools legacy UI patching

* chore: update patches

---------

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-11-01 16:24:06 -04:00
electron-roller[bot]
5997b47d21 chore: bump chromium to 119.0.6045.105 (28-x-y) (#40405)
* chore: bump chromium in DEPS to 119.0.6045.105

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-11-01 11:41:52 -04:00
trop[bot]
3f0af4d435 build: actually show github upload output if verbose is true. (#40398)
* build: actually show github upload output if verbose is true.

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

* chore: fixup lint

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>
2023-10-31 21:24:07 -04:00
trop[bot]
45fbdcca6a fix: navigator.keyboard.lock() fullscreen exit handling (#40389)
fix: navigator.keyboard.lock() fullscreen exit handling

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-31 21:23:50 -04:00
trop[bot]
09c151a701 build: update deps to fix yarn audit (#40392)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-10-31 17:30:14 -04:00
electron-roller[bot]
5dad69ce8f chore: bump chromium to 119.0.6045.59 (28-x-y) (#40356)
* chore: bump chromium in DEPS to 119.0.6045.59

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-10-31 09:34:43 -04:00
trop[bot]
d0d2a64739 refactor: options parsing in WebContents.prototype.printToPDF() (#40279)
* refactor: options parsing in WebContents.prototype.printToPDF()

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

* tweak parsePageSize

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>
2023-10-30 11:55:29 -07:00
trop[bot]
2c200c9b8d docs: add reference to app.getAppMetrics() in serviceName for utilityProcess (#40367)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-10-30 11:43:57 -07:00
trop[bot]
bb0dd34e63 fix: prevent PopUpButtonHandler premature dealloc (#40346)
fix: prevent PopUpButtonHandler dealloc

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-26 14:12:43 -04:00
trop[bot]
8148ba5398 build: upload slow, more time good (#40336)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-10-26 00:20:43 -07:00
trop[bot]
f6d7aba69c test: add spec for app.getAppMetrics() for utility process (#40312)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-10-25 09:30:28 -04:00
trop[bot]
22687c18c4 test: add spec for child-process-gone event for utility process (#40304)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-10-23 11:44:22 -07:00
trop[bot]
d1bf107bee chore: Show FIDO devices in the chooser if allowed (#40275)
chore: Show FIDO devices in the chooser if allowed (#40216)

* chore: Show FIDO devices in the chooser if allowed

* chore: tweak HidChooserContext::IsFidoAllowedForOrigin

* chore: feedback from review

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-10-20 10:28:57 +02:00
electron-roller[bot]
eff2ea682d chore: bump chromium to 119.0.6045.33 (28-x-y) (#40278)
* chore: bump chromium in DEPS to 119.0.6045.33

* chore: update patches

* test: fix Node.js color edge snapshot stack traces

(cherry picked from commit af4943fd1b)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-19 19:20:48 -04:00
trop[bot]
0310156be6 docs: fix represented file fiddle (#40252)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-10-19 10:03:23 +02:00
trop[bot]
714e6ea49c chore: implement no-op chrome.action extension APIs (#40261)
chore: implement no-op chrome.action extension APIs

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-18 21:39:10 +02:00
trop[bot]
3cf8652027 fix: correctly track receiver for methods called via ctx bridge (#40263)
* fix: correctly track receiver for methods called via ctx bridge

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* spec: test for correct contextBridge passage

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-18 21:24:16 +02:00
trop[bot]
f622bd9927 build: re-enable partition alloc on mac (#40230)
* build: re-enable partition alloc on mac

Co-authored-by: VerteDinde <vertedinde@electronjs.org>

* Trigger Build

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-10-18 12:50:12 -04:00
trop[bot]
9ddd08ba89 fix: support the throwIfNoEntry option to statSync and lstatSync in asar files (#40224)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2023-10-18 11:33:48 +02:00
trop[bot]
a98d66dd23 refactor: partition HidDelegate observers by browser context (#40238)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-18 10:06:16 +02:00
trop[bot]
1e51ee974d fix: Windows Toast notification dismissal from Action Center (#40243)
* fix: Windows Toast notification dismissal from Action Center

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

* docs: note Toast behavior in event

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

* chore: address feedback 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>
2023-10-18 10:03:57 +02:00
trop[bot]
6732f63ac0 docs: Update docs on testing Electron apps with WebdriverIO (#40227)
* docs: Updated docs on testing Electron using WebdriverIO

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* Update docs/tutorial/automated-testing.md

Co-authored-by: Felix Rieseberg <fr@makenotion.com>

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* Update docs/tutorial/automated-testing.md

Co-authored-by: Felix Rieseberg <fr@makenotion.com>

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* more updates

Co-authored-by: Christian Bromann <git@bromann.dev>

* address PR comments

Co-authored-by: Christian Bromann <git@bromann.dev>

* Update docs/tutorial/automated-testing.md

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

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* Update docs/tutorial/automated-testing.md

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

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* Update docs/tutorial/automated-testing.md

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

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* Update docs/tutorial/automated-testing.md

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

Co-authored-by: Christian Bromann <github@christian-bromann.com>

* Update docs/tutorial/automated-testing.md

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

Co-authored-by: Christian Bromann <github@christian-bromann.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Christian Bromann <github@christian-bromann.com>
Co-authored-by: Christian Bromann <git@bromann.dev>
2023-10-17 16:54:41 +02:00
trop[bot]
641249f384 fix: incorrect wco bounds in macOS fullscreen (#40219)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-16 15:06:39 +02:00
electron-roller[bot]
f6b135e1ac chore: bump chromium to 119.0.6045.21 (28-x-y) (#40178)
* chore: bump chromium in DEPS to 119.0.6045.9

* chore: update patches

* chore: bump chromium in DEPS to 119.0.6045.21

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-10-16 14:53:20 +02:00
trop[bot]
a5f01f0328 docs: fix some string union typings (#40199)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-10-16 14:10:13 +09:00
trop[bot]
d65b8761f8 chore: formally deprecate gpu-process-crashed event (#40195)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2023-10-16 09:19:27 +09:00
trop[bot]
f8d4c45f8e fix: ensure MessagePorts get GCed when not referenced (#40201)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-16 09:18:36 +09:00
trop[bot]
6625666e40 fix: store portal restore token under the right source ID (#40192)
XDG Desktop Portal provides restore tokens to restore a previously
selected PipeWire stream instead of prompting the user again. This
restore token is single use only and it has to be replaced when the
stream is completed/stopped.

BaseCapturerPipewire maintains two source IDs: one is initialized by
the constructor for new sources (source_id_) and another is for
capturing previously selected sources (selected_source_id_). The
restore token was always being stored under `source_id_`, even if the
capture was ongoing for `selected_source_id_`. This prevents a stream
from being restored more than once. Fix that by storing the restore
token under the selected source ID if it exists.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
2023-10-13 22:09:09 +02:00
trop[bot]
e3e7bf3786 fix: webContents.capturePage() for hidden windows on Windows/Linux (#40185)
fix: capturePage for hidden windows on Windows/Linux

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-12 13:54:43 +02:00
107 changed files with 794 additions and 798 deletions

View File

@@ -1211,7 +1211,7 @@ commands:
build-type: << parameters.build-type >>
- *step-maybe-electron-dist-strip
- step-electron-dist-build:
additional-targets: electron:node_headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip
additional-targets: shell_browser_ui_unittests electron:node_headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip
- *step-show-goma-stats
@@ -2315,11 +2315,12 @@ jobs:
darwin-testing-x64-tests:
executor:
name: macos
size: macos.m1.medium.gen1
size: macos.x86.medium.gen2
version: 14.0.0
environment:
<<: *env-mac-large
<<: *env-stack-dumping
parallelism: 2
steps:
- electron-tests:
artifact-key: darwin-x64
@@ -2338,11 +2339,12 @@ jobs:
mas-testing-x64-tests:
executor:
name: macos
size: macos.m1.medium.gen1
size: macos.x86.medium.gen2
version: 14.0.0
environment:
<<: *env-mac-large
<<: *env-stack-dumping
parallelism: 2
steps:
- electron-tests:
artifact-key: mas-x64

View File

@@ -1331,6 +1331,25 @@ if (is_mac) {
}
}
test("shell_browser_ui_unittests") {
sources = [
"//electron/shell/browser/ui/accelerator_util_unittests.cc",
"//electron/shell/browser/ui/run_all_unittests.cc",
]
configs += [ ":electron_lib_config" ]
deps = [
":electron_lib",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//ui/base",
"//ui/strings",
]
}
template("dist_zip") {
_runtime_deps_target = "${target_name}__deps"
_runtime_deps_file =

4
DEPS
View File

@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'121.0.6100.0',
'120.0.6099.0',
'node_version':
'v18.18.2',
'v18.18.0',
'nan_version':
'e14bdcd1f72d62bca1d541b66da43130384ec213',
'squirrel.mac_version':

View File

@@ -9,8 +9,8 @@ View these docs in other languages on our [Crowdin](https://crowdin.com/project/
The Electron framework lets you write cross-platform desktop applications
using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and
[Chromium](https://www.chromium.org) and is used by the [Visual Studio
Code](https://github.com/Microsoft/vscode/) and many other [apps](https://electronjs.org/apps).
[Chromium](https://www.chromium.org) and is used by the [Atom
editor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).
Follow [@electronjs](https://twitter.com/electronjs) on Twitter for important
announcements.
@@ -41,9 +41,9 @@ Each Electron release provides binaries for macOS, Windows, and Linux.
* macOS (Catalina and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* Windows (Windows 10 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. Support for Windows 7, 8 and 8.1 was [removed in Electron 23, in line with Chromium's Windows deprecation policy](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice).
* Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on:
* Ubuntu 18.04 and newer
* Fedora 32 and newer
* Debian 10 and newer
* Ubuntu 14.04 and newer
* Fedora 24 and newer
* Debian 8 and newer
## Quick start & Electron Fiddle

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-121.0.6100.0
image: e-120.0.6099.0
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -156,6 +156,7 @@ for:
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
@@ -194,7 +195,7 @@ for:
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME"
} else {
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
foreach($artifact_name in $artifacts_to_validate) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
@@ -232,6 +233,7 @@ for:
- cd C:\projects\src
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
@@ -275,7 +277,7 @@ for:
if ($job.name -eq "Build Arm on X64 Windows") {
$jobId = $job.jobId
foreach($artifact_name in $artifacts_to_download) {
if ($artifact_name -eq 'electron.lib') {
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
$outfile = "src\out\Default\$artifact_name"
} else {
$outfile = $artifact_name

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-121.0.6100.0
image: e-120.0.6099.0
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -154,6 +154,7 @@ for:
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
@@ -192,7 +193,7 @@ for:
if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {
Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME"
} else {
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
$artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip'
foreach($artifact_name in $artifacts_to_validate) {
if ($artifact_name -eq 'ffmpeg.zip') {
$artifact_file = "out\ffmpeg\ffmpeg.zip"
@@ -230,6 +231,7 @@ for:
- cd C:\projects\src
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
@@ -266,12 +268,12 @@ for:
# Download build artifacts
$apiUrl = 'https://ci.appveyor.com/api'
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
$artifacts_to_download = @('dist.zip','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib')
$artifacts_to_download = @('dist.zip','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build") {
$jobId = $job.jobId
foreach($artifact_name in $artifacts_to_download) {
if ($artifact_name -eq 'electron.lib') {
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
$outfile = "src\out\Default\$artifact_name"
} else {
$outfile = $artifact_name
@@ -305,6 +307,7 @@ for:
$env:npm_config_arch = "ia32"
}
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log
- echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log
- cd ..
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
- echo "About to verify mksnapshot"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
from __future__ import print_function
import collections
import os

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess
import sys

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
from __future__ import unicode_literals
import contextlib
import sys

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess
import sys

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess
import sys

View File

@@ -377,6 +377,35 @@ page.
Emitted whenever there is a GPU info update.
### Event: 'gpu-process-crashed' _Deprecated_
Returns:
* `event` Event
* `killed` boolean
Emitted when the GPU process crashes or is killed.
**Deprecated:** This event is superceded by the `child-process-gone` event
which contains more information about why the child process disappeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
### Event: 'renderer-process-crashed' _Deprecated_
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `killed` boolean
Emitted when the renderer process of `webContents` crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process disappeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
### Event: 'render-process-gone'
Returns:
@@ -1249,10 +1278,10 @@ Returns `boolean` - Whether the current desktop environment is Unity launcher.
### `app.getLoginItemSettings([options])` _macOS_ _Windows_
* `options` Object (optional)
* `type` string (optional) _macOS_ - Can be one of `mainAppService`, `agentService`, `daemonService`, or `loginItemService`. Defaults to `mainAppService`. Only available on macOS 13 and up. See [app.setLoginItemSettings](app.md#appsetloginitemsettingssettings-macos-windows) for more information about each type.
* `serviceName` string (optional) _macOS_ - The name of the service. Required if `type` is non-default. Only available on macOS 13 and up.
* `path` string (optional) _Windows_ - The executable path to compare against. Defaults to `process.execPath`.
* `args` string[] (optional) _Windows_ - The command-line arguments to compare against. Defaults to an empty array.
* `path` string (optional) _Windows_ - The executable path to compare against.
Defaults to `process.execPath`.
* `args` string[] (optional) _Windows_ - The command-line arguments to compare
against. Defaults to an empty array.
If you provided `path` and `args` options to `app.setLoginItemSettings`, then you
need to pass the same arguments here for `openAtLogin` to be set correctly.
@@ -1260,11 +1289,17 @@ need to pass the same arguments here for `openAtLogin` to be set correctly.
Returns `Object`:
* `openAtLogin` boolean - `true` if the app is set to open at login.
* `openAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app is set to open as hidden at login. This does not work on macOS 13 and up.
* `wasOpenedAtLogin` boolean _macOS_ _Deprecated_ - `true` if the app was opened at login automatically. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
* `wasOpenedAsHidden` boolean _macOS_ _Deprecated_ - `true` if the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
* `restoreState` boolean _macOS_ _Deprecated_ - `true` if the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on [MAS builds][mas-builds] or on macOS 13 and up.
* `status` string _macOS_ - can be one of `not-registered`, `enabled`, `requires-approval`, or `not-found`.
* `openAsHidden` boolean _macOS_ - `true` if the app is set to open as hidden at login.
This setting is not available on [MAS builds][mas-builds].
* `wasOpenedAtLogin` boolean _macOS_ - `true` if the app was opened at login
automatically. This setting is not available on [MAS builds][mas-builds].
* `wasOpenedAsHidden` boolean _macOS_ - `true` if the app was opened as a hidden login
item. This indicates that the app should not open any windows at startup.
This setting is not available on [MAS builds][mas-builds].
* `restoreState` boolean _macOS_ - `true` if the app was opened as a login item that
should restore the state from the previous session. This indicates that the
app should restore the windows that were open the last time the app was
closed. This setting is not available on [MAS builds][mas-builds].
* `executableWillLaunchAtLogin` boolean _Windows_ - `true` if app is set to open at login and its run key is not deactivated. This differs from `openAtLogin` as it ignores the `args` option, this property will be true if the given executable would be launched at login with **any** arguments.
* `launchItems` Object[] _Windows_
* `name` string _Windows_ - name value of a registry entry.
@@ -1278,14 +1313,10 @@ Returns `Object`:
* `settings` Object
* `openAtLogin` boolean (optional) - `true` to open the app at login, `false` to remove
the app as a login item. Defaults to `false`.
* `openAsHidden` boolean (optional) _macOS_ _Deprecated_ - `true` to open the app as hidden. Defaults to `false`. The user can edit this setting from the System Preferences so `app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app is opened to know the current value. This setting is not available on [MAS build
s][mas-builds] or on macOS 13 and up.
* `type` string (optional) _macOS_ - The type of service to add as a login item. Defaults to `mainAppService`. Only available on macOS 13 and up.
* `mainAppService` - The primary application.
* `agentService` - The property list name for a launch agent. The property list name must correspond to a property list in the apps `Contents/Library/LaunchAgents` directory.
* `daemonService` string (optional) _macOS_ - The property list name for a launch agent. The property list name must correspond to a property list in the apps `Contents/Library/LaunchDaemons` directory.
* `loginItemService` string (optional) _macOS_ - The property list name for a login item service. The property list name must correspond to a property list in the apps `Contents/Library/LoginItems` directory.
* `serviceName` string (optional) _macOS_ - The name of the service. Required if `type` is non-default. Only available on macOS 13 and up.
* `openAsHidden` boolean (optional) _macOS_ - `true` to open the app as hidden. Defaults to
`false`. The user can edit this setting from the System Preferences so
`app.getLoginItemSettings().wasOpenedAsHidden` should be checked when the app
is opened to know the current value. This setting is not available on [MAS builds][mas-builds].
* `path` string (optional) _Windows_ - The executable to launch at login.
Defaults to `process.execPath`.
* `args` string[] (optional) _Windows_ - The command-line arguments to pass to
@@ -1294,7 +1325,6 @@ s][mas-builds] or on macOS 13 and up.
* `enabled` boolean (optional) _Windows_ - `true` will change the startup approved registry key and `enable / disable` the App in Task Manager and Windows Settings.
Defaults to `true`.
* `name` string (optional) _Windows_ - value name to write into registry. Defaults to the app's AppUserModelId().
Set the app's login item settings.
To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel-Windows],
@@ -1319,8 +1349,6 @@ app.setLoginItemSettings({
})
```
For more information about setting different services as login items on macOS 13 and up, see [`SMAppService`](https://developer.apple.com/documentation/servicemanagement/smappservice?language=objc).
### `app.isAccessibilitySupportEnabled()` _macOS_ _Windows_
Returns `boolean` - `true` if Chrome's accessibility support is enabled,

View File

@@ -100,7 +100,7 @@ longer than the maximum length will be truncated.
### `crashReporter.getLastCrashReport()`
Returns [`CrashReport | null`](structures/crash-report.md) - The date and ID of the
Returns [`CrashReport`](structures/crash-report.md) - The date and ID of the
last crash report. Only crash reports that have been uploaded will be returned;
even if a crash report is present on disk it will not be returned until it is
uploaded. In the case that there are no uploaded reports, `null` is returned.

View File

@@ -460,6 +460,20 @@ win.webContents.on('will-prevent-unload', (event) => {
**Note:** This will be emitted for `BrowserViews` but will _not_ be respected - this is because we have chosen not to tie the `BrowserView` lifecycle to its owning BrowserWindow should one exist per the [specification](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event).
#### Event: 'crashed' _Deprecated_
Returns:
* `event` Event
* `killed` boolean
Emitted when the renderer process crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process disappeared. It
isn't always because it crashed. The `killed` boolean can be replaced by
checking `reason === 'killed'` when you switch to that event.
#### Event: 'render-process-gone'
Returns:

View File

@@ -986,6 +986,14 @@ ipcRenderer.on('ping', () => {
})
```
### Event: 'crashed' _Deprecated_
Fired when the renderer process crashes or is killed.
**Deprecated:** This event is superceded by the `render-process-gone` event
which contains more information about why the render process disappeared. It
isn't always because it crashed.
### Event: 'render-process-gone'
Returns:

View File

@@ -12,62 +12,6 @@ This document uses the following convention to categorize breaking changes:
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (29.0)
### Behavior Changed: `ipcRenderer` can no longer be sent over the `contextBridge`
Attempting to send `ipcRenderer` as an object over the `contextBridge` will now result in
an empty object on the receiving side of the bridge. This change was made to remove / mitigate
a security footgun, you should not directly expose ipcRenderer or it's methods over the bridge.
Instead provide a safe wrapper like below:
```js
contextBridge.exposeInMainWorld('app', {
onEvent: (cb) => ipcRenderer.on('foo', (e, ...args) => cb(args))
})
```
### Removed: `renderer-process-crashed` event on `app`
The `renderer-process-crashed` event on `app` has been removed.
Use the new `render-process-gone` event instead.
```js
// Removed
app.on('renderer-process-crashed', (event, webContents, killed) => { /* ... */ })
// Replace with
app.on('render-process-gone', (event, webContents, details) => { /* ... */ })
```
### Removed: `crashed` event on `WebContents` and `<webview>`
The `crashed` events on `WebContents` and `<webview>` have been removed.
Use the new `render-process-gone` event instead.
```js
// Removed
win.webContents.on('crashed', (event, killed) => { /* ... */ })
webview.addEventListener('crashed', (event) => { /* ... */ })
// Replace with
win.webContents.on('render-process-gone', (event, details) => { /* ... */ })
webview.addEventListener('render-process-gone', (event) => { /* ... */ })
```
### Removed: `gpu-process-crashed` event on `app`
The `gpu-process-crashed` event on `app` has been removed.
Use the new `child-process-gone` event instead.
```js
// Removed
app.on('gpu-process-crashed', (event, killed) => { /* ... */ })
// Replace with
app.on('child-process-gone', (event, details) => { /* ... */ })
```
## Planned Breaking API Changes (28.0)
### Behavior Changed: `WebContents.backgroundThrottling` set to false affects all `WebContents` in the host `BrowserWindow`

View File

@@ -82,9 +82,9 @@ contextBridge.exposeInMainWorld('electronAPI', {
})
```
You can create a `interface.d.ts` declaration file and globally augment the `Window` interface:
You can create a `renderer.d.ts` declaration file and globally augment the `Window` interface:
```typescript title='interface.d.ts' @ts-noisolate
```typescript title='renderer.d.ts' @ts-noisolate
export interface IElectronAPI {
loadPreferences: () => Promise<void>,
}

View File

@@ -49,6 +49,12 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
* Since Electron 6, Electron major versions have been targeting every other Chromium major version. Each Electron stable should happen on the same day as Chrome stable ([see blog post](https://www.electronjs.org/blog/12-week-cadence)).
* Since Electron 16, Electron has been releasing major versions on an 8-week cadence in accordance to Chrome's change to a 4-week release cadence ([see blog post](https://www.electronjs.org/blog/8-week-cadence)).
:::info Chrome release dates
Chromium has the own public release schedule [here](https://chromiumdash.appspot.com/schedule).
:::
## Version support policy
:::info
@@ -73,38 +79,6 @@ and the version prior to that receives the vast majority of those fixes
as time and bandwidth warrants. The oldest supported release line will receive
only security fixes directly.
### Chromium version support
:::info Chromium release schedule
Chromium's public release schedule is [here](https://chromiumdash.appspot.com/schedule).
:::
Electron targets Chromium even-number versions, releasing every 8 weeks in concert
with Chromium's 4-week release schedule. For example, Electron 26 uses Chromium 116, while Electron 27 uses Chromium 118.
### Node.js version support
Electron upgrades its `main` branch to even-number versions of Node.js when they enter Active LTS. The schedule
is as follows:
<img src="https://raw.githubusercontent.com/nodejs/Release/main/schedule.svg?sanitize=true" alt="Releases">
As a rule, stable branches of Electron do not receive Node.js upgrades after they have been cut.
If Electron has recently updated its `main` branch to a new major version of Node.js, the next stable
branch to be cut will be released with the new version.
Patch upgrades of Node that contain significant security or bug fixes, and are submitted
more than 2 weeks prior to a stable release date, will be accepted into an Electron alpha
or beta release branch.
Minor upgrades of Node that contain significant security or bug fixes, and are submitted
more than 2 weeks prior to a stable release date may be accepted into an Electron alpha or
beta release branch on a case-by-case basis. These requests will be reviewed and voted on
by the [Releases Working Group](https://github.com/electron/governance/tree/main/wg-releases),
to ensure minimal disruption for developers who may be consuming alpha or beta releases.
### Breaking API changes
When an API is changed or removed in a way that breaks existing functionality, the

View File

@@ -91,9 +91,9 @@ The above configuration will download from URLs such as
`https://npmmirror.com/mirrors/electron/8.0.0/electron-v8.0.0-linux-x64.zip`.
If your mirror serves artifacts with different checksums to the official
Electron release you may have to set `electron_use_remote_checksums=1` directly,
or configure it in a `.npmrc` file, to force Electron to use the remote `SHASUMS256.txt`
file to verify the checksum instead of the embedded checksums.
Electron release you may have to set `electron_use_remote_checksums=1` to
force Electron to use the remote `SHASUMS256.txt` file to verify the checksum
instead of the embedded checksums.
#### Cache

View File

@@ -1,6 +1,7 @@
import * as fs from 'fs';
import { Menu } from 'electron/main';
import * as deprecate from '@electron/internal/common/deprecate';
const bindings = process._linkedBinding('electron_browser_app');
const commandLine = process._linkedBinding('electron_common_command_line');
@@ -111,3 +112,13 @@ for (const name of events) {
webContents.emit(name, event, ...args);
});
}
// Deprecation.
deprecate.event(app, 'gpu-process-crashed', 'child-process-gone', () => {
// the old event is still emitted by App::OnGpuProcessCrashed()
return undefined;
});
deprecate.event(app, 'renderer-process-crashed', 'render-process-gone', (event: Electron.Event, webContents: Electron.WebContents, details: Electron.RenderProcessGoneDetails) => {
return [event, webContents, details.reason === 'killed'];
});

View File

@@ -2,7 +2,7 @@ import { app } from 'electron/main';
import { EventEmitter } from 'events';
import * as squirrelUpdate from '@electron/internal/browser/api/auto-updater/squirrel-update-win';
class AutoUpdater extends EventEmitter implements Electron.AutoUpdater {
class AutoUpdater extends EventEmitter {
updateAvailable: boolean = false;
updateURL: string | null = null;
@@ -15,7 +15,7 @@ class AutoUpdater extends EventEmitter implements Electron.AutoUpdater {
}
getFeedURL () {
return this.updateURL ?? '';
return this.updateURL;
}
setFeedURL (options: { url: string } | string) {

View File

@@ -3,7 +3,7 @@ import * as deprecate from '@electron/internal/common/deprecate';
const binding = process._linkedBinding('electron_browser_crash_reporter');
class CrashReporter implements Electron.CrashReporter {
class CrashReporter {
start (options: Electron.CrashReporterStartOptions) {
const {
productName = app.name,

View File

@@ -1,12 +1,10 @@
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
import { EventEmitter } from 'events';
const { createPair } = process._linkedBinding('electron_browser_message_port');
export default class MessageChannelMain extends EventEmitter implements Electron.MessageChannelMain {
export default class MessageChannelMain {
port1: MessagePortMain;
port2: MessagePortMain;
constructor () {
super();
const { port1, port2 } = createPair();
this.port1 = new MessagePortMain(port1);
this.port2 = new MessagePortMain(port2);

View File

@@ -8,7 +8,7 @@ const {
isOnBatteryPower
} = process._linkedBinding('electron_browser_power_monitor');
class PowerMonitor extends EventEmitter implements Electron.PowerMonitor {
class PowerMonitor extends EventEmitter {
constructor () {
super();
// Don't start the event source until both a) the app is ready and b)

View File

@@ -1,11 +1,9 @@
import { BrowserWindow, Menu, SharingItem, PopupOptions } from 'electron/main';
import { EventEmitter } from 'events';
class ShareMenu extends EventEmitter implements Electron.ShareMenu {
class ShareMenu {
private menu: Menu;
constructor (sharingItem: SharingItem) {
super();
this.menu = new (Menu as any)({ sharingItem });
}

View File

@@ -4,7 +4,7 @@ import { Socket } from 'net';
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
const { _fork } = process._linkedBinding('electron_browser_utility_process');
class ForkUtilityProcess extends EventEmitter implements Electron.UtilityProcess {
class ForkUtilityProcess extends EventEmitter {
#handle: ElectronInternal.UtilityProcessWrapper | null;
#stdout: Duplex | null = null;
#stderr: Duplex | null = null;

View File

@@ -573,6 +573,10 @@ WebContents.prototype._init = function () {
ipcMain.emit(channel, event, message);
});
deprecate.event(this, 'crashed', 'render-process-gone', (event: Electron.Event, details: Electron.RenderProcessGoneDetails) => {
return [event, details.reason === 'killed'];
});
this.on('render-process-gone', (event, details) => {
app.emit('render-process-gone', event, this, details);

View File

@@ -1,7 +1,7 @@
import { EventEmitter } from 'events';
import { IpcMainInvokeEvent } from 'electron/main';
export class IpcMainImpl extends EventEmitter implements Electron.IpcMain {
export class IpcMainImpl extends EventEmitter {
private _invokeHandlers: Map<string, (e: IpcMainInvokeEvent, ...args: any[]) => void> = new Map();
constructor () {

View File

@@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
export class MessagePortMain extends EventEmitter implements Electron.MessagePortMain {
export class MessagePortMain extends EventEmitter {
_internalPort: any;
constructor (internalPort: any) {
super();

View File

@@ -21,6 +21,7 @@ export const webViewEvents: Record<string, readonly string[]> = {
'did-navigate-in-page': ['url', 'isMainFrame', 'frameProcessId', 'frameRoutingId'],
'-focus-change': ['focus'],
close: [],
crashed: [],
'render-process-gone': ['details'],
'plugin-crashed': ['name', 'version'],
destroyed: [],

View File

@@ -3,30 +3,30 @@ import { EventEmitter } from 'events';
const { ipc } = process._linkedBinding('electron_renderer_ipc');
const internal = false;
class IpcRenderer extends EventEmitter implements Electron.IpcRenderer {
send (channel: string, ...args: any[]) {
return ipc.send(internal, channel, args);
}
sendSync (channel: string, ...args: any[]) {
return ipc.sendSync(internal, channel, args);
}
const ipcRenderer = new EventEmitter() as Electron.IpcRenderer;
ipcRenderer.send = function (channel, ...args) {
return ipc.send(internal, channel, args);
};
sendToHost (channel: string, ...args: any[]) {
return ipc.sendToHost(channel, args);
}
ipcRenderer.sendSync = function (channel, ...args) {
return ipc.sendSync(internal, channel, args);
};
async invoke (channel: string, ...args: any[]) {
const { error, result } = await ipc.invoke(internal, channel, args);
if (error) {
throw new Error(`Error invoking remote method '${channel}': ${error}`);
}
return result;
}
ipcRenderer.sendToHost = function (channel, ...args) {
return ipc.sendToHost(channel, args);
};
postMessage (channel: string, message: any, transferables: any) {
return ipc.postMessage(channel, message, transferables);
ipcRenderer.invoke = async function (channel, ...args) {
const { error, result } = await ipc.invoke(internal, channel, args);
if (error) {
throw new Error(`Error invoking remote method '${channel}': ${error}`);
}
}
return result;
};
export default new IpcRenderer();
ipcRenderer.postMessage = function (channel: string, message: any, transferables: any) {
return ipc.postMessage(channel, message, transferables);
};
export default ipcRenderer;

View File

@@ -4,22 +4,20 @@ const { ipc } = process._linkedBinding('electron_renderer_ipc');
const internal = true;
class IpcRendererInternal extends EventEmitter implements ElectronInternal.IpcRendererInternal {
send (channel: string, ...args: any[]) {
return ipc.send(internal, channel, args);
export const ipcRendererInternal = new EventEmitter() as any as ElectronInternal.IpcRendererInternal;
ipcRendererInternal.send = function (channel, ...args) {
return ipc.send(internal, channel, args);
};
ipcRendererInternal.sendSync = function (channel, ...args) {
return ipc.sendSync(internal, channel, args);
};
ipcRendererInternal.invoke = async function<T> (channel: string, ...args: any[]) {
const { error, result } = await ipc.invoke<T>(internal, channel, args);
if (error) {
throw new Error(`Error invoking remote method '${channel}': ${error}`);
}
sendSync (channel: string, ...args: any[]) {
return ipc.sendSync(internal, channel, args);
}
async invoke<T> (channel: string, ...args: any[]) {
const { error, result } = await ipc.invoke<T>(internal, channel, args);
if (error) {
throw new Error(`Error invoking remote method '${channel}': ${error}`);
}
return result;
};
}
export const ipcRendererInternal = new IpcRendererInternal();
return result;
};

View File

@@ -2,7 +2,7 @@ import { EventEmitter } from 'events';
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
const { createParentPort } = process._linkedBinding('electron_utility_parent_port');
export class ParentPort extends EventEmitter implements Electron.ParentPort {
export class ParentPort extends EventEmitter {
#port: ParentPort;
constructor () {
super();

View File

@@ -42,7 +42,7 @@ downloadArtifact({
artifactName: 'electron',
force: process.env.force_no_cache === 'true',
cacheRoot: process.env.electron_config_cache,
checksums: process.env.electron_use_remote_checksums ?? process.env.npm_config_electron_use_remote_checksums ? undefined : require('./checksums.json'),
checksums: process.env.electron_use_remote_checksums ? undefined : require('./checksums.json'),
platform,
arch
}).then(extractFile).catch(err => {

View File

@@ -6,11 +6,11 @@
"devDependencies": {
"@azure/storage-blob": "^12.9.0",
"@electron/asar": "^3.2.1",
"@electron/docs-parser": "^1.2.0",
"@electron/docs-parser": "^1.1.1",
"@electron/fiddle-core": "^1.0.4",
"@electron/github-app-auth": "^2.0.0",
"@electron/lint-roller": "^1.9.0",
"@electron/typescript-definitions": "^8.15.1",
"@electron/typescript-definitions": "^8.14.5",
"@octokit/rest": "^19.0.7",
"@primer/octicons": "^10.0.0",
"@types/basic-auth": "^1.1.3",

View File

@@ -133,5 +133,6 @@ build_remove_ent_content_analysis_assert.patch
fix_activate_background_material_on_windows.patch
fix_move_autopipsettingshelper_behind_branding_buildflag.patch
revert_remove_the_allowaggressivethrottlingwithwebsocket_feature.patch
fix_handle_no_top_level_aura_window_in_webcontentsimpl.patch
feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch
chore_remove_check_is_test_on_script_injection_tracker.patch

View File

@@ -79,7 +79,7 @@ index 5030619779b7bcd67923026991bb44d926d81e1a..1eea33740fcdca49e094ad7ad00cfda8
if (World().IsMainWorld()) {
probe::DidCreateMainWorldContext(GetFrame());
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index c0fa11ea9ec9f35fe7ee1c36a8ea618cc0ccaea0..cd8a420bb51be71996d697b49ccf51f2bcce2c4c 100644
index b83ee768ac5622ceb3c0f230cefdd1e46e219985..f034c3e647ee64c81d9684bb73ff999e16ce9a94 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -320,6 +320,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {

View File

@@ -33,10 +33,10 @@ index 0594fc8f8122b5f66457c262890ea93be3a579d8..19f045d14c6072c1b0b8fb6a50bf4caf
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index d79a6c13ce425ccc123205476b292e9fe4d53171..b78d2c8bad3f3f6d046d5be52e5e5f76c95a8454 100644
index bce36d7ffb408e6bb150afae315c09087c89fc45..6c8ff481d2a89cdeb95f6598de8b716c5f1556a4 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4822,7 +4822,7 @@ static_library("browser") {
@@ -4819,7 +4819,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@@ -46,10 +46,10 @@ index d79a6c13ce425ccc123205476b292e9fe4d53171..b78d2c8bad3f3f6d046d5be52e5e5f76
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index b5242eef4e36dae88fd0e454203ce94777fd268b..99daebc34f3d0e6b154f919648cb4c5044a3c025 100644
index 21f47fbabc1c8af4524642d6ffe0c34fe23db874..beda741d58625b8069785b24a3049e87ba43990d 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7048,7 +7048,6 @@ test("unit_tests") {
@@ -7033,7 +7033,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index b5242eef4e36dae88fd0e454203ce94777fd268b..99daebc34f3d0e6b154f919648cb4c50
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -7069,6 +7068,10 @@ test("unit_tests") {
@@ -7054,6 +7053,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index b5242eef4e36dae88fd0e454203ce94777fd268b..99daebc34f3d0e6b154f919648cb4c50
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -8062,7 +8065,6 @@ test("unit_tests") {
@@ -8046,7 +8049,6 @@ test("unit_tests") {
}
deps += [
@@ -76,7 +76,7 @@ index b5242eef4e36dae88fd0e454203ce94777fd268b..99daebc34f3d0e6b154f919648cb4c50
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:app_registry_cache_waiter",
@@ -8153,6 +8155,10 @@ test("unit_tests") {
@@ -8136,6 +8138,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]

View File

@@ -6,7 +6,7 @@ Subject: build: only use the mas build config in the required components
Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 8f12d13dcd67d9dfb97b3e1fbe6a8caefdb9fd2c..9e93386c769b7bb805cf8057ce4b28a6555a144a 100644
index 24f2397278ccb400a47e065a676be5ae783fa2e6..7d96eee167aadcea896fa18b7c806d9b6ccfff83 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1035,6 +1035,7 @@ component("base") {
@@ -74,7 +74,7 @@ index 53611e788cde9012ca566444e6c1ee05c99b921e..c5d018ae78b486ef4b3cc86a8091869f
if (is_win) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index d2b0f343db2cec3667576d37bad76c2294099331..aaa40fe000b85ffe249b1ce8230ac3a7746b0a1a 100644
index 7ad4e9e5166265651ef50e3ee5488595ab97bc06..a10c3387aa8e81c7b02983e7bae9480a5354a0f3 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -52,6 +52,7 @@ source_set("browser") {
@@ -110,10 +110,10 @@ index 697fa7c5e98e7ee16b1b5e676f60a9689f7aac2b..f5e7278a6e391cbab61bbd2981127beb
public_deps = [
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 97e1984a154b0f4d36d9c02e001234a1d9ed0740..d5d6e524a6063abccee23d1e2632f4e3318f8f10 100644
index 810032493d005228fb9c49b924f91c247f6a9de2..46baa84dd5c05b185e8ea7ea7ea44a441056b9f1 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -482,6 +482,7 @@ static_library("test_support") {
@@ -480,6 +480,7 @@ static_library("test_support") {
configs += [
"//build/config:precompiled_headers",
"//v8:external_startup_data",

View File

@@ -9,7 +9,7 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index ae39e6adf98e783e19d83e4e31dde47a19e37593..022ed0a5767806b66f32b8a7555d6726636b09cf 100644
index fe69db83393efd0a4b886761dce4b7ead3c4c7d0..f2e623cd6ed7eb910216ff4e32686f9124762d81 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -8231,6 +8231,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -21,10 +21,10 @@ index ae39e6adf98e783e19d83e4e31dde47a19e37593..022ed0a5767806b66f32b8a7555d6726
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a062e2af581013170e655f3d2318c8d43c7d5e63..f7a8529020e9be4a4f13156b9e96e74fbffd09cc 100644
index eab88872f0cee9f2fa208031684b0ed0018333d4..59701b5246e2d07662fb0072b77f3d73ab5df49d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4483,6 +4483,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4487,6 +4487,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@@ -37,7 +37,7 @@ index a062e2af581013170e655f3d2318c8d43c7d5e63..f7a8529020e9be4a4f13156b9e96e74f
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -4524,12 +4530,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4528,12 +4534,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -66,10 +66,10 @@ index 40c14e1757dee4fda9aa79f3a52532f8ab737a97..2c833d683b737bd6b24d2ec10d97b46d
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index b9cb67d2350da2a59c69f7dc45ba8fec5f4192c5..cd26851920c6fae8721ba5c3a126962b1c036e49 100644
index dcdc54f90f114cdef17ae59e579493fe4278c5c8..72d942d2aea9369f319308fc01e6366ebd0f2612 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -716,6 +716,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -715,6 +715,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -79,7 +79,7 @@ index b9cb67d2350da2a59c69f7dc45ba8fec5f4192c5..cd26851920c6fae8721ba5c3a126962b
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index e637fcabba2637d6044992c332a90c73d058e926..a5600d50354e21139baecbee89b27cf62a0f90fa 100644
index 06e22b37dfbcefb71f0dc3705f7ab50a27487ff0..5266731678dbfe5fe66ff863b88325546c255be8 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -177,6 +177,7 @@ class NetworkService;
@@ -90,7 +90,7 @@ index e637fcabba2637d6044992c332a90c73d058e926..a5600d50354e21139baecbee89b27cf6
} // namespace network
namespace sandbox {
@@ -1153,6 +1154,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1142,6 +1143,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -100,10 +100,10 @@ index e637fcabba2637d6044992c332a90c73d058e926..a5600d50354e21139baecbee89b27cf6
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 1858dd4e9946aae67ab09b61c813eef23ed0284f..331e86ca4023980a2f26dab388dac02bbeb49f1c 100644
index fdcd738fb91ef8b0a341d24496913196dcc3047a..fc19223c3fe7d675c00d26df35fc21dfbc3e15ec 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -30,6 +30,17 @@ namespace content {
@@ -29,6 +29,17 @@ namespace content {
WebContentsDelegate::WebContentsDelegate() = default;
@@ -122,7 +122,7 @@ index 1858dd4e9946aae67ab09b61c813eef23ed0284f..331e86ca4023980a2f26dab388dac02b
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 5658b9774511ba54505370cd06193191db714ea3..04fa30594c33664a320598a3ec25d3b53bc4975b 100644
index a3da78805b9bc36d433861f7769dfdb943f43b6c..7400c6f7f50ae8fef6646590fab3e4186f911f67 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -133,7 +133,7 @@ index 5658b9774511ba54505370cd06193191db714ea3..04fa30594c33664a320598a3ec25d3b5
#include "content/public/browser/eye_dropper.h"
#include "content/public/browser/fullscreen_types.h"
#include "content/public/browser/invalidate_type.h"
@@ -345,6 +346,13 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -344,6 +345,13 @@ class CONTENT_EXPORT WebContentsDelegate {
const StoragePartitionConfig& partition_config,
SessionStorageNamespace* session_storage_namespace);
@@ -163,7 +163,7 @@ index d7c6222c977058f230d5e6153b1df13e127a9939..47562a65e99b1bdbeca57f1ba69822df
// moved on send.
bool is_background_tab =
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
index 51de81df6cb5126a750dab43322f8fc1fc484d80..9cb924a1969eef8d3940cc261e286e10c6d84d5c 100644
index eee2ed58f7aec55f2ba7b407aa1b00981c02202d..2aa188ccf5e4099ed232f5789bd1a4bc5d53369d 100644
--- a/content/web_test/browser/web_test_content_browser_client.cc
+++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -512,6 +512,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -176,7 +176,7 @@ index 51de81df6cb5126a750dab43322f8fc1fc484d80..9cb924a1969eef8d3940cc261e286e10
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h
index 4869a7502ed31ad6101bd89f899325ffef427c0e..954037dc4fdc21b922debb7a123f1e93e788a908 100644
index 64566572e9119ffa6ff0f1b5e69476da935262c3..561fe713ffd6c286436dee47b4d1b38f86a9e596 100644
--- a/content/web_test/browser/web_test_content_browser_client.h
+++ b/content/web_test/browser/web_test_content_browser_client.h
@@ -86,6 +86,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {

View File

@@ -9,7 +9,7 @@ This is an experimental commit; but if it's successful,
This patch should be upstreamed and then removed from electron's code.
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 7c286fb2c0e22be420fef49027d5f8c5a32c11a6..1d47b3358e174143513ad0bc5261465b996ef98a 100644
index d6d8db2ed2341c475d076bef227f2973d9bca609..372a9760aa87f0dd97e95d0006da428ea46422c7 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -41,7 +41,6 @@

View File

@@ -35,10 +35,10 @@ index 155296ba7ee5495be62045bc620bb1cd31d3ceb3..954efde9e7a58f8b556c6ceabb81643f
content::RenderFrameHost* requesting_frame,
const blink::mojom::FullscreenOptions& options) final;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.cc b/chrome/browser/ui/ash/ash_web_view_impl.cc
index bc9f9240e302e55c114a66437c8bdf6211323cbf..2136e6634ecc499a19ebc3097199521e8e45030c 100644
index 6494db63fa65aea215dbc63283b9575f4ec2068c..d05ce515ee04544677894b116e479727c601d5f5 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.cc
+++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
@@ -111,10 +111,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
@@ -104,10 +104,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -80,7 +80,7 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index d906456768a211e916f8bea3c7506b5ad028d861..3706522250e20c2b5940b0226f13f4879cb0a3e0 100644
index bd2f3d64f3f382722a697d67e8b9adf4a29e028a..d7de167b805969194d79be5fa0418dede14222a5 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1884,12 +1884,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -99,7 +99,7 @@ index d906456768a211e916f8bea3c7506b5ad028d861..3706522250e20c2b5940b0226f13f487
WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 5e73458fda65e4e91054a95c7d041006e9050db1..17c457095375fe8b4cf904695aaf91252d14cb80 100644
index 654474036268324ff169a814c960f0ee83345872..d1bbc1c49b20e3f0eee2295a225aa39e57dbbcf9 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -891,8 +891,7 @@ class Browser : public TabStripModelObserver,
@@ -218,10 +218,10 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b907488927e11061f41669c8c16c427a051d783c..93a0fba3b73c9569a148472d5acec7e2cdc4eaa6 100644
index 3f7181097becd1b6236f49e6b653b7d9e080d5c7..16adc4112b0e10fadd9c8af254e9e26f6e8e19e3 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4389,8 +4389,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4393,8 +4393,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,
@@ -232,10 +232,10 @@ index b907488927e11061f41669c8c16c427a051d783c..93a0fba3b73c9569a148472d5acec7e2
static_cast<WebContentsImpl*>(delegate_->CreateCustomWebContents(
opener, source_site_instance, is_new_browsing_instance,
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 331e86ca4023980a2f26dab388dac02bbeb49f1c..31781b898f30337185eca611d2b7838ce67adc3e 100644
index fc19223c3fe7d675c00d26df35fc21dfbc3e15ec..45d8465bce348c2a631f0a464b3cd14401d33a0c 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -138,8 +138,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
@@ -137,8 +137,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
SiteInstance* source_site_instance,
mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -246,10 +246,10 @@ index 331e86ca4023980a2f26dab388dac02bbeb49f1c..31781b898f30337185eca611d2b7838c
}
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 04fa30594c33664a320598a3ec25d3b53bc4975b..237e890d4ba5430f6632a7eaeecada93591ee976 100644
index 7400c6f7f50ae8fef6646590fab3e4186f911f67..1489dfcf8ea3d3181abe784556b40565cc335c02 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -324,8 +324,7 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -323,8 +323,7 @@ class CONTENT_EXPORT WebContentsDelegate {
SiteInstance* source_site_instance,
mojom::WindowContainerType window_container_type,
const GURL& opener_url,

View File

@@ -44,10 +44,10 @@ index 48b7a20c212578ba9055b781b5c05b312fa7e974..3ae8136e5c938be80df141f7ca582d97
"https://redirector.gvt1.com/edgedl/chrome/dict/";
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index def025dbffec3f44074604fcfb441b769886c3ab..459e8be9dcbf6d3ede156b57abcf9c9ede5587c7 100644
index 386d321eb07ec1cda9475e7c502aac0eb99d19ba..23983aa547a8f4355f33c97fb6218bf00b791702 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -96,6 +96,8 @@ class SpellcheckHunspellDictionary : public SpellcheckDictionary {
@@ -93,6 +93,8 @@ class SpellcheckHunspellDictionary
// Tests use this method to set a custom URL for downloading dictionaries.
static void SetDownloadURLForTesting(const GURL url);

View File

@@ -197,7 +197,7 @@ index e82717d5167e13e2926bcaf6c0ad66c1502e66f6..783c4d6ed399120e026bbf18baab4092
const raw_ptr<GpuServiceImpl> gpu_service_impl_;
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
index 4ceb1a9d9f336f65e15831856d30b45af594dd0f..646ac22f074c3d1827e59170a93807bc10d83d0b 100644
index 5dccc2360cd1f3d83ffc59697aeb559a19b0547a..5fe62069b15e6370e63645b257d931be2a714bc3 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
@@ -106,6 +106,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
@@ -209,13 +209,13 @@ index 4ceb1a9d9f336f65e15831856d30b45af594dd0f..646ac22f074c3d1827e59170a93807bc
// Record the previous paint buffer.
Buffer* previous_paint_buffer =
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
@@ -191,6 +193,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
@@ -194,6 +196,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
ca_layer_params.is_empty = false;
ca_layer_params.scale_factor = scale_factor_;
ca_layer_params.pixel_size = pixel_size_;
+ ca_layer_params.damage = last_damage;
ca_layer_params.io_surface_mach_port.reset(
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface.get()));
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
index 67d5ff67d74c107a867b39b306c6528425b87e05..5fd12a25c9e319e8e675955926271c9d1cd3a7ca 100644

View File

@@ -112,10 +112,10 @@ index a58666f95cf6c0974e25b0c2805f944b290358ae..fa77efab0cbe5a702796a0e374f847c1
string mime_type;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 9872a3ff04cc6cc7b4b129049dfd147df92d0966..92b40aa9d94d0e581ee41c6a0719d67245e927ad 100644
index 6d220fb47ca8e9019c2e4e8efd8c73ad3632c690..b0b972c5768087ded0ade3dfc15bd1c47e68bc3c 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -624,6 +624,7 @@ URLLoader::URLLoader(
@@ -623,6 +623,7 @@ URLLoader::URLLoader(
has_user_activation_ = request.trusted_params->has_user_activation;
allow_cookies_from_browser_ =
request.trusted_params->allow_cookies_from_browser;
@@ -123,7 +123,7 @@ index 9872a3ff04cc6cc7b4b129049dfd147df92d0966..92b40aa9d94d0e581ee41c6a0719d672
}
// Store any cookies passed from the browser process to later attach them to
@@ -662,7 +663,7 @@ URLLoader::URLLoader(
@@ -661,7 +662,7 @@ URLLoader::URLLoader(
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
}
@@ -132,7 +132,7 @@ index 9872a3ff04cc6cc7b4b129049dfd147df92d0966..92b40aa9d94d0e581ee41c6a0719d672
url_request_->SetResponseHeadersCallback(base::BindRepeating(
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
}
@@ -1597,6 +1598,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
@@ -1596,6 +1597,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
}
response_ = BuildResponseHead();
@@ -153,10 +153,10 @@ index 9872a3ff04cc6cc7b4b129049dfd147df92d0966..92b40aa9d94d0e581ee41c6a0719d672
// Parse and remove the Trust Tokens response headers, if any are expected,
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 1d8615500cfc9bbc3162810d9545967796430976..9ac57ece3811da8146695f6546300c12ef6589e8 100644
index b5a9c7db397be9a85c0fdc0a5c76e13393eaa436..3082770fd7cd93da2578e55c4ea256edf819bf29 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -633,6 +633,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -630,6 +630,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
resource_scheduler_request_handle_;

View File

@@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index 26c8448f25a9b1944f4dc0ef19afe3682cae88e6..e4da0e9238cca35091d0a5e65e31f558b578764c 100644
index 159a0e1c17214afb638fff635340add040433b2d..1fa0251171411f8cdb05621fb0d43948e7b3e4af 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -9878,6 +9878,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
@@ -9862,6 +9862,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
return std::make_pair(parent->GetLastCommittedOrigin(), "about_srcdoc");
}

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 14 Sep 2023 10:24:44 +0200
Subject: fix: handle no top level aura window in WebContentsImpl
https://chromium-review.googlesource.com/c/chromium/src/+/4794133
added two new RenderWidgetHostDelegate methods to set and get the
window show state on Aura. However, the implementation of these methods
doesn't take into account the case where there is no top level Aura
Window which leads to a bad access crash trying to get its show state.
This fixes that by guarding against the missing window - this check
can potentially be upstreamed but it's likely that the better fix for this
is to update our OSR code which is several years outdated.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index f107f0089be4d7b75c95821d85b1666b0bf1077f..4aaa859a45e710863695755f69c2bdfbefb73ceb 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3996,7 +3996,7 @@ void WebContentsImpl::Restore() {
ui::WindowShowState WebContentsImpl::GetWindowShowState() {
#if defined(USE_AURA)
aura::Window* window = GetTopLevelNativeWindow();
- return wm::GetWindowState(window);
+ return window ? wm::GetWindowState(window) : ui::SHOW_STATE_NORMAL;
#else
// TODO(laurila, crbug.com/1466855): This API function currently works only on
// Aura platforms (Win/Lin/CrOS/Fuchsia), make it also work on Mac.

View File

@@ -45,10 +45,10 @@ index 1dfd9c071a41482e0d35257b28522e5b37702f25..41a09e9470dfa5797c69d02fc9b4f5e6
// RenderFrameMetadataProvider::Observer implementation.
void OnRenderFrameMetadataChangedBeforeActivation(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7919112de3c7a5e35c83cc6746fd68fcc24cc785..9bc179ad5563fe1b9ae1a856ac99af47e76f8fe5 100644
index 6fd40ddf07a55ec12f18ff88e92a7f59a5a52f96..f107f0089be4d7b75c95821d85b1666b0bf1077f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8644,7 +8644,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -8649,7 +8649,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View File

@@ -85,7 +85,7 @@ index 6fc9f48d84590f85576be0362c716634c87eff80..33391eeb8ce9f70955e4e991c5f400a2
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
index 7efb913cb4ec556deeed64a31e4da620a797c875..3e4e873ac62e387067bdfed9fc24b795acd723c6 100644
index b233430e6049761d478065247e7c2cd4bc26e080..0cb7aef72fdff3686c1c5da81c1f97bf34008d0c 100644
--- a/third_party/blink/renderer/core/frame/local_frame.h
+++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -803,6 +803,7 @@ class CORE_EXPORT LocalFrame final

View File

@@ -20,7 +20,7 @@ index 583ca650938d2e4feac0c31b0f828815c816ee02..525c97a6cf53e69f9eedd5cfb1223c8b
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index a5600d50354e21139baecbee89b27cf62a0f90fa..44b582a349cb656de99b110bba6d3f0ae9a954ec 100644
index 5266731678dbfe5fe66ff863b88325546c255be8..424ecbe94ec90ffd1351fb88d8ef48880862a451 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -315,6 +315,11 @@ class CONTENT_EXPORT ContentBrowserClient {

View File

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index a7d630128056bba736d1826797b321790fc09453..264bcb394393444c5982eb041844a9bea3d91e72 100644
index 95e5ac768b9049ca5ce09264cd391f5f7247b5a3..e8c51cc830d87d08816c50525971c9f58a512b2e 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1263,6 +1263,11 @@
@@ -1260,6 +1260,11 @@
"includes": [8440],
},

View File

@@ -99,7 +99,7 @@ index b267bc2272fa82334a70d897a900f1ea37b1a598..967e22699bf565368704972c021f9b42
DPSXCHECK(responsibility_spawnattrs_setdisclaim(attr.get(), 1));
}
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index 2d063ce0ae54510f3a33e2092e05f41f1de2c1aa..18e53655e080172c278fc89e35d69044a6718f9f 100644
index 2fa8809df1d4b29525a737cca40694a61e7ca570..c90c81b0bc5d87777b87de2848326696f95d2306 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -31,19 +31,23 @@

View File

@@ -43,10 +43,10 @@ index 5a096477c123a782341115f964c4975301ccaf9a..ecfbb3b405425af346a6ba6788fc1d8f
} // namespace
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
index 053b8a2182778b469941116eab3acd5fd6fd8099..d085258d5970b37215fe0d5591e6c0306401a172 100644
index 4616dd8ca21d7e243d5bd785477fe6e43bcdb34b..3332856a44751b3dab0b0002ff3d5a135922fbca 100644
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -600,10 +600,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
@@ -595,10 +595,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
// this should be treated as an error and caught early.
CHECK(bridged_view_);
@@ -265,7 +265,7 @@ index f37c02488e6ba943ebf9b880a04bcfef9afc9d97..b10ed25b5cdf5eb2f314ed72226f71c8
// Used to force the NSApplication's focused accessibility element to be the
// views::Views accessibility tree when the NSView for this is focused.
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index b3fa0a3684892edc14053ba8e7a5f2d5fb15e6e3..c45fd31fb1ac4cd256addabdd0a11ff75eaa3a99 100644
index 34dd3d7497828edc0a2cc1a5babb5b00d54f2ada..501afb8d381ce229d7b30f0a87342b7af37a45ba 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -345,7 +345,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -292,7 +292,7 @@ index b3fa0a3684892edc14053ba8e7a5f2d5fb15e6e3..c45fd31fb1ac4cd256addabdd0a11ff7
}
remote_cocoa::mojom::NativeWidgetNSWindow*
@@ -1407,6 +1415,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1397,6 +1405,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
const std::vector<uint8_t>& window_token,
const std::vector<uint8_t>& view_token) {
@@ -300,7 +300,7 @@ index b3fa0a3684892edc14053ba8e7a5f2d5fb15e6e3..c45fd31fb1ac4cd256addabdd0a11ff7
remote_window_accessible_ =
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
remote_view_accessible_ =
@@ -1418,11 +1427,13 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1408,11 +1417,13 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
![NSAccessibilityRemoteUIElement isRemoteUIApp]) {
[NSAccessibilityRemoteUIElement setRemoteUIApp:YES];
}
@@ -314,7 +314,7 @@ index b3fa0a3684892edc14053ba8e7a5f2d5fb15e6e3..c45fd31fb1ac4cd256addabdd0a11ff7
*pid = getpid();
id element_id = GetNativeViewAccessible();
@@ -1435,6 +1446,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1425,6 +1436,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
}
*token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id);

View File

@@ -101,7 +101,7 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019
} // namespace content
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 37ce08d9c11de4e53dbf9a9db2e74f1b12adafcf..bb9433fcb49d40adbe9ef8fdddfde49fc2809a78 100644
index 82836fc5fe3a7279f4fd15f297969162bc63089a..4276251875612430d1b197578f659736dbd86925 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -37,6 +37,7 @@
@@ -131,7 +131,7 @@ index 37ce08d9c11de4e53dbf9a9db2e74f1b12adafcf..bb9433fcb49d40adbe9ef8fdddfde49f
classic_discovery_manager_(
BluetoothDiscoveryManagerMac::CreateClassic(this)),
device_paired_status_callback_(
@@ -244,8 +248,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) {
@@ -243,8 +247,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) {
}
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {

View File

@@ -904,7 +904,7 @@ index c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c8
// Calculate number of pages in source document.
uint32_t CalculateNumberOfPages(blink::WebLocalFrame* frame,
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 12700e24197d4d976ccd301af577e03439ad9be2..d2b0f343db2cec3667576d37bad76c2294099331 100644
index 3b4f0f00e2e214b9615a07acfc02c9baf4a2a7ab..7ad4e9e5166265651ef50e3ee5488595ab97bc06 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2994,8 +2994,9 @@ source_set("browser") {

View File

@@ -44,10 +44,10 @@ index 895f5126806b557c853f163fe69459ea929f11a4..b4ead2f5f2f813c23cd5eddae3d38052
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index f7a8529020e9be4a4f13156b9e96e74fbffd09cc..b907488927e11061f41669c8c16c427a051d783c 100644
index 59701b5246e2d07662fb0072b77f3d73ab5df49d..3f7181097becd1b6236f49e6b653b7d9e080d5c7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5106,6 +5106,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -5110,6 +5110,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}

View File

@@ -9,7 +9,7 @@ is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 93a0fba3b73c9569a148472d5acec7e2cdc4eaa6..52eb186a4b40f964c7633cdced8514089ec7b2a5 100644
index 16adc4112b0e10fadd9c8af254e9e26f6e8e19e3..b618812f6d750ed4e3122aad642e4cc06c316904 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3448,6 +3448,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,

View File

@@ -15,7 +15,7 @@ Note that we also need to manually update embedder's
`api::WebContents::IsFullscreenForTabOrPending` value.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 022ed0a5767806b66f32b8a7555d6726636b09cf..0bb935d9a1913a1ff67b1e0cdc2fb74f0fc75d96 100644
index f2e623cd6ed7eb910216ff4e32686f9124762d81..57a8a953452a1c1bddd7956c3a83fff8a922ca84 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7445,6 +7445,17 @@ void RenderFrameHostImpl::EnterFullscreen(
@@ -37,7 +37,7 @@ index 022ed0a5767806b66f32b8a7555d6726636b09cf..0bb935d9a1913a1ff67b1e0cdc2fb74f
if (had_fullscreen_token && !GetView()->HasFocus())
GetView()->Focus();
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 52eb186a4b40f964c7633cdced8514089ec7b2a5..7919112de3c7a5e35c83cc6746fd68fcc24cc785 100644
index b618812f6d750ed4e3122aad642e4cc06c316904..6fd40ddf07a55ec12f18ff88e92a7f59a5a52f96 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3702,21 +3702,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(

View File

@@ -405,10 +405,10 @@ index 0000000000000000000000000000000000000000..a564653c3f05608d59fed5aa071d63b8
+}
diff --git a/deps/base64/BUILD.gn b/deps/base64/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..9b97aabe865e4cf12f6c3ccda196b372769a823b
index 0000000000000000000000000000000000000000..694e1991bb11c9ea85fcc69a0e06265d4b0c5aab
--- /dev/null
+++ b/deps/base64/BUILD.gn
@@ -0,0 +1,135 @@
@@ -0,0 +1,152 @@
+config("base64_config") {
+ include_dirs = [
+ "base64/include",
@@ -420,15 +420,7 @@ index 0000000000000000000000000000000000000000..9b97aabe865e4cf12f6c3ccda196b372
+
+static_library("base64") {
+ defines = []
+ deps = [
+ ":base64_neon32",
+ ":base64_neon64",
+ ":base64_avx",
+ ":base64_avx2",
+ ":base64_sse41",
+ ":base64_sse42",
+ ":base64_ssse3",
+ ]
+ deps = []
+
+ public_configs = [ ":base64_config" ]
+
@@ -446,104 +438,157 @@ index 0000000000000000000000000000000000000000..9b97aabe865e4cf12f6c3ccda196b372
+ "base64/lib/lib.c",
+ "base64/lib/tables/tables.c",
+ ]
+
+ if (target_cpu == "arm") {
+ defines += [ "HAVE_NEON32=1" ]
+ deps += [ ":base64_neon32" ]
+ } else {
+ sources += [ "base64/lib/arch/neon32/neon32_codec.c" ]
+ }
+
+ if (target_cpu == "arm64") {
+ defines += [ "HAVE_NEON64=1" ]
+ deps += [ ":base64_neon64" ]
+ } else {
+ sources += [ "base64/lib/arch/neon64/neon64_codec.c" ]
+ }
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines += [
+ "HAVE_SSSE3=1",
+ "HAVE_SSE41=1",
+ "HAVE_SSE42=1",
+ "HAVE_AVX=1",
+ "HAVE_AVX2=1",
+ ]
+
+ deps += [
+ ":base64_avx",
+ ":base64_avx2",
+ ":base64_sse41",
+ ":base64_sse42",
+ ":base64_ssse3",
+ ]
+ } else {
+ sources += [
+ "base64/lib/arch/avx/avx_codec.c",
+ "base64/lib/arch/avx2/avx2_codec.c",
+ "base64/lib/arch/sse41/sse41_codec.c",
+ "base64/lib/arch/sse42/sse42_codec.c",
+ "base64/lib/arch/ssse3/ssse3_codec.c",
+ ]
+ }
+}
+
+source_set("base64_ssse3") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_SSSE3=1" ]
+ defines = [ "HAVE_SSSE3=1" ]
+
+ cflags = [ "-mssse3" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+ cflags = [ "-mssse3" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+
+ sources = [ "base64/lib/arch/ssse3/codec.c" ]
+ sources = [ "base64/lib/arch/ssse3/ssse3_codec.c" ]
+}
+
+source_set("base64_sse41") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_SSE41=1" ]
+ defines = [ "HAVE_SSE41=1" ]
+
+ cflags = [ "-msse4.1" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+ cflags = [ "-msse4.1" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+
+ sources = [ "base64/lib/arch/sse41/codec.c" ]
+ sources = [ "base64/lib/arch/sse41/sse41_codec.c" ]
+}
+
+
+source_set("base64_sse42") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [
+ "BASE64_STATIC_DEFINE",
+ "HAVE_SSE42=1",
+ ]
+ defines = [
+ "BASE64_STATIC_DEFINE",
+ "HAVE_SSE42=1",
+ ]
+
+ cflags = [ "-msse4.2" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+ cflags = [ "-msse4.2" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+
+ sources = [ "base64/lib/arch/sse42/codec.c" ]
+ sources = [ "base64/lib/arch/sse42/sse42_codec.c" ]
+}
+
+source_set("base64_avx") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_AVX=1" ]
+ defines = [ "HAVE_AVX=1" ]
+
+ cflags = [ "-mavx" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+ cflags = [ "-mavx" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+
+ sources = [ "base64/lib/arch/avx/codec.c" ]
+ sources = [ "base64/lib/arch/avx/avx_codec.c" ]
+}
+
+source_set("base64_avx2") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "ia32" || target_cpu == "x64" || target_cpu == "x32") {
+ defines = [ "HAVE_AVX2=1" ]
+ defines = [ "HAVE_AVX2=1" ]
+
+ cflags = [ "-mavx2" ]
+ cflags_c = [
+ "-Wno-implicit-fallthrough",
+ "-Wno-implicit-function-declaration",
+ ]
+ }
+ cflags = [ "-mavx2" ]
+ cflags_c = [
+ "-Wno-implicit-fallthrough",
+ "-Wno-implicit-function-declaration",
+ ]
+
+ sources = [ "base64/lib/arch/avx2/codec.c" ]
+ sources = [ "base64/lib/arch/avx2/avx2_codec.c" ]
+}
+
+source_set("base64_neon32") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "arm") {
+ defines = [ "HAVE_NEON32=1" ]
+ defines = [ "HAVE_NEON32=1" ]
+
+ cflags = [ "-mfpu=neon" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+ cflags = [ "-mfpu=neon" ]
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+
+ sources = [ "base64/lib/arch/neon32/codec.c" ]
+ sources = [ "base64/lib/arch/neon32/neon32_codec.c" ]
+}
+
+source_set("base64_neon64") {
+ public_configs = [ ":base64_config" ]
+
+ if (target_cpu == "arm64") {
+ defines = [ "HAVE_NEON64=1" ]
+ defines = [ "HAVE_NEON64=1" ]
+
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+ }
+ cflags_c = [ "-Wno-implicit-fallthrough" ]
+
+ sources = [ "base64/lib/arch/neon64/codec.c" ]
+ sources = [ "base64/lib/arch/neon64/neon64_codec.c" ]
+}
diff --git a/deps/base64/base64/lib/arch/avx/codec.c b/deps/base64/base64/lib/arch/avx/avx_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/avx/codec.c
rename to deps/base64/base64/lib/arch/avx/avx_codec.c
diff --git a/deps/base64/base64/lib/arch/avx2/codec.c b/deps/base64/base64/lib/arch/avx2/avx2_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/avx2/codec.c
rename to deps/base64/base64/lib/arch/avx2/avx2_codec.c
diff --git a/deps/base64/base64/lib/arch/neon32/codec.c b/deps/base64/base64/lib/arch/neon32/neon32_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/neon32/codec.c
rename to deps/base64/base64/lib/arch/neon32/neon32_codec.c
diff --git a/deps/base64/base64/lib/arch/neon64/codec.c b/deps/base64/base64/lib/arch/neon64/neon64_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/neon64/codec.c
rename to deps/base64/base64/lib/arch/neon64/neon64_codec.c
diff --git a/deps/base64/base64/lib/arch/sse41/codec.c b/deps/base64/base64/lib/arch/sse41/sse41_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/sse41/codec.c
rename to deps/base64/base64/lib/arch/sse41/sse41_codec.c
diff --git a/deps/base64/base64/lib/arch/sse42/codec.c b/deps/base64/base64/lib/arch/sse42/sse42_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/sse42/codec.c
rename to deps/base64/base64/lib/arch/sse42/sse42_codec.c
diff --git a/deps/base64/base64/lib/arch/ssse3/codec.c b/deps/base64/base64/lib/arch/ssse3/ssse3_codec.c
similarity index 100%
rename from deps/base64/base64/lib/arch/ssse3/codec.c
rename to deps/base64/base64/lib/arch/ssse3/ssse3_codec.c
diff --git a/deps/cares/BUILD.gn b/deps/cares/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..2a902c68ca445b8451e442c314c60ee5a30719e4
@@ -804,10 +849,10 @@ index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb
+}
diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3124b2765
index 0000000000000000000000000000000000000000..23eed033d31eced6a85c794eee550655af7a9a1d
--- /dev/null
+++ b/deps/nghttp2/BUILD.gn
@@ -0,0 +1,51 @@
@@ -0,0 +1,48 @@
+config("nghttp2_config") {
+ defines = [ "NGHTTP2_STATICLIB" ]
+ include_dirs = [ "lib/includes" ]
@@ -849,14 +894,11 @@ index 0000000000000000000000000000000000000000..7d2ca477db2415f43ababa270d8aefa3
+ "lib/nghttp2_pq.c",
+ "lib/nghttp2_priority_spec.c",
+ "lib/nghttp2_queue.c",
+ "lib/nghttp2_ratelim.c",
+ "lib/nghttp2_rcbuf.c",
+ "lib/nghttp2_session.c",
+ "lib/nghttp2_stream.c",
+ "lib/nghttp2_submit.c",
+ "lib/nghttp2_time.c",
+ "lib/nghttp2_version.c",
+ "lib/sfparse.c"
+ ]
+}
diff --git a/deps/simdutf/BUILD.gn b/deps/simdutf/BUILD.gn
@@ -887,10 +929,10 @@ index 0000000000000000000000000000000000000000..bfbd4e656db1a6c73048443f96f1d576
+}
diff --git a/deps/uv/BUILD.gn b/deps/uv/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..29e66144dbb67704bad0d78c4b3f5713537c7987
index 0000000000000000000000000000000000000000..ae4d3bf68882f1aa6d7440448050fbdd9a17dca7
--- /dev/null
+++ b/deps/uv/BUILD.gn
@@ -0,0 +1,197 @@
@@ -0,0 +1,194 @@
+config("libuv_config") {
+ include_dirs = [ "include" ]
+
@@ -963,6 +1005,7 @@ index 0000000000000000000000000000000000000000..29e66144dbb67704bad0d78c4b3f5713
+ "src/strscpy.h",
+ "src/strtok.c",
+ "src/strtok.h",
+ "src/thread-common.c",
+ "src/threadpool.c",
+ "src/timer.c",
+ "src/uv-common.c",
@@ -1067,11 +1110,7 @@ index 0000000000000000000000000000000000000000..29e66144dbb67704bad0d78c4b3f5713
+ if (is_linux) {
+ defines += [ "_GNU_SOURCE" ]
+ sources += [
+ "src/unix/epoll.c",
+ "src/unix/linux-core.c",
+ "src/unix/linux-inotify.c",
+ "src/unix/linux-syscalls.c",
+ "src/unix/linux-syscalls.h",
+ "src/unix/linux.c",
+ "src/unix/procfs-exepath.c",
+ "src/unix/random-getrandom.c",
+ "src/unix/random-sysctl-linux.c",
@@ -1134,10 +1173,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..7d86765bf229275ba55d37a452ef24832a7afadb
index 0000000000000000000000000000000000000000..12d4706fae0d8253db8de1fc2c4e31a6380cc122
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,664 @@
@@ -0,0 +1,663 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
@@ -1251,7 +1290,6 @@ index 0000000000000000000000000000000000000000..7d86765bf229275ba55d37a452ef2483
+ "deps/uv/include/uv/linux.h",
+ "deps/uv/include/uv/os390.h",
+ "deps/uv/include/uv/posix.h",
+ "deps/uv/include/uv/stdint-msvc2008.h",
+ "deps/uv/include/uv/sunos.h",
+ "deps/uv/include/uv/threadpool.h",
+ "deps/uv/include/uv/tree.h",
@@ -2062,7 +2100,7 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index 88cc915177bcf8b86eb8f9f16b215cb6d06b3aa7..8df52c22dd76a850d421075effc44fbfb32307db 100644
index 7e90c796f3bd076048a2114a1ba31db7ee876440..60a17104e0b1b19038efc1a1468ee92642d3ffd6 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@

View File

@@ -26,10 +26,10 @@ index 0f5ddfb3ca21b7e5b38d0a4ce4b9e77387597199..ba815202fb157aa82859ec0518523cf6
.. c:function:: int uv_loop_close(uv_loop_t* loop)
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
index ee1c94ccd389915ea7572cce044256a7788025ad..d31abf714d5d1433ec8473ccb1aae3b6615c477a 100644
index 02397dd0fdd43d51f86c0dde9a62046702f12bdb..3375600023e39ddacf62cc17deb4f206db942084 100644
--- a/deps/uv/include/uv.h
+++ b/deps/uv/include/uv.h
@@ -252,7 +252,8 @@ typedef struct uv_statfs_s uv_statfs_t;
@@ -260,7 +260,8 @@ typedef struct uv_metrics_s uv_metrics_t;
typedef enum {
UV_LOOP_BLOCK_SIGNAL = 0,
@@ -40,7 +40,7 @@ index ee1c94ccd389915ea7572cce044256a7788025ad..d31abf714d5d1433ec8473ccb1aae3b6
typedef enum {
diff --git a/deps/uv/src/unix/async.c b/deps/uv/src/unix/async.c
index e1805c323795e5b0c465d80100eebeb7bf838caa..dd4358c0cdaa97ba8fadf4d9755993803beddd18 100644
index 0ff2669e30a628dbb2df9e28ba14b38cf14114e5..679b17bda476d2a9c072ce8261234f837b56422f 100644
--- a/deps/uv/src/unix/async.c
+++ b/deps/uv/src/unix/async.c
@@ -38,7 +38,6 @@
@@ -49,18 +49,18 @@ index e1805c323795e5b0c465d80100eebeb7bf838caa..dd4358c0cdaa97ba8fadf4d975599380
-static void uv__async_send(uv_loop_t* loop);
static int uv__async_start(uv_loop_t* loop);
static void uv__cpu_relax(void);
@@ -70,7 +69,7 @@ int uv_async_send(uv_async_t* handle) {
return 0;
@@ -78,7 +77,7 @@ int uv_async_send(uv_async_t* handle) {
/* Wake up the other thread's event loop. */
- uv__async_send(handle->loop);
+ uv__loop_interrupt(handle->loop);
if (atomic_exchange(pending, 1) == 0)
- uv__async_send(handle->loop);
+ uv__loop_interrupt(handle->loop);
/* Tell the other thread we're done. */
if (cmpxchgi(&handle->pending, 1, 2) != 1)
@@ -165,40 +164,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
/* Set the loop to not-busy. */
atomic_fetch_add(busy, -1);
@@ -178,40 +177,6 @@ static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
}
@@ -102,10 +102,10 @@ index e1805c323795e5b0c465d80100eebeb7bf838caa..dd4358c0cdaa97ba8fadf4d975599380
int pipefd[2];
int err;
diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c
index 54c769f37f2331136c87a37c13fb4e3f9a8f22f9..ac52ab79a5fc3050effd2b1f2f605cee9b1ab336 100644
index 25c5181f370e94983e8a5f797f02f7a8dc207e00..f4d9059796d2c65339a5d48ecb273b09d9364d21 100644
--- a/deps/uv/src/unix/core.c
+++ b/deps/uv/src/unix/core.c
@@ -900,6 +900,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
@@ -926,6 +926,9 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
loop->watchers[w->fd] = w;
loop->nfds++;
}
@@ -115,20 +115,20 @@ index 54c769f37f2331136c87a37c13fb4e3f9a8f22f9..ac52ab79a5fc3050effd2b1f2f605cee
}
@@ -931,6 +934,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
@@ -957,6 +960,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
}
else if (QUEUE_EMPTY(&w->watcher_queue))
QUEUE_INSERT_TAIL(&loop->watcher_queue, &w->watcher_queue);
else if (uv__queue_empty(&w->watcher_queue))
uv__queue_insert_tail(&loop->watcher_queue, &w->watcher_queue);
+
+ if (uv__get_internal_fields(loop)->flags & UV_LOOP_INTERRUPT_ON_IO_CHANGE)
+ uv__loop_interrupt(loop);
}
@@ -947,6 +953,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
@@ -973,6 +979,9 @@ void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
void uv__io_feed(uv_loop_t* loop, uv__io_t* w) {
if (QUEUE_EMPTY(&w->pending_queue))
QUEUE_INSERT_TAIL(&loop->pending_queue, &w->pending_queue);
if (uv__queue_empty(&w->pending_queue))
uv__queue_insert_tail(&loop->pending_queue, &w->pending_queue);
+
+ if (uv__get_internal_fields(loop)->flags & UV_LOOP_INTERRUPT_ON_IO_CHANGE)
+ uv__loop_interrupt(loop);
@@ -136,7 +136,7 @@ index 54c769f37f2331136c87a37c13fb4e3f9a8f22f9..ac52ab79a5fc3050effd2b1f2f605cee
diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c
index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..46fc03264b6cc1a3a4d8faf5ec5a754fc07c9b6d 100644
index a9468e8e19cbede795032980c47eb83aee1e0c68..2d28cf48efc3718de19b901b7e08b8a857d20740 100644
--- a/deps/uv/src/unix/loop.c
+++ b/deps/uv/src/unix/loop.c
@@ -217,6 +217,11 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
@@ -193,10 +193,10 @@ index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..46fc03264b6cc1a3a4d8faf5ec5a754f
+ abort();
+}
diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h
index 6001b0cf68d0b0268b578218b664a737f43c9521..5d2212571f4bcb648ab332f0c5650d0fdb37c03a 100644
index cd57e5a35153d0557351b60cce0c5be7a4468b60..660caef30b1637b8009de5e55ee34f48d17e4dd0 100644
--- a/deps/uv/src/uv-common.h
+++ b/deps/uv/src/uv-common.h
@@ -140,6 +140,8 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
@@ -144,6 +144,8 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
void uv__loop_close(uv_loop_t* loop);
@@ -205,7 +205,7 @@ index 6001b0cf68d0b0268b578218b664a737f43c9521..5d2212571f4bcb648ab332f0c5650d0f
int uv__read_start(uv_stream_t* stream,
uv_alloc_cb alloc_cb,
uv_read_cb read_cb);
@@ -268,6 +270,10 @@ void uv__threadpool_cleanup(void);
@@ -280,6 +282,10 @@ void uv__threadpool_cleanup(void);
if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \
(h)->flags |= UV_HANDLE_ACTIVE; \
if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \
@@ -217,7 +217,7 @@ index 6001b0cf68d0b0268b578218b664a737f43c9521..5d2212571f4bcb648ab332f0c5650d0f
while (0)
diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c
index 67af93e6571ed4324d80b6dfb2ff93db7b9cd9b1..e88008b6a288d1508c5c117d814000d63cab81c3 100644
index e9885a0f1ff3890a8d957c8793e22b01cedc0e97..ae3d09878253fe7169ad7b74b3faea0223f89de5 100644
--- a/deps/uv/src/win/core.c
+++ b/deps/uv/src/win/core.c
@@ -384,10 +384,20 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
@@ -242,7 +242,7 @@ index 67af93e6571ed4324d80b6dfb2ff93db7b9cd9b1..e88008b6a288d1508c5c117d814000d6
return -1;
}
diff --git a/deps/uv/test/test-embed.c b/deps/uv/test/test-embed.c
index 1d3355fdc67310feb63738c9e30724f0e77f7895..77a63dbb4d188b2ad571c814dbc6cbc6fe5fa205 100644
index bbe56e176db17a502d7f3864ba529212f553590a..b0da9d1cddc69428e9fb3379d1338cf893ab93d2 100644
--- a/deps/uv/test/test-embed.c
+++ b/deps/uv/test/test-embed.c
@@ -25,54 +25,184 @@
@@ -463,13 +463,13 @@ index 1d3355fdc67310feb63738c9e30724f0e77f7895..77a63dbb4d188b2ad571c814dbc6cbc6
+ run_loop();
+ ASSERT_EQ(main_timer_called, 1);
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h
index b19c10c7e40c77061337416fd623c53d0863d276..1f54ac21c36902bccb35c64cefa8bb14dd675bb0 100644
index 78ff9c2d1621676feab5d357609970cdf1ba5864..204160f324ad1a80c9b042e62c4bedcb745666ba 100644
--- a/deps/uv/test/test-list.h
+++ b/deps/uv/test/test-list.h
@@ -265,6 +265,7 @@ TEST_DECLARE (process_priority)
@@ -273,6 +273,7 @@ TEST_DECLARE (process_priority)
TEST_DECLARE (has_ref)
TEST_DECLARE (active)
TEST_DECLARE (embed)
@@ -477,7 +477,7 @@ index b19c10c7e40c77061337416fd623c53d0863d276..1f54ac21c36902bccb35c64cefa8bb14
TEST_DECLARE (async)
TEST_DECLARE (async_null_cb)
TEST_DECLARE (eintr_handling)
@@ -867,6 +868,7 @@ TASK_LIST_START
@@ -894,6 +895,7 @@ TASK_LIST_START
TEST_ENTRY (active)
TEST_ENTRY (embed)

View File

@@ -6,10 +6,10 @@ Subject: fix: suppress clang -Wdeprecated-declarations in libuv
Should be upstreamed.
diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c
index 99432053cc3b242e514268b7aba2e2d83a9e64f2..750a5424953aad104ba1e865fefd55d316485917 100644
index f6ec79cd57b5010ed5fd6829d952bcdacc8b7671..5cda078a55f7825d135a107fa98e1aa3527dd147 100644
--- a/deps/uv/src/win/util.c
+++ b/deps/uv/src/win/util.c
@@ -1743,10 +1743,17 @@ int uv_os_uname(uv_utsname_t* buffer) {
@@ -1685,10 +1685,17 @@ int uv_os_uname(uv_utsname_t* buffer) {
#ifdef _MSC_VER
#pragma warning(suppress : 4996)
#endif

View File

@@ -18,10 +18,10 @@ as launch more jobs or exit).
Fixes: https://github.com/JuliaLang/julia/issues/51461
diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c
index 24c633393fd15dcf87726b174d6b027a969e0f0d..4ad9fec900fa66b0e8c6894701e94f420de903a8 100644
index 3e451e2291d6ed200ec258e874becbbea22bbc27..a71a08bdd60166ef1d4ef490ff3e083b44188852 100644
--- a/deps/uv/src/win/process.c
+++ b/deps/uv/src/win/process.c
@@ -102,6 +102,21 @@ static void uv__init_global_job_handle(void) {
@@ -105,6 +105,21 @@ static void uv__init_global_job_handle(void) {
&info,
sizeof info))
uv_fatal_error(GetLastError(), "SetInformationJobObject");
@@ -43,7 +43,7 @@ index 24c633393fd15dcf87726b174d6b027a969e0f0d..4ad9fec900fa66b0e8c6894701e94f42
}
@@ -1098,6 +1113,7 @@ int uv_spawn(uv_loop_t* loop,
@@ -1102,6 +1117,7 @@ int uv_spawn(uv_loop_t* loop,
* breakaway.
*/
process_flags |= DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP;
@@ -51,7 +51,7 @@ index 24c633393fd15dcf87726b174d6b027a969e0f0d..4ad9fec900fa66b0e8c6894701e94f42
}
if (!CreateProcessW(application_path,
@@ -1115,11 +1131,6 @@ int uv_spawn(uv_loop_t* loop,
@@ -1119,11 +1135,6 @@ int uv_spawn(uv_loop_t* loop,
goto done;
}
@@ -63,7 +63,7 @@ index 24c633393fd15dcf87726b174d6b027a969e0f0d..4ad9fec900fa66b0e8c6894701e94f42
/* If the process isn't spawned as detached, assign to the global job object
* so windows will kill it when the parent process dies. */
if (!(options->flags & UV_PROCESS_DETACHED)) {
@@ -1142,6 +1153,19 @@ int uv_spawn(uv_loop_t* loop,
@@ -1146,6 +1157,19 @@ int uv_spawn(uv_loop_t* loop,
}
}

View File

@@ -4,5 +4,5 @@ fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch
feat_add_new_squirrel_mac_bundle_installation_method_behind_flag.patch
refactor_use_posix_spawn_instead_of_nstask_so_we_can_disclaim_the.patch
fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch
chore_disable_api_deprecation_warnings_in_nskeyedarchiver.patch
feat_add_ability_to_prevent_version_downgrades.patch
refactor_use_non-deprecated_nskeyedarchiver_apis.patch

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 22 Jun 2023 12:52:10 +0200
Subject: chore: disable API deprecation warnings in NSKeyedArchiver
This should be updated to use the newer APIs.
Upstream PR at https://github.com/Squirrel/Squirrel.Mac/pull/273
diff --git a/Squirrel/SQRLInstaller.m b/Squirrel/SQRLInstaller.m
index f502df2f88424ea902a061adfeb30358daf212e4..a18fedc3e47eb9c8bb7afc42aeab7cef3df742a3 100644
--- a/Squirrel/SQRLInstaller.m
+++ b/Squirrel/SQRLInstaller.m
@@ -182,14 +182,20 @@ - (SQRLInstallerOwnedBundle *)ownedBundle {
id archiveData = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost));
if (![archiveData isKindOfClass:NSData.class]) return nil;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchiveObjectWithData:archiveData];
if (![ownedBundle isKindOfClass:SQRLInstallerOwnedBundle.class]) return nil;
+#pragma clang diagnostic pop
return ownedBundle;
}
- (void)setOwnedBundle:(SQRLInstallerOwnedBundle *)ownedBundle {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSData *archiveData = (ownedBundle == nil ? nil : [NSKeyedArchiver archivedDataWithRootObject:ownedBundle]);
+#pragma clang diagnostic pop
CFPreferencesSetValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFPropertyListRef)archiveData, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost);
CFPreferencesSynchronize((__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost);
}

View File

@@ -1,50 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 22 Jun 2023 12:26:24 +0200
Subject: refactor: use non-deprecated NSKeyedArchiver APIs
Refs https://chromium-review.googlesource.com/c/chromium/src/+/4628901
Several NSKeyedArchiver methods have been deprecated and replaced as of macOS 10.13:
- unarchiveObjectWithData -> unarchivedObjectOfClass:fromData:error:
- archivedDataWithRootObject -> archivedDataWithRootObject:requiringSecureCoding:error:
diff --git a/Squirrel/SQRLInstaller.m b/Squirrel/SQRLInstaller.m
index f502df2f88424ea902a061adfeb30358daf212e4..8db6406ec7f0cb51140ea2ee39c04f91626f6e18 100644
--- a/Squirrel/SQRLInstaller.m
+++ b/Squirrel/SQRLInstaller.m
@@ -182,14 +182,30 @@ - (SQRLInstallerOwnedBundle *)ownedBundle {
id archiveData = CFBridgingRelease(CFPreferencesCopyValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost));
if (![archiveData isKindOfClass:NSData.class]) return nil;
- SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchiveObjectWithData:archiveData];
- if (![ownedBundle isKindOfClass:SQRLInstallerOwnedBundle.class]) return nil;
+ NSError *error;
+ SQRLInstallerOwnedBundle *ownedBundle = [NSKeyedUnarchiver unarchivedObjectOfClass:[SQRLInstallerOwnedBundle class]
+ fromData:archiveData
+ error:&error];
+ if (error) {
+ NSLog(@"Couldn't unarchive ownedBundle - %@", error.localizedDescription);
+ return nil;
+ }
return ownedBundle;
}
- (void)setOwnedBundle:(SQRLInstallerOwnedBundle *)ownedBundle {
- NSData *archiveData = (ownedBundle == nil ? nil : [NSKeyedArchiver archivedDataWithRootObject:ownedBundle]);
+ NSData *archiveData = nil;
+ if (ownedBundle != nil) {
+ NSError *error;
+ archiveData = [NSKeyedArchiver archivedDataWithRootObject:ownedBundle
+ requiringSecureCoding:NO
+ error:&error];
+
+ if (error)
+ NSLog(@"Couldn't archive ownedBundle - %@", error.localizedDescription);
+ }
+
CFPreferencesSetValue((__bridge CFStringRef)SQRLInstallerOwnedBundleKey, (__bridge CFPropertyListRef)archiveData, (__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost);
CFPreferencesSynchronize((__bridge CFStringRef)self.applicationIdentifier, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost);
}

View File

@@ -1,3 +1,4 @@
build_gn.patch
do_not_export_private_v8_symbols_on_windows.patch
fix_build_deprecated_attribute_for_older_msvc_versions.patch
chore_allow_customizing_microtask_policy_per_context.patch

View File

@@ -9,7 +9,7 @@ necessary for native modules to load.
Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip.
diff --git a/BUILD.gn b/BUILD.gn
index 52c9696e6afe89b584487d4a05e1b3680e856862..c7005f6774ea271ba27ea96bb3fe96010b36eeb2 100644
index 01159bc491a4a97bc0d8dd280f5871e9dc8d3dcd..4d0dd3c174bd8dff18f98506c062b595e88a0420 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -752,7 +752,7 @@ config("internal_config") {

View File

@@ -12,7 +12,7 @@ This patch can be safely removed if, when it is removed, `node.lib` does not
contain any standard C++ library exports (e.g. `std::ostringstream`).
diff --git a/BUILD.gn b/BUILD.gn
index c7005f6774ea271ba27ea96bb3fe96010b36eeb2..f0a0020e146cecbbae141a024695e945be362533 100644
index 4d0dd3c174bd8dff18f98506c062b595e88a0420..91856bfe8ef7f5107e9fe94a075f137db2c8ae37 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -752,6 +752,10 @@ config("internal_config") {

View File

@@ -0,0 +1,49 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Tue, 28 Jan 2020 15:48:03 -0800
Subject: fix: usage of c++ [[deprecated]] attribute for older msvc versions
This attribute can only be used in all contexts in Visual Studio 2019
diff --git a/include/v8config.h b/include/v8config.h
index 7995cfd35884acae3c9a9c38b6e3405910e2396e..435906ed4ba7342060274be6308905f4fdfa3d7e 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -541,10 +541,13 @@ path. Add it with -I<path> to the command line
# define V8_PRESERVE_MOST /* NOT SUPPORTED */
#endif
-
// A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
#if defined(V8_DEPRECATION_WARNINGS)
-# define V8_DEPRECATED(message) [[deprecated(message)]]
+# if !defined(__clang__) && defined(_MSC_VER) && _MSC_VER < 1920
+# define V8_DEPRECATED(message) __declspec(deprecated(message))
+# else
+# define V8_DEPRECATED(message) [[deprecated(message)]]
+# endif
#else
# define V8_DEPRECATED(message)
#endif
@@ -552,7 +555,11 @@ path. Add it with -I<path> to the command line
// A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated.
#if defined(V8_IMMINENT_DEPRECATION_WARNINGS)
-# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
+# if !defined(__clang__) && defined(_MSC_VER) && _MSC_VER < 1920
+# define V8_DEPRECATE_SOON(message) __declspec(deprecated(message))
+# else
+# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
+# endif
#else
# define V8_DEPRECATE_SOON(message)
#endif
@@ -586,7 +593,7 @@ path. Add it with -I<path> to the command line
END_ALLOW_USE_DEPRECATED()
-#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 6)
+#if !defined(__clang__) && (defined(__GNUC__) && __GNUC__ < 6) || (defined(_MSC_VER) && _MSC_VER < 1920)
# define V8_ENUM_DEPRECATED(message)
# define V8_ENUM_DEPRECATE_SOON(message)
#else

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import sys

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import sys

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from __future__ import print_function
import ast
import os
import pprint

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import sys

View File

@@ -6,6 +6,8 @@ Everything here should be project agnostic: it shouldn't rely on project's
structure, or make assumptions about the passed arguments or calls' outcomes.
"""
from __future__ import unicode_literals
import io
import os
import posixpath
@@ -227,6 +229,14 @@ def remove_patch_filename(patch):
force_keep_next_line = l.startswith('Subject: ')
def to_utf8(patch):
"""Python 2/3 compatibility: unicode has been renamed to str in Python3"""
if sys.version_info[0] >= 3:
return str(patch, "utf-8")
return unicode(patch, "utf-8")
def export_patches(repo, out_dir, patch_range=None, dry_run=False):
if not os.path.exists(repo):
sys.stderr.write(
@@ -253,7 +263,7 @@ def export_patches(repo, out_dir, patch_range=None, dry_run=False):
for patch in patches:
filename = get_file_name(patch)
filepath = posixpath.join(out_dir, filename)
existing_patch = str(io.open(filepath, 'rb').read(), 'utf-8')
existing_patch = to_utf8(io.open(filepath, 'rb').read())
formatted_patch = join_patch(patch)
if formatted_patch != existing_patch:
bad_patches.append(filename)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess
@@ -10,6 +10,11 @@ PYYAML_LIB_DIR = os.path.join(SRC_DIR, 'third_party', 'pyyaml', 'lib')
sys.path.append(PYYAML_LIB_DIR)
import yaml #pylint: disable=wrong-import-position,wrong-import-order
try:
basestring # Python 2
except NameError: # Python 3
basestring = str # pylint: disable=redefined-builtin
class Verbosity:
CHATTY = 'chatty' # stdout and stderr
@@ -143,7 +148,7 @@ class TestsList():
if isinstance(value, dict):
return value
if isinstance(value, str):
if isinstance(value, basestring):
return {value: None}
raise AssertionError("unexpected shorthand type: {}".format(type(value)))

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from __future__ import print_function
import contextlib
import errno
import json
@@ -7,7 +8,11 @@ import os
import shutil
import subprocess
import sys
from urllib.request import urlopen
# Python 3 / 2 compat import
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
import zipfile
# from lib.config import is_verbose_mode

View File

@@ -0,0 +1,3 @@
[
"shell_browser_ui_unittests"
]

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import sys

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import hashlib
import json
@@ -166,7 +168,13 @@ def main():
traceback.print_exc(file=sys.stderr)
return 0
elif args.operation == "set":
answer = input(
# Python 2/3 compatibility
try:
user_input = raw_input
except NameError:
user_input = input
answer = user_input(
"WARNING: Manually setting mtimes could mess up your build. "
"If you're sure, type yes: "
)

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from __future__ import print_function
import json
import os
import sys

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import datetime
import hashlib

View File

@@ -7,6 +7,8 @@ It runs over multiple files and directories in parallel.
A diff output is produced and a sensible exit code is returned.
"""
from __future__ import print_function, unicode_literals
import argparse
import codecs
import difflib

View File

@@ -15,6 +15,7 @@ const fail = '✗'.red;
const args = require('minimist')(process.argv, {
string: ['runners', 'target', 'electronVersion'],
boolean: ['buildNativeTests'],
unknown: arg => unknownFlags.push(arg)
});
@@ -34,7 +35,8 @@ const BASE = path.resolve(__dirname, '../..');
const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx';
const runners = new Map([
['main', { description: 'Main process specs', run: runMainProcessElectronTests }]
['main', { description: 'Main process specs', run: runMainProcessElectronTests }],
['native', { description: 'Native specs', run: runNativeElectronTests }]
]);
const specHashPath = path.resolve(__dirname, '../spec/.hash');
@@ -181,6 +183,57 @@ async function runTestUsingElectron (specDir, testName) {
console.log(`${pass} Electron ${testName} process tests passed.`);
}
async function runNativeElectronTests () {
let testTargets = require('./native-test-targets.json');
const outDir = `out/${utils.getOutDir()}`;
// If native tests are being run, only one arg would be relevant
if (args.target && !testTargets.includes(args.target)) {
console.log(`${fail} ${args.target} must be a subset of [${[testTargets].join(', ')}]`);
process.exit(1);
}
// Optionally build all native test targets
if (args.buildNativeTests) {
for (const target of testTargets) {
const build = childProcess.spawnSync('ninja', ['-C', outDir, target], {
cwd: path.resolve(__dirname, '../..'),
stdio: 'inherit'
});
// Exit if test target failed to build
if (build.status !== 0) {
console.log(`${fail} ${target} failed to build.`);
process.exit(1);
}
}
}
// If a specific target was passed, only build and run that target
if (args.target) testTargets = [args.target];
// Run test targets
const failures = [];
for (const target of testTargets) {
console.info('\nRunning native test for target:', target);
const testRun = childProcess.spawnSync(`./${outDir}/${target}`, {
cwd: path.resolve(__dirname, '../..'),
stdio: 'inherit'
});
// Collect failures and log at end
if (testRun.status !== 0) failures.push({ target });
}
// Exit if any failures
if (failures.length > 0) {
console.log(`${fail} Electron native tests failed for the following targets: `, failures);
process.exit(1);
}
console.log(`${pass} Electron native tests passed.`);
}
async function runMainProcessElectronTests () {
await runTestUsingElectron('spec', 'main');
}

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import sys

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import re

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import os
import platform

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import os

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from __future__ import print_function
import argparse
import glob
import os

View File

@@ -85,7 +85,6 @@
#if BUILDFLAG(IS_MAC)
#include <CoreFoundation/CoreFoundation.h>
#include "base/mac/mac_util.h"
#include "shell/browser/ui/cocoa/electron_bundle_mover.h"
#endif
@@ -365,11 +364,8 @@ struct Converter<Browser::LoginItemSettings> {
dict.Get("path", &(out->path));
dict.Get("args", &(out->args));
#if BUILDFLAG(IS_WIN)
dict.Get("name", &(out->name));
dict.Get("enabled", &(out->enabled));
#elif BUILDFLAG(IS_MAC)
dict.Get("serviceName", &(out->service_name));
dict.Get("type", &(out->type));
dict.Get("name", &(out->name));
#endif
return true;
}
@@ -377,19 +373,16 @@ struct Converter<Browser::LoginItemSettings> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
Browser::LoginItemSettings val) {
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
#if BUILDFLAG(IS_WIN)
dict.Set("launchItems", val.launch_items);
dict.Set("executableWillLaunchAtLogin",
val.executable_will_launch_at_login);
#elif BUILDFLAG(IS_MAC)
if (base::mac::MacOSMajorVersion() >= 13)
dict.Set("status", val.status);
#endif
dict.Set("openAtLogin", val.open_at_login);
dict.Set("openAsHidden", val.open_as_hidden);
dict.Set("restoreState", val.restore_state);
dict.Set("wasOpenedAtLogin", val.opened_at_login);
dict.Set("wasOpenedAsHidden", val.opened_as_hidden);
#if BUILDFLAG(IS_WIN)
dict.Set("launchItems", val.launch_items);
dict.Set("executableWillLaunchAtLogin",
val.executable_will_launch_at_login);
#endif
return dict.GetHandle();
}
};
@@ -842,6 +835,10 @@ void App::OnGpuInfoUpdate() {
Emit("gpu-info-update");
}
void App::OnGpuProcessCrashed() {
Emit("gpu-process-crashed", true);
}
void App::BrowserChildProcessLaunchedAndConnected(
const content::ChildProcessData& data) {
ChildProcessLaunched(data.process_type, data.id, data.GetProcess().Handle(),

View File

@@ -153,6 +153,7 @@ class App : public ElectronBrowserClient::Delegate,
// content::GpuDataManagerObserver:
void OnGpuInfoUpdate() override;
void OnGpuProcessCrashed() override;
// content::BrowserChildProcessObserver:
void BrowserChildProcessLaunchedAndConnected(

View File

@@ -45,6 +45,7 @@
#include "ui/display/util/edid_parser.h" // nogncheck
#include "ui/gfx/x/randr.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto_util.h"
#endif // defined(USE_OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_WIN)

View File

@@ -1870,7 +1870,7 @@ bool WebContents::EmitNavigationEvent(
dict.Set("url", url);
dict.Set("isSameDocument", is_same_document);
dict.Set("isMainFrame", is_main_frame);
dict.SetGetter("frame", frame_host);
dict.Set("frame", frame_host);
dict.SetGetter("initiator", initiator_frame_host);
EmitWithoutEvent(event_name, event, url, is_same_document, is_main_frame,

View File

@@ -135,11 +135,7 @@ class Browser : public WindowListObserver {
std::u16string path;
std::vector<std::u16string> args;
#if BUILDFLAG(IS_MAC)
std::string type = "mainAppService";
std::string service_name;
std::string status;
#elif BUILDFLAG(IS_WIN)
#if BUILDFLAG(IS_WIN)
// used in browser::setLoginItemSettings
bool enabled = true;
std::wstring name;
@@ -209,9 +205,9 @@ class Browser : public WindowListObserver {
void ApplyForcedRTL();
// Bounce the dock icon.
enum class BounceType{
kCritical = 0, // NSCriticalRequest
kInformational = 10, // NSInformationalRequest
enum class BounceType {
kCritical = 0, // NSCriticalRequest
kInformational = 10, // NSInformationalRequest
};
int DockBounce(BounceType type);
void DockCancelBounce(int request_id);

View File

@@ -8,8 +8,6 @@
#include <string>
#include <utility>
#import <ServiceManagement/ServiceManagement.h>
#include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
#include "base/apple/scoped_cftyperef.h"
@@ -21,7 +19,6 @@
#include "chrome/browser/browser_process.h"
#include "net/base/mac/url_conversions.h"
#include "shell/browser/badging/badge_manager.h"
#include "shell/browser/javascript_environment.h"
#include "shell/browser/mac/dict_util.h"
#include "shell/browser/mac/electron_application.h"
#include "shell/browser/mac/electron_application_delegate.h"
@@ -88,15 +85,6 @@ bool CheckLoginItemStatus(bool* is_hidden) {
return true;
}
Browser::LoginItemSettings GetLoginItemSettingsDeprecated() {
Browser::LoginItemSettings settings;
settings.open_at_login = CheckLoginItemStatus(&settings.open_as_hidden);
settings.restore_state = base::mac::WasLaunchedAsLoginItemRestoreState();
settings.opened_at_login = base::mac::WasLaunchedAsLoginOrResumeItem();
settings.opened_as_hidden = base::mac::WasLaunchedAsHiddenLoginItem();
return settings;
}
#endif
} // namespace
@@ -379,71 +367,28 @@ void Browser::ApplyForcedRTL() {
Browser::LoginItemSettings Browser::GetLoginItemSettings(
const LoginItemSettings& options) {
LoginItemSettings settings;
if (options.type != "mainAppService" && options.service_name.empty()) {
gin_helper::ErrorThrower(JavascriptEnvironment::GetIsolate())
.ThrowTypeError("'name' is required when type is not mainAppService");
return settings;
}
#if IS_MAS_BUILD()
const std::string status =
platform_util::GetLoginItemEnabled(options.type, options.service_name);
settings.open_at_login =
status == "enabled" || status == "enabled-deprecated";
if (@available(macOS 13, *))
settings.status = status;
settings.open_at_login = platform_util::GetLoginItemEnabled();
#else
// If the app was previously set as a LoginItem with the deprecated API,
// we should report its LoginItemSettings via the old API.
LoginItemSettings settings_deprecated = GetLoginItemSettingsDeprecated();
if (@available(macOS 13, *)) {
const std::string status =
platform_util::GetLoginItemEnabled(options.type, options.service_name);
if (status == "enabled-deprecated") {
settings = settings_deprecated;
} else {
settings.open_at_login = status == "enabled";
settings.status = status;
}
} else {
settings = settings_deprecated;
}
settings.open_at_login = CheckLoginItemStatus(&settings.open_as_hidden);
settings.restore_state = base::mac::WasLaunchedAsLoginItemRestoreState();
settings.opened_at_login = base::mac::WasLaunchedAsLoginOrResumeItem();
settings.opened_as_hidden = base::mac::WasLaunchedAsHiddenLoginItem();
#endif
return settings;
}
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
if (settings.type != "mainAppService" && settings.service_name.empty()) {
gin_helper::ErrorThrower(JavascriptEnvironment::GetIsolate())
.ThrowTypeError("'name' is required when type is not mainAppService");
return;
}
#if IS_MAS_BUILD()
platform_util::SetLoginItemEnabled(settings.type, settings.service_name,
settings.open_at_login);
if (!platform_util::SetLoginItemEnabled(settings.open_at_login)) {
LOG(ERROR) << "Unable to set login item enabled on sandboxed app.";
}
#else
const base::FilePath bundle_path = base::apple::MainBundlePath();
if (@available(macOS 13, *)) {
// If the app was previously set as a LoginItem with the old API, remove it
// as a LoginItem via the old API before re-enabling with the new API.
const std::string status =
platform_util::GetLoginItemEnabled("mainAppService", "");
if (status == "enabled-deprecated") {
base::mac::RemoveFromLoginItems(bundle_path);
if (settings.open_at_login) {
platform_util::SetLoginItemEnabled(settings.type, settings.service_name,
settings.open_at_login);
}
} else {
platform_util::SetLoginItemEnabled(settings.type, settings.service_name,
settings.open_at_login);
}
if (settings.open_at_login) {
base::mac::AddToLoginItems(base::apple::MainBundlePath(),
settings.open_as_hidden);
} else {
if (settings.open_at_login) {
base::mac::AddToLoginItems(bundle_path, settings.open_as_hidden);
} else {
base::mac::RemoveFromLoginItems(bundle_path);
}
base::mac::RemoveFromLoginItems(base::apple::MainBundlePath());
}
#endif
}

View File

@@ -198,12 +198,4 @@ static NSDictionary* UNNotificationResponseToNSDictionary(
}
}
// This only has an effect on macOS 12+, and requests any state restoration
// archive to be created with secure encoding. See the article at
// https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/
// for more details.
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app {
return YES;
}
@end

View File

@@ -73,10 +73,10 @@
#include "shell/browser/ui/x/event_disabler.h"
#include "shell/browser/ui/x/x_window_utils.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/shape.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_util.h"
#endif
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -372,12 +372,10 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_MODAL"));
}
if (!state_atom_list.empty()) {
auto* connection = x11::Connection::Get();
connection->SetArrayProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), x11::Atom::ATOM, state_atom_list);
}
if (!state_atom_list.empty())
SetArrayProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), x11::Atom::ATOM,
state_atom_list);
// Set the _NET_WM_WINDOW_TYPE.
if (!window_type.empty())
@@ -484,10 +482,9 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) {
#if defined(USE_OZONE_PLATFORM_X11)
if (IsX11()) {
const std::string color = use_dark_theme ? "dark" : "light";
auto* connection = x11::Connection::Get();
connection->SetStringProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_GTK_THEME_VARIANT"), x11::GetAtom("UTF8_STRING"), color);
x11::SetStringProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_GTK_THEME_VARIANT"),
x11::GetAtom("UTF8_STRING"), color);
}
#endif
}
@@ -1399,14 +1396,12 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
NativeWindow::SetParentWindow(parent);
#if defined(USE_OZONE_PLATFORM_X11)
if (IsX11()) {
auto* connection = x11::Connection::Get();
connection->SetProperty(
if (IsX11())
x11::SetProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::Atom::WM_TRANSIENT_FOR, x11::Atom::WINDOW,
parent ? static_cast<x11::Window>(parent->GetAcceleratedWidget())
: ui::GetX11RootWindow());
}
#elif BUILDFLAG(IS_WIN)
// To set parentship between windows into Windows is better to play with the
// owner instead of the parent, as Windows natively seems to do if a parent
@@ -1521,10 +1516,8 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() {
// determine whether the current window is visible on all workspaces.
x11::Atom sticky_atom = x11::GetAtom("_NET_WM_STATE_STICKY");
std::vector<x11::Atom> wm_states;
auto* connection = x11::Connection::Get();
connection->GetArrayProperty(
static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), &wm_states);
GetArrayProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
x11::GetAtom("_NET_WM_STATE"), &wm_states);
return base::Contains(wm_states, sticky_atom);
}
#endif

View File

@@ -13,9 +13,9 @@
#include "dbus/object_proxy.h"
#include "shell/common/thread_restrictions.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto.h"
#include "ui/gfx/x/xproto_util.h"
namespace electron {
@@ -29,9 +29,8 @@ void SetWMSpecState(x11::Window window, bool enabled, x11::Atom state) {
void SetWindowType(x11::Window window, const std::string& type) {
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
x11::Atom window_type = x11::GetAtom(type_prefix + base::ToUpperASCII(type));
auto* connection = x11::Connection::Get();
connection->SetProperty(window, x11::GetAtom("_NET_WM_WINDOW_TYPE"),
x11::Atom::ATOM, window_type);
x11::SetProperty(window, x11::GetAtom("_NET_WM_WINDOW_TYPE"), x11::Atom::ATOM,
window_type);
}
bool ShouldUseGlobalMenuBar() {

View File

@@ -49,11 +49,8 @@ bool GetFolderPath(int key, base::FilePath* result);
#endif
#if BUILDFLAG(IS_MAC)
std::string GetLoginItemEnabled(const std::string& type,
const std::string& service_name);
bool SetLoginItemEnabled(const std::string& type,
const std::string& service_name,
bool enabled);
bool GetLoginItemEnabled();
bool SetLoginItemEnabled(bool enabled);
#endif
#if BUILDFLAG(IS_LINUX)

View File

@@ -77,81 +77,6 @@ std::string OpenPathOnThread(const base::FilePath& full_path) {
return success ? "" : "Failed to open path";
}
// https://developer.apple.com/documentation/servicemanagement/1561515-service_management_errors?language=objc
std::string GetLaunchStringForError(NSError* error) {
if (@available(macOS 13, *)) {
switch ([error code]) {
case kSMErrorAlreadyRegistered:
return "The application is already registered";
case kSMErrorAuthorizationFailure:
return "The authorization requested failed";
case kSMErrorLaunchDeniedByUser:
return "The user denied the app's launch request";
case kSMErrorInternalFailure:
return "An internal failure has occurred";
case kSMErrorInvalidPlist:
return "The app's property list is invalid";
case kSMErrorInvalidSignature:
return "The app's code signature doesn't meet the requirements to "
"perform the operation";
case kSMErrorJobMustBeEnabled:
return "The specified job is not enabled";
case kSMErrorJobNotFound:
return "The system can't find the specified job";
case kSMErrorJobPlistNotFound:
return "The app's property list cannot be found";
case kSMErrorServiceUnavailable:
return "The service necessary to perform this operation is unavailable "
"or is no longer accepting requests";
case kSMErrorToolNotValid:
return "The specified path doesn't exist or the helper tool at the "
"specified path isn't valid";
default:
return "Failed to register the login item";
}
}
return "";
}
SMAppService* GetServiceForType(const std::string& type,
const std::string& name)
API_AVAILABLE(macosx(13.0)) {
NSString* service_name = [NSString stringWithUTF8String:name.c_str()];
if (type == "mainAppService") {
return [SMAppService mainAppService];
} else if (type == "agentService") {
return [SMAppService agentServiceWithPlistName:service_name];
} else if (type == "daemonService") {
return [SMAppService daemonServiceWithPlistName:service_name];
} else if (type == "loginService") {
return [SMAppService loginItemServiceWithIdentifier:service_name];
} else {
LOG(ERROR) << "Unrecognized login item type";
return nullptr;
}
}
bool GetLoginItemEnabledDeprecated() {
BOOL enabled = NO;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// SMJobCopyDictionary does not work in sandbox (see rdar://13626319)
CFArrayRef jobs = SMCopyAllJobDictionaries(kSMDomainUserLaunchd);
#pragma clang diagnostic pop
NSArray* jobs_ = CFBridgingRelease(jobs);
NSString* identifier = GetLoginHelperBundleIdentifier();
if (jobs_ && [jobs_ count] > 0) {
for (NSDictionary* job in jobs_) {
if ([identifier isEqualToString:[job objectForKey:@"Label"]]) {
enabled = [[job objectForKey:@"OnDemand"] boolValue];
break;
}
}
}
return enabled;
}
} // namespace
namespace platform_util {
@@ -242,50 +167,29 @@ void Beep() {
NSBeep();
}
std::string GetLoginItemEnabled(const std::string& type,
const std::string& service_name) {
bool enabled = GetLoginItemEnabledDeprecated();
if (@available(macOS 13, *)) {
SMAppService* service = GetServiceForType(type, service_name);
SMAppServiceStatus status = [service status];
if (status == SMAppServiceStatusNotRegistered)
return "not-registered";
else if (status == SMAppServiceStatusEnabled)
return "enabled";
else if (status == SMAppServiceStatusRequiresApproval)
return "requires-approval";
else if (status == SMAppServiceStatusNotFound) {
// If the login item was enabled with the old API, return that.
return enabled ? "enabled-deprecated" : "not-found";
bool GetLoginItemEnabled() {
BOOL enabled = NO;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// SMJobCopyDictionary does not work in sandbox (see rdar://13626319)
CFArrayRef jobs = SMCopyAllJobDictionaries(kSMDomainUserLaunchd);
#pragma clang diagnostic pop
NSArray* jobs_ = CFBridgingRelease(jobs);
NSString* identifier = GetLoginHelperBundleIdentifier();
if (jobs_ && [jobs_ count] > 0) {
for (NSDictionary* job in jobs_) {
if ([identifier isEqualToString:[job objectForKey:@"Label"]]) {
enabled = [[job objectForKey:@"OnDemand"] boolValue];
break;
}
}
}
return enabled ? "enabled" : "not-registered";
return enabled;
}
bool SetLoginItemEnabled(const std::string& type,
const std::string& service_name,
bool enabled) {
if (@available(macOS 13, *)) {
#if IS_MAS_BUILD()
// If the app was previously set as a LoginItem with the old API, remove it
// as a LoginItem via the old API before re-enabling with the new API.
if (GetLoginItemEnabledDeprecated() && enabled) {
NSString* identifier = GetLoginHelperBundleIdentifier();
SMLoginItemSetEnabled((__bridge CFStringRef)identifier, false);
}
#endif
SMAppService* service = GetServiceForType(type, service_name);
NSError* error = nil;
bool result = enabled ? [service registerAndReturnError:&error]
: [service unregisterAndReturnError:&error];
if (error != nil)
LOG(ERROR) << "Unable to set login item: "
<< GetLaunchStringForError(error);
return result;
} else {
NSString* identifier = GetLoginHelperBundleIdentifier();
return SMLoginItemSetEnabled((__bridge CFStringRef)identifier, enabled);
}
bool SetLoginItemEnabled(bool enabled) {
NSString* identifier = GetLoginHelperBundleIdentifier();
return SMLoginItemSetEnabled((__bridge CFStringRef)identifier, enabled);
}
} // namespace platform_util

View File

@@ -9,9 +9,9 @@ import { promisify } from 'node:util';
import { app, BrowserWindow, Menu, session, net as electronNet, WebContents } from 'electron/main';
import { closeWindow, closeAllWindows } from './lib/window-helpers';
import { ifdescribe, ifit, listen, waitUntil } from './lib/spec-helpers';
import { expectDeprecationMessages } from './lib/deprecate-helpers';
import { once } from 'node:events';
import split = require('split')
import * as semver from 'semver';
const fixturesPath = path.resolve(__dirname, 'fixtures');
@@ -527,6 +527,27 @@ describe('app module', () => {
expect(webContents.id).to.equal(w.webContents.id);
});
// FIXME: re-enable this test on win32.
ifit(process.platform !== 'win32')('should emit renderer-process-crashed event when renderer crashes', async () => {
w = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
await w.loadURL('about:blank');
expectDeprecationMessages(async () => {
const emitted = once(app, 'renderer-process-crashed') as Promise<[any, WebContents, boolean]>;
w.webContents.executeJavaScript('process.crash()');
const [, webContents, killed] = await emitted;
expect(webContents).to.equal(w.webContents);
expect(killed).to.be.false();
}, '\'renderer-process-crashed event\' is deprecated and will be removed. Please use \'render-process-gone event\' instead.');
});
// FIXME: re-enable this test on win32.
ifit(process.platform !== 'win32')('should emit render-process-gone event when renderer crashes', async () => {
w = new BrowserWindow({
@@ -595,9 +616,6 @@ describe('app module', () => {
});
ifdescribe(process.platform !== 'linux' && !process.mas)('app.get/setLoginItemSettings API', function () {
const isMac = process.platform === 'darwin';
const isWin = process.platform === 'win32';
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
const processStartArgs = [
'--processStart', `"${path.basename(process.execPath)}"`,
@@ -613,8 +631,6 @@ describe('app module', () => {
'/f',
'/d'
];
const productVersion = isMac ? cp.execSync('sw_vers -productVersion').toString().trim() : '';
const isVenturaOrHigher = semver.gt(semver.coerce(productVersion) || '0.0.0', '13.0.0');
beforeEach(() => {
app.setLoginItemSettings({ openAtLogin: false });
@@ -628,19 +644,18 @@ describe('app module', () => {
app.setLoginItemSettings({ name: 'additionalEntry', openAtLogin: false });
});
ifit(!isWin)('sets and returns the app as a login item', () => {
ifit(process.platform !== 'win32')('sets and returns the app as a login item', function () {
app.setLoginItemSettings({ openAtLogin: true });
const settings = app.getLoginItemSettings();
expect(settings.openAtLogin).to.equal(true);
expect(settings.openAsHidden).to.equal(false);
expect(settings.wasOpenedAtLogin).to.equal(false);
expect(settings.wasOpenedAsHidden).to.equal(false);
expect(settings.restoreState).to.equal(false);
if (isVenturaOrHigher) expect(settings.status).to.equal('enabled');
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
openAsHidden: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false
});
});
ifit(isWin)('sets and returns the app as a login item (windows)', () => {
ifit(process.platform === 'win32')('sets and returns the app as a login item (windows)', function () {
app.setLoginItemSettings({ openAtLogin: true, enabled: true });
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
@@ -677,21 +692,18 @@ describe('app module', () => {
});
});
ifit(!isWin)('adds a login item that loads in hidden mode', () => {
ifit(process.platform !== 'win32')('adds a login item that loads in hidden mode', function () {
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true });
const settings = app.getLoginItemSettings();
expect(settings.openAtLogin).to.equal(true);
const hasOpenAsHidden = process.platform === 'darwin' && !isVenturaOrHigher;
expect(settings.openAsHidden).to.equal(hasOpenAsHidden);
expect(settings.wasOpenedAtLogin).to.equal(false);
expect(settings.wasOpenedAsHidden).to.equal(false);
expect(settings.restoreState).to.equal(false);
if (isVenturaOrHigher) expect(settings.status).to.equal('enabled');
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
openAsHidden: process.platform === 'darwin' && !process.mas, // Only available on macOS
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false
});
});
ifit(isWin)('adds a login item that loads in hidden mode (windows)', () => {
ifit(process.platform === 'win32')('adds a login item that loads in hidden mode (windows)', function () {
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true });
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
@@ -710,7 +722,7 @@ describe('app module', () => {
});
});
it('correctly sets and unsets the LoginItem', () => {
it('correctly sets and unsets the LoginItem', function () {
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
app.setLoginItemSettings({ openAtLogin: true });
@@ -720,76 +732,20 @@ describe('app module', () => {
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
});
ifit(isMac)('correctly sets and unsets the LoginItem as hidden', () => {
ifit(process.platform === 'darwin')('correctly sets and unsets the LoginItem as hidden', function () {
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
expect(app.getLoginItemSettings().openAsHidden).to.equal(false);
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true });
expect(app.getLoginItemSettings().openAtLogin).to.equal(true);
expect(app.getLoginItemSettings().openAsHidden).to.equal(!isVenturaOrHigher);
expect(app.getLoginItemSettings().openAsHidden).to.equal(true);
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: false });
expect(app.getLoginItemSettings().openAtLogin).to.equal(true);
expect(app.getLoginItemSettings().openAsHidden).to.equal(false);
});
ifdescribe(isMac)('using SMAppService', () => {
ifit(isVenturaOrHigher)('can set a login item', () => {
app.setLoginItemSettings({
openAtLogin: true,
type: 'mainAppService'
});
expect(app.getLoginItemSettings()).to.deep.equal({
status: 'enabled',
openAtLogin: true,
openAsHidden: false,
restoreState: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false
});
});
ifit(isVenturaOrHigher)('throws when setting non-default type with no name', () => {
expect(() => {
app.setLoginItemSettings({
openAtLogin: true,
type: 'daemonService'
});
}).to.throw(/'name' is required when type is not mainAppService/);
});
ifit(isVenturaOrHigher)('throws when getting non-default type with no name', () => {
expect(() => {
app.getLoginItemSettings({
type: 'daemonService'
});
}).to.throw(/'name' is required when type is not mainAppService/);
});
ifit(isVenturaOrHigher)('can unset a login item', () => {
app.setLoginItemSettings({
openAtLogin: true,
type: 'mainAppService'
});
app.setLoginItemSettings({
openAtLogin: false,
type: 'mainAppService'
});
expect(app.getLoginItemSettings()).to.deep.equal({
status: 'not-registered',
openAtLogin: false,
openAsHidden: false,
restoreState: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false
});
});
});
ifit(isWin)('allows you to pass a custom executable and arguments', () => {
ifit(process.platform === 'win32')('allows you to pass a custom executable and arguments', function () {
app.setLoginItemSettings({ openAtLogin: true, path: updateExe, args: processStartArgs, enabled: true });
expect(app.getLoginItemSettings().openAtLogin).to.equal(false);
const openAtLoginTrueEnabledTrue = app.getLoginItemSettings({
@@ -819,7 +775,7 @@ describe('app module', () => {
expect(openAtLoginFalseEnabledFalse.executableWillLaunchAtLogin).to.equal(false);
});
ifit(isWin)('allows you to pass a custom name', () => {
ifit(process.platform === 'win32')('allows you to pass a custom name', function () {
app.setLoginItemSettings({ openAtLogin: true });
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', enabled: false });
expect(app.getLoginItemSettings()).to.deep.equal({
@@ -862,7 +818,7 @@ describe('app module', () => {
});
});
ifit(isWin)('finds launch items independent of args', () => {
ifit(process.platform === 'win32')('finds launch items independent of args', function () {
app.setLoginItemSettings({ openAtLogin: true, args: ['arg1'] });
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', enabled: false, args: ['arg2'] });
expect(app.getLoginItemSettings()).to.deep.equal({
@@ -888,7 +844,7 @@ describe('app module', () => {
});
});
ifit(isWin)('finds launch items independent of path quotation or casing', () => {
ifit(process.platform === 'win32')('finds launch items independent of path quotation or casing', function () {
const expectation = {
openAtLogin: false,
openAsHidden: false,
@@ -924,7 +880,7 @@ describe('app module', () => {
});
});
ifit(isWin)('detects disabled by TaskManager', async () => {
ifit(process.platform === 'win32')('detects disabled by TaskManager', async function () {
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', enabled: true, args: ['arg1'] });
const appProcess = cp.spawn('reg', [...regAddArgs, '030000000000000000000000']);
await once(appProcess, 'exit');
@@ -945,7 +901,7 @@ describe('app module', () => {
});
});
ifit(isWin)('detects enabled by TaskManager', async () => {
ifit(process.platform === 'win32')('detects enabled by TaskManager', async function () {
const expectation = {
openAtLogin: false,
openAsHidden: false,

Some files were not shown because too many files have changed in this diff Show More