Compare commits

..

331 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
d3b678a03e Bump v21.0.0 2022-09-26 11:02:36 -07:00
trop[bot]
7bf3913bf3 feat: add support for Web Bluetooth pin pairing (#35818)
* feat: add bluetooth pairing handler

* Update docs/api/session.md

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

* Update docs/api/session.md

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

* docs: update based on review

* Apply suggestions from code review

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update docs per review

* chore: cleanup callback per review

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-09-26 13:29:38 -04:00
trop[bot]
c97955017d feat: add app.getSystemLocale() method (#35794)
* feat: add app.getSystemLocale() method

* Update shell/browser/electron_browser_main_parts.cc

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

* Change methods to be const

* Apply PR feedback

* Fix mac compile

* Add missing scope

* Apply style changes

* Change note

* Add braces to get the comment indentation right

* Change to static

* Apply PR feedback

* Fix the documentation

* Remove extraneous file

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-09-26 10:07:06 -07:00
trop[bot]
587abcc0a3 build: fix major dependencies update workflow file (#35817)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-09-26 12:51:23 -04:00
trop[bot]
6e2d2d8d73 fix: potential exception when calling webFrameMainBinding.fromIdOrNull() (#35803)
* fix: potential exception when calling webFrameMainBinding.fromIdOrNull()

* replace try/catch in getWebFrameForEvent

Co-authored-by: Milan Burda <miburda@microsoft.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-09-26 08:50:42 -07:00
trop[bot]
f1e4cfaca3 build: remove unused GitHub app config file (#35814)
chore: remove unused GitHub action config file

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-09-26 11:29:01 -04:00
Sudowoodo Release Bot
9c3d32a0d3 Revert "Bump v21.0.0-beta.9"
This reverts commit 015be48573.
2022-09-26 06:34:17 -07:00
Sudowoodo Release Bot
015be48573 Bump v21.0.0-beta.9 2022-09-26 06:30:56 -07:00
trop[bot]
9631cee679 feat: allow custom v8 snapshots to be used in the main process and the default snapshot in the renderer process (#35695)
* feat: allow custom v8 snapshots to be used in the main process and the default snapshot in the renderer process (#35266)

* Updates to allow for using a custom v8 snapshot file name

* Allow using a custom v8 snapshot file name

* Fix up patch due to merge

* Use fuse to set up custom v8 snapshot file in browser process

* Refactor to use delegate instead of command line parameter

* Refactoring

* Update due to merge

* PR comments

* Rename patch

* Rename patch

* chore: update patches

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-09-24 12:31:53 -07:00
trop[bot]
0a4b160328 fix: allow docking DevTools with WCO (#35765)
fix: allow for docking devtools with WCO

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-09-23 12:40:47 -07:00
trop[bot]
f3667073e8 docs: update the link for Introduction to Node.js (#35771)
Updated the link for Introduction to NodeJs

Co-authored-by: Aman Gupta <techbugaman@gmail.com>
2022-09-23 11:44:27 -07:00
trop[bot]
3f10c4d1f8 docs: changed event.data to data under the message.port in docs (#35782)
* docs: changed event.data to data under the message.port in docs

* docs: corrected BrowserWindow wrong usage and change window.messagePort to window.electronMessagePort

Co-authored-by: cyrilchukwuebuka <muofunanya3@gmail.com>
2022-09-23 11:35:13 -07:00
electron-roller[bot]
46c473930e chore: bump chromium to 106.0.5249.51 (21-x-y) (#35768)
* chore: bump chromium in DEPS to 106.0.5249.51

* 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-09-22 22:18:19 +02:00
trop[bot]
38bb3e81d3 fix: compensate for title bar height when setting bounds on BrowserView (#35502)
fix: compensate for title bar height when setting bounds

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-09-22 10:01:11 -07:00
Sudowoodo Release Bot
3dd6c6886b Bump v21.0.0-beta.8 2022-09-22 06:30:57 -07:00
trop[bot]
248ae5dc43 docs: add forge-overview.md (#35759) 2022-09-22 11:56:27 +02:00
trop[bot]
199ccfd840 docs: fix wording mistake in security.md section 4 (#35743)
docs: fix wording mistake in security.md section 4 (#35682)

Update security.md

Under "4. Process Sandboxing", it said "For mor information on what `contextIsolation` is..." which was the previous section (copied from there). This updates it to say "For more information on what Process Sandboxing is..."

Co-authored-by: Sebastian Vittersø <37065184+sebastianvitterso@users.noreply.github.com>
2022-09-21 16:12:40 -04:00
trop[bot]
0ced2338ea fix: crash loading non-standard schemes in iframes (#35517)
* fix: crash loading non-standard schemes in iframes

* test: move fixture to correct location

* chore: update patches

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-09-21 15:25:43 +02:00
trop[bot]
fc1d8a80e6 chore: add missing .eslintrc.json files to limit imports properly (#35747)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-09-20 22:04:31 -05:00
trop[bot]
f18485f8bf chore: fix ambiguous reference gcc compile error (#35734)
Co-authored-by: Bruno Pitrus <brunopitrus@hotmail.com>
2022-09-20 12:22:42 -05:00
trop[bot]
3437ffca8b fix: edge case in app.isInApplicationsFolder() (#35730)
fix: edge case in app.isInApplicationsFolder() (#35636)

* fix: edge case in IsInApplicationsFolder

* use realpath instead

* lint

* revert lowercasing

* optimize

* Update shell/browser/ui/cocoa/electron_bundle_mover.mm

* lint

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

Co-authored-by: Kishan Bagaria <hi@kishan.info>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-09-19 16:50:46 -04:00
trop[bot]
a1789897d3 fix: uv_os_gethostname failing on Windows 7 (libuv patch regression) (#35704)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-09-19 08:31:58 -07:00
trop[bot]
64b5d7be2e build: update .nvmrc Node.js version from 14 to 16 (#35700)
Update `.nvmrc` Node.js version from 14 to 16

The `DEPS` file states that Electron is on Node.js ^16.x. I am guessing that the PR bumping to Node.js 16 overlooked the `.nvmrc` file, which is updated in this PR. If leaving the `.nvmrc` file on 14 was intentional, please disregard this PR.

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2022-09-19 10:27:52 -04:00
Sudowoodo Release Bot
8b6b882487 Bump v21.0.0-beta.7 2022-09-19 06:30:51 -07:00
trop[bot]
99d9537ef7 build: fix building with enable_basic_printing false (#35693)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-09-15 15:20:47 -07:00
trop[bot]
b5cf0ad971 feat: webFrameMain.origin (#35534)
* feat: webFrameMain.origin

* add tests

* update docs

* fix spec

Co-authored-by: Jeremy Rose <japthorp@slack-corp.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-09-15 15:20:20 -07:00
trop[bot]
c5e920e361 build: make check-symlinks.js aware of BRANDING.json changes (#35669)
Right now the `check-symlinks.js` assumes that the branding product name
is "Electron". If users change `BRANDING.json` on custom builds, the
script will fail.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Co-authored-by: Juan Cruz Viotti <jv@jviotti.com>
2022-09-15 14:05:12 -07:00
Sudowoodo Release Bot
cb08a466ac Bump v21.0.0-beta.6 2022-09-15 13:31:46 -07:00
trop[bot]
afd392b921 docs: add back docs about asar archives (#35667)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-09-15 13:17:39 -07:00
Keeley Hammond
908751b4f1 chore: update filenames.libcxx.gni (#35689)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-09-15 13:17:05 -07:00
electron-roller[bot]
5e7ff852f3 chore: bump chromium to 106.0.5249.40 (21-x-y) (#35686)
* chore: bump chromium in DEPS to 106.0.5249.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-09-15 13:13:25 -07:00
trop[bot]
cbf5843c9a fix: WCO occlusion of DevTools (#35688)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-09-15 19:06:18 +02:00
Sudowoodo Release Bot
a2c687fcc3 Revert "Bump v21.0.0-beta.6"
This reverts commit b0b8fc2688.
2022-09-15 09:38:03 -07:00
Sudowoodo Release Bot
b0b8fc2688 Bump v21.0.0-beta.6 2022-09-15 06:30:59 -07:00
trop[bot]
12992b253c chore: make macOS spellchecker fns formal no-ops (#35679)
* chore: make macOS spellchecker fns formal no-ops

* docs: correct no-op note

* test: add no-op specs

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-09-14 16:53:53 -07:00
trop[bot]
8becf52f11 fix: allow maximizing when window enters tablet mode with WCO (#35664)
* fix: Backport CL 3753528 for WCO

* Update comment

* Update shell/browser/ui/views/win_caption_button_container.cc

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

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2022-09-14 02:29:38 -07:00
trop[bot]
fad97e0b06 docs: improve registerFileProtocol example (#35599)
docs: improve registerFileProtocol example (#35580)

* improve registerFileProtocol example

* link ProtocolResponse

* kick lint

Co-authored-by: Kishan Bagaria <hi@kishan.info>
2022-09-13 13:51:45 -07:00
trop[bot]
672464d900 docs: fix typescript error in code samples (#35656)
Fixed typescript error

Co-authored-by: Leon Schwanitz <leon@28minds.com>
2022-09-13 13:36:23 -07:00
electron-roller[bot]
aaf560817b chore: bump chromium to 106.0.5249.30 (21-x-y) (#35423) 2022-09-13 09:36:58 -07:00
trop[bot]
f9b2608f2c docs: update sandbox renderer defaults for Electron 20 (#35615)
docs: update sandbox renderer defaults for Electron 20 (#35379)

* docs: update E20 sandbox rendering defaults

* docs: update tutorial

* simplify paragraph

* dont mention context isolation

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-09-13 09:33:40 -07:00
trop[bot]
135c8c34ec fix: ensure history navigations are sandboxed-iframe-aware (#35623)
Co-authored-by: Jeremy Spiegel <jeremy.spiegel@frontapp.com>
2022-09-13 08:14:46 -07:00
trop[bot]
fb4990a537 docs: fix misspelling in fuses (#35620)
Co-authored-by: CanadaHonk <19228318+CanadaHonk@users.noreply.github.com>
2022-09-13 08:12:05 -07:00
trop[bot]
8ce7209b9b fix: potential "Object has been destroyed" error in BrowserWindow.getFocusedWindow (#35646)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-09-13 08:06:19 -07:00
trop[bot]
a1e792f48a docs: Use inline image link in faq.md (#35648)
* Use absolute URL in faq.md image link

The relative link is rendered relative to the host domain, which works fine when viewing it on Github, but since you also use the same generated HTML in your doc site, the link is broken. See here: https://www.electronjs.org/docs/latest/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do

Using an absolute URL here should fix the issue on the main site.

* Use inline image reference for subpixel rendering example

As suggested by @dsanders11

Co-authored-by: Adrian Petrescu <adrian@apetre.sc>
2022-09-13 08:04:49 -07:00
Sudowoodo Release Bot
91969330dd Bump v21.0.0-beta.5 2022-09-12 06:31:02 -07:00
trop[bot]
686a554c6a fix: Set background for WCO container (#35612)
* fix: Set background for WCO container

* Add background when invalidating as well

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2022-09-08 09:59:16 -07:00
Sudowoodo Release Bot
62b64e6e60 Bump v21.0.0-beta.4 2022-09-08 06:31:18 -07:00
trop[bot]
a5db8a3d53 fix: session.getBlobData never resolves with blob sizes > 65536 (#35602)
fix: session.getBlobData never resolves with blob sizes > 65536 (#35277)

* fix: session.getBlobData never resolves with blob sizes > 65536 (#34398)

* Add unit test case for session.getBlobData

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

Co-authored-by: Frank Pian <bianyongfang@vip.qq.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-09-08 06:46:39 -04:00
trop[bot]
85f93bc5bf docs: add fuses and asar integrity docs (#35596)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-09-07 14:07:58 -04:00
Sudowoodo Release Bot
605ee9e28a Bump v21.0.0-beta.3 2022-09-06 15:03:08 -07:00
Samuel Attard
e48878ea63 chore: cherry-pick 9b5207569882 from chromium (#35543)
* chore: cherry-pick 9b5207569882 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-09-06 10:27:46 -07:00
trop[bot]
e78aa6af16 fix: screen.getCursorScreenPoint() crash on Wayland (#35575)
fix: screen.getCursorScreenPoint() crash on Wayland

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-09-06 12:18:03 -04:00
Sudowoodo Release Bot
fb0bbf0100 Bump v21.0.0-beta.2 2022-09-01 06:31:01 -07:00
trop[bot]
5e8b4bd86f fix: crash when switching origins with emulation settings set (#35488)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-31 11:20:10 +09:00
Sudowoodo Release Bot
da47103ad7 Bump v21.0.0-beta.1 2022-08-30 10:11:56 -07:00
trop[bot]
7b62386296 fix: crash on WebWorker destruction (#35492)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-30 13:58:28 +02:00
trop[bot]
018bc0993e chore: use nghttp2's config.h on all platforms (#35487)
https://github.com/nodejs/node/pull/27283

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-30 10:57:32 +02:00
Sudowoodo Release Bot
f9b02358c6 Bump v21.0.0-alpha.6 2022-08-29 15:51:14 -07:00
trop[bot]
23aa6e5084 build: update libcxx filenames (#35497)
* build: update libcxx filenames

* build: change upload_to_storage variable

Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-08-29 15:50:06 -07:00
Sudowoodo Release Bot
65a2c18560 Revert "Bump v21.0.0-alpha.6"
This reverts commit c8b3e23f31.
2022-08-29 10:36:52 -07:00
Sudowoodo Release Bot
c8b3e23f31 Bump v21.0.0-alpha.6 2022-08-29 09:19:34 -07:00
trop[bot]
4ab9295e62 chore: delete implicit fallthrough patch (#35469)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-29 15:25:38 +02:00
trop[bot]
0e79733404 docs: update docs description to match sidebar (#35482)
Update introduction.md

Co-authored-by: Nik K <nk@nikk.ca>
2022-08-29 12:28:21 +02:00
trop[bot]
38d408a26b fix: pass rfh instances through to the permission helper (#35467)
* fix: pass rfh instances through to the permission helper

* refactor: use WeakDocumentPtr instead of frame node id

* fix: handle missing initiator document

* fix: dispatch openExternal event for top level webview navs still

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-08-29 09:52:53 +02:00
trop[bot]
0ad176fd13 fix: fullscreen crashing with roundedCorners: false (#35454)
fix: fullscreen crashing with roundedCorners

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-25 15:52:24 +02:00
trop[bot]
a3cfd1a206 fix: Node.js atob input validation (#35443)
fix: Node.js atob input validation

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-25 15:08:20 +02:00
trop[bot]
63fe34c703 build: fix export patches to work when source directory does not exist (#35437)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-08-25 10:18:11 +09:00
trop[bot]
c99a52eab4 chore: bump chromium to 106.0.5216.0 (21-x-y) (#35363)
* chore: bump chromium to 106.0.5216.0 (main) (#34993)

* Trigger Build

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-08-23 15:22:47 -04:00
trop[bot]
95eb6ea772 fix: undefined details.requestingUrl from session.setPermissionCheckHandler (#35409)
fix: undefined details.requestingUrl from setPermissionCheckHandler

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-08-23 10:27:14 -04:00
trop[bot]
8d6c29ecbc fix: add restore event for minimized maximization (#35410)
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
2022-08-23 14:39:46 +02:00
trop[bot]
637824e086 fix: promise support with webFrameMain.executeJavaScript (#35359)
* fix: promise support with webFrameMain.executeJavaScript

* chore: reject when result is an error

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-08-23 11:39:59 +02:00
trop[bot]
cb6fa8268f fix: ensure chrome colors are initialized (#35401)
* fix: ensure chrome colors are initialized

* build: fix linking on windows

* build: fix linking on windows

* build: add needed files to chromium_src/BUILD

Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2022-08-23 11:19:32 +02:00
Sudowoodo Release Bot
76e8536ca8 Bump v21.0.0-alpha.5 2022-08-22 16:25:16 -07:00
trop[bot]
b075434447 fix: IPC emit order in -ipc-ports handler (#35364)
Co-authored-by: Milan Burda <miburda@microsoft.com>
2022-08-18 18:00:45 -07:00
Sudowoodo Release Bot
9673d29ebe Bump v21.0.0-alpha.4 2022-08-18 12:05:12 -07:00
trop[bot]
5e6d152231 fix: don't bypass redirect checks (#35366)
Co-authored-by: Jeremy Rose <japthorp@slack-corp.com>
2022-08-18 10:09:18 -07:00
trop[bot]
b31a4b4394 fix: Frameless window shows frame while opening (#35353)
* fix: Frameless window shows frame while opening

* Clarify comments

* Inline setter

* Edit comment

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2022-08-17 15:20:20 -07:00
trop[bot]
28ca18a912 feat: add WebContents.ipc (#35231)
feat: add WebContents.ipc (#34959)

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-08-17 09:50:15 -07:00
trop[bot]
8caea9006a fix: add uv_loop_close when object release to fix crash (#35336)
Co-authored-by: yangzuohui <yangzuohui@bytedance.com>
2022-08-16 17:03:05 +09:00
trop[bot]
855536bcb9 refactor: simplify Browser::SetLoginItemSettings (#35329)
refactor: simplify Browser::SetLoginItemSettings

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-15 16:43:48 -04:00
trop[bot]
1978a0b5fe fix: serialPort.open() failing (#35339)
fix: serialPort.open() failing

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-15 13:53:00 -04:00
Sudowoodo Release Bot
fe70152b43 Bump v21.0.0-alpha.3 2022-08-15 08:42:41 -07:00
trop[bot]
9b38a25206 docs: add Electron deps to license credits file (#35332)
* docs: add Electron deps to license credits file

* fixup! docs: add Electron deps to license credits file

remove nan; it is dev-only

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-08-15 10:42:39 -04:00
trop[bot]
a66d3bf206 docs: removes unused import in preload script (#35334)
* Remove unused import of path

This import gives out the error in the preload script:

Error: module not found: path
    at preloadRequire

* Remove import path as it is not used in the script

note: Removes import path as it is not used in the script

Co-authored-by: Rhitik Bhatt <bhattrhitik95@gmail.com>
2022-08-15 17:06:50 +09:00
Sudowoodo Release Bot
752b10f16f Bump v21.0.0-alpha.2 2022-08-11 09:37:32 -07:00
trop[bot]
5803a67963 docs: fix getStoragePath return type (#35296)
Fixes #35255

Co-authored-by: Samuel Attard <sam@electronjs.org>
2022-08-10 22:42:17 +02:00
trop[bot]
40058af821 fix(docs): fix a typo in section on debugging with VSCode (#35285)
fix(docs): fix a typo

Co-authored-by: Trang Le <trang.thule@zoho.com>
2022-08-09 15:30:29 -07:00
trop[bot]
64b40ea69c docs: update tray docs with info for mac menubar icons (#35221)
Co-authored-by: Brad Carter <16466430+carterbs@users.noreply.github.com>
2022-08-09 09:01:10 +09:00
trop[bot]
7c6e16975f fix: app.relaunch loses args when execPath specified (#35254)
fix: app.relaunch loses args when execPath specified (#35108)

Co-authored-by: Aaron Meriwether <me@ameriwether.com>
2022-08-09 08:54:58 +09:00
trop[bot]
c9e7f33f7e test: temporarily disable tests on mas arm64 that are causing a crash (#35247)
* test: temporarily disable test on mas arm64 that is causing crash

* disable the right test

* chore: speculative fix for CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER crash

* enable all the tests

* Revert "chore: speculative fix for CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER crash"

This reverts commit b7c8ef364c.

* test: disable tests that crash on mas arm64

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-08-08 10:02:58 -04:00
Sudowoodo Release Bot
98aa0ef090 Bump v21.0.0-alpha.1 2022-08-03 07:37:56 -07:00
TAN
c47031a279 docs: Fix the URL bugs at tutorial-6-publishing-updating.md (#35175)
* Update tutorial-6-publishing-updating.md

The dot at the end of the URL will depend on the site that cannot open. Because it will open `https://update.electronjs.org./` which does not exist.

* docs: fix the URL problems at tutorial-6-publishing-updating.md

The dot at the end of the URL will depend on the site that cannot open. Because it will open `https://update.electronjs.org./` which does not exist.

* docs: fix the URL problems at tutorial-6-publishing-updating.md

* docs: fix the URL problems at tutorial-6-publishing-updating.md
2022-08-03 10:20:37 -04:00
Erick Zhao
74432a313c docs: fix link in tutorial (#35192)
Relands https://github.com/electron/electronjs.org-new/pull/240 upstream
2022-08-03 10:12:06 -04:00
Sudowoodo Release Bot
4e919c919c Bump v21.0.0-nightly.20220803 2022-08-03 06:01:39 -07:00
Maya Nedeljković Batić
fb39f241fb docs: update categories to match sidebar (#35196)
This page describes each of the categories available in the sidebar, but some of the category titles didn't match.
2022-08-03 12:03:45 +02:00
Cheng Zhao
afa4f5052b fix: consider dock space when showing menu (#35194) 2022-08-03 17:52:42 +09:00
msizanoen1
7b8fb2b074 fix: Wayland general CSD fixes (#34955)
* fix: broken wayland window decorations due to botched chromium update

The `GetTitlebarBounds().height()` is obviously intended to be placed in
the `top` parameter, which used to be the second one before upstream
removed multi-parameter `gfx::Rect::Inset`, but it's the first parameter
for `gfx::Insets::TLBR`, which was intended to replace the removed
`Inset` function. However, whoever updated Chromium kept the parameter
unchanged, causing the title bar height to be passed to the `left`
parameter, causing the window title bar to be unclickable.

* fix: wayland window top bar buttons unclickable

Use NonClientFrameView::TargetForRect for the ClientFrameViewLinux
implementation because the default inherited from FramelessView blocks
any non-HTCLIENT events.

* fix: add maximized parameter to LinuxUI::GetWindowFrameProvider

* fix: pass frame_->IsMaximized() to GetWindowFrameProvider

This ensures that the toolkit renders the window decorations in maximized mode
while the window is maximized to ensure that there is no empty space around the window.
2022-08-03 17:51:52 +09:00
Cheng Zhao
4e8480b15b chore: fix linking with component ffmpeg (#35178) 2022-08-03 16:51:30 +09:00
Keeley Hammond
3fe00d75e9 chore: update NMV for Electron 21 (#35124) 2022-08-02 12:57:42 -07:00
Jeremy Rose
3d4d1b33ba fix: fail non-fatally when InitLogging fails (#35138) 2022-08-02 15:45:30 -04:00
Robo
53cd23159e chore: remove unsupported skiptaskbar linux impl (#35179)
chore: unsupported skiptaskbar linux impl
2022-08-02 11:53:36 -07:00
Sudowoodo Release Bot
31be6ecf7b Bump v21.0.0-nightly.20220802 2022-08-02 06:01:38 -07:00
Robo
e3893632e7 fix: touch events not recognized by WCO on windows (#35117) 2022-08-02 12:13:58 +09:00
Michaela Laurencin
0cdc946b27 fix: modify file extension generation on Windows (#34723)
* fix: modify file extension generation on Windows

* modify includes

* include vector in header

* add win build flags

* remove hardcoded strings

* Update shell/browser/electron_download_manager_delegate.h

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

* fix string manipulation and function definitions

* Update electron_download_manager_delegate.h

* convert to std::string and modify for electron

* Update shell/browser/electron_download_manager_delegate.cc

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

* remove vector include and update conversion

* add vectr include for lint

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-08-02 09:40:17 +09:00
John Kleinschmidt
0d36c0cdc6 ci: turn off windows on arm test result comments (#35142) 2022-08-01 18:59:20 -04:00
Shelley Vohr
7588bb7425 fix: DCHECK entering fullscreen while loading url (#35111)
* fix: DCHECK entering fullscreen while loading url

* spec: fixup test
2022-08-01 16:52:58 -04:00
Keeley Hammond
6c17dd2296 fix: ensure native modules use the correct config (#35159)
* fix: ensure native modules are built with config.gypi

This works by patching node.h to check that two defines are set using the equivilant of an XNOR operation.  One define "ELECTRON_ENSURE_CONFIG_GYPI" is set via common.gypi which is _already_ used to build native modules and has been since the dawn of time.  Therefore this define will be set for all native module compilations targetting the Electron runtime.  The second define "USING_ELECTRON_CONFIG_GYPI" is only defined when the gypi argument "using_electron_config_gypi" is set to 1 which is only done so via config.gypi.  Only new enough versions of node-gyp correctly use the config.gypi file thus resulting in a compilation error on version of node-gyp that are too old.

* chore: fix lint

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-08-01 07:52:26 -07:00
Sudowoodo Release Bot
29434ee7c6 Bump v21.0.0-nightly.20220801 2022-08-01 06:01:38 -07:00
Charles Kerr
b67c69d741 fix: remove skip-taskbar feature on Linux. (#35123) 2022-08-01 12:42:02 +02:00
Kilian Valkhof
00e9bf107a docs: new main -> renderers messageChannel example (#34978)
* docs: new main -> renderers messageChannel example

* consistent use of your

* fix a typo

* linting

* markdown linting

* Update docs/tutorial/message-ports.md

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

* update code example headings, reference contextIsolation example

* remove nodeIntegration: false from browserWindows

* rename "messagePort" to "electronMessagePort" for compatibility

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-07-29 09:47:43 -07:00
Shelley Vohr
9028bb79a8 fix: empty result of webContents.getUserAgent() (#35069)
fix: empty result of webContents.getUserAgent()
2022-07-29 11:09:47 -04:00
Sudowoodo Release Bot
8004cb8722 Bump v21.0.0-nightly.20220729 2022-07-29 06:00:43 -07:00
Sofia Nguy
7f757075bc docs: update E21 release date (#35122)
* docs: update E21 release date

* chore: fix lint

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-07-28 21:54:48 -07:00
John Kleinschmidt
674596d11e ci: switch to GHA for WOA (#35109)
* ci: switch to GHA for WOA

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-28 19:05:59 -04:00
Sudowoodo Release Bot
3c2ec2280e Bump v21.0.0-nightly.20220728 2022-07-28 06:03:11 -07:00
Jeremy Rose
de1cec8693 test: migrate shell specs to main process (#35058) 2022-07-27 09:18:33 -07:00
Sudowoodo Release Bot
99c2706376 Bump v21.0.0-nightly.20220727 2022-07-27 06:01:22 -07:00
Stuart Schechter
63593ffb22 docs: don't wait for ready event to register open-url listener (#35019)
* Update app.md

Add warning about late registration of the open-url event.

* Update app.md
2022-07-27 14:00:35 +02:00
Samuel Attard
b0c6fb5152 chore: add electon deps to //src gitignore (#35065) 2022-07-27 13:15:34 +02:00
Jeremy Rose
77b4aab720 test: migrate the rest of the webFrame tests to main (#35080) 2022-07-27 11:10:14 +02:00
Jeremy Rose
7c2ed98214 test: migrate more chromium specs to main (#35081) 2022-07-27 11:10:04 +02:00
Charles Kerr
62001dc6cb fix: crash on startup in X11 (#35075)
Fixes #34996.
2022-07-27 13:44:44 +09:00
Keeley Hammond
ff804e3a74 fix: use win_clang_x64 binary for x86 extract symbols (#35078)
fix: use win_clang_x64 for x86 extract symbols
2022-07-27 13:33:07 +09:00
Ian German Mesner
9416091180 fix: allow setsize to be called within a move or resize for preventDefault (#34843)
fix: #34599 allow setsize to be called within a move or resize for preventDefault
2022-07-27 09:02:06 +09:00
Jeremy Rose
6d9e8b65bc test: add process module tests for main process (#35057) 2022-07-26 15:42:50 -07:00
Shelley Vohr
b42fd1ddca fix: handle WCO pressed state when going maximized -> minimized (#35070) 2022-07-26 13:30:15 -04:00
John Kleinschmidt
182ab9ad76 test: remove duplicate test that is causing hang in Windows (#35071) 2022-07-26 13:28:59 -04:00
Jeremy Rose
77e1a046ec test: move chromium spec config to its own folder (#35063) 2022-07-26 09:37:11 -07:00
Devin Foley
0be73d18ef fix: Make disable_color_correct_rendering patch work again (#35050)
Fix disable_color_correct_rendering patch.
2022-07-26 09:35:10 -07:00
Jeremy Rose
c842f63383 test: migrate process module specs to spec-main (#35056) 2022-07-26 09:31:26 -07:00
Sudowoodo Release Bot
6674082041 Bump v21.0.0-nightly.20220726 2022-07-26 06:01:07 -07:00
Jeremy Rose
cabfb8507d test: remove references to robotjs (#35064) 2022-07-26 01:12:04 -07:00
Jeremy Rose
aa40652456 test: remove unused spec/expect-helpers (#35055) 2022-07-26 09:57:12 +02:00
Jeremy Rose
dd68fae081 test: migrate nativeImage specs to main (#35062)
* test: move nativeImage specs to main

* simplify test
2022-07-26 09:57:01 +02:00
Jeremy Rose
ad1bbc198b test: migrate clipboard spec to spec-main (#35059) 2022-07-26 09:37:37 +02:00
electron-roller[bot]
2c51a81e85 chore: bump node to v16.16.0 (main) (#34853)
* chore: bump node in DEPS to v16.16.0

* chore: update patches

* 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-07-25 17:06:52 -04:00
John Kleinschmidt
648c9934c0 fix: properly fire serial-port-added and serial-port-removed events (#34958)
Based on 2309652: [webhid] Notify chooser context observers on shutdown | https://chromium-review.googlesource.com/c/chromium/src/+/2309652
2022-07-25 10:50:19 -04:00
Sudowoodo Release Bot
aeba6ca973 Bump v21.0.0-nightly.20220725 2022-07-25 06:01:47 -07:00
Mike Lee
49302e4a2f docs: Add missing link to tutorial page (#35035)
Add missing link to tutorial page
2022-07-25 11:22:06 +02:00
Shelley Vohr
57c265198e refactor: use Get/SetID from views:View in Button (#35022) 2022-07-25 09:46:14 +02:00
Keeley Hammond
08dd38d9be docs: update build dependencies for Fedora (#35024) 2022-07-25 15:25:42 +09:00
Sudowoodo Release Bot
dd82a26e95 Bump v21.0.0-nightly.20220722 2022-07-22 06:01:06 -07:00
Jeremy Rose
3c63f075bd chore: remove unused WebContents._sendToFrameInternal (#35010) 2022-07-21 10:25:54 -07:00
Sudowoodo Release Bot
fec4cca8d4 Bump v21.0.0-nightly.20220721 2022-07-21 06:01:19 -07:00
Shelley Vohr
1ed191114a fix: clean up callback handling in webContents.print() (#34894)
* refactor: clean up callback handling in webContents.print()

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-21 12:46:15 +02:00
Milan Burda
d4e97483aa refactor: only create webContents after 'will-attach-webview' (#32941) 2022-07-21 11:29:31 +02:00
dependabot[bot]
7ae3025fd5 build(deps): bump terser from 4.6.7 to 4.8.1 (#34987)
Bumps [terser](https://github.com/terser/terser) from 4.6.7 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-21 11:15:00 +02:00
Valentin Hăloiu
67eda4bcc8 fix: add support for --ozone-platform-hint flag on Linux (#34937) 2022-07-21 10:37:54 +02:00
Sudowoodo Release Bot
9f0e7126c4 Bump v21.0.0-nightly.20220720 2022-07-20 08:02:19 -07:00
Keeley Hammond
be7f90481d build: update mediastreamdevicescontroller.patch (#34995) 2022-07-20 08:00:31 -07:00
Sudowoodo Release Bot
6dc1218c37 Revert "Bump v21.0.0-nightly.20220720"
This reverts commit cffcd0d47a.
2022-07-20 07:14:04 -07:00
Sudowoodo Release Bot
cffcd0d47a Bump v21.0.0-nightly.20220720 2022-07-20 06:01:09 -07:00
electron-roller[bot]
9e0a3c44dd chore: bump chromium to 105.0.5187.0 (main) (#34921)
* chore: bump chromium in DEPS to 105.0.5179.0

* chore: update patches

* 3758224: Reland^2 "[flags] Enable freezing of flags"

https://chromium-review.googlesource.com/c/v8/v8/+/3758224

* chore: bump chromium in DEPS to 105.0.5181.0

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5183.0

* chore: bump chromium in DEPS to 105.0.5185.0

* chore: bump chromium in DEPS to 105.0.5187.0

* chore: update patches

* 3723298: Pass RemoteFrame mojo channels through its creation messages.

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

* 3737382: [Code Heath] Replace base::{ListValue,DictionaryValue} in skia et al

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

* Pass RemoteFrame mojo channels through its creation messages.

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

* Changed PrintRenderFrame.PrintWithParams mojo interface to use callback.

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

* 3738183: [CSP] Add support for `DisableWasmEval`

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

* 3740498: Move LinuxUI from //ui/views/linux_ui to //ui/linux

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

* 3558277: Moves subsystem and semantics to enum class

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

* chore: fix broken steps-electron-gn-check

* 3749583: [arm64] Fix undefined symbol linker error

https://chromium-review.googlesource.com/c/v8/v8/+/3749583

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-20 13:03:34 +02:00
Shelley Vohr
1b96a3aa1d build: consolidate gn templates (#34918) 2022-07-20 11:14:54 +02:00
Jeremy Rose
3c7d446fad refactor: unduplicate MediaStreamDevicesController (#34895)
* refactor: unduplicate MediaStreamDevicesController

* restore old logic for GUM_* request types

* lint

* gn format

* add test for unsupported getDisplayMedia

* simplify + comment
2022-07-20 17:09:14 +09:00
Alexander Petrov
60b6e74e3f fix: merge crash annotations instead of overwriting (#34795)
ElectronCrashReporterClient::GetProcessSimpleAnnotations() merges
annotations provided as argument with global_annotations_,
preserving useful information.
2022-07-19 09:18:04 -07:00
Sudowoodo Release Bot
ba25714e16 Bump v21.0.0-nightly.20220719 2022-07-19 06:01:27 -07:00
Shelley Vohr
05d4966251 fix: delegate to PrintViewManagerBase on failed print (#34893)
fix: delegate to PrintViewManagerBase on failed print
2022-07-19 14:46:08 +02:00
Shelley Vohr
eb8c9452cb fix: crash on BrowserWindow.setEnabled() (#34904)
fix: crash on BrowserWindow.setEnabled()
2022-07-19 12:31:49 +02:00
Shelley Vohr
38848c5bf7 test: optionally validate disabled Node.js specs (#34899) 2022-07-19 12:14:21 +02:00
Shelley Vohr
57b02e153d fix: potential hang on print settings failure (#34892) 2022-07-19 11:45:10 +02:00
John Kleinschmidt
8a0df1f487 ci: wait longer for goma to be ready (#34956) 2022-07-19 10:20:16 +02:00
Sudowoodo Release Bot
c4cde78818 Bump v21.0.0-nightly.20220718 2022-07-18 06:01:46 -07:00
Samuel Attard
f1746c81c6 fix: do not define _LIBCPP_ABI_NAMESPACE=Cr for all native modules (#34932)
This define is only needed when linking against Chromiums libc++ which we currently
do not ship / expose the symbols of.  We probably should make those symbols visible and
actually ensure that electron-rebuild et. al link against our libc++ instead of the system libc++
but for now this fixes compilation issues on macOS where the default system clang links to the system libc++
which does not (obviously) use the Chromium ABI namespace.

For our nan tests which do link against Chromiums libc++ we define the ABI namespace in the spec runner.
2022-07-15 16:57:29 -07:00
Sudowoodo Release Bot
9d23a624c1 Bump v21.0.0-nightly.20220715 2022-07-15 15:12:54 -07:00
Keeley Hammond
574da5a9a1 chore: cherry-pick 5e227bebf193 from v8 (#34931)
* chore: cherry-pick 5e227bebf193 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-15 15:12:01 -07:00
Sudowoodo Release Bot
2afb284456 Revert "Bump v21.0.0-nightly.20220715"
This reverts commit 4bec26cd0c.
2022-07-15 07:32:25 -07:00
Sudowoodo Release Bot
4bec26cd0c Bump v21.0.0-nightly.20220715 2022-07-15 06:01:14 -07:00
Sudowoodo Release Bot
0cb39b5bb5 Revert "Bump v21.0.0-nightly.20220714"
This reverts commit e9f42b4ad4.
2022-07-14 08:12:33 -07:00
Sudowoodo Release Bot
e9f42b4ad4 Bump v21.0.0-nightly.20220714 2022-07-14 06:03:36 -07:00
Samuel Attard
9a5d759ea3 fix: ensure that v8 sandbox isnt enabled for arm (#34914) 2022-07-14 10:46:41 +02:00
electron-roller[bot]
d32e6cc252 chore: bump chromium to 105.0.5173.0 (main) (#34770)
* chore: bump chromium in DEPS to 105.0.5147.0

* chore: update chromium/can_create_window.patch

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

fix minor code shear in patch

* chore: update chromium/port_autofill_colors_to_the_color_pipeline.patch

Xref: chromium/port_autofill_colors_to_the_color_pipeline.patch

fix minor code shear in patch

* chore: remove chromium/posix_replace_doubleforkandexec_with_forkandspawn.patch

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

Removing upstreamed patch

* chore: update patches

* chore: update patches

* chore: add new enum kOffscreenDocument to switch statement

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

* chore: add stub for new parent virtual method OnNewCropVersion()

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

* chore: remove download_schedule arg from DownloadTargetCallback invocation

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

Clean up DownloadLater flags and prefs

* chore: add stub for new parent virtual method OnNewCropVersion()

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

* chore: use base::List for extensions::Event

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

Remove Event constructor overloads that take vector<base::Value>

* refactor: replace ClearStorageDataOptions.origin with .storage_key

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

Refactor ClearData to take StorageKey

* chore: bump chromium in DEPS to 105.0.5149.0

* chore: update patches

* refactor: migrate InspectableWebContents to base::Value::List

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

Migrate DevToolsEmbedderMessageDispatcher to base::Value::List.

* refactor: update electron_api_clipboard_mac Clipboard::ReadFindText()

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

Mac: Remove unused FindPasteboard C++ interface

* chore: bump chromium in DEPS to 105.0.5151.0

* chore: fix code shear in chromium/build_do_not_depend_on_packed_resource_integrity.patch

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

Move Cart DB proto to //components/commerce

* Revert "chore: fix code shear in chromium/build_do_not_depend_on_packed_resource_integrity.patch"

This reverts commit f8de4605eb3d35152b186646fefd8e88d1df836b.

* chore: fix code shear in chromium/build_do_not_depend_on_packed_resource_integrity.patch

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

Move Cart DB proto to //components/commerce

* chore: update patches

* chore: update ElectronAccessibilityUIMessageHandler to use base::Value::List

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

Convert /chrome/browser/accessibility away from WebUI::RegisterDeprecatedMessageCallback

* chore: bump chromium in DEPS to 105.0.5153.0

* chore: bump chromium in DEPS to 105.0.5155.0

* chore: bump chromium in DEPS to 105.0.5157.0

* chore: bump chromium in DEPS to 105.0.5159.0

* chore: update patches

* chore: update CL reference

* Replace ContentMainDelegate::InvokedIn with a variant

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

* Switch devtools_frontend.mojom to mojom.DictValue.

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

* webhid: Bind HID service with service workers

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

* chore: fix lint

* Don't fire load-complete AX notification on macOS for unfocused windows

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

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5165.0

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5167.0

* chore: bump chromium in DEPS to 105.0.5169.0

* chore: bump chromium in DEPS to 105.0.5171.0

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5173.0

* chore: update patches

* 3743346: Stop generating unsupported policies on macOS

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

* 3727612: [Bluetooth][Win] Refactor pairing prompt code

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

* 3737325: system-extensions: Move IsEnabled() out of SystemExtensionsProvider.

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

* 3748635: Remove RenderView from the public API.

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

* fixup: 3743346: Stop generating unsupported policies on macOS

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: John Kleinschmidt <jkleinsc@electronjs.org>
2022-07-13 17:26:16 -04:00
Gellert Hegyi
440c575aa6 fix: alwaysOnTop browser window option for X11 Linux (#34766)
fix: alwaysontop browser window option for x11
2022-07-13 11:59:57 -07:00
Sudowoodo Release Bot
46e5c537c8 Bump v21.0.0-nightly.20220713 2022-07-13 06:01:20 -07:00
Shelley Vohr
07d168343a fix: enable deviceName validation on Linux (#34872) 2022-07-13 12:23:24 +02:00
Shelley Vohr
62aeb74d7c fix: base::DictionaryValue usage in APNS notifs (#34897) 2022-07-13 12:22:17 +02:00
Joan Xie
afd08c9450 feat: Enable APNS registration + notification delivery in macOS apps (#33574) 2022-07-12 08:38:49 -07:00
Sudowoodo Release Bot
5314ae5342 Bump v21.0.0-nightly.20220712 2022-07-12 06:01:28 -07:00
Samuel Attard
511ff8bc8d fix: ensure that requestMediaKeySystemAccess resolves (#34886)
When widevine was disabled at the build level we never dealt with the callback passed into GetSupportedKeySystems.  This was ok until requests became marked pending in https://chromium-review.googlesource.com/c/chromium/src/+/3430502 until the callback was called.  This resulted in a promise never resolving / rejecting and certain media websites (E.g. spotify) hanging on load waiting for a signal that would never arrive.
2022-07-12 00:48:51 -07:00
Shelley Vohr
95019f0454 fix: update Windows caption buttons to match Win11 style (#34790) 2022-07-12 09:13:40 +02:00
Jeremy Rose
4190ec2482 feat: sandbox preloads by default (#32869) 2022-07-11 16:28:09 -07:00
Valentin Hăloiu
f63bba8ce2 fix: set Wayland application ID (#34855)
* refactor: extract XDG app ID logic into a method

* fix: set application ID on Wayland
2022-07-11 11:26:18 -07:00
Sudowoodo Release Bot
8f3fb8db09 Bump v21.0.0-nightly.20220711 2022-07-11 06:01:12 -07:00
David Sanders
2b862c18ba chore: improve run-clang-tidy.ts behavior when filenames < jobs (#34736) 2022-07-11 12:25:39 +02:00
Samuel Attard
fa8e4a7610 build: use third_party DEPOT_TOOLS when running lint scripts (#34846)
Some folks (especially build_tools users) do not have a version of depot_tools on their path
2022-07-11 12:25:17 +02:00
Shelley Vohr
2eb0e5dcab fix: safer check for WCO button updates (#34833) 2022-07-11 11:45:01 +02:00
Samuel Attard
459404f536 build: run CI tests on Xcode 13.3.0 (#34850)
* build: test disabling security

* build: install python2 during tests

* build: do not install python2 on arm64 runners

* attempt 2

* build: only allow 13.3.0 xcode
2022-07-11 17:04:32 +09:00
Sudowoodo Release Bot
78848f8bfe Bump v21.0.0-nightly.20220708 2022-07-08 06:01:44 -07:00
Samuel Attard
eba9d3fc79 fix: ensure v8 pointer compression + sandbox is enabled on 64bit native modules (#34844)
* fix: ensure v8 pointer compression + sandbox is enabled on 64bit native modules

* build: rely on config.gypi to enable pointer compression
2022-07-08 01:06:06 -07:00
Shelley Vohr
1941c88442 fix: setRepresentedFilename with non-default titlebarStyle (#34834)
fix: setRepresentedFilename with non-default titlebarStyle
2022-07-07 23:33:42 -07:00
Keeley Hammond
e83c3ec744 test: add first-party-set chromium tests (#34827)
test: add first-part-set chromium feature tests
2022-07-07 15:14:53 -04:00
Shelley Vohr
7ec88584b5 fix: WCO pressed background state updates (#34771) 2022-07-07 17:17:20 +02:00
Sudowoodo Release Bot
47d8d4cc5c Bump v21.0.0-nightly.20220707 2022-07-07 06:01:40 -07:00
Sudowoodo Release Bot
f7428baace Bump v21.0.0-nightly.20220706 2022-07-06 06:02:02 -07:00
Jeremy Rose
403bd39d05 chore: modernize base::Value useage in asar/archive (#34796) 2022-07-05 12:35:38 -04:00
David Sanders
c418275228 chore: update Discord invite links (#34730) 2022-07-05 11:55:15 -04:00
David Sanders
98cd16d336 chore: fix typos (#34731) 2022-07-05 11:49:56 -04:00
Jeremy Rose
e5db178ab6 feat: enable v8 sandboxed pointers (#34724)
* feat: enable v8 sandboxed pointers

* update breaking-changes.md

* update zero-fill patch

benchmarks showed the function call was slower
2022-07-05 11:28:22 -04:00
Jeremy Rose
0ee7f14190 chore: modernize Value usage in converters (#34794)
* chore: modernize Value usage in converters

* Date is parsed as an empty object now
2022-07-05 11:25:18 -04:00
Sudowoodo Release Bot
d28ed0da20 Bump v21.0.0-nightly.20220705 2022-07-05 06:01:17 -07:00
Sudowoodo Release Bot
1edf9d2ada Bump v21.0.0-nightly.20220704 2022-07-04 06:02:50 -07:00
Sudowoodo Release Bot
d359736e65 Bump v21.0.0-nightly.20220701 2022-07-01 06:00:58 -07:00
Darshan Sen
c885f9063b docs: document the removal of IA32 Linux support (#34787)
* docs: document the removal of IA32 Linux support

Chromium had dropped support for IA32 Linux, so the Chromium
102.0.4999.0 upgrade PR,
https://github.com/electron/electron/pull/33731, had introduced the commit,
389ef0731e,
to drop support for IA32 Linux but the change landed without an addition
to the documentation for the breaking changes, so this PR adds that.

Closes: https://github.com/electron/electron/issues/34783
Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=1194538
Signed-off-by: Darshan Sen <raisinten@gmail.com>

* Update docs/breaking-changes.md

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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-06-30 09:23:03 -07:00
Sudowoodo Release Bot
c3920c5c02 Bump v21.0.0-nightly.20220630 2022-06-30 06:02:00 -07:00
David Sanders
5d120359f6 chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
Jeremy Rose
0d4e417594 chore: modernize ListValue usage in permission manager (#34662) 2022-06-29 10:09:48 -07:00
Jeremy Rose
4ddd03b1b3 chore: modernize some devtools code using deprecated ListValue (#34655) 2022-06-29 09:39:48 -07:00
Shelley Vohr
7c12baccab build: remove appveyor hook to defunct service (#34789) 2022-06-29 17:19:05 +02:00
Sudowoodo Release Bot
461561c19c Bump v21.0.0-nightly.20220629 2022-06-29 06:01:40 -07:00
Josh Soref
1f814eacb2 build: fix release_dependency_versions workflow (#34573)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-06-29 14:55:59 +02:00
Shelley Vohr
ad2b1fee59 fix: re-enable HKDF crypto functionality (#34767)
* fix: re-enable HKDF crypto functionality

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-29 14:53:57 +02:00
Shelley Vohr
35ff95d3c7 fix: <datalist> bounds vertical cutoff (#34759) 2022-06-29 10:14:03 +02:00
Sudowoodo Release Bot
6257e0c348 Bump v21.0.0-nightly.20220628 2022-06-28 20:28:29 -07:00
Keeley Hammond
3310e4039f build: update makeRequest parameters (#34782) 2022-06-28 20:26:00 -07:00
Jeremy Rose
40fbc05bb2 chore: modernize base::Value usage in accessibility_ui (#34666) 2022-06-28 16:40:56 -07:00
Keeley Hammond
3458eac276 chore: update printing patch for main gclient sync (#34777)
chore: update printing patch
2022-06-28 16:40:23 -07:00
Samuel Attard
44b9ee51f4 fix: resolve symlinks when computing relative asar paths for integrity (#34776) 2022-06-28 16:02:00 -07:00
Jeremy Rose
07294cbf15 chore: modernize ListValue usage in gpu info (#34663) 2022-06-28 09:52:59 -07:00
Sudowoodo Release Bot
a4043237da Revert "Bump v21.0.0-nightly.20220628"
This reverts commit f1087cc830.
2022-06-28 07:40:00 -07:00
Micha Hanselmann
704b2199b3 build: fix building with enable_basic_printing false (#34711)
* build: fix building with enable_basic_printing false

* temp flags for ci builds

* fix other systems

* disable cups

* disable print preview

* revert changes

* merge with printing.patch
2022-06-28 16:34:00 +02:00
Sudowoodo Release Bot
f1087cc830 Bump v21.0.0-nightly.20220628 2022-06-28 07:07:08 -07:00
Sudowoodo Release Bot
d028044a24 Revert "Bump v21.0.0-nightly.20220628"
This reverts commit 9c311a2059.
2022-06-28 07:05:52 -07:00
Sudowoodo Release Bot
9c311a2059 Bump v21.0.0-nightly.20220628 2022-06-28 06:01:35 -07:00
dependabot[bot]
47afaddaf5 build(deps-dev): bump got from 6.7.1 to 11.8.5 (#34697)
Bumps [got](https://github.com/sindresorhus/got) from 6.7.1 to 11.8.5.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v6.7.1...v11.8.5)

---
updated-dependencies:
- dependency-name: got
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-28 11:18:47 +02:00
David Sanders
59d3c12cae chore: remove spurious trailing namespace comments (#34732) 2022-06-28 10:08:55 +02:00
electron-roller[bot]
e86d1cba75 chore: bump chromium to 105.0.5129.0 (main) (#34403)
* chore: bump chromium in DEPS to 104.0.5096.0

* 3651284: Use the entry settings object for window.open navigation

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

* 3644598: Make RenderFrameHost used for notification permission decision

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

* 3642842: Window Placement: Prototype Fullscreen Capability Delegation - Part 2

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

* 3652785: [sandbox] Enable sandboxed pointers on sanitizer builds

https://chromium-review.googlesource.com/c/v8/v8/+/3652785

* 3611967: webhid: Migrate HidDelegate to use BrowserContext and Origin

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

* 3665762: Remove RenderFrameHost::IsRenderFrameCreated from //content/.

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

* 3659375: Fold x509_util_ios and most of x509_util_mac into x509_util_apple

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

* 3656234: [CodeHealth] Remove uses of base::ListValue::Append() (Final, take 2)

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

* chore: update patch indices

* chore: fix lint

* 3644598: Make RenderFrameHost used for notification permission decision

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

* webhid: Migrate HidDelegate to use BrowserContext and Origin

This is a temporary fix for  https://chromium-review.googlesource.com/c/chromium/src/+/3611967 to get the build compiling, but we need to either patch around  https://chromium-review.googlesource.com/c/chromium/src/+/3611967 or move our device permissioning to BrowserContext

* chore: fix lint

* build: run electron/script/gen-libc++-filenames.js

fixes gn check

* chore: bump chromium in DEPS to 104.0.5098.0

* chore: disable flaking tests

* 3682394: Change pipes surrounding code references in comments to backticks

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

* 3652749: Delete GLRenderer and related classes

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

* chore: fixup patch indices

* 3671199: Remove ContentMainDelegate::PostFieldTrialInitialization

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

* 3607963: hid: Do not exclude HID device with no collections

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

* refactor: use ElectronBrowserContext instead of WebContents to persist devices

due to changes like https://chromium-review.googlesource.com/c/chromium/src/+/3611967,
we can no longer use WebContents to store device permissions so this commit
moves device permission storage to live in memory in ElectronBrowserContext
instead.

* 3557253: Deprecate some signature checks

https://chromium-review.googlesource.com/c/v8/v8/+/3557253

* chore: bump chromium in DEPS to 104.0.5100.0

* 3680781: Add policy for Renderer App Container.

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

* chore: update patch indices

* 3675465: Update NetLog network service API to use mojom::DictionaryValue.

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

* chore: bump chromium in DEPS to 104.0.5102.0

* chore: update patches

* chore: bump chromium in DEPS to 104.0.5103.0

* chore: update patches

* chore: bump chromium in DEPS to 104.0.5104.0

* chore: update patches

* fix: add patch for DCHECK in fullscreen test

* build: fix nan build

* build: make the nan spec runner work on macOS

* chore: bump chromium in DEPS to 104.0.5106.0

* chore: update patches

* chore: bump chromium in DEPS to 104.0.5108.0

* chore: update patches

* chore: bump chromium in DEPS to 104.0.5110.0

* chore: update patches

* chore: bump chromium in DEPS to 104.0.5112.0

* chore: bump chromium in DEPS to 105.0.5113.0

* chore: bump chromium in DEPS to 105.0.5115.0

* chore: bump chromium in DEPS to 105.0.5117.0

* chore: update patches

* chore: update libcpp patch

* 3693745: Delete base::LowerCaseEqualsASCII()

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

* 3669226: Remove printing PostTask usage of IO thread

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

* 3687395: Remove DictionaryValue::HasKey().

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

* 3691014: Prevent unsafe narrowing: ui/accessibility, part 2

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

* 3560567: [MSC] Porting GenerateStreams clients to handle stream vectors.

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

* 3684873: [Bluetooth][Win/Linux] Add bluetooth pair confirmation prompt

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

* chore: bump chromium in DEPS to 105.0.5119.0

* chore: missing includes in desktop_notification_controller

* chore: update patches

* 3685951: Reland "Make sure screen object is created once in tests."

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

* fixup: Reland "Make sure screen object is created once in tests."

* 3646014: [API] Deprecate LegacyOOMErrorCallback

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/3646014

* chore: bump chromium in DEPS to 105.0.5121.0

* chore: update patches

* 3699085: [cleanup] update PrintBackend::EnumeratePrinters to use reference

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

* chore: bump chromium in DEPS to 105.0.5123.0

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5125.0

* chore: update patches

* 3630082: [sandbox] Also enable the sandbox outside of Chromium builds

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/3630082

* chore: bump chromium in DEPS to 105.0.5127.0

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5129.0

* chore: update patches

* 3703741: Remove WebContents::GetMainFrame.

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

* chore: update patches

* fixup! 3703741: Remove WebContents::GetMainFrame.

* fix lint

* more lint

* chore: document breaking change

* 3687671: [v8] Freeze flags after initialization

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

* fixup! 3560567: [MSC] Porting GenerateStreams clients to handle stream vectors.

* use the v8 allocator for node serdes

* chore: update patches

* remove faulty non-v8-sandbox-compatible code

* make NodeArrayBufferAllocator use the v8 allocator under the hood

* fixup! 3560567: [MSC] Porting GenerateStreams clients to handle stream vectors.

* fix build on windows

* 3691954: [Reland][Extensions Bindings] Validate arguments sent to API events

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

* chore: remove deprecated AccessorSignatures

https://github.com/nodejs/nan/pull/941

* Update patches/chromium/notification_provenance.patch

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

* remove chore_expose_v8_initialization_isolate_callbacks.patch

* add link to nodejs/nan#941

* 52026: Do not allow md4 or md5 based signatures in X.509 certificates.

https://boringssl-review.googlesource.com/c/boringssl/+/52026

* chore: update patches

* disable nan buffer-test

* disable sandboxed pointers for now

* force sandboxed pointers off

* improve node allocation patch

* restore accidentally dropped node crypto test patch

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <japthorp@slack-corp.com>
2022-06-27 15:50:08 -05:00
Sudowoodo Release Bot
032e1d9bef Bump v21.0.0-nightly.20220627 2022-06-27 06:02:43 -07:00
David Sanders
39840502be docs: replace broken Windows taskbar images (#34729) 2022-06-27 14:14:01 +02:00
David Sanders
8238cca87b test: use maximize event instead of resize event (#34740) 2022-06-27 10:29:55 +02:00
David Sanders
e2c58d164d chore: replace Object.assign with object spread syntax (#34739) 2022-06-27 10:29:18 +02:00
Milan Burda
ba4893c248 refactor: load webFrame via process._linkedBinding in security-warnings.ts (#34735) 2022-06-27 10:28:35 +02:00
Sudowoodo Release Bot
c5b87e4919 Bump v21.0.0-nightly.20220624 2022-06-24 06:01:02 -07:00
Shelley Vohr
3b881e4a13 fix: WCO respects maximizable/closable/minimizable (#34677) 2022-06-23 13:08:32 -04:00
Sudowoodo Release Bot
106aa0e922 Bump v21.0.0-nightly.20220623 2022-06-23 06:00:50 -07:00
Jeremy Rose
11924bdbb2 chore: modernize ListValue usage in dict_util.mm and related files (#34661)
* chore: modernize ListValue usage in dict_util.mm and related files

* use base::Value::{Dict,List} instead of raw base::Value

* fix compile

* fix build

* fix build again
2022-06-23 15:28:41 +09:00
Jeremy Rose
cd19a741b1 chore: modernize base::Value usage in shell/renderer/printing (#34682)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-22 10:37:58 -07:00
Jeremy Rose
5895296239 test: disable flaky transparent window test (#34660) 2022-06-22 10:37:32 -07:00
Sudowoodo Release Bot
e3243ad113 Bump v21.0.0-nightly.20220622 2022-06-22 06:00:53 -07:00
David Sanders
5fee5b0e22 chore: chunk filenames when linting C++ files (#34237)
* chore: chunk filenames when linting C++ files

* chore: refactor code for better readability

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

* chore: further tweak

* chore: limit all platforms to 4095 characters on command line

* chore: use python3

* Revert "chore: use python3"

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-06-22 19:23:11 +09:00
Milan Burda
f172136752 chore: remove undocumented page-title-set webview event (#34533) 2022-06-22 17:18:42 +09:00
Juan Cruz Viotti
218797eb61 fix: allow macOS debug builds to be built (#34536)
Extending the `testing` GN profile with the arguments documented to
allow breakpoint debugging
(https://www.electronjs.org/docs/latest/development/debugging#breakpoint-debugging)
doesn't quite work on macOS:

```sh
is_debug = true
symbol_level = 2
forbid_non_component_debug_builds = false
```

The build eventually fails on both Intel and Apple Silicon with the
following (summarized) error:

```sh
[S:41062 R:1 (41062:41247) (C/s:0.1 O/s:13.6)] SOLINK 'obj/electron/electron_framework_shared_library/Electron Framework' 'obj/electron/electron_framework_shared_library/Electron Framework.TOC'
FAILED: obj/electron/electron_framework_shared_library/Electron Framework obj/electron/electron_framework_shared_library/Electron Framework.TOC
...
Undefined symbols for architecture x86_64:
  "platform_util::GetViewForWindow(gfx::NativeWindow)", referenced from:
      BoundsOverlapWithAnyOpenPrompt(gfx::Rect const&, content::WebContents*) in libchrome.a(autofill_popup_view_utils.o)
  "platform_util::GetParent(gfx::NativeView)", referenced from:
      BoundsOverlapWithAnyOpenPrompt(gfx::Rect const&, content::WebContents*) in libchrome.a(autofill_popup_view_utils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
```

This symbol is defined on a file that is not declared as a dependency of
`libchrome` on the GN definitions. Why the problem is not reproducible
on plain testing or release builds remains a mystery to me. I'm guessing
some non-debug path somewhere in the GN definitions does eventually
require that file.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2022-06-22 17:18:12 +09:00
Erick Zhao
e410109a3d docs: expand tutorial (#34604)
* docs: base tutorial update

* more docs

* zzz

* remove unused images
2022-06-22 17:17:48 +09:00
Milan Burda
a5869fe997 refactor: use std::size(args) instead of hardcoded values (#34651) 2022-06-22 10:15:27 +02:00
Jeremy Rose
bf52318c76 fix: modernize ListValue in net converters (#34657) 2022-06-22 10:14:57 +02:00
Jeremy Rose
73c85410c5 chore: modernize ListValue code in session (#34656)
* chore: modernize ListValue code in session

* also in browser_context
2022-06-22 10:14:35 +02:00
Jeremy Rose
ad7aab8338 chore: modernize base::Value usage in WebRequest (#34667) 2022-06-22 10:11:27 +02:00
Sudowoodo Release Bot
140c8d0d0a Bump v21.0.0-nightly.20220621 2022-06-21 09:07:50 -07:00
Keeley Hammond
34fc53e5e6 chore: Revert "build: build & release libcxx objects on darwin (#34586)" (#34680)
Revert "build: build & release libcxx objects on darwin (#34586)"

This reverts commit 2bbbc66eb8.
2022-06-21 09:06:50 -07:00
Sudowoodo Release Bot
528cbe8131 Revert "Bump v21.0.0-nightly.20220621"
This reverts commit 116c32a030.
2022-06-21 08:27:51 -07:00
Sudowoodo Release Bot
116c32a030 Bump v21.0.0-nightly.20220621 2022-06-21 06:00:53 -07:00
Shelley Vohr
530a022b05 fix: window button visibility fullscreen interaction (#34530) 2022-06-21 16:35:53 +09:00
Milan Burda
f3f327823e chore: move main process only accessible API bindings away from common (#34634) 2022-06-21 16:34:56 +09:00
Milan Burda
0f528c1e43 chore: let result: ReturnType<typeof this._callWindowOpenHandler>; (#34628) 2022-06-21 10:39:41 +09:00
Keeley Hammond
2bbbc66eb8 build: build & release libcxx objects on darwin (#34586)
* build: build & release libcxx objects on darwin

* Fix merge error

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-06-21 10:35:16 +09:00
Shelley Vohr
3cd5223134 build: mark existing Node.js flakes as dontcare (#34644) 2022-06-20 15:54:52 -04:00
Shelley Vohr
8e45f43f18 refactor: remove deprecated drag-and-drop code (#34615) 2022-06-20 15:17:53 +02:00
Sudowoodo Release Bot
d341610d64 Bump v21.0.0-nightly.20220620 2022-06-20 06:01:30 -07:00
Shelley Vohr
6e9466f96b fix: overzealous media key listening on Windows (#34594) 2022-06-20 19:40:10 +09:00
Shelley Vohr
e2f42e5d99 chore: fix BrowserView painting when origin updated (#34581)
chore: fix View painting when origin updated
2022-06-20 13:31:53 +09:00
Darshan Sen
ec98e95b8a fix: performance problem in crashReporter.start() on macOS (#34609)
fix: performance problem in crashReporter.start() on macOS

This change reduces the duration of crashReporter.start() on Intel macOS
from 622 milliseconds to 257 milliseconds!

Backports https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386

  posix: Replace DoubleForkAndExec() with ForkAndSpawn()

  The DoubleForkAndExec() function was taking over 622 milliseconds to run
  on macOS 11 (BigSur) on Intel i5-1038NG7. I did some debugging by adding
  some custom traces and found that the fork() syscall is the bottleneck
  here, i.e., the first fork() takes around 359 milliseconds and the
  nested fork() takes around 263 milliseconds. Replacing the nested fork()
  and exec() with posix_spawn() reduces the time consumption to 257
  milliseconds!

  See https://github.com/libuv/libuv/pull/3064 to know why fork() is so
  slow on macOS and why posix_spawn() is a better replacement.

  Another point to note is that even base::LaunchProcess() from Chromium
  calls posix_spawnp() on macOS -
  8f8d82dea0:base/process/launch_mac.cc;l=295-296

  Change-Id: I25c6ee9629a1ae5d0c32b361b56a1ce0b4b0fd26
  Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386
  Reviewed-by: Mark Mentovai <mark@chromium.org>
  Commit-Queue: Mark Mentovai <mark@chromium.org>

Fixes: https://github.com/electron/electron/issues/34321
Signed-off-by: Darshan Sen <raisinten@gmail.com>
2022-06-20 13:31:29 +09:00
dependabot[bot]
bf4efb693b build(deps): bump jpeg-js from 0.4.3 to 0.4.4 in /spec-main (#34607)
Bumps [jpeg-js](https://github.com/eugeneware/jpeg-js) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/eugeneware/jpeg-js/releases)
- [Commits](https://github.com/eugeneware/jpeg-js/compare/v0.4.3...v0.4.4)

---
updated-dependencies:
- dependency-name: jpeg-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-20 09:57:25 +09:00
Raymond Zhao
999a225edb refactor: use stubs for gdk-pixbuf dependency (#34077)
* refactor: use stubs for gdk-pixbuf dependency

* Adjust build file

* Add includes

* Merge gdk_pixbuf stubs into gtk stubs

* Split pixbuf sigs into own file again

* Add initialization check

* Apply PR feedback
2022-06-19 17:42:30 -07:00
Milan Burda
b3ec0a801a chore: cleanup undocumented keys from webFrame.getWebPreference() (#34588) 2022-06-19 17:40:03 -07:00
Sudowoodo Release Bot
6f8bfdeb7a Bump v21.0.0-nightly.20220617 2022-06-17 06:02:13 -07:00
Shelley Vohr
20538c4f34 fix: draggable regions updating on bounds change (#34582) 2022-06-17 12:01:38 +02:00
Sudowoodo Release Bot
d2e539c7d4 Bump v21.0.0-nightly.20220616 2022-06-16 06:00:48 -07:00
Josh Soref
ea4278754c chore: fix spelling errors in multiple files (#34574)
* chore: fix spelling in .circleci

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in BUILD.gn

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in appveyor.yml

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in build

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in docs

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in lib

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in script

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in shell

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in spec

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* chore: fix spelling in spec-main

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-06-16 16:46:11 +09:00
Milan Burda
f418a49857 chore: warn when using the deprecated new-window event (#34528) 2022-06-15 18:17:42 -07:00
Jeremy Rose
bad8d5e08a fix: make preload calculation identical between sandbox & non-sandboxed (#34531) 2022-06-15 13:22:28 -07:00
Sudowoodo Release Bot
4ec95edf06 Bump v21.0.0-nightly.20220615 2022-06-15 06:01:24 -07:00
Michaela Laurencin
4c7c0b41c2 feat: add immersive dark mode on windows (#33624)
* feat: add immersive dark mode

* fix syntax and add header

* add me

* Update fuses.json5

* fix: redraw title bar on dark mode change

* chore: SetWindowTheme doesn't seem to be needed

* chore: separate out Win 10 dark mode implementation

* final touches

* final touches

* chore: limit Win 10 to >= 20H1 and drop fuse

* fix types

* fix lint

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-06-14 12:27:28 -04:00
isailaandrei
21ef8501e7 feat: add panel support for BrowserWindow (#34388)
* feat: add NSPanel support for BrowserWindow

* change header guard to satisfy linter

* change panel wording in browser-window

* Revert "change panel wording in browser-window"

This reverts commit 6f3f80f94a.

* change wording in browser-window

* Update shell/browser/ui/cocoa/electron_native_widget_mac.mm

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

* Update shell/browser/ui/cocoa/electron_native_widget_mac.h

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

* Changed ScopedDisableResize class to allow for nesting

Co-authored-by: andreiisaila <andreiisaila@microsoft.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2022-06-14 12:24:52 -04:00
Shelley Vohr
bed38e0985 fix: crash when setWindowOpenHandler callback throws (#34523)
* fix: crash when setWindowOpenHandler throws

* refactor: throw as process uncaughtException event
2022-06-14 12:22:23 -04:00
Milan Burda
8de5cdb426 test: add missing page-title-updated event spec for webview (#34529) 2022-06-14 12:15:45 -04:00
Sudowoodo Release Bot
9707812d68 Bump v21.0.0-nightly.20220614 2022-06-14 06:02:37 -07:00
Milan Burda
16cd22ff6a test: use webContents.setWindowOpenHandler() in specs (#34514)
* test: use webContents.setWindowOpenHandler() in specs

* test: use browser-window-created instead of new-window for visibility spec
2022-06-13 13:07:47 -04:00
Jeremy Rose
954fd72500 fix: make navigator.userAgentData non-empty (#34481) 2022-06-13 09:35:42 -07:00
Sudowoodo Release Bot
8157a01a42 Bump v21.0.0-nightly.20220613 2022-06-13 08:39:00 -07:00
Sudowoodo Release Bot
d565243f98 Revert "Bump v21.0.0-nightly.20220613"
This reverts commit 77dcf4a5e0.
2022-06-13 08:37:46 -07:00
Sudowoodo Release Bot
77dcf4a5e0 Bump v21.0.0-nightly.20220613 2022-06-13 06:01:32 -07:00
Milan Burda
2a9b3cc9cd chore: remove unused proxy-window-open.snapshot.txt (#34501)
chore: remove unused spec-main/fixtures/snapshots/proxy-window-open.snapshot.txt
2022-06-13 16:01:34 +09:00
Milan Burda
7ca3f55b10 refactor: move duplicate code to RendererClientBase::ShouldLoadPreload helper (#34477) 2022-06-13 15:58:27 +09:00
Shelley Vohr
e5543a2dd2 fix: all files selection logic on linux (#34496) 2022-06-13 15:57:03 +09:00
John Kleinschmidt
bd81ae08ac fix: don't require glibc 2.29+ on linux arm64 builds (#34491)
* build: use sid sysroot for linux arm64
2022-06-10 14:15:52 -04:00
Sudowoodo Release Bot
57b863c213 Bump v21.0.0-nightly.20220610 2022-06-10 06:02:06 -07:00
Michaela Laurencin
52c0a4fafc docs: add macOS height option info (#34451) 2022-06-09 15:17:27 -04:00
Sudowoodo Release Bot
1302ebf50e Bump v21.0.0-nightly.20220609 2022-06-09 06:01:17 -07:00
Shelley Vohr
37d93b0482 fix: update normal bounds prior to minimizing (#34473) 2022-06-09 10:48:50 +02:00
Shelley Vohr
2fd0194e94 build: update clang-format script (#34286) 2022-06-08 21:26:41 +02:00
Sudowoodo Release Bot
6d50717eed Bump v21.0.0-nightly.20220608 2022-06-08 06:00:42 -07:00
David Sanders
289128b96c chore: use --root instead of --project_root for cpplint (#34456)
--root has been improved upstream in depot_tools to better handle Windows:
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3648533
2022-06-08 10:29:39 +02:00
Shelley Vohr
16db5a112e fix: html fullscreen transitions stacking (#32905)
* fix: html fullscreen transitions stacking

* spec: move webview test to spec-main
2022-06-07 12:59:50 -04:00
Sudowoodo Release Bot
f44ecb7f03 Bump v21.0.0-nightly.20220607 2022-06-07 07:30:55 -07:00
Sudowoodo Release Bot
8e97f3badf Revert "Bump v21.0.0-nightly.20220607"
This reverts commit a203123473.
2022-06-07 07:12:33 -07:00
Sudowoodo Release Bot
a203123473 Bump v21.0.0-nightly.20220607 2022-06-07 07:11:11 -07:00
Sudowoodo Release Bot
c750936328 Revert "Bump v21.0.0-nightly.20220607"
This reverts commit 5f0f517486.
2022-06-07 07:09:18 -07:00
Sudowoodo Release Bot
5f0f517486 Bump v21.0.0-nightly.20220607 2022-06-07 06:01:42 -07:00
Shelley Vohr
4ec2de659f chore: fix nan spec runner on macOS (#34447) 2022-06-07 12:09:08 +02:00
David Sanders
30d15715a9 build: switch to --use-color flag for clang-tidy (#34457)
chore: switch to --use-color flag for clang-tidy
2022-06-07 09:49:52 +02:00
Samuel Maddock
882fa36940 test: fix for flaky renderer crash test (#34452) 2022-06-06 17:39:58 -04:00
Sudowoodo Release Bot
e56f626b94 Bump v21.0.0-nightly.20220606 2022-06-06 06:02:02 -07:00
Charles Kerr
92b0f3e808 build: add --unique option to release notes script (#34296)
Useful when looking for changes unique to a single branch
2022-06-06 14:51:10 +09:00
Will Anderson
4f99e3e46c docs: fix did-frame-navigate example in webFrameMain docs (#34419)
docs: fix did-frame-navigate example in webFrameMain docs
2022-06-06 14:49:14 +09:00
electron-roller[bot]
f39c1a35e5 chore: bump node to v16.15.1 (main) (#34424) 2022-06-03 16:13:27 +02:00
Sudowoodo Release Bot
05b03b01dc Bump v21.0.0-nightly.20220603 2022-06-03 06:00:36 -07:00
Shelley Vohr
6038e42c23 fix: fullscreen windows aren't resizable on macOS (#34379) 2022-06-03 09:47:19 +02:00
Samuel Maddock
b00c026a54 fix: render process crash handling (#34428)
* fix: crash when renderer process is reused

Could occur when a renderer crashes and the same-origin URL is loaded again
which leads to reusing the renderer process.

* test: renderer process crash recovery

* fix: handle case which leads to render frame DCHECK

* fix: lint
2022-06-02 17:23:01 -07:00
Shelley Vohr
eb26f99f6e test: re-enable shared worker webview test (#34338) 2022-06-02 17:27:37 -04:00
Sudowoodo Release Bot
d13c879a15 Bump v21.0.0-nightly.20220602 2022-06-02 14:15:14 -07:00
Sudowoodo Release Bot
3ad70d0f0b Revert "Bump v21.0.0-nightly.20220602"
This reverts commit eb9888d1d2.
2022-06-02 14:12:58 -07:00
Keeley Hammond
0671f229ac chore: increase timeout for electron-build step (#34427) 2022-06-02 14:12:10 -07:00
Shelley Vohr
539a53786c chore: remove redundant @available checks (#34407)
* chore: require macOS 10.13 for Chromium

* chore: fix lint
2022-06-02 14:43:40 -04:00
Keeley Hammond
000c3d981c build: disable 32-bit Windows symbol generation (#34412) 2022-06-02 09:01:33 -07:00
Sudowoodo Release Bot
eb9888d1d2 Bump v21.0.0-nightly.20220602 2022-06-02 06:01:23 -07:00
Samuel Attard
1cd07c565a fix: crash in WebFrameMain mojo connection when RenderFrameHost is nullptr (#34411)
* fix: crash when RenderFrameHost is nullptr

* chore: lint fix

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-06-01 16:03:04 -07:00
Sudowoodo Release Bot
f306fbc010 Revert "Bump v21.0.0-nightly.20220601"
This reverts commit 5057cbf418.
2022-06-01 14:31:30 -07:00
Sudowoodo Release Bot
5057cbf418 Bump v21.0.0-nightly.20220601 2022-06-01 10:32:32 -07:00
Naoki Maeda
561be72373 chore: update husky to v8.0.1 (#34343)
* chore: update husky v8.0.1

* chore: remove unnecessary .husky/.gitignore

ref : https://github.com/typicode/husky/releases/tag/v7.0.0

* chore: add ^ prefix for husky version

* chore: update yarn.lock

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-06-01 13:00:48 -04:00
John Kleinschmidt
a38e5d20ff ci: cache python install to better deal with download errors. (#34360)
* ci: cache python install to better deal with download errors.

* chore: use our CDN to download python2

* build: DRY up the python install steps

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-06-01 12:59:26 -04:00
Sudowoodo Release Bot
cda8f3c15c Revert "Bump v21.0.0-nightly.20220601"
This reverts commit df91dd6d2b.
2022-06-01 08:28:12 -07:00
Sudowoodo Release Bot
df91dd6d2b Bump v21.0.0-nightly.20220601 2022-06-01 06:02:01 -07:00
electron-roller[bot]
470396d6ac chore: bump chromium to 104.0.5073.0 (main) (#34272) 2022-06-01 08:12:47 +02:00
Sudowoodo Release Bot
3849d19e14 Bump v21.0.0-nightly.20220531 2022-05-31 06:01:31 -07:00
Shelley Vohr
2cb53c5db1 fix: zombie windows when fullscreening and closing (#34378) 2022-05-31 10:43:42 +02:00
Shelley Vohr
93b39b92b5 refactor: printToPDF should be headless (#33654) 2022-05-31 08:21:25 +02:00
Sudowoodo Release Bot
0d69067dee Bump v21.0.0-nightly.20220530 2022-05-30 06:01:33 -07:00
Samuel Attard
fd88908457 fix: hide content protected windows during screen capture with ScreenCaptureKitMac (#34362)
fix: hide content protected windows during screen capture
2022-05-30 14:13:48 +02:00
Keeley Hammond
34a9268e97 ci: re-enable CalculateNativeWinOcclusion (#34374) 2022-05-30 10:28:33 +02:00
Sudowoodo Release Bot
03d9615f99 Bump v21.0.0-nightly.20220527 2022-05-27 06:02:05 -07:00
Sudowoodo Release Bot
2ffa31832e Bump v21.0.0-nightly.20220526 2022-05-26 06:01:46 -07:00
Shelley Vohr
4accf67d2b build: trigger mksnapshot/chromedriver releases automatically (#34346) 2022-05-25 20:52:41 +02:00
578 changed files with 7665 additions and 12862 deletions

View File

@@ -216,7 +216,6 @@ step-maybe-cleanup-arm64-mac: &step-maybe-cleanup-arm64-mac
rm -rf ~/Library/Application\ Support/electron*
security delete-generic-password -l "Chromium Safe Storage" || echo "✓ Keychain does not contain password from tests"
security delete-generic-password -l "Electron Test Main Safe Storage" || echo "✓ Keychain does not contain password from tests"
security delete-generic-password -a "electron-test-safe-storage" || echo "✓ Keychain does not contain password from tests"
elif [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
XVFB=/usr/bin/Xvfb
/sbin/start-stop-daemon --stop --exec $XVFB || echo "Xvfb not running"
@@ -455,7 +454,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/*" -not -path "./electron/*" ) | xargs rm -rf
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" ) | xargs rm -rf
fi
# On macOS the yarn install command during gclient sync was run on a linux
@@ -636,9 +635,9 @@ step-electron-publish: &step-electron-publish
cd src/electron
if [ "$UPLOAD_TO_STORAGE" == "1" ]; then
echo 'Uploading Electron release distribution to Azure'
script/release/uploaders/upload.py --verbose --UPLOAD_TO_STORAGE
script/release/uploaders/upload.py --verbose --upload_to_storage
else
echo 'Uploading Electron release distribution to Github releases'
echo 'Uploading Electron release distribution to GitHub releases'
script/release/uploaders/upload.py --verbose
fi
@@ -662,6 +661,7 @@ step-persist-data-for-tests: &step-persist-data-for-tests
- src/buildtools/third_party/libc++
- src/buildtools/third_party/libc++abi
- src/out/Default/obj/buildtools/third_party
- src/v8/tools/builtins-pgo
step-electron-dist-unzip: &step-electron-dist-unzip
run:
@@ -813,7 +813,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_file
ninja -C out/Default electron:electron_version
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
@@ -873,12 +873,12 @@ step-touch-sync-done: &step-touch-sync-done
step-maybe-restore-src-cache: &step-maybe-restore-src-cache
restore_cache:
keys:
- v16-src-cache-{{ checksum "src/electron/.depshash" }}
- v14-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:
- v16-src-cache-marker-{{ checksum "src/electron/.depshash" }}
- v14-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
@@ -893,6 +893,14 @@ 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
@@ -910,6 +918,13 @@ 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
@@ -939,16 +954,13 @@ 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: v16-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }}
key: v14-src-cache-{{ checksum "/var/portal/src/electron/.depshash" }}
name: Persisting src cache
step-make-src-cache-marker: &step-make-src-cache-marker
run:
@@ -958,7 +970,7 @@ step-save-src-cache-marker: &step-save-src-cache-marker
save_cache:
paths:
- .src-cache-marker
key: v16-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }}
key: v14-src-cache-marker-{{ checksum "/var/portal/src/electron/.depshash" }}
step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
run:
@@ -995,9 +1007,17 @@ steps-electron-gn-check: &steps-electron-gn-check
- *step-generate-deps-hash
- *step-touch-sync-done
- maybe-restore-portaled-src-cache
- *step-wait-for-goma
- *step-gn-gen-default
- *step-gn-check
- run:
name: Ensure src checkout worked
command: |
if [ ! -d "src/third_party/blink" ]; then
echo src cache was not restored for an unknown reason
exit 1
fi
- run:
name: Wipe Electron
command: rm -rf src/electron
- *step-checkout-electron
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
steps:
@@ -1282,6 +1302,9 @@ commands:
build:
type: boolean
default: true
use-out-cache:
type: boolean
default: true
restore-src-cache:
type: boolean
default: true
@@ -1404,6 +1427,10 @@ 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
@@ -1446,6 +1473,22 @@ 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
@@ -1599,6 +1642,7 @@ jobs:
persist: true
checkout: false
checkout-and-assume-cache: true
use-out-cache: false
linux-x64-testing-asan:
executor:
@@ -1615,6 +1659,7 @@ jobs:
- electron-build:
persist: true
checkout: true
use-out-cache: false
build-nonproprietary-ffmpeg: false
linux-x64-testing-no-run-as-node:
@@ -1631,6 +1676,7 @@ jobs:
- electron-build:
persist: false
checkout: true
use-out-cache: false
linux-x64-testing-gn-check:
executor:
@@ -1681,6 +1727,7 @@ jobs:
persist: true
checkout: false
checkout-and-assume-cache: true
use-out-cache: false
linux-arm-publish:
executor:
@@ -1723,6 +1770,7 @@ jobs:
persist: true
checkout: false
checkout-and-assume-cache: true
use-out-cache: false
linux-arm64-testing-gn-check:
executor:

View File

@@ -0,0 +1,31 @@
name: Trigger Major Release Dependency Updates
on:
release:
types: [published]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
check_tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.0\.0$ ]]; then
echo ::set-output name=should_release::true
fi
trigger:
runs-on: ubuntu-latest
needs: check_tag
if: needs.check_tag.outputs.should_release == 'true'
steps:
- uses: actions/checkout@v3
- name: Trigger New chromedriver Release
run: |
gh api /repos/:owner/chromedriver/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'
- name: Trigger New mksnapshot Release
run: |
gh api /repos/:owner/mksnapshot/actions/workflows/release.yml/dispatches --input - <<< '{"ref":"main","inputs":{"version":"${{ github.event.release.tag_name }}"}}'

1
.husky/.gitignore vendored
View File

@@ -1 +0,0 @@
_

2
.nvmrc
View File

@@ -1 +1 @@
14
16

View File

@@ -107,14 +107,6 @@ 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,
@@ -143,7 +135,7 @@ config("electron_lib_config") {
include_dirs = [ "." ]
}
# We geneate the definitions twice here, once in //electron/electron.d.ts
# We generate the definitions twice here, once in //electron/electron.d.ts
# and once in $target_gen_dir
# The one in $target_gen_dir is used for the actual TSC build later one
# and the one in //electron/electron.d.ts is used by your IDE (vscode)
@@ -310,9 +302,12 @@ npm_action("electron_version_args") {
outputs = [ "$target_gen_dir/electron_version.args" ]
args = rebase_path(outputs) + [ "$electron_version" ]
args = rebase_path(outputs)
inputs = [ "script/generate-version-json.js" ]
inputs = [
"ELECTRON_VERSION",
"script/generate-version-json.js",
]
}
templated_file("electron_version_header") {
@@ -324,39 +319,6 @@ 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"
@@ -429,6 +391,7 @@ source_set("electron_lib") {
"//components/user_prefs",
"//components/viz/host",
"//components/viz/service",
"//components/webrtc",
"//content/public/browser",
"//content/public/child",
"//content/public/gpu",
@@ -441,6 +404,9 @@ 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",
@@ -601,8 +567,9 @@ source_set("electron_lib") {
"//ui/base/ime/linux",
"//ui/events/devices/x11",
"//ui/events/platform/x11",
"//ui/linux:linux_ui",
"//ui/linux:linux_ui_factory",
"//ui/views/controls/webview",
"//ui/views/linux_ui:linux_ui_factory",
"//ui/wm",
]
if (ozone_platform_x11) {
@@ -651,12 +618,7 @@ source_set("electron_lib") {
}
if (enable_plugins) {
deps += [
"chromium_src:plugins",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/shared_impl",
]
deps += [ "chromium_src:plugins" ]
sources += [
"shell/renderer/pepper_helper.cc",
"shell/renderer/pepper_helper.h",
@@ -712,8 +674,6 @@ source_set("electron_lib") {
if (enable_basic_printing) {
sources += [
"shell/browser/printing/print_preview_message_handler.cc",
"shell/browser/printing/print_preview_message_handler.h",
"shell/browser/printing/print_view_manager_electron.cc",
"shell/browser/printing/print_view_manager_electron.h",
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
@@ -790,6 +750,7 @@ 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" ]
@@ -940,6 +901,13 @@ if (is_mac) {
"@executable_path/../../../../../..",
]
}
# For component ffmpeg under non-component build, it is linked from
# @loader_path. However the ffmpeg.dylib is moved to a different place
# when generating app bundle, and we should change to link from @rpath.
if (is_component_ffmpeg && !is_component_build) {
ldflags += [ "-Wcrl,installnametool,-change,@loader_path/libffmpeg.dylib,@rpath/libffmpeg.dylib" ]
}
}
template("electron_helper_app") {
@@ -1223,7 +1191,6 @@ if (is_mac) {
":default_app_asar",
":electron_app_manifest",
":electron_lib",
":electron_win32_resources",
":packed_resources",
"//components/crash/core/app",
"//content:sandbox_helper_win",
@@ -1257,7 +1224,8 @@ if (is_mac) {
if (is_win) {
sources += [
"$target_gen_dir/win-resources/electron.rc",
# TODO: we should be generating our .rc files more like how chrome does
"shell/browser/resources/win/electron.rc",
"shell/browser/resources/win/resource.h",
]
@@ -1439,10 +1407,15 @@ group("licenses") {
]
}
copy("electron_version") {
sources = [ "ELECTRON_VERSION" ]
outputs = [ "$root_build_dir/version" ]
}
dist_zip("electron_dist_zip") {
data_deps = [
":electron_app",
":electron_version_file",
":electron_version",
":licenses",
]
if (is_linux) {

4
DEPS
View File

@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'104.0.5112.124',
'106.0.5249.51',
'node_version':
'v16.15.0',
'v16.16.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':

1
ELECTRON_VERSION Normal file
View File

@@ -0,0 +1 @@
21.0.0

View File

@@ -2,7 +2,7 @@
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/main.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/main)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/main?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.com/invite/APGC3k5yaH)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.gg/electronjs)
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
View these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).
@@ -38,7 +38,7 @@ For more installation options and troubleshooting tips, see
Each Electron release provides binaries for macOS, Windows, and Linux.
* macOS (High Sierra and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* macOS (El Capitan 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

@@ -34,278 +34,213 @@ environment:
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
GOMA_FALLBACK_ON_AUTH_FAILURE: true
matrix:
- job_name: Build
- job_name: Test
job_depends_on: Build
clone_folder: C:\projects\src\electron
# the first failed job cancels other jobs and fails entire build
matrix:
fast_finish: true
for:
-
matrix:
only:
- job_name: Build
init:
- ps: >-
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
}
build_script:
- ps: |
build_script:
- ps: >-
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
} else {
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping tests for doc only change"; Exit-AppveyorBuild
$result = node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
Write-Output $result
if ($result.ExitCode -eq 0) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
$global:LASTEXITCODE = 0
- cd ..
- ps: Write-Host "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
- update_depot_tools.bat
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..\..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
}
- >-
gclient config
--name "src\electron"
--unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron"
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
$env:RUN_GCLIENT_SYNC="true"
}
- echo "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
- cd ..
- mkdir src
- update_depot_tools.bat
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
cd src\electron
node script\generate-deps-hash.js
$depshash = Get-Content .\.depshash -Raw
$zipfile = "Z:\$depshash.7z"
cd ..\..
if (Test-Path -Path $zipfile) {
# file exists, unzip and then gclient sync
7z x -y $zipfile -mmt=14 -aoa
if (-not (Test-Path -Path "src\buildtools")) {
# the zip file must be corrupt - resync
$env:RUN_GCLIENT_SYNC="true"
if ($env:TARGET_ARCH -ne 'ia32') {
# only save on x64/woa to avoid contention saving
$env:SAVE_GCLIENT_SRC="true"
}
} else {
# update angle
cd src\third_party\angle
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
git fetch
cd ..\..\..
}
} else {
# file does not exist, gclient sync, then zip
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
}
- >-
gclient config
--name "src\electron"
--unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron"
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
$env:RUN_GCLIENT_SYNC="true"
} else {
cd src\electron
node script\generate-deps-hash.js
$depshash = Get-Content .\.depshash -Raw
$zipfile = "Z:\$depshash.7z"
cd ..\..
if (Test-Path -Path $zipfile) {
# file exists, unzip and then gclient sync
7z x -y $zipfile -mmt=30 -aoa
if (-not (Test-Path -Path "src\buildtools")) {
# the zip file must be corrupt - resync
$env:RUN_GCLIENT_SYNC="true"
if ($env:TARGET_ARCH -ne 'ia32') {
# only save on x64/woa to avoid contention saving
$env:SAVE_GCLIENT_SRC="true"
}
} else {
# update angle
cd src\third_party\angle
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
git fetch
cd ..\..\..
}
} else {
# file does not exist, gclient sync, then zip
$env:RUN_GCLIENT_SYNC="true"
if ($env:TARGET_ARCH -ne 'ia32') {
# only save on x64/woa to avoid contention saving
$env:SAVE_GCLIENT_SRC="true"
}
}
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync )
- ps: >-
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
# archive current source for future use
# only run on x64/woa to avoid contention saving
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
if ($LASTEXITCODE -ne 0) {
Write-warning "Could not save source to shared drive; continuing anyway"
}
# build time generation of file gen/angle/angle_commit.h depends on
# third_party/angle/.git
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
$(7z a $zipfile src\third_party\angle\.git)
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
}
# build time generation of file dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
# https://dawn-review.googlesource.com/c/dawn/+/83901
$(7z a $zipfile src\third_party\dawn\.git)
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\dawn\.git; continuing anyway"
}
}
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync )
- ps: >-
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
# archive current source for future use
# only run on x64/woa to avoid contention saving
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
if ($LASTEXITCODE -ne 0) {
Write-warning "Could not save source to shared drive; continuing anyway"
}
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
- 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
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
# build time generation of file gen/angle/angle_commit.h depends on
# third_party/angle/.git
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
$(7z a $zipfile src\third_party\angle\.git)
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python3 electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
# build time generation of file dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
# https://dawn-review.googlesource.com/c/dawn/+/83901
$(7z a $zipfile src\third_party\dawn\.git)
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\dawn\.git; continuing anyway"
}
}
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
- 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
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
python 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
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
- ps: >-
if ((-Not (Test-Path Env:\TEST_WOA)) -And (-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) {
$env:RUN_TESTS="true"
}
- ps: >-
if ($env:RUN_TESTS -eq 'true') {
New-Item .\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
} else {
echo "Skipping tests for $env:GN_CONFIG build"
}
- cd electron
- if "%RUN_TESTS%"=="true" ( echo Running main test suite & node script/yarn test -- --trace-uncaught --runners=main --enable-logging=file --log-file=%cd%\electron.log )
- if "%RUN_TESTS%"=="true" ( echo Running remote test suite & node script/yarn test -- --trace-uncaught --runners=remote --runTestFilesSeparately --enable-logging=file --log-file=%cd%\electron.log )
- if "%RUN_TESTS%"=="true" ( echo Running native test suite & node script/yarn test -- --trace-uncaught --runners=native --enable-logging=file --log-file=%cd%\electron.log )
- cd ..
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying chromedriver"
deploy_script:
- cd electron
- ps: >-
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
} else {
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
7z a pdb.zip out\Default\*.pdb
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py --verbose
}
- 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
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python3 script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& 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
}
on_finish:
# Uncomment this lines to enable RDP
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- cd C:\projects\src
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
- 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)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
}
} 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
}
on_finish:
# Uncomment this lines to enable RDP
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- cd ..
- if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json )
- if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip)
- if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe)
- if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip)
- if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip)
- if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip)
- 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)
- ps: >-
if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) {
appveyor-retry appveyor PushArtifact pdb.zip
}
-
matrix:
only:
- job_name: Test
init:
- ps: |
if ($env:RUN_TESTS -ne 'true') {
Write-warning "Skipping tests for $env:APPVEYOR_PROJECT_NAME"; Exit-AppveyorBuild
}
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
}
build_script:
- ps: |
node script/yarn.js install --frozen-lockfile
node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
if ($LASTEXITCODE -eq 0) {
Write-warning "Skipping tests for doc only change"; Exit-AppveyorBuild
}
$global:LASTEXITCODE = 0
- ps: |
cd ..
mkdir out\Default
cd ..
# 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')
foreach ($job in $build_info.build.jobs) {
if ($job.name -eq "Build") {
$jobId = $job.jobId
foreach($artifact_name in $artifacts_to_download) {
if ($artifact_name -eq 'shell_browser_ui_unittests.exe' -Or $artifact_name -eq 'electron.lib') {
$outfile = "src\out\Default\$artifact_name"
} else {
$outfile = $artifact_name
}
Invoke-RestMethod -Method Get -Uri "$apiUrl/buildjobs/$jobId/artifacts/$artifact_name" -OutFile $outfile
}
}
}
- ps: |
$out_default_zips = @('dist.zip','chromedriver.zip','mksnapshot.zip')
foreach($zip_name in $out_default_zips) {
7z x -y -osrc\out\Default $zip_name
}
- ps: 7z x -y -osrc\out\ffmpeg ffmpeg.zip
- ps: 7z x -y -osrc node_headers.zip
test_script:
# Workaround for https://github.com/appveyor/ci/issues/2420
- set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
- ps: |
cd src
New-Item .\out\Default\gen\node_headers\Release -Type directory
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
- cd electron
- 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 & 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 & python3 electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd%
- echo "Done verifying mksnapshot"
- echo Verifying chromedriver & python3 electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd%
- echo "Done verifying chromedriver"
on_finish:
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )

View File

@@ -2,7 +2,7 @@ is_electron_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
node_module_version = 107
node_module_version = 109
v8_promise_internal_field_count = 1
v8_embedder_string = "-electron.0"
@@ -45,5 +45,3 @@ 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
v8_enable_sandboxed_pointers = false

View File

@@ -1,33 +1,22 @@
import("node.gni")
template("node_action") {
assert(defined(invoker.script), "Need script path to run")
assert(defined(invoker.args), "Need script arguments")
# TODO(MarshallOfSound): Move to electron/node, this is the only place it is used now
# Run an action with a given working directory. Behaves identically to the
# action() target type, with the exception that it changes directory before
# running the script.
#
# Parameters:
# cwd [required]: Directory to change to before running the script.
template("chdir_action") {
action(target_name) {
forward_variables_from(invoker,
"*",
[
"script",
"args",
"deps",
"public_deps",
"sources",
"inputs",
"outputs",
])
assert(defined(cwd), "Need cwd in $target_name")
script = "//electron/build/run-in-dir.py"
if (defined(sources)) {
sources += [ invoker.script ]
} else {
assert(defined(inputs))
inputs += [ invoker.script ]
if (!defined(inputs)) {
inputs = []
}
args = [
rebase_path(cwd),
rebase_path(invoker.script),
]
args += invoker.args
inputs += [ invoker.script ]
script = "//electron/build/run-node.py"
args = [ rebase_path(invoker.script) ] + invoker.args
}
}

View File

@@ -1,23 +1,3 @@
config("build_time_executable") {
configs = []
if (is_electron_build && !is_component_build) {
# The executables which have this config applied are dependent on ffmpeg,
# which is always a shared library in an Electron build. However, in the
# non-component build, executables don't have rpath set to search for
# libraries in the executable's directory, so ffmpeg cannot be found. So
# let's make sure rpath is set here.
# See '//build/config/gcc/BUILD.gn' for details on the rpath setting.
if (is_linux) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_mac) {
ldflags = [ "-Wl,-rpath,@loader_path/." ]
}
}
}
# For MAS build, we force defining "MAS_BUILD".
config("mas_build") {
if (is_mas_build) {

View File

@@ -19,17 +19,13 @@ TEMPLATE_H = """
#define FUSE_EXPORT __attribute__((visibility("default")))
#endif
namespace electron {
namespace fuses {
namespace electron::fuses {
extern const volatile char kFuseWire[];
{getters}
} // namespace fuses
} // namespace electron
} // namespace electron::fuses
#endif // ELECTRON_FUSES_H_
"""
@@ -37,17 +33,13 @@ extern const volatile char kFuseWire[];
TEMPLATE_CC = """
#include "electron/fuses.h"
namespace electron {
namespace fuses {
namespace electron::fuses {
const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version */ {fuse_version}, /* fuse_wire_length */ {fuse_wire_length}, /* fuse_wire */ {initial_config}};
{getters}
}
}
} // namespace electron:fuses
"""
with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:

View File

@@ -8,9 +8,7 @@ TEMPLATE = """
#include "node_native_module.h"
#include "node_internals.h"
namespace node {{
namespace native_module {{
namespace node::native_module {{
{definitions}
@@ -18,9 +16,7 @@ void NativeModuleLoader::LoadEmbedderJavaScriptSource() {{
{initializers}
}}
}} // namespace native_module
}} // namespace node
}} // namespace node::native_module
"""
def main():

View File

@@ -4,7 +4,7 @@
# Cocoa .app bundle. The presence of these empty directories is sufficient to
# convince Cocoa that the application supports the named localization, even if
# an InfoPlist.strings file is not provided. Chrome uses these empty locale
# directoires for its helper executable bundles, which do not otherwise
# directories for its helper executable bundles, which do not otherwise
# require any direct Cocoa locale support.
import os

View File

@@ -1,21 +0,0 @@
template("node_action") {
assert(defined(invoker.script), "Need script path to run")
assert(defined(invoker.args), "Need script argumets")
action(target_name) {
forward_variables_from(invoker,
[
"deps",
"public_deps",
"sources",
"inputs",
"outputs",
])
if (!defined(inputs)) {
inputs = []
}
inputs += [ invoker.script ]
script = "//electron/build/run-node.py"
args = [ rebase_path(invoker.script) ] + invoker.args
}
}

View File

@@ -1,7 +1,7 @@
template("npm_action") {
assert(defined(invoker.script),
"Need script name to run (must be defined in package.json)")
assert(defined(invoker.args), "Need script argumets")
assert(defined(invoker.args), "Need script arguments")
action("npm_pre_flight_" + target_name) {
inputs = [

View File

@@ -51,7 +51,7 @@ template("compile_ib_files") {
# Template to compile and package Mac XIB files as bundle data.
# Arguments
# sources:
# list of string, sources to comiple
# list of string, sources to compile
# output_path:
# (optional) string, the path to use for the outputs list in the
# bundle_data step. If unspecified, defaults to bundle_resources_dir.

View File

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

View File

@@ -6,7 +6,6 @@ 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")
@@ -105,6 +104,7 @@ static_library("chrome") {
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm",
"//chrome/browser/media/webrtc/window_icon_util_mac.mm",
"//chrome/browser/platform_util_mac.mm",
"//chrome/browser/process_singleton_mac.mm",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_mac.mm",
@@ -156,10 +156,7 @@ static_library("chrome") {
"//services/strings",
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//components/optimization_guide/proto:optimization_guide_proto",
]
deps = [ "//chrome/browser:resource_prefetch_predictor_proto" ]
if (is_linux) {
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
@@ -232,6 +229,10 @@ static_library("chrome") {
"//chrome/browser/printing/printer_query.h",
"//chrome/browser/printing/printing_service.cc",
"//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_utils.cc",
"//components/printing/browser/print_to_pdf/pdf_print_utils.h",
]
if (enable_oop_printing) {
@@ -371,20 +372,15 @@ 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_plugins) {
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
@@ -406,14 +402,19 @@ source_set("chrome_spellchecker") {
"//chrome/browser/spellchecker/spellcheck_factory.h",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_service.cc",
"//chrome/browser/spellchecker/spellcheck_service.h",
]
if (!is_mac) {
sources += [
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
]
}
if (has_spellcheck_panel) {
sources += [
"//chrome/browser/spellchecker/spell_check_panel_host_impl.cc",

View File

@@ -83,7 +83,7 @@ function loadApplicationPackage (packagePath: string) {
});
try {
// Override app's package.json data.
// Override app name and version.
packagePath = path.resolve(packagePath);
const packageJsonPath = path.join(packagePath, 'package.json');
let appPath;
@@ -104,16 +104,6 @@ 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,6 +83,7 @@ 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

@@ -130,6 +130,11 @@ set `NSPrincipalClass` to `AtomApplication`.
You should call `event.preventDefault()` if you want to handle this event.
As with the `open-file` event, be sure to register a listener for the `open-url`
event early in your application startup to detect if the the application being
is being opened to handle a URL. If you register the listener in response to a
`ready` event, you'll miss URLs that trigger the launch of your application.
### Event: 'activate' _macOS_
Returns:
@@ -710,7 +715,7 @@ To set the locale, you'll want to use a command line switch at app startup, whic
**Note:** When distributing your packaged app, you have to also ship the
`locales` folder.
**Note:** On Windows, you have to call it after the `ready` events gets emitted.
**Note:** This API must be called after the `ready` event is emitted.
### `app.getLocaleCountryCode()`
@@ -718,6 +723,12 @@ Returns `string` - User operating system's locale two-letter [ISO 3166](https://
**Note:** When unable to detect locale country code, it returns empty string.
### `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.
**Note:** This API must be called after the `ready` event is emitted.
### `app.addRecentDocument(path)` _macOS_ _Windows_
* `path` string
@@ -1381,7 +1392,7 @@ method returns false. If we fail to perform the copy, then this method will
throw an error. The message in the error should be informative and tell
you exactly what went wrong.
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the pre-existing running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
By default, if an app of the same name as the one being moved exists in the Applications directory and is _not_ running, the existing app will be trashed and the active app moved into its place. If it _is_ running, the preexisting running app will assume focus and the previously active app will quit itself. This behavior can be changed by providing the optional conflict handler, where the boolean returned by the handler determines whether or not the move conflict is resolved with default behavior. i.e. returning `false` will ensure no further action is taken, returning `true` will result in the default behavior and the method continuing.
For example:

View File

@@ -139,8 +139,7 @@ green and non-draggable regions will be colored red to aid debugging.
### `ELECTRON_DEBUG_NOTIFICATIONS`
Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common a
tions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to.
Adds extra logs to [`Notification`](./notification.md) lifecycles on macOS to aid in debugging. Extra logging will be displayed when new Notifications are created or activated. They will also be displayed when common actions are taken: a notification is shown, dismissed, its button is clicked, or it is replied to.
Sample output:

View File

@@ -96,6 +96,14 @@ 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).
@@ -118,21 +126,6 @@ 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

@@ -149,7 +149,7 @@ console.log(image)
* `options` Object
* `width` Integer
* `height` Integer
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `NativeImage`
@@ -162,7 +162,7 @@ pixel data returned by `toBitmap()`. The specific format is platform-dependent.
* `options` Object (optional)
* `width` Integer (optional) - Required for bitmap buffers.
* `height` Integer (optional) - Required for bitmap buffers.
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `NativeImage`
@@ -225,7 +225,7 @@ The following methods are available on instances of the `NativeImage` class:
#### `image.toPNG([options])`
* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `Buffer` - A [Buffer][buffer] that contains the image's `PNG` encoded data.
@@ -238,7 +238,7 @@ Returns `Buffer` - A [Buffer][buffer] that contains the image's `JPEG` encoded d
#### `image.toBitmap([options])`
* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `Buffer` - A [Buffer][buffer] that contains a copy of the image's raw bitmap pixel
data.
@@ -246,14 +246,14 @@ data.
#### `image.toDataURL([options])`
* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `string` - The data URL of the image.
#### `image.getBitmap([options])`
* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.
@@ -276,7 +276,7 @@ Returns `boolean` - Whether the image is empty.
#### `image.getSize([scaleFactor])`
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns [`Size`](structures/size.md).
@@ -317,20 +317,20 @@ will be preserved in the resized image.
#### `image.getAspectRatio([scaleFactor])`
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.
Returns `Float` - The image's aspect ratio.
Returns `Number` - The image's aspect ratio.
If `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.
#### `image.getScaleFactors()`
Returns `Float[]` - An array of all scale factors corresponding to representations for a given nativeImage.
Returns `Number[]` - An array of all scale factors corresponding to representations for a given nativeImage.
#### `image.addRepresentation(options)`
* `options` Object
* `scaleFactor` Double - The scale factor to add the image representation for.
* `scaleFactor` Number (optional) - The scale factor to add the image representation for.
* `width` Integer (optional) - Defaults to 0. Required if a bitmap buffer
is specified as `buffer`.
* `height` Integer (optional) - Defaults to 0. Required if a bitmap buffer

View File

@@ -0,0 +1,48 @@
# pushNotifications
Process: [Main](../glossary.md#main-process)
> Register for and receive notifications from remote push notification services
For example, when registering for push notifications via Apple push notification services (APNS):
```javascript
const { pushNotifications, Notification } = require('electron')
pushNotifications.registerForAPNSNotifications().then((token) => {
// forward token to your remote notification server
})
pushNotifications.on('received-apns-notification', (event, userInfo) => {
// generate a new Notification object with the relevant userInfo fields
})
```
## Events
The `pushNotification` module emits the following events:
#### Event: 'received-apns-notification' _macOS_
Returns:
* `userInfo` Record<String, any>
Emitted when the app receives a remote notification while running.
See: https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428430-application?language=objc
## Methods
The `pushNotification` module has the following methods:
### `pushNotifications.registerForAPNSNotifications()` _macOS_
Returns `Promise<string>`
Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/sremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message.
See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
### `pushNotifications.unregisterForAPNSNotifications()` _macOS_
Unregisters the app from notifications received from APNS.
See: https://developer.apple.com/documentation/appkit/nsapplication/1428747-unregisterforremotenotifications?language=objc

View File

@@ -769,6 +769,71 @@ app.whenReady().then(() => {
})
```
#### `ses.setBluetoothPairingHandler(handler)` _Windows_ _Linux_
* `handler` Function | null
* `details` Object
* `deviceId` string
* `pairingKind` string - The type of pairing prompt being requested.
One of the following values:
* `confirm`
This prompt is requesting confirmation that the Bluetooth device should
be paired.
* `confirmPin`
This prompt is requesting confirmation that the provided PIN matches the
pin displayed on the device.
* `providePin`
This prompt is requesting that a pin be provided for the device.
* `frame` [WebFrameMain](web-frame-main.md)
* `pin` string (optional) - The pin value to verify if `pairingKind` is `confirmPin`.
* `callback` Function
* `response` Object
* `confirmed` boolean - `false` should be passed in if the dialog is canceled.
If the `pairingKind` is `confirm` or `confirmPin`, this value should indicate
if the pairing is confirmed. If the `pairingKind` is `providePin` the value
should be `true` when a value is provided.
* `pin` string | null (optional) - When the `pairingKind` is `providePin`
this value should be the required pin for the Bluetooth device.
Sets a handler to respond to Bluetooth pairing requests. This handler
allows developers to handle devices that require additional validation
before pairing. When a handler is not defined, any pairing on Linux or Windows
that requires additional validation will be automatically cancelled.
macOS does not require a handler because macOS handles the pairing
automatically. To clear the handler, call `setBluetoothPairingHandler(null)`.
```javascript
const { app, BrowserWindow, ipcMain, session } = require('electron')
let bluetoothPinCallback = null
function createWindow () {
const mainWindow = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
}
// Listen for an IPC message from the renderer to get the response for the Bluetooth pairing.
ipcMain.on('bluetooth-pairing-response', (event, response) => {
bluetoothPinCallback(response)
})
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
bluetoothPinCallback = callback
// Send a IPC message to the renderer to prompt the user to confirm the pairing.
// Note that this will require logic in the renderer to handle this message and
// display a prompt to the user.
mainWindow.webContents.send('bluetooth-pairing-request', details)
})
app.whenReady().then(() => {
createWindow()
})
```
#### `ses.clearHostResolverCache()`
Returns `Promise<void>` - Resolves when the operation is complete.
@@ -932,7 +997,7 @@ Returns `string[]` - An array of language codes the spellchecker is enabled for.
will fallback to using `en-US`. By default on launch if this setting is an empty list Electron will try to populate this
setting with the current OS locale. This setting is persisted across restarts.
**Note:** On macOS the OS spellchecker is used and has its own list of languages. This API is a no-op on macOS.
**Note:** On macOS the OS spellchecker is used and has its own list of languages. On macOS, this API will return whichever languages have been configured by the OS.
#### `ses.setSpellCheckerDictionaryDownloadURL(url)`

View File

@@ -862,6 +862,8 @@ Returns:
Emitted when the renderer process sends an asynchronous message via `ipcRenderer.send()`.
See also [`webContents.ipc`](#contentsipc-readonly), which provides an [`IpcMain`](ipc-main.md)-like interface for responding to IPC messages specifically from this WebContents.
#### Event: 'ipc-message-sync'
Returns:
@@ -872,6 +874,8 @@ Returns:
Emitted when the renderer process sends a synchronous message via `ipcRenderer.sendSync()`.
See also [`webContents.ipc`](#contentsipc-readonly), which provides an [`IpcMain`](ipc-main.md)-like interface for responding to IPC messages specifically from this WebContents.
#### Event: 'preferred-size-changed'
Returns:
@@ -1428,7 +1432,7 @@ Returns `Promise<PrinterInfo[]>` - Resolves with a [`PrinterInfo[]`](structures/
* `header` string (optional) - string to be printed as page header.
* `footer` string (optional) - string to be printed as page footer.
* `pageSize` string | Size (optional) - Specify page size of the printed document. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`.
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width`.
* `callback` Function (optional)
* `success` boolean - Indicates success of the print call.
* `failureReason` string - Error description called back if the print fails.
@@ -1459,43 +1463,28 @@ win.webContents.print(options, (success, errorType) => {
#### `contents.printToPDF(options)`
* `options` Object
* `headerFooter` Record<string, string> (optional) - the header and footer for the PDF.
* `title` string - The title for the PDF header.
* `url` string - the url for the PDF footer.
* `landscape` boolean (optional) - `true` for landscape, `false` for portrait.
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin.
* `scaleFactor` number (optional) - The scale factor of the web page. Can range from 0 to 100.
* `pageRanges` Record<string, number> (optional) - The page range to print.
* `from` number - Index of the first page to print (0-based).
* `to` number - Index of the last page to print (inclusive) (0-based).
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
* `printBackground` boolean (optional) - Whether to print CSS backgrounds.
* `printSelectionOnly` boolean (optional) - Whether to print selection only.
* `landscape` boolean (optional) - Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
* `displayHeaderFooter` boolean (optional) - Whether to display header and footer. Defaults to false.
* `printBackground` boolean (optional) - Whether to print background graphics. Defaults to false.
* `scale` number(optional) - Scale of the webpage rendering. Defaults to 1.
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`,
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing `height` and `width` in inches. Defaults to `Letter`.
* `margins` Object (optional)
* `top` number (optional) - Top margin in inches. Defaults to 1cm (~0.4 inches).
* `bottom` number (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches).
* `left` number (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches).
* `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
* `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `<span class=title></span>` would generate span containing the title.
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
Returns `Promise<Buffer>` - Resolves with the generated PDF data.
Prints window's web page as PDF with Chromium's preview printing custom
settings.
Prints the window's web page as PDF.
The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
By default, an empty `options` will be regarded as:
```javascript
{
marginsType: 0,
printBackground: false,
printSelectionOnly: false,
landscape: false,
pageSize: 'A4',
scaleFactor: 100
}
```
Use `page-break-before: always;` CSS style to force to print to a new page.
An example of `webContents.printToPDF`:
```javascript
@@ -1504,7 +1493,7 @@ const fs = require('fs')
const path = require('path')
const os = require('os')
const win = new BrowserWindow({ width: 800, height: 600 })
const win = new BrowserWindow()
win.loadURL('http://github.com')
win.webContents.on('did-finish-load', () => {
@@ -1521,6 +1510,8 @@ win.webContents.on('did-finish-load', () => {
})
```
See [Page.printToPdf](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) for more information.
#### `contents.addWorkSpace(path)`
* `path` string
@@ -2000,6 +1991,35 @@ This corresponds to the [animationPolicy][] accessibility feature in Chromium.
### Instance Properties
#### `contents.ipc` _Readonly_
An [`IpcMain`](ipc-main.md) scoped to just IPC messages sent from this
WebContents.
IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
`ipcRenderer.postMessage` will be delivered in the following order:
1. `contents.on('ipc-message')`
2. `contents.mainFrame.on(channel)`
3. `contents.ipc.on(channel)`
4. `ipcMain.on(channel)`
Handlers registered with `invoke` will be checked in the following order. The
first one that is defined will be called, the rest will be ignored.
1. `contents.mainFrame.handle(channel)`
2. `contents.handle(channel)`
3. `ipcMain.handle(channel)`
A handler or event listener registered on the WebContents will receive IPC
messages sent from any frame, including child frames. In most cases, only the
main frame can send IPC messages. However, if the `nodeIntegrationInSubFrames`
option is enabled, it is possible for child frames to send IPC messages also.
In that case, handlers should check the `senderFrame` property of the IPC event
to ensure that the message is coming from the expected frame. Alternatively,
register handlers on the appropriate frame directly using the
[`WebFrameMain.ipc`](web-frame-main.md#frameipc-readonly) interface.
#### `contents.audioMuted`
A `boolean` property that determines whether this page is muted.

View File

@@ -140,6 +140,31 @@ ipcRenderer.on('port', (e, msg) => {
### Instance Properties
#### `frame.ipc` _Readonly_
An [`IpcMain`](ipc-main.md) instance scoped to the frame.
IPC messages sent with `ipcRenderer.send`, `ipcRenderer.sendSync` or
`ipcRenderer.postMessage` will be delivered in the following order:
1. `contents.on('ipc-message')`
2. `contents.mainFrame.on(channel)`
3. `contents.ipc.on(channel)`
4. `ipcMain.on(channel)`
Handlers registered with `invoke` will be checked in the following order. The
first one that is defined will be called, the rest will be ignored.
1. `contents.mainFrame.handle(channel)`
2. `contents.handle(channel)`
3. `ipcMain.handle(channel)`
In most cases, only the main frame of a WebContents can send or receive IPC
messages. However, if the `nodeIntegrationInSubFrames` option is enabled, it is
possible for child frames to send and receive IPC messages also. The
[`WebContents.ipc`](web-contents.md#contentsipc-readonly) interface may be more
convenient when `nodeIntegrationInSubFrames` is not enabled.
#### `frame.url` _Readonly_
A `string` representing the current URL of the frame.

View File

@@ -565,21 +565,21 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
### `<webview>.printToPDF(options)`
* `options` Object
* `headerFooter` Record<string, string> (optional) - the header and footer for the PDF.
* `title` string - The title for the PDF header.
* `url` string - the url for the PDF footer.
* `landscape` boolean (optional) - `true` for landscape, `false` for portrait.
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
default margin, 1 for no margin, and 2 for minimum margin.
and `width` in microns.
* `scaleFactor` number (optional) - The scale factor of the web page. Can range from 0 to 100.
* `pageRanges` Record<string, number> (optional) - The page range to print. On macOS, only the first range is honored.
* `from` number - Index of the first page to print (0-based).
* `to` number - Index of the last page to print (inclusive) (0-based).
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
* `printBackground` boolean (optional) - Whether to print CSS backgrounds.
* `printSelectionOnly` boolean (optional) - Whether to print selection only.
* `landscape` boolean (optional) - Paper orientation.`true` for landscape, `false` for portrait. Defaults to false.
* `displayHeaderFooter` boolean (optional) - Whether to display header and footer. Defaults to false.
* `printBackground` boolean (optional) - Whether to print background graphics. Defaults to false.
* `scale` number(optional) - Scale of the webpage rendering. Defaults to 1.
* `pageSize` string | Size (optional) - Specify page size of the generated PDF. Can be `A0`, `A1`, `A2`, `A3`,
`A4`, `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing `height` and `width` in inches. Defaults to `Letter`.
* `margins` Object (optional)
* `top` number (optional) - Top margin in inches. Defaults to 1cm (~0.4 inches).
* `bottom` number (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches).
* `left` number (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches).
* `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches).
* `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
* `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `<span class=title></span>` would generate span containing the title.
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
Returns `Promise<Uint8Array>` - Resolves with the generated PDF data.

View File

@@ -14,6 +14,68 @@ This document uses the following convention to categorize breaking changes:
## Planned Breaking API Changes (20.0)
### Behavior Changed: V8 Memory Cage enabled
The V8 memory cage has been enabled, which has implications for native modules
which wrap non-V8 memory with `ArrayBuffer` or `Buffer`. See the [blog post
about the V8 memory cage](https://www.electronjs.org/blog/v8-memory-cage) for
more details.
### API Changed: `webContents.printToPDF()`
`webContents.printToPDF()` has been modified to conform to [`Page.printToPDF`](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) in the Chrome DevTools Protocol. This has been changes in order to
address changes upstream that made our previous implementation untenable and rife with bugs.
**Arguments Changed**
* `pageRanges`
**Arguments Removed**
* `printSelectionOnly`
* `marginsType`
* `headerFooter`
* `scaleFactor`
**Arguments Added**
* `headerTemplate`
* `footerTemplate`
* `displayHeaderFooter`
* `margins`
* `scale`
* `preferCSSPageSize`
```js
// Main process
const { webContents } = require('electron')
webContents.printToPDF({
landscape: true,
displayHeaderFooter: true,
printBackground: true,
scale: 2,
pageSize: 'Ledger',
margins: {
top: 2,
bottom: 2,
left: 2,
right: 2
},
pageRanges: '1-5, 8, 11-13',
headerTemplate: '<h1>Title</h1>',
footerTemplate: '<div><span class="pageNumber"></span></div>',
preferCSSPageSize: true
}).then(data => {
fs.writeFile(pdfPath, data, (error) => {
if (error) throw error
console.log(`Wrote PDF successfully to ${pdfPath}`)
})
}).catch(error => {
console.log(`Failed to write PDF to ${pdfPath}: `, error)
})
```
### Default Changed: renderers without `nodeIntegration: true` are sandboxed by default
Previously, renderers that specified a preload script defaulted to being

View File

@@ -64,7 +64,7 @@ If you want to add a new API module to Electron, you'll want to look in [creatin
Electron has a fully-fledged governance system that oversees activity in Electron and whose working groups are responsible for areas like APIs, releases, and upgrades to Electron's dependencies including Chromium and Node.js. Depending on how frequently and to what end you want to contribute, you may want to consider joining a working group.
Details about each group and their reponsibilities can be found in the [governance repo](https://github.com/electron/governance).
Details about each group and their responsibilities can be found in the [governance repo](https://github.com/electron/governance).
## Patches in Electron

View File

@@ -47,10 +47,10 @@ $ sudo yum install clang dbus-devel gtk3-devel libnotify-devel \
On Fedora, install the following libraries:
```sh
$ sudo dnf install clang dbus-devel gtk3-devel libnotify-devel \
libgnome-keyring-devel xorg-x11-server-utils libcap-devel \
$ sudo dnf install clang dbus-devel gperf gtk3-devel \
libnotify-devel libgnome-keyring-devel libcap-devel \
cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \
nss-devel python-dbusmock openjdk-8-jre
nss-devel python-dbusmock
```
On Arch Linux / Manjaro, install the following libraries:

View File

@@ -9,7 +9,7 @@ Some of the more common approaches are outlined below.
Chromium contains logging macros which can aid debugging by printing information to console in C++ and Objective-C++.
You might use this to print out variable values, function names, and line numbers, amonst other things.
You might use this to print out variable values, function names, and line numbers, amongst other things.
Some examples:
@@ -25,7 +25,7 @@ See [logging.h](https://chromium.googlesource.com/chromium/src/base/+/refs/heads
## Printing Stacktraces
Chromium contains a helper to print stack traces to console without interrrupting the program.
Chromium contains a helper to print stack traces to console without interrupting the program.
```cpp
#include "base/debug/stack_trace.h"

View File

@@ -1,10 +1,13 @@
const {app, BrowserWindow} = require('electron')
const {app, BrowserWindow, ipcMain} = require('electron')
const path = require('path')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 800,
height: 600
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
@@ -14,6 +17,18 @@ function createWindow () {
}
})
// Listen for a message from the renderer to get the response for the Bluetooth pairing.
ipcMain.on('bluetooth-pairing-response', (event, response) => {
bluetoothPinCallback(response)
})
mainWindow.webContents.session.setBluetoothPairingHandler((details, callback) => {
bluetoothPinCallback = callback
// Send a message to the renderer to prompt the user to confirm the pairing.
mainWindow.webContents.send('bluetooth-pairing-request', details)
})
mainWindow.loadFile('index.html')
}

View File

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

View File

@@ -5,4 +5,30 @@ async function testIt() {
document.getElementById('device-name').innerHTML = device.name || `ID: ${device.id}`
}
document.getElementById('clickme').addEventListener('click',testIt)
document.getElementById('clickme').addEventListener('click',testIt)
window.electronAPI.bluetoothPairingRequest((event, details) => {
const response = {}
switch (details.pairingKind) {
case 'confirm': {
response.confirmed = confirm(`Do you want to connect to device ${details.deviceId}?`)
break
}
case 'confirmPin': {
response.confirmed = confirm(`Does the pin ${details.pin} match the pin displayed on device ${details.deviceId}?`)
break
}
case 'providePin': {
const pin = prompt(`Please provide a pin for ${details.deviceId}.`)
if (pin) {
response.pin = pin
response.confirmed = true
} else {
response.confirmed = false
}
}
}
window.electronAPI.bluetoothPairingResponse(response)
})

View File

@@ -16,6 +16,10 @@ with bluetooth devices. In order to use this API in Electron, developers will
need to handle the [`select-bluetooth-device` event on the webContents](../api/web-contents.md#event-select-bluetooth-device)
associated with the device request.
Additionally, [`ses.setBluetoothPairingHandler(handler)`](../api/session.md#sessetbluetoothpairinghandlerhandler-windows-linux)
can be used to handle pairing to bluetooth devices on Windows or Linux when
additional validation such as a pin is needed.
### Example
This example demonstrates an Electron application that automatically selects
@@ -43,7 +47,7 @@ the WebHID API:
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
can be used to provide default permissioning to devices without first calling
for permission to devices via `navigator.hid.requestDevice`. Additionally,
the default behavior of Electron is to store granted device permision through
the default behavior of Electron is to store granted device permission through
the lifetime of the corresponding WebContents. If longer term storage is
needed, a developer can store granted device permissions (eg when handling
the `select-hid-device` event) and then read from that storage with
@@ -92,7 +96,7 @@ There are several additional APIs for working with the Web Serial API:
* [`ses.setDevicePermissionHandler(handler)`](../api/session.md#sessetdevicepermissionhandlerhandler)
can be used to provide default permissioning to devices without first calling
for permission to devices via `navigator.serial.requestPort`. Additionally,
the default behavior of Electron is to store granted device permision through
the default behavior of Electron is to store granted device permission through
the lifetime of the corresponding WebContents. If longer term storage is
needed, a developer can store granted device permissions (eg when handling
the `select-serial-port` event) and then read from that storage with

View File

@@ -18,7 +18,7 @@ npm install --save-dev electron@latest
There are several major changes from our 1.x strategy outlined below. Each change is intended to satisfy the needs and priorities of developers/maintainers and app developers.
1. Strict use of the the [SemVer](#semver) spec
1. Strict use of the [SemVer](#semver) spec
2. Introduction of semver-compliant `-beta` tags
3. Introduction of [conventional commit messages](https://conventionalcommits.org/)
4. Well-defined stabilization branches

View File

@@ -50,7 +50,7 @@ guide!).
You can find the full list of "How to?" in the sidebar. If there is
something that you would like to do that is not documented, please join
our [Discord server][] and let us know!
our [Discord server][discord] and let us know!
[discord server]: https://discord.com/invite/electron
[discord]: https://discord.gg/electronjs
[fiddle]: https://www.electronjs.org/fiddle

View File

@@ -69,7 +69,7 @@ Are you getting stuck anywhere? Here are a few links to places to look:
[tutorial]: tutorial-1-prerequisites.md
[api documentation]: ../api/app.md
[chromium]: https://www.chromium.org/
[discord]: https://discord.com/invite/APGC3k5yaH
[discord]: https://discord.gg/electronjs
[examples]: examples.md
[fiddle]: https://electronjs.org/fiddle
[issue-tracker]: https://github.com/electron/electron/issues

View File

@@ -232,7 +232,7 @@ how to meet the Mac App Store requirements.
### Upload
[Apple Transporter][apple-transporter] should be used to upload the signed app to App Store
The Application Loader should be used to upload the signed app to iTunes
Connect for processing, making sure you have [created a record][create-record]
before uploading.
@@ -345,8 +345,7 @@ Electron uses following cryptographic algorithms:
[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://help.apple.com/app-store-connect/#/dev2cd126805
[apple-transporter]: https://help.apple.com/itc/transporteruserguide/en.lproj/static.html
[create-record]: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/CreatingiTunesConnectRecord.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

@@ -83,7 +83,7 @@ terminated as well.
The main process also controls your application's lifecycle through Electron's
[`app`][app] module. This module provides a large set of events and methods
that you can use to add custom application behaviour (for instance, programatically
that you can use to add custom application behaviour (for instance, programmatically
quitting your application, modifying the application dock, or showing an About panel).
As a practical example, the app shown in the [quick start guide][quick-start-lifecycle]

View File

@@ -0,0 +1,95 @@
# 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

@@ -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": "chrome",
"type": "pwa-chrome",
"webRoot": "${workspaceFolder}"
},
{
"name": "Main",
"type": "node",
"type": "pwa-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
`node`.
`pwa-node` (`pwa-` is the prefix that tells VS Code to use the latest JavaScript debugger).
- `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 `chrome`.
The renderer process is a web one, so the debugger we have to use is `pwa-chrome`.
- `Main + renderer` is a [compound task] that executes the previous ones simultaneously.
:::caution

View File

@@ -62,7 +62,7 @@ into end users' hands.
<!-- Link labels -->
[discord]: https://discord.com/invite/APGC3k5yaH
[discord]: https://discord.gg/electronjs
[github]: https://github.com/electron/electronjs.org-new/issues/new
[how-to]: ./examples.md
[node-platform]: https://nodejs.org/api/process.html#process_process_platform

View File

@@ -27,7 +27,7 @@ into your app code.
## Using update.electronjs.org
The Electron maintainers provide a free auto-updating service for open-source apps
at https://update.electronjs.org. Its requirements are:
at [https://update.electronjs.org](https://update.electronjs.org). Its requirements are:
- Your app runs on macOS or Windows
- Your app has a public GitHub repository
@@ -226,7 +226,7 @@ rest of our docs and happy developing! If you have questions, please stop by our
[autoupdater]: ../api/auto-updater.md
[code-signed]: ./code-signing.md
[discord server]: https://discord.com/invite/APGC3k5yaH
[discord server]: https://discord.gg/electronjs
[electron fiddle]: https://electronjs.org/fiddle
[fiddle-build]: https://github.com/electron/fiddle/blob/master/.github/workflows/build.yaml
[fiddle-forge-config]: https://github.com/electron/fiddle/blob/master/forge.config.js

View File

@@ -115,7 +115,7 @@ const win = new BrowserWindow({
})
```
On Windows, you can also specify additional parameters. The color of the overlay and its symbols can be specified by setting `titleBarOverlay` to an object and using the `color` and `symbolColor` properties respectively. The height of the overlay can also be specified with the `height` property.
On either platform `titleBarOverlay` can also be an object. On both macOS and Windows, the height of the overlay can be specified with the `height` property. On Windows, the color of the overlay and its symbols can be specified using the `color` and `symbolColor` properties respectively.
If a color option is not specified, the color will default to its system color for the window control buttons. Similarly, if the height option is not specified it will default to the default height:

View File

@@ -40,6 +40,7 @@ auto_filenames = {
"docs/api/power-save-blocker.md",
"docs/api/process.md",
"docs/api/protocol.md",
"docs/api/push-notifications.md",
"docs/api/safe-storage.md",
"docs/api/screen.md",
"docs/api/service-workers.md",
@@ -141,6 +142,7 @@ auto_filenames = {
"lib/common/define-properties.ts",
"lib/common/ipc-messages.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/ipc-renderer.ts",
@@ -212,6 +214,7 @@ auto_filenames = {
"lib/browser/api/power-monitor.ts",
"lib/browser/api/power-save-blocker.ts",
"lib/browser/api/protocol.ts",
"lib/browser/api/push-notifications.ts",
"lib/browser/api/safe-storage.ts",
"lib/browser/api/screen.ts",
"lib/browser/api/session.ts",

View File

@@ -129,6 +129,7 @@ filenames = {
"shell/browser/api/electron_api_menu_mac.mm",
"shell/browser/api/electron_api_native_theme_mac.mm",
"shell/browser/api/electron_api_power_monitor_mac.mm",
"shell/browser/api/electron_api_push_notifications_mac.mm",
"shell/browser/api/electron_api_system_preferences_mac.mm",
"shell/browser/api/electron_api_web_contents_mac.mm",
"shell/browser/auto_updater_mac.mm",
@@ -296,6 +297,8 @@ filenames = {
"shell/browser/api/electron_api_printing.cc",
"shell/browser/api/electron_api_protocol.cc",
"shell/browser/api/electron_api_protocol.h",
"shell/browser/api/electron_api_push_notifications.cc",
"shell/browser/api/electron_api_push_notifications.h",
"shell/browser/api/electron_api_safe_storage.cc",
"shell/browser/api/electron_api_safe_storage.h",
"shell/browser/api/electron_api_screen.cc",
@@ -413,8 +416,6 @@ filenames = {
"shell/browser/media/media_capture_devices_dispatcher.h",
"shell/browser/media/media_device_id_salt.cc",
"shell/browser/media/media_device_id_salt.h",
"shell/browser/media/media_stream_devices_controller.cc",
"shell/browser/media/media_stream_devices_controller.h",
"shell/browser/microtasks_runner.cc",
"shell/browser/microtasks_runner.h",
"shell/browser/native_browser_view.cc",
@@ -646,8 +647,6 @@ filenames = {
"shell/common/process_util.h",
"shell/common/skia_util.cc",
"shell/common/skia_util.h",
"shell/common/v8_value_converter.cc",
"shell/common/v8_value_converter.h",
"shell/common/v8_value_serializer.cc",
"shell/common/v8_value_serializer.h",
"shell/common/world_ids.h",

View File

@@ -42,9 +42,11 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__algorithm/is_sorted.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/is_sorted_until.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/iter_swap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/iterator_operations.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/lexicographical_compare.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/lower_bound.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/make_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/make_projected.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/max.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/max_element.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/merge.h",
@@ -67,14 +69,92 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__algorithm/pop_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/prev_permutation.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/push_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_adjacent_find.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_all_of.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_any_of.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_binary_search.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_clamp.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_backward.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_n.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_count.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_count_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_equal.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_equal_range.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_fill.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_fill_n.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_end.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_first_of.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_if_not.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_for_each.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_for_each_n.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_generate.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_generate_n.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_includes.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_inplace_merge.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_heap_until.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_partitioned.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_permutation.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_sorted.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_sorted_until.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_iterator_concept.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_lexicographical_compare.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_lower_bound.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_make_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_max.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_max_element.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_merge.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_min.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_min_element.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_minmax.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_minmax_element.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_mismatch.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_move.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_move_backward.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_next_permutation.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_none_of.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_nth_element.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partial_sort.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partial_sort_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition_point.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_pop_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_prev_permutation.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_push_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_copy_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_copy_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_if.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_reverse.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_reverse_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_rotate.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_rotate_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sample.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_search.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_search_n.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_difference.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_intersection.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_symmetric_difference.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_union.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_shuffle.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort_heap.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_partition.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_sort.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_swap_ranges.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_transform.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_upper_bound.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/remove.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/remove_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/remove_copy_if.h",
@@ -104,9 +184,11 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__algorithm/stable_sort.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/swap_ranges.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/transform.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/uniform_random_bit_generator_adaptor.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/unique.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/unique_copy.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_iter.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_range.h",
"//buildtools/third_party/libc++/trunk/include/__algorithm/upper_bound.h",
"//buildtools/third_party/libc++/trunk/include/__assert",
"//buildtools/third_party/libc++/trunk/include/__availability",
@@ -118,15 +200,28 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h",
"//buildtools/third_party/libc++/trunk/include/__charconv/chars_format.h",
"//buildtools/third_party/libc++/trunk/include/__charconv/from_chars_result.h",
"//buildtools/third_party/libc++/trunk/include/__charconv/tables.h",
"//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_base_10.h",
"//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/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/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/steady_clock.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/system_clock.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/time_point.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/weekday.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/year.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/year_month.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/year_month_day.h",
"//buildtools/third_party/libc++/trunk/include/__chrono/year_month_weekday.h",
"//buildtools/third_party/libc++/trunk/include/__compare/common_comparison_category.h",
"//buildtools/third_party/libc++/trunk/include/__compare/compare_partial_order_fallback.h",
"//buildtools/third_party/libc++/trunk/include/__compare/compare_strong_order_fallback.h",
@@ -169,6 +264,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__coroutine/noop_coroutine_handle.h",
"//buildtools/third_party/libc++/trunk/include/__coroutine/trivial_awaitables.h",
"//buildtools/third_party/libc++/trunk/include/__debug",
"//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h",
"//buildtools/third_party/libc++/trunk/include/__errc",
"//buildtools/third_party/libc++/trunk/include/__filesystem/copy_options.h",
"//buildtools/third_party/libc++/trunk/include/__filesystem/directory_entry.h",
@@ -186,7 +282,12 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__filesystem/recursive_directory_iterator.h",
"//buildtools/third_party/libc++/trunk/include/__filesystem/space_info.h",
"//buildtools/third_party/libc++/trunk/include/__filesystem/u8path.h",
"//buildtools/third_party/libc++/trunk/include/__format/buffer.h",
"//buildtools/third_party/libc++/trunk/include/__format/concepts.h",
"//buildtools/third_party/libc++/trunk/include/__format/enable_insertable.h",
"//buildtools/third_party/libc++/trunk/include/__format/extended_grapheme_cluster_table.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_arg.h",
"//buildtools/third_party/libc++/trunk/include/__format/format_arg_store.h",
"//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",
@@ -200,9 +301,11 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__format/formatter_floating_point.h",
"//buildtools/third_party/libc++/trunk/include/__format/formatter_integer.h",
"//buildtools/third_party/libc++/trunk/include/__format/formatter_integral.h",
"//buildtools/third_party/libc++/trunk/include/__format/formatter_output.h",
"//buildtools/third_party/libc++/trunk/include/__format/formatter_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__format/formatter_string.h",
"//buildtools/third_party/libc++/trunk/include/__format/parser_std_format_spec.h",
"//buildtools/third_party/libc++/trunk/include/__format/unicode.h",
"//buildtools/third_party/libc++/trunk/include/__functional/binary_function.h",
"//buildtools/third_party/libc++/trunk/include/__functional/binary_negate.h",
"//buildtools/third_party/libc++/trunk/include/__functional/bind.h",
@@ -210,6 +313,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__functional/bind_front.h",
"//buildtools/third_party/libc++/trunk/include/__functional/binder1st.h",
"//buildtools/third_party/libc++/trunk/include/__functional/binder2nd.h",
"//buildtools/third_party/libc++/trunk/include/__functional/boyer_moore_searcher.h",
"//buildtools/third_party/libc++/trunk/include/__functional/compose.h",
"//buildtools/third_party/libc++/trunk/include/__functional/default_searcher.h",
"//buildtools/third_party/libc++/trunk/include/__functional/function.h",
@@ -230,11 +334,16 @@ 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/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/__hash_table",
"//buildtools/third_party/libc++/trunk/include/__ios/fpos.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/access.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/advance.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/back_insert_iterator.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/bounded_iter.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/common_iterator.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/concepts.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/counted_iterator.h",
@@ -255,6 +364,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__iterator/iterator_traits.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/mergeable.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/move_iterator.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/move_sentinel.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/next.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/ostream_iterator.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/ostreambuf_iterator.h",
@@ -268,14 +378,15 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__iterator/sortable.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/unreachable_sentinel.h",
"//buildtools/third_party/libc++/trunk/include/__iterator/wrap_iter.h",
"//buildtools/third_party/libc++/trunk/include/__libcpp_version",
"//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/allocate_at_least.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocation_guard.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator.h",
"//buildtools/third_party/libc++/trunk/include/__memory/allocator_arg_t.h",
"//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/compressed_pair.h",
"//buildtools/third_party/libc++/trunk/include/__memory/concepts.h",
@@ -285,6 +396,7 @@ libcxx_headers = [
"//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/temporary_buffer.h",
"//buildtools/third_party/libc++/trunk/include/__memory/uninitialized_algorithms.h",
"//buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h",
@@ -355,8 +467,10 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__ranges/empty_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/enable_borrowed_range.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/enable_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/filter_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/iota_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/join_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/lazy_split_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/non_propagating_cache.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/owning_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/range_adaptor.h",
@@ -371,16 +485,16 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__ranges/transform_view.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/view_interface.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/views.h",
"//buildtools/third_party/libc++/trunk/include/__ranges/zip_view.h",
"//buildtools/third_party/libc++/trunk/include/__split_buffer",
"//buildtools/third_party/libc++/trunk/include/__std_stream",
"//buildtools/third_party/libc++/trunk/include/__string",
"//buildtools/third_party/libc++/trunk/include/__string/char_traits.h",
"//buildtools/third_party/libc++/trunk/include/__string/extern_template_lists.h",
"//buildtools/third_party/libc++/trunk/include/__support/android/locale_bionic.h",
"//buildtools/third_party/libc++/trunk/include/__support/fuchsia/xlocale.h",
"//buildtools/third_party/libc++/trunk/include/__support/ibm/gettod_zos.h",
"//buildtools/third_party/libc++/trunk/include/__support/ibm/limits.h",
"//buildtools/third_party/libc++/trunk/include/__support/ibm/locale_mgmt_zos.h",
"//buildtools/third_party/libc++/trunk/include/__support/ibm/nanosleep.h",
"//buildtools/third_party/libc++/trunk/include/__support/ibm/support.h",
"//buildtools/third_party/libc++/trunk/include/__support/ibm/xlocale.h",
"//buildtools/third_party/libc++/trunk/include/__support/musl/xlocale.h",
"//buildtools/third_party/libc++/trunk/include/__support/newlib/xlocale.h",
@@ -398,10 +512,136 @@ libcxx_headers = [
"//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/__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",
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_rvalue_reference.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/add_volatile.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/aligned_storage.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/aligned_union.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/alignment_of.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/apply_cv.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/can_extract_key.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/common_reference.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/common_type.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/conditional.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/conjunction.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/copy_cv.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/copy_cvref.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/decay.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/dependent_type.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/disjunction.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/enable_if.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/extent.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/has_unique_object_representation.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/has_virtual_destructor.h",
"//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_arithmetic.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_array.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_base_of.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_bounded_array.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_callable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_char_like_type.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_class.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_compound.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_const.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_constant_evaluated.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_convertible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_copy_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_copy_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_core_convertible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_default_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_destructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_empty.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_enum.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_final.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_floating_point.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_function.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_fundamental.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_implicitly_default_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_integral.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_literal_type.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_function_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_object_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_move_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_move_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_convertible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_copy_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_copy_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_default_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_destructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_move_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_move_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_null_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_object.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_pod.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_polymorphic.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_primary_template.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_reference.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_reference_wrapper.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_referenceable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_same.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_scalar.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_scoped_enum.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed_integer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_standard_layout.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_swappable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivial.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copy_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copy_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copyable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_default_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_destructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_assignable.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_constructible.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_unbounded_array.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_union.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_unsigned.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_unsigned_integer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_valid_expansion.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_void.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/is_volatile.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/lazy.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_32_64_or_128_bit.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_const_lvalue_ref.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_signed.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/make_unsigned.h",
"//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/promote.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/rank.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_all_extents.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_const.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_const_ref.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_cv.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_cvref.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_extent.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_pointer.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_reference.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/remove_volatile.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/result_of.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/type_identity.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/type_list.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/underlying_type.h",
"//buildtools/third_party/libc++/trunk/include/__type_traits/void_t.h",
"//buildtools/third_party/libc++/trunk/include/__undef_macros",
"//buildtools/third_party/libc++/trunk/include/__utility/as_const.h",
"//buildtools/third_party/libc++/trunk/include/__utility/auto_cast.h",
"//buildtools/third_party/libc++/trunk/include/__utility/cmp.h",
"//buildtools/third_party/libc++/trunk/include/__utility/convert_to_integral.h",
"//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",
@@ -417,6 +657,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/__utility/transaction.h",
"//buildtools/third_party/libc++/trunk/include/__utility/unreachable.h",
"//buildtools/third_party/libc++/trunk/include/__variant/monostate.h",
"//buildtools/third_party/libc++/trunk/include/__verbose_abort",
"//buildtools/third_party/libc++/trunk/include/algorithm",
"//buildtools/third_party/libc++/trunk/include/any",
"//buildtools/third_party/libc++/trunk/include/array",
@@ -512,7 +753,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/map",
"//buildtools/third_party/libc++/trunk/include/math.h",
"//buildtools/third_party/libc++/trunk/include/memory",
"//buildtools/third_party/libc++/trunk/include/module.modulemap",
"//buildtools/third_party/libc++/trunk/include/module.modulemap.in",
"//buildtools/third_party/libc++/trunk/include/mutex",
"//buildtools/third_party/libc++/trunk/include/new",
"//buildtools/third_party/libc++/trunk/include/numbers",
@@ -532,6 +773,7 @@ libcxx_headers = [
"//buildtools/third_party/libc++/trunk/include/span",
"//buildtools/third_party/libc++/trunk/include/sstream",
"//buildtools/third_party/libc++/trunk/include/stack",
"//buildtools/third_party/libc++/trunk/include/stdatomic.h",
"//buildtools/third_party/libc++/trunk/include/stdbool.h",
"//buildtools/third_party/libc++/trunk/include/stddef.h",
"//buildtools/third_party/libc++/trunk/include/stdexcept",

View File

@@ -20,7 +20,7 @@ const spawnUpdate = function (args: string[], detached: boolean, callback: Funct
try {
// Ensure we don't spawn multiple squirrel processes
// Process spawned, same args: Attach events to alread running process
// Process spawned, same args: Attach events to already running process
// Process spawned, different args: Return with error
// No process spawned: Spawn new process
if (spawnedProcess && !isSameArgs(args)) {

View File

@@ -2,7 +2,4 @@ import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
const ipcMain = new IpcMainImpl();
// Do not throw exception when channel name is "error".
ipcMain.on('error', () => {});
export default ipcMain;

View File

@@ -142,7 +142,7 @@ Menu.prototype.insert = function (pos, item) {
if (item.icon) this.setIcon(pos, item.icon);
if (item.role) this.setRole(pos, item.role);
// Make menu accessable to items.
// Make menu accessible to items.
item.overrideReadOnlyProperty('menu', this);
// Remember the items.

View File

@@ -22,6 +22,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'Notification', loader: () => require('./notification') },
{ name: 'powerMonitor', loader: () => require('./power-monitor') },
{ name: 'powerSaveBlocker', loader: () => require('./power-save-blocker') },
{ name: 'pushNotifications', loader: () => require('./push-notifications') },
{ name: 'protocol', loader: () => require('./protocol') },
{ name: 'safeStorage', loader: () => require('./safe-storage') },
{ name: 'screen', loader: () => require('./screen') },

View File

@@ -0,0 +1,3 @@
const { pushNotifications } = process._linkedBinding('electron_browser_push_notifications');
export default pushNotifications;

View File

@@ -9,12 +9,15 @@ import { ipcMainInternal } from '@electron/internal/browser/ipc-main-internal';
import * as ipcMainUtils from '@electron/internal/browser/ipc-main-internal-utils';
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
// session is not used here, the purpose is to make sure session is initalized
// session is not used here, the purpose is to make sure session is initialized
// before the webContents module.
// eslint-disable-next-line
session
const webFrameMainBinding = process._linkedBinding('electron_browser_web_frame_main');
let nextId = 0;
const getNextId = function () {
return ++nextId;
@@ -63,6 +66,20 @@ const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
}
} as const;
const paperFormats: Record<string, ElectronInternal.PageSize> = {
letter: { width: 8.5, height: 11 },
legal: { width: 8.5, height: 14 },
tabloid: { width: 11, height: 17 },
ledger: { width: 17, height: 11 },
a0: { width: 33.1, height: 46.8 },
a1: { width: 23.4, height: 33.1 },
a2: { width: 16.54, height: 23.4 },
a3: { width: 11.7, height: 16.54 },
a4: { width: 8.27, height: 11.7 },
a5: { width: 5.83, height: 8.27 },
a6: { width: 4.13, height: 5.83 }
} as const;
// The minimum micron size Chromium accepts is that where:
// Per printing/units.h:
// * kMicronsPerInch - Length of an inch in 0.001mm unit.
@@ -76,42 +93,6 @@ const isValidCustomPageSize = (width: number, height: number) => {
return [width, height].every(x => x > 352);
};
// Default printing setting
const defaultPrintingSetting = {
// Customizable.
pageRange: [] as {from: number, to: number}[],
mediaSize: {} as ElectronInternal.MediaSize,
landscape: false,
headerFooterEnabled: false,
marginsType: 0,
scaleFactor: 100,
shouldPrintBackgrounds: false,
shouldPrintSelectionOnly: false,
// Non-customizable.
printWithCloudPrint: false,
printWithPrivet: false,
printWithExtension: false,
pagesPerSheet: 1,
isFirstRequest: false,
previewUIID: 0,
// True, if the document source is modifiable. e.g. HTML and not PDF.
previewModifiable: true,
printToPDF: true,
deviceName: 'Save as PDF',
generateDraftData: true,
dpiHorizontal: 72,
dpiVertical: 72,
rasterizePDF: false,
duplex: 0,
copies: 1,
// 2 = color - see ColorModel in //printing/print_job_constants.h
color: 2,
collate: true,
printerType: 2,
title: undefined as string | undefined,
url: undefined as string | undefined
} as const;
// JavaScript implementations of WebContents.
const binding = process._linkedBinding('electron_browser_web_contents');
const printing = process._linkedBinding('electron_browser_printing');
@@ -146,13 +127,6 @@ WebContents.prototype.sendToFrame = function (frameId, channel, ...args) {
return true;
};
WebContents.prototype._sendToFrameInternal = function (frameId, channel, ...args) {
const frame = getWebFrame(this, frameId);
if (!frame) return false;
frame._sendInternal(channel, ...args);
return true;
};
// Following methods are mapped to webFrame.
const webFrameMethods = [
'insertCSS',
@@ -193,136 +167,136 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (worldId
let pendingPromise: Promise<any> | undefined;
WebContents.prototype.printToPDF = async function (options) {
const printSettings: Record<string, any> = {
...defaultPrintingSetting,
requestID: getNextId()
requestID: getNextId(),
landscape: false,
displayHeaderFooter: false,
headerTemplate: '',
footerTemplate: '',
printBackground: false,
scale: 1,
paperWidth: 8.5,
paperHeight: 11,
marginTop: 0,
marginBottom: 0,
marginLeft: 0,
marginRight: 0,
pageRanges: '',
preferCSSPageSize: false
};
if (options.landscape !== undefined) {
if (typeof options.landscape !== 'boolean') {
const error = new Error('landscape must be a Boolean');
return Promise.reject(error);
return Promise.reject(new Error('landscape must be a Boolean'));
}
printSettings.landscape = options.landscape;
}
if (options.scaleFactor !== undefined) {
if (typeof options.scaleFactor !== 'number') {
const error = new Error('scaleFactor must be a Number');
return Promise.reject(error);
if (options.displayHeaderFooter !== undefined) {
if (typeof options.displayHeaderFooter !== 'boolean') {
return Promise.reject(new Error('displayHeaderFooter must be a Boolean'));
}
printSettings.scaleFactor = options.scaleFactor;
}
if (options.marginsType !== undefined) {
if (typeof options.marginsType !== 'number') {
const error = new Error('marginsType must be a Number');
return Promise.reject(error);
}
printSettings.marginsType = options.marginsType;
}
if (options.printSelectionOnly !== undefined) {
if (typeof options.printSelectionOnly !== 'boolean') {
const error = new Error('printSelectionOnly must be a Boolean');
return Promise.reject(error);
}
printSettings.shouldPrintSelectionOnly = options.printSelectionOnly;
printSettings.displayHeaderFooter = options.displayHeaderFooter;
}
if (options.printBackground !== undefined) {
if (typeof options.printBackground !== 'boolean') {
const error = new Error('printBackground must be a Boolean');
return Promise.reject(error);
return Promise.reject(new Error('printBackground must be a Boolean'));
}
printSettings.shouldPrintBackgrounds = options.printBackground;
}
if (options.pageRanges !== undefined) {
const pageRanges = options.pageRanges;
if (!Object.prototype.hasOwnProperty.call(pageRanges, 'from') || !Object.prototype.hasOwnProperty.call(pageRanges, 'to')) {
const error = new Error('pageRanges must be an Object with \'from\' and \'to\' properties');
return Promise.reject(error);
if (options.scale !== undefined) {
if (typeof options.scale !== 'number') {
return Promise.reject(new Error('scale must be a Number'));
}
if (typeof pageRanges.from !== 'number') {
const error = new Error('pageRanges.from must be a Number');
return Promise.reject(error);
}
if (typeof pageRanges.to !== 'number') {
const error = new Error('pageRanges.to must be a Number');
return Promise.reject(error);
}
// Chromium uses 1-based page ranges, so increment each by 1.
printSettings.pageRange = [{
from: pageRanges.from + 1,
to: pageRanges.to + 1
}];
printSettings.scaleFactor = options.scale;
}
if (options.headerFooter !== undefined) {
const headerFooter = options.headerFooter;
printSettings.headerFooterEnabled = true;
if (typeof headerFooter === 'object') {
if (!headerFooter.url || !headerFooter.title) {
const error = new Error('url and title properties are required for headerFooter');
return Promise.reject(error);
const { pageSize } = options;
if (pageSize !== undefined) {
if (typeof pageSize === 'string') {
const format = paperFormats[pageSize.toLowerCase()];
if (!format) {
return Promise.reject(new Error(`Invalid pageSize ${pageSize}`));
}
if (typeof headerFooter.title !== 'string') {
const error = new Error('headerFooter.title must be a String');
return Promise.reject(error);
}
printSettings.title = headerFooter.title;
if (typeof headerFooter.url !== 'string') {
const error = new Error('headerFooter.url must be a String');
return Promise.reject(error);
}
printSettings.url = headerFooter.url;
} else {
const error = new Error('headerFooter must be an Object');
return Promise.reject(error);
}
}
// Optionally set size for PDF.
if (options.pageSize !== undefined) {
const pageSize = options.pageSize;
if (typeof pageSize === 'object') {
printSettings.paperWidth = format.width;
printSettings.paperHeight = format.height;
} else if (typeof options.pageSize === 'object') {
if (!pageSize.height || !pageSize.width) {
const error = new Error('height and width properties are required for pageSize');
return Promise.reject(error);
return Promise.reject(new Error('height and width properties are required for pageSize'));
}
// Dimensions in Microns - 1 meter = 10^6 microns
const height = Math.ceil(pageSize.height);
const width = Math.ceil(pageSize.width);
if (!isValidCustomPageSize(width, height)) {
const error = new Error('height and width properties must be minimum 352 microns.');
return Promise.reject(error);
}
printSettings.mediaSize = {
name: 'CUSTOM',
custom_display_name: 'Custom',
height_microns: height,
width_microns: width
};
} else if (Object.prototype.hasOwnProperty.call(PDFPageSizes, pageSize)) {
printSettings.mediaSize = PDFPageSizes[pageSize];
printSettings.paperWidth = pageSize.width;
printSettings.paperHeight = pageSize.height;
} else {
const error = new Error(`Unsupported pageSize: ${pageSize}`);
return Promise.reject(error);
return Promise.reject(new Error('pageSize must be a String or Object'));
}
} else {
printSettings.mediaSize = PDFPageSizes.A4;
}
// Chromium expects this in a 0-100 range number, not as float
printSettings.scaleFactor = Math.ceil(printSettings.scaleFactor) % 100;
// PrinterType enum from //printing/print_job_constants.h
printSettings.printerType = 2;
const { margins } = options;
if (margins !== undefined) {
if (typeof margins !== 'object') {
return Promise.reject(new Error('margins must be an Object'));
}
if (margins.top !== undefined) {
if (typeof margins.top !== 'number') {
return Promise.reject(new Error('margins.top must be a Number'));
}
printSettings.marginTop = margins.top;
}
if (margins.bottom !== undefined) {
if (typeof margins.bottom !== 'number') {
return Promise.reject(new Error('margins.bottom must be a Number'));
}
printSettings.marginBottom = margins.bottom;
}
if (margins.left !== undefined) {
if (typeof margins.left !== 'number') {
return Promise.reject(new Error('margins.left must be a Number'));
}
printSettings.marginLeft = margins.left;
}
if (margins.right !== undefined) {
if (typeof margins.right !== 'number') {
return Promise.reject(new Error('margins.right must be a Number'));
}
printSettings.marginRight = margins.right;
}
}
if (options.pageRanges !== undefined) {
if (typeof options.pageRanges !== 'string') {
return Promise.reject(new Error('printBackground must be a String'));
}
printSettings.pageRanges = options.pageRanges;
}
if (options.headerTemplate !== undefined) {
if (typeof options.headerTemplate !== 'string') {
return Promise.reject(new Error('headerTemplate must be a String'));
}
printSettings.headerTemplate = options.headerTemplate;
}
if (options.footerTemplate !== undefined) {
if (typeof options.footerTemplate !== 'string') {
return Promise.reject(new Error('footerTemplate must be a String'));
}
printSettings.footerTemplate = options.footerTemplate;
}
if (options.preferCSSPageSize !== undefined) {
if (typeof options.preferCSSPageSize !== 'boolean') {
return Promise.reject(new Error('footerTemplate must be a String'));
}
printSettings.preferCSSPageSize = options.preferCSSPageSize;
}
if (this._printToPDF) {
if (pendingPromise) {
pendingPromise = pendingPromise.then(() => this._printToPDF(printSettings));
@@ -475,14 +449,12 @@ 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);
@@ -564,6 +536,11 @@ const addReturnValueToEvent = (event: Electron.IpcMainEvent) => {
});
};
const getWebFrameForEvent = (event: Electron.IpcMainEvent | Electron.IpcMainInvokeEvent) => {
if (!event.processId || !event.frameId) return null;
return webFrameMainBinding.fromIdOrNull(event.processId, event.frameId);
};
const commandLine = process._linkedBinding('electron_common_command_line');
const environment = process._linkedBinding('electron_common_environment');
@@ -587,6 +564,12 @@ WebContents.prototype._init = function () {
this._windowOpenHandler = null;
const ipc = new IpcMainImpl();
Object.defineProperty(this, 'ipc', {
get () { return ipc; },
enumerable: true
});
// Dispatch IPC messages to the ipc module.
this.on('-ipc-message' as any, function (this: Electron.WebContents, event: Electron.IpcMainEvent, internal: boolean, channel: string, args: any[]) {
addSenderFrameToEvent(event);
@@ -595,6 +578,9 @@ WebContents.prototype._init = function () {
} else {
addReplyToEvent(event);
this.emit('ipc-message', event, channel, ...args);
const maybeWebFrame = getWebFrameForEvent(event);
maybeWebFrame && maybeWebFrame.ipc.emit(channel, event, ...args);
ipc.emit(channel, event, ...args);
ipcMain.emit(channel, event, ...args);
}
});
@@ -606,8 +592,10 @@ WebContents.prototype._init = function () {
console.error(`Error occurred in handler for '${channel}':`, error);
event.sendReply({ error: error.toString() });
};
const target = internal ? ipcMainInternal : ipcMain;
if ((target as any)._invokeHandlers.has(channel)) {
const maybeWebFrame = getWebFrameForEvent(event);
const targets: (ElectronInternal.IpcMainInternal| null)[] = internal ? [ipcMainInternal] : [maybeWebFrame && maybeWebFrame.ipc, ipc, ipcMain];
const target = targets.find(target => target && (target as any)._invokeHandlers.has(channel));
if (target) {
(target as any)._invokeHandlers.get(channel)(event, ...args);
} else {
event._throw(`No handler registered for '${channel}'`);
@@ -621,10 +609,13 @@ WebContents.prototype._init = function () {
ipcMainInternal.emit(channel, event, ...args);
} else {
addReplyToEvent(event);
if (this.listenerCount('ipc-message-sync') === 0 && ipcMain.listenerCount(channel) === 0) {
const maybeWebFrame = getWebFrameForEvent(event);
if (this.listenerCount('ipc-message-sync') === 0 && ipc.listenerCount(channel) === 0 && ipcMain.listenerCount(channel) === 0 && (!maybeWebFrame || maybeWebFrame.ipc.listenerCount(channel) === 0)) {
console.warn(`WebContents #${this.id} called ipcRenderer.sendSync() with '${channel}' channel without listeners.`);
}
this.emit('ipc-message-sync', event, channel, ...args);
maybeWebFrame && maybeWebFrame.ipc.emit(channel, event, ...args);
ipc.emit(channel, event, ...args);
ipcMain.emit(channel, event, ...args);
}
});
@@ -632,6 +623,9 @@ WebContents.prototype._init = function () {
this.on('-ipc-ports' as any, function (event: Electron.IpcMainEvent, internal: boolean, channel: string, message: any, ports: any[]) {
addSenderFrameToEvent(event);
event.ports = ports.map(p => new MessagePortMain(p));
const maybeWebFrame = getWebFrameForEvent(event);
maybeWebFrame && maybeWebFrame.ipc.emit(channel, event, message);
ipc.emit(channel, event, message);
ipcMain.emit(channel, event, message);
});

View File

@@ -1,7 +1,16 @@
import { MessagePortMain } from '@electron/internal/browser/message-port-main';
import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
const { WebFrameMain, fromId } = process._linkedBinding('electron_browser_web_frame_main');
Object.defineProperty(WebFrameMain.prototype, 'ipc', {
get () {
const ipc = new IpcMainImpl();
Object.defineProperty(this, 'ipc', { value: ipc });
return ipc;
}
});
WebFrameMain.prototype.send = function (channel, ...args) {
if (typeof channel !== 'string') {
throw new Error('Missing required channel argument');

View File

@@ -31,7 +31,7 @@ export const setDefaultApplicationMenu = () => {
{
label: 'Community Discussions',
click: async () => {
await shell.openExternal('https://discord.com/invite/APGC3k5yaH');
await shell.openExternal('https://discord.gg/electronjs');
}
},
{

View File

@@ -4,6 +4,13 @@ import { IpcMainInvokeEvent } from 'electron/main';
export class IpcMainImpl extends EventEmitter {
private _invokeHandlers: Map<string, (e: IpcMainInvokeEvent, ...args: any[]) => void> = new Map();
constructor () {
super();
// Do not throw exception when channel name is "error".
this.on('error', () => {});
}
handle: Electron.IpcMain['handle'] = (method, fn) => {
if (this._invokeHandlers.has(method)) {
throw new Error(`Attempted to register a second handler for '${method}'`);

View File

@@ -1,6 +1,3 @@
import { IpcMainImpl } from '@electron/internal/browser/ipc-main-impl';
export const ipcMainInternal = new IpcMainImpl() as ElectronInternal.IpcMainInternal;
// Do not throw exception when channel name is "error".
ipcMainInternal.on('error', () => {});

View File

@@ -8,16 +8,8 @@ export interface GuestViewDelegate {
dispatchEvent (eventName: string, props: Record<string, any>): void;
}
const DEPRECATED_EVENTS: Record<string, string> = {
'page-title-updated': 'page-title-set'
} as const;
export function registerEvents (viewInstanceId: number, delegate: GuestViewDelegate) {
ipcRendererInternal.on(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DISPATCH_EVENT}-${viewInstanceId}`, function (event, eventName, props) {
if (DEPRECATED_EVENTS[eventName] != null) {
delegate.dispatchEvent(DEPRECATED_EVENTS[eventName], props);
}
delegate.dispatchEvent(eventName, props);
});
}

View File

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

View File

@@ -70,22 +70,8 @@ function isInstalled () {
// unzips and makes path.txt point at the correct executable
function extractFile (zipPath) {
const distPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist');
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) {
fs.renameSync(srcTypeDefPath, targetTypeDefPath);
}
// Write a "path.txt" file.
return fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath);
});
return extract(zipPath, { dir: path.join(__dirname, 'dist') })
.then(() => fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath));
}
function getPlatformPath () {

View File

@@ -1,13 +1,12 @@
{
"name": "electron",
"version": "0.0.0-development",
"version": "21.0.0",
"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/asar": "^3.2.1",
"@electron/docs-parser": "^1.0.0",
"@electron/typescript-definitions": "^8.10.0",
"@electron/docs-parser": "^0.12.4",
"@electron/typescript-definitions": "^8.9.5",
"@octokit/auth-app": "^2.10.0",
"@octokit/rest": "^18.0.3",
"@primer/octicons": "^10.0.0",
@@ -32,6 +31,7 @@
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.1",
"asar": "^3.1.0",
"aws-sdk": "^2.814.0",
"check-for-leaks": "^1.2.1",
"colors": "1.4.0",
@@ -47,8 +47,8 @@
"express": "^4.16.4",
"folder-hash": "^2.1.1",
"fs-extra": "^9.0.1",
"got": "^6.3.0",
"husky": "^6.0.0",
"got": "^11.8.5",
"husky": "^8.0.1",
"klaw": "^3.0.0",
"lint": "^1.1.2",
"lint-staged": "^10.2.11",
@@ -89,7 +89,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": "node script/create-api-json.js",
"create-api-json": "electron-docs-parser --dir=./",
"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",
@@ -146,4 +146,4 @@
"resolutions": {
"nan": "nodejs/nan#16fa32231e2ccd89d2804b3f765319128b20c4ac"
}
}
}

View File

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

View File

@@ -1,46 +0,0 @@
From b8636b57b8f231994ecb3fb14f181c593c83a3fb Mon Sep 17 00:00:00 2001
From: Jamie Madill <jmadill@chromium.org>
Date: Mon, 29 Aug 2022 16:25:46 -0400
Subject: [PATCH] [M106] Vulkan: Ensure we sync the draw FB before beingQuery.
Bug: chromium:1354271
(cherry picked from commit 4ebdac790c76b65abf5703bcef9482c638076195)
Change-Id: I7b715a9c28badfe58a0ae1a478d2b4e8bbd23c47
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956939
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
---
diff --git a/src/libANGLE/State.h b/src/libANGLE/State.h
index 168104e..2f498d3 100644
--- a/src/libANGLE/State.h
+++ b/src/libANGLE/State.h
@@ -603,6 +603,11 @@
bool isRobustResourceInitEnabled() const { return mRobustResourceInit; }
+ bool isDrawFramebufferBindingDirty() const
+ {
+ return mDirtyBits.test(DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING);
+ }
+
// Sets the dirty bit for the program executable.
angle::Result onProgramExecutableChange(const Context *context, Program *program);
// Sets the dirty bit for the program pipeline executable.
diff --git a/src/libANGLE/renderer/vulkan/QueryVk.cpp b/src/libANGLE/renderer/vulkan/QueryVk.cpp
index 9f475e6..6ef5f72 100644
--- a/src/libANGLE/renderer/vulkan/QueryVk.cpp
+++ b/src/libANGLE/renderer/vulkan/QueryVk.cpp
@@ -303,6 +303,13 @@
{
ContextVk *contextVk = vk::GetImpl(context);
+ // Ensure that we start with the right RenderPass when we begin a new query.
+ if (contextVk->getState().isDrawFramebufferBindingDirty())
+ {
+ ANGLE_TRY(contextVk->flushCommandsAndEndRenderPass(
+ RenderPassClosureReason::FramebufferBindingChange));
+ }
+
mCachedResultValid = false;
// Transform feedback query is handled by a CPU-calculated value when emulated.

View File

@@ -12,7 +12,6 @@ webview_cross_drag.patch
gin_enable_disable_v8_platform.patch
disable-redraw-lock.patch
enable_reset_aspect_ratio.patch
v8_context_snapshot_generator.patch
boringssl_build_gn.patch
pepper_plugin_support.patch
gtk_visibility.patch
@@ -77,7 +76,6 @@ chore_provide_iswebcontentscreationoverridden_with_full_params.patch
fix_properly_honor_printing_page_ranges.patch
export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch
fix_export_zlib_symbols.patch
don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch
web_contents.patch
webview_fullscreen.patch
disable_unload_metrics.patch
@@ -110,36 +108,18 @@ make_gtk_getlibgtk_public.patch
build_disable_print_content_analysis.patch
custom_protocols_plzserviceworker.patch
feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
posix_replace_doubleforkandexec_with_forkandspawn.patch
fix_allow_guest_webcontents_to_enter_fullscreen.patch
disable_freezing_flags_after_init_in_node.patch
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
chore_add_electron_deps_to_gitignores.patch
chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
fix_mac_build_with_enable_plugins_false.patch
fix_windows_build_with_enable_plugins_false.patch
remove_default_window_title.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
cherry-pick-2083e894852c.patch
cherry-pick-51daffbf5cd8.patch
dpwa_enable_window_controls_overlay_by_default.patch
fix_revert_emulationhandler_update_functions_to_early_return.patch
fix_return_v8_value_from_localframe_requestexecutescript.patch
disable_optimization_guide_for_preconnect_feature.patch
fix_the_gn_gen_for_components_segmentation_platform.patch
fix_crash_loading_non-standard_schemes_in_iframes.patch
create_browser_v8_snapshot_file_name_fuse.patch
cherry-pick-fefd6198da31.patch
cherry-pick-1eb1e18ad41d.patch
cherry-pick-05a0d99c9715.patch
cherry-pick-c83640db21b5.patch
fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch
cherry-pick-65f0ef609c00.patch
cherry-pick-cb9dff93f3d4.patch
build_fix_building_with_enable_plugins_false.patch
build_allow_electron_to_use_exec_script.patch
cherry-pick-d5ffb4dd4112.patch
cherry-pick-933cc81c6bad.patch
cherry-pick-06c87f9f42ff.patch
cherry-pick-67c9cbc784d6.patch
cherry-pick-a1cbf05b4163.patch
cherry-pick-ac4785387fff.patch
cherry-pick-81cb17c24788.patch
cherry-pick-1894458e04a2.patch
cherry-pick-6b4af5d82083.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 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a1f702d8b 100644
index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f942b277b 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -11,6 +11,7 @@
@@ -44,7 +44,7 @@ index 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a
}
#if BUILDFLAG(IS_MAC)
@@ -447,7 +457,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
@@ -445,7 +455,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
const std::u16string& shortcut) const {
std::u16string result = shortcut;
@@ -53,7 +53,7 @@ index 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a
result = ApplyModifierToAcceleratorString(result, IDS_APP_SHIFT_KEY);
// Note that we use 'else-if' in order to avoid using Ctrl+Alt as a shortcut.
@@ -455,7 +465,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
@@ -453,7 +463,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
// more information.
if (IsCtrlDown())
result = ApplyModifierToAcceleratorString(result, IDS_APP_CTRL_KEY);

View File

@@ -10,7 +10,7 @@ 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 3cd3d27448485e30dda92782df2df1e11635b26b..39c1615e0ac1456d2d2b350e03ef6e56c8efee53 100644
index d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f676d35507e 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -24,16 +24,16 @@ index 3cd3d27448485e30dda92782df2df1e11635b26b..39c1615e0ac1456d2d2b350e03ef6e56
// 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
@@ -345,7 +349,6 @@ int GpuMain(MainFunctionParams parameters) {
ChildProcess gpu_process(io_thread_priority);
DCHECK(base::ThreadPoolInstance::Get()->WasStarted());
@@ -323,7 +327,6 @@ int GpuMain(MainFunctionParams parameters) {
const_cast<base::CommandLine*>(&command_line), gpu_preferences);
const bool dead_on_arrival = !init_success;
- auto* client = GetContentClient()->gpu();
if (client)
client->PostIOThreadCreated(gpu_process.io_task_runner());
if (client) {
client->PostSandboxInitialized();
}
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index 04274b751b498456fc4b269bfbc6399b4f27d3ed..2fb98baf0df4e191e5e18fd7055cc2d92a2156df 100644
index a5d868b9e409c986bc85dfd71bb0363b5fa22145..9abe1cf5b2cc8ce60387ddf81b7c13aff9c178c4 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -29,6 +29,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 accbd08ec3f126e5fd5d5f3c7f636d8ccea56457..59e6c571ceb6699ddcb5cb178383ed382b277dea 100644
index 7d169540590b83924766b1d423dc1bc46ab35250..f5bbb6ab26bd714d667236071a2eb0a5794a5631 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 accbd08ec3f126e5fd5d5f3c7f636d8ccea56457..59e6c571ceb6699ddcb5cb178383ed38
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 2c84b31ec771c11818e677e5d120fb965db6da86..f703ab8f616e9765ed3384654a271f251c16ac71 100644
index 8199122b2d759aa8b27affabe67b108fb9a16c38..97cf24ad5f4a64322f242b0c339a807e3edb23fc 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4469,6 +4469,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4345,6 +4345,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index 2c84b31ec771c11818e677e5d120fb965db6da86..f703ab8f616e9765ed3384654a271f25
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 3d492ed695a78519207c3e760405b2b7f4edb80e..d6ea308e4eaba67a597af2c08c406942588811a1 100644
index c8e822502d1b18c701a303024c3cba7e434d7829..89a048fbdaec8a8ea184790b78b0c63cfda7d171 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -608,6 +608,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -588,6 +588,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 3d492ed695a78519207c3e760405b2b7f4edb80e..d6ea308e4eaba67a597af2c08c406942
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 97c7d874e74ed65e960b1cce18edc1520583a2ab..c6317472b0ce1375e1c5762be59684a74c7bcde5 100644
index 4ef7353157272a623cea6b086b84da72ca795fca..548f6afd429695088bd83743fa6f6c1cd4197276 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -602,6 +602,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -584,6 +584,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -67,10 +67,10 @@ index 97c7d874e74ed65e960b1cce18edc1520583a2ab..c6317472b0ce1375e1c5762be59684a7
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 a6ba8411384855c82712960375bc949c5c2bd522..fc86ca807c9c1bda9236160580b094153778e18b 100644
index c8af53d40eaa1dd3a0067948a8cda80d1599cee3..4de918ee52efa7ec27a21aa2f57616d31dfd07d1 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
@@ -207,6 +207,7 @@ void LocalWindowProxy::Initialize() {
@@ -209,6 +209,7 @@ void LocalWindowProxy::Initialize() {
}
InstallConditionalFeatures();
@@ -79,10 +79,10 @@ index a6ba8411384855c82712960375bc949c5c2bd522..fc86ca807c9c1bda9236160580b09415
if (World().IsMainWorld()) {
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index c5b2d86bb3f7d75e99fda9c116dfd8f6ba036f1b..9d3e10d067006fa2043929dc3f9ab39f9bc126c9 100644
index 83a62e23b1d395b0aa545de5b828c24196cccc6d..0ca8163eb9ab87aead27bc8b2ee9e614d7e1d8c7 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -298,6 +298,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -301,6 +301,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
@@ -92,7 +92,7 @@ index c5b2d86bb3f7d75e99fda9c116dfd8f6ba036f1b..9d3e10d067006fa2043929dc3f9ab39f
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 da7bd0f6c3aa7f4b787c404e1d169ee261e17836..ad2e7a0905dd7678a1f29aa03c9571bc84678029 100644
index 2ac22a0410eea7f67cc7eb066879da649f7c6a0e..53ec3d177afbd75b4e67c6ab847094994c291dcb 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(
@@ -110,7 +110,7 @@ index da7bd0f6c3aa7f4b787c404e1d169ee261e17836..ad2e7a0905dd7678a1f29aa03c9571bc
v8::Local<v8::Context> context,
int32_t world_id) {
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
index f2e228ab14d71999c64c204d5f65df326fadbd17..d983d944a5d28de8711c50efe73e4b104b403f9b 100644
index c974fa2f7c7f9c2aa5f075ec4aeb887d0b104453..b4ed9b2fadcfad7676387045b8581eb8d33e89e8 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -80,6 +80,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -123,10 +123,10 @@ index f2e228ab14d71999c64c204d5f65df326fadbd17..d983d944a5d28de8711c50efe73e4b10
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 a9bd5283d3c65728dd3293abe88ffd02d3eee4fc..f5e4a927f2f5114e62d76fec86d6a5d2d2321166 100644
index a2d7e97958d378dc5d37524f2f5516205c010749..e3f605938b3eea7f1c4dfac8e3c25014ebd15476 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -352,6 +352,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
@@ -367,6 +367,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}

View File

@@ -8,15 +8,15 @@ 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 12193ad9090de969b81fa6aa6bed9520aea5bae1..99ea60219b39a6864bdea45ba0917316bff7f2d9 100644
index 1fbb58152c19193d480b437aea123abdd61c24fe..2b7e305d643aa2e0afef4c578688897c3a8832bf 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -556,13 +556,15 @@ std::unique_ptr<views::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
@@ -500,13 +500,15 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
return nullptr;
}
-views::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
+views::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
-ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
+ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
if (!GtkCheckVersion(3, 14))
return nullptr;
auto& provider =
@@ -31,24 +31,24 @@ index 12193ad9090de969b81fa6aa6bed9520aea5bae1..99ea60219b39a6864bdea45ba0917316
}
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
index 65f9d6c81804d1b0efb88ced4a9c80c000ba0f5a..35d851a054a2b2f9887c77a9faaf16ce1aa363b9 100644
index e73bbdf28fba1f5b96d326dd7b0fd9aaa33ba221..5a537c8f6291909392824d62fc04209ad662d59a 100644
--- a/ui/gtk/gtk_ui.h
+++ b/ui/gtk/gtk_ui.h
@@ -89,7 +89,7 @@ class GtkUi : public views::LinuxUI {
@@ -94,7 +94,7 @@ class GtkUi : public ui::LinuxUiBase {
bool PreferDarkTheme() const override;
bool AnimationsEnabled() const override;
std::unique_ptr<views::NavButtonProvider> CreateNavButtonProvider() override;
- views::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
+ views::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) 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;
@@ -188,6 +188,8 @@ class GtkUi : public views::LinuxUI {
@@ -199,6 +199,8 @@ class GtkUi : public ui::LinuxUiBase {
// while Chrome is running.
std::unique_ptr<views::WindowFrameProvider> solid_frame_provider_;
std::unique_ptr<views::WindowFrameProvider> transparent_frame_provider_;
+ std::unique_ptr<views::WindowFrameProvider> solid_maximized_frame_provider_;
+ std::unique_ptr<views::WindowFrameProvider> transparent_maximized_frame_provider_;
std::unique_ptr<ui::WindowFrameProvider> solid_frame_provider_;
std::unique_ptr<ui::WindowFrameProvider> transparent_frame_provider_;
+ std::unique_ptr<ui::WindowFrameProvider> solid_maximized_frame_provider_;
+ std::unique_ptr<ui::WindowFrameProvider> transparent_maximized_frame_provider_;
};
} // namespace gtk
@@ -139,19 +139,19 @@ 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 d3039d73161378197557947aece88d2710c1e486..f7d4605938210b0b75517bb7bcab28b588a16520 100644
index 8370c1cb3f8c3532d94e1265242cbf2397920480..2e0105ba8782dfe0a3ac169850734032c8ab071c 100644
--- a/ui/gtk/window_frame_provider_gtk.h
+++ b/ui/gtk/window_frame_provider_gtk.h
@@ -14,7 +14,7 @@ namespace gtk {
class WindowFrameProviderGtk : public views::WindowFrameProvider {
class WindowFrameProviderGtk : public ui::WindowFrameProvider {
public:
- explicit WindowFrameProviderGtk(bool solid_frame);
+ explicit WindowFrameProviderGtk(bool solid_frame, bool maximized);
WindowFrameProviderGtk(const WindowFrameProviderGtk&) = delete;
WindowFrameProviderGtk& operator=(const WindowFrameProviderGtk&) = delete;
@@ -69,6 +69,9 @@ class WindowFrameProviderGtk : public views::WindowFrameProvider {
@@ -69,6 +69,9 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
// Cached bitmaps and metrics. The scale is rounded to percent.
base::flat_map<int, Asset> assets_;
@@ -161,11 +161,11 @@ index d3039d73161378197557947aece88d2710c1e486..f7d4605938210b0b75517bb7bcab28b5
};
} // namespace gtk
diff --git a/ui/views/linux_ui/linux_ui.h b/ui/views/linux_ui/linux_ui.h
index 7d59a2c9ff87cf9d8cb3ed0b45e34e2831545d28..a6ae4feec8df8f149a9ebbe1c3d2252db73135db 100644
--- a/ui/views/linux_ui/linux_ui.h
+++ b/ui/views/linux_ui/linux_ui.h
@@ -170,7 +170,7 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory,
diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
index dee97740309e29c29d9c9c6c757455cddc817dbb..e5b71cd2b5e9e6252fe13c54bb54e26365347e2a 100644
--- a/ui/linux/linux_ui.h
+++ b/ui/linux/linux_ui.h
@@ -175,7 +175,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUi {
// 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.

View File

@@ -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 c47909313da0d7cd8a2b3cd670327011af66e3fb..0d259c21507f38124dfa46aceeacfda76cfd4a38 100644
index 96f5bf8b6b5f3ed5ab25e15845f0de455eb68e0b..e6718a893e1bc5c970245c8265c95dda5d5fa2ff 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

@@ -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 1f6d9be10432416f591a616805494b5d78975df1..e73f70c62ac2e69c918bdf39bd53f74a47066f4e 100644
index 5c03f1194643c6f7302131404f7d869502f1e18b..fa990e6a444d5321213d956b01ba89ef21d57bd2 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -665,6 +665,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -659,6 +659,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -22,10 +22,10 @@ index 1f6d9be10432416f591a616805494b5d78975df1..e73f70c62ac2e69c918bdf39bd53f74a
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 3ccc771a82992ae70c770fa6d2dde92904aa17db..505091e9006f7d41fa8d02e603afef1d10b35bf4 100644
index dfefe47c77c723c1cfdc6abe0e8ff96bc5ec6ddd..8d195ec46b9a6ea830c1ff36ee740b3b8be2b341 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -138,6 +138,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl
void EnablePreferredSizeMode() override;
void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) const override;
@@ -34,7 +34,7 @@ index 3ccc771a82992ae70c770fa6d2dde92904aa17db..505091e9006f7d41fa8d02e603afef1d
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 4d2a4c6746e1dbfc619faf2e16eaa4948d74e372..6c9f190ff595234eca18ff20ca0655da4689b7a2 100644
index 2e4af843d7d0bbef5b7e6357de73355068b38948..77c69de4a541c56389ae11330f67c5fb6bbc4d2a 100644
--- a/content/public/browser/render_view_host.h
+++ b/content/public/browser/render_view_host.h
@@ -77,6 +77,9 @@ class CONTENT_EXPORT RenderViewHost {
@@ -47,36 +47,23 @@ index 4d2a4c6746e1dbfc619faf2e16eaa4948d74e372..6c9f190ff595234eca18ff20ca0655da
private:
// This interface should only be implemented inside content.
friend class RenderViewHostImpl;
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 99978b33c294ebe37192baccb29f0a34a25aed17..ef6e9ae24979538b8746aca898d1f302827491d8 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -151,6 +151,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
static WindowOpenDisposition NavigationPolicyToDisposition(
blink::WebNavigationPolicy policy);
+ void OnSetSchedulerThrottling(bool allowed);
+
// ---------------------------------------------------------------------------
// ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
// it in the same order in the .cc file as it was in the header.
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
index 39bfc2200e924d0c589cfd07f085f182ef6853a6..bddff6d5ad3f6d08c4dc48e66ebc5319b1a5ec28 100644
index 6ff7c34463f3ce5011ea8711d23f9cd11da38d8b..2b8e313dfac2ea9fad0583bb5e98d0c385e8584a 100644
--- a/third_party/blink/public/mojom/page/page.mojom
+++ b/third_party/blink/public/mojom/page/page.mojom
@@ -108,4 +108,7 @@ interface PageBroadcast {
// Sent to whole page, but should only be used by the main frame.
SetPageBaseBackgroundColor(skia.mojom.SkColor? color);
@@ -137,4 +137,7 @@ interface PageBroadcast {
mojo_base.mojom.UnguessableToken devtools_frame_token,
RemoteFrameInterfacesFromBrowser remote_frame_interfaces,
RemoteMainFrameInterfaces remote_main_frame_interfaces);
+
+ // Whether to enable the Renderer scheduler background throttling.
+ SetSchedulerThrottling(bool allowed);
};
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 5e4032ccf916f969cd669af7d983becddb57c72b..a858c9f2fa609ae756a2e70d0362f2de372dd5be 100644
index 3af33a4d699b5bbfb0a1abac9408ad322a47a5ac..30bc8aa73fb46a0306ccc837a99cc4d58daef99d 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -364,6 +364,7 @@ class WebView {
@@ -366,6 +366,7 @@ class WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@@ -85,10 +72,10 @@ index 5e4032ccf916f969cd669af7d983becddb57c72b..a858c9f2fa609ae756a2e70d0362f2de
// 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 3f6460ceee1e3268db45fec668a5e75353643bcb..818394c235c3f71289218098c7db77e00d156d92 100644
index 231f76d07d8a0d3d060b30e0ff6eabe4aa33d755..40aa3b1a5c569e66b6f5d1630afe248c40d5715b 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3727,6 +3727,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3787,6 +3787,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -102,7 +89,7 @@ index 3f6460ceee1e3268db45fec668a5e75353643bcb..818394c235c3f71289218098c7db77e0
void WebViewImpl::SetVisibilityState(
mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) {
@@ -3738,7 +3745,8 @@ void WebViewImpl::SetVisibilityState(
@@ -3798,7 +3805,8 @@ void WebViewImpl::SetVisibilityState(
}
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
GetPage()->GetPageScheduler()->SetPageVisible(
@@ -113,10 +100,10 @@ index 3f6460ceee1e3268db45fec668a5e75353643bcb..818394c235c3f71289218098c7db77e0
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
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 2f8e971ab224b36c6e464eb7524dd3d4c6b76f8c..4a9664d0ce5de431d9638e4145a21091cea78fd1 100644
index 08cc81481cbe4fe40a7df6316db765fa2eac7fda..c5dfefd84b44de5a2c28afb2b9bd8035647da12b 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -418,6 +418,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -425,6 +425,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -124,7 +111,7 @@ index 2f8e971ab224b36c6e464eb7524dd3d4c6b76f8c..4a9664d0ce5de431d9638e4145a21091
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -865,6 +866,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -875,6 +876,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,13 +8,13 @@ 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 6d51f6a77c21b60ab756dbf8d4961b351a2e2b07..26b820b3ce387e01900cec4227ff290113a833c3 100644
index e5c9ebda8156c1a7c32f7eb0661dff40f022c264..8840d4be4b49b27dfb257866f6a074efc34ff869 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()
fake_no_alloc_direct_call_for_testing_enabled(false),
@@ -143,6 +143,19 @@ WebPreferences::WebPreferences()
v8_cache_options(blink::mojom::V8CacheOptions::kDefault),
record_whole_document(false),
stylus_handwriting_enabled(false),
+ // Begin Electron-specific WebPreferences.
+ context_isolation(false),
+ is_webview(false),
@@ -32,13 +32,13 @@ index 6d51f6a77c21b60ab756dbf8d4961b351a2e2b07..26b820b3ce387e01900cec4227ff2901
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 187fd8d9818693262256d5cbddd5e02659ba903d..28e5178361e03d1ac851fa74214931b2332dd9c2 100644
index cfd107cf7257b5c0c2482baba8964e1d2508fc8b..6a2e25a3d7700df9c59952ff19c9ce62d391005c 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,
data.fake_no_alloc_direct_call_for_testing_enabled();
@@ -149,6 +149,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
out->v8_cache_options = data.v8_cache_options();
out->record_whole_document = data.record_whole_document();
out->stylus_handwriting_enabled = data.stylus_handwriting_enabled();
+ // Begin Electron-specific WebPreferences.
+ out->context_isolation = data.context_isolation();
+ out->is_webview = data.is_webview();
@@ -51,12 +51,12 @@ index 187fd8d9818693262256d5cbddd5e02659ba903d..28e5178361e03d1ac851fa74214931b2
+ out->enable_plugins = data.enable_plugins();
+ out->enable_websql = data.enable_websql();
+ out->webview_tag = data.webview_tag();
+ // End Electron-specific WebPreferences.s
+ // End Electron-specific WebPreferences.
out->cookie_enabled = data.cookie_enabled();
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 59947bfd3c042e5f7d3993967fece9b519f93472..cb2a53f6147767394585ed371744d8a140aace71 100644
index adbb4f0de4d787ac7710de06de2bf3b32dc6491f..c68a71ca2e272874420d309f2154cf89cf99b7ec 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 @@
@@ -67,10 +67,10 @@ index 59947bfd3c042e5f7d3993967fece9b519f93472..cb2a53f6147767394585ed371744d8a1
#include "net/nqe/effective_connection_type.h"
#include "third_party/blink/public/common/common_export.h"
#include "third_party/blink/public/mojom/css/preferred_color_scheme.mojom-shared.h"
@@ -154,6 +155,20 @@ struct BLINK_COMMON_EXPORT WebPreferences {
blink::mojom::V8CacheOptions v8_cache_options;
bool record_whole_document;
@@ -159,6 +160,19 @@ struct BLINK_COMMON_EXPORT 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;
+ // Begin Electron-specific WebPreferences.
+ bool context_isolation;
+ bool is_webview;
@@ -84,12 +84,11 @@ index 59947bfd3c042e5f7d3993967fece9b519f93472..cb2a53f6147767394585ed371744d8a1
+ bool enable_websql;
+ bool webview_tag;
+ // End Electron-specific WebPreferences.
+
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
// only controls whether or not the "document.cookie" field is properly
// connected to the backing store, for instance if you wanted to be able to
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 bd425a5869477de9095c6a41c683609d065b08c0..c7ba3ff52c9de01028c9e2be214e20cd91cbf309 100644
index fa2db0ccc2d9f72aa4976816548df31f83c2ef54..ab896b217be1f8695c6d05414252a37c8086369d 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 @@
@@ -100,8 +99,8 @@ index bd425a5869477de9095c6a41c683609d065b08c0..c7ba3ff52c9de01028c9e2be214e20cd
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/nqe/effective_connection_type.h"
#include "third_party/blink/public/common/common_export.h"
@@ -428,6 +429,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
return r.record_whole_document;
@@ -438,6 +439,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
return r.stylus_handwriting_enabled;
}
+ // Begin Electron-specific WebPreferences.
@@ -154,7 +153,7 @@ index bd425a5869477de9095c6a41c683609d065b08c0..c7ba3ff52c9de01028c9e2be214e20cd
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 738ac646e075f7a37ba2a263c7799a755e63d3fb..40ab2a4b9a1f9de5f201502adebc166a48fccd35 100644
index 656ed9364bc7b5874273797f3587d5d74f2c6bdb..e8e990b10890cca95ecc8927222e622eee8b888f 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";
@@ -165,10 +164,10 @@ index 738ac646e075f7a37ba2a263c7799a755e63d3fb..40ab2a4b9a1f9de5f201502adebc166a
enum PointerType {
kPointerNone = 1, // 1 << 0
@@ -206,6 +207,20 @@ struct WebPreferences {
V8CacheOptions v8_cache_options;
bool record_whole_document;
@@ -210,6 +211,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;
+ // Begin Electron-specific WebPreferences.
+ bool context_isolation;
+ bool is_webview;
@@ -182,7 +181,6 @@ index 738ac646e075f7a37ba2a263c7799a755e63d3fb..40ab2a4b9a1f9de5f201502adebc166a
+ bool enable_websql;
+ bool webview_tag;
+ // End Electron-specific WebPreferences.
+
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
// only controls whether or not the "document.cookie" field is properly
// connected to the backing store, for instance if you wanted to be able to

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 a787411f89e2d95e2fa636a7cc6723bdd227e563..f8c67d10957c26fbcd21fa1fe05507efd78f1c29 100644
index 6e1ed6b05b9358a46c796ac175a6556703477a1f..f138d6dc153694c2c3fbb8c98d9557e5bab8214e 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(
@@ -21,36 +21,36 @@ index a787411f89e2d95e2fa636a7cc6723bdd227e563..f8c67d10957c26fbcd21fa1fe05507ef
ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
int command_id) const {
return ImageModel();
@@ -304,6 +309,11 @@ void SimpleMenuModel::SetLabel(int index, const std::u16string& label) {
@@ -311,6 +316,11 @@ void SimpleMenuModel::SetLabel(size_t index, const std::u16string& label) {
MenuItemsChanged();
}
+void SimpleMenuModel::SetSecondaryLabel(int index, const std::u16string& secondary_label) {
+void SimpleMenuModel::SetSecondaryLabel(size_t index, const std::u16string& secondary_label) {
+ items_[ValidateItemIndex(index)].secondary_label = secondary_label;
+ MenuItemsChanged();
+}
+
void SimpleMenuModel::SetMinorText(int index,
void SimpleMenuModel::SetMinorText(size_t index,
const std::u16string& minor_text) {
items_[ValidateItemIndex(index)].minor_text = minor_text;
@@ -396,6 +406,12 @@ std::u16string SimpleMenuModel::GetLabelAt(int index) const {
@@ -404,6 +414,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
return items_[ValidateItemIndex(index)].label;
}
+std::u16string SimpleMenuModel::GetSecondaryLabelAt(int index) const {
+std::u16string SimpleMenuModel::GetSecondaryLabelAt(size_t index) const {
+ if (IsItemDynamicAt(index))
+ return delegate_->GetSecondaryLabelForCommandId(GetCommandIdAt(index));
+ return items_[ValidateItemIndex(index)].secondary_label;
+}
+
std::u16string SimpleMenuModel::GetMinorTextAt(int index) const {
std::u16string SimpleMenuModel::GetMinorTextAt(size_t index) const {
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 bd2ebaf9f84946c708eba13c18869afadd2fdbb0..880d6f12ad188c5f8abf037b3b8d27fcf1fc2cb6 100644
index 7ecb2f6cae709af8c512cfb6cac71d449a9b39c4..b7781d44125c1d66dba90bc39f9f17b194a85665 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -49,6 +49,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -50,6 +50,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Some command ids have labels and icons that change over time.
virtual bool IsItemForCommandIdDynamic(int command_id) const;
virtual std::u16string GetLabelForCommandId(int command_id) const;
@@ -58,25 +58,25 @@ index bd2ebaf9f84946c708eba13c18869afadd2fdbb0..880d6f12ad188c5f8abf037b3b8d27fc
// Gets the icon for the item with the specified id.
virtual ImageModel GetIconForCommandId(int command_id) const;
@@ -160,6 +161,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -167,6 +168,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Sets the label for the item at |index|.
void SetLabel(int index, const std::u16string& label);
void SetLabel(size_t index, const std::u16string& label);
+ // Sets the secondary_label for the item at |index|.
+ void SetSecondaryLabel(int index, const std::u16string& secondary_label);
+ void SetSecondaryLabel(size_t index, const std::u16string& secondary_label);
+
// Sets the minor text for the item at |index|.
void SetMinorText(int index, const std::u16string& minor_text);
void SetMinorText(size_t index, const std::u16string& minor_text);
@@ -199,6 +203,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
int GetCommandIdAt(int index) const override;
std::u16string GetLabelAt(int index) const override;
+ std::u16string GetSecondaryLabelAt(int index) const override;
std::u16string GetMinorTextAt(int index) const override;
ImageModel GetMinorIconAt(int index) const override;
bool IsItemDynamicAt(int index) const override;
@@ -238,6 +243,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -206,6 +210,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(size_t index) const override;
int GetCommandIdAt(size_t index) const override;
std::u16string GetLabelAt(size_t index) const override;
+ std::u16string GetSecondaryLabelAt(size_t index) const override;
std::u16string GetMinorTextAt(size_t index) const override;
ImageModel GetMinorIconAt(size_t index) const override;
bool IsItemDynamicAt(size_t index) const override;
@@ -246,6 +251,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
int command_id = 0;
ItemType type = TYPE_COMMAND;
std::u16string label;

View File

@@ -7,10 +7,10 @@ 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 72d6b7e109779c9785130ebb0e1e23202c5bc68d..e12c4acfd87f1d698d7c8c8459e7231ee03789fd 100644
index c061962bec620d2da0e217d8f55b7db57d120f97..59d9946ecfb7d68b41f539ce7c29c7398e00e9b2 100644
--- a/third_party/blink/renderer/core/fileapi/file.h
+++ b/third_party/blink/renderer/core/fileapi/file.h
@@ -212,6 +212,9 @@ class CORE_EXPORT File final : public Blob {
@@ -211,6 +211,9 @@ class CORE_EXPORT File final : public Blob {
}
const String& name() const { return name_; }

View File

@@ -15,10 +15,10 @@ 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 b1b53542ad5c10619c86e423c61007cd380d0ff9..903794e43f81fb5783275eff8ffb7c9ef89e03e9 100644
index 0e50579d9b1c989beee4113d6762d32b8074efb4..bbcd21ddc38a799fe4226447f9b3447f1ea54feb 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -123,14 +123,6 @@ bool Frame::Detach(FrameDetachType type) {
@@ -124,14 +124,6 @@ bool Frame::Detach(FrameDetachType type) {
DCHECK(!IsDetached());
@@ -33,7 +33,7 @@ index b1b53542ad5c10619c86e423c61007cd380d0ff9..903794e43f81fb5783275eff8ffb7c9e
if (type == FrameDetachType::kRemove) {
if (provisional_frame_) {
provisional_frame_->Detach(FrameDetachType::kRemove);
@@ -154,6 +146,14 @@ bool Frame::Detach(FrameDetachType type) {
@@ -155,6 +147,14 @@ bool Frame::Detach(FrameDetachType type) {
GetWindowProxyManager()->ClearForSwap();
}
@@ -49,10 +49,10 @@ index b1b53542ad5c10619c86e423c61007cd380d0ff9..903794e43f81fb5783275eff8ffb7c9e
// 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 fccb4b6dc2da482f10f1ea011931361d9fd96d06..3e89a6f0cc2959fe305c08b482e2c014d59e15d2 100644
index 90cf3971e573aaec7a85ccf4b6fff9f931924bdc..bb4e80de2930b2e3213cc7c4469bb2875760ebee 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -544,10 +544,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -547,10 +547,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index fccb4b6dc2da482f10f1ea011931361d9fd96d06..3e89a6f0cc2959fe305c08b482e2c014
if (!Client())
return false;
@@ -593,6 +589,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -596,6 +592,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -13,7 +13,7 @@ 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 c0771b00922c1f21ec9dba726c5c7cd51c267d69..d731c7bf168c4b8df0a46da40c9164b4ac6239f3 100644
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 {

View File

@@ -10,7 +10,7 @@ breakpad independently, as a "browser" process. This patches
crash annotation.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index b1f8fd4494e7f5deac078023c2e0240d701e1f13..a372e9bb12f9cec6235fe529d73b6e0009328038 100644
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,

View File

@@ -8,7 +8,7 @@ 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 a1a93418b0b0d56f92647aa1087bb4485c354201..191bfe2d3922d2e65f0be10d6436c50efc3b0880 100644
index be712614ac5be3573427247d7032432f18e47a15..4ad49e65f6139b43a8f9d1041dfdd4b6951ca7a7 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -80,6 +80,7 @@

View File

@@ -1,18 +0,0 @@
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 7d538f812d72e0937e7a031e1c53651c352149c5..1cad40a9825f3c6df67dbcc12d2f9650aad809b2 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/base/allocator/allocator.gni b/base/allocator/allocator.gni
index 97a57dfb1626ae9a781736dd8b0b55bf201162c1..5c97441faad781b459255cb1f7d0652ec86e40c8 100644
index 674def40cfdc83432d0f3ced8ab3f570dc9e8b1b..96e5e5e145715218724f93041060df60d709839a 100644
--- a/base/allocator/allocator.gni
+++ b/base/allocator/allocator.gni
@@ -20,7 +20,7 @@ _disable_partition_alloc = is_component_build || (is_win && is_debug)

View File

@@ -13,16 +13,15 @@ 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 559ac76d4e4b9d9c1824c4da186a6b0f7619fcca..72855e0c5fadb286b67144b34ff71f45e1434c73 100644
index e57b8edde3b3e8f7a9cd580e2bcd039f1beebdff..f49cbaa980674444ccaee4a615dc99e9c630f7b8 100644
--- a/printing/buildflags/buildflags.gni
+++ b/printing/buildflags/buildflags.gni
@@ -36,8 +36,7 @@ declare_args() {
@@ -36,7 +36,7 @@ declare_args() {
# Enable snapshotting a page when printing for its content to be analyzed for
# sensitive content by enterprise users.
- enable_print_content_analysis =
- is_chromeos_ash || is_chromeos_lacros || is_win || is_linux || is_mac
+ enable_print_content_analysis = is_chromeos_ash || is_chromeos_lacros
- enable_print_content_analysis = is_chromeos || is_win || is_linux || is_mac
+ enable_print_content_analysis = is_chromeos
}
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 b6234183651923505bd2a4a8640ea21508033ef1..e486f92e909f43bb65633245b7dcb3145d0a7604 100644
index 0223183c4e869e835429a52ad7d9eb381a2d21f5..47162ccaa75ea637b7ce5ed0fed976862b14c427 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -175,11 +175,16 @@ if (!is_android && !is_mac) {
@@ -176,11 +176,16 @@ if (!is_android && !is_mac) {
"common/crash_keys.h",
]
@@ -33,10 +33,10 @@ index b6234183651923505bd2a4a8640ea21508033ef1..e486f92e909f43bb65633245b7dcb314
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index bbe8847b3da8d6ec9c5d10bbe875de8c34e060d3..e2e12c141932f52f49d24a0bad4a53007133d9de 100644
index bb193ea0cb1df492e52a5023bd84852bfc3985ce..f89c54a1f73f26ca142a2764fd235111e6cbeff0 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4551,7 +4551,7 @@ static_library("browser") {
@@ -4623,7 +4623,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@@ -46,18 +46,18 @@ index bbe8847b3da8d6ec9c5d10bbe875de8c34e060d3..e2e12c141932f52f49d24a0bad4a5300
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index e791e09b43760ecc3aac9af7bac252233e6bae0b..baacf6bf01fa9df05bd9c2d87d3519666f41fc77 100644
index ade95f3592fc54e69ec8717c7542ef2eae645056..c339589fc723be5ad49cca88bddbd9ae8a649644 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -5913,7 +5913,6 @@ test("unit_tests") {
@@ -6038,7 +6038,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
- "//chrome:packed_resources_integrity",
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/browser:chrome_process_finder",
@@ -5937,6 +5936,10 @@ test("unit_tests") {
"//chrome/app:crash_reporter_client_win_unit_tests",
@@ -6063,6 +6062,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,15 +68,16 @@ index e791e09b43760ecc3aac9af7bac252233e6bae0b..baacf6bf01fa9df05bd9c2d87d351966
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -6827,7 +6830,6 @@ test("unit_tests") {
@@ -6964,7 +6967,7 @@ test("unit_tests") {
}
deps += [
- "//chrome:packed_resources_integrity_hash",
"//chrome/browser:cart_db_content_proto",
"//chrome/browser:coupon_db_content_proto",
+ # "//chrome:packed_resources_integrity_hash",
"//chrome/browser/autofill_assistant/password_change/vector_icons:vector_icons",
"//chrome/browser/enterprise/connectors/analysis:features",
"//chrome/browser/media/router:test_support",
@@ -6933,6 +6935,10 @@ test("unit_tests") {
@@ -7083,6 +7086,10 @@ test("unit_tests") {
}
}

View File

@@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Milan Burda <miburda@microsoft.com>
Date: Sun, 30 Oct 2022 22:32:39 +0100
Subject: build: fix building with enable_plugins = false
This issue is fixed in latest Chromium
diff --git a/tools/ipc_fuzzer/message_lib/BUILD.gn b/tools/ipc_fuzzer/message_lib/BUILD.gn
index 00618d9f81cabd5084218431658fd91d22fb4208..26be64a51fc5767e0ee97681a0b3f2dfd74159fe 100644
--- a/tools/ipc_fuzzer/message_lib/BUILD.gn
+++ b/tools/ipc_fuzzer/message_lib/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//components/nacl/features.gni")
+import("//ppapi/buildflags/buildflags.gni")
import("//remoting/remoting_enable.gni")
static_library("ipc_message_lib") {
@@ -22,7 +23,6 @@ static_library("ipc_message_lib") {
"//ipc",
"//media/cast:net",
"//media/gpu/ipc/common",
- "//ppapi/proxy:ipc",
"//skia",
"//third_party/blink/public:blink",
"//third_party/blink/public:blink_headers",
@@ -49,4 +49,7 @@ static_library("ipc_message_lib") {
if (enable_remoting) {
public_deps += [ "//remoting/host" ]
}
+ if (enable_plugins) {
+ public_deps += [ "//ppapi/proxy:ipc" ]
+ }
}

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 b3e5378f711c54b76c73179e791646d4e5e4e96b..262c8e53ec25b2e91a73b5971d64dbe5d5e005a1 100644
index 01f5a1713c28f077e624fe1ea1c84fa3b514d660..3837b9ccf00b2d9f0b655a2c08e96d5020b0afbf 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -44,7 +44,11 @@ config("winver") {

View File

@@ -6,18 +6,23 @@ Subject: build: make libcxx_abi_unstable false for electron
https://nornagon.medium.com/a-libc-odyssey-973e51649063
diff --git a/build/config/c++/BUILD.gn b/build/config/c++/BUILD.gn
index 2e5843b9f0a5d39d8dbfea0ae5d2ebb413c0ac7d..f4c901e9980ad068a2903482f712bfa8b1310057 100644
index 5d222aaccd15cbcdd413094e33bd48fd3798de8f..a2653637c2735b268dc4e6174536565d9add17bf 100644
--- a/build/config/c++/BUILD.gn
+++ b/build/config/c++/BUILD.gn
@@ -9,6 +9,11 @@ assert(use_custom_libcxx, "should only be used if use_custom_libcxx is set")
libcxx_abi_unstable = true
+if (is_electron_build) {
+ # This breaks native node modules
+ libcxx_abi_unstable = false
+}
@@ -29,10 +29,12 @@ config("runtime_library") {
# on Windows, the increase is great enough that we go above the 4GB size
# limit for PDBs (https://crbug.com/1327710#c5). To fix this, we set
# _LIBCPP_ABI_NAMESPACE to a shorter value.
- defines += [
- "_LIBCPP_ABI_NAMESPACE=Cr",
- "_LIBCPP_ABI_VERSION=2",
- ]
+ defines += [ "_LIBCPP_ABI_NAMESPACE=Cr" ]
+
# TODO(xiaohuic): https://crbug/917533 Crashes on internal ChromeOS build.
# Do unconditionally once the underlying problem is fixed.
if (is_chromeos_ash && is_chrome_branded) {
+ if (!is_electron_build) {
+ # This breaks native node modules
+ defines += [ "_LIBCPP_ABI_VERSION=2" ]
+ }
if (!libcxx_is_shared) {
# Don't leak any symbols on a static build.

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 28c7136b21d058e3daa7570af558f5a415b000a7..d1b7d15a7e4dede5b030e4ae9fb2ab8aa8196446 100644
index 753d3cb544f812689616ce7bd05d24844f20883c..1f58d6a342b0c1e0c5fd4d525a684a166f11a69d 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7006,6 +7006,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -7313,6 +7313,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 28c7136b21d058e3daa7570af558f5a415b000a7..d1b7d15a7e4dede5b030e4ae9fb2ab8a
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index cb74ef64fc8d4014fb57f098df6440dda5e896d4..c7d376b31e0fb570c934c6a8846e37bf1f3b3262 100644
index 8e1c0feede6dc599c0bc78d6278726b16c7931df..2b393e7e7089d17a0906610c3c8979c20928a5f6 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3965,6 +3965,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4012,6 +4012,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
}
auto* new_contents_impl = new_contents.get();
@@ -39,7 +39,7 @@ index cb74ef64fc8d4014fb57f098df6440dda5e896d4..c7d376b31e0fb570c934c6a8846e37bf
new_contents_impl->GetController().SetSessionStorageNamespace(
partition_config, session_storage_namespace);
@@ -4009,12 +4017,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4056,12 +4064,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -53,13 +53,13 @@ index cb74ef64fc8d4014fb57f098df6440dda5e896d4..c7d376b31e0fb570c934c6a8846e37bf
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 9c3a03faeee19f6f0a250680db36906ee64bf55a..0450700d02c74e047fa5124aa43b9f75b869917d 100644
index 4eee5f6c069c83039bf0acee71056d8ed4ea92eb..9212926fba9d06296c9c46a95519b6ed777569ee 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -566,6 +566,10 @@ struct CreateNewWindowParams {
@@ -574,6 +574,10 @@ struct CreateNewWindowParams {
// Governs how downloads are handled if `target_url` results in a download.
blink.mojom.NavigationDownloadPolicy download_policy;
// Additional parameters for creating picture-in-picture windows.
blink.mojom.PictureInPictureWindowOptions? pip_options;
+
+ // Extra fields added by Electron.
+ string raw_features;
@@ -68,10 +68,10 @@ index 9c3a03faeee19f6f0a250680db36906ee64bf55a..0450700d02c74e047fa5124aa43b9f75
// 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 c1beba6701e68255c212e56d78ae8259e2ffdab9..9f77c2a5df8f25876f875c4a7148d82c3dd79db8 100644
index a9c96d4b463929143c7de0ec29d4afee5315fd92..2750d9f6c377b36fd1684077d9eec1cde78c856c 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -595,6 +595,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -617,6 +617,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -81,10 +81,10 @@ index c1beba6701e68255c212e56d78ae8259e2ffdab9..9f77c2a5df8f25876f875c4a7148d82c
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 a49794184baa977ddf03cd911f8d8d7d671df65f..7997c0de85315e30b350316f33e598a0221d583f 100644
index bac29d867e465c87f69ea4f28eac118718db0992..7eb47e0c73c7f0d8a0cadcf5b8163f8a5154faea 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -164,6 +164,7 @@ class NetworkService;
@@ -163,6 +163,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -92,7 +92,7 @@ index a49794184baa977ddf03cd911f8d8d7d671df65f..7997c0de85315e30b350316f33e598a0
} // namespace network
namespace sandbox {
@@ -967,6 +968,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -999,6 +1000,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -102,7 +102,7 @@ index a49794184baa977ddf03cd911f8d8d7d671df65f..7997c0de85315e30b350316f33e598a0
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 ef3889063b562a37fbd945fe30db0d776ecaee7a..99e8449e9c515dd70ed88546a71f83ae139178fe 100644
index 74847a4fbd4d0d897ce6aecd1b39e30bc226f8f4..3ddcc2d403a68fdc2b4b0246899cd9507ecc6195 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -26,6 +26,17 @@ namespace content {
@@ -124,7 +124,7 @@ index ef3889063b562a37fbd945fe30db0d776ecaee7a..99e8449e9c515dd70ed88546a71f83ae
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 348dcde05d71e7d16e4c7bb1d8d9f8718070e669..5a9cc64d6e0d9d01f5dc133c7fcab34101bc32db 100644
index 0274e3bb5cc62ce2c52be68a50b57c339fc5bba7..1ea3e1fdf067ea54ce54d31f494ac2bf42b2de3f 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -149,21 +149,13 @@ index 348dcde05d71e7d16e4c7bb1d8d9f8718070e669..5a9cc64d6e0d9d01f5dc133c7fcab341
// Notifies the delegate about the creation of a new WebContents. This
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 03b637c4d3a68a2bff5a4e06f421f23f97f40911..6235fd626a377643851dbb98d4d089e5a59366db 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -32,6 +32,7 @@
#include "third_party/blink/public/mojom/page/page.mojom.h"
#include "third_party/blink/public/platform/modules/video_capture/web_video_capture_impl_manager.h"
#include "third_party/blink/public/platform/url_conversion.h"
+#include "third_party/blink/public/platform/web_url_request_util.h"
#include "third_party/blink/public/web/modules/mediastream/web_media_stream_device_observer.h"
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/public/web/web_local_frame.h"
@@ -302,6 +303,10 @@ WebView* RenderViewImpl::CreateView(
/*openee_can_access_opener_origin=*/true, !creator->IsAllowedToDownload(),
creator->IsAdSubframe());
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index d70f6df69aa604972755d1cfe0cfcd2b0369f68c..8199122b2d759aa8b27affabe67b108fb9a16c38 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6196,6 +6196,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
/*openee_can_access_opener_origin=*/true,
!GetWebFrame()->IsAllowedToDownload(), GetWebFrame()->IsAdFrame());
+ params->raw_features = features.raw_features.Utf8(
+ WTF::UTF8ConversionMode::kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD);
@@ -173,10 +165,10 @@ index 03b637c4d3a68a2bff5a4e06f421f23f97f40911..6235fd626a377643851dbb98d4d089e5
// 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 2e7c332565ebe33b00ab7fff96a6a8dfc61422a6..0ab061f51d1d0c93f23bfcf5ba051172cea37eb8 100644
index 40b82385697d8721ef6da3d0c77544d6d0ca400c..3a2d5207fb2eeea4b016012b09c3668af8dc35b4 100644
--- a/content/web_test/browser/web_test_content_browser_client.cc
+++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -438,6 +438,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -482,6 +482,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -186,10 +178,10 @@ index 2e7c332565ebe33b00ab7fff96a6a8dfc61422a6..0ab061f51d1d0c93f23bfcf5ba051172
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 00e2a8c21d4f0ef00c942498251fa44065da63c0..0fc4b092fa276063e05f990bf920fecd60c6d26c 100644
index 4805dd035772fcaea60a1a91eb9911d5c0ce93a9..3b752ea509149f04fd6d10f6977bd29791f6a5d6 100644
--- a/content/web_test/browser/web_test_content_browser_client.h
+++ b/content/web_test/browser/web_test_content_browser_client.h
@@ -80,6 +80,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -81,6 +81,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -220,12 +212,12 @@ 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 84eca5b0b66eda6bebf3fdc304438325545a1f17..2f0615ee1454946d6f46f6626ce9b860a0e04fee 100644
index 5bf3339038b6a8498221d1bd222ec340d78d1b92..c4be7a96144ac53be856fbf52dff8e990aa736aa 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2104,6 +2104,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2091,6 +2091,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);
GetWindowFeaturesFromString(features, entered_window, completed_url);
+ window_features.raw_features = features;
+

View File

@@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: David Bokan <bokan@chromium.org>
Date: Thu, 28 Jul 2022 18:09:13 +0000
Subject: Prevent handling input for provisional frames
Bug: 1347644,1322812
Change-Id: Ifd60f6aa593ce23ca6cbb65552fc9fb8f8690035
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3791883
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1029361}
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
index fe775337fbc22817d7489df143821eea2d9425ec..13a241273090e54fabdba9d82510e36d2386c4a4 100644
--- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
@@ -2460,10 +2460,15 @@ WebInputEventResult WebFrameWidgetImpl::HandleInputEvent(
DCHECK(!WebInputEvent::IsTouchEventType(input_event.GetType()));
CHECK(LocalRootImpl());
+ // Clients shouldn't be dispatching events to a provisional frame but this
+ // can happen. Ensure that event handling can assume we're in a committed
+ // frame.
+ if (IsProvisional())
+ return WebInputEventResult::kHandledSuppressed;
+
// Only record metrics for the root frame.
- if (ForTopMostMainFrame()) {
+ if (ForTopMostMainFrame())
GetPage()->GetVisualViewport().StartTrackingPinchStats();
- }
// If a drag-and-drop operation is in progress, ignore input events except
// PointerCancel and GestureLongPress.

View File

@@ -1,153 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Rune Lillesveen <futhark@chromium.org>
Date: Fri, 14 Oct 2022 09:52:34 +0000
Subject: Avoid layout roots in subtrees skipped for style recalc
Layout roots are laid out from inner to outer in LocalFrameView. DOM
mutations may have added layout roots inside size container subtrees
before style recalc. If we decide to postpone style recalc until layout
of the size container, it means we may try to layout a root inside a
subtree skipped for style recalc. That causes a DCHECK and possibly
other issues.
This also fixes the use-after-poison issue 1365330.
(cherry picked from commit 0f0f1e99201fadb3c68518350e1cd6af1b665346)
Bug: 1371820, 1365330
Change-Id: Ia48890c08aacfe7b9a3e660817702abce0570564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934847
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1055853}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3953455
Auto-Submit: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#836}
Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826}
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc
index f51b8878eb0abe23889a07277efeaf7cdf961cc8..ddcef20b47357e58acae08b4183db6187b046f80 100644
--- a/third_party/blink/renderer/core/css/style_engine.cc
+++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -2808,6 +2808,7 @@ void StyleEngine::RecalcStyle(StyleRecalcChange change,
const StyleRecalcContext& style_recalc_context) {
DCHECK(GetDocument().documentElement());
ScriptForbiddenScope forbid_script;
+ SkipStyleRecalcScope skip_scope(*this);
CheckPseudoHasCacheScope check_pseudo_has_cache_scope(&GetDocument());
Element& root_element = style_recalc_root_.RootElement();
Element* parent = FlatTreeTraversal::ParentElement(root_element);
@@ -3400,4 +3401,17 @@ void StyleEngine::MarkForLayoutTreeChangesAfterDetach() {
parent_for_detached_subtree_ = nullptr;
}
+bool StyleEngine::AllowSkipStyleRecalcForScope() const {
+ if (InContainerQueryStyleRecalc())
+ return true;
+ if (LocalFrameView* view = GetDocument().View()) {
+ // Existing layout roots before starting style recalc may end up being
+ // inside skipped subtrees if we allowed skipping. If we start out with an
+ // empty list, any added ones will be a result of an element style recalc,
+ // which means the will not be inside a skipped subtree.
+ return !view->IsSubtreeLayout();
+ }
+ return true;
+}
+
} // namespace blink
diff --git a/third_party/blink/renderer/core/css/style_engine.h b/third_party/blink/renderer/core/css/style_engine.h
index a6c325b69e5bc43c657519f4c0730f6e2efd4f71..f7ccc6c2b7b306d76bba60cf46da91a5b291c29e 100644
--- a/third_party/blink/renderer/core/css/style_engine.h
+++ b/third_party/blink/renderer/core/css/style_engine.h
@@ -178,6 +178,20 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
base::AutoReset<bool> allow_marking_;
};
+ // Set up the condition for allowing to skip style recalc before starting
+ // RecalcStyle().
+ class SkipStyleRecalcScope {
+ STACK_ALLOCATED();
+
+ public:
+ explicit SkipStyleRecalcScope(StyleEngine& engine)
+ : allow_skip_(&engine.allow_skip_style_recalc_,
+ engine.AllowSkipStyleRecalcForScope()) {}
+
+ private:
+ base::AutoReset<bool> allow_skip_;
+ };
+
explicit StyleEngine(Document&);
~StyleEngine() override;
@@ -342,6 +356,10 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
bool MarkReattachAllowed() const;
+ // Returns true if we can skip style recalc for a size container subtree and
+ // resume it during layout.
+ bool SkipStyleRecalcAllowed() const { return allow_skip_style_recalc_; }
+
CSSFontSelector* GetFontSelector() { return font_selector_; }
void RemoveFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&);
@@ -743,6 +761,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
Element& changed_element,
bool for_pseudo_change);
+ // Initialization value for SkipStyleRecalcScope.
+ bool AllowSkipStyleRecalcForScope() const;
+
Member<Document> document_;
// Tracks the number of currently loading top-level stylesheets. Sheets loaded
@@ -812,6 +833,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
// AllowMarkStyleDirtyFromRecalcScope.
bool allow_mark_for_reattach_from_rebuild_layout_tree_{false};
+ // Set to true if we are allowed to skip recalc for a size container subtree.
+ bool allow_skip_style_recalc_{false};
+
// See enum ViewportUnitFlag.
unsigned viewport_unit_dirty_flags_{0};
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc
index 8e5c4aab2e37ed0acda0ef56273d007fbaa58780..2df360c33c54e12af341b77771fcda95e562fa92 100644
--- a/third_party/blink/renderer/core/dom/element.cc
+++ b/third_party/blink/renderer/core/dom/element.cc
@@ -3532,6 +3532,10 @@ bool Element::SkipStyleRecalcForContainer(
const ComputedStyle& style,
const StyleRecalcChange& child_change) {
DCHECK(RuntimeEnabledFeatures::CSSContainerSkipStyleRecalcEnabled());
+
+ if (!GetDocument().GetStyleEngine().SkipStyleRecalcAllowed())
+ return false;
+
if (!child_change.TraversePseudoElements(*this)) {
// If none of the children or pseudo elements need to be traversed for style
// recalc, there is no point in marking the subtree as skipped.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..e3e709a240bd870250b2747c94fe96880bdf52e3
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/crashtests/chrome-layout-root-crash.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<html class="reftest-wait">
+<link rel="help" href="https://crbug.com/1371820">
+<style>
+ body, div, img { container-type: size; }
+</style>
+<p>Pass if no crash.</p>
+<div id="div"><img id="img" alt="a"></div>
+<script>
+ requestAnimationFrame(() => requestAnimationFrame(() => {
+ // Adds a layout root inside the div size container.
+ img.alt = img.src = "b";
+ // Marks div size container for layout which skips style recalc for the sub-tree.
+ div.style.width = "500px";
+ document.documentElement.classList.remove("reftest-wait");
+ }));
+</script>

View File

@@ -1,37 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Joshua Peraza <jperaza@chromium.org>
Date: Thu, 3 Nov 2022 21:18:35 +0000
Subject: Validate number of bytes read
Original commit:
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3994208
(cherry picked from commit 7585111a6c1dfa502f3ca1e3d27aed066e479fd9)
Bug: chromium:1380083
Change-Id: If9708ccdbf6957ef169b35f8f89e2b0744d066d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4000305
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Cr-Original-Commit-Position: refs/branch-heads/5359@{#529}
Cr-Original-Branched-From: 27d3765d341b09369006d030f83f582a29eb57ae-refs/heads/main@{#1058933}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4004067
Cr-Commit-Position: refs/branch-heads/5249@{#905}
Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826}
diff --git a/third_party/crashpad/crashpad/util/linux/ptrace_client.cc b/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
index 1863841f73f64d89391646f5c3e5fc2e2766a6cc..32cc35d9567117fe0eb6f1ec4736ac4a15ddfd83 100644
--- a/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
+++ b/third_party/crashpad/crashpad/util/linux/ptrace_client.cc
@@ -331,6 +331,11 @@ ssize_t PtraceClient::ReadUpTo(VMAddress address, size_t size, void* buffer) {
return total_read;
}
+ if (static_cast<size_t>(bytes_read) > size) {
+ LOG(ERROR) << "invalid size " << bytes_read;
+ return -1;
+ }
+
if (!LoggingReadFileExactly(sock_, buffer_c, bytes_read)) {
return -1;
}

View File

@@ -1,184 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Anders Hartvoll Ruud <andruud@chromium.org>
Date: Tue, 20 Sep 2022 17:43:47 +0000
Subject: Add CSSTokenizer-created strings to CSSVariableData's backing strings
When computing the value of a registered custom property, we create
a CSSVariableData object equivalent to the computed CSSValue by
serializing that CSSValue to a String, then tokenizing that value.
The problem is that CSSTokenizer can create *new* string objects
during the tokenization process (see calls to CSSTokenizer::
RegisterString), without communicating that fact to the call-site.
Therefore, this CL adds a way to access those strings so they can
be added to the backing strings of the CSSVariableData.
Also added a DCHECK to verify that we don't have any tokens with
non-backed string pointers.
Fixed: 1358907
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3892782
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1046868}
Change-Id: Ifb6d194508e99030a5a3ed5fbad5496b7263bdc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3905727
Auto-Submit: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#518}
Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826}
diff --git a/third_party/blink/renderer/core/css/css_variable_data.cc b/third_party/blink/renderer/core/css/css_variable_data.cc
index a2294cc70c59ac0357dddf0f7719cc3c09d23554..b3a61b312eb5f0360e8aa4cb706c60f0085fead9 100644
--- a/third_party/blink/renderer/core/css/css_variable_data.cc
+++ b/third_party/blink/renderer/core/css/css_variable_data.cc
@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/core/css/css_variable_data.h"
+#include "base/containers/span.h"
#include "third_party/blink/renderer/core/css/css_syntax_definition.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_context.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
@@ -109,6 +110,51 @@ void CSSVariableData::ConsumeAndUpdateTokens(const CSSParserTokenRange& range) {
UpdateTokens<UChar>(range, backing_string, tokens_);
}
+#if EXPENSIVE_DCHECKS_ARE_ON()
+
+namespace {
+
+template <typename CharacterType>
+bool IsSubspan(base::span<const CharacterType> inner,
+ base::span<const CharacterType> outer) {
+ // Note that base::span uses CheckedContiguousIterator, which restricts
+ // which comparisons are allowed. Therefore we must avoid begin()/end() here.
+ return inner.data() >= outer.data() &&
+ (inner.data() + inner.size()) <= (outer.data() + outer.size());
+}
+
+bool TokenValueIsBacked(const CSSParserToken& token,
+ const String& backing_string) {
+ StringView value = token.Value();
+ if (value.Is8Bit() != backing_string.Is8Bit())
+ return false;
+ return value.Is8Bit() ? IsSubspan(value.Span8(), backing_string.Span8())
+ : IsSubspan(value.Span16(), backing_string.Span16());
+}
+
+bool TokenValueIsBacked(const CSSParserToken& token,
+ const Vector<String>& backing_strings) {
+ DCHECK(token.HasStringBacking());
+ for (const String& backing_string : backing_strings) {
+ if (TokenValueIsBacked(token, backing_string)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace
+
+void CSSVariableData::VerifyStringBacking() const {
+ for (const CSSParserToken& token : tokens_) {
+ DCHECK(!token.HasStringBacking() ||
+ TokenValueIsBacked(token, backing_strings_))
+ << "Token value is not backed: " << token.Value().ToString();
+ }
+}
+
+#endif // EXPENSIVE_DCHECKS_ARE_ON()
+
CSSVariableData::CSSVariableData(const CSSTokenizedValue& tokenized_value,
bool is_animation_tainted,
bool needs_variable_resolution,
@@ -120,6 +166,9 @@ CSSVariableData::CSSVariableData(const CSSTokenizedValue& tokenized_value,
base_url_(base_url.IsValid() ? base_url.GetString() : String()),
charset_(charset) {
ConsumeAndUpdateTokens(tokenized_value.range);
+#if EXPENSIVE_DCHECKS_ARE_ON()
+ VerifyStringBacking();
+#endif // EXPENSIVE_DCHECKS_ARE_ON()
}
const CSSValue* CSSVariableData::ParseForSyntax(
diff --git a/third_party/blink/renderer/core/css/css_variable_data.h b/third_party/blink/renderer/core/css/css_variable_data.h
index f042f85736c2c49f8337c29cb742976c5e97a14b..7be7d201313ec3e591e2c45c9fd5bda327856645 100644
--- a/third_party/blink/renderer/core/css/css_variable_data.h
+++ b/third_party/blink/renderer/core/css/css_variable_data.h
@@ -100,11 +100,18 @@ class CORE_EXPORT CSSVariableData : public RefCounted<CSSVariableData> {
has_font_units_(has_font_units),
has_root_font_units_(has_root_font_units),
base_url_(base_url),
- charset_(charset) {}
+ charset_(charset) {
+#if EXPENSIVE_DCHECKS_ARE_ON()
+ VerifyStringBacking();
+#endif // EXPENSIVE_DCHECKS_ARE_ON()
+ }
CSSVariableData(const CSSVariableData&) = delete;
CSSVariableData& operator=(const CSSVariableData&) = delete;
void ConsumeAndUpdateTokens(const CSSParserTokenRange&);
+#if EXPENSIVE_DCHECKS_ARE_ON()
+ void VerifyStringBacking() const;
+#endif // EXPENSIVE_DCHECKS_ARE_ON()
// tokens_ may have raw pointers to string data, we store the String objects
// owning that data in backing_strings_ to keep it alive alongside the
diff --git a/third_party/blink/renderer/core/css/parser/css_tokenizer.h b/third_party/blink/renderer/core/css/parser/css_tokenizer.h
index 817bcbd4b6b9a9a5519bb92d6870c5b16a19278f..682a44a478bcd0ee3aa1638601650fd420033625 100644
--- a/third_party/blink/renderer/core/css/parser/css_tokenizer.h
+++ b/third_party/blink/renderer/core/css/parser/css_tokenizer.h
@@ -33,6 +33,7 @@ class CORE_EXPORT CSSTokenizer {
wtf_size_t Offset() const { return input_.Offset(); }
wtf_size_t PreviousOffset() const { return prev_offset_; }
StringView StringRangeAt(wtf_size_t start, wtf_size_t length) const;
+ const Vector<String>& StringPool() const { return string_pool_; }
private:
CSSParserToken TokenizeSingle();
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
index 6739b9de4b500d6173c04966905e26f856594502..f0082d88d70d4ea76604cfac77c09727de134f2a 100644
--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
+++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
@@ -2176,6 +2176,10 @@ StyleBuilderConverter::ConvertRegisteredPropertyVariableData(
Vector<String> backing_strings;
backing_strings.push_back(text);
+ // CSSTokenizer may allocate new strings for some tokens (e.g. for escapes)
+ // and produce tokens that point to those strings. We need to retain those
+ // strings (if any) as well.
+ backing_strings.AppendVector(tokenizer.StringPool());
const bool has_font_units = false;
const bool has_root_font_units = false;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html b/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html
index f03b257246e520bd93055203a5cb27188babc8ca..168495247a3b16a2203fb361f662b6db83044d09 100644
--- a/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html
+++ b/third_party/blink/web_tests/external/wpt/css/css-properties-values-api/registered-property-computation.html
@@ -167,4 +167,6 @@ test_computed_value('<resolution>', '1dppx', '1dppx');
test_computed_value('<resolution>', '96dpi', '1dppx');
test_computed_value('<resolution>', 'calc(1dppx + 96dpi)', '2dppx');
+test_computed_value('*', 'url(why)', 'url(why)');
+
</script>
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt
index 3823a752b99f506d11c50aee36474c6c51c849cd..eeed0dfc0def17b1ba636f7f6a076caf770e1327 100644
--- a/third_party/blink/web_tests/platform/generic/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt
+++ b/third_party/blink/web_tests/platform/generic/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt
@@ -1,5 +1,5 @@
This is a testharness.js-based test.
-Found 60 tests; 59 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN.
+Found 61 tests; 60 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <length> values computed are correctly via var()-reference
PASS <length> values computed are correctly via var()-reference when font-size is inherited
PASS <length> values are computed correctly when font-size is inherited [14em]
@@ -60,5 +60,6 @@ PASS * values are computed correctly [50dpi]
PASS <resolution> values are computed correctly [1dppx]
PASS <resolution> values are computed correctly [96dpi]
FAIL <resolution> values are computed correctly [calc(1dppx + 96dpi)] assert_equals: expected "2dppx" but got "0dppx"
+PASS * values are computed correctly [url(why)]
Harness: the test ran to completion.

View File

@@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Anton Bikineev <bikineev@chromium.org>
Date: Sun, 10 Jul 2022 22:17:03 +0000
Subject: Fix heap-overflow in blink::TableLayoutAlgorithmAuto::InsertSpanCell
The CL fixes size confusion between Member<> and raw pointers.
The bug was found (and the fix was proposed) by m.cooolie@gmail.com.
Bug: 1341539
Change-Id: I99d524fd65c2d6305693d09ad274c23178271269
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3751138
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1022529}
diff --git a/third_party/blink/renderer/core/layout/table_layout_algorithm_auto.cc b/third_party/blink/renderer/core/layout/table_layout_algorithm_auto.cc
index 1e1575cf47027584a9d06d7c5f6046fa15990b10..1a4a06a4761c52b8dd9ae9052b7c51b9236694a5 100644
--- a/third_party/blink/renderer/core/layout/table_layout_algorithm_auto.cc
+++ b/third_party/blink/renderer/core/layout/table_layout_algorithm_auto.cc
@@ -673,7 +673,7 @@ void TableLayoutAlgorithmAuto::InsertSpanCell(LayoutTableCell* cell) {
span > span_cells_[pos]->ColSpan())
pos++;
memmove(span_cells_.data() + pos + 1, span_cells_.data() + pos,
- (size - pos - 1) * sizeof(LayoutTableCell*));
+ (size - pos - 1) * sizeof(decltype(span_cells_)::value_type));
span_cells_[pos] = cell;
}

View File

@@ -1,45 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yutaka Hirano <yhirano@chromium.org>
Date: Mon, 4 Jul 2022 11:48:20 +0000
Subject: Fix UAF on network::URLLoader
network::URLLoader::SetUpUpload calls NotifyCompleted asynchronously,
as it can be called in the constructor and we don't want to run
NotifyCompleted in the constructor.
The problem is that it attaches a raw pointer to the method, which leads to a use-after-free problem if the URLLoader is destructed before
NotifyCompleted is called.
Use weak pointers instead of raw pointers to avoid the problem.
Bug: 1340253
Change-Id: Iacb1e772bf7a8e3de4a7bb9de342fea9ba0f3f3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3740150
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1020539}
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 62201fd4f11ce500b3a9d82fffe7776bf8a15eb0..433edfd8be00d912ffe482283d0e0d1b093b8039 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -989,8 +989,8 @@ void URLLoader::OpenFilesForUpload(const ResourceRequest& request) {
// initializing before getting deleted.
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
- base::BindOnce(&URLLoader::NotifyCompleted, base::Unretained(this),
- net::ERR_ACCESS_DENIED));
+ base::BindOnce(&URLLoader::NotifyCompleted,
+ weak_ptr_factory_.GetWeakPtr(), net::ERR_ACCESS_DENIED));
return;
}
url_request_->LogBlockedBy("Opening Files");
@@ -1009,7 +1009,7 @@ void URLLoader::SetUpUpload(const ResourceRequest& request,
// initializing before getting deleted.
base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&URLLoader::NotifyCompleted,
- base::Unretained(this), error_code));
+ weak_ptr_factory_.GetWeakPtr(), error_code));
return;
}
scoped_refptr<base::SequencedTaskRunner> task_runner =

View File

@@ -1,46 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Paicu <andypaicu@chromium.org>
Date: Thu, 6 Oct 2022 21:04:23 +0000
Subject: Fix UAF issue around permission status observer list
(cherry picked from commit 4df595127d95d4b0bf115be1ab4604d95b75273c)
(cherry picked from commit 1dc5dda6112bdd811c923520cc728a474583409e)
Bug: 1363040
Change-Id: I1f64a901b83aa834ae652c8041456e9b7d253c1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907744
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Cr-Original-Original-Commit-Position: refs/heads/main@{#1049058}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3929034
Reviewed-by: Illia Klimov <elklm@chromium.org>
Cr-Original-Commit-Position: refs/branch-heads/5304@{#483}
Cr-Original-Branched-From: 5d7b1fc9cb7103d9c82eed647cf4be38cf09738b-refs/heads/main@{#1047731}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3936291
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5249@{#764}
Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826}
diff --git a/third_party/blink/renderer/modules/permissions/permission_status_listener.cc b/third_party/blink/renderer/modules/permissions/permission_status_listener.cc
index 424314c1dd49bd693643e41adb537f7a9d01e5d2..946e28ac3139a1927ac36281f04cec9f5faf76d2 100644
--- a/third_party/blink/renderer/modules/permissions/permission_status_listener.cc
+++ b/third_party/blink/renderer/modules/permissions/permission_status_listener.cc
@@ -62,7 +62,17 @@ void PermissionStatusListener::OnPermissionStatusChange(
status_ = status;
+ // The `observers_` list can change in response to permission status change
+ // events as the observers map to PermissionStatus JS objects which can be
+ // created and destroyed in the JS event handler function. To avoid UAF and
+ // list modification issues, a temporary snapshot of the observers is made and
+ // used instead.
+ HeapHashSet<WeakMember<Observer>> observers;
for (const auto& observer : observers_) {
+ observers.insert(observer);
+ }
+
+ for (const auto& observer : observers) {
if (observer)
observer->OnPermissionStatusChange(status);
else

View File

@@ -1,622 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lukasz Anforowicz <lukasza@chromium.org>
Date: Tue, 30 Aug 2022 19:18:15 +0000
Subject: Validate `source_context` in ExtensionHostMsg_OpenChannelToNativeApp.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
After this CL, the Browser process will verify `source_context` in the
IPC payload of the ExtensionHostMsg_OpenChannelToNativeApp message and
avoid processing malformed or spoofed IPCs.
Change-Id: I9466dc076c4d07dbb4bec38973000dc0418565f6
Bug: 1356234
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3854987
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041118}
diff --git a/chrome/browser/extensions/extension_security_exploit_browsertest.cc b/chrome/browser/extensions/extension_security_exploit_browsertest.cc
index 19c9c52fa5a796c93e80f77029727d64acfdfa07..4e5215739f8533d25831f3302515861df179525f 100644
--- a/chrome/browser/extensions/extension_security_exploit_browsertest.cc
+++ b/chrome/browser/extensions/extension_security_exploit_browsertest.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/test/bind.h"
+#include "build/build_config.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_tab_util.h"
@@ -40,6 +41,10 @@
#include "third_party/blink/public/mojom/service_worker/service_worker_database.mojom-forward.h"
#include "url/gurl.h"
+#if !(BUILDFLAG(IS_FUCHSIA))
+#include "chrome/browser/extensions/api/messaging/native_messaging_test_util.h"
+#endif
+
namespace extensions {
// Waits for a kill of the given RenderProcessHost and returns the
@@ -233,6 +238,10 @@ class OpenChannelToExtensionExploitTest : public ExtensionBrowserTest {
return ipc_message_waiter_->WaitForMessage();
}
+ content::WebContents* active_web_contents() {
+ return browser()->tab_strip_model()->GetActiveWebContents();
+ }
+
// Asks the `extension_id` to inject `content_script` into `web_contents`.
// Returns true if the content script execution started successfully.
bool ExecuteProgrammaticContentScript(content::WebContents* web_contents,
@@ -246,63 +255,86 @@ class OpenChannelToExtensionExploitTest : public ExtensionBrowserTest {
browser()->profile(), extension_id, background_script);
}
+ const Extension& active_extension() { return *active_extension_; }
const ExtensionId& active_extension_id() { return active_extension_->id(); }
const ExtensionId& spoofed_extension_id() { return spoofed_extension_->id(); }
private:
+ // Installs an `active_extension` and a separate, but otherwise identical
+ // `spoofed_extension` (the only difference will be the extension id).
void InstallTestExtensions() {
- // Install an `active_extension` and a separate, but otherwise identical
- // `spoofed_extension` (the only difference will be the extension id).
- auto install_extension = [this](TestExtensionDir& dir) -> const Extension* {
+ auto install_extension =
+ [this](TestExtensionDir& dir,
+ const char* extra_manifest_bits) -> const Extension* {
const char kManifestTemplate[] = R"(
{
+ %s
"name": "ContentScriptTrackerBrowserTest - Programmatic",
"version": "1.0",
"manifest_version": 2,
- "permissions": [ "tabs", "<all_urls>" ],
+ "permissions": [
+ "tabs",
+ "<all_urls>",
+ "nativeMessaging"
+ ],
"background": {"scripts": ["background_script.js"]}
} )";
- dir.WriteManifest(kManifestTemplate);
+ dir.WriteManifest(
+ base::StringPrintf(kManifestTemplate, extra_manifest_bits));
dir.WriteFile(FILE_PATH_LITERAL("background_script.js"), "");
+ dir.WriteFile(FILE_PATH_LITERAL("page.html"), "<p>page</p>");
return LoadExtension(dir.UnpackedPath());
};
- TestExtensionDir active_dir;
- TestExtensionDir spoofed_dir;
- active_extension_ = install_extension(active_dir);
- spoofed_extension_ = install_extension(spoofed_dir);
+#if !(BUILDFLAG(IS_FUCHSIA))
+ // The key below corresponds to the extension ID used by
+ // ScopedTestNativeMessagingHost::kExtensionId.
+ const char kActiveExtensionKey[] = R"(
+ "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcBHwzDvyBQ6bDppkIs9MP4ksKqCMyXQ/A52JivHZKh4YO/9vJsT3oaYhSpDCE9RPocOEQvwsHsFReW2nUEc6OLLyoCFFxIb7KkLGsmfakkut/fFdNJYh0xOTbSN8YvLWcqph09XAY2Y/f0AL7vfO1cuCqtkMt8hFrBGWxDdf9CQIDAQAB",
+ )";
+#else
+ // Native messaging is not available on Fuchsia (i.e.
+ // //chrome/browser/extensions/BUILD.gn excludes
+ // api/messaging/native_messaging_test_util.h on Fuchsia).
+ const char kActiveExtensionKey[] = "";
+#endif
+ active_extension_ = install_extension(active_dir_, kActiveExtensionKey);
+ spoofed_extension_ = install_extension(spoofed_dir_, "");
ASSERT_TRUE(active_extension_);
ASSERT_TRUE(spoofed_extension_);
+#if !(BUILDFLAG(IS_FUCHSIA))
+ ASSERT_EQ(active_extension_id(),
+ ScopedTestNativeMessagingHost::kExtensionId);
+#endif
ASSERT_NE(active_extension_id(), spoofed_extension_id());
}
using OpenChannelMessageWaiter =
ExtensionMessageWaiter<ExtensionHostMsg_OpenChannelToExtension>;
- std::unique_ptr<OpenChannelMessageWaiter> StartInterceptingIpcs(
- const GURL& test_page_url) {
// Start capturing IPC messages in all future/new RenderProcessHosts.
- auto ipc_message_waiter = std::make_unique<OpenChannelMessageWaiter>();
+ ipc_message_waiter_ = std::make_unique<OpenChannelMessageWaiter>();
// Navigate to an arbitrary, mostly empty test page. Make sure that a new
// RenderProcessHost is created to make sure it is covered by the
- // `ipc_message_waiter`. (A WebUI -> http navigation should swap the
+ // `ipc_message_waiter_`. (A WebUI -> http navigation should swap the
// RenderProcessHost on all platforms.)
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
+ GURL test_page_url =
+ embedded_test_server()->GetURL("foo.com", "/title1.html");
int old_process_id =
- web_contents->GetPrimaryMainFrame()->GetProcess()->GetID();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
EXPECT_TRUE(
ui_test_utils::NavigateToURL(browser(), GURL("chrome://version")));
EXPECT_TRUE(ui_test_utils::NavigateToURL(browser(), test_page_url));
int new_process_id =
- web_contents->GetPrimaryMainFrame()->GetProcess()->GetID();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
EXPECT_NE(old_process_id, new_process_id);
// Only intercept messages from `active_extension`'s content script running
// in the main frame's process.
std::string matching_extension_id = active_extension_id();
- int matching_process_id = new_process_id;
- ipc_message_waiter->SetIpcMatcher(base::BindLambdaForTesting(
+ int matching_process_id =
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
+ ipc_message_waiter_->SetIpcMatcher(base::BindLambdaForTesting(
[matching_extension_id, matching_process_id](
int captured_render_process_id,
const ExtensionHostMsg_OpenChannelToExtension::Param& param) {
@@ -319,12 +351,19 @@ class OpenChannelToExtensionExploitTest : public ExtensionBrowserTest {
return true;
}));
+ }
- return ipc_message_waiter;
+ // Waits for ExtensionHostMsg_OpenChannelToExtension IPC and returns its
+ // payload.
+ ExtensionHostMsg_OpenChannelToExtension::Param WaitForMessage() {
+ return ipc_message_waiter_->WaitForMessage();
}
+ private:
std::unique_ptr<OpenChannelMessageWaiter> ipc_message_waiter_;
+ TestExtensionDir active_dir_;
+ TestExtensionDir spoofed_dir_;
raw_ptr<const Extension> active_extension_ = nullptr;
raw_ptr<const Extension> spoofed_extension_ = nullptr;
};
@@ -340,24 +379,22 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
// Trigger sending of a valid ExtensionHostMsg_OpenChannelToExtension IPC
// from a content script of an `active_extension_id`.
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(ExecuteProgrammaticContentScript(
- web_contents, active_extension_id(),
+ active_web_contents(), active_extension_id(),
"chrome.runtime.sendMessage({greeting: 'hello'}, (response) => {});"));
// Capture the IPC.
auto [source_context, info, channel_name, port_id] = WaitForMessage();
-
- // Mutate the IPC payload.
EXPECT_EQ(MessagingEndpoint::Type::kTab, info.source_endpoint.type);
EXPECT_EQ(active_extension_id(), info.source_endpoint.extension_id);
+
+ // Mutate the IPC payload.
info.source_endpoint.extension_id = spoofed_extension_id();
// Inject the malformed/mutated IPC and verify that the renderer is terminated
// as expected.
content::RenderProcessHost* main_frame_process =
- web_contents->GetPrimaryMainFrame()->GetProcess();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess();
RenderProcessHostBadIpcMessageWaiter kill_waiter(main_frame_process);
IPC::IpcSecurityTestUtil::PwnMessageReceived(
main_frame_process->GetChannel(),
@@ -371,24 +408,22 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
FromContentScript_UnexpectedNativeAppType) {
// Trigger sending of a valid ExtensionHostMsg_OpenChannelToExtension IPC
// from a content script of an `active_extension_id`.
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(ExecuteProgrammaticContentScript(
- web_contents, active_extension_id(),
+ active_web_contents(), active_extension_id(),
"chrome.runtime.sendMessage({greeting: 'hello'}, (response) => {});"));
// Capture the IPC.
auto [source_context, info, channel_name, port_id] = WaitForMessage();
-
- // Mutate the IPC payload.
EXPECT_EQ(MessagingEndpoint::Type::kTab, info.source_endpoint.type);
EXPECT_EQ(active_extension_id(), info.source_endpoint.extension_id);
+
+ // Mutate the IPC payload.
info.source_endpoint.type = MessagingEndpoint::Type::kNativeApp;
// Inject the malformed/mutated IPC and verify that the renderer is terminated
// as expected.
content::RenderProcessHost* main_frame_process =
- web_contents->GetPrimaryMainFrame()->GetProcess();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess();
RenderProcessHostBadIpcMessageWaiter kill_waiter(main_frame_process);
IPC::IpcSecurityTestUtil::PwnMessageReceived(
main_frame_process->GetChannel(),
@@ -401,24 +436,22 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
FromContentScript_UnexpectedExtensionType) {
// Trigger sending of a valid ExtensionHostMsg_OpenChannelToExtension IPC
// from a content script of an `active_extension_id`.
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(ExecuteProgrammaticContentScript(
- web_contents, active_extension_id(),
+ active_web_contents(), active_extension_id(),
"chrome.runtime.sendMessage({greeting: 'hello'}, (response) => {});"));
// Capture the IPC.
auto [source_context, info, channel_name, port_id] = WaitForMessage();
-
- // Mutate the IPC payload.
EXPECT_EQ(MessagingEndpoint::Type::kTab, info.source_endpoint.type);
EXPECT_EQ(active_extension_id(), info.source_endpoint.extension_id);
+
+ // Mutate the IPC payload.
info.source_endpoint.type = MessagingEndpoint::Type::kExtension;
// Inject the malformed/mutated IPC and verify that the renderer is terminated
// as expected.
content::RenderProcessHost* main_frame_process =
- web_contents->GetPrimaryMainFrame()->GetProcess();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess();
RenderProcessHostBadIpcMessageWaiter kill_waiter(main_frame_process);
IPC::IpcSecurityTestUtil::PwnMessageReceived(
main_frame_process->GetChannel(),
@@ -432,25 +465,23 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
FromContentScript_NoExtensionIdForExtensionType) {
// Trigger sending of a valid ExtensionHostMsg_OpenChannelToExtension IPC
// from a content script of an `active_extension_id`.
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(ExecuteProgrammaticContentScript(
- web_contents, active_extension_id(),
+ active_web_contents(), active_extension_id(),
"chrome.runtime.sendMessage({greeting: 'hello'}, (response) => {});"));
// Capture the IPC.
auto [source_context, info, channel_name, port_id] = WaitForMessage();
-
- // Mutate the IPC payload.
EXPECT_EQ(MessagingEndpoint::Type::kTab, info.source_endpoint.type);
EXPECT_EQ(active_extension_id(), info.source_endpoint.extension_id);
+
+ // Mutate the IPC payload.
info.source_endpoint.type = MessagingEndpoint::Type::kExtension;
info.source_endpoint.extension_id = absl::nullopt;
// Inject the malformed/mutated IPC and verify that the renderer is terminated
// as expected.
content::RenderProcessHost* main_frame_process =
- web_contents->GetPrimaryMainFrame()->GetProcess();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess();
RenderProcessHostBadIpcMessageWaiter kill_waiter(main_frame_process);
IPC::IpcSecurityTestUtil::PwnMessageReceived(
main_frame_process->GetChannel(),
@@ -464,18 +495,16 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
FromContentScript_UnexpectedWorkerContext) {
// Trigger sending of a valid ExtensionHostMsg_OpenChannelToExtension IPC
// from a content script of an `active_extension_id`.
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(ExecuteProgrammaticContentScript(
- web_contents, active_extension_id(),
+ active_web_contents(), active_extension_id(),
"chrome.runtime.sendMessage({greeting: 'hello'}, (response) => {});"));
// Capture the IPC.
auto [source_context, info, channel_name, port_id] = WaitForMessage();
-
- // Mutate the IPC payload.
EXPECT_TRUE(source_context.is_for_render_frame());
EXPECT_FALSE(source_context.is_for_service_worker());
+
+ // Mutate the IPC payload.
source_context.frame = absl::nullopt;
source_context.worker = PortContext::WorkerContext(
/* thread_id = */ 123, /* version_id = */ 456,
@@ -484,7 +513,7 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
// Inject the malformed/mutated IPC and verify that the renderer is terminated
// as expected.
content::RenderProcessHost* main_frame_process =
- web_contents->GetPrimaryMainFrame()->GetProcess();
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess();
RenderProcessHostBadIpcMessageWaiter kill_waiter(main_frame_process);
IPC::IpcSecurityTestUtil::PwnMessageReceived(
main_frame_process->GetChannel(),
@@ -494,4 +523,98 @@ IN_PROC_BROWSER_TEST_F(OpenChannelToExtensionExploitTest,
kill_waiter.Wait());
}
+// Native messaging is not available on Fuchsia (i.e.
+// //chrome/browser/extensions/BUILD.gn excludes
+// api/messaging/native_messaging_test_util.h on Fuchsia).
+#if !(BUILDFLAG(IS_FUCHSIA))
+
+// Test suite for covering ExtensionHostMsg_OpenChannelToNativeApp IPC.
+class OpenChannelToNativeAppExploitTest
+ : public ExtensionSecurityExploitBrowserTest {
+ public:
+ OpenChannelToNativeAppExploitTest() = default;
+
+ using OpenChannelMessageWaiter =
+ ExtensionMessageWaiter<ExtensionHostMsg_OpenChannelToNativeApp>;
+ void SetUpOnMainThread() override {
+ // Set up ExtensionMessageWaiter *before* installing the extensions (i.e.
+ // *before* the corresponding RenderProcessHost objects are created).
+ ipc_message_waiter_ = std::make_unique<OpenChannelMessageWaiter>();
+
+ // SetUpOnMainThread in the base class will install the test extensions.
+ ExtensionSecurityExploitBrowserTest::SetUpOnMainThread();
+
+ // Register a (fake, test-only) native messaging host.
+ test_native_messaging_host_.RegisterTestHost(/* user_level= */ false);
+
+ // Navigate the test tab to an extension page.
+ GURL test_page_url = active_extension().GetResourceURL("page.html");
+ EXPECT_TRUE(ui_test_utils::NavigateToURL(browser(), test_page_url));
+
+ // Only intercept messages from the test process.
+ int matching_process_id =
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
+ ipc_message_waiter_->SetIpcMatcher(base::BindLambdaForTesting(
+ [matching_process_id](
+ int captured_render_process_id,
+ const ExtensionHostMsg_OpenChannelToNativeApp::Param& param) {
+ if (captured_render_process_id != matching_process_id)
+ return false;
+
+ return true;
+ }));
+ }
+
+ // Waits for ExtensionHostMsg_OpenChannelToNativeApp IPC and returns its
+ // payload.
+ ExtensionHostMsg_OpenChannelToNativeApp::Param WaitForMessage() {
+ return ipc_message_waiter_->WaitForMessage();
+ }
+
+ private:
+ ScopedTestNativeMessagingHost test_native_messaging_host_;
+ std::unique_ptr<OpenChannelMessageWaiter> ipc_message_waiter_;
+};
+
+IN_PROC_BROWSER_TEST_F(OpenChannelToNativeAppExploitTest,
+ SourceContextWithSpoofedExtensionId) {
+ // Trigger sending of a valid ExtensionHostMsg_OpenChannelToNativeApp IPC
+ // from a frame of an `active_extension`.
+ const char kScript[] = R"(
+ var message = {text: 'Hello!'};
+ var host = $1;
+ chrome.runtime.sendNativeMessage(host, message);
+ )";
+ ASSERT_EQ(
+ active_extension().origin(),
+ active_web_contents()->GetPrimaryMainFrame()->GetLastCommittedOrigin());
+ ASSERT_TRUE(content::ExecuteScript(
+ active_web_contents(),
+ content::JsReplace(kScript, ScopedTestNativeMessagingHost::kHostName)));
+
+ // Capture the IPC.
+ auto [source_context, native_app_name, port_id] = WaitForMessage();
+ EXPECT_EQ(native_app_name, ScopedTestNativeMessagingHost::kHostName);
+ EXPECT_TRUE(source_context.is_for_render_frame());
+
+ // Mutate the IPC payload.
+ source_context = PortContext::ForWorker(123, // thread_id
+ 456, // version_id
+ spoofed_extension_id());
+
+ // Inject the malformed/mutated IPC and verify that the renderer is terminated
+ // as expected.
+ content::RenderProcessHost* main_frame_process =
+ active_web_contents()->GetPrimaryMainFrame()->GetProcess();
+ RenderProcessHostBadIpcMessageWaiter kill_waiter(main_frame_process);
+ IPC::IpcSecurityTestUtil::PwnMessageReceived(
+ main_frame_process->GetChannel(),
+ ExtensionHostMsg_OpenChannelToNativeApp(source_context, native_app_name,
+ port_id));
+ EXPECT_EQ(bad_message::EMF_INVALID_EXTENSION_ID_FOR_WORKER_CONTEXT,
+ kill_waiter.Wait());
+}
+
+#endif // !(BUILDFLAG(IS_FUCHSIA)) - native messaging is available
+
} // namespace extensions
diff --git a/docs/security/compromised-renderers.md b/docs/security/compromised-renderers.md
index b7e56be454f2d42dc4ae4ac875586a01f2354d9a..2155a399e0e432fedc2792b6893440efd7fca572 100644
--- a/docs/security/compromised-renderers.md
+++ b/docs/security/compromised-renderers.md
@@ -213,14 +213,21 @@ Compromised renderers shouldnt be able to:
- Spoof the `MessageEvent.origin` seen by a recipient of a `postMessage`.
- Bypass enforcement of the `targetOrigin` argument of `postMessage`.
- Send or receive `BroadcastChannel` messages for another origin.
-- Spoof the `MessageSender.origin` seen by a recipient of a
- `chrome.runtime.sendMessage`
- (see also [MessageSender documentation](https://developers.chrome.com/extensions/runtime#type-MessageSender) and [content script security guidance](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/0ei-UCHNm34)).
+- Spoof the `MessageSender.origin`, nor `MessageSender.id` (i.e. an
+ extension id which can differ from the origin when the message is sent
+ from a content script), as seen by a recipient of a
+ `chrome.runtime.sendMessage`.
+ See also [MessageSender documentation](https://developers.chrome.com/extensions/runtime#type-MessageSender) and [content script security guidance](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/0ei-UCHNm34).
+- Spoof the id of a Chrome extension initiating
+ [native messaging](https://developer.chrome.com/docs/apps/nativeMessaging/)
+ communication.
Protection techniques:
- Using `CanAccessDataForOrigin` to verify IPCs sent by a renderer process
(e.g. in `RenderFrameProxyHost::OnRouteMessageEvent` or
`BroadcastChannelProvider::ConnectToChannel`).
+- Using `ContentScriptTracker` to check if IPCs from a given renderer process
+ can legitimately claim to act on behalf content scripts of a given extension.
**Known gaps in protection**:
- Spoofing of `MessageSender.id` object
diff --git a/extensions/browser/api/messaging/messaging_api_message_filter.cc b/extensions/browser/api/messaging/messaging_api_message_filter.cc
index 5469f5e91bfbb98aece208e9fffa8139dc9dacdf..e57cffb46d74229fff2534f7bb9f9fa3ddbc3d26 100644
--- a/extensions/browser/api/messaging/messaging_api_message_filter.cc
+++ b/extensions/browser/api/messaging/messaging_api_message_filter.cc
@@ -156,6 +156,16 @@ bool IsValidSourceContext(RenderProcessHost& process,
}
}
+ // This function doesn't validate frame-flavoured `source_context`s, because
+ // PortContext::FrameContext only contains frame's `routing_id` and therefore
+ // inherently cannot spoof frames in another process (a frame is identified
+ // by its `routing_id` *and* the `process_id` of the Renderer process hosting
+ // the frame; the latter is trustworthy / doesn't come from an IPC payload).
+
+ // This function doesn't validate native app `source_context`s, because
+ // `PortContext::ForNativeHost()` is called with trustoworthy inputs (e.g. it
+ // doesn't take input from IPCs sent by a Renderer process).
+
return true;
}
@@ -227,6 +237,18 @@ void MessagingAPIMessageFilter::Shutdown() {
shutdown_notifier_subscription_ = {};
}
+content::RenderProcessHost* MessagingAPIMessageFilter::GetRenderProcessHost() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (!browser_context_)
+ return nullptr;
+
+ // The IPC might race with RenderProcessHost destruction. This may only
+ // happen in scenarios that are already inherently racey, so returning nullptr
+ // (and dropping the IPC) is okay and won't lead to any additional risk of
+ // data loss.
+ return content::RenderProcessHost::FromID(render_process_id_);
+}
+
void MessagingAPIMessageFilter::OverrideThreadForMessage(
const IPC::Message& message,
BrowserThread::ID* thread) {
@@ -272,19 +294,14 @@ void MessagingAPIMessageFilter::OnOpenChannelToExtension(
const std::string& channel_name,
const PortId& port_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (!browser_context_)
- return;
-
- // The IPC might race with RenderProcessHost destruction. This may only
- // happen in scenarios that are already inherently racey, so dropping the IPC
- // is okay and won't lead to any additional risk of data loss.
- auto* process = content::RenderProcessHost::FromID(render_process_id_);
+ auto* process = GetRenderProcessHost();
if (!process)
return;
TRACE_EVENT("extensions", "MessageFilter::OnOpenChannelToExtension",
ChromeTrackEvent::kRenderProcessHost, *process);
ScopedExternalConnectionInfoCrashKeys info_crash_keys(info);
+ debug::ScopedPortContextCrashKeys port_context_crash_keys(source_context);
if (!IsValidMessagingSource(*process, info.source_endpoint) ||
!IsValidSourceContext(*process, source_context)) {
return;
@@ -303,7 +320,14 @@ void MessagingAPIMessageFilter::OnOpenChannelToNativeApp(
const std::string& native_app_name,
const PortId& port_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (!browser_context_)
+ auto* process = GetRenderProcessHost();
+ if (!process)
+ return;
+ TRACE_EVENT("extensions", "MessageFilter::OnOpenChannelToNativeApp",
+ ChromeTrackEvent::kRenderProcessHost, *process);
+
+ debug::ScopedPortContextCrashKeys port_context_crash_keys(source_context);
+ if (!IsValidSourceContext(*process, source_context))
return;
ChannelEndpoint source_endpoint(browser_context_, render_process_id_,
diff --git a/extensions/browser/api/messaging/messaging_api_message_filter.h b/extensions/browser/api/messaging/messaging_api_message_filter.h
index 6a0ccd698629f650d68f2b4ee168aa2b3b3a116c..3358187387cd9a5765a7bd4e522aeecfd787e06b 100644
--- a/extensions/browser/api/messaging/messaging_api_message_filter.h
+++ b/extensions/browser/api/messaging/messaging_api_message_filter.h
@@ -14,6 +14,7 @@ struct ExtensionMsg_TabTargetConnectionInfo;
namespace content {
class BrowserContext;
+class RenderProcessHost;
}
namespace extensions {
@@ -40,6 +41,11 @@ class MessagingAPIMessageFilter : public content::BrowserMessageFilter {
void Shutdown();
+ // Returns the process that the IPC came from, or `nullptr` if the IPC should
+ // be dropped (in case the IPC arrived racily after the process or its
+ // BrowserContext already got destructed).
+ content::RenderProcessHost* GetRenderProcessHost();
+
// content::BrowserMessageFilter implementation:
void OverrideThreadForMessage(const IPC::Message& message,
content::BrowserThread::ID* thread) override;
diff --git a/extensions/common/api/messaging/port_context.cc b/extensions/common/api/messaging/port_context.cc
index 6872179450d8295de7f15dc1437e9d6edefe4fde..319e2f34eca730c5eb7cf94ef8cdede0ddc3f8e1 100644
--- a/extensions/common/api/messaging/port_context.cc
+++ b/extensions/common/api/messaging/port_context.cc
@@ -40,4 +40,27 @@ PortContext PortContext::ForNativeHost() {
return PortContext();
}
+namespace debug {
+
+namespace {
+
+base::debug::CrashKeyString* GetServiceWorkerExtensionIdCrashKey() {
+ static auto* crash_key = base::debug::AllocateCrashKeyString(
+ "PortContext-worker-extension_id", base::debug::CrashKeySize::Size64);
+ return crash_key;
+}
+
+} // namespace
+
+ScopedPortContextCrashKeys::ScopedPortContextCrashKeys(
+ const PortContext& port_context) {
+ if (port_context.is_for_service_worker()) {
+ extension_id_.emplace(GetServiceWorkerExtensionIdCrashKey(),
+ port_context.worker->extension_id);
+ }
+}
+
+ScopedPortContextCrashKeys::~ScopedPortContextCrashKeys() = default;
+
+} // namespace debug
} // namespace extensions
diff --git a/extensions/common/api/messaging/port_context.h b/extensions/common/api/messaging/port_context.h
index b2e9f057b531d90dc256773959cd586953e4915c..53d94c2ad73c58d45b186a32989e2f4864e67d79 100644
--- a/extensions/common/api/messaging/port_context.h
+++ b/extensions/common/api/messaging/port_context.h
@@ -9,6 +9,7 @@
#include <string>
+#include "base/debug/crash_logging.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace extensions {
@@ -59,6 +60,19 @@ struct PortContext {
absl::optional<WorkerContext> worker;
};
+namespace debug {
+
+class ScopedPortContextCrashKeys {
+ public:
+ explicit ScopedPortContextCrashKeys(const PortContext& port_context);
+ ~ScopedPortContextCrashKeys();
+
+ private:
+ absl::optional<base::debug::ScopedCrashKeyString> extension_id_;
+};
+
+} // namespace debug
+
} // namespace extensions
#endif // EXTENSIONS_COMMON_API_MESSAGING_PORT_CONTEXT_H_

View File

@@ -1,292 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peng Huang <penghuang@chromium.org>
Date: Wed, 23 Nov 2022 00:16:49 +0000
Subject: Fix potential OOB problem with validating command decoder
Bug: 1392715
Change-Id: If51b10cc08e5b3ca4b6012b97261347a5e4c134e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4048203
Auto-Submit: Peng Huang <penghuang@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074966}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index a36b9901b50cd99ac641d70d2f316362006e45e7..73148877e2b8b28374ffd32aa10361d21e4911e4 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8595,10 +8595,18 @@ void GLES2DecoderImpl::DoFramebufferTexture2DCommon(
service_id = texture_ref->service_id();
}
+ bool valid_target = false;
+ if (texture_ref) {
+ valid_target = texture_manager()->ValidForTextureTarget(
+ texture_ref->texture(), level, 0, 0, 1);
+ } else {
+ valid_target = texture_manager()->ValidForTarget(textarget, level, 0, 0, 1);
+ }
+
if ((level > 0 && !feature_info_->IsWebGL2OrES3Context() &&
!(fbo_render_mipmap_explicitly_enabled_ &&
feature_info_->feature_flags().oes_fbo_render_mipmap)) ||
- !texture_manager()->ValidForTarget(textarget, level, 0, 0, 1)) {
+ !valid_target) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE,
name, "level out of range");
@@ -8670,8 +8678,8 @@ void GLES2DecoderImpl::DoFramebufferTextureLayer(
"texture is neither TEXTURE_3D nor TEXTURE_2D_ARRAY");
return;
}
- if (!texture_manager()->ValidForTarget(texture_target, level,
- 0, 0, layer)) {
+ if (!texture_manager()->ValidForTextureTarget(texture_ref->texture(), level,
+ 0, 0, layer)) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, function_name, "invalid level or layer");
return;
@@ -14757,11 +14765,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage(
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "imageSize < 0");
return error::kNoError;
}
- if (!texture_manager()->ValidForTarget(target, level, width, height, depth) ||
- border != 0) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
- return error::kNoError;
- }
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
if (!texture_ref) {
@@ -14770,6 +14773,12 @@ error::Error GLES2DecoderImpl::DoCompressedTexImage(
return error::kNoError;
}
Texture* texture = texture_ref->texture();
+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height,
+ depth) ||
+ border != 0) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
+ return error::kNoError;
+ }
if (texture->IsImmutable()) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, "texture is immutable");
return error::kNoError;
@@ -15139,10 +15148,6 @@ error::Error GLES2DecoderImpl::DoCompressedTexSubImage(
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "imageSize < 0");
return error::kNoError;
}
- if (!texture_manager()->ValidForTarget(target, level, width, height, depth)) {
- LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
- return error::kNoError;
- }
TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
&state_, target);
if (!texture_ref) {
@@ -15150,7 +15155,14 @@ error::Error GLES2DecoderImpl::DoCompressedTexSubImage(
GL_INVALID_OPERATION, func_name, "no texture bound at target");
return error::kNoError;
}
+
Texture* texture = texture_ref->texture();
+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height,
+ depth)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, func_name, "dimensions out of range");
+ return error::kNoError;
+ }
+
GLenum type = 0;
GLenum internal_format = 0;
if (!texture->GetLevelType(target, level, &type, &internal_format)) {
@@ -15275,7 +15287,8 @@ void GLES2DecoderImpl::DoCopyTexImage2D(
GL_INVALID_OPERATION, func_name, "texture is immutable");
return;
}
- if (!texture_manager()->ValidForTarget(target, level, width, height, 1) ||
+ if (!texture_manager()->ValidForTextureTarget(texture, level, width, height,
+ 1) ||
border != 0) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, func_name, "dimensions out of range");
@@ -17848,8 +17861,8 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
}
// Check that this type of texture is allowed.
- if (!texture_manager()->ValidForTarget(source_target, source_level,
- source_width, source_height, 1)) {
+ if (!texture_manager()->ValidForTextureTarget(
+ source_texture, source_level, source_width, source_height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, kFunctionName, "Bad dimensions");
return;
}
@@ -18016,8 +18029,8 @@ void GLES2DecoderImpl::CopySubTextureHelper(const char* function_name,
}
// Check that this type of texture is allowed.
- if (!texture_manager()->ValidForTarget(source_target, source_level,
- source_width, source_height, 1)) {
+ if (!texture_manager()->ValidForTextureTarget(
+ source_texture, source_level, source_width, source_height, 1)) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, function_name,
"source texture bad dimensions");
return;
@@ -18257,11 +18270,20 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
return;
}
}
+ TextureRef* texture_ref =
+ texture_manager()->GetTextureInfoForTarget(&state_, target);
+ if (!texture_ref) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name,
+ "unknown texture for target");
+ return;
+ }
+ Texture* texture = texture_ref->texture();
// The glTexStorage entry points require width, height, and depth to be
// at least 1, but the other texture entry points (those which use
- // ValidForTarget) do not. So we have to add an extra check here.
+ // ValidForTextureTarget) do not. So we have to add an extra check here.
bool is_invalid_texstorage_size = width < 1 || height < 1 || depth < 1;
- if (!texture_manager()->ValidForTarget(target, 0, width, height, depth) ||
+ if (!texture_manager()->ValidForTextureTarget(texture, 0, width, height,
+ depth) ||
is_invalid_texstorage_size) {
LOCAL_SET_GL_ERROR(
GL_INVALID_VALUE, function_name, "dimensions out of range");
@@ -18274,14 +18296,6 @@ void GLES2DecoderImpl::TexStorageImpl(GLenum target,
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, function_name, "too many levels");
return;
}
- TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget(
- &state_, target);
- if (!texture_ref) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION, function_name, "unknown texture for target");
- return;
- }
- Texture* texture = texture_ref->texture();
if (texture->IsAttachedToFramebuffer()) {
framebuffer_state_.clear_state_dirty = true;
}
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index b20b875b6b37c36623b41e648e393ded96bae93b..f5df8270a8192d36b95e619248c128167455ef46 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1641,7 +1641,7 @@ void Texture::Update() {
return;
if (face_infos_.empty() ||
- static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size()) {
+ static_cast<size_t>(base_level_) >= MaxValidMipLevel()) {
texture_complete_ = false;
cube_complete_ = false;
return;
@@ -2028,8 +2028,7 @@ bool Texture::CanRenderTo(const FeatureInfo* feature_info, GLint level) const {
// the time.
if (face_infos_.size() == 6 && !cube_complete())
return false;
- DCHECK(level >= 0 &&
- level < static_cast<GLint>(face_infos_[0].level_infos.size()));
+ DCHECK(level >= 0 && level < static_cast<GLint>(MaxValidMipLevel()));
if (level > base_level_ && !texture_complete()) {
return false;
}
@@ -2064,7 +2063,7 @@ void Texture::SetCompatibilitySwizzle(const CompatibilitySwizzle* swizzle) {
void Texture::ApplyFormatWorkarounds(const FeatureInfo* feature_info) {
if (feature_info->gl_version_info().NeedsLuminanceAlphaEmulation()) {
- if (static_cast<size_t>(base_level_) >= face_infos_[0].level_infos.size())
+ if (static_cast<size_t>(base_level_) >= MaxValidMipLevel())
return;
const Texture::LevelInfo& info = face_infos_[0].level_infos[base_level_];
SetCompatibilitySwizzle(GetCompatibilitySwizzleInternal(info.format));
@@ -2298,8 +2297,11 @@ scoped_refptr<TextureRef>
return default_texture;
}
-bool TextureManager::ValidForTarget(
- GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth) {
+bool TextureManager::ValidForTarget(GLenum target,
+ GLint level,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth) {
if (level < 0 || level >= MaxLevelsForTarget(target))
return false;
GLsizei max_size = MaxSizeForTarget(target) >> level;
@@ -2319,6 +2321,18 @@ bool TextureManager::ValidForTarget(
(target != GL_TEXTURE_2D || (depth == 1));
}
+bool TextureManager::ValidForTextureTarget(const Texture* texture,
+ GLint level,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth) {
+ if (texture->target() == 0)
+ return false;
+ if (level < 0 || static_cast<size_t>(level) >= texture->MaxValidMipLevel())
+ return false;
+ return ValidForTarget(texture->target(), level, width, height, depth);
+}
+
void TextureManager::SetTarget(TextureRef* ref, GLenum target) {
DCHECK(ref);
ref->texture()->SetTarget(target, MaxLevelsForTarget(target));
@@ -2802,14 +2816,6 @@ bool TextureManager::ValidateTexImage(ContextState* state,
args.internal_format, args.level)) {
return false;
}
- if (!ValidForTarget(args.target, args.level,
- args.width, args.height, args.depth) ||
- args.border != 0) {
- ERRORSTATE_SET_GL_ERROR(
- error_state, GL_INVALID_VALUE, function_name,
- "dimensions out of range");
- return false;
- }
if ((GLES2Util::GetChannelsForFormat(args.format) &
(GLES2Util::kDepth | GLES2Util::kStencil)) != 0 && args.pixels
&& !feature_info_->IsWebGL2OrES3Context()) {
@@ -2832,7 +2838,13 @@ bool TextureManager::ValidateTexImage(ContextState* state,
"texture is immutable");
return false;
}
-
+ if (!ValidForTextureTarget(local_texture_ref->texture(), args.level,
+ args.width, args.height, args.depth) ||
+ args.border != 0) {
+ ERRORSTATE_SET_GL_ERROR(error_state, GL_INVALID_VALUE, function_name,
+ "dimensions out of range");
+ return false;
+ }
Buffer* buffer = state->bound_pixel_unpack_buffer.get();
if (buffer) {
if (buffer->GetMappedRange()) {
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index c78c914cbad58abb17439354eeb9f77a9891f21d..8f68e70e6d1c9a4b75f6bec0df7179320bc167c0 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -470,6 +470,11 @@ class GPU_GLES2_EXPORT Texture final : public TextureBase {
sampler_state_.min_filter != GL_LINEAR;
}
+ size_t MaxValidMipLevel() const {
+ DCHECK(!face_infos_.empty());
+ return face_infos_[0].level_infos.size();
+ }
+
private:
friend class MailboxManagerTest;
friend class TextureManager;
@@ -932,6 +937,11 @@ class GPU_GLES2_EXPORT TextureManager
bool ValidForTarget(
GLenum target, GLint level,
GLsizei width, GLsizei height, GLsizei depth);
+ bool ValidForTextureTarget(const Texture* texture,
+ GLint level,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth);
// True if this texture meets all the GLES2 criteria for rendering.
// See section 3.8.2 of the GLES2 spec.

View File

@@ -1,115 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christoph Schwering <schwering@google.com>
Date: Fri, 4 Nov 2022 00:56:32 +0000
Subject: Handle misaligned FormData, FormStructure.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This CL handles the case where the fields of the cached FormStructure
and the FormData are misaligned in
BrowserAutofillManager::WillFillCreditCardNumber.
(cherry picked from commit 1ad751f7dfa30a12a85824c291394b73c5c47eff)
Bug: 1376637, 1376639
Change-Id: Id7c3357a274b4d6624009ecf52b95a24cf3bfa1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3965141
Commit-Queue: Christoph Schwering <schwering@google.com>
Quick-Run: Christoph Schwering <schwering@google.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Auto-Submit: Christoph Schwering <schwering@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1061790}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4003032
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#907}
Cr-Branched-From: 4f7bea5de862aaa52e6bde5920755a9ef9db120b-refs/heads/main@{#1036826}
diff --git a/chrome/test/data/autofill/captured_sites/testcases.json b/chrome/test/data/autofill/captured_sites/testcases.json
index bb7ac2a638a410b3e83b9871314eae27aa8ef229..2e69d8f8532760103b9cccd5efc4ca7a4ad016a1 100644
--- a/chrome/test/data/autofill/captured_sites/testcases.json
+++ b/chrome/test/data/autofill/captured_sites/testcases.json
@@ -17,7 +17,7 @@
{ "site_name": "bath_and_body_works" },
{ "site_name": "beachbody" },
{ "site_name": "bed_bath_beyond" },
- { "site_name": "belk" },
+ { "site_name": "belk", "bug_number": 1376637 },
{ "site_name": "bestbuy" },
{ "site_name": "bhphotovideo", "bug_number":1173033 },
{ "site_name": "bloomingdales" },
diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc
index 2dad433c7deb91a2d06f7a10077c9197bd2eba98..0a6e94a1f5327600c1c13cd6fd7586c7ca09037e 100644
--- a/components/autofill/core/browser/browser_autofill_manager.cc
+++ b/components/autofill/core/browser/browser_autofill_manager.cc
@@ -1069,26 +1069,36 @@ void BrowserAutofillManager::OnAskForValuesToFillImpl(
bool BrowserAutofillManager::WillFillCreditCardNumber(
const FormData& form,
- const FormFieldData& field) {
+ const FormFieldData& triggered_field_data) {
FormStructure* form_structure = nullptr;
- AutofillField* autofill_field = nullptr;
- if (!GetCachedFormAndField(form, field, &form_structure, &autofill_field))
+ AutofillField* triggered_field = nullptr;
+ if (!GetCachedFormAndField(form, triggered_field_data, &form_structure,
+ &triggered_field)) {
return false;
+ }
- if (autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER)
+ if (triggered_field->Type().GetStorableType() == CREDIT_CARD_NUMBER)
return true;
- DCHECK_EQ(form_structure->field_count(), form.fields.size());
- for (size_t i = 0; i < form_structure->field_count(); ++i) {
- if (form_structure->field(i)->section == autofill_field->section &&
- form_structure->field(i)->Type().GetStorableType() ==
- CREDIT_CARD_NUMBER &&
- form.fields[i].value.empty() && !form.fields[i].is_autofilled) {
- return true;
- }
- }
+ // `form` is the latest version of the form received from the renderer and may
+ // be more up to date than the `form_structure` in the cache. Therefore, we
+ // need to validate for each `field` in the cache we try to fill whether
+ // it still exists in the renderer and whether it is fillable.
+ auto IsFillableField = [&form](FieldGlobalId id) {
+ auto it = base::ranges::find(form.fields, id, &FormFieldData::global_id);
+ return it != form.fields.end() && it->value.empty() && !it->is_autofilled;
+ };
- return false;
+ auto IsFillableCreditCardNumberField = [&triggered_field,
+ &IsFillableField](const auto& field) {
+ return field->Type().GetStorableType() == CREDIT_CARD_NUMBER &&
+ field->section == triggered_field->section &&
+ IsFillableField(field->global_id());
+ };
+
+ // This runs O(N^2) in the worst case, but usually there aren't too many
+ // credit card number fields in a form.
+ return base::ranges::any_of(*form_structure, IsFillableCreditCardNumberField);
}
void BrowserAutofillManager::FillOrPreviewCreditCardForm(
diff --git a/components/autofill/core/browser/browser_autofill_manager.h b/components/autofill/core/browser/browser_autofill_manager.h
index d6d33df90907dd1521108cfbae1ecbd430bb4e8e..03f92c993a05122b0df1e3b6afdad50edd9e1b41 100644
--- a/components/autofill/core/browser/browser_autofill_manager.h
+++ b/components/autofill/core/browser/browser_autofill_manager.h
@@ -475,11 +475,11 @@ class BrowserAutofillManager : public AutofillManager,
// profile does not exist.
AutofillProfile* GetProfile(int unique_id);
- // Determines whether a fill on |form| initiated from |field| will wind up
- // filling a credit card number. This is useful to determine if we will need
- // to unmask a card.
+ // Determines whether a fill on |form| initiated from |triggered_field| will
+ // wind up filling a credit card number. This is useful to determine if we
+ // will need to unmask a card.
bool WillFillCreditCardNumber(const FormData& form,
- const FormFieldData& field);
+ const FormFieldData& triggered_field);
// Fills or previews the credit card form.
// Assumes the form and field are valid.

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