Compare commits

..

158 Commits

Author SHA1 Message Date
Electron Bot
42efa2ad04 Bump v9.0.6 2020-06-24 14:01:03 -07:00
trop[bot]
8b61d26a70 fix: frameless vibrant modals shouldn't bezel (#24285)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-24 10:15:22 -07:00
Jeremy Rose
783590276e fix: backport nodejs/node#33682 (#24267) 2020-06-24 00:58:11 -07:00
trop[bot]
f7b6249d00 fix: only notify mouse-up on mouse-up (#24259)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-23 09:20:00 -07:00
Electron Bot
28350b4e00 Bump v9.0.5 2020-06-22 10:50:19 -07:00
Samuel Attard
31e8b9f4ba build: remove dead symlink from MAS build (#24158) (#24238)
* build: remove dead symlink from MAS build

* chore: new out cache

* build: fixup gn check

* Update node_main.cc

* chore: fix lint
2020-06-22 10:41:01 -07:00
trop[bot]
06902de06b fix: emit click events with tray context menu (#24236)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-22 09:15:05 -07:00
Electron Bot
f92b42eda5 chore: bump chromium in DEPS to 83.0.4103.119 (#24234) 2020-06-22 08:58:16 -07:00
trop[bot]
3704dc9284 fix: isTrustedSender() in test-app (#24232)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-06-22 08:23:52 -07:00
Electron Bot
d321e2940e chore: bump chromium to 83.0.4103.118 (9-x-y) (#24219)
* chore: bump chromium in DEPS to 83.0.4103.117

* chore: bump chromium in DEPS to 83.0.4103.118
2020-06-21 12:41:04 -07:00
Electron Bot
305d75516b chore: bump chromium in DEPS to 83.0.4103.115 (#24210) 2020-06-19 16:44:27 -07:00
Electron Bot
5d18005338 chore: bump chromium in DEPS to 83.0.4103.114 (#24198) 2020-06-18 09:39:25 -07:00
trop[bot]
ee27523363 fix: do not use CONTEXT_MENU flag for tray menu (reland) (#24193) 2020-06-18 08:35:13 -07:00
trop[bot]
368f583399 fix: volume key globalShortcut deregistration (#24155)
Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-06-17 21:45:48 -07:00
trop[bot]
f6d3c565fe Make pasteandmatchstyle accelerator OS specific (#24185)
Co-authored-by: Elena Topaka <el1topa@gmail.com>
2020-06-17 21:43:56 -07:00
Robo
f11aad0784 fix: let Node.js perform microtask checkpoint in the main process (#24131) (#24178)
* fix: let Node.js perform microtask checkpoint in the main process

* fix: don't specify v8::MicrotasksScope for explicit policy

* fix: remove checkpoint from some call-sites

We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.

* fix: remove checkpoint from some call-sites

We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.

* fix incorrect specs

* default constructor arguments are considered for explicit mark

* add regression spec
2020-06-17 16:00:56 -07:00
Robo
b0cbf49ee0 chore: cherry-pick c20afc96e36f57 from chromium (#24059) 2020-06-17 12:15:06 -07:00
trop[bot]
f7c4199853 docs: fix MenuItem click handler type (#24177)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-17 11:30:18 -07:00
Electron Bot
4a092ccdf2 chore: bump chromium in DEPS to 83.0.4103.113 (#24172) 2020-06-17 10:32:37 -07:00
Electron Bot
71a104ae48 chore: bump chromium in DEPS to 83.0.4103.112 (#24150) 2020-06-16 09:52:17 -07:00
trop[bot]
284017b22c fix: emit 'shutdown' outside -[NSApplication terminate:] (#24141)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-15 21:02:50 -07:00
trop[bot]
e8e05f7e99 fix: handle non-client area pointer events from pen on Win10 (#24103)
* fix: handle non client pointer events from pen on Win10

* fix trop oops

* update patches

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-06-15 18:57:59 -07:00
Electron Bot
2734773305 chore: bump chromium to 83.0.4103.109 (9-x-y) (#24127)
* chore: bump chromium in DEPS to 83.0.4103.108

* chore: bump chromium in DEPS to 83.0.4103.109
2020-06-15 18:05:34 -07:00
trop[bot]
db7ac3587e fix: correctly handle nexttick scheduling in stream reads (#24082)
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2020-06-15 19:00:47 +09:00
Electron Bot
87d6f6f599 chore: bump chromium to 83.0.4103.107 (9-x-y) (#24098)
* chore: bump chromium in DEPS to 83.0.4103.105

* chore: bump chromium in DEPS to 83.0.4103.107
2020-06-13 08:27:22 -07:00
trop[bot]
496b0f811f fix: showing certificate dialog with no window (#24121)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-13 08:19:44 -07:00
trop[bot]
0d80baf528 fix: fs.readdir should support withFileTypes (#24108)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-12 13:41:48 -07:00
Electron Bot
bcf77df3d9 Bump v9.0.4 2020-06-12 12:34:10 -07:00
Robo
dfc9be60c9 chore: cherry-pick 867fcd45891e from chromium (#24060)
https://chromium-review.googlesource.com/c/chromium/src/+/2134037
2020-06-11 17:22:42 -07:00
Samuel Attard
3d6125894b Revert "fix: do not use CONTEXT_MENU flag for tray menu (#23880)" (#24078)
This reverts commit 26c6c81540.
2020-06-11 14:26:48 -04:00
Robo
d5fe2812ff chore: cherry-pick bc4df9dd11e609e from chromium (#24061) 2020-06-11 10:28:35 -07:00
Electron Bot
13499392e9 chore: bump chromium in DEPS to 83.0.4103.104 (#24068) 2020-06-11 09:54:27 -07:00
trop[bot]
03e7293384 fix: Add .paks for media-internals and webrtc-internals pages (#24058)
* fix: adds paks for media-internals and webrtc-internals pages

* adds tests

Co-authored-by: gellert <gellert.hegyi@around.co>
2020-06-11 09:25:50 -07:00
Cheng Zhao
9a7c2fa2af fix: assign session to remote webContents (#24065)
Co-authored-by: Eryk Rakowski <sentialx@gmail.com>
2020-06-11 10:07:20 -04:00
trop[bot]
974be18991 fix: backport libuv patch for failure to load advapi32 (#24039)
* chore: backport advapi32 libuv fix

* Update .patches

* Update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-11 12:55:42 +09:00
trop[bot]
acd8829190 fix: Allow windows behind macOS elements if frame = false (#24033)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2020-06-11 10:56:10 +09:00
Electron Bot
cc5acfa0ed chore: bump chromium to 83.0.4103.103 (9-x-y) (#24050)
* chore: bump chromium in DEPS to 83.0.4103.103

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-10 13:53:07 -04:00
Electron Bot
604cd3d09b chore: bump chromium in DEPS to 83.0.4103.102 (#24028) 2020-06-09 14:07:14 -04:00
Shelley Vohr
413e41f7db fix: compensate for lazy-loaded circular deps (#23956) 2020-06-08 12:03:18 -04:00
Jeremy Rose
4c485e53a4 fix: throw instead of crash when using ipcRenderer after context released (#23917) (#23978)
* fix: throw instead of crash when using ipcRenderer after context released (#23917)

* meh

* test: reduce flakiness of post-context-release ipc test
2020-06-08 10:57:12 -05:00
trop[bot]
e9427e7b92 fix: add missing isComposing KeyboardEvent property (#23996)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-08 10:55:39 -05:00
Electron Bot
36673bf5e6 chore: bump chromium in DEPS to 83.0.4103.101 (#24013) 2020-06-08 10:48:09 -04:00
Robo
fc9fb0b179 fix: default to NTLM v2 in the network service for POSIX platforms (#23934)
* build: fix for "enable_desktop_capturer = false" (#23864)

* build: fix filenames autogen with new BUILDFLAG syntax (#23952)

* fix: default to NTLM v2 in the network service for POSIX platforms (#23846)

* chore: update patch

Co-authored-by: Alexey Kuzmin <alkuzmin@microsoft.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-07 13:56:08 -07:00
Electron Bot
4ad03dc60a Bump v9.0.3 2020-06-05 11:55:50 -07:00
Electron Bot
72dbe13f76 chore: bump chromium in DEPS to 83.0.4103.100 (#23986) 2020-06-05 11:09:24 -07:00
trop[bot]
e6616d62e0 fix: use acceptLanguages argument in session.setUserAgent() (#23962)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-06-05 10:11:33 -07:00
Electron Bot
aa301f76d9 chore: bump chromium in DEPS to 83.0.4103.99 (#23967) 2020-06-04 16:21:58 -04:00
trop[bot]
058e2e73bb feat: add V8CacheOptions webpreference (#23868)
* feat: add V8CacheOptions webpreference

* address review comments

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-06-04 12:08:40 -04:00
trop[bot]
59538c9b36 fix: Make the --disable-color-correct-rendering switch work again (#23900)
* fix: Make the `--disable-color-correct-rendering` switch work again

This regressed once again in Electron 8 due to Chromium changes.

Test Plan:

- Confirm that test case from https://github.com/electron/electron/pull/15898#issuecomment-443191770 now works

Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`

* update patches

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-03 11:23:53 -07:00
trop[bot]
455228bed5 fix: restore original GTK/appindicator implementation of tray icons (#23926)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-03 11:07:37 -07:00
Electron Bot
f9d18015e0 chore: bump chromium in DEPS to 83.0.4103.98 (#23943) 2020-06-03 10:53:27 -07:00
trop[bot]
8fd0c11513 fix: correctly support the --inspect-brk-node flag (#23920)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-03 17:01:45 +09:00
Electron Bot
d40162e4bd chore: bump chromium to 83.0.4103.97 (9-x-y) (#23907)
* chore: bump chromium in DEPS to 83.0.4103.97

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-02 15:37:31 -04:00
trop[bot]
a57e7eb2e5 docs: default of allowRendererProcessReuse is true (#23913)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-02 12:02:51 -07:00
Electron Bot
12afb18487 Bump v9.0.2 2020-06-02 11:14:21 -07:00
trop[bot]
89340008ee fix: add patch to prevent crash during frame swap with ctx isolation enabled (#23895)
* fix: add patch to prevent crash during frame swap with ctx isolation enabled

* Update .patches

* chore: update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-02 10:52:39 -07:00
trop[bot]
dd7c9fb55b build: make electron renderer init scripts profilable (#23892)
The devtools profiler is not attached at the point we run out init scripts (or our apps preload scripts), we do not really want to change when we run these init scripts but for when a dev is doing performance work it makes sense to give them an option to make the devtools profiler actually work on both our init scripts and their preload script.  This PR adds that logic behind an environment variable ELECTRON_PROFILE_INIT_SCRIPTS.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-01 17:37:54 -07:00
trop[bot]
26c6c81540 fix: do not use CONTEXT_MENU flag for tray menu (#23880)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-01 12:24:29 -05:00
Electron Bot
7f769ec325 Bump v9.0.1 2020-06-01 09:32:10 -07:00
Electron Bot
32ecaae8a8 chore: bump chromium in DEPS to 83.0.4103.94 (#23875) 2020-06-01 11:13:02 -04:00
Electron Bot
7d0cc5edd8 chore: bump chromium to 83.0.4103.93 (9-x-y) (#23858)
* chore: bump chromium in DEPS to 83.0.4103.92

* chore: bump chromium in DEPS to 83.0.4103.93
2020-05-31 14:37:58 -07:00
Electron Bot
c09083b1d8 chore: bump chromium to 83.0.4103.91 (9-x-y) (#23848)
* chore: bump chromium in DEPS to 83.0.4103.91

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-29 15:24:23 -04:00
Shelley Vohr
718bbf137c fix: nativeImage remote serialization (#23796) 2020-05-28 13:21:28 -07:00
trop[bot]
568d38c61a fix: weakly reference MenuModel from MenuController (#23808)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:47:56 -07:00
Electron Bot
68a01398d9 chore: bump chromium in DEPS to 83.0.4103.89 (#23825) 2020-05-28 09:46:55 -07:00
trop[bot]
d0495f5fd4 fix: handle asynchronous URL loading in bw proxy (#23805)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:41:49 -07:00
Alexey Kuzmin
314cfa7aec test: refactor how spec files are collected (#23814)
(cherry picked from commit 3a7775fa73)
2020-05-28 09:41:25 -07:00
trop[bot]
ff4cc4dc16 fix: volume key globalShortcut registration (#23824)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:40:38 -07:00
trop[bot]
af1253392b fix: only bezel frameless windows (#23810)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 08:54:02 -04:00
Cheng Zhao
4f2699f4d9 Revert "fix: trigger activate event when app is activated via app switcher (#23773)" (#23821)
This reverts commit b5baafdab6.
2020-05-28 08:37:00 -04:00
trop[bot]
ca76da9f14 fix: pass correct buffer length (#23801)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-27 13:31:48 -07:00
Electron Bot
0814e72012 chore: bump chromium in DEPS to 83.0.4103.87 (#23790) 2020-05-27 08:41:01 -07:00
trop[bot]
b5baafdab6 fix: trigger activate event when app is activated via app switcher (#23773)
When application is activated thru macOS app switcher (cmd+tab) the
App's activate event is note emitted. The reason is that
`applicationShouldHandleReopen:hasVisibleWindows:` is sent only when app
is activated via Dock. Using `applicationDidBecomeActive:` is handling
all cases properly.

Co-authored-by: Lukas Weber <luweber@microsoft.com>
2020-05-27 09:52:30 +09:00
trop[bot]
0f96402c78 ci: deflake WOA tests (#23770)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-26 08:46:54 -07:00
Electron Bot
5d357e87b4 chore: bump chromium in DEPS to 83.0.4103.86 (#23765) 2020-05-26 08:46:19 -07:00
Electron Bot
448a645128 chore: bump chromium in DEPS to 83.0.4103.85 (#23750) 2020-05-25 12:03:40 -07:00
Electron Bot
7f1e492a68 chore: bump chromium to 83.0.4103.84 (9-x-y) (#23733)
* chore: bump chromium in DEPS to 83.0.4103.82

* chore: bump chromium in DEPS to 83.0.4103.84
2020-05-24 15:34:54 -07:00
Alexey Kuzmin
8803c12715 test: do not run spellchecker tests if the feature is disabled (9-x-y) (#23724)
* test: do not run SpellChecker tests if the features is disabled at build time

* fixup! test: do not run SpellChecker tests if the features is disabled at build time

* fixup! test: do not run SpellChecker tests if the features is disabled at build time
2020-05-23 11:05:37 -07:00
Electron Bot
98033f8520 chore: bump chromium in DEPS to 83.0.4103.81 (#23725) 2020-05-22 21:09:02 -07:00
trop[bot]
be6c102fa1 fix: trigger about panel for about role on on win (#23715)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-21 21:09:05 -04:00
trop[bot]
85aa3e9c3e fix: read GTK dark theme setting on Linux (#23712)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 20:39:29 -04:00
trop[bot]
2a5c92f534 test: multiple processes may crash in crashReporter test (#23705)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 15:41:06 -07:00
trop[bot]
525179dbfc docs: errors in isolated world are not dispatched (#23706)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 15:40:46 -07:00
Electron Bot
55c4de8723 chore: bump chromium in DEPS to 83.0.4103.77 (#23700) 2020-05-21 12:42:08 -07:00
Alexey Kuzmin
2241b146a0 test: call "expect()" on a correct call stack (#23696)
(cherry picked from commit 33d6a99d40)
2020-05-21 11:42:41 -04:00
Charles Kerr
14945be56c fix: don't run environment bootstrapper (#23689)
* chore: remove node "split CreateEnvironment" patch

* chore: remove `environment.js` from electron-node

* chore: don't call the electron-node API we removed

* fix: don't prepareMainExecution twice

* test: re-enable some node tests

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-21 11:27:34 -04:00
trop[bot]
0aa104ed9c fix: make sure hunspell file is not destroyed in UI thread (#23660)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 10:27:25 -04:00
LuoJinghua
c21c9b64e2 net: Don't ignore the referer header in net.request (#23685) 2020-05-20 20:27:27 -04:00
Electron Bot
935f5ca081 chore: bump chromium in DEPS to 83.0.4103.76 (#23679) 2020-05-20 09:41:09 -07:00
trop[bot]
a02d3c80a0 feat: add enableWebSQL webpreference (#23580)
* feat: add enableWebSQL webpreference

* chore: update indexedDB test

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-19 15:44:14 -04:00
Electron Bot
0b12642826 chore: bump chromium in DEPS to 83.0.4103.75 (#23657) 2020-05-19 11:18:41 -07:00
trop[bot]
011b2733d6 build: save mksnapshot args on Windows (#23641)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-19 09:28:40 -04:00
Milan Burda
90833d372f build: allow use of BUILDFLAG directives from within JS code (#23496) 2020-05-19 09:26:59 -04:00
trop[bot]
69a343e276 refactor: improve MoveItemToTrash error description (#23628)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-18 18:35:32 -07:00
Electron Bot
4da01641ce Bump v9.0.0 2020-05-18 14:17:08 -07:00
Charles Kerr
9d46395940 refactor: revert release notes changes (#23649)
* refactor: undo the "look harder for commit PRs" notes changes

* chore: chmod +x the notes script
2020-05-18 16:12:09 -05:00
Electron Bot
67a905c090 Revert "Bump v9.0.0"
This reverts commit dcdca6a014.
2020-05-18 13:37:51 -07:00
Electron Bot
dcdca6a014 Bump v9.0.0 2020-05-18 13:36:41 -07:00
Charles Kerr
7db9c35fa8 fix: eat octokit 422 errs when scraping commit PRs (#23643) 2020-05-18 16:33:23 -04:00
Electron Bot
5c03d05b8e Revert "Bump v9.0.0"
This reverts commit 0ac262dc2d.
2020-05-18 13:16:26 -07:00
Electron Bot
0ac262dc2d Bump v9.0.0 2020-05-18 13:04:48 -07:00
trop[bot]
4de54b412f ci: use longer mocha timeout on WOA testing (#23636)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-18 14:07:30 -04:00
Electron Bot
29af2312ca Revert "Bump v9.0.0-beta.25"
This reverts commit 1a4c34bb13.
2020-05-18 08:42:10 -07:00
Electron Bot
1a4c34bb13 Bump v9.0.0-beta.25 2020-05-18 08:32:13 -07:00
Electron Bot
8556eaab9b chore: bump chromium to 83.0.4103.64 (9-x-y) (#23623)
* chore: bump chromium in DEPS to 83.0.4103.61

* chore: bump chromium in DEPS to 83.0.4103.62

* chore: bump chromium in DEPS to 83.0.4103.64
2020-05-18 11:03:53 -04:00
trop[bot]
b22c44fef7 test: skip remote module related tests when enable_remote_module = false (#23568)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-18 10:45:38 +09:00
trop[bot]
c084b128dc fix: exclude crashpad_handler binary on linux (#23575)
* fix: exclude crashpad_handler binary on linux

* Update build/zip.py

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
2020-05-18 10:30:30 +09:00
trop[bot]
fcf50849f3 test: remove usage of the remote module from tests (#23577)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-18 10:29:52 +09:00
trop[bot]
9988beabb5 feat: look harder for a commit's pull request. (#23596)
PR numbers are almost always listed parenthetically in the commit message;
but when something is committed manually, it could be missing. This change
uses octokit's listPullRequestsAssociatedWithCommit() as a second approach
to finding a commit's PR.

Last night's Releases WG meeting noted that "re-enable pdf viewer" was
missing from the notes. This PR fixes that omission.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-05-18 10:12:09 +09:00
trop[bot]
32bc081ba5 build: remove unused header from a patch (#23590)
It can cause build failures because the header is generated
and there's no explicit dependency on a target that creates it.

Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-05-17 08:53:52 -07:00
Samuel Attard
320487080f refactor: remove the RenderFrameFunctionStore and use privates to memory manage (#23592) (#23617) 2020-05-15 16:33:44 -07:00
Electron Bot
a143339d35 chore: bump chromium in DEPS to 83.0.4103.59 (#23606) 2020-05-15 12:44:33 -07:00
Electron Bot
9011d5e7fc chore: bump chromium in DEPS to 83.0.4103.57 (#23588) 2020-05-14 19:37:57 -04:00
Electron Bot
73e1fceb39 Revert "Bump v9.0.0-beta.25"
This reverts commit 3dbebcb285.
2020-05-14 09:06:05 -07:00
Electron Bot
3dbebcb285 Bump v9.0.0-beta.25 2020-05-14 08:33:20 -07:00
trop[bot]
3a51ee5ce5 fix: generate symbols for the correct crashpad handler binary (#23573)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-05-14 10:42:59 -04:00
trop[bot]
a3256facea fix: leave behind the unmodified XDG_CURRENT_DESKTOP variable (#23554)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-05-13 12:37:50 -04:00
Electron Bot
3698f000c2 chore: bump chromium in DEPS to 83.0.4103.56 (#23559) 2020-05-13 09:12:41 -07:00
Milan Burda
810b54854a fix: expose v8util.createIDWeakMap() regardless of enable_remote_module (#23546) (#23556) 2020-05-13 09:12:15 -07:00
trop[bot]
56e84acab9 build: use correct v8_context_snapshot_generator in mksnapshot zip (#23540)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-13 09:40:44 -04:00
trop[bot]
8252565979 fix: run Node.js at-exit callbacks in renderer proc (#23544)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-12 18:32:29 -07:00
trop[bot]
169c87bfc1 fix: do not destroy thread in UI thread (#23535)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-13 09:18:52 +09:00
trop[bot]
cded93ae8e build: fix building with enable_remote_module = false (#23533)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-13 09:18:41 +09:00
Electron Bot
ab34627723 chore: bump chromium in DEPS to 83.0.4103.53 (#23524) 2020-05-12 14:18:07 -07:00
trop[bot]
d313998cdb test: skip "handles Promise timeouts correctly" when ELECTRON_RUN_AS_NODE is disabled (#23500)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-05-12 09:53:04 -05:00
Electron Bot
b8460f11fa chore: bump chromium to 83.0.4103.50 (9-x-y) (#23469)
* chore: bump chromium in DEPS to 83.0.4103.46

* chore: bump chromium in DEPS to 83.0.4103.48

* chore: bump chromium in DEPS to 83.0.4103.49

* chore: bump chromium in DEPS to 83.0.4103.50

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-11 14:17:18 -04:00
Alexey Kuzmin
6d75e7aac6 spec: fix conditions for some tests (#23489) (#23494)
(cherry picked from commit dc3de49a08)
2020-05-11 12:08:25 -04:00
Electron Bot
8cf55a674e Bump v9.0.0-beta.24 2020-05-11 08:31:56 -07:00
Erick Zhao
4542e2eef9 docs: document supported extensions apis (#22021) (#23434)
* docs: document supported extensions apis

* Update extensions.md

* Update README.md

* Apply suggestions from code review

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

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

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-05-11 10:49:32 +09:00
trop[bot]
5009538045 fix: do not initialize extension system in in-memory sessions (#23472)
* fix: do not initialize any extension related logic in OffTheRecord contexts

* chore: fix linting

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-05-08 12:43:07 -07:00
Jeremy Apthorp
2f8150891b fix: crashReporter incompatible with sandbox on Linux (#23265) (#23461) 2020-05-08 11:41:42 -07:00
Charles Kerr
4b9df8c248 feat: add force option to app.focus() (#22612) (#23447)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-07 12:16:24 -07:00
trop[bot]
0920d01c9c fix: multiple extension filters on macOS (#23450)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-07 11:57:45 -07:00
Electron Bot
520e0bcc43 chore: bump chromium in DEPS to 83.0.4103.45 (#23446) 2020-05-07 08:56:40 -07:00
Electron Bot
6be41c2f8e Bump v9.0.0-beta.23 2020-05-07 08:32:03 -07:00
Electron Bot
b997c562f7 chore: bump chromium in DEPS to 83.0.4103.44 (#23424) 2020-05-06 11:00:45 -07:00
Electron Bot
2c9fe0b951 chore: bump chromium to 83.0.4103.42 (9-x-y) (#23416)
* chore: bump chromium in DEPS to 83.0.4103.42

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-05-05 10:35:19 -07:00
Charles Kerr
4445182739 chore: remove redundant release note items. (#23408)
Backport of #23335. See that PR for details.
2020-05-05 08:38:16 -07:00
Charles Kerr
e549aec5fc fix: respect system language preferences on Win/macOS (#23247) (#23405)
This commit fixes https://github.com/electron/electron/issues/18829

Previously the full preferences set to OS was not given to Chromium.

Also, this commit improves fallback font selection for CJK text.
Chromium uses browser languages to determine fallback fonts on Windows,
especially kanji/han characters in CJK.

For instance, when user sets 'en-US, ja-JP' to Accept-Language,
while Chromium chooses Japanese font for kanji text, but Electron
chooses Chinese font.  This is because only the first language was given
to Accept-Language on Electron.

This patch is based on https://github.com/electron/electron/pull/15532

Co-authored-by: Nitish Sakhawalkar <nitsakh@icloud.com>
Co-authored-by: Kasumi Hanazuki <kasumi@rollingapple.net>

Co-authored-by: Nitish Sakhawalkar <nitsakh@icloud.com>
Co-authored-by: Kasumi Hanazuki <kasumi@rollingapple.net>

Co-authored-by: Sorah Fukumori <her@sorah.jp>
Co-authored-by: Nitish Sakhawalkar <nitsakh@icloud.com>
Co-authored-by: Kasumi Hanazuki <kasumi@rollingapple.net>
2020-05-04 19:41:17 -07:00
trop[bot]
c1311480c0 fix: guard pdf behind correct buildflags (#23406)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-04 19:38:24 -07:00
Shelley Vohr
6c78c9274a refactor: return null when passing empty menu templates (#23401) 2020-05-04 14:39:58 -05:00
Electron Bot
d50fb2938b chore: bump chromium to 83.0.4103.41 (9-x-y) (#23378)
* chore: bump chromium in DEPS to 83.0.4103.38

* chore: bump chromium in DEPS to 83.0.4103.39

* chore: bump chromium in DEPS to 83.0.4103.40

* chore: bump chromium in DEPS to 83.0.4103.41
2020-05-04 08:13:12 -07:00
trop[bot]
5414c8dd7e fix: hold browser_context instead of render_frame_host to fix lifetime issues (#23375)
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2020-05-03 16:19:52 -07:00
trop[bot]
ee68e1a787 fix: ensure guest-embedder map is updated when webview is removed (#23374)
There are use cases of webview where the container holding the webview is not
actually destroyed first, instead just webview gets removed from DOM, in such
situations the browser process map is not updated accordingly and holds reference
to stale guest contents, and any window operations like scroll, resize or keyboard
events that has to chain through browser embedder will lead to UAF crash.

Ref: https://github.com/microsoft/vscode/issues/92420

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-05-01 12:32:35 -07:00
Charles Kerr
e3d4f999ca fix: undo and redo broken in webviews (#23370)
* fix: undo and redo broken in webviews

Backport upstream fix https://chromium-review.googlesource.com/c/chromium/src/+/2135187 to 9-x-y.

* chore: re-run git-export-patches to refresh patch
2020-04-30 17:18:27 -05:00
trop[bot]
b62df312f2 docs: event.newGuest for new-window in WebContents and webContents in BrowsweWindow's constructor (#23356)
* docs: `newGuest` in `WebContents` and `webContents` in `BrowsweWindow`

According to the example codes in the documentation of `new-window`
event in `WebContents`, `webContents` in `BrowsweWindow` constructor
options and `newGuest` in `event` argument of `new-window` handler are
both existing but documented. This patch is for adding the related
documentations. Also, it provides typescript-definitations for these
two properties.

* Remove the documnent of `webContents` in BrowserWindow constructor option.

Co-authored-by: Sean Lee <sean.l@canva.com>
2020-04-30 15:42:14 -05:00
trop[bot]
9ba491116c ci: make sure msedge isn't running at end of woa test (#23361)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-04-30 14:14:20 -04:00
Electron Bot
c74dd6eee7 chore: bump chromium in DEPS to 83.0.4103.36 (#23348) 2020-04-30 11:02:09 -07:00
Electron Bot
2d888dc7b5 Bump v9.0.0-beta.22 2020-04-30 08:33:00 -07:00
trop[bot]
1024544573 fix: do not leak IPC or context bridge promises (#23338)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-04-29 17:23:25 -07:00
trop[bot]
ebbd3081b9 fix: build when some buildflags are disabled (#23337)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-04-29 16:09:42 -07:00
trop[bot]
dc3dc81beb feat: support fullScreen BrowserWindow property (#23330)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-04-29 12:16:11 -07:00
Electron Bot
6babb8a9fe chore: bump chromium in DEPS to 83.0.4103.34 (#23326) 2020-04-29 14:06:23 -04:00
trop[bot]
088e23d604 menu-item.md remove duplicate options (#23296)
Co-authored-by: szTheory <szTheory@users.noreply.github.com>
2020-04-28 23:17:11 -07:00
Electron Bot
d0a764bd16 chore: bump chromium to 83.0.4103.31 (9-x-y) (#23270)
* chore: bump chromium in DEPS to 83.0.4103.27

* chore: bump chromium in DEPS to 83.0.4103.28

* chore: bump chromium in DEPS to 83.0.4103.29

* chore: bump chromium in DEPS to 83.0.4103.30

* chore: bump chromium in DEPS to 83.0.4103.31

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-04-28 17:20:24 -07:00
Electron Bot
d47b788e03 Bump v9.0.0-beta.21 2020-04-27 18:23:30 -07:00
Samuel Attard
a985865f65 refactor: port window-setup to use ctx bridge instead of being run in the main world (#23299)
* refactor: port parts of window-setup to use ctx bridge instead of being run in the main world (#23194)

* refactor: port parts of window-setup to use ctx bridge instead of being run in the main world

* chore: update ctx bridge specs for new base numbers

* refactor: port window.open and window.opener to use ctx bridge instead of hole punching (#23235)

* refactor: port window.open and window.opener to use ctx bridge instead of hole punching

* refactor: only run the isolated init bundle when webview is enabled
2020-04-27 14:42:14 -07:00
trop[bot]
729019b974 style: use build/include_directory for NOLINT (#23300)
build/include linter was splitted to build/include_directory at
depot_tools upstream.

https://crrev.com/c/2159690
https://crbug.com/1073191

Co-authored-by: Sorah Fukumori <her@sorah.jp>
2020-04-27 13:28:41 -07:00
299 changed files with 9443 additions and 4306 deletions

View File

@@ -409,6 +409,7 @@ step-electron-build: &step-electron-build
fi
cd src
ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
node electron/script/check-symlinks.js
step-native-unittests-build: &step-native-unittests-build
run:
@@ -661,8 +662,10 @@ step-mksnapshot-build: &step-mksnapshot-build
if [ "`uname`" != "Darwin" ]; then
if [ "$TARGET_ARCH" == "arm" ]; then
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/v8_context_snapshot_generator
elif [ "$TARGET_ARCH" == "arm64" ]; then
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/mksnapshot
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x64_v8_arm64/v8_context_snapshot_generator
else
electron/script/strip-binaries.py --file $PWD/out/Default/mksnapshot
electron/script/strip-binaries.py --file $PWD/out/Default/v8_context_snapshot_generator
@@ -819,7 +822,7 @@ step-restore-out-cache: &step-restore-out-cache
paths:
- ./src/out/Default
keys:
- v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
- v8-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
@@ -843,7 +846,7 @@ step-save-out-cache: &step-save-out-cache
save_cache:
paths:
- ./src/out/Default
key: v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
key: v8-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

View File

@@ -27,7 +27,12 @@
"sourceType": "module"
},
"globals": {
"standardScheme": "readonly"
"standardScheme": "readonly",
"BUILDFLAG": "readonly",
"ENABLE_DESKTOP_CAPTURER": "readonly",
"ENABLE_ELECTRON_EXTENSIONS": "readonly",
"ENABLE_REMOTE_MODULE": "readonly",
"ENABLE_VIEW_API": "readonly"
},
"overrides": [
{

110
BUILD.gn
View File

@@ -3,6 +3,7 @@ import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//content/public/app/mac_helpers.gni")
import("//extensions/buildflags/buildflags.gni")
import("//pdf/features.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
@@ -58,6 +59,17 @@ if (is_mas_build) {
"It doesn't make sense to build a MAS build on a non-mac platform")
}
if (enable_pdf_viewer) {
assert(enable_pdf, "PDF viewer support requires enable_pdf=true")
assert(enable_electron_extensions,
"PDF viewer support requires enable_electron_extensions=true")
}
if (enable_electron_extensions) {
assert(enable_extensions,
"Chrome extension support requires enable_extensions=true")
}
config("branding") {
defines = [
"ELECTRON_PRODUCT_NAME=\"$electron_product_name\"",
@@ -321,6 +333,7 @@ source_set("electron_lib") {
"shell/common/api:mojo",
"//base:base_static",
"//base/allocator:buildflags",
"//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
@@ -330,7 +343,10 @@ source_set("electron_lib") {
"//components/network_hints/common:mojo_bindings",
"//components/network_hints/renderer",
"//components/network_session_configurator/common",
"//components/pref_registry",
"//components/prefs",
"//components/upload_list",
"//components/user_prefs",
"//components/viz/host",
"//components/viz/service",
"//content/public/browser",
@@ -426,6 +442,9 @@ source_set("electron_lib") {
"*\bviews/*",
]
}
if (!is_mas_build) {
deps += [ "//components/crash/core/app" ]
}
set_sources_assignment_filter(
sources_assignment_filter + extra_source_filters)
@@ -443,6 +462,10 @@ source_set("electron_lib") {
]
}
if (is_linux) {
deps += [ "//components/crash/content/browser" ]
}
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
@@ -450,6 +473,10 @@ source_set("electron_lib") {
"//ui/accelerated_widget_mac",
]
if (!is_mas_build) {
deps += [ "//third_party/crashpad/crashpad/client" ]
}
libs = [
"AVFoundation.framework",
"Carbon.framework",
@@ -468,12 +495,14 @@ source_set("electron_lib") {
]
if (is_mas_build) {
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
sources -= [
"shell/browser/auto_updater_mac.mm",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
]
sources -= [ "shell/browser/auto_updater_mac.mm" ]
defines += [ "MAS_BUILD" ]
sources -= [
"shell/app/electron_crash_reporter_client.cc",
"shell/app/electron_crash_reporter_client.h",
"shell/common/crash_keys.cc",
"shell/common/crash_keys.h",
]
} else {
libs += [
"Squirrel.framework",
@@ -495,7 +524,6 @@ source_set("electron_lib") {
"//build/config/linux/gtk",
"//dbus",
"//device/bluetooth",
"//third_party/breakpad:client",
"//ui/events/devices/x11",
"//ui/events/platform/x11",
"//ui/gtk",
@@ -509,7 +537,6 @@ source_set("electron_lib") {
]
}
configs += [ ":gio_unix" ]
include_dirs += [ "//third_party/breakpad" ]
configs += [ "//build/config/linux:x11" ]
defines += [
# Disable warnings for g_settings_list_schemas.
@@ -518,6 +545,16 @@ source_set("electron_lib") {
sources += filenames.lib_sources_nss
sources += [
"shell/browser/ui/gtk/app_indicator_icon.cc",
"shell/browser/ui/gtk/app_indicator_icon.h",
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
"shell/browser/ui/gtk/app_indicator_icon_menu.h",
"shell/browser/ui/gtk/gtk_status_icon.cc",
"shell/browser/ui/gtk/gtk_status_icon.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/gtk/status_icon.cc",
"shell/browser/ui/gtk/status_icon.h",
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
@@ -525,6 +562,7 @@ source_set("electron_lib") {
if (is_win) {
libs += [ "dwmapi.lib" ]
deps += [
"//components/crash/core/app:crash_export_thunks",
"//ui/native_theme:native_theme_browser",
"//ui/views/controls/webview",
"//ui/wm",
@@ -536,14 +574,6 @@ source_set("electron_lib") {
]
}
if ((is_mac && !is_mas_build) || is_win) {
sources += [
"shell/common/crash_reporter/crash_reporter_crashpad.cc",
"shell/common/crash_reporter/crash_reporter_crashpad.h",
]
deps += [ "//third_party/crashpad/crashpad/client" ]
}
if (enable_plugins) {
deps += [ "chromium_src:plugins" ]
sources += [
@@ -583,8 +613,6 @@ source_set("electron_lib") {
if (enable_remote_module) {
sources += [
"shell/common/api/remote/object_life_monitor.cc",
"shell/common/api/remote/object_life_monitor.h",
"shell/common/api/remote/remote_callback_freer.cc",
"shell/common/api/remote/remote_callback_freer.h",
"shell/common/api/remote/remote_object_freer.cc",
@@ -634,15 +662,6 @@ source_set("electron_lib") {
deps += [ "//components/printing/common:mojo_interfaces" ]
}
deps += [
"//components/pref_registry",
"//components/user_prefs",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/common",
"//extensions/common:core_api_provider",
"//extensions/renderer",
]
if (enable_electron_extensions) {
sources += filenames.lib_sources_extensions
deps += [
@@ -651,6 +670,11 @@ source_set("electron_lib") {
"shell/common/extensions/api:extensions_features",
"//chrome/browser/resources:component_extension_resources",
"//components/zoom",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/common",
"//extensions/common:core_api_provider",
"//extensions/renderer",
]
}
@@ -764,11 +788,17 @@ if (is_mac) {
}
bundle_data("electron_crashpad_helper") {
sources = [ "$root_out_dir/crashpad_handler" ]
sources = [ "$root_out_dir/chrome_crashpad_handler" ]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
public_deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
public_deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
if (is_asan) {
# crashpad_handler requires the ASan runtime at its @executable_path.
sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ]
}
}
mac_framework_bundle("electron_framework") {
@@ -778,6 +808,9 @@ if (is_mac) {
"Resources",
"Libraries",
]
if (!is_mas_build) {
framework_contents += [ "Helpers" ]
}
public_deps = [
":electron_framework_libraries",
":electron_lib",
@@ -1000,21 +1033,24 @@ if (is_mac) {
}
extract_symbols("crashpad_handler_syms") {
binary = "$root_out_dir/crashpad_handler"
binary = "$root_out_dir/chrome_crashpad_handler"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/crashpad_handler.dSYM/Contents/Resources/DWARF/crashpad_handler"
deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
dsym_file = "$root_out_dir/chrome_crashpad_handler.dSYM/Contents/Resources/DWARF/chrome_crashpad_handler"
deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
}
group("electron_symbols") {
deps = [
":crashpad_handler_syms",
":electron_app_syms",
":electron_framework_syms",
":swiftshader_egl_syms",
":swiftshader_gles_syms",
]
if (!is_mas_build) {
deps += [ ":crashpad_handler_syms" ]
}
foreach(helper_params, content_mac_helpers) {
_helper_target = helper_params[0]
deps += [ ":electron_helper_syms_${_helper_target}" ]
@@ -1044,6 +1080,7 @@ if (is_mac) {
":electron_app_manifest",
":electron_lib",
":packed_resources",
"//components/crash/core/app",
"//content:sandbox_helper_win",
"//electron/buildflags",
"//ui/strings",
@@ -1073,6 +1110,11 @@ if (is_mac) {
"shell/browser/resources/win/resource.h",
]
deps += [
"//components/browser_watcher:browser_watcher_client",
"//components/crash/core/app:run_as_crashpad_handler",
]
libs = [
"comctl32.lib",
"uiautomationcore.lib",
@@ -1276,7 +1318,7 @@ dist_zip("electron_chromedriver_zip") {
mksnapshot_deps = [
":licenses",
"//tools/v8_context_snapshot:v8_context_snapshot_generator",
"//tools/v8_context_snapshot:v8_context_snapshot_generator($v8_snapshot_toolchain)",
"//v8:mksnapshot($v8_snapshot_toolchain)",
]

2
DEPS
View File

@@ -12,7 +12,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'83.0.4103.26',
'83.0.4103.119',
'node_version':
'v12.14.1',
'nan_version':

View File

@@ -1 +1 @@
9.0.0-beta.20
9.0.6

View File

@@ -146,7 +146,11 @@ build_script:
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
@@ -197,8 +201,7 @@ test_script:
- if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --enable-logging)
- cd ..
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( gn desc out\Default v8:run_mksnapshot_default args > out\Default\mksnapshot_args )
- echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )

View File

@@ -88,5 +88,6 @@ steps:
- powershell: |
Get-Process | Where Name Like "electron*" | Stop-Process
Get-Process | Where Name Like "MicrosoftEdge*" | Stop-Process
Get-Process | Where Name Like "msedge*" | Stop-Process
displayName: 'Kill processes left running from last test run'
condition: always()

View File

@@ -20,7 +20,3 @@ angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
is_cfi = false
enable_osr = true
enable_electron_extensions = true

View File

@@ -1,3 +1,4 @@
const fs = require('fs');
const path = require('path')
const webpack = require('webpack')
@@ -9,6 +10,9 @@ config.output = {
filename: path.basename(outPath)
}
const { wrapInitWithProfilingTimeout } = config;
delete config.wrapInitWithProfilingTimeout;
webpack(config, (err, stats) => {
if (err) {
console.error(err)
@@ -17,6 +21,18 @@ webpack(config, (err, stats) => {
console.error(stats.toString('normal'))
process.exit(1)
} else {
if (wrapInitWithProfilingTimeout) {
const contents = fs.readFileSync(outPath, 'utf8');
const newContents = `function ___electron_webpack_init__() {
${contents}
};
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
setTimeout(___electron_webpack_init__, 0);
} else {
___electron_webpack_init__();
}`;
fs.writeFileSync(outPath, newContents);
}
process.exit(0)
}
})

View File

@@ -20,11 +20,72 @@ class AccessDependenciesPlugin {
}
}
const defines = {
BUILDFLAG: onlyPrintingGraph ? '(a => a)' : ''
}
const buildFlagsPrefix = '--buildflags='
const buildFlagArg = process.argv.find(arg => arg.startsWith(buildFlagsPrefix))
if (buildFlagArg) {
const buildFlagPath = buildFlagArg.substr(buildFlagsPrefix.length)
const flagFile = fs.readFileSync(buildFlagPath, 'utf8')
for (const line of flagFile.split(/(\r\n|\r|\n)/g)) {
const flagMatch = line.match(/#define BUILDFLAG_INTERNAL_(.+?)\(\) \(([01])\)/)
if (flagMatch) {
const [, flagName, flagValue] = flagMatch;
defines[flagName] = JSON.stringify(Boolean(parseInt(flagValue, 10)));
}
}
}
const ignoredModules = []
if (defines['ENABLE_DESKTOP_CAPTURER'] === 'false') {
ignoredModules.push(
'@electron/internal/browser/desktop-capturer',
'@electron/internal/renderer/api/desktop-capturer'
)
}
if (defines['ENABLE_REMOTE_MODULE'] === 'false') {
ignoredModules.push(
'@electron/internal/browser/remote/server',
'@electron/internal/renderer/api/remote'
)
}
if (defines['ENABLE_VIEW_API'] === 'false') {
ignoredModules.push(
'@electron/internal/browser/api/views/box-layout',
'@electron/internal/browser/api/views/button',
'@electron/internal/browser/api/views/label-button',
'@electron/internal/browser/api/views/layout-manager',
'@electron/internal/browser/api/views/md-text-button',
'@electron/internal/browser/api/views/resize-area',
'@electron/internal/browser/api/views/text-field'
)
}
if (defines['ENABLE_ELECTRON_EXTENSIONS'] === 'false') {
ignoredModules.push(
'@electron/internal/@browser/chrome-extension-shim'
)
} else {
ignoredModules.push(
'@electron/internal/browser/chrome-extension',
'@electron/internal/renderer/chrome-api',
'@electron/internal/renderer/content-scripts-injector'
)
}
module.exports = ({
alwaysHasNode,
loadElectronFromAlternateTarget,
targetDeletesNodeGlobals,
target
target,
wrapInitWithProfilingTimeout
}) => {
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
if (!fs.existsSync(entry)) {
@@ -39,23 +100,30 @@ module.exports = ({
output: {
filename: `${target}.bundle.js`
},
wrapInitWithProfilingTimeout,
resolve: {
alias: {
'@electron/internal': path.resolve(electronRoot, 'lib'),
'electron': path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts'),
// Force timers to resolve to our dependency that doens't use window.postMessage
// Force timers to resolve to our dependency that doesn't use window.postMessage
'timers': path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
},
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: (moduleName) => !onlyPrintingGraph && ignoredModules.includes(moduleName),
loader: 'null-loader',
}, {
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
transpileOnly: onlyPrintingGraph,
ignoreDiagnostics: [6059]
ignoreDiagnostics: [
// File '{0}' is not under 'rootDir' '{1}'.
6059,
]
}
}]
},
@@ -78,6 +146,7 @@ module.exports = ({
new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise'],
}),
new webpack.DefinePlugin(defines),
]
})
}

View File

@@ -1,5 +1,6 @@
module.exports = require('./webpack.config.base')({
target: 'renderer',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
targetDeletesNodeGlobals: true,
wrapInitWithProfilingTimeout: true
})

View File

@@ -1,4 +1,5 @@
module.exports = require('./webpack.config.base')({
target: 'sandboxed_renderer',
alwaysHasNode: false
alwaysHasNode: false,
wrapInitWithProfilingTimeout: true,
})

View File

@@ -16,6 +16,7 @@ template("webpack_build") {
inputs = [
invoker.config_file,
"//electron/build/webpack/webpack.config.base.js",
"//electron/build/webpack/run-compiler.js",
"//electron/tsconfig.json",
"//electron/yarn.lock",
"//electron/typings/internal-ambient.d.ts",
@@ -25,7 +26,9 @@ template("webpack_build") {
args = [
rebase_path(invoker.config_file),
rebase_path(invoker.out_file),
"--buildflags=" + rebase_path("$target_gen_dir/buildflags/buildflags.h"),
]
deps += [ "buildflags" ]
outputs = [ invoker.out_file ]
}

View File

@@ -25,6 +25,13 @@ PATHS_TO_SKIP = [
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
# ship it.
'pyproto',
# On Windows, this binary doesn't exist (the crashpad handler is built-in).
# On MacOS, the binary is called 'chrome_crashpad_handler' and is inside the
# app bundle.
# On Linux, we don't use crashpad, but this binary is still built for some
# reason. Exclude it from the zip.
'./crashpad_handler',
]
def skip_path(dep, dist_zip, target_cpu):

View File

@@ -32,7 +32,7 @@ declare_args() {
enable_pepper_flash = true
# Enable Chrome extensions support.
enable_electron_extensions = false
enable_electron_extensions = true
# Enable Spellchecker support
enable_builtin_spellchecker = true

View File

@@ -14,6 +14,8 @@ static_library("chrome") {
sources = [
"//chrome/browser/browser_process.cc",
"//chrome/browser/browser_process.h",
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc",
"//chrome/browser/crash_upload_list/crash_upload_list_crashpad.h",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
"//chrome/browser/devtools/devtools_contents_resizing_strategy.h",
"//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc",
@@ -55,6 +57,8 @@ static_library("chrome") {
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
"//chrome/browser/win/chrome_process_finder.cc",
"//chrome/browser/win/chrome_process_finder.h",
"//chrome/child/v8_crashpad_support_win.cc",
"//chrome/child/v8_crashpad_support_win.h",
"//extensions/browser/app_window/size_constraints.cc",
"//extensions/browser/app_window/size_constraints.h",
]
@@ -239,17 +243,22 @@ static_library("chrome") {
sources += [
"//chrome/browser/extensions/chrome_url_request_util.cc",
"//chrome/browser/extensions/chrome_url_request_util.h",
"//chrome/browser/pdf/pdf_extension_util.cc",
"//chrome/browser/pdf/pdf_extension_util.h",
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc",
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h",
"//chrome/renderer/extensions/extension_hooks_delegate.cc",
"//chrome/renderer/extensions/extension_hooks_delegate.h",
"//chrome/renderer/extensions/tabs_hooks_delegate.cc",
"//chrome/renderer/extensions/tabs_hooks_delegate.h",
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
]
if (enable_pdf_viewer) {
sources += [
"//chrome/browser/pdf/pdf_extension_util.cc",
"//chrome/browser/pdf/pdf_extension_util.h",
"//chrome/renderer/pepper/chrome_pdf_print_client.cc",
"//chrome/renderer/pepper/chrome_pdf_print_client.h",
]
}
}
}
@@ -268,12 +277,14 @@ source_set("plugins") {
"//chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h",
]
deps += [
"//components/pdf/browser",
"//media:media_buildflags",
"//ppapi/buildflags",
"//ppapi/proxy:ipc",
"//services/device/public/mojom",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/browser" ]
}
if (enable_pepper_flash) {
sources += [
"//chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc",
@@ -319,9 +330,11 @@ source_set("plugins") {
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/renderer" ]
}
}
deps += [
"//components/pdf/renderer",
"//components/strings",
"//media:media_buildflags",
"//ppapi/host",

View File

@@ -1,5 +1,6 @@
import { app, dialog, BrowserWindow, shell, ipcMain } from 'electron';
import * as path from 'path';
import * as url from 'url';
let mainWindow: BrowserWindow | null = null;
@@ -29,12 +30,11 @@ function isTrustedSender (webContents: Electron.WebContents) {
return false;
}
const parsedUrl = new URL(webContents.getURL());
const urlPath = process.platform === 'win32'
// Strip the prefixed "/" that occurs on windows
? path.resolve(parsedUrl.pathname.substr(1))
: parsedUrl.pathname;
return parsedUrl.protocol === 'file:' && urlPath === indexPath;
try {
return url.fileURLToPath(webContents.getURL()) === indexPath;
} catch {
return false;
}
}
ipcMain.handle('bootstrap', (event) => {

View File

@@ -112,6 +112,7 @@ These individual tutorials expand on topics discussed in the guide above.
* [Process Object](api/process.md)
* [Supported Command Line Switches](api/command-line-switches.md)
* [Environment Variables](api/environment-variables.md)
* [Chrome Extensions Support](api/extensions.md)
* [Breaking API Changes](breaking-changes.md)
### Custom DOM Elements:

View File

@@ -554,11 +554,17 @@ Returns `Promise<void>` - fulfilled when Electron is initialized.
May be used as a convenient alternative to checking `app.isReady()`
and subscribing to the `ready` event if the app is not ready yet.
### `app.focus()`
### `app.focus([options])`
* `options` Object (optional)
* `steal` Boolean _macOS_ - Make the receiver the active app even if another app is
currently active.
On Linux, focuses on the first visible window. On macOS, makes the application
the active app. On Windows, focuses on the application's first window.
You should seek to use the `steal` option as sparingly as possible.
### `app.hide()` _macOS_
Hides all application windows without minimizing them.
@@ -602,6 +608,7 @@ Returns `String` - The current application directory.
* `videos` Directory for a user's videos.
* `logs` Directory for your app's log folder.
* `pepperFlashSystemPlugin` Full path to the system version of the Pepper Flash plugin.
* `crashDumps` Directory where crash dumps are stored.
Returns `String` - A path to a special directory or file associated with `name`. On
failure, an `Error` is thrown.
@@ -1347,7 +1354,7 @@ in your app's initialization to ensure that your overridden value is used.
A `Boolean` which when `true` disables the overrides that Electron has in place
to ensure renderer processes are restarted on every navigation. The current
default value for this property is `false`.
default value for this property is `true`.
The intention is for these overrides to become disabled by default and then at
some point in the future this property will be removed. This property impacts

View File

@@ -385,6 +385,15 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
visible to users.
* `spellcheck` Boolean (optional) - Whether to enable the builtin spellchecker.
Default is `true`.
* `enableWebSQL` Boolean (optional) - Whether to enable the [WebSQL api](https://www.w3.org/TR/webdatabase/).
Default is `true`.
* `v8CacheOptions` String (optional) - Enforces the v8 code caching policy
used by blink. Accepted values are
* `none` - Disables code caching
* `code` - Heuristic based code caching
* `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation
* `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager.
Default policy is `code`.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
@@ -807,6 +816,10 @@ hide it immediately.
A `Boolean` property that determines whether the window is in simple (pre-Lion) fullscreen mode.
#### `win.fullScreen`
A `Boolean` property that determines whether the window is in fullscreen mode.
#### `win.visibleOnAllWorkspaces`
A `Boolean` property that determines whether the window is visible on all workspaces.

View File

@@ -28,6 +28,10 @@ Disables the disk cache for HTTP requests.
Disable HTTP/2 and SPDY/3.1 protocols.
### --disable-ntlm-v2
Disables NTLM v2 for posix platforms, no effect elsewhere.
## --lang
Set a custom locale.

View File

@@ -4,18 +4,13 @@
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
The following is an example of automatically submitting a crash report to a
remote server:
The following is an example of setting up Electron to automatically submit
crash reports to a remote server:
```javascript
const { crashReporter } = require('electron')
crashReporter.start({
productName: 'YourName',
companyName: 'YourCompany',
submitURL: 'https://your-domain.com/url-to-submit',
uploadToServer: true
})
crashReporter.start({ submitURL: 'https://your-domain.com/url-to-submit' })
```
For setting up a server to accept and process crash reports, you can use
@@ -30,11 +25,19 @@ Or use a 3rd party hosted solution:
* [Sentry](https://docs.sentry.io/clients/electron)
* [BugSplat](https://www.bugsplat.com/docs/platforms/electron)
Crash reports are saved locally in an application-specific temp directory folder.
For a `productName` of `YourName`, crash reports will be stored in a folder
named `YourName Crashes` inside the temp directory. You can customize this temp
directory location for your app by calling the `app.setPath('temp', '/my/custom/temp')`
API before starting the crash reporter.
Crash reports are stored temporarily before being uploaded in a directory
underneath the app's user data directory (called 'Crashpad' on Windows and Mac,
or 'Crash Reports' on Linux). You can override this directory by calling
`app.setPath('crashDumps', '/path/to/crashes')` before starting the crash
reporter.
On Windows and macOS, Electron uses
[crashpad](https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md)
to monitor and report crashes. On Linux, Electron uses
[breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/). This
is an implementation detail driven by Chromium, and it may change in future. In
particular, crashpad is newer and will likely eventually replace breakpad on
all platforms.
## Methods
@@ -43,40 +46,68 @@ The `crashReporter` module has the following methods:
### `crashReporter.start(options)`
* `options` Object
* `companyName` String
* `submitURL` String - URL that crash reports will be sent to as POST.
* `productName` String (optional) - Defaults to `app.name`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent to the server. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
* `extra` Record<String, String> (optional) - An object you can define that will be sent along with the
report. Only string properties are sent correctly. Nested objects are not
supported. When using Windows, the property names and values must be fewer than 64 characters.
* `crashesDirectory` String (optional) - Directory to store the crash reports temporarily (only used when the crash reporter is started via `process.crashReporter.start`).
* `companyName` String (optional) _Deprecated_ - Deprecated alias for
`{ globalExtra: { _companyName: ... } }`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent
to the server. If false, crash reports will be collected and stored in the
crashes directory, but not uploaded. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - If true, crashes generated
in the main process will not be forwarded to the system crash handler.
Default is `false`.
* `rateLimit` Boolean (optional) _macOS_ _Windows_ - If true, limit the
number of crashes uploaded to 1/hour. Default is `false`.
* `compress` Boolean (optional) _macOS_ _Windows_ - If true, crash reports
will be compressed and uploaded with `Content-Encoding: gzip`. Not all
collection servers support compressed payloads. Default is `false`.
* `extra` Record<String, String> (optional) - Extra string key/value
annotations that will be sent along with crash reports that are generated
in the main process. Only string values are supported. Crashes generated in
child processes will not contain these extra
parameters to crash reports generated from child processes, call
[`addExtraParameter`](#crashreporteraddextraparameterkey-value) from the
child process.
* `globalExtra` Record<String, String> (optional) - Extra string key/value
annotations that will be sent along with any crash reports generated in any
process. These annotations cannot be changed once the crash reporter has
been started. If a key is present in both the global extra parameters and
the process-specific extra parameters, then the global one will take
precedence. By default, `productName` and the app version are included, as
well as the Electron version.
You are required to call this method before using any other `crashReporter` APIs
and in each process (main/renderer) from which you want to collect crash reports.
You can pass different options to `crashReporter.start` when calling from different processes.
This method must be called before using any other `crashReporter` APIs. Once
initialized this way, the crashpad handler collects crashes from all
subsequently created processes. The crash reporter cannot be disabled once
started.
**Note** Child processes created via the `child_process` module will not have access to the Electron modules.
Therefore, to collect crash reports from them, use `process.crashReporter.start` instead. Pass the same options as above
along with an additional one called `crashesDirectory` that should point to a directory to store the crash
reports temporarily. You can test this out by calling `process.crash()` to crash the child process.
This method should be called as early as possible in app startup, preferably
before `app.on('ready')`. If the crash reporter is not initialized at the time
a renderer process is created, then that renderer process will not be monitored
by the crash reporter.
**Note:** If you need send additional/updated `extra` parameters after your
first call `start` you can call `addExtraParameter` on macOS or call `start`
again with the new/updated `extra` parameters on Linux and Windows.
**Note:** You can test out the crash reporter by generating a crash using
`process.crash()`.
**Note:** On macOS and windows, Electron uses a new `crashpad` client for crash collection and reporting.
If you want to enable crash reporting, initializing `crashpad` from the main process using `crashReporter.start` is required
regardless of which process you want to collect crashes from. Once initialized this way, the crashpad handler collects
crashes from all processes. You still have to call `crashReporter.start` from the renderer or child process, otherwise crashes from
them will get reported without `companyName`, `productName` or any of the `extra` information.
**Note:** If you need to send additional/updated `extra` parameters after your
first call `start` you can call `addExtraParameter`.
**Note:** Parameters passed in `extra`, `globalExtra` or set with
`addExtraParameter` have limits on the length of the keys and values. Key names
must be at most 39 bytes long, and values must be no longer than 127 bytes.
Keys with names longer than the maximum will be silently ignored. Key values
longer than the maximum length will be truncated.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getLastCrashReport()`
Returns [`CrashReport`](structures/crash-report.md):
Returns [`CrashReport`](structures/crash-report.md) - The date and ID of the
last crash report. Only crash reports that have been uploaded will be returned;
even if a crash report is present on disk it will not be returned until it is
uploaded. In the case that there are no uploaded reports, `null` is returned.
Returns the date and ID of the last crash report. Only crash reports that have been uploaded will be returned; even if a crash report is present on disk it will not be returned until it is uploaded. In the case that there are no uploaded reports, `null` is returned.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getUploadedReports()`
@@ -85,43 +116,61 @@ Returns [`CrashReport[]`](structures/crash-report.md):
Returns all uploaded crash reports. Each report contains the date and uploaded
ID.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.getUploadToServer()`
Returns `Boolean` - Whether reports should be submitted to the server. Set through
the `start` method or `setUploadToServer`.
**Note:** This API can only be called from the main process.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.setUploadToServer(uploadToServer)`
* `uploadToServer` Boolean _macOS_ - Whether reports should be submitted to the server.
* `uploadToServer` Boolean - Whether reports should be submitted to the server.
This would normally be controlled by user preferences. This has no effect if
called before `start` is called.
**Note:** This API can only be called from the main process.
**Note:** Calling this method from the renderer process is deprecated.
### `crashReporter.addExtraParameter(key, value)` _macOS_ _Windows_
### `crashReporter.getCrashesDirectory()` _Deprecated_
* `key` String - Parameter key, must be less than 64 characters long.
* `value` String - Parameter value, must be less than 64 characters long.
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
Set an extra parameter to be sent with the crash report. The values
specified here will be sent in addition to any values set via the `extra` option when `start` was called. This API is only available on macOS and windows, if you need to add/update extra parameters on Linux after your first call to `start` you can call `start` again with the updated `extra` options.
**Note:** This method is deprecated, use `app.getPath('crashDumps')` instead.
### `crashReporter.removeExtraParameter(key)` _macOS_ _Windows_
### `crashReporter.addExtraParameter(key, value)`
* `key` String - Parameter key, must be less than 64 characters long.
* `key` String - Parameter key, must be no longer than 39 bytes.
* `value` String - Parameter value, must be no longer than 127 bytes.
Remove a extra parameter from the current set of parameters so that it will not be sent with the crash report.
Set an extra parameter to be sent with the crash report. The values specified
here will be sent in addition to any values set via the `extra` option when
`start` was called.
Parameters added in this fashion (or via the `extra` parameter to
`crashReporter.start`) are specific to the calling process. Adding extra
parameters in the main process will not cause those parameters to be sent along
with crashes from renderer or other child processes. Similarly, adding extra
parameters in a renderer process will not result in those parameters being sent
with crashes that occur in other renderer processes or in the main process.
**Note:** Parameters have limits on the length of the keys and values. Key
names must be no longer than 39 bytes, and values must be no longer than 127
bytes. Keys with names longer than the maximum will be silently ignored. Key
values longer than the maximum length will be truncated.
### `crashReporter.removeExtraParameter(key)`
* `key` String - Parameter key, must be no longer than 39 bytes.
Remove a extra parameter from the current set of parameters. Future crashes
will not include this parameter.
### `crashReporter.getParameters()`
See all of the current parameters being passed to the crash reporter.
### `crashReporter.getCrashesDirectory()`
Returns `String` - The directory where crashes are temporarily stored before being uploaded.
Returns `Record<String, String>` - The current 'extra' parameters of the crash reporter.
## Crash Report Payload

View File

@@ -135,3 +135,14 @@ the one downloaded by `npm install`. Usage:
```sh
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
```
## Set By Electron
Electron sets some variables in your environment at runtime.
### `ORIGINAL_XDG_CURRENT_DESKTOP`
This variable is set to the value of `XDG_CURRENT_DESKTOP` that your application
originally launched with. Electron sometimes modifies the value of `XDG_CURRENT_DESKTOP`
to affect other logic within Chromium so if you want access to the _original_ value
you should look up this environment variable instead.

101
docs/api/extensions.md Normal file
View File

@@ -0,0 +1,101 @@
# Chrome Extension Support
Electron supports a subset of the [Chrome Extensions
API][chrome-extensions-api-index], primarily to support DevTools extensions and
Chromium-internal extensions, but it also happens to support some other
extension capabilities.
[chrome-extensions-api-index]: https://developer.chrome.com/extensions/api_index
> **Note:** Electron does not support arbitrary Chrome extensions from the
> store, and it is a **non-goal** of the Electron project to be perfectly
> compatible with Chrome's implementation of Extensions.
## Loading extensions
Electron only supports loading unpacked extensions (i.e., `.crx` files do not
work). Extensions are installed per-`session`. To load an extension, call
[`ses.loadExtension`](session.md#sesloadextensionpath):
```js
const { session } = require('electron')
session.loadExtension('path/to/unpacked/extension').then(({ id }) => {
// ...
})
```
Loaded extensions will not be automatically remembered across exits; if you do
not call `loadExtension` when the app runs, the extension will not be loaded.
See the [`session`](session.md) documentation for more information about
loading, unloading, and querying active extensions.
## Supported Extensions APIs
We support the following extensions APIs, with some caveats. Other APIs may
additionally be supported, but support for any APIs not listed here is
provisional and may be removed.
### `chrome.devtools.inspectedWindow`
All features of this API are supported.
### `chrome.devtools.network`
All features of this API are supported.
### `chrome.devtools.panels`
All features of this API are supported.
### `chrome.extension`
The following properties of `chrome.extension` are supported:
- `chrome.extension.lastError`
The following methods of `chrome.extension` are supported:
- `chrome.extension.getURL`
- `chrome.extension.getBackgroundPage`
### `chrome.runtime`
The following properties of `chrome.runtime` are supported:
- `chrome.runtime.lastError`
- `chrome.runtime.id`
The following methods of `chrome.runtime` are supported:
- `chrome.runtime.getBackgroundPage`
- `chrome.runtime.getManifest`
- `chrome.runtime.getURL`
- `chrome.runtime.connect`
- `chrome.runtime.sendMessage`
The following events of `chrome.runtime` are supported:
- `chrome.runtime.onStartup`
- `chrome.runtime.onInstalled`
- `chrome.runtime.onSuspend`
- `chrome.runtime.onSuspendCanceled`
- `chrome.runtime.onConnect`
- `chrome.runtime.onMessage`
### `chrome.storage`
Only `chrome.storage.local` is supported; `chrome.storage.sync` and
`chrome.storage.managed` are not.
### `chrome.tabs`
The following methods of `chrome.tabs` are supported:
- `chrome.tabs.sendMessage`
- `chrome.tabs.executeScript`
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
> supported and will raise an error.

View File

@@ -12,9 +12,9 @@ See [`Menu`](menu.md) for examples.
* `click` Function (optional) - Will be called with
`click(menuItem, browserWindow, event)` when the menu item is clicked.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md)
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.
@@ -69,6 +69,7 @@ a `type`.
The `role` property can have following values:
* `undo`
* `about` - Trigger a native about panel (custom message box on Window, which does not provide its own).
* `redo`
* `cut`
* `copy`
@@ -94,7 +95,6 @@ The `role` property can have following values:
The following additional roles are available on _macOS_:
* `appMenu` - Whole default "App" menu (About, Services, etc.)
* `about` - Map to the `orderFrontStandardAboutPanel` action.
* `hide` - Map to the `hide` action.
* `hideOthers` - Map to the `hideOtherApplications` action.
* `unhide` - Map to the `unhideAllApplications` action.
@@ -151,7 +151,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme
#### `menuItem.role`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
#### `menuItem.accelerator`

View File

@@ -0,0 +1,4 @@
# NewWindowEvent Object extends `Event`
* `newGuest` BrowserWindow (optional)

View File

@@ -138,7 +138,7 @@ Emitted when page receives favicon urls.
Returns:
* `event` Event
* `event` NewWindowEvent
* `url` String
* `frameName` String
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
@@ -366,6 +366,7 @@ Returns:
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
* `isComposing` Boolean - Equivalent to [KeyboardEvent.isComposing][keyboardevent].
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
@@ -871,10 +872,10 @@ Returns `String` - The URL of the current web page.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
let currentURL = win.webContents.getURL()
console.log(currentURL)
win.loadURL('http://github.com').then(() => {
const currentURL = win.webContents.getURL()
console.log(currentURL)
})
```
#### `contents.getTitle()`

View File

@@ -162,10 +162,14 @@ this limitation.
* `error` Error
Returns `Promise<any>` - A promise that resolves with the result of the executed
code or is rejected if execution throws or results in a rejected promise.
code or is rejected if execution could not start.
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
Note that when the execution of script fails, the returned promise will not
reject and the `result` would be `undefined`. This is because Chromium does not
dispatch errors of isolated worlds to foreign worlds.
### `webFrame.setIsolatedWorldInfo(worldId, info)`
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
* `info` Object

View File

@@ -2,13 +2,124 @@
Breaking changes will be documented here, and deprecation warnings added to JS code where possible, at least [one major version](tutorial/electron-versioning.md#semver) before the change is made.
## `FIXME` comments
### Types of Breaking Changes
The `FIXME` string is used in code comments to denote things that should be fixed for future releases. See https://github.com/electron/electron/search?q=fixme
This document uses the following convention to categorize breaking changes:
- **API Changed:** An API was changed in such a way that code that has not been updated is guaranteed to throw an exception.
- **Behavior Changed:** The behavior of Electron has changed, but not in such a way that an exception will necessarily be thrown.
- **Default Changed:** Code depending on the old default may break, not necessarily throwing an exception. The old behavior can be restored by explicitly specifying the value.
- **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
- **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (12.0)
### Removed: `crashReporter` methods in the renderer process
The following `crashReporter` methods are no longer available in the renderer
process:
- `crashReporter.start`
- `crashReporter.getLastCrashReport`
- `crashReporter.getUploadedReports`
- `crashReporter.getUploadToServer`
- `crashReporter.setUploadToServer`
- `crashReporter.getCrashesDirectory`
They should be called only from the main process.
See [#23265](https://github.com/electron/electron/pull/23265) for more details.
## Planned Breaking API Changes (11.0)
## Planned Breaking API Changes (10.0)
### Deprecated: `companyName` argument to `crashReporter.start()`
The `companyName` argument to `crashReporter.start()`, which was previously
required, is now optional, and further, is deprecated. To get the same
behavior in a non-deprecated way, you can pass a `companyName` value in
`globalExtra`.
```js
// Deprecated in Electron 10
crashReporter.start({ companyName: 'Umbrella Corporation' })
// Replace with
crashReporter.start({ globalExtra: { _companyName: 'Umbrella Corporation' } })
```
### Deprecated: `crashReporter.getCrashesDirectory()`
The `crashReporter.getCrashesDirectory` method has been deprecated. Usage
should be replaced by `app.getPath('crashDumps')`.
```js
// Deprecated in Electron 10
crashReporter.getCrashesDirectory()
// Replace with
app.getPath('crashDumps')
```
### Deprecated: `crashReporter` methods in the renderer process
Calling the following `crashReporter` methods from the renderer process is
deprecated:
- `crashReporter.start`
- `crashReporter.getLastCrashReport`
- `crashReporter.getUploadedReports`
- `crashReporter.getUploadToServer`
- `crashReporter.setUploadToServer`
- `crashReporter.getCrashesDirectory`
The only non-deprecated methods remaining in the `crashReporter` module in the
renderer are `addExtraParameter`, `removeExtraParameter` and `getParameters`.
All above methods remain non-deprecated when called from the main process.
See [#23265](https://github.com/electron/electron/pull/23265) for more details.
### Removed: Browser Window Affinity
The `affinity` option when constructing a new `BrowserWindow` will be removed
as part of our plan to more closely align with Chromium's process model for security,
performance and maintainability.
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
### Default Changed: `enableRemoteModule` defaults to `false`
In Electron 9, using the remote module without explicitly enabling it via the
`enableRemoteModule` WebPreferences option began emitting a warning. In
Electron 10, the remote module is now disabled by default. To use the remote
module, `enableRemoteModule: true` must be specified in WebPreferences:
```js
const w = new BrowserWindow({
webPreferences: {
enableRemoteModule: true
}
})
```
We [recommend moving away from the remote
module](https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31).
## Planned Breaking API Changes (9.0)
### `<webview>.getWebContents()`
### Default Changed: Loading non-context-aware native modules in the renderer process is disabled by default
As of Electron 9 we do not allow loading of non-context-aware native modules in
the renderer process. This is to improve security, performance and maintainability
of Electron as a project.
If this impacts you, you can temporarily set `app.allowRendererProcessReuse` to `false`
to revert to the old behavior. This flag will only be an option until Electron 11 so
you should plan to update your native modules to be context aware.
For more detailed information see [#18397](https://github.com/electron/electron/issues/18397).
### Removed: `<webview>.getWebContents()`
This API, which was deprecated in Electron 8.0, is now removed.
@@ -20,7 +131,7 @@ const { remote } = require('electron')
remote.webContents.fromId(webview.getWebContentsId())
```
### `webFrame.setLayoutZoomLevelLimits()`
### Removed: `webFrame.setLayoutZoomLevelLimits()`
Chromium has removed support for changing the layout zoom level limits, and it
is beyond Electron's capacity to maintain it. The function was deprecated in
@@ -28,7 +139,7 @@ Electron 8.x, and has been removed in Electron 9.x. The layout zoom level limits
are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
[here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11).
### Sending non-JS objects over IPC now throws an exception
### Behavior Changed: Sending non-JS objects over IPC now throws an exception
In Electron 8.0, IPC was changed to use the Structured Clone Algorithm,
bringing significant performance improvements. To help ease the transition, the
@@ -44,9 +155,14 @@ In Electron 9.0, the old serialization algorithm has been removed, and sending
such non-serializable objects will now throw an "object could not be cloned"
error.
### API Changed: `shell.openItem` is now `shell.openPath`
The `shell.openItem` API has been replaced with an asynchronous `shell.openPath` API.
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/master/wg-api/spec-documents/shell-openitem.md).
## Planned Breaking API Changes (8.0)
### Values sent over IPC are now serialized with Structured Clone Algorithm
### Behavior Changed: Values sent over IPC are now serialized with Structured Clone Algorithm
The algorithm used to serialize objects sent over IPC (through
`ipcRenderer.send`, `ipcRenderer.sendSync`, `WebContents.send` and related
@@ -97,7 +213,7 @@ these kinds of objects will throw a 'could not be cloned' error.
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
### `<webview>.getWebContents()`
### Deprecated: `<webview>.getWebContents()`
This API is implemented using the `remote` module, which has both performance
and security implications. Therefore its usage should be explicit.
@@ -138,7 +254,7 @@ const { ipcRenderer } = require('electron')
ipcRenderer.invoke('openDevTools', webview.getWebContentsId())
```
### `webFrame.setLayoutZoomLevelLimits()`
### Deprecated: `webFrame.setLayoutZoomLevelLimits()`
Chromium has removed support for changing the layout zoom level limits, and it
is beyond Electron's capacity to maintain it. The function will emit a warning
@@ -148,7 +264,7 @@ limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined
## Planned Breaking API Changes (7.0)
### Node Headers URL
### Deprecated: Atom.io Node Headers URL
This is the URL specified as `disturl` in a `.npmrc` file or as the `--dist-url`
command line flag when building native Node modules. Both will be supported for
@@ -158,7 +274,7 @@ Deprecated: https://atom.io/download/electron
Replace with: https://electronjs.org/headers
### `session.clearAuthCache(options)`
### API Changed: `session.clearAuthCache()` no longer accepts options
The `session.clearAuthCache` API no longer accepts options for what to clear, and instead unconditionally clears the whole cache.
@@ -169,25 +285,25 @@ session.clearAuthCache({ type: 'password' })
session.clearAuthCache()
```
### `powerMonitor.querySystemIdleState`
### API Changed: `powerMonitor.querySystemIdleState` is now `powerMonitor.getSystemIdleState`
```js
// Removed in Electron 7.0
powerMonitor.querySystemIdleState(threshold, callback)
// Replace with synchronous API
const idleState = getSystemIdleState(threshold)
const idleState = powerMonitor.getSystemIdleState(threshold)
```
### `powerMonitor.querySystemIdleTime`
### API Changed: `powerMonitor.querySystemIdleTime` is now `powerMonitor.getSystemIdleState`
```js
// Removed in Electron 7.0
powerMonitor.querySystemIdleTime(callback)
// Replace with synchronous API
const idleTime = getSystemIdleTime()
const idleTime = powerMonitor.getSystemIdleTime()
```
### webFrame Isolated World APIs
### API Changed: `webFrame.setIsolatedWorldInfo` replaces separate methods
```js
// Removed in Electron 7.0
@@ -204,11 +320,11 @@ webFrame.setIsolatedWorldInfo(
})
```
### Removal of deprecated `marked` property on getBlinkMemoryInfo
### Removed: `marked` property on `getBlinkMemoryInfo`
This property was removed in Chromium 77, and as such is no longer available.
### `webkitdirectory` attribute for `<input type="file"/>`
### Behavior Changed: `webkitdirectory` attribute for `<input type="file"/>` now lists directory contents
The `webkitdirectory` property on HTML file inputs allows them to select folders.
Previous versions of Electron had an incorrect implementation where the `event.target.files`
@@ -241,9 +357,10 @@ In Electron 7, this now returns a `FileList` with a `File` object for:
Note that `webkitdirectory` no longer exposes the path to the selected folder.
If you require the path to the selected folder rather than the folder contents,
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
## Planned Breaking API Changes (6.0)
### `win.setMenu(null)`
### API Changed: `win.setMenu(null)` is now `win.removeMenu()`
```js
// Deprecated
@@ -252,7 +369,7 @@ win.setMenu(null)
win.removeMenu()
```
### `contentTracing.getTraceBufferUsage()`
### API Changed: `contentTracing.getTraceBufferUsage()` is now a promise
```js
// Deprecated
@@ -265,7 +382,7 @@ contentTracing.getTraceBufferUsage().then(infoObject => {
})
```
### `electron.screen` in renderer process
### API Changed: `electron.screen` in the renderer process should be accessed via `remote`
```js
// Deprecated
@@ -274,7 +391,7 @@ require('electron').screen
require('electron').remote.screen
```
### `require` in sandboxed renderers
### API Changed: `require()`ing node builtins in sandboxed renderers no longer implicitly loads the `remote` version
```js
// Deprecated
@@ -298,25 +415,25 @@ require('path')
require('electron').remote.require('path')
```
### `powerMonitor.querySystemIdleState`
### Deprecated: `powerMonitor.querySystemIdleState` replaced with `powerMonitor.getSystemIdleState`
```js
// Deprecated
powerMonitor.querySystemIdleState(threshold, callback)
// Replace with synchronous API
const idleState = getSystemIdleState(threshold)
const idleState = powerMonitor.getSystemIdleState(threshold)
```
### `powerMonitor.querySystemIdleTime`
### Deprecated: `powerMonitor.querySystemIdleTime` replaced with `powerMonitor.getSystemIdleTime`
```js
// Deprecated
powerMonitor.querySystemIdleTime(callback)
// Replace with synchronous API
const idleTime = getSystemIdleTime()
const idleTime = powerMonitor.getSystemIdleTime()
```
### `app.enableMixedSandbox`
### Deprecated: `app.enableMixedSandbox()` is no longer needed
```js
// Deprecated
@@ -325,7 +442,7 @@ app.enableMixedSandbox()
Mixed-sandbox mode is now enabled by default.
### `Tray`
### Deprecated: `Tray.setHighlightMode`
Under macOS Catalina our former Tray implementation breaks.
Apple's native substitute doesn't support changing the highlighting behavior.
@@ -338,7 +455,7 @@ tray.setHighlightMode(mode)
## Planned Breaking API Changes (5.0)
### `new BrowserWindow({ webPreferences })`
### Default Changed: `nodeIntegration` and `webviewTag` default to false, `contextIsolation` defaults to true
The following `webPreferences` option default values are deprecated in favor of the new defaults listed below.
@@ -358,16 +475,16 @@ const w = new BrowserWindow({
})
```
### `nativeWindowOpen`
### Behavior Changed: `nodeIntegration` in child windows opened via `nativeWindowOpen`
Child windows opened with the `nativeWindowOpen` option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames` is `true.
Child windows opened with the `nativeWindowOpen` option will always have Node.js integration disabled, unless `nodeIntegrationInSubFrames` is `true`.
### Privileged Schemes Registration
### API Changed: Registering privileged schemes must now be done before app ready
Renderer process APIs `webFrame.setRegisterURLSchemeAsPrivileged` and `webFrame.registerURLSchemeAsBypassingCSP` as well as browser process API `protocol.registerStandardSchemes` have been removed.
Renderer process APIs `webFrame.registerURLSchemeAsPrivileged` and `webFrame.registerURLSchemeAsBypassingCSP` as well as browser process API `protocol.registerStandardSchemes` have been removed.
A new API, `protocol.registerSchemesAsPrivileged` has been added and should be used for registering custom schemes with the required privileges. Custom schemes are required to be registered before app ready.
### webFrame Isolated World APIs
### Deprecated: `webFrame.setIsolatedWorld*` replaced with `webFrame.setIsolatedWorldInfo`
```js
// Deprecated
@@ -384,7 +501,7 @@ webFrame.setIsolatedWorldInfo(
})
```
## `webFrame.setSpellCheckProvider`
### API Changed: `webFrame.setSpellCheckProvider` now takes an asynchronous callback
The `spellCheck` callback is now asynchronous, and `autoCorrectWord` parameter has been removed.
```js
// Deprecated

View File

@@ -55,7 +55,9 @@ template("electron_extra_paks") {
output = "${invoker.output_dir}/resources.pak"
sources = [
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/dev_ui_content_resources.pak",
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
@@ -68,7 +70,9 @@ template("electron_extra_paks") {
"//components/resources",
"//content:content_resources",
"//content:dev_ui_content_resources",
"//content/browser/resources/media:media_internals_resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//electron:resources",
"//mojo/public/js:resources",
"//net:net_resources",

View File

@@ -21,6 +21,7 @@ auto_filenames = {
"docs/api/dock.md",
"docs/api/download-item.md",
"docs/api/environment-variables.md",
"docs/api/extensions.md",
"docs/api/file-object.md",
"docs/api/frameless-window.md",
"docs/api/global-shortcut.md",
@@ -96,6 +97,7 @@ auto_filenames = {
"docs/api/structures/mime-typed-buffer.md",
"docs/api/structures/mouse-input-event.md",
"docs/api/structures/mouse-wheel-input-event.md",
"docs/api/structures/new-window-event.md",
"docs/api/structures/notification-action.md",
"docs/api/structures/point.md",
"docs/api/structures/printer-info.md",
@@ -130,20 +132,19 @@ auto_filenames = {
]
sandbox_bundle_deps = [
"lib/browser/api/module-keys.js",
"lib/browser/api/module-names.ts",
"lib/common/api/clipboard.js",
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/ipc-renderer.ts",
"lib/renderer/api/remote.js",
@@ -178,11 +179,8 @@ auto_filenames = {
isolated_bundle_deps = [
"lib/common/electron-binding-setup.ts",
"lib/isolated_renderer/init.js",
"lib/renderer/ipc-renderer-internal-utils.ts",
"lib/renderer/ipc-renderer-internal.ts",
"lib/renderer/web-view/web-view-constants.ts",
"lib/renderer/web-view/web-view-element.ts",
"lib/renderer/window-setup.ts",
"package.json",
"tsconfig.electron.json",
"tsconfig.json",
@@ -192,6 +190,7 @@ auto_filenames = {
"lib/common/electron-binding-setup.ts",
"lib/common/webpack-globals-provider.ts",
"lib/content_script/init.js",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/chrome-api.ts",
"lib/renderer/extensions/event.ts",
"lib/renderer/extensions/i18n.ts",
@@ -214,7 +213,7 @@ auto_filenames = {
"lib/browser/api/browser-view.js",
"lib/browser/api/browser-window.js",
"lib/browser/api/content-tracing.js",
"lib/browser/api/crash-reporter.js",
"lib/browser/api/crash-reporter.ts",
"lib/browser/api/dialog.js",
"lib/browser/api/exports/electron.ts",
"lib/browser/api/global-shortcut.js",
@@ -250,7 +249,6 @@ auto_filenames = {
"lib/browser/api/web-contents.js",
"lib/browser/chrome-extension-shim.js",
"lib/browser/chrome-extension.js",
"lib/browser/crash-reporter-init.js",
"lib/browser/default-menu.ts",
"lib/browser/desktop-capturer.ts",
"lib/browser/devtools.ts",
@@ -270,7 +268,6 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
@@ -287,13 +284,12 @@ auto_filenames = {
]
renderer_bundle_deps = [
"lib/browser/api/module-keys.js",
"lib/browser/api/module-names.ts",
"lib/common/api/clipboard.js",
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
@@ -302,7 +298,7 @@ auto_filenames = {
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/exports/electron.ts",
"lib/renderer/api/ipc-renderer.ts",
@@ -336,13 +332,12 @@ auto_filenames = {
]
worker_bundle_deps = [
"lib/browser/api/module-keys.js",
"lib/browser/api/module-names.ts",
"lib/common/api/clipboard.js",
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
@@ -350,7 +345,7 @@ auto_filenames = {
"lib/common/type-utils.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/crash-reporter.ts",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/exports/electron.ts",
"lib/renderer/api/ipc-renderer.ts",

View File

@@ -31,6 +31,8 @@ filenames = {
"shell/app/command_line_args.h",
"shell/app/electron_content_client.cc",
"shell/app/electron_content_client.h",
"shell/app/electron_crash_reporter_client.cc",
"shell/app/electron_crash_reporter_client.h",
"shell/app/electron_main_delegate.cc",
"shell/app/electron_main_delegate.h",
"shell/app/electron_main_delegate_mac.h",
@@ -51,6 +53,8 @@ filenames = {
"shell/browser/api/electron_api_content_tracing.cc",
"shell/browser/api/electron_api_cookies.cc",
"shell/browser/api/electron_api_cookies.h",
"shell/browser/api/electron_api_crash_reporter.cc",
"shell/browser/api/electron_api_crash_reporter.h",
"shell/browser/api/electron_api_data_pipe_holder.cc",
"shell/browser/api/electron_api_data_pipe_holder.h",
"shell/browser/api/electron_api_debugger.cc",
@@ -164,7 +168,6 @@ filenames = {
"shell/browser/electron_javascript_dialog_manager.h",
"shell/browser/electron_navigation_throttle.cc",
"shell/browser/electron_navigation_throttle.h",
"shell/browser/electron_paths.h",
"shell/browser/electron_permission_manager.cc",
"shell/browser/electron_permission_manager.h",
"shell/browser/electron_quota_permission_context.cc",
@@ -389,6 +392,8 @@ filenames = {
"shell/browser/ui/views/submenu_button.h",
"shell/browser/ui/views/win_frame_view.cc",
"shell/browser/ui/views/win_frame_view.h",
"shell/browser/ui/win/dialog_thread.cc",
"shell/browser/ui/win/dialog_thread.h",
"shell/browser/ui/win/electron_desktop_native_widget_aura.cc",
"shell/browser/ui/win/electron_desktop_native_widget_aura.h",
"shell/browser/ui/win/electron_desktop_window_tree_host_win.cc",
@@ -433,7 +438,6 @@ filenames = {
"shell/common/api/electron_api_clipboard.h",
"shell/common/api/electron_api_clipboard_mac.mm",
"shell/common/api/electron_api_command_line.cc",
"shell/common/api/electron_api_crash_reporter.cc",
"shell/common/api/electron_api_key_weak_map.h",
"shell/common/api/electron_api_native_image.cc",
"shell/common/api/electron_api_native_image.h",
@@ -443,6 +447,8 @@ filenames = {
"shell/common/api/electron_bindings.cc",
"shell/common/api/electron_bindings.h",
"shell/common/api/features.cc",
"shell/common/api/object_life_monitor.cc",
"shell/common/api/object_life_monitor.h",
"shell/common/application_info.cc",
"shell/common/application_info.h",
"shell/common/application_info_linux.cc",
@@ -456,22 +462,13 @@ filenames = {
"shell/common/asar/scoped_temporary_file.h",
"shell/common/color_util.cc",
"shell/common/color_util.h",
"shell/common/crash_reporter/crash_reporter.cc",
"shell/common/crash_reporter/crash_reporter.h",
"shell/common/crash_reporter/crash_reporter_linux.cc",
"shell/common/crash_reporter/crash_reporter_linux.h",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
"shell/common/crash_reporter/crash_reporter_win.cc",
"shell/common/crash_reporter/crash_reporter_win.h",
"shell/common/crash_reporter/linux/crash_dump_handler.cc",
"shell/common/crash_reporter/linux/crash_dump_handler.h",
"shell/common/crash_reporter/win/crash_service_main.cc",
"shell/common/crash_reporter/win/crash_service_main.h",
"shell/common/crash_keys.cc",
"shell/common/crash_keys.h",
"shell/common/electron_command_line.cc",
"shell/common/electron_command_line.h",
"shell/common/electron_constants.cc",
"shell/common/electron_constants.h",
"shell/common/electron_paths.h",
"shell/common/gin_converters/accelerator_converter.cc",
"shell/common/gin_converters/accelerator_converter.h",
"shell/common/gin_converters/blink_converter.cc",
@@ -479,8 +476,6 @@ filenames = {
"shell/common/gin_converters/callback_converter.h",
"shell/common/gin_converters/content_converter.cc",
"shell/common/gin_converters/content_converter.h",
"shell/common/gin_converters/extension_converter.cc",
"shell/common/gin_converters/extension_converter.h",
"shell/common/gin_converters/file_dialog_converter.cc",
"shell/common/gin_converters/file_dialog_converter.h",
"shell/common/gin_converters/file_path_converter.h",
@@ -495,6 +490,8 @@ filenames = {
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/time_converter.cc",
"shell/common/gin_converters/time_converter.h",
"shell/common/gin_converters/value_converter.cc",
"shell/common/gin_converters/value_converter.h",
"shell/common/gin_helper/arguments.cc",
@@ -515,6 +512,8 @@ filenames = {
"shell/common/gin_helper/function_template.h",
"shell/common/gin_helper/locker.cc",
"shell/common/gin_helper/locker.h",
"shell/common/gin_helper/microtasks_scope.cc",
"shell/common/gin_helper/microtasks_scope.h",
"shell/common/gin_helper/object_template_builder.cc",
"shell/common/gin_helper/object_template_builder.h",
"shell/common/gin_helper/persistent_dictionary.cc",
@@ -531,6 +530,10 @@ filenames = {
"shell/common/key_weak_map.h",
"shell/common/keyboard_util.cc",
"shell/common/keyboard_util.h",
"shell/common/language_util.h",
"shell/common/language_util_linux.cc",
"shell/common/language_util_mac.mm",
"shell/common/language_util_win.cc",
"shell/common/mac/main_application_bundle.h",
"shell/common/mac/main_application_bundle.mm",
"shell/common/mouse_util.cc",
@@ -561,10 +564,9 @@ filenames = {
"shell/common/world_ids.h",
"shell/renderer/api/context_bridge/object_cache.cc",
"shell/renderer/api/context_bridge/object_cache.h",
"shell/renderer/api/context_bridge/render_frame_function_store.cc",
"shell/renderer/api/context_bridge/render_frame_function_store.h",
"shell/renderer/api/electron_api_context_bridge.cc",
"shell/renderer/api/electron_api_context_bridge.h",
"shell/renderer/api/electron_api_crash_reporter_renderer.cc",
"shell/renderer/api/electron_api_renderer_ipc.cc",
"shell/renderer/api/electron_api_spell_check_client.cc",
"shell/renderer/api/electron_api_spell_check_client.h",
@@ -645,6 +647,8 @@ filenames = {
"shell/common/extensions/electron_extensions_api_provider.h",
"shell/common/extensions/electron_extensions_client.cc",
"shell/common/extensions/electron_extensions_client.h",
"shell/common/gin_converters/extension_converter.cc",
"shell/common/gin_converters/extension_converter.h",
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.cc",
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.h",
"shell/renderer/extensions/electron_extensions_renderer_client.cc",

View File

@@ -1,12 +0,0 @@
'use strict';
const CrashReporter = require('@electron/internal/common/crash-reporter');
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init');
class CrashReporterMain extends CrashReporter {
init (options) {
return crashReporterInit(options);
}
}
module.exports = new CrashReporterMain();

View File

@@ -0,0 +1,83 @@
import { app } from 'electron';
const binding = process.electronBinding('crash_reporter');
class CrashReporter {
start (options: Electron.CrashReporterStartOptions) {
const {
productName = app.name,
companyName = undefined,
extra = {},
globalExtra = {},
ignoreSystemCrashHandler = false,
submitURL = undefined,
uploadToServer = true,
rateLimit = false,
compress = false
} = options || {};
if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');
const appVersion = app.getVersion();
if (companyName && globalExtra._companyName == null) globalExtra._companyName = companyName;
const globalExtraAmended = {
_productName: productName,
_version: appVersion,
...globalExtra
};
binding.start(submitURL, uploadToServer,
ignoreSystemCrashHandler, rateLimit, compress, globalExtraAmended, extra, false);
}
getLastCrashReport () {
const reports = this.getUploadedReports()
.sort((a, b) => {
const ats = (a && a.date) ? new Date(a.date).getTime() : 0;
const bts = (b && b.date) ? new Date(b.date).getTime() : 0;
return bts - ats;
});
return (reports.length > 0) ? reports[0] : null;
}
getUploadedReports (): Electron.CrashReport[] {
return binding.getUploadedReports();
}
getCrashesDirectory () {
return app.getPath('crashDumps');
}
getUploadToServer () {
if (process.type === 'browser') {
return binding.getUploadToServer();
} else {
throw new Error('getUploadToServer can only be called from the main process');
}
}
setUploadToServer (uploadToServer: boolean) {
if (process.type === 'browser') {
return binding.setUploadToServer(uploadToServer);
} else {
throw new Error('setUploadToServer can only be called from the main process');
}
}
addExtraParameter (key: string, value: string) {
binding.addExtraParameter(key, value);
}
removeExtraParameter (key: string) {
binding.removeExtraParameter(key);
}
getParameters () {
return binding.getParameters();
}
}
export default new CrashReporter();

View File

@@ -249,7 +249,11 @@ module.exports = {
},
showCertificateTrustDialog: function (window, options) {
if (window && window.constructor !== BrowserWindow) options = window;
if (window && window.constructor !== BrowserWindow) {
options = window;
window = null;
}
if (options == null || typeof options !== 'object') {
throw new TypeError('options must be an object');
}

View File

@@ -10,7 +10,8 @@ const roles = {
about: {
get label () {
return isLinux ? 'About' : `About ${app.name}`;
}
},
...(isWindows && { appMethod: 'showAboutPanel' })
},
close: {
label: isMac ? 'Close Window' : 'Close',
@@ -70,7 +71,7 @@ const roles = {
},
pasteandmatchstyle: {
label: 'Paste and Match Style',
accelerator: 'Shift+CommandOrControl+V',
accelerator: isMac ? 'Cmd+Option+Shift+V' : 'Shift+CommandOrControl+V',
webContentsMethod: 'pasteAndMatchStyle',
registerAccelerator: false
},

View File

@@ -1,52 +0,0 @@
'use strict';
// TODO: Figure out a way to not duplicate this information between here and module-list
// It is currently duplicated as module-list "require"s all the browser API file and the
// remote module in the renderer process depends on that file. As a result webpack
// includes all the browser API files in the renderer process as well and we want to avoid that
const features = process.electronBinding('features');
// Browser side modules, please sort alphabetically.
module.exports = [
{ name: 'app' },
{ name: 'autoUpdater' },
{ name: 'BrowserView' },
{ name: 'BrowserWindow' },
{ name: 'contentTracing' },
{ name: 'crashReporter' },
{ name: 'dialog' },
{ name: 'globalShortcut' },
{ name: 'ipcMain' },
{ name: 'inAppPurchase' },
{ name: 'Menu' },
{ name: 'MenuItem' },
{ name: 'nativeTheme' },
{ name: 'net' },
{ name: 'netLog' },
{ name: 'Notification' },
{ name: 'powerMonitor' },
{ name: 'powerSaveBlocker' },
{ name: 'protocol' },
{ name: 'screen' },
{ name: 'session' },
{ name: 'systemPreferences' },
{ name: 'TopLevelWindow' },
{ name: 'TouchBar' },
{ name: 'Tray' },
{ name: 'View' },
{ name: 'webContents' },
{ name: 'WebContentsView' }
];
if (features.isViewApiEnabled()) {
module.exports.push(
{ name: 'BoxLayout' },
{ name: 'Button' },
{ name: 'LabelButton' },
{ name: 'LayoutManager' },
{ name: 'MdTextButton' },
{ name: 'ResizeArea' },
{ name: 'TextField' }
);
}

View File

@@ -1,7 +1,5 @@
// TODO: Updating this file also required updating the module-keys file
const features = process.electronBinding('features');
// Browser side modules, please sort alphabetically.
export const browserModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'app', loader: () => require('./app') },
@@ -34,14 +32,14 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'WebContentsView', loader: () => require('./web-contents-view') }
];
if (features.isViewApiEnabled()) {
if (BUILDFLAG(ENABLE_VIEW_API)) {
browserModuleList.push(
{ name: 'BoxLayout', loader: () => require('./views/box-layout') },
{ name: 'Button', loader: () => require('./views/button') },
{ name: 'LabelButton', loader: () => require('./views/label-button') },
{ name: 'LayoutManager', loader: () => require('./views/layout-manager') },
{ name: 'MdTextButton', loader: () => require('./views/md-text-button') },
{ name: 'ResizeArea', loader: () => require('./views/resize-area') },
{ name: 'TextField', loader: () => require('./views/text-field') }
{ name: 'BoxLayout', loader: () => require('@electron/internal/browser/api/views/box-layout') },
{ name: 'Button', loader: () => require('@electron/internal/browser/api/views/button') },
{ name: 'LabelButton', loader: () => require('@electron/internal/browser/api/views/label-button') },
{ name: 'LayoutManager', loader: () => require('@electron/internal/browser/api/views/layout-manager') },
{ name: 'MdTextButton', loader: () => require('@electron/internal/browser/api/views/md-text-button') },
{ name: 'ResizeArea', loader: () => require('@electron/internal/browser/api/views/resize-area') },
{ name: 'TextField', loader: () => require('@electron/internal/browser/api/views/text-field') }
);
}

View File

@@ -0,0 +1,48 @@
// TODO: Figure out a way to not duplicate this information between here and module-list
// It is currently duplicated as module-list "require"s all the browser API file and the
// remote module in the renderer process depends on that file. As a result webpack
// includes all the browser API files in the renderer process as well and we want to avoid that
// Browser side modules, please sort alphabetically.
export const browserModuleNames = [
'app',
'autoUpdater',
'BrowserView',
'BrowserWindow',
'contentTracing',
'crashReporter',
'dialog',
'globalShortcut',
'ipcMain',
'inAppPurchase',
'Menu',
'MenuItem',
'nativeTheme',
'net',
'netLog',
'Notification',
'powerMonitor',
'powerSaveBlocker',
'protocol',
'screen',
'session',
'systemPreferences',
'TopLevelWindow',
'TouchBar',
'Tray',
'View',
'webContents',
'WebContentsView'
];
if (BUILDFLAG(ENABLE_VIEW_API)) {
browserModuleNames.push(
'BoxLayout',
'Button',
'LabelButton',
'LayoutManager',
'MdTextButton',
'ResizeArea',
'TextField'
);
}

View File

@@ -371,6 +371,7 @@ class ClientRequest extends Writable {
}
return ret;
};
this._urlLoaderOptions.referrer = this._urlLoaderOptions.extraHeaders.referer || '';
const opts = { ...this._urlLoaderOptions, extraHeaders: stringifyValues(this._urlLoaderOptions.extraHeaders) };
this._urlLoader = new URLLoader(opts);
this._urlLoader.on('response-started', (event, finalUrl, responseHead) => {

View File

@@ -29,6 +29,11 @@ Object.defineProperty(TopLevelWindow.prototype, 'visibleOnAllWorkspaces', {
set: function (visible) { this.setVisibleOnAllWorkspaces(visible); }
});
Object.defineProperty(TopLevelWindow.prototype, 'fullScreen', {
get: function () { return this.isFullScreen(); },
set: function (full) { this.setFullScreen(full); }
});
Object.defineProperty(TopLevelWindow.prototype, 'simpleFullScreen', {
get: function () { return this.isSimpleFullScreen(); },
set: function (simple) { this.setSimpleFullScreen(simple); }

View File

@@ -1,6 +1,5 @@
'use strict';
const features = process.electronBinding('features');
const { EventEmitter } = require('events');
const electron = require('electron');
const path = require('path');
@@ -332,7 +331,7 @@ WebContents.prototype.printToPDF = function (options) {
printSettings.scaleFactor = Math.ceil(printSettings.scaleFactor) % 100;
// PrinterType enum from //printing/print_job_constants.h
printSettings.printerType = 2;
if (features.isPrintingEnabled()) {
if (this._printToPDF) {
return this._printToPDF(printSettings);
} else {
const error = new Error('Printing feature is disabled');
@@ -366,7 +365,7 @@ WebContents.prototype.print = function (options = {}, callback) {
}
}
if (features.isPrintingEnabled()) {
if (this._print) {
if (callback) {
this._print(options, callback);
} else {
@@ -378,7 +377,7 @@ WebContents.prototype.print = function (options = {}, callback) {
};
WebContents.prototype.getPrinters = function () {
if (features.isPrintingEnabled()) {
if (this._getPrinters) {
return this._getPrinters();
} else {
console.error('Error: Printing feature is disabled.');
@@ -528,6 +527,11 @@ WebContents.prototype._init = function () {
const referrer = { url: '', policy: 'default' };
internalWindowOpen(event, url, referrer, frameName, disposition, options);
});
const prefs = this.getWebPreferences() || {};
if (prefs.webviewTag && prefs.contextIsolation) {
electron.deprecate.log('Security Warning: A WebContents was just created with both webviewTag and contextIsolation enabled. This combination is fundamentally less secure and effectively bypasses the protections of contextIsolation. We strongly recommend you move away from webviews to OOPIF or BrowserView in order for your app to be more secure');
}
}
this.on('login', (event, ...args) => {

View File

@@ -1,25 +0,0 @@
'use strict';
const { app } = require('electron');
const path = require('path');
const getTempDirectory = function () {
try {
return app.getPath('temp');
} catch {
// Delibrately laze-load the os module, this file is on the hot
// path when booting Electron and os takes between 5 - 8ms to load and we do not need it yet
return require('os').tmpdir();
}
};
exports.crashReporterInit = function (options) {
const productName = options.productName || app.name;
const crashesDirectory = path.join(getTempDirectory(), `${productName} Crashes`);
return {
productName,
crashesDirectory,
appVersion: app.getVersion()
};
};

View File

@@ -232,7 +232,8 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn
['nodeIntegration', false],
['enableRemoteModule', false],
['sandbox', true],
['nodeIntegrationInSubFrames', false]
['nodeIntegrationInSubFrames', false],
['enableWebSQL', false]
]);
// Inherit certain option values from embedder
@@ -266,6 +267,9 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn
// Remove an guest-embedder relationship.
const detachGuest = function (embedder, guestInstanceId) {
const guestInstance = guestInstances[guestInstanceId];
if (!guestInstance) return;
if (embedder !== guestInstance.embedder) {
return;
}
@@ -356,6 +360,10 @@ handleMessage('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', function (event, embed
}
});
handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_DETACH_GUEST', function (event, guestInstanceId) {
return detachGuest(event.sender, guestInstanceId);
});
// this message is sent by the actual <webview>
ipcMainInternal.on('ELECTRON_GUEST_VIEW_MANAGER_FOCUS_CHANGE', function (event, focus, guestInstanceId) {
const guest = getGuest(guestInstanceId);

View File

@@ -19,7 +19,8 @@ const inheritedWebPreferences = new Map([
['enableRemoteModule', false],
['sandbox', true],
['webviewTag', false],
['nodeIntegrationInSubFrames', false]
['nodeIntegrationInSubFrames', false],
['enableWebSQL', false]
]);
// Copy attribute of |parent| to |child| if it is not defined in |child|.

View File

@@ -153,16 +153,14 @@ app._setDefaultAppPaths(packagePath);
// Load the chrome devtools support.
require('@electron/internal/browser/devtools');
const features = process.electronBinding('features');
// Load the chrome extension support.
if (features.isExtensionsEnabled()) {
if (BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)) {
require('@electron/internal/browser/chrome-extension-shim');
} else {
require('@electron/internal/browser/chrome-extension');
}
if (features.isRemoteModuleEnabled()) {
if (BUILDFLAG(ENABLE_REMOTE_MODULE)) {
require('@electron/internal/browser/remote/server');
}
@@ -188,6 +186,7 @@ function currentPlatformSupportsAppIndicator () {
}
// Workaround for electron/electron#5050 and electron/electron#9046
process.env.ORIGINAL_XDG_CURRENT_DESKTOP = process.env.XDG_CURRENT_DESKTOP;
if (currentPlatformSupportsAppIndicator()) {
process.env.XDG_CURRENT_DESKTOP = 'Unity';
}

View File

@@ -4,11 +4,12 @@ import * as electron from 'electron';
import { EventEmitter } from 'events';
import objectsRegistry from './objects-registry';
import { ipcMainInternal } from '../ipc-main-internal';
import { isPromise, isSerializableObject } from '@electron/internal/common/type-utils';
import { isPromise, isSerializableObject, deserialize, serialize } from '@electron/internal/common/type-utils';
const v8Util = process.electronBinding('v8_util');
const eventBinding = process.electronBinding('event');
const features = process.electronBinding('features');
const { NativeImage } = process.electronBinding('native_image');
if (!features.isRemoteModuleEnabled()) {
throw new Error('remote module is disabled');
@@ -113,6 +114,9 @@ type MetaType = {
} | {
type: 'promise',
then: MetaType
} | {
type: 'nativeimage'
value: electron.NativeImage
}
// Convert a real value into meta data.
@@ -123,6 +127,8 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
// Recognize certain types of objects.
if (value instanceof Buffer) {
type = 'buffer';
} else if (value instanceof NativeImage) {
type = 'nativeimage';
} else if (Array.isArray(value)) {
type = 'array';
} else if (value instanceof Error) {
@@ -146,6 +152,8 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
type,
members: value.map((el: any) => valueToMeta(sender, contextId, el, optimizeSimpleObject))
};
} else if (type === 'nativeimage') {
return { type, value: serialize(value) };
} else if (type === 'object' || type === 'function') {
return {
type,
@@ -233,7 +241,10 @@ type MetaTypeFromRenderer = {
} | {
type: 'object',
name: string,
members: { name: string, value: MetaTypeFromRenderer }[]
members: {
name: string,
value: MetaTypeFromRenderer
}[]
} | {
type: 'function-with-return-value',
value: MetaTypeFromRenderer
@@ -242,6 +253,14 @@ type MetaTypeFromRenderer = {
id: number,
location: string,
length: number
} | {
type: 'nativeimage',
value: {
size: electron.Size,
buffer: Buffer,
scaleFactor: number,
dataURL: string
}[]
}
const fakeConstructor = (constructor: Function, name: string) =>
@@ -259,6 +278,8 @@ const fakeConstructor = (constructor: Function, name: string) =>
const unwrapArgs = function (sender: electron.WebContents, frameId: number, contextId: string, args: any[]) {
const metaToValue = function (meta: MetaTypeFromRenderer): any {
switch (meta.type) {
case 'nativeimage':
return deserialize(meta.value);
case 'value':
return meta.value;
case 'remote-object':

View File

@@ -5,9 +5,7 @@ const fs = require('fs');
const eventBinding = process.electronBinding('event');
const clipboard = process.electronBinding('clipboard');
const features = process.electronBinding('features');
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init');
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal');
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils');
const guestViewManager = require('@electron/internal/browser/guest-view-manager');
@@ -37,10 +35,6 @@ ipcMainInternal.on('ELECTRON_BROWSER_WINDOW_CLOSE', function (event) {
event.returnValue = null;
});
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_INIT', function (event, options) {
return crashReporterInit(options);
});
ipcMainInternal.handle('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES', function (event) {
return event.sender.getLastWebPreferences();
});
@@ -65,7 +59,7 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_CLIPBOARD_SYNC', function (event, meth
return typeUtils.serialize(electron.clipboard[method](...typeUtils.deserialize(args)));
});
if (features.isDesktopCapturerEnabled()) {
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
const desktopCapturer = require('@electron/internal/browser/desktop-capturer');
ipcMainInternal.handle('ELECTRON_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function (event, options, stack) {
@@ -81,10 +75,14 @@ if (features.isDesktopCapturerEnabled()) {
});
}
const isRemoteModuleEnabled = features.isRemoteModuleEnabled()
const isRemoteModuleEnabled = BUILDFLAG(ENABLE_REMOTE_MODULE)
? require('@electron/internal/browser/remote/server').isRemoteModuleEnabled
: () => false;
const getContentScripts = !BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
? require('@electron/internal/browser/chrome-extension').getContentScripts
: () => [];
const getPreloadScript = async function (preloadPath) {
let preloadSrc = null;
let preloadError = null;
@@ -96,26 +94,14 @@ const getPreloadScript = async function (preloadPath) {
return { preloadPath, preloadSrc, preloadError };
};
if (features.isExtensionsEnabled()) {
ipcMainUtils.handleSync('ELECTRON_GET_CONTENT_SCRIPTS', () => []);
} else {
const { getContentScripts } = require('@electron/internal/browser/chrome-extension');
ipcMainUtils.handleSync('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts());
}
ipcMainUtils.handleSync('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts());
ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event) {
const preloadPaths = event.sender._getPreloadPaths();
let contentScripts = [];
if (!features.isExtensionsEnabled()) {
const { getContentScripts } = require('@electron/internal/browser/chrome-extension');
contentScripts = getContentScripts();
}
const webPreferences = event.sender.getLastWebPreferences() || {};
return {
contentScripts,
contentScripts: getContentScripts(),
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),
@@ -135,3 +121,23 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
ipcMainInternal.on('ELECTRON_BROWSER_PRELOAD_ERROR', function (event, preloadPath, error) {
event.sender.emit('preload-error', event, preloadPath, error);
});
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_LAST_CRASH_REPORT', () => {
return electron.crashReporter.getLastCrashReport();
});
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_UPLOADED_REPORTS', () => {
return electron.crashReporter.getUploadedReports();
});
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_UPLOAD_TO_SERVER', () => {
return electron.crashReporter.getUploadToServer();
});
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', (event, uploadToServer) => {
return electron.crashReporter.setUploadToServer(uploadToServer);
});
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY', () => {
return electron.crashReporter.getCrashesDirectory();
});

View File

@@ -572,7 +572,7 @@
};
const { readdir } = fs;
fs.readdir = function (pathArgument, options, callback) {
fs.readdir = function (pathArgument, options = {}, callback) {
const { isAsar, asarPath, filePath } = splitPath(pathArgument);
if (typeof options === 'function') {
callback = options;
@@ -594,13 +594,29 @@
return;
}
if (options.withFileTypes) {
const dirents = [];
for (const file of files) {
const stats = archive.stat(file);
if (stats.isFile) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
} else if (stats.isDirectory) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_DIR));
} else if (stats.isLink) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_LINK));
}
}
nextTick(callback, [null, dirents]);
return;
}
nextTick(callback, [null, files]);
};
fs.promises.readdir = util.promisify(fs.readdir);
const { readdirSync } = fs;
fs.readdirSync = function (pathArgument, options) {
fs.readdirSync = function (pathArgument, options = {}) {
const { isAsar, asarPath, filePath } = splitPath(pathArgument);
if (!isAsar) return readdirSync.apply(this, arguments);
@@ -614,6 +630,21 @@
throw createError(AsarError.NOT_FOUND, { asarPath, filePath });
}
if (options.withFileTypes) {
const dirents = [];
for (const file of files) {
const stats = archive.stat(file);
if (stats.isFile) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
} else if (stats.isDirectory) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_DIR));
} else if (stats.isLink) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_LINK));
}
}
return dirents;
}
return files;
};

View File

@@ -1,98 +0,0 @@
'use strict';
const binding = process.electronBinding('crash_reporter');
class CrashReporter {
constructor () {
this.productName = null;
this.crashesDirectory = null;
}
init (options) {
throw new Error('Not implemented');
}
start (options) {
if (options == null) options = {};
const {
productName,
companyName,
extra = {},
ignoreSystemCrashHandler = false,
submitURL,
uploadToServer = true
} = options;
if (companyName == null) throw new Error('companyName is a required option to crashReporter.start');
if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');
const ret = this.init({
submitURL,
productName
});
this.productName = ret.productName;
this.crashesDirectory = ret.crashesDirectory;
if (extra._productName == null) extra._productName = ret.productName;
if (extra._companyName == null) extra._companyName = companyName;
if (extra._version == null) extra._version = ret.appVersion;
binding.start(ret.productName, companyName, submitURL, ret.crashesDirectory, uploadToServer, ignoreSystemCrashHandler, extra);
}
getLastCrashReport () {
const reports = this.getUploadedReports()
.sort((a, b) => {
const ats = (a && a.date) ? new Date(a.date).getTime() : 0;
const bts = (b && b.date) ? new Date(b.date).getTime() : 0;
return bts - ats;
});
return (reports.length > 0) ? reports[0] : null;
}
getUploadedReports () {
const crashDir = this.getCrashesDirectory();
if (!crashDir) {
throw new Error('crashReporter has not been started');
}
return binding.getUploadedReports(crashDir);
}
getCrashesDirectory () {
return this.crashesDirectory;
}
getUploadToServer () {
if (process.type === 'browser') {
return binding.getUploadToServer();
} else {
throw new Error('getUploadToServer can only be called from the main process');
}
}
setUploadToServer (uploadToServer) {
if (process.type === 'browser') {
return binding.setUploadToServer(uploadToServer);
} else {
throw new Error('setUploadToServer can only be called from the main process');
}
}
addExtraParameter (key, value) {
binding.addExtraParameter(key, value);
}
removeExtraParameter (key) {
binding.removeExtraParameter(key);
}
getParameters () {
return binding.getParameters();
}
}
module.exports = CrashReporter;

0
lib/common/dummy.js Normal file
View File

View File

@@ -23,6 +23,7 @@ const serializableTypes = [
ArrayBuffer
];
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#Supported_types
export function isSerializableObject (value: any) {
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type);
}
@@ -33,14 +34,55 @@ const objectMap = function (source: Object, mapper: (value: any) => any) {
return Object.fromEntries(targetEntries);
};
function serializeNativeImage (image: any) {
const representations = [];
const scaleFactors = image.getScaleFactors();
// Use Buffer when there's only one representation for better perf.
// This avoids compressing to/from PNG where it's not necessary to
// ensure uniqueness of dataURLs (since there's only one).
if (scaleFactors.length === 1) {
const scaleFactor = scaleFactors[0];
const size = image.getSize(scaleFactor);
const buffer = image.toBitmap({ scaleFactor });
representations.push({ scaleFactor, size, buffer });
} else {
// Construct from dataURLs to ensure that they are not lost in creation.
for (const scaleFactor of scaleFactors) {
const size = image.getSize(scaleFactor);
const dataURL = image.toDataURL({ scaleFactor });
representations.push({ scaleFactor, size, dataURL });
}
}
return { __ELECTRON_SERIALIZED_NativeImage__: true, representations };
}
function deserializeNativeImage (value: any) {
const image = nativeImage.createEmpty();
// Use Buffer when there's only one representation for better perf.
// This avoids compressing to/from PNG where it's not necessary to
// ensure uniqueness of dataURLs (since there's only one).
if (value.representations.length === 1) {
const { buffer, size, scaleFactor } = value.representations[0];
const { width, height } = size;
image.addRepresentation({ buffer, scaleFactor, width, height });
} else {
// Construct from dataURLs to ensure that they are not lost in creation.
for (const rep of value.representations) {
const { dataURL, size, scaleFactor } = rep;
const { width, height } = size;
image.addRepresentation({ dataURL, scaleFactor, width, height });
}
}
return image;
}
export function serialize (value: any): any {
if (value instanceof NativeImage) {
return {
buffer: value.toBitmap(),
size: value.getSize(),
__ELECTRON_SERIALIZED_NativeImage__: true
};
} else if (Array.isArray(value)) {
return serializeNativeImage(value);
} if (Array.isArray(value)) {
return value.map(serialize);
} else if (isSerializableObject(value)) {
return value;
@@ -53,7 +95,7 @@ export function serialize (value: any): any {
export function deserialize (value: any): any {
if (value && value.__ELECTRON_SERIALIZED_NativeImage__) {
return nativeImage.createFromBitmap(value.buffer, value.size);
return deserializeNativeImage(value);
} else if (Array.isArray(value)) {
return value.map(deserialize);
} else if (isSerializableObject(value)) {

View File

@@ -6,10 +6,6 @@ process.electronBinding = require('@electron/internal/common/electron-binding-se
const v8Util = process.electronBinding('v8_util');
// The `lib/renderer/ipc-renderer-internal.js` module looks for the ipc object in the
// "ipc-internal" hidden value
v8Util.setHiddenValue(global, 'ipc-internal', v8Util.getHiddenValue(isolatedWorld, 'ipc-internal'));
const webViewImpl = v8Util.getHiddenValue(isolatedWorld, 'web-view-impl');
if (webViewImpl) {
@@ -17,11 +13,3 @@ if (webViewImpl) {
const { setupWebView } = require('@electron/internal/renderer/web-view/web-view-element');
setupWebView(v8Util, webViewImpl);
}
const isolatedWorldArgs = v8Util.getHiddenValue(isolatedWorld, 'isolated-world-args');
if (isolatedWorldArgs) {
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen } = isolatedWorldArgs;
const { windowSetup } = require('@electron/internal/renderer/window-setup');
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen);
}

View File

@@ -11,10 +11,21 @@ const contextBridge = {
exposeInMainWorld: (key: string, api: Record<string, any>) => {
checkContextIsolationEnabled();
return binding.exposeAPIInMainWorld(key, api);
},
debugGC: () => binding._debugGCMaps({})
}
};
if (!binding._debugGCMaps) delete contextBridge.debugGC;
export default contextBridge;
export const internalContextBridge = {
contextIsolationEnabled,
overrideGlobalValueFromIsolatedWorld: (keys: string[], value: any) => {
return binding._overrideGlobalValueFromIsolatedWorld(keys, value, false);
},
overrideGlobalValueWithDynamicPropsFromIsolatedWorld: (keys: string[], value: any) => {
return binding._overrideGlobalValueFromIsolatedWorld(keys, value, true);
},
overrideGlobalPropertyFromIsolatedWorld: (keys: string[], getter: Function, setter?: Function) => {
return binding._overrideGlobalPropertyFromIsolatedWorld(keys, getter, setter || null);
},
isInMainWorld: () => binding._isCalledFromMainWorld() as boolean
};

View File

@@ -1,12 +0,0 @@
'use strict';
const CrashReporter = require('@electron/internal/common/crash-reporter');
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils');
class CrashReporterRenderer extends CrashReporter {
init (options) {
return ipcRendererUtils.invokeSync('ELECTRON_CRASH_REPORTER_INIT', options);
}
}
module.exports = new CrashReporterRenderer();

View File

@@ -0,0 +1,50 @@
import { invokeSync } from '../ipc-renderer-internal-utils';
import { deprecate } from 'electron';
const binding = process.electronBinding('crash_reporter');
export default {
start (options: Electron.CrashReporterStartOptions) {
deprecate.log('crashReporter.start is deprecated in the renderer process. Call it from the main process instead.');
for (const [k, v] of Object.entries(options.extra || {})) {
binding.addExtraParameter(k, String(v));
}
},
getLastCrashReport (): Electron.CrashReport | null {
deprecate.log('crashReporter.getLastCrashReport is deprecated in the renderer process. Call it from the main process instead.');
return invokeSync('ELECTRON_CRASH_REPORTER_GET_LAST_CRASH_REPORT');
},
getUploadedReports () {
deprecate.log('crashReporter.getUploadedReports is deprecated in the renderer process. Call it from the main process instead.');
return invokeSync('ELECTRON_CRASH_REPORTER_GET_UPLOADED_REPORTS');
},
getUploadToServer () {
deprecate.log('crashReporter.getUploadToServer is deprecated in the renderer process. Call it from the main process instead.');
return invokeSync('ELECTRON_CRASH_REPORTER_GET_UPLOAD_TO_SERVER');
},
setUploadToServer (uploadToServer: boolean) {
deprecate.log('crashReporter.setUploadToServer is deprecated in the renderer process. Call it from the main process instead.');
return invokeSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', uploadToServer);
},
getCrashesDirectory () {
deprecate.log('crashReporter.getCrashesDirectory is deprecated in the renderer process. Call it from the main process instead.');
return invokeSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY');
},
addExtraParameter (key: string, value: string) {
binding.addExtraParameter(key, value);
},
removeExtraParameter (key: string) {
binding.removeExtraParameter(key);
},
getParameters () {
return binding.getParameters();
}
};

View File

@@ -1,4 +1,3 @@
const features = process.electronBinding('features');
const v8Util = process.electronBinding('v8_util');
const enableRemoteModule = v8Util.getHiddenValue<boolean>(global, 'enableRemoteModule');
@@ -11,10 +10,16 @@ export const rendererModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'webFrame', loader: () => require('./web-frame') }
];
if (features.isDesktopCapturerEnabled()) {
rendererModuleList.push({ name: 'desktopCapturer', loader: () => require('./desktop-capturer') });
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
rendererModuleList.push({
name: 'desktopCapturer',
loader: () => require('@electron/internal/renderer/api/desktop-capturer')
});
}
if (features.isRemoteModuleEnabled() && enableRemoteModule) {
rendererModuleList.push({ name: 'remote', loader: () => require('./remote') });
if (BUILDFLAG(ENABLE_REMOTE_MODULE) && enableRemoteModule) {
rendererModuleList.push({
name: 'remote',
loader: () => require('@electron/internal/renderer/api/remote')
});
}

View File

@@ -2,9 +2,10 @@
const v8Util = process.electronBinding('v8_util');
const { hasSwitch } = process.electronBinding('command_line');
const { NativeImage } = process.electronBinding('native_image');
const { CallbacksRegistry } = require('@electron/internal/renderer/remote/callbacks-registry');
const { isPromise, isSerializableObject } = require('@electron/internal/common/type-utils');
const { isPromise, isSerializableObject, serialize, deserialize } = require('@electron/internal/common/type-utils');
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal');
const callbacksRegistry = new CallbacksRegistry();
@@ -41,7 +42,9 @@ function wrapArgs (args, visited = new Set()) {
};
}
if (Array.isArray(value)) {
if (value instanceof NativeImage) {
return { type: 'nativeimage', value: serialize(value) };
} else if (Array.isArray(value)) {
visited.add(value);
const meta = {
type: 'array',
@@ -221,6 +224,7 @@ function metaToValue (meta) {
const types = {
value: () => meta.value,
array: () => meta.members.map((member) => metaToValue(member)),
nativeimage: () => deserialize(meta.value),
buffer: () => Buffer.from(meta.value.buffer, meta.value.byteOffset, meta.value.byteLength),
promise: () => Promise.resolve({ then: metaToValue(meta.then) }),
error: () => metaToError(meta),
@@ -357,7 +361,9 @@ const addBuiltinProperty = (name) => {
};
const { commonModuleList } = require('@electron/internal/common/api/module-list');
const browserModules = commonModuleList.concat(require('@electron/internal/browser/api/module-keys'));
const { browserModuleNames } = require('@electron/internal/browser/api/module-names');
const browserModules = commonModuleList.concat(browserModuleNames.map(name => ({ name })));
// And add a helper receiver for each one.
browserModules

View File

@@ -100,7 +100,7 @@ switch (window.location.protocol) {
}
case 'chrome-extension:': {
// Inject the chrome.* APIs that chrome extensions require
if (!process.electronBinding('features').isExtensionsEnabled()) {
if (!BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)) {
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window);
}
break;
@@ -113,7 +113,7 @@ switch (window.location.protocol) {
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen);
// Inject content scripts.
if (!process.electronBinding('features').isExtensionsEnabled()) {
if (!BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)) {
const contentScripts = ipcRendererUtils.invokeSync('ELECTRON_GET_CONTENT_SCRIPTS') as Electron.ContentScriptEntry[];
require('@electron/internal/renderer/content-scripts-injector')(contentScripts);
}

View File

@@ -1,5 +1,6 @@
import { webFrame, IpcMessageEvent } from 'electron';
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
import { WebViewImpl } from '@electron/internal/renderer/web-view/web-view-impl';
@@ -105,8 +106,13 @@ export function attachGuest (
ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', embedderFrameId, elementInstanceId, guestInstanceId, params);
}
export function detachGuest (guestInstanceId: number) {
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_VIEW_MANAGER_DETACH_GUEST', guestInstanceId);
}
export const guestViewInternalModule = {
deregisterEvents,
createGuest,
attachGuest
attachGuest,
detachGuest
};

View File

@@ -66,6 +66,9 @@ const defineWebViewElement = (v8Util: NodeJS.V8UtilBinding, webViewImpl: typeof
return;
}
guestViewInternal.deregisterEvents(internal.viewInstanceId);
if (internal.guestInstanceId) {
guestViewInternal.detachGuest(internal.guestInstanceId);
}
internal.elementAttached = false;
this.internalInstanceId = 0;
internal.reset();

View File

@@ -1,11 +1,10 @@
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils';
import { internalContextBridge } from '@electron/internal/renderer/api/context-bridge';
// This file implements the following APIs:
// - window.history.back()
// - window.history.forward()
// - window.history.go()
// - window.history.length
const { contextIsolationEnabled } = internalContextBridge;
// This file implements the following APIs over the ctx bridge:
// - window.open()
// - window.opener.blur()
// - window.opener.close()
@@ -13,7 +12,12 @@ import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-inte
// - window.opener.focus()
// - window.opener.location
// - window.opener.print()
// - window.opener.closed
// - window.opener.postMessage()
// - window.history.back()
// - window.history.forward()
// - window.history.go()
// - window.history.length
// - window.prompt()
// - document.hidden
// - document.visibilityState
@@ -30,13 +34,13 @@ const toString = (value: any) => {
const windowProxies = new Map<number, BrowserWindowProxy>();
const getOrCreateProxy = (guestId: number) => {
const getOrCreateProxy = (guestId: number): SafelyBoundBrowserWindowProxy => {
let proxy = windowProxies.get(guestId);
if (proxy == null) {
proxy = new BrowserWindowProxy(guestId);
windowProxies.set(guestId, proxy);
}
return proxy;
return proxy.getSafe();
};
const removeProxy = (guestId: number) => {
@@ -64,6 +68,8 @@ class LocationProxy {
*/
private static ProxyProperty<T> (target: LocationProxy, propertyKey: LocationProperties) {
Object.defineProperty(target, propertyKey, {
enumerable: true,
configurable: true,
get: function (this: LocationProxy): T | string {
const guestURL = this.getGuestURL();
const value = guestURL ? guestURL[propertyKey] : '';
@@ -82,6 +88,30 @@ class LocationProxy {
});
}
public getSafe = () => {
const that = this;
return {
get href () { return that.href; },
set href (newValue) { that.href = newValue; },
get hash () { return that.hash; },
set hash (newValue) { that.hash = newValue; },
get host () { return that.host; },
set host (newValue) { that.host = newValue; },
get hostname () { return that.hostname; },
set hostname (newValue) { that.hostname = newValue; },
get origin () { return that.origin; },
set origin (newValue) { that.origin = newValue; },
get pathname () { return that.pathname; },
set pathname (newValue) { that.pathname = newValue; },
get port () { return that.port; },
set port (newValue) { that.port = newValue; },
get protocol () { return that.protocol; },
set protocol (newValue) { that.protocol = newValue; },
get search () { return that.search; },
set search (newValue) { that.search = newValue; }
};
}
constructor (guestId: number) {
// eslint will consider the constructor "useless"
// unless we assign them in the body. It's fine, that's what
@@ -95,7 +125,11 @@ class LocationProxy {
}
private getGuestURL (): URL | null {
const urlString = this._invokeWebContentsMethodSync('getURL') as string;
const maybeURL = this._invokeWebContentsMethodSync('getURL') as string;
// When there's no previous frame the url will be blank, so accountfor that here
// to prevent url parsing errors on an empty string.
const urlString = maybeURL !== '' ? maybeURL : 'about:blank';
try {
return new URL(urlString);
} catch (e) {
@@ -114,6 +148,17 @@ class LocationProxy {
}
}
interface SafelyBoundBrowserWindowProxy {
location: WindowProxy['location'];
blur: WindowProxy['blur'];
close: WindowProxy['close'];
eval: typeof eval; // eslint-disable-line no-eval
focus: WindowProxy['focus'];
print: WindowProxy['print'];
postMessage: WindowProxy['postMessage'];
closed: boolean;
}
class BrowserWindowProxy {
public closed: boolean = false
@@ -124,7 +169,7 @@ class BrowserWindowProxy {
// so for now, we'll have to make do with an "any" in the mix.
// https://github.com/Microsoft/TypeScript/issues/2521
public get location (): LocationProxy | any {
return this._location;
return this._location.getSafe();
}
public set location (url: string | any) {
url = resolveURL(url, this.location.href);
@@ -141,27 +186,48 @@ class BrowserWindowProxy {
});
}
public close () {
public getSafe = (): SafelyBoundBrowserWindowProxy => {
const that = this;
return {
postMessage: this.postMessage,
blur: this.blur,
close: this.close,
focus: this.focus,
print: this.print,
eval: this.eval,
get location () {
return that.location;
},
set location (url: string | any) {
that.location = url;
},
get closed () {
return that.closed;
}
};
}
public close = () => {
this._invokeWindowMethod('destroy');
}
public focus () {
public focus = () => {
this._invokeWindowMethod('focus');
}
public blur () {
public blur = () => {
this._invokeWindowMethod('blur');
}
public print () {
public print = () => {
this._invokeWebContentsMethod('print');
}
public postMessage (message: any, targetOrigin: string) {
public postMessage = (message: any, targetOrigin: string) => {
ipcRendererInternal.invoke('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', this.guestId, message, toString(targetOrigin), window.location.origin);
}
public eval (code: string) {
public eval = (code: string) => {
this._invokeWebContentsMethod('executeJavaScript', code);
}
@@ -182,9 +248,11 @@ export const windowSetup = (
window.close = function () {
ipcRendererInternal.send('ELECTRON_BROWSER_WINDOW_CLOSE');
};
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['close'], window.close);
}
if (!usesNativeWindowOpen) {
// TODO(MarshallOfSound): Make compatible with ctx isolation without hole-punch
// Make the browser window or guest view emit "new-window" event.
(window as any).open = function (url?: string, frameName?: string, features?: string) {
if (url != null && url !== '') {
@@ -197,16 +265,19 @@ export const windowSetup = (
return null;
}
};
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueWithDynamicPropsFromIsolatedWorld(['open'], window.open);
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId);
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueWithDynamicPropsFromIsolatedWorld(['opener'], window.opener);
}
// But we do not support prompt().
window.prompt = function () {
throw new Error('prompt() is and will not be supported.');
};
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['prompt'], window.prompt);
if (!usesNativeWindowOpen || openerId != null) {
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
@@ -233,21 +304,24 @@ export const windowSetup = (
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK');
};
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['history', 'back'], window.history.back);
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD');
};
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['history', 'forward'], window.history.forward);
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset);
};
if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['history', 'go'], window.history.go);
const getHistoryLength = () => ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH');
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH');
},
get: getHistoryLength,
set () {}
});
if (contextIsolationEnabled) internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(['history', 'length'], getHistoryLength);
}
if (guestInstanceId != null) {
@@ -269,16 +343,16 @@ export const windowSetup = (
});
// Make document.hidden and document.visibilityState return the correct value.
const getDocumentHidden = () => cachedVisibilityState !== 'visible';
Object.defineProperty(document, 'hidden', {
get: function () {
return cachedVisibilityState !== 'visible';
}
get: getDocumentHidden
});
if (contextIsolationEnabled) internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(['document', 'hidden'], getDocumentHidden);
const getDocumentVisibilityState = () => cachedVisibilityState;
Object.defineProperty(document, 'visibilityState', {
get: function () {
return cachedVisibilityState;
}
get: getDocumentVisibilityState
});
if (contextIsolationEnabled) internalContextBridge.overrideGlobalPropertyFromIsolatedWorld(['document', 'visibilityState'], getDocumentVisibilityState);
}
};

View File

@@ -1,5 +1,3 @@
const features = process.electronBinding('features');
export const moduleList: ElectronInternal.ModuleEntry[] = [
{
name: 'contextBridge',
@@ -29,14 +27,14 @@ export const moduleList: ElectronInternal.ModuleEntry[] = [
}
];
if (features.isDesktopCapturerEnabled()) {
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
moduleList.push({
name: 'desktopCapturer',
loader: () => require('@electron/internal/renderer/api/desktop-capturer')
});
}
if (features.isRemoteModuleEnabled() && process.isRemoteModuleEnabled) {
if (BUILDFLAG(ENABLE_REMOTE_MODULE) && process.isRemoteModuleEnabled) {
moduleList.push({
name: 'remote',
loader: () => require('@electron/internal/renderer/api/remote')

View File

@@ -114,6 +114,12 @@ function preloadRequire (module) {
// Process command line arguments.
const { hasSwitch } = process.electronBinding('command_line');
// Similar to nodes --expose-internals flag, this exposes electronBinding so
// that tests can call it to get access to some test only bindings
if (hasSwitch('unsafely-expose-electron-internals-for-testing')) {
preloadProcess.electronBinding = process.electronBinding;
}
const contextIsolation = hasSwitch('context-isolation');
const isHiddenPage = hasSwitch('hidden-page');
const usesNativeWindowOpen = true;
@@ -129,7 +135,7 @@ switch (window.location.protocol) {
}
case 'chrome-extension:': {
// Inject the chrome.* APIs that chrome extensions require
if (!process.electronBinding('features').isExtensionsEnabled()) {
if (!BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)) {
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window);
}
break;
@@ -143,7 +149,7 @@ switch (window.location.protocol) {
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen);
// Inject content scripts.
if (!process.electronBinding('features').isExtensionsEnabled()) {
if (!BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)) {
require('@electron/internal/renderer/content-scripts-injector')(contentScripts);
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "9.0.0-beta.20",
"version": "9.0.6",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
@@ -9,6 +9,7 @@
"@octokit/rest": "^16.3.2",
"@primer/octicons": "^9.1.1",
"@types/basic-auth": "^1.1.2",
"@types/busboy": "^0.2.3",
"@types/chai": "^4.1.7",
"@types/chai-as-promised": "^7.1.0",
"@types/dirty-chai": "^2.0.0",
@@ -16,6 +17,7 @@
"@types/fs-extra": "^5.0.5",
"@types/mocha": "^5.2.6",
"@types/node": "^12.0.10",
"@types/rimraf": "^3.0.0",
"@types/semver": "^6.0.1",
"@types/send": "^0.14.5",
"@types/split": "^1.0.0",
@@ -45,6 +47,7 @@
"lint-staged": "^8.1.0",
"minimist": "^1.2.0",
"nugget": "^2.0.1",
"null-loader": "^4.0.0",
"pre-flight": "^1.1.0",
"remark-cli": "^4.0.0",
"remark-preset-lint-markdown-style-guide": "^2.1.1",
@@ -139,7 +142,6 @@
]
},
"dependencies": {
"@types/multiparty": "^0.0.32",
"@types/temp": "^0.8.34"
}
}

View File

@@ -92,3 +92,17 @@ fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
web_contents.patch
ui_gtk_public_header.patch
layoutng_make_hittestresult_localpoint_for_inline_element.patch
fix-ensure-edit-cmds-to-sent-focused-WebContents.patch
crash_allow_setting_more_options.patch
breakpad_disable_upload_compression.patch
breakpad_treat_node_processes_as_browser_processes.patch
upload_list_add_loadsync_method.patch
breakpad_allow_getting_string_values_for_crash_keys.patch
fix_hunspell_crash.patch
fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
fix_default_to_ntlm_v2_in_network_service.patch
a11y_iterate_all_descendants_for_getselectioncount.patch
a11y_allows_klistboxoption_as_an_item_to_kgroup.patch
fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch
allow_ime_to_insert_zero_length_composition_string.patch
remove_menu_window_task_item.patch

View File

@@ -0,0 +1,80 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Julie Jeongeun Kim <jkim@igalia.com>
Date: Fri, 3 Apr 2020 19:22:20 +0000
Subject: a11y: Allows kListBoxOption as an item to kGroup
This CL adds ListBoxOption role as an item for Group role in
AXNode::SetRoleMatchesItemRole() since Group role could have
ListBoxOption as an item[1]. With this change, when the parent
of ListBoxOption is a group role, PosInSet and SetSize has
proper values.
[1]https://w3c.github.io/aria-practices/examples/listbox/listbox-grouped.html
Bug: 1066632
Change-Id: I23cf0c34ee479d6e8ee33b3f9e327def820527e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134037
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756360}
diff --git a/ui/accessibility/ax_node.cc b/ui/accessibility/ax_node.cc
index b2012c7ac2169d366923b9b1f5645f03401ea44a..0db263e38b2364fb660d305dddf42c65483e015a 100644
--- a/ui/accessibility/ax_node.cc
+++ b/ui/accessibility/ax_node.cc
@@ -819,6 +819,7 @@ bool AXNode::SetRoleMatchesItemRole(const AXNode* ordered_set) const {
item_role == ax::mojom::Role::kListItem ||
item_role == ax::mojom::Role::kMenuItem ||
item_role == ax::mojom::Role::kMenuItemRadio ||
+ item_role == ax::mojom::Role::kListBoxOption ||
item_role == ax::mojom::Role::kTreeItem;
case ax::mojom::Role::kMenu:
return item_role == ax::mojom::Role::kMenuItem ||
diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc
index c48318b7a8cc592cf9adc97a2cb29124c7578250..3cf7532755f2163a372233ca63c88cae20b8f272 100644
--- a/ui/accessibility/ax_tree_unittest.cc
+++ b/ui/accessibility/ax_tree_unittest.cc
@@ -3647,6 +3647,43 @@ TEST(AXTreeTest, TestSetSizePosInSetMenuItemValidChildOfMenuListPopup) {
EXPECT_OPTIONAL_EQ(2, item2->GetSetSize());
}
+TEST(AXTreeTest, TestSetSizePostInSetListBoxOptionWithGroup) {
+ AXTreeUpdate initial_state;
+ initial_state.root_id = 1;
+ initial_state.nodes.resize(7);
+ initial_state.nodes[0].id = 1;
+ initial_state.nodes[0].child_ids = {2, 3};
+ initial_state.nodes[0].role = ax::mojom::Role::kListBox;
+ initial_state.nodes[1].id = 2;
+ initial_state.nodes[1].child_ids = {4, 5};
+ initial_state.nodes[1].role = ax::mojom::Role::kGroup;
+ initial_state.nodes[2].id = 3;
+ initial_state.nodes[2].child_ids = {6, 7};
+ initial_state.nodes[2].role = ax::mojom::Role::kGroup;
+ initial_state.nodes[3].id = 4;
+ initial_state.nodes[3].role = ax::mojom::Role::kListBoxOption;
+ initial_state.nodes[4].id = 5;
+ initial_state.nodes[4].role = ax::mojom::Role::kListBoxOption;
+ initial_state.nodes[5].id = 6;
+ initial_state.nodes[5].role = ax::mojom::Role::kListBoxOption;
+ initial_state.nodes[6].id = 7;
+ initial_state.nodes[6].role = ax::mojom::Role::kListBoxOption;
+ AXTree tree(initial_state);
+
+ AXNode* listbox_option1 = tree.GetFromId(4);
+ EXPECT_OPTIONAL_EQ(1, listbox_option1->GetPosInSet());
+ EXPECT_OPTIONAL_EQ(2, listbox_option1->GetSetSize());
+ AXNode* listbox_option2 = tree.GetFromId(5);
+ EXPECT_OPTIONAL_EQ(2, listbox_option2->GetPosInSet());
+ EXPECT_OPTIONAL_EQ(2, listbox_option2->GetSetSize());
+ AXNode* listbox_option3 = tree.GetFromId(6);
+ EXPECT_OPTIONAL_EQ(1, listbox_option3->GetPosInSet());
+ EXPECT_OPTIONAL_EQ(2, listbox_option3->GetSetSize());
+ AXNode* listbox_option4 = tree.GetFromId(7);
+ EXPECT_OPTIONAL_EQ(2, listbox_option4->GetPosInSet());
+ EXPECT_OPTIONAL_EQ(2, listbox_option4->GetSetSize());
+}
+
TEST(AXTreeTest, OnNodeWillBeDeletedHasValidUnignoredParent) {
AXTreeUpdate initial_state;
initial_state.root_id = 1;

View File

@@ -0,0 +1,580 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Julie Jeongeun Kim <jkim@igalia.com>
Date: Fri, 10 Apr 2020 05:50:17 +0000
Subject: a11y: Iterate all descendants for GetSelectionCount
This CL iterates all descendants for GetSelectionCount and
GetSelectedChild. When listbox has group children, it should
iterates their children as well to check the select state.
Bug: 1058961
Change-Id: Ib6459bf6f47023d4258ef4c2f2dc545739d7a61b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2115211
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Joanmarie Diggs <jdiggs@igalia.com>
Cr-Commit-Position: refs/heads/master@{#758140}
diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc
index 773ca872f48b548af2cf9bf5b27291e85a7a563d..2f150dbbae32f9faae0f8b55a65133fb333aa5e5 100644
--- a/ui/accessibility/platform/ax_platform_node_auralinux.cc
+++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc
@@ -1512,19 +1512,10 @@ AtkObject* RefSelection(AtkSelection* selection, gint requested_child_index) {
if (!obj)
return nullptr;
- int child_count = obj->GetChildCount();
- gint selected_count = 0;
- for (int i = 0; i < child_count; ++i) {
- AtkObject* child = obj->ChildAtIndex(i);
- AXPlatformNodeAuraLinux* child_ax_node =
- AtkObjectToAXPlatformNodeAuraLinux(child);
- if (!child_ax_node)
- continue;
-
- if (child_ax_node->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected)) {
- if (selected_count == requested_child_index)
- return static_cast<AtkObject*>(g_object_ref(child));
- ++selected_count;
+ if (auto* selected_child = obj->GetSelectedItem(requested_child_index)) {
+ if (AtkObject* atk_object = selected_child->GetNativeViewAccessible()) {
+ g_object_ref(atk_object);
+ return atk_object;
}
}
@@ -1539,19 +1530,7 @@ gint GetSelectionCount(AtkSelection* selection) {
if (!obj)
return 0;
- int child_count = obj->GetChildCount();
- gint selected_count = 0;
- for (int i = 0; i < child_count; ++i) {
- AXPlatformNodeAuraLinux* child =
- AtkObjectToAXPlatformNodeAuraLinux(obj->ChildAtIndex(i));
- if (!child)
- continue;
-
- if (child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected))
- ++selected_count;
- }
-
- return selected_count;
+ return obj->GetSelectionCount();
}
gboolean IsChildSelected(AtkSelection* selection, gint index) {
diff --git a/ui/accessibility/platform/ax_platform_node_auralinux_unittest.cc b/ui/accessibility/platform/ax_platform_node_auralinux_unittest.cc
index fdae0972a0197133d80bfb8a935a4d30ec73a8e3..9ce1fa7e36aa6fd4255772226718388c1c148f40 100644
--- a/ui/accessibility/platform/ax_platform_node_auralinux_unittest.cc
+++ b/ui/accessibility/platform/ax_platform_node_auralinux_unittest.cc
@@ -1859,6 +1859,8 @@ TEST_F(AXPlatformNodeAuraLinuxTest, TestAtkSelectionInterface) {
AXNodeData root;
root.id = 1;
root.role = ax::mojom::Role::kListBox;
+ root.AddState(ax::mojom::State::kFocusable);
+ root.AddState(ax::mojom::State::kMultiselectable);
root.child_ids.push_back(2);
root.child_ids.push_back(3);
root.child_ids.push_back(4);
diff --git a/ui/accessibility/platform/ax_platform_node_base.cc b/ui/accessibility/platform/ax_platform_node_base.cc
index ebff0e2b2640fa44ff189a735e98ec2c558fe44d..12ec1674a79bdc1f28d5d2b1bb4792b81cd8608f 100644
--- a/ui/accessibility/platform/ax_platform_node_base.cc
+++ b/ui/accessibility/platform/ax_platform_node_base.cc
@@ -130,7 +130,7 @@ int AXPlatformNodeBase::GetChildCount() const {
return 0;
}
-gfx::NativeViewAccessible AXPlatformNodeBase::ChildAtIndex(int index) {
+gfx::NativeViewAccessible AXPlatformNodeBase::ChildAtIndex(int index) const {
if (delegate_)
return delegate_->ChildAtIndex(index);
return nullptr;
@@ -2058,6 +2058,54 @@ ui::TextAttributeList AXPlatformNodeBase::ComputeTextAttributes() const {
return attributes;
}
+int AXPlatformNodeBase::GetSelectionCount() const {
+ int max_items = GetMaxSelectableItems();
+ if (!max_items)
+ return 0;
+ return GetSelectedItems(max_items);
+}
+
+AXPlatformNodeBase* AXPlatformNodeBase::GetSelectedItem(
+ int selected_index) const {
+ DCHECK_GE(selected_index, 0);
+ int max_items = GetMaxSelectableItems();
+ if (max_items == 0)
+ return nullptr;
+ if (selected_index >= max_items)
+ return nullptr;
+
+ std::vector<AXPlatformNodeBase*> selected_children;
+ int requested_count = selected_index + 1;
+ int returned_count = GetSelectedItems(requested_count, &selected_children);
+
+ if (returned_count <= selected_index)
+ return nullptr;
+
+ DCHECK(!selected_children.empty());
+ DCHECK_LT(selected_index, static_cast<int>(selected_children.size()));
+ return selected_children[selected_index];
+}
+
+int AXPlatformNodeBase::GetSelectedItems(
+ int max_items,
+ std::vector<AXPlatformNodeBase*>* out_selected_items) const {
+ int selected_count = 0;
+ // TODO(Nektar): Remove const_cast by making all tree traversal methods const.
+ for (AXPlatformNodeBase* child =
+ const_cast<AXPlatformNodeBase*>(this)->GetFirstChild();
+ child && selected_count < max_items; child = child->GetNextSibling()) {
+ if (!IsItemLike(child->GetData().role)) {
+ selected_count += child->GetSelectedItems(max_items - selected_count,
+ out_selected_items);
+ } else if (child->GetBoolAttribute(ax::mojom::BoolAttribute::kSelected)) {
+ selected_count++;
+ if (out_selected_items)
+ out_selected_items->emplace_back(child);
+ }
+ }
+ return selected_count;
+}
+
void AXPlatformNodeBase::SanitizeTextAttributeValue(const std::string& input,
std::string* output) const {
DCHECK(output);
@@ -2116,4 +2164,20 @@ std::string AXPlatformNodeBase::ComputeDetailsRoles() const {
return base::JoinString(details_roles_vector, " ");
}
+int AXPlatformNodeBase::GetMaxSelectableItems() const {
+ if (!GetData().HasState(ax::mojom::State::kFocusable))
+ return 0;
+
+ if (IsLeaf())
+ return 0;
+
+ if (!IsContainerWithSelectableChildren(GetData().role))
+ return 0;
+
+ int max_items = 1;
+ if (GetData().HasState(ax::mojom::State::kMultiselectable))
+ max_items = std::numeric_limits<int>::max();
+ return max_items;
+}
+
} // namespace ui
diff --git a/ui/accessibility/platform/ax_platform_node_base.h b/ui/accessibility/platform/ax_platform_node_base.h
index b46cf48d223b49d196aff10b5822e35628a45469..0355f281a600979f59a25086fd7400201693bf89 100644
--- a/ui/accessibility/platform/ax_platform_node_base.h
+++ b/ui/accessibility/platform/ax_platform_node_base.h
@@ -64,7 +64,7 @@ class AX_EXPORT AXPlatformNodeBase : public AXPlatformNode {
gfx::NativeViewAccessible GetFocus();
gfx::NativeViewAccessible GetParent() const;
int GetChildCount() const;
- gfx::NativeViewAccessible ChildAtIndex(int index);
+ gfx::NativeViewAccessible ChildAtIndex(int index) const;
std::string GetName() const;
base::string16 GetNameAsString16() const;
@@ -312,6 +312,24 @@ class AX_EXPORT AXPlatformNodeBase : public AXPlatformNode {
ui::TextAttributeList ComputeTextAttributes() const;
+ // Get the number of items selected. It checks kMultiselectable and
+ // kFocusable. and uses GetSelectedItems to get the selected number.
+ int GetSelectionCount() const;
+
+ // If this object is a container that supports selectable children, returns
+ // the selected item at the provided index.
+ AXPlatformNodeBase* GetSelectedItem(int selected_index) const;
+
+ // If this object is a container that supports selectable children,
+ // returns the number of selected items in this container.
+ // |out_selected_items| could be set to nullptr if the caller just
+ // needs to know the number of items selected.
+ // |max_items| represents the number that the caller expects as a
+ // maximum. For a single selection list box, it will be 1.
+ int GetSelectedItems(
+ int max_items,
+ std::vector<AXPlatformNodeBase*>* out_selected_items = nullptr) const;
+
//
// Delegate. This is a weak reference which owns |this|.
//
@@ -454,6 +472,11 @@ class AX_EXPORT AXPlatformNodeBase : public AXPlatformNode {
std::string GetInvalidValue() const;
+ // Based on the characteristics of this object, such as its role and the
+ // presence of a multiselectable attribute, returns the maximum number of
+ // selectable children that this object could potentially contain.
+ int GetMaxSelectableItems() const;
+
mutable AXHypertext hypertext_;
private:
diff --git a/ui/accessibility/platform/ax_platform_node_base_unittest.cc b/ui/accessibility/platform/ax_platform_node_base_unittest.cc
index d0bc34a70e5c96062a2d1a24b2a6e8c087098b47..401d5be24b9f1957f4425f32b150006d094c6838 100644
--- a/ui/accessibility/platform/ax_platform_node_base_unittest.cc
+++ b/ui/accessibility/platform/ax_platform_node_base_unittest.cc
@@ -96,4 +96,200 @@ TEST(AXPlatformNodeBaseTest, InnerTextIgnoresInvisibleAndIgnored) {
}
}
+TEST(AXPlatformNodeBaseTest, TestSelectedChildren) {
+ AXPlatformNode::NotifyAddAXModeFlags(kAXModeComplete);
+
+ AXNodeData root_data;
+ root_data.id = 1;
+ root_data.role = ax::mojom::Role::kListBox;
+ root_data.AddState(ax::mojom::State::kFocusable);
+ root_data.child_ids = {2, 3};
+
+ AXNodeData item_1_data;
+ item_1_data.id = 2;
+ item_1_data.role = ax::mojom::Role::kListBoxOption;
+ item_1_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXNodeData item_2_data;
+ item_2_data.id = 3;
+ item_2_data.role = ax::mojom::Role::kListBoxOption;
+
+ AXTreeUpdate update;
+ update.root_id = 1;
+ update.nodes = {root_data, item_1_data, item_2_data};
+ AXTree tree(update);
+
+ auto* root = static_cast<AXPlatformNodeBase*>(
+ TestAXNodeWrapper::GetOrCreate(&tree, tree.root())->ax_platform_node());
+
+ int num = root->GetSelectionCount();
+ EXPECT_EQ(num, 1);
+
+ gfx::NativeViewAccessible first_child = root->ChildAtIndex(0);
+ AXPlatformNodeBase* first_selected_node = root->GetSelectedItem(0);
+ EXPECT_EQ(first_child, first_selected_node->GetNativeViewAccessible());
+ EXPECT_EQ(nullptr, root->GetSelectedItem(1));
+}
+
+TEST(AXPlatformNodeBaseTest, TestSelectedChildrenWithGroup) {
+ AXPlatformNode::NotifyAddAXModeFlags(kAXModeComplete);
+
+ AXNodeData root_data;
+ root_data.id = 1;
+ root_data.role = ax::mojom::Role::kListBox;
+ root_data.AddState(ax::mojom::State::kFocusable);
+ root_data.AddState(ax::mojom::State::kMultiselectable);
+ root_data.child_ids = {2, 3};
+
+ AXNodeData group_1_data;
+ group_1_data.id = 2;
+ group_1_data.role = ax::mojom::Role::kGroup;
+ group_1_data.child_ids = {4, 5};
+
+ AXNodeData group_2_data;
+ group_2_data.id = 3;
+ group_2_data.role = ax::mojom::Role::kGroup;
+ group_2_data.child_ids = {6, 7};
+
+ AXNodeData item_1_data;
+ item_1_data.id = 4;
+ item_1_data.role = ax::mojom::Role::kListBoxOption;
+ item_1_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXNodeData item_2_data;
+ item_2_data.id = 5;
+ item_2_data.role = ax::mojom::Role::kListBoxOption;
+
+ AXNodeData item_3_data;
+ item_3_data.id = 6;
+ item_3_data.role = ax::mojom::Role::kListBoxOption;
+
+ AXNodeData item_4_data;
+ item_4_data.id = 7;
+ item_4_data.role = ax::mojom::Role::kListBoxOption;
+ item_4_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXTreeUpdate update;
+ update.root_id = 1;
+ update.nodes = {root_data, group_1_data, group_2_data, item_1_data,
+ item_2_data, item_3_data, item_4_data};
+ AXTree tree(update);
+
+ auto* root = static_cast<AXPlatformNodeBase*>(
+ TestAXNodeWrapper::GetOrCreate(&tree, tree.root())->ax_platform_node());
+
+ int num = root->GetSelectionCount();
+ EXPECT_EQ(num, 2);
+
+ gfx::NativeViewAccessible first_group_child =
+ static_cast<AXPlatformNodeBase*>(
+ AXPlatformNode::FromNativeViewAccessible(root->ChildAtIndex(0)))
+ ->ChildAtIndex(0);
+ AXPlatformNodeBase* first_selected_node = root->GetSelectedItem(0);
+ EXPECT_EQ(first_group_child, first_selected_node->GetNativeViewAccessible());
+
+ gfx::NativeViewAccessible second_group_child =
+ static_cast<AXPlatformNodeBase*>(
+ AXPlatformNode::FromNativeViewAccessible(root->ChildAtIndex(1)))
+ ->ChildAtIndex(1);
+ AXPlatformNodeBase* second_selected_node = root->GetSelectedItem(1);
+ EXPECT_EQ(second_group_child,
+ second_selected_node->GetNativeViewAccessible());
+}
+
+TEST(AXPlatformNodeBaseTest, TestSelectedChildrenMixed) {
+ AXPlatformNode::NotifyAddAXModeFlags(kAXModeComplete);
+
+ // Build the below tree which is mixed with listBoxOption and group.
+ // id=1 listBox FOCUSABLE MULTISELECTABLE (0, 0)-(0, 0) child_ids=2,3,4,9
+ // ++id=2 listBoxOption (0, 0)-(0, 0) selected=true
+ // ++id=3 group (0, 0)-(0, 0) child_ids=5,6
+ // ++++id=5 listBoxOption (0, 0)-(0, 0) selected=true
+ // ++++id=6 listBoxOption (0, 0)-(0, 0)
+ // ++id=4 group (0, 0)-(0, 0) child_ids=7,8
+ // ++++id=7 listBoxOption (0, 0)-(0, 0)
+ // ++++id=8 listBoxOption (0, 0)-(0, 0) selected=true
+ // ++id=9 listBoxOption (0, 0)-(0, 0) selected=true
+
+ AXNodeData root_data;
+ root_data.id = 1;
+ root_data.role = ax::mojom::Role::kListBox;
+ root_data.AddState(ax::mojom::State::kFocusable);
+ root_data.AddState(ax::mojom::State::kMultiselectable);
+ root_data.child_ids = {2, 3, 4, 9};
+
+ AXNodeData item_1_data;
+ item_1_data.id = 2;
+ item_1_data.role = ax::mojom::Role::kListBoxOption;
+ item_1_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXNodeData group_1_data;
+ group_1_data.id = 3;
+ group_1_data.role = ax::mojom::Role::kGroup;
+ group_1_data.child_ids = {5, 6};
+
+ AXNodeData item_2_data;
+ item_2_data.id = 5;
+ item_2_data.role = ax::mojom::Role::kListBoxOption;
+ item_2_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXNodeData item_3_data;
+ item_3_data.id = 6;
+ item_3_data.role = ax::mojom::Role::kListBoxOption;
+
+ AXNodeData group_2_data;
+ group_2_data.id = 4;
+ group_2_data.role = ax::mojom::Role::kGroup;
+ group_2_data.child_ids = {7, 8};
+
+ AXNodeData item_4_data;
+ item_4_data.id = 7;
+ item_4_data.role = ax::mojom::Role::kListBoxOption;
+
+ AXNodeData item_5_data;
+ item_5_data.id = 8;
+ item_5_data.role = ax::mojom::Role::kListBoxOption;
+ item_5_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXNodeData item_6_data;
+ item_6_data.id = 9;
+ item_6_data.role = ax::mojom::Role::kListBoxOption;
+ item_6_data.AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, true);
+
+ AXTreeUpdate update;
+ update.root_id = 1;
+ update.nodes = {root_data, item_1_data, group_1_data,
+ item_2_data, item_3_data, group_2_data,
+ item_4_data, item_5_data, item_6_data};
+ AXTree tree(update);
+
+ auto* root = static_cast<AXPlatformNodeBase*>(
+ TestAXNodeWrapper::GetOrCreate(&tree, tree.root())->ax_platform_node());
+
+ int num = root->GetSelectionCount();
+ EXPECT_EQ(num, 4);
+
+ gfx::NativeViewAccessible first_child = root->ChildAtIndex(0);
+ AXPlatformNodeBase* first_selected_node = root->GetSelectedItem(0);
+ EXPECT_EQ(first_child, first_selected_node->GetNativeViewAccessible());
+
+ gfx::NativeViewAccessible first_group_child =
+ static_cast<AXPlatformNodeBase*>(
+ AXPlatformNode::FromNativeViewAccessible(root->ChildAtIndex(1)))
+ ->ChildAtIndex(0);
+ AXPlatformNodeBase* second_selected_node = root->GetSelectedItem(1);
+ EXPECT_EQ(first_group_child, second_selected_node->GetNativeViewAccessible());
+
+ gfx::NativeViewAccessible second_group_child =
+ static_cast<AXPlatformNodeBase*>(
+ AXPlatformNode::FromNativeViewAccessible(root->ChildAtIndex(2)))
+ ->ChildAtIndex(1);
+ AXPlatformNodeBase* third_selected_node = root->GetSelectedItem(2);
+ EXPECT_EQ(second_group_child, third_selected_node->GetNativeViewAccessible());
+
+ gfx::NativeViewAccessible fourth_child = root->ChildAtIndex(3);
+ AXPlatformNodeBase* fourth_selected_node = root->GetSelectedItem(3);
+ EXPECT_EQ(fourth_child, fourth_selected_node->GetNativeViewAccessible());
+}
+
} // namespace ui
diff --git a/ui/accessibility/platform/ax_platform_node_unittest.cc b/ui/accessibility/platform/ax_platform_node_unittest.cc
index c652b37ec7f3a345da4986463962fee9423f213b..480a723325393b55774bbe80b14934dbe1ce95df 100644
--- a/ui/accessibility/platform/ax_platform_node_unittest.cc
+++ b/ui/accessibility/platform/ax_platform_node_unittest.cc
@@ -356,13 +356,13 @@ AXTreeUpdate AXPlatformNodeTest::BuildListBox(
bool option_1_is_selected,
bool option_2_is_selected,
bool option_3_is_selected,
- ax::mojom::State additional_state /* ax::mojom::State::kNone */) {
+ const std::vector<ax::mojom::State>& additional_state) {
AXNodeData listbox;
listbox.id = 1;
listbox.SetName("ListBox");
listbox.role = ax::mojom::Role::kListBox;
- if (additional_state != ax::mojom::State::kNone)
- listbox.AddState(additional_state);
+ for (auto state : additional_state)
+ listbox.AddState(state);
AXNodeData option_1;
option_1.id = 2;
diff --git a/ui/accessibility/platform/ax_platform_node_unittest.h b/ui/accessibility/platform/ax_platform_node_unittest.h
index 3207332eb8370edf850bac6d8eee72ff8f9fad85..d004a0585ebbdaa6944e05ba48be8936a775e3cd 100644
--- a/ui/accessibility/platform/ax_platform_node_unittest.h
+++ b/ui/accessibility/platform/ax_platform_node_unittest.h
@@ -48,10 +48,11 @@ class AXPlatformNodeTest : public testing::Test, public TestAXTreeManager {
AXTreeUpdate Build3X3Table();
AXTreeUpdate BuildAriaColumnAndRowCountGrids();
- AXTreeUpdate BuildListBox(bool option_1_is_selected,
- bool option_2_is_selected,
- bool option_3_is_selected,
- ax::mojom::State additional_state);
+ AXTreeUpdate BuildListBox(
+ bool option_1_is_selected,
+ bool option_2_is_selected,
+ bool option_3_is_selected,
+ const std::vector<ax::mojom::State>& additional_state);
};
} // namespace ui
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc
index eadcb741d948798bab9269044170ede3474f237d..a61d4121d9eeb336e72dbb6a3e2bf884a9b4e799 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -2131,15 +2131,10 @@ IFACEMETHODIMP AXPlatformNodeWin::GetSelection(SAFEARRAY** result) {
WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SELECTION_GETSELECTION);
UIA_VALIDATE_CALL_1_ARG(result);
- std::vector<AXPlatformNodeWin*> selected_children;
- LONG child_count = GetDelegate()->GetChildCount();
- for (LONG i = 0; i < child_count; ++i) {
- auto* child = static_cast<AXPlatformNodeWin*>(
- FromNativeViewAccessible(GetDelegate()->ChildAtIndex(i)));
- DCHECK(child);
- if (child->GetData().GetBoolAttribute(ax::mojom::BoolAttribute::kSelected))
- selected_children.push_back(child);
- }
+ std::vector<AXPlatformNodeBase*> selected_children;
+ int max_items = GetMaxSelectableItems();
+ if (max_items)
+ GetSelectedItems(max_items, &selected_children);
LONG selected_children_count = selected_children.size();
*result = SafeArrayCreateVector(VT_UNKNOWN, 0, selected_children_count);
@@ -2147,9 +2142,10 @@ IFACEMETHODIMP AXPlatformNodeWin::GetSelection(SAFEARRAY** result) {
return E_OUTOFMEMORY;
for (LONG i = 0; i < selected_children_count; ++i) {
+ AXPlatformNodeWin* children =
+ static_cast<AXPlatformNodeWin*>(selected_children[i]);
HRESULT hr = SafeArrayPutElement(
- *result, &i,
- static_cast<IRawElementProviderSimple*>(selected_children[i]));
+ *result, &i, static_cast<IRawElementProviderSimple*>(children));
if (FAILED(hr)) {
SafeArrayDestroy(*result);
*result = nullptr;
diff --git a/ui/accessibility/platform/ax_platform_node_win_unittest.cc b/ui/accessibility/platform/ax_platform_node_win_unittest.cc
index 4a1df770606ac88bb44121b58f67198258c8adf2..2092d5c263dafa452c4977d53678ad81aa6575e1 100644
--- a/ui/accessibility/platform/ax_platform_node_win_unittest.cc
+++ b/ui/accessibility/platform/ax_platform_node_win_unittest.cc
@@ -4655,8 +4655,7 @@ TEST_F(AXPlatformNodeWinTest, TestUIANavigate) {
TEST_F(AXPlatformNodeWinTest, TestISelectionProviderCanSelectMultipleDefault) {
Init(BuildListBox(/*option_1_is_selected*/ false,
/*option_2_is_selected*/ false,
- /*option_3_is_selected*/ false,
- /*additional_state*/ ax::mojom::State::kNone));
+ /*option_3_is_selected*/ false, {}));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));
@@ -4668,10 +4667,12 @@ TEST_F(AXPlatformNodeWinTest, TestISelectionProviderCanSelectMultipleDefault) {
}
TEST_F(AXPlatformNodeWinTest, TestISelectionProviderCanSelectMultipleTrue) {
+ const std::vector<ax::mojom::State> state = {
+ ax::mojom::State::kMultiselectable, ax::mojom::State::kFocusable};
Init(BuildListBox(/*option_1_is_selected*/ false,
/*option_2_is_selected*/ false,
/*option_3_is_selected*/ false,
- /*additional_state*/ ax::mojom::State::kMultiselectable));
+ /*additional_state*/ state));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));
@@ -4687,7 +4688,7 @@ TEST_F(AXPlatformNodeWinTest,
Init(BuildListBox(/*option_1_is_selected*/ false,
/*option_2_is_selected*/ false,
/*option_3_is_selected*/ false,
- /*additional_state*/ ax::mojom::State::kNone));
+ /*additional_state*/ {}));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));
@@ -4702,7 +4703,7 @@ TEST_F(AXPlatformNodeWinTest, TestISelectionProviderIsSelectionRequiredTrue) {
Init(BuildListBox(/*option_1_is_selected*/ false,
/*option_2_is_selected*/ false,
/*option_3_is_selected*/ false,
- /*additional_state*/ ax::mojom::State::kRequired));
+ /*additional_state*/ {ax::mojom::State::kRequired}));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));
@@ -4717,7 +4718,7 @@ TEST_F(AXPlatformNodeWinTest, TestISelectionProviderGetSelectionNoneSelected) {
Init(BuildListBox(/*option_1_is_selected*/ false,
/*option_2_is_selected*/ false,
/*option_3_is_selected*/ false,
- /*additional_state*/ ax::mojom::State::kNone));
+ /*additional_state*/ {ax::mojom::State::kFocusable}));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));
@@ -4743,7 +4744,7 @@ TEST_F(AXPlatformNodeWinTest,
Init(BuildListBox(/*option_1_is_selected*/ false,
/*option_2_is_selected*/ true,
/*option_3_is_selected*/ false,
- /*additional_state*/ ax::mojom::State::kNone));
+ /*additional_state*/ {ax::mojom::State::kFocusable}));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));
@@ -4775,10 +4776,12 @@ TEST_F(AXPlatformNodeWinTest,
TEST_F(AXPlatformNodeWinTest,
TestISelectionProviderGetSelectionMultipleItemsSelected) {
+ const std::vector<ax::mojom::State> state = {
+ ax::mojom::State::kMultiselectable, ax::mojom::State::kFocusable};
Init(BuildListBox(/*option_1_is_selected*/ true,
/*option_2_is_selected*/ true,
/*option_3_is_selected*/ true,
- /*additional_state*/ ax::mojom::State::kNone));
+ /*additional_state*/ state));
ComPtr<ISelectionProvider> selection_provider(
QueryInterfaceFromNode<ISelectionProvider>(GetRootAsAXNode()));

View File

@@ -0,0 +1,142 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Siye Liu <siliu@microsoft.com>
Date: Mon, 8 Jun 2020 21:19:00 +0000
Subject: Allow IME to insert zero-length composition string.
Some IMEs and Windows OS dictation will either insert zero-length text
or delete existing composition text to commit active composition.
Therefore, we should allow IMEs to cancel composition by committing zero
length text.
Bug: 1091069
Change-Id: I99cb213dc2ba1965abfa88ccf6858b89bd7e82df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2233234
Commit-Queue: Siye Liu <siliu@microsoft.com>
Reviewed-by: Yohei Yukawa <yukawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776198}
diff --git a/ui/base/ime/win/tsf_text_store.cc b/ui/base/ime/win/tsf_text_store.cc
index 2a8cde4995fc41305847fd995654e3a012f68e1d..31174ba0eb0559aa461cfba1689d9ef627914e71 100644
--- a/ui/base/ime/win/tsf_text_store.cc
+++ b/ui/base/ime/win/tsf_text_store.cc
@@ -647,9 +647,7 @@ HRESULT TSFTextStore::RequestLock(DWORD lock_flags, HRESULT* result) {
// 3. User commits current composition text.
if (((new_composition_start > last_composition_start &&
text_input_client_->HasCompositionText()) ||
- (wparam_keydown_fired_ == 0 && !has_composition_range_ &&
- !text_input_client_->HasCompositionText()) ||
- (wparam_keydown_fired_ != 0 && !has_composition_range_)) &&
+ !has_composition_range_) &&
text_input_client_) {
CommitTextAndEndCompositionIfAny(last_composition_start,
new_composition_start);
@@ -1355,8 +1353,11 @@ void TSFTextStore::CommitTextAndEndCompositionIfAny(size_t old_size,
: new_committed_string_size);
// TODO(crbug.com/978678): Unify the behavior of
// |TextInputClient::InsertText(text)| for the empty text.
- if (!new_committed_string.empty())
+ if (!new_committed_string.empty()) {
text_input_client_->InsertText(new_committed_string);
+ } else {
+ text_input_client_->ClearCompositionText();
+ }
// Notify accessibility about this committed composition
text_input_client_->SetActiveCompositionForAccessibility(
replace_text_range_, new_committed_string,
diff --git a/ui/base/ime/win/tsf_text_store_unittest.cc b/ui/base/ime/win/tsf_text_store_unittest.cc
index 081809d75a1fbbedbcbc722302d4d915eabc46d4..4e81d7c1012f86712f1bba2bfe4037ed1ef79772 100644
--- a/ui/base/ime/win/tsf_text_store_unittest.cc
+++ b/ui/base/ime/win/tsf_text_store_unittest.cc
@@ -3394,5 +3394,92 @@ TEST_F(TSFTextStoreTest, RegressionTest7) {
EXPECT_EQ(S_OK, result);
}
+// regression tests for crbug.com/1091069.
+// We should allow inserting empty compositon string to cancel composition.
+class RegressionTest8Callback : public TSFTextStoreTestCallback {
+ public:
+ explicit RegressionTest8Callback(TSFTextStore* text_store)
+ : TSFTextStoreTestCallback(text_store) {}
+
+ HRESULT LockGranted1(DWORD flags) {
+ SetTextTest(0, 0, L"bbbb", S_OK);
+ SetSelectionTest(0, 4, S_OK);
+
+ text_spans()->clear();
+ ImeTextSpan text_span_1;
+ text_span_1.start_offset = 0;
+ text_span_1.end_offset = 4;
+ text_span_1.underline_color = SK_ColorBLACK;
+ text_span_1.thickness = ImeTextSpan::Thickness::kThin;
+ text_span_1.background_color = SK_ColorTRANSPARENT;
+ text_spans()->push_back(text_span_1);
+
+ *edit_flag() = true;
+ *composition_start() = 0;
+ composition_range()->set_start(0);
+ composition_range()->set_end(4);
+ *has_composition_range() = true;
+
+ text_store_->OnKeyTraceDown(65u, 1966081u);
+ return S_OK;
+ }
+
+ void SetCompositionText1(const ui::CompositionText& composition) {
+ EXPECT_EQ(L"bbbb", composition.text);
+ EXPECT_EQ(0u, composition.selection.start());
+ EXPECT_EQ(4u, composition.selection.end());
+ ASSERT_EQ(1u, composition.ime_text_spans.size());
+ EXPECT_EQ(0u, composition.ime_text_spans[0].start_offset);
+ EXPECT_EQ(4u, composition.ime_text_spans[0].end_offset);
+ SetHasCompositionText(true);
+ }
+
+ HRESULT LockGranted2(DWORD flags) {
+ GetTextTest(0, -1, L"bbbb", 4);
+ SetTextTest(0, 4, L"", S_OK);
+
+ text_spans()->clear();
+ *edit_flag() = true;
+ *composition_start() = 0;
+ composition_range()->set_start(0);
+ composition_range()->set_end(0);
+
+ *has_composition_range() = false;
+ text_store_->OnKeyTraceUp(65u, 1966081u);
+ return S_OK;
+ }
+
+ void ClearCompositionText2() { EXPECT_EQ(false, *has_composition_range()); }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RegressionTest8Callback);
+};
+
+TEST_F(TSFTextStoreTest, RegressionTest8) {
+ RegressionTest8Callback callback(text_store_.get());
+ EXPECT_CALL(text_input_client_, SetCompositionText(_))
+ .WillOnce(
+ Invoke(&callback, &RegressionTest8Callback::SetCompositionText1));
+
+ EXPECT_CALL(text_input_client_, ClearCompositionText())
+ .WillOnce(
+ Invoke(&callback, &RegressionTest8Callback::ClearCompositionText2));
+
+ EXPECT_CALL(*sink_, OnLockGranted(_))
+ .WillOnce(Invoke(&callback, &RegressionTest8Callback::LockGranted1))
+ .WillOnce(Invoke(&callback, &RegressionTest8Callback::LockGranted2));
+
+ ON_CALL(text_input_client_, HasCompositionText())
+ .WillByDefault(
+ Invoke(&callback, &TSFTextStoreTestCallback::HasCompositionText));
+
+ HRESULT result = kInvalidResult;
+ EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result));
+ EXPECT_EQ(S_OK, result);
+ result = kInvalidResult;
+ EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result));
+ EXPECT_EQ(S_OK, result);
+}
+
} // namespace
} // namespace ui

View File

@@ -14,7 +14,7 @@ when there is code doing that.
This patch reverts the change to fix the crash in Electron.
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index ab0d55c3de88faf10e25ef8cbb6ebd3f7f580654..4660af81c248fe39c1df428a3b892a251a957363 100644
index 3c78d008993846417ebdce01366dadfc11e63469..4426beb5ff635c96f9b77dce2afee3145eb59d27 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -472,10 +472,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {

View File

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

View File

@@ -0,0 +1,49 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Wed, 29 Apr 2020 16:28:35 -0700
Subject: breakpad: disable upload compression
Our prior implementation of breakpad uploading did not compress files on
upload. In order to maintain that behavior, this disables compression in
//components/crash.
Ideally, this would be made configurable.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index 364af690879d79d25d118d5b2fdbaabe21a1c52d..390cca9edc26d3153c8dbc86024cb50097d7ac78 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -1334,6 +1334,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
#else // defined(OS_CHROMEOS)
+ /*
// Compress |dumpfile| with gzip.
const pid_t gzip_child = sys_fork();
if (gzip_child < 0) {
@@ -1377,13 +1378,16 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
WriteLog(msg, sizeof(msg) - 1);
sys__exit(1);
}
+ */
// The --header argument to wget looks like:
// --header=Content-Encoding: gzip
// --header=Content-Type: multipart/form-data; boundary=XYZ
// where the boundary has two fewer leading '-' chars
+ /*
static const char header_content_encoding[] =
"--header=Content-Encoding: gzip";
+ */
static const char header_msg[] =
"--header=Content-Type: multipart/form-data; boundary=";
const size_t header_content_type_size =
@@ -1412,7 +1416,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
static const char kWgetBinary[] = "/usr/bin/wget";
const char* args[] = {
kWgetBinary,
- header_content_encoding,
+ //header_content_encoding,
header_content_type,
post_file,
upload_url,

View File

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

View File

@@ -9,7 +9,7 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 657306b0c95c9a499ca626c033c4b5b73de71d59..d1503246dfa0edf16a918d0c5b141bf89ae95bb1 100644
index b1ea181a9088bce0422701ac7d3e118b999fec5b..8a3afc59f96e0f29997d0e239726217d490189d8 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -4324,6 +4324,7 @@ void RenderFrameHostImpl::CreateNewWindow(

View File

@@ -7,7 +7,7 @@ spellchecker uses a few IDS_ resources. We need to load these from
Electrons grit header instead of Chromes
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 023024e81c99d09efc0d1530a6c9ae3f1acf3abe..9cff221f4927bec68eb93353cfcc4c9af153ac8e 100644
index b3f8ac152722daf79878d83f14d2ee0bf625004c..e70d15134e8ffe75311da48dfa222f4d3d85bf2d 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -5331,6 +5331,7 @@ jumbo_static_library("browser") {

View File

@@ -3,17 +3,8 @@ From: Jeremy Apthorp <jeremya@chromium.org>
Date: Wed, 10 Oct 2018 15:07:34 -0700
Subject: command-ismediakey.patch
Override MediaKeysListener::IsMediaKeycode to also listen for Volume Up, Volume Down,
and Mute. We also need to patch out Chromium's usage of RemoteCommandCenterDelegate, as
it uses MPRemoteCommandCenter. MPRemoteCommandCenter makes it such that GlobalShortcuts
in Electron will not work as intended, because by design an app does not receive remote
control events until it begins playing audio. This means that a media shortcut would not kick
into effect until you, for example, began playing a YouTube video which sort of defeats the
purpose of GlobalShortcuts.
At the moment there is no upstream possibility for this; but perhaps Chromium may
consider some kind of switch, enabled by default, which would conditionally choose to avoid usage of
RemoteCommandCenterDelegate on macOS.
Override MediaKeysListener::IsMediaKeycode and associated functions to also listen for
Volume Up, Volume Down, and Mute.
Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
@@ -67,18 +58,10 @@ index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc
} // namespace ui
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
index 85378bb565de617b1bd611d28c8714361747a357..d67d558b91b49835dfa927893093948093c54f7a 100644
index 85378bb565de617b1bd611d28c8714361747a357..36de4c0b0353be2418dacd388e92d7c38a7ee139 100644
--- a/ui/base/accelerators/media_keys_listener_mac.mm
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
@@ -11,6 +11,7 @@
#include <IOKit/hidsystem/ev_keymap.h>
#include "base/containers/flat_set.h"
+#include "electron/buildflags/buildflags.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/system_media_controls_media_keys_listener.h"
@@ -32,6 +33,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
@@ -32,6 +32,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
case NX_KEYTYPE_NEXT:
case NX_KEYTYPE_FAST:
return VKEY_MEDIA_NEXT_TRACK;
@@ -91,7 +74,7 @@ index 85378bb565de617b1bd611d28c8714361747a357..d67d558b91b49835dfa9278930939480
}
return VKEY_UNKNOWN;
}
@@ -192,7 +199,10 @@ CGEventRef MediaKeysListenerImpl::EventTapCallback(CGEventTapProxy proxy,
@@ -192,7 +198,10 @@ CGEventRef MediaKeysListenerImpl::EventTapCallback(CGEventTapProxy proxy,
int key_code = (data1 & 0xFFFF0000) >> 16;
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&
@@ -103,3 +86,31 @@ index 85378bb565de617b1bd611d28c8714361747a357..d67d558b91b49835dfa9278930939480
return event;
}
diff --git a/ui/base/accelerators/system_media_controls_media_keys_listener.cc b/ui/base/accelerators/system_media_controls_media_keys_listener.cc
index 9d6084ceaccfd071549e63e3015f55ef292312ec..846210b04d6e2e193413c643296938ec550f6d25 100644
--- a/ui/base/accelerators/system_media_controls_media_keys_listener.cc
+++ b/ui/base/accelerators/system_media_controls_media_keys_listener.cc
@@ -65,6 +65,11 @@ bool SystemMediaControlsMediaKeysListener::StartWatchingMediaKey(
case VKEY_MEDIA_STOP:
service_->SetIsStopEnabled(true);
break;
+ case VKEY_VOLUME_DOWN:
+ case VKEY_VOLUME_UP:
+ case VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
@@ -97,6 +102,11 @@ void SystemMediaControlsMediaKeysListener::StopWatchingMediaKey(
case VKEY_MEDIA_STOP:
service_->SetIsStopEnabled(false);
break;
+ case VKEY_VOLUME_DOWN:
+ case VKEY_VOLUME_UP:
+ case VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}

View File

@@ -0,0 +1,201 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Thu, 30 Apr 2020 10:08:06 -0700
Subject: crash: allow setting more options
This allows the client of //components/crash to set upload url,
rate-limiting, compression and global annotations.
This should be upstreamed.
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index 192b0a7f137f311abb6a991f997e11f5eba52256..364af690879d79d25d118d5b2fdbaabe21a1c52d 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -103,9 +103,18 @@ namespace {
// while we do have functions to deal with uint64_t's.
uint64_t g_crash_loop_before_time = 0;
#else
-const char kUploadURL[] = "https://clients2.google.com/cr/report";
+const char kDefaultUploadURL[] = "https://clients2.google.com/cr/report";
+char* g_upload_url = nullptr;
#endif
+void SetUploadURL(const std::string& url) {
+ const size_t url_len = url.size() + 1;
+ DCHECK(!g_upload_url);
+ g_upload_url = new char[url_len];
+ strncpy(g_upload_url, url.c_str(), url_len);
+}
+
+bool g_is_node = false;
bool g_is_crash_reporter_enabled = false;
uint64_t g_process_start_time = 0;
pid_t g_pid = 0;
@@ -1398,13 +1407,15 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
char* status_fd_path =
StringFromPrefixAndUint("/dev/fd/", upload_status_fd, allocator);
+ const char* upload_url = g_upload_url ? g_upload_url : kDefaultUploadURL;
+
static const char kWgetBinary[] = "/usr/bin/wget";
const char* args[] = {
kWgetBinary,
header_content_encoding,
header_content_type,
post_file,
- kUploadURL,
+ upload_url,
"--timeout=10", // Set a timeout so we don't hang forever.
"--tries=1", // Don't retry if the upload fails.
"-O", // Output reply to the file descriptor path.
@@ -2037,6 +2048,10 @@ void InitCrashReporter(const std::string& process_type) {
#endif
process_type.empty();
+ std::string upload_url;
+ if (GetCrashReporterClient()->GetUploadUrl(&upload_url))
+ SetUploadURL(upload_url);
+
if (is_browser_process) {
bool enable_breakpad = GetCrashReporterClient()->GetCollectStatsConsent() ||
GetCrashReporterClient()->IsRunningUnattended();
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
index e778f68af30f8c071d1360d06b553cc957160c5b..b7f6ca60ef9c2367989d39e1268bf9f9a517951c 100644
--- a/components/crash/core/app/crash_reporter_client.cc
+++ b/components/crash/core/app/crash_reporter_client.cc
@@ -148,6 +148,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
return false;
}
+bool CrashReporterClient::GetShouldRateLimit() {
+ return true;
+}
+
+bool CrashReporterClient::GetShouldCompressUploads() {
+ return true;
+}
+
+void CrashReporterClient::GetProcessSimpleAnnotations(std::map<std::string, std::string>* annotations) {
+}
+
#if defined(OS_ANDROID)
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
return 100;
@@ -196,6 +207,10 @@ void CrashReporterClient::GetSanitizationInformation(
}
#endif
+bool CrashReporterClient::GetUploadUrl(std::string* url) {
+ return false;
+}
+
bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
return false;
}
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
index 9cc78fc2584061d26fd1e83b3ebf5ada0a12c138..aa63d7b95c37e4a143283450798b8bd500dc17a1 100644
--- a/components/crash/core/app/crash_reporter_client.h
+++ b/components/crash/core/app/crash_reporter_client.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
#define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
+#include <map>
#include <string>
#include "base/strings/string16.h"
@@ -153,6 +154,19 @@ class CrashReporterClient {
// that case, |breakpad_enabled| is set to the value enforced by policies.
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
+ // Returns true if crash uploads should be rate limited. If false, no
+ // throttling will be applied for uploads.
+ virtual bool GetShouldRateLimit();
+
+ // Returns true if crash uploads should be compressed with gzip. If false,
+ // reports will be uploaded uncompressed.
+ virtual bool GetShouldCompressUploads();
+
+ // Allows the client to add or edit global annotations passed to the crashpad
+ // handler.
+ virtual void GetProcessSimpleAnnotations(
+ std::map<std::string, std::string>* annotations);
+
#if defined(OS_ANDROID)
// Used by WebView to sample crashes without generating the unwanted dumps. If
// the returned value is less than 100, crash dumping will be sampled to that
@@ -194,6 +208,9 @@ class CrashReporterClient {
bool* sanitize_stacks);
#endif
+ // Override the default upload url. Returns true if overridden.
+ virtual bool GetUploadUrl(std::string* url);
+
// This method should return true to configure a crash reporter capable of
// monitoring itself for its own crashes to do so, even if self-monitoring
// would be expensive. "Expensive" self-monitoring dedicates an additional
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
index b579521d55860823722df2ee849f6b1628b3c950..f4f71e5174cf8fb706a2f8385252ba877d1a03a7 100644
--- a/components/crash/core/app/crashpad_mac.mm
+++ b/components/crash/core/app/crashpad_mac.mm
@@ -67,6 +67,8 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
} // @autoreleasepool
return process_annotations;
}();
+ CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
+ crash_reporter_client->GetProcessSimpleAnnotations(&annotations);
return annotations;
}
@@ -140,9 +142,17 @@ base::FilePath PlatformCrashpadInitialization(
#else
std::string url;
#endif
+ crash_reporter_client->GetUploadUrl(&url);
std::vector<std::string> arguments;
+ if (!crash_reporter_client->GetShouldRateLimit()) {
+ arguments.push_back("--no-rate-limit");
+ }
+ if (!crash_reporter_client->GetShouldCompressUploads()) {
+ arguments.push_back("--no-upload-gzip");
+ }
+
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
arguments.push_back("--monitor-self");
}
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
index 669f5bea844d75f0e5c34b58994f4cfb8e856af0..8c1fb8fb8f2e02466b51ef08de25b056f8b2052d 100644
--- a/components/crash/core/app/crashpad_win.cc
+++ b/components/crash/core/app/crashpad_win.cc
@@ -84,12 +84,14 @@ base::FilePath PlatformCrashpadInitialization(
std::map<std::string, std::string> process_annotations;
GetPlatformCrashpadAnnotations(&process_annotations);
+ crash_reporter_client->GetProcessSimpleAnnotations(&process_annotations);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
std::string url = "https://clients2.google.com/cr/report";
#else
std::string url;
#endif
+ crash_reporter_client->GetUploadUrl(&url);
// Allow the crash server to be overridden for testing. If the variable
// isn't present in the environment then the default URL will remain.
@@ -126,6 +128,13 @@ base::FilePath PlatformCrashpadInitialization(
std::vector<std::string> arguments(start_arguments);
+ if (!crash_reporter_client->GetShouldRateLimit()) {
+ arguments.push_back("--no-rate-limit");
+ }
+ if (!crash_reporter_client->GetShouldCompressUploads()) {
+ arguments.push_back("--no-upload-gzip");
+ }
+
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
arguments.push_back("--monitor-self");
for (const std::string& start_argument : start_arguments) {

View File

@@ -19,6 +19,21 @@ This can be removed once web content (including WebGL) learn how
to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 1889f1df493c46f9460cadde1fd80267b141bf98..688a0905c997c86b63bcc607033ec82a74741114 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1794,6 +1794,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace(
gfx::ContentColorUsage content_color_usage) const {
+ if (!settings_.enable_color_correct_rendering) {
+ return {};
+ }
+
constexpr gfx::ColorSpace srgb = gfx::ColorSpace::CreateSRGB();
if (settings_.prefer_raster_in_srgb &&
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index 95a901678c215220b9e88db768444d48e32f6dbd..841c809b0b50c8c34a9d9c972c511bd4fd57a7b0 100644
--- a/cc/trees/layer_tree_settings.h
@@ -66,7 +81,7 @@ index cb69e08c0185f55497089505ed5b226e57140321..362f28accc248248f3bcb54955c23528
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
#if defined(OS_MACOSX)
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625adb68e93 100644
index 5062680dac94c24aa4c6ad3f8508b5a2a25dad54..31700af38ea7d309dfe85fde69d0eb0566346ba1 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -84,6 +84,9 @@
@@ -79,7 +94,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
namespace viz {
namespace {
@@ -588,8 +591,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
@@ -581,8 +584,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
SetBlendEnabled(quad->ShouldDrawWithBlending());
@@ -91,7 +106,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
// Use the full quad_rect for debug quads to not move the edges based on
// partial swaps.
@@ -1547,7 +1551,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
@@ -1540,7 +1544,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
params->use_color_matrix, tint_gl_composited_content_,
params->apply_shader_based_rounded_corner &&
ShouldApplyRoundedCorner(params->quad)),
@@ -101,7 +116,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
@@ -2018,7 +2023,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -2011,7 +2016,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -111,7 +126,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
SetShaderColor(color, opacity);
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -2173,7 +2179,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
@@ -2166,7 +2172,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
: NON_PREMULTIPLIED_ALPHA,
false, false, tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -121,7 +136,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2269,7 +2276,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
@@ -2262,7 +2269,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -131,7 +146,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2371,7 +2379,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
@@ -2364,7 +2372,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
// The source color space should never be RGB.
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
@@ -140,7 +155,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
#if defined(OS_WIN)
// Force sRGB output on Windows for overlay candidate video quads to match
@@ -2535,7 +2543,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
@@ -2528,7 +2536,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
@@ -150,7 +165,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2600,8 +2609,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2593,8 +2602,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
@@ -161,7 +176,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -3340,7 +3349,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
@@ -3333,7 +3342,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
const gfx::ColorSpace& src_color_space,
const gfx::ColorSpace& dst_color_space) {
@@ -172,7 +187,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
// If the input color space is PQ, and it did not specify a white level,
// override it with the frame's white level.
@@ -3722,9 +3733,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
@@ -3715,9 +3726,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
}
@@ -185,7 +200,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
gfx::SizeF((*overlay_texture)->texture.size()));
@@ -3943,8 +3954,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
@@ -3936,8 +3947,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
PrepareGeometry(SHARED_BINDING);
@@ -196,7 +211,7 @@ index ceb0c4ecbe0401c0190ba683bac479392726207b..a4b41b16a2850b899fa815bd49ac6625
gfx::Transform render_matrix;
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
@@ -4053,3 +4064,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
@@ -4046,3 +4057,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
}
} // namespace viz
@@ -293,7 +308,7 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
gfx::ColorSpace::TransferID transfer_id =
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..5b661c70c9c89883a1aaaf1a29a9ec9fe7f16da6 100644
index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..93a9652b71d86441e15b87aafd7a6b1a13f45830 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -16,6 +16,7 @@
@@ -304,33 +319,37 @@ index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..5b661c70c9c89883a1aaaf1a29a9ec9f
namespace gfx {
@@ -258,6 +259,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
} else {
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ color_space = base::mac::GetSystemColorSpace();
+ }
+
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
CGColorSpaceCopyICCProfile(color_space));
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
@@ -274,6 +280,14 @@ bool IOSurfaceCanSetColorSpace(const ColorSpace& color_space) {
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
@@ -119,6 +120,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
// Common method used by IOSurfaceSetColorSpace and IOSurfaceCanSetColorSpace.
bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
const ColorSpace& color_space) {
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ base::ScopedCFTypeRef<CFDataRef> system_icc(
+ CGColorSpaceCopyICCProfile(base::mac::GetSystemColorSpace()));
+ IOSurfaceSetValue(io_surface, CFSTR("IOSurfaceColorSpace"), system_icc);
+ return;
+ return true;
+ }
+
if (!internal::IOSurfaceSetColorSpace(io_surface, color_space)) {
DLOG(ERROR) << "Failed to set color space for IOSurface: "
<< color_space.ToString();
// Allow but ignore invalid color spaces.
if (!color_space.IsValid())
return true;
@@ -253,6 +262,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
DCHECK_EQ(kIOReturnSuccess, r);
}
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ CGColorSpaceRef color_space = base::mac::GetSystemColorSpace();
+ base::ScopedCFTypeRef<CFDataRef> color_space_icc(
+ CGColorSpaceCopyICCProfile(color_space));
+ IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
+ return surface;
+ }
+
// Ensure that all IOSurfaces start as sRGB.
if (__builtin_available(macos 10.12, *)) {
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index 0f746ead72a2c195321384c9c4ced96d0608fb7b..a9cc7b6d93cdb42c5a9a177e8a09edeb36db8122 100644
--- a/ui/gfx/switches.cc

View File

@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
See https://github.com/electron/electron/issues/10754
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
index ef44c779973737d2abc024553b317f0dc2ccccdc..ae9608974be11e28d8d2737302f0d377cd8f674c 100644
index f55c90df9969ace76a0813d02237edcb406e079c..6b341a5c046685afdfc2502191f1f209567c2c6e 100644
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -4151,7 +4151,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
@@ -4156,7 +4156,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
"frame that never had a user gesture since its load. "
"https://www.chromestatus.com/feature/5082396709879808";
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);

View File

@@ -0,0 +1,216 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 30 Apr 2020 13:39:46 -0500
Subject: fix: ensure edit cmds to sent focused WebContents
Fixes an issue whereby some edit commands were not being
sent to the focused WebContents. This fixes the issue by
adding the malfunctioning commands to RenderFrameHostDelegate
and then calling them that way.
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
index 72f9b6d582345736d1b0b05f52925e8e036cf131..7fecac21ea36670a20bc2b317cfe11eb5e0b2524 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -451,6 +451,22 @@ void InterstitialPageImpl::ExecuteEditCommand(
input_handler->ExecuteEditCommand(command, value);
}
+void InterstitialPageImpl::Undo() {
+ auto* input_handler = GetFocusedFrameInputHandler();
+ if (!input_handler)
+ return;
+ input_handler->Undo();
+ RecordAction(base::UserMetricsAction("Undo"));
+}
+
+void InterstitialPageImpl::Redo() {
+ auto* input_handler = GetFocusedFrameInputHandler();
+ if (!input_handler)
+ return;
+ input_handler->Redo();
+ RecordAction(base::UserMetricsAction("Redo"));
+}
+
void InterstitialPageImpl::Copy() {
auto* input_handler = GetFocusedFrameInputHandler();
if (!input_handler)
@@ -467,6 +483,14 @@ void InterstitialPageImpl::Paste() {
RecordAction(base::UserMetricsAction("Paste"));
}
+void InterstitialPageImpl::PasteAndMatchStyle() {
+ auto* input_handler = GetFocusedFrameInputHandler();
+ if (!input_handler)
+ return;
+ input_handler->PasteAndMatchStyle();
+ RecordAction(base::UserMetricsAction("PasteAndMatchStyle"));
+}
+
void InterstitialPageImpl::SelectAll() {
auto* input_handler = GetFocusedFrameInputHandler();
if (!input_handler)
diff --git a/content/browser/frame_host/interstitial_page_impl.h b/content/browser/frame_host/interstitial_page_impl.h
index e645cd75128085e15c1213df206847dd02fb5a83..095ae4dffb1f576a8ceefd2a4ab9f8f93473e460 100644
--- a/content/browser/frame_host/interstitial_page_impl.h
+++ b/content/browser/frame_host/interstitial_page_impl.h
@@ -119,9 +119,12 @@ class CONTENT_EXPORT InterstitialPageImpl : public InterstitialPage,
ui::AXMode GetAccessibilityMode() override;
void ExecuteEditCommand(const std::string& command,
const base::Optional<base::string16>& value) override;
+ void Undo() override;
+ void Redo() override;
void Cut() override;
void Copy() override;
void Paste() override;
+ void PasteAndMatchStyle() override;
void SelectAll() override;
RenderFrameHostDelegate* CreateNewWindow(
RenderFrameHost* opener,
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index 234baaefaa36a2a64f7c365462c44807b0a1eabb..ef04420a733ef3d2bdc7d50af1d149db337494a4 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -148,9 +148,12 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
virtual void ExecuteEditCommand(
const std::string& command,
const base::Optional<base::string16>& value) = 0;
+ virtual void Undo() = 0;
+ virtual void Redo() = 0;
virtual void Cut() = 0;
virtual void Copy() = 0;
virtual void Paste() = 0;
+ virtual void PasteAndMatchStyle() = 0;
virtual void SelectAll() = 0;
// Requests the renderer to move the selection extent to a new position.
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 5697455918f9aa2f4225eba1a5566950e34ec410..f5a7fdaa218742249cde04c73bcab43de0d83eed 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -426,9 +426,12 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
const std::string& command,
const base::Optional<base::string16>& value) override {}
+ void Undo() override {}
+ void Redo() override {}
void Cut() override {}
void Copy() override {}
void Paste() override {}
+ void PasteAndMatchStyle() override {}
void SelectAll() override {}
private:
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 472869202ff8a62d854c9ca39ca9f14e2f91e8cf..17e3fe40522e088057eaf01a290b658a0b6d1d01 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1799,15 +1799,15 @@ void RenderWidgetHostViewMac::ExecuteEditCommand(const std::string& command) {
}
void RenderWidgetHostViewMac::Undo() {
- WebContents* web_contents = GetWebContents();
- if (web_contents)
- web_contents->Undo();
+ if (auto* delegate = GetFocusedRenderWidgetHostDelegate()) {
+ delegate->Undo();
+ }
}
void RenderWidgetHostViewMac::Redo() {
- WebContents* web_contents = GetWebContents();
- if (web_contents)
- web_contents->Redo();
+ if (auto* delegate = GetFocusedRenderWidgetHostDelegate()) {
+ delegate->Redo();
+ }
}
void RenderWidgetHostViewMac::Cut() {
@@ -1835,9 +1835,9 @@ void RenderWidgetHostViewMac::Paste() {
}
void RenderWidgetHostViewMac::PasteAndMatchStyle() {
- WebContents* web_contents = GetWebContents();
- if (web_contents)
- web_contents->PasteAndMatchStyle();
+ if (auto* delegate = GetFocusedRenderWidgetHostDelegate()) {
+ delegate->PasteAndMatchStyle();
+ }
}
void RenderWidgetHostViewMac::SelectAll() {
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
index 760e47e9edd7b92b7bc6074f6da9c76048be8f28..2b0f1135e584852048081629eb6297e4e1fcc574 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -91,9 +91,12 @@ class RenderWidgetHostDelegateEditCommandCounter
const base::Optional<base::string16>& value) override {
edit_command_message_count_++;
}
+ void Undo() override {}
+ void Redo() override {}
void Cut() override {}
void Copy() override {}
void Paste() override {}
+ void PasteAndMatchStyle() override {}
void SelectAll() override {}
};
diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm
index 158e0507af7433e16c47227e7519b12e14554f1b..e7b8109cdc78e76d737bd0c067f8d33e0c171117 100644
--- a/content/browser/renderer_host/text_input_client_mac_unittest.mm
+++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm
@@ -40,9 +40,12 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
void ExecuteEditCommand(
const std::string& command,
const base::Optional<base::string16>& value) override {}
+ void Undo() override {}
+ void Redo() override {}
void Cut() override {}
void Copy() override {}
void Paste() override {}
+ void PasteAndMatchStyle() override {}
void SelectAll() override {}
};
diff --git a/content/test/mock_render_widget_host_delegate.cc b/content/test/mock_render_widget_host_delegate.cc
index 8e7922a2e83b1272e93fbd7c8c5323ad7ed9c3a7..4aa08a55c036569e39d4d02254b347d8470462af 100644
--- a/content/test/mock_render_widget_host_delegate.cc
+++ b/content/test/mock_render_widget_host_delegate.cc
@@ -31,12 +31,18 @@ void MockRenderWidgetHostDelegate::ExecuteEditCommand(
const std::string& command,
const base::Optional<base::string16>& value) {}
+void MockRenderWidgetHostDelegate::Undo() {}
+
+void MockRenderWidgetHostDelegate::Redo() {}
+
void MockRenderWidgetHostDelegate::Cut() {}
void MockRenderWidgetHostDelegate::Copy() {}
void MockRenderWidgetHostDelegate::Paste() {}
+void MockRenderWidgetHostDelegate::PasteAndMatchStyle() {}
+
void MockRenderWidgetHostDelegate::SelectAll() {}
void MockRenderWidgetHostDelegate::CreateInputEventRouter() {
diff --git a/content/test/mock_render_widget_host_delegate.h b/content/test/mock_render_widget_host_delegate.h
index 5cdc010273f0bd03419c14046ee6cb8603a29dbf..16273c2ec761668249277a0be77aa429bcba1aef 100644
--- a/content/test/mock_render_widget_host_delegate.h
+++ b/content/test/mock_render_widget_host_delegate.h
@@ -42,9 +42,12 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
const NativeWebKeyboardEvent& event) override;
void ExecuteEditCommand(const std::string& command,
const base::Optional<base::string16>& value) override;
+ void Undo() override;
+ void Redo() override;
void Cut() override;
void Copy() override;
void Paste() override;
+ void PasteAndMatchStyle() override;
void SelectAll() override;
RenderWidgetHostInputEventRouter* GetInputEventRouter() override;
RenderWidgetHostImpl* GetFocusedRenderWidgetHost(

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Mon, 1 Jun 2020 20:36:16 +0000
Subject: fix: default to NTLM v2 in network service for POSIX platforms
NTLM always defaults to NTLM v2 at the //net layer for quite
sometime now https://crbug.com/22532.
Change-Id: I4ea2dedc10c63a7c4e00101c0acc6d8a713c5054
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2222116
Auto-Submit: Deepak Mohan <hop2deep@gmail.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773809}
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom
index 4ed52a1fd6edafd74e0927aeb469603b25e1d0f8..ad42acc4f6b7dab6406cccc8eec945b6962110da 100644
--- a/services/network/public/mojom/network_service.mojom
+++ b/services/network/public/mojom/network_service.mojom
@@ -152,7 +152,7 @@ struct HttpAuthDynamicParams {
bool enable_negotiate_port = true;
// Whether NTLM V2 is enabled on POSIX platforms. No effect elsewhere.
- bool ntlm_v2_enabled = false;
+ bool ntlm_v2_enabled = true;
// The AccountManager AccountManagerget.AccountsByTypeAndFeatures on Android
// when using Negotiate authentication.

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 4 Oct 2018 14:57:02 -0700
Subject: fix: handle non client pointer events from pen on Windows 10
Refs: https://github.com/electron/electron/issues/21440
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2237535
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 281c722d81c0ad5fa7bacbe25c07a7578dfa43b6..037ace982ed86c515e7b024d0cd2862d604ec63b 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1993,6 +1993,15 @@ LRESULT HWNDMessageHandler::OnPointerEvent(UINT message,
return -1;
}
+ // Pen may also send non client pointer messages, treat them as normal
+ // touch events so they can be properly handled.
+ if (pointer_type == PT_PEN &&
+ (message == WM_NCPOINTERDOWN ||
+ message == WM_NCPOINTERUP ||
+ message == WM_NCPOINTERUPDATE)) {
+ pointer_type = PT_TOUCH;
+ }
+
switch (pointer_type) {
case PT_PEN:
return HandlePointerEventTypePen(message, w_param, l_param);

View File

@@ -0,0 +1,147 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 4 Oct 2018 14:57:02 -0700
Subject: Make sure hunspell file is not destroyed in UI thread
Submitted to Chromium at:
https://chromium-review.googlesource.com/c/chromium/src/+/2206199/1
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index c9c9f18b5cb176d74729cea8e5fee12f7fcf74f2..dfc895984cf7c1f0ca661ae527d00f9f4ebba49f 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -92,21 +92,28 @@ bool SaveDictionaryData(std::unique_ptr<std::string> data,
} // namespace
-SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile() {
-}
+SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile(
+ base::TaskRunner* task_runner) : task_runner_(task_runner) {}
SpellcheckHunspellDictionary::DictionaryFile::~DictionaryFile() {
+ if (file.IsValid()) {
+ task_runner_->PostTask(FROM_HERE,
+ base::BindOnce(&CloseDictionary, std::move(file)));
+ }
}
SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile(
DictionaryFile&& other)
- : path(other.path), file(std::move(other.file)) {}
+ : path(other.path),
+ file(std::move(other.file)),
+ task_runner_(std::move(other.task_runner_)) {}
SpellcheckHunspellDictionary::DictionaryFile&
SpellcheckHunspellDictionary::DictionaryFile::operator=(
DictionaryFile&& other) {
path = other.path;
file = std::move(other.file);
+ task_runner_ = std::move(other.task_runner_);
return *this;
}
@@ -120,15 +127,10 @@ SpellcheckHunspellDictionary::SpellcheckHunspellDictionary(
use_browser_spellchecker_(false),
browser_context_(browser_context),
spellcheck_service_(spellcheck_service),
- download_status_(DOWNLOAD_NONE) {}
+ download_status_(DOWNLOAD_NONE),
+ dictionary_file_(task_runner_.get()) {}
SpellcheckHunspellDictionary::~SpellcheckHunspellDictionary() {
- if (dictionary_file_.file.IsValid()) {
- task_runner_->PostTask(
- FROM_HERE,
- base::BindOnce(&CloseDictionary, std::move(dictionary_file_.file)));
- }
-
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
// Disable the language from platform spellchecker.
if (spellcheck::UseBrowserSpellChecker())
@@ -323,7 +325,8 @@ void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
#if !defined(OS_ANDROID)
// static
SpellcheckHunspellDictionary::DictionaryFile
-SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
+SpellcheckHunspellDictionary::OpenDictionaryFile(base::TaskRunner* task_runner,
+ const base::FilePath& path) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
@@ -334,7 +337,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
// For systemwide installations on Windows, the default directory may not
// have permissions for download. In that case, the alternate directory for
// download is chrome::DIR_USER_DATA.
- DictionaryFile dictionary;
+ DictionaryFile dictionary(task_runner);
#if defined(OS_WIN)
// Check if the dictionary exists in the fallback location. If so, use it
@@ -376,7 +379,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
// static
SpellcheckHunspellDictionary::DictionaryFile
SpellcheckHunspellDictionary::InitializeDictionaryLocation(
- const std::string& language) {
+ base::TaskRunner* task_runner, const std::string& language) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
@@ -391,7 +394,7 @@ SpellcheckHunspellDictionary::InitializeDictionaryLocation(
base::FilePath dict_path =
spellcheck::GetVersionedFileName(language, dict_dir);
- return OpenDictionaryFile(dict_path);
+ return OpenDictionaryFile(task_runner, dict_path);
}
void SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete(
@@ -480,7 +483,8 @@ void SpellcheckHunspellDictionary::PlatformSupportsLanguageComplete(
#if !defined(OS_ANDROID) && BUILDFLAG(USE_RENDERER_SPELLCHECKER)
base::PostTaskAndReplyWithResult(
task_runner_.get(), FROM_HERE,
- base::BindOnce(&InitializeDictionaryLocation, language_),
+ base::BindOnce(&InitializeDictionaryLocation,
+ base::RetainedRef(task_runner_.get()), language_),
base::BindOnce(
&SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete,
weak_ptr_factory_.GetWeakPtr()));
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index 4662bdc08b54304a7f8b2995f60fea9dc5617fff..7679f526c05980889adb2f6a8a0c20dd7f5415c3 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -99,7 +99,7 @@ class SpellcheckHunspellDictionary
// blocking sequence.
struct DictionaryFile {
public:
- DictionaryFile();
+ explicit DictionaryFile(base::TaskRunner* task_runner);
~DictionaryFile();
DictionaryFile(DictionaryFile&& other);
@@ -112,6 +112,9 @@ class SpellcheckHunspellDictionary
base::File file;
private:
+ // Task runner where the file is created.
+ scoped_refptr<base::TaskRunner> task_runner_;
+
DISALLOW_COPY_AND_ASSIGN(DictionaryFile);
};
@@ -126,11 +129,12 @@ class SpellcheckHunspellDictionary
#if !defined(OS_ANDROID)
// Figures out the location for the dictionary, verifies its contents, and
// opens it.
- static DictionaryFile OpenDictionaryFile(const base::FilePath& path);
+ static DictionaryFile OpenDictionaryFile(base::TaskRunner* task_runner,
+ const base::FilePath& path);
// Gets the default location for the dictionary file.
static DictionaryFile InitializeDictionaryLocation(
- const std::string& language);
+ base::TaskRunner* task_runner, const std::string& language);
// The reply point for PostTaskAndReplyWithResult, called after the dictionary
// file has been initialized.

View File

@@ -0,0 +1,79 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Wed, 20 May 2020 13:48:51 -0700
Subject: fix: swap global proxies before initializing the windows proxies
Electron's Context Isolation implementation has a side-effect of initializing
the isolated worlds WindowProxy during the initialization of the main world
WindowProxy as a result of creating the isolated world inside the DidCreateScriptContext
hook. This results in an assertion failing in Chromium during a frame
swap where it expects to be able to set a new global_proxy in the WindowProxy
of the isolated world BEFORE it is initialized.
To meet this assumption this patch splits SetGlobalProxy into two calls,
SetGlobalProxyWithoutInitializing and InitializeIfNeeded which has the same
resultant effect but means that all of the global_proxy objects are set
BEFORE any WindowProxy's are initialized.
This could probably be upstreamed as it doesn't affect the way Chromium works
but also it has no benefit for them at this time.
diff --git a/third_party/blink/renderer/bindings/core/v8/window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/window_proxy.cc
index 389dcd940e93ee043cf7a4435991c64d67386a38..0b5c44d75ae590b493da5584a82ea38a8246a9bf 100644
--- a/third_party/blink/renderer/bindings/core/v8/window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/window_proxy.cc
@@ -104,10 +104,7 @@ v8::Local<v8::Object> WindowProxy::ReleaseGlobalProxy() {
}
void WindowProxy::SetGlobalProxy(v8::Local<v8::Object> global_proxy) {
- DCHECK_EQ(lifecycle_, Lifecycle::kContextIsUninitialized);
-
- CHECK(global_proxy_.IsEmpty());
- global_proxy_.Set(isolate_, global_proxy);
+ SetGlobalProxyWithoutInitializing(global_proxy);
// Initialize the window proxy now, to re-establish the connection between
// the global object and the v8::Context. This is really only needed for a
@@ -118,6 +115,13 @@ void WindowProxy::SetGlobalProxy(v8::Local<v8::Object> global_proxy) {
Initialize();
}
+void WindowProxy::SetGlobalProxyWithoutInitializing(v8::Local<v8::Object> global_proxy) {
+ DCHECK_EQ(lifecycle_, Lifecycle::kContextIsUninitialized);
+
+ CHECK(global_proxy_.IsEmpty());
+ global_proxy_.Set(isolate_, global_proxy);
+}
+
// Create a new environment and setup the global object.
//
// The global object corresponds to a DOMWindow instance. However, to
diff --git a/third_party/blink/renderer/bindings/core/v8/window_proxy.h b/third_party/blink/renderer/bindings/core/v8/window_proxy.h
index ce6aac22126e0a39fa28fcde56e903abd3a9d510..1cf5e056252af5f8ba4725722ac8d9f9d4a88de2 100644
--- a/third_party/blink/renderer/bindings/core/v8/window_proxy.h
+++ b/third_party/blink/renderer/bindings/core/v8/window_proxy.h
@@ -156,6 +156,7 @@ class WindowProxy : public GarbageCollected<WindowProxy> {
CORE_EXPORT v8::Local<v8::Object> GlobalProxyIfNotDetached();
v8::Local<v8::Object> ReleaseGlobalProxy();
void SetGlobalProxy(v8::Local<v8::Object>);
+ void SetGlobalProxyWithoutInitializing(v8::Local<v8::Object>);
// TODO(dcheng): Temporarily exposed to avoid include cycles. Remove the need
// for this and remove this getter.
diff --git a/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc b/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc
index ba9845625ea960c1f0be69251a41d51a3a1fd313..a1aa5de76a86cc0a135ae775e4d8455993f10e75 100644
--- a/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc
+++ b/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc
@@ -55,8 +55,11 @@ void WindowProxyManager::ReleaseGlobalProxies(
void WindowProxyManager::SetGlobalProxies(
const GlobalProxyVector& global_proxies) {
+ for (const auto& entry : global_proxies) {
+ WindowProxyMaybeUninitialized(*entry.first)->SetGlobalProxyWithoutInitializing(entry.second);
+ }
for (const auto& entry : global_proxies)
- WindowProxyMaybeUninitialized(*entry.first)->SetGlobalProxy(entry.second);
+ WindowProxyMaybeUninitialized(*entry.first)->InitializeIfNeeded();
}
WindowProxyManager::WindowProxyManager(Frame& frame, FrameType frame_type)

View File

@@ -71,10 +71,10 @@ index f0b9f9634264e9073f22560903307332986df2fe..934fa63595053156b446dbc5fdccb196
render_frame_host_ =
frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index f76a633c85c8e53d99c1280d359b6ddcf6bcfbbc..676f70c59f75d47c94902eba3776949b749f267f 100644
index 4c370c23a2217b45d7f023708305b3d1b115790a..9a3a207eab69464f35ffd39b75417311a9102cc2 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2392,6 +2392,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -2391,6 +2391,16 @@ bool RenderFrameHostManager::InitRenderView(
scoped_refptr<SiteInstance>
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
NavigationRequest* request) {
@@ -91,7 +91,7 @@ index f76a633c85c8e53d99c1280d359b6ddcf6bcfbbc..676f70c59f75d47c94902eba3776949b
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
// All children of MHTML documents must be MHTML documents. They all live in
@@ -2411,10 +2421,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2410,10 +2420,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
//
// TODO(clamy): We should also consider as a candidate SiteInstance the
// speculative SiteInstance that was computed on redirects.
@@ -156,7 +156,7 @@ index f76a633c85c8e53d99c1280d359b6ddcf6bcfbbc..676f70c59f75d47c94902eba3776949b
// Account for renderer-initiated reload as well.
// Needed as a workaround for https://crbug.com/1045524, remove it when it is
@@ -2456,6 +2516,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2455,6 +2515,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->dest_site_instance() != dest_site_instance) {
request->ResetStateForSiteInstanceChange();
}

View File

@@ -12,7 +12,7 @@ rendering and there is no signal from browser process on this event
to identify it.
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index db9780a6c0b679354a5f74b1f89e32a8ff9dd2e3..cc51d41f88a60ccb936b0608973b76ba84c2a47b 100644
index 80fd68b4b862e59ba255163f3a903846a7768d75..0681822c29b9f9e75c93819a3bf14f398fe24abf 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -161,6 +161,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
@@ -28,7 +28,7 @@ index db9780a6c0b679354a5f74b1f89e32a8ff9dd2e3..cc51d41f88a60ccb936b0608973b76ba
base::AutoLock auto_lock(lock_);
private_->OnBrowserThreadsStarted();
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index d5595c91f4d63362e575ad31070335ee344261fa..19c012313550cf9d9bf591a54e739fc34239e4dd 100644
index ce8f9551f1b17c7508a0e0bd0ecc55eca2c0ac6e..d5289401110a5fe7d3327d9ca50c160c7b2e876a 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -90,6 +90,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
@@ -38,12 +38,12 @@ index d5595c91f4d63362e575ad31070335ee344261fa..19c012313550cf9d9bf591a54e739fc3
+ bool DxdiagDx12VulkanRequested() const;
// Called from BrowserMainLoop::BrowserThreadsStarted().
void OnBrowserThreadsStarted();
#endif
void TerminateInfoCollectionGpuProcess();
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index aae01a85f5d37d4c8e809815540662dee1550dbc..c70dbbc6ec1fc460f8a1f95613dbf1a65482f4f4 100644
index b09b8ffe7684f511e971d0c470c8b67a46288b6e..fd9dcfef52a0797ec6b2497c2bf331c88f481d75 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -885,6 +885,11 @@ bool GpuDataManagerImplPrivate::Dx12VulkanRequested() const {
@@ -888,6 +888,11 @@ bool GpuDataManagerImplPrivate::Dx12VulkanRequested() const {
return gpu_info_dx12_vulkan_requested_;
}
@@ -56,7 +56,7 @@ index aae01a85f5d37d4c8e809815540662dee1550dbc..c70dbbc6ec1fc460f8a1f95613dbf1a6
// Launch the info collection GPU process to collect DX12 and Vulkan support
// information. Not to affect Chrome startup, this is done in a delayed mode,
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
index 6a082f73e77d9f5e7630cc4dbc18188c7e565c0b..1468b5a9a469e9fa9f9911dc4ca9eb91a20b5cad 100644
index 37c11fa98c30d2ab0455e550847c9dbecc327304..283fc6455efd3d9c19ebc48779f2d6b7d763ff9b 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
@@ -70,6 +70,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
@@ -65,5 +65,5 @@ index 6a082f73e77d9f5e7630cc4dbc18188c7e565c0b..1468b5a9a469e9fa9f9911dc4ca9eb91
bool Dx12VulkanRequested() const;
+ bool DxdiagDx12VulkanRequested() const;
void OnBrowserThreadsStarted();
void TerminateInfoCollectionGpuProcess();
#endif
void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info,

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 4 Oct 2018 14:57:02 -0700
Subject: fix: remove menu window from taskbar
Refs https://chromium-review.googlesource.com/c/chromium/src/+/2245941
diff --git a/ui/views/widget/widget_hwnd_utils.cc b/ui/views/widget/widget_hwnd_utils.cc
index 40e66a212e3ea158b61f11d804a3c1644023b2d7..89f5b62f95dfec59bacf79f33895438039fac1c5 100644
--- a/ui/views/widget/widget_hwnd_utils.cc
+++ b/ui/views/widget/widget_hwnd_utils.cc
@@ -118,6 +118,8 @@ void CalculateWindowStylesFromInitParams(
else
*style |= WS_BORDER;
}
+ if (!params.force_show_in_taskbar)
+ *ex_style |= WS_EX_TOOLWINDOW;
break;
case Widget::InitParams::TYPE_TOOLTIP:
*style |= WS_POPUP;

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Fri, 1 May 2020 18:25:59 -0700
Subject: upload_list: add LoadSync method
This allows synchronous loading of the upload list, which is required by
the crashReporter.getUploadedReports() API. The synchronous version is
deprecated, and this API should be removed once the deprecated behavior
is no longer supported.
diff --git a/components/upload_list/upload_list.cc b/components/upload_list/upload_list.cc
index ea718a40f80bc65eb9b25259d6e02c9322c54e48..9d9f9919efcefa83e6fd5b3e8447ec901cfa1388 100644
--- a/components/upload_list/upload_list.cc
+++ b/components/upload_list/upload_list.cc
@@ -70,6 +70,10 @@ void UploadList::Load(base::OnceClosure callback) {
base::BindOnce(&UploadList::OnLoadComplete, this));
}
+void UploadList::LoadSync() {
+ uploads_ = LoadUploadList();
+}
+
void UploadList::Clear(const base::Time& begin,
const base::Time& end,
base::OnceClosure callback) {
diff --git a/components/upload_list/upload_list.h b/components/upload_list/upload_list.h
index 20358339df63ae2bb8b955870c5daf51b65f19f7..7cf89626bea8ee9436f15366446f053a479ac438 100644
--- a/components/upload_list/upload_list.h
+++ b/components/upload_list/upload_list.h
@@ -73,6 +73,8 @@ class UploadList : public base::RefCountedThreadSafe<UploadList> {
// overwrite the previously supplied one, and the first will not be called.
void Load(base::OnceClosure callback);
+ void LoadSync();
+
// Clears any data associated with the upload list, where the upload time or
// capture time falls within the given range.
void Clear(const base::Time& begin,

View File

@@ -22,9 +22,7 @@ fix_do_not_define_debugoptions_s_constructors_in_header.patch
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
refactor_allow_embedder_overriding_of_internal_fs_calls.patch
chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch
inherit_electron_crashpad_pipe_name_in_child_process.patch
chore_read_nobrowserglobals_from_global_not_process.patch
chore_split_createenvironment_into_createenvironment_and.patch
build_bring_back_node_with_ltcg_configuration.patch
revert_crypto_add_oaeplabel_option.patch
refactor_transferrablemodule_is_deprecated_use_compiledwasmmodule.patch
@@ -38,3 +36,7 @@ test_use_tmpdir_refresh_in_test-esm-windows_js.patch
override_existing_v8_reallocate.patch
avoid_calling_deprecated_method.patch
remove_deprecated_wasm_module_type_check.patch
fix_don_t_preparemainexecution_twice.patch
win_use_rtlgenrandom_from_advapi32_dll_directly.patch
tools_update_certdata_txt.patch
crypto_update_root_certificates.patch

View File

@@ -885,10 +885,10 @@ index 0000000000000000000000000000000000000000..f13b471d17128468bed06e66bd03a2ea
+}
diff --git a/filenames.json b/filenames.json
new file mode 100644
index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1fad1cc946
index 0000000000000000000000000000000000000000..aa9aa6d32f7d33a6f82ccb32a52f53ed3d5a77f0
--- /dev/null
+++ b/filenames.json
@@ -0,0 +1,448 @@
@@ -0,0 +1,447 @@
+// This file is automatically generated by generate_gn_filenames_json.py
+// DO NOT EDIT
+{
@@ -957,7 +957,6 @@ index 0000000000000000000000000000000000000000..db73a7699cdb1925c723fd1708d6ce1f
+ }
+ ],
+ "library_files": [
+ "lib/internal/bootstrap/environment.js",
+ "lib/internal/bootstrap/loaders.js",
+ "lib/internal/bootstrap/node.js",
+ "lib/internal/bootstrap/pre_execution.js",

View File

@@ -38,7 +38,7 @@ index fabaea75686161f488a03349e07049a513b98fad..5a6b01dc12fb77d5f8c26a1153ead2a1
bool Exists(const char* id);
diff --git a/tools/js2c.py b/tools/js2c.py
index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c48e52b67c 100755
index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..dc3946e3ac579134dd26e5855a1db0a7ed44e405 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -187,13 +187,15 @@ namespace native_module {{
@@ -100,14 +100,14 @@ index 752344d68c3f63b4c5e491b33d4576ed48f8b74f..a6f0805048e3c3f4dd81ce6e90b684c4
- definitions.append(config_def)
+ # Electron: Expose fs module without asar support.
+ if filename == 'lib/fs.js':
+ # Node's 'fs' and 'internal/fs/streams' have a lazy-loaded circular
+ # dependency. So to expose the unmodified Node 'fs' functionality here,
+ # we have to copy both 'fs' *and* 'internal/fs/streams' and modify the
+ # Node's 'fs' and 'internal/fs/<filename> have lazy-loaded circular
+ # dependencies. So to expose the unmodified Node 'fs' functionality here,
+ # we have to copy both 'fs' *and* 'internal/fs/<filename>' files and modify the
+ # copies to depend on each other instead of on our asarified 'fs' code.
+ # See https://github.com/electron/electron/pull/16028 for more.
+ AddModule('lib/original-fs.js', consts, macros, definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/streams')", "require('internal/original-fs/streams')"))
+ elif filename == 'lib/internal/fs/streams.js':
+ AddModule('lib/internal/original-fs/streams.js', consts, macros, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
+ AddModule('lib/original-fs.js', consts, macros, definitions, initializers, lambda _: ReadFile(filename).replace("require('internal/fs/", "require('internal/original-fs/"))
+ elif filename.startswith('lib/internal/fs/'):
+ original_fs_filename = filename.replace('internal/fs/', 'internal/original-fs/')
+ AddModule(original_fs_filename, consts, macros, definitions, initializers, lambda _: ReadFile(filename).replace("require('fs')", "require('original-fs')"))
+
+ config_size = 0
+ if not only_js:

View File

@@ -1,69 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Wed, 17 Jul 2019 14:45:59 -0700
Subject: chore: split CreateEnvironment into CreateEnvironment and
BootstrapEnvironment
This allows us to run operations on a created but not yet bootstrapped
environment such as setting up an InspectorAgent
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 356131156b4a714eebf4e202cd105f0f184e3852..96192f0ea4174315d73e03849ce1bed996afc44c 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -263,7 +263,8 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
int argc,
const char* const* argv,
int exec_argc,
- const char* const* exec_argv) {
+ const char* const* exec_argv,
+ bool bootstrap) {
Isolate* isolate = context->GetIsolate();
HandleScope handle_scope(isolate);
Context::Scope context_scope(context);
@@ -281,9 +282,16 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
Environment::kOwnsProcessState |
Environment::kOwnsInspector));
env->InitializeLibuv(per_process::v8_is_profiling);
- if (env->RunBootstrapping().IsEmpty()) {
+ if (bootstrap && !BootstrapEnvironment(env)) {
return nullptr;
}
+ return env;
+}
+
+bool BootstrapEnvironment(Environment* env) {
+ if (env->RunBootstrapping().IsEmpty()) {
+ return false;
+ }
std::vector<Local<String>> parameters = {
env->require_string(),
@@ -296,9 +304,10 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
if (ExecuteBootstrapper(
env, "internal/bootstrap/environment", &parameters, &arguments)
.IsEmpty()) {
- return nullptr;
+ return false;
}
- return env;
+
+ return true;
}
void FreeEnvironment(Environment* env) {
diff --git a/src/node.h b/src/node.h
index e3258434eba34124c71562225e295cd1807fdf7c..2ac35208ae8b2cfd067b5b712d4447121ef6e47d 100644
--- a/src/node.h
+++ b/src/node.h
@@ -326,7 +326,9 @@ NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data,
int argc,
const char* const* argv,
int exec_argc,
- const char* const* exec_argv);
+ const char* const* exec_argv,
+ bool bootstrap = true);
+NODE_EXTERN bool BootstrapEnvironment(Environment* env);
NODE_EXTERN void LoadEnvironment(Environment* env);
NODE_EXTERN void FreeEnvironment(Environment* env);

View File

@@ -0,0 +1,65 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AshCripps <Ashley.Cripps@ibm.com>
Date: Mon, 1 Jun 2020 13:34:20 +0100
Subject: crypto: update root certificates
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl.
Certificates added:
Entrust Root Certification Authority - G4
Certificates removed:
PR-URL: https://github.com/nodejs/node/pull/33682
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
diff --git a/src/node_root_certs.h b/src/node_root_certs.h
index bc08910c77ad4c9d1121614aa9b97eed0433175c..f8e84e7d231e33736a798c2fd344566df2d2c6a6 100644
--- a/src/node_root_certs.h
+++ b/src/node_root_certs.h
@@ -3421,4 +3421,38 @@
"qp9HpLIiyhY6UFfEW0NnxWViA0kB60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7\n"
"UvToiIMrVCjU8jVStDKDYmlkDJGcn5fqdBb9HxEGmpv0\n"
"-----END CERTIFICATE-----",
+
+/* Entrust Root Certification Authority - G4 */
+"-----BEGIN CERTIFICATE-----\n"
+"MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAwgb4xCzAJ\n"
+"BgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVu\n"
+"dHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMu\n"
+"IC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0\n"
+"aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDEx\n"
+"Nlowgb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9T\n"
+"ZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRy\n"
+"dXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3Qg\n"
+"Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0MIICIjANBgkqhkiG9w0BAQEFAAOC\n"
+"Ag8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3DumSXbcr3DbVZwbPLqGgZ2K+EbTBwXX7zLtJT\n"
+"meH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV3imz/f3ET+iq4qA7ec2/a0My3dl0ELn3\n"
+"9GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j5pds8ELl3FFLFUHtSUrJ3hCX1nbB76W1\n"
+"NhSXNdh4IjVS70O92yfbYVaCNNzLiGAMC1rlLAHGVK/XqsEQe9IFWrhAnoanw5CGAlZSCXqc\n"
+"0ieCU0plUmr1POeo8pyvi73TDtTUXm6Hnmo9RR3RXRv06QqsYJn7ibT/mCzPfB3pAqoEmh64\n"
+"3IhuJbNsZvc8kPNXwbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5XxNMhIWNlUpEbsZmO\n"
+"eX7m640A2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV7rtNOzK+mndm\n"
+"nqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8dWbrAuMI\n"
+"NClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwlN4y6mACXi0mWHv0l\n"
+"iqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNjc0kCAwEAAaNCMEAwDwYDVR0T\n"
+"AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJ84xFYjwznooHFs6FRM5Og6\n"
+"sb9nMA0GCSqGSIb3DQEBCwUAA4ICAQAS5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ\n"
+"9POrYs4QjbRaZIxowLByQzTSGwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5\n"
+"ZDIBf9PD3Vht7LGrhFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0g\n"
+"kLpHZPt/B7NTeLUKYvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uI\n"
+"AeV8KEsD+UmDfLJ/fOPtjqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbwH5Lk6rWS\n"
+"02FREAutp9lfx1/cH6NcjKF+m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+b7DUUH8i119lAg2m\n"
+"9IUe2K4GS0qn0jFmwvjO5QimpAKWRGhXxNUzzxkvFMSUHHuk2fCfDrGA4tGeEWSpiBE6doLl\n"
+"YsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjAJOgc47OlIQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuI\n"
+"jnDrnBdSqEGULoe256YSxXXfW8AKbnuk5F6G+TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh\n"
+"7DE9ZapD8j3fcEThuk0mEDuYn/PIjhs4ViFqUZPTkcpG2om3PVODLAgfi49T3f+sHw==\n"
+"-----END CERTIFICATE-----",
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

View File

@@ -0,0 +1,58 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 20 May 2020 17:37:39 -0500
Subject: fix: don't prepareMainExecution twice
In https://github.com/nodejs/node/pull/26788 (v12.0.0), Node.js added a
bootstrapper to `CreateEnvironment`, which would prepare the main thread
for execution any time an embedder created a new environment. However, this
caused an unfortunate doubling-up effect; Node.js also ran bootstrapping
(called `prepareMainThreadExecution`) for all other execution paths
(like the repl, the actual main module, eval, etc).
To fix this, we can just remove bootstrapping code from `CreateEnvironment`.
diff --git a/lib/internal/bootstrap/environment.js b/lib/internal/bootstrap/environment.js
deleted file mode 100644
index 79a67dae378202ee377f2f138560b74f673af6e4..0000000000000000000000000000000000000000
--- a/lib/internal/bootstrap/environment.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-// This runs necessary preparations to prepare a complete Node.js context
-// that depends on run time states.
-// It is currently only intended for preparing contexts for embedders.
-
-/* global markBootstrapComplete */
-const {
- prepareMainThreadExecution
-} = require('internal/bootstrap/pre_execution');
-
-prepareMainThreadExecution();
-markBootstrapComplete();
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 356131156b4a714eebf4e202cd105f0f184e3852..6c2e0555f2ee554c8ac29465af01e9c47e1d81f9 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -284,20 +284,6 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
if (env->RunBootstrapping().IsEmpty()) {
return nullptr;
}
-
- std::vector<Local<String>> parameters = {
- env->require_string(),
- FIXED_ONE_BYTE_STRING(env->isolate(), "markBootstrapComplete")};
- std::vector<Local<Value>> arguments = {
- env->native_module_require(),
- env->NewFunctionTemplate(MarkBootstrapComplete)
- ->GetFunction(env->context())
- .ToLocalChecked()};
- if (ExecuteBootstrapper(
- env, "internal/bootstrap/environment", &parameters, &arguments)
- .IsEmpty()) {
- return nullptr;
- }
return env;
}

View File

@@ -1,22 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Tue, 4 Jun 2019 17:42:11 +0900
Subject: Inherit ELECTRON_CRASHPAD_PIPE_NAME in child process
This is required for crashReporter to work correctly in node process.
diff --git a/lib/child_process.js b/lib/child_process.js
index d5d97c9da90281e0c24fe97a4914db12d685c7bc..a6d058c92dff927cd2fc6bcb2bb304e9ca497a31 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -107,6 +107,10 @@ function fork(modulePath /* , args, options */) {
options.env = Object.create(options.env || process.env)
options.env.ELECTRON_RUN_AS_NODE = 1;
+ if (process.platform === 'win32') {
+ options.env.ELECTRON_CRASHPAD_PIPE_NAME = process.env.ELECTRON_CRASHPAD_PIPE_NAME;
+ }
+
if (!options.execPath && process.type && process.platform == 'darwin') {
options.execPath = process.helperExecPath;
}

View File

@@ -0,0 +1,409 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AshCripps <Ashley.Cripps@ibm.com>
Date: Mon, 1 Jun 2020 13:31:36 +0100
Subject: tools: update certdata.txt
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is the certdata.txt[0] from NSS 3.53, released on 2020-05-29.
This is the version of NSS that will ship in Firefox 78 on
2020-06-30.
[0] https://hg.mozilla.org/projects/nss/raw-file/NSS_3_53_RTM/lib/ckfw/builtins/certdata.txt
PR-URL: https://github.com/nodejs/node/pull/33682
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
diff --git a/tools/certdata.txt b/tools/certdata.txt
index 3a44db293df268fd3f183f5a297a368ac51d975d..ea14926063b4b5e61a90d0f330d60172317e4346 100644
--- a/tools/certdata.txt
+++ b/tools/certdata.txt
@@ -1810,7 +1810,10 @@ CKA_VALUE MULTILINE_OCTAL
\302\005\146\200\241\313\346\063
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Wed Jan 01 00:00:00 2020
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\062\060\060\061\060\061\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "GeoTrust Global CA"
@@ -1972,7 +1975,10 @@ CKA_VALUE MULTILINE_OCTAL
\244\346\216\330\371\051\110\212\316\163\376\054
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Sun Sep 30 00:00:00 2018
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\070\060\071\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "GeoTrust Universal CA"
@@ -2134,7 +2140,10 @@ CKA_VALUE MULTILINE_OCTAL
\362\034\054\176\256\002\026\322\126\320\057\127\123\107\350\222
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Wed Jan 01 00:00:00 2020
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\062\060\060\061\060\061\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "GeoTrust Universal CA 2"
@@ -4131,7 +4140,10 @@ CKA_VALUE MULTILINE_OCTAL
\245\206\054\174\364\022
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Thu Sep 19 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\071\061\071\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "Taiwan GRCA"
@@ -5329,7 +5341,10 @@ CKA_VALUE MULTILINE_OCTAL
\253\022\350\263\336\132\345\240\174\350\017\042\035\132\351\131
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Tue Apr 30 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\064\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "GeoTrust Primary Certification Authority"
@@ -5486,7 +5501,10 @@ CKA_VALUE MULTILINE_OCTAL
\215\126\214\150
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Tue Apr 30 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\064\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "thawte Primary Root CA"
@@ -5663,7 +5681,10 @@ CKA_VALUE MULTILINE_OCTAL
\254\021\326\250\355\143\152
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Tue Apr 30 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\064\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "VeriSign Class 3 Public Primary Certification Authority - G5"
@@ -7240,7 +7261,10 @@ CKA_VALUE MULTILINE_OCTAL
\021\055
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Tue Apr 30 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\064\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "GeoTrust Primary Certification Authority - G3"
@@ -7371,7 +7395,10 @@ CKA_VALUE MULTILINE_OCTAL
\367\130\077\056\162\002\127\243\217\241\024\056
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Sun Sep 30 00:00:00 2018
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\070\060\071\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "thawte Primary Root CA - G2"
@@ -7533,7 +7560,10 @@ CKA_VALUE MULTILINE_OCTAL
\061\324\100\032\142\064\066\077\065\001\256\254\143\240
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Tue Apr 30 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\064\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "thawte Primary Root CA - G3"
@@ -7671,7 +7701,10 @@ CKA_VALUE MULTILINE_OCTAL
\017\212
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Wed Jan 01 00:00:00 2020
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\062\060\060\061\060\061\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "GeoTrust Primary Certification Authority - G2"
@@ -7843,7 +7876,10 @@ CKA_VALUE MULTILINE_OCTAL
\354\315\202\141\361\070\346\117\227\230\052\132\215
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Tue Apr 30 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\064\063\060\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "VeriSign Universal Root Certification Authority"
@@ -8000,7 +8036,10 @@ CKA_VALUE MULTILINE_OCTAL
\055\247\330\206\052\335\056\020
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Thu Jan 31 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\060\061\063\061\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "VeriSign Class 3 Public Primary Certification Authority - G4"
@@ -11580,7 +11619,10 @@ CKA_VALUE MULTILINE_OCTAL
\371\210\075\176\270\157\156\003\344\102
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Sat Dec 28 00:00:00 2019
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\071\061\062\062\070\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for Certificate "EC-ACC"
@@ -12734,7 +12776,10 @@ CKA_VALUE MULTILINE_OCTAL
\307\314\165\301\226\305\235
END
CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
-CKA_NSS_SERVER_DISTRUST_AFTER CK_BBOOL CK_FALSE
+# For Server Distrust After: Fri Sep 01 00:00:00 2017
+CKA_NSS_SERVER_DISTRUST_AFTER MULTILINE_OCTAL
+\061\067\060\071\060\061\060\060\060\060\060\060\132
+END
CKA_NSS_EMAIL_DISTRUST_AFTER CK_BBOOL CK_FALSE
# Trust for "EE Certification Centre Root CA"
@@ -23345,3 +23390,203 @@ CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST
CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST
CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
+#
+# Certificate "Entrust Root Certification Authority - G4"
+#
+# Issuer: CN=Entrust Root Certification Authority - G4,OU="(c) 2015 Entrust, Inc. - for authorized use only",OU=See www.entrust.net/legal-terms,O="Entrust, Inc.",C=US
+# Serial Number:00:d9:b5:43:7f:af:a9:39:0f:00:00:00:00:55:65:ad:58
+# Subject: CN=Entrust Root Certification Authority - G4,OU="(c) 2015 Entrust, Inc. - for authorized use only",OU=See www.entrust.net/legal-terms,O="Entrust, Inc.",C=US
+# Not Valid Before: Wed May 27 11:11:16 2015
+# Not Valid After : Sun Dec 27 11:41:16 2037
+# Fingerprint (SHA-256): DB:35:17:D1:F6:73:2A:2D:5A:B9:7C:53:3E:C7:07:79:EE:32:70:A6:2F:B4:AC:42:38:37:24:60:E6:F0:1E:88
+# Fingerprint (SHA1): 14:88:4E:86:26:37:B0:26:AF:59:62:5C:40:77:EC:35:29:BA:96:01
+CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE
+CKA_TOKEN CK_BBOOL CK_TRUE
+CKA_PRIVATE CK_BBOOL CK_FALSE
+CKA_MODIFIABLE CK_BBOOL CK_FALSE
+CKA_LABEL UTF8 "Entrust Root Certification Authority - G4"
+CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509
+CKA_SUBJECT MULTILINE_OCTAL
+\060\201\276\061\013\060\011\006\003\125\004\006\023\002\125\123
+\061\026\060\024\006\003\125\004\012\023\015\105\156\164\162\165
+\163\164\054\040\111\156\143\056\061\050\060\046\006\003\125\004
+\013\023\037\123\145\145\040\167\167\167\056\145\156\164\162\165
+\163\164\056\156\145\164\057\154\145\147\141\154\055\164\145\162
+\155\163\061\071\060\067\006\003\125\004\013\023\060\050\143\051
+\040\062\060\061\065\040\105\156\164\162\165\163\164\054\040\111
+\156\143\056\040\055\040\146\157\162\040\141\165\164\150\157\162
+\151\172\145\144\040\165\163\145\040\157\156\154\171\061\062\060
+\060\006\003\125\004\003\023\051\105\156\164\162\165\163\164\040
+\122\157\157\164\040\103\145\162\164\151\146\151\143\141\164\151
+\157\156\040\101\165\164\150\157\162\151\164\171\040\055\040\107
+\064
+END
+CKA_ID UTF8 "0"
+CKA_ISSUER MULTILINE_OCTAL
+\060\201\276\061\013\060\011\006\003\125\004\006\023\002\125\123
+\061\026\060\024\006\003\125\004\012\023\015\105\156\164\162\165
+\163\164\054\040\111\156\143\056\061\050\060\046\006\003\125\004
+\013\023\037\123\145\145\040\167\167\167\056\145\156\164\162\165
+\163\164\056\156\145\164\057\154\145\147\141\154\055\164\145\162
+\155\163\061\071\060\067\006\003\125\004\013\023\060\050\143\051
+\040\062\060\061\065\040\105\156\164\162\165\163\164\054\040\111
+\156\143\056\040\055\040\146\157\162\040\141\165\164\150\157\162
+\151\172\145\144\040\165\163\145\040\157\156\154\171\061\062\060
+\060\006\003\125\004\003\023\051\105\156\164\162\165\163\164\040
+\122\157\157\164\040\103\145\162\164\151\146\151\143\141\164\151
+\157\156\040\101\165\164\150\157\162\151\164\171\040\055\040\107
+\064
+END
+CKA_SERIAL_NUMBER MULTILINE_OCTAL
+\002\021\000\331\265\103\177\257\251\071\017\000\000\000\000\125
+\145\255\130
+END
+CKA_VALUE MULTILINE_OCTAL
+\060\202\006\113\060\202\004\063\240\003\002\001\002\002\021\000
+\331\265\103\177\257\251\071\017\000\000\000\000\125\145\255\130
+\060\015\006\011\052\206\110\206\367\015\001\001\013\005\000\060
+\201\276\061\013\060\011\006\003\125\004\006\023\002\125\123\061
+\026\060\024\006\003\125\004\012\023\015\105\156\164\162\165\163
+\164\054\040\111\156\143\056\061\050\060\046\006\003\125\004\013
+\023\037\123\145\145\040\167\167\167\056\145\156\164\162\165\163
+\164\056\156\145\164\057\154\145\147\141\154\055\164\145\162\155
+\163\061\071\060\067\006\003\125\004\013\023\060\050\143\051\040
+\062\060\061\065\040\105\156\164\162\165\163\164\054\040\111\156
+\143\056\040\055\040\146\157\162\040\141\165\164\150\157\162\151
+\172\145\144\040\165\163\145\040\157\156\154\171\061\062\060\060
+\006\003\125\004\003\023\051\105\156\164\162\165\163\164\040\122
+\157\157\164\040\103\145\162\164\151\146\151\143\141\164\151\157
+\156\040\101\165\164\150\157\162\151\164\171\040\055\040\107\064
+\060\036\027\015\061\065\060\065\062\067\061\061\061\061\061\066
+\132\027\015\063\067\061\062\062\067\061\061\064\061\061\066\132
+\060\201\276\061\013\060\011\006\003\125\004\006\023\002\125\123
+\061\026\060\024\006\003\125\004\012\023\015\105\156\164\162\165
+\163\164\054\040\111\156\143\056\061\050\060\046\006\003\125\004
+\013\023\037\123\145\145\040\167\167\167\056\145\156\164\162\165
+\163\164\056\156\145\164\057\154\145\147\141\154\055\164\145\162
+\155\163\061\071\060\067\006\003\125\004\013\023\060\050\143\051
+\040\062\060\061\065\040\105\156\164\162\165\163\164\054\040\111
+\156\143\056\040\055\040\146\157\162\040\141\165\164\150\157\162
+\151\172\145\144\040\165\163\145\040\157\156\154\171\061\062\060
+\060\006\003\125\004\003\023\051\105\156\164\162\165\163\164\040
+\122\157\157\164\040\103\145\162\164\151\146\151\143\141\164\151
+\157\156\040\101\165\164\150\157\162\151\164\171\040\055\040\107
+\064\060\202\002\042\060\015\006\011\052\206\110\206\367\015\001
+\001\001\005\000\003\202\002\017\000\060\202\002\012\002\202\002
+\001\000\261\354\054\102\356\342\321\060\377\245\222\107\342\055
+\303\272\144\227\155\312\367\015\265\131\301\263\313\250\150\031
+\330\257\204\155\060\160\135\176\363\056\322\123\231\341\376\037
+\136\331\110\257\135\023\215\333\377\143\063\115\323\000\002\274
+\304\370\321\006\010\224\171\130\212\025\336\051\263\375\375\304
+\117\350\252\342\240\073\171\315\277\153\103\062\335\331\164\020
+\271\367\364\150\324\273\320\207\325\252\113\212\052\157\052\004
+\265\262\246\307\240\172\346\110\253\322\321\131\314\326\176\043
+\346\227\154\360\102\345\334\121\113\025\101\355\111\112\311\336
+\020\227\326\166\301\357\245\265\066\024\227\065\330\170\042\065
+\122\357\103\275\333\047\333\141\126\202\064\334\313\210\140\014
+\013\132\345\054\001\306\124\257\327\252\301\020\173\322\005\132
+\270\100\236\206\247\303\220\206\002\126\122\011\172\234\322\047
+\202\123\112\145\122\152\365\074\347\250\362\234\257\213\275\323
+\016\324\324\136\156\207\236\152\075\105\035\321\135\033\364\351
+\012\254\140\231\373\211\264\377\230\054\317\174\035\351\002\252
+\004\232\036\270\334\210\156\045\263\154\146\367\074\220\363\127
+\301\263\057\365\155\362\373\312\241\370\051\235\106\213\263\152
+\366\346\147\007\276\054\147\012\052\037\132\262\076\127\304\323
+\041\041\143\145\122\221\033\261\231\216\171\176\346\353\215\000
+\331\132\252\352\163\350\244\202\002\107\226\376\133\216\124\141
+\243\353\057\113\060\260\213\043\165\162\174\041\074\310\366\361
+\164\324\034\173\243\005\125\356\273\115\073\062\276\232\167\146
+\236\254\151\220\042\007\037\141\072\226\276\345\232\117\314\005
+\074\050\131\323\301\014\124\250\131\141\275\310\162\114\350\334
+\237\207\177\275\234\110\066\136\225\243\016\271\070\044\125\374
+\165\146\353\002\343\010\064\051\112\306\343\053\057\063\240\332
+\243\206\245\022\227\375\200\053\332\024\102\343\222\275\076\362
+\135\136\147\164\056\034\210\107\051\064\137\342\062\250\234\045
+\067\214\272\230\000\227\213\111\226\036\375\045\212\254\334\332
+\330\135\164\156\146\260\377\104\337\241\030\306\276\110\057\067
+\224\170\370\225\112\077\177\023\136\135\131\375\164\206\103\143
+\163\111\002\003\001\000\001\243\102\060\100\060\017\006\003\125
+\035\023\001\001\377\004\005\060\003\001\001\377\060\016\006\003
+\125\035\017\001\001\377\004\004\003\002\001\006\060\035\006\003
+\125\035\016\004\026\004\024\237\070\304\126\043\303\071\350\240
+\161\154\350\124\114\344\350\072\261\277\147\060\015\006\011\052
+\206\110\206\367\015\001\001\013\005\000\003\202\002\001\000\022
+\345\102\246\173\213\017\014\344\106\245\266\140\100\207\214\045
+\176\255\270\150\056\133\306\100\166\074\003\370\311\131\364\363
+\253\142\316\020\215\264\132\144\214\150\300\260\162\103\064\322
+\033\013\366\054\123\322\312\220\113\206\146\374\252\203\042\364
+\213\032\157\046\110\254\166\167\010\277\305\230\134\364\046\211
+\236\173\303\271\144\062\001\177\323\303\335\130\155\354\261\253
+\204\125\164\167\204\004\047\122\153\206\114\316\335\271\145\377
+\326\306\136\237\232\020\231\113\165\152\376\152\351\227\040\344
+\344\166\172\306\320\044\252\220\315\040\220\272\107\144\373\177
+\007\263\123\170\265\012\142\362\163\103\316\101\053\201\152\056
+\205\026\224\123\324\153\137\162\042\253\121\055\102\325\000\234
+\231\277\336\273\224\073\127\375\232\365\206\313\126\073\133\210
+\001\345\174\050\113\003\371\111\203\174\262\177\174\343\355\216
+\241\177\140\123\216\125\235\120\064\022\017\267\227\173\154\207
+\112\104\347\365\155\354\200\067\360\130\031\156\112\150\166\360
+\037\222\344\352\265\222\323\141\121\020\013\255\247\331\137\307
+\137\334\037\243\134\214\241\176\233\267\236\323\126\157\146\136
+\007\226\040\355\013\164\373\146\116\213\021\025\351\201\111\176
+\157\260\324\120\177\042\327\137\145\002\015\246\364\205\036\330
+\256\006\113\112\247\322\061\146\302\370\316\345\010\246\244\002
+\226\104\150\127\304\325\063\317\031\057\024\304\224\034\173\244
+\331\360\237\016\261\200\342\321\236\021\144\251\210\021\072\166
+\202\345\142\302\200\330\244\203\355\223\357\174\057\220\260\062
+\114\226\025\150\110\122\324\231\010\300\044\350\034\343\263\245
+\041\016\222\300\220\037\317\040\137\312\073\070\307\267\155\072
+\363\346\104\270\016\061\153\210\216\160\353\234\027\122\250\101
+\224\056\207\266\347\246\022\305\165\337\133\300\012\156\173\244
+\344\136\206\371\066\224\337\167\303\351\015\300\071\361\171\273
+\106\216\253\103\131\047\267\040\273\043\351\126\100\041\354\061
+\075\145\252\103\362\075\337\160\104\341\272\115\046\020\073\230
+\237\363\310\216\033\070\126\041\152\121\223\323\221\312\106\332
+\211\267\075\123\203\054\010\037\213\217\123\335\377\254\037
+END
+CKA_NSS_MOZILLA_CA_POLICY CK_BBOOL CK_TRUE
+
+# Trust for "Entrust Root Certification Authority - G4"
+# Issuer: CN=Entrust Root Certification Authority - G4,OU="(c) 2015 Entrust, Inc. - for authorized use only",OU=See www.entrust.net/legal-terms,O="Entrust, Inc.",C=US
+# Serial Number:00:d9:b5:43:7f:af:a9:39:0f:00:00:00:00:55:65:ad:58
+# Subject: CN=Entrust Root Certification Authority - G4,OU="(c) 2015 Entrust, Inc. - for authorized use only",OU=See www.entrust.net/legal-terms,O="Entrust, Inc.",C=US
+# Not Valid Before: Wed May 27 11:11:16 2015
+# Not Valid After : Sun Dec 27 11:41:16 2037
+# Fingerprint (SHA-256): DB:35:17:D1:F6:73:2A:2D:5A:B9:7C:53:3E:C7:07:79:EE:32:70:A6:2F:B4:AC:42:38:37:24:60:E6:F0:1E:88
+# Fingerprint (SHA1): 14:88:4E:86:26:37:B0:26:AF:59:62:5C:40:77:EC:35:29:BA:96:01
+CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST
+CKA_TOKEN CK_BBOOL CK_TRUE
+CKA_PRIVATE CK_BBOOL CK_FALSE
+CKA_MODIFIABLE CK_BBOOL CK_FALSE
+CKA_LABEL UTF8 "Entrust Root Certification Authority - G4"
+CKA_CERT_SHA1_HASH MULTILINE_OCTAL
+\024\210\116\206\046\067\260\046\257\131\142\134\100\167\354\065
+\051\272\226\001
+END
+CKA_CERT_MD5_HASH MULTILINE_OCTAL
+\211\123\361\203\043\267\174\216\005\361\214\161\070\116\037\210
+END
+CKA_ISSUER MULTILINE_OCTAL
+\060\201\276\061\013\060\011\006\003\125\004\006\023\002\125\123
+\061\026\060\024\006\003\125\004\012\023\015\105\156\164\162\165
+\163\164\054\040\111\156\143\056\061\050\060\046\006\003\125\004
+\013\023\037\123\145\145\040\167\167\167\056\145\156\164\162\165
+\163\164\056\156\145\164\057\154\145\147\141\154\055\164\145\162
+\155\163\061\071\060\067\006\003\125\004\013\023\060\050\143\051
+\040\062\060\061\065\040\105\156\164\162\165\163\164\054\040\111
+\156\143\056\040\055\040\146\157\162\040\141\165\164\150\157\162
+\151\172\145\144\040\165\163\145\040\157\156\154\171\061\062\060
+\060\006\003\125\004\003\023\051\105\156\164\162\165\163\164\040
+\122\157\157\164\040\103\145\162\164\151\146\151\143\141\164\151
+\157\156\040\101\165\164\150\157\162\151\164\171\040\055\040\107
+\064
+END
+CKA_SERIAL_NUMBER MULTILINE_OCTAL
+\002\021\000\331\265\103\177\257\251\071\017\000\000\000\000\125
+\145\255\130
+END
+CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST
+CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE

View File

@@ -0,0 +1,110 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Tue, 9 Jun 2020 11:23:55 -0700
Subject: win: use RtlGenRandom from advapi32.dll directly
At least two people have reported that `LoadLibrary("advapi32.dll")`
fails in some configurations.
Libuv already links against advapi32.dll so let's sidestep the issue
by linking to `RtlGenRandom()` directly instead of looking it up at
runtime.
Fixes: #2759
PR-URL: #2762
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jameson Nash <vtjnash@gmail.com>
Cherry-Pick: https://github.com/libuv/libuv/commit/335e8a6d128646e5a19d39dfc677f5a5a555f7cc
diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c
index 4bbeb3154123ddae1bf8c3dc7c684e9de05ad67d..1ba35bf56d4a6906c241a1fddca2e1ba9464909c 100644
--- a/deps/uv/src/win/util.c
+++ b/deps/uv/src/win/util.c
@@ -63,6 +63,9 @@
/* Maximum environment variable size, including the terminating null */
#define MAX_ENV_VAR_LENGTH 32767
+/* A RtlGenRandom() by any other name... */
+extern BOOLEAN NTAPI SystemFunction036(PVOID Buffer, ULONG BufferLength);
+
/* Cached copy of the process title, plus a mutex guarding it. */
static char *process_title;
static CRITICAL_SECTION process_title_lock;
@@ -1862,13 +1865,10 @@ int uv_gettimeofday(uv_timeval64_t* tv) {
}
int uv__random_rtlgenrandom(void* buf, size_t buflen) {
- if (pRtlGenRandom == NULL)
- return UV_ENOSYS;
-
if (buflen == 0)
return 0;
- if (pRtlGenRandom(buf, buflen) == FALSE)
+ if (SystemFunction036(buf, buflen) == FALSE)
return UV_EIO;
return 0;
diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c
index 85a9de8a2295ec3250f9ae41f5ef6dbe72dc2a8a..bb86ec8ceac8ba3fccd02b292aca7ddfab38e187 100644
--- a/deps/uv/src/win/winapi.c
+++ b/deps/uv/src/win/winapi.c
@@ -36,9 +36,6 @@ sNtQueryDirectoryFile pNtQueryDirectoryFile;
sNtQuerySystemInformation pNtQuerySystemInformation;
sNtQueryInformationProcess pNtQueryInformationProcess;
-/* Advapi32 function pointers */
-sRtlGenRandom pRtlGenRandom;
-
/* Kernel32 function pointers */
sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;
@@ -54,7 +51,6 @@ void uv_winapi_init(void) {
HMODULE powrprof_module;
HMODULE user32_module;
HMODULE kernel32_module;
- HMODULE advapi32_module;
ntdll_module = GetModuleHandleA("ntdll.dll");
if (ntdll_module == NULL) {
@@ -138,12 +134,4 @@ void uv_winapi_init(void) {
pSetWinEventHook = (sSetWinEventHook)
GetProcAddress(user32_module, "SetWinEventHook");
}
-
- advapi32_module = GetModuleHandleA("advapi32.dll");
- if (advapi32_module == NULL) {
- uv_fatal_error(GetLastError(), "GetModuleHandleA");
- }
-
- pRtlGenRandom =
- (sRtlGenRandom) GetProcAddress(advapi32_module, "SystemFunction036");
}
diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h
index fcc70652a9aedb72f92ce78b8ee21cea8933b905..322a212dd73c19378b7abda01c5b60a93cb8e1d5 100644
--- a/deps/uv/src/win/winapi.h
+++ b/deps/uv/src/win/winapi.h
@@ -4589,11 +4589,6 @@ typedef NTSTATUS (NTAPI *sNtQueryInformationProcess)
ULONG Length,
PULONG ReturnLength);
-/*
- * Advapi32 headers
- */
-typedef BOOLEAN (WINAPI *sRtlGenRandom)(PVOID Buffer, ULONG BufferLength);
-
/*
* Kernel32 headers
*/
@@ -4736,9 +4731,6 @@ extern sNtQueryDirectoryFile pNtQueryDirectoryFile;
extern sNtQuerySystemInformation pNtQuerySystemInformation;
extern sNtQueryInformationProcess pNtQueryInformationProcess;
-/* Advapi32 function pointers */
-extern sRtlGenRandom pRtlGenRandom;
-
/* Kernel32 function pointers */
extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;

42
script/check-symlinks.js Normal file
View File

@@ -0,0 +1,42 @@
const fs = require('fs');
const path = require('path');
const utils = require('./lib/utils');
if (process.platform !== 'darwin') {
console.log('Not checking symlinks on non-darwin platform');
process.exit(0);
}
const appPath = path.resolve(__dirname, '..', '..', 'out', utils.getOutDir(), 'Electron.app');
const visited = new Set();
const traverse = (p) => {
if (visited.has(p)) return;
visited.add(p);
if (!fs.statSync(p).isDirectory()) return;
for (const child of fs.readdirSync(p)) {
const childPath = path.resolve(p, child);
let realPath;
try {
realPath = fs.realpathSync(childPath);
} catch (err) {
if (err.path) {
console.error('Detected an invalid symlink');
console.error('Source:', childPath);
let link = fs.readlinkSync(childPath);
if (!link.startsWith('.')) {
link = `../${link}`;
}
console.error('Target:', path.resolve(childPath, link));
process.exit(1);
} else {
throw err;
}
}
traverse(realPath);
}
};
traverse(appPath);

View File

@@ -29,7 +29,6 @@ PLATFORM = {
LINUX_BINARIES = [
'electron',
'chrome-sandbox',
'crashpad_handler',
'libffmpeg.so',
'libGLESv2.so',
'libEGL.so',

View File

@@ -20,22 +20,7 @@
"async-hooks/test-signalwrap",
"async-hooks/test-statwatcher",
"async-hooks/test-timers.setInterval",
"es-module/test-cjs-esm-warn",
"es-module/test-esm-cjs-load-error-note",
"es-module/test-esm-cjs-main",
"es-module/test-esm-default-type",
"es-module/test-esm-json-cache",
"es-module/test-esm-no-extension",
"es-module/test-esm-scope-node-modules",
"es-module/test-esm-snapshot",
"es-module/test-esm-specifiers",
"es-module/test-esm-type-flag",
"message/async_error_eval_esm",
"message/async_error_sync_esm",
"message/esm_display_syntax_error",
"message/esm_display_syntax_error_import",
"message/esm_display_syntax_error_import_module",
"message/esm_display_syntax_error_module",
"message/source_map_throw_catch",
"message/source_map_throw_first_tick",
"message/source_map_throw_set_immediate",
@@ -211,7 +196,6 @@
"parallel/test-vm-sigint-existing-handler",
"parallel/test-vm-syntax-error-message",
"parallel/test-vm-timeout",
"parallel/test-warn-sigprof",
"parallel/test-whatwg-encoding-custom-textdecoder",
"parallel/test-worker-debug",
"parallel/test-worker-invalid-workerdata",
@@ -224,17 +208,8 @@
"parallel/test-worker-stdio",
"parallel/test-wrap-js-stream-exceptions",
"parallel/test-zlib-unused-weak",
"pseudo-tty/console_colors",
"pseudo-tty/ref_keeps_node_running",
"pseudo-tty/test-async-wrap-getasyncid-tty",
"pseudo-tty/test-fatal-error",
"pseudo-tty/test-handle-wrap-isrefed-tty",
"pseudo-tty/test-set-raw-mode-reset",
"pseudo-tty/test-set-raw-mode-reset-process-exit",
"pseudo-tty/test-set-raw-mode-reset-signal",
"pseudo-tty/test-tty-color-support",
"pseudo-tty/test-tty-window-size",
"pseudo-tty/test-tty-wrap",
"report/test-report-config",
"report/test-report-getreport",
"report/test-report-signal",
@@ -260,9 +235,6 @@
"sequential/test-heap-prof",
"sequential/test-heapdump",
"sequential/test-heapdump-flag",
"sequential/test-inspector",
"sequential/test-inspector-async-call-stack-abort",
"sequential/test-inspector-console",
"sequential/test-inspector-contexts",
"sequential/test-inspector-port-zero",
"sequential/test-inspector-resource-name-to-url",
@@ -274,4 +246,4 @@
"sequential/test-tls-connect",
"sequential/test-vm-timeout-rethrow",
"wpt/test-encoding"
]
]

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