Compare commits

...

88 Commits

Author SHA1 Message Date
trop[bot]
6a5bd8dc28 chore: process.mainModule -> require.main (#38477)
chore: process.mainModule -> require.main

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-29 09:42:50 -04:00
trop[bot]
b78c30a6d8 build: make ReactiveObjC/Mantle deps format consistent (#38480)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-29 09:41:56 -04:00
trop[bot]
9ecd8910de fix: Windows FrameView always appearing inactive (#38473)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-28 20:41:03 -04:00
electron-roller[bot]
da87a471fe chore: bump chromium to 114.0.5735.45 (25-x-y) (#38447)
* chore: bump chromium in DEPS to 114.0.5735.45

* 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-05-25 12:14:56 -04:00
trop[bot]
6544df1992 build: upgrade @electron/github-app-auth to 2.0.0 (#38446)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-05-25 11:14:32 -04:00
trop[bot]
c9f7ebf821 docs: ensure app.md examples are runnable (#38440)
docs: ensure app.md examples are runnable

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-25 09:58:39 +02:00
trop[bot]
d3a0a255b1 build: fix build with "enable_pdf_viewer=false" (#38436)
* build: fix build with "enable_pdf_viewer=false"

Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>

* fixup! build: fix build with "enable_pdf_viewer=false"

Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>
2023-05-24 16:40:21 -04:00
trop[bot]
2d3819e2a8 fix: MediaDevices missing DisplayMediaInformation (#38433)
fix: MediaDevices missing DisplayMediaInformation

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-24 19:15:32 +02:00
trop[bot]
bd384b5301 build: update yarn.lock (#38427)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-05-24 11:15:05 -04:00
David Sanders
1e13475e89 build: disable v8 builtins pgo (#38281)
* build: disable v8 builtins pgo (#38252)

* Revert "build: revert builtins PGO logging file changes (#38235)"

This reverts commit a0e6ca8dab.

---------

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2023-05-23 21:52:24 -04:00
trop[bot]
8ce23c425d docs: fix typing of message box type value (#38352)
* docs: fix typing of dialog type value

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

* test: add smoke tests

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

* test: update test

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-05-23 13:17:32 +02:00
John Kleinschmidt
c891980848 build: fixup patches (#38400) 2023-05-22 16:30:21 -04:00
trop[bot]
15f4e8ef88 docs: disablewebsecurity on webview-tag can not be changed for an active session (#38398)
disablewebsecurity on webview-tag can not be changed for an active session

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kilian Valkhof <kilian@kilianvalkhof.com>
2023-05-22 15:19:39 -04:00
electron-roller[bot]
b6b4971da0 chore: bump chromium to 114.0.5735.35 (25-x-y) (#38320)
* chore: bump chromium in DEPS to 114.0.5735.26

* chore: update patches

* chore: bump chromium in DEPS to 114.0.5735.35

* chore: update patches

* refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr()

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

This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit.

(cherry picked from commit 3f3ab39e3a1077f71aa90319d7a81d53cfb3c55e)

---------

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>
2023-05-22 10:50:48 -04:00
trop[bot]
14918767d8 fix: linker error missing uv__strtok (#38393)
fix: linker error missing uv__strtok

This symbol is referenced inside what seems to be dead code
in `uv__search_path` in third_party/electron_node/deps/uv/src/unix/core.c
When compiling in LTO mode, the reference is removed,
but not during a non-LTO build.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Bruno Pitrus <brunopitrus@hotmail.com>
2023-05-22 16:18:10 +02:00
Keeley Hammond
f7a16f33a8 chore: cherry-pick 8 changes from Release-1-M113 (#38329)
* chore: [25-x-y] cherry-pick 8 changes from Release-1-M113

* 91fce3345668 from v8
* 2c8a019f39d2 from v8
* b8020e1973d7 from v8
* d6272b794cbb from chromium
* 48785f698b1c from chromium
* d0ee0197ddff from angle
* 9b6ca211234b from chromium
* 675562695049 from chromium

* chore: update patches

* chore: check test failure

* build: revert patch causing test failures

---------

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-05-22 20:01:49 +09:00
Shelley Vohr
662fa261da feat: support Mica/Acrylic on Windows (#38357) 2023-05-22 11:39:59 +02:00
trop[bot]
8ceb20c75c docs: fix devtools-open-url ts definition (#38353)
docs: fix devtools-open-url ts definition

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-22 09:59:40 +02:00
trop[bot]
e0e824f069 build: use @octokit/request v6.2.4 (#38379)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-19 12:05:27 -07:00
trop[bot]
ab0a13eed6 feat: emit context-menu event from extensions (#38356)
feat: emit context-menu event from extensions

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-18 16:58:40 -04:00
trop[bot]
7910ace135 feat: surface more webContents text selection commands (#38362)
* feat: surface more text selection commands

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

* refactor: use options argument

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

* docs: correct for 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-05-18 16:55:34 -04:00
trop[bot]
eb8eb6fae2 chore: implement WebContentsDelegate::GetFullscreenState (#38355)
chore: implement WebContentsDelegate::GetFullscreenState

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-18 16:54:38 -04:00
trop[bot]
c9bea8b712 feat: add missing 'cursor-changed' type values (#38363)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-18 12:15:31 -04:00
trop[bot]
71ee04a3e2 build: modify gclient.py with unified patch (#38359)
* build: modify gclient.py with unified patch

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

* ci: ensure depot_tools does not update

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

* ci: move auto-update disable outside if

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-05-17 16:38:02 -04:00
trop[bot]
f7f55d096a fix: getNormalBounds() for transparent windows on Windows (#38348)
fix: getNormalBounds for transparent windows on Windows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-17 15:57:08 +02:00
trop[bot]
ad6155f08e fix: win.isMaximized() for transparent windows on Windows (#38345)
fix: win.isMaximized() for transparent windows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-17 13:14:42 +02:00
trop[bot]
37caca046f chore: cherry-pick e6e23ba00379 from chromium (#38333)
* chore: cherry-pick e6e23ba00379 from chromium

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

* make it work

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

* build: remove incorrectly cherry-picked patch

* chore: update patches

---------

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: Samuel Attard <marshallofsound@electronjs.org>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-05-17 10:20:25 +02:00
trop[bot]
ea6a8eea22 fix: unify BrowserWindow.isVisible() logic cross-platform (#38314)
fix: unify BrowserWindow.isVisible() logic cross-platform

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-16 11:15:41 -04:00
trop[bot]
d314b4e18b build: bump brew cache to v6 (#38318)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-16 11:08:26 -04:00
trop[bot]
1bc8549ce5 fix: enable BrowserWindow.id access post-destruction (#38311)
fix: enable BrowserWindow id access post-destruction

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-16 12:04:53 +02:00
trop[bot]
8e6c8cc384 fix: isMaximized after minimize/fullscreen on macOS (#38307)
fix: isMaximized after isMinimized on macOS

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-16 11:47:23 +02:00
David Sanders
5c13da7c40 test: prewarm Node headers cache if specifying Electron version (#38297) 2023-05-16 09:38:59 +02:00
David Sanders
45a5827e09 chore: fix lint:js-in-markdown script (#38300)
chore: fix lint:js-in-markdown script (#38260)
2023-05-15 19:26:58 -04:00
trop[bot]
e809a5a043 build: drop python2 from CI (#38304)
* build: drop python2 from CI

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

* python3

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

* python3 uses linux not linux2

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

---------

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: Samuel Attard <sam@electronjs.org>
2023-05-15 19:18:31 -04:00
David Sanders
4f2e369bdc chore: migrate to @electron/lint-roller for Markdown linting (#38280)
chore: migrate to @electron/lint-roller for Markdown linting (#38191)
2023-05-14 15:01:04 +02:00
Samuel Attard
eef9787c48 build: fix octokit resolution with patch-package 2023-05-10 03:47:44 -07:00
Samuel Attard
81fe8993ec build: fix octokit resolution 2023-05-10 03:24:45 -07:00
Keeley Hammond
55b5c85f92 build: handle duplex option for Node 18 MacOS upload (#38237)
* build: handle duplex option for Node 18 upload

* build: remove patch-package, pin sha fix
2023-05-09 22:19:44 -07:00
Keeley Hammond
a0e6ca8dab build: revert builtins PGO logging file changes (#38235)
* build: revert builtins PGO error for release builds

* build: warn instead of aborting on bad profile
2023-05-09 14:50:41 -07:00
Shelley Vohr
e30b25269d fix: printing crash when settings invalid (#38230)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2023-05-09 12:16:03 -04:00
Shelley Vohr
319d77a4ee docs: fix typing of session.setDevicePermissionHandler (#38229)
docs: fix typing of session.setDevicePermissionHandler

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-05-09 12:08:17 -04:00
Shelley Vohr
e22767b1e7 docs: update dead link to Apple Human Interface notification guidelines (#38226)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: astone123 <adams@cypress.io>
2023-05-09 12:06:32 -04:00
Shelley Vohr
5008e3ecab fix: handle AXManualAccessibility attribute cross-protocol (#38223)
fix: handle `AXManualAccessibility` attribute cross-protocol (#38142)

* fix: handle AXManualAccessibility attribute cross-protocol

* Update shell/browser/mac/electron_application.mm



---------

Co-authored-by: Robo <hop2deep@gmail.com>
2023-05-09 12:04:00 -04:00
Shelley Vohr
d69776bfb0 chore: stop using a RenderWidgetHost observer in FileSelectHelper (#38222)
chore: stop using a `RenderWidgetHost` observer in `FileSelectHelper` (#38168)

chore: stop using a RenderWidgetHost observer in FileSelectHelper
2023-05-09 12:03:30 -04:00
Shelley Vohr
b56e4287d3 refactor: remove IPC from mouse_util (#38220)
refactor: remove IPC from mouse_util (#38183)
2023-05-09 12:01:52 -04:00
electron-roller[bot]
1254a684dd chore: bump chromium to 114.0.5735.16 (25-x-y) (#38118)
* chore: bump chromium in DEPS to 114.0.5733.2

* chore: bump chromium in DEPS to 114.0.5735.6

* chore: bump chromium in DEPS to 114.0.5735.9

* chore: update patches

* 4450570: Clean up content shell
https://chromium-review.googlesource.com/c/chromium/src/+/4450570

(cherry picked from commit d89b76e6857a332dc779bdb0a04913f3e7541524)

* 4262527: geolocation: Introduce mojom::GeopositionResult
https://chromium-review.googlesource.com/c/chromium/src/+/4262527

(cherry picked from commit 9b350a60c234653109520b407d16d0ad71ea3ed7)

* 4450327: Android/Nav: Stop taking content timeout timer from old host.
https://chromium-review.googlesource.com/c/chromium/src/+/4450327

Also, see:
4451366: Reland "Prerender: Fix prerender new content timeout start timing"
https://chromium-review.googlesource.com/c/chromium/src/+/4451366

(cherry picked from commit 7039603714cbfac7ebb20cb1ab0135c8249a89fd)

* chore: bump CircleCI xcode version
this will hopefully get us the necessary macOS sdk 13.3 on CI.

(cherry picked from commit b3283351cdd0a079d5fe65fe46b642c7def74f38)

* test: fix geolocation test

(cherry picked from commit bddbc573ada91511d07dbc6b4622ac95358f0993)

* fixup patch

* chore: bump chromium in DEPS to 114.0.5735.16

* chore: update patches

* 4336172: Include client-drawn window decorations in aspect ratio. |
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4336172

* build: bump appveyor image to fix windows cache

* spec: fix race condition in alwaysOnTop test

* build: use xcode 14.2 not 14.3

* build: use macOS 12 to run tests

The new macOS 13 VMs appear to have different screen / display behavior

---------

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: clavin <clavin@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2023-05-09 11:03:33 -04:00
trop[bot]
99a81e4ef0 chore: fix TrustedTypes policy in chrome://accessibility (#38211)
chore: fix TrustedTypes policy in chrome://accessibility

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-05-08 15:57:44 +02:00
Shelley Vohr
36d5706ea9 feat: net.resolveHost (#38152)
feat: net.resolveHost (#37853)

Co-authored-by: Fedor Indutny <238531+indutny@users.noreply.github.com>
2023-05-08 09:46:11 +02:00
Alexey Kuzmin
2ae9588e1c test: use await to call "closeWindow" (#38174) 2023-05-04 14:26:50 +02:00
David Sanders
320415edf9 docs: moves icpMain.handle call in tutorial part 3 (#38175)
docs: moves icpMain.handle call in tutorial part 3 (#38138)

Co-authored-by: Russell Carpenella <russellcarpenella@gmail.com>
2023-05-04 12:25:50 +02:00
Shelley Vohr
dd59115ac6 fix: AXManualAccessibility showing failure (#38146) 2023-05-04 10:38:54 +02:00
David Sanders
80a378a9de fix: falsy transparent shouldn't affect webContents background (#38157)
fix: falsy transparent shouldn't affect webContents background (#36914)
2023-05-03 15:42:27 +02:00
Shelley Vohr
8d2530437e chore: add ocr scaffolding to pdf viewer (#38148)
* chore: add OCR scaffolding to PDF Viewer

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

* chore: remove unnecessary gn file

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
2023-05-03 09:56:36 +02:00
Shelley Vohr
dde3a0f1ba chore: correct extra qualification causing build error with gcc (#38143)
* chore: correct extra qualification causing build error with GCC

Co-authored-by: Bruno Pitrus <brunopitrus@hotmail.com>

* fixup for lint

Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>

* chore: fix lint

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Bruno Pitrus <brunopitrus@hotmail.com>
Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
2023-05-02 11:20:29 -04:00
trop[bot]
ce079c02bc fix: crash on missing RenderWidgetHostView (#38115)
chore: fix crash on missing RenderWidgetHostView

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-04-25 15:29:25 -07:00
trop[bot]
f23df11352 docs: fix start highlight tutorial-2-first-app.md (#38114)
doc: fix start highlight tutorial-2-first-app.md

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Francis Chartrand <chartrandf@users.noreply.github.com>
2023-04-25 13:16:32 +02:00
trop[bot]
abb86a7ea1 fix: webContents return type incorrect (#38107)
* fix: webContents type incorrect

Co-authored-by: Black-Hole1 <bh@bugs.cc>

* fix: ci failed

Co-authored-by: Black-Hole1 <bh@bugs.cc>

* fix: ci failed 2

Co-authored-by: Black-Hole1 <bh@bugs.cc>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Black-Hole1 <bh@bugs.cc>
2023-04-25 12:08:01 +02:00
trop[bot]
8f96b2192a chore: always lint JS in docs/fiddles (#38109)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-24 19:44:46 +02:00
trop[bot]
977a7eb1d0 docs: fix 'usb-device-added', 'usb-device-removed', 'usb-device-revoked' typings (#38095)
* Fix 'usb-device-added', 'usb-device-removed', 'usb-device-revoked' typings

Co-authored-by: Quang Lam <quang.lam@webcatalog.io>

* Add webContents

Co-authored-by: Quang Lam <quang.lam@webcatalog.io>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Quang Lam <quang.lam@webcatalog.io>
2023-04-24 09:43:32 -04:00
trop[bot]
504588c861 fix: crash in utilityProcess when generating code from strings (#38039)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-04-23 22:17:03 +02:00
trop[bot]
5bc09dda1a fix: defaults broken in shell.openExternal() options (#38071)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2023-04-21 12:43:25 -07:00
trop[bot]
6b72837203 chore: bump chromium to 114.0.5719.0 (25-x-y) (#38034)
* chore: bump chromium in DEPS to 114.0.5719.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* revert eb07a797cc

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
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: Jeremy Rose <jeremya@chromium.org>
2023-04-21 13:14:34 -04:00
trop[bot]
9f2bef9a65 feat: add thermal states to powerMonitor (#38028)
* feat: add thermal states to powerMonitor

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* update docs

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-04-20 12:27:08 +02:00
trop[bot]
d0273d83ef feat: add did-resign-active event on app (#38018)
feat: add did-resign-active event on app

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-04-20 12:25:17 +02:00
trop[bot]
248dc89217 build: fix building with no PDF support (#38006)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>
2023-04-17 21:58:37 -04:00
trop[bot]
a75a867997 chore: bump chromium to 114.0.5715.0 (25-x-y) (#38010)
* chore: bump chromium in DEPS to 114.0.5712.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* 4401084: Remove extensions::InfoMap which is no longer needed. | https://chromium-review.googlesource.com/c/chromium/src/+/4401084

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

* 4415646: Add more details to print settings error log | https://chromium-review.googlesource.com/c/chromium/src/+/4415646

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

* chore: bump chromium in DEPS to 114.0.5714.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: update libcxx filenames

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

* chore: bump chromium in DEPS to 114.0.5715.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* fix extensions test

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
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: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2023-04-17 21:06:38 -04:00
trop[bot]
0d82286a23 docs: update github.com links (#37990)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-17 11:16:54 -04:00
trop[bot]
4553ec2a2a docs: add note to win.setFullScreen(flag) (#37997)
docs: add note to win.setFullScreen(flag)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-04-17 11:13:48 -04:00
trop[bot]
62f64f9f03 chore: replace uses of ComPtr::GetAddressOf() with ComPtr::operator& (#37993)
chore: replace uses of ComPtr::GetAddressOf() with ComPtr::operator&

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-04-17 11:44:55 +02:00
trop[bot]
f35adf303b chore: drop patch for fixed Linux menus issue in Views (#37988)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-16 17:06:40 -07:00
trop[bot]
f236478b2b fix: defaultFontFamily in webPreferences (#37967)
* fix: defaultFontFamily in webPreferences

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

* chore: check if default_font_family_ is empty

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-14 09:17:39 -07:00
trop[bot]
b69de7c412 fix: swipe event emission on macOS (#37966)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-04-13 13:06:40 -04:00
trop[bot]
8c3bbded4f docs: Fix the syntax error for code fragment (#37961)
By using `app.on('ready').then(xxx)`, application will throw a TypeError

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Zenkie Bear <62818957+ZenkieBear@users.noreply.github.com>
2023-04-13 13:28:35 +02:00
trop[bot]
d9019fc54b chore: bump chromium to 114.0.5710.0 (25-x-y) (#37957)
* chore: bump chromium in DEPS to 114.0.5710.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

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

* 4411421: [json-schema-compiler] Support separating numbers in enum entries | https://chromium-review.googlesource.com/c/chromium/src/+/4411421

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

* 4400251: Remove MayBlock and TaskShutdownBehavior from BrowserTaskTraits | https://chromium-review.googlesource.com/c/chromium/src/+/4400251

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2023-04-12 20:51:49 -07:00
trop[bot]
7c624c17fa docs: update 22-x-y EOL dates (#37956)
To account for https://www.electronjs.org/blog/electron-22-0#windows-7881-support-update

Not sure if it is worth adding as a historical change though

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
2023-04-12 20:22:20 -07:00
trop[bot]
3e336d2923 chore: bump chromium to 114.0.5708.0 (25-x-y) (#37953)
chore: bump chromium to 114.0.5708.0 25-x-y

* chore: bump chromium in DEPS to 114.0.5696.0

* chore: update patches

* chore: revert clang revert

(cherry picked from commit 4c3ffa8001b5fdbfc99374bf77895d8d8e35ee31)

* test: remove unneeded test for title on ses.setCertificateVerifyProc

This test is unnecessary because all that really needs to be verified is that the request was rejected.

* chore: Revert "Reland "[BRP] Enable clang plugin check for Linux""

* chore: bump chromium in DEPS to 114.0.5697.0

* chore: bump chromium in DEPS to 114.0.5698.0

* chore: update patches

* chore: bump chromium in DEPS to 114.0.5700.0

* chore: update patches

* chore: bump chromium in DEPS to 114.0.5702.0

* chore: bump chromium in DEPS to 114.0.5704.0

* chore: update patches

* chore: bump chromium in DEPS to 114.0.5705.0

* 4368281: Add bottom-up CertVerifier change observer flow. |
https://chromium-review.googlesource.com/c/chromium/src/+/4368281

* 4402277: Enable check_raw_ptr_fields for Linux |
https://chromium-review.googlesource.com/c/chromium/src/+/4402277

* 4389621: [ChromeAppsDeprecation] Remove deprecated chrome apps from AppService |
https://chromium-review.googlesource.com/c/chromium/src/+/4389621

* 4402191: Allow default initializing BrowserTaskTraits |
https://chromium-review.googlesource.com/c/chromium/src/+/4402191

* chore: bump chromium in DEPS to 114.0.5708.0

* chore: remove incorrectly re-added clang patch

* chore: update patches (clean sync)

* ci: use newer clang for 32-bit Linux ARM

Fixes crash on compiling skia/skia/SkPatchUtils.cpp

* build: generate new libcxx filenames

* 4409898: Update paper printable area in UpdatePrintSettings |
https://chromium-review.googlesource.com/c/chromium/src/+/4409898

* chore: update sysroots.json
Sysroot CL: https://chromium-review.googlesource.com/c/chromium/src/+/4383374
Chromium CL: 4246577: media/gpu: Add CQP AV1 VA-API video encoder | https://chromium-review.googlesource.com/c/chromium/src/+/4246577

* 4336198: [task] Move source location and use it in v8 platform | https://chromium-review.googlesource.com/c/v8/v8/+/4336198

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2023-04-12 18:11:07 -07:00
trop[bot]
95b727ccdb fix: recommended node-gyp version in node.h error (#37926)
fix: recommended node-gyp version in node.h error

In
https://github.com/electron/electron/blob/main/docs/tutorial/using-native-node-modules.md#using-npm,
we recommend setting the `npm_config_disturl` variable but doing that
does not work on node-gyp v8.4.0 because after
https://github.com/nodejs/node-gyp/pull/2497
landed, the dist URL was read only from `gyp.opts['dist-url']`. The fix
for reading the value from `npm_config_disturl` by parsing
`gyp.opts.disturl` was landed in
https://github.com/nodejs/node-gyp/pull/2547 and that change was
released in node-gyp v9.0.0, so this change updates the error macro to
recommend node-gyp v9.0.0 as the minimum required version.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Darshan Sen <raisinten@gmail.com>
2023-04-11 22:13:52 +02:00
trop[bot]
382b19f816 fix: exceptions during function/promise result conversions live in calling world (#37922)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-04-11 09:23:15 -07:00
trop[bot]
a1b3b506d7 fix: menus on Linux after window modification (#37905)
* fix: menus on Linux after window modification

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

* test: don't run on CI

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-11 15:44:56 +02:00
trop[bot]
9b25d6b91b chore: use nested namespaces (#37917)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-11 12:52:59 +02:00
trop[bot]
b113c5d583 fix: broken buttons in PDF viewer (#37920)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-04-11 12:39:12 +02:00
trop[bot]
a36e44c973 chore: change some for loops to range-based (#37912)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-11 12:25:55 +02:00
trop[bot]
8ae741102d test: support 'latest'/'latest@X' Electron version strings (#37866)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-11 11:57:55 +02:00
trop[bot]
666e8f9647 chore: use emplace when possible (#37909)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2023-04-11 11:57:26 +02:00
trop[bot]
fdceacce44 fix: showAboutPanel also on linux (#37873)
showAboutPanel also on linux

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-04-11 15:20:05 +09:00
trop[bot]
0ad8ffa3d2 fix: exceptions in nested conversions live in the target world (#37896)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2023-04-10 18:00:55 -07:00
trop[bot]
031283003c docs: update E24/E25 breaking changes (#37882) 2023-04-07 12:51:31 -07:00
trop[bot]
63fdcba0c8 docs: update 21-x-y EOL dates (#37871)
* docs: update 21-x-y EOL dates

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

* doc: update node versions

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2023-04-06 13:01:56 -07:00
263 changed files with 4548 additions and 2699 deletions

View File

@@ -52,9 +52,14 @@ executors:
size:
description: "macOS executor size"
type: enum
enum: ["macos.x86.medium.gen2", "large"]
enum: ["macos.x86.medium.gen2"]
version:
description: "xcode version"
type: enum
enum: ["14.3.0", "14.0.0"]
default: 14.3.0
macos:
xcode: 14.0.0
xcode: << parameters.version >>
resource_class: << parameters.size >>
# Electron Runners
@@ -245,14 +250,27 @@ step-depot-tools-get: &step-depot-tools-get
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
cd depot_tools
patch gclient.py -R \<<'EOF'
676,677c676
< packages = dep_value.get('packages', [])
< for package in (x for x in packages if "infra/3pp/tools/swift-format" not in x.get('package')):
---
> for package in dep_value.get('packages', []):
cat > gclient.diff \<< 'EOF'
diff --git a/gclient.py b/gclient.py
index 3a9c5c6..f222043 100755
--- a/gclient.py
+++ b/gclient.py
@@ -712,7 +712,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
if dep_type == 'cipd':
cipd_root = self.GetCipdRoot()
- for package in dep_value.get('packages', []):
+ packages = dep_value.get('packages', [])
+ for package in (x for x in packages if "infra/3pp/tools/swift-format" not in x.get('package')):
deps_to_add.append(
CipdDependency(
parent=self,
EOF
git apply --3way gclient.diff
fi
# Ensure depot_tools does not update.
test -d depot_tools && cd depot_tools
touch .disable_auto_update
step-depot-tools-add-to-path: &step-depot-tools-add-to-path
run:
@@ -274,7 +292,7 @@ step-gclient-sync: &step-gclient-sync
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags
if [ "$IS_RELEASE" != "true" ]; then
# Re-export all the patches to check if there were changes.
python src/electron/script/export_all_patches.py src/electron/patches/config.json
python3 src/electron/script/export_all_patches.py src/electron/patches/config.json
cd src/electron
git update-index --refresh || true
if ! git diff-index --quiet HEAD --; then
@@ -357,14 +375,14 @@ step-restore-brew-cache: &step-restore-brew-cache
- /usr/local/Cellar/gnu-tar
- /usr/local/bin/gtar
keys:
- v5-brew-cache-{{ arch }}
- v6-brew-cache-{{ arch }}
step-save-brew-cache: &step-save-brew-cache
save_cache:
paths:
- /usr/local/Cellar/gnu-tar
- /usr/local/bin/gtar
key: v5-brew-cache-{{ arch }}
key: v6-brew-cache-{{ arch }}
name: Persisting brew cache
step-get-more-space-on-mac: &step-get-more-space-on-mac
@@ -675,9 +693,9 @@ step-verify-mksnapshot: &step-verify-mksnapshot
if [ "$IS_ASAN" != "1" ]; then
cd src
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --snapshot-files-dir $PWD/cross-arch-snapshots
python3 electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --snapshot-files-dir $PWD/cross-arch-snapshots
else
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
python3 electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
fi
fi
@@ -687,7 +705,7 @@ step-verify-chromedriver: &step-verify-chromedriver
command: |
if [ "$IS_ASAN" != "1" ]; then
cd src
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
python3 electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
fi
step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
@@ -813,7 +831,7 @@ step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
elif [ "`uname`" == "Darwin" ]; then
cp "out/Default/$MKSNAPSHOT_PATH/libffmpeg.dylib" out/Default
fi
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
python3 electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default --create-snapshot-only
mkdir cross-arch-snapshots
cp out/Default-mksnapshot-test/*.bin cross-arch-snapshots
# Clean up so that ninja does not get confused
@@ -970,7 +988,6 @@ step-ts-compile: &step-ts-compile
# List of all steps.
steps-electron-gn-check: &steps-electron-gn-check
steps:
- install-python2-mac
- *step-setup-goma-for-build
- checkout-from-cache
- *step-setup-env-for-build
@@ -989,31 +1006,6 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
# Command Aliases
commands:
install-python2-mac:
steps:
- restore_cache:
keys:
- v2.7.18-python-cache-{{ arch }}
name: Restore python cache
- run:
name: Install python2 on macos
command: |
if [ "`uname`" == "Darwin" ] && [ "$IS_ELECTRON_RUNNER" != "1" ]; then
if [ ! -f "python-downloads/python-2.7.18-macosx10.9.pkg" ]; then
mkdir python-downloads
echo 'Downloading Python 2.7.18'
curl -O https://dev-cdn.electronjs.org/python/python-2.7.18-macosx10.9.pkg
mv python-2.7.18-macosx10.9.pkg python-downloads
else
echo 'Using Python install from cache'
fi
sudo installer -pkg python-downloads/python-2.7.18-macosx10.9.pkg -target /
fi
- save_cache:
paths:
- python-downloads
key: v2.7.18-python-cache-{{ arch }}
name: Persisting python cache
maybe-restore-portaled-src-cache:
parameters:
halt-if-successful:
@@ -1310,7 +1302,6 @@ commands:
- run: rm -rf src/electron
- *step-restore-brew-cache
- *step-install-gnutar-on-mac
- install-python2-mac
- *step-save-brew-cache
- when:
condition: << parameters.build >>
@@ -1471,7 +1462,6 @@ commands:
- *step-setup-linux-for-headless-testing
- *step-restore-brew-cache
- *step-fix-known-hosts-linux
- install-python2-mac
- *step-install-signing-cert-on-mac
- run:
@@ -1581,7 +1571,6 @@ commands:
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
- install-python2-mac
- *step-get-more-space-on-mac
- when:
condition: << parameters.checkout >>
@@ -2142,6 +2131,7 @@ jobs:
executor:
name: macos
size: macos.x86.medium.gen2
version: 14.0.0
environment:
<<: *env-mac-large
<<: *env-stack-dumping
@@ -2165,6 +2155,7 @@ jobs:
executor:
name: macos
size: macos.x86.medium.gen2
version: 14.0.0
environment:
<<: *env-mac-large
<<: *env-stack-dumping

View File

@@ -1,27 +1,3 @@
{
"commands-show-output": false,
"first-line-h1": false,
"header-increment": false,
"line-length": {
"code_blocks": false,
"tables": false,
"stern": true,
"line_length": -1
},
"no-bare-urls": false,
"no-blanks-blockquote": false,
"no-duplicate-header": {
"allow_different_nesting": true
},
"no-emphasis-as-header": false,
"no-hard-tabs": {
"code_blocks": false
},
"no-space-in-emphasis": false,
"no-trailing-punctuation": false,
"no-trailing-spaces": {
"br_spaces": 0
},
"single-h1": false,
"no-inline-html": false
"extends": "@electron/lint-roller/configs/markdownlint.json"
}

View File

@@ -772,6 +772,8 @@ source_set("electron_lib") {
sources += [
"shell/browser/electron_pdf_web_contents_helper_client.cc",
"shell/browser/electron_pdf_web_contents_helper_client.h",
"shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.cc",
"shell/browser/extensions/api/pdf_viewer_private/pdf_viewer_private_api.h",
]
}

12
DEPS
View File

@@ -2,13 +2,17 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'114.0.5694.0',
'114.0.5735.45',
'node_version':
'v18.15.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
'0e5d146ba13101a1302d59ea6e6e0b3cace4ae38',
'reactiveobjc_version':
'74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
'mantle_version':
'78d3966b3c331292ea29ec38661b25df0a245948',
'pyyaml_version': '3.12',
@@ -17,6 +21,8 @@ vars = {
'nodejs_git': 'https://github.com/nodejs',
'yaml_git': 'https://github.com/yaml',
'squirrel_git': 'https://github.com/Squirrel',
'reactiveobjc_git': 'https://github.com/ReactiveCocoa',
'mantle_git': 'https://github.com/Mantle',
# KEEP IN SYNC WITH utils.js FILE
'yarn_version': '1.15.2',
@@ -87,11 +93,11 @@ deps = {
'condition': 'process_deps',
},
'src/third_party/squirrel.mac/vendor/ReactiveObjC': {
'url': 'https://github.com/ReactiveCocoa/ReactiveObjC.git@74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
'url': Var("reactiveobjc_git") + '/ReactiveObjC.git@' + Var("reactiveobjc_version"),
'condition': 'process_deps'
},
'src/third_party/squirrel.mac/vendor/Mantle': {
'url': 'https://github.com/Mantle/Mantle.git@78d3966b3c331292ea29ec38661b25df0a245948',
'url': Var("mantle_git") + '/Mantle.git@' + Var("mantle_version"),
'condition': 'process_deps',
}
}

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-114.0.5684.0
image: e-114.0.5735.16-bust-cache
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electronhq-16-core
image: e-114.0.5684.0
image: e-114.0.5735.16-bust-cache
environment:
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR: Default

View File

@@ -49,3 +49,9 @@ use_qt = false
# https://chromium-review.googlesource.com/c/chromium/src/+/4365718
# TODO(codebytere): fix perfetto incompatibility with Node.js.
use_perfetto_client_library = false
# Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4402277
enable_check_raw_ptr_fields = false
# Disables the builtins PGO for V8
v8_builtins_profiling_log_file = ""

View File

@@ -7,7 +7,7 @@ Process: [Main](../glossary.md#main-process)
The following example shows how to quit the application when the last window is
closed:
```javascript
```js
const { app } = require('electron')
app.on('window-all-closed', () => {
app.quit()
@@ -150,9 +150,20 @@ Returns:
* `event` Event
Emitted when mac application become active. Difference from `activate` event is
Emitted when the application becomes active. This differs from the `activate` event in
that `did-become-active` is emitted every time the app becomes active, not only
when Dock icon is clicked or application is re-launched.
when Dock icon is clicked or application is re-launched. It is also emitted when a user
switches to the app via the macOS App Switcher.
### Event: 'did-resign-active' _macOS_
Returns:
* `event` Event
Emitted when the app is no longer active and doesnt have focus. This can be triggered,
for example, by clicking on another application or by using the macOS App Switcher to
switch to another application.
### Event: 'continue-activity' _macOS_
@@ -285,7 +296,7 @@ Emitted when failed to verify the `certificate` for `url`, to trust the
certificate you should prevent the default behavior with
`event.preventDefault()` and call `callback(true)`.
```javascript
```js
const { app } = require('electron')
app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
@@ -317,7 +328,7 @@ and `callback` can be called with an entry filtered from the list. Using
`event.preventDefault()` prevents the application from using the first
certificate from the store.
```javascript
```js
const { app } = require('electron')
app.on('select-client-certificate', (event, webContents, url, list, callback) => {
@@ -350,7 +361,7 @@ The default behavior is to cancel all authentications. To override this you
should prevent the default behavior with `event.preventDefault()` and call
`callback(username, password)` with the credentials.
```javascript
```js
const { app } = require('electron')
app.on('login', (event, webContents, details, authInfo, callback) => {
@@ -470,7 +481,7 @@ Returns:
Emitted when Electron has created a new `session`.
```javascript
```js
const { app } = require('electron')
app.on('session-created', (session) => {
@@ -555,7 +566,7 @@ started after current instance exited.
An example of restarting current instance immediately and adding a new command
line argument to the new instance:
```javascript
```js
const { app } = require('electron')
app.relaunch({ args: process.argv.slice(1).concat(['--relaunch']) })
@@ -940,7 +951,7 @@ List, nor will it be displayed.
Here's a very simple example of creating a custom Jump List:
```javascript
```js
const { app } = require('electron')
app.setJumpList([
@@ -1023,8 +1034,8 @@ use this method to ensure single instance.
An example of activating the window of primary instance when a second instance
starts:
```javascript
const { app } = require('electron')
```js
const { app, BrowserWindow } = require('electron')
let myWindow = null
const additionalData = { myKey: 'myValue' }
@@ -1044,9 +1055,9 @@ if (!gotTheLock) {
}
})
// Create myWindow, load the rest of the app, etc...
app.whenReady().then(() => {
myWindow = createWindow()
myWindow = new BrowserWindow({})
myWindow.loadURL('https://electronjs.org')
})
}
```
@@ -1169,11 +1180,15 @@ case the user's DNS configuration does not include a provider that supports
DoH.
```js
app.configureHostResolver({
secureDnsMode: 'secure',
secureDnsServers: [
'https://cloudflare-dns.com/dns-query'
]
const { app } = require('electron')
app.whenReady().then(() => {
app.configureHostResolver({
secureDnsMode: 'secure',
secureDnsServers: [
'https://cloudflare-dns.com/dns-query'
]
})
})
```
@@ -1325,7 +1340,10 @@ To work with Electron's `autoUpdater` on Windows, which uses [Squirrel][Squirrel
you'll want to set the launch path to Update.exe, and pass arguments that specify your
application name. For example:
``` javascript
``` js
const { app } = require('electron')
const path = require('path')
const appFolder = path.dirname(process.execPath)
const updateExe = path.resolve(appFolder, '..', 'Update.exe')
const exeName = path.basename(process.execPath)
@@ -1335,7 +1353,7 @@ app.setLoginItemSettings({
path: updateExe,
args: [
'--processStart', `"${exeName}"`,
'--process-start-args', `"--hidden"`
'--process-start-args', '"--hidden"'
]
})
```
@@ -1394,11 +1412,22 @@ Show the platform's native emoji picker.
Returns `Function` - This function **must** be called once you have finished accessing the security scoped file. If you do not remember to stop accessing the bookmark, [kernel resources will be leaked](https://developer.apple.com/reference/foundation/nsurl/1417051-startaccessingsecurityscopedreso?language=objc) and your app will lose its ability to reach outside the sandbox completely, until your app is restarted.
```js
// Start accessing the file.
const stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(data)
// You can now access the file outside of the sandbox 🎉
const { app, dialog } = require('electron')
const fs = require('fs')
// Remember to stop accessing the file once you've finished with it.
let filepath
let bookmark
dialog.showOpenDialog(null, { securityScopedBookmarks: true }, (filepaths, bookmarks) => {
filepath = filepaths[0]
bookmark = bookmarks[0]
fs.readFileSync(filepath)
})
// ... restart app ...
const stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(bookmark)
fs.readFileSync(filepath)
stopAccessingSecurityScopedResource()
```
@@ -1439,6 +1468,8 @@ By default, if an app of the same name as the one being moved exists in the Appl
For example:
```js
const { app, dialog } = require('electron')
app.moveToApplicationsFolder({
conflictHandler: (conflictType) => {
if (conflictType === 'exists') {

View File

@@ -137,7 +137,7 @@ application starts.
[squirrel-mac]: https://github.com/Squirrel/Squirrel.Mac
[server-support]: https://github.com/Squirrel/Squirrel.Mac#server-support
[squirrel-windows]: https://github.com/Squirrel/Squirrel.Windows
[installer]: https://github.com/electron/grunt-electron-installer
[installer]: https://github.com/electron-archive/grunt-electron-installer
[installer-lib]: https://github.com/electron/windows-installer
[electron-forge-lib]: https://github.com/electron/forge
[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids

View File

@@ -262,6 +262,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
`tooltip`, `content`, `under-window`, or `under-page`. Please note that
`appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are
deprecated and have been removed in macOS Catalina (10.15).
* `backgroundMaterial` string (optional) _Windows_ - Set the window's
system-drawn background material, including behind the non-client area.
Can be `auto`, `none`, `mica`, `acrylic` or `tabbed`. See [win.setBackgroundMaterial](#winsetbackgroundmaterialmaterial-windows) for more information.
* `zoomToPageWidth` boolean (optional) _macOS_ - Controls the behavior on
macOS when option-clicking the green stoplight button on the toolbar or by
clicking the Window > Zoom menu item. If `true`, the window will grow to
@@ -954,7 +957,7 @@ Hides the window.
#### `win.isVisible()`
Returns `boolean` - Whether the window is visible to the user.
Returns `boolean` - Whether the window is visible to the user in the foreground of the app.
#### `win.isModal()`
@@ -992,6 +995,8 @@ Returns `boolean` - Whether the window is minimized.
Sets whether the window should be in fullscreen mode.
**Note:** On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the ['enter-full-screen'](browser-window.md#event-enter-full-screen) or ['leave-full-screen'](browser-window.md#event-leave-full-screen) events.
#### `win.isFullScreen()`
Returns `boolean` - Whether the window is in fullscreen mode.
@@ -1842,6 +1847,21 @@ will remove the vibrancy effect on the window.
Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
deprecated and will be removed in an upcoming version of macOS.
#### `win.setBackgroundMaterial(material)` _Windows_
* `material` string
* `auto` - Let the Desktop Window Manager (DWM) automatically decide the system-drawn backdrop material for this window. This is the default.
* `none` - Don't draw any system backdrop.
* `mica` - Draw the backdrop material effect corresponding to a long-lived window.
* `acrylic` - Draw the backdrop material effect corresponding to a transient window.
* `tabbed` - Draw the backdrop material effect corresponding to a window with a tabbed title bar.
This method sets the browser window's system-drawn background material, including behind the non-client area.
See the [Windows documentation](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type) for more details.
**Note:** This method is only supported on Windows 11 22H2 and up.
#### `win.setWindowButtonPosition(position)` _macOS_
* `position` [Point](structures/point.md) | null

View File

@@ -65,7 +65,7 @@ strictly follow the Node.js model as described in the
For instance, we could have created the same request to 'github.com' as follows:
```JavaScript
```javascript
const request = net.request({
method: 'GET',
protocol: 'https:',
@@ -104,7 +104,7 @@ The `callback` function is expected to be called back with user credentials:
* `username` string
* `password` string
```JavaScript
```javascript
request.on('login', (authInfo, callback) => {
callback('username', 'password')
})
@@ -113,9 +113,9 @@ request.on('login', (authInfo, callback) => {
Providing empty credentials will cancel the request and report an authentication
error on the response object:
```JavaScript
```javascript
request.on('response', (response) => {
console.log(`STATUS: ${response.statusCode}`);
console.log(`STATUS: ${response.statusCode}`)
response.on('error', (error) => {
console.log(`ERROR: ${JSON.stringify(error)}`)
})

View File

@@ -16,7 +16,7 @@ crashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })
For setting up a server to accept and process crash reports, you can use
following projects:
* [socorro](https://github.com/mozilla/socorro)
* [socorro](https://github.com/mozilla-services/socorro)
* [mini-breakpad-server](https://github.com/electron/mini-breakpad-server)
> **Note:** Electron uses Crashpad, not Breakpad, to collect and upload

View File

@@ -223,10 +223,10 @@ expanding and collapsing the dialog.
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `message` string - Content of the message box.
* `type` string (optional) - Can be `"none"`, `"info"`, `"error"`, `"question"` or
`"warning"`. On Windows, `"question"` displays the same icon as `"info"`, unless
you set an icon using the `"icon"` option. On macOS, both `"warning"` and
`"error"` display the same warning icon.
* `type` string (optional) - Can be `none`, `info`, `error`, `question` or
`warning`. On Windows, `question` displays the same icon as `info`, unless
you set an icon using the `icon` option. On macOS, both `warning` and
`error` display the same warning icon.
* `buttons` string[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
will result in one button labeled "OK".
* `defaultId` Integer (optional) - Index of the button in the buttons array which will
@@ -266,10 +266,10 @@ If `browserWindow` is not shown dialog will not be attached to it. In such case
* `browserWindow` [BrowserWindow](browser-window.md) (optional)
* `options` Object
* `message` string - Content of the message box.
* `type` string (optional) - Can be `"none"`, `"info"`, `"error"`, `"question"` or
`"warning"`. On Windows, `"question"` displays the same icon as `"info"`, unless
you set an icon using the `"icon"` option. On macOS, both `"warning"` and
`"error"` display the same warning icon.
* `type` string (optional) - Can be `none`, `info`, `error`, `question` or
`warning`. On Windows, `question` displays the same icon as `info`, unless
you set an icon using the `icon` option. On macOS, both `warning` and
`error` display the same warning icon.
* `buttons` string[]&#32;(optional) - Array of texts for buttons. On Windows, an empty array
will result in one button labeled "OK".
* `defaultId` Integer (optional) - Index of the button in the buttons array which will

View File

@@ -154,20 +154,22 @@ const isMac = process.platform === 'darwin'
const template = [
// { role: 'appMenu' }
...(isMac ? [{
label: app.name,
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
]
}] : []),
...(isMac
? [{
label: app.name,
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
]
}]
: []),
// { role: 'fileMenu' }
{
label: 'File',
@@ -185,23 +187,25 @@ const template = [
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
...(isMac ? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{
label: 'Speech',
submenu: [
{ role: 'startSpeaking' },
{ role: 'stopSpeaking' }
...(isMac
? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{
label: 'Speech',
submenu: [
{ role: 'startSpeaking' },
{ role: 'stopSpeaking' }
]
}
]
}
] : [
{ role: 'delete' },
{ type: 'separator' },
{ role: 'selectAll' }
])
: [
{ role: 'delete' },
{ type: 'separator' },
{ role: 'selectAll' }
])
]
},
// { role: 'viewMenu' }
@@ -225,14 +229,16 @@ const template = [
submenu: [
{ role: 'minimize' },
{ role: 'zoom' },
...(isMac ? [
{ type: 'separator' },
{ role: 'front' },
{ type: 'separator' },
{ role: 'window' }
] : [
{ role: 'close' }
])
...(isMac
? [
{ type: 'separator' },
{ role: 'front' },
{ type: 'separator' },
{ role: 'window' }
]
: [
{ role: 'close' }
])
]
},
{

View File

@@ -129,6 +129,45 @@ won't be able to connect to remote sites. However, a return value of
whether a particular connection attempt to a particular remote site
will be successful.
#### `net.resolveHost(host, [options])`
* `host` string - Hostname to resolve.
* `options` Object (optional)
* `queryType` string (optional) - Requested DNS query type. If unspecified,
resolver will pick A or AAAA (or both) based on IPv4/IPv6 settings:
* `A` - Fetch only A records
* `AAAA` - Fetch only AAAA records.
* `source` string (optional) - The source to use for resolved addresses.
Default allows the resolver to pick an appropriate source. Only affects use
of big external sources (e.g. calling the system for resolution or using
DNS). Even if a source is specified, results can still come from cache,
resolving "localhost" or IP literals, etc. One of the following values:
* `any` (default) - Resolver will pick an appropriate source. Results could
come from DNS, MulticastDNS, HOSTS file, etc
* `system` - Results will only be retrieved from the system or OS, e.g. via
the `getaddrinfo()` system call
* `dns` - Results will only come from DNS queries
* `mdns` - Results will only come from Multicast DNS queries
* `localOnly` - No external sources will be used. Results will only come
from fast local sources that are available no matter the source setting,
e.g. cache, hosts file, IP literal resolution, etc.
* `cacheUsage` string (optional) - Indicates what DNS cache entries, if any,
can be used to provide a response. One of the following values:
* `allowed` (default) - Results may come from the host cache if non-stale
* `staleAllowed` - Results may come from the host cache even if stale (by
expiration or network changes)
* `disallowed` - Results will not come from the host cache.
* `secureDnsPolicy` string (optional) - Controls the resolver's Secure DNS
behavior for this request. One of the following values:
* `allow` (default)
* `disable`
Returns [`Promise<ResolvedHost>`](structures/resolved-host.md) - Resolves with the resolved IP addresses for the `host`.
This method will resolve hosts from the [default
session](session.md#sessiondefaultsession). To resolve a host from
another session, use [ses.resolveHost()](session.md#sesresolvehosthost-options).
## Properties
### `net.online` _Readonly_

View File

@@ -24,6 +24,30 @@ Emitted when the system changes to AC power.
Emitted when system changes to battery power.
### Event: 'thermal-state-change' _macOS_
* `state` string - The system's new thermal state. Can be `unknown`, `nominal`, `fair`, `serious`, `critical`.
Emitted when the thermal state of the system changes. Notification of a change
in the thermal status of the system, such as entering a critical temperature
range. Depending on the severity, the system might take steps to reduce said
temperature, for example, throttling the CPU or switching on the fans if
available.
Apps may react to the new state by reducing expensive computing tasks (e.g.
video encoding), or notifying the user. The same state might be received
repeatedly.
See https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html
### Event: 'speed-limit-change' _macOS_ _Windows_
* `limit` number - The operating system's advertised speed limit for CPUs, in percent.
Notification of a change in the operating system's advertised speed limit for
CPUs, in percent. Values below 100 indicate that the system is impairing
processing power due to thermal management.
### Event: 'shutdown' _Linux_ _macOS_
Emitted when the system is about to reboot or shut down. If the event handler
@@ -55,7 +79,7 @@ The `powerMonitor` module has the following methods:
* `idleThreshold` Integer
Returns `string` - The system's current state. Can be `active`, `idle`, `locked` or `unknown`.
Returns `string` - The system's current idle state. Can be `active`, `idle`, `locked` or `unknown`.
Calculate the system idle state. `idleThreshold` is the amount of time (in seconds)
before considered idle. `locked` is available on supported systems only.
@@ -66,6 +90,10 @@ Returns `Integer` - Idle time in seconds
Calculate system idle time in seconds.
### `powerMonitor.getCurrentThermalState()` _macOS_
Returns `string` - The system's current thermal state. Can be `unknown`, `nominal`, `fair`, `serious`, or `critical`.
### `powerMonitor.isOnBatteryPower()`
Returns `boolean` - Whether the system is on battery power.

View File

@@ -519,9 +519,8 @@ app.whenReady().then(() => {
Returns:
* `event` Event
* `details` Object
* `device` [USBDevice](structures/usb-device.md)
* `frame` [WebFrameMain](web-frame-main.md)
* `device` [USBDevice](structures/usb-device.md)
* `webContents` [WebContents](web-contents.md)
Emitted after `navigator.usb.requestDevice` has been called and
`select-usb-device` has fired if a new device becomes available before
@@ -534,9 +533,8 @@ with the newly added device.
Returns:
* `event` Event
* `details` Object
* `device` [USBDevice](structures/usb-device.md)
* `frame` [WebFrameMain](web-frame-main.md)
* `device` [USBDevice](structures/usb-device.md)
* `webContents` [WebContents](web-contents.md)
Emitted after `navigator.usb.requestDevice` has been called and
`select-usb-device` has fired if a device has been removed before the callback
@@ -550,7 +548,7 @@ Returns:
* `event` Event
* `details` Object
* `device` [USBDevice[]](structures/usb-device.md)
* `device` [USBDevice](structures/usb-device.md)
* `origin` string (optional) - The origin that the device has been revoked from.
Emitted after `USBDevice.forget()` has been called. This event can be used
@@ -1026,7 +1024,7 @@ Passing `null` instead of a function resets the handler to its default state.
* `details` Object
* `deviceType` string - The type of device that permission is being requested on, can be `hid`, `serial`, or `usb`.
* `origin` string - The origin URL of the device permission check.
* `device` [HIDDevice](structures/hid-device.md) | [SerialPort](structures/serial-port.md)- the device that permission is being requested for.
* `device` [HIDDevice](structures/hid-device.md) | [SerialPort](structures/serial-port.md) | [USBDevice](structures/usb-device.md) - the device that permission is being requested for.
Sets the handler which can be used to respond to device permission checks for the `session`.
Returning `true` will allow the device to be permitted and `false` will reject it.
@@ -1483,7 +1481,7 @@ app.whenReady().then(() => {
const protocol = session.fromPartition('some-partition').protocol
if (!protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
callback({ path: path.normalize(path.join(__dirname, url)) })
})) {
console.error('Failed to register protocol')
}

View File

@@ -228,10 +228,10 @@ const win = new BrowserWindow(browserOptions)
// Navigate.
if (browserOptions.transparent) {
win.loadURL(`file://${__dirname}/index.html`)
win.loadFile('index.html')
} else {
// No transparency, so we load a fallback that uses basic styles.
win.loadURL(`file://${__dirname}/fallback.html`)
win.loadFile('fallback.html')
}
```

View File

@@ -65,28 +65,28 @@ for all windows, webviews, opened devtools, and devtools extension background pa
### `webContents.getFocusedWebContents()`
Returns `WebContents` | null - The web contents that is focused in this application, otherwise
Returns `WebContents | null` - The web contents that is focused in this application, otherwise
returns `null`.
### `webContents.fromId(id)`
* `id` Integer
Returns `WebContents` | undefined - A WebContents instance with the given ID, or
Returns `WebContents | undefined` - A WebContents instance with the given ID, or
`undefined` if there is no WebContents associated with the given ID.
### `webContents.fromFrame(frame)`
* `frame` WebFrameMain
Returns `WebContents` | undefined - A WebContents instance with the given WebFrameMain, or
Returns `WebContents | undefined` - A WebContents instance with the given WebFrameMain, or
`undefined` if there is no WebContents associated with the given WebFrameMain.
### `webContents.fromDevToolsTargetId(targetId)`
* `targetId` string - The Chrome DevTools Protocol [TargetID](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) associated with the WebContents instance.
Returns `WebContents` | undefined - A WebContents instance with the given TargetID, or
Returns `WebContents | undefined` - A WebContents instance with the given TargetID, or
`undefined` if there is no WebContents associated with the given TargetID.
When communicating with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/),
@@ -601,6 +601,7 @@ window.
Returns:
* `event` Event
* `url` string - URL of the link that was clicked or selected.
Emitted when a link is clicked in DevTools or 'Open in new tab' is selected for a link in its context menu.
@@ -736,14 +737,16 @@ Returns:
* `size` [Size](structures/size.md) (optional) - the size of the `image`.
* `hotspot` [Point](structures/point.md) (optional) - coordinates of the custom cursor's hotspot.
Emitted when the cursor's type changes. The `type` parameter can be `default`,
`crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`,
`ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`,
`ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`,
`row-resize`, `m-panning`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`,
`s-panning`, `se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`,
`cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`,
`not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing` or `custom`.
Emitted when the cursor's type changes. The `type` parameter can be `pointer`,
`crosshair`, `hand`, `text`, `wait`, `help`, `e-resize`, `n-resize`, `ne-resize`,
`nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`, `ns-resize`, `ew-resize`,
`nesw-resize`, `nwse-resize`, `col-resize`, `row-resize`, `m-panning`, `m-panning-vertical`,
`m-panning-horizontal`, `e-panning`, `n-panning`, `ne-panning`, `nw-panning`, `s-panning`,
`se-panning`, `sw-panning`, `w-panning`, `move`, `vertical-text`, `cell`, `context-menu`,
`alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`, `zoom-out`, `grab`,
`grabbing`, `custom`, `null`, `drag-drop-none`, `drag-drop-move`, `drag-drop-copy`,
`drag-drop-link`, `ns-no-resize`, `ew-no-resize`, `nesw-no-resize`, `nwse-no-resize`,
or `default`.
If the `type` parameter is `custom`, the `image` parameter will hold the custom
cursor image in a [`NativeImage`](native-image.md), and `scale`, `size` and `hotspot` will hold
@@ -863,7 +866,7 @@ app.whenReady().then(() => {
})
if (!result) {
// The device wasn't found so we need to either wait longer (eg until the
// device is turned on) or cancel the request by calling the callback
// device is turned on) or cancel the request by calling the callback
// with an empty string.
callback('')
} else {
@@ -1389,6 +1392,10 @@ Executes the editing command `cut` in web page.
Executes the editing command `copy` in web page.
#### `contents.centerSelection()`
Centers the current text selection in web page.
#### `contents.copyImageAt(x, y)`
* `x` Integer
@@ -1416,6 +1423,46 @@ Executes the editing command `selectAll` in web page.
Executes the editing command `unselect` in web page.
#### `contents.scrollToTop()`
Scrolls to the top of the current `webContents`.
#### `contents.scrollToBottom()`
Scrolls to the bottom of the current `webContents`.
#### `contents.adjustSelection(options)`
* `options` Object
* `start` Number (optional) - Amount to shift the start index of the current selection.
* `end` Number (optional) - Amount to shift the end index of the current selection.
Adjusts the current text selection starting and ending points in the focused frame by the given amounts. A negative amount moves the selection towards the beginning of the document, and a positive amount moves the selection towards the end of the document.
Example:
```js
const win = new BrowserWindow()
// Adjusts the beginning of the selection 1 letter forward,
// and the end of the selection 5 letters forward.
win.webContents.adjustSelection({ start: 1, end: 5 })
// Adjusts the beginning of the selection 2 letters forward,
// and the end of the selection 3 letters backward.
win.webContents.adjustSelection({ start: 2, end: -3 })
```
For a call of `win.webContents.adjustSelection({ start: 1, end: 5 })`
Before:
<img width="487" alt="Image Before Text Selection Adjustment" src="https://user-images.githubusercontent.com/2036040/231761306-cd4e7b15-c2ed-46cf-8e80-10811f6de83e.png">
After:
<img width="487" alt="Image After Text Selection Adjustment" src="https://user-images.githubusercontent.com/2036040/231761169-887eb8ef-06fb-46e4-9efa-898bcb0d6a2b.png">
#### `contents.replace(text)`
* `text` string

View File

@@ -184,6 +184,8 @@ page is loaded, use the `setUserAgent` method to change the user agent.
A `boolean`. When this attribute is present the guest page will have web security disabled.
Web security is enabled by default.
This value can only be modified before the first navigation.
### `partition`
```html
@@ -463,6 +465,10 @@ Executes editing command `cut` in page.
Executes editing command `copy` in page.
#### `<webview>.centerSelection()`
Centers the current text selection in page.
### `<webview>.paste()`
Executes editing command `paste` in page.
@@ -483,6 +489,25 @@ Executes editing command `selectAll` in page.
Executes editing command `unselect` in page.
#### `<webview>.scrollToTop()`
Scrolls to the top of the current `<webview>`.
#### `<webview>.scrollToBottom()`
Scrolls to the bottom of the current `<webview>`.
#### `<webview>.adjustSelection(options)`
* `options` Object
* `start` Number (optional) - Amount to shift the start index of the current selection.
* `end` Number (optional) - Amount to shift the end index of the current selection.
Adjusts the current text selection starting and ending points in the focused frame by the given amounts. A negative amount moves the selection towards the beginning of the document, and a positive amount moves the selection towards the end of the document.
See [`webContents.adjustSelection`](web-contents.md#contentsadjustselectionoptions) for
examples.
### `<webview>.replace(text)`
* `text` string

View File

@@ -61,6 +61,44 @@ protocol.handle('some-protocol', () => {
})
```
### Deprecated: `BrowserWindow.setTrafficLightPosition(position)`
`BrowserWindow.setTrafficLightPosition(position)` has been deprecated, the
`BrowserWindow.setWindowButtonPosition(position)` API should be used instead
which accepts `null` instead of `{ x: 0, y: 0 }` to reset the position to
system default.
```js
// Deprecated in Electron 25
win.setTrafficLightPosition({ x: 10, y: 10 })
win.setTrafficLightPosition({ x: 0, y: 0 })
// Replace with
win.setWindowButtonPosition({ x: 10, y: 10 })
win.setWindowButtonPosition(null)
```
### Deprecated: `BrowserWindow.getTrafficLightPosition()`
`BrowserWindow.getTrafficLightPosition()` has been deprecated, the
`BrowserWindow.getWindowButtonPosition()` API should be used instead
which returns `null` instead of `{ x: 0, y: 0 }` when there is no custom
position.
```js
// Deprecated in Electron 25
const pos = win.getTrafficLightPosition()
if (pos.x === 0 && pos.y === 0) {
// No custom position.
}
// Replace with
const ret = win.getWindowButtonPosition()
if (ret === null) {
// No custom position.
}
```
## Planned Breaking API Changes (24.0)
### API Changed: `nativeImage.createThumbnailFromPath(path, size)`
@@ -98,44 +136,6 @@ nativeImage.createThumbnailFromPath(imagePath, size).then(result => {
})
```
### Deprecated: `BrowserWindow.setTrafficLightPosition(position)`
`BrowserWindow.setTrafficLightPosition(position)` has been deprecated, the
`BrowserWindow.setWindowButtonPosition(position)` API should be used instead
which accepts `null` instead of `{ x: 0, y: 0 }` to reset the position to
system default.
```js
// Removed in Electron 24
win.setTrafficLightPosition({ x: 10, y: 10 })
win.setTrafficLightPosition({ x: 0, y: 0 })
// Replace with
win.setWindowButtonPosition({ x: 10, y: 10 })
win.setWindowButtonPosition(null)
```
### Deprecated: `BrowserWindow.getTrafficLightPosition()`
`BrowserWindow.getTrafficLightPosition()` has been deprecated, the
`BrowserWindow.getWindowButtonPosition()` API should be used instead
which returns `null` instead of `{ x: 0, y: 0 }` when there is no custom
position.
```js
// Removed in Electron 24
const pos = win.getTrafficLightPosition()
if (pos.x === 0 && pos.y === 0) {
// No custom position.
}
// Replace with
const ret = win.getWindowButtonPosition()
if (ret === null) {
// No custom position.
}
```
## Planned Breaking API Changes (23.0)
### Behavior Changed: Draggable Regions on macOS

View File

@@ -49,7 +49,7 @@ formatted correctly.
* Write [standard](https://www.npmjs.com/package/standard) JavaScript style.
* File names should be concatenated with `-` instead of `_`, e.g.
`file-name.js` rather than `file_name.js`, because in
[github/atom](https://github.com/github/atom) module names are usually in
[atom/atom](https://github.com/atom/atom) module names are usually in
the `module-name` form. This rule only applies to `.js` files.
* Use newer ES6/ES2015 syntax where appropriate
* [`const`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)

View File

@@ -2,5 +2,5 @@ const NOTIFICATION_TITLE = 'Title'
const NOTIFICATION_BODY = 'Notification from the Renderer process. Click to log to console.'
const CLICK_MESSAGE = 'Notification clicked!'
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY })
.onclick = () => document.getElementById('output').innerText = CLICK_MESSAGE
new window.Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY })
.onclick = () => { document.getElementById('output').innerText = CLICK_MESSAGE }

View File

@@ -4,16 +4,31 @@ const path = require('path')
app.disableHardwareAcceleration()
let win
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
offscreen: true
}
})
app.whenReady().then(() => {
win = new BrowserWindow({ webPreferences: { offscreen: true } })
win.loadURL('https://github.com')
win.webContents.on('paint', (event, dirty, image) => {
fs.writeFileSync('ex.png', image.toPNG())
})
win.webContents.setFrameRate(60)
console.log(`The screenshot has been successfully saved to ${path.join(process.cwd(), 'ex.png')}`)
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
@@ -21,9 +36,3 @@ app.on('window-all-closed', () => {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})

View File

@@ -1,7 +1,7 @@
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')
let bluetoothPinCallback
let bluetoothPinCallback
let selectBluetoothCallback
function createWindow () {
@@ -24,13 +24,12 @@ function createWindow () {
} else {
// The device wasn't found so we need to either wait longer (eg until the
// device is turned on) or until the user cancels the request
}
}
})
ipcMain.on('cancel-bluetooth-request', (event) => {
selectBluetoothCallback('')
})
// Listen for a message from the renderer to get the response for the Bluetooth pairing.
ipcMain.on('bluetooth-pairing-response', (event, response) => {

View File

@@ -7,7 +7,7 @@ async function testIt () {
document.getElementById('clickme').addEventListener('click', testIt)
function cancelRequest() {
function cancelRequest () {
window.electronAPI.cancelBluetoothRequest()
}
@@ -18,15 +18,15 @@ window.electronAPI.bluetoothPairingRequest((event, details) => {
switch (details.pairingKind) {
case 'confirm': {
response.confirmed = confirm(`Do you want to connect to device ${details.deviceId}?`)
response.confirmed = window.confirm(`Do you want to connect to device ${details.deviceId}?`)
break
}
case 'confirmPin': {
response.confirmed = confirm(`Does the pin ${details.pin} match the pin displayed on device ${details.deviceId}?`)
response.confirmed = window.confirm(`Does the pin ${details.pin} match the pin displayed on device ${details.deviceId}?`)
break
}
case 'providePin': {
const pin = prompt(`Please provide a pin for ${details.deviceId}.`)
const pin = window.prompt(`Please provide a pin for ${details.deviceId}.`)
if (pin) {
response.pin = pin
response.confirmed = true

View File

@@ -23,6 +23,7 @@ function createWindow () {
if (portList && portList.length > 0) {
callback(portList[0].portId)
} else {
// eslint-disable-next-line n/no-callback-literal
callback('') // Could not find any matching devices
}
})

View File

@@ -24,9 +24,7 @@ function createWindow () {
event.preventDefault()
if (details.deviceList && details.deviceList.length > 0) {
const deviceToReturn = details.deviceList.find((device) => {
if (!grantedDeviceThroughPermHandler || (device.deviceId !== grantedDeviceThroughPermHandler.deviceId)) {
return true
}
return !grantedDeviceThroughPermHandler || (device.deviceId !== grantedDeviceThroughPermHandler.deviceId)
})
if (deviceToReturn) {
callback(deviceToReturn.deviceId)

View File

@@ -20,7 +20,7 @@ async function testIt () {
const grantedDevice = await navigator.usb.requestDevice({
filters: []
})
grantedDeviceList += `<hr>${getDeviceDetails(device)}</hr>`
grantedDeviceList += `<hr>${getDeviceDetails(grantedDevice)}</hr>`
} catch (ex) {
if (ex.name === 'NotFoundError') {
grantedDeviceList = noDevicesFoundMsg

View File

@@ -3,9 +3,7 @@ const path = require('path')
async function handleFileOpen () {
const { canceled, filePaths } = await dialog.showOpenDialog()
if (canceled) {
} else {
if (!canceled) {
return filePaths[0]
}
}

View File

@@ -5,17 +5,3 @@ const exLinksBtn = document.getElementById('open-ex-links')
exLinksBtn.addEventListener('click', (event) => {
shell.openExternal('https://electronjs.org')
})
const OpenAllOutboundLinks = () => {
const links = document.querySelectorAll('a[href]')
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})
}

View File

@@ -4,5 +4,5 @@ const copyInput = document.getElementById('copy-to-input')
copyBtn.addEventListener('click', () => {
if (copyInput.value !== '') copyInput.value = ''
copyInput.placeholder = 'Copied! Paste here to see.'
clipboard.writeText('Electron Demo!')
window.clipboard.writeText('Electron Demo!')
})

View File

@@ -1,7 +1,7 @@
const pasteBtn = document.getElementById('paste-to')
pasteBtn.addEventListener('click', async () => {
await clipboard.writeText('What a demo!')
const message = `Clipboard contents: ${await clipboard.readText()}`
await window.clipboard.writeText('What a demo!')
const message = `Clipboard contents: ${await window.clipboard.readText()}`
document.getElementById('paste-from').innerHTML = message
})

View File

@@ -1,7 +1,7 @@
const { ipcRenderer } = require('electron')
const { ipcRenderer, shell } = require('electron')
const appInfoBtn = document.getElementById('app-info')
const electron_doc_link = document.querySelectorAll('a[href]')
const electronDocLink = document.querySelectorAll('a[href]')
appInfoBtn.addEventListener('click', () => {
ipcRenderer.send('get-app-path')
@@ -12,7 +12,8 @@ ipcRenderer.on('got-app-path', (event, path) => {
document.getElementById('got-app-info').innerHTML = message
})
electron_doc_link.addEventListener('click', (e) => {
electronDocLink.addEventListener('click', (e) => {
e.preventDefault()
const url = e.target.getAttribute('href')
shell.openExternal(url)
})

View File

@@ -1,2 +1,2 @@
const information = document.getElementById('info')
information.innerText = `This app is using Chrome (v${versions.chrome()}), Node.js (v${versions.node()}), and Electron (v${versions.electron()})`
information.innerText = `This app is using Chrome (v${window.versions.chrome()}), Node.js (v${window.versions.node()}), and Electron (v${window.versions.electron()})`

View File

@@ -23,23 +23,21 @@ function createWindow () {
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
app.whenReady().then(() => {
createWindow()
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
// In this file you can include the rest of your app's specific main process

View File

@@ -18,7 +18,7 @@ ipcMain.on('create-demo-window', (event) => {
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
@@ -33,23 +33,21 @@ function createWindow () {
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
app.whenReady().then(() => {
createWindow()
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
// In this file you can include the rest of your app's specific main process

View File

@@ -23,23 +23,21 @@ function createWindow () {
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
app.whenReady().then(() => {
createWindow()
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
// In this file you can include the rest of your app's specific main process

View File

@@ -41,23 +41,21 @@ function createWindow () {
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(createWindow)
app.whenReady().then(() => {
createWindow()
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('activate', function () {
// On macOS it is common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
// In this file you can include the rest of your app's specific main process

View File

@@ -28,6 +28,8 @@ On macOS, third-party assistive technology can toggle accessibility features ins
Electron applications by setting the `AXManualAccessibility` attribute
programmatically:
Using Objective-C:
```objc
CFStringRef kAXManualAccessibility = CFSTR("AXManualAccessibility");
@@ -43,5 +45,16 @@ CFStringRef kAXManualAccessibility = CFSTR("AXManualAccessibility");
}
```
Using Swift:
```swift
import Cocoa
let name = CommandLine.arguments.count >= 2 ? CommandLine.arguments[1] : "Electron"
let pid = NSWorkspace.shared.runningApplications.first(where: {$0.localizedName == name})!.processIdentifier
let axApp = AXUIElementCreateApplication(pid)
let result = AXUIElementSetAttributeValue(axApp, "AXManualAccessibility" as CFString, true as CFTypeRef)
print("Setting 'AXManualAccessibility' \(error.rawValue == 0 ? "succeeded" : "failed")")
```
[a11y-docs]: https://www.chromium.org/developers/design-documents/accessibility#TOC-How-Chrome-detects-the-presence-of-Assistive-Technology
[setAccessibilitySupportEnabled]: ../api/app.md#appsetaccessibilitysupportenabledenabled-macos-windows

View File

@@ -37,7 +37,7 @@ This installs all necessary packages for you and generates a `wdio.conf.js` conf
Update the capabilities in your configuration file to point to your Electron app binary:
```javascript title='wdio.conf.js'
export.config = {
exports.config = {
// ...
capabilities: [{
browserName: 'chrome',
@@ -214,10 +214,10 @@ test('example test', async () => {
const isPackaged = await electronApp.evaluate(async ({ app }) => {
// This runs in Electron's main process, parameter here is always
// the result of the require('electron') in the main app script.
return app.isPackaged;
});
return app.isPackaged
})
expect(isPackaged).toBe(false);
expect(isPackaged).toBe(false)
// Wait for the first BrowserWindow to open
// and return its Page object
@@ -226,7 +226,7 @@ test('example test', async () => {
// close app
await electronApp.close()
});
})
```
Then, run Playwright Test using `npx playwright test`. You should see the test pass in your
@@ -338,7 +338,7 @@ class TestDriver {
}
}
module.exports = { TestDriver };
module.exports = { TestDriver }
```
In your app code, can then write a simple handler to receive RPC calls:

View File

@@ -52,7 +52,7 @@ You can find more information and documentation in [the repository](https://gith
## electron-react-boilerplate
If you don't want any tools but only a solid boilerplate to build from,
CT Lin's [`electron-react-boilerplate`](https://github.com/chentsulin/electron-react-boilerplate) might be worth
CT Lin's [`electron-react-boilerplate`](https://github.com/electron-react-boilerplate/electron-react-boilerplate) might be worth
a look. It's quite popular in the community and uses `electron-builder`
internally.

View File

@@ -127,7 +127,7 @@ try {
authors: 'My App Inc.',
exe: 'myapp.exe',
certificateFile: './cert.pfx',
certificatePassword: 'this-is-a-secret',
certificatePassword: 'this-is-a-secret'
})
console.log('It worked!')
} catch (e) {
@@ -159,7 +159,7 @@ const msiCreator = new MSICreator({
version: '1.1.2',
outputDirectory: '/path/to/output/folder',
certificateFile: './cert.pfx',
certificatePassword: 'this-is-a-secret',
certificatePassword: 'this-is-a-secret'
})
// Step 2: Create a .wxs template file

View File

@@ -129,7 +129,7 @@ Electron provides several APIs for working with the WebUSB API:
when handling the `select-usb-device` event.
**Note:** These two events only fire until the callback from `select-usb-device`
is called. They are not intended to be used as a generic usb device listener.
* The [`usb-device-revoked' event on the Session](../api/session.md#event-usb-device-revoked) can
* The [`usb-device-revoked` event on the Session](../api/session.md#event-usb-device-revoked) can
be used to respond when [device.forget()](https://developer.chrome.com/articles/usb/#revoke-access)
is called on a USB device.
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)

View File

@@ -34,19 +34,19 @@ Using the [React Developer Tools][react-devtools] as an example:
API. For React Developer Tools `v4.9.0`, it looks something like:
```javascript
const { app, session } = require('electron')
const path = require('path')
const os = require('os')
const { app, session } = require('electron')
const path = require('path')
const os = require('os')
// on macOS
const reactDevToolsPath = path.join(
os.homedir(),
'/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.9.0_0'
)
// on macOS
const reactDevToolsPath = path.join(
os.homedir(),
'/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.9.0_0'
)
app.whenReady().then(async () => {
await session.defaultSession.loadExtension(reactDevToolsPath)
})
app.whenReady().then(async () => {
await session.defaultSession.loadExtension(reactDevToolsPath)
})
```
**Notes:**

View File

@@ -9,11 +9,11 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
| 25.0.0 | 2023-Apr-10 | 2023-May-02 | 2023-May-30 | TBD | M114 | TBD | TBD |
| 24.0.0 | 2022-Feb-09 | 2023-Mar-07 | 2023-Apr-08 | TBD | M112 | TBD | ✅ |
| 23.0.0 | 2022-Dec-01 | 2023-Jan-10 | 2023-Feb-07 | TBD | M110 | TBD | ✅ |
| 22.0.0 | 2022-Sep-29 | 2022-Oct-25 | 2022-Nov-29 | TBD | M108 | v16.17 | ✅ |
| 21.0.0 | 2022-Aug-04 | 2022-Aug-30 | 2022-Sep-27 | TBD | M106 | v16.16 | |
| 25.0.0 | 2023-Apr-10 | 2023-May-02 | 2023-May-30 | 2023-Dec-05 | M114 | TBD | |
| 24.0.0 | 2022-Feb-09 | 2023-Mar-07 | 2023-Apr-04 | 2023-Oct-03 | M112 | v18.14 | ✅ |
| 23.0.0 | 2022-Dec-01 | 2023-Jan-10 | 2023-Feb-07 | 2023-Aug-08 | M110 | v18.12 | ✅ |
| 22.0.0 | 2022-Sep-29 | 2022-Oct-25 | 2022-Nov-29 | 2023-Oct-10 | M108 | v16.17 | ✅ |
| 21.0.0 | 2022-Aug-04 | 2022-Aug-30 | 2022-Sep-27 | 2023-Apr-04 | M106 | v16.16 | 🚫 |
| 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | 2023-Feb-07 | M104 | v16.15 | 🚫 |
| 19.0.0 | 2022-Mar-31 | 2022-Apr-26 | 2022-May-24 | 2022-Nov-29 | M102 | v16.14 | 🚫 |
| 18.0.0 | 2022-Feb-03 | 2022-Mar-03 | 2022-Mar-29 | 2022-Sep-27 | M100 | v16.13 | 🚫 |

View File

@@ -51,10 +51,10 @@ sections.
In the main process, set an IPC listener on the `set-title` channel with the `ipcMain.on` API:
```javascript {6-10,22} title='main.js (Main Process)'
const {app, BrowserWindow, ipcMain} = require('electron')
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')
//...
// ...
function handleSetTitle (event, title) {
const webContents = event.sender
@@ -74,8 +74,8 @@ function createWindow () {
app.whenReady().then(() => {
ipcMain.on('set-title', handleSetTitle)
createWindow()
}
//...
})
// ...
```
The above `handleSetTitle` callback has two parameters: an [IpcMainEvent][] structure and a
@@ -100,7 +100,7 @@ variable to your renderer process.
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
setTitle: (title) => ipcRenderer.send('set-title', title)
setTitle: (title) => ipcRenderer.send('set-title', title)
})
```
@@ -142,9 +142,9 @@ script:
const setButton = document.getElementById('btn')
const titleInput = document.getElementById('title')
setButton.addEventListener('click', () => {
const title = titleInput.value
window.electronAPI.setTitle(title)
});
const title = titleInput.value
window.electronAPI.setTitle(title)
})
```
At this point, your demo should be fully functional. Try using the input field and see what happens
@@ -185,13 +185,11 @@ provided to the renderer process. Please refer to
const { BrowserWindow, dialog, ipcMain } = require('electron')
const path = require('path')
//...
// ...
async function handleFileOpen() {
async function handleFileOpen () {
const { canceled, filePaths } = await dialog.showOpenDialog()
if (canceled) {
return
} else {
if (!canceled) {
return filePaths[0]
}
}
@@ -209,7 +207,7 @@ app.whenReady(() => {
ipcMain.handle('dialog:openFile', handleFileOpen)
createWindow()
})
//...
// ...
```
:::tip on channel names
@@ -379,7 +377,7 @@ module that uses the `webContents.send` API to send an IPC message from the main
target renderer.
```javascript {11-26} title='main.js (Main Process)'
const {app, BrowserWindow, Menu, ipcMain} = require('electron')
const { app, BrowserWindow, Menu, ipcMain } = require('electron')
const path = require('path')
function createWindow () {
@@ -395,11 +393,11 @@ function createWindow () {
submenu: [
{
click: () => mainWindow.webContents.send('update-counter', 1),
label: 'Increment',
label: 'Increment'
},
{
click: () => mainWindow.webContents.send('update-counter', -1),
label: 'Decrement',
label: 'Decrement'
}
]
}
@@ -408,8 +406,7 @@ function createWindow () {
mainWindow.loadFile('index.html')
}
//...
// ...
```
For the purposes of the tutorial, it's important to note that the `click` handler
@@ -432,7 +429,7 @@ modules in the preload script to expose IPC functionality to the renderer proces
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
onUpdateCounter: (callback) => ipcRenderer.on('update-counter', callback)
onUpdateCounter: (callback) => ipcRenderer.on('update-counter', callback)
})
```
@@ -452,12 +449,12 @@ rather than exposing it over the context bridge.
const { ipcRenderer } = require('electron')
window.addEventListener('DOMContentLoaded', () => {
const counter = document.getElementById('counter')
ipcRenderer.on('update-counter', (_event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
})
const counter = document.getElementById('counter')
ipcRenderer.on('update-counter', (_event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
})
})
```
@@ -493,9 +490,9 @@ so that the value of the `#counter` element is updated whenever we fire an `upda
const counter = document.getElementById('counter')
window.electronAPI.onUpdateCounter((_event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
})
```
@@ -526,11 +523,11 @@ window.electronAPI.onUpdateCounter((event, value) => {
In the main process, listen for `counter-value` events and handle them appropriately.
```javascript title='main.js (Main Process)'
//...
// ...
ipcMain.on('counter-value', (_event, value) => {
console.log(value) // will print value to Node console
})
//...
// ...
```
## Pattern 4: Renderer to renderer

View File

@@ -84,11 +84,11 @@ renderer process using the [addEventListener() API][addEventListener-api].
```javascript fiddle='docs/fiddles/features/keyboard-shortcuts/web-apis|focus=renderer.js'
const handleKeyPress = (event) => {
// You can put code here to handle the keypress.
document.getElementById("last-keypress").innerText = event.key;
console.log(`You pressed ${event.key}`);
document.getElementById('last-keypress').innerText = event.key
console.log(`You pressed ${event.key}`)
}
window.addEventListener('keyup', handleKeyPress, true);
window.addEventListener('keyup', handleKeyPress, true)
```
> Note: the third parameter `true` indicates that the listener will always receive

View File

@@ -341,7 +341,7 @@ Electron uses following cryptographic algorithms:
* RIPEMD - [ISO/IEC 10118-3](https://webstore.ansi.org/RecordDetail.aspx?sku=ISO%2FIEC%2010118-3:2004)
[developer-program]: https://developer.apple.com/support/compare-memberships/
[@electron/osx-sign]: https://github.com/electron/electron-osx-sign
[@electron/osx-sign]: https://github.com/electron/osx-sign
[app-sandboxing]: https://developer.apple.com/app-sandboxing/
[app-notarization]: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution
[submitting-your-app]: https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/SubmittingYourApp/SubmittingYourApp.html

View File

@@ -29,7 +29,7 @@ const { app, BrowserWindow, Menu } = require('electron')
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
height: 600
})
win.loadFile('index.html')
@@ -66,7 +66,6 @@ app.on('activate', () => {
createWindow()
}
})
```
After launching the Electron application, right click the application icon.

View File

@@ -17,29 +17,29 @@ Notification objects created using this module do not appear unless their `show(
method is called.
```js title='Main Process'
const { Notification } = require("electron");
const { Notification } = require('electron')
const NOTIFICATION_TITLE = "Basic Notification";
const NOTIFICATION_BODY = "Notification from the Main process";
const NOTIFICATION_TITLE = 'Basic Notification'
const NOTIFICATION_BODY = 'Notification from the Main process'
new Notification({
title: NOTIFICATION_TITLE,
body: NOTIFICATION_BODY,
}).show();
body: NOTIFICATION_BODY
}).show()
```
Here's a full example that you can open with Electron Fiddle:
```javascript fiddle='docs/fiddles/features/notifications/main'
const { Notification } = require("electron");
const { Notification } = require('electron')
const NOTIFICATION_TITLE = "Basic Notification";
const NOTIFICATION_BODY = "Notification from the Main process";
const NOTIFICATION_TITLE = 'Basic Notification'
const NOTIFICATION_BODY = 'Notification from the Main process'
new Notification({
title: NOTIFICATION_TITLE,
body: NOTIFICATION_BODY,
}).show();
body: NOTIFICATION_BODY
}).show()
```
### Show notifications in the renderer process
@@ -48,25 +48,25 @@ Notifications can be displayed directly from the renderer process with the
[web Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API).
```js title='Renderer Process'
const NOTIFICATION_TITLE = "Title";
const NOTIFICATION_TITLE = 'Title'
const NOTIFICATION_BODY =
"Notification from the Renderer process. Click to log to console.";
const CLICK_MESSAGE = "Notification clicked";
'Notification from the Renderer process. Click to log to console.'
const CLICK_MESSAGE = 'Notification clicked'
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
() => console.log(CLICK_MESSAGE);
() => console.log(CLICK_MESSAGE)
```
Here's a full example that you can open with Electron Fiddle:
```javascript fiddle='docs/fiddles/features/notifications/renderer'
const NOTIFICATION_TITLE = "Title";
const NOTIFICATION_TITLE = 'Title'
const NOTIFICATION_BODY =
"Notification from the Renderer process. Click to log to console.";
const CLICK_MESSAGE = "Notification clicked";
'Notification from the Renderer process. Click to log to console.'
const CLICK_MESSAGE = 'Notification clicked'
new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
() => console.log(CLICK_MESSAGE);
() => console.log(CLICK_MESSAGE)
```
## Platform considerations
@@ -146,6 +146,6 @@ GNOME, and KDE.
[set-app-user-model-id]: ../api/app.md#appsetappusermodelidid-windows
[squirrel-events]: https://github.com/electron/windows-installer/blob/main/README.md#handling-squirrel-events
[toast-activator-clsid]: https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-toastactivatorclsid
[apple-notification-guidelines]: https://developer.apple.com/macos/human-interface-guidelines/system-capabilities/notifications/
[apple-notification-guidelines]: https://developer.apple.com/design/human-interface-guidelines/notifications
[windows-notification-state]: https://github.com/felixrieseberg/windows-notification-state
[macos-notification-state]: https://github.com/felixrieseberg/macos-notification-state

View File

@@ -158,13 +158,13 @@ A preload script can be attached to the main process in the `BrowserWindow` cons
```js title='main.js'
const { BrowserWindow } = require('electron')
//...
// ...
const win = new BrowserWindow({
webPreferences: {
preload: 'path/to/preload.js',
},
preload: 'path/to/preload.js'
}
})
//...
// ...
```
Because the preload script shares a global [`Window`][window-mdn] interface with the
@@ -177,7 +177,7 @@ the [`contextIsolation`][context-isolation] default.
```js title='preload.js'
window.myAPI = {
desktop: true,
desktop: true
}
```
@@ -196,7 +196,7 @@ securely:
const { contextBridge } = require('electron')
contextBridge.exposeInMainWorld('myAPI', {
desktop: true,
desktop: true
})
```

View File

@@ -29,7 +29,7 @@ To set the represented file of window, you can use the
```javascript fiddle='docs/fiddles/features/represented-file'
const { app, BrowserWindow } = require('electron')
const os = require('os');
const os = require('os')
const createWindow = () => {
const win = new BrowserWindow({

View File

@@ -9,7 +9,7 @@ toc_max_heading_level: 3
:::info Reporting security issues
For information on how to properly disclose an Electron vulnerability,
see [SECURITY.md](https://github.com/electron/electron/tree/main/SECURITY.md).
see [SECURITY.md](https://github.com/electron/electron/blob/main/SECURITY.md).
For upstream Chromium vulnerabilities: Electron keeps up to date with alternating
Chromium releases. For more information, see the
@@ -742,19 +742,19 @@ You should be validating the `sender` of **all** IPC messages by default.
```js title='main.js (Main Process)'
// Bad
ipcMain.handle('get-secrets', () => {
return getSecrets();
});
return getSecrets()
})
// Good
ipcMain.handle('get-secrets', (e) => {
if (!validateSender(e.senderFrame)) return null;
return getSecrets();
});
if (!validateSender(e.senderFrame)) return null
return getSecrets()
})
function validateSender(frame) {
function validateSender (frame) {
// Value the host of the URL using an actual URL parser and an allowlist
if ((new URL(frame.url)).host === 'electronjs.org') return true;
return false;
if ((new URL(frame.url)).host === 'electronjs.org') return true
return false
}
```

View File

@@ -241,5 +241,5 @@ apps:
[electron-packager]: https://github.com/electron/electron-packager
[electron-forge]: https://github.com/electron/forge
[electron-builder]: https://github.com/electron-userland/electron-builder
[electron-installer-debian]: https://github.com/unindented/electron-installer-debian
[electron-installer-debian]: https://github.com/electron-userland/electron-installer-debian
[electron-winstaller]: https://github.com/electron/windows-installer

View File

@@ -125,7 +125,7 @@ main process entry point is configured correctly. Create a `main.js` file in the
of your project with a single line of code:
```js title='main.js'
console.log(`Hello from Electron 👋`)
console.log('Hello from Electron 👋')
```
Because Electron's main process is a Node.js runtime, you can execute arbitrary Node.js code
@@ -134,7 +134,7 @@ add `electron .` to the `start` command in the [`scripts`][package-scripts]
field of your package.json. This command will tell the Electron executable to look for the main
script in the current directory and run it in dev mode.
```json {8-10} title='package.json'
```json {7} title='package.json'
{
"name": "my-electron-app",
"version": "1.0.0",
@@ -199,7 +199,7 @@ const { app, BrowserWindow } = require('electron')
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
height: 600
})
win.loadFile('index.html')
@@ -247,7 +247,7 @@ The `createWindow()` function loads your web page into a new BrowserWindow insta
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
height: 600
})
win.loadFile('index.html')
@@ -274,7 +274,7 @@ calling `createWindow()` once its promise is fulfilled.
You typically listen to Node.js events by using an emitter's `.on` function.
```diff
+ app.on('ready').then(() => {
+ app.on('ready', () => {
- app.whenReady().then(() => {
createWindow()
})

View File

@@ -73,7 +73,7 @@ const { contextBridge } = require('electron')
contextBridge.exposeInMainWorld('versions', {
node: () => process.versions.node,
chrome: () => process.versions.chrome,
electron: () => process.versions.electron,
electron: () => process.versions.electron
// we can also expose variables, not just functions
})
```
@@ -90,8 +90,8 @@ const createWindow = () => {
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
@@ -183,7 +183,7 @@ contextBridge.exposeInMainWorld('versions', {
node: () => process.versions.node,
chrome: () => process.versions.chrome,
electron: () => process.versions.electron,
ping: () => ipcRenderer.invoke('ping'),
ping: () => ipcRenderer.invoke('ping')
// we can also expose variables, not just functions
})
```
@@ -202,7 +202,7 @@ Then, set up your `handle` listener in the main process. We do this _before_
loading the HTML file so that the handler is guaranteed to be ready before
you send out the `invoke` call from the renderer.
```js {1,12} title="main.js"
```js {1,15} title="main.js"
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')
@@ -211,13 +211,15 @@ const createWindow = () => {
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
preload: path.join(__dirname, 'preload.js')
}
})
ipcMain.handle('ping', () => 'pong')
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
app.whenReady().then(() => {
ipcMain.handle('ping', () => 'pong')
createWindow()
})
```
Once you have the sender and receiver set up, you can now send messages from the renderer

View File

@@ -153,14 +153,14 @@ For more information on code signing, check out the
module.exports = {
packagerConfig: {
osxSign: {},
//...
// ...
osxNotarize: {
tool: 'notarytool',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID,
teamId: process.env.APPLE_TEAM_ID
}
//...
// ...
}
}
```
@@ -170,17 +170,17 @@ module.exports = {
```js title='forge.config.js'
module.exports = {
//...
// ...
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
certificateFile: './cert.pfx',
certificatePassword: process.env.CERTIFICATE_PASSWORD,
},
},
],
//...
certificatePassword: process.env.CERTIFICATE_PASSWORD
}
}
]
// ...
}
```

View File

@@ -86,13 +86,13 @@ module.exports = {
config: {
repository: {
owner: 'github-user-name',
name: 'github-repo-name',
name: 'github-repo-name'
},
prerelease: false,
draft: true,
},
},
],
draft: true
}
}
]
}
```

View File

@@ -104,8 +104,7 @@ setInterval(() => {
```
Once your application is [packaged](./application-distribution.md),
it will receive an update for each new
[GitHub Release](https://help.github.com/articles/creating-releases/) that you
it will receive an update for each new [GitHub Release][gh-releases] that you
publish.
### Step 3: Notifying users when updates are available
@@ -122,7 +121,7 @@ autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
title: 'Application Update',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail:
'A new version has been downloaded. Restart the application to apply the updates.',
'A new version has been downloaded. Restart the application to apply the updates.'
}
dialog.showMessageBox(dialogOpts).then((returnValue) => {
@@ -155,7 +154,7 @@ server-communication aspect of the process by loading your update from a local d
[vercel]: https://vercel.com
[hazel]: https://github.com/vercel/hazel
[nuts]: https://github.com/GitbookIO/nuts
[gh-releases]: https://help.github.com/articles/creating-releases/
[gh-releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release
[electron-release-server]: https://github.com/ArekSredzki/electron-release-server
[nucleus]: https://github.com/atlassian/nucleus
[update.electronjs.org]: https://github.com/electron/update.electronjs.org

View File

@@ -152,7 +152,7 @@ Once installation succeeded, you can move on to compiling your Electron app.
[app-converter]: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-run-desktop-app-converter
[add-appxpackage]: https://technet.microsoft.com/en-us/library/hh856048.aspx
[electron-packager]: https://github.com/electron/electron-packager
[electron-windows-store]: https://github.com/catalystcode/electron-windows-store
[electron-windows-store]: https://github.com/electron-userland/electron-windows-store
[background-task]: https://github.com/felixrieseberg/electron-uwp-background
[centennial-campaigns]: https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge
[how-to-update]: https://blogs.windows.com/windowsexperience/2016/08/02/how-to-get-the-windows-10-anniversary-update

View File

@@ -637,8 +637,6 @@ filenames = {
"shell/common/language_util.h",
"shell/common/logging.cc",
"shell/common/logging.h",
"shell/common/mouse_util.cc",
"shell/common/mouse_util.h",
"shell/common/node_bindings.cc",
"shell/common/node_bindings.h",
"shell/common/node_includes.h",

View File

@@ -304,7 +304,6 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__coroutine/trivial_awaitables.h",
"//buildtools/third_party/libc++/trunk/include/__debug",
"//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h",
"//buildtools/third_party/libc++/trunk/include/__errc",
"//buildtools/third_party/libc++/trunk/include/__exception/exception.h",
"//buildtools/third_party/libc++/trunk/include/__exception/exception_ptr.h",
"//buildtools/third_party/libc++/trunk/include/__exception/nested_exception.h",
@@ -571,7 +570,6 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__ranges/views.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/zip_view.h",
"//buildtools/third_party/libc++/trunk/include/__split_buffer",
"//buildtools/third_party/libc++/trunk/include/__std_stream",
"//buildtools/third_party/libc++/trunk/include/__string/char_traits.h",
"//buildtools/third_party/libc++/trunk/include/__string/constexpr_c_functions.h",
"//buildtools/third_party/libc++/trunk/include/__string/extern_template_lists.h",
@@ -591,20 +589,25 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__support/xlocale/__nop_locale_mgmt.h",
"//buildtools/third_party/libc++/trunk/include/__support/xlocale/__posix_l_fallback.h",
"//buildtools/third_party/libc++/trunk/include/__support/xlocale/__strtonum_fallback.h",
"//buildtools/third_party/libc++/trunk/include/__system_error/errc.h",
"//buildtools/third_party/libc++/trunk/include/__system_error/error_category.h",
"//buildtools/third_party/libc++/trunk/include/__system_error/error_code.h",
"//buildtools/third_party/libc++/trunk/include/__system_error/error_condition.h",
"//buildtools/third_party/libc++/trunk/include/__system_error/system_error.h",
"//buildtools/third_party/libc++/trunk/include/__thread/poll_with_backoff.h",
"//buildtools/third_party/libc++/trunk/include/__thread/timed_backoff_policy.h",
"//buildtools/third_party/libc++/trunk/include/__threading_support",
"//buildtools/third_party/libc++/trunk/include/__tree",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/apply_cv.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/make_tuple_types.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/pair_like.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/sfinae_helpers.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/tuple_element.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/tuple_indices.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/tuple_like.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/tuple_like_ext.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/tuple_size.h",
"//buildtools/third_party/libc++/trunk/include/__tuple_dir/tuple_types.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/apply_cv.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/make_tuple_types.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/pair_like.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/sfinae_helpers.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/tuple_element.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/tuple_indices.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/tuple_like.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/tuple_like_ext.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/tuple_size.h",
"//buildtools/third_party/libc++/trunk/include/__tuple/tuple_types.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_const.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_cv.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_lvalue_reference.h",

View File

@@ -12,6 +12,14 @@ BrowserWindow.prototype._init = function (this: BWT) {
// Avoid recursive require.
const { app } = require('electron');
// Set ID at constructon time so it's accessible after
// underlying window destruction.
const id = this.id;
Object.defineProperty(this, 'id', {
value: id,
writable: false
});
const nativeSetBounds = this.setBounds;
this.setBounds = (bounds, ...opts) => {
bounds = {

View File

@@ -26,7 +26,7 @@ export const roleList: Record<RoleId, Role> = {
get label () {
return isLinux ? 'About' : `About ${app.name}`;
},
...(isWindows && { appMethod: () => app.showAboutPanel() })
...((isWindows || isLinux) && { appMethod: () => app.showAboutPanel() })
},
close: {
label: isMac ? 'Close Window' : 'Close',

View File

@@ -12,6 +12,10 @@ export function fetch (input: RequestInfo, init?: RequestInit): Promise<Response
return session.defaultSession.fetch(input, init);
}
export function resolveHost (host: string, options?: Electron.ResolveHostOptions): Promise<Electron.ResolvedHost> {
return session.defaultSession.resolveHost(host, options);
}
exports.isOnline = isOnline;
Object.defineProperty(exports, 'online', {

View File

@@ -5,6 +5,7 @@ const {
createPowerMonitor,
getSystemIdleState,
getSystemIdleTime,
getCurrentThermalState,
isOnBatteryPower
} = process._linkedBinding('electron_browser_power_monitor');
@@ -43,6 +44,10 @@ class PowerMonitor extends EventEmitter {
return getSystemIdleState(idleThreshold);
}
getCurrentThermalState () {
return getCurrentThermalState();
}
getSystemIdleTime () {
return getSystemIdleTime();
}

View File

@@ -519,17 +519,10 @@ WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event,
event.preventDefault();
return defaultResponse;
} else if (response.action === 'allow') {
if (typeof response.overrideBrowserWindowOptions === 'object' && response.overrideBrowserWindowOptions !== null) {
return {
browserWindowConstructorOptions: response.overrideBrowserWindowOptions,
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false
};
} else {
return {
browserWindowConstructorOptions: {},
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false
};
}
return {
browserWindowConstructorOptions: typeof response.overrideBrowserWindowOptions === 'object' ? response.overrideBrowserWindowOptions : null,
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false
};
} else {
event.preventDefault();
console.error('The window open handler response must be an object with an \'action\' property of \'allow\' or \'deny\'.');

View File

@@ -31,11 +31,15 @@ export const syncMethods = new Set([
'redo',
'cut',
'copy',
'centerSelection',
'paste',
'pasteAndMatchStyle',
'delete',
'selectAll',
'unselect',
'scrollToTop',
'scrollToBottom',
'adjustSelection',
'replace',
'replaceMisspelling',
'findInPage',

View File

@@ -5,11 +5,11 @@
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@azure/storage-blob": "^12.9.0",
"@dsanders11/vscode-markdown-languageservice": "^0.3.0-alpha.4",
"@electron/asar": "^3.2.1",
"@electron/docs-parser": "^1.1.0",
"@electron/fiddle-core": "^1.0.4",
"@electron/github-app-auth": "^1.5.0",
"@electron/github-app-auth": "^2.0.0",
"@electron/lint-roller": "^1.2.1",
"@electron/typescript-definitions": "^8.14.0",
"@octokit/rest": "^19.0.7",
"@primer/octicons": "^10.0.0",
@@ -45,6 +45,7 @@
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha": "^7.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-typescript": "^0.14.0",
"events": "^3.2.0",
@@ -56,8 +57,6 @@
"klaw": "^3.0.0",
"lint": "^1.1.2",
"lint-staged": "^10.2.11",
"markdownlint-cli": "^0.33.0",
"mdast-util-from-markdown": "^1.2.0",
"minimist": "^1.2.6",
"null-loader": "^4.0.0",
"pre-flight": "^1.1.0",
@@ -66,7 +65,6 @@
"remark-preset-lint-markdown-style-guide": "^4.0.0",
"semver": "^5.6.0",
"shx": "^0.3.2",
"standard-markdown": "^6.0.0",
"stream-json": "^1.7.1",
"tap-xunit": "^2.4.1",
"temp": "^0.8.3",
@@ -74,10 +72,6 @@
"ts-loader": "^8.0.2",
"ts-node": "6.2.0",
"typescript": "^4.5.5",
"unist-util-visit": "^4.1.1",
"vscode-languageserver": "^8.0.2",
"vscode-languageserver-textdocument": "^1.0.7",
"vscode-uri": "^3.0.6",
"webpack": "^5.76.0",
"webpack-cli": "^4.10.0",
"wrapper-webpack-plugin": "^2.2.0"
@@ -94,11 +88,11 @@
"lint:objc": "node ./script/lint.js --objc",
"lint:py": "node ./script/lint.js --py",
"lint:gn": "node ./script/lint.js --gn",
"lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-relative-links && npm run lint:markdownlint",
"lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-fiddles && npm run lint:docs-relative-links && npm run lint:markdownlint",
"lint:docs-fiddles": "standard \"docs/fiddles/**/*.js\"",
"lint:docs-relative-links": "ts-node script/lint-docs-links.ts",
"lint:markdownlint": "markdownlint -r ./script/markdownlint-emd001.js \"*.md\" \"docs/**/*.md\"",
"lint:js-in-markdown": "standard-markdown docs",
"lint:docs-relative-links": "electron-lint-markdown-links --root docs \"**/*.md\"",
"lint:markdownlint": "electron-markdownlint \"*.md\" \"docs/**/*.md\"",
"lint:js-in-markdown": "electron-lint-markdown-standard --root docs \"**/*.md\"",
"create-api-json": "node script/create-api-json.js",
"create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --api=electron-api.json && node spec/ts-smoke/runner.js",
"gn-typescript-definitions": "npm run create-typescript-definitions && shx cp electron.d.ts",
@@ -142,7 +136,7 @@
],
"docs/api/**/*.md": [
"ts-node script/gen-filenames.ts",
"markdownlint --config .markdownlint.autofix.json --fix",
"electron-markdownlint --config .markdownlint.autofix.json --fix",
"git add filenames.auto.gni"
],
"{*.patch,.patches}": [

1
patches/angle/.patches Normal file
View File

@@ -0,0 +1 @@
cherry-pick-d0ee0197ddff.patch

View File

@@ -0,0 +1,208 @@
From d0ee0197ddff25fe1a9876511c07542ac483702d Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Wed, 03 May 2023 13:41:36 -0400
Subject: [PATCH] WebGL: Limit total size of private data
... not just individual arrays.
Bug: chromium:1431761
Change-Id: I721e29aeceeaf12c3f6a67b668abffb8dfbc89b0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4503753
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
---
diff --git a/src/compiler/translator/ValidateTypeSizeLimitations.cpp b/src/compiler/translator/ValidateTypeSizeLimitations.cpp
index 6097b6d..2a033ad 100644
--- a/src/compiler/translator/ValidateTypeSizeLimitations.cpp
+++ b/src/compiler/translator/ValidateTypeSizeLimitations.cpp
@@ -35,7 +35,9 @@
{
public:
ValidateTypeSizeLimitationsTraverser(TSymbolTable *symbolTable, TDiagnostics *diagnostics)
- : TIntermTraverser(true, false, false, symbolTable), mDiagnostics(diagnostics)
+ : TIntermTraverser(true, false, false, symbolTable),
+ mDiagnostics(diagnostics),
+ mTotalPrivateVariablesSize(0)
{
ASSERT(diagnostics);
}
@@ -93,18 +95,33 @@
const bool isPrivate = variableType.getQualifier() == EvqTemporary ||
variableType.getQualifier() == EvqGlobal ||
variableType.getQualifier() == EvqConst;
- if (layoutEncoder.getCurrentOffset() > kMaxPrivateVariableSizeInBytes && isPrivate)
+ if (isPrivate)
{
- error(asSymbol->getLine(),
- "Size of declared private variable exceeds implementation-defined limit",
- asSymbol->getName());
- return false;
+ if (layoutEncoder.getCurrentOffset() > kMaxPrivateVariableSizeInBytes)
+ {
+ error(asSymbol->getLine(),
+ "Size of declared private variable exceeds implementation-defined limit",
+ asSymbol->getName());
+ return false;
+ }
+ mTotalPrivateVariablesSize += layoutEncoder.getCurrentOffset();
}
}
return true;
}
+ void validateTotalPrivateVariableSize()
+ {
+ if (mTotalPrivateVariablesSize > kMaxPrivateVariableSizeInBytes)
+ {
+ mDiagnostics->error(
+ TSourceLoc{},
+ "Total size of declared private variables exceeds implementation-defined limit",
+ "");
+ }
+ }
+
private:
void error(TSourceLoc loc, const char *reason, const ImmutableString &token)
{
@@ -213,6 +230,8 @@
TDiagnostics *mDiagnostics;
std::vector<int> mLoopSymbolIds;
+
+ size_t mTotalPrivateVariablesSize;
};
} // namespace
@@ -223,6 +242,7 @@
{
ValidateTypeSizeLimitationsTraverser validate(symbolTable, diagnostics);
root->traverse(&validate);
+ validate.validateTotalPrivateVariableSize();
return diagnostics->numErrors() == 0;
}
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index e62c8fb..996bad1 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -5271,11 +5271,12 @@
// fairly small array.
constexpr char kVSArrayOK[] =
R"(varying vec4 color;
-const int array_size = 1000;
+const int array_size = 500;
void main()
{
mat2 array[array_size];
- if (array[0][0][0] == 2.0)
+ mat2 array2[array_size];
+ if (array[0][0][0] + array2[0][0][0] == 2.0)
color = vec4(0.0, 1.0, 0.0, 1.0);
else
color = vec4(1.0, 0.0, 0.0, 1.0);
@@ -5353,6 +5354,103 @@
EXPECT_EQ(0u, program);
}
+// Reject attempts to allocate too much private memory.
+// This is an implementation-defined limit - crbug.com/1431761.
+TEST_P(WebGLCompatibilityTest, ValidateTotalPrivateSize)
+{
+ constexpr char kTooLargeGlobalMemory1[] =
+ R"(precision mediump float;
+
+// 1 MB / 16 bytes per vec4 = 65536
+vec4 array[32768];
+vec4 array2[32769];
+
+void main()
+{
+ if (array[0].x + array[1].x == 0.)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+})";
+
+ constexpr char kTooLargeGlobalMemory2[] =
+ R"(precision mediump float;
+
+// 1 MB / 16 bytes per vec4 = 65536
+vec4 array[32767];
+vec4 array2[32767];
+vec4 x, y, z;
+
+void main()
+{
+ if (array[0].x + array[1].x == x.w + y.w + z.w)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+})";
+
+ constexpr char kTooLargeGlobalAndLocalMemory1[] =
+ R"(precision mediump float;
+
+// 1 MB / 16 bytes per vec4 = 65536
+vec4 array[32768];
+
+void main()
+{
+ vec4 array2[32769];
+ if (array[0].x + array[1].x == 2.0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+})";
+
+ // Note: The call stack is not taken into account for the purposes of total memory calculation.
+ constexpr char kTooLargeGlobalAndLocalMemory2[] =
+ R"(precision mediump float;
+
+// 1 MB / 16 bytes per vec4 = 65536
+vec4 array[32768];
+
+float f()
+{
+ vec4 array2[16384];
+ return array2[0].x;
+}
+
+float g()
+{
+ vec4 array3[16383];
+ return array3[0].x;
+}
+
+float h()
+{
+ vec4 value;
+ float value2
+ return value.x + value2;
+}
+
+void main()
+{
+ if (array[0].x + f() + g() + h() == 2.0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+})";
+
+ GLuint program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalMemory1);
+ EXPECT_EQ(0u, program);
+
+ program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalMemory2);
+ EXPECT_EQ(0u, program);
+
+ program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalAndLocalMemory1);
+ EXPECT_EQ(0u, program);
+
+ program = CompileProgram(essl1_shaders::vs::Simple(), kTooLargeGlobalAndLocalMemory2);
+ EXPECT_EQ(0u, program);
+}
+
// Linking should fail when corresponding vertex/fragment uniform blocks have different precision
// qualifiers.
TEST_P(WebGL2CompatibilityTest, UniformBlockPrecisionMismatch)

View File

@@ -20,10 +20,10 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
case ssl_open_record_error:
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
index 86e8eb33e2f99b9a6173550027cfd0812a39614e..f2aac85c096bef42a015135b02936e3d4e9a4c56 100644
index 6b4549633585f8a65fb7b285a9be4ba83db355db..f9367d3c050f89011a09b847c29df31f321ffd09 100644
--- a/ssl/ssl_lib.cc
+++ b/ssl/ssl_lib.cc
@@ -1320,7 +1320,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
@@ -1335,7 +1335,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
}
if (ret_code == 0) {
@@ -32,7 +32,7 @@ index 86e8eb33e2f99b9a6173550027cfd0812a39614e..f2aac85c096bef42a015135b02936e3d
return SSL_ERROR_ZERO_RETURN;
}
// An EOF was observed which violates the protocol, and the underlying
@@ -2597,13 +2597,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
@@ -2624,13 +2624,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
return CRYPTO_get_ex_data(&ctx->ex_data, idx);
}
@@ -48,10 +48,10 @@ index 86e8eb33e2f99b9a6173550027cfd0812a39614e..f2aac85c096bef42a015135b02936e3d
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
RSA *(*cb)(SSL *ssl, int is_export,
diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
index f51c11efc12209377773204808b85c9cbf5d3bff..d19fd1f9643f99fdd56753a942fccefff08728ac 100644
index 854068f44b2bb8f738e41fab059b62ced9309fce..a080edd8b5ec48e433afa45d6246b30e9f7221f0 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -8460,11 +8460,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8459,11 +8459,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(ret, 0);
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_ZERO_RETURN);
@@ -63,7 +63,7 @@ index f51c11efc12209377773204808b85c9cbf5d3bff..d19fd1f9643f99fdd56753a942fcceff
// Although the client has seen close_notify, it should continue to report
// |SSL_ERROR_SYSCALL| when its writes fail.
ret = SSL_write(client.get(), data, sizeof(data));
@@ -8472,22 +8467,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8471,22 +8466,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_SYSCALL);
EXPECT_TRUE(write_failed);
write_failed = false;

View File

@@ -126,4 +126,5 @@ expose_v8initializer_codegenerationcheckcallbackinmainthread.patch
chore_patch_out_profile_methods_in_profile_selections_cc.patch
add_gin_converter_support_for_arraybufferview.patch
chore_defer_usb_service_getdevices_request_until_usb_service_is.patch
revert_roll_clang_rust_llvmorg-16-init-17653-g39da55e8-3.patch
cherry-pick-48a136e77e6d.patch
cherry-pick-e6e23ba00379.patch

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 7bf09dd8870040e74cd1a7653665d0806910378c..ec6d1554075ee5454f79e98d0e2e539395499dbe 100644
index a399e1ba0e6728aa8d2869864d3c328ba61e779b..b7dd5e0e48af2a88aad11139f5951d917d8d4f9d 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -243,6 +243,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -258,6 +258,10 @@ int GpuMain(MainFunctionParams parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,7 +24,7 @@ index 7bf09dd8870040e74cd1a7653665d0806910378c..ec6d1554075ee5454f79e98d0e2e5393
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -327,7 +331,6 @@ int GpuMain(MainFunctionParams parameters) {
@@ -342,7 +346,6 @@ int GpuMain(MainFunctionParams parameters) {
const_cast<base::CommandLine*>(&command_line), gpu_preferences);
const bool dead_on_arrival = !init_success;

View File

@@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the
context, which can cause some preload scripts to trip.
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index 6c92a2856e447bdda11c7ed2c64b79b93a0eca26..03dedde2d83e6b09fb7e90be7dfdce246f301d8f 100644
index fef4c8e02067c44ed804c8b53db1007fae2d2a76..b36304ee0a832c5e1e2fd3af6151b7b03fd98ec4 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -136,6 +136,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -137,6 +137,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
virtual void DidHandleOnloadEvents() {}
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
@@ -23,10 +23,10 @@ index 6c92a2856e447bdda11c7ed2c64b79b93a0eca26..03dedde2d83e6b09fb7e90be7dfdce24
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index ba3672c8a22c5316a225ee3fc0468b296d9c9e56..bd303758e7c53698bd268dc5caa0f596f2b64d81 100644
index 026a6934997f0825c3f2c0a40551ce7784a7b828..5bceb2baec943a2f58416c0ca6093014f9d68d7c 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4395,6 +4395,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4417,6 +4417,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index ba3672c8a22c5316a225ee3fc0468b296d9c9e56..bd303758e7c53698bd268dc5caa0f596
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index a441c84491884e92e1cc15e7b581e8598dafa30d..fb77bfde937563874a02a1ce54e6e39c8fa7405a 100644
index 516a8140f79cc7f8ffe4b0665184d7d3d6111da9..fce2608070d2bf31b6b02de47102aff870c8229f 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -609,6 +609,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -608,6 +608,8 @@ class CONTENT_EXPORT RenderFrameImpl
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@@ -53,10 +53,10 @@ index a441c84491884e92e1cc15e7b581e8598dafa30d..fb77bfde937563874a02a1ce54e6e39c
int world_id) override;
void DidChangeScrollOffset() override;
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index ee528077545133ab14002823ce302f6e36780207..8e08121bc2402fcd7c7008c3aa914cd06c963c96 100644
index dfd33eede0a8b0935a06eeb8f505a8d0738afa19..06827403830cb730b2521c715ec06aedbf7339c6 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -603,6 +603,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -606,6 +606,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -79,10 +79,10 @@ index e7d4256fa96f5bc8ad71bd13b6b33feef32b443f..0dfeda68a4dbfd6b442f8d8f928c8cb8
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 b21defea45e641eef86c72a91ccd03a55e5cf037..cc0f6e555762a0baaea1e2fb00f1bc745f725282 100644
index 2c526726ff1ed7008152086210b25103ce308d5b..c62ab44289bf32ac9d40d3df45f6363409f0dea9 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -317,6 +317,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -315,6 +315,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
@@ -92,7 +92,7 @@ index b21defea45e641eef86c72a91ccd03a55e5cf037..cc0f6e555762a0baaea1e2fb00f1bc74
int32_t world_id) = 0;
virtual bool AllowScriptExtensions() = 0;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
index 7699652913870d0cc323091487d6869c90a716d1..840cdcbace2929b98a292769c5ee6e6aaed135c6 100644
index 56ad2a8f3fabe03b2c285231d0e99dbcbaf2a9d2..130423e45f17998bf5a28c719115715941ae6620 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -110,10 +110,10 @@ index 7699652913870d0cc323091487d6869c90a716d1..840cdcbace2929b98a292769c5ee6e6a
v8::Local<v8::Context> context,
int32_t world_id) {
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
index 7788f1e48f10aca1bffac3f35ac4e03351b7ce8d..4533c4c6b9a0f10c26ac1ee5871ddd1325e5ef4a 100644
index cd3cc4ea62f8956b87c711362520308f062de76e..75dd52f5eb3e6a06cd6185d590ba20e17b7e4e1d 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -82,6 +82,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -83,6 +83,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override;

View File

@@ -8,10 +8,10 @@ was removed as part of the Raw Clipboard API scrubbing.
https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
index 069a4481ca6318215dd8a86b71aa7cacfb635173..605c5b8f8a7e50a22c94c6818cbdd95ced14fc15 100644
index 0aef31c1e881fdcb5bfe09fd5ba47b1c5bd861bc..0864450bdcb5577b3ccdf2b6bd97198f283db295 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
@@ -232,6 +232,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
@@ -249,6 +249,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -29,10 +29,10 @@ index 069a4481ca6318215dd8a86b71aa7cacfb635173..605c5b8f8a7e50a22c94c6818cbdd95c
objects_.clear();
platform_representations_.clear();
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
index 2a9964f12a3a17103cd473de74a039d01e117041..873cd66831b7cb4d762d3b7abf5fd08623d3d73b 100644
index 569aa7f3673f16c126e7c0b8ea34cac483c7b38d..e494fcc56d4182175943ce0f4190f23a86b9f3a5 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.h
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
@@ -87,6 +87,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
@@ -91,6 +91,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
// This is only used to write custom format data.
void WriteData(const std::u16string& format, mojo_base::BigBuffer data);

View File

@@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView
This allows us to disable throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 172f0b47e2c77cc15ddf0451e86d907d73b5bb95..141220d97a195e2589e1bc0ad303c085d347274e 100644
index 43c8a9913c4b3a4fe0c3151d885c5a13a9fdc74b..0cd8005e743d3bb662c2d439b552a17b1db9b0ab 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -689,6 +689,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -695,6 +695,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}

View File

@@ -15,7 +15,7 @@ Refs changes in:
This patch reverts the changes to fix associated crashes in Electron.
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
index b7bff829d779036ce0341b52ce9adc28eac91fa2..79b48d028ff6742d0d43ac6d32242f505587dafd 100644
index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a08332a4ce 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -125,14 +125,6 @@ bool Frame::Detach(FrameDetachType type) {
@@ -49,10 +49,10 @@ index b7bff829d779036ce0341b52ce9adc28eac91fa2..79b48d028ff6742d0d43ac6d32242f50
// its owning reference back to our owning LocalFrame.
client_->Detached(type);
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 46a21ac9dfe9308bbb1b2fb44249cb1ce6e8dcf6..8b2c78985cf718e06244c73b0961a69d3a0f8ac6 100644
index ff4e8adad01b5d05bf0aa1bbac8fac5733ffb682..b01924ed532b360a7002d846b6085e308681a0ff 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -623,10 +623,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -625,10 +625,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index 46a21ac9dfe9308bbb1b2fb44249cb1ce6e8dcf6..8b2c78985cf718e06244c73b0961a69d
if (!Client())
return false;
@@ -674,6 +670,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -676,6 +672,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -6,10 +6,10 @@ Subject: boringssl BUILD.gn
Build BoringSSL with some extra functions that nodejs needs.
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
index 40073723173388015f0c78899214ba155e7cdc53..72978c43a522e5716ba06e8b989710cc99bd8773 100644
index 6fb13437c6bcca2aff102b04f3a46d2ad6a791c5..c61c60c7cb968c2b730a14de9ac0629aaceb73d3 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -44,6 +44,20 @@ config("no_asm_config") {
@@ -49,6 +49,20 @@ config("no_asm_config") {
all_sources = crypto_sources + ssl_sources
all_headers = crypto_headers + ssl_headers
@@ -28,5 +28,5 @@ index 40073723173388015f0c78899214ba155e7cdc53..72978c43a522e5716ba06e8b989710cc
+ ]
+}
# Windows' assembly is built with NASM. The other platforms use the platform
# assembler. Exclude Windows ARM64 because NASM targets x86 and x64 only.
if (enable_rust_boringssl) {
rust_bindgen("raw_bssl_sys_bindings") {

View File

@@ -13,7 +13,7 @@ This patch can be removed when enable_print_content_analysis can be more
easily enabled or disabled by default with buildflags.
diff --git a/printing/buildflags/buildflags.gni b/printing/buildflags/buildflags.gni
index 8a688b2d196070caf8076bc5621eca2649a6f136..c148f511628ac13f0b50faab01f7308538f102a9 100644
index e617f46226d9c1c43353db51d6e4764ec8ed66e8..b7c99a725eda84d1c3f7b334633c19be67714363 100644
--- a/printing/buildflags/buildflags.gni
+++ b/printing/buildflags/buildflags.gni
@@ -44,7 +44,7 @@ declare_args() {

View File

@@ -11,7 +11,7 @@ if we ever align our .pak file generation with Chrome we can remove this
patch.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 7c3a9357e6155e841215fd73ce9b71cbd688b676..04300a24bc1b3a6a0d326d177a4d9e07076b4026 100644
index f9e148eb5b5a9a1da534f5db19227e327282eac0..d95ba090ae13b036b694724d95834e5a62a3fff9 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -193,11 +193,16 @@ if (!is_android && !is_mac) {
@@ -33,10 +33,10 @@ index 7c3a9357e6155e841215fd73ce9b71cbd688b676..04300a24bc1b3a6a0d326d177a4d9e07
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 44f71ea5d24fe1fc45d8bce83f1b9e5d62f9aec4..6024f883b60a5d52ac6e8f8c69e27d1a560ad459 100644
index acf48b7ffd061192c202893ebd1ba09b4df00187..27f5760aadd3a6892175a007b0ed71950bca2983 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4567,7 +4567,7 @@ static_library("browser") {
@@ -4595,7 +4595,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 44f71ea5d24fe1fc45d8bce83f1b9e5d62f9aec4..6024f883b60a5d52ac6e8f8c69e27d1a
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index e26649fe6b687cf0039f11b325aa8b5729667c5e..7a4922a947091a55d256134083789f7a474a90da 100644
index d6515aedf07677dd10c85acecb17877b041abb7f..15197af41fff21200f70cb6b88448cf173785474 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6385,7 +6385,6 @@ test("unit_tests") {
@@ -6423,7 +6423,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index e26649fe6b687cf0039f11b325aa8b5729667c5e..7a4922a947091a55d256134083789f7a
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -6411,6 +6410,10 @@ test("unit_tests") {
@@ -6449,6 +6448,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index e26649fe6b687cf0039f11b325aa8b5729667c5e..7a4922a947091a55d256134083789f7a
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -7337,7 +7340,6 @@ test("unit_tests") {
@@ -7389,7 +7392,6 @@ test("unit_tests") {
}
deps += [
@@ -76,7 +76,7 @@ index e26649fe6b687cf0039f11b325aa8b5729667c5e..7a4922a947091a55d256134083789f7a
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:test_support",
@@ -7415,6 +7417,10 @@ test("unit_tests") {
@@ -7470,6 +7472,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]

View File

@@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
rebuild the entire tree.
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index ca7debdbbd76a48ff322fd7665ff99a27e2e2691..21cc8f57ed0fe4151a95bb9520d84e73988de6af 100644
index 33651426b6d5a591a9565dfc0d6418d486a3e480..82ec974552d89ce178c19e67ff19cfba2564ab3e 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {

View File

@@ -6,10 +6,10 @@ 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 5c15cdf2ab2a8d41774917e6c006247ea9af44ab..b684afd5ef09fc220c042c44e5fcf7032e4bc92d 100644
index 8417fcda40d49733b5fa6cac56e6caf623efc237..ff3d085f931ae822b2fe8d0eb2c822f0e9ac0d95 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1036,6 +1036,7 @@ component("base") {
@@ -1032,6 +1032,7 @@ component("base") {
"//build/config/compiler:prevent_unsafe_narrowing",
"//build/config/compiler:wexit_time_destructors",
"//build/config/compiler:wglobal_constructors",
@@ -18,7 +18,7 @@ index 5c15cdf2ab2a8d41774917e6c006247ea9af44ab..b684afd5ef09fc220c042c44e5fcf703
deps = [
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 21cc8f57ed0fe4151a95bb9520d84e73988de6af..421fc44fa6ee63b60e65c973dd8920d339cb01f6 100644
index 82ec974552d89ce178c19e67ff19cfba2564ab3e..9c0a08d708535b1559e206e5bb35f16b24a61941 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -355,7 +355,6 @@ default_compiler_configs = [
@@ -55,10 +55,10 @@ index 0625f07f317de46af619fdb279be78d9ecdc0029..5897820839d6d57ada22a83fe753e3a6
"alert.h",
"alert.mm",
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 6926bd6766603f8de2237447c0a8fde2d09b67b4..707a943dd2bbc89917bd4b5b0fbc1d42452908a8 100644
index 06e4c47bd5f37c041d93808cf712e9eb028ff1b2..5b0a12d8b69c0b79fefcb9194e0f3fb88c4c7051 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -314,6 +314,7 @@ viz_component("service") {
@@ -322,6 +322,7 @@ viz_component("service") {
frameworks += [ "CoreGraphics.framework" ]
}
@@ -66,7 +66,7 @@ index 6926bd6766603f8de2237447c0a8fde2d09b67b4..707a943dd2bbc89917bd4b5b0fbc1d42
}
if (is_android || use_ozone) {
@@ -568,6 +569,8 @@ viz_source_set("unit_tests") {
@@ -576,6 +577,8 @@ viz_source_set("unit_tests") {
"display_embedder/software_output_device_mac_unittest.mm",
]
frameworks = [ "IOSurface.framework" ]
@@ -76,7 +76,7 @@ index 6926bd6766603f8de2237447c0a8fde2d09b67b4..707a943dd2bbc89917bd4b5b0fbc1d42
if (is_win) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 3b1d9b1a41903d57e65517a046f30b11873b8b73..e231734571cadb6f5aebe49cf853c54f66d7fd8b 100644
index ab9889dc4d631df1ddc61565eb0fe35c06e45b72..416b801add9b122a0c8d9747bf46f0096cf70464 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -56,6 +56,7 @@ source_set("browser") {
@@ -88,7 +88,7 @@ index 3b1d9b1a41903d57e65517a046f30b11873b8b73..e231734571cadb6f5aebe49cf853c54f
libs = []
frameworks = []
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index a92d1339b0ec7980dc9b73dcbad834c3ffca8211..5a07df3e8a31f6d5bfc5d27bf804517fb27239b2 100644
index a164080599beb28449c6bda91a0f7373c6434019..44750c770ff445cf1b38da27922caa94357baac0 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -170,6 +170,7 @@ source_set("common") {
@@ -100,7 +100,7 @@ index a92d1339b0ec7980dc9b73dcbad834c3ffca8211..5a07df3e8a31f6d5bfc5d27bf804517f
public_deps = [
":mojo_bindings",
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 3ec54c242fb920a53fcaa6d8040f2ec88c2727df..27dee1596183d2ead5290a60c08e47e69e905d21 100644
index 487c06de8be47be8508ef01dd84e444c2cea95ce..c6825189ba5f75f54e6cdbae9a1e9439f361079c 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -224,6 +224,7 @@ target(link_target_type, "renderer") {
@@ -112,7 +112,7 @@ index 3ec54c242fb920a53fcaa6d8040f2ec88c2727df..27dee1596183d2ead5290a60c08e47e6
public_deps = [
diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn
index 5e9f447e4d946cd48d7b18d81c256baa169f93ea..fcfda1b4fde66c39b53a52d57c5e57b7f239bda1 100644
index 642afd72cc0f98fe2590cef0c470f378eabb939e..894769a5de698767117339cab0fc2942d1a20b90 100644
--- a/device/bluetooth/BUILD.gn
+++ b/device/bluetooth/BUILD.gn
@@ -240,6 +240,7 @@ component("bluetooth") {
@@ -124,10 +124,10 @@ index 5e9f447e4d946cd48d7b18d81c256baa169f93ea..fcfda1b4fde66c39b53a52d57c5e57b7
if (is_mac) {
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn
index 89e0e91bb24cb1b92abb8670f56328499c0669e0..6b6dd9c74011c1acafb931842d6675ff65e17bd9 100644
index f52c3b6c8daa545baf92eccb6aff4f9afad27632..18ba76df48107403b4996245f3b581edf0269aa7 100644
--- a/gpu/ipc/service/BUILD.gn
+++ b/gpu/ipc/service/BUILD.gn
@@ -119,6 +119,7 @@ component("service") {
@@ -123,6 +123,7 @@ component("service") {
"QuartzCore.framework",
]
defines += [ "GL_SILENCE_DEPRECATION" ]
@@ -136,7 +136,7 @@ index 89e0e91bb24cb1b92abb8670f56328499c0669e0..6b6dd9c74011c1acafb931842d6675ff
if (is_ios) {
sources += [
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index f1b4cd5055d00df425926e83a3b2e7f32af4c2e6..a80aaa7fde1fd9c70e7038aef4e322f1ec6a307a 100644
index 609c60d94cdbf4755f60323734b976b49f03fecb..09a3871bfef3ba7a523ac37a80a4aa86ce2975ae 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -194,6 +194,7 @@ source_set("audio") {
@@ -189,7 +189,7 @@ index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a980
source_set("sandbox_unittests") {
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
index 94aece314a1ba9418f1e5a3e015088a3395500d4..239527d1aebefa2496a5d3fe2afa2ab1e8c63bed 100644
index cf57dd886874729872f949a08997e454bddaba3c..7a9d82150349219aae672cd22ae26bcaef3b332d 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -304,6 +304,7 @@ component("core") {
@@ -226,10 +226,10 @@ index ebc2470893838ec41ac1bf536c5a6db304bfa7cb..4a2082c2fed4e220cb8cbc2c803f682c
if (use_atk) {
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index 9631446ea47a2d8c5d2483ed13cf17a023c49ab6..0e61c424c7529cd469582d200bb6f42e795942a0 100644
index 4beabe5a2daf781521af70be6c5132c64848c9b7..4b69d53ac4a2ae6578ac3688c63d8d1a06a9357d 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -343,6 +343,7 @@ component("base") {
@@ -341,6 +341,7 @@ component("base") {
"l10n/l10n_util_mac.mm",
"resource/resource_bundle_mac.mm",
]
@@ -238,7 +238,7 @@ index 9631446ea47a2d8c5d2483ed13cf17a023c49ab6..0e61c424c7529cd469582d200bb6f42e
if (is_apple) {
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
index 20e72272bfd36d8411e7ecb8a83c75d9f95632e4..9784269499bccc19161a613aa1bb3a35132e0b32 100644
index 1bfc640fe1443ef783977ac16510d5e042db9137..fac4aad72c4de0657df64ec49e3d15b009541f69 100644
--- a/ui/display/BUILD.gn
+++ b/ui/display/BUILD.gn
@@ -67,6 +67,10 @@ component("display") {
@@ -253,7 +253,7 @@ index 20e72272bfd36d8411e7ecb8a83c75d9f95632e4..9784269499bccc19161a613aa1bb3a35
if (is_win) {
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index 00f83601160eb795067bce9532baeaa078259e68..37e40a1bcf770a060fe7803bafb08274254a3fdf 100644
index 34a269ee4d47a2597fd098bc9eabe10685f4fc86..8a96f5abc4e0092bca15dbf6e5098a64d81a3ff7 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -193,6 +193,7 @@ component("gfx") {
@@ -265,7 +265,7 @@ index 00f83601160eb795067bce9532baeaa078259e68..37e40a1bcf770a060fe7803bafb08274
if (is_win) {
sources += [
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 5aae27d937eb26f0b9f8bdf4f38a5fc48c930ab4..dc8da6198ebf689cf29adc5073c0d5f104535ab6 100644
index 11515d6de3e8b017f03f4d6665f1e57b1f6dceb3..6b5c3d3a9f6cab7dcc97830f2e76c93b3ed79d8d 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -675,6 +675,7 @@ component("views") {

View File

@@ -9,10 +9,10 @@ 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 814c7d68ef10f4b0978583ecb6983407b2d57ddf..79336d50231e352f83d3e06f35bacdfac0289f2a 100644
index 5afe83c262bcd2cc9dd93d22807ef1cf2350e583..3ac38d7ed50be9ba1670bb2863475a192baacc3a 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7680,6 +7680,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -7776,6 +7776,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index 814c7d68ef10f4b0978583ecb6983407b2d57ddf..79336d50231e352f83d3e06f35bacdfa
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 336854b4fe339d7229f309d59984752ad95261cc..ac1fcc365e9bb093b4c45319f1d1f4cb2e79b818 100644
index db08fe0124e425b039d76cb28653113af9e17d8e..941450ac84b3580f899dd7c286c3c276d2fba888 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4156,6 +4156,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4164,6 +4164,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@@ -37,7 +37,7 @@ index 336854b4fe339d7229f309d59984752ad95261cc..ac1fcc365e9bb093b4c45319f1d1f4cb
// 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
@@ -4197,12 +4203,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4205,12 +4211,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -51,10 +51,10 @@ index 336854b4fe339d7229f309d59984752ad95261cc..ac1fcc365e9bb093b4c45319f1d1f4cb
new_contents_impl, opener, params.target_url,
params.referrer.To<Referrer>(), params.disposition,
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index c7cc09531bd7b2c67085a7a3d9f98ab060a62ccb..faa0a7cd254b84af686f0c321f4d718f85636770 100644
index 12f4a2066a2a31e9852216c0cb3344095c7b0e39..588ca46227c58f9596317d6d4d05d0b3c76cbc06 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -599,6 +599,10 @@ struct CreateNewWindowParams {
@@ -593,6 +593,10 @@ struct CreateNewWindowParams {
// The navigation initiator's user activation and ad status.
blink.mojom.NavigationInitiatorActivationAndAdStatus
initiator_activation_and_ad_status;
@@ -66,10 +66,10 @@ index c7cc09531bd7b2c67085a7a3d9f98ab060a62ccb..faa0a7cd254b84af686f0c321f4d718f
// 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 cd77eefb577e610612e5af8cd7b89c064b6b6fe6..789df626f7b0592868c77c2e2ddc35522865be46 100644
index f9c88663946a9f04f7b4fbb5d2101e3f7022acc5..334b7c767ef2e7fbbee40b0a21f8f47372473b18 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -636,6 +636,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -654,6 +654,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -79,10 +79,10 @@ index cd77eefb577e610612e5af8cd7b89c064b6b6fe6..789df626f7b0592868c77c2e2ddc3552
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 01e7953e9b426c3000b45c8d4546e126135537cc..cf681fbaaa829af15f7e67b454730e2b7103b650 100644
index a60c4455d1d7d5240be6d676f97b595e07bc8986..b9438a454757e3368ca194cefedb40a266f71131 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -164,6 +164,7 @@ class NetworkService;
@@ -166,6 +166,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -90,7 +90,7 @@ index 01e7953e9b426c3000b45c8d4546e126135537cc..cf681fbaaa829af15f7e67b454730e2b
} // namespace network
namespace sandbox {
@@ -1033,6 +1034,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1062,6 +1063,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -148,10 +148,10 @@ index 5da6f93293bc5ddae88c17ac2dd8d7037ba8e8f3..76d699790fb7d92587293b14332f696d
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index dec52d1114cae6627145ec93e0d2e689d5371650..ba3672c8a22c5316a225ee3fc0468b296d9c9e56 100644
index c921467ec58895143efc7ba11661f5a529e14ad6..026a6934997f0825c3f2c0a40551ce7784a7b828 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6292,6 +6292,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6314,6 +6314,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
blink::GetNavigationInitiatorActivationAndAdStatus(
request.HasUserGesture(), GetWebFrame()->IsAdScriptInStack());
@@ -189,33 +189,33 @@ index 22254206063abe36739e1c0e7c065223ab6807d2..7f5d89f8dc8b46ac1338e73b03948725
bool opener_suppressed,
bool* no_javascript_access) override;
diff --git a/third_party/blink/public/web/web_window_features.h b/third_party/blink/public/web/web_window_features.h
index 19e505a2d434dfd219b12304238e3b654eb8395f..314d1e63c55fae58e9f7ad0ce10045d3133f4882 100644
index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59bb6a3d6b 100644
--- a/third_party/blink/public/web/web_window_features.h
+++ b/third_party/blink/public/web/web_window_features.h
@@ -34,6 +34,7 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/common/navigation/impression.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_vector.h"
+#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
@@ -68,6 +69,8 @@ struct WebWindowFeatures {
// Represents the attribution source declared by Attribution Reporting related
// window features, if any.
absl::optional<Impression> impression;
@@ -73,6 +74,8 @@ struct WebWindowFeatures {
// TODO(apaseltiner): Investigate moving this field to a non-public struct
// since it is only needed within //third_party/blink.
absl::optional<WebVector<WebString>> attribution_srcs;
+
+ String raw_features;
};
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 6e4235ff40d88880e5928cbca2a593264d6da527..814781746df6fd0b2cedc2f3aa77759aa1c7a868 100644
index 83a6e6015d0b974dc038133948e6f436c0c8ba72..e9a85e5b1ae2d7a0d4ccb7e17792431e27ce21fe 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2212,6 +2212,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2219,6 +2219,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window, completed_url);
GetWindowFeaturesFromString(features, entered_window);
+ window_features.raw_features = features;
+

View File

@@ -0,0 +1,232 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christopher Cameron <ccameron@chromium.org>
Date: Mon, 15 May 2023 23:09:29 +0000
Subject: ui::Compositor: Propagate display ID
The display ID originates in BrowserCompositorMac (for things like
ContentShell) or in NativeWidgetMacNSWindowHost (for views).
Add it as a parameter to RecyclableCompositorMac::UpdateSurface and
use this to propagate it to ui::Compositor.
Ensure that its initial value is propagated correctly in
ui::Compositor::SetLayerTreeFrameSink.
Remove use of base::LazyInstance from BrowserCompositorMac (it is
long deprecated, and touching the file triggered presubmit failures).
Bug: 1404797
Change-Id: Ib39addd1ac2a3b2f42e1958d7ab7c6c4750224f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4517539
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1144438}
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 323548d3ed7be2e2572c0048dbf5f0fa464016dc..b7311c83633746855b1e7086b6824879c1870b28 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -12,7 +12,7 @@
#include "base/command_line.h"
#include "base/containers/circular_deque.h"
-#include "base/lazy_instance.h"
+#include "base/no_destructor.h"
#include "base/trace_event/trace_event.h"
#include "components/viz/common/features.h"
#include "components/viz/common/surfaces/local_surface_id.h"
@@ -38,8 +38,10 @@
// signals to shut down will come in very late, long after things that the
// ui::Compositor depend on have been destroyed).
// https://crbug.com/805726
-base::LazyInstance<std::set<BrowserCompositorMac*>>::Leaky
- g_browser_compositors;
+std::set<BrowserCompositorMac*>& GetBrowserCompositors() {
+ static base::NoDestructor<std::set<BrowserCompositorMac*>> instance;
+ return *instance.get();
+}
} // namespace
@@ -54,7 +56,7 @@
: client_(client),
accelerated_widget_mac_ns_view_(accelerated_widget_mac_ns_view),
weak_factory_(this) {
- g_browser_compositors.Get().insert(this);
+ GetBrowserCompositors().insert(this);
root_layer_ = std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR);
// Ensure that this layer draws nothing when it does not not have delegated
@@ -75,7 +77,7 @@
delegated_frame_host_.reset();
root_layer_.reset();
- size_t num_erased = g_browser_compositors.Get().erase(this);
+ size_t num_erased = GetBrowserCompositors().erase(this);
DCHECK_EQ(1u, num_erased);
}
@@ -138,9 +140,9 @@
}
if (recyclable_compositor_) {
- recyclable_compositor_->UpdateSurface(dfh_size_pixels_,
- current.device_scale_factor,
- current.display_color_spaces);
+ recyclable_compositor_->UpdateSurface(
+ dfh_size_pixels_, current.device_scale_factor,
+ current.display_color_spaces, current.display_id);
}
}
@@ -160,9 +162,9 @@
dfh_device_scale_factor_ = new_device_scale_factor;
root_layer_->SetBounds(gfx::Rect(dfh_size_dip_));
if (recyclable_compositor_) {
- recyclable_compositor_->UpdateSurface(dfh_size_pixels_,
- current.device_scale_factor,
- current.display_color_spaces);
+ recyclable_compositor_->UpdateSurface(
+ dfh_size_pixels_, current.device_scale_factor,
+ current.display_color_spaces, current.display_id);
}
}
delegated_frame_host_->EmbedSurface(
@@ -252,9 +254,9 @@
recyclable_compositor_ = std::make_unique<ui::RecyclableCompositorMac>(
content::GetContextFactory());
display::ScreenInfo current = client_->GetCurrentScreenInfo();
- recyclable_compositor_->UpdateSurface(dfh_size_pixels_,
- current.device_scale_factor,
- current.display_color_spaces);
+ recyclable_compositor_->UpdateSurface(
+ dfh_size_pixels_, current.device_scale_factor,
+ current.display_color_spaces, current.display_id);
recyclable_compositor_->compositor()->SetRootLayer(root_layer_.get());
recyclable_compositor_->compositor()->SetBackgroundColor(background_color_);
recyclable_compositor_->widget()->SetNSView(
@@ -273,9 +275,8 @@
// Ensure that the client has destroyed its BrowserCompositorViewMac before
// it dependencies are destroyed.
// https://crbug.com/805726
- while (!g_browser_compositors.Get().empty()) {
- BrowserCompositorMac* browser_compositor =
- *g_browser_compositors.Get().begin();
+ while (!GetBrowserCompositors().empty()) {
+ BrowserCompositorMac* browser_compositor = *GetBrowserCompositors().begin();
browser_compositor->client_->DestroyCompositorForShutdown();
}
}
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index c652c0dfd2e6c464c91e3522902ee96dd19b0287..e52e5b74146d0709925e87c6f4d5dc551ec8eec8 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -347,6 +347,9 @@ void Compositor::SetLayerTreeFrameSink(
display_private_->SetDisplayColorMatrix(
gfx::SkM44ToTransform(display_color_matrix_));
display_private_->SetOutputIsSecure(output_is_secure_);
+#if BUILDFLAG(IS_MAC)
+ display_private_->SetVSyncDisplayID(display_id_);
+#endif
if (has_vsync_params_) {
display_private_->SetDisplayVSyncParameters(vsync_timebase_,
vsync_interval_);
diff --git a/ui/compositor/recyclable_compositor_mac.cc b/ui/compositor/recyclable_compositor_mac.cc
index 0e30e781760d38778ec0e741ddae250e96c6d671..0c57b17778872702f887e5fe9d95dc8ad98d654f 100644
--- a/ui/compositor/recyclable_compositor_mac.cc
+++ b/ui/compositor/recyclable_compositor_mac.cc
@@ -12,6 +12,7 @@
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_observer.h"
#include "ui/compositor/compositor_switches.h"
+#include "ui/display/types/display_constants.h"
namespace ui {
@@ -65,7 +66,8 @@ void RecyclableCompositorMac::Unsuspend() {
void RecyclableCompositorMac::UpdateSurface(
const gfx::Size& size_pixels,
float scale_factor,
- const gfx::DisplayColorSpaces& display_color_spaces) {
+ const gfx::DisplayColorSpaces& display_color_spaces,
+ int64_t display_id) {
if (size_pixels != size_pixels_ || scale_factor != scale_factor_) {
size_pixels_ = size_pixels;
scale_factor_ = scale_factor;
@@ -75,21 +77,19 @@ void RecyclableCompositorMac::UpdateSurface(
compositor()->SetScaleAndSize(scale_factor_, size_pixels_,
local_surface_id);
}
- if (display_color_spaces != display_color_spaces_) {
- display_color_spaces_ = display_color_spaces;
- compositor()->SetDisplayColorSpaces(display_color_spaces_);
- }
+ compositor()->SetDisplayColorSpaces(display_color_spaces);
+ compositor()->SetVSyncDisplayID(display_id);
}
void RecyclableCompositorMac::InvalidateSurface() {
size_pixels_ = gfx::Size();
scale_factor_ = 1.f;
local_surface_id_allocator_.Invalidate();
- display_color_spaces_ = gfx::DisplayColorSpaces();
compositor()->SetScaleAndSize(
scale_factor_, size_pixels_,
local_surface_id_allocator_.GetCurrentLocalSurfaceId());
compositor()->SetDisplayColorSpaces(gfx::DisplayColorSpaces());
+ compositor()->SetVSyncDisplayID(display::kInvalidDisplayId);
}
void RecyclableCompositorMac::OnCompositingDidCommit(
diff --git a/ui/compositor/recyclable_compositor_mac.h b/ui/compositor/recyclable_compositor_mac.h
index 891204a715de65bce5103b85490bb66de401ba0e..778842bee9395101c6f8b2c182e4b6de7a8a039e 100644
--- a/ui/compositor/recyclable_compositor_mac.h
+++ b/ui/compositor/recyclable_compositor_mac.h
@@ -49,7 +49,8 @@ class COMPOSITOR_EXPORT RecyclableCompositorMac
// Update the compositor's surface information, if needed.
void UpdateSurface(const gfx::Size& size_pixels,
float scale_factor,
- const gfx::DisplayColorSpaces& display_color_spaces);
+ const gfx::DisplayColorSpaces& display_color_spaces,
+ int64_t display_id);
private:
// Invalidate the compositor's surface information.
@@ -63,7 +64,6 @@ class COMPOSITOR_EXPORT RecyclableCompositorMac
viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
gfx::Size size_pixels_;
float scale_factor_ = 1.f;
- gfx::DisplayColorSpaces display_color_spaces_;
std::unique_ptr<ui::AcceleratedWidgetMac> accelerated_widget_mac_;
ui::Compositor compositor_;
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 c6a33c2a85206295426292406291af670ce65ab0..f1f25bf0e19a918c3fcc7b7610ecf2924a880ff4 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -617,7 +617,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
content_bounds_in_screen_.size(), display_.device_scale_factor()));
compositor_->UpdateSurface(content_bounds_in_pixels,
display_.device_scale_factor(),
- display_.color_spaces());
+ display_.color_spaces(), display_.id());
}
void NativeWidgetMacNSWindowHost::DestroyCompositor() {
@@ -1173,7 +1173,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
content_bounds_in_screen_.size(), display_.device_scale_factor()));
compositor_->UpdateSurface(content_bounds_in_pixels,
display_.device_scale_factor(),
- display_.color_spaces());
+ display_.color_spaces(), display_.id());
}
if (display_id_changed) {
@@ -1187,7 +1187,6 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
if (compositor_) {
RequestVSyncParametersUpdate();
- compositor_->compositor()->SetVSyncDisplayID(display_.id());
}
}
}

View File

@@ -0,0 +1,430 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christopher Cameron <ccameron@chromium.org>
Date: Mon, 15 May 2023 15:30:36 +0200
Subject: Use ExternalBeginFrameSourceMac on macOS
Change ExternalBeginFrameSourceMac from being a
SyntheticBeginFrameSource to being an ExternalBeginFrameSource.
Move all of the code that is responsible for updating the VSync
parameters every 10 seconds from NativeWidgetMacNSWindowHost to
ExternalBeginFrameSourceMac.
Wire up ExternalBeginFrameSourceMac::SetVSyncDisplayID to create
the DisplayLinkMac (that was previously created in
NativeWidgetMacNSWindowHost). Set the VSyncCallbackMac callback in
ExternalBeginFrameSourceMac to update the timer based VSync
parameters the same way that was done in SyntheticBeginFrameSource.
Make RootCompositorFrameSinkImpl create a ExternalBeginFrameSourceMac
instead of creating a DelayBasedBeginFrameSource.
Bug: 1404797
Change-Id: I288497d94cc66356586e8da34852d53d05cf42f3
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 5b0a12d8b69c0b79fefcb9194e0f3fb88c4c7051..8ebcf88eadb7fbc3ce781b9094ec88f6d23134c1 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -323,6 +323,12 @@ viz_component("service") {
frameworks += [ "CoreGraphics.framework" ]
}
configs = ["//electron/build/config:mas_build"]
+ if (is_mac) {
+ sources += [
+ "frame_sinks/external_begin_frame_source_mac.cc",
+ "frame_sinks/external_begin_frame_source_mac.h",
+ ]
+ }
}
if (is_android || use_ozone) {
diff --git a/components/viz/service/frame_sinks/DEPS b/components/viz/service/frame_sinks/DEPS
index 163224a3cdb78d1eee055491c2daa7ca09fe4baa..c0e240ec70f7b7d4da92b497ac607e73d1168923 100644
--- a/components/viz/service/frame_sinks/DEPS
+++ b/components/viz/service/frame_sinks/DEPS
@@ -26,4 +26,8 @@ specific_include_rules = {
"external_begin_frame_source_android.cc": [
"+components/viz/service/service_jni_headers/ExternalBeginFrameSourceAndroid_jni.h",
],
+ "external_begin_frame_source_mac.h": [
+ "+ui/display/mac/display_link_mac.h",
+ "+ui/display/types/display_constants.h",
+ ],
}
diff --git a/components/viz/service/frame_sinks/external_begin_frame_source_mac.cc b/components/viz/service/frame_sinks/external_begin_frame_source_mac.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f5bd62e7c486b8e6bb58d59984f363867015486c
--- /dev/null
+++ b/components/viz/service/frame_sinks/external_begin_frame_source_mac.cc
@@ -0,0 +1,97 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/viz/service/frame_sinks/external_begin_frame_source_mac.h"
+
+#include <algorithm>
+#include <memory>
+#include <utility>
+
+#include "base/containers/contains.h"
+#include "base/trace_event/trace_event.h"
+
+namespace viz {
+
+ExternalBeginFrameSourceMac::ExternalBeginFrameSourceMac(
+ std::unique_ptr<DelayBasedTimeSource> time_source,
+ uint32_t restart_id)
+ : ExternalBeginFrameSource(this, restart_id),
+ time_source_(std::move(time_source)) {
+ time_source_->SetClient(this);
+}
+
+ExternalBeginFrameSourceMac::~ExternalBeginFrameSourceMac() = default;
+
+void ExternalBeginFrameSourceMac::SetDynamicBeginFrameDeadlineOffsetSource(
+ DynamicBeginFrameDeadlineOffsetSource*
+ dynamic_begin_frame_deadline_offset_source) {
+ begin_frame_args_generator_.set_dynamic_begin_frame_deadline_offset_source(
+ dynamic_begin_frame_deadline_offset_source);
+}
+
+void ExternalBeginFrameSourceMac::SetVSyncDisplayID(int64_t display_id) {
+ if (display_id_ == display_id) {
+ return;
+ }
+
+ display_id_ = display_id;
+ display_link_ = ui::DisplayLinkMac::GetForDisplay(
+ base::checked_cast<CGDirectDisplayID>(display_id_));
+ time_source_next_update_time_ = base::TimeTicks();
+ RequestTimeSourceParamsUpdate();
+}
+
+void ExternalBeginFrameSourceMac::OnNeedsBeginFrames(bool needs_begin_frames) {
+ if (needs_begin_frames_ == needs_begin_frames) {
+ return;
+ }
+ needs_begin_frames_ = needs_begin_frames;
+
+ DCHECK_NE(time_source_->Active(), needs_begin_frames_);
+ time_source_->SetActive(needs_begin_frames_);
+}
+
+void ExternalBeginFrameSourceMac::OnTimerTick() {
+ // The VSync parameters skew over time (astonishingly quickly -- 0.1 msec per
+ // second). If too much time has elapsed since the last time the vsync
+ // parameters were calculated, re-calculate them.
+ if (base::TimeTicks::Now() >= time_source_next_update_time_) {
+ RequestTimeSourceParamsUpdate();
+ }
+
+ // See comments in DelayBasedBeginFrameSource::OnTimerTick regarding the
+ // computation of `frame_time`.
+ base::TimeTicks frame_time =
+ std::max(time_source_->LastTickTime(),
+ time_source_->NextTickTime() - time_source_->Interval());
+ OnBeginFrame(begin_frame_args_generator_.GenerateBeginFrameArgs(
+ source_id(), frame_time, time_source_->NextTickTime(),
+ time_source_->Interval()));
+}
+
+void ExternalBeginFrameSourceMac::RequestTimeSourceParamsUpdate() {
+ if (!display_link_ || time_source_updater_) {
+ return;
+ }
+ time_source_updater_ = display_link_->RegisterCallback(base::BindRepeating(
+ &ExternalBeginFrameSourceMac::OnTimeSourceParamsUpdate,
+ weak_factory_.GetWeakPtr()));
+}
+
+void ExternalBeginFrameSourceMac::OnTimeSourceParamsUpdate(
+ ui::VSyncParamsMac params) {
+ time_source_next_update_time_ = base::TimeTicks::Now() + base::Seconds(10);
+ time_source_updater_ = nullptr;
+
+ if (params.display_times_valid) {
+ time_source_->SetTimebaseAndInterval(params.display_timebase,
+ params.display_interval);
+ last_timebase_ = params.display_timebase;
+ } else {
+ time_source_->SetTimebaseAndInterval(last_timebase_,
+ BeginFrameArgs::DefaultInterval());
+ }
+}
+
+} // namespace viz
diff --git a/components/viz/service/frame_sinks/external_begin_frame_source_mac.h b/components/viz/service/frame_sinks/external_begin_frame_source_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..4753f86371d97ec0470e355258bae17e10e77dcf
--- /dev/null
+++ b/components/viz/service/frame_sinks/external_begin_frame_source_mac.h
@@ -0,0 +1,74 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_VIZ_SERVICE_FRAME_SINKS_EXTERNAL_BEGIN_FRAME_SOURCE_MAC_H_
+#define COMPONENTS_VIZ_SERVICE_FRAME_SINKS_EXTERNAL_BEGIN_FRAME_SOURCE_MAC_H_
+
+#include <memory>
+
+#include "components/viz/common/frame_sinks/begin_frame_source.h"
+#include "components/viz/service/viz_service_export.h"
+#include "ui/display/mac/display_link_mac.h"
+#include "ui/display/types/display_constants.h"
+
+namespace viz {
+
+// A begin frame source for use on macOS. This behaves like a
+// DelayBasedBeginFrameSource, but, instead of being informed externally of its
+// timebase and interval, it is informed externally of its display::DisplayId
+// and uses that to query its timebase and interval from a DisplayLinkMac.
+class VIZ_COMMON_EXPORT ExternalBeginFrameSourceMac
+ : public ExternalBeginFrameSource,
+ public ExternalBeginFrameSourceClient,
+ public DelayBasedTimeSourceClient {
+ public:
+ ExternalBeginFrameSourceMac(std::unique_ptr<DelayBasedTimeSource> time_source,
+ uint32_t restart_id);
+
+ ExternalBeginFrameSourceMac(const ExternalBeginFrameSourceMac&) = delete;
+ ExternalBeginFrameSourceMac& operator=(const ExternalBeginFrameSourceMac&) =
+ delete;
+ ~ExternalBeginFrameSourceMac() override;
+
+ // BeginFrameSource implementation.
+ void SetDynamicBeginFrameDeadlineOffsetSource(
+ DynamicBeginFrameDeadlineOffsetSource*
+ dynamic_begin_frame_deadline_offset_source) override;
+ void SetVSyncDisplayID(int64_t display_id) override;
+
+ // ExternalBeginFrameSourceClient implementation.
+ void OnNeedsBeginFrames(bool needs_begin_frames) override;
+
+ // DelayBasedTimeSourceClient implementation.
+ void OnTimerTick() override;
+
+ private:
+ // Request a callback from DisplayLinkMac, and the callback function.
+ void RequestTimeSourceParamsUpdate();
+ void OnTimeSourceParamsUpdate(ui::VSyncParamsMac params);
+
+ BeginFrameArgsGenerator begin_frame_args_generator_;
+
+ bool needs_begin_frames_ = false;
+
+ // CVDisplayLink and related structures to set timer parameters.
+ int64_t display_id_ = display::kInvalidDisplayId;
+ scoped_refptr<ui::DisplayLinkMac> display_link_;
+
+ // Timer used to drive callbacks.
+ // TODO(https://crbug.com/1404797): Only use this when it is not possible or
+ // efficient to use `display_link_`.
+ std::unique_ptr<DelayBasedTimeSource> time_source_;
+ base::TimeTicks last_timebase_;
+
+ // The callback that is used to update `time_source_`.
+ base::TimeTicks time_source_next_update_time_;
+ std::unique_ptr<ui::VSyncCallbackMac> time_source_updater_;
+
+ base::WeakPtrFactory<ExternalBeginFrameSourceMac> weak_factory_{this};
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_SERVICE_FRAME_SINKS_EXTERNAL_BEGIN_FRAME_SOURCE_MAC_H_
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
index 055b0a2df07954b8e28f2a6f36b446339ae9ef9f..895dff4c0587dbca26f5178b116d914e15bcefa3 100644
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -36,6 +36,10 @@
#include "components/viz/service/frame_sinks/external_begin_frame_source_ios.h"
#endif
+#if BUILDFLAG(IS_MAC)
+#include "components/viz/service/frame_sinks/external_begin_frame_source_mac.h"
+#endif
+
namespace viz {
class RootCompositorFrameSinkImpl::StandaloneBeginFrameObserver
@@ -140,6 +144,11 @@ RootCompositorFrameSinkImpl::Create(
hw_support_for_multiple_refresh_rates = true;
external_begin_frame_source =
std::make_unique<ExternalBeginFrameSourceIOS>(restart_id);
+#elif BUILDFLAG(IS_MAC)
+ external_begin_frame_source = std::make_unique<ExternalBeginFrameSourceMac>(
+ std::make_unique<DelayBasedTimeSource>(
+ base::SingleThreadTaskRunner::GetCurrentDefault().get()),
+ restart_id);
#else
if (params->disable_frame_rate_limit) {
synthetic_begin_frame_source =
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 0d5ef8c48f08b1eb5ed878ab8934f2ecd04083fa..30f72b9655e790d864fc7e28983b6a37074448a5 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/graphics/IOGraphicsLib.h>
+#include <QuartzCore/CVDisplayLink.h>
#include <stdint.h>
#include <map>
@@ -27,7 +28,6 @@
#include "base/trace_event/trace_event.h"
#include "ui/display/display.h"
#include "ui/display/display_change_notifier.h"
-#include "ui/display/mac/display_link_mac.h"
#include "ui/display/util/display_util.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/icc_profile.h"
@@ -280,8 +280,22 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) {
display.set_is_monochrome(CGDisplayUsesForceToGray());
#endif
- if (auto display_link = ui::DisplayLinkMac::GetForDisplay(display_id))
- display.set_display_frequency(display_link->GetRefreshRate());
+ // Query the display's referesh rate.
+ {
+ CVDisplayLinkRef display_link = nullptr;
+ if (CVDisplayLinkCreateWithCGDisplay(display_id, &display_link) ==
+ kCVReturnSuccess) {
+ DCHECK(display_link);
+ CVTime cv_time =
+ CVDisplayLinkGetNominalOutputVideoRefreshPeriod(display_link);
+ if (!(cv_time.flags & kCVTimeIsIndefinite)) {
+ double refresh_rate = (static_cast<double>(cv_time.timeScale) /
+ static_cast<double>(cv_time.timeValue));
+ display.set_display_frequency(refresh_rate);
+ }
+ CVDisplayLinkRelease(display_link);
+ }
+ }
// CGDisplayRotation returns a double. Display::SetRotationAsDegree will
// handle the unexpected situations were the angle is not a multiple of 90.
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
index e63b249a9bdc23545121a513156bfa32e92fec0b..e21c2df5d19bf01271bee91f792a3dbae29c55b7 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -24,7 +24,6 @@
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#include "ui/base/cocoa/accessibility_focus_overrider.h"
#include "ui/compositor/layer_owner.h"
-#include "ui/display/mac/display_link_mac.h"
#include "ui/views/cocoa/drag_drop_client_mac.h"
#include "ui/views/cocoa/native_widget_mac_event_monitor.h"
#include "ui/views/views_export.h"
@@ -421,12 +420,6 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
// ui::AcceleratedWidgetMacNSView:
void AcceleratedWidgetCALayerParamsUpdated() override;
- // If `display_link_` is valid and `display_link_updater_` does not exist,
- // create it. It will call back to OnVSyncParametersUpdated with new VSync
- // parameters.
- void RequestVSyncParametersUpdate();
- void OnVSyncParametersUpdated(ui::VSyncParamsMac params);
-
// The id that this bridge may be looked up from.
const uint64_t widget_id_;
const raw_ptr<views::NativeWidgetMac>
@@ -494,15 +487,6 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
// The display that the window is currently on.
display::Display display_;
- // Display link for getting vsync info for `display_`, and VSyncCallbackMac to
- // use for callbacks.
- scoped_refptr<ui::DisplayLinkMac> display_link_;
- std::unique_ptr<ui::VSyncCallbackMac> display_link_updater_;
-
- // Updating VSync parameters can be expensive, so set this to the next time
- // when we should update VSync parameters.
- base::TimeTicks display_link_next_update_time_;
-
// The geometry of the window and its contents view, in screen coordinates.
gfx::Rect window_bounds_in_screen_;
gfx::Rect content_bounds_in_screen_;
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 f1f25bf0e19a918c3fcc7b7610ecf2924a880ff4..a0c9f71c5eb97091941ba7d9955854af74bd67d5 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -1163,32 +1163,19 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::OnWindowDisplayChanged(
const display::Display& new_display) {
- bool display_id_changed = display_.id() != new_display.id();
display_ = new_display;
- if (compositor_) {
- // Mac device scale factor is always an integer so the result here is an
- // integer pixel size.
- gfx::Size content_bounds_in_pixels =
- gfx::ToRoundedSize(gfx::ConvertSizeToPixels(
- content_bounds_in_screen_.size(), display_.device_scale_factor()));
- compositor_->UpdateSurface(content_bounds_in_pixels,
- display_.device_scale_factor(),
- display_.color_spaces(), display_.id());
+ if (!compositor_) {
+ return;
}
- if (display_id_changed) {
- display_link_ = ui::DisplayLinkMac::GetForDisplay(
- base::checked_cast<CGDirectDisplayID>(display_.id()));
- if (!display_link_) {
- // Note that on some headless systems, the display link will fail to be
- // created, so this should not be a fatal error.
- LOG(ERROR) << "Failed to create display link.";
- }
-
- if (compositor_) {
- RequestVSyncParametersUpdate();
- }
- }
+ // Mac device scale factor is always an integer so the result here is an
+ // integer pixel size.
+ gfx::Size content_bounds_in_pixels =
+ gfx::ToRoundedSize(gfx::ConvertSizeToPixels(
+ content_bounds_in_screen_.size(), display_.device_scale_factor()));
+ compositor_->UpdateSurface(content_bounds_in_pixels,
+ display_.device_scale_factor(),
+ display_.color_spaces(), display_.id());
}
void NativeWidgetMacNSWindowHost::OnWindowWillClose() {
@@ -1619,32 +1606,6 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::AcceleratedWidgetCALayerParamsUpdated() {
if (const auto* ca_layer_params = compositor_->widget()->GetCALayerParams())
GetNSWindowMojo()->SetCALayerParams(*ca_layer_params);
-
- // The VSync parameters skew over time (astonishingly quickly -- 0.1 msec per
- // second). If too much time has elapsed since the last time the vsync
- // parameters were calculated, re-calculate them.
- if (base::TimeTicks::Now() >= display_link_next_update_time_) {
- RequestVSyncParametersUpdate();
- }
-}
-
-void NativeWidgetMacNSWindowHost::RequestVSyncParametersUpdate() {
- if (!display_link_ || display_link_updater_) {
- return;
- }
- display_link_updater_ = display_link_->RegisterCallback(base::BindRepeating(
- &NativeWidgetMacNSWindowHost::OnVSyncParametersUpdated,
- weak_factory_for_vsync_update_.GetWeakPtr()));
-}
-
-void NativeWidgetMacNSWindowHost::OnVSyncParametersUpdated(
- ui::VSyncParamsMac params) {
- if (compositor_ && params.display_times_valid) {
- compositor_->compositor()->SetDisplayVSyncParameters(
- params.display_timebase, params.display_interval);
- display_link_next_update_time_ = base::TimeTicks::Now() + base::Seconds(10);
- }
- display_link_updater_ = nullptr;
}
} // namespace views

View File

@@ -6,10 +6,10 @@ Subject: chore: add electron deps to gitignores
Makes things like "git status" quicker when developing electron locally
diff --git a/.gitignore b/.gitignore
index f39533c8951d81fba73910a89b5cf2de9bd34a02..00756eb8a32aec3bc109db9aa1b370ab9f0b1d26 100644
index 775a2ccf4c36d647658a5c35b5161f43eeb3fb00..ee92b06a8a0dc5adbf22d714a20b66efdad0d7ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -238,6 +238,7 @@ vs-chromium-project.txt
@@ -239,6 +239,7 @@ vs-chromium-project.txt
/delegate_execute
/device/serial/device_serial_mojo.xml
/docs/website
@@ -18,7 +18,7 @@ index f39533c8951d81fba73910a89b5cf2de9bd34a02..00756eb8a32aec3bc109db9aa1b370ab
/google_apis/internal
/googleurl
diff --git a/third_party/.gitignore b/third_party/.gitignore
index 06405f8cf4ed0571d3df7a3d7a5370005d07c8bd..65c86fc3579ff2f828e5a356dbaffb847db7a795 100644
index 9978d8b8756ed8557275d2556cdc493eec94c7f1..58a3f97ea420d19c26a4e5e604730f0244e62283 100644
--- a/third_party/.gitignore
+++ b/third_party/.gitignore
@@ -90,6 +90,7 @@
@@ -37,7 +37,7 @@ index 06405f8cf4ed0571d3df7a3d7a5370005d07c8bd..65c86fc3579ff2f828e5a356dbaffb84
/nasm
/nearby/src
/neon_2_sse/src
@@ -261,6 +263,7 @@
@@ -264,6 +266,7 @@
/speex
/sqlite/src
/sqlite4java/lib/

View File

@@ -7,10 +7,10 @@ With WCO, allow chromium to handle synthetic mouse events generated for touch
actions in the non-client caption area.
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index b2e8e4127d73d1c8f0f3698fe9c7f37a03868c06..79e00fd9f83dc6cb4114ceac53ea025dcb7595b7 100644
index 06fd4d3962b8aa0767d295deeba2e949e7cd856c..61673ac08ca19816dc01c89b6687f5b2a7c289e2 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -1209,6 +1209,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
@@ -1215,6 +1215,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds);
}
@@ -22,10 +22,10 @@ index b2e8e4127d73d1c8f0f3698fe9c7f37a03868c06..79e00fd9f83dc6cb4114ceac53ea025d
DesktopWindowTreeHostWin::GetSingletonDesktopNativeCursorManager() {
return new DesktopNativeCursorManagerWin();
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
index 2b935ac09209c1b043aa416f886a84dff742826e..04b586a7fd15bc2e85cb62cd6cefe63461a2539e 100644
index 2e4bacce52a45b5d9d7829c1f88f82aa0bb1b4bb..f3537e89191bd2c6d9b06c9b741a168071eb8662 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -259,6 +259,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
@@ -261,6 +261,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
void HandleWindowSizeUnchanged() override;
void HandleWindowScaleFactorChanged(float window_scale_factor) override;
void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) override;
@@ -34,10 +34,10 @@ index 2b935ac09209c1b043aa416f886a84dff742826e..04b586a7fd15bc2e85cb62cd6cefe634
Widget* GetWidget();
const Widget* GetWidget() const;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 66444599384981681a3018b5de516e2242324285..c55e27bfc275ff63282f8d703dcdf723b5b2385d 100644
index 81d3612a4d0a56c0e3fdc57a3e1718984014f7bc..6b7366dfd43ca13587f0fc430eb1b11f2ed0436a 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3209,15 +3209,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3225,15 +3225,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
SetMsgHandled(FALSE);
// We must let Windows handle the caption buttons if it's drawing them, or
// they won't work.

View File

@@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
of explicitly adding ScopedAllowBlocking calls as friends.
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index f37e3cfc946bc8926b808b1fda9b7a3770810a96..84a1b9b8fc651b3bba12257e16b31929ccb9782b 100644
index 4c9ff4452fa14cbd639207169afbf3e0ea663e2b..d6487da03dd6595272d63e0930e956948791b722 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -133,6 +133,7 @@ class FirefoxProfileLock;
@@ -18,7 +18,7 @@ index f37e3cfc946bc8926b808b1fda9b7a3770810a96..84a1b9b8fc651b3bba12257e16b31929
class Profile;
class ProfileImpl;
class StartupTabProviderImpl;
@@ -269,6 +270,9 @@ class BackendImpl;
@@ -272,6 +273,9 @@ class BackendImpl;
class InFlightIO;
bool CleanupDirectorySync(const base::FilePath&);
} // namespace disk_cache
@@ -28,7 +28,7 @@ index f37e3cfc946bc8926b808b1fda9b7a3770810a96..84a1b9b8fc651b3bba12257e16b31929
namespace enterprise_connectors {
class LinuxKeyRotationCommand;
} // namespace enterprise_connectors
@@ -576,6 +580,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -579,6 +583,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class ::DesktopNotificationBalloon;
friend class ::FirefoxProfileLock;
friend class ::GaiaConfig;
@@ -36,7 +36,7 @@ index f37e3cfc946bc8926b808b1fda9b7a3770810a96..84a1b9b8fc651b3bba12257e16b31929
friend class ::ProfileImpl;
friend class ::ScopedAllowBlockingForProfile;
friend class ::StartupTabProviderImpl;
@@ -613,6 +618,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -616,6 +621,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class crosapi::LacrosThreadTypeDelegate;
friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
friend class drive::FakeDriveService;

View File

@@ -52,10 +52,10 @@ index a3add3e3811f5f31d615800b1852f56afde63edc..2f3132e450f883460e0325c4a0bb91f0
/*from_user_gesture=*/true);
return true;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.h b/chrome/browser/ui/ash/ash_web_view_impl.h
index 1af9377f917f4659149698593dbe85d98ed3409e..52771e9703663e60ed8ac77fff5abf9c85e21f4f 100644
index 68fec72b3b97a18563fade50dd129eba49a86bb6..d3d4af06542c73c61cf8b8ee510a0345ba666739 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.h
+++ b/chrome/browser/ui/ash/ash_web_view_impl.h
@@ -48,8 +48,7 @@ class AshWebViewImpl : public ash::AshWebView,
@@ -49,8 +49,7 @@ class AshWebViewImpl : public ash::AshWebView,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -80,10 +80,10 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 51b7658944d39151f5d11eec00650fcb87954e3c..45c002e75972acd3f3da84be7ced75253d403b7f 100644
index 0fcb0295dec5d38c859ca5963238def57167080f..d849ed0609d97dd9282628b37b4239be05e71806 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1837,12 +1837,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -1859,12 +1859,11 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -99,7 +99,7 @@ index 51b7658944d39151f5d11eec00650fcb87954e3c..45c002e75972acd3f3da84be7ced7525
WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 83b8260beb59da437ae08a5b62746c40603a1200..3ea5f7c42ef350cc094355154c52220e68e6ceb5 100644
index 23a838ba30c6890b66d301c90ece2dd3eafac8c7..f660378323bb9d3004b967689bf3bbb56ace198c 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -862,8 +862,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 1dafd9c9d934e19284279fb24e8488c086b20d4c..2fdbc714c3f0f560820eaec4524b016dea2fa442 100644
index 5c46e1429f1c2d6c19e112d9e13ca105d7067b04..031a8409bc13e6f65ca94811f860e07d14efc8e4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4063,8 +4063,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4071,8 +4071,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,

View File

@@ -31,18 +31,18 @@ index 284dd099122df85d2cebf467cdb3a54b45a343eb..bb21ddbd2ee4d2952a4b753a5c553005
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
return 100;
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
index 9f8f20dfa65068a13ce3b035a7e3ce062d767161..9b45c7276e97253f79f4555ee692687b040afa67 100644
index a604df7a5ea6a1f5613acc032a65668364aadf89..93a8bf787bdaa0e4251a41453eb22062646f4bcb 100644
--- a/components/crash/core/app/crash_reporter_client.h
+++ b/components/crash/core/app/crash_reporter_client.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
#define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <map>
#include <string>
#include "build/build_config.h"
@@ -151,6 +152,19 @@ class CrashReporterClient {
@@ -153,6 +154,19 @@ class CrashReporterClient {
// that case, |breakpad_enabled| is set to the value enforced by policies.
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);

View File

@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index c56314c7852119bd8ad06d22ae777ad971966b75..2e28a16eb75340f3913447392dabaec34bdd1ede 100644
index d2ca2effde6f7523518c1531f86506c4f619797e..287abd4623f56ef00354c5892b3b6ac15786e915 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -39,6 +39,7 @@
@@ -18,7 +18,7 @@ index c56314c7852119bd8ad06d22ae777ad971966b75..2e28a16eb75340f3913447392dabaec3
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
@@ -253,8 +254,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
@@ -257,8 +258,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
#endif
@@ -33,7 +33,7 @@ index c56314c7852119bd8ad06d22ae777ad971966b75..2e28a16eb75340f3913447392dabaec3
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
base::FileDescriptorStore& file_descriptor_store =
base::FileDescriptorStore::GetInstance();
@@ -283,11 +289,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
@@ -287,11 +293,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
#endif // V8_USE_EXTERNAL_STARTUP_DATA
@@ -48,7 +48,7 @@ index c56314c7852119bd8ad06d22ae777ad971966b75..2e28a16eb75340f3913447392dabaec3
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
@@ -961,7 +968,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
@@ -965,7 +972,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
return TerminateForFatalInitializationError();
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
@@ -102,10 +102,10 @@ index d4bb0e9a017a833b403916e1d6e64fb058f40f86..35ba35a95e39700824d6e0b480b99bc3
friend class ContentClientCreator;
friend class ContentClientInitializer;
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index ae8116dae33d0e7340e526263de86a4b181f1a19..d5385860f5f4496709d47560c3d6d0dd6dbc525b 100644
index f65c0fd59dfe3029fe47d3401759298e75243839..76dcbe2873f3e995cc612cbcd7eba60f236f655d 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -503,8 +503,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
@@ -506,8 +506,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
@@ -115,7 +115,7 @@ index ae8116dae33d0e7340e526263de86a4b181f1a19..d5385860f5f4496709d47560c3d6d0dd
if (g_mapped_snapshot) {
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
// files in a process.
@@ -513,10 +512,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
@@ -516,10 +515,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
base::MemoryMappedFile::Region file_region;
base::File file =

View File

@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index ffaf89466d29864bd1bb91565c16303b097e4e5d..56fe848755bc56ddb5b5893476ba82ed185774c0 100644
index 16117d0b40245282ed59a8b9c0cebddc3b2e288c..dd03e12e2b2069e426401ec91a3070e0a2dc0de7 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1915,6 +1915,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -1919,6 +1919,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
gfx::ContentColorUsage content_color_usage) const {
TargetColorParams params;
@@ -35,7 +35,7 @@ index ffaf89466d29864bd1bb91565c16303b097e4e5d..56fe848755bc56ddb5b5893476ba82ed
// If we are likely to software composite the resource, we use sRGB because
// software compositing is unable to perform color conversion.
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index d67c103a301f6398084f8db8a7d559981f3c669c..ccec09bdde3b107b0260ec9d26f5db20e023ce89 100644
index b85b3251a752afc1305108ad370bbe8453e4f789..e24eefabacf2fcdbd15b26e0c696579cca909dd8 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -96,6 +96,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -81,10 +81,10 @@ index c7ca2458708dd9577afdaef7fbcafaaa68046904..c4a1f1368ef053830c86cf86c3bec7ce
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index cb05dfa656174c132157a1ca283da2dad50c2423..fe38ee99ed053f41680a413883739cf7b359cf6a 100644
index 081cf448574bdf0ab2562e21b2eec0436925dc82..637553eaf6aa77c02ced24bf70da10a86737b33d 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -225,6 +225,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -226,6 +226,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
// Command-line switches to propagate to the GPU process.
static const char* const kSwitchNames[] = {
@@ -93,10 +93,10 @@ index cb05dfa656174c132157a1ca283da2dad50c2423..fe38ee99ed053f41680a413883739cf7
sandbox::policy::switches::kGpuSandboxAllowSysVShm,
sandbox::policy::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index da3254d252dabca7593eb46c461ce4063137d957..cd0bd70cbefa80246fc4624a718585cf63c13e96 100644
index e5ff37adaa1d38e3732457004c63d8c282cb0fd8..197949ebcbb7d1c0f3cd7e3fa3e7623303ebbff1 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3333,6 +3333,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3349,6 +3349,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
@@ -148,7 +148,7 @@ index 318005b66e04ed03ce6d44931d9360c0e009cb94..0d622fddb95720141ccf8a285ace4714
}
diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
index 77624a8b54b6e05da79bd913aa3d25187118090c..0057d51aebaf7530cc91e87fc826dd70c49c1df4 100644
index 3ebaee0026affd8a9eb4cf36432cbefc13db8f3b..0a38a4a281b5b90fea38b6a2662ec5da0087f134 100644
--- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
+++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
@@ -25,6 +25,7 @@
@@ -159,7 +159,7 @@ index 77624a8b54b6e05da79bd913aa3d25187118090c..0057d51aebaf7530cc91e87fc826dd70
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
@@ -214,6 +215,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
@@ -210,6 +211,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);

View File

@@ -6,7 +6,7 @@ Subject: fix: disabling compositor recycling
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 66c8dda8af5605fb270011bd58c7bed59fe71fcf..383c6dcfe93753f6b84c18b6db2fd4c6fe453b23 100644
index 2e3a87b7694f105a684ac2500ae5fb6861eee668..8ffcc8086b9b414240ced42e0219c3d59c5ad417 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -527,7 +527,11 @@

View File

@@ -15,10 +15,10 @@ at some point be an API to "unfreeze" the flags, or we may be able to refactor
node initialization to not update flags after V8 initialization.
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc
index 94016c74d962d7e5459ff5457f276e6742146280..0ca99a62d1289f9eff38291bd7af23cefd9cf77d 100644
index 243f60e292bee821d2842964d88209e6762391bd..d8da9eca25025e28204fe54b037b6a6f543f1bec 100644
--- a/content/renderer/render_process_impl.cc
+++ b/content/renderer/render_process_impl.cc
@@ -231,6 +231,9 @@ RenderProcessImpl::RenderProcessImpl()
@@ -221,6 +221,9 @@ RenderProcessImpl::RenderProcessImpl()
v8::V8::SetFlagsFromString(kSABPerContextFlag, sizeof(kSABPerContextFlag));
}

View File

@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 6dab72c3c7471fe567a39e988a75b6b97a4da702..d164a86023ceb2718dfefce23d0a9fc910150f0e 100644
index e45129c031d9cecd8838483ea6ba23436d59bab3..347b8d89a2ecaa6baa4779f650b8af49a6d6d118 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -800,6 +800,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -20,10 +20,10 @@ index 6dab72c3c7471fe567a39e988a75b6b97a4da702..d164a86023ceb2718dfefce23d0a9fc9
blink::mojom::PointerLockResult::kWrongDocument);
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index f4775ddc34202803b3b015dc565bdcf5d0f5d8e0..e33c5b8ea948523a91fee51f03651e1033e73407 100644
index d93a3647c1150b763a954c9f8d53e5b6d57ee9bc..f09757ba35d07d117cae7ca4b6842189cdbc219b 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -896,6 +896,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -900,6 +900,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void UpdateBrowserControlsState(cc::BrowserControlsState constraints,
cc::BrowserControlsState current,
bool animate);

View File

@@ -6,26 +6,26 @@ Subject: feat: enable setting aspect ratio to 0
Make SetAspectRatio accept 0 as valid input, which would reset to null.
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index d52fc15106eb3a834f1008846df6cb954db17250..b2e8e4127d73d1c8f0f3698fe9c7f37a03868c06 100644
index 3d22d934c39f50760d1c519d665ddc3cb1908541..06fd4d3962b8aa0767d295deeba2e949e7cd856c 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -564,7 +564,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
}
void DesktopWindowTreeHostWin::SetAspectRatio(const gfx::SizeF& aspect_ratio) {
@@ -570,7 +570,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
void DesktopWindowTreeHostWin::SetAspectRatio(
const gfx::SizeF& aspect_ratio,
const gfx::Size& excluded_margin) {
- DCHECK(!aspect_ratio.IsEmpty());
+ DCHECK_NE(aspect_ratio.height(), 0);
message_handler_->SetAspectRatio(aspect_ratio.width() /
aspect_ratio.height());
message_handler_->SetAspectRatio(aspect_ratio.width() / aspect_ratio.height(),
excluded_margin);
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 5de1045439dca219331968dcac3c721907e20c35..8edbbbea1afcae8a32d18d23afa706224bf58b14 100644
index bde6bc5a8a3ade015909c31f8c238d287c54ece9..1bb4dcca04b57c2dab18c23c358f59c1f7c5abf1 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1123,8 +1123,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
}
@@ -1135,8 +1135,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
void HWNDMessageHandler::SetAspectRatio(float aspect_ratio) {
void HWNDMessageHandler::SetAspectRatio(float aspect_ratio,
const gfx::Size& excluded_margin) {
- // If the aspect ratio is not in the valid range, do nothing.
- DCHECK_GT(aspect_ratio, 0.0f);
+ // If the aspect ratio is 0, reset it to null.

View File

@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
} // namespace net
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index a985d4a9b1f005c965fc0ec9076e9648bc1ff7c3..974b8562354665301ba2f44ae79a3d69b93960fb 100644
index 6ed06ffa2119753748ac4b7c5705c1229825f3e6..0f31bafe0f56edce4d695058a94d721a2e92acd1 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1434,6 +1434,13 @@ void NetworkContext::SetNetworkConditions(
@@ -1461,6 +1461,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index a985d4a9b1f005c965fc0ec9076e9648bc1ff7c3..974b8562354665301ba2f44ae79a3d69
// This may only be called on NetworkContexts created with the constructor
// that calls MakeURLRequestContext().
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 9812aef784d8aa1e57a91b4adfeb25befdc57e2c..a16320c306b937a36162b9a34f7b66c003818498 100644
index 574434c94e0ee145c9a86566baa04d1c054b0dff..5a15c65967b73e54ea742c4f44ee40dd8c2add1e 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -311,6 +311,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -312,6 +312,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
mojom::NetworkConditionsPtr conditions) override;
@@ -63,10 +63,10 @@ index 9812aef784d8aa1e57a91b4adfeb25befdc57e2c..a16320c306b937a36162b9a34f7b66c0
void SetEnableReferrers(bool enable_referrers) override;
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 0d2ff1f52aa217aef66e6b9c10bbb119f9f622e3..28cc52d5ec9b2fd12361c24b07c78c90d1bb3099 100644
index 810a23b388b4c9fd02569f506ff884825cd7bb09..3c75a8146a8ca321c49b715b46f211a207408aa6 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1103,6 +1103,9 @@ interface NetworkContext {
@@ -1131,6 +1131,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);

View File

@@ -10,10 +10,10 @@ get this standardised, but in lieu of that, this makes MessagePort a
whole bunch more useful!
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index b38bbd1d14f6a0eb10412858fb4dc7f714aa3ede..5526dec4f134b265f5de5ff6820fe9c5119a3ed9 100644
index 515143a8408ff29e39f556a32439738b1f38a1a6..1f3b1e84ffa3fa874118b69652c6faf1253dda12 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -174,6 +174,7 @@ void MessagePort::close() {
@@ -175,6 +175,7 @@ void MessagePort::close() {
Entangle(pipe.TakePort0());
}
closed_ = true;

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