Compare commits

...

82 Commits

Author SHA1 Message Date
electron-roller[bot]
71941e720e chore: bump chromium to 108.0.5359.62 (22-x-y) (#36478)
* chore: bump chromium in DEPS to 108.0.5359.62

* Trigger Build

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-29 15:16:16 -05:00
Keeley Hammond
8d9a9641cd fix: enable crashpad for ELECTRON_RUN_AS_NODE processes (#36483)
* fix: enable crashpad for ELECTRON_RUN_AS_NODE processes

* wip: enable crashpad for node processes

fix: add PID testing method

wip: plumb fd into child_process in node

* node::ProcessInitializationFlags::kNoDefaultSignalHandling

* chore: clean up debug logging

* chore: gate platform includes

* test: clean up node process test

* fix: pass pid in node_main

* chore: cleanup impl

* chore: fixup patch method definition

* fix: expose bound methods to node_main

* fix: remove bound methods

* fix: crashpad connection for all ELECTRON_RUN_AS_NODE processes

* chore: fix typo

* chore: address review feedback

* chore: delay crashpad initialization

* chore: ensure options.env, code hygiene

* chore: add argv test, check for process.env over {}

* fix: fix test, return options.env immutability

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>

* chore: update patches

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-29 13:03:34 -05:00
trop[bot]
e879e2f853 build(deps): bump minimatch from 3.0.4 to 3.0.8 (#36468)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.0.8.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.0.8)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 10:44:27 -05:00
trop[bot]
4989994ad9 fix: reimplement Tray with StatusIconLinuxDbus on Linux (#36472)
* fix: reimplement Tray with StatusIconLinuxDbus on Linux (#36333)

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>

* chore: remove incorrectly added patches

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-11-29 10:26:39 -05:00
John Kleinschmidt
ccc5a7abee fix: remove unneeded --turbo-profiling-input arg from mksnapshot_args… (#36463)
fix: remove unneeded --turbo-profiling-input arg from mksnapshot_args (#36378)

fix: remove unneeded --turbo-profiling-input args from mksnapshot_args
(cherry picked from commit 7529ebfe0e)
2022-11-28 13:09:37 -08:00
Samuel Attard
6338350620 chore: cherry-pick 7196a42b42ce from chromium (#36458)
* chore: cherry-pick 7196a42b42ce from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-28 12:25:08 -05:00
trop[bot]
1601265cec docs: add missing event-emitter link to utility-process docs (#36433)
add missing event-emitter link

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>
2022-11-23 11:28:56 +01:00
trop[bot]
02eef17791 chore: fix dangling promise in npm install (#36398)
* Fix dangling promise introduced in #33979

Co-authored-by: hyrious <hyrious@outlook.com>

* fix reject in callback

Co-authored-by: hyrious <hyrious@outlook.com>

* simplify code

Co-authored-by: Black-Hole <158blackhole@gmail.com>

Co-authored-by: hyrious <hyrious@outlook.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: hyrious <hyrious@outlook.com>
2022-11-22 02:03:44 -08:00
trop[bot]
17d712e9b4 build: force ninja binary to the right arch after src cache restore (#36404)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-11-19 18:46:03 -08:00
electron-roller[bot]
5085ac7dae chore: bump chromium to 108.0.5359.48 (22-x-y) (#36388)
* chore: bump chromium in DEPS to 108.0.5359.48

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-11-17 17:48:33 -05:00
Robo
895f991816 chore: compile addons with --gnu++17 (#36369) 2022-11-17 17:42:49 +09:00
trop[bot]
d843ae327d feat: UtilityProcess API (#36089)
* feat: UtilityProcess API (#34980)

* chore: initial scaffolding

* chore: implement interface and docs

* chore: address code style review

* fix: cleanup of utility process on shutdown

* chore: simplify NodeBindings::CreateEnvironment

* chore: rename disableLibraryValidation => allowLoadingUnsignedLibraries

* chore: implement process.parentPort

* chore(posix): implement stdio pipe interface

* chore(win): implement stdio interface

* chore: reenable SetNodeOptions for utility process

* chore: add specs

* chore: fix lint

* fix: update kill API

* fix: update process.parentPort API

* fix: exit event

* docs: update exit event

* fix: tests on linux

* chore: expand on some comments

* fix: shutdown of pipe reader

Avoid logging since it is always the case that reader end of
pipe will terminate after the child process.

* fix: remove exit code check for crash spec

* fix: rm PR_SET_NO_NEW_PRIVS for unsandbox utility process

* chore: fix incorrect rebase

* fix: address review feedback

* chore: rename utility_process -> utility

* chore: update docs

* chore: cleanup c++ implemantation

* fix: leak in NodeServiceHost impl

* chore: minor cleanup

* chore: cleanup JS implementation

* chore: flip default stdio to inherit

* fix: some api improvements

* Support cwd option
* Remove path restriction for modulePath
* Rewire impl for env support

* fix: add tests for cwd and env option

* chore: alt impl for reading stdio handles

* chore: support message queuing

* chore: fix lint

* chore: new UtilityProcess => utilityProcess.fork

* fix: support for uncaught exception exits

* chore: remove process.execArgv as default

* fix: windows build

* fix: style changes

* fix: docs and style changes

* chore: update patches

* spec: disable flaky test on win32 arm CI

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

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

* chore: update patches

* docs: add utility process info to tutorial docs (#36074)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2022-11-17 15:33:27 +09:00
Samuel Attard
5d418c5dab fix: abort ShipIt installation attempt at the final mile if the app is running (#36362)
fix: abort ShipIt installation attempt at the final mile if the app is running (#36130)

* fix: abort ShipIt installation attempt at the final mile if the app is running

* chore: remove only

* Update patches/squirrel.mac/fix_abort_installation_attempt_at_the_final_mile_if_the_app_is.patch

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

* chore: update patches

* spec: make the ShipIt process lister helper more resilient

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

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-16 10:48:56 +01:00
trop[bot]
39f23b057e build: remove out cache (#36361)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-11-15 16:17:32 -05:00
trop[bot]
d8ddf31aa7 build: make src cache smaller (#36352)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-11-15 13:15:55 -05:00
trop[bot]
7a5d49bb8d docs: update README.md to use correct twitter handle (#36348)
doc: update README.md to use correct twitter handle

Co-authored-by: Tierney Cyren <bnb@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Tierney Cyren <bnb@electronjs.org>
2022-11-15 00:30:51 -08:00
Samuel Attard
44d72e39f7 build: provide moduleVersion to docs-parser directly (#36335)
build: provide moduleVersion to docs-parser directly (#36329)
2022-11-14 16:28:33 -05:00
trop[bot]
ede27b75b0 docs: update tutorials for Forge 6 (#36322)
docs: update tutorials for Forge 6 (#36313)

docs: update tutorial for Forge 6

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-11-13 23:45:32 -08:00
electron-roller[bot]
96e82dc368 chore: bump chromium to 108.0.5359.40 (22-x-y) (#36308)
* chore: bump chromium in DEPS to 108.0.5359.40

* 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>
2022-11-10 15:10:22 -05:00
trop[bot]
6908088d38 feat: add app.getPreferredSystemLanguages() API (#36291)
* feat: add app.getSystemLanguage() API

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Change the API to getPreferredSystemLanguages

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Fix test

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Clarify docs and add Linux impl

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Remove USE_GLIB

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Don't add C to list

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Remove examples since there's a lot of edge cases

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Fix lint

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Add examples

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Fix compile error

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Apply PR feedback

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

* Update the example

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2022-11-09 17:20:50 -05:00
trop[bot]
548a91a24b fix: app.dock.setIcon() crash before app ready (#36293)
fix: dock.setIcon() crash before app ready

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>
2022-11-09 15:00:20 -05:00
trop[bot]
04b3fb30ea fix: arm linux glibc dependency (#36272)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-11-08 11:31:59 +01:00
trop[bot]
3395a813fb docs: fix driverId -> deviceId typo (#36271)
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>
2022-11-08 11:30:38 +01:00
electron-roller[bot]
d299d267b3 chore: bump chromium to 108.0.5359.29 (22-x-y) (#36243)
chore: bump chromium in DEPS to 108.0.5359.29

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2022-11-03 16:20:14 -04:00
trop[bot]
71701978b8 docs: Fixed outdated documentation (uploading to App Store) (#36213)
* Updated docs on uploading

- replaced mention of Application Loader with Apple Transporter, its replacement
- replaced mention of iTunes Connect with App Store Connect
- updated link for creating a record

Co-authored-by: Georgescu Gabriel <29951139+gabi200@users.noreply.github.com>

* Update mac-app-store-submission-guide.md

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Georgescu Gabriel <29951139+gabi200@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-11-01 16:39:15 -07:00
electron-roller[bot]
7a8346cc11 chore: bump chromium to 108.0.5359.22 (22-x-y) (#36163)
* chore: bump chromium in DEPS to 108.0.5359.19

* chore: update patches

* 3859750: [linux/wayland] Added plumbing for the state of tiled edges.

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

Also 3970920: [linux/wayland] Fixed the tiled edges for the GTK frame.

https://chromium-review.googlesource.com/c/chromium/src/+/3970920
(cherry picked from commit d3f0dbb68a)

* chore: bump chromium in DEPS to 108.0.5359.22

* 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>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-11-01 17:17:00 -04:00
trop[bot]
ddcc9b20f2 build: fix building with enable_plugins = false (#36201)
Co-authored-by: Milan Burda <miburda@microsoft.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-11-01 16:05:38 -04:00
trop[bot]
4a13d2708c fix: resolve loadURL properly for in-page navigations (#36151)
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>
2022-11-01 11:08:47 -04:00
trop[bot]
53ebcb0110 docs: add EOL dates to timeline doc (#36189)
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>
2022-10-28 19:14:11 -07:00
Keeley Hammond
3a179fb2b7 build: use npm@7 for npm view command (#36188)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-10-28 13:07:52 -07:00
trop[bot]
820b80b320 build: prefix version in uploader script (#36174)
build: prefix v in uploader script

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-10-27 17:47:07 -07:00
trop[bot]
60889443f7 refactor: handle uncaught promise error (#36159)
Co-authored-by: daief <1437931235@qq.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: daief <1437931235@qq.com>
2022-10-27 14:23:44 -04:00
trop[bot]
15e0366c35 test: fix flake in will-navigate test (#36165)
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>
2022-10-27 14:19:39 -04:00
John Kleinschmidt
65c4cd7f19 test: fixup HID test for ARM CI (#36168)
(cherry picked from commit caf28066d6)
2022-10-27 10:59:31 -07:00
Keeley Hammond
286b533ec1 build: determine electron version from tags not files (#36134)
* build: determine electron version from tags not files (#36106)

* build: determine electron version from tags not files

* build: make electron_version dependent on packed-refs and git HEAD

* build: do not delete electron/.git

* build: do not revert a commit we didn't make

* build: gen version file instead of just writing it

* build: update cache and ninja targets

* build: copy resource.h to generated electron.rc

* build: electron_win32_resources should be public deps

* build: also copy the icon

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

* build: ensure get-version runs in the electron git checkout (#36128)

* build: strip v in the getElectronVersion helper

Co-authored-by: MarshallOfSound <marshallofsound@electronjs.org>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-10-27 10:28:21 -04:00
trop[bot]
d0d7dfab67 docs: correcting main example in WebRequest documentation (#36161)
docs: correcting main example in WebRequest documentation (#36113)

Correcting main example

The entry `*://electron.github.io` is invalid and produces an exception. i.e.

> UnhandledPromiseRejectionWarning: TypeError: Invalid url pattern *://electron.github.io: Empty path.

Setting a valid path to resolve this issue

Co-authored-by: Shane Gannon <sgannon200@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shane Gannon <sgannon200@gmail.com>
2022-10-27 09:31:03 -04:00
trop[bot]
3d619ac79f docs: document that when invoke rejects, it gives a different Error (#36148)
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>
2022-10-26 17:28:07 -07:00
trop[bot]
163518b80f build: use python3 for appveyor commands (#36133)
Co-authored-by: Samuel Attard <sattard@salesforce.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-10-25 20:28:12 -07:00
Sudowoodo Release Bot
b930387036 Bump v22.0.0-beta.1 2022-10-25 10:02:00 -07:00
trop[bot]
ba08f4c157 docs: fixed MenuItem documentation to use the same formatting for all role options (#36120)
docs: fixed MenuItem documentation to use the same formatting for all role options (#36112)

Fixed MenuItem documentation

Some of the items in the list of possible roles were formatted differently, which made it harder to read.
Sorry if this was intended, but I found it easier to read with them all formatted the same.

Co-authored-by: flynow10 <37031514+flynow10@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: flynow10 <37031514+flynow10@users.noreply.github.com>
2022-10-25 20:45:23 +09:00
trop[bot]
51f6a644e9 refactor: enable OOPIF printing to PDF (#36095)
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>
2022-10-24 15:26:30 -04:00
trop[bot]
2b13ba9231 test: exit properly when node-spec-runner validates specs (#36102)
test: exit properly when node spec runner validates specs

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>
2022-10-24 15:25:04 -04:00
trop[bot]
dc73409683 test: disable flaky linux arm/arm64 crash test case (#36097)
test: disable failing linux arm/arm64 crash test case

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-10-24 14:48:52 -04:00
Sudowoodo Release Bot
b637d0312c Bump v22.0.0-alpha.8 2022-10-24 06:30:55 -07:00
electron-roller[bot]
fa39ee4bb7 chore: bump chromium to 108.0.5359.10 (22-x-y) (#36063)
* chore: bump chromium in DEPS to 108.0.5359.4

* chore: update patches

* fixup! Change content::PluginList to only run on the UI thread.

(cherry picked from commit 7b5ec87d4f)
Co-Authored-By: Robo <hop2deep@gmail.com>
(cherry picked from commit 76a618e7d0)

* chore: bump chromium in DEPS to 108.0.5359.10

* chore: update patches

* fixup printing patch

https://github.com/electron/electron/pull/35375 accidentally
broke https://github.com/electron/electron/pull/34711

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: John Kleinschmidt <jkleinsc@electronjs.org>
2022-10-21 20:00:18 -04:00
trop[bot]
b0a5ada661 fix: printToPDF default margins (#36073)
fix: printToPDF default margins (#36060)

printToPDF default margins

The document printToPDF has a 1cm margin and this default value has been added in the code.

Co-authored-by: Yusoo <Yusoo@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Yusoo <Yusoo@users.noreply.github.com>
2022-10-20 14:32:13 -04:00
trop[bot]
abf7a48605 feat: support serialPort.forget() (#36062)
feat: enable serialPort.revoke()

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>
2022-10-20 14:29:48 -04:00
Sudowoodo Release Bot
0525247b38 Bump v22.0.0-alpha.7 2022-10-20 06:31:10 -07:00
trop[bot]
6ee24c97ac fix: headless job tracking in printToPDF (#36065)
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>
2022-10-19 10:09:36 +02:00
trop[bot]
72075edca5 chore: bump chromium to 108.0.5355.0 (22-x-y) (#36056)
* chore: bump chromium to 108.0.5355.0 (main) (#35900)

* chore: bump chromium in DEPS to 108.0.5339.0

* chore: bump chromium in DEPS to 108.0.5341.0

* chore: sync patch to unrelated upstream code shear

patches/chromium/network_service_allow_remote_certificate_verification_logic.patch

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

* chore: sync patch to unrelated upstream code shear

patches/chromium/printing.patch

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

* chore: sync patch to unrelated upstream code shear

patches/chromium/chore_add_electron_deps_to_gitignores.patch

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

* chore: refresh patches - `e patches all`

* chore: remove unused parameter from WillCreateURLLoaderRequestInterceptors

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

* perf: avoid unique pointer round trip

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

* refactor: Simplify entropy provider management.

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

* fixup! perf: avoid unique pointer round trip

* fixup! perf: avoid unique pointer round trip

* refactor: update typeof FileSelectHelper::select_file_dialog_

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

* fixup! fixup! perf: avoid unique pointer round trip

* chore: bump chromium in DEPS to 108.0.5343.0

* chore: update patches

* chore: bump chromium in DEPS to 108.0.5345.0

* chore: bump chromium in DEPS to 108.0.5347.0

* chore: bump chromium in DEPS to 108.0.5349.0

* chore: bump chromium in DEPS to 108.0.5351.0

* chore: bump chromium in DEPS to 108.0.5353.0

* chore: bump chromium in DEPS to 108.0.5355.0

* chore: update patches

* Refactor display::win::DisplayInfo to display::win::internal::DisplayInfo

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

* Update proxy resolution to use NAK - Part 2

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

* Disable PreconnectManager when the user disabled preloading.

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

* chore: update patches

* chore: update sysroot

* linux: Remove breakpad integration

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

* chore: update comments

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com>

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

* chore: fixup patches

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: John Kleinschmidt <jkleinsc@electronjs.org>
2022-10-17 14:42:15 -04:00
Sudowoodo Release Bot
f486172114 Bump v22.0.0-alpha.6 2022-10-17 11:38:11 -07:00
trop[bot]
b938b30128 docs: update VS Code debugger types to remove "pwa-" prefix (#36054)
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>
2022-10-17 14:16:44 -04:00
Sudowoodo Release Bot
0b9212859b Revert "Bump v22.0.0-alpha.6"
This reverts commit abd8c8367f.
2022-10-17 08:59:17 -07:00
Sudowoodo Release Bot
abd8c8367f Bump v22.0.0-alpha.6 2022-10-17 06:31:02 -07:00
trop[bot]
9ab5b08466 fix: override app's desktop name and v8 flags in default-app (#36049)
Co-authored-by: Piroro-hs <Piroro-hs@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Piroro-hs <Piroro-hs@users.noreply.github.com>
2022-10-17 14:03:14 +02:00
trop[bot]
8e7c81052d chore: remove useless Node.js V8 patch (#36043)
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>
2022-10-17 11:39:23 +02:00
trop[bot]
b403ccc73c test: re-enable <webview> tag DOM events emits resize event (#36044)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-10-17 10:57:43 +02:00
trop[bot]
583b24f0b2 test: more robust PDF specs (#36008)
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>
2022-10-15 01:25:04 -07:00
trop[bot]
b8a6fcd6c7 test: re-enable power monitor tests on arm64 (#36021)
test: re-enable powermonitor on arm64

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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-10-15 01:24:05 -07:00
trop[bot]
ec7e24da56 fix: Windows 7 frame showing for frameless non-resizable windows (#36024)
Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2022-10-13 17:02:46 -04:00
trop[bot]
f232a31891 fix: disable nodeIntegrationInWorker for certain Worker types (#36010)
fix: disable nodeIntegrationInWorker for certain Worker types

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>
2022-10-13 11:40:51 -04:00
Sudowoodo Release Bot
cc7822f950 Bump v22.0.0-alpha.5 2022-10-13 07:06:04 -07:00
Sudowoodo Release Bot
71cbdb01b2 Revert "Bump v22.0.0-alpha.5"
This reverts commit 323803263f.
2022-10-13 07:03:50 -07:00
Sudowoodo Release Bot
323803263f Bump v22.0.0-alpha.5 2022-10-13 06:30:59 -07:00
trop[bot]
5b6b7e85ff build: fix building with enable_ppapi = false (#36007)
Co-authored-by: Milan Burda <milan.burda@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-10-12 13:09:50 -04:00
trop[bot]
0c8be31d1a docs: remove references to Widevine (#35989)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-10-12 10:03:44 -04:00
trop[bot]
b74a04cce5 fix: webContents.printToPDF option plumbing (#35993)
fix: contents.printToPDF option plumbing

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>
2022-10-12 10:50:48 +02:00
trop[bot]
a4afb0ab86 fix: drag and drop should copy on macOS (#35976)
fix: drag and drop should copy on macOS (#35963)

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>
2022-10-11 23:19:58 +02:00
trop[bot]
ba0ebeecdb fix: on-screen-keyboard hides on input blurred in webview (#35983)
Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kyrylo Hrechykhin <khrechykhin@microsoft.com>
2022-10-11 23:19:44 +02:00
Sudowoodo Release Bot
1bcca22149 Bump v22.0.0-alpha.4 2022-10-11 09:15:25 -07:00
trop[bot]
c87b479a05 fix: expose the built-in electron module via the ESM loader (#35957)
Co-authored-by: Samuel Attard <sattard@salesforce.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-10-11 11:48:05 -04:00
trop[bot]
07d4fc3288 fix: override content::ContentMainDelegate::CreateContentClient() (#35964)
* fix: override content::ContentMainDelegate::CreateContentClient()

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

* chore: remove extra call

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>
2022-10-11 02:37:35 -07:00
trop[bot]
bf8dec7b63 fix: add missing #include "base/cxx17_backports.h" (#35955)
Co-authored-by: Milan Burda <milan.burda@gmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-10-11 15:47:33 +09:00
Sudowoodo Release Bot
059f8cd353 Bump v22.0.0-alpha.3 2022-10-06 06:46:58 -07:00
Sudowoodo Release Bot
8ca56d0ff8 Bump v22.0.0-alpha.2 2022-10-06 06:31:01 -07:00
Samuel Attard
1432649617 chore: cherry-pick c83640db21b5 from chromium (#35927)
* chore: cherry-pick c83640db21b5 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-10-06 04:26:25 -07:00
Samuel Attard
fb330fba9e build: fix filesystem permissions from bad trop commits
Ref: 60ae79e418
Ref: 1995972467
Ref: a9d1ccd6a0
Ref: 09475f87f0
2022-10-05 12:14:20 -07:00
trop[bot]
09475f87f0 chore: bump chromium to 108.0.5329.0 (22-x-y) (#35906)
* chore: bump chromium to 108.0.5329.0 (main) (#35628)

Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>

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

* chore: update libcxx filenames

(cherry picked from commit 3c6a56394b)

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: VerteDinde <vertedinde@electronjs.org>
2022-10-05 13:14:34 -04:00
trop[bot]
a9d1ccd6a0 docs: update supported Mac versions (#35913)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-10-05 11:05:54 +02:00
trop[bot]
1995972467 docs: update bluetooth fiddle example event name to trigger correct event (#35908)
Fix event type spelling for bluetooth fiddle example

Co-authored-by: sam <sam.leider@hotmail.com>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: sam <sam.leider@hotmail.com>
2022-10-04 20:31:13 -07:00
trop[bot]
60ae79e418 fix: TryCatch scope in node_bindings (#35896)
fix: TryCatch scope in node_bindings

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>
2022-10-04 15:43:16 +02:00
Sudowoodo Release Bot
71bc0395c5 Bump v22.0.0-alpha.1 2022-09-28 10:54:32 -07:00
357 changed files with 6202 additions and 3781 deletions

View File

@@ -455,7 +455,7 @@ step-delete-git-directories: &step-delete-git-directories
command: |
if [ "`uname`" == "Darwin" ]; then
cd src
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" ) | xargs rm -rf
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" -not -path "./electron/*" ) | xargs rm -rf
fi
# On macOS the yarn install command during gclient sync was run on a linux
@@ -494,6 +494,11 @@ step-fix-sync: &step-fix-sync
# Remove extra output from calling gclient getdep which always calls update_depot_tools
sed -i '' "s/Updating depot_tools... //g" esbuild_ensure_file
cipd ensure --root src/third_party/devtools-frontend/src/third_party/esbuild -ensure-file esbuild_ensure_file
# Fix ninja (wrong binary)
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
sed -i '' "s/Updating depot_tools... //g" ninja_ensure_file
cipd ensure --root src/third_party/ninja -ensure-file ninja_ensure_file
fi
cd src/third_party/angle
@@ -569,6 +574,13 @@ step-electron-build: &step-electron-build
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default tools/v8_context_snapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
# Remove unused args from mksnapshot_args
SEDOPTION=
if [ "`uname`" == "Darwin" ]; then
SEDOPTION="-i ''"
fi
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
(cd out/Default; zip mksnapshot.zip mksnapshot_args clang_x64_v8_arm64/gen/v8/embedded.S)
rm -rf out/Default/clang_x64_v8_arm64/gen
rm -rf out/Default/clang_x64_v8_arm64/obj
@@ -759,6 +771,13 @@ step-mksnapshot-build: &step-mksnapshot-build
if [ "$USE_PREBUILT_V8_CONTEXT_SNAPSHOT" != "1" ]; then
ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
# Remove unused args from mksnapshot_args
SEDOPTION=
if [ "`uname`" == "Darwin" ]; then
SEDOPTION="-i ''"
fi
sed $SEDOPTION '/.*builtins-pgo/d' out/Default/mksnapshot_args
sed $SEDOPTION '/--turbo-profiling-input/d' out/Default/mksnapshot_args
fi
if [ "`uname`" != "Darwin" ]; then
if [ "$TARGET_ARCH" == "arm" ]; then
@@ -814,7 +833,7 @@ step-maybe-zip-symbols: &step-maybe-zip-symbols
cd src
export BUILD_PATH="$PWD/out/Default"
ninja -C out/Default electron:licenses
ninja -C out/Default electron:electron_version
ninja -C out/Default electron:electron_version_file
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
@@ -874,12 +893,12 @@ step-touch-sync-done: &step-touch-sync-done
step-maybe-restore-src-cache: &step-maybe-restore-src-cache
restore_cache:
keys:
- v14-src-cache-{{ checksum "src/electron/.depshash" }}
- v16-src-cache-{{ checksum "src/electron/.depshash" }}
name: Restoring src cache
step-maybe-restore-src-cache-marker: &step-maybe-restore-src-cache-marker
restore_cache:
keys:
- v14-src-cache-marker-{{ checksum "src/electron/.depshash" }}
- v16-src-cache-marker-{{ checksum "src/electron/.depshash" }}
name: Restoring src cache marker
# Restore exact or closest git cache based on the hash of DEPS and .circle-sync-done
@@ -894,14 +913,6 @@ step-maybe-restore-git-cache: &step-maybe-restore-git-cache
- v1-git-cache-{{ checksum "src/electron/.circle-sync-done" }}
name: Conditionally restoring git cache
step-restore-out-cache: &step-restore-out-cache
restore_cache:
paths:
- ./src/out/Default
keys:
- v10-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
name: Restoring out cache
step-set-git-cache-path: &step-set-git-cache-path
run:
name: Set GIT_CACHE_PATH to make gclient to use the cache
@@ -919,13 +930,6 @@ step-save-git-cache: &step-save-git-cache
key: v1-git-cache-{{ checksum "src/electron/.circle-sync-done" }}-{{ checksum "src/electron/DEPS" }}
name: Persisting git cache
step-save-out-cache: &step-save-out-cache
save_cache:
paths:
- ./src/out/Default
key: v10-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
name: Persisting out cache
step-run-electron-only-hooks: &step-run-electron-only-hooks
run:
name: Run Electron Only Hooks
@@ -955,13 +959,16 @@ step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-c
rm -rf third_party/electron_node/deps/openssl
rm -rf third_party/electron_node/deps/v8
rm -rf chrome/test/data/xr/webvr_info
rm -rf src/third_party/angle/third_party/VK-GL-CTS/src
rm -rf src/third_party/swift-toolchain
rm -rf src/third_party/swiftshader/tests/regres/testlists
# Save the src cache based on the deps hash
step-save-src-cache: &step-save-src-cache
save_cache:
paths:
- /var/portal
key: v14-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }}
key: v16-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }}
name: Persisting src cache
step-make-src-cache-marker: &step-make-src-cache-marker
run:
@@ -971,7 +978,7 @@ step-save-src-cache-marker: &step-save-src-cache-marker
save_cache:
paths:
- .src-cache-marker
key: v14-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }}
key: v16-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }}
step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
run:
@@ -1297,9 +1304,6 @@ commands:
build:
type: boolean
default: true
use-out-cache:
type: boolean
default: true
restore-src-cache:
type: boolean
default: true
@@ -1422,10 +1426,6 @@ commands:
- *step-delete-git-directories
# Electron app
- when:
condition: << parameters.use-out-cache >>
steps:
- *step-restore-out-cache
- *step-gn-gen-default
- *step-electron-build
- *step-maybe-electron-dist-strip
@@ -1468,22 +1468,6 @@ commands:
condition: << parameters.build >>
steps:
- move_and_store_all_artifacts
- run:
name: Remove the big things on macOS, this seems to be better on average
command: |
if [ "`uname`" == "Darwin" ]; then
mkdir -p src/out/Default
cd src/out/Default
find . -type f -size +50M -delete
mkdir -p gen/electron
cd gen/electron
# These files do not seem to like being in a cache, let us remove them
find . -type f -name '*_pkg_info' -delete
fi
- when:
condition: << parameters.use-out-cache >>
steps:
- *step-save-out-cache
- *step-maybe-notify-slack-failure
@@ -1637,7 +1621,6 @@ jobs:
persist: true
checkout: false
checkout-and-assume-cache: true
use-out-cache: false
linux-x64-testing-asan:
executor:
@@ -1654,7 +1637,6 @@ jobs:
- electron-build:
persist: true
checkout: true
use-out-cache: false
build-nonproprietary-ffmpeg: false
linux-x64-testing-no-run-as-node:
@@ -1671,7 +1653,6 @@ jobs:
- electron-build:
persist: false
checkout: true
use-out-cache: false
linux-x64-testing-gn-check:
executor:
@@ -1722,7 +1703,6 @@ jobs:
persist: true
checkout: false
checkout-and-assume-cache: true
use-out-cache: false
linux-arm-publish:
executor:
@@ -1765,7 +1745,6 @@ jobs:
persist: true
checkout: false
checkout-and-assume-cache: true
use-out-cache: false
linux-arm64-testing-gn-check:
executor:
@@ -2229,3 +2208,5 @@ workflows:
lint:
jobs:
- lint
# VS Code Extension Version: 1.1.1

105
BUILD.gn
View File

@@ -107,6 +107,14 @@ branding = read_file("shell/app/BRANDING.json", "json")
electron_project_name = branding.project_name
electron_product_name = branding.product_name
electron_mac_bundle_id = branding.mac_bundle_id
electron_version = exec_script("script/print-version.py",
[],
"trim string",
[
".git/packed-refs",
".git/HEAD",
"script/lib/get-version.js",
])
if (is_mas_build) {
assert(is_mac,
@@ -202,6 +210,15 @@ webpack_build("electron_isolated_renderer_bundle") {
out_file = "$target_gen_dir/js2c/isolated_bundle.js"
}
webpack_build("electron_utility_bundle") {
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.utility_bundle_deps
config_file = "//electron/build/webpack/webpack.config.utility.js"
out_file = "$target_gen_dir/js2c/utility_init.js"
}
action("electron_js2c") {
deps = [
":electron_asar_bundle",
@@ -209,6 +226,7 @@ action("electron_js2c") {
":electron_isolated_renderer_bundle",
":electron_renderer_bundle",
":electron_sandboxed_renderer_bundle",
":electron_utility_bundle",
":electron_worker_bundle",
]
@@ -218,6 +236,7 @@ action("electron_js2c") {
"$target_gen_dir/js2c/isolated_bundle.js",
"$target_gen_dir/js2c/renderer_init.js",
"$target_gen_dir/js2c/sandbox_bundle.js",
"$target_gen_dir/js2c/utility_init.js",
"$target_gen_dir/js2c/worker_init.js",
]
@@ -302,12 +321,9 @@ npm_action("electron_version_args") {
outputs = [ "$target_gen_dir/electron_version.args" ]
args = rebase_path(outputs)
args = rebase_path(outputs) + [ "$electron_version" ]
inputs = [
"ELECTRON_VERSION",
"script/generate-version-json.js",
]
inputs = [ "script/generate-version-json.js" ]
}
templated_file("electron_version_header") {
@@ -319,6 +335,39 @@ templated_file("electron_version_header") {
args_files = get_target_outputs(":electron_version_args")
}
templated_file("electron_win_rc") {
deps = [ ":electron_version_args" ]
template = "build/templates/electron_rc.tmpl"
output = "$target_gen_dir/win-resources/electron.rc"
args_files = get_target_outputs(":electron_version_args")
}
copy("electron_win_resource_files") {
sources = [
"shell/browser/resources/win/electron.ico",
"shell/browser/resources/win/resource.h",
]
outputs = [ "$target_gen_dir/win-resources/{{source_file_part}}" ]
}
templated_file("electron_version_file") {
deps = [ ":electron_version_args" ]
template = "build/templates/version_string.tmpl"
output = "$root_build_dir/version"
args_files = get_target_outputs(":electron_version_args")
}
group("electron_win32_resources") {
public_deps = [
":electron_win_rc",
":electron_win_resource_files",
]
}
action("electron_fuses") {
script = "build/fuses/build.py"
@@ -368,6 +417,7 @@ source_set("electron_lib") {
"chromium_src:chrome",
"chromium_src:chrome_spellchecker",
"shell/common/api:mojo",
"shell/services/node/public/mojom",
"//base:base_static",
"//base/allocator:buildflags",
"//chrome:strings",
@@ -404,9 +454,6 @@ source_set("electron_lib") {
"//media/mojo/mojom",
"//net:extras",
"//net:net_resources",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/shared_impl",
"//printing/buildflags",
"//services/device/public/cpp/geolocation",
"//services/device/public/cpp/hid",
@@ -493,13 +540,6 @@ source_set("electron_lib") {
]
}
if (is_linux) {
deps += [
"//components/crash/content/browser",
"//ui/gtk:gtk_config",
]
}
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
@@ -562,11 +602,14 @@ source_set("electron_lib") {
":electron_gtk_stubs",
":libnotify_loader",
"//build/config/linux/gtk",
"//components/crash/content/browser",
"//dbus",
"//device/bluetooth",
"//third_party/crashpad/crashpad/client",
"//ui/base/ime/linux",
"//ui/events/devices/x11",
"//ui/events/platform/x11",
"//ui/gtk:gtk_config",
"//ui/linux:linux_ui",
"//ui/linux:linux_ui_factory",
"//ui/views/controls/webview",
@@ -588,16 +631,8 @@ source_set("electron_lib") {
sources += [
"shell/browser/certificate_manager_model.cc",
"shell/browser/certificate_manager_model.h",
"shell/browser/ui/gtk/app_indicator_icon.cc",
"shell/browser/ui/gtk/app_indicator_icon.h",
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
"shell/browser/ui/gtk/app_indicator_icon_menu.h",
"shell/browser/ui/gtk/gtk_status_icon.cc",
"shell/browser/ui/gtk/gtk_status_icon.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/gtk/status_icon.cc",
"shell/browser/ui/gtk/status_icon.h",
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
@@ -620,11 +655,23 @@ source_set("electron_lib") {
if (enable_plugins) {
deps += [ "chromium_src:plugins" ]
sources += [
"shell/common/plugin_info.cc",
"shell/common/plugin_info.h",
"shell/renderer/electron_renderer_pepper_host_factory.cc",
"shell/renderer/electron_renderer_pepper_host_factory.h",
"shell/renderer/pepper_helper.cc",
"shell/renderer/pepper_helper.h",
]
}
if (enable_ppapi) {
deps += [
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/shared_impl",
]
}
if (enable_run_as_node) {
sources += [
"shell/app/node_main.cc",
@@ -750,7 +797,6 @@ if (is_mac) {
electron_helper_name = "$electron_product_name Helper"
electron_login_helper_name = "$electron_product_name Login Helper"
electron_framework_version = "A"
electron_version = read_file("ELECTRON_VERSION", "trim string")
mac_xib_bundle_data("electron_xibs") {
sources = [ "shell/common/resources/mac/MainMenu.xib" ]
@@ -1191,6 +1237,7 @@ if (is_mac) {
":default_app_asar",
":electron_app_manifest",
":electron_lib",
":electron_win32_resources",
":packed_resources",
"//components/crash/core/app",
"//content:sandbox_helper_win",
@@ -1224,8 +1271,7 @@ if (is_mac) {
if (is_win) {
sources += [
# TODO: we should be generating our .rc files more like how chrome does
"shell/browser/resources/win/electron.rc",
"$target_gen_dir/win-resources/electron.rc",
"shell/browser/resources/win/resource.h",
]
@@ -1407,15 +1453,10 @@ group("licenses") {
]
}
copy("electron_version") {
sources = [ "ELECTRON_VERSION" ]
outputs = [ "$root_build_dir/version" ]
}
dist_zip("electron_dist_zip") {
data_deps = [
":electron_app",
":electron_version",
":electron_version_file",
":licenses",
]
if (is_linux) {

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'107.0.5286.0',
'108.0.5359.62',
'node_version':
'v16.17.1',
'nan_version':

View File

@@ -1 +0,0 @@
22.0.0-nightly.20220928

View File

@@ -12,7 +12,7 @@ using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) an
[Chromium](https://www.chromium.org) and is used by the [Atom
editor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).
Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
Follow [@electronjs](https://twitter.com/electronjs) on Twitter for important
announcements.
This project adheres to the Contributor Covenant
@@ -38,7 +38,7 @@ For more installation options and troubleshooting tips, see
Each Electron release provides binaries for macOS, Windows, and Linux.
* macOS (El Capitan and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* macOS (High Sierra and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* Windows (Windows 7 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8.
* Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on:
* Ubuntu 14.04 and newer

View File

@@ -179,7 +179,11 @@ for:
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
- ps: >-
# Remove unused args from mksnapshot_args
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') } | Set-Content out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
@@ -190,7 +194,6 @@ for:
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- 7z a node_headers.zip out\Default\gen\node_headers
- 7z a builtins-pgo.zip v8\tools\builtins-pgo
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
@@ -199,14 +202,14 @@ for:
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python electron\script\zip-symbols.py
python3 electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
} else {
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
7z a pdb.zip out\Default\*.pdb
}
- python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
deploy_script:
- cd electron
@@ -214,10 +217,10 @@ for:
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python script\release\uploaders\upload.py --verbose --upload_to_storage
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py --verbose
& python3 script\release\uploaders\upload.py --verbose
}
} elseif (Test-Path Env:\TEST_WOA) {
node script/release/ci-release-build.js --job=electron-woa-testing --ci=GHA --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
@@ -235,7 +238,6 @@ for:
- if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip)
- if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip)
- if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib)
- if exist builtins-pgo.zip (appveyor-retry appveyor PushArtifact builtins-pgo.zip)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
@@ -269,7 +271,7 @@ for:
# Download build artifacts
$apiUrl = 'https://ci.appveyor.com/api'
$build_info = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
$artifacts_to_download = @('dist.zip','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','builtins-pgo.zip')
$artifacts_to_download = @('dist.zip','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build") {
$jobId = $job.jobId
@@ -290,7 +292,6 @@ for:
}
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
- ps: 7z x -y -osrc node_headers.zip
- ps: 7z x -y -osrc builtins-pgo.zip
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
@@ -303,11 +304,11 @@ for:
- echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log
- echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log
- cd ..
- echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
- echo Verifying non proprietary ffmpeg & python3 electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg
- echo "About to verify mksnapshot"
- echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
- echo Verifying mksnapshot & python3 electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
- echo "Done verifying mksnapshot"
- echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
- echo Verifying chromedriver & python3 electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
- echo "Done verifying chromedriver"
on_finish:

View File

@@ -45,3 +45,6 @@ enable_cet_shadow_stack = false
# V8 in the browser process.
# Ref: https://source.chromium.org/chromium/chromium/src/+/45fba672185aae233e75d6ddc81ea1e0b30db050:v8/BUILD.gn;l=281
is_cfi = false
# TODO: fix this once sysroots have been updated.
use_qt = false

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 22,0,0,20220928
PRODUCTVERSION 22,0,0,20220928
FILEVERSION $major,$minor,$patch,$prerelease_number
PRODUCTVERSION $major,$minor,$patch,$prerelease_number
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "22.0.0"
VALUE "FileVersion", "$major.$minor.$patch"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "22.0.0"
VALUE "ProductVersion", "$major.$minor.$patch"
VALUE "SquirrelAwareVersion", "1"
END
END

View File

@@ -0,0 +1 @@
$full_version

View File

@@ -0,0 +1,4 @@
module.exports = require('./webpack.config.base')({
target: 'utility',
alwaysHasNode: true
});

View File

@@ -6,6 +6,7 @@ import("//build/config/ozone.gni")
import("//build/config/ui.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//electron/buildflags/buildflags.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//third_party/widevine/cdm/widevine.gni")
@@ -231,6 +232,8 @@ static_library("chrome") {
"//chrome/browser/printing/printing_service.h",
"//components/printing/browser/print_to_pdf/pdf_print_job.cc",
"//components/printing/browser/print_to_pdf/pdf_print_job.h",
"//components/printing/browser/print_to_pdf/pdf_print_result.cc",
"//components/printing/browser/print_to_pdf/pdf_print_result.h",
"//components/printing/browser/print_to_pdf/pdf_print_utils.cc",
"//components/printing/browser/print_to_pdf/pdf_print_utils.h",
]
@@ -372,15 +375,20 @@ source_set("plugins") {
deps += [
"//components/strings",
"//media:media_buildflags",
"//ppapi/buildflags",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/proxy:ipc",
"//ppapi/shared_impl",
"//services/device/public/mojom",
"//skia",
"//storage/browser",
]
if (enable_ppapi) {
deps += [
"//ppapi/buildflags",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/proxy:ipc",
"//ppapi/shared_impl",
]
}
}
# This source set is just so we don't have to depend on all of //chrome/browser

View File

@@ -83,7 +83,7 @@ function loadApplicationPackage (packagePath: string) {
});
try {
// Override app name and version.
// Override app's package.json data.
packagePath = path.resolve(packagePath);
const packageJsonPath = path.join(packagePath, 'package.json');
let appPath;
@@ -104,6 +104,16 @@ function loadApplicationPackage (packagePath: string) {
} else if (packageJson.name) {
app.name = packageJson.name;
}
if (packageJson.desktopName) {
app.setDesktopName(packageJson.desktopName);
} else {
app.setDesktopName(`${app.name}.desktop`);
}
// Set v8 flags, deliberately lazy load so that apps that do not use this
// feature do not pay the price
if (packageJson.v8Flags) {
require('v8').setFlagsFromString(packageJson.v8Flags);
}
appPath = packagePath;
}

View File

@@ -83,7 +83,6 @@ These individual tutorials expand on topics discussed in the guide above.
* Electron Releases & Developer Feedback
* [Versioning Policy](tutorial/electron-versioning.md)
* [Release Timelines](tutorial/electron-timelines.md)
* [Testing Widevine CDM](tutorial/testing-widevine-cdm.md)
---

View File

@@ -717,6 +717,8 @@ To set the locale, you'll want to use a command line switch at app startup, whic
**Note:** This API must be called after the `ready` event is emitted.
**Note:** To see example return values of this API compared to other locale and language APIs, see [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
### `app.getLocaleCountryCode()`
Returns `string` - User operating system's locale two-letter [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) country code. The value is taken from native OS APIs.
@@ -725,10 +727,42 @@ Returns `string` - User operating system's locale two-letter [ISO 3166](https://
### `app.getSystemLocale()`
Returns `string` - The current system locale. On Windows and Linux, it is fetched using Chromium's `i18n` library. On macOS, the `NSLocale` object is used instead.
Returns `string` - The current system locale. On Windows and Linux, it is fetched using Chromium's `i18n` library. On macOS, `[NSLocale currentLocale]` is used instead. To get the user's current system language, which is not always the same as the locale, it is better to use [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
Different operating systems also use the regional data differently:
* Windows 11 uses the regional format for numbers, dates, and times.
* macOS Monterey uses the region for formatting numbers, dates, times, and for selecting the currency symbol to use.
Therefore, this API can be used for purposes such as choosing a format for rendering dates and times in a calendar app, especially when the developer wants the format to be consistent with the OS.
**Note:** This API must be called after the `ready` event is emitted.
**Note:** To see example return values of this API compared to other locale and language APIs, see [`app.getPreferredSystemLanguages()`](#appgetpreferredsystemlanguages).
### `app.getPreferredSystemLanguages()`
Returns `string[]` - The user's preferred system languages from most preferred to least preferred, including the country codes if applicable. A user can modify and add to this list on Windows or macOS through the Language and Region settings.
The API uses `GlobalizationPreferences` (with a fallback to `GetSystemPreferredUILanguages`) on Windows, `\[NSLocale preferredLanguages\]` on macOS, and `g_get_language_names` on Linux.
This API can be used for purposes such as deciding what language to present the application in.
Here are some examples of return values of the various language and locale APIs with different configurations:
* For Windows, where the application locale is German, the regional format is Finnish (Finland), and the preferred system languages from most to least preferred are French (Canada), English (US), Simplified Chinese (China), Finnish, and Spanish (Latin America):
* `app.getLocale()` returns `'de'`
* `app.getSystemLocale()` returns `'fi-FI'`
* `app.getPreferredSystemLanguages()` returns `['fr-CA', 'en-US', 'zh-Hans-CN', 'fi', 'es-419']`
* On macOS, where the application locale is German, the region is Finland, and the preferred system languages from most to least preferred are French (Canada), English (US), Simplified Chinese, and Spanish (Latin America):
* `app.getLocale()` returns `'de'`
* `app.getSystemLocale()` returns `'fr-FI'`
* `app.getPreferredSystemLanguages()` returns `['fr-CA', 'en-US', 'zh-Hans-FI', 'es-419']`
Both the available languages and regions and the possible return values differ between the two operating systems.
As can be seen with the example above, on Windows, it is possible that a preferred system language has no country code, and that one of the preferred system languages corresponds with the language used for the regional format. On macOS, the region serves more as a default country code: the user doesn't need to have Finnish as a preferred language to use Finland as the region,and the country code `FI` is used as the country code for preferred system languages that do not have associated countries in the language name.
### `app.addRecentDocument(path)` _macOS_ _Windows_
* `path` string
@@ -1203,7 +1237,7 @@ For `infoType` equal to `basic`:
}
```
Using `basic` should be preferred if only basic information like `vendorId` or `driverId` is needed.
Using `basic` should be preferred if only basic information like `vendorId` or `deviceId` is needed.
### `app.setBadgeCount([count])` _Linux_ _macOS_

View File

@@ -96,14 +96,6 @@ Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will no
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
> **NOTE:** Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
The main process should listen for `channel` with
[`ipcMain.handle()`](./ipc-main.md#ipcmainhandlechannel-listener).
@@ -126,6 +118,21 @@ If you need to transfer a [`MessagePort`][] to the main process, use [`ipcRender
If you do not need a response to the message, consider using [`ipcRenderer.send`](#ipcrenderersendchannel-args).
> **Note**
> Sending non-standard JavaScript types such as DOM objects or
> special Electron objects will throw an exception.
>
> Since the main process does not have support for DOM objects such as
> `ImageBitmap`, `File`, `DOMMatrix` and so on, such objects cannot be sent over
> Electron's IPC to the main process, as the main process would have no way to decode
> them. Attempting to send such objects over IPC will result in an error.
> **Note**
> If the handler in the main process throws an error,
> the promise returned by `invoke` will reject.
> However, the `Error` object in the renderer process
> will not be the same as the one thrown in the main process.
### `ipcRenderer.sendSync(channel, ...args)`
* `channel` string

View File

@@ -14,7 +14,7 @@ See [`Menu`](menu.md) for examples.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, 'showSubstitutions', 'toggleSmartQuotes', 'toggleSmartDashes', 'toggleTextReplacement', `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` string (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.

46
docs/api/parent-port.md Normal file
View File

@@ -0,0 +1,46 @@
# parentPort
> Interface for communication with parent process.
Process: [Utility](../glossary.md#utility-process)
`parentPort` is an [EventEmitter][event-emitter].
_This object is not exported from the `'electron'` module. It is only available as a property of the process object in the Electron API._
```js
// Main process
const child = utilityProcess.fork(path.join(__dirname, 'test.js'))
child.postMessage({ message: 'hello' })
child.on('message', (data) => {
console.log(data) // hello world!
})
// Child process
process.parentPort.on('message', (e) => {
process.parentPort.postMessage(`${e.data} world!`)
})
```
## Events
The `parentPort` object emits the following events:
### Event: 'message'
Returns:
* `messageEvent` Object
* `data` any
* `ports` MessagePortMain[]
Emitted when the process receives a message. Messages received on
this port will be queued up until a handler is registered for this
event.
## Methods
### `parentPort.postMessage(message)`
* `message` any
Sends a message from the process to its parent.

View File

@@ -113,6 +113,7 @@ A `string` representing the current process's type, can be:
* `browser` - The main process
* `renderer` - A renderer process
* `worker` - In a web worker
* `utility` - In a node process launched as a service
### `process.versions.chrome` _Readonly_
@@ -134,6 +135,11 @@ Each frame has its own JavaScript context. When contextIsolation is enabled, the
world also has a separate JavaScript context.
This property is only available in the renderer process.
### `process.parentPort`
A [`Electron.ParentPort`](parent-port.md) property if this is a [`UtilityProcess`](utility-process.md)
(or `null` otherwise) allowing communication with the parent process.
## Methods
The `process` object has the following methods:

View File

@@ -385,6 +385,50 @@ callback from `select-serial-port` is called. This event is intended for use
when using a UI to ask users to pick a port so that the UI can be updated
to remove the specified port.
#### Event: 'serial-port-revoked'
Returns:
* `event` Event
* `details` Object
* `port` [SerialPort](structures/serial-port.md)
* `frame` [WebFrameMain](web-frame-main.md)
* `origin` string - The origin that the device has been revoked from.
Emitted after `SerialPort.forget()` has been called. This event can be used
to help maintain persistent storage of permissions when `setDevicePermissionHandler` is used.
```js
// Browser Process
const { app, BrowserWindow } = require('electron')
app.whenReady().then(() => {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.webContents.session.on('serial-port-revoked', (event, details) => {
console.log(`Access revoked for serial device from origin ${details.origin}`)
})
})
```
```js
// Renderer Process
const portConnect = async () => {
// Request a port.
const port = await navigator.serial.requestPort()
// Wait for the serial port to open.
await port.open({ baudRate: 9600 })
// ...later, revoke access to the serial port.
await port.forget()
}
```
### Instance Methods
The following methods are available on instances of `Session`:

View File

@@ -27,17 +27,14 @@ app.whenReady().then(() => {
__Platform Considerations__
If you want to keep exact same behaviors on all platforms, you should not
rely on the `click` event; instead, always attach a context menu to the tray icon.
__Linux__
* On Linux distributions that only have app indicator support, you have to
install `libappindicator1` to make the tray icon work.
* The app indicator will be used if it is supported, otherwise
`GtkStatusIcon` will be used instead.
* App indicator will only be shown when it has a context menu.
* The `click` event is ignored when using the app indicator.
* Tray icon requires support of [StatusNotifierItem](https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/)
in user's desktop environment.
* The `click` event is emitted when the tray icon receives activation from
user, however the StatusNotifierItem spec does not specify which action would
cause an activation, for some environments it is left mouse click, but for
some it might be double left mouse click.
* In order for changes made to individual `MenuItem`s to take effect,
you have to call `setContextMenu` again. For example:
@@ -92,6 +89,9 @@ Returns:
Emitted when the tray icon is clicked.
Note that on Linux this event is emitted when the tray icon receives an
activation, which might not necessarily be left mouse click.
#### Event: 'right-click' _macOS_ _Windows_
Returns:

137
docs/api/utility-process.md Normal file
View File

@@ -0,0 +1,137 @@
# utilityProcess
`utilityProcess` creates a child process with
Node.js and Message ports enabled. It provides the equivalent of [`child_process.fork`][] API from Node.js
but instead uses [Services API][] from Chromium to launch the child process.
Process: [Main](../glossary.md#main-process)<br />
## Methods
### `utilityProcess.fork(modulePath[, args][, options])`
* `modulePath` string - Path to the script that should run as entrypoint in the child process.
* `args` string[] (optional) - List of string arguments that will be available as `process.argv`
in the child process.
* `options` Object (optional)
* `env` Object (optional) - Environment key-value pairs. Default is `process.env`.
* `execArgv` string[] (optional) - List of string arguments passed to the executable.
* `cwd` string (optional) - Current working directory of the child process.
* `stdio` (string[] | string) (optional) - Allows configuring the mode for `stdout` and `stderr`
of the child process. Default is `inherit`.
String value can be one of `pipe`, `ignore`, `inherit`, for more details on these values you can refer to
[stdio][] documentation from Node.js. Currently this option only supports configuring `stdout` and
`stderr` to either `pipe`, `inherit` or `ignore`. Configuring `stdin` is not supported; `stdin` will
always be ignored.
For example, the supported values will be processed as following:
* `pipe`: equivalent to ['ignore', 'pipe', 'pipe'] (the default)
* `ignore`: equivalent to 'ignore', 'ignore', 'ignore']
* `inherit`: equivalent to ['ignore', 'inherit', 'inherit']
* `serviceName` string (optional) - Name of the process that will appear in `name` property of
[`child-process-gone` event of `app`](app.md#event-child-process-gone).
Default is `node.mojom.NodeService`.
* `allowLoadingUnsignedLibraries` boolean (optional) _macOS_ - With this flag, the utility process will be
launched via the `Electron Helper (Plugin).app` helper executable on macOS, which can be
codesigned with `com.apple.security.cs.disable-library-validation` and
`com.apple.security.cs.allow-unsigned-executable-memory` entitlements. This will allow the utility process
to load unsigned libraries. Unless you specifically need this capability, it is best to leave this disabled.
Default is `false`.
Returns [`UtilityProcess`](utility-process.md#class-utilityprocess)
## Class: UtilityProcess
> Instances of the `UtilityProcess` represent the Chromium spawned child process
> with Node.js integration.
`UtilityProcess` is an [EventEmitter][event-emitter].
### Instance Methods
#### `child.postMessage(message, [transfer])`
* `message` any
* `transfer` MessagePortMain[] (optional)
Send a message to the child process, optionally transferring ownership of
zero or more [`MessagePortMain`][] objects.
For example:
```js
// Main process
const { port1, port2 } = new MessageChannelMain()
const child = utilityProcess.fork(path.join(__dirname, 'test.js'))
child.postMessage({ message: 'hello' }, [port1])
// Child process
process.parentPort.once('message', (e) => {
const [port] = e.ports
// ...
})
```
#### `child.kill()`
Returns `boolean`
Terminates the process gracefully. On POSIX, it uses SIGTERM
but will ensure the process is reaped on exit. This function returns
true if the kill is successful, and false otherwise.
### Instance Properties
#### `child.pid`
A `Integer | undefined` representing the process identifier (PID) of the child process.
If the child process fails to spawn due to errors, then the value is `undefined`. When
the child process exits, then the value is `undefined` after the `exit` event is emitted.
#### `child.stdout`
A `NodeJS.ReadableStream | null` that represents the child process's stdout.
If the child was spawned with options.stdio[1] set to anything other than 'pipe', then this will be `null`.
When the child process exits, then the value is `null` after the `exit` event is emitted.
```js
// Main process
const { port1, port2 } = new MessageChannelMain()
const child = utilityProcess.fork(path.join(__dirname, 'test.js'))
child.stdout.on('data', (data) => {
console.log(`Received chunk ${data}`)
})
```
#### `child.stderr`
A `NodeJS.ReadableStream | null` that represents the child process's stderr.
If the child was spawned with options.stdio[2] set to anything other than 'pipe', then this will be `null`.
When the child process exits, then the value is `null` after the `exit` event is emitted.
### Instance Events
#### Event: 'spawn'
Emitted once the child process has spawned successfully.
#### Event: 'exit'
Returns:
* `code` number - Contains the exit code for
the process obtained from waitpid on posix, or GetExitCodeProcess on windows.
Emitted after the child process ends.
#### Event: 'message'
Returns:
* `message` any
Emitted when the child process sends a message using [`process.parentPort.postMessage()`](process.md#processparentport).
[`child_process.fork`]: https://nodejs.org/dist/latest-v16.x/docs/api/child_process.html#child_processforkmodulepath-args-options
[Services API]: https://chromium.googlesource.com/chromium/src/+/master/docs/mojo_and_services.md
[stdio]: https://nodejs.org/dist/latest/docs/api/child_process.html#optionsstdio
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

View File

@@ -28,7 +28,7 @@ const { session } = require('electron')
// Modify the user agent for all requests to the following urls.
const filter = {
urls: ['https://*.github.com/*', '*://electron.github.io']
urls: ['https://*.github.com/*', '*://electron.github.io/*']
}
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {

View File

@@ -2,5 +2,5 @@ const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-respnse', response)
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
})

View File

@@ -194,6 +194,15 @@ overly prescriptive about how it should be used. Userland enables users to
create and share tools that provide additional functionality on top of what is
available in "core".
### utility process
The utility process is a child of the main process that allows running any
untrusted services that cannot be run in the main process. Chromium uses this
process to perform network I/O, audio/video processing, device inputs etc.
In Electron, you can create this process using [UtilityProcess][] API.
See also: [process](#process), [main process](#main-process)
### V8
V8 is Google's open source JavaScript engine. It is written in C++ and is
@@ -231,4 +240,5 @@ embedded content.
[renderer]: #renderer-process
[userland]: #userland
[using native node modules]: tutorial/using-native-node-modules.md
[UtilityProcess]: api/utility-process.md
[v8]: #v8

View File

@@ -52,15 +52,17 @@ ways to get your application signed and notarized.
If you're using Electron's favorite build tool, getting your application signed
and notarized requires a few additions to your configuration. [Forge](https://electronforge.io) is a
collection of the official Electron tools, using [`electron-packager`],
[`electron-osx-sign`], and [`electron-notarize`] under the hood.
[`@electron/osx-sign`], and [`@electron/notarize`] under the hood.
Detailed instructions on how to configure your application can be found in the [Electron Forge Code Signing Tutorial](https://www.electronforge.io/guides/code-signing/code-signing-macos).
Detailed instructions on how to configure your application can be found in the
[Signing macOS Apps](https://www.electronforge.io/guides/code-signing/code-signing-macos) guide in
the Electron Forge docs.
### Using Electron Packager
If you're not using an integrated build pipeline like Forge, you
are likely using [`electron-packager`], which includes [`electron-osx-sign`] and
[`electron-notarize`].
are likely using [`electron-packager`], which includes [`@electron/osx-sign`] and
[`@electron/notarize`].
If you're using Packager's API, you can pass [in configuration that both signs
and notarizes your application](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html).
@@ -70,13 +72,7 @@ const packager = require('electron-packager')
packager({
dir: '/path/to/my/app',
osxSign: {
identity: 'Developer ID Application: Felix Rieseberg (LT94ZKYDCJ)',
'hardened-runtime': true,
entitlements: 'entitlements.plist',
'entitlements-inherit': 'entitlements.plist',
'signature-flags': 'library'
},
osxSign: {},
osxNotarize: {
appleId: 'felix@felix.fun',
appleIdPassword: 'my-apple-id-password'
@@ -84,26 +80,6 @@ packager({
})
```
The `entitlements.plist` file referenced here needs the following macOS-specific entitlements
to assure the Apple security mechanisms that your app is doing these things
without meaning any harm:
```xml title="entitlements.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
</dict>
</plist>
```
Up until Electron 12, the `com.apple.security.cs.allow-unsigned-executable-memory` entitlement was required
as well. However, it should not be used anymore if it can be avoided.
### Signing Mac App Store applications
See the [Mac App Store Guide].
@@ -213,15 +189,14 @@ can find [its documentation here](https://www.electron.build/code-signing).
See the [Windows Store Guide].
[apple developer program]: https://developer.apple.com/programs/
[`electron-builder`]: https://github.com/electron-userland/electron-builder
[`electron-forge`]: https://github.com/electron-userland/electron-forge
[`electron-osx-sign`]: https://github.com/electron-userland/electron-osx-sign
[`electron-forge`]: https://github.com/electron/forge
[`@electron/osx-sign`]: https://github.com/electron/osx-sign
[`electron-packager`]: https://github.com/electron/electron-packager
[`electron-notarize`]: https://github.com/electron/electron-notarize
[`@electron/notarize`]: https://github.com/electron/notarize
[`electron-winstaller`]: https://github.com/electron/windows-installer
[`electron-wix-msi`]: https://github.com/felixrieseberg/electron-wix-msi
[`electron-wix-msi`]: https://github.com/electron-userland/electron-wix-msi
[xcode]: https://developer.apple.com/xcode
[signing certificates]: https://github.com/electron/electron-osx-sign/wiki/1.-Getting-Started#certificates
[signing certificates]: https://developer.apple.com/support/certificates/
[mac app store guide]: ./mac-app-store-submission-guide.md
[windows store guide]: ./windows-store-guide.md
[maker-squirrel]: https://www.electronforge.io/config/makers/squirrel.windows

View File

@@ -7,29 +7,29 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
## Timeline
| Electron | Alpha | Beta | Stable | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- |
| 22.0.0 | 2022-Sep-29 | 2022-Oct-25 | 2022-Nov-29 | M108 | TBD | ✅ |
| 21.0.0 | 2022-Aug-04 | 2022-Aug-30 | 2022-Sep-27 | M106 | v16.17 | ✅ |
| 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | M104 | v16.15 | ✅ |
| 19.0.0 | 2022-Mar-31 | 2022-Apr-26 | 2022-May-24 | M102 | v16.14 | ✅ |
| 18.0.0 | 2022-Feb-03 | 2022-Mar-03 | 2022-Mar-29 | M100 | v16.13 | 🚫 |
| 17.0.0 | 2021-Nov-18 | 2022-Jan-06 | 2022-Feb-01 | M98 | v16.13 | 🚫 |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | M96 | v16.9 | 🚫 |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | v16.5 | 🚫 |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | M93 | v14.17 | 🚫 |
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | M91 | v14.16 | 🚫 |
| 12.0.0 | -- | 2020-Nov-19 | 2021-Mar-02 | M89 | v14.16 | 🚫 |
| 11.0.0 | -- | 2020-Aug-27 | 2020-Nov-17 | M87 | v12.18 | 🚫 |
| 10.0.0 | -- | 2020-May-21 | 2020-Aug-25 | M85 | v12.16 | 🚫 |
| 9.0.0 | -- | 2020-Feb-06 | 2020-May-19 | M83 | v12.14 | 🚫 |
| 8.0.0 | -- | 2019-Oct-24 | 2020-Feb-04 | M80 | v12.13 | 🚫 |
| 7.0.0 | -- | 2019-Aug-01 | 2019-Oct-22 | M78 | v12.8 | 🚫 |
| 6.0.0 | -- | 2019-May-01 | 2019-Jul-30 | M76 | v12.4 | 🚫 |
| 5.0.0 | -- | 2019-Jan-22 | 2019-Apr-24 | M73 | v12.0 | 🚫 |
| 4.0.0 | -- | 2018-Oct-11 | 2018-Dec-20 | M69 | v10.11 | 🚫 |
| 3.0.0 | -- | 2018-Jun-21 | 2018-Sep-18 | M66 | v10.2 | 🚫 |
| 2.0.0 | -- | 2018-Feb-21 | 2018-May-01 | M61 | v8.9 | 🚫 |
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
| 22.0.0 | 2022-Sep-29 | 2022-Oct-25 | 2022-Nov-29 | TBD | M108 | TBD | ✅ |
| 21.0.0 | 2022-Aug-04 | 2022-Aug-30 | 2022-Sep-27 | TBD | M106 | v16.17 | ✅ |
| 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | TBD | M104 | v16.15 | ✅ |
| 19.0.0 | 2022-Mar-31 | 2022-Apr-26 | 2022-May-24 | TBD | M102 | v16.14 | ✅ |
| 18.0.0 | 2022-Feb-03 | 2022-Mar-03 | 2022-Mar-29 | 2022-Sep-27 | M100 | v16.13 | 🚫 |
| 17.0.0 | 2021-Nov-18 | 2022-Jan-06 | 2022-Feb-01 | 2022-Aug-02 | M98 | v16.13 | 🚫 |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | 2022-May-24 | M96 | v16.9 | 🚫 |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | 2022-May-24 | M94 | v16.5 | 🚫 |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | 2022-Mar-29 | M93 | v14.17 | 🚫 |
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | 2022-Feb-01 | M91 | v14.16 | 🚫 |
| 12.0.0 | -- | 2020-Nov-19 | 2021-Mar-02 | 2021-Nov-16 | M89 | v14.16 | 🚫 |
| 11.0.0 | -- | 2020-Aug-27 | 2020-Nov-17 | 2021-Aug-31 | M87 | v12.18 | 🚫 |
| 10.0.0 | -- | 2020-May-21 | 2020-Aug-25 | 2021-May-25 | M85 | v12.16 | 🚫 |
| 9.0.0 | -- | 2020-Feb-06 | 2020-May-19 | 2021-Mar-02 | M83 | v12.14 | 🚫 |
| 8.0.0 | -- | 2019-Oct-24 | 2020-Feb-04 | 2020-Nov-17 | M80 | v12.13 | 🚫 |
| 7.0.0 | -- | 2019-Aug-01 | 2019-Oct-22 | 2020-Aug-25 | M78 | v12.8 | 🚫 |
| 6.0.0 | -- | 2019-Apr-25 | 2019-Jul-30 | 2020-May-19 | M76 | v12.14.0 | 🚫 |
| 5.0.0 | -- | 2019-Jan-22 | 2019-Apr-23 | 2020-Feb-04 | M73 | v12.0 | 🚫 |
| 4.0.0 | -- | 2018-Oct-11 | 2018-Dec-20 | 2019-Oct-22 | M69 | v10.11 | 🚫 |
| 3.0.0 | -- | 2018-Jun-21 | 2018-Sep-18 | 2019-Jul-30 | M66 | v10.2 | 🚫 |
| 2.0.0 | -- | 2018-Feb-21 | 2018-May-01 | 2019-Apr-23 | M61 | v8.9 | 🚫 |
**Notes:**

View File

@@ -11,7 +11,7 @@ This guide provides information on:
To sign Electron apps, the following tools must be installed first:
* Xcode 11 or above.
* The [electron-osx-sign][electron-osx-sign] npm module.
* The [@electron/osx-sign] npm module.
You also have to register an Apple Developer account and join the
[Apple Developer Program][developer-program].
@@ -103,7 +103,7 @@ Apps submitted to the Mac App Store must run under Apple's
the App Sandbox. The standard darwin build of Electron will fail to launch
when run under App Sandbox.
When signing the app with `electron-osx-sign`, it will automatically add the
When signing the app with `@electron/osx-sign`, it will automatically add the
necessary entitlements to your app's entitlements, but if you are using custom
entitlements, you must ensure App Sandbox capacity is added:
@@ -120,7 +120,7 @@ entitlements, you must ensure App Sandbox capacity is added:
#### Extra steps without `electron-osx-sign`
If you are signing your app without using `electron-osx-sign`, you must ensure
If you are signing your app without using `@electron/osx-sign`, you must ensure
the app bundle's entitlements have at least following keys:
```xml
@@ -170,22 +170,22 @@ your Apple Developer account's Team ID as its value:
</plist>
```
When using `electron-osx-sign` the `ElectronTeamID` key will be added
When using `@electron/osx-sign` the `ElectronTeamID` key will be added
automatically by extracting the Team ID from the certificate's name. You may
need to manually add this key if `electron-osx-sign` could not find the correct
need to manually add this key if `@electron/osx-sign` could not find the correct
Team ID.
### Sign apps for development
To sign an app that can run on your development machine, you must sign it with
the "Apple Development" certificate and pass the provisioning profile to
`electron-osx-sign`.
`@electron/osx-sign`.
```bash
electron-osx-sign YourApp.app --identity='Apple Development' --provisioning-profile=/path/to/yourapp.provisionprofile
```
If you are signing without `electron-osx-sign`, you must place the provisioning
If you are signing without `@electron/osx-sign`, you must place the provisioning
profile to `YourApp.app/Contents/embedded.provisionprofile`.
The signed app can only run on the machines that registered by the provisioning
@@ -213,7 +213,7 @@ use App Sandbox.
electron-osx-sign YourApp.app --identity='Developer ID Application' --no-gatekeeper-assess
```
By passing `--no-gatekeeper-assess`, the `electron-osx-sign` will skip the macOS
By passing `--no-gatekeeper-assess`, `@electron/osx-sign` will skip the macOS
GateKeeper check as your app usually has not been notarized yet by this step.
<!-- TODO(zcbenz): Add a chapter about App Notarization -->
@@ -232,7 +232,7 @@ how to meet the Mac App Store requirements.
### Upload
The Application Loader should be used to upload the signed app to iTunes
[Apple Transporter][apple-transporter] should be used to upload the signed app to App Store
Connect for processing, making sure you have [created a record][create-record]
before uploading.
@@ -341,11 +341,12 @@ 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/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
[create-record]: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/CreatingiTunesConnectRecord.html
[create-record]: https://help.apple.com/app-store-connect/#/dev2cd126805
[apple-transporter]: https://help.apple.com/itc/transporteruserguide/en.lproj/static.html
[submit-for-review]: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
[export-compliance]: https://help.apple.com/app-store-connect/#/devc3f64248f
[user-selected]: https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW6

View File

@@ -20,6 +20,8 @@ const win = new BrowserWindow({
The `nodeIntegrationInWorker` can be used independent of `nodeIntegration`, but
`sandbox` must not be set to `true`.
**Note:** This option is not available in [`SharedWorker`s](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker) or [`Service Worker`s](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker) owing to incompatibilities in sandboxing policies.
## Available APIs
All built-in modules of Node.js are supported in Web Workers, and `asar`

View File

@@ -214,8 +214,25 @@ This feature is incredibly useful for two main purposes:
URL, you can add custom properties onto the renderer's `window` global that can
be used for desktop-only logic on the web client's side.
## The utility process
Each Electron app can spawn multiple child processes from the main process using
the [UtilityProcess][] API. The utility process runs in a Node.js environment,
meaning it has the ability to `require` modules and use all of Node.js APIs.
The utility process can be used to host for example: untrusted services,
CPU intensive tasks or crash prone components which would have previously
been hosted in the main process or process spawned with Node.js [`child_process.fork`][] API.
The primary difference between the utility process and process spawned by Node.js
child_process module is that the utility process can establish a communication
channel with a renderer process using [`MessagePort`][]s. An Electron app can
always prefer the [UtilityProcess][] API over Node.js [`child_process.fork`][] API when
there is need to fork a child process from the main process.
[window-mdn]: https://developer.mozilla.org/en-US/docs/Web/API/Window
[`MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
[`child_process.fork`]: https://nodejs.org/dist/latest-v16.x/docs/api/child_process.html#child_processforkmodulepath-args-options
[context-isolation]: ./context-isolation.md
[context-bridge]: ../api/context-bridge.md
[ipcrenderer]: ../api/ipc-renderer.md
[UtilityProcess]: ../api/utility-process.md
[tutorial]: ./tutorial-1-prerequisites.md

View File

@@ -1,95 +0,0 @@
# Testing Widevine CDM
In Electron you can use the Widevine CDM library shipped with Chrome browser.
Widevine Content Decryption Modules (CDMs) are how streaming services protect
content using HTML5 video to web browsers without relying on an NPAPI plugin
like Flash or Silverlight. Widevine support is an alternative solution for
streaming services that currently rely on Silverlight for playback of
DRM-protected video content. It will allow websites to show DRM-protected video
content in Firefox without the use of NPAPI plugins. The Widevine CDM runs in an
open-source CDM sandbox providing better user security than NPAPI plugins.
#### Note on VMP
As of [`Electron v1.8.0 (Chrome v59)`](https://electronjs.org/releases#1.8.1),
the below steps are may only be some of the necessary steps to enable Widevine;
any app on or after that version intending to use the Widevine CDM may need to
be signed using a license obtained from [Widevine](https://www.widevine.com/)
itself.
Per [Widevine](https://www.widevine.com/):
> Chrome 59 (and later) includes support for Verified Media Path (VMP). VMP
> provides a method to verify the authenticity of a device platform. For browser
> deployments, this will provide an additional signal to determine if a
> browser-based implementation is reliable and secure.
>
> The proxy integration guide has been updated with information about VMP and
> how to issue licenses.
>
> Widevine recommends our browser-based integrations (vendors and browser-based
> applications) add support for VMP.
To enable video playback with this new restriction,
[castLabs](https://castlabs.com/open-source/downstream/) has created a
[fork](https://github.com/castlabs/electron-releases) that has implemented the
necessary changes to enable Widevine to be played in an Electron application if
one has obtained the necessary licenses from widevine.
## Getting the library
Open `chrome://components/` in Chrome browser, find `Widevine Content Decryption Module`
and make sure it is up to date, then you can find the library files from the
application directory.
### On Windows
The library file `widevinecdm.dll` will be under
`Program Files(x86)/Google/Chrome/Application/CHROME_VERSION/WidevineCdm/_platform_specific/win_(x86|x64)/`
directory.
### On macOS
The library file `libwidevinecdm.dylib` will be under
`/Applications/Google Chrome.app/Contents/Versions/CHROME_VERSION/Google Chrome Framework.framework/Versions/A/Libraries/WidevineCdm/_platform_specific/mac_(x86|x64)/`
directory.
**Note:** Make sure that chrome version used by Electron is greater than or
equal to the `min_chrome_version` value of Chrome's widevine cdm component.
The value can be found in `manifest.json` under `WidevineCdm` directory.
## Using the library
After getting the library files, you should pass the path to the file
with `--widevine-cdm-path` command line switch, and the library's version
with `--widevine-cdm-version` switch. The command line switches have to be
passed before the `ready` event of `app` module gets emitted.
Example code:
```javascript
const { app, BrowserWindow } = require('electron')
// You have to pass the directory that contains widevine library here, it is
// * `libwidevinecdm.dylib` on macOS,
// * `widevinecdm.dll` on Windows.
app.commandLine.appendSwitch('widevine-cdm-path', '/path/to/widevine_library')
// The version of plugin can be got from `chrome://components` page in Chrome.
app.commandLine.appendSwitch('widevine-cdm-version', '1.4.8.866')
let win = null
app.whenReady().then(() => {
win = new BrowserWindow()
win.show()
})
```
## Verifying Widevine CDM support
To verify whether widevine works, you can use following ways:
* Open https://shaka-player-demo.appspot.com/ and load a manifest that uses
`Widevine`.
* Open http://www.dash-player.com/demo/drm-test-area/, check whether the page
says `bitdash uses Widevine in your browser`, then play the video.

View File

@@ -26,6 +26,15 @@ work on Windows, macOS, and Linux with a single JavaScript codebase.
This tutorial will guide you through the process of developing a desktop
application with Electron and distributing it to end users.
## Goals
This tutorial starts by guiding you through the process of piecing together
a minimal Electron application from scratch, then teaches you how to
package and distribute it to users using Electron Forge.
If you prefer to get a project started with a single-command boilerplate, we recommend you start
with Electron Forge's [`create-electron-app`](https://www.electronforge.io/) command.
## Assumptions
Electron is a native wrapper layer for web apps and is run in a Node.js environment.

View File

@@ -369,12 +369,12 @@ run. Create a launch.json configuration in a new `.vscode` folder in your projec
"name": "Renderer",
"port": 9222,
"request": "attach",
"type": "pwa-chrome",
"type": "chrome",
"webRoot": "${workspaceFolder}"
},
{
"name": "Main",
"type": "pwa-node",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
@@ -398,11 +398,11 @@ What we have done in the `launch.json` file is to create 3 configurations:
- `Main` is used to start the main process and also expose port 9222 for remote debugging
(`--remote-debugging-port=9222`). This is the port that we will use to attach the debugger
for the `Renderer`. Because the main process is a Node.js process, the type is set to
`pwa-node` (`pwa-` is the prefix that tells VS Code to use the latest JavaScript debugger).
`node`.
- `Renderer` is used to debug the renderer process. Because the main process is the one
that creates the process, we have to "attach" to it (`"request": "attach"`) instead of
creating a new one.
The renderer process is a web one, so the debugger we have to use is `pwa-chrome`.
The renderer process is a web one, so the debugger we have to use is `chrome`.
- `Main + renderer` is a [compound task] that executes the previous ones simultaneously.
:::caution

View File

@@ -70,10 +70,9 @@ the [Electron Forge CLI documentation].
:::
You should also notice that your package.json now has a few more packages installed
under your `devDependencies`, and contains an added `config.forge` field with an array
of makers configured. **Makers** are Forge plugins that create distributables from
your source code. You should see multiple makers in the pre-populated configuration,
one for each target platform.
under `devDependencies`, and a new `forge.config.js` file that exports a configuration
object. You should see multiple makers (packages that generate distributable app bundles) in the
pre-populated configuration, one for each target platform.
### Creating a distributable
@@ -111,13 +110,14 @@ Electron Forge can be configured to create distributables in different OS-specif
:::
:::tip Creating and Adding Application Icons
:::tip Creating and adding application icons
Setting custom application icons requires a few additions to your config. Check out [Forge's icon tutorial] for more information.
Setting custom application icons requires a few additions to your config.
Check out [Forge's icon tutorial] for more information.
:::
:::note Packaging without Electron Forge
:::info Packaging without Electron Forge
If you want to manually package your code, or if you're just interested understanding the
mechanics behind packaging an Electron app, check out the full [Application Packaging]
@@ -136,64 +136,51 @@ Code signing is a security technology that you use to certify that a desktop app
created by a known source. Windows and macOS have their own OS-specific code signing
systems that will make it difficult for users to download or launch unsigned applications.
If you already have code signing certificates for Windows and macOS, you can set your
credentials in your Forge configuration. Otherwise, please refer to the full
[Code Signing] documentation to learn how to purchase a certificate and for more information
on the desktop app code signing process.
On macOS, code signing is done at the app packaging level. On Windows, distributable installers
are signed instead.
are signed instead. If you already have code signing certificates for Windows and macOS, you can set
your credentials in your Forge configuration.
:::info
For more information on code signing, check out the
[Signing macOS Apps](https://www.electronforge.io/guides/code-signing) guide in the Forge docs.
:::
<Tabs>
<TabItem value="macos" label="macOS" default>
```json title='package.json' {6-18}
{
//...
"config": {
"forge": {
//...
"packagerConfig": {
"osxSign": {
"identity": "Developer ID Application: Felix Rieseberg (LT94ZKYDCJ)",
"hardened-runtime": true,
"entitlements": "entitlements.plist",
"entitlements-inherit": "entitlements.plist",
"signature-flags": "library"
},
"osxNotarize": {
"appleId": "felix@felix.fun",
"appleIdPassword": "this-is-a-secret"
}
}
//...
```js title='forge.config.js'
module.exports = {
packagerConfig: {
osxSign: {},
//...
osxNotarize: {
tool: 'notarytool',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID,
}
//...
}
//...
}
```
</TabItem>
<TabItem value="windows" label="Windows">
```json title='package.json' {6-14}
{
```js title='forge.config.js'
module.exports = {
//...
"config": {
"forge": {
//...
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"certificateFile": "./cert.pfx",
"certificatePassword": "this-is-a-secret"
}
}
]
//...
}
}
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
certificateFile: './cert.pfx',
certificatePassword: process.env.CERTIFICATE_PASSWORD,
},
},
],
//...
}
```
@@ -214,13 +201,12 @@ information.
[`@electron/osx-sign`]: https://github.com/electron/osx-sign
[application packaging]: ./application-distribution.md
[code signing]: ./code-signing.md
[`electron-packager`]: https://github.com/electron/electron-packager
[`electron-winstaller`]: https://github.com/electron/windows-installer
[electron forge]: https://www.electronforge.io
[electron forge cli documentation]: https://www.electronforge.io/cli#commands
[makers]: https://www.electronforge.io/config/makers
[Forge's icon tutorial]: https://www.electronforge.io/guides/create-and-add-icons
[forge's icon tutorial]: https://www.electronforge.io/guides/create-and-add-icons
<!-- Tutorial links -->

View File

@@ -78,27 +78,21 @@ Once you have it installed, you need to set it up in your Forge
configuration. A full list of options is documented in the Forge's
[`PublisherGitHubConfig`] API docs.
```json title='package.json' {6-16}
{
//...
"config": {
"forge": {
"publishers": [
{
"name": "@electron-forge/publisher-github",
"config": {
"repository": {
"owner": "github-user-name",
"name": "github-repo-name"
},
"prerelease": false,
"draft": true
}
}
]
}
}
//...
```js title='forge.config.js'
module.exports = {
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'github-user-name',
name: 'github-repo-name',
},
prerelease: false,
draft: true,
},
},
],
}
```

View File

@@ -36,6 +36,7 @@ auto_filenames = {
"docs/api/net-log.md",
"docs/api/net.md",
"docs/api/notification.md",
"docs/api/parent-port.md",
"docs/api/power-monitor.md",
"docs/api/power-save-blocker.md",
"docs/api/process.md",
@@ -62,6 +63,7 @@ auto_filenames = {
"docs/api/touch-bar-spacer.md",
"docs/api/touch-bar.md",
"docs/api/tray.md",
"docs/api/utility-process.md",
"docs/api/web-contents.md",
"docs/api/web-frame-main.md",
"docs/api/web-frame.md",
@@ -220,6 +222,7 @@ auto_filenames = {
"lib/browser/api/system-preferences.ts",
"lib/browser/api/touch-bar.ts",
"lib/browser/api/tray.ts",
"lib/browser/api/utility-process.ts",
"lib/browser/api/view.ts",
"lib/browser/api/views/image-view.ts",
"lib/browser/api/web-contents-view.ts",
@@ -331,4 +334,20 @@ auto_filenames = {
"typings/internal-ambient.d.ts",
"typings/internal-electron.d.ts",
]
utility_bundle_deps = [
"lib/browser/message-port-main.ts",
"lib/common/define-properties.ts",
"lib/common/init.ts",
"lib/common/reset-search-paths.ts",
"lib/utility/api/exports/electron.ts",
"lib/utility/api/module-list.ts",
"lib/utility/init.ts",
"lib/utility/parent-port.ts",
"package.json",
"tsconfig.electron.json",
"tsconfig.json",
"typings/internal-ambient.d.ts",
"typings/internal-electron.d.ts",
]
}

View File

@@ -313,6 +313,8 @@ filenames = {
"shell/browser/api/electron_api_tray.h",
"shell/browser/api/electron_api_url_loader.cc",
"shell/browser/api/electron_api_url_loader.h",
"shell/browser/api/electron_api_utility_process.cc",
"shell/browser/api/electron_api_utility_process.h",
"shell/browser/api/electron_api_view.cc",
"shell/browser/api/electron_api_view.h",
"shell/browser/api/electron_api_web_contents.cc",
@@ -522,6 +524,7 @@ filenames = {
"shell/browser/window_list_observer.h",
"shell/browser/zoom_level_delegate.cc",
"shell/browser/zoom_level_delegate.h",
"shell/common/api/crashpad_support.cc",
"shell/common/api/electron_api_asar.cc",
"shell/common/api/electron_api_clipboard.cc",
"shell/common/api/electron_api_clipboard.h",
@@ -582,6 +585,7 @@ filenames = {
"shell/common/gin_converters/native_window_converter.h",
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/serial_port_info_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/time_converter.cc",
"shell/common/gin_converters/time_converter.h",
@@ -671,14 +675,16 @@ filenames = {
"shell/renderer/electron_render_frame_observer.h",
"shell/renderer/electron_renderer_client.cc",
"shell/renderer/electron_renderer_client.h",
"shell/renderer/electron_renderer_pepper_host_factory.cc",
"shell/renderer/electron_renderer_pepper_host_factory.h",
"shell/renderer/electron_sandboxed_renderer_client.cc",
"shell/renderer/electron_sandboxed_renderer_client.h",
"shell/renderer/renderer_client_base.cc",
"shell/renderer/renderer_client_base.h",
"shell/renderer/web_worker_observer.cc",
"shell/renderer/web_worker_observer.h",
"shell/services/node/node_service.cc",
"shell/services/node/node_service.h",
"shell/services/node/parent_port.cc",
"shell/services/node/parent_port.h",
"shell/utility/electron_content_utility_client.cc",
"shell/utility/electron_content_utility_client.h",
]

View File

@@ -205,15 +205,20 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_result.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/calendar.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_timespec.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_tm.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/day.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/duration.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/file_clock.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/formatter.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/hh_mm_ss.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/high_resolution_clock.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/literals.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/month.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/month_weekday.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/monthday.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/ostream.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/parser_std_format_spec.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/statically_widen.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/steady_clock.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/system_clock.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/time_point.h",
@@ -291,6 +296,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__format/format_args.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_context.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_error.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_functions.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_fwd.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_parse_context.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_string.h",
@@ -334,10 +340,13 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__functional/unary_negate.h",
"//buildtools/third_party/libc++/trunk/include/__functional/unwrap_ref.h",
"//buildtools/third_party/libc++/trunk/include/__functional/weak_result_type.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/array.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/get.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/hash.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/pair.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/span.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/string_view.h",
"//buildtools/third_party/libc++/trunk/include/__fwd/tuple.h",
"//buildtools/third_party/libc++/trunk/include/__hash_table",
"//buildtools/third_party/libc++/trunk/include/__ios/fpos.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/access.h",
@@ -381,6 +390,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__locale",
"//buildtools/third_party/libc++/trunk/include/__mbstate_t.h",
"//buildtools/third_party/libc++/trunk/include/__memory/addressof.h",
"//buildtools/third_party/libc++/trunk/include/__memory/align.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocate_at_least.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocation_guard.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator.h",
@@ -388,15 +398,18 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_traits.h",
"//buildtools/third_party/libc++/trunk/include/__memory/assume_aligned.h",
"//buildtools/third_party/libc++/trunk/include/__memory/auto_ptr.h",
"//buildtools/third_party/libc++/trunk/include/__memory/builtin_new_allocator.h",
"//buildtools/third_party/libc++/trunk/include/__memory/compressed_pair.h",
"//buildtools/third_party/libc++/trunk/include/__memory/concepts.h",
"//buildtools/third_party/libc++/trunk/include/__memory/construct_at.h",
"//buildtools/third_party/libc++/trunk/include/__memory/destruct_n.h",
"//buildtools/third_party/libc++/trunk/include/__memory/pointer_traits.h",
"//buildtools/third_party/libc++/trunk/include/__memory/ranges_construct_at.h",
"//buildtools/third_party/libc++/trunk/include/__memory/ranges_uninitialized_algorithms.h",
"//buildtools/third_party/libc++/trunk/include/__memory/raw_storage_iterator.h",
"//buildtools/third_party/libc++/trunk/include/__memory/shared_ptr.h",
"//buildtools/third_party/libc++/trunk/include/__memory/swap_allocator.h",
"//buildtools/third_party/libc++/trunk/include/__memory/temp_value.h",
"//buildtools/third_party/libc++/trunk/include/__memory/temporary_buffer.h",
"//buildtools/third_party/libc++/trunk/include/__memory/uninitialized_algorithms.h",
"//buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h",
@@ -502,7 +515,6 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__support/solaris/floatingpoint.h",
"//buildtools/third_party/libc++/trunk/include/__support/solaris/wchar.h",
"//buildtools/third_party/libc++/trunk/include/__support/solaris/xlocale.h",
"//buildtools/third_party/libc++/trunk/include/__support/win32/limits_msvc_win32.h",
"//buildtools/third_party/libc++/trunk/include/__support/win32/locale_win32.h",
"//buildtools/third_party/libc++/trunk/include/__support/xlocale/__nop_locale_mgmt.h",
"//buildtools/third_party/libc++/trunk/include/__support/xlocale/__posix_l_fallback.h",
@@ -511,7 +523,14 @@ libcxx_headers = [
"//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",
"//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/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_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",
@@ -539,6 +558,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__type_traits/integral_constant.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_abstract.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_aggregate.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_allocator.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_arithmetic.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_array.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_assignable.h",
@@ -621,6 +641,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__type_traits/maybe_const.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/nat.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/negation.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/noexcept_move_assign_container.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/promote.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/rank.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_all_extents.h",
@@ -645,6 +666,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__utility/declval.h",
"//buildtools/third_party/libc++/trunk/include/__utility/exchange.h",
"//buildtools/third_party/libc++/trunk/include/__utility/forward.h",
"//buildtools/third_party/libc++/trunk/include/__utility/forward_like.h",
"//buildtools/third_party/libc++/trunk/include/__utility/in_place.h",
"//buildtools/third_party/libc++/trunk/include/__utility/integer_sequence.h",
"//buildtools/third_party/libc++/trunk/include/__utility/move.h",

View File

@@ -31,6 +31,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'systemPreferences', loader: () => require('./system-preferences') },
{ name: 'TouchBar', loader: () => require('./touch-bar') },
{ name: 'Tray', loader: () => require('./tray') },
{ name: 'utilityProcess', loader: () => require('./utility-process') },
{ name: 'View', loader: () => require('./view') },
{ name: 'webContents', loader: () => require('./web-contents') },
{ name: 'WebContentsView', loader: () => require('./web-contents-view') },

View File

@@ -0,0 +1,150 @@
import { EventEmitter } from 'events';
import { Duplex, PassThrough } from 'stream';
import { Socket } from 'net';
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
const { _fork } = process._linkedBinding('electron_browser_utility_process');
class ForkUtilityProcess extends EventEmitter {
#handle: ElectronInternal.UtilityProcessWrapper | null;
#stdout: Duplex | null = null;
#stderr: Duplex | null = null;
constructor (modulePath: string, args?: string[], options?: Electron.ForkOptions) {
super();
if (!modulePath) {
throw new Error('Missing UtilityProcess entry script.');
}
if (args == null) {
args = [];
} else if (typeof args === 'object' && !Array.isArray(args)) {
options = args;
args = [];
}
if (options == null) {
options = {};
} else {
options = { ...options };
}
if (!options) {
throw new Error('Options cannot be undefined.');
}
if (options.execArgv != null) {
if (!Array.isArray(options.execArgv)) {
throw new Error('execArgv must be an array of strings.');
}
}
if (options.serviceName != null) {
if (typeof options.serviceName !== 'string') {
throw new Error('serviceName must be a string.');
}
}
if (options.cwd != null) {
if (typeof options.cwd !== 'string') {
throw new Error('cwd path must be a string.');
}
}
if (typeof options.stdio === 'string') {
const stdio : Array<'pipe' | 'ignore' | 'inherit'> = [];
switch (options.stdio) {
case 'inherit':
case 'ignore':
stdio.push('ignore', options.stdio, options.stdio);
break;
case 'pipe':
this.#stderr = new PassThrough();
this.#stdout = new PassThrough();
stdio.push('ignore', options.stdio, options.stdio);
break;
default:
throw new Error('stdio must be of the following values: inherit, pipe, ignore');
}
options.stdio = stdio;
} else if (Array.isArray(options.stdio)) {
if (options.stdio.length >= 3) {
if (options.stdio[0] !== 'ignore') {
throw new Error('stdin value other than ignore is not supported.');
}
if (options.stdio[1] === 'pipe') {
this.#stdout = new PassThrough();
} else if (options.stdio[1] !== 'ignore' && options.stdio[1] !== 'inherit') {
throw new Error('stdout configuration must be of the following values: inherit, pipe, ignore');
}
if (options.stdio[2] === 'pipe') {
this.#stderr = new PassThrough();
} else if (options.stdio[2] !== 'ignore' && options.stdio[2] !== 'inherit') {
throw new Error('stderr configuration must be of the following values: inherit, pipe, ignore');
}
} else {
throw new Error('configuration missing for stdin, stdout or stderr.');
}
}
this.#handle = _fork({ options, modulePath, args });
this.#handle!.emit = (channel: string | symbol, ...args: any[]) => {
if (channel === 'exit') {
try {
this.emit('exit', ...args);
} finally {
this.#handle = null;
if (this.#stdout) {
this.#stdout.removeAllListeners();
this.#stdout = null;
}
if (this.#stderr) {
this.#stderr.removeAllListeners();
this.#stderr = null;
}
}
return false;
} else if (channel === 'stdout' && this.#stdout) {
new Socket({ fd: args[0], readable: true }).pipe(this.#stdout);
return true;
} else if (channel === 'stderr' && this.#stderr) {
new Socket({ fd: args[0], readable: true }).pipe(this.#stderr);
return true;
} else {
return this.emit(channel, ...args);
}
};
}
get pid () {
return this.#handle?.pid;
}
get stdout () {
return this.#stdout;
}
get stderr () {
return this.#stderr;
}
postMessage (message: any, transfer?: MessagePortMain[]) {
if (Array.isArray(transfer)) {
transfer = transfer.map((o: any) => o instanceof MessagePortMain ? o._internalPort : o);
return this.#handle?.postMessage(message, transfer);
}
return this.#handle?.postMessage(message);
}
kill () : boolean {
if (this.#handle === null) {
return false;
}
return this.#handle.kill();
}
}
export function fork (modulePath: string, args?: string[], options?: Electron.ForkOptions) {
return new ForkUtilityProcess(modulePath, args, options);
}

View File

@@ -174,13 +174,13 @@ WebContents.prototype.printToPDF = async function (options) {
headerTemplate: '',
footerTemplate: '',
printBackground: false,
scale: 1,
scale: 1.0,
paperWidth: 8.5,
paperHeight: 11,
marginTop: 0,
marginBottom: 0,
marginLeft: 0,
marginRight: 0,
paperHeight: 11.0,
marginTop: 0.4,
marginBottom: 0.4,
marginLeft: 0.4,
marginRight: 0.4,
pageRanges: '',
preferCSSPageSize: false
};
@@ -210,7 +210,7 @@ WebContents.prototype.printToPDF = async function (options) {
if (typeof options.scale !== 'number') {
return Promise.reject(new Error('scale must be a Number'));
}
printSettings.scaleFactor = options.scale;
printSettings.scale = options.scale;
}
const { pageSize } = options;
@@ -450,12 +450,14 @@ WebContents.prototype.loadURL = function (url, options) {
const removeListeners = () => {
this.removeListener('did-finish-load', finishListener);
this.removeListener('did-fail-load', failListener);
this.removeListener('did-navigate-in-page', finishListener);
this.removeListener('did-start-navigation', navigationListener);
this.removeListener('did-stop-loading', stopLoadingListener);
this.removeListener('destroyed', stopLoadingListener);
};
this.on('did-finish-load', finishListener);
this.on('did-fail-load', failListener);
this.on('did-navigate-in-page', finishListener);
this.on('did-start-navigation', navigationListener);
this.on('did-stop-loading', stopLoadingListener);
this.on('destroyed', stopLoadingListener);

View File

@@ -33,20 +33,29 @@ function wrap <T extends AnyFn> (func: T, wrapper: (fn: AnyFn) => T) {
return wrapped;
}
// process.nextTick and setImmediate make use of uv_check and uv_prepare to
// run the callbacks, however since we only run uv loop on requests, the
// callbacks wouldn't be called until something else activated the uv loop,
// which would delay the callbacks for arbitrary long time. So we should
// initiatively activate the uv loop once process.nextTick and setImmediate is
// called.
process.nextTick = wrapWithActivateUvLoop(process.nextTick);
global.setImmediate = timers.setImmediate = wrapWithActivateUvLoop(timers.setImmediate);
global.clearImmediate = timers.clearImmediate;
// setTimeout needs to update the polling timeout of the event loop, when
// called under Chromium's event loop the node's event loop won't get a chance
// to update the timeout, so we have to force the node's event loop to
// recalculate the timeout in browser process.
// recalculate the timeout in the process.
timers.setTimeout = wrapWithActivateUvLoop(timers.setTimeout);
timers.setInterval = wrapWithActivateUvLoop(timers.setInterval);
// Only override the global setTimeout/setInterval impls in the browser process
if (process.type === 'browser') {
// Update the global version of the timer apis to use the above wrapper
// only in the process that runs node event loop alongside chromium
// event loop. We skip renderer with nodeIntegration here because node globals
// are deleted in these processes, see renderer/init.js for reference.
if (process.type === 'browser' ||
process.type === 'utility') {
global.setTimeout = timers.setTimeout;
global.setInterval = timers.setInterval;
}

View File

@@ -186,7 +186,10 @@ export class SrcAttribute extends WebViewAttribute {
opts.userAgent = useragent;
}
(this.webViewImpl.webviewNode as Electron.WebviewTag).loadURL(this.getValue(), opts);
(this.webViewImpl.webviewNode as Electron.WebviewTag).loadURL(this.getValue(), opts)
.catch(err => {
console.error('Unexpected error while loading URL', err);
});
}
}

View File

@@ -0,0 +1,21 @@
{
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
"electron",
"electron/renderer"
],
"patterns": [
"./*",
"../*",
"@electron/internal/isolated_renderer/*",
"@electron/internal/renderer/*",
"@electron/internal/sandboxed_worker/*",
"@electron/internal/worker/*"
]
}
]
}
}

View File

@@ -0,0 +1,6 @@
import { defineProperties } from '@electron/internal/common/define-properties';
import { utilityNodeModuleList } from '@electron/internal/utility/api/module-list';
module.exports = {};
defineProperties(module.exports, utilityNodeModuleList);

View File

@@ -0,0 +1,2 @@
// Utility side modules, please sort alphabetically.
export const utilityNodeModuleList: ElectronInternal.ModuleEntry[] = [];

38
lib/utility/init.ts Normal file
View File

@@ -0,0 +1,38 @@
import { ParentPort } from '@electron/internal/utility/parent-port';
const Module = require('module');
const v8Util = process._linkedBinding('electron_common_v8_util');
const entryScript: string = v8Util.getHiddenValue(process, '_serviceStartupScript');
// We modified the original process.argv to let node.js load the init.js,
// we need to restore it here.
process.argv.splice(1, 1, entryScript);
// Clear search paths.
require('../common/reset-search-paths');
// Import common settings.
require('@electron/internal/common/init');
const parentPort: ParentPort = new ParentPort();
Object.defineProperty(process, 'parentPort', {
enumerable: true,
writable: false,
value: parentPort
});
// Based on third_party/electron_node/lib/internal/worker/io.js
parentPort.on('newListener', (name: string) => {
if (name === 'message' && parentPort.listenerCount('message') === 0) {
parentPort.start();
}
});
parentPort.on('removeListener', (name: string) => {
if (name === 'message' && parentPort.listenerCount('message') === 0) {
parentPort.pause();
}
});
// Finally load entry script.
process._firstFileName = Module._resolveFilename(entryScript, null, false);
Module._load(entryScript, Module, true);

View File

@@ -0,0 +1,30 @@
import { EventEmitter } from 'events';
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
const { createParentPort } = process._linkedBinding('electron_utility_parent_port');
export class ParentPort extends EventEmitter {
#port: ParentPort
constructor () {
super();
this.#port = createParentPort();
this.#port.emit = (channel: string | symbol, event: { ports: any[] }) => {
if (channel === 'message') {
event = { ...event, ports: event.ports.map(p => new MessagePortMain(p)) };
}
this.emit(channel, event);
return false;
};
}
start () : void {
this.#port.start();
}
pause () : void {
this.#port.pause();
}
postMessage (message: any) : void {
this.#port.postMessage(message);
}
}

View File

@@ -70,29 +70,21 @@ function isInstalled () {
// unzips and makes path.txt point at the correct executable
function extractFile (zipPath) {
return new Promise((resolve, reject) => {
const distPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist');
const distPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist');
extract(zipPath, { dir: path.join(__dirname, 'dist') })
.then(() => {
// If the zip contains an "electron.d.ts" file,
// move that up
const srcTypeDefPath = path.join(distPath, 'electron.d.ts');
const targetTypeDefPath = path.join(__dirname, 'electron.d.ts');
const hasTypeDefinitions = fs.existsSync(srcTypeDefPath);
return extract(zipPath, { dir: path.join(__dirname, 'dist') }).then(() => {
// If the zip contains an "electron.d.ts" file,
// move that up
const srcTypeDefPath = path.join(distPath, 'electron.d.ts');
const targetTypeDefPath = path.join(__dirname, 'electron.d.ts');
const hasTypeDefinitions = fs.existsSync(srcTypeDefPath);
if (hasTypeDefinitions) {
try {
fs.renameSync(srcTypeDefPath, targetTypeDefPath);
} catch (err) {
reject(err);
}
}
if (hasTypeDefinitions) {
fs.renameSync(srcTypeDefPath, targetTypeDefPath);
}
// Write a "path.txt" file.
return fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath);
})
.catch((err) => reject(err));
// Write a "path.txt" file.
return fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath);
});
}

View File

@@ -1,12 +1,12 @@
{
"name": "electron",
"version": "22.0.0-nightly.20220928",
"version": "0.0.0-development",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@azure/storage-blob": "^12.9.0",
"@electron/docs-parser": "^0.12.4",
"@electron/typescript-definitions": "^8.9.6",
"@electron/docs-parser": "^1.0.0",
"@electron/typescript-definitions": "^8.10.0",
"@octokit/auth-app": "^2.10.0",
"@octokit/rest": "^18.0.3",
"@primer/octicons": "^10.0.0",
@@ -92,7 +92,7 @@
"lint:docs-relative-links": "python3 ./script/check-relative-doc-links.py",
"lint:markdownlint": "markdownlint \"*.md\" \"docs/**/*.md\"",
"lint:js-in-markdown": "standard-markdown docs",
"create-api-json": "electron-docs-parser --dir=./",
"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",
"pre-flight": "pre-flight",

View File

@@ -58,7 +58,7 @@ index 852b76bea69988e0b3ac76a17b603128f239dde0..d443f4dc2daea0b7aa86ae75d31d995f
callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg);
callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg);
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
index 380d25d9c2a8efb0636db5749a8e3b1ba6908ad5..7a5aa1c142e15cf06e63882e83d82a93c0d38785 100644
index ba4b6983f5e898b5300ee7a5d683e0cba94682e8..1117a007da931e005b41e9d97672bdfd4eb61449 100644
--- a/include/openssl/cipher.h
+++ b/include/openssl/cipher.h
@@ -460,6 +460,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);

View File

@@ -20,7 +20,7 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
case ssl_open_record_error:
diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
index 82acb6534f3520b0161b80ca0d9247221002afeb..ae02d8cf9f136909259046bd259e18f6c3092323 100644
index a6ca0ab96266475384429e73970de18d4ba09912..c7e7bd02f2484f91bf55df1400e94804e61ea914 100644
--- a/ssl/ssl_lib.cc
+++ b/ssl/ssl_lib.cc
@@ -1319,7 +1319,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
@@ -32,7 +32,7 @@ index 82acb6534f3520b0161b80ca0d9247221002afeb..ae02d8cf9f136909259046bd259e18f6
return SSL_ERROR_ZERO_RETURN;
}
// An EOF was observed which violates the protocol, and the underlying
@@ -2576,13 +2576,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
@@ -2592,13 +2592,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 82acb6534f3520b0161b80ca0d9247221002afeb..ae02d8cf9f136909259046bd259e18f6
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 2627362daf72423c15bfcc4e3d2fb82ffc1bdb33..a9a695a4029f3563145ec0f8864cae366de90bc3 100644
index 3709a4694f3c9be67fd918f125f023b5aa660971..3507f4ef5bd4444c2499b06a5e312ab54f08bc3b 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -8509,11 +8509,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8358,11 +8358,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 2627362daf72423c15bfcc4e3d2fb82ffc1bdb33..a9a695a4029f3563145ec0f8864cae36
// 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));
@@ -8521,22 +8516,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8370,22 +8365,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_SYSCALL);
EXPECT_TRUE(write_failed);
write_failed = false;

View File

@@ -63,10 +63,7 @@ feat_add_onclose_to_messageport.patch
allow_in-process_windows_to_have_different_web_prefs.patch
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
crash_allow_setting_more_options.patch
breakpad_treat_node_processes_as_browser_processes.patch
upload_list_add_loadsync_method.patch
breakpad_allow_getting_string_values_for_crash_keys.patch
crash_allow_disabling_compression_on_linux.patch
allow_setting_secondary_label_via_simplemenumodel.patch
feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch
fix_patch_out_profile_refs_in_accessibility_ui.patch
@@ -85,7 +82,6 @@ build_libc_as_static_library.patch
build_do_not_depend_on_packed_resource_integrity.patch
refactor_restore_base_adaptcallbackforrepeating.patch
hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch
don_t_run_pcscan_notifythreadcreated_if_pcscan_is_disabled.patch
logging_win32_only_create_a_console_if_logging_to_stderr.patch
fix_media_key_usage_with_globalshortcuts.patch
feat_expose_raw_response_headers_from_urlloader.patch
@@ -116,9 +112,13 @@ chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
revert_spellcheck_fully_launch_spell_check_delayed_initialization.patch
add_electron_deps_to_license_credits_file.patch
feat_add_set_can_resize_mutator.patch
fix_revert_emulationhandler_update_functions_to_early_return.patch
fix_crash_loading_non-standard_schemes_in_iframes.patch
disable_optimization_guide_for_preconnect_feature.patch
fix_return_v8_value_from_localframe_requestexecutescript.patch
create_browser_v8_snapshot_file_name_fuse.patch
feat_configure_launch_options_for_service_process.patch
fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch
preconnect_manager.patch
fix_remove_caption-removing_style_call.patch
build_allow_electron_to_use_exec_script.patch
cherry-pick-7196a42b42ce.patch
fix_tray_icon_gone_on_lock_screen.patch

View File

@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
3. Ctrl-Shift-= and Ctrl-Plus show up as such
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f942b277b 100644
index 2b38e56d26ae7738d82e14094c2d63357a9eb1ef..23e73566e444ab9ff3e409b0b87024be327e2dc4 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -11,6 +11,7 @@
@@ -63,7 +63,7 @@ index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f
if (IsCmdDown()) {
diff --git a/ui/base/accelerators/accelerator.h b/ui/base/accelerators/accelerator.h
index e0d9df439d120c0a47f55666b3818c7ba6796e70..283c6283f5aeaae1a5436e5fbb17ce2db4a9034e 100644
index bcc44522d01713aad2231417e1e6c89c9004dc29..1e2836e2de583cb3bd6d7fca5cc6b34f0f6e8418 100644
--- a/ui/base/accelerators/accelerator.h
+++ b/ui/base/accelerators/accelerator.h
@@ -16,6 +16,7 @@

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 d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f676d35507e 100644
index 5c3bcea34087025ecab1959fd2d55fe5c5369142..7b019632914eb1bd4ebef9468d20c7c7f2560a94 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -241,6 +241,10 @@ int GpuMain(MainFunctionParams parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,7 +24,7 @@ index d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f67
// 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
@@ -323,7 +327,6 @@ int GpuMain(MainFunctionParams parameters) {
@@ -325,7 +329,6 @@ int GpuMain(MainFunctionParams parameters) {
const_cast<base::CommandLine*>(&command_line), gpu_preferences);
const bool dead_on_arrival = !init_success;
@@ -33,7 +33,7 @@ index d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f67
client->PostSandboxInitialized();
}
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index e7811da60f78b5dcf782f832933c164d08b982bb..938f70f5545e252516dc940d07fc940a61685a10 100644
index 3020e59f491f95740983b01c16e2a5be01d60f67..b25140275ce636717ca60a3cb17eb2f35f50d8be 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -30,6 +30,10 @@ class CONTENT_EXPORT ContentGpuClient {

View File

@@ -10,7 +10,7 @@ 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 9bdb516d44cf69fa438f99a7bdb0df9c989465a7..fa235f8993cfdb7dce2da0b505ebe2461334a9b9 100644
index 0af40eb8f556aa29c8b7e1bdd0d62b1fb7b38791..b3ae64cf8836fdd3634bfd24fc2f8a25e1735da5 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,
@@ -23,10 +23,10 @@ index 9bdb516d44cf69fa438f99a7bdb0df9c989465a7..fa235f8993cfdb7dce2da0b505ebe246
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 36b3f9d6d535e1fde2cf3496dabcac07c372b892..41913e27f955e81397b08c1690579c25d6704498 100644
index fb0483af59b0e289bd716a3417a545233f17be1f..6a7e5ab92e6fa23762794efc3031ce982836c20e 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4351,6 +4351,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4365,6 +4365,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index 36b3f9d6d535e1fde2cf3496dabcac07c372b892..41913e27f955e81397b08c1690579c25
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index eea01ab95a033b5fb537db004dc0b63724192a93..d72b75f1dbccc4aa7bf9f4abb080b0692c4b9d04 100644
index 0e1296d023867bf1e4f12757d482cffcfe8a1942..0e4b144aeb54af86bc663d8b20fba4d0483ec28c 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -589,6 +589,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -591,6 +591,8 @@ class CONTENT_EXPORT RenderFrameImpl
uint32_t ng_call_count) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@@ -53,10 +53,10 @@ index eea01ab95a033b5fb537db004dc0b63724192a93..d72b75f1dbccc4aa7bf9f4abb080b069
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 103989bc5a74f6adc79734f97e517056596aa913..ccf2ba4cbdf382164db9f6951a00a11434d4f661 100644
index 149ca596036a4a4c123b6982014001953cf06800..dd069baf01929b75f42093ecf09ecf8eb20376c0 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -579,6 +579,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -580,6 +580,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -67,10 +67,10 @@ index 103989bc5a74f6adc79734f97e517056596aa913..ccf2ba4cbdf382164db9f6951a00a114
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index c8af53d40eaa1dd3a0067948a8cda80d1599cee3..4de918ee52efa7ec27a21aa2f57616d31dfd07d1 100644
index d0b5233ad45995bd6128a03fe9267618d723d683..e5e93be8f2433196a13aa104241b1ddd63985e81 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -209,6 +209,7 @@ void LocalWindowProxy::Initialize() {
@@ -210,6 +210,7 @@ void LocalWindowProxy::Initialize() {
}
InstallConditionalFeatures();
@@ -92,7 +92,7 @@ index 83a62e23b1d395b0aa545de5b828c24196cccc6d..0ca8163eb9ab87aead27bc8b2ee9e614
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 90e53a2dc78c1be9e03d3b80b4d0938a43128fa0..a428af1c219522aa8a08ebfdb10abd2f8a34a44e 100644
index 7b726508f926eb9e694230c3801a4324aac1e989..c688eb24441e2921de1fc85d69deb4a965fdd2b7 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
@@ -273,6 +273,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -123,10 +123,10 @@ index c974fa2f7c7f9c2aa5f075ec4aeb887d0b104453..b4ed9b2fadcfad7676387045b8581eb8
int32_t world_id) override;
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
index 3ca0a5a99d9c0b2f93bb8f63b01199b45101e557..70248d589390023ed388882deb843347147783f7 100644
index ba841a41c1387c2cac3578bc01524b0a1868f74d..d2ce9ae524025cc06028b4ca80d04c580dc29b44 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -368,6 +368,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
@@ -366,6 +366,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}

View File

@@ -7,7 +7,7 @@ Ensure that licenses for the dependencies introduced by Electron
are included in `LICENSES.chromium.html`
diff --git a/tools/licenses.py b/tools/licenses.py
index a58dbf44370baabbfa2986c734c96a210cc16f1d..1d6934460f788ab76275710e727fb062f5c92b5b 100755
index c4ffc17fb5b372d56f68bc69e9d4fc93ae40d45f..253618104ea7bb4c97085da9df1496efaee32a46 100755
--- a/tools/licenses.py
+++ b/tools/licenses.py
@@ -347,6 +347,32 @@ SPECIAL_CASES = {

View File

@@ -8,7 +8,7 @@ decorations in maximized mode where needed, preventing empty space caused
by decoration shadows and rounded titlebars around the window while maximized.
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
index 7d1c3407ff408fbbb0d123323af09fb9e46e5453..90c93d2826739df07fb1accc48cd83810dea8dee 100644
index c847ccaad26a147b18abb95dd4a9898b9024c296..d32bd13fd25e8cbf577252813fd93827e0aa8db3 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -504,13 +504,15 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
@@ -31,19 +31,19 @@ index 7d1c3407ff408fbbb0d123323af09fb9e46e5453..90c93d2826739df07fb1accc48cd8381
}
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
index 3bf62d4de0ce141db60bab5356839d20543b3026..ca0f0bc3270b9b3ad793cd48b95a61bd7965b458 100644
index 18c34ce9965912caa58457fc28be2b4f6edffb78..d1fc002ff98ea25ff4fec7bacd44140c7d7ec4fd 100644
--- a/ui/gtk/gtk_ui.h
+++ b/ui/gtk/gtk_ui.h
@@ -95,7 +95,7 @@ class GtkUi : public ui::LinuxUi {
@@ -102,7 +102,7 @@ class GtkUi : public ui::LinuxUiAndTheme {
WindowFrameActionSource source) override;
bool PreferDarkTheme() const override;
bool AnimationsEnabled() const override;
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
- ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
+ ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
base::flat_map<std::string, std::string> GetKeyboardLayoutMap() override;
std::string GetCursorThemeName() override;
int GetCursorThemeSize() override;
@@ -199,6 +199,8 @@ class GtkUi : public ui::LinuxUi {
private:
using TintMap = std::map<int, color_utils::HSL>;
@@ -191,6 +191,8 @@ class GtkUi : public ui::LinuxUiAndTheme {
// while Chrome is running.
std::unique_ptr<ui::WindowFrameProvider> solid_frame_provider_;
std::unique_ptr<ui::WindowFrameProvider> transparent_frame_provider_;
@@ -53,7 +53,7 @@ index 3bf62d4de0ce141db60bab5356839d20543b3026..ca0f0bc3270b9b3ad793cd48b95a61bd
} // namespace gtk
diff --git a/ui/gtk/window_frame_provider_gtk.cc b/ui/gtk/window_frame_provider_gtk.cc
index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb769952c98aca2 100644
index c7857a3e316554e6b5f46c023a1a8084a3263074..5ad7d4ffa7e9c12ec4640a845a4c763420c23ec2 100644
--- a/ui/gtk/window_frame_provider_gtk.cc
+++ b/ui/gtk/window_frame_provider_gtk.cc
@@ -38,16 +38,18 @@ std::string GetThemeName() {
@@ -111,8 +111,8 @@ index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb76995
WindowFrameProviderGtk::~WindowFrameProviderGtk() = default;
@@ -264,7 +266,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(gfx::Canvas* canvas,
top_area_height_dip * scale - asset.frame_thickness_px.top();
@@ -272,7 +274,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(
top_area_height_dip * scale - effective_frame_thickness_px.top();
auto header = PaintHeaderbar({client_bounds_px.width(), top_area_height_px},
- HeaderContext(solid_frame_, focused), scale);
@@ -120,7 +120,7 @@ index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb76995
image = gfx::ImageSkia::CreateFrom1xBitmap(header);
// In GTK4, the headerbar gets clipped by the window.
if (GtkCheckVersion(4)) {
@@ -296,7 +298,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
@@ -304,7 +306,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
gfx::Rect frame_bounds_dip(kMaxFrameSizeDip, kMaxFrameSizeDip,
2 * kMaxFrameSizeDip, 2 * kMaxFrameSizeDip);
@@ -129,7 +129,7 @@ index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb76995
frame_bounds_dip.Inset(-GtkStyleContextGetPadding(focused_context));
frame_bounds_dip.Inset(-GtkStyleContextGetBorder(focused_context));
gfx::Size bitmap_size(BitmapSizePx(asset), BitmapSizePx(asset));
@@ -304,7 +306,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
@@ -312,7 +314,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
PaintBitmap(bitmap_size, frame_bounds_dip, focused_context, scale);
asset.unfocused_bitmap =
PaintBitmap(bitmap_size, frame_bounds_dip,
@@ -139,7 +139,7 @@ index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb76995
// In GTK4, there's no way to obtain the frame thickness from CSS values
// directly, so we must determine it experimentally based on the drawn
diff --git a/ui/gtk/window_frame_provider_gtk.h b/ui/gtk/window_frame_provider_gtk.h
index 8370c1cb3f8c3532d94e1265242cbf2397920480..2e0105ba8782dfe0a3ac169850734032c8ab071c 100644
index d8cb2c6aab333cc55ad1daa70ac91b0569d33a7c..558aa3979301f79df789a29ba3ad1cf134bd6494 100644
--- a/ui/gtk/window_frame_provider_gtk.h
+++ b/ui/gtk/window_frame_provider_gtk.h
@@ -14,7 +14,7 @@ namespace gtk {
@@ -151,7 +151,7 @@ index 8370c1cb3f8c3532d94e1265242cbf2397920480..2e0105ba8782dfe0a3ac169850734032
WindowFrameProviderGtk(const WindowFrameProviderGtk&) = delete;
WindowFrameProviderGtk& operator=(const WindowFrameProviderGtk&) = delete;
@@ -69,6 +69,9 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
@@ -70,6 +70,9 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
// Cached bitmaps and metrics. The scale is rounded to percent.
base::flat_map<int, Asset> assets_;
@@ -162,15 +162,15 @@ index 8370c1cb3f8c3532d94e1265242cbf2397920480..2e0105ba8782dfe0a3ac169850734032
} // namespace gtk
diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
index e177923484a1be740170a65c2b3067f04e949995..68f217d316f15129f66e74f14851613dbb24970e 100644
index 4c5e4e19fc94c62717d4983c0dc056628c59bd4d..fa9be339b2004df224d46431e3fcced3b79e9a2a 100644
--- a/ui/linux/linux_ui.h
+++ b/ui/linux/linux_ui.h
@@ -171,7 +171,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUi {
@@ -270,7 +270,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme {
// if transparency is unsupported and the frame should be rendered opaque.
// The returned object is not owned by the caller and will remain alive until
// the process ends.
- virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) = 0;
+ virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) = 0;
// Returns a map of KeyboardEvent code to KeyboardEvent key values.
virtual base::flat_map<std::string, std::string> GetKeyboardLayoutMap() = 0;
const base::ObserverList<WindowButtonOrderObserver>::Unchecked&
window_button_order_observer_list() const {

View File

@@ -8,7 +8,7 @@ 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 1eb1d0fe4696f26e7de43fc8797c283e9e6db042..766f8d8df866ce7fbc337cecceb715cced39643c 100644
index 3d644fbcf9be5ea6a61dd90fa25e23288cb0358b..8730b2c9089c66a646ad92d56f6152fc3946f22e 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
@@ -227,6 +227,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
@@ -29,7 +29,7 @@ index 1eb1d0fe4696f26e7de43fc8797c283e9e6db042..766f8d8df866ce7fbc337cecceb715cc
objects_.clear();
platform_representations_.clear();
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
index 96f5bf8b6b5f3ed5ab25e15845f0de455eb68e0b..e6718a893e1bc5c970245c8265c95dda5d5fa2ff 100644
index 5ac38344f1221ce402ad2c0e2954c442f3955318..49e22a89d823649f4c62bbae7323a055dcc47934 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.h
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
@@ -84,6 +84,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {

View File

@@ -8,7 +8,7 @@ accessing Blink internals. Its inverse, which already exists, is used in
Android WebView.
diff --git a/third_party/blink/public/web/web_message_port_converter.h b/third_party/blink/public/web/web_message_port_converter.h
index 70270faafcae01aba19d2be9ece3821c1c75dc29..809ec708c3faa9deb69ff17d499e645540358b88 100644
index a58ddcc8f6e79d3288d0c645875c8b1bbdaaf209..1283bd18cce78bc5eaad71b3fad01031b54d1ab3 100644
--- a/third_party/blink/public/web/web_message_port_converter.h
+++ b/third_party/blink/public/web/web_message_port_converter.h
@@ -13,6 +13,7 @@ class Isolate;
@@ -19,9 +19,9 @@ index 70270faafcae01aba19d2be9ece3821c1c75dc29..809ec708c3faa9deb69ff17d499e6455
} // namespace v8
namespace blink {
@@ -25,6 +26,9 @@ class WebMessagePortConverter {
@@ -25,6 +26,9 @@ class BLINK_EXPORT WebMessagePortConverter {
// neutered, it will return nullopt.
BLINK_EXPORT static absl::optional<MessagePortChannel>
static absl::optional<MessagePortChannel>
DisentangleAndExtractMessagePortChannel(v8::Isolate*, v8::Local<v8::Value>);
+
+ BLINK_EXPORT static v8::Local<v8::Value>
@@ -30,7 +30,7 @@ index 70270faafcae01aba19d2be9ece3821c1c75dc29..809ec708c3faa9deb69ff17d499e6455
} // namespace blink
diff --git a/third_party/blink/renderer/core/exported/web_message_port_converter.cc b/third_party/blink/renderer/core/exported/web_message_port_converter.cc
index 0f9377d28fdf8dd6511fbf025493367205ff74d6..5b04fb60cbd079b7d589ca14dfbb351fd2492f74 100644
index f440ee59be4ed14760f2948751f31f7ea3d42e2a..654fbb2d12c9fe7cb362d792ede64c9d1f8c099f 100644
--- a/third_party/blink/renderer/core/exported/web_message_port_converter.cc
+++ b/third_party/blink/renderer/core/exported/web_message_port_converter.cc
@@ -6,6 +6,7 @@

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 5c03f1194643c6f7302131404f7d869502f1e18b..fa990e6a444d5321213d956b01ba89ef21d57bd2 100644
index 564822b722580aa20adf728ca4706a853c285c8b..175a803839efd10226476285bfc506d01ef2626d 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -659,6 +659,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -675,6 +675,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -22,10 +22,10 @@ index 5c03f1194643c6f7302131404f7d869502f1e18b..fa990e6a444d5321213d956b01ba89ef
return is_active();
}
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index dfefe47c77c723c1cfdc6abe0e8ff96bc5ec6ddd..8d195ec46b9a6ea830c1ff36ee740b3b8be2b341 100644
index 84b4727e8e8f7eb84c6654854606dc1d4f3c5fb9..827cf26d2a1e5c2869524c4709a613896a94dbb4 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -138,6 +138,7 @@ class CONTENT_EXPORT RenderViewHostImpl
void EnablePreferredSizeMode() override;
void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) const override;
@@ -34,7 +34,7 @@ index dfefe47c77c723c1cfdc6abe0e8ff96bc5ec6ddd..8d195ec46b9a6ea830c1ff36ee740b3b
void SendRendererPreferencesToRenderer(
const blink::RendererPreferences& preferences);
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
index e5931e1115d1f90a8fc0c1ec6b3e2a0b58246c74..a9b58297ec46da7432b717e2a71736b0187f9917 100644
index 9979c25ecd57e68331b628a518368635db5c2027..32733bf951af3eff7da5fd5758bbcbaa49ff0e3c 100644
--- a/content/public/browser/render_view_host.h
+++ b/content/public/browser/render_view_host.h
@@ -76,6 +76,9 @@ class CONTENT_EXPORT RenderViewHost {
@@ -48,10 +48,10 @@ index e5931e1115d1f90a8fc0c1ec6b3e2a0b58246c74..a9b58297ec46da7432b717e2a71736b0
// This interface should only be implemented inside content.
friend class RenderViewHostImpl;
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
index 6ff7c34463f3ce5011ea8711d23f9cd11da38d8b..2b8e313dfac2ea9fad0583bb5e98d0c385e8584a 100644
index 0cfe109e1ee4ac59dc8ddc68dff3ab929fcf480b..398be46c71fb9ea42ea655b204aaff31501d48c9 100644
--- a/third_party/blink/public/mojom/page/page.mojom
+++ b/third_party/blink/public/mojom/page/page.mojom
@@ -137,4 +137,7 @@ interface PageBroadcast {
@@ -131,4 +131,7 @@ interface PageBroadcast {
mojo_base.mojom.UnguessableToken devtools_frame_token,
RemoteFrameInterfacesFromBrowser remote_frame_interfaces,
RemoteMainFrameInterfaces remote_main_frame_interfaces);
@@ -60,10 +60,10 @@ index 6ff7c34463f3ce5011ea8711d23f9cd11da38d8b..2b8e313dfac2ea9fad0583bb5e98d0c3
+ SetSchedulerThrottling(bool allowed);
};
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 3af33a4d699b5bbfb0a1abac9408ad322a47a5ac..30bc8aa73fb46a0306ccc837a99cc4d58daef99d 100644
index f3b681ec44c57f69c57390f31bd951cef8de3f0c..2fbe866ddf50d7eb324b0e2e4d120f4c4bcf2875 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -366,6 +366,7 @@ class WebView {
@@ -365,6 +365,7 @@ class BLINK_EXPORT WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@@ -72,10 +72,10 @@ index 3af33a4d699b5bbfb0a1abac9408ad322a47a5ac..30bc8aa73fb46a0306ccc837a99cc4d5
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index a29d97603b7de57b99038fae199d04cc5ee40999..7419518434b91a49f36e84b484c445d631f87f82 100644
index 33cd38a8e24a2db922987a957a115a5892382a59..b07f239296667e0d3809ccee255d608e7b0d0c9b 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3800,6 +3800,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3811,13 +3811,21 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -89,21 +89,20 @@ index a29d97603b7de57b99038fae199d04cc5ee40999..7419518434b91a49f36e84b484c445d6
void WebViewImpl::SetVisibilityState(
mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) {
@@ -3811,7 +3818,8 @@ void WebViewImpl::SetVisibilityState(
}
DCHECK(GetPage());
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
GetPage()->GetPageScheduler()->SetPageVisible(
- visibility_state == mojom::blink::PageVisibilityState::kVisible);
+ scheduler_throttling_allowed_ ?
+ (visibility_state == mojom::blink::PageVisibilityState::kVisible) : true);
}
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
// Notify observers of the change.
if (!is_initial_state) {
for (auto& observer : observers_)
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index 49da24df2b0136eed93ba36e7fbde8772a366c8f..65f7f120d1f518883f5709ed32d2d43f440e3388 100644
index ac38111515f40630f2d16c8425e39775e4118818..0a4890ed17305e215eb8963d27767d77471eebb7 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -425,6 +425,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -426,6 +426,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -111,7 +110,7 @@ index 49da24df2b0136eed93ba36e7fbde8772a366c8f..65f7f120d1f518883f5709ed32d2d43f
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -875,6 +876,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -879,6 +880,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// If true, we send IPC messages when |preferred_size_| changes.
bool send_preferred_size_changes_ = false;

View File

@@ -8,7 +8,7 @@ WebPreferences of in-process child windows, rather than relying on
process-level command line switches, as before.
diff --git a/third_party/blink/common/web_preferences/web_preferences.cc b/third_party/blink/common/web_preferences/web_preferences.cc
index 645d50cd3d50581fa0d13d1dc67158b60b628327..4adc497c5959c7d499ebc82189b4c654c64f2a17 100644
index 86791679979e715308090c5868cac9d54169d812..92d1c191249a2922a9a1196fabfc61461aeda944 100644
--- a/third_party/blink/common/web_preferences/web_preferences.cc
+++ b/third_party/blink/common/web_preferences/web_preferences.cc
@@ -142,6 +142,19 @@ WebPreferences::WebPreferences()
@@ -32,7 +32,7 @@ index 645d50cd3d50581fa0d13d1dc67158b60b628327..4adc497c5959c7d499ebc82189b4c654
accelerated_video_decode_enabled(false),
animation_policy(
diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
index b71bd477dac6fb5dde6a5c68b0acb066bfa47c32..a1607db91e9c373691a526988d098695cb72cc0c 100644
index f8792c52abc09a8fadbd4f3a478ce29c7f49c1a7..6e41b0be6aa017521efe73dc6c80cf76d3059e0c 100644
--- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
+++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
@@ -148,6 +148,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -56,7 +56,7 @@ index b71bd477dac6fb5dde6a5c68b0acb066bfa47c32..a1607db91e9c373691a526988d098695
out->accelerated_video_decode_enabled =
data.accelerated_video_decode_enabled();
diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
index b8023168b7be3f74e376c7a22f3519defa4eb01d..56c8f4f96203e4c8c963afda7244bac261a8519a 100644
index cac389c5ebd303945d958336e0c3601fdc2d7152..0c56b1d9e3c94559abd77325e3e5791e46d72867 100644
--- a/third_party/blink/public/common/web_preferences/web_preferences.h
+++ b/third_party/blink/public/common/web_preferences/web_preferences.h
@@ -10,6 +10,7 @@
@@ -88,7 +88,7 @@ index b8023168b7be3f74e376c7a22f3519defa4eb01d..56c8f4f96203e4c8c963afda7244bac2
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
// only controls whether or not the "document.cookie" field is properly
diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
index 59571fe4cbf8a75b3fd62d31bbd3bf693e1003a2..c1ca3d5343c66402143dcb5c9b809361ec17b498 100644
index e3290deda800c0807f5c9dd0d8360c15f9b56554..eff323e0c2a660b965f2c834ac4d0ae795528268 100644
--- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
+++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
@@ -6,6 +6,7 @@
@@ -153,18 +153,18 @@ index 59571fe4cbf8a75b3fd62d31bbd3bf693e1003a2..c1ca3d5343c66402143dcb5c9b809361
return r.cookie_enabled;
}
diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
index 3cba12472e2856d43076e5f171486b32673156eb..fb2fbea01bbd9f5bc05663e80aaae84460204374 100644
index b370a37da63b26937cf07a7be121e56887ef99a5..4577bfba785f052ebb05be0ef15455c8a1d10aee 100644
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
@@ -10,6 +10,7 @@ import "third_party/blink/public/mojom/v8_cache_options.mojom";
@@ -9,6 +9,7 @@ import "third_party/blink/public/mojom/css/preferred_contrast.mojom";
import "third_party/blink/public/mojom/v8_cache_options.mojom";
import "url/mojom/url.mojom";
import "url/mojom/origin.mojom";
import "mojo/public/mojom/base/string16.mojom";
+import "mojo/public/mojom/base/file_path.mojom";
enum PointerType {
kPointerNone = 1, // 1 << 0
@@ -209,6 +210,19 @@ struct WebPreferences {
@@ -208,6 +209,19 @@ struct WebPreferences {
// If true, stylus handwriting recognition to text input will be available in
// editable input fields which are non-password type.
bool stylus_handwriting_enabled;

View File

@@ -3,28 +3,28 @@ From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Mon, 26 Aug 2019 12:02:51 -0700
Subject: allow new privileges in unsandboxed child processes
This allows unsandboxed renderers to launch setuid processes on Linux.
This allows unsandboxed child process to launch setuid processes on Linux.
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
index 16d838b710d4f717733f4aa8f92f144922969b3b..ff2c78c7b803159dde97dafdb799d9b8761dc3fd 100644
index dd5ccfc0bdc2e071999d1bf864dc065dd1311407..cfadd28fca9f80bf57578db78d5472c4f75414e1 100644
--- a/content/browser/child_process_launcher_helper_linux.cc
+++ b/content/browser/child_process_launcher_helper_linux.cc
@@ -54,6 +54,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
if (GetProcessType() == switches::kRendererProcess) {
const int sandbox_fd = SandboxHostLinux::GetInstance()->GetChildSocket();
@@ -56,6 +56,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
options->fds_to_remap.push_back(std::make_pair(sandbox_fd, GetSandboxFD()));
+
+ // (For Electron), if we're launching without zygote, that means we're
+ // launching an unsandboxed process (since all sandboxed processes are
+ // forked from the zygote). Relax the allow_new_privs option to permit
+ // launching suid processes from unsandboxed renderers.
+ ZygoteHandle zygote_handle =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
+ ? nullptr
+ : delegate_->GetZygote();
+ if (!zygote_handle) {
+ options->allow_new_privs = true;
+ }
}
+ // (For Electron), if we're launching without zygote, that means we're
+ // launching an unsandboxed process (since all sandboxed processes are
+ // forked from the zygote). Relax the allow_new_privs option to permit
+ // launching suid processes from unsandboxed child processes.
+ ZygoteHandle zygote_handle =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
+ ? nullptr
+ : delegate_->GetZygote();
+ if (!zygote_handle) {
+ options->allow_new_privs = true;
+ }
+
for (const auto& remapped_fd : file_data_->additional_remapped_fds) {
options->fds_to_remap.emplace_back(remapped_fd.second.get(),
remapped_fd.first);

View File

@@ -6,7 +6,7 @@ Subject: Allow setting secondary label via SimpleMenuModel
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 6e1ed6b05b9358a46c796ac175a6556703477a1f..f138d6dc153694c2c3fbb8c98d9557e5bab8214e 100644
index 185b8281232401a76844987b4b949954e62f93b6..ac58d5bc1f2ced7784621a46bb339a96fc20ed71 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -53,6 +53,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId(
@@ -47,7 +47,7 @@ index 6e1ed6b05b9358a46c796ac175a6556703477a1f..f138d6dc153694c2c3fbb8c98d9557e5
return items_[ValidateItemIndex(index)].minor_text;
}
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index 7ecb2f6cae709af8c512cfb6cac71d449a9b39c4..b7781d44125c1d66dba90bc39f9f17b194a85665 100644
index 7c24e00caa235d0434377c1f4225efbe462f5525..cb2d82d806c679b780f83373d2bdffc9b1f1e12d 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -50,6 +50,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {

View File

@@ -7,7 +7,7 @@ This is used by editors to obtain the filesystem path from a dragged file. See
documentation at https://electronjs.org/docs/api/file-object
diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h
index c061962bec620d2da0e217d8f55b7db57d120f97..59d9946ecfb7d68b41f539ce7c29c7398e00e9b2 100644
index 6ad3b117511544ca318dac7a5fdae6edabb5dd25..754d1b5fdb1fb08f119705e0da3def5a49863ebf 100644
--- a/third_party/blink/renderer/core/fileapi/file.h
+++ b/third_party/blink/renderer/core/fileapi/file.h
@@ -211,6 +211,9 @@ class CORE_EXPORT File final : public Blob {

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 0e50579d9b1c989beee4113d6762d32b8074efb4..bbcd21ddc38a799fe4226447f9b3447f1ea54feb 100644
index 8b6abb315d33ce752884510beca325833b893bce..b197d38944c0560c7f9cb25b706eb8a5876c59d3 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -124,14 +124,6 @@ bool Frame::Detach(FrameDetachType type) {
@@ -49,10 +49,10 @@ index 0e50579d9b1c989beee4113d6762d32b8074efb4..bbcd21ddc38a799fe4226447f9b3447f
// 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 b19001d3f24edc2f979c0585614897a404890994..baba2925889605ab997a1ceb1f4acd1b809bcf58 100644
index 79bb5259e80c4708e1b93876b6aa8cd3e8dca66c..175b2a77d696a60fa8209809edc758912a11e83a 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -547,10 +547,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -548,10 +548,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index b19001d3f24edc2f979c0585614897a404890994..baba2925889605ab997a1ceb1f4acd1b
if (!Client())
return false;
@@ -596,6 +592,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -599,6 +595,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -6,7 +6,7 @@ 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 efcbdf378b61af0a4b0f2cd784160d95439e84e1..fc6bba3fdd71ee40bb38f7d95a2f4dccd82d3e17 100644
index dfd4ff9d338683214566345f1c6a0a3add12094c..6c14f780e7cc1478385da23e843256f101206220 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -44,6 +44,20 @@ config("no_asm_config") {

View File

@@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Tue, 5 May 2020 12:36:39 -0700
Subject: breakpad: allow getting string values for crash keys
Linux is currently recording both crashpad and breakpad keys on linux
(because upstream is experimenting with crashpad-on-linux). We can fetch
the string values for crashpad keys on win/mac, and they're easily
available on linux too, this just exposes them.
Should be upstreamed, or failing that, deleted once crashpad is enabled
on linux. If removing this patch doesn't cause a compile failure, it's
fine to delete!
diff --git a/components/crash/core/common/crash_key.h b/components/crash/core/common/crash_key.h
index bf88c1180ee507c97e2613d4aba12a8e87fcfcd3..fae2b77315784f9167c0fcf4cc5330520c14b862 100644
--- a/components/crash/core/common/crash_key.h
+++ b/components/crash/core/common/crash_key.h
@@ -219,6 +219,10 @@ class CrashKeyStringCombined : public internal::CrashKeyStringCombinedImpl {
crashpad_key_.Set(value);
}
+ const base::StringPiece value() const {
+ return crashpad_key_.value();
+ }
+
private:
CrashKeyStringBreakpad<MaxLength> breakpad_key_;
crashpad::StringAnnotation<MaxLength> crashpad_key_;

View File

@@ -1,45 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Thu, 30 Apr 2020 17:04:13 -0700
Subject: breakpad: treat node processes as browser processes
On Linux, to avoid the need to pass breakpad FDs to child node processes
spawned by child_process.fork(), each child process must re-initialize
breakpad independently, as a "browser" process. This patches
//components/crash so that it will correctly report 'ptype=node' as a
crash annotation.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index 1fa85302da7a64abc42fd9558ddbcaf68b387517..62d15f57e4c5a0a24aa730e8979fb1e9537fecd3 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -719,8 +719,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
log_path[log_path_len] = '\0';
info.log_filename = log_path;
#endif
- info.process_type = "browser";
- info.process_type_length = 7;
+ if (g_is_node) {
+ info.process_type = "node";
+ info.process_type_length = 4;
+ } else {
+ info.process_type = "browser";
+ info.process_type_length = 7;
+ }
info.distro = base::g_linux_distro;
info.distro_length = my_strlen(base::g_linux_distro);
info.upload = upload;
@@ -2027,8 +2032,13 @@ void InitCrashReporter(const std::string& process_type) {
process_type == kWebViewSingleProcessType ||
process_type == kBrowserProcessType ||
#endif
+ process_type == "node" ||
process_type.empty();
+ if (process_type == "node") {
+ g_is_node = true;
+ }
+
#if !BUILDFLAG(IS_CHROMEOS)
SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
#endif

View File

@@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 2c2cde3260fb1d104d01fcc0fb7b160dc29fc4c0..61a55b7f837c6881efe277d9a4653eee9d650206 100644
index cfa800eb9fc7707b6b881d6504371fe7c56c4642..1a0cc1e6cd7fb90f84699ae18b00d68428a28e8d 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -80,6 +80,7 @@
@@ -81,6 +81,7 @@
X("drmcursor") \
X("dwrite") \
X("DXVA_Decoding") \

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@salesforce.com>
Date: Fri, 21 Oct 2022 16:29:06 -0700
Subject: build: allow electron to use exec_script
This is similar to the //build usecase so we're OK adding ourselves here
diff --git a/.gn b/.gn
index 55f5ee19f13e49dfd0aa2300d980d813474c95ef..483e0f0598bfed76b4a4283be3cfa1fdb9eafe5a 100644
--- a/.gn
+++ b/.gn
@@ -169,4 +169,6 @@ exec_script_whitelist =
"//tools/grit/grit_rule.gni",
"//tools/gritsettings/BUILD.gn",
+
+ "//electron/BUILD.gn"
]

View File

@@ -9,7 +9,7 @@ and can be removed when the crash in fork is resolved.
Related issue: https://github.com/electron/electron/issues/32718
diff --git a/build_overrides/partition_alloc.gni b/build_overrides/partition_alloc.gni
index 7ce71f04ed4c5c0da7dd6f26c35f01ddda490484..0c39dc9c08c1c29e842f8f924134609472b5a156 100644
index 44ace8017bdf9ce2ddb996e30ee03dbdc6274fb9..e2ce9f6c57e55f6a9257bb2e58e99895ca52f8c6 100644
--- a/build_overrides/partition_alloc.gni
+++ b/build_overrides/partition_alloc.gni
@@ -40,7 +40,7 @@ _disable_partition_alloc = is_component_build || (is_win && is_debug)

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 e57b8edde3b3e8f7a9cd580e2bcd039f1beebdff..88b7962836cfe93a59d1569245f4815f22be355e 100644
index 4c7f9e2a074229f002dba786123423066b49d3bc..f2cd0d435fda91a74970c51d120687d27fa2e0e1 100644
--- a/printing/buildflags/buildflags.gni
+++ b/printing/buildflags/buildflags.gni
@@ -36,7 +36,7 @@ declare_args() {

View File

@@ -11,10 +11,10 @@ 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 0223183c4e869e835429a52ad7d9eb381a2d21f5..47162ccaa75ea637b7ce5ed0fed976862b14c427 100644
index b12b4e65be8ad29054f5fdd98600888726b1d068..d67683efeabed3209eac553ff050ec2e5974f496 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -176,11 +176,16 @@ if (!is_android && !is_mac) {
@@ -181,11 +181,16 @@ if (!is_android && !is_mac) {
"common/crash_keys.h",
]
@@ -33,10 +33,10 @@ index 0223183c4e869e835429a52ad7d9eb381a2d21f5..47162ccaa75ea637b7ce5ed0fed97686
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index e1274ce21a8d794b7753c0017b0558cfd92f9530..ba723ec8f05e03981a273a3890a775c151aaed99 100644
index 6af6b725815f67cee31bf03382ea69c53c2897d8..63807e436ef7011a284357e237ada68508870d87 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4639,7 +4639,7 @@ static_library("browser") {
@@ -4687,7 +4687,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 e1274ce21a8d794b7753c0017b0558cfd92f9530..ba723ec8f05e03981a273a3890a775c1
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 9e848b82105112f95a77ad87f23d9ffc762bd88b..4f10f85a7a4a9951b0a11fef0419f5301564e378 100644
index 1c660e23fbfbe97d489bb7b0e463ef40197851be..60a43d97d47924e4d95ab27feb0a365e52878bfc 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6065,7 +6065,6 @@ test("unit_tests") {
@@ -6157,7 +6157,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index 9e848b82105112f95a77ad87f23d9ffc762bd88b..4f10f85a7a4a9951b0a11fef0419f530
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:crash_reporter_client_win_unit_tests",
@@ -6090,6 +6089,10 @@ test("unit_tests") {
@@ -6182,6 +6181,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index 9e848b82105112f95a77ad87f23d9ffc762bd88b..4f10f85a7a4a9951b0a11fef0419f530
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -7018,7 +7021,7 @@ test("unit_tests") {
@@ -7109,7 +7112,7 @@ test("unit_tests") {
}
deps += [
@@ -77,7 +77,7 @@ index 9e848b82105112f95a77ad87f23d9ffc762bd88b..4f10f85a7a4a9951b0a11fef0419f530
"//chrome/browser/autofill_assistant/password_change/vector_icons:vector_icons",
"//chrome/browser/enterprise/connectors/analysis:features",
"//chrome/browser/media/router:test_support",
@@ -7140,6 +7143,10 @@ test("unit_tests") {
@@ -7232,6 +7235,10 @@ test("unit_tests") {
}
}

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 c737e53c2ce7237974f6c749eae60ba1de7ec2c1..26ba3ae4a77bc8f525c2ad927ff2956c028ef337 100644
index 21b4055dc151bd1868fee580866109db8f69bd01..b852a33b41608ef2f157c8bf428158a012045454 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {

View File

@@ -7,7 +7,7 @@ Build libc++ as static library to compile and pass
nan tests
diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
index 6f904094e6c9bf23f7a7a69a14e28196327074b0..d70fd8f616e0022860128861c5b8d484a3e2bd3e 100644
index 3956cb73cdde75a2778fba1a9fae456e890a7b5e..deb7ceab1d8fffb4300d3a168d86f5d1236caa9d 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -44,7 +44,11 @@ config("winver") {
@@ -32,7 +32,7 @@ index 6f904094e6c9bf23f7a7a69a14e28196327074b0..d70fd8f616e0022860128861c5b8d484
]
if (is_linux) {
diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
index 40f1285f14c0843405e0ee51879b8742285a006d..5be895d3e36df53a5960006a1513f1322400fd23 100644
index 8316e2754db29d96121d72bc4ef43313ec5760ba..225f05272d435bea47c02b0cc166291c0ba39244 100644
--- a/buildtools/third_party/libc++abi/BUILD.gn
+++ b/buildtools/third_party/libc++abi/BUILD.gn
@@ -4,7 +4,7 @@

View File

@@ -6,7 +6,7 @@ Subject: build: make libcxx_abi_unstable false for electron
https://nornagon.medium.com/a-libc-odyssey-973e51649063
diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site
index c9f885120cdcafbdd021a3d2afa3d7f29bf56367..a26efc71bed9c672528431fa8969e60d0aac3c42 100644
index c9230033a1250c50c863487bfea3547a3e821707..866c6f5c5f672b797be9456045405ac906a61b98 100644
--- a/buildtools/third_party/libc++/__config_site
+++ b/buildtools/third_party/libc++/__config_site
@@ -12,7 +12,6 @@

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 1c652afe8b002635b34d6718c8c69cdd86dd9f8b..21eb439646c16aa72e78e9436006a29cbd8c5bf4 100644
index e4e16ccdcd2070e56d9572b7d4bc22d685cb34bc..7484975281bf5c19b1640c56ea6ad5f8a1add54a 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7344,6 +7344,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -7443,6 +7443,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 1c652afe8b002635b34d6718c8c69cdd86dd9f8b..21eb439646c16aa72e78e9436006a29c
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index abb91fd00245fddf49ee8d28be081a041aa9fce9..707d9a116c8ea119977b54d3a3365d96fef05a5a 100644
index 15b6cdaf470c14300c66d46ad0fe4138f545f4d7..43a816bfe1259144792484ad90c79bffc266b82f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4005,6 +4005,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4006,6 +4006,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
}
auto* new_contents_impl = new_contents.get();
@@ -39,7 +39,7 @@ index abb91fd00245fddf49ee8d28be081a041aa9fce9..707d9a116c8ea119977b54d3a3365d96
new_contents_impl->GetController().SetSessionStorageNamespace(
partition_config, session_storage_namespace);
@@ -4049,12 +4057,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4050,12 +4058,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -53,10 +53,10 @@ index abb91fd00245fddf49ee8d28be081a041aa9fce9..707d9a116c8ea119977b54d3a3365d96
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 4eee5f6c069c83039bf0acee71056d8ed4ea92eb..9212926fba9d06296c9c46a95519b6ed777569ee 100644
index 683ea0bc548ed4978873d44c0ce7db6933585eda..e6241d0b14660a8aec09aab2271162c296c4ca1b 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -574,6 +574,10 @@ struct CreateNewWindowParams {
@@ -590,6 +590,10 @@ struct CreateNewWindowParams {
// Additional parameters for creating picture-in-picture windows.
blink.mojom.PictureInPictureWindowOptions? pip_options;
@@ -68,10 +68,10 @@ index 4eee5f6c069c83039bf0acee71056d8ed4ea92eb..9212926fba9d06296c9c46a95519b6ed
// 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 1e6bbfd6e7d79d1d75bd590fd2040ce51d330f16..3154a7ea00daa120279c34bdb5799b278e73ac62 100644
index f31156ba6ea6d6229198d129c5b56cfa1847c5fc..41f3dac6323bda9d1a10bcb8678fe3da3e195160 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -617,6 +617,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -622,6 +622,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -81,7 +81,7 @@ index 1e6bbfd6e7d79d1d75bd590fd2040ce51d330f16..3154a7ea00daa120279c34bdb5799b27
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 b4d22a849e067bb942825449e649a4a00fc4947a..67a8cbf589693a0a347f6604a36ed2a39d4ef2da 100644
index 9b6c2b8b249af92bc38c2c72f420e851c138d6f6..3f5f0449b7c70b7d48438d4c4c908c897cad3727 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -163,6 +163,7 @@ class NetworkService;
@@ -92,7 +92,7 @@ index b4d22a849e067bb942825449e649a4a00fc4947a..67a8cbf589693a0a347f6604a36ed2a3
} // namespace network
namespace sandbox {
@@ -1003,6 +1004,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1010,6 +1011,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -102,10 +102,10 @@ index b4d22a849e067bb942825449e649a4a00fc4947a..67a8cbf589693a0a347f6604a36ed2a3
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 74847a4fbd4d0d897ce6aecd1b39e30bc226f8f4..3ddcc2d403a68fdc2b4b0246899cd9507ecc6195 100644
index 4f4ce7c49df42d32e9a2dfb770671bb038d31f36..bd4bdeda3403325ac5c3b83bc575b46844b5077a 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -26,6 +26,17 @@ namespace content {
@@ -27,6 +27,17 @@ namespace content {
WebContentsDelegate::WebContentsDelegate() = default;
@@ -124,7 +124,7 @@ index 74847a4fbd4d0d897ce6aecd1b39e30bc226f8f4..3ddcc2d403a68fdc2b4b0246899cd950
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 815bee280776026f477c695d31cff8e040e25a49..04eff05d01eb94e5020cdd6e1cc2555077692ba0 100644
index 7119f2fe8397a1bd3472af5b00346672ed90f2b1..f33bc7ec4bce4b6a4c38462110b68aae5b6280d6 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -135,7 +135,7 @@ index 815bee280776026f477c695d31cff8e040e25a49..04eff05d01eb94e5020cdd6e1cc25550
#include "content/public/browser/eye_dropper.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/media_stream_request.h"
@@ -341,6 +342,13 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -342,6 +343,13 @@ class CONTENT_EXPORT WebContentsDelegate {
const StoragePartitionConfig& partition_config,
SessionStorageNamespace* session_storage_namespace);
@@ -150,10 +150,10 @@ index 815bee280776026f477c695d31cff8e040e25a49..04eff05d01eb94e5020cdd6e1cc25550
// 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 34a64f22b7e6f834409e3afdb243943af370b21d..36b3f9d6d535e1fde2cf3496dabcac07c372b892 100644
index d7f19a4efc3540d8bac48d00c37436362043f074..fb0483af59b0e289bd716a3417a545233f17be1f 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6201,6 +6201,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6210,6 +6210,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
/*openee_can_access_opener_origin=*/true,
!GetWebFrame()->IsAllowedToDownload(), GetWebFrame()->IsAdFrame());
@@ -165,7 +165,7 @@ index 34a64f22b7e6f834409e3afdb243943af370b21d..36b3f9d6d535e1fde2cf3496dabcac07
// moved on send.
bool is_background_tab =
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
index 40b82385697d8721ef6da3d0c77544d6d0ca400c..3a2d5207fb2eeea4b016012b09c3668af8dc35b4 100644
index 815df247101f8a2824daf5a6c37b7835c581bf30..09f6af8ef73afe2e3f864fc5b30b6a83146d8a80 100644
--- a/content/web_test/browser/web_test_content_browser_client.cc
+++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -482,6 +482,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -178,7 +178,7 @@ index 40b82385697d8721ef6da3d0c77544d6d0ca400c..3a2d5207fb2eeea4b016012b09c3668a
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h
index 4805dd035772fcaea60a1a91eb9911d5c0ce93a9..3b752ea509149f04fd6d10f6977bd29791f6a5d6 100644
index 0b77223b1fa7a24599c89621423ad9d66f36c114..848029e3f293d11421598c0e5ecf3593b1720bb3 100644
--- a/content/web_test/browser/web_test_content_browser_client.h
+++ b/content/web_test/browser/web_test_content_browser_client.h
@@ -81,6 +81,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -212,10 +212,10 @@ index 34570168ccb123f5102dcf8fa6bbf98e7c373ec6..192701e56d258da41b3724292853885e
} // 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 496610b02adf00eee937ffb42e5e6461df847441..ad9d8b199c32c189982fbed3ab6b9ae04c5ff968 100644
index fe5e2a61ec5a794b05bfc6a8eb1f69e105b69ed6..9f18da7c62951ecaf767ab9ead773c6e005c1dd8 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2108,6 +2108,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2145,6 +2145,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window, completed_url);

View File

@@ -0,0 +1,251 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Johannes Kron <kron@chromium.org>
Date: Thu, 17 Nov 2022 19:54:33 +0000
Subject: Reconfigure stream on window resize when using ScreenCaptureKit
Bug: chromium:1352405
Change-Id: I315104eb4ee985a2d04ea90f01341129c6307501
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4027202
Reviewed-by: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Johannes Kron <kron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1072984}
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
index c17f6f076fc852df85d5deb919434458b886db37..5d640a372f1649e0e2cb7e1828dbb3c66eb1e4d7 100644
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
@@ -6,15 +6,18 @@
#import <ScreenCaptureKit/ScreenCaptureKit.h>
+#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
#include "base/task/bind_post_task.h"
#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
#include "content/browser/media/capture/io_surface_capture_device_base_mac.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capture_types.h"
#include "ui/gfx/native_widget_types.h"
-using SampleCallback = base::RepeatingCallback<void(gfx::ScopedInUseIOSurface)>;
+using SampleCallback = base::RepeatingCallback<void(gfx::ScopedInUseIOSurface,
+ absl::optional<gfx::Size>)>;
using ErrorCallback = base::RepeatingClosure;
API_AVAILABLE(macos(12.3))
@@ -45,17 +48,64 @@ - (void)stream:(SCStream*)stream
CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
if (!pixelBuffer)
return;
+
+ // Read out width, height and scaling from metadata to determine the captured
+ // content size.
+ absl::optional<gfx::Size> contentSize;
+ CFArrayRef attachmentsArray =
+ CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, false);
+ if (attachmentsArray && CFArrayGetCount(attachmentsArray) > 0) {
+ CFDictionaryRef attachment = base::mac::CFCast<CFDictionaryRef>(
+ CFArrayGetValueAtIndex(attachmentsArray, 0));
+ if (attachment) {
+ CFDictionaryRef contentRectValue = base::mac::CFCast<CFDictionaryRef>(
+ CFDictionaryGetValue(attachment, SCStreamFrameInfoContentRect));
+ CFNumberRef contentScaleValue = base::mac::CFCast<CFNumberRef>(
+ CFDictionaryGetValue(attachment, SCStreamFrameInfoContentScale));
+ if (contentRectValue && contentScaleValue) {
+ CGRect contentRect = {};
+ bool succeed = CGRectMakeWithDictionaryRepresentation(contentRectValue,
+ &contentRect);
+ float contentScale = 1.0f;
+ succeed &= CFNumberGetValue(contentScaleValue, kCFNumberFloatType,
+ &contentScale);
+ if (succeed) {
+ contentSize.emplace(round(contentRect.size.width / contentScale),
+ round(contentRect.size.height / contentScale));
+ }
+ }
+ }
+ }
IOSurfaceRef ioSurface = CVPixelBufferGetIOSurface(pixelBuffer);
if (!ioSurface)
return;
_sampleCallback.Run(
- gfx::ScopedInUseIOSurface(ioSurface, base::scoped_policy::RETAIN));
+ gfx::ScopedInUseIOSurface(ioSurface, base::scoped_policy::RETAIN),
+ contentSize);
}
- (void)stream:(SCStream*)stream didStopWithError:(NSError*)error {
_errorCallback.Run();
}
++ (base::scoped_nsobject<SCStreamConfiguration>)
+ createStreamConfigurationWithFrameSize:(gfx::Size)frameSize
+ destRectInFrame:(gfx::RectF)destRectInFrame
+ frameRate:(float)frameRate {
+ base::scoped_nsobject<SCStreamConfiguration> config(
+ [[SCStreamConfiguration alloc] init]);
+ [config setWidth:frameSize.width()];
+ [config setHeight:frameSize.height()];
+ [config setPixelFormat:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange];
+ [config setDestinationRect:destRectInFrame.ToCGRect()];
+ [config setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)];
+ [config setScalesToFit:YES];
+ [config setShowsCursor:YES];
+ [config setColorSpaceName:kCGColorSpaceSRGB];
+ [config setMinimumFrameInterval:CMTimeMakeWithSeconds(1 / frameRate, 1)];
+ return config;
+}
+
@end
namespace content {
@@ -95,7 +145,6 @@ void OnShareableContentCreated(
}
base::scoped_nsobject<SCContentFilter> filter;
- gfx::Size content_size;
switch (source_.type) {
case DesktopMediaID::TYPE_SCREEN:
for (SCDisplay* display : [content displays]) {
@@ -112,7 +161,8 @@ void OnShareableContentCreated(
filter.reset([[SCContentFilter alloc]
initWithDisplay:display
excludingWindows:exclude_windows]);
- content_size = gfx::Size([display width], [display height]);
+ stream_config_content_size_ =
+ gfx::Size([display width], [display height]);
break;
}
}
@@ -123,7 +173,7 @@ void OnShareableContentCreated(
filter.reset([[SCContentFilter alloc]
initWithDesktopIndependentWindow:window]);
CGRect frame = [window frame];
- content_size = gfx::Size(frame.size);
+ stream_config_content_size_ = gfx::Size(frame.size);
break;
}
}
@@ -142,22 +192,16 @@ void OnShareableContentCreated(
gfx::RectF dest_rect_in_frame;
actual_capture_format_ = capture_params().requested_format;
actual_capture_format_.pixel_format = media::PIXEL_FORMAT_NV12;
- ComputeFrameSizeAndDestRect(content_size, actual_capture_format_.frame_size,
+ ComputeFrameSizeAndDestRect(stream_config_content_size_,
+ actual_capture_format_.frame_size,
dest_rect_in_frame);
-
- base::scoped_nsobject<SCStreamConfiguration> config(
- [[SCStreamConfiguration alloc] init]);
- [config setWidth:actual_capture_format_.frame_size.width()];
- [config setHeight:actual_capture_format_.frame_size.height()];
- [config setPixelFormat:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange];
- [config setDestinationRect:dest_rect_in_frame.ToCGRect()];
- [config setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)];
- [config setScalesToFit:YES];
- [config setShowsCursor:YES];
- [config setColorSpaceName:kCGColorSpaceSRGB];
- [config
- setMinimumFrameInterval:CMTimeMakeWithSeconds(
- 1 / actual_capture_format_.frame_rate, 1)];
+ base::scoped_nsobject<SCStreamConfiguration> config =
+ [ScreenCaptureKitDeviceHelper
+ createStreamConfigurationWithFrameSize:actual_capture_format_
+ .frame_size
+ destRectInFrame:dest_rect_in_frame
+ frameRate:actual_capture_format_
+ .frame_rate];
stream_.reset([[SCStream alloc] initWithFilter:filter
configuration:config
delegate:helper_]);
@@ -203,9 +247,71 @@ void OnStreamStopped(bool error) {
return;
}
}
- void OnStreamSample(gfx::ScopedInUseIOSurface io_surface) {
- // TODO(https://crbug.com/1309653): Reconfigure the stream if the IOSurface
- // should be resized.
+ void OnStreamSample(gfx::ScopedInUseIOSurface io_surface,
+ absl::optional<gfx::Size> content_size) {
+ if (requested_capture_format_) {
+ // Does the size of io_surface match the requested format?
+ size_t io_surface_width = IOSurfaceGetWidth(io_surface);
+ size_t io_surface_height = IOSurfaceGetHeight(io_surface);
+ DVLOG(3) << "Waiting for new capture format, "
+ << requested_capture_format_->frame_size.width() << " x "
+ << requested_capture_format_->frame_size.height()
+ << ". IO surface size " << io_surface_width << " x "
+ << io_surface_height;
+ if (static_cast<size_t>(requested_capture_format_->frame_size.width()) ==
+ io_surface_width &&
+ static_cast<size_t>(requested_capture_format_->frame_size.height()) ==
+ io_surface_height) {
+ actual_capture_format_ = requested_capture_format_.value();
+ requested_capture_format_.reset();
+ }
+ } else {
+ // No current request for new capture format. Check to see if content_size
+ // has changed and requires an updated configuration.
+ if (content_size &&
+ (stream_config_content_size_.width() != content_size->width() ||
+ stream_config_content_size_.height() != content_size->height())) {
+ DVLOG(3) << "Content size changed to " << content_size->width() << " x "
+ << content_size->height() << ". It was "
+ << stream_config_content_size_.width() << " x "
+ << stream_config_content_size_.height();
+ stream_config_content_size_ = content_size.value();
+ gfx::RectF dest_rect_in_frame;
+ gfx::Size new_frame_size;
+ ComputeFrameSizeAndDestRect(stream_config_content_size_, new_frame_size,
+ dest_rect_in_frame);
+ if (new_frame_size.width() !=
+ actual_capture_format_.frame_size.width() ||
+ new_frame_size.height() !=
+ actual_capture_format_.frame_size.height()) {
+ DVLOG(3) << "Calling updateConfiguration with new frame size: "
+ << new_frame_size.width() << " x "
+ << new_frame_size.height();
+ requested_capture_format_ = actual_capture_format_;
+ requested_capture_format_->frame_size = new_frame_size;
+ // Update stream configuration.
+ base::scoped_nsobject<SCStreamConfiguration> config =
+ [ScreenCaptureKitDeviceHelper
+ createStreamConfigurationWithFrameSize:
+ requested_capture_format_->frame_size
+ destRectInFrame:dest_rect_in_frame
+ frameRate:
+ requested_capture_format_->
+ frame_rate];
+ [stream_
+ updateConfiguration:config
+ completionHandler:^(NSError* _Nullable error) {
+ if (error) {
+ client()->OnError(
+ media::VideoCaptureError::kScreenCaptureKitStreamError,
+ FROM_HERE, "Error on updateConfiguration");
+ }
+ }];
+ }
+ }
+ }
+ // TODO(https://crbug.com/1352405): Set visible rect to make it possible to
+ // crop the frame when it's rendered/encoded.
OnReceivedIOSurfaceFromStream(io_surface, actual_capture_format_);
}
void OnStreamError() {
@@ -257,6 +363,13 @@ void OnStop() override {
// The actual format of the video frames that are sent to `client`.
media::VideoCaptureFormat actual_capture_format_;
+ // The requested format if a request to update the configuration has been
+ // sent.
+ absl::optional<media::VideoCaptureFormat> requested_capture_format_;
+
+ // The size of the content at the time that we configured the stream.
+ gfx::Size stream_config_content_size_;
+
// Helper class that acts as output and delegate for `stream_`.
base::scoped_nsobject<ScreenCaptureKitDeviceHelper> helper_;

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 651d8ec7d8e98e7588f8f182018188ab234d5c5a..1fc645a7f748d3cad8ca2f4fa9897454cb937a4c 100644
index 109e9f4361ef7682f5223f7aacb33940e206fa3c..c9d27e1e522adef49b3dd268224ecefaffdf6cc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -230,6 +230,7 @@ vs-chromium-project.txt
@@ -231,6 +231,7 @@ vs-chromium-project.txt
/delegate_execute
/device/serial/device_serial_mojo.xml
/docs/website
@@ -18,10 +18,10 @@ index 651d8ec7d8e98e7588f8f182018188ab234d5c5a..1fc645a7f748d3cad8ca2f4fa9897454
/google_apis/internal
/googleurl
diff --git a/third_party/.gitignore b/third_party/.gitignore
index e83145bd5b7301167ece2fc96a0710e9419638d4..4bbd7bac9dcc1b925a33bd4a675d065d073df502 100644
index bb50e8dd9c06049dbebc9952d5f49c7dea57b8f7..f11bec886fe4cc25cded88efd7d5ffef27fb82c8 100644
--- a/third_party/.gitignore
+++ b/third_party/.gitignore
@@ -84,6 +84,7 @@
@@ -85,6 +85,7 @@
/directxsdk
/dom_distiller_js/dist
/eigen3/src
@@ -29,15 +29,15 @@ index e83145bd5b7301167ece2fc96a0710e9419638d4..4bbd7bac9dcc1b925a33bd4a675d065d
/elfutils/src
/emoji-segmenter/src
/emoji-metadata/src
@@ -180,6 +181,7 @@
/mocha
@@ -183,6 +184,7 @@
/js_code_coverage/node_modules
/mockito/src
/nacl_sdk_binaries/
+/nan
/nasm
/nearby/src
/neon_2_sse/src
@@ -244,6 +246,7 @@
@@ -246,6 +248,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 8f79b6a75929a331cb11cb728a832ba01f48c7a4..e42f8777733c0a26cd72a6f5b4588537b6f1a381 100644
index 9ca8ea82afdc9660384dd7224d810990f96bf5a5..65d4e0b5f99c398814f1746a8ab66528e766f373 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
@@ -1171,6 +1171,10 @@ void DesktopWindowTreeHostWin::HandleWindowScaleFactorChanged(
@@ -1213,6 +1213,10 @@ void DesktopWindowTreeHostWin::HandleWindowScaleFactorChanged(
}
}
@@ -22,10 +22,10 @@ index 8f79b6a75929a331cb11cb728a832ba01f48c7a4..e42f8777733c0a26cd72a6f5b4588537
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 166ade2f988de2ba4b86aa74d315aeb70a37b768..efd7d0953f9ad4c3cd06f97d4d99ceca056e1caf 100644
index cec35ceb254777e447047e48fba11dd8d38af97d..17cf2b79963079e66050e29411baa5a398c8d68a 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
@@ -263,6 +263,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
@@ -265,6 +265,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
void HandleWindowSizeChanging() override;
void HandleWindowSizeUnchanged() override;
void HandleWindowScaleFactorChanged(float window_scale_factor) override;
@@ -34,7 +34,7 @@ index 166ade2f988de2ba4b86aa74d315aeb70a37b768..efd7d0953f9ad4c3cd06f97d4d99ceca
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 696062d4dfe06937bed5902b543b627be63b773a..a8b66dcfab91e3f2c86afdd31e207db474ee4ac1 100644
index aacb580a7506f2c86769251ad00d8679870a454a..400278ab26a4e095fd837fcf84c952a1297b173d 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3140,15 +3140,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -60,7 +60,7 @@ index 696062d4dfe06937bed5902b543b627be63b773a..a8b66dcfab91e3f2c86afdd31e207db4
}
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
index 5dbb192d0840ca0ded61397c399b774a8cb05cce..098a9c3140e9e140fdc8f0dc9cf4e8ec84451221 100644
index 233dd12f86c20a7f5169caab998993f614e8bc7e..3bf6fc95a653f1783510378ffeef5b18da42e559 100644
--- a/ui/views/win/hwnd_message_handler_delegate.h
+++ b/ui/views/win/hwnd_message_handler_delegate.h
@@ -258,6 +258,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {

View File

@@ -10,7 +10,7 @@ In Electron that can be simplified to webContents.isFocused() which maps to "is
This can't be upstreamed but the patch is minimal.
diff --git a/chrome/browser/resources/cryptotoken/webrequestsender.js b/chrome/browser/resources/cryptotoken/webrequestsender.js
index 8ea2d1c6d7269d25cd34a61d971d35c81b561670..8609defbb5de5c11614858586a9100974aed067c 100644
index a0ad8622ad90e2d730c053b749e299274ab7cbde..a27fe6ff44d9f15329fb86b9a588ac7c8cdeb0bc 100644
--- a/chrome/browser/resources/cryptotoken/webrequestsender.js
+++ b/chrome/browser/resources/cryptotoken/webrequestsender.js
@@ -142,10 +142,11 @@ function tabInForeground(tabId) {

View File

@@ -7,7 +7,7 @@ Pending upstream patch, this gives us fuller access to the window.open params
so that we will be able to decide whether to cancel it or not.
diff --git a/chrome/browser/android/document/document_web_contents_delegate.cc b/chrome/browser/android/document/document_web_contents_delegate.cc
index eb480c840e0a39485472349e2b276daa03c5ee52..c1523c09fe3a400d311c6df59aa46ef6897dc43b 100644
index 72644e1404e025bcfa5fa07a817721cdf2aecca5..5d1dae43ae3f79ed3e84f570c120a44ffdacf8ae 100644
--- a/chrome/browser/android/document/document_web_contents_delegate.cc
+++ b/chrome/browser/android/document/document_web_contents_delegate.cc
@@ -46,8 +46,7 @@ bool DocumentWebContentsDelegate::IsWebContentsCreationOverridden(
@@ -21,7 +21,7 @@ index eb480c840e0a39485472349e2b276daa03c5ee52..c1523c09fe3a400d311c6df59aa46ef6
return true;
}
diff --git a/chrome/browser/android/document/document_web_contents_delegate.h b/chrome/browser/android/document/document_web_contents_delegate.h
index 6f4a0f157fb226d78cdff9a7c6be52b580dbcd2a..df34af06b2f808d66c6284676d70be937bd8fe19 100644
index bcf9aa806ef31af1fe88e7b7aa661135f2d4d6bc..350dcd90d5961b17af8cd5748460e04d930b269d 100644
--- a/chrome/browser/android/document/document_web_contents_delegate.h
+++ b/chrome/browser/android/document/document_web_contents_delegate.h
@@ -41,8 +41,7 @@ class DocumentWebContentsDelegate
@@ -35,7 +35,7 @@ index 6f4a0f157fb226d78cdff9a7c6be52b580dbcd2a..df34af06b2f808d66c6284676d70be93
#endif // CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_
diff --git a/chrome/browser/media/offscreen_tab.cc b/chrome/browser/media/offscreen_tab.cc
index 3289268d3ddb3fbb625b8498c2f84370c37acdff..89920af3e44257b6091bb558537fe07d2bb2d899 100644
index 32a1c3ace3b9e1624f3637e9773c72b8088f296b..cdc4053b02e6f5ef38707b2353adb5057e8048eb 100644
--- a/chrome/browser/media/offscreen_tab.cc
+++ b/chrome/browser/media/offscreen_tab.cc
@@ -285,8 +285,7 @@ bool OffscreenTab::IsWebContentsCreationOverridden(
@@ -49,7 +49,7 @@ index 3289268d3ddb3fbb625b8498c2f84370c37acdff..89920af3e44257b6091bb558537fe07d
// uses this to spawn new windows/tabs, which is also not allowed for
// offscreen tabs.
diff --git a/chrome/browser/media/offscreen_tab.h b/chrome/browser/media/offscreen_tab.h
index faa684c429e8cd5817c043db48dcbea33c6c8782..8b5991bc8279585cc0749f6816aa8a03a2c4e558 100644
index 155296ba7ee5495be62045bc620bb1cd31d3ceb3..954efde9e7a58f8b556c6ceabb81643f453f7dc3 100644
--- a/chrome/browser/media/offscreen_tab.h
+++ b/chrome/browser/media/offscreen_tab.h
@@ -107,8 +107,7 @@ class OffscreenTab final : public ProfileObserver,
@@ -63,7 +63,7 @@ index faa684c429e8cd5817c043db48dcbea33c6c8782..8b5991bc8279585cc0749f6816aa8a03
content::RenderFrameHost* requesting_frame,
const blink::mojom::FullscreenOptions& options) final;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.cc b/chrome/browser/ui/ash/ash_web_view_impl.cc
index a3083a16b1317cc58b87e13f30498bcf3e475eaf..50deda6f7ee9b2cbf57288d54a30a44022be808a 100644
index cd480419c84969837d8322f1860d62042f116b00..b521b8f84b6ac1c4a7902151a630de386063a589 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.cc
+++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
@@ -96,10 +96,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
@@ -80,7 +80,7 @@ index a3083a16b1317cc58b87e13f30498bcf3e475eaf..50deda6f7ee9b2cbf57288d54a30a440
/*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 f0333177f885000fb22818ffa30a0c4ad520a161..03e82957f9d7bf009dcbf5fcd43718c9d2ac9bb8 100644
index b857041f9be1ee941a40b50ab8cad9c1079028bc..131faece2645aa104da440f09cd7d8bd5e3e324e 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.h
+++ b/chrome/browser/ui/ash/ash_web_view_impl.h
@@ -47,8 +47,7 @@ class AshWebViewImpl : public ash::AshWebView,
@@ -94,7 +94,7 @@ index f0333177f885000fb22818ffa30a0c4ad520a161..03e82957f9d7bf009dcbf5fcd43718c9
content::WebContents* source,
const content::OpenURLParams& params) override;
diff --git a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
index 1318d5e04d5448d2b357454c3ce4207264288760..3b0324c35d5b18ed2e29264aae860c4887cdd382 100644
index 1d49ec9a62ebc062ac825bebf471e2da99f4b65d..f19a6d112fe006b9a1eaa5dff375f6d2b40ae4da 100644
--- a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
+++ b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
@@ -71,8 +71,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate,
@@ -108,10 +108,10 @@ index 1318d5e04d5448d2b357454c3ce4207264288760..3b0324c35d5b18ed2e29264aae860c48
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index fc0083d2dcdf72a92cef4e1e830015341df4d65e..d8a82c7d06b58038f8b6a13fbdb31f96599f9e28 100644
index a3853924c98fae1ecb32bbf5e3dfe98108a82b66..cd8f9f7f75a950860c52bf825413a53a23bd7cb3 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1812,12 +1812,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -1814,12 +1814,11 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -127,10 +127,10 @@ index fc0083d2dcdf72a92cef4e1e830015341df4d65e..d8a82c7d06b58038f8b6a13fbdb31f96
WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 490f14db4bec628ab2e6d2c2d3582e41f8cf6723..23004cb8b7d494cbf7badc18f5a122155e3552e2 100644
index e80e3d192f615140cad4f804cf08f8dbc8590834..d5980c0c190c03fef24561d1a224b52b1e900ffa 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -852,8 +852,7 @@ class Browser : public TabStripModelObserver,
@@ -842,8 +842,7 @@ class Browser : public TabStripModelObserver,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -141,7 +141,7 @@ index 490f14db4bec628ab2e6d2c2d3582e41f8cf6723..23004cb8b7d494cbf7badc18f5a12215
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
index 27b0f262235a58d546358ea12d7d7ea05f250c15..4f3cb2d63313703c98fd2149c07c60c95f263cdb 100644
index 45a27e0b458d5ad30619727aa54e9136aab13546..1e1c67b5c9eec3ce050d9702276a02b24e6f9f21 100644
--- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
+++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
@@ -202,8 +202,7 @@ bool PresentationReceiverWindowController::IsWebContentsCreationOverridden(
@@ -155,7 +155,7 @@ index 27b0f262235a58d546358ea12d7d7ea05f250c15..4f3cb2d63313703c98fd2149c07c60c9
// uses this to spawn new windows/tabs, which is also not allowed for
// local presentations.
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
index b6833e34c5840a4d3a545d1c4a44b2b08d7fc9ea..5ebc16a3545a73e58516cb0fbdddca43e789fd24 100644
index c5ac95f3f5de7a71a52dc3ad6ec7cdd6da8a7f75..cd5b29a7df6bad940dbe9dbf972a58c6deef1fb8 100644
--- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
+++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
@@ -105,8 +105,7 @@ class PresentationReceiverWindowController final
@@ -169,7 +169,7 @@ index b6833e34c5840a4d3a545d1c4a44b2b08d7fc9ea..5ebc16a3545a73e58516cb0fbdddca43
// The profile used for the presentation.
raw_ptr<Profile> otr_profile_;
diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
index ed23267cd9f28f4e02d8374177f0bb697547cc2a..a979719f75ab4c9b49775ec3df5eff13f4429a49 100644
index f1561f1759be766d00543a868c9cd931dc17a72a..e2502b1f9219841857da4a27d5723052b3915757 100644
--- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
+++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
@@ -70,8 +70,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
@@ -183,7 +183,7 @@ index ed23267cd9f28f4e02d8374177f0bb697547cc2a..a979719f75ab4c9b49775ec3df5eff13
}
content::WebContents* CreateCustomWebContents(
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
index 9d5265c5774c5e1196af3d0a66b796896676469c..40b9842bed30fd79252aa0fd19daa78e1c9baa5c 100644
index 5361b1d57e3277b76463e7c67d32b0c378192609..f22776c45911026b637bd854cff7b5b09b96486b 100644
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
@@ -169,14 +169,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
@@ -204,7 +204,7 @@ index 9d5265c5774c5e1196af3d0a66b796896676469c..40b9842bed30fd79252aa0fd19daa78e
java_gurl);
}
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.h b/components/embedder_support/android/delegate/web_contents_delegate_android.h
index 2930898b03d7b7ef86d13733cec3cbe84105c166..76625339f42a867c8b68840253e91648721c9343 100644
index 2b328613e7ccd65bb5fad0e2264aab74484fb9bc..726548375430e9d4f6a720f80d4376765c319723 100644
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.h
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.h
@@ -78,8 +78,7 @@ class WebContentsDelegateAndroid : public content::WebContentsDelegate {
@@ -218,7 +218,7 @@ index 2930898b03d7b7ef86d13733cec3cbe84105c166..76625339f42a867c8b68840253e91648
void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override;
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.cc b/components/offline_pages/content/background_loader/background_loader_contents.cc
index 40e1d8312d64452beeac4eeb216c156132cd16e1..9b9a34f50d96b8fcae5a6b4133bd292002aa3cf6 100644
index e055852342aef9ab1b49a9d8a630fae1173862e4..cc3ce00fb16ad560852aae6c3dcab29d920faec1 100644
--- a/components/offline_pages/content/background_loader/background_loader_contents.cc
+++ b/components/offline_pages/content/background_loader/background_loader_contents.cc
@@ -83,8 +83,7 @@ bool BackgroundLoaderContents::IsWebContentsCreationOverridden(
@@ -232,7 +232,7 @@ index 40e1d8312d64452beeac4eeb216c156132cd16e1..9b9a34f50d96b8fcae5a6b4133bd2920
return true;
}
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.h b/components/offline_pages/content/background_loader/background_loader_contents.h
index 58c032fe666591be0a72c350b752ad07326253f0..23c8aa67c698ee6208a89b36c38a5fd39080b299 100644
index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7cc461b0a 100644
--- a/components/offline_pages/content/background_loader/background_loader_contents.h
+++ b/components/offline_pages/content/background_loader/background_loader_contents.h
@@ -66,8 +66,7 @@ class BackgroundLoaderContents : public content::WebContentsDelegate {
@@ -246,10 +246,10 @@ index 58c032fe666591be0a72c350b752ad07326253f0..23c8aa67c698ee6208a89b36c38a5fd3
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 b48f62fb5ba99e7399e739d9d23346c48218c247..84b48011e5a9d5b890a26debce68d0efd3c013c4 100644
index 387fe3214e73f0ea4cd9a39d7f74c2e1fb2e8b9c..9e3a045ee09748f74712ee9fa8134661c01b2df7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3932,8 +3932,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -3933,8 +3933,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,
@@ -260,10 +260,10 @@ index b48f62fb5ba99e7399e739d9d23346c48218c247..84b48011e5a9d5b890a26debce68d0ef
static_cast<WebContentsImpl*>(delegate_->CreateCustomWebContents(
opener, source_site_instance, is_new_browsing_instance,
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 3ddcc2d403a68fdc2b4b0246899cd9507ecc6195..eecc92f2ffce2c2eeb5fde977da6b94a29923b67 100644
index bd4bdeda3403325ac5c3b83bc575b46844b5077a..224d70abab0fdcd08fd09cff4a3deba5a5387ba4 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -134,8 +134,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
@@ -135,8 +135,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -274,10 +274,10 @@ index 3ddcc2d403a68fdc2b4b0246899cd9507ecc6195..eecc92f2ffce2c2eeb5fde977da6b94a
}
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 04eff05d01eb94e5020cdd6e1cc2555077692ba0..42a80fbe1d6a574b04d07fb1da3ae4b65854287c 100644
index f33bc7ec4bce4b6a4c38462110b68aae5b6280d6..53cf3913f59bc4d2fc883462a1b854ed18d7681f 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -320,8 +320,7 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -321,8 +321,7 @@ class CONTENT_EXPORT WebContentsDelegate {
SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -288,10 +288,10 @@ index 04eff05d01eb94e5020cdd6e1cc2555077692ba0..42a80fbe1d6a574b04d07fb1da3ae4b6
// Allow delegate to creates a custom WebContents when
// WebContents::CreateNewWindow() is called. This function is only called
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
index 0549e437ca79b1926da1e7ac3cd4371d2116cc17..fceb6c073d1e023c722196d907d98b73a379c6a0 100644
index a4a3713b484d706d18466b0d3e6efef4a16e584b..84fe3304a2967de36efb6595689fee33454a73b5 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
@@ -199,8 +199,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
@@ -198,8 +198,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -302,10 +302,10 @@ index 0549e437ca79b1926da1e7ac3cd4371d2116cc17..fceb6c073d1e023c722196d907d98b73
// view is used for displaying embedded extension options, we want any
// external links to be opened in a new tab, not in a new guest view so we
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h
index 33c6e87c19f67ce6f2cbded50b860e7e009e7d98..174570ed505f3948494f85a7e63433ccffafb9d0 100644
index e7ca270c9e95c539c5379e09302ae43256e193d2..9c2de6f9992e4630fa8b4359607973d5087b83ff 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.h
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h
@@ -58,8 +58,7 @@ class ExtensionOptionsGuest
@@ -59,8 +59,7 @@ class ExtensionOptionsGuest
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -316,10 +316,10 @@ index 33c6e87c19f67ce6f2cbded50b860e7e009e7d98..174570ed505f3948494f85a7e63433cc
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 75a2534e3be7102a221378afbfef3df8e6a8555e..495fc687379c6456384acc3a1864c5f0c49ad47f 100644
index 98bc3a82d40f840044a58bcc4b047cf58ea40b09..e11a0a0b8b113c694f9d3fcc284205305d6ba20e 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -399,8 +399,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
@@ -390,8 +390,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -330,7 +330,7 @@ index 75a2534e3be7102a221378afbfef3df8e6a8555e..495fc687379c6456384acc3a1864c5f0
}
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index 26dc86a7534d9296f1b1f772ec95f5313c61061c..925152a6c1fb645dfff5bd7238b620a8344de734 100644
index 06d3ed32b65708d91b220cdd4991fd377d84217c..bc942580c1bfb16bc5a8e9168f55626d16b863f0 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -170,8 +170,7 @@ class MimeHandlerViewGuest
@@ -344,10 +344,10 @@ index 26dc86a7534d9296f1b1f772ec95f5313c61061c..925152a6c1fb645dfff5bd7238b620a8
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
diff --git a/fuchsia_web/webengine/browser/frame_impl.cc b/fuchsia_web/webengine/browser/frame_impl.cc
index fbbd630fcc3c684c5f79a526e53e8240897d6f6b..ba0c18a6f6430cafefa21bf73717cd3f3b0fde94 100644
index 3d75b8de4e87fb365ca3472387b74dcdc1acf221..235be638fc445d7b2fcd907cbfeddbd44c624383 100644
--- a/fuchsia_web/webengine/browser/frame_impl.cc
+++ b/fuchsia_web/webengine/browser/frame_impl.cc
@@ -413,8 +413,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
@@ -525,8 +525,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -358,7 +358,7 @@ index fbbd630fcc3c684c5f79a526e53e8240897d6f6b..ba0c18a6f6430cafefa21bf73717cd3f
// can catch bad client behavior while not interfering with normal operation.
constexpr size_t kMaxPendingWebContentsCount = 10;
diff --git a/fuchsia_web/webengine/browser/frame_impl.h b/fuchsia_web/webengine/browser/frame_impl.h
index 93fb79392c573b48d30136b0e2147b94e73158e6..0bed243e6947f7b54ee5bed9621f6482ca6364f4 100644
index ac903eeed4d888b1128c9d96aec755d519aee590..cdfccea0e758c35e772b554ba0f3c987b58124d7 100644
--- a/fuchsia_web/webengine/browser/frame_impl.h
+++ b/fuchsia_web/webengine/browser/frame_impl.h
@@ -310,8 +310,7 @@ class WEB_ENGINE_EXPORT FrameImpl : public fuchsia::web::Frame,
@@ -372,7 +372,7 @@ index 93fb79392c573b48d30136b0e2147b94e73158e6..0bed243e6947f7b54ee5bed9621f6482
int opener_render_process_id,
int opener_render_frame_id,
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
index 1c1425fcd27aae25a6569762824cdaf4ebf19ffd..b8c06b3519fcfe3da08ea4d1769b7833effb0f69 100644
index 22f46f2515e62c84edd5540ba783843fef93b211..eb4d36792888278759d9a822b8d0518905245f0a 100644
--- a/headless/lib/browser/headless_web_contents_impl.cc
+++ b/headless/lib/browser/headless_web_contents_impl.cc
@@ -182,8 +182,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
@@ -386,7 +386,7 @@ index 1c1425fcd27aae25a6569762824cdaf4ebf19ffd..b8c06b3519fcfe3da08ea4d1769b7833
->options()
->block_new_web_contents();
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
index 6928d3f618de83e7d468b2204dba187a0361c892..0ae568044e6eaee3e486e4dc550be04b7e2ef545 100644
index a4e4703e5c2a3e668806e61ca5437a6a571e73d2..f1198ac26f34c68efd70e77453b0705c7c73376a 100644
--- a/ui/views/controls/webview/web_dialog_view.cc
+++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -427,8 +427,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
@@ -400,7 +400,7 @@ index 6928d3f618de83e7d468b2204dba187a0361c892..0ae568044e6eaee3e486e4dc550be04b
return delegate_->HandleShouldOverrideWebContentsCreation();
return false;
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h
index 3c6f0ed5f14251455c8dd295ffc5418ae8d360da..c9ba35edbbc8d2a60fcc53b51e998a9d5a0148ff 100644
index 105c29d75c54fe5ff2909af38f52bb00fdee3d05..3fbb4beca0e0b727858d4966a509851700baa167 100644
--- a/ui/views/controls/webview/web_dialog_view.h
+++ b/ui/views/controls/webview/web_dialog_view.h
@@ -155,8 +155,7 @@ class WEBVIEW_EXPORT WebDialogView : public ClientView,

View File

@@ -7,7 +7,7 @@ Disable persiste licence support check for widevine cdm,
as its not supported in the current version of chrome.
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc
index ae4b6d6ea7b16367096ac91c6c8550819ae4769b..bfe03fa38536caa7aec625c89a90a74dcc05809d 100644
index 13fea00df7ea693ff10576be264f17eafe8f80bf..ee5966ee7e0503d9dd43b407e605952a73aff309 100644
--- a/chrome/renderer/media/chrome_key_systems.cc
+++ b/chrome/renderer/media/chrome_key_systems.cc
@@ -17,7 +17,9 @@
@@ -20,7 +20,7 @@ index ae4b6d6ea7b16367096ac91c6c8550819ae4769b..bfe03fa38536caa7aec625c89a90a74d
#include "components/cdm/renderer/external_clear_key_key_system_info.h"
#include "components/cdm/renderer/widevine_key_system_info.h"
#include "content/public/renderer/render_thread.h"
@@ -235,12 +237,14 @@ SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability) {
@@ -238,12 +240,14 @@ SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability,
// Returns whether persistent-license session can be supported.
bool CanSupportPersistentLicense() {

View File

@@ -11,7 +11,7 @@ and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
patches.
diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.cc b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
index ed2ac20679a9357c9493224ec5e08837c7860d6e..7f9a97e11395e5521e100694cd37bcd95bcd8e35 100644
index 2ac08809148beeb6bacccfc5e9f032c3a88eabe7..025082e5fa644f89cec42fd8a2b97d6f764f375f 100644
--- a/chrome/browser/extensions/global_shortcut_listener_ozone.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
@@ -58,7 +58,8 @@ bool GlobalShortcutListenerOzone::RegisterAcceleratorImpl(
@@ -52,7 +52,7 @@ index ed2ac20679a9357c9493224ec5e08837c7860d6e..7f9a97e11395e5521e100694cd37bcd9
NotifyKeyPressed(ui::Accelerator(key_code, modifiers));
}
diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.h b/chrome/browser/extensions/global_shortcut_listener_ozone.h
index a2cec20e0ba434afa5e15bf60327c6a6f9b551f9..f58796ff2050883879225a22ed0b3f0c1aacf824 100644
index 3c2fc1707e38345c114e140104ffc5a93d704918..40dac9fd7beb7a1a589a479a8035391d4a32cbb8 100644
--- a/chrome/browser/extensions/global_shortcut_listener_ozone.h
+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.h
@@ -46,7 +46,8 @@ class GlobalShortcutListenerOzone
@@ -66,7 +66,7 @@ index a2cec20e0ba434afa5e15bf60327c6a6f9b551f9..f58796ff2050883879225a22ed0b3f0c
bool is_listening_ = false;
diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
index 2778a18b6c28f3342c6b43d1de71fbbd46c72f06..85af551f87b8b0f9aed7a2a395ecf79f81f5a0a1 100644
index 51cc1dd4f3452c18a4b4cc0634509ab4faa9dcd7..bb5f937d59617f323e829c5259a33028822f585a 100644
--- a/chrome/browser/extensions/global_shortcut_listener_win.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
@@ -62,6 +62,8 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd,
@@ -87,7 +87,7 @@ index 2778a18b6c28f3342c6b43d1de71fbbd46c72f06..85af551f87b8b0f9aed7a2a395ecf79f
// Create an observer that registers a hot key for |accelerator|.
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
index 3f37f08ccc06137317164e96e8934a0202fa5550..b954f8dde00d4f5257223c464e9145a6bef48900 100644
index f855a6f083d7f0de1aa2ac26e6032917e2a984c8..2901d408d154a86f0df838314e54c17c208ac573 100644
--- a/content/browser/media/media_keys_listener_manager_impl.cc
+++ b/content/browser/media/media_keys_listener_manager_impl.cc
@@ -297,6 +297,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
@@ -103,7 +103,7 @@ index 3f37f08ccc06137317164e96e8934a0202fa5550..b954f8dde00d4f5257223c464e9145a6
NOTREACHED();
}
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc7951d372 100644
index db596585cbb44b3710636e3fc013f288966f604f..6d5557ee1a2c35ee15e695e024834184a525e2a7 100644
--- a/ui/base/accelerators/media_keys_listener.cc
+++ b/ui/base/accelerators/media_keys_listener.cc
@@ -13,7 +13,8 @@ MediaKeysListener::~MediaKeysListener() = default;
@@ -117,7 +117,7 @@ index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc
} // namespace ui
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
index 87a53282aa3afa3fe8469272d8b1ee37dcadf845..55c36da933165c8f86dd2ab440733f4b20bee378 100644
index 49cdcc41ccc1d1f005520e7f26700a98e5123476..7710129240b17124c8a845e513e49c16daa839a0 100644
--- a/ui/base/accelerators/media_keys_listener_mac.mm
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
@@ -34,6 +34,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
@@ -146,7 +146,7 @@ index 87a53282aa3afa3fe8469272d8b1ee37dcadf845..55c36da933165c8f86dd2ab440733f4b
}
diff --git a/ui/base/x/x11_global_shortcut_listener.cc b/ui/base/x/x11_global_shortcut_listener.cc
index 898e15a25c99ad25221c41594803521565ff4432..664337941023e800c9605f987d0e1d65bb0a444d 100644
index 8b0bcbe458f44431385cedb89f988756d89636b6..bc10cf442edf14cd43714707565aae9475cb8112 100644
--- a/ui/base/x/x11_global_shortcut_listener.cc
+++ b/ui/base/x/x11_global_shortcut_listener.cc
@@ -31,11 +31,13 @@ const x11::ModMask kModifiersMasks[] = {
@@ -226,7 +226,7 @@ index 898e15a25c99ad25221c41594803521565ff4432..664337941023e800c9605f987d0e1d65
} // namespace ui
diff --git a/ui/base/x/x11_global_shortcut_listener.h b/ui/base/x/x11_global_shortcut_listener.h
index bfb82e38a9ccc7459ccb427d512df821517a328b..7f1d5876a51fa53e539b2bab8d2f020f26d39ceb 100644
index 7165e88ef78e0e1b4683a2ead588dc6529d085b8..a605cd8c1468be78172fed09eb227722b4832227 100644
--- a/ui/base/x/x11_global_shortcut_listener.h
+++ b/ui/base/x/x11_global_shortcut_listener.h
@@ -41,18 +41,21 @@ class COMPONENT_EXPORT(UI_BASE_X) XGlobalShortcutListener
@@ -264,7 +264,7 @@ index bfb82e38a9ccc7459ccb427d512df821517a328b..7f1d5876a51fa53e539b2bab8d2f020f
// Invoked when a global shortcut is pressed.
void OnKeyPressEvent(const KeyEvent& event);
diff --git a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc
index 760dfc340601b7c1807fa750b008bcc79780c583..54f9817017c9fc0ebcd2f5825fb20b2fb8412b02 100644
index d23310746bca13981d0099ce74c62459471db0e5..6ad79156e62dc60bdf20ef1acf53ec2425cb2bfe 100644
--- a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc
+++ b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.cc
@@ -26,27 +26,30 @@ void X11GlobalShortcutListenerOzone::StopListening() {
@@ -305,7 +305,7 @@ index 760dfc340601b7c1807fa750b008bcc79780c583..54f9817017c9fc0ebcd2f5825fb20b2f
}
diff --git a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h
index 0f1980abdcaf30e23f580b937ecb2c422bf2a357..112967622cb8a6263c7a88dd8d09f48f52448a45 100644
index 4f7392e2019828caf374d7008068222aa366815f..bc1fcbb68c15d999caa991d678a6bb7473496d39 100644
--- a/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h
+++ b/ui/ozone/platform/x11/x11_global_shortcut_listener_ozone.h
@@ -28,17 +28,20 @@ class X11GlobalShortcutListenerOzone : public PlatformGlobalShortcutListener,
@@ -333,7 +333,7 @@ index 0f1980abdcaf30e23f580b937ecb2c422bf2a357..112967622cb8a6263c7a88dd8d09f48f
} // namespace ui
diff --git a/ui/ozone/public/platform_global_shortcut_listener.h b/ui/ozone/public/platform_global_shortcut_listener.h
index 5b6ceb2e23d306e446cad5a6b6e7adf37334410a..d4fbca17a11bd52deaf746e052eeeb12d8a4594e 100644
index dd8bf45d0b7072178d97678565c023c0a6f9a6db..c6af8dbe1dee2d9c1552383b17c81ae12b5cc05c 100644
--- a/ui/ozone/public/platform_global_shortcut_listener.h
+++ b/ui/ozone/public/platform_global_shortcut_listener.h
@@ -20,7 +20,8 @@ class COMPONENT_EXPORT(OZONE_BASE) PlatformGlobalShortcutListenerDelegate {

View File

@@ -1,147 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Thu, 14 May 2020 16:52:09 -0700
Subject: crash: allow disabling compression on linux
This makes compression optional on breakpad_linux.
Upstream attempted here
https://chromium-review.googlesource.com/c/chromium/src/+/2198641, but
was denied.
Ultimately we should remove the option to disable compression, and
subsequently remove this patch.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index 62d15f57e4c5a0a24aa730e8979fb1e9537fecd3..77fd14f5e9a4330364da4e7e5ee089c9196b4939 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -111,6 +111,8 @@ void SetUploadURL(const std::string& url) {
DCHECK(!g_upload_url);
g_upload_url = strdup(url.c_str());
}
+
+bool g_compress_uploads = true;
#endif
bool g_is_node = false;
@@ -1324,56 +1326,60 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
#else // BUILDFLAG(IS_CHROMEOS)
- // Compress |dumpfile| with gzip.
- const pid_t gzip_child = sys_fork();
- if (gzip_child < 0) {
- static const char msg[] = "sys_fork() for gzip process failed.\n";
- WriteLog(msg, sizeof(msg) - 1);
- sys__exit(1);
- }
- if (!gzip_child) {
- // gzip process.
- const char* args[] = {
- "/bin/gzip",
- "-f", // Do not prompt to verify before overwriting.
- dumpfile,
- nullptr,
- };
- execve(args[0], const_cast<char**>(args), environ);
- static const char msg[] = "Cannot exec gzip.\n";
- WriteLog(msg, sizeof(msg) - 1);
- sys__exit(1);
- }
- // Wait for gzip process.
- int status = 0;
- if (sys_waitpid(gzip_child, &status, 0) != gzip_child ||
- !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
- static const char msg[] = "sys_waitpid() for gzip process failed.\n";
- WriteLog(msg, sizeof(msg) - 1);
- sys_kill(gzip_child, SIGKILL);
- sys__exit(1);
- }
+ if (g_compress_uploads) {
+ // Compress |dumpfile| with gzip.
+ const pid_t gzip_child = sys_fork();
+ if (gzip_child < 0) {
+ static const char msg[] = "sys_fork() for gzip process failed.\n";
+ WriteLog(msg, sizeof(msg) - 1);
+ sys__exit(1);
+ }
+ if (!gzip_child) {
+ // gzip process.
+ const char* args[] = {
+ "/bin/gzip",
+ "-f", // Do not prompt to verify before overwriting.
+ dumpfile,
+ nullptr,
+ };
+ execve(args[0], const_cast<char**>(args), environ);
+ static const char msg[] = "Cannot exec gzip.\n";
+ WriteLog(msg, sizeof(msg) - 1);
+ sys__exit(1);
+ }
+ // Wait for gzip process.
+ int status = 0;
+ if (sys_waitpid(gzip_child, &status, 0) != gzip_child ||
+ !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+ static const char msg[] = "sys_waitpid() for gzip process failed.\n";
+ WriteLog(msg, sizeof(msg) - 1);
+ sys_kill(gzip_child, SIGKILL);
+ sys__exit(1);
+ }
- static const char kGzipExtension[] = ".gz";
- const size_t gzip_file_size = my_strlen(dumpfile) + sizeof(kGzipExtension);
- char* const gzip_file = reinterpret_cast<char*>(allocator->Alloc(
- gzip_file_size));
- my_strlcpy(gzip_file, dumpfile, gzip_file_size);
- my_strlcat(gzip_file, kGzipExtension, gzip_file_size);
+ static const char kGzipExtension[] = ".gz";
+ const size_t gzip_file_size = my_strlen(dumpfile) + sizeof(kGzipExtension);
+ char* const gzip_file =
+ reinterpret_cast<char*>(allocator->Alloc(gzip_file_size));
+ my_strlcpy(gzip_file, dumpfile, gzip_file_size);
+ my_strlcat(gzip_file, kGzipExtension, gzip_file_size);
- // Rename |gzip_file| to |dumpfile| (the original file was deleted by gzip).
- if (rename(gzip_file, dumpfile)) {
- static const char msg[] = "Failed to rename gzipped file.\n";
- WriteLog(msg, sizeof(msg) - 1);
- sys__exit(1);
+ // Rename |gzip_file| to |dumpfile| (the original file was deleted by gzip).
+ if (rename(gzip_file, dumpfile)) {
+ static const char msg[] = "Failed to rename gzipped file.\n";
+ WriteLog(msg, sizeof(msg) - 1);
+ sys__exit(1);
+ }
}
// The --header argument to wget looks like:
// --header=Content-Encoding: gzip
// --header=Content-Type: multipart/form-data; boundary=XYZ
// where the boundary has two fewer leading '-' chars
- static const char header_content_encoding[] =
+ static const char header_content_encoding_gzip[] =
"--header=Content-Encoding: gzip";
+ static const char header_content_encoding_identity[] =
+ "--header=Content-Encoding: identity";
static const char header_msg[] =
"--header=Content-Type: multipart/form-data; boundary=";
const size_t header_content_type_size =
@@ -1400,7 +1406,8 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
static const char kWgetBinary[] = "/usr/bin/wget";
const char* args[] = {
kWgetBinary,
- header_content_encoding,
+ g_compress_uploads ? header_content_encoding_gzip
+ : header_content_encoding_identity,
header_content_type,
post_file,
g_upload_url,
@@ -2041,6 +2048,7 @@ void InitCrashReporter(const std::string& process_type) {
#if !BUILDFLAG(IS_CHROMEOS)
SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
+ g_compress_uploads = GetCrashReporterClient()->GetShouldCompressUploads();
#endif
if (is_browser_process) {

View File

@@ -8,20 +8,8 @@ rate-limiting, compression and global annotations.
This should be upstreamed.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index 6aa864db880408bf7021ac58673f4d8d489426b4..1fa85302da7a64abc42fd9558ddbcaf68b387517 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -113,6 +113,7 @@ void SetUploadURL(const std::string& url) {
}
#endif
+bool g_is_node = false;
bool g_is_crash_reporter_enabled = false;
uint64_t g_process_start_time = 0;
pid_t g_pid = 0;
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
index 463f92a6e547006a46119f52203482dd6695a84a..34e6f087613d76947ae463fda2b107fad6ec14e9 100644
index 284dd099122df85d2cebf467cdb3a54b45a343eb..bb21ddbd2ee4d2952a4b753a5c553005f8dc46db 100644
--- a/components/crash/core/app/crash_reporter_client.cc
+++ b/components/crash/core/app/crash_reporter_client.cc
@@ -145,6 +145,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
@@ -43,7 +31,7 @@ index 463f92a6e547006a46119f52203482dd6695a84a..34e6f087613d76947ae463fda2b107fa
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 2532e99f00b39777cd9640c76704f7430d39502e..323e039e4591a4099b187f7a0097b4ee8be11a9f 100644
index 9f8f20dfa65068a13ce3b035a7e3ce062d767161..9b45c7276e97253f79f4555ee692687b040afa67 100644
--- a/components/crash/core/app/crash_reporter_client.h
+++ b/components/crash/core/app/crash_reporter_client.h
@@ -5,6 +5,7 @@
@@ -75,7 +63,7 @@ index 2532e99f00b39777cd9640c76704f7430d39502e..323e039e4591a4099b187f7a0097b4ee
// Used by WebView to sample crashes without generating the unwanted dumps. If
// the returned value is less than 100, crash dumping will be sampled to that
diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc
index a80a792f1cb2c996b77443a3383663b4687ae044..2b1453353ce93632b378d4b25295b5cb14df9b2c 100644
index 99efa6b245b9944710b76a342ec9a37947078a48..e55df93f17560a566e1dd2a63c560054edd772a5 100644
--- a/components/crash/core/app/crashpad_linux.cc
+++ b/components/crash/core/app/crashpad_linux.cc
@@ -170,6 +170,7 @@ bool PlatformCrashpadInitialization(
@@ -101,7 +89,7 @@ index a80a792f1cb2c996b77443a3383663b4687ae044..2b1453353ce93632b378d4b25295b5cb
annotations, arguments, false, false));
} else {
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
index dc041c43371fd58e3121ef6bc423aadb644bb8d0..a1fa566775724b4a1662a939fda3f0a59bf46b96 100644
index cab2c95eee53e6c406d6867b0a6e53a3a9fb5ce3..46935fcbf84cf1472214904cf96b03aa0e57be8f 100644
--- a/components/crash/core/app/crashpad_mac.mm
+++ b/components/crash/core/app/crashpad_mac.mm
@@ -85,6 +85,8 @@
@@ -128,7 +116,7 @@ index dc041c43371fd58e3121ef6bc423aadb644bb8d0..a1fa566775724b4a1662a939fda3f0a5
arguments.push_back("--monitor-self");
}
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
index ae8801a7fc877241313de84a6ae0698d4f2adf69..9ae249bfe41da9743adc7f60d69be0f003ca31e2 100644
index 9ab5fb1c822752854fc88ba0ee3d24ddca4dd107..11ae602ccc58cb2728911b28d6637079d2dcb359 100644
--- a/components/crash/core/app/crashpad_win.cc
+++ b/components/crash/core/app/crashpad_win.cc
@@ -91,6 +91,7 @@ bool PlatformCrashpadInitialization(

View File

@@ -16,7 +16,7 @@ https://github.com/electron/electron/pull/18483#discussion_r292703588
https://github.com/electron/electron/pull/18483#issuecomment-501090683
diff --git a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
index 6890a01cc4b333927be6c36ff3392706020f57a3..36da005deed5893989585427216fd1e16d5e9f0c 100644
index ba938ec93f81680d98ab444484db00b1b1f54b88..3d0d2dee374367904dff2bffa967c2da856b7cde 100644
--- a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
+++ b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
@@ -446,9 +446,16 @@ bool ExceptionHandlerServer::ServiceClientConnection(

View File

@@ -7,10 +7,10 @@ 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 6242f0a0070b2b862f9fa5ed70825a16d6e270ef..af355d4b0adb509f6b04d8bc2eddbb3a6b3c9a08 100644
index 8d82dc3e54180da12dc55134945e291fafaa020e..5b07db2879bea5ec60c2ca19a120c07579a87346 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -37,6 +37,7 @@
@@ -38,6 +38,7 @@
#include "base/process/memory.h"
#include "base/process/process.h"
#include "base/process/process_handle.h"
@@ -18,7 +18,7 @@ index 6242f0a0070b2b862f9fa5ed70825a16d6e270ef..af355d4b0adb509f6b04d8bc2eddbb3a
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/thread_pool/thread_pool_instance.h"
@@ -232,8 +233,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
@@ -242,8 +243,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
#endif
@@ -33,7 +33,7 @@ index 6242f0a0070b2b862f9fa5ed70825a16d6e270ef..af355d4b0adb509f6b04d8bc2eddbb3a
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
base::FileDescriptorStore& file_descriptor_store =
base::FileDescriptorStore::GetInstance();
@@ -262,11 +268,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
@@ -272,11 +278,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
#endif // V8_USE_EXTERNAL_STARTUP_DATA
@@ -48,7 +48,7 @@ index 6242f0a0070b2b862f9fa5ed70825a16d6e270ef..af355d4b0adb509f6b04d8bc2eddbb3a
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
@@ -925,7 +932,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
@@ -960,7 +967,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
return TerminateForFatalInitializationError();
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
@@ -58,7 +58,7 @@ index 6242f0a0070b2b862f9fa5ed70825a16d6e270ef..af355d4b0adb509f6b04d8bc2eddbb3a
blink::TrialTokenValidator::SetOriginTrialPolicyGetter(
base::BindRepeating([]() -> blink::OriginTrialPolicy* {
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
index 5450eb6ba565164953b778f861d8fc75a06b6115..3f15d5a83d6e8011da09da178a0a9dfd2dd95d30 100644
index a687861c04b323102a8d2bfe22b24a964793cd9b..4a7a469111eaec3e1e76ee852bd5afbbc0da2956 100644
--- a/content/public/app/content_main_delegate.cc
+++ b/content/public/app/content_main_delegate.cc
@@ -5,6 +5,7 @@
@@ -69,7 +69,7 @@ index 5450eb6ba565164953b778f861d8fc75a06b6115..3f15d5a83d6e8011da09da178a0a9dfd
#include "build/build_config.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
@@ -83,6 +84,10 @@ absl::optional<int> ContentMainDelegate::PostEarlyInitialization(
@@ -87,6 +88,10 @@ absl::optional<int> ContentMainDelegate::PostEarlyInitialization(
return absl::nullopt;
}
@@ -81,7 +81,7 @@ index 5450eb6ba565164953b778f861d8fc75a06b6115..3f15d5a83d6e8011da09da178a0a9dfd
return new ContentClient();
}
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
index f40146c4ed20e63dd09450e43c26736171f02ed4..5e3246a1346bd0210e7b83842a17dcc1986c8647 100644
index 8420d43b88bc7187d8e0701dd58a5de07366a5c6..5572fad8219ae2c72f7c636b8b86c0b64cf75411 100644
--- a/content/public/app/content_main_delegate.h
+++ b/content/public/app/content_main_delegate.h
@@ -9,6 +9,7 @@
@@ -92,7 +92,7 @@ index f40146c4ed20e63dd09450e43c26736171f02ed4..5e3246a1346bd0210e7b83842a17dcc1
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "content/public/common/main_function_params.h"
@@ -154,6 +155,8 @@ class CONTENT_EXPORT ContentMainDelegate {
@@ -165,6 +166,8 @@ class CONTENT_EXPORT ContentMainDelegate {
virtual bool ShouldHandleConsoleControlEvents();
#endif
@@ -102,10 +102,10 @@ index f40146c4ed20e63dd09450e43c26736171f02ed4..5e3246a1346bd0210e7b83842a17dcc1
friend class ContentClientCreator;
friend class ContentClientInitializer;
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index 5530d975303cc96701e4b70ffbcaf6e7c02bb016..edd9959cc0fd23711e19de4aee104199a8a3599e 100644
index 67d3be89ac776ebc39c245641f9fbb4e9dd5e03d..1e88f4034ef2b72b2373e17c607b9e38bf24863b 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -496,8 +496,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
@@ -495,8 +495,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
@@ -115,7 +115,7 @@ index 5530d975303cc96701e4b70ffbcaf6e7c02bb016..edd9959cc0fd23711e19de4aee104199
if (g_mapped_snapshot) {
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
// files in a process.
@@ -506,10 +505,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
@@ -505,10 +504,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
base::MemoryMappedFile::Region file_region;
base::File file =
@@ -135,7 +135,7 @@ index 5530d975303cc96701e4b70ffbcaf6e7c02bb016..edd9959cc0fd23711e19de4aee104199
void V8Initializer::LoadV8SnapshotFromFile(
base::File snapshot_file,
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
index 13a120c7fe8e69a44793473f3124c33d572a07a3..acb294780873c1d84546eb2b9acc00f86838361d 100644
index dd9899c3e0dbadfc0074ffce87d51193e1c963cb..25c747ee645d845a0abfaf63cc66595319df4b51 100644
--- a/gin/v8_initializer.h
+++ b/gin/v8_initializer.h
@@ -9,6 +9,7 @@

View File

@@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 2754f849a4a8cdd23956ef8e49b8025c6528a218..76bef9239dcbe93300143bd2b6960beef0d38392 100644
index 15cf2ff03d50c10ab2423e326f8ac26585c67077..15542659edd07eaee42629ac9011524908835733 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1670,6 +1670,28 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1676,6 +1676,28 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
loader_factory_bundle_info =
context()->loader_factory_bundle_for_update_check()->Clone();
@@ -40,7 +40,7 @@ index 2754f849a4a8cdd23956ef8e49b8025c6528a218..76bef9239dcbe93300143bd2b6960bee
if (base::FeatureList::IsEnabled(
features::kEnableServiceWorkersForChromeUntrusted) &&
scope.scheme_piece() == kChromeUIUntrustedScheme) {
@@ -1690,9 +1712,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1696,9 +1718,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
browser_context(), scope_origin)) {
config->RegisterURLDataSource(browser_context());

View File

@@ -17,7 +17,7 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index fe8d191217e24b08d36339dbf047beaeb6bd6538..870db0552544e3e89d9498c22ec3db81b46df741 100644
index 2c0cc8d12b2e7987034fde9819e34b801549878d..c6353228eb5e5c720518d9c7a647349fcc617e05 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -891,10 +891,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {

View File

@@ -8,7 +8,7 @@ Subject: desktop_media_list.patch
* Ensure "OnRefreshComplete()" even if there are no items in the list
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
index f16b2dae4dc5c6c0377400a51302bbb34ec5e485..8aba5333fb046e3f2650ce3a63479bd6afc931aa 100644
index 2892ec2c97b6a49b696f155780900e5c4654b051..c559ad5e07344281e61148eff3b63a131144fed2 100644
--- a/chrome/browser/media/webrtc/desktop_media_list.h
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
@@ -107,7 +107,8 @@ class DesktopMediaList {
@@ -22,7 +22,7 @@ index f16b2dae4dc5c6c0377400a51302bbb34ec5e485..8aba5333fb046e3f2650ce3a63479bd6
virtual int GetSourceCount() const = 0;
virtual const Source& GetSource(int index) const = 0;
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
index 62156d9c7fe3908d330807a0642a9e9e04e2cae0..736cf6dfe45046d0a177a915dd599e6163137389 100644
index c49e83d5ea1e8425156f0be482ec9061544db9bd..549e5a3a900c8aca83e64ea000a13e8377d28227 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
@@ -69,12 +69,12 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
@@ -41,7 +41,7 @@ index 62156d9c7fe3908d330807a0642a9e9e04e2cae0..736cf6dfe45046d0a177a915dd599e61
int DesktopMediaListBase::GetSourceCount() const {
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
index 7d8f137be2d337a0069b0fbf890ef04741d986ec..e8de4f72d819ab55a78a1b1a86f522dac6b5a7a6 100644
index 202cfa1df6a540fb6e13ef06b43bdabba5535599..94ed6bf35606fe22c4c58cbb4ed6668f84247d52 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
@@ -39,7 +39,7 @@ class DesktopMediaListBase : public DesktopMediaList {
@@ -54,10 +54,10 @@ index 7d8f137be2d337a0069b0fbf890ef04741d986ec..e8de4f72d819ab55a78a1b1a86f522da
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/fake_desktop_media_list.cc b/chrome/browser/media/webrtc/fake_desktop_media_list.cc
index 196a49e70a2aaae4e3dc456e9bc00e878d577750..f1ea9ee497d538f2802103d8cc58dd102e088676 100644
index 1b977da7ff9e2ac86ce131da0dd0c6f3b6a69448..f94b818d3de71cb9a5521186611452c086d56608 100644
--- a/chrome/browser/media/webrtc/fake_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/fake_desktop_media_list.cc
@@ -77,7 +77,8 @@ void FakeDesktopMediaList::StartUpdating(DesktopMediaListObserver* observer) {
@@ -79,7 +79,8 @@ void FakeDesktopMediaList::StartUpdating(DesktopMediaListObserver* observer) {
thumbnail_ = gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
}
@@ -68,10 +68,10 @@ index 196a49e70a2aaae4e3dc456e9bc00e878d577750..f1ea9ee497d538f2802103d8cc58dd10
}
diff --git a/chrome/browser/media/webrtc/fake_desktop_media_list.h b/chrome/browser/media/webrtc/fake_desktop_media_list.h
index 0f3bc1477387ea24f20647dc668ed82ce7e609b0..a791ff38795392b32e7cfcacd646bb68fe4cf9e5 100644
index 33ca7a53dfb6d2c9e3a33f0065a3acd806e82e01..9fdf2e8ff0056ff407015b914c6b03eb6e25e0e4 100644
--- a/chrome/browser/media/webrtc/fake_desktop_media_list.h
+++ b/chrome/browser/media/webrtc/fake_desktop_media_list.h
@@ -32,7 +32,8 @@ class FakeDesktopMediaList : public DesktopMediaList {
@@ -40,7 +40,8 @@ class FakeDesktopMediaList : public DesktopMediaList {
void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
void StartUpdating(DesktopMediaListObserver* observer) override;
@@ -82,21 +82,19 @@ index 0f3bc1477387ea24f20647dc668ed82ce7e609b0..a791ff38795392b32e7cfcacd646bb68
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 9cc555065bde14bbbed57112ce09a02768bfc38c..67fe851eb2cf014e6a4e7d4b99499ca4d943291e 100644
index 4da983eee1abad065dd8a76a7efd308ef5897a09..5c34fda5db161ad1e563a953995bfe06f902b53f 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -141,8 +141,9 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
#endif // BUILDFLAG(IS_WIN)
@@ -142,7 +142,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
#if BUILDFLAG(IS_MAC)
+// Refs https://github.com/electron/electron/pull/30507
const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kWindowCaptureMacV2,
"WindowCaptureMacV2",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
#endif
} // namespace
@@ -440,6 +441,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
@@ -452,6 +452,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
FROM_HERE,
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
media_list_));
@@ -106,7 +104,7 @@ index 9cc555065bde14bbbed57112ce09a02768bfc38c..67fe851eb2cf014e6a4e7d4b99499ca4
}
void NativeDesktopMediaList::Worker::OnCaptureResult(
@@ -748,6 +752,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
@@ -824,6 +827,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
base::Unretained(worker_.get()),
std::move(native_ids), thumbnail_size_));

View File

@@ -15,10 +15,10 @@ the redraw locking mechanism, which fixes these issues. The electron issue
can be found at https://github.com/electron/electron/issues/1821
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index ee704693b5bd303e7093b943a26ada8ef4acdbf9..eb6dcd91c18902c6309553e0073e49cf517dcc7a 100644
index ec39cb0d15c80f051e89bf4d0f05368dff897fa7..472090adb19411366c50ed8e5a2f1276bc0a47eb 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -310,6 +310,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -311,6 +311,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
} // namespace
@@ -29,7 +29,7 @@ index ee704693b5bd303e7093b943a26ada8ef4acdbf9..eb6dcd91c18902c6309553e0073e49cf
// A scoping class that prevents a window from being able to redraw in response
// to invalidations that may occur within it for the lifetime of the object.
//
@@ -360,7 +364,8 @@ class HWNDMessageHandler::ScopedRedrawLock {
@@ -361,7 +365,8 @@ class HWNDMessageHandler::ScopedRedrawLock {
hwnd_(owner_->hwnd()),
cancel_unlock_(false),
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
@@ -39,7 +39,7 @@ index ee704693b5bd303e7093b943a26ada8ef4acdbf9..eb6dcd91c18902c6309553e0073e49cf
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
!ui::win::IsAeroGlassEnabled())) {
if (should_lock_)
@@ -1056,6 +1061,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
@@ -1057,6 +1062,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
return scoped_enable;
}
@@ -51,7 +51,7 @@ index ee704693b5bd303e7093b943a26ada8ef4acdbf9..eb6dcd91c18902c6309553e0073e49cf
// HWNDMessageHandler, gfx::WindowImpl overrides:
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 3344a25c7e14998d27a5e50e479b43e924463ba1..6397495f3a4144ee39abde7a8473c31e0bf1b297 100644
index e93d1727cbd8263d3b68e539856a577585a6092c..6d0adb7b5febc5625073312e7f1d557f89927ac8 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -210,6 +210,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
@@ -64,7 +64,7 @@ index 3344a25c7e14998d27a5e50e479b43e924463ba1..6397495f3a4144ee39abde7a8473c31e
HICON GetDefaultWindowIcon() const override;
HICON GetSmallWindowIcon() const override;
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
index d8e0f1d3131aef80c9fcb6069df7d7f986af6605..5dbb192d0840ca0ded61397c399b774a8cb05cce 100644
index 08e46c7b92f6cbe95c9cb524d09a6ed9e89ecf00..233dd12f86c20a7f5169caab998993f614e8bc7e 100644
--- a/ui/views/win/hwnd_message_handler_delegate.h
+++ b/ui/views/win/hwnd_message_handler_delegate.h
@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {

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 5542037a338e34800d86c3ca9cbaf0511fa60570..e5011a2b9d2127c1e17730db54f9574f1ed1d287 100644
index d129d26e2ee18a30aa44c7f9c2ba3af2d12dca6a..06867e89b6a0a73dc7d8f4060b366a8b43dd5525 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1873,6 +1873,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -1890,6 +1890,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
gfx::ContentColorUsage content_color_usage) const {
TargetColorParams params;
@@ -35,10 +35,10 @@ index 5542037a338e34800d86c3ca9cbaf0511fa60570..e5011a2b9d2127c1e17730db54f9574f
// 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 809fb46cc34db308e0ec73197859045ba639407c..9360695cd920de372529206212f795f299405fcf 100644
index d9b3e3cbeb7fcf2dc410245167ccffa4828ae5b8..540ec189f33ad35aaae612e11cf5fc18a746f4b6 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -93,6 +93,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -96,6 +96,8 @@ class CC_EXPORT LayerTreeSettings {
bool use_rgba_4444 = false;
bool unpremultiply_and_dither_low_bit_depth_tiles = false;
@@ -48,7 +48,7 @@ index 809fb46cc34db308e0ec73197859045ba639407c..9360695cd920de372529206212f795f2
// Image Decode Service and raster tiles without images until the decode is
// ready.
diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h
index bc48a50a7664f12a454997db54d893cde9b04881..810a8ce52bf9ac74f47a710f8b332980754996f5 100644
index 893291f2c79dd921d03785bbef2eb4b1de1f3638..217f3efc64f55506d8dc6548c10830b38d5f5940 100644
--- a/components/viz/common/display/renderer_settings.h
+++ b/components/viz/common/display/renderer_settings.h
@@ -24,6 +24,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
@@ -60,7 +60,7 @@ index bc48a50a7664f12a454997db54d893cde9b04881..810a8ce52bf9ac74f47a710f8b332980
bool force_antialiasing = false;
bool force_blending_with_shaders = false;
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
index 9d34ced366026eb7cdd00ce40a4eb1af56180d39..abf67f8246bfa37df08cd2216c388dd316fb6499 100644
index 5ca2e3b7999fb0c8da4953c6a20352a4b9de675d..86b4f9d2d1882e5706fd559e01442b02f629bda9 100644
--- a/components/viz/host/renderer_settings_creation.cc
+++ b/components/viz/host/renderer_settings_creation.cc
@@ -17,6 +17,7 @@
@@ -81,10 +81,10 @@ index 9d34ced366026eb7cdd00ce40a4eb1af56180d39..abf67f8246bfa37df08cd2216c388dd3
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 510c2bb4c8a859a36605eb4dbfc5b5ce11a9334d..b685b682ee12861b8e9de0bfa83d2ad054a11898 100644
index f52718f68a21d257fd51fcad6b8fef94cd339673..e4e8885b53ec990729e2ca38cdab5757af4cd1dc 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -224,6 +224,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -230,6 +230,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
// Command-line switches to propagate to the GPU process.
static const char* const kSwitchNames[] = {
@@ -93,10 +93,10 @@ index 510c2bb4c8a859a36605eb4dbfc5b5ce11a9334d..b685b682ee12861b8e9de0bfa83d2ad0
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 57639004908694d5d4a247ee23446b05b9ac0b14..dfd588523ec35d59f6b44610f6eee0416b983f83 100644
index d0b9284fcd1120722b751a462f7018353e7b07c3..6c6a50e6f5f78a5e1caaf539bde4893b4a8bd0a8 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -199,6 +199,7 @@
@@ -200,6 +200,7 @@
#include "ui/accessibility/accessibility_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/display/display_switches.h"
@@ -104,7 +104,7 @@ index 57639004908694d5d4a247ee23446b05b9ac0b14..dfd588523ec35d59f6b44610f6eee041
#include "ui/gl/gl_switches.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -3206,6 +3207,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3231,6 +3232,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[] = {
@@ -113,7 +113,7 @@ index 57639004908694d5d4a247ee23446b05b9ac0b14..dfd588523ec35d59f6b44610f6eee041
sandbox::policy::switches::kDisableSeccompFilterSandbox,
sandbox::policy::switches::kNoSandbox,
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..35b0bb908245330fbdc5205caa3299bf6fd8f7b4 100644
index 318005b66e04ed03ce6d44931d9360c0e009cb94..0d622fddb95720141ccf8a285ace47142060c9d1 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
@@ -4,6 +4,7 @@
@@ -156,10 +156,10 @@ index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..35b0bb908245330fbdc5205caa3299bf
}
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 ba6ab6961dec25a3f9c572341d24f341c8f58358..ba8cfd2a2572368fc14073a53f8544f269089894 100644
index 191a45bd3844d3b1ea652e7df164d7b7c11767da..754998229bb1fb92ac8cbf783839a60b92db0320 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
@@ -24,6 +24,7 @@
@@ -25,6 +25,7 @@
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"
@@ -167,7 +167,7 @@ index ba6ab6961dec25a3f9c572341d24f341c8f58358..ba8cfd2a2572368fc14073a53f8544f2
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
@@ -178,6 +179,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
@@ -184,6 +185,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
@@ -178,7 +178,7 @@ index ba6ab6961dec25a3f9c572341d24f341c8f58358..ba8cfd2a2572368fc14073a53f8544f2
// is what the renderer uses if its not threaded.
settings.enable_checker_imaging =
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index 961b730933d285ccea7b81b8c21dd5bb0ecea56a..d6e536924f0b397d3e8808298d2b9fdd6025411f 100644
index d346af4fa91adfc2f031484252e4ae05435f94d7..88315bdf562451a2371e53d994bbb3821f357d0e 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -20,6 +20,7 @@
@@ -189,7 +189,7 @@ index 961b730933d285ccea7b81b8c21dd5bb0ecea56a..d6e536924f0b397d3e8808298d2b9fdd
namespace gfx {
@@ -142,6 +143,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
@@ -143,6 +144,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
// Common method used by IOSurfaceSetColorSpace and IOSurfaceCanSetColorSpace.
bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
const ColorSpace& color_space) {
@@ -204,7 +204,7 @@ index 961b730933d285ccea7b81b8c21dd5bb0ecea56a..d6e536924f0b397d3e8808298d2b9fdd
// Allow but ignore invalid color spaces.
if (!color_space.IsValid())
return true;
@@ -312,6 +321,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
@@ -313,6 +322,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
DCHECK_EQ(kIOReturnSuccess, r);
}
@@ -221,7 +221,7 @@ index 961b730933d285ccea7b81b8c21dd5bb0ecea56a..d6e536924f0b397d3e8808298d2b9fdd
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index 0e8044c6d87008c51fd165c6ef8bdc3687d6cc29..78015868927602b5225f252f0a9182f61b8431dc 100644
index 3efe109c57d7cdf2979bfd97d26ff351b48158f6..d549cb67409425238cf7cae57a34339650584fb7 100644
--- a/ui/gfx/switches.cc
+++ b/ui/gfx/switches.cc
@@ -11,6 +11,8 @@ namespace switches {
@@ -234,7 +234,7 @@ index 0e8044c6d87008c51fd165c6ef8bdc3687d6cc29..78015868927602b5225f252f0a9182f6
// sharpness, kerning, hinting and layout.
const char kDisableFontSubpixelPositioning[] =
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
index e8e5d44e246364dd45594efb442c129676c14270..252096ee18ca33f4b98f68beb1f534e1c2ab805e 100644
index 96563c15f0849dfced900435e8eb20db4d50bc0d..01e6a4954866cdcdc9e8a2e05c092e059b05426b 100644
--- a/ui/gfx/switches.h
+++ b/ui/gfx/switches.h
@@ -12,6 +12,7 @@

View File

@@ -6,10 +6,10 @@ 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 e0168e7cf64a783a96aa4e43fa3a80bfbbe1fbac..5812734dbc86831e4c7611319647225732b483ea 100644
index a420b3cf9b1c325967318db322d61c4ebc4cf7c6..c5bc07973bba93aff7837cea92895e2ef7dff897 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -524,7 +524,11 @@
@@ -525,7 +525,11 @@
return;
host()->WasHidden();

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 c00f1b3d1bde2c1bcc201e6580b8f6151e09af0c..bc33814fb82632c0956f057a4e91fd29c45c9d40 100644
index f2bdea351833b9c49b2f6fb1a9badfc83c07dbb1..ed7b55da2ba31391d2840ef704159f59c26b92e3 100644
--- a/content/renderer/render_process_impl.cc
+++ b/content/renderer/render_process_impl.cc
@@ -226,6 +226,9 @@ RenderProcessImpl::RenderProcessImpl()
@@ -228,6 +228,9 @@ RenderProcessImpl::RenderProcessImpl()
SetV8FlagIfNotFeature(features::kWebAssemblyDynamicTiering,
"--no-wasm-dynamic-tiering");
@@ -27,4 +27,4 @@ index c00f1b3d1bde2c1bcc201e6580b8f6151e09af0c..bc33814fb82632c0956f057a4e91fd29
+
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
if (command_line->HasSwitch(switches::kEnableCrashpad) ||
base::CommandLine* const command_line =

View File

@@ -6,10 +6,10 @@ 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 93c985bbfc6048047a5d3b5a7a9dc7e83ed82391..47c25cf13a76de1c04624fff5e3773c05809b0a1 100644
index ff4e181fae1849772b699bf83e0f7e9556dbd71e..84b3bcbfb4f52098efad6f2b8ab8e8445d8fe13a 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -812,6 +812,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -824,6 +824,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
return;
@@ -20,12 +20,12 @@ index 93c985bbfc6048047a5d3b5a7a9dc7e83ed82391..47c25cf13a76de1c04624fff5e3773c0
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 1301db91b45b5cde376835f2d4caaea92a26556e..31f37242c8a833065fd5e11b7b25e09005fb30c1 100644
index 6ea55a22496a5186513963d06fa700cb82758177..bbcff3ff49234e2f6b9fcdaa1409678189d91b67 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -885,6 +885,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
SiteInstanceGroup* GetSiteInstanceGroup();
@@ -894,6 +894,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
cc::BrowserControlsState current,
bool animate);
+ // Electron: Prevents the widget from getting hidden.
+ bool disable_hidden_ = false;
@@ -34,10 +34,10 @@ index 1301db91b45b5cde376835f2d4caaea92a26556e..31f37242c8a833065fd5e11b7b25e090
// |routing_id| must not be MSG_ROUTING_NONE.
// If this object outlives |delegate|, DetachDelegate() must be called when
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index b9a9aefe1eb1acaf0aeedda2e1945c5ab0219684..06501c3703c68e15d127609a34c4026d10964e31 100644
index 8b712a21e7ee1d2375c28af6a2f8d7279220138c..96c24edf6e4044a3ced0a87ecbd7a56f36f5d3d3 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -602,7 +602,7 @@ void RenderWidgetHostViewAura::HideImpl() {
@@ -604,7 +604,7 @@ void RenderWidgetHostViewAura::HideImpl() {
DCHECK(visibility_ == Visibility::HIDDEN ||
visibility_ == Visibility::OCCLUDED);

View File

@@ -1,59 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <jkleinsc@electronjs.org>
Date: Thu, 1 Sep 2022 11:31:24 -0400
Subject: disable optimization guide for preconnect feature
The optimization guide component
(https://source.chromium.org/chromium/chromium/src/+/main:components/optimization_guide/)
is not enabled for Electron, but the preconnect feature uses the resource prefetch
predictor code which includes this component. This patch disables the optimization guide
component code in the resource prefetch predictor code since it is unused and including
it causes compilation problems on Windows.
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
index c4b64a7812bac4534371887eb7e0a07ec9cab8ff..b827d69964d824540ea70f66c467e91be8391e6c 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -100,10 +100,12 @@ PreconnectPrediction& PreconnectPrediction::operator=(
PreconnectPrediction& PreconnectPrediction::operator=(
PreconnectPrediction&& other) = default;
+#if 0
OptimizationGuidePrediction::OptimizationGuidePrediction() = default;
OptimizationGuidePrediction::OptimizationGuidePrediction(
const OptimizationGuidePrediction& prediction) = default;
OptimizationGuidePrediction::~OptimizationGuidePrediction() = default;
+#endif
////////////////////////////////////////////////////////////////////////////////
// ResourcePrefetchPredictor static functions.
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index 53a23990019accc0504a25dae935c53348c7eaa7..ef6667ce8bbc062dbfb8d2e2cdb6886b3e994b76 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -26,7 +26,9 @@
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
#include "components/keyed_service/core/keyed_service.h"
+#if 0
#include "components/optimization_guide/content/browser/optimization_guide_decider.h"
+#endif
#include "components/sqlite_proto/key_value_data.h"
#include "net/base/network_isolation_key.h"
#include "services/network/public/mojom/fetch_api.mojom-forward.h"
@@ -110,6 +112,7 @@ struct PreconnectPrediction {
std::vector<PrefetchRequest> prefetch_requests;
};
+#if 0
// Stores a result of a prediction from the optimization guide.
struct OptimizationGuidePrediction {
OptimizationGuidePrediction();
@@ -121,6 +124,7 @@ struct OptimizationGuidePrediction {
std::vector<GURL> predicted_subresources;
absl::optional<base::TimeTicks> optimization_guide_prediction_arrived;
};
+#endif
// Contains logic for learning what can be prefetched and for kicking off
// speculative prefetching.

View File

@@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we
should continue seeking for a real fix.
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
index 8739003ce80baefc904dd2d20df81b62855b482b..89a0c653fdbe7f3ae51844ec93d8c2e062a6bcd1 100644
index 30ea1ea16adeef33ed6831de1b92cece90a370d2..1dd9657c567380e895a1decf8e549ebc6dbc4e95 100644
--- a/content/browser/renderer_host/navigator.cc
+++ b/content/browser/renderer_host/navigator.cc
@@ -1223,6 +1223,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1240,6 +1240,7 @@ void Navigator::RecordNavigationMetrics(
.InMilliseconds());
}
@@ -35,7 +35,7 @@ index 8739003ce80baefc904dd2d20df81b62855b482b..89a0c653fdbe7f3ae51844ec93d8c2e0
// If this is a same-process navigation and we have timestamps for unload
// durations, fill those metrics out as well.
if (params.unload_start && params.unload_end &&
@@ -1273,6 +1274,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1290,6 +1291,7 @@ void Navigator::RecordNavigationMetrics(
first_before_unload_start_time)
.InMilliseconds());
}

View File

@@ -17,7 +17,7 @@ as well as keeps these storage areas limited to a bounded
size meanwhile giving application developers more space to work with.
diff --git a/components/services/storage/dom_storage/dom_storage_constants.cc b/components/services/storage/dom_storage/dom_storage_constants.cc
index 3fd108c89c3b070a08790850db4dfd6cc8a3ce44..c393f51709efd8b28b07edfe452d2b84b14983ae 100644
index aa5edd1d07d97bee4912b14996ff804351240e94..8334b7eb6a3293c068f5234508f8dca780ccb262 100644
--- a/components/services/storage/dom_storage/dom_storage_constants.cc
+++ b/components/services/storage/dom_storage/dom_storage_constants.cc
@@ -6,7 +6,9 @@
@@ -32,7 +32,7 @@ index 3fd108c89c3b070a08790850db4dfd6cc8a3ce44..c393f51709efd8b28b07edfe452d2b84
} // namespace storage
diff --git a/third_party/blink/public/mojom/dom_storage/storage_area.mojom b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
index adbb73ef9c5a5a59fd0bfe0137d0dc9219d376e9..7e1e10faba4263d8ec1afefdebb3202da1944d34 100644
index 332be0811d86c7a265f440ab7719460160a22617..e3382d843599ef6017e0ac557919b3a41809f17d 100644
--- a/third_party/blink/public/mojom/dom_storage/storage_area.mojom
+++ b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
@@ -50,7 +50,8 @@ struct KeyValue {

View File

@@ -1,81 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <jkleinsc@electronjs.org>
Date: Wed, 16 Jun 2021 11:30:28 -0400
Subject: Don't run PCScan functions if PCScan is disabled
PCScan should not be invoked if PCScan is disabled.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/2965109.
diff --git a/base/allocator/partition_allocator/memory_reclaimer.cc b/base/allocator/partition_allocator/memory_reclaimer.cc
index 0d480d11d5d51fa72639d346448ec22f2f6b9621..d6ea0053cee3dcd5ba1ef79c52b82c858876e337 100644
--- a/base/allocator/partition_allocator/memory_reclaimer.cc
+++ b/base/allocator/partition_allocator/memory_reclaimer.cc
@@ -70,7 +70,7 @@ void MemoryReclaimer::Reclaim(int flags) {
//
// Lastly decommit empty slot spans and lastly try to discard unused pages at
// the end of the remaining active slots.
-#if PA_STARSCAN_ENABLE_STARSCAN_ON_RECLAIM && BUILDFLAG(STARSCAN)
+#if PA_STARSCAN_ENABLE_STARSCAN_ON_RECLAIM && defined(PA_ALLOW_PCSCAN)
{
using PCScan = internal::PCScan;
const auto invocation_mode = flags & PurgeFlags::kAggressiveReclaim
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index 714232b0c2707d6c256e634ff784c18322bf0a85..48c8d0051c427954fe7265fee9cd0c6b5f473984 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -44,6 +44,7 @@
#endif
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#include "base/allocator/partition_allocator/partition_alloc_config.h"
#include "base/allocator/partition_allocator/starscan/pcscan.h"
#include "base/allocator/partition_allocator/starscan/stack/stack.h"
#endif
@@ -77,7 +78,7 @@ void* ThreadFunc(void* params) {
base::DisallowSingleton();
#if !BUILDFLAG(IS_NACL)
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && defined(PA_ALLOW_PCSCAN)
partition_alloc::internal::PCScan::NotifyThreadCreated(
partition_alloc::internal::GetStackPointer());
#endif
@@ -104,7 +105,7 @@ void* ThreadFunc(void* params) {
PlatformThread::CurrentHandle().platform_handle(),
PlatformThread::CurrentId());
-#if !BUILDFLAG(IS_NACL) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if !BUILDFLAG(IS_NACL) && BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && defined(PA_ALLOW_PCSCAN)
partition_alloc::internal::PCScan::NotifyThreadDestroyed();
#endif
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index 960d0100e1857592ee24b2da22e0253ab06098c1..dca9fb72fb69386ffb0910e13f841fa698250b66 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -30,6 +30,7 @@
#include <windows.h>
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#include "base/allocator/partition_allocator/partition_alloc_config.h"
#include "base/allocator/partition_allocator/starscan/pcscan.h"
#include "base/allocator/partition_allocator/starscan/stack/stack.h"
#endif
@@ -115,7 +116,7 @@ DWORD __stdcall ThreadFunc(void* params) {
FALSE,
DUPLICATE_SAME_ACCESS);
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && defined(PA_ALLOW_PCSCAN)
partition_alloc::internal::PCScan::NotifyThreadCreated(
partition_alloc::internal::GetStackPointer());
#endif
@@ -136,7 +137,7 @@ DWORD __stdcall ThreadFunc(void* params) {
PlatformThread::CurrentId());
}
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
+#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && defined(PA_ALLOW_PCSCAN)
partition_alloc::internal::PCScan::NotifyThreadDestroyed();
#endif

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