Compare commits

..

311 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
151e098f9f Bump v18.3.10 2022-08-24 08:32:04 -07:00
trop[bot]
89945eced3 fix: don't bypass redirect checks (#35367)
Co-authored-by: Jeremy Rose <japthorp@slack-corp.com>
2022-08-18 10:09:11 -07:00
Sudowoodo Release Bot
dce1b44b61 Bump v18.3.9 2022-08-17 08:34:27 -07:00
Pedro Pontes
8b7a1ca78f chore: cherry-pick bd9724c9fe63 from chromium (#35276)
* chore: cherry-pick bd9724c9fe63 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-08-16 13:31:41 -04:00
trop[bot]
00120e6337 fix: add uv_loop_close when object release to fix crash (#35340)
Co-authored-by: yangzuohui <yangzuohui@bytedance.com>
2022-08-15 16:48:01 -04:00
Pedro Pontes
3e524ffe31 chore: cherry-pick c643d18a078d from chromium (#35272)
* chore: cherry-pick c643d18a078d from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-08-15 15:46:06 +09:00
trop[bot]
57f29743b4 fix: WCO occlusion of DevTools (#35307)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-15 10:30:49 +09:00
Pedro Pontes
75b03a5aae chore: cherry-pick 54a7927b19f9 from chromium (#35268)
Co-authored-by: Electron Bot <electron@github.com>
2022-08-15 09:58:51 +09:00
Sudowoodo Release Bot
6efe392926 Bump v18.3.8 2022-08-10 08:32:20 -07:00
Pedro Pontes
16a5482dde chore: cherry-pick 60d8559e150a from chromium (#35270)
* chore: cherry-pick 60d8559e150a from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-08-09 14:51:52 -04:00
Pedro Pontes
047a48ebfd chore: cherry-pick 54e32332750c from chromium (#35274)
* chore: cherry-pick 54e32332750c from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-08-09 10:37:12 +02:00
Jeremy Rose
f78d95d3ad chore: cherry-pick 94a8bdafc8c6 from chromium (#35236)
* chore: cherry-pick 94a8bdafc8c6 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-08-09 09:38:56 +02:00
trop[bot]
3314f0cbf5 fix: merge crash annotations instead of overwriting (#35263)
ElectronCrashReporterClient::GetProcessSimpleAnnotations() merges
annotations provided as argument with global_annotations_,
preserving useful information.

Co-authored-by: Alexander Petrov <zowers+github@zowers.net>
2022-08-08 21:57:43 +02:00
Milan Burda
05bf827fc0 build: fix building with enable_plugins = false (#35261) 2022-08-08 11:46:01 -04:00
Jeremy Rose
03d98f04b6 chore: cherry-pick 06aea31d10f8 from webrtc (#35238)
* chore: cherry-pick 06aea31d10f8 from webrtc

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-08-08 16:44:08 +02:00
trop[bot]
b494afe684 fix: add support for --ozone-platform-hint flag on Linux (#35013)
* fix: add support for --ozone-platform-hint flag on Linux

* fixup! fix: add support for --ozone-platform-hint flag on Linux

Co-authored-by: Valentin Hăloiu <valentin.haloiu@gmail.com>
2022-08-04 10:57:46 +02:00
trop[bot]
f54c9df0cd fix: handle WCO pressed state when going maximized -> minimized (#35072)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-04 10:51:48 +02:00
Sudowoodo Release Bot
dee6e01e9e Bump v18.3.7 2022-08-03 08:32:21 -07:00
Robo
483e39cc74 chore: cherry-pick 97193a64b431 from chromium (#35184)
Backports https://chromium-review.googlesource.com/c/chromium/src/+/3542265

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-08-03 10:34:29 -04:00
trop[bot]
cd7490d233 fix: consider dock space when showing menu (#35198)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-08-03 10:21:04 -04:00
trop[bot]
b990bd6c97 fix: allow setsize to be called within a move or resize for preventDefault (#35082)
fix: #34599 allow setsize to be called within a move or resize for preventDefault

Co-authored-by: Ian German Mesner <mesner@gmail.com>
2022-08-03 11:54:58 +02:00
trop[bot]
56a0b45ef2 fix: modify file extension generation on Windows (#35171)
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>

Co-authored-by: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-08-02 15:54:02 -04:00
Robo
5871f81bb9 fix: touch events not recognized by WCO on windows (#35117) (#35177)
* fix: touch events not recognized by WCO on windows (#35117)

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-08-02 15:39:57 -04:00
trop[bot]
511f27506f ci: turn off windows on arm test result comments (#35167)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-08-02 10:58:22 -04:00
trop[bot]
8189ee64b9 chore: add electron deps to //src gitignore (#35148)
chore: add electon deps to //src gitignore

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-08-01 16:55:07 -04:00
trop[bot]
cc52f07023 ci: switch to GHA for WOA (#35127)
ci: switch to GHA for WOA (#35109)

* ci: switch to GHA for WOA

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit 674596d11e)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-07-29 14:56:31 -04:00
trop[bot]
890adefb95 docs: new main -> renderers messageChannel example (#35133)
* 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: Kilian Valkhof <kilian@kilianvalkhof.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-07-29 11:44:45 -07:00
trop[bot]
348e76b1d6 fix: empty result of webContents.getUserAgent() (#35130)
fix: empty result of webContents.getUserAgent()

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-29 11:44:14 -07:00
Pedro Pontes
cfee3286b2 chore: cherry-pick 902f0d144a5b from chromium (#35097)
* chore: cherry-pick 902f0d144a5b from chromium

* chore: update patches

* Trigger Build

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-07-29 10:57:32 -04:00
Pedro Pontes
d7acbeb8ee chore: cherry-pick 3466cc056b05 from pdfium (#35099)
* chore: cherry-pick 3466cc056b05 from pdfium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-28 15:46:48 -04:00
Sudowoodo Release Bot
b35c90777a Bump v18.3.6 2022-07-28 09:21:57 -07:00
Pedro Pontes
b5bc30da45 chore: cherry-pick 664e0d8b4cfb from chromium (#35102)
* chore: cherry-pick 664e0d8b4cfb from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-28 11:54:23 -04:00
Devin Foley
3ca4944ad8 fix: Make disable_color_correct_rendering patch work again (#35088)
Fix disable_color_correct_rendering patch.
2022-07-28 12:14:13 +02:00
Keeley Hammond
40fcfaa5e9 fix: use win_clang_x64 binary for x86 extract symbols (#35078) (#35096) 2022-07-28 16:55:54 +09:00
John Kleinschmidt
da6e16157f ci: explicitly use pylint-1.5 for pylint (#35105)
3780302: pylint: drop unversioned program

https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3780302
2022-07-27 16:26:54 -04:00
trop[bot]
358d6f83cf fix: crash on BrowserWindow.setEnabled() (#34973)
fix: crash on BrowserWindow.setEnabled()

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-27 11:16:01 +02:00
Jeremy Rose
c5918acbf1 chore: cherry-pick ecad352cd614 from chromium (#34689) 2022-07-25 15:44:10 -07:00
Jeremy Rose
dba8e7fe42 chore: cherry-pick d7a5d6b38ea8 from chromium (#34998)
* chore: [18-x-y] cherry-pick d7a5d6b38ea8 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-07-25 10:50:07 +02:00
Sudowoodo Release Bot
2fc331859f Revert "Bump v18.3.6"
This reverts commit c3a3274826.
2022-07-22 14:52:13 -07:00
Sudowoodo Release Bot
c3a3274826 Bump v18.3.6 2022-07-22 13:10:03 -07:00
Jeremy Rose
675737397d chore: cherry-pick 22abbad430b6 from chromium (#35004)
* chore: [18-x-y] cherry-pick 22abbad430b6 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-07-21 10:29:03 -07:00
Jeremy Rose
5059502456 chore: cherry-pick 3cbd5973d704 from chromium (#35002)
* chore: [18-x-y] cherry-pick 3cbd5973d704 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-21 09:37:35 +02:00
Jeremy Rose
b1093f454c chore: cherry-pick 8ea66a7833e2 from v8 (#35000)
* chore: [18-x-y] cherry-pick 8ea66a7833e2 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-21 09:37:24 +02:00
John Kleinschmidt
51146df170 build: run CI tests on Xcode 13.3.0 (#34982)
* 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

(cherry picked from commit 459404f536)

* chore: update circleci config with needed changes from main

(cherry picked from commit f3ed1bd0f1)

Co-authored-by: Samuel Attard <sam@electronjs.org>
2022-07-20 09:30:48 +02:00
trop[bot]
1c59c8eb61 ci: wait longer for goma to be ready (#34964)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-07-19 16:28:17 +02:00
trop[bot]
09bb0c14a7 fix: alwaysOnTop browser window option for X11 Linux (#34911)
fix: alwaysontop browser window option for x11

Co-authored-by: Gellert Hegyi <gellert.hegyi@around.co>
2022-07-19 10:52:59 +02:00
trop[bot]
fcef0963d2 fix: prevent brief display of "Ozone X11" in window title on Linux (#34943) 2022-07-19 10:19:59 +02:00
Shelley Vohr
b608874076 fix: fullscreen windows aren't resizable on macOS (#34907) 2022-07-14 09:22:17 +02:00
Shelley Vohr
f06842e6f8 fix: call loadUrl when opening new windows from links (#34910) 2022-07-13 17:17:04 -04:00
trop[bot]
4119881a36 fix: set Wayland application ID (#34877)
* refactor: extract XDG app ID logic into a method

* fix: set application ID on Wayland

Co-authored-by: Valentin Hăloiu <valentin.haloiu@gmail.com>
2022-07-12 10:16:15 +02:00
Pedro Pontes
ecb9afd7d6 chore: cherry-pick 13ffdf63a471 from v8 (#34881)
* chore: [18-x-y] cherry-pick 13ffdf63a471 from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-12 10:16:05 +02:00
Pedro Pontes
a70431f8db chore: cherry-pick 763d847f1e5a from webrtc (#34882)
* chore: cherry-pick 763d847f1e5a from webrtc

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-11 20:08:19 -04:00
trop[bot]
b21dae6bee fix: safer check for WCO button updates (#34873)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-11 13:37:42 +02:00
trop[bot]
cb3fef890f fix: WCO pressed background state updates (#34838)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-11 17:21:36 +09:00
trop[bot]
b61a6f8021 fix: setRepresentedFilename with non-default titlebarStyle (#34847)
fix: setRepresentedFilename with non-default titlebarStyle

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-08 10:50:54 +02:00
Sudowoodo Release Bot
b390336a5c Revert "Bump v18.3.6"
This reverts commit 7a9747021d.
2022-07-06 13:00:39 -07:00
Sudowoodo Release Bot
7a9747021d Bump v18.3.6 2022-07-06 08:32:51 -07:00
Jeremy Rose
18fd51af5f chore: cherry-pick f427936d32db from chromium (#34685)
* chore: [18-x-y] cherry-pick f427936d32db from chromium

* fix patch.

* chore: update patches

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Pedro Pontes <pepontes@microsoft.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-07-05 13:51:45 -04:00
Jeremy Rose
9e51cf4a65 chore: cherry-pick d0882b3dff76 from v8 (#34687)
* chore: [18-x-y] cherry-pick d0882b3dff76 from v8

* fix patch.

* fix patch pt. 2

Co-authored-by: Electron Bot <electron@github.com>
Co-authored-by: Pedro Pontes <pepontes@microsoft.com>
2022-07-05 11:37:11 -04:00
Sudowoodo Release Bot
76a07c227d Revert "Bump v18.3.6"
This reverts commit 9308ac6e67.
2022-06-30 22:39:32 -07:00
Sudowoodo Release Bot
9308ac6e67 Bump v18.3.6 2022-06-30 15:06:31 -07:00
trop[bot]
3823245a46 fix: BrowserView background color in webContents (#33478)
* chore: fix BrowserView background color in webContents

* disable screen capture test on linux

* spec: fix platform failure condition

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-30 12:35:07 -07:00
Keeley Hammond
f49f74831b docs: expand tutorial (#34604) (#34799)
* docs: base tutorial update

* more docs

* zzz

* remove unused images

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-06-30 09:23:36 -07:00
trop[bot]
0b26e76739 build: remove appveyor hook to defunct service (#34793)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-29 10:45:16 -07:00
Sudowoodo Release Bot
079010f01a Revert "Bump v18.3.6"
This reverts commit 8f673fe81d.
2022-06-29 10:44:30 -07:00
Sudowoodo Release Bot
8f673fe81d Bump v18.3.6 2022-06-29 08:32:34 -07:00
trop[bot]
1012fd687a fix: resolve symlinks when computing relative asar paths for integrity (#34780)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-06-29 10:12:55 +02:00
trop[bot]
871be236f8 docs: replace broken Windows taskbar images (#34752)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-06-28 10:08:13 +02:00
trop[bot]
cee4a64493 fix: make navigator.userAgentData non-empty (#34758)
fix: make navigator.userAgentData non-empty (#34481)

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-06-28 10:07:42 +02:00
trop[bot]
d71c08a404 refactor: load webFrame via process._linkedBinding in security-warnings.ts (#34746)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-06-27 14:12:41 +02:00
trop[bot]
5a0f75f42c fix: WCO respects maximizable/closable/minimizable (#34720)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-23 21:07:28 +02:00
Pedro Pontes
f5e26258da chore: cherry-pick 22c61cfae5d1 from chromium (#34714)
* chore: cherry-pick 22c61cfae5d1 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-23 14:24:29 -04:00
Sudowoodo Release Bot
6165f6afc9 Bump v18.3.5 2022-06-22 08:31:20 -07:00
Jeremy Rose
35f871c702 chore: cherry-pick 44c4e56fea2c from v8 (#34692) 2022-06-22 12:26:57 +02:00
trop[bot]
8c3c382673 fix: window button visibility fullscreen interaction (#34673)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-22 10:49:09 +02:00
Shelley Vohr
16ae9e16cf refactor: remove deprecated drag-and-drop code (#34653) 2022-06-20 15:57:04 -04:00
trop[bot]
1d14d15d8c fix: performance problem in crashReporter.start() on macOS (#34640)
* 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>

* Update .patches

* chore: update patches

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-20 16:43:17 +09:00
trop[bot]
32df7f58bb chore: fix BrowserView painting when origin updated (#34641)
chore: fix View painting when origin updated

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-20 09:19:36 +02:00
Raymond Zhao
66c3319458 refactor: use stubs for gdk-pixbuf dependency (#34601) 2022-06-20 13:30:47 +09:00
Milan Burda
49955512a8 fix: crash when setWindowOpenHandler callback throws (#34627)
fix: crash when `setWindowOpenHandler` callback throws (#34523)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-20 09:34:59 +09:00
Pedro Pontes
977dc2527e chore: cherry-pick b03797bdb1df from chromium (#34631)
* chore: cherry-pick b03797bdb1df from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-20 09:33:19 +09:00
trop[bot]
4f70332460 fix: draggable regions updating on bounds change (#34610)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-17 15:36:29 +02:00
Jeremy Rose
d8e1f4f73b chore: add ffmpeg patch dir to config.json (#34597)
* chore: add ffmpeg patch dir to config.json

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-16 17:14:27 -07:00
Jeremy Rose
ec40581e83 chore: cherry-pick e481fc655a62 from ffmpeg (#34560) 2022-06-16 18:31:13 +02:00
Jeremy Rose
22cdcf400c chore: cherry-pick 2782c7bc5bbe from chromium (#34569)
* chore: cherry-pick 2782c7bc5bbe from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-06-16 16:43:45 +09:00
Jeremy Rose
1b36d1d175 chore: cherry-pick 801b904aea7d from angle (#34566)
* chore: cherry-pick 801b904aea7d from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-06-15 15:47:53 -04:00
Jeremy Rose
4578597dea chore: cherry-pick f3d01ff794dc from chromium (#34556)
* chore: cherry-pick f3d01ff794dc from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-06-15 15:46:01 -04:00
Jeremy Rose
20deb65058 chore: cherry-pick 03aa5ae75c29 from angle (#34568)
* chore: cherry-pick 03aa5ae75c29 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-06-15 12:53:44 -04:00
Jeremy Rose
7b7d22fa7c chore: cherry-pick 919b1ffe1fe7 from chromium (#34558)
* chore: cherry-pick 919b1ffe1fe7 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-06-15 12:51:11 -04:00
Pedro Pontes
851350b9f3 chore: cherry-pick f1504440487f from chromium (#34540)
* chore: cherry-pick f1504440487f from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-06-15 11:33:37 -04:00
Sudowoodo Release Bot
7162f641b5 Bump v18.3.4 2022-06-15 08:31:31 -07:00
Jeremy Rose
88e3f4a1e6 chore: cherry-pick 6661eb4900da from angle (#34554)
* chore: cherry-pick 6661eb4900da from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-15 14:25:57 +09:00
trop[bot]
0d1900048d test: add missing page-title-updated event spec for webview (#34545)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-06-15 14:25:44 +09:00
Jeremy Rose
af65324717 chore: cherry-pick f1dd785e021e from chromium (#34562)
* chore: cherry-pick f1dd785e021e from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-15 11:29:54 +09:00
Jeremy Rose
6d1cc18322 chore: cherry-pick 21139756239b from chromium (#34534)
* chore: cherry-pick 21139756239b from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-14 15:26:47 -04:00
Pedro Pontes
4d73469ed5 chore: cherry-pick 9768648fffc9 from angle (#34537)
* chore: cherry-pick 9768648fffc9 from angle

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-06-14 15:22:19 -04:00
trop[bot]
ca17f574de fix: all files selection logic on linux (#34518)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-13 16:22:06 +02:00
trop[bot]
a5fdd272b1 fix: update normal bounds prior to minimizing (#34485)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-09 15:39:37 -04:00
Sudowoodo Release Bot
15f3c45fe9 Bump v18.3.3 2022-06-08 08:31:14 -07:00
trop[bot]
3f01fb3110 test: fix for flaky renderer crash test (#34453)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-06-08 11:33:01 +02:00
trop[bot]
96789ee78b chore: fix nan spec runner on macOS (#34461)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-06-08 16:10:16 +09:00
trop[bot]
4b8885ffc8 docs: fix did-frame-navigate example in webFrameMain docs (#34445)
docs: fix did-frame-navigate example in webFrameMain docs

Co-authored-by: Will Anderson <will@itsananderson.com>
2022-06-06 11:20:05 -04:00
trop[bot]
c47b196d02 fix: render process crash handling (#34430)
* 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

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-06-02 20:12:50 -07:00
trop[bot]
d67c319642 fix: crash in WebFrameMain mojo connection when RenderFrameHost is nullptr (#34415)
* fix: crash when RenderFrameHost is nullptr

* chore: lint fix

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-06-02 15:16:43 +09:00
Sudowoodo Release Bot
6839dd92b8 Bump v18.3.2 2022-06-01 08:32:20 -07:00
trop[bot]
d468a73edb fix: zombie windows when fullscreening and closing (#34392)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-31 15:36:47 +02:00
Robo
e4dbd1407e chore: backport a704c3a from chromium (#34385)
* chore: backport a704c3a from chromium

Refs https://chromium-review.googlesource.com/c/chromium/src/+/3545665
Fixes https://github.com/electron/electron/issues/25387

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-31 10:43:38 +02:00
Shelley Vohr
37a422d05b fix: esc not working on Windows during fullscreen (#34361)
* fix: esc not working on Windows during fullscreen

* chore: fix lint
2022-05-31 14:08:45 +09:00
Sudowoodo Release Bot
26e7f27110 Bump v18.3.1 2022-05-25 08:32:14 -07:00
John Kleinschmidt
707e8d5b7b fix: crash on navigator.serial.getPorts() (#34327)
(cherry picked from commit 7f9431764f)
2022-05-24 16:55:20 +02:00
trop[bot]
6fda94858d chore: add a TRACE call for crash_reporter::Start() (#34325)
chore: add a TRACE call for crash_reporter::Start()

Initializing the crashReporter takes around 620 milliseconds on Intel
macOS. I have sent a CL to crashpad to partially fix the performance
issue in
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386.
It would be beneficial to log the performance impact of this function in
the traces in case this slows down in the future.

Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-24 10:21:42 +02:00
trop[bot]
1eece7ada0 docs: remove X-Content-Security-Policy header in quick-start.md (#34318)
reference: Note: It is known that having both Content-Security-Policy
 and X-Content-Security-Policy or X-Webkit-CSP causes unexpected
 behaviours on certain versions of browsers. Please avoid using deprecated
 X-* headers. https://content-security-policy.com/
also:
1ad18486ed

Co-authored-by: Letu Ren <fantasquex@gmail.com>
2022-05-23 13:45:06 -04:00
Sudowoodo Release Bot
c33bfffeec Bump v18.3.0 2022-05-23 08:54:56 -07:00
Shelley Vohr
02bf71fb43 fix: crash when loading extension with missing manifest (#34304) 2022-05-23 10:43:53 -04:00
Robo
74b85afca4 fix: service worker registration with custom protocols (#34291)
Refs https://github.com/electron/electron/issues/32664
2022-05-23 21:20:03 +09:00
Keeley Hammond
fbc398f9bc fix: revert "feat: add first-instance-ack event to the app.requestSingleInstanceLock() flow (#34295)
* Revert "fix: requestSingleInstanceLock API ConnectNamedPipe sometimes hangs program (#33778)"

This reverts commit ffb8749243.

* fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow"

* chore: update patch
2022-05-22 22:22:01 -07:00
trop[bot]
4c32d141d8 fix: delayed bounds when moving/resizing and preventing default (#34284)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-20 10:32:44 +02:00
trop[bot]
88bedfcf25 fix: crash when creating interface for speculative frame (#34293)
* fix: crash when creating interface for speculative frame

* fix: (attempt 2) always try to connect when using renderer api

* fix: potential crash when rfh is disposed

* refactor: always teardown mojo connection

This should eliminate an entire class of potential errors from appearing in the future.

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-05-19 16:37:22 -04:00
Sudowoodo Release Bot
f4ba63536a Bump v18.2.4 2022-05-18 08:31:32 -07:00
trop[bot]
f024af603c docs: add missing explanation for [angle|dawn]_enable_vulkan_validation_layers = false (#34257)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-17 11:21:26 -04:00
trop[bot]
9c669210c4 fix: fetching PDF element from WebLocalFrame (#34214)
fix: fetching PDF element from WebLocalFrame

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-16 18:13:28 -04:00
Pedro Pontes
1bd99405ad chore: cherry-pick 723ed8a9cfff from v8 (#34202)
* chore: cherry-pick 723ed8a9cfff from v8

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-12 20:18:35 -04:00
trop[bot]
ef939db944 fix: tray icon not highlighting on empty menu (#34207)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-12 16:19:48 -07:00
trop[bot]
e7e8b324ff test: fixup done being called multiple times (#34186)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-11 13:09:48 -07:00
Samuel Attard
b4533d19e6 fix: disable SIGUSR1 when --inspect is disabled (#34180)
fix: disable SIGUSR1 when --inspect is disabled (#33188)
2022-05-11 12:38:31 -07:00
Cheng Zhao
2ecc68621f fix: remove use of xkb_keymap_key_get_mods_for_level (#34155) 2022-05-11 11:48:29 -07:00
electron-roller[bot]
0971add78a chore: bump chromium to 100.0.4896.160 (18-x-y) (#34171)
* chore: bump chromium in DEPS to 100.0.4896.160

* chore: update patch indexes

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-11 10:23:59 -07:00
Sudowoodo Release Bot
ebd134881b Bump v18.2.3 2022-05-11 08:31:15 -07:00
trop[bot]
448069cd04 build: change upload-to-s3 vars to upload-to-storage (#34146)
* build: change upload-to-s3 vars to upload-to-az

* build: change upload-to-az to upload-to-storage

* build: change linux-ia32-publish var

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-05-11 09:59:39 -04:00
trop[bot]
7afc5ab88e fix: fix a crash in safeStorage on Linux (#34148)
On Linux, `isEncryptionAvailable()` was crashing instead of returning a
boolean before the 'ready' event was emitted by the app. The reason of
the crash is that [`CreateKeyStorage()`](https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=74;drc=35be6215ec8f09e50176f36753c68f26c63d1885;bpv=1;bpt=0)
expects the config to be set but the function responsible for setting the
config, [`SetConfig()`](https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=237;drc=35be6215ec8f09e50176f36753c68f26c63d1885;bpv=1;bpt=0),
is called only after the app is ready inside [`PostCreateMainMessageLoop()`](https://github.com/electron/electron/blob/main/shell/browser/electron_browser_main_parts.cc#L499).
So this changes `IsEncryptionAvailable()` to return `false` when the app
is not ready on Linux and uses that instead of the raw API in other
places like `EncryptString()` and `DecryptString()`.

Fixes: https://github.com/electron/electron/issues/32206
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-11 10:55:58 +02:00
Milan Burda
601ca745c1 fix: building node modules with Visual Studio 2017 (#34110) 2022-05-11 01:02:48 -07:00
Sudowoodo Release Bot
ba3a6c1193 Bump v18.2.2 2022-05-10 18:35:55 -07:00
Keeley Hammond
af3e3ff0cb fix: create singleton pipename from user & executable (#34161) 2022-05-10 16:28:06 -07:00
trop[bot]
85e19bd0ad chore: stub gtk_native_dialog_get_type (#34150)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-05-10 10:33:55 +09:00
trop[bot]
cc428fdea2 refactor: prevent RemoveFromLoginItems() from mounting volumes from login items (#34106)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-09 13:11:29 +02:00
trop[bot]
553573e6ff docs: add missing ackCallback parameter (#34127)
Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
2022-05-06 23:33:41 -07:00
trop[bot]
f057e0669d build: use azure function to hash assets instead of lambda (#34122)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-06 23:27:26 -07:00
trop[bot]
4ae399e4eb build: stop uploading assets to S3 (#34114)
* build: remove S3 uploads

* build: remove ending slash upload-index-json (#34125)

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-05-06 23:26:39 -07:00
trop[bot]
418c957e13 test: unflake some more tests (#34100)
* test: unflake webview fullscreen test

* test: unflake net throttle test

* Update spec-main/api-net-spec.ts

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

Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-05-05 22:07:13 -04:00
trop[bot]
fe96879a9d fix: offscreen rendering crash on input select (#34092)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-05 11:49:49 -07:00
Pedro Pontes
8acf68c980 chore: cherry-pick 6b66a45021a0 from chromium (#34072)
* chore: cherry-pick 6b66a45021a0 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-05 09:42:33 -04:00
trop[bot]
11a0e2a402 test: unflake some focus tests (#34080)
* spec: unflake some focus tests

* test: disable flaky webFrame visibiilty spec

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-05 10:17:36 +02:00
Pedro Pontes
fabdfb2c18 chore: cherry-pick cf64617c1cc5 from chromium (#34052)
* chore: cherry-pick cf64617c1cc5 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
2022-05-05 09:32:59 +09:00
trop[bot]
eca4b1325f test: fix nativeModulesEnabled in spec/webview-spec.js (#34067)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-04 11:57:01 -04:00
Sudowoodo Release Bot
3bc25c997d Bump v18.2.1 2022-05-04 08:33:09 -07:00
trop[bot]
b715e8714a fix: make BrowserWindow#isFocused() return false when blur() is called on macOS (#34030)
The isFocused() method on macOS works by checking if the selected
BrowserWindow is a key window. Unfortunately, this didn't work well
with blur() because it wasn't calling any macOS APIs that would change
the key status of the window. Hence, this changes the implementation of
blur() to call orderOut first, which removes the key
status of the window. Then when the orderBack function is called, it
moves the window to the back of its level in the screen list, without
changing the key window.

Fixes: https://github.com/electron/electron/issues/33732
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-04 00:05:23 -07:00
trop[bot]
2a0828e69a test: scope internal test fixtures under @electron-ci (#34025)
* test: scope internal test fixtures under `@electron`

* Missed references

* Move packages from @electron to @electron-ci scope

* Fix tests

* fix require

Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-03 23:56:55 -07:00
Samuel Attard
5d46db1839 refactor: use posix_spawn instead of NSTask so we can disclaim the spawned ShipIt executable (#34059)
* refactor: use posix_spawn instead of NSTask so we can disclaim the spawned ShipIt executable (#33468)

* Update .patches
2022-05-03 16:21:10 -07:00
Pedro Pontes
9d482f438a chore: cherry-pick e2b8856012e0 from chromium (#34048)
* chore: cherry-pick e2b8856012e0 from chromium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-03 16:17:24 -07:00
Samuel Attard
7630fc801e build: use smaller resource_class because goma (#33905) (#34033) 2022-05-03 12:06:50 -07:00
trop[bot]
6b2375cba0 fix: support mixed-case extensions in Linux file dialogs (#34016)
Co-authored-by: Kevin Ushey <kevinushey@gmail.com>
2022-05-02 11:03:03 -07:00
Keeley Hammond
c017200e85 build: improve CI speeds and reduce CI costs (#33904) (#33952)
* build: improve CI speeds and reduce CI costs (#33904)

* remove third_party/electron_node:overlapped-checker

target isn't present in older versions

* build: use original arch logic

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-02 12:50:42 -04:00
trop[bot]
daf55a81b1 build: allow script/spec-runner.js with empty list of runners (#34003)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 09:45:11 -04:00
trop[bot]
067314ec32 docs: fix return type of setJumpList() in electron.d.ts (#33964)
Before:
```ts
setJumpList(categories: (JumpListCategory[]) | (null)): void;
```

After:
```ts
setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
```

Fixes: https://github.com/electron/electron/issues/33909
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-02 17:40:42 +09:00
trop[bot]
a128449e3d refactor: better solution for resizable frameless DCHECK (#33973)
* refactor: better solution for resizable frameless DCHECK

* fix: also implement TargetForRectin WinFrameView

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-02 15:24:37 +09:00
Samuel Attard
de74dce663 build: use dev-cdn instead of sysroots s3 bucket (#33984)
* build: use dev-cdn instead of sysroots s3 bucket (#33922)

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-02 10:30:50 +09:00
trop[bot]
0e3a558913 spec: allow connections to port 2049 (#33992)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 10:28:04 +09:00
trop[bot]
e2d4a98c76 fix: disable MallocNanoZone on mac (#33965)
Co-authored-by: Jacek Oleksy <jacek.oleksy@gmail.com>
2022-04-28 20:19:03 -04:00
Sudowoodo Release Bot
015e9a8843 Bump v18.2.0 2022-04-28 17:04:33 -07:00
Sudowoodo Release Bot
1fc8f72126 Revert "Bump v18.1.1"
This reverts commit 6a91276172.
2022-04-28 16:58:15 -07:00
Sudowoodo Release Bot
6a91276172 Bump v18.1.1 2022-04-28 13:32:04 -07:00
Keeley Hammond
32ab3297fa Revert "Bump v18.2.0" (#33968)
This reverts commit 3b4e17e7e2.
2022-04-28 12:50:45 -07:00
Sudowoodo Release Bot
3b4e17e7e2 Bump v18.2.0 2022-04-28 11:04:44 -07:00
trop[bot]
6c314dc08b build: ensure sync-done file exists during git cache save (#33958)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-27 17:21:46 -07:00
electron-roller[bot]
cd6a17db08 chore: bump chromium in DEPS to 100.0.4896.143 (#33948)
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2022-04-27 15:56:28 -04:00
trop[bot]
b6d6f86ee8 feat: implement chrome.tabs.reload to fix PDF Viewer (#33711)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-27 12:18:23 -07:00
Samuel Attard
178688fe61 build: upload to AZ as well as S3 (#33924)
* build: upload to AZ as well as S3

* build: actually verify az urls too
2022-04-27 10:43:11 -07:00
Samuel Attard
40f6e2ee7e build: improve circleci config (#33941)
* build: improve circleci config (#33881)

* build: fix conditional restore of git cache

* build: split lint out of setup.yml

* ci: update release script to handle new CircleCI configs (#33914)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-27 10:13:11 -07:00
Sudowoodo Release Bot
f747f071fb Revert "Bump v18.1.1"
This reverts commit 8476bfbcaa.
2022-04-27 09:34:03 -07:00
Sudowoodo Release Bot
8476bfbcaa Bump v18.1.1 2022-04-27 08:32:00 -07:00
trop[bot]
d1abb62943 build: fix intermittent compilation failures on macOS (#33878)
* build: fix intermittent compilation failures on macOS

* chore: remove //base dependency from main executable

* chore: fix lint

Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-21 06:37:56 -07:00
trop[bot]
86bf9ea252 chore: backport 7c9b3938d from libuv (#33871)
* chore: backport 7c9b3938d from libuv

Backports https://github.com/libuv/libuv/pull/3597

* Update .patches

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-21 03:13:19 -07:00
Raymond Zhao
ffb8749243 fix: requestSingleInstanceLock API ConnectNamedPipe sometimes hangs program (#33778) 2022-04-21 17:25:07 +09:00
Sudowoodo Release Bot
feea88600a Bump v18.1.0 2022-04-20 15:30:29 -07:00
Sudowoodo Release Bot
89188cd4e9 Revert "Bump v18.1.0"
This reverts commit 45c1d22489.
2022-04-20 15:24:23 -07:00
Sudowoodo Release Bot
45c1d22489 Bump v18.1.0 2022-04-20 14:29:03 -07:00
trop[bot]
3f39d85501 fix: include accessibility blink strings (#33843)
* fix: include accessibility blink strings

* chore: empty commit to trigger semantic check

Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-04-20 14:26:22 -07:00
Sudowoodo Release Bot
2dd7749181 Revert "Bump v18.1.0"
This reverts commit 6de6d3966a.
2022-04-20 14:25:48 -07:00
trop[bot]
5634ddc665 chore: use semantic-commit-action (#33866)
* chore: use semantic-commit-action

* Update semantic.yml

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-04-20 14:15:06 -07:00
Sudowoodo Release Bot
6de6d3966a Bump v18.1.0 2022-04-20 08:31:28 -07:00
trop[bot]
02562e903b feat: allow null when subscribing notification (#33771)
* feat: allow null when subscribing notification

* docs: document null event

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-18 10:10:58 -04:00
trop[bot]
718ef5269f fix: potential crash caused by dlopen different gtk libraries (#33812)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-18 09:44:27 -04:00
electron-roller[bot]
ddaa4a9686 chore: bump chromium to 100.0.4896.127 (18-x-y) (#33730)
* chore: bump chromium in DEPS to 100.0.4896.88

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4896.127

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-04-18 09:38:43 -04:00
trop[bot]
f646744d32 test: re-enable desktop specs (#33542)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-18 13:27:57 +09:00
trop[bot]
75ccd1fb65 docs: recommend setting e.returnValue (#33645)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-04-18 13:24:04 +09:00
Sudowoodo Release Bot
f30034d1a9 Bump v18.0.4 2022-04-14 06:58:03 -07:00
trop[bot]
00b6524793 fix: event propagation after exiting fullscreen on Windows (#33787)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-14 06:54:19 -07:00
trop[bot]
f8f08814a2 fix: apply senderFrame details to ipcMain port event (#33782)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-14 19:17:30 +09:00
trop[bot]
0a758c418c chore: interpret bytes to string (#33773)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-14 16:26:23 +09:00
trop[bot]
daff2057a4 docs: note safeStorage.isEncryptionAvailable() needs ready event (#33738)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-13 10:45:49 +02:00
trop[bot]
67f2f9e024 build: migrate urllib to python3 (#33745)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-12 21:59:43 -07:00
Erick Zhao
3ee1a45d76 docs: add ipc fiddle samples (#33748) 2022-04-12 16:29:58 -07:00
Erick Zhao
652d87282a docs: manually backport ipc doc (#33746) 2022-04-12 16:02:10 -07:00
trop[bot]
923788b4e4 build: explicitly run scripts with python3 (#33729)
* build: explicitly run scripts with python3

* chore: update patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 13:32:56 -07:00
Jeremy Rose
541504c8a4 fix: backport unseasoned pdf support to 18.x (#33664) 2022-04-12 11:09:30 +02:00
Jeremy Rose
490584834e chore: cherry-pick a18fddcb53e6 from webrtc (#33708)
* chore: cherry-pick a18fddcb53e6 from webrtc

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 11:04:12 +02:00
trop[bot]
a269ebd1d8 build: use python3 to lint (#33719) 2022-04-12 11:02:32 +02:00
trop[bot]
0f073186ff fix: report more detailed errors in shell.openExternal() on Windows (#33705)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-04-11 22:18:56 -07:00
trop[bot]
73e216f182 fix: report more detailed errors in shell.openExternal() on Windows (#33659)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-04-11 16:36:04 -07:00
Sudowoodo Release Bot
0a80eb4a9c Bump v18.0.3 2022-04-06 08:31:11 -07:00
trop[bot]
50e386ead4 fix: remove usage of private pid API on MAS (#33622)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-06 13:40:27 +02:00
electron-roller[bot]
5f0810a177 chore: bump chromium to 100.0.4896.75 (18-x-y) (#33619)
* chore: bump chromium in DEPS to 100.0.4896.75

* 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-04-05 21:21:00 -04:00
Sudowoodo Release Bot
65f3729bfb Bump v18.0.2 2022-04-05 09:44:17 -07:00
trop[bot]
b5bdd26a45 Revert "fix: some frameless windows showing a frame on Windows (#32692)" (#33610)
This reverts commit 7c701367c0.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-04-05 09:42:45 -07:00
trop[bot]
9ac2ee317d chore: set v8_typed_array_max_size_in_heap to default (#33541)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-05 11:25:31 -05:00
trop[bot]
a600027384 fix: add missing translation string for ax tree (#33616)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-04-05 09:20:40 -07:00
trop[bot]
7f82836d67 test: BrowserWindow backgroundColor and transparency (#33561)
* test: BrowserWindow backgroundColor

* test: allow similar colors

* test: disable linux capturing

* refactor: split screen capture from reading pixel color

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-04-04 09:54:21 -04:00
trop[bot]
769088f8dc fix: create userData on requestSingleInstanceLock() if needed (#33559) (#33592)
* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-04-04 10:48:04 +02:00
trop[bot]
c85bc3c932 fix: getting focused window with destroyed webContents (#33538)
* fix: getting focused window with destroyed webContents

* fix: add extra safeguards

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-31 13:01:44 -05:00
trop[bot]
3cd795a927 fix: don't unmaximize on macOS if user set max bounds (#33550)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-31 10:07:56 -04:00
David Sanders
6179b03fa1 fix: on macOS show BrowserWindow on maximize if not currently shown (#33537) 2022-03-31 10:36:39 +02:00
Sudowoodo Release Bot
72c48aa400 Bump v18.0.1 2022-03-30 08:32:15 -07:00
trop[bot]
befe53e5ad fix: pointer lock escape handling (#32828) 2022-03-30 09:41:48 +02:00
trop[bot]
41aaed307d fix: crash when WindowButtonsProxy references cleared NSWindow (#33490)
* resets WindowButtonsProxy on window delete on macOS

* fixes reset

Co-authored-by: Gellert Hegyi <gellert.hegyi@around.co>
2022-03-29 12:25:01 -04:00
electron-roller[bot]
0d17fac455 chore: bump chromium to 100.0.4896.60 (18-x-y) (#33501)
* chore: bump chromium in DEPS to 100.0.4896.60

* 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-03-29 11:39:34 -04:00
Robo
5c3d6aaa81 fix: calling of X11 functions when running under Wayland (#33355) (#33498)
Backports https://github.com/electron/electron/pull/33355

Co-authored-by: Marek Rusinowski <marekrusinowski@gmail.com>
2022-03-29 15:09:18 +02:00
Sudowoodo Release Bot
da6996dc63 Bump v18.0.0 2022-03-28 21:35:58 -07:00
Keeley Hammond
4cfa648a2e Revert "Bump v18.0.0" (#33493)
This reverts commit 8680415128.
2022-03-28 21:34:36 -07:00
Sudowoodo Release Bot
86294aa1d0 Revert "Bump v18.0.1"
This reverts commit 50d9fd215e.
2022-03-28 21:20:30 -07:00
Sudowoodo Release Bot
50d9fd215e Bump v18.0.1 2022-03-28 21:18:45 -07:00
trop[bot]
06b3615e30 ci: fixup esbuild on macos (#33492)
* ci: fixup esbuild on macos

* ci: call update_depot_tools right after clone

* when all else fails, use sed

* chore: empty commit to trigger ci

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-03-28 21:17:13 -07:00
Sudowoodo Release Bot
8680415128 Bump v18.0.0 2022-03-28 17:11:02 -07:00
Calvin
35bf159cd3 chore: update node types version (#33477)
* chore: update node types version

* update another types package to fix incompatible global declarations

* remove incompatible type magicks

* update our ambient types to match the node types

* fix test type
2022-03-28 19:07:29 -04:00
electron-roller[bot]
f8c7408279 chore: bump chromium to 100.0.4896.56 (18-x-y) (#33475)
* chore: bump chromium in DEPS to 100.0.4896.56

* chore: update patches

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-28 17:09:35 -05:00
Charles Kerr
9b1e7a8963 docs: simplify skipTaskbar breaking changes text (#33479) (#33482) 2022-03-28 16:49:30 -05:00
trop[bot]
765e1025f4 feat: add WCO title bar style setters (#33440)
* feat: add wco title bar style setters

* return after throwing

Co-authored-by: clavin <clavin@electronjs.org>
2022-03-28 12:51:50 -05:00
Sudowoodo Release Bot
a5d2a56105 Revert "Bump v18.0.0-beta.7"
This reverts commit d8f43ed7bd.
2022-03-28 09:28:37 -07:00
Sudowoodo Release Bot
d8f43ed7bd Bump v18.0.0-beta.7 2022-03-28 06:30:58 -07:00
trop[bot]
f1b30c26f9 fix: non-client windows messages on legacy widget host (again) (#33446)
Co-authored-by: clavin <clavin@electronjs.org>
2022-03-28 16:34:25 +09:00
trop[bot]
c80f701085 fix: gn check when //printing component is disabled (#33442)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-25 00:51:25 -07:00
Sudowoodo Release Bot
fa6dde3e1c Bump v18.0.0-beta.6 2022-03-24 06:30:31 -07:00
trop[bot]
bb6a072380 fix: initialize asar support in worker threads (#33396)
* fix: initialize asar support in worker threads (#33216)

* fix: initialize asar support in worker threads

Use `ObjectWrap` instead of gin's Wrap in `electron_api_asar.cc` because
gin isn't fully initialized (and apparently not possible to initialize
without ruining the isolate configuration and array buffer allocator) in
worker threads. In the worker thread call `setupAsarSupport` just as we
do for the main process.

* Update lib/asar/fs-wrapper.ts

Co-authored-by: Darshan Sen <raisinten@gmail.com>

* Update patches/node/worker_thread_add_asar_support.patch

Co-authored-by: Darshan Sen <raisinten@gmail.com>

* Add a test

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* chore: update .patches after merge

Co-authored-by: Fedor Indutny <fedor@indutny.com>
Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-24 16:24:34 +09:00
trop[bot]
743e442796 ci: abort CI if goma authentication is invalid (#33420)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-23 21:17:13 -04:00
trop[bot]
4abb7e9709 feat: add nativeTheme.inForcedColorsMode (#33357)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-03-23 16:54:11 -07:00
trop[bot]
8b996a478a fix: libuv patches to address child_process.spawn slowness (#33407)
* fix: libuv patches to address child_process.spawn slowness

* chore: backport additional patches

* Update .patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-23 19:03:25 -04:00
trop[bot]
d36dc1c7de fix: persist BrowserView content bounds when calculating layout (#33399)
Reverting change introduced in PR: https://github.com/electron/electron/pull/30510

Co-authored-by: Andreas Johansson <aj3621@tobii.com>
2022-03-23 10:10:12 +01:00
trop[bot]
e5c56c08a4 ci: enable thin LTO on Mac (#33194) (#33387)
* build: remove thin lto mac patch

* build: remove step-get-more-space-on-mac

* build: remove USE_PREBUILT_V8_CONTEXT_SNAPSHOT

* ci: re-add mksnapshot logic

* ci: re-add USE_PREBUILT_V8_CONTEXT_SNAPSHOT

* ci: re-add get-more-space, delete thin LTO cache & .dSYM

* ci: don't delete v8_snapshot_generator.dSYM

* ci: add timeout to mksnapshot

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-03-22 20:11:43 -04:00
trop[bot]
1763f4cfc8 fix: use stricter options in SecStaticCodeCheckValidity (#33378)
* fix: use stricter options in SecStaticCodeCheckValidity

* Update patches/squirrel.mac/fix_use_kseccschecknestedcode_kseccsstrictvalidate_in_the_sec.patch

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-22 14:19:43 -07:00
trop[bot]
700887d623 fix: IncrementCapturerCount doesn't increase the capturer count (#33371)
This regression was introduced by commit 22a70eb8.

Co-authored-by: Zeeker <13848632+zeeker999@users.noreply.github.com>
2022-03-22 11:25:27 -04:00
trop[bot]
f893707c5d fix: pend bounds change when moving BrowserWindows (#33375)
* fix: ensure bounds changes apply when moving windows

* chore: remove unused queue include

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-22 08:57:18 +01:00
trop[bot]
dcf825bed6 fix: fire show event when BrowserWindow shown via maximize() (#33214)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-21 20:33:20 -04:00
trop[bot]
cee4e3707f feat: support more color formats for backgroundColor (#33364)
* feat: support more color formats for backgroundColor

* feat: support more formats in getBackgroundColor

* chore: remove redundant includes

* refactor: differentiate rgb/rgba/hsl/hsla + docs

* chore: address review cleanup comments

* refactor: simple getBackgroundColor

* chore: fix iwyu

* fix: typescript arg

* Update docs/api/browser-view.md

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

* chore: address comments

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-03-21 20:06:03 -04:00
trop[bot]
e9fa834757 fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames

Notes: no-notes

* refactor: extract electron API IPC to its own mojo interface

* fix: just check main frame not primary main frame

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-03-21 13:41:15 -07:00
Robo
a327684118 fix: iocp integration when process is reused (#33207) (#33361) 2022-03-21 09:21:59 -07:00
Sudowoodo Release Bot
ef5424cee0 Bump v18.0.0-beta.5 2022-03-21 06:30:49 -07:00
trop[bot]
388acd7e2a fix: race condition where webContents can be nullptr during re-focus and a multi-window close sequence (#33284)
* fix: race condition where webContents can be nullptr during re-focus and a multi-window close sequence

* chore: update electron_inspectable_web_contents_view.mm

Co-authored-by: Samuel Attard <sam@electronjs.org>
2022-03-21 10:26:49 +09:00
trop[bot]
46d74390fc feat: allow setting code cache directory (#33286)
* feat: allow setting code cache directory

* chore: address review feedback

* chore: update docs

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

* chore: rewrite with base::Contains

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

Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-03-21 10:22:33 +09:00
trop[bot]
d305082ab7 build: drop pywin32 usage (#33298)
* build: drop pywin32 usage

* chore: ignore extra output on AppVeyor

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-21 10:19:45 +09:00
trop[bot]
0370583c73 fix: intialize FPS file in network service (#33345)
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-03-20 11:12:17 -07:00
trop[bot]
91274e5a7e fix: crash when destroying node env with pending promises (#33302)
* fix: crash when destroying node env with pending promises

* chore: add spec

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-03-18 04:08:45 -07:00
Sudowoodo Release Bot
fc3172dd2a Bump v18.0.0-beta.4 2022-03-17 06:30:45 -07:00
trop[bot]
7e0b787a76 docs: webFrame.insertCSS should mention options arg (#33293)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-03-17 14:08:01 +01:00
trop[bot]
4556adde82 fix: ensure external memory adjustments are balanced (#33305)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-17 14:07:16 +01:00
trop[bot]
7283c257ae fix: BrowserWindow.fromWebContents should work in browser-window-created (#33316)
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-03-17 09:45:24 +01:00
trop[bot]
bf5a0cdd6a chore: cherry-pick 2ed58f4 from chromium (#33109) (#33250)
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: https://github.com/electron/electron/issues/33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

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

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-03-16 14:38:31 -04:00
trop[bot]
1c8e9b3651 docs: remove "marked" from process.getBlinkMemoryInfo() (#33291)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-03-16 09:30:25 -04:00
trop[bot]
90726a46e1 fix: add missing [[maybe_unused]] to IsEnvSet (#33269)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-03-16 11:49:21 +01:00
trop[bot]
9cd76a8e52 fix: prevent UAF crash in setCertificateVerifyProc (#33253)
* fix: prevent UAF crash in setCertificateVerifyProc

* fix patch

* fix tests

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-03-15 10:46:57 -07:00
trop[bot]
a9b17793de fix: cppgc/node collisions in renderer process (#33260) 2022-03-15 10:04:58 -07:00
Sudowoodo Release Bot
134042cc43 Bump v18.0.0-beta.3 2022-03-14 06:30:53 -07:00
trop[bot]
26d729a4a3 fix: settings not persisting across devtools loads (#33206)
* fix: settings not persisting across devtools loads

* chore: remove redundant RegisterPreference impl

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-11 11:18:50 -06:00
Sudowoodo Release Bot
68c3c3f7ad Bump v18.0.0-beta.2 2022-03-10 05:30:48 -08:00
trop[bot]
92cd3d1fa5 fix: crash when showin item in folder on DevTools (#33197)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-09 17:32:52 -05:00
trop[bot]
47f8a13384 fix: non-client mouse events on WCO-enabled windows (#33202)
Co-authored-by: clavin <clavin@electronjs.org>
2022-03-09 16:54:54 -05:00
trop[bot]
19c3e1c8b7 fix: patches to use BUILDFLAG(IS_WIN) / BUILDFLAG(IS_MAC) checks (#33195)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-03-09 16:54:28 -05:00
trop[bot]
7e771a3db5 feat: warn that preloads will be sandboxed by default in v20 (#33203)
* feat: warn that preloads will be sandboxed by default in v20

* add a note to breaking changes

* fix type error

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-03-09 12:04:48 -05:00
trop[bot]
c5ec2099bb docs: remove platform notices from tutorial titles (#33136)
* docs: remove platform notices from tutorial titles

* Update docs/tutorial/launch-app-from-url-in-another-app.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2022-03-08 14:37:52 -05:00
trop[bot]
262cc48ad0 fix: max window size defaults to 0 (#33119)
* fix: max window size defaults to 0

* fix: also check max_size empty

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-08 14:20:39 -05:00
trop[bot]
fb5741efd6 fix: really strip crashpad handler binary (#33175)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-03-08 13:56:04 -05:00
Sudowoodo Release Bot
47669c55fd Bump v18.0.0-beta.1 2022-03-08 10:16:46 -08:00
trop[bot]
7b76a70e07 build: put v8_context_snapshot_generator.dSYM in its own zip file (#33187)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-03-08 12:20:00 -05:00
Sudowoodo Release Bot
b4466f8f3e Revert "Bump v18.0.0-alpha.6"
This reverts commit 1528b0d307.
2022-03-07 09:22:59 -08:00
trop[bot]
2e9ccd4372 docs: Updated list numbering (#33147)
* docs: Updated list numbering

The steps to package and distribute an application using electron had incorrect numbering

* Indented text within ordered list sections

* Removed single space

* Fixed indentation

Co-authored-by: Alvin Philips <alvinphilips257@gmail.com>
2022-03-07 09:26:36 -05:00
Sudowoodo Release Bot
1528b0d307 Bump v18.0.0-alpha.6 2022-03-07 05:31:18 -08:00
John Kleinschmidt
da86676a43 chore: fixup 18-x-y release (#33145)
* build: add stack_trace.h to main delegate (#32854)

* build: add stack_trace.h to main delegate

* build: trigger circleci

* build: free up a tiny bit more space

* build: disable use_thin_lto

* fixup build/args/all.gn

Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
(cherry picked from commit 4fa3310887)

* ci: disable use-thin-lto on Mac only (#33115)

* build: remove use_thin_lto = false

* ci: enabling if things get really bad (all darwin)

* build: lol don't enable that

* build: add patch to disable thin lto for mac

(cherry picked from commit f71a6db3ff)

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-03-03 20:50:21 -08:00
trop[bot]
0579822008 fix: macOS tray icon alternate images (#33107)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-03-03 14:52:35 -08:00
Sudowoodo Release Bot
ff64cd722f Revert "Bump v18.0.0-alpha.6"
This reverts commit fea2aabdd4.
2022-03-03 12:21:06 -08:00
Sudowoodo Release Bot
fea2aabdd4 Bump v18.0.0-alpha.6 2022-03-03 05:31:19 -08:00
trop[bot]
3bbbf4b27f fix: disable partition alloc on mac (#33117)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-03-01 16:13:33 -08:00
trop[bot]
6dc7384f3a fix: DCHECK when calling app.exit() (#33059)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-28 11:45:47 -08:00
John Kleinschmidt
68c541380e chore: bump chromium to 100.0.4894.0 (18-x-y) (#33093)
* chore: bump chromium to 100.0.4857.0 (main) (#32419)

* chore: bump chromium in DEPS to 99.0.4819.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4824.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4827.0

* chore: update patches

* 3352511: PiP: Add inkdrop and pointer cursor to PiP window buttons

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

* 3309164: webhid: Show FIDO devices in the chooser if allowed

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

* 3297868: hid: Add experimental HIDDevice.forget()

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

* 3362491: [Extensions] Move i18n API to //extensions

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

* MCC Refactor step0: Allow embedders to register associated_interface binders with RenderFrameHostImpl::associated_registry_.

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

* 3352616: [Gtk] Remove libgtk from the link-line

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

* 3249211: Clear-Site-Data support for partitioned cookies

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

* [Extensions][COIL] Use [allow|block]list in //extensions/common

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

* Begin ScopedUserPrefUpdate migration to modern base::Value

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

* [Code Health] Refactor PrefService GetDict + GetList to use base::Value

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

* 3354997: [CodeHealth] Remove deprecated SetDictionary method

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

* 3287323: Add LacrosPrefStore for lacros settings

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

* 3365916: [PA] Clean up remaining lazy commit code

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

* [MPArch] Target the external protocol error at the responsible frame.

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

* Pass origin to RegisterNonNetworkSubresourceURLLoaderFactories

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

* Linux: Send OSCrypt raw encryption key to the Network Service

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

* [PlzServiceWorker] Remove remaining references to PlzServiceWorker.

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

* chore: fixup for lint

* 3327621: Fix tablet mode detection for Win 11.

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

* 3342428: ax_mac: move AXTextMarker conversion utils under ui umbrella

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

* 3353974: Mac: Use base::Feature for overlay features

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

* chore: bump chromium in DEPS to 99.0.4828.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4837.0

* chore: update patches

* chore: update patches

* 3379142: Drop FALLTHROUGH macro
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3379142

* 3381749: C++17: Allow use of std::map::try_emplace and std::map::insert_or_assign
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3381749

* chore: bump chromium in DEPS to 99.0.4839.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4840.0

* chore: bump chromium in DEPS to 99.0.4844.0

* 3395881: [api] Deprecate Local<v8::Context> v8::Object::CreationContext()

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

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4845.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4847.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4849.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4851.0

* chore: bump chromium in DEPS to 100.0.4853.0

* update patches

* chore: update patches

* update patches

* 3383599: Fonts Access: Remove prototype that uses a font picker.

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

* 3404768: Remove ALLOW_UNUSED macros

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

* 3374762: Remove ignore_result.h

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

* 3399305: [unseasoned-pdf] Apply proper frame offsets for touch selections

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

* 3402210: [Extensions] Don't trigger unload event for already unloaded extension

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

* 3410912: Combine URLLoaderClient OnReceiveResponse and OnStartLoadingResponseBody.

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

* 3370428: Make the AuthSchemes policy support dynamic refresh

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

* 3407603: Finish ScopedUserPrefUpdate migration to modern base::Value

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

* 3378352: ozone/x11: move code from //ui/p/x11 to //ui/ozone/p/x11

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

* 3370810: Delete chrome/service, AKA the Cloud Print service process.

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

* chore: bump chromium in DEPS to 100.0.4855.0

* chore: update patches

* fixup! 3370810: Delete chrome/service, AKA the Cloud Print service process.

* revert 3348007 to fix windows build

* 3318572: [Code health] Fix gn check errors in //extensions/browser:*

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

* fix printing.patch

* fix iwyu issue

* 3408515: win: Make ShorcutOperation an enum class and modernize names

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

* 3388333: [UIA] Remove dead code accessibility_misc_utils.h/cc

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

* fix windows build? i hope

* patch gn visibility of //ui/ozone/platform/x11

* missing include base/logging.h

* use BUILDFLAG for USE_NSS_CERTS

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

* defined(OS_*) ==> BUILDFLAG(IS_*)

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

* fixup! 3404768: Remove ALLOW_UNUSED macros

* another attempt to fix windows build

* temporarily disable the custom scheme service worker test

https://github.com/electron/electron/issues/32664

* fix loading mv3 extensions

not sure what cl broke this unfort.

* fixup! 3404768: Remove ALLOW_UNUSED macros

* patch nan

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

* fix node test

* fix nullptr in FindPdfFrame

* patch perfetto to fix build issue on win-ia32

bc44c3c753

* fix build for linux-x64-testing-no-run-as-node

* fix patch

* skip <webview>.capturePage() test

https://github.com/electron/electron/issues/32705

* test: fix failing tests of focus/blur events of WebContents (#32711)

* inherit stdio from app module test child processes

this prevents them from timing out due to full stdout buffers

* test to see if we can get better logs on windows ci

* try again for appveyor log things

* skip contentTracing tests on ia32

* ci: disable gpu compositing

* drop applied patch

* fix merge fail

* Revert "ci: disable gpu compositing"

This reverts commit 0344129fcb.

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: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
(cherry picked from commit 28ada6ea8b)

* chore: bump chromium to 100.0.4894.0 (main) (#32852)

* chore: bump chromium in DEPS to 100.0.4880.0

* resolve conflicts

* chore: update patches

* fix patch

* PIP20: add a new DocumentOverlayWindowViews subtype

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

* Clean up PictureInPictureWindowManager::EnterPictureInPicture()

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

* Remove StoragePartitionId.

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

* Remove FLoC code

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

* media: Make AddSupportedKeySystems() Async

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

* [Extensions] Move some l10n file util methods to //extensions/browser

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

* chore: IWYU

* Reland "webhid: Grant permissions for policy-allowed devices"

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

* Migrate base::Value::GetList() to base::Value::GetListDeprecated(): 2/N.

https://chromium-review.googlesource.com/c/chromium/src/+/3435727
https://chromium-review.googlesource.com/c/chromium/src/+/3440910
https://chromium-review.googlesource.com/c/chromium/src/+/3440088

* [text blink period] Cache blink period instead of fetching from defaults

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

* chore: update picture-in-picture.patch

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

* ci: update to Xcode 13.2.1

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

* chore: bump chromium in DEPS to 100.0.4882.1

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4884.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4886.0

* chore: update patches

* Refactor DownloadManager to use StoragePartitionConfig

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

* Remove ToWebInputElement() in favor of new WebNode::DynamicTo<> helpers.

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

* refactor: autofill to use the color pipeline

https://bugs.chromium.org/p/chromium/issues/detail?id=1249558
https://bugs.chromium.org/p/chromium/issues/detail?id=1003612

* [ProcessSingleton] Add many more trace events to cover all scenarios

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

* fixup! PIP20: add a new DocumentOverlayWindowViews subtype

* chore: bump chromium in DEPS to 100.0.4888.0

* chore: update patches

* chore: update picture-in-picture.patch

* fixup! refactor: autofill to use the color pipeline

* ci: fixup fix sync

(cherry picked from commit c1e3e395465739bce5ca8e1c5ec1f5bd72b99ebd)

* chore: bump chromium in DEPS to 100.0.4889.0

* chore: update patches

* chore: fix feat_add_data_transfer_to_requestsingleinstancelock.patch

* fixup! PIP20: add a new DocumentOverlayWindowViews subtype

* Remove remaining NativeTheme::GetSystemColor() machinery.

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

* ci: fetch proper esbuild for macos

* ci: fixup fetch proper esbuild for macos

* fix: failing Node.js test on outdated CurrentValueSerializerFormatVersion

* chore: bump chromium in DEPS to 100.0.4892.0

* 3460365: Set V8 fatal error callbacks during Isolate initialization

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

* 3454343: PIP20: use permanent top controls

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

* 3465574: Move most of GTK color mixers to ui/color/.

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

* chore: fixup patch indices

* 3445327: [locales] Remove locales reference

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

* 3456548: [DBB][#7] Blue border falls back to all tab if cropped-to zero pixels

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

* 3441196: Convert GuestView's remaining legacy IPC messages to Mojo

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

* 3455491: Don't include run_loop.h in thread_task_runner_handle.h

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

* fixup! 3454343: PIP20: use permanent top controls

* 3442501: Add missing includes of //base/observer_list.h

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

* 3437552: mac: Deploy a new hermetic build of Xcode 13.2.1 13C100

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

* chore: bump chromium in DEPS to 100.0.4894.0

* fixup! 3460365: Set V8 fatal error callbacks during Isolate initialization

* chore: update patches

* 3425231: Use DnsOverHttpsConfig where appropriate

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

* test: disable test-heapsnapshot-near-heap-limit-worker.js

As a result of CLs linked in https://bugs.chromium.org/p/v8/issues/detail?id=12503,
heap snapshotting near the heap limit DCHECKS in Node.js specs. This will
likely require a larger refactor in Node.js so i've disabled the test for
now and opened an upstream issue on node-v8 issue
at https://github.com/nodejs/node-v8/issues/218.

* Port all usage of NativeTheme color IDs to color pipeline

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

* chore: update patches after rebase

* ci: use gen2 machine for more disk space

* ci: don't try to make root volume writeable

* ci: use older xcode/macos for tests

* fix: html fullscreen transitions stacking

(cherry picked from commit 5e10965cdd7b2a024def5fc568912cefd0f05b44)

* ci: speed up woa testing

(cherry picked from commit 75c33c48b032137794f5734348a9ee3daa60d9de)
(cherry picked from commit e819962340)

* ci: disable flaky tests on WOA

* ci: run remote tests separately to isolate issue there

* tests: disable node test parallel/test-worker-debug for now

* revert: fix: html fullscreen transitions stacking

* tests: disable flaky test on macOS arm64

* fixup circleci config so build tools can find xcode version

* make sure the workspace is clean before job runs

(cherry picked from commit 75f713c974)

* tests: disable flaky test on Linux

* ci: debug why windows i32 is crashing

* Revert "ci: debug why windows i32 is crashing"

This reverts commit 4c4bba87ea.

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
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>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit 3da598015b)

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2022-02-28 11:37:30 -08:00
Sudowoodo Release Bot
fe8c831a0c Bump v18.0.0-alpha.5 2022-02-28 05:30:50 -08:00
trop[bot]
cc9ba35c51 fix: tray garbage collection (#33074)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-25 14:17:18 +01:00
Sudowoodo Release Bot
56ccfad7a5 Bump v18.0.0-alpha.4 2022-02-24 11:06:40 -08:00
Sudowoodo Release Bot
47bda9c0e5 Revert "Bump v18.0.0-alpha.4"
This reverts commit 339ae4c014.
2022-02-24 11:04:23 -08:00
Keeley Hammond
4f27c367b1 build: debug getDraftRelease call (#33073) 2022-02-24 14:03:56 -05:00
Sudowoodo Release Bot
339ae4c014 Bump v18.0.0-alpha.4 2022-02-24 05:31:27 -08:00
trop[bot]
c1f4b6a4cb fix: broken OSR transparent option (#33053)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-24 12:09:46 +01:00
trop[bot]
0a908224c2 fix: savePage throw on relative paths (#33019)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-22 16:29:32 +09:00
trop[bot]
34c4889bbb fix: command string for windows protocol handler (#33013)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-02-22 16:26:39 +09:00
trop[bot]
8c066c2a35 fix: don't restore maximized BrowserWindow when calling showInactive (#33022)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-02-22 16:25:09 +09:00
trop[bot]
7c9b609389 chore: backport EPROTOTYPE fixes from libuv (#32944)
* chore: backport EPROTOTYPE fixes from libuv

This commit backports three commits from libuv's 1.x branch to fix
issues with CPU going to 100% on macOS when EPROTOTYPE is returned.

See: abb109f30f
See: 3a7b95593a
See: de24da8c11

* Update .patches

Co-authored-by: Fedor Indutny <fedor@indutny.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-22 16:18:18 +09:00
trop[bot]
7ab85558f5 chore: add @electron/wg-security to patches/ CODEOWNERS (#33007)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-21 15:04:51 +01:00
trop[bot]
ca06034fdd fix: stale renderer process on quit (#32971)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-02-21 10:53:39 +01:00
trop[bot]
d07fe4480f fix: webContents.openDevTools({mode}) not working (#32946)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-21 10:25:02 +01:00
trop[bot]
c2195915d8 fix: failure to print on macOS (#32813)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-21 16:40:14 +09:00
trop[bot]
57408e4c2a Fix broken link to GNOME notifications spec (#33002)
Co-authored-by: Kev <kevslashnull@gmail.com>
2022-02-21 16:37:23 +09:00
trop[bot]
0012e01c86 docs: update checklists (#32931)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-02-21 10:21:31 +09:00
trop[bot]
2b97ff3fba docs: fix relative link in developer documentation (#32922)
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2022-02-15 14:36:39 -08:00
Sudowoodo Release Bot
87590da2fb Bump v18.0.0-alpha.3 2022-02-14 07:44:33 -08:00
trop[bot]
493751b321 Make ElectronBrowser mojo interface frame associated. (#32851)
Co-authored-by: Marek Haranczyk <marek@openfin.co>
2022-02-14 20:34:11 +09:00
trop[bot]
36008e0dea test: disable the test that makes spec runner hang on exit (#32838)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-09 12:00:38 -06:00
trop[bot]
2871698148 build: rebuild the dist_zips when the deps get modified (#32820)
* build: rebuild the dist_zips when the deps get modified

The dist.zip generated by the electron_dist_zip action was not getting
updated when changes were being made to the dependencies, like the
source files. It turns out, we were using data_deps for the dependencies
instead of deps. Here is the difference:

data_deps: things needed to ultimately run the thing built by a target
deps: things needed to build the target

So the difference in treatment of both sets of dependencies is actually
intentional.

Signed-off-by: Darshan Sen <raisinten@gmail.com>

* fixup! build: rebuild the dist_zips when the deps get modified

Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-02-09 11:12:29 -05:00
trop[bot]
9d8dde5c76 docs: clarify meaning of cssOrigin (#32810)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-02-08 12:59:17 -06:00
trop[bot]
f72efecf95 test: improve webContents.savePage() specs (#32745)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-08 12:59:45 +01:00
Sudowoodo Release Bot
5b45cb3f77 Bump v18.0.0-alpha.2 2022-02-07 06:13:30 -08:00
trop[bot]
ad2b136425 fix: WCO window hover on window controls on Windows (#32723)
* fix: WCO window hover on window controls

* Update shell/browser/ui/win/electron_desktop_window_tree_host_win.cc

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

* Trigger Build

Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Calvin <clavin@users.noreply.github.com>
Co-authored-by: Robo <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-02-03 09:46:32 -05:00
trop[bot]
94f4c18d7c fix: some frameless windows showing a frame on Windows (#32714)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-02-03 21:51:16 +09:00
trop[bot]
f7f41fee99 test: fix failing tests of focus/blur events of WebContents (#32724)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-02-02 18:32:37 -05:00
trop[bot]
907e9c8c0e docs: Update E18 release date (#32722)
Co-authored-by: Sofia Nguy <sofianguy@gmail.com>
2022-02-02 09:27:25 -08:00
Sudowoodo Release Bot
4d2968bfc1 Bump v18.0.0-alpha.1 2022-02-02 08:20:06 -08:00
425 changed files with 8600 additions and 6727 deletions

View File

@@ -24,7 +24,7 @@ parameters:
linux-publish-arch-limit:
type: enum
default: all
enum: ["all", "arm", "arm64", "x64"]
enum: ["all", "arm", "arm64", "x64", "ia32"]
run-macos-publish:
type: boolean
@@ -107,6 +107,12 @@ env-unittests: &env-unittests
BUILD_TARGET: electron/spec:chromium_unittests
TESTS_CONFIG: src/electron/spec/configs/unittests.yml
# Build targets options.
env-ia32: &env-ia32
GN_EXTRA_ARGS: 'target_cpu = "x86"'
NPM_CONFIG_ARCH: ia32
TARGET_ARCH: ia32
env-arm: &env-arm
GN_EXTRA_ARGS: 'target_cpu = "arm"'
MKSNAPSHOT_TOOLCHAIN: //build/toolchain/linux:clang_arm
@@ -235,20 +241,11 @@ step-depot-tools-get: &step-depot-tools-get
name: Get depot tools
command: |
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
if [ "`uname`" == "Darwin" ]; then
# remove ninjalog_uploader_wrapper.py from autoninja since we don't use it and it causes problems
sed -i '' '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
else
sed -i '/ninjalog_uploader_wrapper.py/d' ./depot_tools/autoninja
# Remove swift-format dep from cipd on macOS until we send a patch upstream.
cd depot_tools
patch gclient.py -R \<<'EOF'
676,677c676
< packages = dep_value.get('packages', [])
< for package in (x for x in packages if "infra/3pp/tools/swift-format" not in x.get('package')):
---
> for package in dep_value.get('packages', []):
EOF
fi
step-depot-tools-add-to-path: &step-depot-tools-add-to-path
@@ -354,14 +351,14 @@ step-restore-brew-cache: &step-restore-brew-cache
- /usr/local/Cellar/gnu-tar
- /usr/local/bin/gtar
keys:
- v5-brew-cache-{{ arch }}
- v4-brew-cache-{{ arch }}
step-save-brew-cache: &step-save-brew-cache
save_cache:
paths:
- /usr/local/Cellar/gnu-tar
- /usr/local/bin/gtar
key: v5-brew-cache-{{ arch }}
key: v4-brew-cache-{{ arch }}
name: Persisting brew cache
step-get-more-space-on-mac: &step-get-more-space-on-mac
@@ -370,7 +367,6 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
command: |
if [ "`uname`" == "Darwin" ]; then
sudo mkdir -p $TMPDIR/del-target
tmpify() {
if [ -d "$1" ]; then
sudo mv "$1" $TMPDIR/del-target/$(echo $1|shasum -a 256|head -n1|cut -d " " -f1)
@@ -442,11 +438,9 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
background: true
# On macOS delete all .git directories under src/ expect for
# third_party/angle/ and third_party/dawn/ because of build time generation of files
# third_party/angle/ because of build time generation of file
# gen/angle/commit.h depends on third_party/angle/.git/HEAD
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
# and dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
# https://dawn-review.googlesource.com/c/dawn/+/83901
# TODO: maybe better to always leave out */.git/HEAD file for all targets ?
step-delete-git-directories: &step-delete-git-directories
run:
@@ -454,7 +448,7 @@ step-delete-git-directories: &step-delete-git-directories
command: |
if [ "`uname`" == "Darwin" ]; then
cd src
( find . -type d -name ".git" -not -path "./third_party/angle/*" -not -path "./third_party/dawn/*" ) | xargs rm -rf
( find . -type d -name ".git" -not -path "./third_party/angle/*" ) | xargs rm -rf
fi
# On macOS the yarn install command during gclient sync was run on a linux
@@ -470,13 +464,6 @@ step-install-npm-deps-on-mac: &step-install-npm-deps-on-mac
node script/yarn install
fi
step-install-npm-deps: &step-install-npm-deps
run:
name: Install node_modules
command: |
cd src/electron
node script/yarn install --frozen-lockfile
# This step handles the differences between the linux "gclient sync"
# and the expected state on macOS
step-fix-sync: &step-fix-sync
@@ -547,7 +534,7 @@ step-gn-check: &step-gn-check
step-electron-build: &step-electron-build
run:
name: Electron build
no_output_timeout: 60m
no_output_timeout: 30m
command: |
# On arm platforms we generate a cross-arch ffmpeg that ninja does not seem
# to realize is not correct / should be rebuilt. We delete it here so it is
@@ -588,6 +575,8 @@ step-maybe-electron-dist-strip: &step-maybe-electron-dist-strip
if [ "$STRIP_BINARIES" == "true" ] && [ "`uname`" == "Linux" ]; then
if [ x"$TARGET_ARCH" == x ]; then
target_cpu=x64
elif [ "$TARGET_ARCH" == "ia32" ]; then
target_cpu=x86
else
target_cpu="$TARGET_ARCH"
fi
@@ -637,7 +626,7 @@ step-electron-publish: &step-electron-publish
echo 'Uploading Electron release distribution to Azure'
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
@@ -910,7 +899,7 @@ step-restore-out-cache: &step-restore-out-cache
paths:
- ./src/out/Default
keys:
- v10-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
- v9-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
@@ -934,7 +923,7 @@ 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" }}
key: v9-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
@@ -996,16 +985,9 @@ step-ts-compile: &step-ts-compile
run:
name: Run TS/JS compile on doc only change
command: |
cd src/electron
node script/yarn create-typescript-definitions
node script/yarn tsc -p tsconfig.default_app.json --noEmit
for f in build/webpack/*.js
do
out="${f:29}"
if [ "$out" != "base.js" ]; then
node script/yarn webpack --config $f --output-filename=$out --output-path=./.tmp --env.mode=development
fi
done
cd src
ninja -C out/Default electron:default_app_js -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:electron_js2c -j $NUMBER_OF_NINJA_PROCESSES
# List of all steps.
steps-electron-gn-check: &steps-electron-gn-check
@@ -1027,7 +1009,36 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
steps:
# Checkout - Copied from steps-checkout
- *step-checkout-electron
- *step-install-npm-deps
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
- *step-install-gnutar-on-mac
- *step-get-more-space-on-mac
- *step-setup-goma-for-build
- *step-generate-deps-hash
- *step-touch-sync-done
- maybe-restore-portaled-src-cache
- *step-maybe-restore-git-cache
- *step-set-git-cache-path
# This sync call only runs if .circle-sync-done is an EMPTY file
- *step-gclient-sync
# These next few steps reset Electron to the correct commit regardless of which cache was restored
- run:
name: Wipe Electron
command: rm -rf src/electron
- *step-checkout-electron
- *step-run-electron-only-hooks
- *step-generate-deps-hash-cleanly
- *step-mark-sync-done
- *step-minimize-workspace-size-from-checkout
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-wait-for-goma
- *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac
- *step-fix-sync
- *step-gn-gen-default
#Compile ts/js to verify doc change didn't break anything
- *step-ts-compile
@@ -1037,7 +1048,6 @@ steps-native-tests: &steps-native-tests
- attach_workspace:
at: .
- *step-depot-tools-add-to-path
- install-python2-mac
- *step-setup-env-for-build
- *step-setup-goma-for-build
- *step-wait-for-goma
@@ -1260,7 +1270,6 @@ commands:
mv_if_exist src/out/Default/hunspell_dictionaries.zip
mv_if_exist src/cross-arch-snapshots
mv_if_exist src/out/electron_ninja_log
mv_if_exist src/out/Default/.ninja_log
when: always
- store_artifacts:
path: generated_artifacts
@@ -1316,6 +1325,8 @@ commands:
target_os=linux
if [ x"$TARGET_ARCH" == x ]; then
target_cpu=x64
elif [ "$TARGET_ARCH" == "ia32" ]; then
target_cpu=x86
else
target_cpu="$TARGET_ARCH"
fi
@@ -1760,6 +1771,44 @@ jobs:
attach: false
checkout: true
linux-ia32-testing:
executor:
name: linux-docker
size: xlarge
environment:
<<: *env-global
<<: *env-ia32
<<: *env-testing-build
<<: *env-ninja-status
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_arm64=True'
steps:
- electron-build:
persist: true
checkout: true
use-out-cache: false
linux-ia32-publish:
executor:
name: linux-docker
size: 2xlarge
environment:
<<: *env-linux-2xlarge-release
<<: *env-ia32
<<: *env-release-build
<<: *env-32bit-release
UPLOAD_TO_STORAGE: << pipeline.parameters.upload-to-storage >>
<<: *env-ninja-status
steps:
- run: echo running
- when:
condition:
or:
- equal: ["all", << pipeline.parameters.linux-publish-arch-limit >>]
- equal: ["ia32", << pipeline.parameters.linux-publish-arch-limit >>]
steps:
- electron-publish:
attach: false
checkout: true
linux-arm-testing:
executor:
@@ -2092,6 +2141,51 @@ jobs:
<<: *env-send-slack-notifications
<<: *steps-verify-ffmpeg
linux-ia32-testing-tests:
executor:
name: linux-docker
size: medium
environment:
<<: *env-linux-medium
<<: *env-ia32
<<: *env-headless-testing
<<: *env-stack-dumping
parallelism: 3
<<: *steps-tests
linux-ia32-testing-nan:
executor:
name: linux-docker
size: medium
environment:
<<: *env-linux-medium
<<: *env-ia32
<<: *env-headless-testing
<<: *env-stack-dumping
<<: *steps-test-nan
linux-ia32-testing-node:
executor:
name: linux-docker
size: xlarge
environment:
<<: *env-linux-medium
<<: *env-ia32
<<: *env-headless-testing
<<: *env-stack-dumping
<<: *steps-test-node
linux-ia32-verify-ffmpeg:
executor:
name: linux-docker
size: medium
environment:
<<: *env-linux-medium
<<: *env-ia32
<<: *env-headless-testing
<<: *env-send-slack-notifications
<<: *steps-verify-ffmpeg
linux-arm-testing-tests:
executor: linux-arm
environment:
@@ -2175,6 +2269,8 @@ workflows:
jobs:
- linux-x64-publish:
context: release-env
- linux-ia32-publish:
context: release-env
- linux-arm-publish:
context: release-env
- linux-arm64-publish:
@@ -2233,6 +2329,18 @@ workflows:
- linux-x64-testing-node:
requires:
- linux-x64-testing
- linux-ia32-testing:
requires:
- linux-make-src-cache
- linux-ia32-testing-tests:
requires:
- linux-ia32-testing
- linux-ia32-testing-nan:
requires:
- linux-ia32-testing
- linux-ia32-testing-node:
requires:
- linux-ia32-testing
- linux-arm-testing:
requires:
- linux-make-src-cache

View File

@@ -1,5 +1,4 @@
{
"root": true,
"extends": "standard",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],

View File

@@ -1,5 +0,0 @@
# Atom --> Electron rename
d9321f4df751fa32813fab1b6387bbd61bd681d0
34c4c8d5088fa183f56baea28809de6f2a427e02
# Enable JS Semicolons
5d657dece4102e5e5304d42e8004b6ad64c0fcda

View File

@@ -17,11 +17,8 @@ body:
- type: input
attributes:
label: Electron Version
description: |
What version of Electron are you using?
Note: Please only report issues for [currently supported versions of Electron](https://www.electronjs.org/docs/latest/tutorial/support#currently-supported-versions).
placeholder: 17.0.0
description: What version of Electron are you using?
placeholder: 12.0.0
validations:
required: true
- type: dropdown
@@ -56,7 +53,7 @@ body:
attributes:
label: Last Known Working Electron version
description: What is the last version of Electron this worked in, if applicable?
placeholder: 16.0.0
placeholder: 11.0.0
- type: textarea
attributes:
label: Expected Behavior

View File

@@ -514,8 +514,6 @@ source_set("electron_lib") {
"StoreKit.framework",
]
weak_frameworks = [ "QuickLookThumbnailing.framework" ]
sources += [
"shell/browser/ui/views/autofill_popup_view.cc",
"shell/browser/ui/views/autofill_popup_view.h",
@@ -712,7 +710,7 @@ source_set("electron_lib") {
"//components/pdf/browser:interceptors",
"//components/pdf/common",
"//components/pdf/renderer",
"//pdf",
"//pdf:pdf_ppapi",
]
sources += [
"shell/browser/electron_pdf_web_contents_helper_client.cc",
@@ -814,11 +812,16 @@ if (is_mac) {
# Add the SwiftShader .dylibs in the Libraries directory of the Framework.
bundle_data("electron_swiftshader_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
public_deps = [
"//ui/gl:swiftshader_egl_library_copy",
"//ui/gl:swiftshader_vk_library_copy",
]
}
}
group("electron_angle_library") {
@@ -1015,14 +1018,14 @@ if (is_mac) {
action("electron_app_lproj_dirs") {
outputs = []
foreach(locale, locales_as_apple_outputs) {
foreach(locale, locales_as_mac_outputs) {
outputs += [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
}
script = "build/mac/make_locale_dirs.py"
args = rebase_path(outputs)
}
foreach(locale, locales_as_apple_outputs) {
foreach(locale, locales_as_mac_outputs) {
bundle_data("electron_app_strings_${locale}_bundle_data") {
sources = [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
outputs = [ "{{bundle_resources_dir}}/$locale.lproj" ]
@@ -1031,7 +1034,7 @@ if (is_mac) {
}
group("electron_app_strings_bundle_data") {
public_deps = []
foreach(locale, locales_as_apple_outputs) {
foreach(locale, locales_as_mac_outputs) {
public_deps += [ ":electron_app_strings_${locale}_bundle_data" ]
}
}
@@ -1110,18 +1113,21 @@ if (is_mac) {
deps = [ ":electron_app" ]
}
extract_symbols("egl_syms") {
binary = "$root_out_dir/libEGL.dylib"
extract_symbols("swiftshader_egl_syms") {
binary = "$root_out_dir/libswiftshader_libEGL.dylib"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/libEGL.dylib.dSYM/Contents/Resources/DWARF/libEGL.dylib"
deps = [ "//third_party/angle:libEGL" ]
dsym_file = "$root_out_dir/libswiftshader_libEGL.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libEGL.dylib"
deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
}
extract_symbols("gles_syms") {
binary = "$root_out_dir/libGLESv2.dylib"
extract_symbols("swiftshader_gles_syms") {
binary = "$root_out_dir/libswiftshader_libGLESv2.dylib"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libGLESv2.dylib"
deps = [ "//third_party/angle:libGLESv2" ]
dsym_file = "$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libGLESv2.dylib"
deps = [
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
}
extract_symbols("crashpad_handler_syms") {
@@ -1133,10 +1139,10 @@ if (is_mac) {
group("electron_symbols") {
deps = [
":egl_syms",
":electron_app_syms",
":electron_framework_syms",
":gles_syms",
":swiftshader_egl_syms",
":swiftshader_gles_syms",
]
if (!is_mas_build) {
@@ -1295,23 +1301,27 @@ if (is_mac) {
deps = [ ":electron_app" ]
}
extract_symbols("egl_symbols") {
binary = "$root_out_dir/libEGL$_target_shared_library_suffix"
extract_symbols("swiftshader_egl_symbols") {
binary = "$root_out_dir/swiftshader/libEGL$_target_shared_library_suffix"
symbol_dir = "$root_out_dir/breakpad_symbols"
deps = [ "//third_party/angle:libEGL" ]
deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
}
extract_symbols("gles_symbols") {
binary = "$root_out_dir/libGLESv2$_target_shared_library_suffix"
extract_symbols("swiftshader_gles_symbols") {
binary =
"$root_out_dir/swiftshader/libGLESv2$_target_shared_library_suffix"
symbol_dir = "$root_out_dir/breakpad_symbols"
deps = [ "//third_party/angle:libGLESv2" ]
deps = [
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
}
group("electron_symbols") {
deps = [
":egl_symbols",
":electron_app_symbols",
":gles_symbols",
":swiftshader_egl_symbols",
":swiftshader_gles_symbols",
]
}
}

19
DEPS
View File

@@ -1,10 +1,23 @@
gclient_gn_args_from = 'src'
gclient_gn_args_file = 'src/build/config/gclient_args.gni'
gclient_gn_args = [
'build_with_chromium',
'checkout_android',
'checkout_android_native_support',
'checkout_libaom',
'checkout_nacl',
'checkout_pgo_profiles',
'checkout_oculus_sdk',
'checkout_openxr',
'checkout_google_benchmark',
'mac_xcode_version',
'generate_location_tags',
]
vars = {
'chromium_version':
'102.0.5005.167',
'100.0.4896.160',
'node_version':
'v16.14.2',
'v16.13.2',
'nan_version':
# The following commit hash of NAN is v2.14.2 with *only* changes to the
# test suite. This should be updated to a specific tag when one becomes

View File

@@ -1 +1 @@
19.0.16
18.3.10

View File

@@ -34,17 +34,6 @@ For more installation options and troubleshooting tips, see
[installation](docs/tutorial/installation.md). For info on how to manage Electron versions in your apps, see
[Electron versioning](docs/tutorial/electron-versioning.md).
## Platform support
Each Electron release provides binaries for macOS, Windows, and Linux.
* macOS (El Capitan and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11.
* 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
* Fedora 24 and newer
* Debian 8 and newer
## Quick start & Electron Fiddle
Use [`Electron Fiddle`](https://github.com/electron/fiddle)
@@ -65,10 +54,12 @@ npm start
## Resources for learning Electron
* [electronjs.org/docs](https://electronjs.org/docs) - All of Electron's documentation
* [electron/fiddle](https://github.com/electron/fiddle) - A tool to build, run, and package small Electron experiments
* [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - A very basic starter Electron app
* [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - Sample starter apps created by the community
- [electronjs.org/docs](https://electronjs.org/docs) - All of Electron's documentation
- [electron/fiddle](https://github.com/electron/fiddle) - A tool to build, run, and package small Electron experiments
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - A very basic starter Electron app
- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - Sample starter apps created by the community
- [electron/simple-samples](https://github.com/electron/simple-samples) - Small applications with ideas for taking them further
- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - An Electron app that teaches you how to use Electron
## Programmatic usage
@@ -89,15 +80,11 @@ const child = proc.spawn(electron)
### Mirrors
* [China](https://npmmirror.com/mirrors/electron/)
- [China](https://npmmirror.com/mirrors/electron)
See the [Advanced Installation Instructions](https://www.electronjs.org/docs/latest/tutorial/installation#mirror) to learn how to use a custom mirror.
## Documentation Translations
## Documentation translations
We crowdsource translations for our documentation via [Crowdin](https://crowdin.com/project/electron).
We currently accept translations for Chinese (Simplified), French, German, Japanese, Portuguese,
Russian, and Spanish.
Find documentation translations in [electron/i18n](https://github.com/electron/i18n).
## Contributing
@@ -106,10 +93,10 @@ If you are interested in reporting/fixing issues and contributing directly to th
## Community
Info on reporting bugs, getting help, finding third-party tools and sample apps,
and more can be found on the [Community page](https://www.electronjs.org/community).
and more can be found in the [support document](docs/tutorial/support.md#finding-support).
## License
[MIT](https://github.com/electron/electron/blob/main/LICENSE)
When using Electron logos, make sure to follow [OpenJS Foundation Trademark Policy](https://openjsf.org/wp-content/uploads/sites/84/2021/01/OpenJS-Foundation-Trademark-Policy-2021-01-12.docx.pdf).
When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electron-16-core
image: vs2019bt-16.16.11
image: vs2019bt-16.6.2
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -144,12 +144,6 @@ build_script:
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"
}
}
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
@@ -172,8 +166,17 @@ build_script:
- 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
- python electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/shell_browser_ui_unittests.exe
- appveyor PushArtifact out/Default/chromedriver.zip
- appveyor PushArtifact out/ffmpeg/ffmpeg.zip
- 7z a node_headers.zip out\Default\gen\node_headers
- appveyor PushArtifact node_headers.zip
- appveyor PushArtifact out/Default/mksnapshot.zip
- appveyor PushArtifact out/Default/hunspell_dictionaries.zip
- appveyor PushArtifact out/Default/electron.lib
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
@@ -188,6 +191,7 @@ build_script:
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
7z a pdb.zip out\Default\*.pdb
appveyor-retry appveyor PushArtifact pdb.zip
}
- 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:
@@ -216,6 +220,7 @@ test_script:
- 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"
- if exist %cd%\electron.log ( appveyor-retry appveyor PushArtifact %cd%\electron.log )
deploy_script:
- cd electron
- ps: >-
@@ -231,18 +236,4 @@ deploy_script:
node script/release/ci-release-build.js --job=electron-woa-testing --ci=GHA --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
}
on_finish:
- 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
}
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )
- if exist src\electron\electron.log ( appveyor-retry appveyor PushArtifact src\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 = 106
node_module_version = 103
v8_promise_internal_field_count = 1
v8_embedder_string = "-electron.0"
@@ -27,6 +27,9 @@ enable_basic_printing = true
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
# This breaks native node modules
libcxx_abi_unstable = false
# These are disabled because they cause the zip manifest to differ between
# testing and release builds.
# See https://chromium-review.googlesource.com/c/chromium/src/+/2774898.

View File

@@ -55,14 +55,6 @@ static_library("chrome") {
"//chrome/browser/process_singleton.h",
"//chrome/browser/process_singleton_internal.cc",
"//chrome/browser/process_singleton_internal.h",
"//chrome/browser/themes/browser_theme_pack.cc",
"//chrome/browser/themes/browser_theme_pack.h",
"//chrome/browser/themes/custom_theme_supplier.cc",
"//chrome/browser/themes/custom_theme_supplier.h",
"//chrome/browser/themes/theme_properties.cc",
"//chrome/browser/themes/theme_properties.h",
"//chrome/browser/ui/color/chrome_color_mixers.cc",
"//chrome/browser/ui/color/chrome_color_mixers.h",
"//chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc",
"//chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h",
"//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc",
@@ -77,11 +69,6 @@ static_library("chrome") {
"//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
"//chrome/browser/ui/frame/window_frame_util.cc",
"//chrome/browser/ui/frame/window_frame_util.h",
"//chrome/browser/ui/native_window_tracker.h",
"//chrome/browser/ui/ui_features.cc",
"//chrome/browser/ui/ui_features.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc",
@@ -119,8 +106,6 @@ static_library("chrome") {
"//chrome/browser/ui/view_ids.h",
"//chrome/browser/win/chrome_process_finder.cc",
"//chrome/browser/win/chrome_process_finder.h",
"//chrome/browser/win/titlebar_config.cc",
"//chrome/browser/win/titlebar_config.h",
"//chrome/browser/win/titlebar_config.h",
"//chrome/child/v8_crashpad_support_win.cc",
"//chrome/child/v8_crashpad_support_win.h",
@@ -134,15 +119,12 @@ static_library("chrome") {
if (use_aura) {
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/aura/native_window_tracker_aura.cc",
"//chrome/browser/ui/aura/native_window_tracker_aura.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
]
}
public_deps = [
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser/ui/color:mixers",
"//chrome/common",
"//chrome/common:version_header",
"//components/keyed_service/content",
@@ -324,6 +306,8 @@ static_library("chrome") {
"//chrome/browser/pdf/pdf_frame_util.h",
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.cc",
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.h",
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
]
deps += [
"//components/pdf/browser",
@@ -361,6 +345,8 @@ source_set("plugins") {
sources += [
"//chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc",
"//chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h",
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
"//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
"//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
]

View File

@@ -64,6 +64,7 @@ an issue:
* [Automated Testing](tutorial/automated-testing.md)
* [REPL](tutorial/repl.md)
* [Distribution](tutorial/application-distribution.md)
* [Supported Platforms](tutorial/support.md#supported-platforms)
* [Code Signing](tutorial/code-signing.md)
* [Mac App Store](tutorial/mac-app-store-submission-guide.md)
* [Windows Store](tutorial/windows-store-guide.md)

View File

@@ -690,7 +690,7 @@ Overrides the current application's name.
### `app.getLocale()`
Returns `string` - The current application locale, fetched using Chromium's `l10n_util` library.
Possible return values are documented [here](https://source.chromium.org/chromium/chromium/src/+/main:ui/base/l10n/l10n_util.cc).
Possible return values are documented [here](https://source.chromium.org/chromium/chromium/src/+/master:ui/base/l10n/l10n_util.cc).
To set the locale, you'll want to use a command line switch at app startup, which may be found [here](command-line-switches.md).
@@ -1059,7 +1059,7 @@ Activation policy types:
Imports the certificate in pkcs12 format into the platform certificate store.
`callback` is called with the `result` of import operation, a value of `0`
indicates success while any other value indicates failure according to Chromium [net_error_list](https://source.chromium.org/chromium/chromium/src/+/main:net/base/net_error_list.h).
indicates success while any other value indicates failure according to Chromium [net_error_list](https://source.chromium.org/chromium/chromium/src/+/master:net/base/net_error_list.h).
### `app.configureHostResolver(options)`

View File

@@ -64,7 +64,7 @@ win.loadURL('https://github.com')
```
Note that even for apps that use `ready-to-show` event, it is still recommended
to set `backgroundColor` to make the app feel more native.
to set `backgroundColor` to make app feel more native.
Some examples of valid `backgroundColor` values include:
@@ -158,20 +158,20 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `useContentSize` boolean (optional) - The `width` and `height` would be used as web
page's size, which means the actual window's size will include window
frame's size and be slightly larger. Default is `false`.
* `center` boolean (optional) - Show window in the center of the screen. Default is `false`.
* `center` boolean (optional) - Show window in the center of the screen.
* `minWidth` Integer (optional) - Window's minimum width. Default is `0`.
* `minHeight` Integer (optional) - Window's minimum height. Default is `0`.
* `maxWidth` Integer (optional) - Window's maximum width. Default is no limit.
* `maxHeight` Integer (optional) - Window's maximum height. Default is no limit.
* `resizable` boolean (optional) - Whether window is resizable. Default is `true`.
* `movable` boolean (optional) _macOS_ _Windows_ - Whether window is
movable. This is not implemented on Linux. Default is `true`.
* `minimizable` boolean (optional) _macOS_ _Windows_ - Whether window is
minimizable. This is not implemented on Linux. Default is `true`.
* `maximizable` boolean (optional) _macOS_ _Windows_ - Whether window is
maximizable. This is not implemented on Linux. Default is `true`.
* `closable` boolean (optional) _macOS_ _Windows_ - Whether window is
closable. This is not implemented on Linux. Default is `true`.
* `movable` boolean (optional) - Whether window is movable. This is not implemented
on Linux. Default is `true`.
* `minimizable` boolean (optional) - Whether window is minimizable. This is not
implemented on Linux. Default is `true`.
* `maximizable` boolean (optional) - Whether window is maximizable. This is not
implemented on Linux. Default is `true`.
* `closable` boolean (optional) - Whether window is closable. This is not implemented
on Linux. Default is `true`.
* `focusable` boolean (optional) - Whether the window can be focused. Default is
`true`. On Windows setting `focusable: false` also implies setting
`skipTaskbar: true`. On Linux setting `focusable: false` makes the window
@@ -185,10 +185,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `fullscreenable` boolean (optional) - Whether the window can be put into fullscreen
mode. On macOS, also whether the maximize/zoom button should toggle full
screen mode or maximize window. Default is `true`.
* `simpleFullscreen` boolean (optional) _macOS_ - Use pre-Lion fullscreen on
macOS. Default is `false`.
* `skipTaskbar` boolean (optional) _macOS_ _Windows_ - Whether to show the window in taskbar.
Default is `false`.
* `simpleFullscreen` boolean (optional) - Use pre-Lion fullscreen on macOS. Default is `false`.
* `skipTaskbar` boolean (optional) - Whether to show the window in taskbar. Default is
`false`.
* `kiosk` boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
* `title` string (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
* `icon` ([NativeImage](native-image.md) | string) (optional) - The window icon. On Windows it is
@@ -202,30 +201,27 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `parent` BrowserWindow (optional) - Specify parent window. Default is `null`.
* `modal` boolean (optional) - Whether this is a modal window. This only works when the
window is a child window. Default is `false`.
* `acceptFirstMouse` boolean (optional) _macOS_ - Whether clicking an
inactive window will also click through to the web contents. Default is
`false` on macOS. This option is not configurable on other platforms.
* `acceptFirstMouse` boolean (optional) - Whether clicking an inactive window will also
click through to the web contents. Default is `false` on macOS. This option is not
configurable on other platforms.
* `disableAutoHideCursor` boolean (optional) - Whether to hide cursor when typing.
Default is `false`.
* `autoHideMenuBar` boolean (optional) - Auto hide the menu bar unless the `Alt`
key is pressed. Default is `false`.
* `enableLargerThanScreen` boolean (optional) _macOS_ - Enable the window to
be resized larger than screen. Only relevant for macOS, as other OSes
allow larger-than-screen windows by default. Default is `false`.
* `enableLargerThanScreen` boolean (optional) - Enable the window to be resized larger
than screen. Only relevant for macOS, as other OSes allow
larger-than-screen windows by default. Default is `false`.
* `backgroundColor` string (optional) - The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if `transparent` is set to `true`. Default is `#FFF` (white). See [win.setBackgroundColor](browser-window.md#winsetbackgroundcolorbackgroundcolor) for more information.
* `hasShadow` boolean (optional) - Whether window should have a shadow. Default is `true`.
* `opacity` number (optional) _macOS_ _Windows_ - Set the initial opacity of
the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This
is only implemented on Windows and macOS.
* `opacity` number (optional) - Set the initial opacity of the window, between 0.0 (fully
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
* `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` boolean (optional) - Makes the window [transparent](../tutorial/window-customization.md#create-transparent-windows).
Default is `false`. On Windows, does not work unless the window is frameless.
* `type` string (optional) - The type of window, default is normal window. See more about
this below.
* `visualEffectState` string (optional) _macOS_ - Specify how the material
appearance should reflect window activity state on macOS. Must be used
with the `vibrancy` property. Possible values are:
* `visualEffectState` string (optional) - Specify how the material appearance should reflect window activity state on macOS. Must be used with the `vibrancy` property. Possible values are:
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
* `active` - The backdrop should always appear active.
* `inactive` - The backdrop should always appear inactive.
@@ -233,42 +229,36 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
Default is `default`. Possible values are:
* `default` - Results in the standard title bar for macOS or Windows respectively.
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
* `hiddenInset` _macOS_ - Only on macOS, results in a hidden title bar
with an alternative look where the traffic light buttons are slightly
more inset from the window edge.
* `customButtonsOnHover` _macOS_ - Only on macOS, results in a hidden
title bar and a full size content window, the traffic light buttons will
display when being hovered over in the top left of the window.
**Note:** This option is currently experimental.
* `trafficLightPosition` [Point](structures/point.md) (optional) _macOS_ -
Set a custom position for the traffic light buttons in frameless windows.
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
should have rounded corners on macOS. Default is `true`. Setting this property
to `false` will prevent the window from being fullscreenable.
* `fullscreenWindowTitle` boolean (optional) _macOS_ _Deprecated_ - Shows
the title in the title bar in full screen mode on macOS for `hiddenInset`
titleBarStyle. Default is `false`.
* `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look
where the traffic light buttons are slightly more inset from the window edge.
* `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size
content window, the traffic light buttons will display when being hovered
over in the top left of the window. **Note:** This option is currently
experimental.
* `trafficLightPosition` [Point](structures/point.md) (optional) - Set a
custom position for the traffic light buttons in frameless windows.
* `roundedCorners` boolean (optional) - Whether frameless window should have
rounded corners on macOS. Default is `true`.
* `fullscreenWindowTitle` boolean (optional) _Deprecated_ - Shows the title in
the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle.
Default is `false`.
* `thickFrame` boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
Windows, which adds standard window frame. Setting it to `false` will remove
window shadow and window animations. Default is `true`.
* `vibrancy` string (optional) _macOS_ - Add a type of vibrancy effect to
the window, only on macOS. Can be `appearance-based`, `light`, `dark`,
`titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`,
`ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`,
`tooltip`, `content`, `under-window`, or `under-page`. Please note that
`appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are
deprecated and have been removed in macOS Catalina (10.15).
* `zoomToPageWidth` boolean (optional) _macOS_ - Controls the behavior on
macOS when option-clicking the green stoplight button on the toolbar or by
clicking the Window > Zoom menu item. If `true`, the window will grow to
the preferred width of the web page when zoomed, `false` will cause it to
zoom to the width of the screen. This will also affect the behavior when
calling `maximize()` directly. Default is `false`.
* `tabbingIdentifier` string (optional) _macOS_ - Tab group name, allows
opening the window as a native tab on macOS 10.12+. Windows with the same
tabbing identifier will be grouped together. This also adds a native new
tab button to your window's tab bar and allows your `app` and window to
receive the `new-window-for-tab` event.
* `vibrancy` string (optional) - Add a type of vibrancy effect to the window, only on
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
`menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
* `zoomToPageWidth` boolean (optional) - Controls the behavior on macOS when
option-clicking the green stoplight button on the toolbar or by clicking the
Window > Zoom menu item. If `true`, the window will grow to the preferred
width of the web page when zoomed, `false` will cause it to zoom to the
width of the screen. This will also affect the behavior when calling
`maximize()` directly. Default is `false`.
* `tabbingIdentifier` string (optional) - Tab group name, allows opening the
window as a native tab on macOS 10.12+. Windows with the same tabbing
identifier will be grouped together. This also adds a native new tab button
to your window's tab bar and allows your `app` and window to receive the
`new-window-for-tab` event.
* `webPreferences` Object (optional) - Settings of web page's features.
* `devTools` boolean (optional) - Whether to enable DevTools. If it is set to `false`, can not use `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
* `nodeIntegration` boolean (optional) - Whether node integration is enabled.
@@ -320,8 +310,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `plugins` boolean (optional) - Whether plugins should be enabled. Default is `false`.
* `experimentalFeatures` boolean (optional) - Enables Chromium's experimental features.
Default is `false`.
* `scrollBounce` boolean (optional) _macOS_ - Enables scroll bounce
(rubber banding) effect on macOS. Default is `false`.
* `scrollBounce` boolean (optional) - Enables scroll bounce (rubber banding) effect on
macOS. Default is `false`.
* `enableBlinkFeatures` string (optional) - A list of feature strings separated by `,`, like
`CSSVariables,KeyboardEventKey` to enable. The full list of supported feature
strings can be found in the [RuntimeEnabledFeatures.json5][runtime-enabled-features]
@@ -784,7 +774,7 @@ A `boolean` property that determines whether the window is in fullscreen mode.
A `boolean` property that determines whether the window is focusable.
#### `win.visibleOnAllWorkspaces` _macOS_ _Linux_
#### `win.visibleOnAllWorkspaces`
A `boolean` property that determines whether the window is visible on all workspaces.
@@ -821,13 +811,13 @@ A `string` property that determines the title of the native window.
**Note:** The title of the web page can be different from the title of the native window.
#### `win.minimizable` _macOS_ _Windows_
#### `win.minimizable`
A `boolean` property that determines whether the window can be manually minimized by user.
On Linux the setter is a no-op, although the getter returns `true`.
#### `win.maximizable` _macOS_ _Windows_
#### `win.maximizable`
A `boolean` property that determines whether the window can be manually maximized by user.
@@ -842,13 +832,13 @@ maximizes the window.
A `boolean` property that determines whether the window can be manually resized by user.
#### `win.closable` _macOS_ _Windows_
#### `win.closable`
A `boolean` property that determines whether the window can be manually closed by user.
On Linux the setter is a no-op, although the getter returns `true`.
#### `win.movable` _macOS_ _Windows_
#### `win.movable`
A `boolean` property that determines Whether the window can be moved by user.
@@ -1645,7 +1635,7 @@ Changes window icon.
Sets whether the window traffic light buttons should be visible.
#### `win.setAutoHideMenuBar(hide)` _Windows_ _Linux_
#### `win.setAutoHideMenuBar(hide)`
* `hide` boolean
@@ -1654,7 +1644,7 @@ menu bar will only show when users press the single `Alt` key.
If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately.
#### `win.isMenuBarAutoHide()` _Windows_ _Linux_
#### `win.isMenuBarAutoHide()`
Returns `boolean` - Whether menu bar automatically hides itself.
@@ -1664,11 +1654,11 @@ Returns `boolean` - Whether menu bar automatically hides itself.
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
#### `win.isMenuBarVisible()` _Windows_ _Linux_
#### `win.isMenuBarVisible()`
Returns `boolean` - Whether the menu bar is visible.
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
* `visible` boolean
* `options` Object (optional)
@@ -1686,7 +1676,7 @@ Sets whether the window should be visible on all workspaces.
**Note:** This API does nothing on Windows.
#### `win.isVisibleOnAllWorkspaces()` _macOS_ _Linux_
#### `win.isVisibleOnAllWorkspaces()`
Returns `boolean` - Whether the window is visible on all workspaces.

View File

@@ -185,7 +185,7 @@ the first write will throw an error. If the passed value is not a `string`, its
Certain headers are restricted from being set by apps. These headers are
listed below. More information on restricted headers can be found in
[Chromium's header utils](https://source.chromium.org/chromium/chromium/src/+/main:services/network/public/cpp/header_util.cc;drc=1562cab3f1eda927938f8f4a5a91991fefde66d3;bpv=1;bpt=1;l=22).
[Chromium's header utils](https://source.chromium.org/chromium/chromium/src/+/master:services/network/public/cpp/header_util.cc;drc=1562cab3f1eda927938f8f4a5a91991fefde66d3;bpv=1;bpt=1;l=22).
* `Content-Length`
* `Host`

View File

@@ -274,8 +274,8 @@ By default inspector websocket url is available in stderr and under /json/list e
[ready]: app.md#event-ready
[play-silent-audio]: https://github.com/atom/atom/pull/9485/files
[debugging-main-process]: ../tutorial/debugging-main-process.md
[logging]: https://source.chromium.org/chromium/chromium/src/+/main:base/logging.h
[logging]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h
[node-cli]: https://nodejs.org/api/cli.html
[play-silent-audio]: https://github.com/atom/atom/pull/9485/files
[ready]: app.md#event-ready
[severities]: https://source.chromium.org/chromium/chromium/src/+/main:base/logging.h?q=logging::LogSeverity&ss=chromium
[severities]: https://source.chromium.org/chromium/chromium/src/+/master:base/logging.h?q=logging::LogSeverity&ss=chromium

View File

@@ -36,7 +36,7 @@ Returns `Promise<string[]>` - resolves with an array of category groups once all
Get a set of category groups. The category groups can change as new code paths
are reached. See also the [list of built-in tracing
categories](https://chromium.googlesource.com/chromium/src/+/main/base/trace_event/builtin_categories.h).
categories](https://chromium.googlesource.com/chromium/src/+/master/base/trace_event/builtin_categories.h).
> **NOTE:** Electron adds a non-default tracing category called `"electron"`.
> This category can be used to capture Electron-specific tracing events.

View File

@@ -1,10 +1,3 @@
---
title: "ipcMain"
description: "Communicate asynchronously from the main process to renderer processes."
slug: ipc-main
hide_title: false
---
# ipcMain
> Communicate asynchronously from the main process to renderer processes.
@@ -16,9 +9,7 @@ process, it handles asynchronous and synchronous messages sent from a renderer
process (web page). Messages sent from a renderer will be emitted to this
module.
For usage examples, check out the [IPC tutorial].
## Sending messages
## Sending Messages
It is also possible to send messages from the main process to the renderer
process, see [webContents.send][web-contents-send] for more information.
@@ -30,6 +21,36 @@ process, see [webContents.send][web-contents-send] for more information.
coming from frames that aren't the main frame (e.g. iframes) whereas
`event.sender.send(...)` will always send to the main frame.
An example of sending and handling messages between the render and main
processes:
```javascript
// In main process.
const { ipcMain } = require('electron')
ipcMain.on('asynchronous-message', (event, arg) => {
console.log(arg) // prints "ping"
event.reply('asynchronous-reply', 'pong')
})
ipcMain.on('synchronous-message', (event, arg) => {
console.log(arg) // prints "ping"
event.returnValue = 'pong'
})
```
```javascript
// In renderer process (web page).
// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled.
// See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts for more details.
const { ipcRenderer } = require('electron')
console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong"
ipcRenderer.on('asynchronous-reply', (event, arg) => {
console.log(arg) // prints "pong"
})
ipcRenderer.send('asynchronous-message', 'ping')
```
## Methods
The `ipcMain` module has the following method to listen for events:
@@ -38,7 +59,7 @@ The `ipcMain` module has the following method to listen for events:
* `channel` string
* `listener` Function
* `event` [IpcMainEvent][ipc-main-event]
* `event` IpcMainEvent
* `...args` any[]
Listens to `channel`, when a new message arrives `listener` would be called with
@@ -48,7 +69,7 @@ Listens to `channel`, when a new message arrives `listener` would be called with
* `channel` string
* `listener` Function
* `event` [IpcMainEvent][ipc-main-event]
* `event` IpcMainEvent
* `...args` any[]
Adds a one time `listener` function for the event. This `listener` is invoked
@@ -72,8 +93,8 @@ Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`
* `channel` string
* `listener` Function<Promise\<void&#62; | any&#62;
* `event` [IpcMainInvokeEvent][ipc-main-invoke-event]
* `listener` Function<Promise\<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
Adds a handler for an `invoke`able IPC. This handler will be called whenever a
@@ -83,14 +104,14 @@ If `listener` returns a Promise, the eventual result of the promise will be
returned as a reply to the remote caller. Otherwise, the return value of the
listener will be used as the value of the reply.
```js title='Main Process'
```js
// Main process
ipcMain.handle('my-invokable-ipc', async (event, ...args) => {
const result = await somePromise(...args)
return result
})
```
```js title='Renderer Process'
// Renderer process
async () => {
const result = await ipcRenderer.invoke('my-invokable-ipc', arg1, arg2)
// ...
@@ -109,7 +130,7 @@ provided to the renderer process. Please refer to
### `ipcMain.handleOnce(channel, listener)`
* `channel` string
* `listener` Function<Promise\<void&#62; | any&#62;
* `listener` Function<Promise\<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@@ -125,16 +146,13 @@ Removes any handler for `channel`, if present.
## IpcMainEvent object
The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-main-event`][ipc-main-event] structure docs.
in the [`ipc-main-event`](structures/ipc-main-event.md) structure docs.
## IpcMainInvokeEvent object
The documentation for the `event` object passed to `handle` callbacks can be
found in the [`ipc-main-invoke-event`][ipc-main-invoke-event]
found in the [`ipc-main-invoke-event`](structures/ipc-main-invoke-event.md)
structure docs.
[IPC tutorial]: ../tutorial/ipc.md
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[web-contents-send]: ../api/web-contents.md#contentssendchannel-args
[ipc-main-event]:../api/structures/ipc-main-event.md
[ipc-main-invoke-event]:../api/structures/ipc-main-invoke-event.md
[web-contents-send]: web-contents.md#contentssendchannel-args

View File

@@ -1,10 +1,3 @@
---
title: "ipcRenderer"
description: "Communicate asynchronously from a renderer process to the main process."
slug: ipc-renderer
hide_title: false
---
# ipcRenderer
> Communicate asynchronously from a renderer process to the main process.
@@ -16,7 +9,7 @@ methods so you can send synchronous and asynchronous messages from the render
process (web page) to the main process. You can also receive replies from the
main process.
See [IPC tutorial](../tutorial/ipc.md) for code examples.
See [ipcMain](ipc-main.md) for code examples.
## Methods
@@ -77,7 +70,7 @@ throw an exception.
> them. Attempting to send such objects over IPC will result in an error.
The main process handles it by listening for `channel` with the
[`ipcMain`](./ipc-main.md) module.
[`ipcMain`](ipc-main.md) module.
If you need to transfer a [`MessagePort`][] to the main process, use [`ipcRenderer.postMessage`](#ipcrendererpostmessagechannel-message-transfer).
@@ -105,7 +98,7 @@ throw an exception.
> 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).
[`ipcMain.handle()`](ipc-main.md#ipcmainhandlechannel-listener).
For example:
@@ -131,11 +124,11 @@ If you do not need a response to the message, consider using [`ipcRenderer.send`
* `channel` string
* `...args` any[]
Returns `any` - The value sent back by the [`ipcMain`](./ipc-main.md) handler.
Returns `any` - The value sent back by the [`ipcMain`](ipc-main.md) handler.
Send a message to the main process via `channel` and expect a result
synchronously. Arguments will be serialized with the [Structured Clone
Algorithm][SCA], just like [`window.postMessage`], so prototype chains will not be
Algorithm][SCA], just like [`window.postMessage`][], so prototype chains will not be
included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
throw an exception.
@@ -147,13 +140,13 @@ throw an exception.
> 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 handles it by listening for `channel` with [`ipcMain`](./ipc-main.md) module,
The main process handles it by listening for `channel` with [`ipcMain`](ipc-main.md) module,
and replies by setting `event.returnValue`.
> :warning: **WARNING**: Sending a synchronous message will block the whole
> renderer process until the reply is received, so use this method only as a
> last resort. It's much better to use the asynchronous version,
> [`invoke()`](./ipc-renderer.md#ipcrendererinvokechannel-args).
> [`invoke()`](ipc-renderer.md#ipcrendererinvokechannel-args).
### `ipcRenderer.postMessage(channel, message, [transfer])`
@@ -165,7 +158,7 @@ Send a message to the main process, optionally transferring ownership of zero
or more [`MessagePort`][] objects.
The transferred `MessagePort` objects will be available in the main process as
[`MessagePortMain`](./message-port-main.md) objects by accessing the `ports`
[`MessagePortMain`](message-port-main.md) objects by accessing the `ports`
property of the emitted event.
For example:
@@ -204,7 +197,7 @@ the host page instead of the main process.
## Event object
The documentation for the `event` object passed to the `callback` can be found
in the [`ipc-renderer-event`](./structures/ipc-renderer-event.md) structure docs.
in the [`ipc-renderer-event`](structures/ipc-renderer-event.md) structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm

View File

@@ -567,7 +567,7 @@ the original network configuration.
* `errorCode` Integer - Error code.
* `callback` Function
* `verificationResult` Integer - Value can be one of certificate error codes
from [here](https://source.chromium.org/chromium/chromium/src/+/main:net/base/net_error_list.h).
from [here](https://source.chromium.org/chromium/chromium/src/+/master:net/base/net_error_list.h).
Apart from the certificate error codes, the following special codes can be used.
* `0` - Indicates success and disables Certificate Transparency verification.
* `-2` - Indicates failure.
@@ -1025,7 +1025,7 @@ is emitted.
#### `ses.getStoragePath()`
Returns `string | null` - The absolute file system path where data for this
A `string | null` indicating the absolute file system path where data for this
session is persisted on disk. For in memory sessions this returns `null`.
### Instance Properties

View File

@@ -31,4 +31,4 @@
* `uploadData` [ProtocolResponseUploadData](protocol-response-upload-data.md) (optional) - The data used as upload data. This is only
used for URL responses when `method` is `"POST"`.
[net-error]: https://source.chromium.org/chromium/chromium/src/+/main:net/base/net_error_list.h
[net-error]: https://source.chromium.org/chromium/chromium/src/+/master:net/base/net_error_list.h

View File

@@ -8,7 +8,7 @@
* `enable_argument_filter` boolean (optional) - if true, filter event data
according to a specific list of events that have been manually vetted to not
include any PII. See [the implementation in
Chromium][trace_event_args_allowlist.cc] for specifics.
Chromium][trace_event_args_whitelist.cc] for specifics.
* `included_categories` string[] (optional) - a list of tracing categories to
include. Can include glob-like patterns using `*` at the end of the category
name. See [tracing categories][] for the list of categories.
@@ -45,7 +45,7 @@ An example TraceConfig that roughly matches what Chrome DevTools records:
}
```
[tracing categories]: https://chromium.googlesource.com/chromium/src/+/main/base/trace_event/builtin_categories.h
[memory-infra docs]: https://chromium.googlesource.com/chromium/src/+/main/docs/memory-infra/memory_infra_startup_tracing.md#the-advanced-way
[trace_event_args_allowlist.cc]: https://chromium.googlesource.com/chromium/src/+/main/services/tracing/public/cpp/trace_event_args_allowlist.cc
[tracing categories]: https://chromium.googlesource.com/chromium/src/+/master/base/trace_event/builtin_categories.h
[memory-infra docs]: https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/memory_infra_startup_tracing.md#the-advanced-way
[trace_event_args_whitelist.cc]: https://chromium.googlesource.com/chromium/src/+/master/services/tracing/public/cpp/trace_event_args_whitelist.cc
[histogram]: https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

View File

@@ -183,11 +183,11 @@ Some popular `key` and `type`s are:
* `NSPreferredWebServices`: `dictionary`
* `NSUserDictionaryReplacementItems`: `array`
### `systemPreferences.setUserDefault<Type extends keyof UserDefaultTypes>(key, type, value)` _macOS_
### `systemPreferences.setUserDefault(key, type, value)` _macOS_
* `key` string
* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`.
* `value` UserDefaultTypes[Type]
* `type` string - Can be `string`, `boolean`, `integer`, `float`, `double`, `url`, `array` or `dictionary`.
* `value` string
Set the value of `key` in `NSUserDefaults`.

View File

@@ -25,20 +25,15 @@ app.whenReady().then(() => {
})
```
__Platform Considerations__
If you want to keep exact same behaviors on all platforms, you should not
rely on the `click` event; instead, always attach a context menu to the tray icon.
__Linux__
__Platform limitations:__
* On Linux the app indicator will be used if it is supported, otherwise
`GtkStatusIcon` will be used instead.
* On Linux distributions that only have app indicator support, you have to
install `libappindicator1` to make the tray icon work.
* The app indicator will be used if it is supported, otherwise
`GtkStatusIcon` will be used instead.
* App indicator will only be shown when it has a context menu.
* The `click` event is ignored when using the app indicator.
* In order for changes made to individual `MenuItem`s to take effect,
* When app indicator is used on Linux, the `click` event is ignored.
* On Linux in order for changes made to individual `MenuItem`s to take effect,
you have to call `setContextMenu` again. For example:
```javascript
@@ -60,16 +55,10 @@ app.whenReady().then(() => {
})
```
__MacOS__
* On Windows it is recommended to use `ICO` icons to get best visual effects.
* Icons passed to the Tray constructor should be [Template Images](native-image.md#template-image).
* To make sure your icon isn't grainy on retina monitors, be sure your `@2x` image is 144dpi.
* If you are bundling your application (e.g., with webpack for development), be sure that the file names are not being mangled or hashed. The filename needs to end in Template, and the `@2x` image needs to have the same filename as the standard image, or MacOS will not magically invert your image's colors or use the high density image.
* 16x16 (72dpi) and 32x32@2x (144dpi) work well for most icons.
__Windows__
* It is recommended to use `ICO` icons to get best visual effects.
If you want to keep exact same behaviors on all platforms, you should not
rely on the `click` event and always attach a context menu to the tray icon.
### `new Tray(image, [guid])`

View File

@@ -35,7 +35,7 @@ for all windows, webviews, opened devtools, and devtools extension background pa
### `webContents.getFocusedWebContents()`
Returns `WebContents` | null - The web contents that is focused in this application, otherwise
Returns `WebContents` - The web contents that is focused in this application, otherwise
returns `null`.
### `webContents.fromId(id)`
@@ -92,7 +92,7 @@ Returns:
* `frameRoutingId` Integer
This event is like `did-finish-load` but emitted when the load failed.
The full list of error codes and their meaning is available [here](https://source.chromium.org/chromium/chromium/src/+/main:net/base/net_error_list.h).
The full list of error codes and their meaning is available [here](https://source.chromium.org/chromium/chromium/src/+/master:net/base/net_error_list.h).
#### Event: 'did-fail-provisional-load'
@@ -820,6 +820,9 @@ This event can be used to configure `webPreferences` for the `webContents`
of a `<webview>` before it's loaded, and provides the ability to set settings
that can't be set via `<webview>` attributes.
**Note:** The specified `preload` script option will appear as `preloadURL`
(not `preload`) in the `webPreferences` object emitted with this event.
#### Event: 'did-attach-webview'
Returns:

View File

@@ -195,6 +195,3 @@ have the same `routingId`.
A `string` representing the [visibility state](https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState) of the frame.
See also how the [Page Visibility API](browser-window.md#page-visibility) is affected by other Electron APIs.
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

View File

@@ -110,7 +110,7 @@ webFrame.setSpellCheckProvider('en-US', {
})
```
### `webFrame.insertCSS(css[, options])`
#### `webFrame.insertCSS(css[, options])`
* `css` string
* `options` Object (optional)

View File

@@ -158,6 +158,9 @@ When the guest page doesn't have node integration this script will still have
access to all Node APIs, but global objects injected by Node will be deleted
after this script has finished executing.
**Note:** This option will appear as `preloadURL` (not `preload`) in
the `webPreferences` specified to the `will-attach-webview` event.
### `httpreferrer`
```html

View File

@@ -73,11 +73,6 @@ creating the window. Note that this is more powerful than passing options
through the feature string, as the renderer has more limited privileges in
deciding security preferences than the main process.
In addition to passing in `action` and `overrideBrowserWindowOptions`,
`outlivesOpener` can be passed like: `{ action: 'allow', outlivesOpener: true,
overrideBrowserWindowOptions: { ... } }`. If set to `true`, the newly created
window will not close when the opener window closes. The default value is `false`.
### Native `Window` example
```javascript

View File

@@ -36,10 +36,7 @@ requires unsafe mode), so Electron is unable to support this feature on Linux.
## Planned Breaking API Changes (19.0)
### Removed: IA32 Linux binaries
This is a result of Chromium 102.0.4999.0 dropping support for IA32 Linux.
This concludes the [removal of support for IA32 Linux](#removed-ia32-linux-support).
*None (yet)*
## Planned Breaking API Changes (18.0)
@@ -1206,10 +1203,6 @@ not present, then the native module will fail to load on Windows, with an error
message like `Cannot find module`. See the [native module
guide](/docs/tutorial/using-native-node-modules.md) for more.
### Removed: IA32 Linux support
Electron 18 will no longer run on 32-bit Linux systems. See [discontinuing support for 32-bit Linux](https://www.electronjs.org/blog/linux-32bit-support) for more information.
## Breaking API Changes (3.0)
The following list includes the breaking API changes in Electron 3.0.

View File

@@ -196,12 +196,12 @@ If you test other combinations and find them to work, please update this documen
See the GN reference for allowable values of [`target_os`][target_os values]
and [`target_cpu`][target_cpu values].
[target_os values]: https://gn.googlesource.com/gn/+/main/docs/reference.md#built_in-predefined-variables-target_os_the-desired-operating-system-for-the-build-possible-values
[target_cpu values]: https://gn.googlesource.com/gn/+/main/docs/reference.md#built_in-predefined-variables-target_cpu_the-desired-cpu-architecture-for-the-build-possible-values
[target_os values]: https://gn.googlesource.com/gn/+/master/docs/reference.md#built_in-predefined-variables-target_os_the-desired-operating-system-for-the-build-possible-values
[target_cpu values]: https://gn.googlesource.com/gn/+/master/docs/reference.md#built_in-predefined-variables-target_cpu_the-desired-cpu-architecture-for-the-build-possible-values
#### Windows on Arm (experimental)
To cross-compile for Windows on Arm, [follow Chromium's guide](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/windows_build_instructions.md#Visual-Studio) to get the necessary dependencies, SDK and libraries, then build with `ELECTRON_BUILDING_WOA=1` in your environment before running `gclient sync`.
To cross-compile for Windows on Arm, [follow Chromium's guide](https://chromium.googlesource.com/chromium/src/+/refs/heads/master/docs/windows_build_instructions.md#Visual-Studio) to get the necessary dependencies, SDK and libraries, then build with `ELECTRON_BUILDING_WOA=1` in your environment before running `gclient sync`.
```bat
set ELECTRON_BUILDING_WOA=1

View File

@@ -82,7 +82,7 @@ $ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
g++-aarch64-linux-gnu
```
And to cross-compile for `arm` or targets, you should pass the
And to cross-compile for `arm` or `ia32` targets, you should pass the
`target_cpu` parameter to `gn gen`:
```sh

View File

@@ -9,12 +9,14 @@ Follow the guidelines below for building **Electron itself** on Windows, for the
* Windows 10 / Server 2012 R2 or higher
* Visual Studio 2017 15.7.2 or higher - [download VS 2019 Community Edition for
free](https://www.visualstudio.com/vs/)
* See [the Chromium build documentation](https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md#visual-studio) for more details on which Visual Studio
* See [the Chromium build documentation](https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio) for more details on which Visual Studio
components are required.
* If your Visual Studio is installed in a directory other than the default, you'll need to
set a few environment variables to point the toolchains to your installation path.
* `vs2019_install = DRIVE:\path\to\Microsoft Visual Studio\2019\Community`, replacing `2019` and `Community` with your installed versions and replacing `DRIVE:` with the drive that Visual Studio is on. Often, this will be `C:`.
* `WINDOWSSDKDIR = DRIVE:\path\to\Windows Kits\10`, replacing `DRIVE:` with the drive that Windows Kits is on. Often, this will be `C:`.
* [Python for Windows (pywin32) Extensions](https://pypi.org/project/pywin32/#files)
is also needed in order to run the build process.
* [Node.js](https://nodejs.org/download/)
* [Git](https://git-scm.com)
* Debugging Tools for Windows of Windows SDK 10.0.15063.468 if you plan on

View File

@@ -24,7 +24,7 @@ contribute:
## Asking for General Help
[The Electron website](https://electronjs.org/community) has a
["Finding Support"](../tutorial/support.md#finding-support) has a
list of resources for getting programming help, reporting security issues,
contributing, and more. Please use the issue tracker for bugs only!

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<div>
<h1>Asynchronous messages</h1>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
<div>
<div>
<button id="async-msg">Ping</button>
<span id="async-reply"></span>
</div>
<p>Using <code>ipc</code> to send messages between processes asynchronously is the preferred method since it will return when finished without blocking other operations in the same process.</p>
<p>This example sends a "ping" from this process (renderer) to the main process. The main process then replies with "pong".</p>
</div>
</div>
</div>
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>

View File

@@ -0,0 +1,29 @@
const { app, BrowserWindow, ipcMain } = require('electron')
let mainWindow = null
function createWindow () {
const windowOptions = {
width: 600,
height: 400,
title: 'Asynchronous messages',
webPreferences: {
nodeIntegration: true
}
}
mainWindow = new BrowserWindow(windowOptions)
mainWindow.loadFile('index.html')
mainWindow.on('closed', () => {
mainWindow = null
})
}
app.whenReady().then(() => {
createWindow()
})
ipcMain.on('asynchronous-message', (event, arg) => {
event.sender.send('asynchronous-reply', 'pong')
})

View File

@@ -0,0 +1,12 @@
const { ipcRenderer } = require('electron')
const asyncMsgBtn = document.getElementById('async-msg')
asyncMsgBtn.addEventListener('click', () => {
ipcRenderer.send('asynchronous-message', 'ping')
})
ipcRenderer.on('asynchronous-reply', (event, arg) => {
const message = `Asynchronous message reply: ${arg}`
document.getElementById('async-reply').innerHTML = message
})

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<div>
<h1>Synchronous messages</h1>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
<div>
<div>
<button id="sync-msg">Ping</button>
<span id="sync-reply"></span>
</div>
<p>You can use the <code>ipc</code> module to send synchronous messages between processes as well, but note that the synchronous nature of this method means that it <b>will block</b> other operations while completing its task.</p>
<p>This example sends a synchronous message, "ping", from this process (renderer) to the main process. The main process then replies with "pong".</p>
</div>
</div>
</div>
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>

View File

@@ -0,0 +1,29 @@
const { app, BrowserWindow, ipcMain } = require('electron')
let mainWindow = null
function createWindow () {
const windowOptions = {
width: 600,
height: 400,
title: 'Synchronous Messages',
webPreferences: {
nodeIntegration: true
}
}
mainWindow = new BrowserWindow(windowOptions)
mainWindow.loadFile('index.html')
mainWindow.on('closed', () => {
mainWindow = null
})
}
app.whenReady().then(() => {
createWindow()
})
ipcMain.on('synchronous-message', (event, arg) => {
event.returnValue = 'pong'
})

View File

@@ -0,0 +1,9 @@
const { ipcRenderer } = require('electron')
const syncMsgBtn = document.getElementById('sync-msg')
syncMsgBtn.addEventListener('click', () => {
const reply = ipcRenderer.sendSync('synchronous-message', 'ping')
const message = `Synchronous message reply: ${reply}`
document.getElementById('sync-reply').innerHTML = message
})

View File

@@ -91,7 +91,7 @@ An IPC system for communicating intra- or inter-process, and that's important
because Chrome is keen on being able to split its work into separate processes
or not, depending on memory pressures etc.
See https://chromium.googlesource.com/chromium/src/+/main/mojo/README.md
See https://chromium.googlesource.com/chromium/src/+/master/mojo/README.md
See also: [IPC](#ipc)

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" standalone="yes"?>
<svg width="520" height="220" version="1.1" xmlns="http://www.w3.org/2000/svg">
<marker id="arrow" viewBox="-1 0 12 10" refX="10.5" refY="5" markerWidth="8" markerHeight="8" orient="auto">
<path d="M 0 0 L 10 5 L 0 10"/>
</marker>
<g transform="translate(0,40)">
<!-- master -->
<text x="60" y="30" text-anchor="end" alignment-baseline="middle">master</text>
<path d="M70 30 H 500" stroke-width="2" stroke="black"/>
<!-- v2.0 -->
<g>
<path d="M100 30 l 20 30 H 200" stroke-width="2" stroke="black" fill="transparent"/>
<text x="110" y="60" text-anchor="end" alignment-baseline="middle">2.0</text>
<circle cx="120" cy="60" r="5"/>
<text x="110" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 120,60)">v2.0.0-beta0</text>
<circle cx="200" cy="60" r="5"/>
<text x="190" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 200,60)">v2.0.0</text>
</g>
<!-- v2.1 -->
<g transform="translate(130,0)">
<path d="M100 30 l 20 30 H 200" stroke-width="2" stroke="black" fill="transparent"/>
<text x="110" y="60" text-anchor="end" alignment-baseline="middle">2.1</text>
<circle cx="120" cy="60" r="5"/>
<text x="110" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 120,60)">v2.1.0-beta0</text>
<circle cx="160" cy="60" r="5"/>
<text x="150" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 160,60)">v2.1.0-beta1</text>
<circle cx="200" cy="60" r="5"/>
<text x="190" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 200,60)">v2.1.0</text>
</g>
<!-- v3.0 -->
<g transform="translate(260,0)">
<path d="M100 30 l 20 30 H 200" stroke-width="2" stroke="black" fill="transparent"/>
<text x="110" y="60" text-anchor="end" alignment-baseline="middle">3.0</text>
<circle cx="120" cy="60" r="5"/>
<text x="110" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 120,60)">v3.0.0-beta0</text>
<circle cx="200" cy="60" r="5"/>
<text x="190" y="60" text-anchor="end" alignment-baseline="middle" transform="rotate(-60 200,60)">v3.0.0</text>
</g>
<!-- Bug fixes -->
<g transform="translate(160,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">bug fix</text>
<path d="M0 0 l0,30" marker-end="url(#arrow)" stroke-dasharray="2,2" stroke="#000"/>
</g>
<g transform="translate(260,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">bug fix</text>
<path d="M0 0 l0,30" marker-end="url(#arrow)" stroke-dasharray="2,2" stroke="#000"/>
</g>
<g transform="translate(280,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">bug fix</text>
<path d="M0 0 l0,30" marker-end="url(#arrow)" stroke-dasharray="2,2" stroke="#000"/>
</g>
<g transform="translate(400,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">bug fix</text>
<path d="M0 0 l0,30" marker-end="url(#arrow)" stroke-dasharray="2,2" stroke="#000"/>
</g>
<g transform="translate(430,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">bug fix</text>
<path d="M0 0 l0,30" marker-end="url(#arrow)" stroke-dasharray="2,2" stroke="#000"/>
</g>
<!-- Features -->
<g transform="translate(130,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">feature</text>
</g>
<g transform="translate(200,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">feature</text>
</g>
<g transform="translate(340,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)">feature</text>
</g>
<!-- Chromium update -->
<g transform="translate(310,30)">
<circle cx="0" cy="0" r="3"/>
<text x="10" y="0" text-anchor="start" alignment-baseline="middle" transform="rotate(-60 0,0)"><tspan>chromium</tspan><tspan dy="10" x="10">update</tspan></text>
</g>
<!-- Timeline -->
<g transform="translate(100,160)">
<text x="50" y="0" text-anchor="middle" alignment-baseline="text-after-edge">~1 week</text>
<path d="M0 0 l0 10 l0 -5 H100l0 -5l0 10" stroke-width="2" stroke="black" fill="transparent"/>
</g>
<g transform="translate(230,160)">
<text x="50" y="0" text-anchor="middle" alignment-baseline="text-after-edge">~1 week</text>
<path d="M0 0 l0 10 l0 -5 H100l0 -5l0 10" stroke-width="2" stroke="black" fill="transparent"/>
</g>
<g transform="translate(360,160)">
<text x="50" y="0" text-anchor="middle" alignment-baseline="text-after-edge">~1 week</text>
<path d="M0 0 l0 10 l0 -5 H100l0 -5l0 10" stroke-width="2" stroke="black" fill="transparent"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -1,101 +1,30 @@
# Electron Releases
# Electron Release Timelines
Electron frequently releases major versions alongside every other Chromium release.
This document focuses on the release cadence and version support policy.
For a more in-depth guide on our git branches and how Electron uses semantic versions,
check out our [Electron Versioning](./electron-versioning.md) doc.
Special notes:
## Timeline
| Electron | Alpha | Beta | Stable | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- |
| 2.0.0 | -- | 2018-Feb-21 | 2018-May-01 | M61 | v8.9 | 🚫 |
| 3.0.0 | -- | 2018-Jun-21 | 2018-Sep-18 | M66 | v10.2 | 🚫 |
| 4.0.0 | -- | 2018-Oct-11 | 2018-Dec-20 | M69 | v10.11 | 🚫 |
| 5.0.0 | -- | 2019-Jan-22 | 2019-Apr-24 | M73 | v12.0 | 🚫 |
| 6.0.0 | -- | 2019-May-01 | 2019-Jul-30 | M76 | v12.4 | 🚫 |
| 7.0.0 | -- | 2019-Aug-01 | 2019-Oct-22 | M78 | v12.8 | 🚫 |
| 8.0.0 | -- | 2019-Oct-24 | 2020-Feb-04 | M80 | v12.13 | 🚫 |
| 9.0.0 | -- | 2020-Feb-06 | 2020-May-19 | M83 | v12.14 | 🚫 |
| 10.0.0 | -- | 2020-May-21 | 2020-Aug-25 | M85 | v12.16 | 🚫 |
| 11.0.0 | -- | 2020-Aug-27 | 2020-Nov-17 | M87 | v12.18 | 🚫 |
| 12.0.0 | -- | 2020-Nov-19 | 2021-Mar-02 | M89 | v14.16 | 🚫 |
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | M91 | v14.16 | 🚫 |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | M93 | v14.17 | 🚫 |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | v16.5 | 🚫 |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | M96 | v16.9 | 🚫 |
| 17.0.0 | 2021-Nov-18 | 2022-Jan-06 | 2022-Feb-01 | M98 | v16.13 | ✅ |
| 18.0.0 | 2022-Feb-03 | 2022-Mar-03 | 2022-Mar-29 | M100 | v16.13 | ✅ |
| 19.0.0 | 2022-Mar-31 | 2022-Apr-26 | 2022-May-24 | M102 | v16.14 | ✅ |
| 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | M104 | TBD | ✅ |
**Notes:**
* The `-alpha.1`, `-beta.1`, and `stable` dates are our solid release dates.
* We strive for weekly alpha/beta releases, but we often release more than scheduled.
* The `-beta.1` and `stable` dates are our solid release dates.
* We strive for weekly beta releases, however we often release more betas than scheduled.
* All dates are our goals but there may be reasons for adjusting the stable deadline, such as security bugs.
* Take a look at the [5.0.0 Timeline blog post](https://electronjs.org/blog/electron-5-0-timeline) for info about publicizing our release dates.
* Since Electron 6.0, we've been targeting every other Chromium version and releasing our stable on the same day as Chrome stable. You can reference Chromium's release schedule [here](https://chromiumdash.appspot.com/schedule). See [Electron's new release cadence blog post](https://www.electronjs.org/blog/12-week-cadence) for more details on our release schedule.
* Starting in Electron 16.0, we will release on an 8-week cadence. See [Electron's new 8-week cadence blog post](https://www.electronjs.org/blog/8-week-cadence) for more details.
**Historical changes:**
* Since Electron 5, Electron has been publicizing its release dates ([see blog post](https://electronjs.org/blog/electron-5-0-timeline)).
* Since Electron 6, Electron major versions have been targeting every other Chromium major version. Each Electron stable should happen on the same day as Chrome stable ([see blog post](https://www.electronjs.org/blog/12-week-cadence)).
* Since Electron 16, Electron has been releasing major versions on an 8-week cadence in accordance to Chrome's change to a 4-week release cadence ([see blog post](https://www.electronjs.org/blog/8-week-cadence)).
:::info Chrome release dates
Chromium has the own public release schedule [here](https://chromiumdash.appspot.com/schedule).
:::
## Version support policy
:::info
Beginning in September 2021 (Electron 15), the Electron team
will temporarily support the latest **four** stable major versions. This
extended support is intended to help Electron developers transition to
the [new 8-week release cadence](https://electronjs.org/blog/8-week-cadence),
and will continue until the release of Electron 19. At that time,
the Electron team will drop support back to the latest three stable major versions.
:::
The latest three *stable* major versions are supported by the Electron team.
For example, if the latest release is 6.1.x, then the 5.0.x as well
as the 4.2.x series are supported. We only support the latest minor release
for each stable release series. This means that in the case of a security fix,
6.1.x will receive the fix, but we will not release a new version of 6.0.x.
The latest stable release unilaterally receives all fixes from `main`,
and the version prior to that receives the vast majority of those fixes
as time and bandwidth warrants. The oldest supported release line will receive
only security fixes directly.
### Breaking API changes
When an API is changed or removed in a way that breaks existing functionality, the
previous functionality will be supported for a minimum of two major versions when
possible before being removed. For example, if a function takes three arguments,
and that number is reduced to two in major version 10, the three-argument version would
continue to work until, at minimum, major version 12. Past the minimum two-version
threshold, we will attempt to support backwards compatibility beyond two versions
until the maintainers feel the maintenance burden is too high to continue doing so.
### End-of-life
When a release branch reaches the end of its support cycle, the series
will be deprecated in NPM and a final end-of-support release will be
made. This release will add a warning to inform that an unsupported
version of Electron is in use.
These steps are to help app developers learn when a branch they're
using becomes unsupported, but without being excessively intrusive
to end users.
If an application has exceptional circumstances and needs to stay
on an unsupported series of Electron, developers can silence the
end-of-support warning by omitting the final release from the app's
`package.json` `devDependencies`. For example, since the 1-6-x series
ended with an end-of-support 1.6.18 release, developers could choose
to stay in the 1-6-x series without warnings with `devDependency` of
`"electron": 1.6.0 - 1.6.17`.
| Electron | Alpha | Beta | Stable | Chrome | Node |
| ------- | ----- | ------- | ------ | ------ | ---- |
| 2.0.0 | -- | 2018-Feb-21 | 2018-May-01 | M61 | v8.9 |
| 3.0.0 | -- | 2018-Jun-21 | 2018-Sep-18 | M66 | v10.2 |
| 4.0.0 | -- | 2018-Oct-11 | 2018-Dec-20 | M69 | v10.11 |
| 5.0.0 | -- | 2019-Jan-22 | 2019-Apr-24 | M73 | v12.0 |
| 6.0.0 | -- | 2019-May-01 | 2019-Jul-30 | M76 | v12.4 |
| 7.0.0 | -- | 2019-Aug-01 | 2019-Oct-22 | M78 | v12.8 |
| 8.0.0 | -- | 2019-Oct-24 | 2020-Feb-04 | M80 | v12.13 |
| 9.0.0 | -- | 2020-Feb-06 | 2020-May-19 | M83 | v12.14 |
| 10.0.0 | -- | 2020-May-21 | 2020-Aug-25 | M85 | v12.16 |
| 11.0.0 | -- | 2020-Aug-27 | 2020-Nov-17 | M87 | v12.18 |
| 12.0.0 | -- | 2020-Nov-19 | 2021-Mar-02 | M89 | v14.16 |
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | M91 | v14.16 |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | M93 | v14.17 |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | v16.5 |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | M96 | v16.9 |
| 17.0.0 | 2021-Nov-18 | 2022-Jan-06 | 2022-Feb-01 | M98 | v16.13 |
| 18.0.0 | 2022-Feb-03 | 2022-Mar-03 | 2022-Mar-29 | M100 | TBD |

View File

@@ -48,7 +48,7 @@ Stabilization branches are branches that run parallel to `main`, taking in only
Since Electron 8, stabilization branches are always **major** version lines, and named against the following template `$MAJOR-x-y` e.g. `8-x-y`. Prior to that we used **minor** version lines and named them as `$MAJOR-$MINOR-x` e.g. `2-0-x`.
We allow for multiple stabilization branches to exist simultaneously, one for each supported version. For more details on which versions are supported, see our [Electron Releases](./electron-timelines.md) doc.
We allow for multiple stabilization branches to exist simultaneously, one for each supported version. For more details on which versions are supported, see our [Electron Release Timelines](./electron-timelines.md) doc.
![Multiple Stability Branches](../images/versioning-sketch-2.png)
@@ -107,15 +107,6 @@ A few examples of how various SemVer ranges will pick up new releases:
![Semvers and Releases](../images/versioning-sketch-7.png)
### Backport request process
All supported release lines will accept external pull requests to backport
fixes previously merged to `main`, though this may be on a case-by-case
basis for some older supported lines. All contested decisions around release
line backports will be resolved by the
[Releases Working Group](https://github.com/electron/governance/tree/main/wg-releases)
as an agenda item at their weekly meeting the week the backport PR is raised.
## Feature flags
Feature flags are a common practice in Chromium, and are well-established in the web-development ecosystem. In the context of Electron, a feature flag or **soft branch** must have the following properties:

View File

@@ -44,14 +44,14 @@ are the different categories and what you can expect on each one:
application.
- **Processes in Electron**: In-depth reference on Electron processes and how to work with them.
- **Best Practices**: Important checklists to keep in mind when developing an Electron app.
- **Examples**: Quick references to add features to your Electron app.
- **How-To Examples**: Quick references to add features to your Electron app.
- **Development**: Miscellaneous development guides.
- **Distribution**: Learn how to distribute your app to end users.
- **Testing and debugging**: How to debug JavaScript, write tests, and other tools used
to create quality Electron applications.
- **References**: Useful links to better understand how the Electron project works
- **Resources**: Useful links to better understand how the Electron project works
and is organized.
- **Contributing**: Compiling Electron and making contributions can be daunting.
- **Contributing to Electron**: Compiling Electron and making contributions can be daunting.
We try to make it easier in this section.
## Getting help
@@ -66,7 +66,6 @@ Are you getting stuck anywhere? Here are a few links to places to look:
<!-- Links -->
[tutorial]: tutorial-1-prerequisites.md
[api documentation]: ../api/app.md
[chromium]: https://www.chromium.org/
[discord]: https://discord.com/invite/APGC3k5yaH

View File

@@ -66,7 +66,7 @@ Your `package.json` file should look something like this:
Then, install the `electron` package into your app's `devDependencies`.
```sh npm2yarn
npm install --save-dev electron
$ npm install --save-dev electron
```
> Note: If you're encountering any issues with installing Electron, please

View File

@@ -157,7 +157,7 @@ versions of Electron, we do not make a guarantee that every fix will be
backported. Your best chance at staying secure is to be on the latest stable
version of Electron.
[sandbox]: https://chromium.googlesource.com/chromium/src/+/main/docs/design/sandbox.md
[sandbox]: https://chromium.googlesource.com/chromium/src/+/master/docs/design/sandbox.md
[issue-28466]: https://github.com/electron/electron/issues/28466
[browser-window]: ../api/browser-window.md
[enable-sandbox]: ../api/app.md#appenablesandbox

View File

@@ -279,12 +279,11 @@ security-conscious developers might want to assume the very opposite.
```js title='main.js (Main Process)'
const { session } = require('electron')
const URL = require('url').URL
session
.fromPartition('some-partition')
.setPermissionRequestHandler((webContents, permission, callback) => {
const parsedUrl = new URL(webContents.getURL())
const url = webContents.getURL()
if (permission === 'notifications') {
// Approves the permissions request
@@ -292,7 +291,7 @@ session
}
// Verify URL
if (parsedUrl.protocol !== 'https:' || parsedUrl.host !== 'example.com') {
if (!url.startsWith('https://example.com/')) {
// Denies the permissions request
return callback(false)
}
@@ -563,6 +562,7 @@ app.on('web-contents-created', (event, contents) => {
contents.on('will-attach-webview', (event, webPreferences, params) => {
// Strip away preload scripts if unused or verify their location is legitimate
delete webPreferences.preload
delete webPreferences.preloadURL
// Disable Node.js integration
webPreferences.nodeIntegration = false
@@ -724,41 +724,6 @@ Migrate your app one major version at a time, while referring to Electron's
[Breaking Changes][breaking-changes] document to see if any code needs to
be updated.
### 17. Validate the `sender` of all IPC messages
You should always validate incoming IPC messages `sender` property to ensure you
aren't performing actions or sending information to untrusted renderers.
#### Why?
All Web Frames can in theory send IPC messages to the main process, including
iframes and child windows in some scenarios. If you have an IPC message that returns
user data to the sender via `event.reply` or performs privileged actions that the renderer
can't natively, you should ensure you aren't listening to third party web frames.
You should be validating the `sender` of **all** IPC messages by default.
#### How?
```js title='main.js (Main Process)'
// Bad
ipcMain.handle('get-secrets', () => {
return getSecrets();
});
// Good
ipcMain.handle('get-secrets', (e) => {
if (!validateSender(e.senderFrame)) return null;
return getSecrets();
});
function validateSender(frame) {
// Value the host of the URL using an actual URL parser and an allowlist
if ((new URL(frame.url)).host === 'electronjs.org') return true;
return false;
}
```
[breaking-changes]: ../breaking-changes.md
[browser-window]: ../api/browser-window.md
[browser-view]: ../api/browser-view.md

View File

@@ -1,5 +1,128 @@
# This doc has moved!
# Electron Support
* For information on supported releases, see the [Electron Releases](./electron-timelines.md) doc.
* For community support on Electron, see the [Community page](https://www.electronjs.org/community).
* For platform support info, see the [README](https://github.com/electron/electron/blob/main/README.md).
## Finding Support
If you have a security concern,
please see the [security document](https://github.com/electron/electron/tree/main/SECURITY.md).
If you're looking for programming help,
for answers to questions,
or to join in discussion with other developers who use Electron,
you can interact with the community in these locations:
* [Electron's Discord server](https://discord.com/invite/APGC3k5yaH) has channels for:
* Getting help
* Ecosystem apps like [Electron Forge](https://github.com/electron-userland/electron-forge) and [Electron Fiddle](https://github.com/electron/fiddle)
* Sharing ideas with other Electron app developers
* And more!
* [`electron`](https://discuss.atom.io/c/electron) category on the Atom forums
* `#electron` channel on [Atom's Slack](https://discuss.atom.io/t/join-us-on-slack/16638?source_topic_id=25406)
* [`electron-ru`](https://telegram.me/electron_ru) *(Russian)*
* [`electron-br`](https://electron-br.slack.com) *(Brazilian Portuguese)*
* [`electron-kr`](https://electron-kr.github.io/electron-kr) *(Korean)*
* [`electron-jp`](https://electron-jp.slack.com) *(Japanese)*
* [`electron-tr`](https://electron-tr.herokuapp.com) *(Turkish)*
* [`electron-id`](https://electron-id.slack.com) *(Indonesia)*
* [`electron-pl`](https://electronpl.github.io) *(Poland)*
If you'd like to contribute to Electron,
see the [contributing document](https://github.com/electron/electron/blob/main/CONTRIBUTING.md).
If you've found a bug in a [supported version](#supported-versions) of Electron,
please report it with the [issue tracker](../development/issues.md).
[awesome-electron](https://github.com/sindresorhus/awesome-electron)
is a community-maintained list of useful example apps,
tools and resources.
## Supported Versions
_**Note:** Beginning in September 2021 with Electron 15, the Electron team
will temporarily support the latest **four** stable major versions. This
extended support is intended to help Electron developers transition to
the [new eight week release cadence](https://electronjs.org/blog/8-week-cadence), and will continue until May 2022, with
the release of Electron 19. At that time, the Electron team will drop support
back to the latest three stable major versions._
The latest three *stable* major versions are supported by the Electron team.
For example, if the latest release is 6.1.x, then the 5.0.x as well
as the 4.2.x series are supported. We only support the latest minor release
for each stable release series. This means that in the case of a security fix
6.1.x will receive the fix, but we will not release a new version of 6.0.x.
The latest stable release unilaterally receives all fixes from `main`,
and the version prior to that receives the vast majority of those fixes
as time and bandwidth warrants. The oldest supported release line will receive
only security fixes directly.
All supported release lines will accept external pull requests to backport
fixes previously merged to `main`, though this may be on a case-by-case
basis for some older supported lines. All contested decisions around release
line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/main/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised.
When an API is changed or removed in a way that breaks existing functionality, the
previous functionality will be supported for a minimum of two major versions when
possible before being removed. For example, if a function takes three arguments,
and that number is reduced to two in major version 10, the three-argument version would
continue to work until, at minimum, major version 12. Past the minimum two-version
threshold, we will attempt to support backwards compatibility beyond two versions
until the maintainers feel the maintenance burden is too high to continue doing so.
### Currently supported versions
* 18.x.y
* 17.x.y
* 16.x.y
* 15.x.y
### End-of-life
When a release branch reaches the end of its support cycle, the series
will be deprecated in NPM and a final end-of-support release will be
made. This release will add a warning to inform that an unsupported
version of Electron is in use.
These steps are to help app developers learn when a branch they're
using becomes unsupported, but without being excessively intrusive
to end users.
If an application has exceptional circumstances and needs to stay
on an unsupported series of Electron, developers can silence the
end-of-support warning by omitting the final release from the app's
`package.json` `devDependencies`. For example, since the 1-6-x series
ended with an end-of-support 1.6.18 release, developers could choose
to stay in the 1-6-x series without warnings with `devDependency` of
`"electron": 1.6.0 - 1.6.17`.
## Supported Platforms
Following platforms are supported by Electron:
### macOS
Only 64bit binaries are provided for macOS, and the minimum macOS version
supported is macOS 10.11 (El Capitan).
Native support for Apple Silicon (`arm64`) devices was added in Electron 11.0.0.
### Windows
Windows 7 and later are supported, older operating systems are not supported
(and do not work).
Both `ia32` (`x86`) and `x64` (`amd64`) binaries are provided for Windows.
[Native support for Windows on Arm (`arm64`) devices was added in Electron 6.0.8.](windows-arm.md).
Running apps packaged with previous versions is possible using the ia32 binary.
### Linux
The prebuilt binaries of Electron are built on Ubuntu 18.04.
Whether the prebuilt binary can run on a distribution depends on whether the
distribution includes the libraries that Electron is linked to on the building
platform, so only Ubuntu 18.04 is guaranteed to work, but following platforms
are also verified to be able to run the prebuilt binaries of Electron:
* Ubuntu 14.04 and newer
* Fedora 24 and newer
* Debian 8 and newer

View File

@@ -350,7 +350,7 @@ app.whenReady().then(() => {
## Optional: Debugging from VS Code
If you want to debug your application using VS Code, you need to attach VS Code to
If you want to debug your application using VS Code, you have need attach VS Code to
both the main and renderer processes. Here is a sample configuration for you to
run. Create a launch.json configuration in a new `.vscode` folder in your project:

View File

@@ -65,6 +65,7 @@ template("electron_extra_paks") {
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
"$target_gen_dir/electron_resources.pak",
]
deps = [
@@ -200,7 +201,7 @@ template("electron_paks") {
output_dir = "${invoker.output_dir}/locales"
if (is_mac) {
output_locales = locales_as_apple_outputs
output_locales = locales_as_mac_outputs
} else {
output_locales = platform_pak_locales
}

View File

@@ -24,9 +24,6 @@
<message name="IDS_DEFAULT_PRINT_DOCUMENT_TITLE" desc="Default title for a print document">
Untitled Document
</message>
<message name="IDS_UTILITY_PROCESS_PRINT_BACKEND_SERVICE_NAME" desc="The name of the utility process used for backend interactions with printer drivers.">
Print Backend Service
</message>
<!-- Desktop Capturer API -->
<message name="IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there is only one monitor.">

View File

@@ -86,8 +86,6 @@ filenames = {
"shell/browser/ui/message_box_win.cc",
"shell/browser/ui/tray_icon_win.cc",
"shell/browser/ui/views/electron_views_delegate_win.cc",
"shell/browser/ui/views/win_icon_painter.cc",
"shell/browser/ui/views/win_icon_painter.h",
"shell/browser/ui/views/win_frame_view.cc",
"shell/browser/ui/views/win_frame_view.h",
"shell/browser/ui/views/win_caption_button.cc",

View File

@@ -7,16 +7,11 @@ hunspell_dictionaries = [
"//third_party/hunspell_dictionaries/da-DK-3-0.bdic",
"//third_party/hunspell_dictionaries/de-DE-3-0.bdic",
"//third_party/hunspell_dictionaries/el-GR-3-0.bdic",
"//third_party/hunspell_dictionaries/en-AU-10-0.bdic",
"//third_party/hunspell_dictionaries/en-AU-10-1.bdic",
"//third_party/hunspell_dictionaries/en-CA-10-0.bdic",
"//third_party/hunspell_dictionaries/en-CA-10-1.bdic",
"//third_party/hunspell_dictionaries/en-GB-10-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-10-1.bdic",
"//third_party/hunspell_dictionaries/en-GB-oxendict-10-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-oxendict-10-1.bdic",
"//third_party/hunspell_dictionaries/en-US-10-0.bdic",
"//third_party/hunspell_dictionaries/en-US-10-1.bdic",
"//third_party/hunspell_dictionaries/en-AU-9-0.bdic",
"//third_party/hunspell_dictionaries/en-CA-9-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-9-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-oxendict-9-0.bdic",
"//third_party/hunspell_dictionaries/en-US-9-0.bdic",
"//third_party/hunspell_dictionaries/es-ES-3-0.bdic",
"//third_party/hunspell_dictionaries/et-EE-3-0.bdic",
"//third_party/hunspell_dictionaries/fa-IR-9-0.bdic",
@@ -51,7 +46,6 @@ hunspell_dictionaries = [
"//third_party/hunspell_dictionaries/tg-TG-5-0.bdic",
"//third_party/hunspell_dictionaries/tr-TR-4-0.bdic",
"//third_party/hunspell_dictionaries/uk-UA-4-0.bdic",
"//third_party/hunspell_dictionaries/uk-UA-5-0.bdic",
"//third_party/hunspell_dictionaries/vi-VN-3-0.bdic",
"//third_party/hunspell_dictionaries/xx-XX-3-0.bdic",
]

View File

@@ -1,5 +1,4 @@
libcxxabi_headers = [
"//buildtools/third_party/libc++abi/trunk/include/CMakeLists.txt",
"//buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h",
"//buildtools/third_party/libc++abi/trunk/include/cxxabi.h",
]

View File

@@ -1,6 +1,6 @@
import * as fs from 'fs';
import { Menu, deprecate } from 'electron/main';
import { Menu } from 'electron/main';
const bindings = process._linkedBinding('electron_browser_app');
const commandLine = process._linkedBinding('electron_common_command_line');
@@ -111,7 +111,3 @@ for (const name of events) {
webContents.emit(name, event, ...args);
});
}
// Deprecation.
deprecate.event(app, 'gpu-process-crashed', 'child-process-gone');
deprecate.event(app, 'renderer-process-crashed', 'render-process-gone');

View File

@@ -198,7 +198,7 @@ class ChunkedBodyStream extends Writable {
this._downstream = pipe;
if (this._pendingChunk) {
const doneWriting = (maybeError: Error | void) => {
// If the underlying request has been aborted, we honestly don't care about the error
// If the underlying request has been aborted, we honeslty don't care about the error
// all work should cease as soon as we abort anyway, this error is probably a
// "mojo pipe disconnected" error (code=9)
if (this._clientRequest._aborted) return;

View File

@@ -492,17 +492,13 @@ WebContents.prototype.loadURL = function (url, options) {
return p;
};
WebContents.prototype.setWindowOpenHandler = function (handler: (details: Electron.HandlerDetails) => ({action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions, outlivesOpener?: boolean})) {
WebContents.prototype.setWindowOpenHandler = function (handler: (details: Electron.HandlerDetails) => ({action: 'allow'} | {action: 'deny', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions})) {
this._windowOpenHandler = handler;
};
WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event, details: Electron.HandlerDetails): {browserWindowConstructorOptions: BrowserWindowConstructorOptions | null, outlivesOpener: boolean} {
const defaultResponse = {
browserWindowConstructorOptions: null,
outlivesOpener: false
};
WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event, details: Electron.HandlerDetails): BrowserWindowConstructorOptions | null {
if (!this._windowOpenHandler) {
return defaultResponse;
return null;
}
const response = this._windowOpenHandler(details);
@@ -510,34 +506,28 @@ WebContents.prototype._callWindowOpenHandler = function (event: Electron.Event,
if (typeof response !== 'object') {
event.preventDefault();
console.error(`The window open handler response must be an object, but was instead of type '${typeof response}'.`);
return defaultResponse;
return null;
}
if (response === null) {
event.preventDefault();
console.error('The window open handler response must be an object, but was instead null.');
return defaultResponse;
return null;
}
if (response.action === 'deny') {
event.preventDefault();
return defaultResponse;
return null;
} else if (response.action === 'allow') {
if (typeof response.overrideBrowserWindowOptions === 'object' && response.overrideBrowserWindowOptions !== null) {
return {
browserWindowConstructorOptions: response.overrideBrowserWindowOptions,
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false
};
return response.overrideBrowserWindowOptions;
} else {
return {
browserWindowConstructorOptions: {},
outlivesOpener: typeof response.outlivesOpener === 'boolean' ? response.outlivesOpener : false
};
return {};
}
} else {
event.preventDefault();
console.error('The window open handler response must be an object with an \'action\' property of \'allow\' or \'deny\'.');
return defaultResponse;
return null;
}
};
@@ -572,7 +562,7 @@ const loggingEnabled = () => {
// Add JavaScript wrappers for WebContents class.
WebContents.prototype._init = function () {
const prefs = this.getLastWebPreferences() || {};
if (!prefs.nodeIntegration && prefs.preload != null && prefs.sandbox == null) {
if (!prefs.nodeIntegration && (prefs.preload != null || prefs.preloadURL != null) && prefs.sandbox == null) {
deprecate.log('The default sandbox option for windows without nodeIntegration is changing. Presently, by default, when a window has a preload script, it defaults to being unsandboxed. In Electron 20, this default will be changing, and all windows that have nodeIntegration: false (which is the default) will be sandboxed by default. If your preload script doesn\'t use Node, no action is needed. If your preload script does use Node, either refactor it to move Node usage to the main process, or specify sandbox: false in your WebPreferences.');
}
// Read off the ID at construction time, so that it's accessible even after
@@ -668,15 +658,14 @@ WebContents.prototype._init = function () {
disposition
};
let result: ReturnType<typeof this._callWindowOpenHandler>;
let options: ReturnType<typeof this._callWindowOpenHandler>;
try {
result = this._callWindowOpenHandler(event, details);
options = this._callWindowOpenHandler(event, details);
} catch (err) {
event.preventDefault();
throw err;
}
const options = result.browserWindowConstructorOptions;
if (!event.defaultPrevented) {
openGuestWindow({
event,
@@ -685,14 +674,12 @@ WebContents.prototype._init = function () {
referrer,
postData,
overrideBrowserWindowOptions: options || {},
windowOpenArgs: details,
outlivesOpener: result.outlivesOpener
windowOpenArgs: details
});
}
});
let windowOpenOverriddenOptions: BrowserWindowConstructorOptions | null = null;
let windowOpenOutlivesOpenerOption: boolean = false;
this.on('-will-add-new-contents' as any, (event: ElectronInternal.Event, url: string, frameName: string, rawFeatures: string, disposition: Electron.HandlerDetails['disposition'], referrer: Electron.Referrer, postData: PostData) => {
const postBody = postData ? {
data: postData,
@@ -715,8 +702,7 @@ WebContents.prototype._init = function () {
throw err;
}
windowOpenOutlivesOpenerOption = result.outlivesOpener;
windowOpenOverriddenOptions = result.browserWindowConstructorOptions;
windowOpenOverriddenOptions = result;
if (!event.defaultPrevented) {
const secureOverrideWebPreferences = windowOpenOverriddenOptions ? {
// Allow setting of backgroundColor as a webPreference even though
@@ -747,10 +733,7 @@ WebContents.prototype._init = function () {
_userGesture: boolean, _left: number, _top: number, _width: number, _height: number, url: string, frameName: string,
referrer: Electron.Referrer, rawFeatures: string, postData: PostData) => {
const overriddenOptions = windowOpenOverriddenOptions || undefined;
const outlivesOpener = windowOpenOutlivesOpenerOption;
windowOpenOverriddenOptions = null;
// false is the default
windowOpenOutlivesOpenerOption = false;
if ((disposition !== 'foreground-tab' && disposition !== 'new-window' &&
disposition !== 'background-tab')) {
@@ -770,8 +753,7 @@ WebContents.prototype._init = function () {
url,
frameName,
features: rawFeatures
},
outlivesOpener
}
});
});
}

View File

@@ -15,7 +15,6 @@ interface GuestInstance {
const webViewManager = process._linkedBinding('electron_browser_web_view_manager');
const eventBinding = process._linkedBinding('electron_browser_event');
const netBinding = process._linkedBinding('electron_browser_net');
const supportedWebViewEvents = Object.keys(webViewEvents);
@@ -50,7 +49,7 @@ function makeWebPreferences (embedder: Electron.WebContents, params: Record<stri
};
if (params.preload) {
webPreferences.preload = netBinding.fileURLToFilePath(params.preload);
webPreferences.preloadURL = params.preload;
}
// Security options that guest will always inherit from embedder

View File

@@ -29,7 +29,7 @@ const getGuestWindowByFrameName = (name: string) => frameNamesToWindow.get(name)
* user to preventDefault() on the passed event (which ends up calling
* DestroyWebContents).
*/
export function openGuestWindow ({ event, embedder, guest, referrer, disposition, postData, overrideBrowserWindowOptions, windowOpenArgs, outlivesOpener }: {
export function openGuestWindow ({ event, embedder, guest, referrer, disposition, postData, overrideBrowserWindowOptions, windowOpenArgs }: {
event: { sender: WebContents, defaultPrevented: boolean },
embedder: WebContents,
guest?: WebContents,
@@ -38,7 +38,6 @@ export function openGuestWindow ({ event, embedder, guest, referrer, disposition
postData?: PostData,
overrideBrowserWindowOptions?: BrowserWindowConstructorOptions,
windowOpenArgs: WindowOpenArgs,
outlivesOpener: boolean,
}): BrowserWindow | undefined {
const { url, frameName, features } = windowOpenArgs;
const { options: browserWindowOptions } = makeBrowserWindowOptions({
@@ -91,7 +90,7 @@ export function openGuestWindow ({ event, embedder, guest, referrer, disposition
});
}
handleWindowLifecycleEvents({ embedder, frameName, guest: window, outlivesOpener });
handleWindowLifecycleEvents({ embedder, frameName, guest: window });
embedder.emit('did-create-window', window, { url, frameName, options: browserWindowOptions, disposition, referrer, postData });
@@ -104,11 +103,10 @@ export function openGuestWindow ({ event, embedder, guest, referrer, disposition
* too is the guest destroyed; this is Electron convention and isn't based in
* browser behavior.
*/
const handleWindowLifecycleEvents = function ({ embedder, guest, frameName, outlivesOpener }: {
const handleWindowLifecycleEvents = function ({ embedder, guest, frameName }: {
embedder: WebContents,
guest: BrowserWindow,
frameName: string,
outlivesOpener: boolean
frameName: string
}) {
const closedByEmbedder = function () {
guest.removeListener('closed', closedByUser);
@@ -116,14 +114,9 @@ const handleWindowLifecycleEvents = function ({ embedder, guest, frameName, outl
};
const closedByUser = function () {
// Embedder might have been closed
if (!embedder.isDestroyed() && !outlivesOpener) {
embedder.removeListener('current-render-view-deleted' as any, closedByEmbedder);
}
embedder.removeListener('current-render-view-deleted' as any, closedByEmbedder);
};
if (!outlivesOpener) {
embedder.once('current-render-view-deleted' as any, closedByEmbedder);
}
embedder.once('current-render-view-deleted' as any, closedByEmbedder);
guest.once('closed', closedByUser);
if (frameName) {
@@ -183,8 +176,7 @@ function emitDeprecatedNewWindowEvent ({ event, embedder, guest, windowOpenArgs,
handleWindowLifecycleEvents({
embedder: event.sender,
guest: newGuest,
frameName,
outlivesOpener: false
frameName
});
}
return true;

View File

@@ -8,7 +8,7 @@
"postinstall": "node install.js"
},
"dependencies": {
"@electron/get": "^1.14.1",
"@electron/get": "^1.13.0",
"@types/node": "^16.11.26",
"extract-zip": "^1.0.3"
},

View File

@@ -1,11 +1,11 @@
{
"name": "electron",
"version": "19.0.16",
"version": "18.3.10",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@azure/storage-blob": "^12.9.0",
"@electron/docs-parser": "^0.12.4",
"@electron/docs-parser": "^0.12.3",
"@electron/typescript-definitions": "^8.9.5",
"@octokit/auth-app": "^2.10.0",
"@octokit/rest": "^18.0.3",
@@ -54,7 +54,7 @@
"lint-staged": "^10.2.11",
"markdownlint": "^0.21.1",
"markdownlint-cli": "^0.25.0",
"minimist": "^1.2.6",
"minimist": "^1.2.5",
"null-loader": "^4.0.0",
"pre-flight": "^1.1.0",
"remark-cli": "^10.0.0",
@@ -77,7 +77,7 @@
"scripts": {
"asar": "asar",
"generate-version-json": "node script/generate-version-json.js",
"lint": "node ./script/lint.js && npm run lint:docs",
"lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs",
"lint:js": "node ./script/lint.js --js",
"lint:clang-format": "python3 script/run-clang-format.py -r -c shell/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
"lint:clang-tidy": "ts-node ./script/run-clang-tidy.ts",
@@ -94,7 +94,6 @@
"gn-typescript-definitions": "npm run create-typescript-definitions && shx cp electron.d.ts",
"pre-flight": "pre-flight",
"gn-check": "node ./script/gn-check.js",
"gn-format": "python3 script/run-gn-format.py",
"precommit": "lint-staged",
"preinstall": "node -e 'process.exit(0)'",
"prepack": "check-for-leaks",
@@ -125,7 +124,7 @@
],
"*.{gn,gni}": [
"npm run gn-check",
"npm run gn-format"
"python3 script/run-gn-format.py"
],
"*.py": [
"node script/lint.js --py --fix --only --"

View File

@@ -1,2 +1,4 @@
m104_vulkan_fix_garbage_collection_vs_outside-rp-only_flush.patch
m104_vulkan_fix_xfb_buffer_redefine_to_smaller_size.patch
cherry-pick-9768648fffc9.patch
cherry-pick-801b904aea7d.patch
cherry-pick-03aa5ae75c29.patch
cherry-pick-6661eb4900da.patch

View File

@@ -0,0 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Geoff Lang <geofflang@google.com>
Date: Wed, 1 Jun 2022 11:22:42 -0400
Subject: M102: Ignore eglBind/ReleaseTexImage calls for lost contexts.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
eglBindTexImage and eglReleaseTexImage no-op when no context is
current. Extend this to lost contexts to match the behaviour of making
a GL call on a lost context.
This avoids potential unexpected bad accesses in the backends.
Bug: chromium:1316578
Change-Id: I7b309c297e0c803019720733dee2950abb4c4b5f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3683869
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Alexis Hétu <sugoi@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
(cherry picked from commit bfab7e60a15dc6f72e34406d3f2a3996cd8d0be2)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691180
diff --git a/src/libANGLE/validationEGL.cpp b/src/libANGLE/validationEGL.cpp
index 7e4b3adb8db7ea32c98228155e0a702796f0da4c..4309fd84e74fbb4a21edfb9b90bfc1fcda5a9d4a 100644
--- a/src/libANGLE/validationEGL.cpp
+++ b/src/libANGLE/validationEGL.cpp
@@ -4863,7 +4863,7 @@ bool ValidateBindTexImage(const ValidationContext *val,
}
gl::Context *context = val->eglThread->getContext();
- if (context)
+ if (context && !context->isContextLost())
{
gl::TextureType type = egl_gl::EGLTextureTargetToTextureType(surface->getTextureTarget());
gl::Texture *textureObject = context->getTextureByType(type);
diff --git a/src/libGLESv2/egl_stubs.cpp b/src/libGLESv2/egl_stubs.cpp
index 0554b7f40c65d6a2690380fe7483818886e20533..645f53ba038e3a5ad580eead0d9135cd274c57f8 100644
--- a/src/libGLESv2/egl_stubs.cpp
+++ b/src/libGLESv2/egl_stubs.cpp
@@ -61,7 +61,7 @@ EGLBoolean BindTexImage(Thread *thread, Display *display, Surface *eglSurface, E
GetDisplayIfValid(display), EGL_FALSE);
gl::Context *context = thread->getContext();
- if (context)
+ if (context && !context->isContextLost())
{
gl::TextureType type =
egl_gl::EGLTextureTargetToTextureType(eglSurface->getTextureTarget());
@@ -573,15 +573,18 @@ EGLBoolean ReleaseTexImage(Thread *thread, Display *display, Surface *eglSurface
{
ANGLE_EGL_TRY_RETURN(thread, display->prepareForCall(), "eglReleaseTexImage",
GetDisplayIfValid(display), EGL_FALSE);
- gl::Texture *texture = eglSurface->getBoundTexture();
-
- if (texture)
+ gl::Context *context = thread->getContext();
+ if (context && !context->isContextLost())
{
- ANGLE_EGL_TRY_RETURN(thread, eglSurface->releaseTexImage(thread->getContext(), buffer),
- "eglReleaseTexImage", GetSurfaceIfValid(display, eglSurface),
- EGL_FALSE);
- }
+ gl::Texture *texture = eglSurface->getBoundTexture();
+ if (texture)
+ {
+ ANGLE_EGL_TRY_RETURN(thread, eglSurface->releaseTexImage(thread->getContext(), buffer),
+ "eglReleaseTexImage", GetSurfaceIfValid(display, eglSurface),
+ EGL_FALSE);
+ }
+ }
thread->setSuccess();
return EGL_TRUE;
}

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jamie Madill <jmadill@chromium.org>
Date: Mon, 2 May 2022 15:42:23 -0400
Subject: Fix validation cache when deleting a Transform Feedback.
Bug: chromium:1320024
Change-Id: I76ef85a3c65c663c138d8caebd4ef2c0da53cd4f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621780
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
(cherry picked from commit 84e42c3b04da9e2c9d93d35bb6f2b1830fef22f4)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3650697
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 390f7bc6790abe5d84b05f97160966eca46fee05..86da3fd82fff38c911e8678a1f6c415583b38381 100755
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -3075,6 +3075,7 @@ void Context::detachTransformFeedback(TransformFeedbackID transformFeedback)
if (mState.removeTransformFeedbackBinding(this, transformFeedback))
{
bindTransformFeedback(GL_TRANSFORM_FEEDBACK, {0});
+ mStateCache.onActiveTransformFeedbackChange(this);
}
}

View File

@@ -0,0 +1,238 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jamie Madill <jmadill@chromium.org>
Date: Fri, 20 May 2022 10:26:15 -0400
Subject: D3D: Fix race condition with parallel shader compile.
Bug: chromium:1317673
Change-Id: I0fb7c9a66248852e41e8700e80c295393ef941e8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3651153
Reviewed-by: Jie A Chen <jie.a.chen@intel.com>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
(cherry picked from commit 4a20c9143abbf29c649cf643182735e8952089e3)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691050
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index 59fe34fc46a1bfbc7b4be1aad6ad84b6da303b5b..3256357a80d69739661ec1fd32220d3037145875 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -1687,12 +1687,6 @@ class ProgramD3D::GetVertexExecutableTask : public ProgramD3D::GetExecutableTask
angle::Result run() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetVertexExecutableTask::run");
- if (!mProgram->mState.getAttachedShader(gl::ShaderType::Vertex))
- {
- return angle::Result::Continue;
- }
-
- mProgram->updateCachedInputLayoutFromShader();
ANGLE_TRY(mProgram->getVertexExecutableForCachedInputLayout(this, &mExecutable, &mInfoLog));
@@ -2147,6 +2141,11 @@ std::unique_ptr<LinkEvent> ProgramD3D::link(const gl::Context *context,
linkResources(resources);
+ if (mState.getAttachedShader(gl::ShaderType::Vertex))
+ {
+ updateCachedInputLayoutFromShader();
+ }
+
return compileProgramExecutables(context, infoLog);
}
}
diff --git a/src/tests/gl_tests/ParallelShaderCompileTest.cpp b/src/tests/gl_tests/ParallelShaderCompileTest.cpp
index bcd88ef01308759085c8244ad2058efe68686f2b..a98aff540c642617bba366b2e238519942d7e349 100644
--- a/src/tests/gl_tests/ParallelShaderCompileTest.cpp
+++ b/src/tests/gl_tests/ParallelShaderCompileTest.cpp
@@ -58,9 +58,10 @@ class ParallelShaderCompileTest : public ANGLETest
Task(int id) : mID(id) {}
virtual ~Task() {}
- virtual bool compile() = 0;
- virtual bool isCompileCompleted() = 0;
- virtual bool link() = 0;
+ virtual bool compile() = 0;
+ virtual bool isCompileCompleted() = 0;
+ virtual bool link() = 0;
+ virtual void postLink() {}
virtual void runAndVerify(ParallelShaderCompileTest *test) = 0;
bool isLinkCompleted()
@@ -71,7 +72,7 @@ class ParallelShaderCompileTest : public ANGLETest
}
protected:
- std::string insertRandomString(const std::string &source)
+ static std::string InsertRandomString(const std::string &source)
{
RNG rng;
std::ostringstream ostream;
@@ -80,7 +81,7 @@ class ParallelShaderCompileTest : public ANGLETest
return ostream.str();
}
- GLuint CompileShader(GLenum type, const std::string &source)
+ static GLuint CompileShader(GLenum type, const std::string &source)
{
GLuint shader = glCreateShader(type);
@@ -90,7 +91,14 @@ class ParallelShaderCompileTest : public ANGLETest
return shader;
}
- bool checkShader(GLuint shader)
+ static void RecompileShader(GLuint shader, const std::string &source)
+ {
+ const char *sourceArray[1] = {source.c_str()};
+ glShaderSource(shader, 1, sourceArray, nullptr);
+ glCompileShader(shader);
+ }
+
+ static bool CheckShader(GLuint shader)
{
GLint compileResult;
glGetShaderiv(shader, GL_COMPILE_STATUS, &compileResult);
@@ -129,7 +137,7 @@ class ParallelShaderCompileTest : public ANGLETest
TaskRunner() {}
~TaskRunner() {}
- void run(ParallelShaderCompileTest *test)
+ void run(ParallelShaderCompileTest *test, unsigned int pollInterval)
{
std::vector<std::unique_ptr<T>> compileTasks;
@@ -151,6 +159,7 @@ class ParallelShaderCompileTest : public ANGLETest
if (task->isCompileCompleted())
{
bool isLinking = task->link();
+ task->postLink();
ASSERT_TRUE(isLinking);
linkTasks.push_back(std::move(task));
compileTasks.erase(compileTasks.begin() + i);
@@ -158,7 +167,10 @@ class ParallelShaderCompileTest : public ANGLETest
}
++i;
}
- angle::Sleep(kPollInterval);
+ if (pollInterval != 0)
+ {
+ angle::Sleep(pollInterval);
+ }
}
while (!linkTasks.empty())
@@ -173,9 +185,16 @@ class ParallelShaderCompileTest : public ANGLETest
linkTasks.erase(linkTasks.begin() + i);
continue;
}
+ else
+ {
+ task->postLink();
+ }
++i;
}
- angle::Sleep(kPollInterval);
+ if (pollInterval != 0)
+ {
+ angle::Sleep(pollInterval);
+ }
}
}
};
@@ -192,9 +211,9 @@ class ParallelShaderCompileTest : public ANGLETest
bool compile() override
{
mVertexShader =
- CompileShader(GL_VERTEX_SHADER, insertRandomString(essl1_shaders::vs::Simple()));
+ CompileShader(GL_VERTEX_SHADER, InsertRandomString(essl1_shaders::vs::Simple()));
mFragmentShader = CompileShader(GL_FRAGMENT_SHADER,
- insertRandomString(essl1_shaders::fs::UniformColor()));
+ InsertRandomString(essl1_shaders::fs::UniformColor()));
return (mVertexShader != 0 && mFragmentShader != 0);
}
@@ -213,7 +232,7 @@ class ParallelShaderCompileTest : public ANGLETest
bool link() override
{
mProgram = 0;
- if (checkShader(mVertexShader) && checkShader(mFragmentShader))
+ if (CheckShader(mVertexShader) && CheckShader(mFragmentShader))
{
mProgram = glCreateProgram();
glAttachShader(mProgram, mVertexShader);
@@ -244,10 +263,25 @@ class ParallelShaderCompileTest : public ANGLETest
ASSERT_GL_NO_ERROR();
}
+ protected:
+ void recompile()
+ {
+ RecompileShader(mVertexShader, essl1_shaders::vs::Simple());
+ RecompileShader(mFragmentShader, essl1_shaders::fs::UniformColor());
+ }
+
private:
- GLColor mColor;
GLuint mVertexShader;
GLuint mFragmentShader;
+ GLColor mColor;
+ };
+
+ class ClearColorWithDrawRecompile : public ClearColorWithDraw
+ {
+ public:
+ ClearColorWithDrawRecompile(int taskID) : ClearColorWithDraw(taskID) {}
+
+ void postLink() override { recompile(); }
};
class ImageLoadStore : public Task
@@ -268,7 +302,7 @@ void main()
imageStore(uImage_2, ivec2(gl_LocalInvocationID.xy), value);
})";
- mShader = CompileShader(GL_COMPUTE_SHADER, insertRandomString(kCSSource));
+ mShader = CompileShader(GL_COMPUTE_SHADER, InsertRandomString(kCSSource));
return mShader != 0;
}
@@ -282,7 +316,7 @@ void main()
bool link() override
{
mProgram = 0;
- if (checkShader(mShader))
+ if (CheckShader(mShader))
{
mProgram = glCreateProgram();
glAttachShader(mProgram, mShader);
@@ -370,7 +404,18 @@ TEST_P(ParallelShaderCompileTest, LinkAndDrawManyPrograms)
ANGLE_SKIP_TEST_IF(!ensureParallelShaderCompileExtensionAvailable());
TaskRunner<ClearColorWithDraw> runner;
- runner.run(this);
+ runner.run(this, kPollInterval);
+}
+
+// Tests no crash in case that the Shader starts another compile while the Program being attached
+// to is still linking.
+// crbug.com/1317673
+TEST_P(ParallelShaderCompileTest, LinkProgramAndRecompileShader)
+{
+ ANGLE_SKIP_TEST_IF(!ensureParallelShaderCompileExtensionAvailable());
+
+ TaskRunner<ClearColorWithDrawRecompile> runner;
+ runner.run(this, 0);
}
class ParallelShaderCompileTestES31 : public ParallelShaderCompileTest
@@ -389,7 +434,7 @@ TEST_P(ParallelShaderCompileTestES31, LinkAndDispatchManyPrograms)
ANGLE_SKIP_TEST_IF(!ensureParallelShaderCompileExtensionAvailable());
TaskRunner<ImageLoadStore> runner;
- runner.run(this);
+ runner.run(this, kPollInterval);
}
ANGLE_INSTANTIATE_TEST_ES2(ParallelShaderCompileTest);

View File

@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: SeongHwan Park <ggabu423@gmail.com>
Date: Tue, 31 May 2022 02:41:32 +0900
Subject: Fix to invalidate cache when binding Transform Feedback.
Bug: chromium:1330379
Change-Id: I091116286ac511c50f9abcffa4d3cf350be920b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3677115
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
(cherry picked from commit d96cee6685099f6bcc392a4d20d28c8ec484673a)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691799
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 685b235cc5962c4f55f539e387dda8c7edb023bc..390f7bc6790abe5d84b05f97160966eca46fee05 100755
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -1323,6 +1323,7 @@ void Context::bindTransformFeedback(GLenum target, TransformFeedbackID transform
TransformFeedback *transformFeedback =
checkTransformFeedbackAllocation(transformFeedbackHandle);
mState.setTransformFeedbackBinding(this, transformFeedback);
+ mStateCache.onActiveTransformFeedbackChange(this);
}
void Context::bindProgramPipeline(ProgramPipelineID pipelineHandle)

View File

@@ -1,287 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Thu, 4 Aug 2022 12:28:12 -0400
Subject: M104: Vulkan: Fix garbage collection vs outside-RP-only flush
In https://chromium-review.googlesource.com/c/angle/angle/+/3379231, an
optimization was implemented such that the excessive recorded texture
uploads would get flushed early and submitted. This caused a
use-after-free bug in the following situation:
* Draw with pipeline A
* Delete A <--- this puts A in the Context garbage list
* Upload a lot of data
At this point, the flush threshold could pass and the commands recorded
outside of the render pass up to this point would be submitted.
Associated with this submission was the current garbage, including
pipeline A. However, the render pass that uses pipeline A is still not
submitted.
Now if after some time the render pass is still open, but the "completed
commands" are checked (another set of uploads causing another
submission, a query status check, etc), the garbage can be cleaned up.
When the render pass closes next and is submitted, the implementation
attempts to use the pipeline, which is already deleted.
In this change, outside-render-pass-only submissions no longer reference
the current garbage. This has the side effect that the temporary
buffers used for uploading texture data won't be released early. A
future optimization may want to separate the garbage list in ContextVk
to render pass and outside render pass garbage.
Bug: chromium:1337538
Change-Id: Ibfc11f2b0d166b0c325fced725f23d6b9328ff98
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3821371
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp
index 90ecf42b2cc22cee5b74296d7a2f73b77f9a0f2c..41c06dc42810d6c55565686c87adf20367024f05 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -2614,14 +2614,16 @@ void ContextVk::addOverlayUsedBuffersCount(vk::CommandBufferHelperCommon *comman
}
}
-angle::Result ContextVk::submitFrame(const vk::Semaphore *signalSemaphore, Serial *submitSerialOut)
+angle::Result ContextVk::submitFrame(const vk::Semaphore *signalSemaphore,
+ Submit submission,
+ Serial *submitSerialOut)
{
getShareGroupVk()->acquireResourceUseList(
std::move(mOutsideRenderPassCommands->getResourceUseList()));
getShareGroupVk()->acquireResourceUseList(std::move(mResourceUseList));
getShareGroupVk()->acquireResourceUseList(std::move(mRenderPassCommands->getResourceUseList()));
- ANGLE_TRY(submitCommands(signalSemaphore, submitSerialOut));
+ ANGLE_TRY(submitCommands(signalSemaphore, submission, submitSerialOut));
onRenderPassFinished(RenderPassClosureReason::AlreadySpecifiedElsewhere);
return angle::Result::Continue;
@@ -2633,10 +2635,11 @@ angle::Result ContextVk::submitFrameOutsideCommandBufferOnly(Serial *submitSeria
getShareGroupVk()->acquireResourceUseList(
std::move(mOutsideRenderPassCommands->getResourceUseList()));
- return submitCommands(nullptr, submitSerialOut);
+ return submitCommands(nullptr, Submit::OutsideRenderPassCommandsOnly, submitSerialOut);
}
angle::Result ContextVk::submitCommands(const vk::Semaphore *signalSemaphore,
+ Submit submission,
Serial *submitSerialOut)
{
if (mCurrentWindowSurface)
@@ -2655,10 +2658,18 @@ angle::Result ContextVk::submitCommands(const vk::Semaphore *signalSemaphore,
dumpCommandStreamDiagnostics();
}
+ // Clean up garbage only when submitting all commands. Otherwise there may be garbage
+ // associated with commands that are not yet flushed.
+ vk::GarbageList garbage;
+ if (submission == Submit::AllCommands)
+ {
+ garbage = std::move(mCurrentGarbage);
+ }
+
ANGLE_TRY(mRenderer->submitFrame(this, hasProtectedContent(), mContextPriority,
std::move(mWaitSemaphores),
std::move(mWaitSemaphoreStageMasks), signalSemaphore,
- std::move(mCurrentGarbage), &mCommandPools, submitSerialOut));
+ std::move(garbage), &mCommandPools, submitSerialOut));
getShareGroupVk()->releaseResourceUseLists(*submitSerialOut);
// Now that we have processed resourceUseList, some of pending garbage may no longer pending
@@ -6128,7 +6139,7 @@ angle::Result ContextVk::flushAndGetSerial(const vk::Semaphore *signalSemaphore,
mHasInFlightStreamedVertexBuffers.reset();
}
- ANGLE_TRY(submitFrame(signalSemaphore, submitSerialOut));
+ ANGLE_TRY(submitFrame(signalSemaphore, Submit::AllCommands, submitSerialOut));
resetPerFramePerfCounters();
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.h b/src/libANGLE/renderer/vulkan/ContextVk.h
index 6c6a3797c6e9a387abf13442613088bd5f4341ec..8ed00be4eb19fea01bb2ada65d2c05ad1d3284f4 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.h
+++ b/src/libANGLE/renderer/vulkan/ContextVk.h
@@ -1078,9 +1078,19 @@ class ContextVk : public ContextImpl, public vk::Context, public MultisampleText
void writeAtomicCounterBufferDriverUniformOffsets(uint32_t *offsetsOut, size_t offsetsSize);
- angle::Result submitFrame(const vk::Semaphore *signalSemaphore, Serial *submitSerialOut);
+ enum class Submit
+ {
+ OutsideRenderPassCommandsOnly,
+ AllCommands,
+ };
+
+ angle::Result submitFrame(const vk::Semaphore *signalSemaphore,
+ Submit submission,
+ Serial *submitSerialOut);
angle::Result submitFrameOutsideCommandBufferOnly(Serial *submitSerialOut);
- angle::Result submitCommands(const vk::Semaphore *signalSemaphore, Serial *submitSerialOut);
+ angle::Result submitCommands(const vk::Semaphore *signalSemaphore,
+ Submit submission,
+ Serial *submitSerialOut);
angle::Result synchronizeCpuGpuTime();
angle::Result traceGpuEventImpl(vk::OutsideRenderPassCommandBuffer *commandBuffer,
diff --git a/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp b/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
index a5021e3248933815e3ac43cc0477671109befb1e..1a4e35592d0573991cc54136c80a9299714162a4 100644
--- a/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
+++ b/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
@@ -18,6 +18,7 @@
#include "test_utils/gl_raii.h"
#include "util/random_utils.h"
#include "util/shader_utils.h"
+#include "util/test_utils.h"
using namespace angle;
@@ -561,22 +562,21 @@ TEST_P(VulkanPerformanceCounterTest, NewTextureDoesNotBreakRenderPass)
TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotBreakRenderPass)
{
initANGLEFeatures();
- // http://anglebug.com/6354
- size_t kMaxBufferToImageCopySize = 1 << 28;
- uint32_t kNumSubmits = 2;
- uint32_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
- uint32_t expectedSubmitCommandsCount = getPerfCounters().submittedCommands + kNumSubmits;
+ constexpr size_t kMaxBufferToImageCopySize = 1 << 28;
+ constexpr uint32_t kNumSubmits = 2;
+ uint32_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
+ uint32_t expectedSubmitCommandsCount = getPerfCounters().submittedCommands + kNumSubmits;
// Step 1: Set up a simple 2D texture.
GLTexture texture;
- GLsizei texDim = 256;
- uint32_t pixelSizeRGBA = 4;
- uint32_t textureSize = texDim * texDim * pixelSizeRGBA;
- std::vector<GLColor> kInitialData(texDim * texDim, GLColor::green);
+ constexpr GLsizei kTexDim = 256;
+ constexpr uint32_t kPixelSizeRGBA = 4;
+ constexpr uint32_t kTextureSize = kTexDim * kTexDim * kPixelSizeRGBA;
+ std::vector<GLColor> kInitialData(kTexDim * kTexDim, GLColor::green);
glBindTexture(GL_TEXTURE_2D, texture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texDim, texDim, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kTexDim, kTexDim, 0, GL_RGBA, GL_UNSIGNED_BYTE,
kInitialData.data());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -603,13 +603,12 @@ TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotBreakR
// Step 2: Load a new 2D Texture multiple times with the same Program and Framebuffer. The total
// size of the loaded textures must exceed the threshold to submit the outside command buffer.
- auto maxLoadCount =
- static_cast<size_t>((kMaxBufferToImageCopySize / textureSize) * kNumSubmits + 1);
- for (size_t loadCount = 0; loadCount < maxLoadCount; loadCount++)
+ constexpr size_t kMaxLoadCount = kMaxBufferToImageCopySize / kTextureSize * kNumSubmits + 1;
+ for (size_t loadCount = 0; loadCount < kMaxLoadCount; loadCount++)
{
GLTexture newTexture;
glBindTexture(GL_TEXTURE_2D, newTexture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texDim, texDim, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kTexDim, kTexDim, 0, GL_RGBA, GL_UNSIGNED_BYTE,
kInitialData.data());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -623,6 +622,96 @@ TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotBreakR
EXPECT_EQ(getPerfCounters().submittedCommands, expectedSubmitCommandsCount);
}
+// Tests that submitting the outside command buffer due to texture upload size does not result in
+// garbage collection of render pass resources..
+TEST_P(VulkanPerformanceCounterTest, SubmittingOutsideCommandBufferDoesNotCollectRenderPassGarbage)
+{
+ ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_disjoint_timer_query"));
+
+ initANGLEFeatures();
+
+ uint64_t expectedRenderPassCount = getPerfCounters().renderPasses + 1;
+ uint64_t submitCommandsCount = getPerfCounters().vkQueueSubmitCallsTotal;
+
+ // Set up a simple 2D texture.
+ GLTexture texture;
+ constexpr GLsizei kTexDim = 256;
+ std::vector<GLColor> kInitialData(kTexDim * kTexDim, GLColor::green);
+
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kTexDim, kTexDim, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ kInitialData.data());
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ auto quadVerts = GetQuadVertices();
+
+ GLBuffer vertexBuffer;
+ glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
+ glBufferData(GL_ARRAY_BUFFER, quadVerts.size() * sizeof(quadVerts[0]), quadVerts.data(),
+ GL_STATIC_DRAW);
+
+ ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Texture2D(), essl1_shaders::fs::Texture2D());
+ glUseProgram(program);
+
+ GLint posLoc = glGetAttribLocation(program, essl1_shaders::PositionAttrib());
+ ASSERT_NE(-1, posLoc);
+
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
+ glEnableVertexAttribArray(posLoc);
+ ASSERT_GL_NO_ERROR();
+
+ // Issue a timestamp query, just for the sake of using it as a means of knowing when a
+ // submission is finished. In the Vulkan backend, querying the status of the query results in a
+ // check of completed submissions, at which point associated garbage is also destroyed.
+ GLQuery query;
+ glQueryCounterEXT(query, GL_TIMESTAMP_EXT);
+
+ // Issue a draw call, and delete the program
+ glDrawArrays(GL_TRIANGLES, 0, 6);
+ ASSERT_GL_NO_ERROR();
+ program.reset();
+
+ ANGLE_GL_PROGRAM(program2, essl1_shaders::vs::Texture2D(), essl1_shaders::fs::Texture2D());
+ glUseProgram(program2);
+ ASSERT_EQ(posLoc, glGetAttribLocation(program2, essl1_shaders::PositionAttrib()));
+
+ // Issue uploads until there's an implicit submission
+ while (getPerfCounters().vkQueueSubmitCallsTotal == submitCommandsCount)
+ {
+ GLTexture newTexture;
+ glBindTexture(GL_TEXTURE_2D, newTexture);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kTexDim, kTexDim, 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ kInitialData.data());
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glDrawArrays(GL_TRIANGLES, 0, 6);
+ ASSERT_GL_NO_ERROR();
+ }
+
+ ++submitCommandsCount;
+ EXPECT_EQ(getPerfCounters().vkQueueSubmitCallsTotal, submitCommandsCount);
+
+ // Busy wait until the query results are available.
+ GLuint ready = GL_FALSE;
+ while (ready == GL_FALSE)
+ {
+ angle::Sleep(0);
+ glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &ready);
+ }
+
+ // At this point, the render pass should still not be submitted, and the pipeline that is
+ // deleted should still not be garbage collected. Submit the commands and ensure there is no
+ // crash.
+ EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
+ ++submitCommandsCount;
+
+ // Verify counters.
+ EXPECT_EQ(getPerfCounters().renderPasses, expectedRenderPassCount);
+ EXPECT_EQ(getPerfCounters().vkQueueSubmitCallsTotal, submitCommandsCount);
+}
+
// Tests that RGB texture should not break renderpass.
TEST_P(VulkanPerformanceCounterTest, SampleFromRGBTextureDoesNotBreakRenderPass)
{

View File

@@ -1,122 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Tue, 26 Jul 2022 21:07:04 -0400
Subject: M104: Vulkan: Fix xfb buffer redefine to smaller size
In 89e11878b275b15735eaf273ababfa6fd43a2e3d, a use-after-free bug was
fixed where glBufferData redefined a buffer, leading to a change in
storage. This was only tested for the case where the new buffer was
larger than the old buffer.
When the new buffer is smaller however, another issue remains where the
buffer size as cached by the transform feedback object used the old
object's size. This is worked around in this change, with a fix for the
real issue (that the buffer state is updated after calling into the
backend instead of before) coming up.
Bug: chromium:1345042
Change-Id: I7bafd51b6203a419e5ef123da26b9e1eaf079bf1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812556
Reviewed-by: Ian Elliott <ianelliott@google.com>
diff --git a/src/libANGLE/renderer/vulkan/BufferVk.cpp b/src/libANGLE/renderer/vulkan/BufferVk.cpp
index 9c9cee78d890f5cc13d8762aa03de9dcf9c00abf..ceb065822984cf44bd4319fb97cb7e4dd49517b2 100644
--- a/src/libANGLE/renderer/vulkan/BufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/BufferVk.cpp
@@ -798,6 +798,7 @@ angle::Result BufferVk::updateBuffer(ContextVk *contextVk,
}
return angle::Result::Continue;
}
+
angle::Result BufferVk::directUpdate(ContextVk *contextVk,
const uint8_t *data,
size_t size,
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp
index 41c06dc42810d6c55565686c87adf20367024f05..1319bf771339210dcb9a3e0ccd0936112c746582 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -799,7 +799,8 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
DIRTY_BIT_DRIVER_UNIFORMS_BINDING,
DIRTY_BIT_VIEWPORT,
DIRTY_BIT_SCISSOR};
- if (getFeatures().supportsTransformFeedbackExtension.enabled)
+ if (getFeatures().supportsTransformFeedbackExtension.enabled ||
+ getFeatures().emulateTransformFeedback.enabled)
{
mNewGraphicsCommandBufferDirtyBits.set(DIRTY_BIT_TRANSFORM_FEEDBACK_BUFFERS);
}
diff --git a/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp b/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp
index dbaa4eeedbf36c4a3f6cb818b50bdcac856766c2..f785fe5f7c36033163a77a7e29957ebca6edaf79 100644
--- a/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp
+++ b/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp
@@ -362,7 +362,8 @@ void TransformFeedbackVk::onSubjectStateChange(angle::SubjectIndex index,
ASSERT(bufferVk->isBufferValid());
mBufferHelpers[index] = &bufferVk->getBuffer();
mBufferOffsets[index] = binding.getOffset() + mBufferHelpers[index]->getOffset();
- mBufferSizes[index] = gl::GetBoundBufferAvailableSize(binding);
+ mBufferSizes[index] = std::min<VkDeviceSize>(gl::GetBoundBufferAvailableSize(binding),
+ mBufferHelpers[index]->getSize());
mBufferObserverBindings[index].bind(bufferVk);
mXFBBuffersDesc.updateTransformFeedbackBuffer(
diff --git a/src/tests/angle_end2end_tests_expectations.txt b/src/tests/angle_end2end_tests_expectations.txt
index af74f258fb3d901dac8a738ca9be53511963137b..22230db0ecb77f16cb2cc494a74225731401a47d 100644
--- a/src/tests/angle_end2end_tests_expectations.txt
+++ b/src/tests/angle_end2end_tests_expectations.txt
@@ -161,6 +161,7 @@
6738 MAC AMD OPENGL : Texture3DTestES3.PixelUnpackStateTex* = SKIP
1296467 MAC OPENGL : VertexAttributeTestES3.emptyBuffer/* = SKIP
7203 MAC INTEL OPENGL : CopyTextureTest.CopyToMipmap/* = SKIP
+7530 MAC NVIDIA OPENGL : TransformFeedbackTest.RenderOnceChangeXfbBufferRenderAgain/* = SKIP
// BlitFramebufferTest.ScissoredMultisampleStencil failures
3496 MAC INTEL OPENGL : BlitFramebufferTest.ScissoredMultisampleStencil/* = SKIP
diff --git a/src/tests/gl_tests/TransformFeedbackTest.cpp b/src/tests/gl_tests/TransformFeedbackTest.cpp
index a4e4f86157232de46c6e06ee7b5a6dfa2b8a2261..dc944d4249e0a26708d01bd0bde7efc4d68db3e3 100644
--- a/src/tests/gl_tests/TransformFeedbackTest.cpp
+++ b/src/tests/gl_tests/TransformFeedbackTest.cpp
@@ -403,7 +403,6 @@ TEST_P(TransformFeedbackTest, RecordAndDraw)
// Test that transform feedback can cover multiple render passes.
TEST_P(TransformFeedbackTest, SpanMultipleRenderPasses)
{
-
// TODO(anglebug.com/4533) This fails after the upgrade to the 26.20.100.7870 driver.
ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan());
@@ -4105,6 +4104,36 @@ TEST_P(TransformFeedbackTest, ResumingTransformFeedbackAfterDeletebuffer)
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
}
+// Test that redefining the transform feedback buffer and starting a new render pass works.
+TEST_P(TransformFeedbackTest, RenderOnceChangeXfbBufferRenderAgain)
+{
+ std::vector<std::string> tfVaryings;
+ tfVaryings.push_back("gl_Position");
+ ANGLE_GL_PROGRAM_TRANSFORM_FEEDBACK(drawColor, essl3_shaders::vs::Simple(),
+ essl3_shaders::fs::Red(), tfVaryings,
+ GL_INTERLEAVED_ATTRIBS);
+
+ GLBuffer buffer;
+ glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, buffer);
+ glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 10'000'000, nullptr, GL_DYNAMIC_READ);
+
+ glUseProgram(drawColor);
+ glBeginTransformFeedback(GL_TRIANGLES);
+
+ drawQuad(drawColor, essl3_shaders::PositionAttrib(), 0.5f);
+
+ // Break the render pass
+ EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
+
+ // Redefine the transform feedback buffer
+ glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 40, nullptr, GL_DYNAMIC_READ);
+
+ // Start a new render pass
+ drawQuad(drawColor, essl3_shaders::PositionAttrib(), 0.5f);
+
+ glEndTransformFeedback();
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TransformFeedbackTest);
ANGLE_INSTANTIATE_TEST_ES3(TransformFeedbackTest);

View File

@@ -112,28 +112,40 @@ fix_crash_when_saving_edited_pdf_files.patch
port_autofill_colors_to_the_color_pipeline.patch
build_disable_partition_alloc_on_mac.patch
fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch
build_make_libcxx_abi_unstable_false_for_electron.patch
remove_incorrect_width_height_adjustments.patch
introduce_ozoneplatform_electron_can_call_x11_property.patch
make_gtk_getlibgtk_public.patch
build_disable_print_content_analysis.patch
feat_move_firstpartysets_to_content_browser_client.patch
cherry-pick-cf64617c1cc5.patch
cherry-pick-e2b8856012e0.patch
cherry-pick-6b66a45021a0.patch
fix_xkb_keysym_reverse_look_up_for_lacros.patch
custom_protocols_plzserviceworker.patch
pa_support_16kb_pagesize_on_linux_arm64.patch
cherry-pick-f1504440487f.patch
cherry-pick-21139756239b.patch
cherry-pick-2782c7bc5bbe.patch
cherry-pick-f3d01ff794dc.patch
cherry-pick-919b1ffe1fe7.patch
cherry-pick-f1dd785e021e.patch
cherry-pick-b03797bdb1df.patch
posix_replace_doubleforkandexec_with_forkandspawn.patch
cherry-pick-ecad352cd614.patch
cherry-pick-f427936d32db.patch
cherry-pick-22c61cfae5d1.patch
remove_default_window_title.patch
keep_handling_scroll_update_if_you_can.patch
cherry-pick-d7a5d6b38ea8.patch
cherry-pick-22abbad430b6.patch
cherry-pick-3cbd5973d704.patch
cherry-pick-902f0d144a5b.patch
cherry-pick-664e0d8b4cfb.patch
chore_add_electron_deps_to_gitignores.patch
chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
disable_gpu_acceleration_on_vmware_on_linux.patch
add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
do_not_reduce_page_size_from_64k_to_4k_on_linux_arm64.patch
cherry-pick-94a8bdafc8c6.patch
fix_mac_build_with_enable_plugins_false.patch
fix_windows_build_with_enable_plugins_false.patch
cherry-pick-54e32332750c.patch
cherry-pick-60d8559e150a.patch
cherry-pick-54a7927b19f9.patch
cherry-pick-bd9724c9fe63.patch
m104_background_fetch_passing.patch
cherry-pick-c643d18a078d.patch
feat_add_set_can_resize_mutator.patch
cherry-pick-2083e894852c.patch
cherry-pick-079105b7ebba.patch
merge_104_speculative_fix_for_isvalidcodepointinindex_range_crash.patch
cherry-pick-60d8559e150a.patch
cherry-pick-54e32332750c.patch

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 660c5f35c6095b23cc483c8eb1c119c215dc681d..961c0d7f7a9fe5f9e130998aeb0c872c571b710e 100644
index 9f840287967b50ec1db3a9d27973429ab231a486..731a279e395a8762a25a115665bff99be428de3d 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -240,6 +240,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,7 +24,7 @@ index 660c5f35c6095b23cc483c8eb1c119c215dc681d..961c0d7f7a9fe5f9e130998aeb0c872c
// 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
@@ -346,7 +350,6 @@ int GpuMain(MainFunctionParams parameters) {
@@ -345,7 +349,6 @@ int GpuMain(MainFunctionParams parameters) {
GpuProcess gpu_process(io_thread_priority);
#endif

View File

@@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the
context, which can cause some preload scripts to trip.
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index eb6f4c87c4479d5f4fb8e3f85a231fb9cc744a63..11298b413021b4d438195482db253a93356b2862 100644
index a92e09dc651a5f1a9bbae2572fad32233afcd46c..f99b652dda817b62615d2b3f00b4ae4b438ec44d 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -132,6 +132,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -129,6 +129,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
virtual void DidHandleOnloadEvents() {}
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
@@ -23,10 +23,10 @@ index eb6f4c87c4479d5f4fb8e3f85a231fb9cc744a63..11298b413021b4d438195482db253a93
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f217de19126feeeafee01b2be31ced936696ce20..95966ce7f0eeb0a7f2822bef69b540ac6bfe298d 100644
index 4473c5e812a4a598f3e2f2bb06f78def5791af24..44c0ec9815aafd61182fd18a9d125e185d7196bc 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4489,6 +4489,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4455,6 +4455,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,11 +40,11 @@ index f217de19126feeeafee01b2be31ced936696ce20..95966ce7f0eeb0a7f2822bef69b540ac
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index d8ffccc148622d4eb0388e03c78ff1def4290701..5a3162cc88e5a48b04fbbb74a5c2ba4b7dd8a5d3 100644
index 21b90bbb8fe8ddc03eb20538be423a5396d18eb3..f9c735038f733d990783dd66ffe8c74f824c78f2 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -599,6 +599,8 @@ class CONTENT_EXPORT RenderFrameImpl
uint32_t ng_call_count) override;
@@ -597,6 +597,8 @@ class CONTENT_EXPORT RenderFrameImpl
blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
+ void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
@@ -53,10 +53,10 @@ index d8ffccc148622d4eb0388e03c78ff1def4290701..5a3162cc88e5a48b04fbbb74a5c2ba4b
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 5adee94f81c0e98db976ac1c6c55fb5eab8c2e65..9d3e43f4394ad9a4377b47a001c4baf4027cbe7c 100644
index 3d6e0c0395ff7c92d8908c5151b467beec3a7516..2fadd6d9b2e3747eacea08973d8d3c7aa9c15f26 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -584,6 +584,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -599,6 +599,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -67,10 +67,10 @@ index 5adee94f81c0e98db976ac1c6c55fb5eab8c2e65..9d3e43f4394ad9a4377b47a001c4baf4
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 aa4b510137d60e6fb924f4f1a6554fe06c19ad75..816b6260020a6cbb6880b0eed197743ccd9002f5 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() {
@@ -205,6 +205,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 f36d04ff77481bd30e0de3f6d45c54dfece4067c..d30f569cd68716b9e963cf0fb5da3f7e65cc215a 100644
index 0dda1f7cd77c47f7e61ba48dd20429c13679b543..2f73aacda1bafe07775213e232eda56c4b33325b 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -303,6 +303,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -308,6 +308,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
@@ -92,10 +92,10 @@ index f36d04ff77481bd30e0de3f6d45c54dfece4067c..d30f569cd68716b9e963cf0fb5da3f7e
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 5a83dcdf50acc27da2b1fbb3e515cb4316305a3a..86f31acc40a2dd296c34f3ecf5ef6ccd97cbc18c 100644
index 5297ad63f1c76240d57a64cc5ea64cbf8c7e1b95..006da6072db12da1632f9d45ecb5710136573641 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
@@ -275,6 +275,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -274,6 +274,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
web_frame_->Client()->DidCreateScriptContext(context, world_id);
}
@@ -110,10 +110,10 @@ index 5a83dcdf50acc27da2b1fbb3e515cb4316305a3a..86f31acc40a2dd296c34f3ecf5ef6ccd
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 ac81fdc1ac99ca02458a10c0d258b846a8a9955e..ed838db2474790437ff4b57e23a1e289afce4d47 100644
index 708414fca139eb8328e425d909a48ca97038e442..48b2a0e129ec166ebd4c9bbd32330b0cc43dbeb2 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 {
@@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override;
@@ -123,10 +123,10 @@ index ac81fdc1ac99ca02458a10c0d258b846a8a9955e..ed838db2474790437ff4b57e23a1e289
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 aab6a77b18f83adeac065083f83b94b7ff251282..0d0e272a162be8d1bee9e0122e3e7a59b0ad32a3 100644
index 4b639069d5d9173f0c35fe7656356031ba424a61..3da6699b40bf4f91e6d76a37e5fa8f680f7a7850 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -359,6 +359,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
@@ -357,6 +357,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}

View File

@@ -1,176 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: msizanoen1 <msizanoen@qtmlabs.xyz>
Date: Tue, 19 Jul 2022 05:11:06 +0200
Subject: Add maximized parameter to LinuxUI::GetWindowFrameProvider
This allows ClientFrameViewLinux to instruct the toolkit to draw the window
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 c037fa8db6d4a5ebeb7257627db206e9bab57ecc..14eddfd043e748400a9ee81ce5346a53f10ea03c 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -757,13 +757,15 @@ std::unique_ptr<views::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
return nullptr;
}
-views::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
+views::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
if (!GtkCheckVersion(3, 14))
return nullptr;
auto& provider =
- solid_frame ? solid_frame_provider_ : transparent_frame_provider_;
+ maximized
+ ? (solid_frame ? solid_maximized_frame_provider_ : transparent_maximized_frame_provider_)
+ : (solid_frame ? solid_frame_provider_ : transparent_frame_provider_);
if (!provider)
- provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame);
+ provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, maximized);
return provider.get();
}
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
index 8e609b8311c6b69ef7b6753117542d9e60b2c8ab..a329822c3285599954d77dd5a8e33ccc10e5f626 100644
--- a/ui/gtk/gtk_ui.h
+++ b/ui/gtk/gtk_ui.h
@@ -107,7 +107,7 @@ class GtkUi : public views::LinuxUI {
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;
base::flat_map<std::string, std::string> GetKeyboardLayoutMap() override;
std::string GetCursorThemeName() override;
int GetCursorThemeSize() override;
@@ -218,6 +218,8 @@ class GtkUi : public views::LinuxUI {
// 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_;
};
} // namespace gtk
diff --git a/ui/gtk/window_frame_provider_gtk.cc b/ui/gtk/window_frame_provider_gtk.cc
index e4dbdad327eb77994ffd7f068c67336a19897915..d3ae0636455489a7c7443df85cb769952c98aca2 100644
--- a/ui/gtk/window_frame_provider_gtk.cc
+++ b/ui/gtk/window_frame_provider_gtk.cc
@@ -38,16 +38,18 @@ std::string GetThemeName() {
return theme_string;
}
-GtkCssContext WindowContext(bool solid_frame, bool focused) {
+GtkCssContext WindowContext(bool solid_frame, bool maximized, bool focused) {
std::string selector = "#window.background.";
selector += solid_frame ? "solid-csd" : "csd";
+ if (maximized)
+ selector += ".maximized";
if (!focused)
selector += ":inactive";
return AppendCssNodeToStyleContext({}, selector);
}
-GtkCssContext DecorationContext(bool solid_frame, bool focused) {
- auto context = WindowContext(solid_frame, focused);
+GtkCssContext DecorationContext(bool solid_frame, bool maximized, bool focused) {
+ auto context = WindowContext(solid_frame, maximized, focused);
// GTK4 renders the decoration directly on the window.
if (!GtkCheckVersion(4))
context = AppendCssNodeToStyleContext(context, "#decoration");
@@ -64,8 +66,8 @@ GtkCssContext DecorationContext(bool solid_frame, bool focused) {
return context;
}
-GtkCssContext HeaderContext(bool solid_frame, bool focused) {
- auto context = WindowContext(solid_frame, focused);
+GtkCssContext HeaderContext(bool solid_frame, bool maximized, bool focused) {
+ auto context = WindowContext(solid_frame, maximized, focused);
context =
AppendCssNodeToStyleContext(context, "#headerbar.header-bar.titlebar");
if (!focused)
@@ -110,8 +112,8 @@ int ComputeTopCornerRadius() {
// need to experimentally determine the corner radius by rendering a sample.
// Additionally, in GTK4, the headerbar corners get clipped by the window
// rather than the headerbar having its own rounded corners.
- auto context = GtkCheckVersion(4) ? DecorationContext(false, false)
- : HeaderContext(false, false);
+ auto context = GtkCheckVersion(4) ? DecorationContext(false, false, false)
+ : HeaderContext(false, false, false);
ApplyCssToContext(context, R"(window, headerbar {
background-image: none;
background-color: black;
@@ -169,8 +171,8 @@ void WindowFrameProviderGtk::Asset::CloneFrom(
unfocused_bitmap = src.unfocused_bitmap;
}
-WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame)
- : solid_frame_(solid_frame) {}
+WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool maximized)
+ : solid_frame_(solid_frame), maximized_(maximized) {}
WindowFrameProviderGtk::~WindowFrameProviderGtk() = default;
@@ -264,7 +266,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(gfx::Canvas* canvas,
top_area_height_dip * scale - asset.frame_thickness_px.top();
auto header = PaintHeaderbar({client_bounds_px.width(), top_area_height_px},
- HeaderContext(solid_frame_, focused), scale);
+ HeaderContext(solid_frame_, maximized_, focused), scale);
image = gfx::ImageSkia::CreateFrom1xBitmap(header);
// In GTK4, the headerbar gets clipped by the window.
if (GtkCheckVersion(4)) {
@@ -296,7 +298,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
gfx::Rect frame_bounds_dip(kMaxFrameSizeDip, kMaxFrameSizeDip,
2 * kMaxFrameSizeDip, 2 * kMaxFrameSizeDip);
- auto focused_context = DecorationContext(solid_frame_, true);
+ auto focused_context = DecorationContext(solid_frame_, maximized_, true);
frame_bounds_dip.Inset(-GtkStyleContextGetPadding(focused_context));
frame_bounds_dip.Inset(-GtkStyleContextGetBorder(focused_context));
gfx::Size bitmap_size(BitmapSizePx(asset), BitmapSizePx(asset));
@@ -304,7 +306,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
PaintBitmap(bitmap_size, frame_bounds_dip, focused_context, scale);
asset.unfocused_bitmap =
PaintBitmap(bitmap_size, frame_bounds_dip,
- DecorationContext(solid_frame_, false), scale);
+ DecorationContext(solid_frame_, maximized_, false), scale);
// 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
--- 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 {
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 {
// Cached bitmaps and metrics. The scale is rounded to percent.
base::flat_map<int, Asset> assets_;
+
+ // Whether to draw the window decorations as maximized.
+ bool maximized_;
};
} // namespace gtk
diff --git a/ui/views/linux_ui/linux_ui.h b/ui/views/linux_ui/linux_ui.h
index 5f312e01508c49033bf2d05b9dc083e524f37e5f..7590acd760ba4f36e5a77c1972afc5fc08e616ff 100644
--- a/ui/views/linux_ui/linux_ui.h
+++ b/ui/views/linux_ui/linux_ui.h
@@ -189,7 +189,7 @@ class VIEWS_EXPORT LinuxUI : public ui::LinuxInputMethodContextFactory,
// if transparency is unsupported and the frame should be rendered opaque.
// The returned object is not owned by the caller and will remain alive until
// the process ends.
- virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) = 0;
+ virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) = 0;
// Returns a map of KeyboardEvent code to KeyboardEvent key values.
virtual base::flat_map<std::string, std::string> GetKeyboardLayoutMap() = 0;

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 a9267b633e126f057e914b895f280ed658ff279d..179b5449f53c2d7b9024fb08fe1b1f6c03c6d5b0 100644
index 56c08919ab626a8a7b3bcb892ee94cdee2a106fc..b85bdf4ed574a149a6502e8d21e54f2ee80777a5 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) {
@@ -647,6 +647,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -22,24 +22,24 @@ index a9267b633e126f057e914b895f280ed658ff279d..179b5449f53c2d7b9024fb08fe1b1f6c
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 3f0df3df3dd74ced71869ce01abf7b159387b8f4..85b169530a21bcfc016d1439a71d35378077774d 100644
index 9e32df9f5fd765895c8470c3922a62f754e7d409..9bac2321d65d9e54ce88fffafd72a74803ed2c87 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl
bool IsRenderViewLiveForTesting() const override;
void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) const override;
@@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl
bool IsRenderViewLive() override;
void WriteIntoTrace(perfetto::TracedValue context) override;
+ void SetSchedulerThrottling(bool allowed) override;
void SendWebPreferencesToRenderer();
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 3b01b3419c4361d5d75ad1c37e5baa3a1967bd09..35c82d931242a1180091267c18e0255840acc5ce 100644
index 787077d71c04d571aa825bec0a549c5fad2b8574..4b05b80802ba97a46eed60e509b503fc8375016b 100644
--- a/content/public/browser/render_view_host.h
+++ b/content/public/browser/render_view_host.h
@@ -80,6 +80,9 @@ class CONTENT_EXPORT RenderViewHost {
virtual void WriteIntoTrace(
perfetto::TracedProto<TraceProto> context) const = 0;
@@ -74,6 +74,9 @@ class CONTENT_EXPORT RenderViewHost {
// Write a representation of this object into a trace.
virtual void WriteIntoTrace(perfetto::TracedValue context) = 0;
+ // Disable/Enable scheduler throttling.
+ virtual void SetSchedulerThrottling(bool allowed) = 0;
@@ -48,10 +48,10 @@ index 3b01b3419c4361d5d75ad1c37e5baa3a1967bd09..35c82d931242a1180091267c18e02558
// 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 fd145f0aa562d6b63fb1d3a8a9241ae1aa1ce7a0..54d30fb9db8b48b94abdb815c487f618f9bb6525 100644
index 4e8d36420d6edc1725a840e1b9f123041d21abe4..dd198cb7bf02e509833c6b4c7d8e5d65d20d46dc 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,
@@ -152,6 +152,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
static WindowOpenDisposition NavigationPolicyToDisposition(
blink::WebNavigationPolicy policy);
@@ -61,10 +61,10 @@ index fd145f0aa562d6b63fb1d3a8a9241ae1aa1ce7a0..54d30fb9db8b48b94abdb815c487f618
// 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 befd736a9cf362514b9a2ee475dc4a814c85a87b..24b2617f56673a3075697802cf5b574b0c766610 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 {
@@ -97,4 +97,7 @@ interface PageBroadcast {
// Sent to whole page, but should only be used by the main frame.
SetPageBaseBackgroundColor(skia.mojom.SkColor? color);
@@ -73,10 +73,10 @@ index 39bfc2200e924d0c589cfd07f085f182ef6853a6..bddff6d5ad3f6d08c4dc48e66ebc5319
+ 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 14d4a00293ab0b11e733676844ce483992d6cd8e..c6c2dbb9dddd1eaa21e8c7b276d871a3898463fa 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 {
@@ -368,6 +368,7 @@ class WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@@ -85,10 +85,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 6504c73f614bebad7b899c8b76c4b3034b7dab7a..f76a0ee0778d7b4e4df69a4c43b4a6bfdc89294d 100644
index b9d5a13bcdf981064f9970fdb8017fed5f93b35e..182f70b2b3bd9cbc6548d4c17caad797e5dad0ce 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3689,6 +3689,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3668,6 +3668,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -102,7 +102,7 @@ index 6504c73f614bebad7b899c8b76c4b3034b7dab7a..f76a0ee0778d7b4e4df69a4c43b4a6bf
void WebViewImpl::SetVisibilityState(
mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) {
@@ -3700,7 +3707,8 @@ void WebViewImpl::SetVisibilityState(
@@ -3679,7 +3686,8 @@ void WebViewImpl::SetVisibilityState(
}
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
GetPage()->GetPageScheduler()->SetPageVisible(
@@ -113,7 +113,7 @@ index 6504c73f614bebad7b899c8b76c4b3034b7dab7a..f76a0ee0778d7b4e4df69a4c43b4a6bf
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 5c9609a6a8d1e18981ac14ad5321fa82c3eb38e0..0a2564a8e45210ba58438e95caa70d01fac22aee 100644
index 5107ef421138e136b20b25b7bbcc1f0bb246bb66..043266205142e59f88c4c2f2ae6b58bb009f2d9c 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -420,6 +420,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -124,7 +124,7 @@ index 5c9609a6a8d1e18981ac14ad5321fa82c3eb38e0..0a2564a8e45210ba58438e95caa70d01
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -855,6 +856,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -857,6 +858,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,10 +8,10 @@ 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 4e51622d725ad0ee448ea1794c209aae7f78e09a..df6e9ed6fda9e6fa695fa3ab717847735dc63b17 100644
index 30e237f886b41bdf528b2a0e81054d15fb323f1f..43f7920cf6ff12d8a48ddef5440814a42266e8c5 100644
--- a/third_party/blink/common/web_preferences/web_preferences.cc
+++ b/third_party/blink/common/web_preferences/web_preferences.cc
@@ -140,6 +140,20 @@ WebPreferences::WebPreferences()
@@ -145,6 +145,20 @@ WebPreferences::WebPreferences()
fake_no_alloc_direct_call_for_testing_enabled(false),
v8_cache_options(blink::mojom::V8CacheOptions::kDefault),
record_whole_document(false),
@@ -33,7 +33,7 @@ index 4e51622d725ad0ee448ea1794c209aae7f78e09a..df6e9ed6fda9e6fa695fa3ab71784773
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 16e7501cf2da98d0046d65102e634af31c1f6c39..53fbfdb4837fe444c3564523068faadcc12afd1a 100644
index d278453a261fe2dd3bacce433e35d50879b555a7..140f8d6273d944bfe36831d27aef757d89240b56 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
@@ -22,6 +22,10 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -47,7 +47,7 @@ index 16e7501cf2da98d0046d65102e634af31c1f6c39..53fbfdb4837fe444c3564523068faadc
!data.ReadLazyFrameLoadingDistanceThresholdsPx(
&out->lazy_frame_loading_distance_thresholds_px) ||
!data.ReadLazyImageLoadingDistanceThresholdsPx(
@@ -145,6 +149,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -151,6 +155,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
data.fake_no_alloc_direct_call_for_testing_enabled();
out->v8_cache_options = data.v8_cache_options();
out->record_whole_document = data.record_whole_document();
@@ -68,7 +68,7 @@ index 16e7501cf2da98d0046d65102e634af31c1f6c39..53fbfdb4837fe444c3564523068faadc
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 b2b3be2019209d3810bb0dc570e2a1ebcf702ad8..0ff23de6bd73d6d0ba82402ec39d2f0812c41aab 100644
index 8509f720c5afb816c6cbb2313dd566a24236a790..b9f0f79d96c58a7769939610bb72f8b2bcd3be94 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 @@
@@ -79,7 +79,7 @@ index b2b3be2019209d3810bb0dc570e2a1ebcf702ad8..0ff23de6bd73d6d0ba82402ec39d2f08
#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"
@@ -152,6 +153,22 @@ struct BLINK_COMMON_EXPORT WebPreferences {
@@ -160,6 +161,22 @@ struct BLINK_COMMON_EXPORT WebPreferences {
blink::mojom::V8CacheOptions v8_cache_options;
bool record_whole_document;
@@ -103,7 +103,7 @@ index b2b3be2019209d3810bb0dc570e2a1ebcf702ad8..0ff23de6bd73d6d0ba82402ec39d2f08
// 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 30fd01c6e804d05091ff6147ac570901a8d998b9..4acd2df36ab6928947b5defe8691eccaf3cd7b19 100644
index a6291be3e953ceaee1d996e4b30a6ae78916bc7a..c3baf95c5d9b6a6ace56bcde9e1dc8179f18eaa0 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 @@
@@ -114,7 +114,7 @@ index 30fd01c6e804d05091ff6147ac570901a8d998b9..4acd2df36ab6928947b5defe8691ecca
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/nqe/effective_connection_type.h"
#include "third_party/blink/public/common/common_export.h"
@@ -418,6 +419,60 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
@@ -441,6 +442,60 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
return r.record_whole_document;
}
@@ -176,7 +176,7 @@ index 30fd01c6e804d05091ff6147ac570901a8d998b9..4acd2df36ab6928947b5defe8691ecca
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 d10d1b4c0b16ac9e863077cf60feca35fa2da329..1a49fb1a11f75aa3c79cd3cc1796957d0b9a5549 100644
index 96dd9fd56e44e66c5ea24d9df7c6cbff25409d6c..e0d113b4dee6a72f350b8494448f516be01d0468 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";
@@ -187,7 +187,7 @@ index d10d1b4c0b16ac9e863077cf60feca35fa2da329..1a49fb1a11f75aa3c79cd3cc1796957d
enum PointerType {
kPointerNone = 1, // 1 << 0
@@ -204,6 +205,22 @@ struct WebPreferences {
@@ -212,6 +213,22 @@ struct WebPreferences {
V8CacheOptions v8_cache_options;
bool record_whole_document;

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 746dffb1defec9d776f681d41325a65b02cbdd0f..05a7f20f10e3ff514aa3b3b5386980ddfcc586eb 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(

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 a519c49a01987feab4dadbc4ba48b73e943fa404..c8d2a65cb428e85c33675668cc106f0af124dfee 100644
index 09e6436422169ac05d5f0561f12984c86dc7af5e..7b2263f4c7fa2dffbaf5b630f4d5a83d9b68f9a5 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) {
@@ -122,14 +122,6 @@ bool Frame::Detach(FrameDetachType type) {
DCHECK(!IsDetached());
@@ -33,7 +33,7 @@ index a519c49a01987feab4dadbc4ba48b73e943fa404..c8d2a65cb428e85c33675668cc106f0a
if (type == FrameDetachType::kRemove) {
if (provisional_frame_) {
provisional_frame_->Detach(FrameDetachType::kRemove);
@@ -154,6 +146,14 @@ bool Frame::Detach(FrameDetachType type) {
@@ -153,6 +145,14 @@ bool Frame::Detach(FrameDetachType type) {
GetWindowProxyManager()->ClearForSwap();
}
@@ -49,10 +49,10 @@ index a519c49a01987feab4dadbc4ba48b73e943fa404..c8d2a65cb428e85c33675668cc106f0a
// 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 3efc0a04ae3fa60dce4aeb9a296c8dd1bb43320a..5dac7c18f39abefcc318ba2a7b8fad449189d0b6 100644
index db69148e0756ed36bcf3a04f1ace69cc166261a6..bcf072a6d8bc46e5c71d9ef3f248b6af69693ac9 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -543,10 +543,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -538,10 +538,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index 3efc0a04ae3fa60dce4aeb9a296c8dd1bb43320a..5dac7c18f39abefcc318ba2a7b8fad44
if (!Client())
return false;
@@ -592,6 +588,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -587,6 +583,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 0736e7021761e6019e1b52448d21ffdb73b964fc..571b553e9aaa98739851d0ff312eefe9f6a75596 100644
index 107516329273ee4a6cc49433b69f307b1264362b..0c9555a04233d07a186e34ada8b7615095854950 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -80,6 +80,7 @@
@@ -78,6 +78,7 @@
X("drmcursor") \
X("dwrite") \
X("DXVA_Decoding") \

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 8fa0c36007a0ae0e4553709d27a8231efb08459b..3c4f93fc98b5002572adc78cb9a21b3e78c9f3e0 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

@@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <vertedinde@electronjs.org>
Date: Sun, 1 May 2022 18:01:42 -0700
Subject: build: disable print_content_analysis
Print Content Analysis enables enterprise users to scan to-be-printed
pages and documents for sensitive data if the OnPrintEnterpriseConnector
policy is enabled. A conversation with the Chromium team confirmed
this feature was intended for enterprise Chrome users and not embedders,
so we're disabling it to prevent build issues/additional unneeded files.
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
--- a/printing/buildflags/buildflags.gni
+++ b/printing/buildflags/buildflags.gni
@@ -36,8 +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
}
declare_args() {

View File

@@ -11,7 +11,7 @@ if we ever align our .pak file generation with Chrome we can remove this
patch.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 3c40d999a9545051e91a9f0ad3bf7ca2a95d80c4..b5a20be5e22238e7e1969bdaf52c0b05e84bb846 100644
index f2c4feac76e96575de3627b7e8f2373b4fb30411..f5fa6b21594c97a08d1aefd790a4846d9b3e1a45 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -171,11 +171,16 @@ if (!is_android && !is_mac) {
@@ -33,10 +33,10 @@ index 3c40d999a9545051e91a9f0ad3bf7ca2a95d80c4..b5a20be5e22238e7e1969bdaf52c0b05
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 948d05358b89895faa97a7d383bfac66a45464a8..43859d267010103daf80525a5af0f312a577411c 100644
index 492cd8e11e28e0b427aca227665295a3052af765..760d2171c5083820fbbf66ce5d7d3c80930b9e88 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4560,7 +4560,7 @@ static_library("browser") {
@@ -4501,7 +4501,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@@ -46,10 +46,10 @@ index 948d05358b89895faa97a7d383bfac66a45464a8..43859d267010103daf80525a5af0f312
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 641f52eb7952858738a6623b480f767261e5d009..6d0c624ea62a9125ef7e5579da197de2327a12ff 100644
index 028d269850e66db444591cda7005a0f8434193e9..cc0d14cd9798c6bbee80581c95eb8281ce7fb6ba 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6002,7 +6002,6 @@ test("unit_tests") {
@@ -5722,7 +5722,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index 641f52eb7952858738a6623b480f767261e5d009..6d0c624ea62a9125ef7e5579da197de2
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/browser:chrome_process_finder",
@@ -6025,6 +6024,10 @@ test("unit_tests") {
@@ -5745,6 +5744,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index 641f52eb7952858738a6623b480f767261e5d009..6d0c624ea62a9125ef7e5579da197de2
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -6712,7 +6715,6 @@ test("unit_tests") {
@@ -6438,7 +6441,6 @@ test("unit_tests") {
}
deps += [
@@ -76,10 +76,10 @@ index 641f52eb7952858738a6623b480f767261e5d009..6d0c624ea62a9125ef7e5579da197de2
"//chrome/browser:cart_db_content_proto",
"//chrome/browser:coupon_db_content_proto",
"//chrome/browser/media/router:test_support",
@@ -6760,6 +6762,11 @@ test("unit_tests") {
if (is_chromeos) {
deps += [ "//ui/chromeos" ]
}
@@ -6483,6 +6485,11 @@ test("unit_tests") {
"//ui/native_theme:test_support",
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
+
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_hash" ]

View File

@@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
rebuild the entire tree.
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index d960648941d8b959b25f87b364a594ec44760348..74a14a2373305e2e62b974b34a28ea9a62c6a911 100644
index fcc7e12834733fa0927c35708de9665db4c59eba..faac97db5a2c86f1fcc89c3c045ef74b7b2b878a 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {
@@ -27,7 +27,7 @@ index d960648941d8b959b25f87b364a594ec44760348..74a14a2373305e2e62b974b34a28ea9a
# Set to enable the official build level of optimization. This has nothing
# to do with branding, but enables an additional level of optimization above
# release (!is_debug). This might be better expressed as a tri-state
@@ -349,6 +352,7 @@ default_compiler_configs = [
@@ -346,6 +349,7 @@ default_compiler_configs = [
"//build/config/compiler/pgo:default_pgo_flags",
"//build/config/coverage:default_coverage",
"//build/config/sanitizers:default_sanitizer_flags",

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 a53cc9066a3485ff6829e3c410eb523de7d074d6..9697e2dc2d0892fc7f1007d62488c2f2f24ec92f 100644
index 7915346430db72d18474d7a011b8dc7637c3f281..cd736d988f9c5e37dc24c724268fe115e00914d9 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -44,7 +44,11 @@ config("winver") {
@@ -30,7 +30,7 @@ index a53cc9066a3485ff6829e3c410eb523de7d074d6..9697e2dc2d0892fc7f1007d62488c2f2
+ "//electron:libcxx_objects_zip",
"//third_party/catapult/devil:devil",
]
if (is_linux) {
if (is_linux && !is_chromeos) {
diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
index 40f1285f14c0843405e0ee51879b8742285a006d..5be895d3e36df53a5960006a1513f1322400fd23 100644
--- a/buildtools/third_party/libc++abi/BUILD.gn

View File

@@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Tue, 22 Mar 2022 16:24:44 -0500
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 046792ac275853bf109537589b911cfada44ed24..e43daeaa8f8c8e23eea99b3f8f5f48f92012bbc1 100644
--- a/build/config/c++/BUILD.gn
+++ b/build/config/c++/BUILD.gn
@@ -8,6 +8,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
+}
+
# 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) {

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 ec886101b6e5347bdd832684a5c3b2cc3179c657..0287e414f4020147ddee297f7c1447c32a118905 100644
index 36a8fa8d3e981707e6688379813560ba94209ab3..e36a19c847912b007a94464321bb83b15bdcdafd 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6943,6 +6943,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -6706,6 +6706,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 ec886101b6e5347bdd832684a5c3b2cc3179c657..0287e414f4020147ddee297f7c1447c3
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 335e70179a03ee379082525bb4c7d596983bd633..faa795be3a6cbc7ae13d9a42a1bdbd01ac0406a9 100644
index 2b2d267bcaac7eaaf63055d2108e03835f94ea3d..b406cd71133062618258a7d56e69b5e258687e12 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3947,6 +3947,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -3934,6 +3934,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
}
auto* new_contents_impl = new_contents.get();
@@ -39,7 +39,7 @@ index 335e70179a03ee379082525bb4c7d596983bd633..faa795be3a6cbc7ae13d9a42a1bdbd01
new_contents_impl->GetController().SetSessionStorageNamespace(
partition_config, session_storage_namespace);
@@ -3991,12 +3999,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -3976,12 +3984,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -53,10 +53,10 @@ index 335e70179a03ee379082525bb4c7d596983bd633..faa795be3a6cbc7ae13d9a42a1bdbd01
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 a7f36529608011013dab96a803ad3187c940fc81..2bbcea3efede2fda4ff2c5b270e1db0135c54290 100644
index ace032dc2ffac27fbdddee5a4b13c3c3e36ba5ae..80f7dd56fdaa94a9880995b2b5393af0414eef29 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -569,6 +569,10 @@ struct CreateNewWindowParams {
@@ -550,6 +550,10 @@ struct CreateNewWindowParams {
// Governs how downloads are handled if `target_url` results in a download.
blink.mojom.NavigationDownloadPolicy download_policy;
@@ -68,10 +68,10 @@ index a7f36529608011013dab96a803ad3187c940fc81..2bbcea3efede2fda4ff2c5b270e1db01
// 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 ffa24d4b6779226ea3b94afdf176939ea7e42e34..16fb4946cb3ea2d097e8ed05bb340cc3f0782ed6 100644
index a0a9f51b7e62b13f62467f14e3e9245cb6fc8d84..329cbc6f8c822c6f6deac4f341baec41228dca7b 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -579,6 +579,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -577,6 +577,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -81,10 +81,10 @@ index ffa24d4b6779226ea3b94afdf176939ea7e42e34..16fb4946cb3ea2d097e8ed05bb340cc3
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 ae3dda4b9b40bb0d4c1a10eaedda9270d3543a8b..9b988bb631ab759739ae01c918efb1d563d5aafc 100644
index 3bbb6a39eeb719b94d0e212ea8da5051ff55d441..ceb2bb900e122840505aa8d3911923cffc9a907e 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -165,6 +165,7 @@ class NetworkService;
@@ -169,6 +169,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -92,7 +92,7 @@ index ae3dda4b9b40bb0d4c1a10eaedda9270d3543a8b..9b988bb631ab759739ae01c918efb1d5
} // namespace network
namespace sandbox {
@@ -954,6 +955,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -960,6 +961,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -102,7 +102,7 @@ index ae3dda4b9b40bb0d4c1a10eaedda9270d3543a8b..9b988bb631ab759739ae01c918efb1d5
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 9bbc7cf6d9542a3f013313e0c497839da2beb9d1..c01e06b08b1cca7a663e30476a551904ce9c6db8 100644
index f132199113778f6b50972419b61a187e6272300c..7bb1680553c405a9016cfd67eca5fa3c6439b692 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 9bbc7cf6d9542a3f013313e0c497839da2beb9d1..c01e06b08b1cca7a663e30476a551904
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 04aa4d993b331396ee20464f6e1d2da10c91c834..2556c044b6e28501a5fac9b0040e623b8f35f497 100644
index f889d0bf33cf218a68bf5a9422aecaed23fa260a..3330876f623e5b2cb600b1ce1fd10b3375568613 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -135,7 +135,7 @@ index 04aa4d993b331396ee20464f6e1d2da10c91c834..2556c044b6e28501a5fac9b0040e623b
#include "content/public/browser/eye_dropper.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/media_stream_request.h"
@@ -338,6 +339,13 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -339,6 +340,13 @@ class CONTENT_EXPORT WebContentsDelegate {
const StoragePartitionConfig& partition_config,
SessionStorageNamespace* session_storage_namespace);
@@ -150,10 +150,10 @@ index 04aa4d993b331396ee20464f6e1d2da10c91c834..2556c044b6e28501a5fac9b0040e623b
// 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 89b07508aef80680a847c106fea0e2fa58ff964b..6630af3583a6bac6135d46644280d6444fe981b8 100644
index 83517883144a77a0c775ce2d146b4e85ef79ea97..aa65517a568aa0b324b2c8cca8f60bb532ba085a 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -33,6 +33,7 @@
@@ -32,6 +32,7 @@
#include "third_party/blink/public/platform/impression_conversions.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"
@@ -161,7 +161,7 @@ index 89b07508aef80680a847c106fea0e2fa58ff964b..6630af3583a6bac6135d46644280d644
#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"
@@ -295,6 +296,10 @@ WebView* RenderViewImpl::CreateView(
@@ -291,6 +292,10 @@ WebView* RenderViewImpl::CreateView(
params->impression = blink::ConvertWebImpressionToImpression(*impression);
}
@@ -173,10 +173,10 @@ index 89b07508aef80680a847c106fea0e2fa58ff964b..6630af3583a6bac6135d46644280d644
/*is_opener_navigation=*/false, request.HasUserGesture(),
// `openee_can_access_opener_origin` only matters for opener navigations,
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 4379497806bf7c85ade2f4e4554d6a60c4ec966c..fa860bbcf0c12df33dae69d25b01587676a1b79e 100644
index 54b62065d148ab860a49dc03daaf7680ff00d778..3008d3efe89585a562ae55734938b10ef8b0074e 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(
@@ -440,6 +440,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -220,14 +220,14 @@ index 84d32491a56528a84b4395fba1d54cdbb38d522b..09998a83c449ef8cd9f360fbcdcf7edc
} // 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 2e2ba228a7f179b7cf9c43434bd20ca20b1f1af6..de9f95426ad2dcc99bc4961a0e57539d287408e4 100644
index 030cc373443766b6485a888f5627885f535e06fc..7bc60b17a0f1aeb208f6d7d85cd6fa537c44c54a 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2074,6 +2074,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2050,6 +2050,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, incumbent_window);
+ window_features.raw_features = features;
// In fenced frames, we should always use `noopener`.
if (GetFrame()->IsInFencedFrameTree()) {
FrameLoadRequest frame_request(incumbent_window,
ResourceRequest(completed_url));

View File

@@ -1,272 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yuki Shiino <yukishiino@chromium.org>
Date: Tue, 23 Aug 2022 09:18:50 +0000
Subject: bindings: Add argument type checks to ObservableArray<T>
Performs type checks for arguments of trap functions and throws
a TypeError if a type is wrong.
(cherry picked from commit 4d67bb1dbf55e2eddf513f29ac33e38e8e1d2fab)
Bug: 1352549
Change-Id: I66df3a9eeae5e4f44bdf714666a2c6304ebec0f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3835494
Auto-Submit: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1036005}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3849901
Cr-Commit-Position: refs/branch-heads/5112@{#1514}
Cr-Branched-From: b13d3fe7b3c47a56354ef54b221008afa754412e-refs/heads/main@{#1012729}
diff --git a/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_handler.h b/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_handler.h
index 1b31781f4b445b2dab7967b1137c28de50455623..4b17428992c66fad9f7eee1e2956f4218017fb8f 100644
--- a/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_handler.h
+++ b/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_handler.h
@@ -54,13 +54,17 @@ class ObservableArrayExoticObjectHandler {
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
- v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- v8::Local<v8::Value> v8_property = info[1];
- v8::Local<v8::Value> v8_desc_obj = info[2];
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
ExceptionState exception_state(
- isolate, ExceptionContext::Context::kNamedPropertyDefine,
- backing_list.ObservableArrayNameInIDL());
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(), "defineProperty");
+ if (!(info[0]->IsArray() && info[1]->IsName() && info[2]->IsObject())) {
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
+ v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
+ v8::Local<v8::Name> v8_property = info[1].As<v8::Name>();
+ v8::Local<v8::Object> v8_desc_obj = info[2].As<v8::Object>();
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
V8PropertyDescriptorBag desc_bag;
V8ObjectToPropertyDescriptor(isolate, v8_desc_obj, desc_bag,
@@ -112,9 +116,7 @@ class ObservableArrayExoticObjectHandler {
desc.set_configurable(desc_bag.configurable);
if (desc_bag.has_enumerable)
desc.set_enumerable(desc_bag.enumerable);
- if (!v8_target
- ->DefineProperty(current_context, v8_property.As<v8::Name>(),
- desc)
+ if (!v8_target->DefineProperty(current_context, v8_property, desc)
.To(&is_defined)) {
return;
}
@@ -124,9 +126,7 @@ class ObservableArrayExoticObjectHandler {
desc.set_configurable(desc_bag.configurable);
if (desc_bag.has_enumerable)
desc.set_enumerable(desc_bag.enumerable);
- if (!v8_target
- ->DefineProperty(current_context, v8_property.As<v8::Name>(),
- desc)
+ if (!v8_target->DefineProperty(current_context, v8_property, desc)
.To(&is_defined)) {
return;
}
@@ -139,9 +139,16 @@ class ObservableArrayExoticObjectHandler {
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
+ if (!(info[0]->IsArray() && info[1]->IsName())) {
+ ExceptionState exception_state(
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(), "deleteProperty");
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- v8::Local<v8::Value> v8_property = info[1];
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
+ v8::Local<v8::Name> v8_property = info[1].As<v8::Name>();
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
if (v8_property->IsString()) {
v8::Local<v8::Uint32> v8_index;
@@ -154,7 +161,7 @@ class ObservableArrayExoticObjectHandler {
ScriptState* script_state = ScriptState::From(current_context);
ExceptionState exception_state(
isolate, ExceptionContext::Context::kIndexedPropertyDelete,
- backing_list.ObservableArrayNameInIDL());
+ BackingListWrappable::ObservableArrayNameInIDL());
if (!RunDeleteAlgorithm(script_state, backing_list, index,
exception_state)) {
return;
@@ -181,9 +188,16 @@ class ObservableArrayExoticObjectHandler {
static void TrapGet(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
+ if (!(info[0]->IsArray() && info[1]->IsName())) {
+ ExceptionState exception_state(
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(), "get");
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- v8::Local<v8::Value> v8_property = info[1];
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
+ v8::Local<v8::Name> v8_property = info[1].As<v8::Name>();
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
if (v8_property->IsString()) {
v8::Local<v8::Uint32> v8_index;
@@ -221,9 +235,17 @@ class ObservableArrayExoticObjectHandler {
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
+ if (!(info[0]->IsArray() && info[1]->IsName())) {
+ ExceptionState exception_state(
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(),
+ "getOwnPropertyDescriptor");
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- v8::Local<v8::Value> v8_property = info[1];
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
+ v8::Local<v8::Name> v8_property = info[1].As<v8::Name>();
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
if (v8_property->IsString()) {
v8::Local<v8::Uint32> v8_index;
@@ -258,9 +280,7 @@ class ObservableArrayExoticObjectHandler {
}
v8::Local<v8::Value> v8_value;
- if (!v8_target
- ->GetOwnPropertyDescriptor(current_context,
- v8_property.As<v8::Name>())
+ if (!v8_target->GetOwnPropertyDescriptor(current_context, v8_property)
.ToLocal(&v8_value)) {
return;
}
@@ -271,9 +291,16 @@ class ObservableArrayExoticObjectHandler {
static void TrapHas(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
+ if (!(info[0]->IsArray() && info[1]->IsName())) {
+ ExceptionState exception_state(
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(), "has");
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- v8::Local<v8::Value> v8_property = info[1];
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
+ v8::Local<v8::Name> v8_property = info[1].As<v8::Name>();
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
if (v8_property->IsString()) {
v8::Local<v8::Uint32> v8_index;
@@ -300,8 +327,15 @@ class ObservableArrayExoticObjectHandler {
static void TrapOwnKeys(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
+ if (!info[0]->IsArray()) {
+ ExceptionState exception_state(
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(), "ownKeys");
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
// 2. Let length be handler.[[BackingList]]'s size.
// 3. Let keys be an empty list.
@@ -357,17 +391,24 @@ class ObservableArrayExoticObjectHandler {
static void TrapSet(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Context> current_context = isolate->GetCurrentContext();
+ if (!(info[0]->IsArray() && info[1]->IsName())) {
+ ExceptionState exception_state(
+ isolate, ExceptionContext::Context::kOperationInvoke,
+ BackingListWrappable::ObservableArrayNameInIDL(), "set");
+ exception_state.ThrowTypeError("Invalid argument.");
+ return;
+ }
v8::Local<v8::Array> v8_target = info[0].As<v8::Array>();
- v8::Local<v8::Value> v8_property = info[1];
+ v8::Local<v8::Name> v8_property = info[1].As<v8::Name>();
v8::Local<v8::Value> v8_value = info[2];
- BackingListWrappable& backing_list = ToWrappableUnsafe(isolate, v8_target);
+ BackingListWrappable& backing_list = ToWrappableOrDie(isolate, v8_target);
if (v8_property->IsString()) {
v8::Local<v8::Uint32> v8_index;
if (v8_property->ToArrayIndex(current_context).ToLocal(&v8_index)) {
ExceptionState exception_state(
isolate, ExceptionContext::Context::kIndexedPropertySet,
- backing_list.ObservableArrayNameInIDL());
+ BackingListWrappable::ObservableArrayNameInIDL());
uint32_t index = v8_index->Value();
bool result =
DoSetTheIndexedValue(isolate, current_context, backing_list, index,
@@ -380,7 +421,7 @@ class ObservableArrayExoticObjectHandler {
V8AtomicString(isolate, "length"))) {
ExceptionState exception_state(
isolate, ExceptionContext::Context::kAttributeSet,
- backing_list.ObservableArrayNameInIDL(), "length");
+ BackingListWrappable::ObservableArrayNameInIDL(), "length");
bool result = DoSetTheLength(isolate, current_context, backing_list,
v8_value, exception_state);
V8SetReturnValue(info, result);
@@ -431,11 +472,11 @@ class ObservableArrayExoticObjectHandler {
}
private:
- static BackingListWrappable& ToWrappableUnsafe(v8::Isolate* isolate,
- v8::Local<v8::Array> target) {
+ static BackingListWrappable& ToWrappableOrDie(v8::Isolate* isolate,
+ v8::Local<v8::Array> target) {
bindings::ObservableArrayBase* base =
bindings::ObservableArrayExoticObjectImpl::
- ProxyTargetToObservableArrayBase(isolate, target);
+ ProxyTargetToObservableArrayBaseOrDie(isolate, target);
return *static_cast<BackingListWrappable*>(base);
}
diff --git a/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.cc b/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.cc
index 8672414aba480c4af3b7431e6db071a03d61569e..88c2adf501a3a3088c635c8d24215fbce787b3e5 100644
--- a/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.cc
+++ b/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.cc
@@ -42,7 +42,7 @@ const WrapperTypeInfo& ObservableArrayExoticObjectImpl::wrapper_type_info_ =
// static
bindings::ObservableArrayBase*
-ObservableArrayExoticObjectImpl::ProxyTargetToObservableArrayBase(
+ObservableArrayExoticObjectImpl::ProxyTargetToObservableArrayBaseOrDie(
v8::Isolate* isolate,
v8::Local<v8::Array> v8_proxy_target) {
// See the implementation comment in ObservableArrayExoticObjectImpl::Wrap.
@@ -50,6 +50,8 @@ ObservableArrayExoticObjectImpl::ProxyTargetToObservableArrayBase(
V8PrivateProperty::GetSymbol(isolate, kV8ProxyTargetToV8WrapperKey);
v8::Local<v8::Value> backing_list_wrapper =
private_property.GetOrUndefined(v8_proxy_target).ToLocalChecked();
+ // Crash when author script managed to pass something else other than the
+ // right proxy target object.
CHECK(backing_list_wrapper->IsObject());
return ToScriptWrappable(backing_list_wrapper.As<v8::Object>())
->ToImpl<bindings::ObservableArrayBase>();
diff --git a/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.h b/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.h
index 4d262a4981c1404d9b403b0fcf4ec9d71e109bea..8c56428c40e5b0d246b45c741f8bdcbfdcfb23ee 100644
--- a/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.h
+++ b/third_party/blink/renderer/bindings/core/v8/observable_array_exotic_object_impl.h
@@ -22,7 +22,7 @@ class CORE_EXPORT ObservableArrayExoticObjectImpl final
public:
// Returns the backing list object extracted from the proxy target object
// of type JS Array.
- static bindings::ObservableArrayBase* ProxyTargetToObservableArrayBase(
+ static bindings::ObservableArrayBase* ProxyTargetToObservableArrayBaseOrDie(
v8::Isolate* isolate,
v8::Local<v8::Array> v8_proxy_target);

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

@@ -0,0 +1,114 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ari Chivukula <arichiv@chromium.org>
Date: Tue, 17 May 2022 18:17:07 +0000
Subject: {M102 PICK} [IndexedDB] Use-After-Free Fix
We can't guarantee order in the task the constructor dispatches the same
way we could before due to all the async changes. Let's be sure all the
objects exist before using them now. Long term, we need to address
ownership of the idb context.
Bug: 1324864, 1218100
Change-Id: Id5753297a4c966432028a1e7e063c5f1bed6f619
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3646994
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Srinivas Sista <srinivassista@chromium.org>
Cr-Commit-Position: refs/branch-heads/5005@{#812}
Cr-Branched-From: 5b4d9450fee01f821b6400e947b3839727643a71-refs/heads/main@{#992738}
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc
index 9472e762729312bf68073c95056ce09e324148da..219904d80798f71f0be23ee9ffeb5c58d030fb55 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.cc
+++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -167,38 +167,32 @@ IndexedDBContextImpl::IndexedDBContextImpl(
std::move(quota_client_remote),
storage::QuotaClientType::kIndexedDatabase,
{blink::mojom::StorageType::kTemporary});
+ IDBTaskRunner()->PostTask(
+ FROM_HERE, base::BindOnce(&IndexedDBContextImpl::BindPipesOnIDBSequence,
+ weak_factory_.GetWeakPtr(),
+ std::move(quota_client_receiver),
+ std::move(blob_storage_context),
+ std::move(file_system_access_context)));
+}
- // This is safe because the IndexedDBContextImpl must be destructed on the
- // IDBTaskRunner, and this task will always happen before that.
- idb_task_runner_->PostTask(
- FROM_HERE,
- base::BindOnce(
- [](mojo::Remote<storage::mojom::BlobStorageContext>*
- blob_storage_context,
- mojo::Remote<storage::mojom::FileSystemAccessContext>*
- file_system_access_context,
- mojo::Receiver<storage::mojom::QuotaClient>* quota_client_receiver,
- mojo::PendingRemote<storage::mojom::BlobStorageContext>
- pending_blob_storage_context,
- mojo::PendingRemote<storage::mojom::FileSystemAccessContext>
- pending_file_system_access_context,
- mojo::PendingReceiver<storage::mojom::QuotaClient>
- quota_client_pending_receiver) {
- quota_client_receiver->Bind(
- std::move(quota_client_pending_receiver));
- if (pending_blob_storage_context) {
- blob_storage_context->Bind(
- std::move(pending_blob_storage_context));
- }
- if (pending_file_system_access_context) {
- file_system_access_context->Bind(
- std::move(pending_file_system_access_context));
- }
- },
- &blob_storage_context_, &file_system_access_context_,
- &quota_client_receiver_, std::move(blob_storage_context),
- std::move(file_system_access_context),
- std::move(quota_client_receiver)));
+void IndexedDBContextImpl::BindPipesOnIDBSequence(
+ mojo::PendingReceiver<storage::mojom::QuotaClient>
+ pending_quota_client_receiver,
+ mojo::PendingRemote<storage::mojom::BlobStorageContext>
+ pending_blob_storage_context,
+ mojo::PendingRemote<storage::mojom::FileSystemAccessContext>
+ pending_file_system_access_context) {
+ DCHECK(IDBTaskRunner()->RunsTasksInCurrentSequence());
+ if (pending_quota_client_receiver) {
+ quota_client_receiver_.Bind(std::move(pending_quota_client_receiver));
+ }
+ if (pending_blob_storage_context) {
+ blob_storage_context_.Bind(std::move(pending_blob_storage_context));
+ }
+ if (pending_file_system_access_context) {
+ file_system_access_context_.Bind(
+ std::move(pending_file_system_access_context));
+ }
}
void IndexedDBContextImpl::Bind(
diff --git a/content/browser/indexed_db/indexed_db_context_impl.h b/content/browser/indexed_db/indexed_db_context_impl.h
index 4b874b244778d831e0fa8ca3bbfd7e751897923e..ad2f984e130ece867c0f0dc7ca9ae52b8ec12ae9 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.h
+++ b/content/browser/indexed_db/indexed_db_context_impl.h
@@ -224,6 +224,14 @@ class CONTENT_EXPORT IndexedDBContextImpl
~IndexedDBContextImpl() override;
+ void BindPipesOnIDBSequence(
+ mojo::PendingReceiver<storage::mojom::QuotaClient>
+ pending_quota_client_receiver,
+ mojo::PendingRemote<storage::mojom::BlobStorageContext>
+ pending_blob_storage_context,
+ mojo::PendingRemote<storage::mojom::FileSystemAccessContext>
+ pending_file_system_access_context);
+
// Binds receiver on bucket retrieval to ensure that a bucket always exists
// for a storage key.
void BindIndexedDBWithBucket(
@@ -282,6 +290,8 @@ class CONTENT_EXPORT IndexedDBContextImpl
mojo::Receiver<storage::mojom::QuotaClient> quota_client_receiver_;
const std::unique_ptr<storage::FilesystemProxy> filesystem_proxy_;
+ // weak_factory_->GetWeakPtr() may be used on any thread, but the resulting
+ // pointer must only be checked/used on idb_task_runner_.
base::WeakPtrFactory<IndexedDBContextImpl> weak_factory_{this};
};

View File

@@ -0,0 +1,427 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Austin Eng <enga@chromium.org>
Date: Thu, 23 Jun 2022 03:12:49 +0000
Subject: WebGPU: Mark the context lost on GPU context lost
M102 merge issues:
- dawn_control_client_holder.h/cc:
GetWGPUInstance() not present in M102
Fixes a bug where completely destructing the context instead of
marking it lost when receiving a context lost notification freed
memory still accessible by the page.
Fixed: 1336014
Change-Id: I662e531102af91362b4f62700bfbee507fc44d1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3708646
Commit-Queue: Austin Eng <enga@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1017003}
(cherry picked from commit 6c7f327b7a15aabd3fc5d57e9c05b95d02f1cd36)
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn
index 1c72562d4f58eb77742bfd9539e5d132683949fa..c56507ad59bc111a22c0abd072c1bd21ac3d8808 100644
--- a/third_party/blink/renderer/modules/BUILD.gn
+++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -662,6 +662,7 @@ source_set("unit_tests") {
"//third_party/blink/renderer/modules/peerconnection:test_support",
"//third_party/blink/renderer/modules/storage:unit_tests",
"//third_party/blink/renderer/modules/webcodecs:unit_tests",
+ "//third_party/blink/renderer/modules/webgpu:unit_tests",
"//third_party/blink/renderer/modules/webtransport:unit_tests",
"//third_party/blink/renderer/platform",
"//third_party/blink/renderer/platform:test_support",
diff --git a/third_party/blink/renderer/modules/webgpu/BUILD.gn b/third_party/blink/renderer/modules/webgpu/BUILD.gn
index dcfece568d0e0e2bc5dbd6383fb1a0c2235a296c..71f2880467c50c145d5a68b4cfac62cba61f8e27 100644
--- a/third_party/blink/renderer/modules/webgpu/BUILD.gn
+++ b/third_party/blink/renderer/modules/webgpu/BUILD.gn
@@ -91,3 +91,17 @@ blink_modules_sources("webgpu") {
"//third_party/dawn/include/dawn:headers",
]
}
+
+source_set("unit_tests") {
+ testonly = true
+ sources = [ "gpu_context_lost_test.cc" ]
+
+ deps = [
+ "//base/test:test_support",
+ "//third_party/blink/renderer/controller:blink_bindings_test_sources",
+ "//third_party/blink/renderer/core",
+ "//third_party/blink/renderer/core:testing",
+ "//third_party/blink/renderer/modules",
+ "//third_party/blink/renderer/platform:test_support",
+ ]
+}
diff --git a/third_party/blink/renderer/modules/webgpu/DEPS b/third_party/blink/renderer/modules/webgpu/DEPS
index ded05aa68e59cadddb678d5254119ae3dad1b47e..9e777ab0473f0bb9cbd46e4d6c1498f1a12a6f40 100644
--- a/third_party/blink/renderer/modules/webgpu/DEPS
+++ b/third_party/blink/renderer/modules/webgpu/DEPS
@@ -9,6 +9,7 @@ include_rules = [
"+gpu/command_buffer/client/raster_interface.h",
"+gpu/command_buffer/client/shared_image_interface.h",
"+gpu/command_buffer/client/webgpu_interface.h",
+ "+gpu/command_buffer/client/webgpu_interface_stub.h",
"+media/base/video_frame.h",
"+media/renderers/paint_canvas_video_renderer.h",
"+services/metrics/public/cpp/ukm_builders.h",
diff --git a/third_party/blink/renderer/modules/webgpu/gpu.cc b/third_party/blink/renderer/modules/webgpu/gpu.cc
index 8a1f4dcaf605bc656a6499bd415d9db4db9e8ed4..d86dd384e71894f9aaefaf4491c4fc2aabefbea9 100644
--- a/third_party/blink/renderer/modules/webgpu/gpu.cc
+++ b/third_party/blink/renderer/modules/webgpu/gpu.cc
@@ -287,4 +287,9 @@ void BoxedMappableWGPUBufferHandles::ClearAndDestroyAll(
contents_.clear();
}
+void GPU::SetDawnControlClientHolderForTesting(
+ scoped_refptr<DawnControlClientHolder> dawn_control_client) {
+ dawn_control_client_ = std::move(dawn_control_client);
+}
+
} // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/gpu.h b/third_party/blink/renderer/modules/webgpu/gpu.h
index a7348a1c18a2004734275cb4d6f1f4aa68b11d8e..17362a2ee1b3111b52c93ffd0e3222c3de893479 100644
--- a/third_party/blink/renderer/modules/webgpu/gpu.h
+++ b/third_party/blink/renderer/modules/webgpu/gpu.h
@@ -9,6 +9,7 @@
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
+#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/supplementable.h"
@@ -47,9 +48,9 @@ struct BoxedMappableWGPUBufferHandles
HashSet<void*> contents_;
};
-class GPU final : public ScriptWrappable,
- public Supplement<NavigatorBase>,
- public ExecutionContextLifecycleObserver {
+class MODULES_EXPORT GPU final : public ScriptWrappable,
+ public Supplement<NavigatorBase>,
+ public ExecutionContextLifecycleObserver {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -86,6 +87,9 @@ class GPU final : public ScriptWrappable,
return mappable_buffer_handles_.get();
}
+ void SetDawnControlClientHolderForTesting(
+ scoped_refptr<DawnControlClientHolder> dawn_control_client);
+
private:
void OnRequestAdapterCallback(ScriptState* script_state,
const GPURequestAdapterOptions* options,
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_context_lost_test.cc b/third_party/blink/renderer/modules/webgpu/gpu_context_lost_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1063295a543eaee5650cdaf5b115284b8c2f095e
--- /dev/null
+++ b/third_party/blink/renderer/modules/webgpu/gpu_context_lost_test.cc
@@ -0,0 +1,229 @@
+// Copyright 2022 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/callback.h"
+#include "base/run_loop.h"
+#include "base/test/mock_callback.h"
+#include "gpu/command_buffer/client/webgpu_interface_stub.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
+#include "third_party/blink/renderer/core/frame/local_dom_window.h"
+#include "third_party/blink/renderer/core/frame/local_frame.h"
+#include "third_party/blink/renderer/core/frame/navigator.h"
+#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
+#include "third_party/blink/renderer/modules/webgpu/gpu.h"
+#include "third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.h"
+#include "third_party/blink/renderer/platform/graphics/gpu/drawing_buffer_test_helpers.h"
+
+namespace blink {
+
+namespace {
+
+class WebGPUContextProviderForTest
+ : public WebGraphicsContext3DProviderForTests {
+ public:
+ explicit WebGPUContextProviderForTest(
+ base::MockCallback<base::OnceClosure>* destruction_callback)
+ : WebGraphicsContext3DProviderForTests(
+ std::make_unique<gpu::webgpu::WebGPUInterfaceStub>()),
+ destruction_callback_(destruction_callback) {}
+ ~WebGPUContextProviderForTest() override {
+ if (destruction_callback_) {
+ destruction_callback_->Run();
+ }
+ }
+
+ static WebGPUContextProviderForTest* From(
+ scoped_refptr<DawnControlClientHolder>& dawn_control_client) {
+ return static_cast<WebGPUContextProviderForTest*>(
+ dawn_control_client->GetContextProviderWeakPtr()->ContextProvider());
+ }
+
+ void ClearDestructionCallback() { destruction_callback_ = nullptr; }
+
+ void SetLostContextCallback(
+ base::RepeatingClosure lost_context_callback) override {
+ lost_context_callback_ = std::move(lost_context_callback);
+ }
+
+ void CallLostContextCallback() { lost_context_callback_.Run(); }
+
+ private:
+ base::MockCallback<base::OnceClosure>* destruction_callback_;
+ base::RepeatingClosure lost_context_callback_;
+};
+
+class WebGPUContextLostTest : public testing::Test {
+ protected:
+ void SetUp() override { page_ = std::make_unique<DummyPageHolder>(); }
+
+ std::tuple<ExecutionContext*, GPU*> SetUpGPU(V8TestingScope* v8_test_scope) {
+ ExecutionContext* execution_context =
+ ExecutionContext::From(v8_test_scope->GetScriptState());
+
+ Navigator* navigator = page_->GetFrame().DomWindow()->navigator();
+ GPU* gpu = MakeGarbageCollected<GPU>(*navigator);
+ return std::make_tuple(execution_context, gpu);
+ }
+
+ std::unique_ptr<DummyPageHolder> page_;
+};
+
+// Test that the context provider is destructed after the last reference to
+// its owning DawnControlClientHolder is dropped.
+TEST_F(WebGPUContextLostTest, DestructedAfterLastRefDropped) {
+ V8TestingScope v8_test_scope;
+ ExecutionContext* execution_context =
+ ExecutionContext::From(v8_test_scope.GetScriptState());
+
+ base::MockCallback<base::OnceClosure> destruction_callback;
+ auto context_provider =
+ std::make_unique<WebGPUContextProviderForTest>(&destruction_callback);
+
+ auto dawn_control_client = DawnControlClientHolder::Create(
+ std::move(context_provider),
+ execution_context->GetTaskRunner(TaskType::kWebGPU));
+
+ // Drop the last reference to the DawnControlClientHolder which will
+ // now destroy the context provider.
+ EXPECT_CALL(destruction_callback, Run()).Times(1);
+ dawn_control_client = nullptr;
+}
+
+// Test that the GPU lost context callback marks the context lost, but does not
+// destruct it.
+TEST_F(WebGPUContextLostTest, GPULostContext) {
+ V8TestingScope v8_test_scope;
+ auto [execution_context, gpu] = SetUpGPU(&v8_test_scope);
+
+ base::MockCallback<base::OnceClosure> destruction_callback;
+ auto context_provider =
+ std::make_unique<WebGPUContextProviderForTest>(&destruction_callback);
+
+ auto dawn_control_client = DawnControlClientHolder::Create(
+ std::move(context_provider),
+ execution_context->GetTaskRunner(TaskType::kWebGPU));
+
+ gpu->SetDawnControlClientHolderForTesting(dawn_control_client);
+
+ // Trigger the lost context callback, but the context should not be destroyed.
+ EXPECT_CALL(destruction_callback, Run()).Times(0);
+ WebGPUContextProviderForTest::From(dawn_control_client)
+ ->CallLostContextCallback();
+ testing::Mock::VerifyAndClear(&destruction_callback);
+
+ // The context should be marked lost.
+ EXPECT_TRUE(dawn_control_client->IsContextLost());
+
+ // The context provider should still be live.
+ auto context_provider_weak_ptr =
+ dawn_control_client->GetContextProviderWeakPtr();
+ EXPECT_NE(context_provider_weak_ptr, nullptr);
+
+ // Clear the destruction callback since it is stack-allocated in this frame.
+ static_cast<WebGPUContextProviderForTest*>(
+ context_provider_weak_ptr->ContextProvider())
+ ->ClearDestructionCallback();
+}
+
+// Test that the GPU lost context callback marks the context lost, and then when
+// the context is recreated, the context still lives until the previous
+// DawnControlClientHolder is destroyed.
+TEST_F(WebGPUContextLostTest, RecreatedAfterGPULostContext) {
+ V8TestingScope v8_test_scope;
+ auto [execution_context, gpu] = SetUpGPU(&v8_test_scope);
+
+ base::MockCallback<base::OnceClosure> destruction_callback;
+ auto context_provider =
+ std::make_unique<WebGPUContextProviderForTest>(&destruction_callback);
+
+ auto dawn_control_client = DawnControlClientHolder::Create(
+ std::move(context_provider),
+ execution_context->GetTaskRunner(TaskType::kWebGPU));
+
+ gpu->SetDawnControlClientHolderForTesting(dawn_control_client);
+
+ // Trigger the lost context callback, but the context should not be destroyed.
+ EXPECT_CALL(destruction_callback, Run()).Times(0);
+ WebGPUContextProviderForTest::From(dawn_control_client)
+ ->CallLostContextCallback();
+ testing::Mock::VerifyAndClear(&destruction_callback);
+
+ // The context should be marked lost.
+ EXPECT_TRUE(dawn_control_client->IsContextLost());
+
+ // The context provider should still be live.
+ auto context_provider_weak_ptr =
+ dawn_control_client->GetContextProviderWeakPtr();
+ EXPECT_NE(context_provider_weak_ptr, nullptr);
+
+ // Make a new context provider and DawnControlClientHolder
+ base::MockCallback<base::OnceClosure> destruction_callback2;
+ auto context_provider2 =
+ std::make_unique<WebGPUContextProviderForTest>(&destruction_callback2);
+
+ auto dawn_control_client2 = DawnControlClientHolder::Create(
+ std::move(context_provider2),
+ execution_context->GetTaskRunner(TaskType::kWebGPU));
+
+ // Set the new context, but the previous context should still not be
+ // destroyed.
+ EXPECT_CALL(destruction_callback, Run()).Times(0);
+ gpu->SetDawnControlClientHolderForTesting(dawn_control_client2);
+ testing::Mock::VerifyAndClear(&destruction_callback);
+
+ // Drop the last reference to the previous DawnControlClientHolder which will
+ // now destroy the previous context provider.
+ EXPECT_CALL(destruction_callback, Run()).Times(1);
+ dawn_control_client = nullptr;
+ testing::Mock::VerifyAndClear(&destruction_callback);
+
+ // Clear the destruction callback since it is stack-allocated in this frame.
+ static_cast<WebGPUContextProviderForTest*>(
+ dawn_control_client2->GetContextProviderWeakPtr()->ContextProvider())
+ ->ClearDestructionCallback();
+}
+
+// Test that ContextDestroyed lifecycle event destructs the context.
+TEST_F(WebGPUContextLostTest, ContextDestroyed) {
+ V8TestingScope v8_test_scope;
+ auto [execution_context, gpu] = SetUpGPU(&v8_test_scope);
+
+ base::MockCallback<base::OnceClosure> destruction_callback;
+ auto context_provider =
+ std::make_unique<WebGPUContextProviderForTest>(&destruction_callback);
+
+ auto dawn_control_client = DawnControlClientHolder::Create(
+ std::move(context_provider),
+ execution_context->GetTaskRunner(TaskType::kWebGPU));
+
+ gpu->SetDawnControlClientHolderForTesting(dawn_control_client);
+
+ // Trigger the context destroyed lifecycle event. The context should not be
+ // destroyed yet.
+ EXPECT_CALL(destruction_callback, Run()).Times(0);
+ gpu->ContextDestroyed();
+ testing::Mock::VerifyAndClear(&destruction_callback);
+
+ // The context should be marked lost.
+ EXPECT_TRUE(dawn_control_client->IsContextLost());
+
+ // Getting the context provider should return null.
+ EXPECT_EQ(dawn_control_client->GetContextProviderWeakPtr(), nullptr);
+
+ // The context is destructed in a posted task with a fresh callstack to avoid
+ // re-entrancy issues. Expectations should resolve by the end of the next
+ // task.
+ EXPECT_CALL(destruction_callback, Run()).Times(1);
+ base::RunLoop loop;
+ execution_context->GetTaskRunner(TaskType::kWebGPU)
+ ->PostTask(FROM_HERE, loop.QuitClosure());
+ loop.Run();
+ testing::Mock::VerifyAndClear(&destruction_callback);
+}
+
+} // namespace
+
+} // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.cc b/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.cc
index be5b392fa83a4197958f9f032eac4dd41af61f61..6a6283972e7bf597fdf720eefafb57dc4e3263a2 100644
--- a/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.cc
+++ b/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.cc
@@ -17,9 +17,17 @@ scoped_refptr<DawnControlClientHolder> DawnControlClientHolder::Create(
auto dawn_control_client_holder =
base::MakeRefCounted<DawnControlClientHolder>(std::move(context_provider),
std::move(task_runner));
+ // The context lost callback occurs when the client receives
+ // OnGpuControlLostContext. This can happen on fatal errors when the GPU
+ // channel is disconnected: the GPU process crashes, the GPU process fails to
+ // deserialize a message, etc. We mark the context lost, but NOT destroy the
+ // entire WebGraphicsContext3DProvider as that would free services for mapping
+ // shared memory. There may still be outstanding mapped GPUBuffers pointing to
+ // this memory.
dawn_control_client_holder->context_provider_->ContextProvider()
->SetLostContextCallback(WTF::BindRepeating(
- &DawnControlClientHolder::Destroy, dawn_control_client_holder));
+ &DawnControlClientHolder::MarkContextLost,
+ dawn_control_client_holder->weak_ptr_factory_.GetWeakPtr()));
return dawn_control_client_holder;
}
@@ -38,7 +46,7 @@ DawnControlClientHolder::DawnControlClientHolder(
DawnControlClientHolder::~DawnControlClientHolder() = default;
void DawnControlClientHolder::Destroy() {
- api_channel_->Disconnect();
+ MarkContextLost();
// Destroy the WebGPU context.
// This ensures that GPU resources are eagerly reclaimed.
@@ -68,8 +76,16 @@ DawnControlClientHolder::GetContextProviderWeakPtr() const {
return context_provider_->GetWeakPtr();
}
+void DawnControlClientHolder::MarkContextLost() {
+ if (context_lost_) {
+ return;
+ }
+ api_channel_->Disconnect();
+ context_lost_ = true;
+}
+
bool DawnControlClientHolder::IsContextLost() const {
- return !context_provider_;
+ return context_lost_;
}
std::unique_ptr<RecyclableCanvasResource>
diff --git a/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.h b/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.h
index 550038892c97e8f5f46e7a08c07821aa083b67d1..9e3c086225aff661e2402b974534d27860f4f446 100644
--- a/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.h
+++ b/third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.h
@@ -47,6 +47,7 @@ class PLATFORM_EXPORT DawnControlClientHolder
base::WeakPtr<WebGraphicsContext3DProviderWrapper> GetContextProviderWeakPtr()
const;
const DawnProcTable& GetProcs() const { return procs_; }
+ void MarkContextLost();
bool IsContextLost() const;
std::unique_ptr<RecyclableCanvasResource> GetOrCreateCanvasResource(
const SkImageInfo& info,
@@ -56,11 +57,14 @@ class PLATFORM_EXPORT DawnControlClientHolder
friend class RefCounted<DawnControlClientHolder>;
~DawnControlClientHolder();
+ bool context_lost_ = false;
std::unique_ptr<WebGraphicsContext3DProviderWrapper> context_provider_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
scoped_refptr<gpu::webgpu::APIChannel> api_channel_;
DawnProcTable procs_;
WebGPURecyclableResourceCache recyclable_resource_cache_;
+
+ base::WeakPtrFactory<DawnControlClientHolder> weak_ptr_factory_{this};
};
} // namespace blink

View File

@@ -12,10 +12,10 @@ Auto-Submit: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002495}
diff --git a/content/browser/file_system_access/file_system_chooser.cc b/content/browser/file_system_access/file_system_chooser.cc
index f8cd9d51222c70166a82cdd6dd4b7d0c24970606..8c38f004109aa967e1e5439a17dc35d3013e8ecf 100644
index 86b9af148a86e64f9f4aedb6e39998bf83668745..f6018224c5f0aea3aba6735d49aaa25d077de600 100644
--- a/content/browser/file_system_access/file_system_chooser.cc
+++ b/content/browser/file_system_access/file_system_chooser.cc
@@ -275,13 +275,15 @@ bool FileSystemChooser::IsShellIntegratedExtension(
@@ -276,13 +276,15 @@ bool FileSystemChooser::IsShellIntegratedExtension(
base::FilePath::StringType extension_lower =
base::ToLowerASCII(GetLastExtension(extension));

View File

@@ -0,0 +1,139 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marijn Kruisselbrink <mek@chromium.org>
Date: Wed, 27 Apr 2022 20:51:50 +0000
Subject: Reland "Close a MessagePort if it is created in a destroyed context."
This is a reland of commit 068f13cc5aa5f7a6e9faf28d8731275e64cb657b
This reland changes the timeout in the test from 3 to 2 seconds, because
two 3 second timeouts is too long for chrome's default overall test
timeout of 6 seconds on non-dcheck release builds.
Original change's description:
> Close a MessagePort if it is created in a destroyed context.
>
> MessagePort assumes it is only destroyed either after ContextDestroyed,
> or after the port has been closed explicitly. As it turns out ports that
> were created in an already detached iframe would violate this invariant,
> causing issues.
>
> Bug: 1228661
> Change-Id: Ib1abce15f1d1d15f044de19fe0534767db488af0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3561845
> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#988859}
Bug: 1228661
Change-Id: Ifc5ec866678667b0d81438e2a2c8e5ada6e19d8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3609249
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Auto-Submit: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996880}
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index 6f67b21803fcdc2498ef207878d1541e04822fca..7f3df8ea567f91cd063122aab63a5c5424ab7919 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -55,7 +55,11 @@
namespace blink {
MessagePort::MessagePort(ExecutionContext& execution_context)
- : ExecutionContextLifecycleObserver(&execution_context),
+ : ExecutionContextLifecycleObserver(execution_context.IsContextDestroyed()
+ ? nullptr
+ : &execution_context),
+ // Ports in a destroyed context start out in a closed state.
+ closed_(execution_context.IsContextDestroyed()),
task_runner_(execution_context.GetTaskRunner(TaskType::kPostedMessage)) {}
MessagePort::~MessagePort() {
@@ -168,10 +172,21 @@ void MessagePort::Entangle(MessagePortDescriptor port) {
DCHECK(port.IsValid());
DCHECK(!connector_);
+ // If the context was already destroyed, there is no reason to actually
+ // entangle the port and create a Connector. No messages will ever be able to
+ // be sent or received anyway, as StartReceiving will never be called.
+ if (!GetExecutionContext())
+ return;
+
port_ = std::move(port);
connector_ = std::make_unique<mojo::Connector>(
port_.TakeHandleToEntangle(GetExecutionContext()),
mojo::Connector::SINGLE_THREADED_SEND);
+ // The raw `this` is safe despite `this` being a garbage collected object
+ // because we make sure that:
+ // 1. This object will not be garbage collected while it is connected and
+ // the execution context is not destroyed, and
+ // 2. when the execution context is destroyed, the connector_ is reset.
connector_->set_incoming_receiver(this);
connector_->set_connection_error_handler(
WTF::Bind(&MessagePort::close, WrapWeakPersistent(this)));
diff --git a/third_party/blink/renderer/core/messaging/message_port.h b/third_party/blink/renderer/core/messaging/message_port.h
index 83d7901d99ad01ba039ea1ffa3dbee2595fc31ff..f9baba3c6d13992508da48a13c97bb10c8ec56e0 100644
--- a/third_party/blink/renderer/core/messaging/message_port.h
+++ b/third_party/blink/renderer/core/messaging/message_port.h
@@ -148,7 +148,7 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData,
std::unique_ptr<mojo::Connector> connector_;
bool started_ = false;
- bool closed_ = false;
+ bool closed_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
diff --git a/third_party/blink/web_tests/external/wpt/webmessaging/message-channels/detached-iframe.window.js b/third_party/blink/web_tests/external/wpt/webmessaging/message-channels/detached-iframe.window.js
new file mode 100644
index 0000000000000000000000000000000000000000..c1effaf141b7246320883e293b58dabbc3572123
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/webmessaging/message-channels/detached-iframe.window.js
@@ -0,0 +1,47 @@
+// META: title=MessageChannel in a detached iframe test
+// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
+// Pull in the with_iframe helper function from the service worker tests
+
+
+const IframeAction = {
+ REMOVE_BEFORE_CREATION: 'remove-before-creation',
+ REMOVE_AFTER_CREATION: 'remove-after-creation',
+};
+
+async function detached_frame_test(t, action) {
+ const iframe = await with_iframe('about:blank');
+ const iframe_MessageChannel = iframe.contentWindow.MessageChannel;
+
+ if (action === IframeAction.REMOVE_BEFORE_CREATION) {
+ iframe.remove();
+ }
+
+ (() => {
+ const mc = new iframe_MessageChannel();
+ mc.port1.postMessage("boo");
+ mc.port2.onmessage = t.unreached_func("message event received");
+ mc.port2.onmessageerror = t.unreached_func("message event received");
+ })();
+
+ if (action === IframeAction.REMOVE_AFTER_CREATION) {
+ iframe.remove();
+ }
+
+ // TODO(https://github.com/web-platform-tests/wpt/issues/7899): Change to
+ // some sort of cross-browser GC trigger.
+ if (self.gc) self.gc();
+
+ // We are testing that neither of the above two events fire. We assume that a 2 second timeout
+ // is good enough. We can't use any other API for an end condition because each MessagePort has
+ // its own independent port message queue, which has no ordering guarantees relative to other
+ // APIs.
+ await new Promise(resolve => t.step_timeout(resolve, 2000));
+}
+
+promise_test(async (t) => {
+ return detached_frame_test(t, IframeAction.REMOVE_AFTER_CREATION);
+}, 'MessageChannel created from a detached iframe should not send messages (remove after create)');
+
+promise_test(async (t) => {
+ return detached_frame_test(t, IframeAction.REMOVE_BEFORE_CREATION);
+}, 'MessageChannel created from a detached iframe should not send messages (remove before create)');

View File

@@ -0,0 +1,102 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Date: Mon, 18 Jul 2022 20:44:41 +0000
Subject: Keep refptr to ServiceWorkerVersion in MaybeTimeoutRequest
The callback in ServiceWorkerVersion::MaybeTimeoutRequest may reduce the
reference to the version object, which can be the last reference to it.
In thet case, the object can be destroyed and the `inflight_requests_`
field access after the callback become invalid.
This CL keeps this to avoid the object destruction.
(cherry picked from commit 5926fa916d9ad53c77e31ee757e1979275d7466c)
Bug: 1339844
Change-Id: I6564627bad0527dea007ca73261c5636dab56755
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3739330
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Sergei Glazunov <glazunov@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1023475}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3766241
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Srinivas Sista <srinivassista@chromium.org>
Cr-Commit-Position: refs/branch-heads/5005@{#1263}
Cr-Branched-From: 5b4d9450fee01f821b6400e947b3839727643a71-refs/heads/main@{#992738}
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index 0b4b32d13db8958f579085a41bc5e20b26543f61..5797e3f954ae0769a91c8f259e19e50e2bf31a94 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -1993,18 +1993,17 @@ void ServiceWorkerVersion::OnTimeoutTimer() {
MarkIfStale();
+ // Global `this` protecter.
+ // callbacks initiated by this function sometimes reduce refcnt to 0
+ // to make this instance freed.
+ scoped_refptr<ServiceWorkerVersion> protect_this(this);
+
// Stopping the worker hasn't finished within a certain period.
if (GetTickDuration(stop_time_) > kStopWorkerTimeout) {
DCHECK_EQ(EmbeddedWorkerStatus::STOPPING, running_status());
ReportError(blink::ServiceWorkerStatusCode::kErrorTimeout,
"DETACH_STALLED_IN_STOPPING");
- // Detach the worker. Remove |this| as a listener first; otherwise
- // OnStoppedInternal might try to restart before the new worker
- // is created. Also, protect |this|, since swapping out the
- // EmbeddedWorkerInstance could destroy our ServiceWorkerHost which could in
- // turn destroy |this|.
- scoped_refptr<ServiceWorkerVersion> protect_this(this);
embedded_worker_->RemoveObserver(this);
embedded_worker_->Detach();
embedded_worker_ = std::make_unique<EmbeddedWorkerInstance>(this);
@@ -2031,7 +2030,6 @@ void ServiceWorkerVersion::OnTimeoutTimer() {
DCHECK(running_status() == EmbeddedWorkerStatus::STARTING ||
running_status() == EmbeddedWorkerStatus::STOPPING)
<< static_cast<int>(running_status());
- scoped_refptr<ServiceWorkerVersion> protect(this);
FinishStartWorker(blink::ServiceWorkerStatusCode::kErrorTimeout);
if (running_status() == EmbeddedWorkerStatus::STARTING)
embedded_worker_->Stop();
@@ -2040,17 +2038,22 @@ void ServiceWorkerVersion::OnTimeoutTimer() {
// Requests have not finished before their expiration.
bool stop_for_timeout = false;
- auto timeout_iter = request_timeouts_.begin();
- while (timeout_iter != request_timeouts_.end()) {
+ std::set<InflightRequestTimeoutInfo> request_timeouts;
+ request_timeouts.swap(request_timeouts_);
+ auto timeout_iter = request_timeouts.begin();
+ while (timeout_iter != request_timeouts.end()) {
const InflightRequestTimeoutInfo& info = *timeout_iter;
- if (!RequestExpired(info.expiration))
+ if (!RequestExpired(info.expiration)) {
break;
+ }
if (MaybeTimeoutRequest(info)) {
stop_for_timeout =
stop_for_timeout || info.timeout_behavior == KILL_ON_TIMEOUT;
}
- timeout_iter = request_timeouts_.erase(timeout_iter);
+ timeout_iter = request_timeouts.erase(timeout_iter);
}
+ DCHECK(request_timeouts_.empty());
+ request_timeouts_.swap(request_timeouts);
if (stop_for_timeout && running_status() != EmbeddedWorkerStatus::STOPPING)
embedded_worker_->Stop();
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index dcf0dfaf515f8058438d727b30fb4c508a7211a9..a88bc2513f988a00b538baa596a1e713c2600cf8 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -863,6 +863,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
bool is_browser_startup_complete,
blink::ServiceWorkerStatusCode status);
+ // The caller of MaybeTimeoutRequest must increase reference count of |this|
+ // to avoid it deleted during the execution.
bool MaybeTimeoutRequest(const InflightRequestTimeoutInfo& info);
void SetAllRequestExpirations(const base::TimeTicks& expiration);

View File

@@ -97,10 +97,10 @@ index dc808af395333a2bd81c2bd73faac4c6063fd409..8fa96906c0288d0021c1500bd442a35c
struct FileFilterSpec {
// A human readable description of this filter. E.g. "HTML Files."
diff --git a/ui/shell_dialogs/execute_select_file_win_unittest.cc b/ui/shell_dialogs/execute_select_file_win_unittest.cc
index df5e8a89d9b0854626a99750a56e3f2500dba812..b6c604fa5a798ba6e448e892ca7a9212cce507fc 100644
index 8ea243924a1834dbe88dd53c5c6e8bde46d33b08..6237bf7d640e55929fb3c549674520f20adb0c94 100644
--- a/ui/shell_dialogs/execute_select_file_win_unittest.cc
+++ b/ui/shell_dialogs/execute_select_file_win_unittest.cc
@@ -50,3 +50,38 @@ TEST(ShellDialogsWin, AppendExtensionIfNeeded) {
@@ -51,3 +51,38 @@ TEST(ShellDialogsWin, AppendExtensionIfNeeded) {
test_cases[i].suggested_ext));
}
}

View File

@@ -19,10 +19,10 @@ Cr-Commit-Position: refs/branch-heads/5112@{#820}
Cr-Branched-From: b13d3fe7b3c47a56354ef54b221008afa754412e-refs/heads/main@{#1012729}
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index c015d4b06a44c9121576d14160b84e871081fa33..0afe3c60715c948c7e376f81646c11b29cc01486 100644
index 0f8171dd0dd0b438a0406535e5693b22358d81e5..7d90add9e441451e3ae23dc5de4fa305819e0590 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1971,7 +1971,7 @@ void PDFiumEngine::SearchUsingICU(const std::u16string& term,
@@ -1981,7 +1981,7 @@ void PDFiumEngine::SearchUsingICU(const std::u16string& term,
}
void PDFiumEngine::AddFindResult(const PDFiumRange& result) {
@@ -31,7 +31,7 @@ index c015d4b06a44c9121576d14160b84e871081fa33..0afe3c60715c948c7e376f81646c11b2
// Figure out where to insert the new location, since we could have
// started searching midway and now we wrapped.
size_t result_index;
@@ -1988,7 +1988,6 @@ void PDFiumEngine::AddFindResult(const PDFiumRange& result) {
@@ -1998,7 +1998,6 @@ void PDFiumEngine::AddFindResult(const PDFiumRange& result) {
UpdateTickMarks();
client_->NotifyNumberOfFindResultsChanged(find_results_.size(), false);
if (first_result) {

View File

@@ -0,0 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Etienne Bergeron <etienneb@chromium.org>
Date: Tue, 19 Jul 2022 16:46:43 +0000
Subject: Fix incorrect text itemization for \r codepoint
M96 merge issues:
render_text_unittest.cc
Tests Clusterfuzz_Issue_1298286/1299054 aren't present
in M96 and caused a merge conflict.
The "\r" codepoint should be split to be rendered in a single
harfbuzz run (same as "\n").
We do recognize these sequences as newline:
\r
\n
\r\n
Previously, the itemization will leave the "\r" with the previous
run. This is leading to incorrect multiline lines splitting.
(cherry picked from commit eee0c5ca752ad50df9986c551cb98226ce078893)
Bug: 1287804
Change-Id: Idfc00a3cf147eb53258d5da9ea105e2d6dc25f05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3708936
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1014955}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3726349
Reviewed-by: Etienne Bergeron <etienneb@chromium.org>
Commit-Queue: Roger Felipe Zanoni da Silva <rzanoni@google.com>
Cr-Commit-Position: refs/branch-heads/4664@{#1662}
Cr-Branched-From: 24dc4ee75e01a29d390d43c9c264372a169273a7-refs/heads/main@{#929512}
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index cd19053ad39a8386b348ae89fb2cf59bcfddb01a..cd779904454940f744cd82c5365ece7147633c2b 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -201,7 +201,7 @@ GraphemeProperties RetrieveGraphemeProperties(const base::StringPiece16& text,
properties.block = ublock_getCode(codepoint);
}
- if (codepoint == '\n' || codepoint == ' ')
+ if (codepoint == '\n' || codepoint == '\r' || codepoint == ' ')
properties.has_control = true;
if (IsBracket(codepoint))
properties.has_bracket = true;
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index 43d03699495c935cd1203e8195d12571fa92b347..e33d25270efb49ee8498108dfa0473b4f760d732 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -1575,6 +1575,9 @@ const RunListCase kBasicsRunListCases[] = {
{"multiline_newline1", u"\n\n", "[0][1]", true},
{"multiline_newline2", u"\r\n\r\n", "[0->1][2->3]", true},
{"multiline_newline3", u"\r\r\n", "[0][1->2]", true},
+ {"multiline_newline4", u"x\r\r", "[0][1][2]", true},
+ {"multiline_newline5", u"x\n\r\r", "[0][1][2][3]", true},
+ {"multiline_newline6", u"x\ny\rz\r\n", "[0][1][2][3][4][5->6]", true},
};
INSTANTIATE_TEST_SUITE_P(ItemizeTextToRunsBasics,
@@ -8561,4 +8564,14 @@ TEST_F(RenderTextTest, StringSizeUpdatedWhenDeviceScaleFactorChanges) {
}
#endif
+TEST_F(RenderTextTest, Clusterfuzz_Issue_1287804) {
+ RenderText* render_text = GetRenderText();
+ render_text->SetMaxLines(1);
+ render_text->SetText(u">\r\r");
+ render_text->SetMultiline(true);
+ render_text->SetDisplayRect(Rect(0, 0, 100, 24));
+ render_text->SetElideBehavior(ELIDE_TAIL);
+ EXPECT_EQ(RangeF(0, 0), render_text->GetCursorSpan(Range(0, 0)));
+}
+
} // namespace gfx

View File

@@ -0,0 +1,259 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Garrett Tanzer <gtanzer@chromium.org>
Date: Wed, 2 Mar 2022 18:33:42 +0000
Subject: Reland "Fix noopener case for user activation consumption"
This is a reland of e9828a82b5c182dc9a7fb0ae7226c35ba1726e7d
The MSAN error is from checking status before err in
content/renderer/render_view_impl.cc .
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/b8821495655905086193/overview
The fix is to split the check for err and kIgnore into two checks,
and put the err check before kBlocked.
It is probably possible for the browser to consume user activation
but then eventually mojo returns an error and the renderer doesn't
consume activation, but that seems pretty marginal.
Original change's description:
> Fix noopener case for user activation consumption
>
>
> The flow for user activation consumption in window.open was as follows:
>
> Renderer: ask the browser to create a new window
> Browser: consume transient user activation (in the browser, and via RPC
> to remote frames only)
> Browser: return success for opener, return ignore for noopener
> Renderer: consume transient user activation upon success
>
> So in the noopener case, the renderer with the local frame where the
> window.open originated didn't have its transient user activation
> consumed.
>
>
> The new behavior is to consume user activation in the calling renderer
> whenever it is consumed in the browser. We accomplish this by returning
> a distinct value kBlocked to represent failure before the browser
> consumes user activation.
>
> Bug: 1264543, 1291210
> Change-Id: Iffb6e3fd772bef625d3d28e600e6fb73d70ab29f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3468171
> Reviewed-by: Dominic Farolino <dom@chromium.org>
> Reviewed-by: Ken Buchanan <kenrb@chromium.org>
> Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
> Reviewed-by: Charles Reis <creis@chromium.org>
> Reviewed-by: Jonathan Ross <jonross@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Garrett Tanzer <gtanzer@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#973876}
Bug: 1264543, 1291210
Change-Id: Ie27c4d68db34dfd98adee7cc5c743953dad59834
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3481666
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Charles Reis <creis@chromium.org>
Commit-Queue: Garrett Tanzer <gtanzer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#976745}
diff --git a/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc b/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
index 4c7d9a3fc2d90b751b8b6dd109f223132eb27fe6..2c6ec16e1700882a0ea30c022e1bb0b5eb3a88f8 100644
--- a/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
+++ b/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
@@ -1187,6 +1187,52 @@ IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest,
EXPECT_FALSE(frame_c_popup_opened);
}
+// Test that opening a window with `noopener` consumes user activation.
+// crbug.com/1264543, crbug.com/1291210
+IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest,
+ UserActivationConsumptionNoopener) {
+ // Start on a page a.com.
+ GURL main_url(embedded_test_server()->GetURL(
+ "a.com", "/cross_site_iframe_factory.html?a"));
+ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), main_url));
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ // Activate the frame by executing a dummy script.
+ const std::string no_op_script = "// No-op script";
+ EXPECT_TRUE(ExecuteScript(web_contents, no_op_script));
+
+ // Add a popup observer.
+ content::TestNavigationObserver popup_observer(nullptr);
+ popup_observer.StartWatchingNewWebContents();
+
+ // Open a popup from the frame, with `noopener`. This should consume
+ // transient user activation.
+ GURL popup_url(embedded_test_server()->GetURL("popup.com", "/"));
+ EXPECT_TRUE(ExecuteScriptWithoutUserGesture(
+ web_contents,
+ base::StringPrintf(
+ "window.w = window.open('%s'+'title1.html', '_blank', 'noopener');",
+ popup_url.spec().c_str())));
+
+ // Try to open another popup.
+ EXPECT_TRUE(ExecuteScriptWithoutUserGesture(
+ web_contents,
+ base::StringPrintf(
+ "window.w = window.open('%s'+'title2.html', '_blank', 'noopener');",
+ popup_url.spec().c_str())));
+
+ // Wait and check that only one popup was opened.
+ popup_observer.Wait();
+ EXPECT_EQ(2, browser()->tab_strip_model()->count());
+
+ content::WebContents* popup =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_EQ(embedded_test_server()->GetURL("popup.com", "/title1.html"),
+ popup->GetLastCommittedURL());
+ EXPECT_NE(popup, web_contents);
+}
+
// TODO(crbug.com/1021895): Flaky.
// Tests that a cross-site iframe runs its beforeunload handler when closing a
// tab. See https://crbug.com/853021.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index afd175d35096b0a50ccee3f2b14c632adbfec58a..b346e9adcb73d80c260e4095b140acd319f69e89 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6719,17 +6719,22 @@ void RenderFrameHostImpl::CreateNewWindow(
effective_transient_activation_state, params->opener_suppressed,
&no_javascript_access);
- bool was_consumed = false;
- if (can_create_window) {
- // Consume activation even w/o User Activation v2, to sync other renderers
- // with calling renderer.
- was_consumed = frame_tree_node_->UpdateUserActivationState(
- blink::mojom::UserActivationUpdateType::kConsumeTransientActivation,
- blink::mojom::UserActivationNotificationType::kNone);
- } else {
- std::move(callback).Run(mojom::CreateNewWindowStatus::kIgnore, nullptr);
- return;
- }
+ // If this frame isn't allowed to create a window, return early (before we
+ // consume transient user activation).
+ if (!can_create_window) {
+ std::move(callback).Run(mojom::CreateNewWindowStatus::kBlocked, nullptr);
+ return;
+ }
+
+ // Otherwise, consume user activation before we proceed. In particular, it is
+ // important to do this before we return from the |opener_suppressed| case
+ // below.
+ // NB: This call will consume activations in the browser and the remote frame
+ // proxies for this frame. The initiating renderer will consume its view of
+ // the activations after we return.
+ bool was_consumed = frame_tree_node_->UpdateUserActivationState(
+ blink::mojom::UserActivationUpdateType::kConsumeTransientActivation,
+ blink::mojom::UserActivationNotificationType::kNone);
// For Android WebView, we support a pop-up like behavior for window.open()
// even if the embedding app doesn't support multiple windows. In this case,
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index 80f7dd56fdaa94a9880995b2b5393af0414eef29..f3d13fc719324e064f70077deb5d95cb9e467820 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -558,8 +558,10 @@ struct CreateNewWindowParams {
// Operation result when the renderer asks the browser to create a new window.
enum CreateNewWindowStatus {
- // Ignore creation of the new window. This can happen because creation is
- // blocked or because the new window should have no opener relationship.
+ // Creation of the new window was blocked, e.g. because the source frame
+ // doesn't have user activation.
+ kBlocked,
+ // Ignore creation of the new window, e.g. because noopener is in effect.
kIgnore,
// Reuse the current window rather than creating a new window.
kReuse,
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index aa65517a568aa0b324b2c8cca8f60bb532ba085a..11815bca2741002dd8595af026ef402bc2af999e 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -311,8 +311,27 @@ WebView* RenderViewImpl::CreateView(
mojom::CreateNewWindowStatus status;
mojom::CreateNewWindowReplyPtr reply;
auto* frame_host = creator_frame->GetFrameHost();
- bool err = !frame_host->CreateNewWindow(std::move(params), &status, &reply);
- if (err || status == mojom::CreateNewWindowStatus::kIgnore)
+ if (!frame_host->CreateNewWindow(std::move(params), &status, &reply)) {
+ // The sync IPC failed, e.g. maybe the render process is in the middle of
+ // shutting down. Can't create a new window without the browser process,
+ // so just bail out.
+ return nullptr;
+ }
+
+ // If creation of the window was blocked (e.g. because this frame doesn't
+ // have user activation), return before consuming user activation. A frame
+ // that isn't allowed to open a window shouldn't be able to consume the
+ // activation for the rest of the frame tree.
+ if (status == mojom::CreateNewWindowStatus::kBlocked)
+ return nullptr;
+
+ // Consume the transient user activation in the current renderer.
+ consumed_user_gesture = creator->ConsumeTransientUserActivation(
+ blink::UserActivationUpdateSource::kBrowser);
+
+ // If we should ignore the new window (e.g. because of `noopener`), return
+ // now that user activation was consumed.
+ if (status == mojom::CreateNewWindowStatus::kIgnore)
return nullptr;
// For Android WebView, we support a pop-up like behavior for window.open()
@@ -332,11 +351,6 @@ WebView* RenderViewImpl::CreateView(
DCHECK_NE(MSG_ROUTING_NONE, reply->main_frame_route_id);
DCHECK_NE(MSG_ROUTING_NONE, reply->widget_params->routing_id);
- // The browser allowed creation of a new window and consumed the user
- // activation.
- consumed_user_gesture = creator->ConsumeTransientUserActivation(
- blink::UserActivationUpdateSource::kBrowser);
-
// While this view may be a background extension page, it can spawn a visible
// render view. So we just assume that the new one is not another background
// page instead of passing on our own value.
diff --git a/third_party/blink/web_tests/wpt_internal/fenced_frame/consume-user-activation.https.html b/third_party/blink/web_tests/wpt_internal/fenced_frame/consume-user-activation.https.html
index d78d08e18a803f66d5136b193abfa26fd7ab087a..e4ad20d17b7fdcec69f25e652dab967f9b52cf65 100644
--- a/third_party/blink/web_tests/wpt_internal/fenced_frame/consume-user-activation.https.html
+++ b/third_party/blink/web_tests/wpt_internal/fenced_frame/consume-user-activation.https.html
@@ -88,11 +88,7 @@ promise_test(async () => {
// Check that B's transient user activation was consumed.
assert_activations(true, true, "A");
- // TODO(crbug.com/1291210): B should be inactive after consuming the
- // transient user activation, but due to a preexisting bug it isn't.
- // Replace with this once fixed:
- // await B.execute(assert_activations, [true, false, "B"]);
- await B.execute(assert_activations, [true, true, "B"]);
+ await B.execute(assert_activations, [true, false, "B"]);
}, 'user-activation');
</script>
diff --git a/third_party/blink/web_tests/wpt_internal/fenced_frame/restrict-size.https.html b/third_party/blink/web_tests/wpt_internal/fenced_frame/restrict-size.https.html
new file mode 100644
index 0000000000000000000000000000000000000000..5668407d7e1e6ac7840fc47b76869787cb3f3d63
--- /dev/null
+++ b/third_party/blink/web_tests/wpt_internal/fenced_frame/restrict-size.https.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>Test fencedframe size restrictions in opaque ads mode.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/utils.js"></script>
+<script src="/common/dispatcher/dispatcher.js"></script>
+<script src="resources/utils.js"></script>
+
+<body>
+<script>
+promise_test(async () => {
+ const frame = attachFencedFrameContext();
+}, 'restrict fencedframe size');
+</script>
+</body>

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Justin Novosad <junov@chromium.org>
Date: Fri, 15 Jul 2022 23:12:50 +0000
Subject: Mitigate bad cast in OffscreenCanvas::GetFontSelector
This change will cause the browser to crash if the execution context
is not a Window or WorkerGlobalScope. This is a temporary solution
to handle the case where the execution context is an
AudioWorkletGlobalScope. The longer term solution, which will be
implemented in a follow-up CL, is to block OffscreenCanvas objects from
being transferred to AudioWorklets, as required by the postMessage spec.
BUG=1334864
(cherry picked from commit 028c11e59fd41bc22eff06dbec10fe9b0e82bd04)
Change-Id: Ief5e37eca6dff14098b12cdbe6fc362c3dd87d1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722117
Auto-Submit: Justin Novosad <junov@chromium.org>
Reviewed-by: Juanmi Huertas <juanmihd@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1017357}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3752921
Commit-Queue: Srinivas Sista <srinivassista@chromium.org>
Cr-Commit-Position: refs/branch-heads/5005@{#1254}
Cr-Branched-From: 5b4d9450fee01f821b6400e947b3839727643a71-refs/heads/main@{#992738}
diff --git a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
index 584920aad8a3bfd9f00bf0db99fdf1891b13176b..4625aec940a349e94f591e2b96801c99dcb3ef05 100644
--- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
+++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
@@ -548,6 +548,9 @@ FontSelector* OffscreenCanvas::GetFontSelector() {
if (auto* window = DynamicTo<LocalDOMWindow>(GetExecutionContext())) {
return window->document()->GetStyleEngine().GetFontSelector();
}
+ // TODO(crbug.com/1334864): Temporary mitigation. Remove the following
+ // CHECK once a more comprehensive solution has been implemented.
+ CHECK(GetExecutionContext()->IsWorkerGlobalScope());
return To<WorkerGlobalScope>(GetExecutionContext())->GetFontSelector();
}

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