Compare commits

...

94 Commits

Author SHA1 Message Date
Electron Bot
2bc7aaf2ef Bump v9.0.0-beta.8 2020-03-12 08:32:27 -07:00
Erick Zhao
1114954cbf fix: guard against duplicate TouchBarItem IDs (#22644) 2020-03-12 10:48:17 +09:00
trop[bot]
a76ea622b9 build: fix broken Views build (#22642)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-11 16:00:55 +09:00
trop[bot]
7ee7890fd8 test: test setPath for errors thrown (#22639)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-10 10:03:36 -07:00
trop[bot]
851ed7a6e7 fix: when building with enable_pdf_viewer = false (#22631)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-03-10 10:54:07 -04:00
loc
16c4d6e487 fix: port CL that fixes ARIA tree impl for macOS (#22421) 2020-03-10 19:53:39 +09:00
trop[bot]
56c0ba138b chore: don't delete nightly tag after draft (#22624)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-10 17:04:34 +09:00
Alexey Kuzmin
1883edd869 build: fix build without built-in spellchecker (#22610)
(cherry picked from commit 385d778a8b4e97c1cffa8f31efcf9748e82e3d94)
2020-03-10 16:59:39 +09:00
trop[bot]
9b5f2159a2 build: upload sentry src bundles to symbol S3 bucket (#22617)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-03-09 16:24:44 -07:00
Samuel Maddock
60f16eaf95 fix: disallow loading extensions in temp sessions (#22090) (#22571)
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-03-09 11:33:23 -07:00
Electron Bot
0f08c6c874 Bump v9.0.0-beta.7 2020-03-09 08:31:47 -07:00
trop[bot]
e227578ae0 optional typically sync callback for WebFrame#executeJavaScript* (#22501)
Co-authored-by: bughit <bughit@users.noreply.github.com>
2020-03-06 19:07:46 +09:00
trop[bot]
f413cda758 feat(extensions): add chrome.tabs.connect API (#22549)
* feat(extensions): add chrome.tabs.connect API

* test(extensions): verify that chrome.tabs.connect port communication works

Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2020-03-06 19:06:40 +09:00
trop[bot]
c41b543842 feat: add events for spellcheck dictionary downloads (#22556)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-03-06 19:04:52 +09:00
trop[bot]
7bb430dc44 docs: clean up dark mode related docs (#22562)
* docs: clean up systemPreferences.effectiveAppearance text

* Grammar fixes
* Add links for Electron Packager & Electron Forge
* Update Packager API links, given https://github.com/electron/electron-packager/pull/1131

* docs: clean up Dark Mode guide

* Grammar fixes
* Add links for Electron Packager & Electron Forge

* docs: adjust based on Electron 8 using 10.14 SDK

Co-authored-by: Mark Lee <electronjs@lazymalevolence.com>
2020-03-06 19:04:31 +09:00
Samuel Maddock
231f5af1a1 feat(extensions): add chrome.i18n API (#22570)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-06 19:03:38 +09:00
Samuel Attard
539ca773de feat: programmatically modify traffic light positioning (#22533) (#22566)
* setter

* getter

* specs and docs

* fixup

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

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-05 16:59:00 -08:00
Samuel Attard
1fc197bedb fix: allow persistent media salts (#22386) (#22567)
* fix: allow persistent media salts

* chore: add regression test for persistent media device ids across reloads

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-05 16:58:39 -08:00
Samuel Attard
926bea232d fix: reposition traffic lights on theme change (#22560)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-05 14:02:23 -08:00
Electron Bot
db664f3433 Bump v9.0.0-beta.6 2020-03-05 07:31:44 -08:00
Cheng Zhao
9ec73a3dcf fix: destroy node platform after destroying wrappers (#22535)
Co-authored-by: Cheng Zhao <zcbenz@electronjs.org>
2020-03-05 13:07:48 +09:00
Samuel Attard
c1c1ac2b2e fix: disable contextBridge object identity caching (#22525)
* fix: disable contextBridge object identity caching

* cleanup

* chore: make non-const references raw pointers

* fix: zero-param constructors are not explicit

* refactor: use base::LinkedList

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-04 16:54:05 -08:00
trop[bot]
9c931136d0 fix: do not reposition traffic lights when fullscreened (#22509)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-04 20:08:43 +09:00
trop[bot]
f01ee72ea5 fix: properly forward properties to webview (#22511)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-04 20:08:19 +09:00
trop[bot]
f6b4c39195 fix: bail early if no printers on the network (#22519)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-04 16:19:37 +09:00
Cheng Zhao
578f59532d chore: remove unneeded header (#22520) 2020-03-04 12:31:46 +09:00
trop[bot]
dcf9e4b2dd docs: add documentation on case insensitive dictionary hosting (#22487)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-03-03 14:30:30 -08:00
Shelley Vohr
2021f25453 chore: ensure correct scopes are in place (#22479) 2020-03-03 11:30:52 +09:00
John Kleinschmidt
faee8a092d fix: revive offscreen rendering support (#22160) (#22425)
(cherry picked from commit 36f982aee2)

Co-authored-by: Andy Dill <andy@discordapp.com>
2020-03-02 20:17:48 -05:00
Erick Zhao
3d65d84193 feat: add session.removeWordFromSpellCheckerDictionary API (#22368)
* feat: add session.removeWordFromSpellCheckerDictionary API

* rebase fixup
2020-03-02 14:46:19 -08:00
Jeremy Apthorp
5e05df9f71 chore: update chromium to 82.0.4058.2 (#22198)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: loc <andy@slack-corp.com>
Co-authored-by: Robo <hop2deep@gmail.com>
2020-03-02 11:21:22 -08:00
Electron Bot
df2d03fe9b Bump v9.0.0-beta.5 2020-03-02 07:31:48 -08:00
trop[bot]
80967287ad fix: make webRequest work for CORS preflight requests (#22468)
* fix: support CORS preflight

* test: webRequest should work for CORS requests

Co-authored-by: Cheng Zhao <zcbenz@electronjs.org>
2020-03-02 20:25:28 +09:00
trop[bot]
2855f1d237 fix: do not call close on sheets themselves (#22445)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-03-02 16:50:22 +09:00
trop[bot]
5e25649e77 fix: Add ContentsView to AXChildren (#22469)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2020-03-02 16:28:38 +09:00
trop[bot]
3e90e523eb fix: add patch to set the base download URL rather than override it completely (#22385)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-28 17:00:44 -08:00
trop[bot]
c702aec1f8 fix: dictionaries download path should be in userdata (#22447)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-28 17:00:15 -08:00
Electron Bot
ede40f260e Bump v9.0.0-beta.4 2020-02-27 16:37:59 -08:00
Samuel Attard
ca53cc8380 fix: backport v8 patch for type inference issue (#22426) 2020-02-27 12:48:23 -08:00
Samuel Attard
7ec9b4e252 feat: set app.enableRendererProcessReuse to true by default (#22336) (#22401)
* feat: set app.enableRendererProcessReuse to true by default

* chore: add context aware info to breaking changes doc

* spec: fix nodeIntegration in child windows test for rendererprocessreuse

* spec: fix remote listeners in destroyed renderers spec as the error is now async

* Update api-browser-window-spec.ts

* chore: deprecate affinity

* chore: fix docs

* spec: handle tests crashing without an exist code

* spec: update tests for new rendererprocessreuse default

* spec: with renderer process re-use we get to destroy less views
2020-02-27 12:19:31 -08:00
trop[bot]
0d7e13d2a6 feat: add API for receiving logs from service workers (#22313)
* feat: add API for receiving logs from service workers

* feat: add new serviceWorkerContext APIs

* chore: add missing #include's

* refactor: rename serviceWorkerContext to serviceWorkers

* chore: clean up based on review

* chore: remove native_mate

* chore: add tests for the service worker module

* Update spec-main/api-service-workers-spec.ts

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* chore: fix linting

* chore: handle renames

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-27 11:02:31 -08:00
Electron Bot
a5c56684b9 Revert "Bump v9.0.0-beta.4"
This reverts commit 68d96459c3.
2020-02-27 10:01:45 -08:00
Electron Bot
68d96459c3 Bump v9.0.0-beta.4 2020-02-27 09:14:14 -08:00
trop[bot]
6cf4757019 docs: improve documentation on spellchecker download URL (#22402)
* docs: improve documentation on spellchecker download URL

* Update session.md

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-26 23:09:43 -08:00
trop[bot]
6e80d6fba5 fix: pass safeDialogs preference properly (#22378)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-26 13:34:42 -08:00
trop[bot]
ec07954d5d test: disable clipboard tests for WOA (#22387)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-26 18:04:32 +09:00
Electron Bot
7fd2d39f72 Bump v9.0.0-beta.3 2020-02-25 14:03:20 -08:00
trop[bot]
64880c75a3 fix: emit will-navigate for sandboxed contents (#22327)
* fix: emit will-navigate for sandboxed contents

* uncomment test

* more tests

* use ShouldFork instead of browser_handles_all_top_level_requests

* forward post data in OpenURLFromTab

* align OpenURLFromTab with chrome's version (browser_navigator.cc/LoadURLInContents)

* add tests for navigating from file: and about:blank to http:

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-25 11:11:33 +09:00
trop[bot]
cc94689db1 chore: allow custom node-spec-runner options (#22331)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-25 11:10:02 +09:00
trop[bot]
806e483049 fix(extensions): set lowest isolated world id (#22355)
* fix(extensions): set lowest isolated world id

* refactor: move world IDs into separate header file

Several files are including electron_render_frame_observer.h just for the world IDs.

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
2020-02-25 11:01:30 +09:00
Jeremy Apthorp
8129e92d2b refactor: saner blink_initialization_order.patch (#22054) (#22366) 2020-02-24 13:19:33 -08:00
trop[bot]
660706ba2c fix: disable remote layer APIs in MAS build (#22354)
* fix: add patch to disable remote layer APIs

* fix: use --disable-gpu-memory-buffer-compositor-resources for MAS build

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-24 19:29:15 +09:00
trop[bot]
2feca9d35a fix: revert {Atom => Electron}Application rename (#22325)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-24 12:29:10 +09:00
trop[bot]
3a4118703a docs: clean up protocol docs (#22308)
* docs: clean up protocol docs

* Fix capitalization

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-02-24 12:28:29 +09:00
Jeremy Apthorp
bd669f72ee feat: [extensions] support extension.getBackgroundPage (#21951) (#22177) 2020-02-21 14:33:28 -08:00
trop[bot]
1f3c3eee83 fix: typo in crash reporter constructor (#22322) 2020-02-21 17:50:32 +00:00
trop[bot]
6e84ebee8e chore: remove libcc from release not generator (#22294)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-20 10:17:41 -05:00
trop[bot]
f22376ef32 fix: add patch to route mouse event navigations through the WebContentsDelegate (#22204)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-19 13:46:15 +09:00
trop[bot]
324b49a5eb doc: remove accidental deprecation (#22264)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-02-19 13:44:45 +09:00
John Kleinschmidt
0e9727e8d5 ci: enable goma for all testing builds (#21992) (#22203)
(cherry picked from commit e7982623ec)
2020-02-18 12:03:33 -05:00
trop[bot]
44ee90e5cf fix: don't include breakpad_symbols dir in dsym.zip (#22221)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-18 11:57:33 -05:00
Electron Bot
2b9ef75d82 Bump v9.0.0-beta.2 2020-02-15 16:07:17 -08:00
John Kleinschmidt
4dc2b4d55f Revert "Bump v9.0.0-beta.2"
This reverts commit 69f77d309d.
2020-02-14 16:50:33 -05:00
Electron Bot
69f77d309d Bump v9.0.0-beta.2 2020-02-14 12:39:21 -08:00
John Kleinschmidt
9cd1744a2b Revert "Bump v9.0.0-beta.2"
This reverts commit 8b11adc6f2.
2020-02-14 15:37:16 -05:00
trop[bot]
c6e411173e build: fix release script to work with sudowoodo (#22200)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-14 15:35:10 -05:00
Electron Bot
8b11adc6f2 Bump v9.0.0-beta.2 2020-02-14 12:29:44 -08:00
trop[bot]
57ec30e459 feat: add session.listWordsFromSpellCheckerDictionary API (#22128)
* doesn't work yet but compiles.

* works

* fixup

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2020-02-14 15:26:17 -05:00
trop[bot]
c4a836f95a fix: crash on custom printing margins (#22185)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-02-14 15:40:01 +09:00
trop[bot]
9b2de2583e fix: no-arg console.log is undefined (#22171)
Co-authored-by: Shelley Vohr <codebytere@github.com>
2020-02-14 15:31:49 +09:00
Samuel Attard
7b2bfb4a0f chore: update NMV for Electron 9 (#22189) 2020-02-13 13:18:22 -08:00
Jeremy Apthorp
0e31826043 feat: enable pdf viewer 2020-02-13 10:09:29 -08:00
trop[bot]
7b3c073b3e fix RTL bug when used with traffic light repositioning (#22163)
Co-authored-by: tonyfwoo <55114329+tonyfwoo@users.noreply.github.com>
2020-02-12 11:29:03 -06:00
trop[bot]
2dc900b95d ci: Speed up release (#22159) 2020-02-12 07:27:21 +00:00
trop[bot]
f41423501a fix: make webRequest work with WebSocket (#22133)
* fix: web request support proxying websocket

* fix: make tests work

* chore: do not use api:: code outside api/ folder

* chore: do not create proxy when no listener

* test: use separate session to avoid conflicts

* chore: address review

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-11 15:56:00 -05:00
trop[bot]
07d9728b63 build: fix spellchecker deps (#22155)
Co-authored-by: Alexey Kuzmin <alex.s.kuzmin@gmail.com>
2020-02-11 15:45:46 -05:00
trop[bot]
d4c90e80a5 refactor: use NSVisualEffectMaterial* constants directly (#22148) 2020-02-11 17:48:44 +00:00
trop[bot]
91141028e6 chore: print more logging for failed tests (#22116)
Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-02-11 15:07:54 +09:00
Electron Bot
9d69d4b9ef Bump v9.0.0-beta.1 2020-02-10 06:50:08 -08:00
Electron Bot
d57d5c544e Revert "Bump v9.0.0-beta.2"
This reverts commit 74d4dab157.
2020-02-10 06:38:44 -08:00
Electron Bot
74d4dab157 Bump v9.0.0-beta.2 2020-02-10 04:32:41 -08:00
trop[bot]
94246dabe3 ci: fix build failure on doc only changes (#22089)
* ci: fix build failure on doc only changes

* ci: fix doc-only check when CI fires on branch before PR is created

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-10 17:09:35 +09:00
trop[bot]
4fe91e56ac chore: remove debugging log (#22095)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-10 17:05:34 +09:00
trop[bot]
0d7440d676 build: preserve timestamps when stripping files (#22098)
* build: preserve timestamps when stripping files

Resolves an issue where the binaries in mksnapshot.zip were not getting stripped.

* Add missing comma

* Update script/strip-binaries.py

Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>

* Don't try to run strip on macOS

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-02-10 17:05:04 +09:00
trop[bot]
60edd2d3b1 build: try using newer version of xcode/macOS sdk (#22106)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-10 16:48:51 +09:00
trop[bot]
d4d06660f3 fix: flash plugin (#22111)
* fix: flash plugin

Fixes https://github.com/electron/electron/issues/20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
2020-02-10 10:50:56 +09:00
trop[bot]
8d8f15121b fix: use a WeakPtr so we do not UAF the store in FunctionLifetimeMonitor (#22113)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-02-10 10:47:23 +09:00
trop[bot]
1f8cb5144d build: copy chromedriver to correct location (#22092)
* build: copy chromedriver to correct location

* build: try to free up disk space for macos releases

* get verbose mode working on strip-binaries

* Only use separate chromedriver build arm/arm64

* fixup circleci config

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-07 16:49:04 -05:00
trop[bot]
667ee359a1 test: get native unit tests running (#22086)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-07 10:53:09 -05:00
trop[bot]
4b009159ba docs: clarify requirements for GOOGLE_API_KEY (#22071)
* docs: clarify requirements for GOOGLE_API_KEY

* Update docs/api/environment-variables.md

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

* Update docs/api/environment-variables.md

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

* Update docs/api/environment-variables.md

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

* update

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-02-06 15:25:28 -05:00
John Kleinschmidt
89f66bd00c Revert "Bump v9.0.0-beta.1"
This reverts commit 68346fec55.
2020-02-06 15:19:27 -05:00
trop[bot]
2d542c6028 build: copy chromedriver to proper directory for release (#22073)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-02-06 15:07:46 -05:00
Electron Bot
68346fec55 Bump v9.0.0-beta.1 2020-02-05 13:46:21 -08:00
Samuel Attard
23f32ca9f3 chore: prepare for 9.0.0-beta.1 2020-02-05 13:44:23 -08:00
259 changed files with 7747 additions and 2418 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -629,8 +629,6 @@ source_set("electron_lib") {
deps += [ "//components/printing/common:mojo_interfaces" ]
}
deps += [ "shell/common/extensions/api:extensions_features" ]
deps += [ "shell/common/extensions/api" ]
deps += [
"//components/pref_registry",
"//components/user_prefs",
@@ -642,12 +640,22 @@ source_set("electron_lib") {
]
if (enable_electron_extensions) {
sources += filenames.lib_sources_extensions
deps += [
"shell/browser/extensions/api:api_registration",
"shell/common/extensions/api",
"shell/common/extensions/api:extensions_features",
"//chrome/browser/resources:component_extension_resources",
"//components/zoom",
]
}
if (enable_pdf) {
# Printing depends on some //pdf code, so it needs to be built even if the
# pdf viewer isn't enabled.
deps += [ "//pdf" ]
deps += [
"//pdf",
"//pdf:features",
]
}
if (enable_pdf_viewer) {
deps += [
@@ -783,6 +791,7 @@ if (is_mac) {
include_dirs = [ "." ]
sources = filenames.framework_sources
libs = []
if (enable_osr) {
libs += [ "IOSurface.framework" ]

2
DEPS
View File

@@ -12,7 +12,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'2102ff0fb03469ca5ff317a168e6ad99ca0f23f1',
'82.0.4058.2',
'node_version':
'v12.14.1',
'nan_version':

View File

@@ -1 +1 @@
9.0.0-nightly.20200205
9.0.0-beta.8

View File

@@ -118,19 +118,29 @@ build_script:
}
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
.\src\electron\script\start-goma.ps1 -gomaDir "$pwd\src\electron\external_binaries\goma"
if ($env:GN_CONFIG -ne 'release') {
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
git clone https://github.com/electron/build-tools.git
cd build-tools
npm install
mkdir third_party
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
cd ..
.\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
}
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- if DEFINED RAW_GOMA_AUTH (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"//electron/build/args/goma.gn\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
- if DEFINED GN_GOMA_FILE (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron:manifests
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED RAW_GOMA_AUTH (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
@@ -140,7 +150,7 @@ build_script:
- 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
- if DEFINED RAW_GOMA_AUTH (python electron\external_binaries\goma\goma_ctl.py stat)
- if "%GN_CONFIG%"=="testing" ( python %LOCAL_GOMA_DIR%\goma_ctl.py stat )
- python electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/dist.zip

View File

@@ -2,7 +2,7 @@ is_electron_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
node_module_version = 76
node_module_version = 80
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0
@@ -21,7 +21,6 @@ dawn_enable_vulkan_validation_layers = false
is_cfi = false
# TODO: disabled due to crashes. re-enable.
enable_osr = false
enable_osr = true
enable_electron_extensions = true

View File

@@ -14,7 +14,7 @@ declare_args() {
enable_view_api = false
enable_pdf_viewer = false
enable_pdf_viewer = true
enable_tts = true

View File

@@ -68,7 +68,6 @@ static_library("chrome") {
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/browser/ssl:proto",
"//components/feature_engagement:buildflags",
]
@@ -233,6 +232,12 @@ static_library("chrome") {
if (enable_electron_extensions) {
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",

View File

@@ -703,34 +703,34 @@ Clears the recent documents list.
### `app.setAsDefaultProtocolClient(protocol[, path, args])`
* `protocol` String - The name of your protocol, without `://`. If you want your
app to handle `electron://` links, call this method with `electron` as the
parameter.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Defaults to an empty array
* `protocol` String - The name of your protocol, without `://`. For example,
if you want your app to handle `electron://` links, call this method with
`electron` as the parameter.
* `path` String (optional) _Windows_ - The path to the Electron executable.
Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Arguments passed to the executable.
Defaults to an empty array
Returns `Boolean` - Whether the call succeeded.
This method sets the current executable as the default handler for a protocol
(aka URI scheme). It allows you to integrate your app deeper into the operating
system. Once registered, all links with `your-protocol://` will be opened with
the current executable. The whole link, including protocol, will be passed to
your application as a parameter.
On Windows, you can provide optional parameters path, the path to your executable,
and args, an array of arguments to be passed to your executable when it launches.
Sets the current executable as the default handler for a protocol (aka URI
scheme). It allows you to integrate your app deeper into the operating system.
Once registered, all links with `your-protocol://` will be opened with the
current executable. The whole link, including protocol, will be passed to your
application as a parameter.
**Note:** On macOS, you can only register protocols that have been added to
your app's `info.plist`, which can not be modified at runtime. You can however
change the file with a simple text editor or script during build time.
Please refer to [Apple's documentation][CFBundleURLTypes] for details.
your app's `info.plist`, which cannot be modified at runtime. However, you can
change the file during build time via [Electron Forge][electron-forge],
[Electron Packager][electron-packager], or by editing `info.plist` with a text
editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
**Note:** In a Windows Store environment (when packaged as an `appx`) this API
will return `true` for all calls but the registry key it sets won't be accessible
by other applications. In order to register your Windows Store application
as a default protocol handler you must [declare the protocol in your manifest](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
@@ -749,10 +749,8 @@ protocol (aka URI scheme). If so, it will remove the app as the default handler.
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
* `args` String[] (optional) _Windows_ - Defaults to an empty array
Returns `Boolean`
This method checks if the current executable is the default handler for a protocol
(aka URI scheme). If so, it will return true. Otherwise, it will return false.
Returns `Boolean` - Whether the current executable is the default handler for a
protocol (aka URI scheme).
**Note:** On macOS, you can use this method to check if the app has been
registered as the default protocol handler for a protocol. You can also verify
@@ -760,7 +758,7 @@ this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
macOS machine. Please refer to
[Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.
### `app.getApplicationNameForProtocol(url)`
@@ -1327,6 +1325,8 @@ A `Boolean` property that returns `true` if the app is packaged, `false` otherw
[dock-menu]:https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/electron-packager
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme
[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html

View File

@@ -289,7 +289,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
between the web pages even when you specified different values for them,
including but not limited to `preload`, `sandbox` and `nodeIntegration`.
So it is suggested to use exact same `webPreferences` for web pages with
the same `affinity`. _This property is experimental_
the same `affinity`. _Deprecated_
* `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents
`300%`. Default is `1.0`.
* `javascript` Boolean (optional) - Enables JavaScript support. Default is `true`.
@@ -1748,6 +1748,17 @@ will remove the vibrancy effect on the window.
Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
deprecated and will be removed in an upcoming version of macOS.
#### `win.setTrafficLightPosition(position)` _macOS_
* `position` [Point](structures/point.md)
Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`.
#### `win.getTrafficLightPosition()` _macOS_
Returns `Point` - The current position for the traffic light buttons. Can only be used with `titleBarStyle`
set to `hidden`.
#### `win.setTouchBar(touchBar)` _macOS_ _Experimental_
* `touchBar` TouchBar | null

View File

@@ -53,16 +53,23 @@ Unsupported options are:
### `GOOGLE_API_KEY`
You can provide an API key for making requests to Google's geocoding webservice. To do this, place the following code in your main process
file, before opening any browser windows that will make geocoding requests:
Geolocation support in Electron requires the use of Google Cloud Platform's
geolocation webservice. To enable this feature, acquire a
[Google API key](https://developers.google.com/maps/documentation/geolocation/get-api-key)
and place the following code in your main process file, before opening any
browser windows that will make geolocation requests:
```javascript
process.env.GOOGLE_API_KEY = 'YOUR_KEY_HERE'
```
For instructions on how to acquire a Google API key, visit [this page](https://developers.google.com/maps/documentation/javascript/get-api-key).
By default, a newly generated Google API key may not be allowed to make
geocoding requests. To enable geocoding requests, visit [this page](https://developers.google.com/maps/documentation/geocoding/get-api-key).
By default, a newly generated Google API key may not be allowed to make geolocation requests.
To enable the geolocation webservice for your project, enable it through the
[API library](https://console.cloud.google.com/apis/library).
N.B. You will need to add a
[Billing Account](https://cloud.google.com/billing/docs/how-to/payment-methods#add_a_payment_method)
to the project associated to the API key for the geolocation webservice to work.
### `ELECTRON_NO_ASAR`

View File

@@ -0,0 +1,62 @@
## Class: ServiceWorkers
> Query and receive events from a sessions active service workers.
Process: [Main](../glossary.md#main-process)
Instances of the `ServiceWorkers` class are accessed by using `serviceWorkers` property of
a `Session`.
For example:
```javascript
const { session } = require('electron')
// Get all service workers.
console.log(session.defaultSession.serviceWorkers.getAllRunning())
// Handle logs and get service worker info
session.defaultSession.serviceWorkers.on('console-message', (event, messageDetails) => {
console.log(
'Got service worker message',
messageDetails,
'from',
session.defaultSession.serviceWorkers.getFromVersionID(messageDetails.versionId)
)
})
```
### Instance Events
The following events are available on instances of `ServiceWorkers`:
#### Event: 'console-message'
Returns:
* `event` Event
* `messageDetails` Object - Information about the console message
* `message` String - The actual console message
* `versionId` Number - The version ID of the service worker that sent the log message
* `source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
* `sourceUrl` String - The URL the message came from
* `lineNumber` Number - The line number of the source that triggered this console message
Emitted when a service worker logs something to the console.
### Instance Methods
The following methods are available on instances of `ServiceWorkers`:
#### `serviceWorkers.getAllRunning()`
Returns `Record<Number, ServiceWorkerInfo>` - A [ServiceWorkerInfo](structures/service-worker-info.md) object where the keys are the service worker version ID and the values are the information about that service worker.
#### `serviceWorkers.getFromVersionID(versionId)`
* `versionId` Number
Returns [`ServiceWorkerInfo`](structures/service-worker-info.md) - Information about this service worker
If the service worker does not exist or is not running this method will throw an exception.

View File

@@ -105,6 +105,45 @@ Returns:
Emitted when a render process requests preconnection to a URL, generally due to
a [resource hint](https://w3c.github.io/resource-hints/).
#### Event: 'spellcheck-dictionary-initialized'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file has been successfully initialized. This
occurs after the file has been downloaded.
#### Event: 'spellcheck-dictionary-download-begin'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file starts downloading
#### Event: 'spellcheck-dictionary-download-success'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file has been successfully downloaded
#### Event: 'spellcheck-dictionary-download-failure'
Returns:
* `event` Event
* `languageCode` String - The language code of the dictionary file
Emitted when a hunspell dictionary file download fails. For details
on the failure you should collect a netlog and inspect the download
request.
### Instance Methods
The following methods are available on instances of `Session`:
@@ -483,10 +522,20 @@ setting with the current OS locale. This setting is persisted across restarts.
By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this
behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell
dictionaries. We publish a `hunspell_dictionaries.zip` file with each release which contains the files you need
to host here.
to host here, the file server must be **case insensitive** you must upload each file twice, once with the case it
has in the ZIP file and once with the filename as all lower case.
If the files present in `hunspell_dictionaries.zip` are available at `https://example.com/dictionaries/language-code.bdic`
then you should call this api with `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`. Please
note the trailing slash. The URL to the dictionaries is formed as `${url}${filename}`.
**Note:** On macOS the OS spellchecker is used and therefore we do not download any dictionary files. This API is a no-op on macOS.
#### `ses.listWordsInSpellCheckerDictionary()`
Returns `Promise<String[]>` - An array of all words in app's custom dictionary.
Resolves when the full dictionary is loaded from disk.
#### `ses.addWordToSpellCheckerDictionary(word)`
* `word` String - The word you want to add to the dictionary
@@ -495,6 +544,14 @@ Returns `Boolean` - Whether the word was successfully written to the custom dict
**Note:** On macOS and Windows 10 this word will be written to the OS custom dictionary as well
#### `ses.removeWordFromSpellCheckerDictionary(word)`
* `word` String - The word you want to remove from the dictionary
Returns `Boolean` - Whether the word was successfully removed from the custom dictionary.
**Note:** On macOS and Windows 10 this word will be removed from the OS custom dictionary as well
#### `ses.loadExtension(path)`
* `path` String - Path to a directory containing an unpacked Chrome extension
@@ -567,6 +624,10 @@ code to the `setSpellCheckerLanaguages` API that isn't in this array will result
A [`Cookies`](cookies.md) object for this session.
#### `ses.serviceWorkers` _Readonly_
A [`ServiceWorkers`](service-workers.md) object for this session.
#### `ses.webRequest` _Readonly_
A [`WebRequest`](web-request.md) object for this session.

View File

@@ -0,0 +1,5 @@
# ServiceWorkerInfo Object
* `scriptUrl` String - The full URL to the script that this service worker runs
* `scope` String - The base URL that this service worker is active for.
* `renderProcessId` Number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`.

View File

@@ -369,14 +369,6 @@ Returns `String` - Can be `dark`, `light` or `unknown`.
Gets the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
Please note that until Electron is built targeting the 10.14 SDK, your application's
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
the interim in order for your application to inherit the OS preference you must set the
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
for more details.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.getAppLevelAppearance()` _macOS_ _Deprecated_
@@ -404,8 +396,6 @@ Returns `Boolean` - whether or not this device has the ability to use Touch ID.
**NOTE:** This API will return `false` on macOS systems older than Sierra 10.12.2.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.promptTouchID(reason)` _macOS_
* `reason` String - The reason you are asking for Touch ID authentication
@@ -480,11 +470,3 @@ A `String` property that can be `dark`, `light` or `unknown`.
Returns the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
Please note that until Electron is built targeting the 10.14 SDK, your application's
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
the interim in order for your application to inherit the OS preference you must set the
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
for more details.

View File

@@ -1286,7 +1286,7 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`.
* `callback` Function (optional)
* `success` Boolean - Indicates success of the print call.
* `failureReason` String - Called back if the print fails; can be `cancelled` or `failed`.
* `failureReason` String - Error description called back if the print fails.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings for printing.

View File

@@ -122,13 +122,20 @@ by its key, which is returned from `webFrame.insertCSS(css)`.
Inserts `text` to the focused element.
### `webFrame.executeJavaScript(code[, userGesture])`
### `webFrame.executeJavaScript(code[, userGesture, callback])`
* `code` String
* `userGesture` Boolean (optional) - Default is `false`.
* `callback` Function (optional) - Called after script has been executed. Unless
the frame is suspended (e.g. showing a modal alert), execution will be
synchronous and the callback will be invoked before the method returns. For
compatibility with an older version of this method, the error parameter is
second.
* `result` Any
* `error` Error
Returns `Promise<any>` - A promise that resolves with the result of the executed code
or is rejected if the result of the code is a rejected promise.
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.
Evaluates `code` in page.
@@ -136,14 +143,24 @@ In the browser window some HTML APIs like `requestFullScreen` can only be
invoked by a gesture from the user. Setting `userGesture` to `true` will remove
this limitation.
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])`
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture, callback])`
* `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. You can provide any integer here.
* `worldId` Integer - The ID of the world to run the javascript
in, `0` is the default main world (where content runs), `999` is the
world used by Electron's `contextIsolation` feature. Accepts values
in the range 1..536870911.
* `scripts` [WebSource[]](structures/web-source.md)
* `userGesture` Boolean (optional) - Default is `false`.
* `callback` Function (optional) - Called after script has been executed. Unless
the frame is suspended (e.g. showing a modal alert), execution will be
synchronous and the callback will be invoked before the method returns. For
compatibility with an older version of this method, the error parameter is
second.
* `result` Any
* `error` Error
Returns `Promise<any>` - A promise that resolves with the result of the executed code
or is rejected if the result of the code is a rejected promise.
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.
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.

View File

@@ -146,6 +146,7 @@ response are visible by the time this listener is fired.
* `timestamp` Double
* `statusLine` String
* `statusCode` Integer
* `requestHeaders` Record<string, string>
* `responseHeaders` Record<string, string[]> (optional)
* `callback` Function
* `headersReceivedResponse` Object
@@ -228,6 +229,7 @@ redirect is about to occur.
* `fromCache` Boolean
* `statusCode` Integer
* `statusLine` String
* `error` String
The `listener` will be called with `listener(details)` when a request is
completed.

View File

@@ -1,29 +1,40 @@
# Mojave Dark Mode
# Supporting macOS Dark Mode
In macOS 10.14 Mojave, Apple introduced a new [system-wide dark mode](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/)
for all macOS computers. If your app does have a dark mode, you can make your Electron app
follow the system-wide dark mode setting using [the nativeTheme api](../api/native-theme.md).
for all macOS computers. If your Electron app has a dark mode, you can make it follow the
system-wide dark mode setting using [the `nativeTheme` api](../api/native-theme.md).
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order
for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on Catalina you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your `Info.plist` file or be on Electron `>=7.0.0`.
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers.
In order for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on
Catalina, you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your
`Info.plist` file, or be on Electron `>=7.0.0`. Both [Electron Packager][electron-packager] and
[Electron Forge][electron-forge] have a [`darwinDarkModeSupport` option][packager-darwindarkmode-api]
to automate the `Info.plist` changes during app build time.
## Automatically updating the native interfaces
"Native Interfaces" include the file picker, window border, dialogs, context menus and more; basically anything where
the UI comes from macOS and not your app. The default behavior as of Electron 7.0.0 is to opt in to this automatic
theming from the OS. If you wish to opt out you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file
to `true`. Please note that once Electron starts building against the 10.14 SDK it will not be possible for you to opt
out of this theming.
"Native Interfaces" include the file picker, window border, dialogs, context menus and more; basically,
anything where the UI comes from macOS and not your app. As of Electron 7.0.0, the default behavior
is to opt in to this automatic theming from the OS. If you wish to opt out and are using Electron
&gt; 8.0.0, you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file to `true`.
Please note that Electron 8.0.0 and above will not let your opt out of this theming, due to the use
of the macOS 10.14 SDK.
## Automatically updating your own interfaces
If your app has its own dark mode you should toggle it on and off in sync with the system's dark mode setting. You can do
this by listening for the theme updated event on Electron's `nativeTheme` module. E.g.
If your app has its own dark mode, you should toggle it on and off in sync with the system's dark
mode setting. You can do this by listening for the theme updated event on Electron's `nativeTheme` module.
```js
For example:
```javascript
const { nativeTheme } = require('electron')
nativeTheme.on('updated', function theThemeHasChanged () {
updateMyAppTheme(nativeTheme.shouldUseDarkColors)
})
```
[electron-forge]: https://www.electronforge.io/
[electron-packager]: https://github.com/electron/electron-packager
[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport

View File

@@ -92,10 +92,14 @@ template("electron_extra_paks") {
}
if (enable_electron_extensions) {
sources += [
"$root_gen_dir/chrome/component_extension_resources.pak",
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
"$root_gen_dir/extensions/extensions_resources.pak",
]
deps += [ "//extensions:extensions_resources" ]
deps += [
"//chrome/browser/resources:component_extension_resources",
"//extensions:extensions_resources",
]
}
}
}

View File

@@ -17,7 +17,8 @@
<part file="electron_strings.grdp" />
</messages>
<includes>
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}\shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}/shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
<include name="IDR_PDF_MANIFEST" file="../chrome/browser/resources/pdf/manifest.json" type="BINDATA" />
</includes>
</release>
</grit>

View File

@@ -45,6 +45,7 @@ auto_filenames = {
"docs/api/remote.md",
"docs/api/sandbox-option.md",
"docs/api/screen.md",
"docs/api/service-workers.md",
"docs/api/session.md",
"docs/api/shell.md",
"docs/api/structures",
@@ -110,6 +111,7 @@ auto_filenames = {
"docs/api/structures/remove-password.md",
"docs/api/structures/scrubber-item.md",
"docs/api/structures/segmented-control-segment.md",
"docs/api/structures/service-worker-info.md",
"docs/api/structures/shared-worker-info.md",
"docs/api/structures/shortcut-details.md",
"docs/api/structures/size.md",

View File

@@ -88,6 +88,8 @@ filenames = {
"shell/browser/api/electron_api_protocol.h",
"shell/browser/api/electron_api_screen.cc",
"shell/browser/api/electron_api_screen.h",
"shell/browser/api/electron_api_service_worker_context.cc",
"shell/browser/api/electron_api_service_worker_context.h",
"shell/browser/api/electron_api_session.cc",
"shell/browser/api/electron_api_session.h",
"shell/browser/api/electron_api_system_preferences.cc",
@@ -234,12 +236,15 @@ filenames = {
"shell/browser/net/node_stream_loader.h",
"shell/browser/net/proxying_url_loader_factory.cc",
"shell/browser/net/proxying_url_loader_factory.h",
"shell/browser/net/proxying_websocket.cc",
"shell/browser/net/proxying_websocket.h",
"shell/browser/net/resolve_proxy_helper.cc",
"shell/browser/net/resolve_proxy_helper.h",
"shell/browser/net/system_network_context_manager.cc",
"shell/browser/net/system_network_context_manager.h",
"shell/browser/net/url_pipe_loader.cc",
"shell/browser/net/url_pipe_loader.h",
"shell/browser/net/web_request_api_interface.h",
"shell/browser/network_hints_handler_impl.cc",
"shell/browser/network_hints_handler_impl.h",
"shell/browser/node_debugger.cc",
@@ -276,6 +281,8 @@ filenames = {
"shell/browser/notifications/win/win32_notification.h",
"shell/browser/notifications/win/windows_toast_notification.cc",
"shell/browser/notifications/win/windows_toast_notification.h",
"shell/browser/plugins/plugin_utils.cc",
"shell/browser/plugins/plugin_utils.h",
"shell/browser/pref_store_delegate.cc",
"shell/browser/pref_store_delegate.h",
"shell/browser/relauncher.cc",
@@ -551,8 +558,11 @@ filenames = {
"shell/common/skia_util.h",
"shell/common/v8_value_converter.cc",
"shell/common/v8_value_converter.h",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"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_renderer_ipc.cc",
@@ -591,44 +601,54 @@ filenames = {
]
lib_sources_extensions = [
"shell/browser/extensions/api/i18n/i18n_api.cc",
"shell/browser/extensions/api/i18n/i18n_api.h",
"shell/browser/extensions/api/resources_private/resources_private_api.cc",
"shell/browser/extensions/api/resources_private/resources_private_api.h",
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
"shell/browser/extensions/api/tabs/tabs_api.cc",
"shell/browser/extensions/api/tabs/tabs_api.h",
"shell/browser/extensions/electron_extensions_browser_client.cc",
"shell/browser/extensions/electron_extensions_browser_client.h",
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
"shell/browser/extensions/api/streams_private/streams_private_api.h",
"shell/browser/extensions/electron_browser_context_keyed_service_factories.cc",
"shell/browser/extensions/electron_browser_context_keyed_service_factories.h",
"shell/browser/extensions/electron_component_extension_resource_manager.cc",
"shell/browser/extensions/electron_component_extension_resource_manager.h",
"shell/browser/extensions/electron_display_info_provider.cc",
"shell/browser/extensions/electron_display_info_provider.h",
"shell/browser/extensions/electron_extension_host_delegate.cc",
"shell/browser/extensions/electron_extension_host_delegate.h",
"shell/browser/extensions/electron_extension_loader.cc",
"shell/browser/extensions/electron_extension_loader.h",
"shell/browser/extensions/electron_extension_message_filter.cc",
"shell/browser/extensions/electron_extension_message_filter.h",
"shell/browser/extensions/electron_extension_system.cc",
"shell/browser/extensions/electron_extension_system.h",
"shell/browser/extensions/electron_extension_system_factory.cc",
"shell/browser/extensions/electron_extension_system_factory.h",
"shell/browser/extensions/electron_extension_web_contents_observer.cc",
"shell/browser/extensions/electron_extension_web_contents_observer.h",
"shell/browser/extensions/electron_navigation_ui_data.cc",
"shell/browser/extensions/electron_navigation_ui_data.h",
"shell/browser/extensions/electron_process_manager_delegate.cc",
"shell/browser/extensions/electron_process_manager_delegate.h",
"shell/browser/extensions/electron_extensions_api_client.cc",
"shell/browser/extensions/electron_extensions_api_client.h",
"shell/browser/extensions/electron_extensions_browser_api_provider.cc",
"shell/browser/extensions/electron_extensions_browser_api_provider.h",
"shell/browser/extensions/electron_extensions_browser_client.cc",
"shell/browser/extensions/electron_extensions_browser_client.h",
"shell/browser/extensions/electron_messaging_delegate.cc",
"shell/browser/extensions/electron_messaging_delegate.h",
"shell/browser/extensions/electron_navigation_ui_data.cc",
"shell/browser/extensions/electron_navigation_ui_data.h",
"shell/browser/extensions/electron_process_manager_delegate.cc",
"shell/browser/extensions/electron_process_manager_delegate.h",
"shell/common/extensions/electron_extensions_api_provider.cc",
"shell/common/extensions/electron_extensions_api_provider.h",
"shell/common/extensions/electron_extensions_client.cc",
"shell/common/extensions/electron_extensions_client.h",
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
"shell/renderer/extensions/electron_extensions_renderer_client.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",
"shell/renderer/extensions/electron_extensions_renderer_client.h",
]
app_sources = [

View File

@@ -2,7 +2,7 @@
const { EventEmitter } = require('events')
const { app, deprecate } = require('electron')
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.electronBinding('session')
const { fromPartition, Session, Cookies, NetLog, Protocol, ServiceWorkerContext } = process.electronBinding('session')
// Public API.
Object.defineProperties(exports, {
@@ -16,8 +16,9 @@ Object.defineProperties(exports, {
}
})
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
Object.setPrototypeOf(ServiceWorkerContext.prototype, EventEmitter.prototype)
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
Session.prototype._init = function () {
app.emit('session-created', this)

View File

@@ -51,13 +51,25 @@ class TouchBar extends EventEmitter {
item.child.ordereredItems.forEach(registerItem)
}
}
const idSet = new Set()
items.forEach((item) => {
if (!(item instanceof TouchBarItem)) {
throw new Error('Each item must be an instance of TouchBarItem')
}
if (!idSet.has(item.id)) {
idSet.add(item.id)
} else {
throw new Error('Cannot add a single instance of TouchBarItem multiple times in a TouchBar')
}
})
// register in separate loop after all items are validated
for (const item of items) {
this.ordereredItems.push(item)
registerItem(item)
})
}
}
set escapeItem (item) {

View File

@@ -4,7 +4,7 @@ const { webContents } = require('electron')
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
const parseFeaturesString = require('@electron/internal/common/parse-features-string')
const { syncMethods, asyncMethods } = require('@electron/internal/common/web-view-methods')
const { syncMethods, asyncMethods, properties } = require('@electron/internal/common/web-view-methods')
const { serialize } = require('@electron/internal/common/type-utils')
// Doesn't exist in early initialization.
@@ -384,6 +384,24 @@ handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_CALL', function (event, guestInst
return guest[method](...args)
})
handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_GET', function (event, guestInstanceId, property) {
const guest = getGuestForWebContents(guestInstanceId, event.sender)
if (!properties.has(property)) {
throw new Error(`Invalid property: ${property}`)
}
return guest[property]
})
handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_SET', function (event, guestInstanceId, property, val) {
const guest = getGuestForWebContents(guestInstanceId, event.sender)
if (!properties.has(property)) {
throw new Error(`Invalid property: ${property}`)
}
guest[property] = val
})
handleMessage('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', async function (event, guestInstanceId, args) {
const guest = getGuestForWebContents(guestInstanceId, event.sender)

View File

@@ -18,8 +18,10 @@ require('@electron/internal/common/init')
if (process.platform === 'win32') {
// Redirect node's console to use our own implementations, since node can not
// handle console output when running as GUI program.
const consoleLog = (format: any, ...args: any[]) => {
return process.log(util.format(format, ...args) + '\n')
const consoleLog = (...args: any[]) => {
// @ts-ignore this typing is incorrect; 'format' is an optional parameter
// See https://nodejs.org/api/util.html#util_util_format_format_args
return process.log(util.format(...args) + '\n')
}
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
if (Buffer.isBuffer(chunk)) {

View File

@@ -3,7 +3,7 @@
const binding = process.electronBinding('crash_reporter')
class CrashReporter {
contructor () {
constructor () {
this.productName = null
this.crashesDirectory = null
}

View File

@@ -50,6 +50,14 @@ export const syncMethods = new Set([
'setZoomLevel'
])
export const properties = new Set([
'audioMuted',
'userAgent',
'zoomLevel',
'zoomFactor',
'frameRate'
])
export const asyncMethods = new Set([
'loadURL',
'executeJavaScript',

View File

@@ -14,7 +14,6 @@ const remoteObjectCache = v8Util.createIDWeakMap()
const contextId = v8Util.getHiddenValue(global, 'contextId')
ipcRendererInternal.invoke('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES').then(preferences => {
console.log(preferences)
if (!preferences.enableRemoteModule) {
console.warn('%cElectron Deprecation Warning', 'font-weight: bold', "The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.")
}

View File

@@ -4,7 +4,7 @@ import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-in
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils'
import * as guestViewInternal from '@electron/internal/renderer/web-view/guest-view-internal'
import { WEB_VIEW_CONSTANTS } from '@electron/internal/renderer/web-view/web-view-constants'
import { syncMethods, asyncMethods } from '@electron/internal/common/web-view-methods'
import { syncMethods, asyncMethods, properties } from '@electron/internal/common/web-view-methods'
import { deserialize } from '@electron/internal/common/type-utils'
const { webFrame } = electron
@@ -249,6 +249,25 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
WebViewElement.prototype.capturePage = async function (...args) {
return deserialize(await ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', this.getWebContentsId(), args))
}
const createPropertyGetter = function (property: string) {
return function (this: ElectronInternal.WebViewElement) {
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_GET', this.getWebContentsId(), property)
}
}
const createPropertySetter = function (property: string) {
return function (this: ElectronInternal.WebViewElement, arg: any) {
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_SET', this.getWebContentsId(), property, arg)
}
}
for (const property of properties) {
Object.defineProperty(WebViewElement.prototype, property, {
get: createPropertyGetter(property) as any,
set: createPropertySetter(property)
})
}
}
export const webViewImplModule = {

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "9.0.0-nightly.20200205",
"version": "9.0.0-beta.8",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
@@ -19,6 +19,7 @@
"@types/semver": "^6.0.1",
"@types/send": "^0.14.5",
"@types/split": "^1.0.0",
"@types/uuid": "^3.4.6",
"@types/webpack": "^4.4.32",
"@types/webpack-env": "^1.13.9",
"@typescript-eslint/eslint-plugin": "^2.6.0",

View File

@@ -31,11 +31,12 @@ scroll_bounce_flag.patch
mas-cfisobjc.patch
mas-cgdisplayusesforcetogray.patch
mas-audiodeviceduck.patch
mas_disable_remote_layer.patch
mas_disable_remote_accessibility.patch
mas_disable_custom_window_frame.patch
chrome_key_systems.patch
allow_nested_error_trackers.patch
blink_initialization_order.patch
add_didinstallconditionalfeatures.patch
ssl_security_state_tab_helper.patch
desktop_media_list.patch
proxy_config_monitor.patch
@@ -81,3 +82,12 @@ feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
accessible_pane_view.patch
fixme_grit_conflicts.patch
fix_use_the_new_mediaplaypause_key_listener_for_internal_chrome.patch
use_electron_resources_in_pdf_util.patch
hack_plugin_response_interceptor_to_point_to_electron.patch
delay_lock_the_protocol_scheme_registry.patch
fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
feat_enable_offscreen_rendering_with_viz_compositor.patch
feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
gpu_notify_when_dxdiag_request_fails.patch
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
expose_aria_trees_as_tables_for_macos_accessibility.patch

View File

@@ -0,0 +1,137 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Wed, 15 Jan 2020 16:35:18 -0800
Subject: add DidInstallConditionalFeatures
This adds a hook on script context creation _after conditional features
have been installed_. Electron uses this to run preload scripts and
various other initialization. This is necessary because at the time
DidCreateScriptContext is called, not all JS APIs are available in the
context, which can cause some preload scripts to trip.
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index b09355c6dc2fe264c66fceaafd4ef75bc1059f82..205a9197acef55dc062a8645a6cc406f1db496c2 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -115,6 +115,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
virtual void DidHandleOnloadEvents() {}
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
+ int32_t world_id) {}
virtual void WillReleaseScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 24d5189649d7ce6fd702cd6c686aac2edf2e6150..0d3d1b8f0aeefbcf81d14460fd687ddd09ff9d98 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5034,6 +5034,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
+void RenderFrameImpl::DidInstallConditionalFeatures(
+ v8::Local<v8::Context> context, int world_id) {
+ for (auto& observer : observers_)
+ observer.DidInstallConditionalFeatures(context, world_id);
+}
+
void RenderFrameImpl::WillReleaseScriptContext(v8::Local<v8::Context> context,
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index ee6e06ed821f8caff2fd5d475e878389e5f9c61f..dac55b994034aafd01c93ccab17d7bc8ded3e022 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -752,6 +752,8 @@ class CONTENT_EXPORT RenderFrameImpl
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
+ void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
+ int world_id) override;
void WillReleaseScriptContext(v8::Local<v8::Context> context,
int world_id) override;
void DidChangeScrollOffset() override;
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index d427db5260bf6faf34fa32a8990d84f6119e7f61..32fd79b23c5d6afa0d3681906398f4a410fa2659 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -574,6 +574,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
+ int32_t world_id) {}
+
// WebKit is about to release its reference to a v8 context for a frame.
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index b00085e2f313a69f6dd5a8817d5a4cf0a78a198e..bb8a830fc70fee6b7e79b6ffb36889923b7e09ce 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -215,6 +215,7 @@ void LocalWindowProxy::Initialize() {
}
InstallConditionalFeatures();
+ GetFrame()->Client()->DidInstallConditionalFeatures(context, world_->GetWorldId());
if (World().IsMainWorld()) {
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
index d7adc387557a0f65d507ebddebda5fa611ddfa5f..f2a465c6223de32970ce5a39ba6935ceaea9f15c 100644
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
@@ -348,6 +348,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
web_frame_->Client()->DidCreateScriptContext(context, world_id);
}
+void LocalFrameClientImpl::DidInstallConditionalFeatures(
+ v8::Local<v8::Context> context,
+ int32_t world_id) {
+ if (web_frame_->Client())
+ web_frame_->Client()->DidInstallConditionalFeatures(context, world_id);
+}
+
void LocalFrameClientImpl::WillReleaseScriptContext(
v8::Local<v8::Context> context,
int32_t world_id) {
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
index ef5fe8dfd99d8800c0fc20c52a19bfdc9fc2b722..6c5832f3394e84bcb420f18871984c2437e29425 100644
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
@@ -80,6 +80,8 @@ class LocalFrameClientImpl final : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override;
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
+ int32_t world_id) override;
void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) override;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index e3de4cf6e464d42816a40ff39c0b979528f42298..97a912a188f95b85310049dc0c7960cc8644d6f4 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -293,6 +293,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
+ int32_t world_id) = 0;
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
virtual bool AllowScriptExtensions() = 0;
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
index bf63bab30fd7f839574bf0d6a903b514245c0c2b..f278bae3715e42bce6fdf8b27659ca5b9b837405 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -368,6 +368,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
+ int32_t world_id) override {}
void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}
bool AllowScriptExtensions() override { return false; }

View File

@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index 7aa84a3e19c257dde8f48d25743dc8ab2a3a0a30..58cbfc6e6f9f916ace683705d8a87ee05dc73422 100644
index 02078481fc5e10597a810c0ef7857f259ae877d4..99019dbf45f4a7fd209e6836e5738b1781223e4e 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -659,6 +659,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
@@ -660,6 +660,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, ArrayBufferContents::kDontInitialize);
}

View File

@@ -10,10 +10,10 @@ WebContents, and cancels the authentication if there's no WebContents
available, which there isn't in the case of the 'net' module.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 78fd4bd72b07f38b447840b584253883756fe021..6d8aaecc08207456f243125db8e6d7c74f731d87 100644
index f6672a20f1eb0914b8e103ae38079e9e0e6bfbdc..ee32e6f6361085b51b3ab905d0c5aa2d9ff93ab7 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -191,6 +191,25 @@ struct HttpAuthStaticNetworkContextParams {
@@ -192,6 +192,25 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
};
@@ -39,7 +39,7 @@ index 78fd4bd72b07f38b447840b584253883756fe021..6d8aaecc08207456f243125db8e6d7c7
interface CertVerifierClient {
Verify(
int32 default_error,
@@ -608,6 +627,8 @@ struct URLLoaderFactoryParams {
@@ -621,6 +640,8 @@ struct URLLoaderFactoryParams {
// interface. This still respects the per-context block lists.
CorsOriginAccessPatterns? factory_bound_access_patterns;
@@ -49,10 +49,10 @@ index 78fd4bd72b07f38b447840b584253883756fe021..6d8aaecc08207456f243125db8e6d7c7
NetworkIsolationKey? network_isolation_key;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b23ca7b694 100644
index 3a288e96c446a69e54a12e2237b75bca9663e811..118d2f126bdcd4a08bd2b9822382edbf1838ad9b 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -338,6 +338,7 @@ URLLoader::URLLoader(
@@ -429,6 +429,7 @@ URLLoader::URLLoader(
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
@@ -60,7 +60,7 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
mojom::OriginPolicyManager* origin_policy_manager)
: url_request_context_(url_request_context),
network_service_client_(network_service_client),
@@ -396,6 +397,11 @@ URLLoader::URLLoader(
@@ -491,6 +492,11 @@ URLLoader::URLLoader(
header_client_.set_disconnect_handler(
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
}
@@ -72,7 +72,7 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
if (want_raw_headers_) {
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
@@ -830,7 +836,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
@@ -929,7 +935,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
void URLLoader::OnAuthRequired(net::URLRequest* url_request,
const net::AuthChallengeInfo& auth_info) {
@@ -81,7 +81,7 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
OnAuthCredentials(base::nullopt);
return;
}
@@ -846,11 +852,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
@@ -945,11 +951,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
if (url_request->response_headers())
head->headers = url_request->response_headers();
head->auth_challenge_info = auth_info;
@@ -108,10 +108,10 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
auth_challenge_responder_receiver_.set_disconnect_handler(
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 532ecdc0a9b386eb9ea04a480b18aeb1ac32a059..b3ad0f42ab9c2f513d8c4a06683d1af6f0219a56 100644
index c9bc24da6e0bc26509685d8031ff2ccb2377f96a..8a4730fc49ac186cd98cb9f2c4433e45d6a3290d 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -85,6 +85,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -104,6 +104,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
@@ -119,7 +119,7 @@ index 532ecdc0a9b386eb9ea04a480b18aeb1ac32a059..b3ad0f42ab9c2f513d8c4a06683d1af6
mojom::OriginPolicyManager* origin_policy_manager);
~URLLoader() override;
@@ -384,6 +385,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -407,6 +408,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::Optional<base::UnguessableToken> fetch_window_id_;
mojo::Remote<mojom::TrustedHeaderClient> header_client_;

View File

@@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Thu, 20 Sep 2018 17:50:24 -0700
Subject: blink_initialization_order.patch
Backport of https://chromium-review.googlesource.com/c/chromium/src/+/1030530
to fix the order of V8 and Blink initialization. Also fixes order
of DidCreateScriptContext notification with initialization of window globals
to fix electron/electron#13787. The backport landed in Chromium 67 but the
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index c845acb8321e94c916798826a168e06df34ffff4..941ca9d3905c0c2f36606655bf60e9e9bd1f9196 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -211,11 +211,10 @@ void LocalWindowProxy::Initialize() {
GetFrame()->IsMainFrame());
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
origin);
+ InstallConditionalFeatures();
GetFrame()->Client()->DidCreateScriptContext(context, world_->GetWorldId());
}
- InstallConditionalFeatures();
-
if (World().IsMainWorld()) {
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
}

View File

@@ -14,10 +14,10 @@ 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 28d4c323a1c94ad61f83d4d9cc37863801f02276..85cb2f33afff53c8e524b04e398241928acf8305 100644
index ec7a282e9d254141c298d78e6237403ec24ec058..2514b82ca59c3d39d6dc1f5bfe7903184174292c 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -357,10 +357,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -364,10 +364,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
}
CHECK(!view_ || !view_->IsAttached());
@@ -28,7 +28,7 @@ index 28d4c323a1c94ad61f83d4d9cc37863801f02276..85cb2f33afff53c8e524b04e39824192
if (!Client())
return;
@@ -378,6 +374,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -385,6 +381,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
// Notify ScriptController that the frame is closing, since its cleanup ends
// up calling back to LocalFrameClient via WindowProxy.
GetScriptController().ClearForClose();

View File

@@ -7,10 +7,10 @@ This exposes a method for obtaining a reference to an isolated world, which is
otherwise not available in the Blink API.
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index 6f52b7e81585ad04ed8c14331aa07654354de386..812e555b9df7d39977798997f7517b1eb0467393 100644
index d4482dae09bc9fef32d081be949f0566e562f005..d8f7f59fe3fff4e044f9238d1b69856b0accecc3 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -333,6 +333,9 @@ class WebLocalFrame : public WebFrame {
@@ -328,6 +328,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
@@ -21,10 +21,10 @@ index 6f52b7e81585ad04ed8c14331aa07654354de386..812e555b9df7d39977798997f7517b1e
// that the script evaluated to with callback. Script execution can be
// suspend.
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index e3dc69f4df92cc731c93373fa2579a3eb58ae2bc..be9626f3c594aef8fa9b9fa09b7e65716afcd5fd 100644
index 9035dffc460acd9d0a556a53e859f8c7a5ae0184..f48c5103a3fefa856a43c7b028d05ec8c2258fa5 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -943,6 +943,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
@@ -945,6 +945,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
@@ -39,10 +39,10 @@ index e3dc69f4df92cc731c93373fa2579a3eb58ae2bc..be9626f3c594aef8fa9b9fa09b7e6571
return BindingSecurity::ShouldAllowAccessToFrame(
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
index 26184ae197e935335420bb85f639f3cf1c8f8020..ff05a80f48533b3c1ec4f934bc4788663f9fef09 100644
index 2315b8ef3123abeda0d3638bd541fbec7f5964c2..3067597161194324723ec5c07f74cd51e5c027a6 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -165,6 +165,8 @@ class CORE_EXPORT WebLocalFrameImpl final
@@ -162,6 +162,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;

View File

@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index bf408c6bff28f05b91dae284565e6f4ecf2b03d1..6bbf011aad1a6fc20ea5c3f0adee9e6b2f11d707 100644
index b447973cdd4c95a4b1468224151dd18c624a74be..46d33f5d0449fd51a8d7cf17cec334bc80c23442 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -67,6 +67,7 @@

View File

@@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 49587997fa1ebe73dd00e96c95ae0448fcc7fa62..7e203486c32617e325c8aa6305c4ee57c93540f7 100644
index a6da1d84ee4c103411392bc151dfb48516118c97..96d597c7d63763ba5fda4d44581af81b7cf4d3d9 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -4487,6 +4487,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -4544,6 +4544,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index 49587997fa1ebe73dd00e96c95ae0448fcc7fa62..7e203486c32617e325c8aa6305c4ee57
&no_javascript_access);
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index abd2be4bc8e81a28209aa551f4435b9e8d37a249..f33766c98e1a28c89fc41f9e5cfd098ca6bc6150 100644
index e3a4ac61e468fa6458d80065635519816cb6ed97..6350a93e0e047499f067e2cc36a15757c736fa95 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -305,6 +305,10 @@ struct CreateNewWindowParams {
@@ -296,6 +296,10 @@ struct CreateNewWindowParams {
// The window features to use for the new window.
blink.mojom.WindowFeatures features;
@@ -36,10 +36,10 @@ index abd2be4bc8e81a28209aa551f4435b9e8d37a249..f33766c98e1a28c89fc41f9e5cfd098c
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index bcdc73fdf89d46e267f0c9568e46172ec89f9f23..930e043a0fdf40ef0e48a19597da567c8603878c 100644
index aceb1814fced09e3a93464f48a8c16446c589360..a7000c7ee15c5c988bff448e1d762d91cd6f5141 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -505,6 +505,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -513,6 +513,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -49,10 +49,10 @@ index bcdc73fdf89d46e267f0c9568e46172ec89f9f23..930e043a0fdf40ef0e48a19597da567c
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 51f31b2c7e431004f2f1bf54e043ed497d166d4f..f9601b5813746ce930bb7082178e1f826aaeb62e 100644
index ffc0526baef9127d34852649e80b4fd8c0d84ef8..cfb548239a9bd4582344cc332ca4c253628d7438 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -146,6 +146,7 @@ class NetworkService;
@@ -142,6 +142,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -60,7 +60,7 @@ index 51f31b2c7e431004f2f1bf54e043ed497d166d4f..f9601b5813746ce930bb7082178e1f82
} // namespace network
namespace rappor {
@@ -831,6 +832,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -829,6 +830,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -70,7 +70,7 @@ index 51f31b2c7e431004f2f1bf54e043ed497d166d4f..f9601b5813746ce930bb7082178e1f82
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index bd44565e78aaa70e9402312830d30c4a908ede11..463906df3f761bb321c8580185c5e12dceb96854 100644
index 4ff7f7b2640fab10267079f01d910113c0558f13..cc33b1b54e812e0284b4c66b228b3a0a8b88e85f 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -69,6 +69,7 @@
@@ -81,7 +81,7 @@ index bd44565e78aaa70e9402312830d30c4a908ede11..463906df3f761bb321c8580185c5e12d
#include "content/renderer/media/audio/audio_device_factory.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_frame_proxy.h"
@@ -1276,6 +1277,8 @@ WebView* RenderViewImpl::CreateView(
@@ -1267,6 +1268,8 @@ WebView* RenderViewImpl::CreateView(
}
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
@@ -91,10 +91,10 @@ index bd44565e78aaa70e9402312830d30c4a908ede11..463906df3f761bb321c8580185c5e12d
// moved on send.
bool is_background_tab =
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
index 62e1749ae329791ed31374b255958bfc971599ab..64285a53a4baa65216f58412909202ce085fca12 100644
index 6692dd42929f56455e11e7784e2e89c6a22a11ce..bede71b49dd6ea9c0381f895a72dcd076c5de9b1 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
@@ -326,6 +326,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -339,6 +339,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -104,10 +104,10 @@ index 62e1749ae329791ed31374b255958bfc971599ab..64285a53a4baa65216f58412909202ce
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
index 5f985e2f11ebef42ed676260297e5e699096ba4a..2f3e68199f50b0e85dbb0d5cb95388279a194028 100644
index 09924087558f172f481a0e10c0c000f8aec4678a..c00b88ce7c9e0f3f04ee2e6442d5ee987cab9667 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
@@ -66,6 +66,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -67,6 +67,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,

View File

@@ -6,6 +6,18 @@ Subject: chore: use electron resources not chrome for spellchecker
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 a941c98c6c17af9e025902f31332a612eada9f6b..4087d4156b51d72d646e1a6ae9fac8e31d6f36f1 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -5247,6 +5247,7 @@ jumbo_static_library("browser") {
deps += [
"//components/spellcheck/browser",
"//components/spellcheck/common",
+ "//electron:resources",
]
if (!is_android) {
diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fae4ee67ca 100644
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
@@ -19,6 +31,18 @@ index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fa
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
diff --git a/components/language/core/browser/BUILD.gn b/components/language/core/browser/BUILD.gn
index f28230ea94fece5ae8ca7ac27a14da48f40fadbb..c10eea103852b9411a644e1fe20a7e20a38bf187 100644
--- a/components/language/core/browser/BUILD.gn
+++ b/components/language/core/browser/BUILD.gn
@@ -31,6 +31,7 @@ static_library("browser") {
"//components/pref_registry",
"//components/prefs",
"//components/strings",
+ "//electron:resources",
"//ui/base",
]
}
diff --git a/components/language/core/browser/language_prefs.cc b/components/language/core/browser/language_prefs.cc
index 7e06f689632ae67e3e17d7985c6e7b6ea0057f3c..0b4676f4c40b4a0eda927a51016ec91ec230291d 100644
--- a/components/language/core/browser/language_prefs.cc

View File

@@ -41,10 +41,10 @@ index c5125495b4d178ffb18be4d2d9670f7556412cbd..cddb321abb938c667a4a2089f87eab99
// Create an observer that registers a hot key for |accelerator|.
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chrome/browser/extensions/global_shortcut_listener_x11.cc
index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e48792cc4159 100644
index 9b6bba3ed87cae8ecc4288d01e5e7a3f74f71510..a4e4a5d6f1096754bf20c3438f47ebe60147f184 100644
--- a/chrome/browser/extensions/global_shortcut_listener_x11.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.cc
@@ -38,6 +38,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
@@ -39,6 +39,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
modifiers |= accelerator.IsShiftDown() ? ShiftMask : 0;
modifiers |= accelerator.IsCtrlDown() ? ControlMask : 0;
modifiers |= accelerator.IsAltDown() ? Mod1Mask : 0;
@@ -52,15 +52,6 @@ index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e487
return modifiers;
}
@@ -151,6 +152,8 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) {
modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0;
modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0;
modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0;
+ // For Windows key
+ modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0;
ui::Accelerator accelerator(
ui::KeyboardCodeFromXKeyEvent(x_event), modifiers);
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc7951d372 100644
--- a/ui/base/accelerators/media_keys_listener.cc

View File

@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
in atom::CommonWebContentsDelegate::ResetManageWebContents.
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 00d50221bbb63070be48e2493e766242b76724c8..ce20a8dc5135a9b9b6565ac3f1daf0cbeb2df185 100644
index ce2ce3e4bd62e4d0bebf50293f7af28ba6103f58..fa2874db541bb9d532906908d95bc9ab74e44c1d 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1504,7 +1504,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
@@ -1507,7 +1507,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
NOTREACHED();
#else
base::RunLoop run_loop;

View File

@@ -17,7 +17,7 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 1bb7007c16029db901514e79171952d07b47058e..5f5e887f85abc5c4f948de034feb4482571144fc 100644
index deb02fbfd0732978ef82cd389559d29be1d562b1..37207b205dbc8308b0d92cbcf0e3861dc397ed93 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1250,8 +1250,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
@@ -46,20 +46,20 @@ index 1bb7007c16029db901514e79171952d07b47058e..5f5e887f85abc5c4f948de034feb4482
// navigation. Now we know that the renderer has updated its state accordingly
// and it is safe to also clear the browser side history.
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 1308bcb042b38d502b1b65b04affabf7e09d6fcd..52c9da3ea565d131ea8704f34f743f6661d42e84 100644
index 23681d4192ac329a68822dbcdb06369f34e5e28a..ecb4cd19c364285044da60830fb1b4d4f52204f3 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -768,10 +768,10 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
}
@@ -767,10 +767,10 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
UINT cf_format = format.ToFormatEtc().cfFormat;
- DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
+ //DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
if (handle && !::SetClipboardData(format, handle)) {
if (handle && !::SetClipboardData(cf_format, handle)) {
- DCHECK_NE(GetLastError(),
- static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
+ //DCHECK_NE(GetLastError(),
+ // static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
FreeData(format, handle);
FreeData(cf_format, handle);
}
}

View File

@@ -0,0 +1,109 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Locascio <andy@slack-corp.com>
Date: Tue, 18 Feb 2020 14:35:04 -0800
Subject: content: allow embedder to prevent locking scheme registry
The //content layer requires all schemes to be registered during startup,
because Add*Scheme aren't threadsafe. However, Electron exposes the option to
register additional schemes via JavaScript in the main process before the app
is ready, but after the //content layer has already locked the registry.
This allows embedders to optionally keep the scheme registry unlocked, and it
is their responsibility to ensure that it is not accessed in a way that would
cause potential thread-safety issues.
Previously upstreamed patch: https://chromium-review.googlesource.com/c/chromium/src/+/1637040
This change was lost during upstream refactor in
https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
re-submitting the patch.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index aa6244ed2a389625731d68c328e2e3f37aaf9095..8bba34a9783ec5a1bfae7ad0d15745c32ed3d8d1 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -668,7 +668,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
}
#endif
- RegisterContentSchemes();
+ RegisterContentSchemes(delegate_->ShouldLockSchemeRegistry());
ContentClientInitializer::Set(process_type, delegate_);
#if !defined(OS_ANDROID)
diff --git a/content/common/url_schemes.cc b/content/common/url_schemes.cc
index 686c7157e5db3530fc2ea9ad682808c07b421288..8c7bef1e015236afae91a7a808f82861a60390e1 100644
--- a/content/common/url_schemes.cc
+++ b/content/common/url_schemes.cc
@@ -49,7 +49,7 @@ std::vector<std::string>& GetMutableServiceWorkerSchemes() {
} // namespace
-void RegisterContentSchemes() {
+void RegisterContentSchemes(bool should_lock_registry) {
// On Android and in tests, schemes may have been registered already.
if (g_registered_url_schemes)
return;
@@ -103,7 +103,8 @@ void RegisterContentSchemes() {
// threadsafe so must be called when GURL isn't used on any other thread. This
// is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
// must be inside this function.
- url::LockSchemeRegistries();
+ if (should_lock_registry)
+ url::LockSchemeRegistries();
// Combine the default savable schemes with the additional ones given.
GetMutableSavableSchemes().assign(std::begin(kDefaultSavableSchemes),
diff --git a/content/common/url_schemes.h b/content/common/url_schemes.h
index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f889977bee 100644
--- a/content/common/url_schemes.h
+++ b/content/common/url_schemes.h
@@ -16,7 +16,7 @@ namespace content {
// parsed as "standard" or "referrer" with the src/url/ library, then locks the
// sets of schemes down. The embedder can add additional schemes by
// overriding the ContentClient::AddAdditionalSchemes method.
-CONTENT_EXPORT void RegisterContentSchemes();
+CONTENT_EXPORT void RegisterContentSchemes(bool should_lock_registry = true);
// Re-initializes schemes for tests.
CONTENT_EXPORT void ReRegisterContentSchemesForTests();
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
index af1200a0f2e04c1582e527b609a2e89a97bb0f4c..7ab4cd4a1d8aefcb4bd90d68870f02f3edcff5a7 100644
--- a/content/public/app/content_main_delegate.cc
+++ b/content/public/app/content_main_delegate.cc
@@ -40,6 +40,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
return 0;
}
+bool ContentMainDelegate::ShouldLockSchemeRegistry() {
+ return true;
+}
+
service_manager::ProcessType ContentMainDelegate::OverrideProcessType() {
return service_manager::ProcessType::kDefault;
}
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
index f8590642a8d6807a15746e9e7673b5e76cbe0e14..7d8df731b6dd18a42ec4fc2b1bb08a6198da8ff8 100644
--- a/content/public/app/content_main_delegate.h
+++ b/content/public/app/content_main_delegate.h
@@ -77,6 +77,20 @@ class CONTENT_EXPORT ContentMainDelegate {
// returning initialization error code. Default behavior is CHECK(false).
virtual int TerminateForFatalInitializationError();
+ // Allows the embedder to prevent locking the scheme registry. The scheme
+ // registry is the list of URL schemes we recognize, with some additional
+ // information about each scheme such as whether it expects a host. The
+ // scheme registry is not thread-safe, so by default it is locked before any
+ // threads are created to ensure single-threaded access. An embedder can
+ // override this to prevent the scheme registry from being locked during
+ // startup, but if they do so then they are responsible for making sure that
+ // the registry is only accessed in a thread-safe way, and for calling
+ // url::LockSchemeRegistries() when initialization is complete. If possible,
+ // prefer registering additional schemes through
+ // ContentClient::AddAdditionalSchemes over preventing the scheme registry
+ // from being locked.
+ virtual bool ShouldLockSchemeRegistry();
+
// Overrides the Service Manager process type to use for the currently running
// process.
virtual service_manager::ProcessType OverrideProcessType();

View File

@@ -19,28 +19,11 @@ 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 4691cedce6d16b5ffcbed995bc2a4a49dda2556b..7c95c65dbb7067524f8696ea4d86e27dacc815cb 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1814,6 +1814,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {
const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpaceAndId(
int* id) const {
+ if (!settings_.enable_color_correct_rendering) {
+ static gfx::ColorSpace invalid_color_space;
+ *id = -1;
+ return invalid_color_space;
+ }
+
const gfx::ColorSpace* result = nullptr;
// The pending tree will have the most recently updated color space, so
// prefer that.
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index 161ce54e75c0047797e9d0db27aafc3d0bfe7140..61838deb281cc11db50d195cf960970ee9cdac89 100644
index 799ea55b4d74fa5b86034e0dc63e0ab81e7f47fb..9960298ea2306db6482f610c2f5fdb2977dc232b 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -100,6 +100,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -101,6 +101,8 @@ class CC_EXPORT LayerTreeSettings {
bool use_rgba_4444 = false;
bool unpremultiply_and_dither_low_bit_depth_tiles = false;
@@ -50,7 +33,7 @@ index 161ce54e75c0047797e9d0db27aafc3d0bfe7140..61838deb281cc11db50d195cf960970e
// Image Decode Service and raster tiles without images until the decode is
// ready.
diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h
index 389f2ed29bd85c35b38df92346a8d6c76ce22fd6..02cf492fa4068d10c4b8b2addee8102b35aac3e0 100644
index f4d5e4daf5db36da88e5dfabc698a51a32d55010..33ecf4ac5792b38d5d2b5e4a81dd79478c562e24 100644
--- a/components/viz/common/display/renderer_settings.h
+++ b/components/viz/common/display/renderer_settings.h
@@ -23,6 +23,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
@@ -83,7 +66,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 be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070ac6f80fa 100644
index a89c6e85d86dd035e834c9ff4be3387024082815..a89a1b393ea95dea52b5c78c0b0be075a80a0118 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -84,6 +84,9 @@
@@ -101,10 +84,10 @@ index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070
SetBlendEnabled(quad->ShouldDrawWithBlending());
- SetUseProgram(ProgramKey::DebugBorder(), gfx::ColorSpace::CreateSRGB(),
- current_frame()->current_render_pass->color_space);
- CurrentRenderPassColorSpace());
+ SetUseProgram(ProgramKey::DebugBorder(),
+ PATCH_CS(gfx::ColorSpace::CreateSRGB()),
+ PATCH_CS(current_frame()->current_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
// Use the full quad_rect for debug quads to not move the edges based on
// partial swaps.
@@ -118,71 +101,67 @@ index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
@@ -1979,8 +1984,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -1979,7 +1984,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
- quad_color_space,
- current_frame()->current_render_pass->color_space);
- quad_color_space, CurrentRenderPassColorSpace());
+ PATCH_CS(quad_color_space),
+ PATCH_CS(current_frame()->current_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
SetShaderColor(color, opacity);
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -2135,8 +2140,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
@@ -2134,7 +2140,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
: NON_PREMULTIPLIED_ALPHA,
false, false, tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
- quad_resource_lock.color_space(),
- current_frame()->current_render_pass->color_space);
- quad_resource_lock.color_space(), CurrentRenderPassColorSpace());
+ PATCH_CS(quad_resource_lock.color_space()),
+ PATCH_CS(current_frame()->current_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2232,8 +2237,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
@@ -2230,7 +2237,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
- quad_resource_lock.color_space(),
- current_frame()->current_render_pass->color_space);
- quad_resource_lock.color_space(), CurrentRenderPassColorSpace());
+ PATCH_CS(quad_resource_lock.color_space()),
+ PATCH_CS(current_frame()->current_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2336,7 +2341,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
@@ -2332,7 +2340,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
// The source color space should never be RGB.
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
gfx::ColorSpace dst_color_space =
- current_frame()->current_render_pass->color_space;
+ PATCH_CS(current_frame()->current_render_pass->color_space);
- gfx::ColorSpace dst_color_space = CurrentRenderPassColorSpace();
+ gfx::ColorSpace dst_color_space = PATCH_CS(CurrentRenderPassColorSpace());
#if defined(OS_WIN)
// Force sRGB output on Windows for overlay candidate video quads to match
@@ -2499,8 +2504,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
@@ -2496,7 +2504,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
- lock.color_space(),
- current_frame()->current_render_pass->color_space);
- lock.color_space(), CurrentRenderPassColorSpace());
+ PATCH_CS(lock.color_space()),
+ PATCH_CS(current_frame()->current_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2562,8 +2567,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2561,8 +2570,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
- SetUseProgram(draw_cache_.program_key, locked_quad.color_space(),
- current_frame()->current_render_pass->color_space);
- CurrentRenderPassColorSpace());
+ SetUseProgram(draw_cache_.program_key, PATCH_CS(locked_quad.color_space()),
+ PATCH_CS(current_frame()->current_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -3300,7 +3305,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
@@ -3299,7 +3308,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) {
@@ -193,37 +172,41 @@ index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070
// If the input color space is PQ, and it did not specify a white level,
// override it with the frame's white level.
@@ -3683,7 +3690,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
@@ -3681,9 +3692,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
}
*overlay_texture = FindOrCreateOverlayTexture(
params.quad->render_pass_id, iosurface_width, iosurface_height,
- current_frame()->root_render_pass->color_space);
+ PATCH_CS(current_frame()->root_render_pass->color_space));
- *overlay_texture =
- FindOrCreateOverlayTexture(params.quad->render_pass_id, iosurface_width,
- iosurface_height, RootRenderPassColorSpace());
+ *overlay_texture = FindOrCreateOverlayTexture(
+ params.quad->render_pass_id, iosurface_width, iosurface_height,
+ PATCH_CS(RootRenderPassColorSpace()));
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
gfx::SizeF((*overlay_texture)->texture.size()));
@@ -3902,8 +3909,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
@@ -3902,8 +3913,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
PrepareGeometry(SHARED_BINDING);
- SetUseProgram(ProgramKey::DebugBorder(), gfx::ColorSpace::CreateSRGB(),
- current_frame()->root_render_pass->color_space);
- CurrentRenderPassColorSpace());
+ SetUseProgram(ProgramKey::DebugBorder(), PATCH_CS(gfx::ColorSpace::CreateSRGB()),
+ PATCH_CS(current_frame()->root_render_pass->color_space));
+ PATCH_CS(CurrentRenderPassColorSpace()));
gfx::Transform render_matrix;
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
@@ -4012,3 +4019,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
@@ -4012,3 +4023,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
}
} // namespace viz
+
+#undef PATCH_CS
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 34510d80f708b2e61dac8605526d7b34c484a962..3ba61b3c1fbec6e9d5d9fe62704f6a9d05c4cbdd 100644
index fcca8876d3d2ac935dd02303319b070ff6c6e099..97a21a042e2e9f2ad78ea97999de5ad1de1a5cca 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -221,6 +221,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -209,6 +209,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
// Command-line switches to propagate to the GPU process.
static const char* const kSwitchNames[] = {
@@ -232,7 +215,7 @@ index 34510d80f708b2e61dac8605526d7b34c484a962..3ba61b3c1fbec6e9d5d9fe62704f6a9d
service_manager::switches::kGpuSandboxAllowSysVShm,
service_manager::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 89fa83bbda39e90c1fcd6df83cd248c1f2de7195..8d69e9a2f2ee1ea7e639c1bfcdf42eb89a4099ff 100644
index 8205a898bc368543ffe150a641c9f04c137fc072..9aa8cb0bb65af9c506e928fdcd5b3e26c220f6a2 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -228,6 +228,7 @@
@@ -243,7 +226,7 @@ index 89fa83bbda39e90c1fcd6df83cd248c1f2de7195..8d69e9a2f2ee1ea7e639c1bfcdf42eb8
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "url/origin.h"
@@ -3083,6 +3084,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3149,6 +3150,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
@@ -252,10 +235,10 @@ index 89fa83bbda39e90c1fcd6df83cd248c1f2de7195..8d69e9a2f2ee1ea7e639c1bfcdf42eb8
service_manager::switches::kDisableInProcessStackTraces,
service_manager::switches::kDisableSeccompFilterSandbox,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index bef9630bc7a15b9b8fcebd064d4cea013e6adc4d..c376dab8247eb8352f045dbcd1b8d01a6571aaa3 100644
index 13affc02e2bde412faa258ea872640219ad0eddd..98ff1d26d92c03c83c0f8cae29c217d95e7102ee 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2853,6 +2853,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
@@ -2806,6 +2806,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);

View File

@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 954011b5d5623ddb24971e8797d3ba9c957b2e94..8e095e6cbc3408c8b884ea0cecb5f869c7b83ffd 100644
index e2160f13472a287435574edca789ead1d77bfc04..a2d741641a7a716b28975edce02753312a364de7 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -613,6 +613,9 @@ void RenderWidgetHostImpl::WasHidden() {

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 f7a30a0bd0d37b0a23ae441794f5a968e45dc3d9..74e1143f30411106b598fb7bd12f618fd439b041 100644
index 2dfa801e802a12b23dd0e37aab037a5c4e2ac819..2091d773d2122a8282c779624a87d600fd079fd1 100644
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -3896,7 +3896,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
@@ -4027,7 +4027,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

@@ -32,10 +32,10 @@ index 3fd108c89c3b070a08790850db4dfd6cc8a3ce44..c393f51709efd8b28b07edfe452d2b84
} // namespace storage
diff --git a/third_party/blink/public/mojom/dom_storage/storage_area.mojom b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
index 1f1b2c6fa109aa52c4e7c7f5fcaac91beb538449..d8f15eed9be83340ffd1f2400df08558e9554710 100644
index c9f9124eb6f4900988ad63fa38a03b7b6c5d1abb..9cba4e5af9a624d358697d806f151ee3998f0b58 100644
--- a/third_party/blink/public/mojom/dom_storage/storage_area.mojom
+++ b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
@@ -40,7 +40,8 @@ interface StorageAreaGetAllCallback {
@@ -50,7 +50,8 @@ struct KeyValue {
interface StorageArea {
// The quota for each storage area.
// This value is enforced in renderer processes and the browser process.

View File

@@ -0,0 +1,118 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Locascio <alocascio@slack-corp.com>
Date: Mon, 24 Feb 2020 13:50:29 -0800
Subject: Expose ARIA trees as tables for macOS accessibility
ARIA trees were previously un-navigable with VoiceOver on macOS. This
was because it didn't properly fulfill the NSAccessibilityRowsAttribute
attribute.
In webkit, this attribute is fulfilled by diving on the row's children
and surfacing any TreeItem elements. This CL represents a port of their
implementation.
Additionally, I noticed a confusing spot where the subrole is being
compared in a long line of role comparisons. I moved this around to be
less foot-gunny/confusing and added more attributes for the OutlineRow
subrole that macOS accessibility suggests are necessary (and exist in
the webkit implementation).
Link to webkit impl:
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm#L2836
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/accessibility/AccessibilityObject.cpp#L1804
Bug: 868480
Test: Use VoiceOver to navigate the table at https://cookiecrook.com/test/aria/tree/ariatree2.html. Note that the table is no longer announced as empty.
Change-Id: Ibb86049efa23e12875aa9aeda541e0145242e3b5
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
index 0216501dda1dc8b8fb4307785a0dab868bc3315a..f9730f71c122965f7ce7815a1b9a7b32f8a224f0 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_
#import <Cocoa/Cocoa.h>
+#include <vector>
#import "base/mac/scoped_nsobject.h"
#include "base/strings/string16.h"
@@ -75,6 +76,8 @@ struct AXTextEdit {
// left).
- (NSRect)rectInScreen:(gfx::Rect)rect;
+- (void)getTreeItemDescendantNodeIds:(std::vector<int32_t>*)tree_item_ids;
+
// Return the method name for the given attribute. For testing only.
- (NSString*)methodNameForAttribute:(NSString*)attribute;
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 1381a64458dd37d07c72c3265e46166935012cad..5a9ab09b5214f9a8c38756fb627d32b52b028539 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -2110,7 +2110,9 @@ - (NSArray*)rows {
NSMutableArray* ret = [[[NSMutableArray alloc] init] autorelease];
std::vector<int32_t> node_id_list;
- if (ui::IsTableLike(_owner->GetRole()))
+ if (_owner->GetRole() == ax::mojom::Role::kTree)
+ [self getTreeItemDescendantNodeIds:&node_id_list];
+ else if (ui::IsTableLike(_owner->GetRole()))
node_id_list = _owner->node()->GetTableRowNodeIds();
// Rows attribute for a column is the list of all the elements in that column
// at each row.
@@ -2543,6 +2545,19 @@ - (id)window {
return manager->GetWindow();
}
+- (void)getTreeItemDescendantNodeIds:(std::vector<int32_t>*)tree_item_ids {
+ for (auto it = _owner->PlatformChildrenBegin();
+ it != _owner->PlatformChildrenEnd(); ++it) {
+ const BrowserAccessibilityCocoa* child =
+ ToBrowserAccessibilityCocoa(it.get());
+
+ if ([child internalRole] == ax::mojom::Role::kTreeItem) {
+ tree_item_ids->push_back([child hash]);
+ }
+ [child getTreeItemDescendantNodeIds:tree_item_ids];
+ }
+}
+
- (NSString*)methodNameForAttribute:(NSString*)attribute {
return [attributeToMethodNameMap objectForKey:attribute];
}
@@ -3361,18 +3376,12 @@ - (NSArray*)accessibilityAttributeNames {
NSAccessibilityMaxValueAttribute, NSAccessibilityMinValueAttribute,
NSAccessibilityValueDescriptionAttribute
]];
- } else if ([subrole isEqualToString:NSAccessibilityOutlineRowSubrole]) {
- [ret addObjectsFromArray:@[
- NSAccessibilityDisclosingAttribute,
- NSAccessibilityDisclosedByRowAttribute,
- NSAccessibilityDisclosureLevelAttribute,
- NSAccessibilityDisclosedRowsAttribute
- ]];
} else if ([role isEqualToString:NSAccessibilityRowRole]) {
BrowserAccessibility* container = _owner->PlatformGetParent();
if (container && container->GetRole() == ax::mojom::Role::kRowGroup)
container = container->PlatformGetParent();
- if (container && container->GetRole() == ax::mojom::Role::kTreeGrid) {
+ if ([subrole isEqualToString:NSAccessibilityOutlineRowSubrole] ||
+ (container && container->GetRole() == ax::mojom::Role::kTreeGrid)) {
[ret addObjectsFromArray:@[
NSAccessibilityDisclosingAttribute,
NSAccessibilityDisclosedByRowAttribute,
@@ -3387,6 +3396,13 @@ - (NSArray*)accessibilityAttributeNames {
NSAccessibilitySelectedChildrenAttribute,
NSAccessibilityVisibleChildrenAttribute
]];
+ } else if ([role isEqualToString:NSAccessibilityOutlineRole]) {
+ [ret addObjectsFromArray:@[
+ NSAccessibilitySelectedRowsAttribute,
+ NSAccessibilityRowsAttribute,
+ NSAccessibilityColumnsAttribute,
+ NSAccessibilityOrientationAttribute
+ ]];
}
// Caret navigation and text selection attributes.

View File

@@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970
DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
};
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 7e7e50880804583acf75206d3f5f1c6f4c3b158d..3e69113249366e4bb6e62a9fe7085f608dd59755 100644
index 1e73a5c4eb015bcbfacb4f7ae0a36f3855f320a6..0b8cc7a550422445e4c07800682b5f60277a39d2 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -991,6 +991,13 @@ void NetworkContext::SetNetworkConditions(
@@ -978,6 +978,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index 7e7e50880804583acf75206d3f5f1c6f4c3b158d..3e69113249366e4bb6e62a9fe7085f60
// This may only be called on NetworkContexts created with the constructor
// that calls MakeURLRequestContext().
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 67f0e98426345beac34bfd41be384210be5911e4..b6fcd9920fcc047d58501dccc492bb0a118e654f 100644
index 68a8a0e228103ea4e9fe58f416a53587b2d26f6e..7c3055e6250b693546c29ac315ce3f418ab478f8 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -234,6 +234,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -231,6 +231,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
mojom::NetworkConditionsPtr conditions) override;
@@ -63,10 +63,10 @@ index 67f0e98426345beac34bfd41be384210be5911e4..b6fcd9920fcc047d58501dccc492bb0a
void SetEnableReferrers(bool enable_referrers) override;
#if defined(OS_CHROMEOS)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 6adfd8969148daba3f77aea4c5f89adec6338e6b..78fd4bd72b07f38b447840b584253883756fe021 100644
index 4729cc2bc74d410100a0c1946b867cd5d8428d31..f6672a20f1eb0914b8e103ae38079e9e0e6bfbdc 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -984,6 +984,9 @@ interface NetworkContext {
@@ -1001,6 +1001,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);

View File

@@ -26,10 +26,10 @@ index c20f1455d9d81e6780deecdebfb1f1b4e125db66..8a933b20b4d5ca8c2c55c881e95695d8
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 782dd1d122bfab4990c924a7fb0e7276fb51b18b..8ff66638296fefd66443ea83436258b07235aded 100644
index 20df4f2086bcc5aa572115ab32ac22348c196c03..f1e66535d690e9bb905058f58e7ccda0a5262335 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -449,6 +449,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -455,6 +455,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
ColorId color_id,
ColorScheme color_scheme = ColorScheme::kDefault) const = 0;
@@ -52,7 +52,7 @@ index 782dd1d122bfab4990c924a7fb0e7276fb51b18b..8ff66638296fefd66443ea83436258b0
// Returns a shared instance of the native theme that should be used for web
// rendering. Do not use it in a normal application context (i.e. browser).
// The returned object should not be deleted by the caller. This function is
@@ -573,6 +589,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -579,6 +595,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
PreferredColorScheme preferred_color_scheme_ =
PreferredColorScheme::kNoPreference;

View File

@@ -0,0 +1,58 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Tue, 25 Feb 2020 13:28:30 -0800
Subject: feat: add support for overriding the base spellchecker download URL
This patch is required as the testing-only method we were using does not
take into account the dictionary name and therefore will not work for
production use cases. This is unlikely to be upstreamed as the change
is entirely in //chrome.
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index 0fb84989f9b2f84ec2a2589dda3d91cf59c0adda..9ff5b33d2885c5532e1496711c27a01c8502725c 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -48,6 +48,9 @@ namespace {
base::LazyInstance<GURL>::Leaky g_download_url_for_testing =
LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<GURL>::Leaky g_base_download_url_override =
+ LAZY_INSTANCE_INITIALIZER;
+
// Close the file.
void CloseDictionary(base::File file) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
@@ -247,6 +250,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
g_download_url_for_testing.Get() = url;
}
+void SpellcheckHunspellDictionary::SetBaseDownloadURL(const GURL url) {
+ g_base_download_url_override.Get() = url;
+}
+
GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
if (g_download_url_for_testing.Get() != GURL())
return g_download_url_for_testing.Get();
@@ -254,6 +261,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
DCHECK(!bdict_file.empty());
+ if (g_base_download_url_override.Get() != GURL())
+ return GURL(g_base_download_url_override.Get().spec() + base::ToLowerASCII(bdict_file));
+
static const char kDownloadServerUrl[] =
"https://redirector.gvt1.com/edgedl/chrome/dict/";
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index 4af3201238dfec14bd5a4241b662ca52799e6862..4662bdc08b54304a7f8b2995f60fea9dc5617fff 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -85,6 +85,8 @@ class SpellcheckHunspellDictionary
// Tests use this method to set a custom URL for downloading dictionaries.
static void SetDownloadURLForTesting(const GURL url);
+ static void SetBaseDownloadURL(const GURL url);
+
private:
// Dictionary download status.
enum DownloadStatus {

View File

@@ -6,7 +6,7 @@ Subject: feat: allow disabling blink scheduler throttling per RenderView
This allows us to disable throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 26df70e508cd60ddc96d668697e76542a7f1cd2c..dd3eb6426bdeeb641f551be6f92665589823e597 100644
index 660ed00ae8a22287b2dbe090374cdb032ba3e7eb..bdac4bd7dd6ff5fe5d6de6cd9f573d9a9f092f51 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -432,6 +432,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -33,7 +33,7 @@ index 2f666f75debc36767a9746bdfb2c99d7c8ee71a0..0ed154e56ad144750ecf0cc25118e00d
void UpdateWebkitPreferences(const WebPreferences& prefs) override;
void OnWebkitPreferencesChanged() override;
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 18d157538ec3cc6a6bfde3eda3873d61336ed649..54d7085355e42e5d7ced7262b6b6e91e19b24e9e 100644
index 9dfdaf825b2288bc4975c898f331881263b80431..0057459007983424e08ffd7a5e8a4a87c8b7a9bf 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -109,6 +109,9 @@ IPC_STRUCT_TRAITS_END()
@@ -61,20 +61,20 @@ index 95679ab2915ad496ca0018aa13874b84eb11d7fd..c278e0fc072409677beafc7f252ebcf6
//
// Returns the current WebKit preferences. Note: WebPreferences is cached, so
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 463906df3f761bb321c8580185c5e12dceb96854..053abd33b8f73b0f12a7729b507914516dff584e 100644
index cc33b1b54e812e0284b4c66b228b3a0a8b88e85f..5d5e06fc90bd09458054720b03436cae80111370 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1192,6 +1192,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
@@ -1188,6 +1188,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale)
IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetSchedulerThrottling,
+ OnSetSchedulerThrottling)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
@@ -1748,6 +1750,12 @@ void RenderViewImpl::OnSetPageScale(float page_scale_factor) {
webview()->SetPageScaleFactor(page_scale_factor);
@@ -1733,6 +1735,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
return send_content_state_immediately_;
}
+void RenderViewImpl::OnSetSchedulerThrottling(bool allowed) {
@@ -87,10 +87,10 @@ index 463906df3f761bb321c8580185c5e12dceb96854..053abd33b8f73b0f12a7729b50791451
PageVisibilityState visibility_state,
bool initial_setting) {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index edefd461a9d6b127886a2e84355a3a99e891ade7..af5fc0cc3334e66368c1780b4e79e923aeac1394 100644
index 828303a718e17c98c4dfd6222a482c5d978b5762..3ccbbd3d012e065ab839c1a7ac2f1d2641e4dde6 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -440,6 +440,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
@@ -424,6 +424,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
void OnSetInitialFocus(bool reverse);
void OnSetRendererPrefs(
const blink::mojom::RendererPreferences& renderer_prefs);
@@ -111,10 +111,10 @@ index a6d03eca18db4566002d71ec0b6aedae39a78be7..5eaf6fa6e7568d89d3051617f3ac99b3
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 7f58ed742695387c9516dd5c5c3f195e66348cfc..0688b04bc98cecc7506aa69af6b1c2a355dddf62 100644
index cee2e9a8c2d72ce27d3496023f102a231390cec5..bbe4ffef747c01d8fd2fe8722d068109355160b7 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3334,12 +3334,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3332,12 +3332,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -138,10 +138,10 @@ index 7f58ed742695387c9516dd5c5c3f195e66348cfc..0688b04bc98cecc7506aa69af6b1c2a3
PageVisibilityState WebViewImpl::GetVisibilityState() {
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index 710607bd9112b399e14826105e45f5bf93ab6524..dafc73dc85222298a3e027433939632f4fddb9c1 100644
index 4cd0387325448e568de6baff3f8eae18498498ea..5a4a4dafc5ec2aa983f4501a203c9f2e5345600a 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -310,6 +310,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -313,6 +313,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -149,7 +149,7 @@ index 710607bd9112b399e14826105e45f5bf93ab6524..dafc73dc85222298a3e027433939632f
void SetVisibilityState(PageVisibilityState visibility_state,
bool is_initial_state) override;
PageVisibilityState GetVisibilityState() override;
@@ -680,6 +681,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -684,6 +685,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// WebViewImpl::Close while handling an input event.
bool debug_inside_input_handling_ = false;

View File

@@ -0,0 +1,64 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Sun, 1 Mar 2020 16:33:55 -0800
Subject: feat: allow embedders to add observers on created hunspell
dictionaries
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 0dc509bafcfab2637aab4ea55769cd06ad3492c9..3b1f02e354c5c5a85e9193859ca8e7497f02cf86 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -284,6 +284,9 @@ void SpellcheckService::LoadHunspellDictionaries() {
std::make_unique<SpellcheckHunspellDictionary>(dictionary, context_,
this));
hunspell_dictionaries_.back()->AddObserver(this);
+ if (hunspell_observer_) {
+ hunspell_dictionaries_.back()->AddObserver(hunspell_observer_);
+ }
hunspell_dictionaries_.back()->Load();
}
@@ -297,6 +300,20 @@ SpellcheckService::GetHunspellDictionaries() {
return hunspell_dictionaries_;
}
+void SpellcheckService::SetHunspellObserver(SpellcheckHunspellDictionary::Observer* observer) {
+ if (hunspell_observer_) {
+ for (auto& dict : hunspell_dictionaries_) {
+ dict->RemoveObserver(hunspell_observer_);
+ }
+ }
+ if (observer) {
+ for (auto& dict : hunspell_dictionaries_) {
+ dict->AddObserver(observer);
+ }
+ }
+ hunspell_observer_ = observer;
+}
+
bool SpellcheckService::LoadExternalDictionary(std::string language,
std::string locale,
std::string path,
diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h
index 557a0a2a91821a595181481f92b2a2a06dcb1f50..59e24da4be927303df8c4aac87f50778c1c208b0 100644
--- a/chrome/browser/spellchecker/spellcheck_service.h
+++ b/chrome/browser/spellchecker/spellcheck_service.h
@@ -116,6 +116,8 @@ class SpellcheckService : public KeyedService,
const std::vector<std::unique_ptr<SpellcheckHunspellDictionary>>&
GetHunspellDictionaries();
+ void SetHunspellObserver(SpellcheckHunspellDictionary::Observer* observer);
+
// Load a dictionary from a given path. Format specifies how the dictionary
// is stored. Return value is true if successful.
bool LoadExternalDictionary(std::string language,
@@ -213,6 +215,8 @@ class SpellcheckService : public KeyedService,
// A pointer to the BrowserContext which this service refers to.
content::BrowserContext* context_;
+ SpellcheckHunspellDictionary::Observer* hunspell_observer_ = nullptr;
+
std::unique_ptr<SpellCheckHostMetrics> metrics_;
std::unique_ptr<SpellcheckCustomDictionary> custom_dictionary_;

View File

@@ -0,0 +1,636 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Dill <andy.dill@gmail.com>
Date: Thu, 30 Jan 2020 09:36:07 -0800
Subject: feat: enable off-screen rendering with viz compositor
This patch adds hooks in the relevant places that allow for off-screen
rendering with the viz compositor by way of a custom HostDisplayClient
and LayeredWindowUpdater.
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
index 3547ee865c22..715bfa4b5db5 100644
--- a/components/viz/host/host_display_client.cc
+++ b/components/viz/host/host_display_client.cc
@@ -43,9 +43,13 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
}
#endif
-#if defined(OS_WIN)
+void HostDisplayClient::IsOffscreen(IsOffscreenCallback callback) {
+ std::move(callback).Run(false);
+}
+
void HostDisplayClient::CreateLayeredWindowUpdater(
mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) {
+#if defined(OS_WIN)
if (!NeedsToUseLayerWindow(widget_)) {
DLOG(ERROR) << "HWND shouldn't be using a layered window";
return;
@@ -53,8 +57,12 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
layered_window_updater_ =
std::make_unique<LayeredWindowUpdaterImpl>(widget_, std::move(receiver));
-}
+#else
+ CHECK(false) << "Chromium is calling CreateLayeredWindowUpdater for non-OSR "
+ "windows on POSIX platforms, something is wrong with "
+ "Electron's OSR implementation.";
#endif
+}
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
index cedf833d2358..4437a7875076 100644
--- a/components/viz/host/host_display_client.h
+++ b/components/viz/host/host_display_client.h
@@ -31,17 +31,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
mojo::PendingRemote<mojom::DisplayClient> GetBoundRemote(
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
- private:
+ protected:
// mojom::DisplayClient implementation:
+ void IsOffscreen(IsOffscreenCallback callback) override;
+
#if defined(OS_MACOSX)
void OnDisplayReceivedCALayerParams(
const gfx::CALayerParams& ca_layer_params) override;
#endif
-#if defined(OS_WIN)
void CreateLayeredWindowUpdater(
mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) override;
-#endif
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
diff --git a/components/viz/host/layered_window_updater_impl.cc b/components/viz/host/layered_window_updater_impl.cc
index b04f654fe820..ee22012b01ef 100644
--- a/components/viz/host/layered_window_updater_impl.cc
+++ b/components/viz/host/layered_window_updater_impl.cc
@@ -44,7 +44,9 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory(
// |region|'s handle will close when it goes out of scope.
}
-void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) {
+void LayeredWindowUpdaterImpl::Draw(
+ const gfx::Rect& damage_rect,
+ DrawCallback draw_callback) {
TRACE_EVENT0("viz", "LayeredWindowUpdaterImpl::Draw");
if (!canvas_) {
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
index 1026b739d283..fe562ab60ce9 100644
--- a/components/viz/host/layered_window_updater_impl.h
+++ b/components/viz/host/layered_window_updater_impl.h
@@ -35,7 +35,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
// mojom::LayeredWindowUpdater implementation.
void OnAllocatedSharedMemory(const gfx::Size& pixel_size,
base::UnsafeSharedMemoryRegion region) override;
- void Draw(DrawCallback draw_callback) override;
+ void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override;
private:
const HWND hwnd_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 7a1277ad28ed..d09e6480b18d 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -111,6 +111,8 @@ viz_component("service") {
"display_embedder/output_surface_provider_impl.h",
"display_embedder/server_shared_bitmap_manager.cc",
"display_embedder/server_shared_bitmap_manager.h",
+ "display_embedder/software_output_device_proxy.cc",
+ "display_embedder/software_output_device_proxy.h",
"display_embedder/software_output_surface.cc",
"display_embedder/software_output_surface.h",
"display_embedder/viz_process_context_provider.cc",
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
index 97feccc71b94..c267d1e72ec6 100644
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
@@ -21,6 +21,7 @@
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
#include "components/viz/service/display_embedder/skia_output_surface_dependency_impl.h"
#include "components/viz/service/display_embedder/skia_output_surface_impl.h"
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
#include "components/viz/service/display_embedder/software_output_surface.h"
#include "components/viz/service/display_embedder/viz_process_context_provider.h"
#include "components/viz/service/gl/gpu_service_impl.h"
@@ -34,6 +35,7 @@
#include "gpu/ipc/scheduler_sequence.h"
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
#include "gpu/ipc/service/image_transport_surface.h"
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/init/gl_factory.h"
@@ -242,6 +244,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
if (headless_)
return std::make_unique<SoftwareOutputDevice>();
+#if !defined(OS_MACOSX)
+ {
+ mojo::ScopedAllowSyncCallForTesting allow_sync;
+ DCHECK(display_client);
+ bool offscreen = false;
+ if (display_client->IsOffscreen(&offscreen) && offscreen) {
+ mojom::LayeredWindowUpdaterPtr layered_window_updater;
+ display_client->CreateLayeredWindowUpdater(
+ mojo::MakeRequest(&layered_window_updater));
+
+ return std::make_unique<SoftwareOutputDeviceProxy>(
+ std::move(layered_window_updater));
+ }
+ }
+#endif
+
#if defined(OS_WIN)
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
display_client);
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
index b9357082293c..b4cb07e26d15 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
SkCanvas* SoftwareOutputDeviceMac::BeginPaint(
const gfx::Rect& new_damage_rect) {
+ last_damage = new_damage_rect;
+
// Record the previous paint buffer.
Buffer* previous_paint_buffer =
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
@@ -184,6 +186,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
ca_layer_params.is_empty = false;
ca_layer_params.scale_factor = scale_factor_;
ca_layer_params.pixel_size = pixel_size_;
+ ca_layer_params.damage = last_damage;
ca_layer_params.io_surface_mach_port.reset(
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
index f3867356e3d6..b1d192d2b20c 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.h
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer,
const SkRegion& new_damage_rect);
+ gfx::Rect last_damage;
gfx::Size pixel_size_;
float scale_factor_ = 1;
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc
new file mode 100644
index 000000000000..4efea02f80f8
--- /dev/null
+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc
@@ -0,0 +1,157 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
+
+#include "base/memory/unsafe_shared_memory_region.h"
+#include "base/threading/thread_checker.h"
+#include "base/trace_event/trace_event.h"
+#include "components/viz/common/resources/resource_sizes.h"
+#include "components/viz/service/display_embedder/output_device_backing.h"
+#include "mojo/public/cpp/system/platform_handle.h"
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
+#include "skia/ext/platform_canvas.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/gfx/skia_util.h"
+
+#if defined(OS_WIN)
+#include "skia/ext/skia_utils_win.h"
+#include "ui/gfx/gdi_util.h"
+#include "ui/gfx/win/hwnd_util.h"
+#else
+#include "mojo/public/cpp/base/shared_memory_utils.h"
+#endif
+
+namespace viz {
+
+SoftwareOutputDeviceBase::~SoftwareOutputDeviceBase() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ DCHECK(!in_paint_);
+}
+
+void SoftwareOutputDeviceBase::Resize(const gfx::Size& viewport_pixel_size,
+ float scale_factor) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ DCHECK(!in_paint_);
+
+ if (viewport_pixel_size_ == viewport_pixel_size)
+ return;
+
+ viewport_pixel_size_ = viewport_pixel_size;
+ ResizeDelegated();
+}
+
+SkCanvas* SoftwareOutputDeviceBase::BeginPaint(
+ const gfx::Rect& damage_rect) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ DCHECK(!in_paint_);
+
+ damage_rect_ = damage_rect;
+ in_paint_ = true;
+ return BeginPaintDelegated();
+}
+
+void SoftwareOutputDeviceBase::EndPaint() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ DCHECK(in_paint_);
+
+ in_paint_ = false;
+
+ gfx::Rect intersected_damage_rect = damage_rect_;
+ intersected_damage_rect.Intersect(gfx::Rect(viewport_pixel_size_));
+ if (intersected_damage_rect.IsEmpty())
+ return;
+
+ EndPaintDelegated(intersected_damage_rect);
+}
+
+SoftwareOutputDeviceProxy::~SoftwareOutputDeviceProxy() = default;
+
+SoftwareOutputDeviceProxy::SoftwareOutputDeviceProxy(
+ mojom::LayeredWindowUpdaterPtr layered_window_updater)
+ : layered_window_updater_(std::move(layered_window_updater)) {
+ DCHECK(layered_window_updater_.is_bound());
+}
+
+void SoftwareOutputDeviceProxy::OnSwapBuffers(
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) {
+ DCHECK(swap_ack_callback_.is_null());
+
+ // We aren't waiting on DrawAck() and can immediately run the callback.
+ if (!waiting_on_draw_ack_) {
+ task_runner_->PostTask(FROM_HERE,
+ base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_));
+ return;
+ }
+
+ swap_ack_callback_ = std::move(swap_ack_callback);
+}
+
+void SoftwareOutputDeviceProxy::ResizeDelegated() {
+ canvas_.reset();
+
+ size_t required_bytes;
+ if (!ResourceSizes::MaybeSizeInBytes(
+ viewport_pixel_size_, ResourceFormat::RGBA_8888, &required_bytes)) {
+ DLOG(ERROR) << "Invalid viewport size " << viewport_pixel_size_.ToString();
+ return;
+ }
+
+ base::UnsafeSharedMemoryRegion region =
+ base::UnsafeSharedMemoryRegion::Create(required_bytes);
+ if (!region.IsValid()) {
+ DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes";
+ return;
+ }
+
+ #if defined(WIN32)
+ canvas_ = skia::CreatePlatformCanvasWithSharedSection(
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
+ region.GetPlatformHandle(), skia::CRASH_ON_FAILURE);
+ #else
+ shm_mapping_ = region.Map();
+ if (!shm_mapping_.IsValid()) {
+ DLOG(ERROR) << "Failed to map " << required_bytes << " bytes";
+ return;
+ }
+
+ canvas_ = skia::CreatePlatformCanvasWithPixels(
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
+ static_cast<uint8_t*>(shm_mapping_.memory()), skia::CRASH_ON_FAILURE);
+ #endif
+
+ // Transfer region ownership to the browser process.
+ layered_window_updater_->OnAllocatedSharedMemory(viewport_pixel_size_,
+ std::move(region));
+}
+
+SkCanvas* SoftwareOutputDeviceProxy::BeginPaintDelegated() {
+ return canvas_.get();
+}
+
+void SoftwareOutputDeviceProxy::EndPaintDelegated(
+ const gfx::Rect& damage_rect) {
+ DCHECK(!waiting_on_draw_ack_);
+
+ if (!canvas_)
+ return;
+
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
+ &SoftwareOutputDeviceProxy::DrawAck, base::Unretained(this)));
+ waiting_on_draw_ack_ = true;
+
+ TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceProxy::Draw", this);
+}
+
+void SoftwareOutputDeviceProxy::DrawAck() {
+ DCHECK(waiting_on_draw_ack_);
+ DCHECK(!swap_ack_callback_.is_null());
+
+ TRACE_EVENT_ASYNC_END0("viz", "SoftwareOutputDeviceProxy::Draw", this);
+
+ waiting_on_draw_ack_ = false;
+ std::move(swap_ack_callback_).Run(viewport_pixel_size_);
+}
+
+} // namespace viz
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h
new file mode 100644
index 000000000000..48fa86caaab3
--- /dev/null
+++ b/components/viz/service/display_embedder/software_output_device_proxy.h
@@ -0,0 +1,90 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
+#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
+
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
+#include <memory>
+
+#include "base/memory/shared_memory_mapping.h"
+#include "base/threading/thread_checker.h"
+#include "components/viz/host/host_display_client.h"
+#include "components/viz/service/display/software_output_device.h"
+#include "components/viz/service/viz_service_export.h"
+#include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
+
+namespace viz {
+
+// Shared base class for SoftwareOutputDevice implementations.
+class SoftwareOutputDeviceBase : public SoftwareOutputDevice {
+ public:
+ SoftwareOutputDeviceBase() = default;
+ ~SoftwareOutputDeviceBase() override;
+
+ // SoftwareOutputDevice implementation.
+ void Resize(const gfx::Size& viewport_pixel_size,
+ float scale_factor) override;
+ SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
+ void EndPaint() override;
+
+ // Called from Resize() if |viewport_pixel_size_| has changed.
+ virtual void ResizeDelegated() = 0;
+
+ // Called from BeginPaint() and should return an SkCanvas.
+ virtual SkCanvas* BeginPaintDelegated() = 0;
+
+ // Called from EndPaint() if there is damage.
+ virtual void EndPaintDelegated(const gfx::Rect& damage_rect) = 0;
+
+ private:
+ bool in_paint_ = false;
+
+ THREAD_CHECKER(thread_checker_);
+
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceBase);
+};
+
+// SoftwareOutputDevice implementation that draws indirectly. An implementation
+// of mojom::LayeredWindowUpdater in the browser process handles the actual
+// drawing. Pixel backing is in SharedMemory so no copying between processes
+// is required.
+class SoftwareOutputDeviceProxy : public SoftwareOutputDeviceBase {
+ public:
+ explicit SoftwareOutputDeviceProxy(
+ mojom::LayeredWindowUpdaterPtr layered_window_updater);
+ ~SoftwareOutputDeviceProxy() override;
+
+ // SoftwareOutputDevice implementation.
+ void OnSwapBuffers(SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) override;
+
+ // SoftwareOutputDeviceBase implementation.
+ void ResizeDelegated() override;
+ SkCanvas* BeginPaintDelegated() override;
+ void EndPaintDelegated(const gfx::Rect& rect) override;
+
+ private:
+ // Runs |swap_ack_callback_| after draw has happened.
+ void DrawAck();
+
+ mojom::LayeredWindowUpdaterPtr layered_window_updater_;
+
+ std::unique_ptr<SkCanvas> canvas_;
+ bool waiting_on_draw_ack_ = false;
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback_;
+
+#if !defined(WIN32)
+ base::WritableSharedMemoryMapping shm_mapping_;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceProxy);
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
index bb07c338fac5..e0ebb98d9a02 100644
--- a/components/viz/service/display_embedder/software_output_device_win.cc
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
@@ -268,7 +268,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
if (!canvas_)
return;
- layered_window_updater_->Draw(base::BindOnce(
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
&SoftwareOutputDeviceWinProxy::DrawAck, base::Unretained(this)));
waiting_on_draw_ack_ = true;
diff --git a/mojo/public/cpp/bindings/sync_call_restrictions.h b/mojo/public/cpp/bindings/sync_call_restrictions.h
index ac94eab98fd0..b89d52a0c869 100644
--- a/mojo/public/cpp/bindings/sync_call_restrictions.h
+++ b/mojo/public/cpp/bindings/sync_call_restrictions.h
@@ -29,6 +29,7 @@ class HostContextFactoryPrivate;
namespace viz {
class HostFrameSinkManager;
+class GpuDisplayProvider;
}
namespace mojo {
@@ -82,6 +83,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
// For preventing frame swaps of wrong size during resize on Windows.
// (https://crbug.com/811945)
friend class ui::HostContextFactoryPrivate;
+ // For query of whether to use SoftwareOutputDevice or not
+ friend class viz::GpuDisplayProvider;
// END ALLOWED USAGE.
#if ENABLE_SYNC_CALL_RESTRICTIONS
diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom
index 609ded904478..2e6a7c8808d3 100644
--- a/services/viz/privileged/mojom/compositing/display_private.mojom
+++ b/services/viz/privileged/mojom/compositing/display_private.mojom
@@ -75,12 +75,14 @@ interface DisplayPrivate {
};
interface DisplayClient {
+ [Sync]
+ IsOffscreen() => (bool success);
+
[EnableIf=is_mac]
OnDisplayReceivedCALayerParams(gfx.mojom.CALayerParams ca_layer_params);
// Creates a LayeredWindowUpdater implementation to draw into a layered
// window.
- [EnableIf=is_win]
CreateLayeredWindowUpdater(pending_receiver<LayeredWindowUpdater> receiver);
// Notifies that a swap has occurred and provides information about the pixel
diff --git a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
index 6b7fbb6cf13d..e2af75168cb9 100644
--- a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
+++ b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
@@ -26,5 +26,5 @@ interface LayeredWindowUpdater {
// Draws to the HWND by copying pixels from shared memory. Callback must be
// called after draw operation is complete to signal shared memory can be
// modified.
- Draw() => ();
+ Draw(gfx.mojom.Rect damage_rect) => ();
};
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 443406844ecf..0b4ca067fe1e 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -66,6 +66,7 @@ class GpuMemoryBufferManager;
namespace viz {
class ContextProvider;
+class HostDisplayClient;
class HostFrameSinkManager;
class LocalSurfaceIdAllocation;
class RasterContextProvider;
@@ -166,6 +167,15 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0;
};
+class COMPOSITOR_EXPORT CompositorDelegate {
+ public:
+ virtual std::unique_ptr<viz::HostDisplayClient> CreateHostDisplayClient(
+ ui::Compositor* compositor) = 0;
+
+ protected:
+ virtual ~CompositorDelegate() {}
+};
+
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -205,6 +215,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
+ CompositorDelegate* delegate() const { return delegate_; }
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
+
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -422,6 +435,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;
+ CompositorDelegate* delegate_ = nullptr;
+
// The root of the Layer tree drawn by this compositor.
Layer* root_layer_ = nullptr;
diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc
index 1db09f76243c..f07cd7a5098b 100644
--- a/ui/compositor/host/host_context_factory_private.cc
+++ b/ui/compositor/host/host_context_factory_private.cc
@@ -112,8 +112,13 @@ void HostContextFactoryPrivate::ConfigureCompositor(
compositor_data.display_private.reset();
root_params->display_private =
compositor_data.display_private.BindNewEndpointAndPassReceiver();
- compositor_data.display_client =
- std::make_unique<HostDisplayClient>(compositor);
+ if (compositor->delegate()) {
+ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient(
+ compositor);
+ } else {
+ compositor_data.display_client =
+ std::make_unique<HostDisplayClient>(compositor);
+ }
root_params->display_client =
compositor_data.display_client->GetBoundRemote(resize_task_runner_);
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
index 4014e64a75da..25e57784e1a1 100644
--- a/ui/gfx/ca_layer_params.h
+++ b/ui/gfx/ca_layer_params.h
@@ -6,6 +6,7 @@
#define UI_GFX_CA_LAYER_PARAMS_H_
#include "build/build_config.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gfx_export.h"
@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams {
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
#endif
+ gfx::Rect damage;
+
// The geometry of the frame.
gfx::Size pixel_size;
float scale_factor = 1.f;
diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom
index a73b2e678ffe..6c36626d204c 100644
--- a/ui/gfx/mojom/ca_layer_params.mojom
+++ b/ui/gfx/mojom/ca_layer_params.mojom
@@ -18,5 +18,6 @@ struct CALayerParams {
bool is_empty;
CALayerContent content;
gfx.mojom.Size pixel_size;
+ gfx.mojom.Rect damage;
float scale_factor;
};
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
index 843d5c24ec33..0ea594950fcd 100644
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
if (!data.ReadPixelSize(&out->pixel_size))
return false;
+ if (!data.ReadDamage(&out->damage))
+ return false;
+
out->scale_factor = data.scale_factor();
return true;
}
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
index 4cac766eae31..0821495ad229 100644
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
return ca_layer_params.pixel_size;
}
+ static gfx::Rect damage(const gfx::CALayerParams& ca_layer_params) {
+ return ca_layer_params.damage;
+ }
+
static float scale_factor(const gfx::CALayerParams& ca_layer_params) {
return ca_layer_params.scale_factor;
}

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Fri, 14 Feb 2020 13:35:47 -0800
Subject: fix: route mouse event navigations through the web_contents delegate
This ensures that embedders can handle browser-side mouse navigations
themselves. We need this so that we can correctly ensure that processes
are not restarted for in-document navigations.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1769525
This patch can be removed once app.allowRendererProcessReuse is forced
to true as then Chromiums assumptions around processes become correct.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2cdc3785010b78d74bb980de9211622130a3c072..d45314c55e6b7a9412e2a7f07de33a16361a0338 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2358,11 +2358,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
WebContentsImpl* outermost = GetOutermostWebContents();
if (event.button == blink::WebPointerProperties::Button::kBack &&
outermost->controller_.CanGoBack()) {
- outermost->controller_.GoBack();
+ if (delegate_->OnGoToEntryOffset(-1))
+ outermost->controller_.GoBack();
return true;
} else if (event.button == blink::WebPointerProperties::Button::kForward &&
outermost->controller_.CanGoForward()) {
- outermost->controller_.GoForward();
+ if (delegate_->OnGoToEntryOffset(1))
+ outermost->controller_.GoForward();
return true;
}
}

View File

@@ -10,10 +10,10 @@ Should be removed once grit is fixed.
Tracking bug: https://crbug.com/1040605
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 9def0bb9dda87c476fdf3b52ce4d4125f37c7f49..90c81d2a9711d88284d960149e25db55ae8dc1c2 100644
index 9043b1e7a60282701ced0b9f36726a9b2b1adcd9..14c15ca63ec3d0d76f51dba18c149134ee5dde9a 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -573,15 +573,16 @@
@@ -578,15 +578,16 @@
"includes": [3840],
},

View File

@@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index e911c3aa1cf13b17bd43ad8c9d50f0fd59996907..373e36eb61d57e1bcd98d45419ee4b434820bf02 100644
index 50a2551342ad6a37f7ac7635f795b7e50d325a47..1c894fc4df54af4184074501ea56d422ce6327f6 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -1185,6 +1185,24 @@ void NavigationRequest::BeginNavigation() {
@@ -1223,6 +1223,24 @@ void NavigationRequest::BeginNavigation() {
TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationRequest", this,
"ResponseStarted");
@@ -71,10 +71,10 @@ index e911c3aa1cf13b17bd43ad8c9d50f0fd59996907..373e36eb61d57e1bcd98d45419ee4b43
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 e41e833e963617cf5b2e463e839b2ae0bfd212ae..f544da86cb12d2786f7aad24953741ed77a0ac24 100644
index ad629ffc0a855f70598d8f224f55588b3c42d59d..8658faff1c65a48a10e988a709949aba283375cc 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2247,6 +2247,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -2282,6 +2282,16 @@ bool RenderFrameHostManager::InitRenderView(
scoped_refptr<SiteInstance>
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
NavigationRequest* request) {
@@ -91,7 +91,7 @@ index e41e833e963617cf5b2e463e839b2ae0bfd212ae..f544da86cb12d2786f7aad24953741ed
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
// All children of MHTML documents must be MHTML documents. They all live in
@@ -2266,10 +2276,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2301,10 +2311,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
//
// TODO(clamy): We should also consider as a candidate SiteInstance the
// speculative SiteInstance that was computed on redirects.
@@ -156,21 +156,20 @@ index e41e833e963617cf5b2e463e839b2ae0bfd212ae..f544da86cb12d2786f7aad24953741ed
// Account for renderer-initiated reload as well.
// Needed as a workaround for https://crbug.com/1045524, remove it when it is
@@ -2300,6 +2360,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->GetRestoreType() != RestoreType::NONE, request->is_view_source(),
request->WasServerRedirect(), cross_origin_policy_swap);
@@ -2342,6 +2402,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->dest_site_instance() != dest_site_instance) {
request->ResetStateForSiteInstanceChange();
}
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
+ render_frame_host_.get(), dest_site_instance.get());
+
return dest_site_instance;
}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index eb20d84de260b35049cac72fdc8d0645688fdd9a..eb3106ece80f3b347b7b13efbd77b11a60e03169 100644
index 9dbc9bb7114e1dea5e8a24395f39bd9d068eeb76..31bddf69f2e805451d42d1a284a53f41bdaa5650 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -427,6 +427,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
@@ -426,6 +426,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
return browsing_instance_->HasSiteInstance(url);
}
@@ -194,10 +193,10 @@ index caa100b3889e17a9afdc8127e0e13bb6b86e8042..f08d3a2eb28f0f6fff89b5759eff5369
size_t GetRelatedActiveContentsCount() override;
bool RequiresDedicatedProcess() override;
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 930e043a0fdf40ef0e48a19597da567c8603878c..b6ba4dfad79d6031efd725de795bf901bab1a06c 100644
index a7000c7ee15c5c988bff448e1d762d91cd6f5141..a4ee01d118a7c4e4375bd42926a150553f3f1f92 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -50,6 +50,21 @@
@@ -58,6 +58,21 @@
namespace content {
@@ -220,10 +219,10 @@ index 930e043a0fdf40ef0e48a19597da567c8603878c..b6ba4dfad79d6031efd725de795bf901
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index f9601b5813746ce930bb7082178e1f826aaeb62e..f94bc9e640b54c6abf05bfe074ae0635d57470e8 100644
index cfb548239a9bd4582344cc332ca4c253628d7438..8beaad24a22647a6a3f8b92e4343b55ec61e1ada 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -233,8 +233,45 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -231,8 +231,45 @@ class CONTENT_EXPORT ContentBrowserClient {
using IsClipboardPasteAllowedCallback =
base::OnceCallback<void(ClipboardPasteAllowed)>;

View File

@@ -0,0 +1,69 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Fri, 28 Feb 2020 15:08:26 -0800
Subject: gpu: notify when dxdiag request for gpu info fails
We rely on the signal OnGpuInfoUpdate to process gpu info.
When Electron wants to collect the complete info in a single run
it checks for the presence of dx_diagnostics attribute, as these
are the only async calls that happens in the gpu process, but
there are times when this call can fail due to crash or software
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 bc006a1fe2f946b88f41a2cd7addbe7822f07b1e..5a7ef72f28761f185ca68e9f541079432fec6f65 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -140,6 +140,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
base::AutoLock auto_lock(lock_);
return private_->Dx12VulkanRequested();
}
+
+bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const {
+ base::AutoLock auto_lock(lock_);
+ return private_->DxdiagDx12VulkanRequested();
+}
#endif
void GpuDataManagerImpl::UpdateGpuFeatureInfo(
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index edb5af251fc305215c629c27c6536a01830ee857..42e5bdbba323dda8c3b301f2d2a49a86cf48121b 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -85,6 +85,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
void UpdateDxDiagNodeRequestStatus(bool request_continues);
void UpdateDx12VulkanRequestStatus(bool request_continues);
bool Dx12VulkanRequested() const;
+ bool DxdiagDx12VulkanRequested() const;
#endif
// Update the GPU feature info. This updates the blacklist and enabled status
// of GPU rasterization. In the future this will be used for more features.
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index e623685b9ab4b370ed5cfe25160b879a79c668cf..4185a4a63b3380d71a1af55793324ab06349055f 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -848,6 +848,11 @@ void GpuDataManagerImplPrivate::UpdateDx12VulkanRequestStatus(
bool GpuDataManagerImplPrivate::Dx12VulkanRequested() const {
return gpu_info_dx12_vulkan_requested_;
}
+
+bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const {
+ return !(gpu_info_dx12_vulkan_request_failed_ ||
+ gpu_info_dx_diag_request_failed_);
+}
#endif
void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo(
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
index 610f406e6fbeb1404f32c711dc2c53ae2fd3267c..40f2973613016f646a9f9468ad192fcb5f6fd0c7 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
@@ -72,6 +72,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
void UpdateDx12VulkanRequestStatus(bool request_continues);
void UpdateDxDiagNodeRequestStatus(bool request_continues);
bool Dx12VulkanRequested() const;
+ bool DxdiagDx12VulkanRequested() const;
#endif
void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info,
const base::Optional<gpu::GpuFeatureInfo>&

View File

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index cd531c9abd2da78f0edb718575ea219d8edd456e..9def0bb9dda87c476fdf3b52ce4d4125f37c7f49 100644
index bd7bc70c20ec0876f7526c2d0c3cf72603a42864..9043b1e7a60282701ced0b9f36726a9b2b1adcd9 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -579,6 +579,11 @@
@@ -584,6 +584,11 @@
"includes": [3860],
},

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Mon, 10 Feb 2020 11:52:23 -0800
Subject: hack plugin response interceptor to point to electron
chrome's streams_private_api does prerender and other things and would
require a largeish patch to get working, so just redirect it to our
implementation instead.
diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
index 1c9aeb8fa71d054159c2ccccccbe57aa474d417e..0bd6412f2c79f77f936720b1a0795b50ecefd26c 100644
--- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
+++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
@@ -8,8 +8,8 @@
#include "base/feature_list.h"
#include "base/guid.h"
#include "base/task/post_task.h"
-#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
-#include "chrome/browser/plugins/plugin_utils.h"
+#include "electron/shell/browser/extensions/api/streams_private/streams_private_api.h"
+#include "electron/shell/browser/plugins/plugin_utils.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_utils.h"

View File

@@ -6,13 +6,13 @@ Subject: mas-cgdisplayusesforcetogray.patch
Removes usage of the CGDisplayUsesForceToGray private API.
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 43b5ae0c4fcbbaa3fc95ed15a9b02289e45c0cff..a743edce57b31b867afbc9676ac9c3e7475e5fe9 100644
index 585d02bf08000834b941455d90d355de3f9e76a9..de80c433a2151890d50bf1248d0948fd9df1b436 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -107,7 +107,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
display.set_color_depth(Display::kDefaultBitsPerPixel);
display.set_depth_per_component(Display::kDefaultBitsPerComponent);
@@ -134,7 +134,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
display.set_color_depth(Display::kDefaultBitsPerPixel);
display.set_depth_per_component(Display::kDefaultBitsPerComponent);
}
+#ifdef MAS_BUILD
+ // This is equivalent to the CGDisplayUsesForceToGray() API as at 2018-08-06,
+ // but avoids usage of the private API.

View File

@@ -236,7 +236,7 @@ index 1c68117a8987463e810d0d1da5e7e598ce8fc3e1..ad29e87c00db0d34ee3a7d95469fb3fb
// Used to force the NSApplication's focused accessibility element to be the
// views::Views accessibility tree when the NSView for this is focused.
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index d4209f169d3e468339371e661db6ae84ed20bbe3..7223e9c769904a0aa2ba082d99d597c775e66970 100644
index 3bc6ab0565f83b6a8d2b4b94029de23e8fb8d162..99926aba86a07dd568a51eed24faac63ffd4d591 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -282,14 +282,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -262,7 +262,7 @@ index d4209f169d3e468339371e661db6ae84ed20bbe3..7223e9c769904a0aa2ba082d99d597c7
}
remote_cocoa::mojom::NativeWidgetNSWindow*
@@ -1133,6 +1141,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1122,6 +1130,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
const std::vector<uint8_t>& window_token,
const std::vector<uint8_t>& view_token) {
@@ -270,7 +270,7 @@ index d4209f169d3e468339371e661db6ae84ed20bbe3..7223e9c769904a0aa2ba082d99d597c7
remote_window_accessible_ =
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
remote_view_accessible_ =
@@ -1140,14 +1149,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1129,14 +1138,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
[remote_view_accessible_
setTopLevelUIElement:remote_window_accessible_.get()];

View File

@@ -0,0 +1,137 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:48:49 -0700
Subject: mas_disable_remote_layer.patch
Disable remote layer APIs (CAContext and CALayerHost) for MAS build.
Accordin to ccameron:
For apps that spend a lot of time watching video (especially fullscreen video),
the power/battery usage will likely increase 1.5x to 2x. For something that is,
e.g, scrolling, it'll be smaller, more like 1.15x or 1.25x.
In terms of performance, the impact will likely be fairly small -- any app that
could hit 60fps before will likely still be able to hit 60fps. There may even be
cases where performance improves when disabling remote CoreAnimation (remote
CoreAnimation is really only about battery usage).
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
index a298747e3b755acd4f8d366d625142371ed1995e..9c9bdc53016637c6d6dbb27f3581b343ec96fb97 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
@@ -20,7 +20,9 @@
#include "ui/gl/gl_surface_egl.h"
#endif
+#ifndef MAS_BUILD
@class CAContext;
+#endif
@class CALayer;
namespace ui {
@@ -97,7 +99,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
bool use_remote_layer_api_;
+#ifndef MAS_BUILD
base::scoped_nsobject<CAContext> ca_context_;
+#endif
std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_;
gfx::Size pixel_size_;
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index eb46993b8f40fdc7da35dae1b850dad637f6b47d..05a9ae47620d17b5a53f991c0b3a0a5c153b599c 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -63,6 +63,7 @@
template <typename BaseClass>
bool ImageTransportSurfaceOverlayMacBase<BaseClass>::Initialize(
gl::GLSurfaceFormat format) {
+#ifndef MAS_BUILD
// Create the CAContext to send this to the GPU process, and the layer for
// the context.
if (use_remote_layer_api_) {
@@ -71,6 +72,7 @@
[CAContext contextWithCGSConnection:connection_id options:@{}] retain]);
[ca_context_ setLayer:ca_layer_tree_coordinator_->GetCALayerForDisplay()];
}
+#endif
return true;
}
@@ -139,7 +141,9 @@
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
"width", pixel_size_.width());
if (use_remote_layer_api_) {
+#ifndef MAS_BUILD
params.ca_layer_params.ca_context_id = [ca_context_ contextId];
+#endif
} else {
IOSurfaceRef io_surface =
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
index 38f25d6314f653d7138d30c67c5ae49963863327..f2fda251ed975bd848a49b33830d329fc8954826 100644
--- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm
+++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
@@ -97,6 +97,7 @@ - (void)setContentsChanged;
}
void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) {
+#ifndef MAS_BUILD
// Early-out if the remote layer has not changed.
if ([remote_layer_ contextId] == ca_context_id)
return;
@@ -121,6 +122,9 @@ - (void)setContentsChanged;
[io_surface_layer_ removeFromSuperlayer];
io_surface_layer_.reset();
}
+#else
+ NOTREACHED() << "Remote layer is being used in MAS build";
+#endif
}
void DisplayCALayerTree::GotIOSurfaceFrame(
diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h
index 2057fe69d1bb4a2eb0b1dabc5473a30d676847fe..2aba330fc488660ef874caae26a06e6847cdaf93 100644
--- a/ui/base/cocoa/remote_layer_api.h
+++ b/ui/base/cocoa/remote_layer_api.h
@@ -13,6 +13,7 @@
#include "ui/base/ui_base_export.h"
+#ifndef MAS_BUILD
// The CGSConnectionID is used to create the CAContext in the process that is
// going to share the CALayers that it is rendering to another process to
// display.
@@ -50,6 +51,8 @@ typedef uint32_t CAContextID;
#endif // __OBJC__
+#endif // MAS_BUILD
+
namespace ui {
// This function will check if all of the interfaces listed above are supported
diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm
index bbaf9f466f4999acb5bfccf3b9565fd8f556ca2f..8c846ce9523a4b2f6fbdbdbeae4f94b45ac3c115 100644
--- a/ui/base/cocoa/remote_layer_api.mm
+++ b/ui/base/cocoa/remote_layer_api.mm
@@ -12,6 +12,7 @@
namespace ui {
bool RemoteLayerAPISupported() {
+#ifndef MAS_BUILD
static bool disabled_at_command_line =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableRemoteCoreAnimation);
@@ -46,6 +47,9 @@ bool RemoteLayerAPISupported() {
// If everything is there, we should be able to use the API.
return true;
+#else
+ return false;
+#endif // MAS_BUILD
}
} // namespace

View File

@@ -50,7 +50,7 @@ index 9cc52238971a095421c3cde01a5df24a2f6f92cd..0216501dda1dc8b8fb4307785a0dab86
// is concerned.
@property(nonatomic, readonly) NSString* subrole;
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e46166935012cad 100644
index 24d34fbb830000cedb69c18f4a463d20811e4f6c..42923fcf189c6684bb25b4093b43fabc0818454f 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -206,6 +206,7 @@
@@ -157,7 +157,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
// Returns whether or not this node should be ignored in the
// accessibility tree.
@@ -2163,6 +2180,7 @@ - (NSArray*)selectedChildren {
@@ -2167,6 +2184,7 @@ - (NSArray*)selectedChildren {
return ret;
}
@@ -165,7 +165,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
- (NSString*)selectedText {
if (![self instanceActive])
return nil;
@@ -2174,11 +2192,13 @@ - (NSString*)selectedText {
@@ -2178,11 +2196,13 @@ - (NSString*)selectedText {
return nil;
return base::SysUTF16ToNSString(range.GetText());
}
@@ -179,7 +179,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
- (NSValue*)selectedTextRange {
if (![self instanceActive])
return nil;
@@ -2199,12 +2219,15 @@ - (NSValue*)selectedTextRange {
@@ -2203,12 +2223,15 @@ - (NSValue*)selectedTextRange {
int selLength = range.GetText().length();
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
}
@@ -195,7 +195,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
- (NSValue*)size {
if (![self instanceActive])
@@ -2237,6 +2260,7 @@ - (NSString*)sortDirection {
@@ -2241,6 +2264,7 @@ - (NSString*)sortDirection {
return nil;
}
@@ -203,7 +203,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
// Returns a text marker that points to the first character in the document that
// can be selected with VoiceOver.
- (id)startTextMarker {
@@ -2247,6 +2271,7 @@ - (id)startTextMarker {
@@ -2251,6 +2275,7 @@ - (id)startTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
}
@@ -211,7 +211,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
// Returns a subrole based upon the role.
- (NSString*)subrole {
@@ -2554,11 +2579,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
@@ -2558,11 +2583,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
NSMutableAttributedString* attributedValue =
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
@@ -225,7 +225,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
return [attributedValue attributedSubstringFromRange:range];
}
@@ -2661,9 +2688,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
@@ -2665,9 +2692,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return ToBrowserAccessibilityCocoa(cell);
}
@@ -237,7 +237,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
BrowserAccessibilityPositionInstance position =
CreatePositionFromTextMarker(parameter);
if (!position->IsNullPosition())
@@ -2974,6 +3000,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -2978,6 +3004,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return CreateTextMarker(root->CreatePositionAt(index));
}
@@ -245,7 +245,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
if ([attribute isEqualToString:
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -3007,6 +3034,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -3011,6 +3038,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return nil;
}
@@ -253,7 +253,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
if ([attribute
isEqualToString:
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
@@ -3121,6 +3149,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -3125,6 +3153,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return @(child->GetIndexInParent());
}
@@ -358,10 +358,10 @@ index 7c018cce2c2d9981c94e91e5d97cff0d37548b13..cfb0fb20c81f908caac9933b820e40e0
void BluetoothAdapterMac::RemovePairingDelegateInternal(
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index 32c78e9f533782e1cfca44217a8a831959bba5e6..655bcfb43e49440ce341b11013d0620b8c2354ce 100644
index de1318ef5912375496d8cb77178bdc8a870df66e..b92f823fd8a186b2278d2442bd6fe05ef5d3796b 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -171,6 +171,12 @@ source_set("audio") {
@@ -173,6 +173,12 @@ source_set("audio") {
"mac/scoped_audio_unit.cc",
"mac/scoped_audio_unit.h",
]

View File

@@ -7,7 +7,7 @@ This adds a callback from the network service that's used to implement
session.setCertificateVerifyCallback.
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f4c3b158d 100644
index ed92b3b4f19d49fd371c9a8bad7f2124174b1c67..1e73a5c4eb015bcbfacb4f7ae0a36f3855f320a6 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -95,6 +95,11 @@
@@ -102,7 +102,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
@@ -516,6 +594,13 @@ void NetworkContext::SetClient(
@@ -497,6 +575,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -116,7 +116,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -1661,6 +1746,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -1646,6 +1731,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
base::CommandLine::ForCurrentProcess();
std::unique_ptr<net::CertVerifier> cert_verifier;
@@ -124,7 +124,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
if (g_cert_verifier_for_testing) {
cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
} else {
@@ -1714,8 +1800,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -1694,8 +1780,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
}
#endif
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
@@ -135,7 +135,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
std::make_unique<net::CoalescingCertVerifier>(
std::make_unique<net::MultiThreadedCertVerifier>(
params_->use_builtin_cert_verifier
@@ -1725,12 +1811,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -1705,12 +1791,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
cert_net_fetcher_))));
}
#endif
@@ -160,10 +160,10 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
std::unique_ptr<NetworkServiceNetworkDelegate> network_delegate =
std::make_unique<NetworkServiceNetworkDelegate>(
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210be5911e4 100644
index 5b6b6fc0f2cb3716de4e996938b2f146e4e66f1c..68a8a0e228103ea4e9fe58f416a53587b2d26f6e 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -87,6 +87,7 @@ class DomainReliabilityMonitor;
@@ -84,6 +84,7 @@ class DomainReliabilityMonitor;
namespace network {
class CertVerifierWithTrustAnchors;
@@ -171,7 +171,7 @@ index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210
class CookieManager;
class ExpectCTReporter;
class HostResolver;
@@ -184,6 +185,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -181,6 +182,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) override;
@@ -180,7 +180,7 @@ index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210
void ResetURLLoaderFactories() override;
void GetCookieManager(
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
@@ -621,6 +624,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -620,6 +623,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
#endif
@@ -190,10 +190,10 @@ index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210
// CertNetFetcher is not used by the current platform.
scoped_refptr<net::CertNetFetcherURLRequest> cert_net_fetcher_;
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index c37e71fb1eac0c568f91676eddcd624f491a7b69..6adfd8969148daba3f77aea4c5f89adec6338e6b 100644
index df53831fd07b7fb4903e73015ca8350a2de1ebbc..4729cc2bc74d410100a0c1946b867cd5d8428d31 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -191,6 +191,17 @@ struct HttpAuthStaticNetworkContextParams {
@@ -192,6 +192,17 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
};
@@ -211,7 +211,7 @@ index c37e71fb1eac0c568f91676eddcd624f491a7b69..6adfd8969148daba3f77aea4c5f89ade
// Parameters for constructing a network context.
struct NetworkContextParams {
// Name used by memory tools to identify the context.
@@ -813,6 +824,9 @@ interface NetworkContext {
@@ -830,6 +841,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);

View File

@@ -7,10 +7,10 @@ Do not check for unique origin in CacheStorage, in Electron we may have
scripts running without an origin.
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.cc b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
index a2c9bc873ae4def01bc31a5b4a280a799b241213..3cb71674bc5a000bca1e3473cf7ad6b8437ab507 100644
index 0abdf04f5fa016d7ee8241eab60375944fe8fe62..95f62ba41bd28c08364c5f13927bc90c4567f88b 100644
--- a/content/browser/cache_storage/legacy/legacy_cache_storage.cc
+++ b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
@@ -106,7 +106,7 @@ class LegacyCacheStorage::CacheLoader {
@@ -107,7 +107,7 @@ class LegacyCacheStorage::CacheLoader {
cache_storage_(cache_storage),
origin_(origin),
owner_(owner) {

View File

@@ -108,10 +108,10 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 5c07cb506115cdc846952d9b8e1061b6de6042d0..baf9e4ed20a41b9c1320ec6fbae290319e8e05e5 100644
index d62a91f5aa838735ea6052a550aad002eeaecbde..fb7995dc1e80ba4bce5c466526d4119bbcf8f28a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2033,7 +2033,7 @@ void RenderProcessHostImpl::CreateNotificationService(
@@ -2084,7 +2084,7 @@ void RenderProcessHostImpl::CreateNotificationService(
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(

View File

@@ -35,7 +35,7 @@ index e9b64a823ae7e25361f37190d247af0fa6a6f68a..43fdb0ad50d2b11a1bc28aa0f358c6dd
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_palette.h"
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc
index 02c05417bf3a2b6ca1bfc839d76262b97e9b2d69..3ac71544700f517b4c7397fa7a838ca8d778d2b1 100644
index 4af5ead7df57e26ceb64ab909c4dc2de86ccfc41..294e6c08975fae62ca8dbe9e471f39a5adbf03e3 100644
--- a/chrome/browser/ui/views/overlay/overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
@@ -19,7 +19,7 @@

View File

@@ -8,39 +8,39 @@ needed in chromium but our autofill implementation uses them. This patch can be
our autofill implementation to work like Chromium's.
diff --git a/chrome/browser/ui/gtk/native_theme_gtk.cc b/chrome/browser/ui/gtk/native_theme_gtk.cc
index 26f1842494bdbcf5ffefb07e8fc74ba816a2a2d8..8ef9c27728a5b3166732d753d582e30a015cc0a6 100644
index 0bc7a7ecdacd666cc0cc4769f5bb36053515a732..aecde5b7ee8e28a14ba7f3ee6b77f421041c4443 100644
--- a/chrome/browser/ui/gtk/native_theme_gtk.cc
+++ b/chrome/browser/ui/gtk/native_theme_gtk.cc
@@ -301,6 +301,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
@@ -300,6 +300,27 @@ base::Optional<SkColor> SkColorFromColorId(
case ui::NativeTheme::kColorId_TableHeaderSeparator:
return GetBorderColor("GtkTreeView#treeview.view GtkButton#button");
+ // Results Table
+ case ui::NativeTheme::kColorId_ResultsTableNormalBackground:
+ return SkColorFromColorId(
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground);
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground, base_theme, color_scheme);
+ case ui::NativeTheme::kColorId_ResultsTableHoveredBackground:
+ return color_utils::AlphaBlend(
+ SkColorFromColorId(
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground),
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground, base_theme, color_scheme).value(),
+ SkColorFromColorId(
+ ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused),
+ ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused, base_theme, color_scheme).value(),
+ 0.5f);
+ case ui::NativeTheme::kColorId_ResultsTableNormalText:
+ return SkColorFromColorId(
+ ui::NativeTheme::kColorId_TextfieldDefaultColor);
+ ui::NativeTheme::kColorId_TextfieldDefaultColor, base_theme, color_scheme);
+ case ui::NativeTheme::kColorId_ResultsTableDimmedText:
+ return color_utils::AlphaBlend(
+ SkColorFromColorId(ui::NativeTheme::kColorId_TextfieldDefaultColor),
+ SkColorFromColorId(ui::NativeTheme::kColorId_TextfieldDefaultColor, base_theme, color_scheme).value(),
+ SkColorFromColorId(
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground),
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground, base_theme, color_scheme).value(),
+ 0.5f);
+
// Throbber
// TODO(thomasanderson): Render GtkSpinner directly.
case ui::NativeTheme::kColorId_ThrobberSpinningColor:
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c1c86ee3a 100644
index dfa5a1c6e9ba1798de5be08a20f6f134f1b9e8d5..5ac2f70df6ba26671827a8634633b3bfb53ee7bc 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -59,6 +59,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
@@ -58,7 +58,7 @@ index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c
// FocusableBorder
case NativeTheme::kColorId_FocusedBorderColor:
return SkColorSetA(gfx::kGoogleBlue300, 0x4D);
@@ -401,6 +409,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
@@ -424,6 +432,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_UnfocusedBorderColor:
return gfx::kGoogleGrey300;
@@ -78,10 +78,10 @@ index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c
case NativeTheme::kColorId_ThrobberSpinningColor:
return gfx::kGoogleBlue600;
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 0c26cce0cb14bd9e87c3a095116501bf0c1803e4..782dd1d122bfab4990c924a7fb0e7276fb51b18b 100644
index d69cba7667555c3f552739f8273afd4d9928cb3b..20df4f2086bcc5aa572115ab32ac22348c196c03 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -409,6 +409,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -415,6 +415,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
kColorId_TableHeaderText,
kColorId_TableHeaderBackground,
kColorId_TableHeaderSeparator,

View File

@@ -6,7 +6,7 @@ Subject: render_widget_host_view_base.patch
... something to do with OSR? and maybe <webview> as well? terrifying.
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 95724e75d7c9d1582bb820321c1c47774e49dd7d..7d8c0f47e41e2bcf4ef29aec1c0873098e40d8ee 100644
index bfe2491d454e5cf7844a6350d38b291002694b1a..e43b31435702f87728caab3d268377802dc52375 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -618,6 +618,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
@@ -24,7 +24,7 @@ index 95724e75d7c9d1582bb820321c1c47774e49dd7d..7d8c0f47e41e2bcf4ef29aec1c087309
const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) {
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 226e7c96a2b7539890b297c05d3c963c5d4d193f..8a75e5253dd8ee66fc05232fccb3502b320ac353 100644
index f9c6c00902f9313d56d9a26008391837a0bbad43..397acfff6e96b529f5b435afdbaab5268a8100e6 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -23,9 +23,11 @@

View File

@@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`.
Additionally, disables usage of some private APIs in MAS builds.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e1628861a74cb69 100644
index 8b48f4dcfd00c415919811a6128cd606a33c6065..853f14e77f57ae20f3d5b3a7a5e8ce1217f4958e 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -154,6 +154,11 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -46,7 +46,7 @@ index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e162886
// We only handle key down events and just simply forward other events.
if (eventType != NSKeyDown) {
_hostHelper->ForwardKeyboardEvent(event, latency_info);
@@ -1762,9 +1774,11 @@ - (NSAccessibilityRole)accessibilityRole {
@@ -1759,9 +1771,11 @@ - (NSAccessibilityRole)accessibilityRole {
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
@@ -58,7 +58,7 @@ index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e162886
- (NSArray*)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
@@ -1773,7 +1787,10 @@ - (NSArray*)validAttributesForMarkedText {
@@ -1770,7 +1784,10 @@ - (NSArray*)validAttributesForMarkedText {
initWithObjects:NSUnderlineStyleAttributeName,
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,

View File

@@ -52,10 +52,10 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index fe09f99a91e3b1d2abfb335ec2771d1ed8592d87..050102ea2d7cac519c5bba4845021df6f671b4fa 100644
index 5b8ef55339ad0833270cbde99d30ed9b7d414ece..0196d66e4b4e3e95a4a2ebb6f390edf6883609b8 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1489,7 +1489,7 @@ if (is_chrome_branded && !is_android) {
@@ -1484,7 +1484,7 @@ if (is_chrome_branded && !is_android) {
}
}
@@ -64,7 +64,7 @@ index fe09f99a91e3b1d2abfb335ec2771d1ed8592d87..050102ea2d7cac519c5bba4845021df6
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1509,6 +1509,12 @@ if (!is_android) {
@@ -1504,6 +1504,12 @@ if (!is_android) {
}
}

View File

@@ -1,18 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Wed, 23 Oct 2019 15:30:18 -0700
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 4 Feb 2020 08:59:32 -0700
Subject: Revert "Remove ContentRendererClient::ShouldFork."
This reverts commit 6b068eb8ca4a3c7350bdafa22fc0cf0636ef8b74.
This reverts the CL at https://chromium-review.googlesource.com/c/chromium/src/+/1812128.
We use it to force a new renderer process for navigations, and need to start a new renderer process
for every navigation to keep Node.js working properly. Once Native Modules in the renderer process
are required to be NAPI or context aware (Electron v11), this patch can be removed.
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index e03ad3a5a115383143d1324164dfd37f87c6f2f2..1c179e0cca8b0b1fc19971d1c9e93d59af7b9383 100644
index f4164c6d41ea1b10bf8c4f4b75ee788c7529cbcf..b15a72fe6d02617e227395461dbbdf3c830a3dd8 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -1291,6 +1291,17 @@ bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
return true;
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
@@ -1269,6 +1269,25 @@ bool ChromeContentRendererClient::AllowPopup() {
#endif
}
+bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
+ const GURL& url,
+ const std::string& http_method,
+ bool is_initial_navigation,
+ bool is_server_redirect) {
+ DCHECK(!frame->Parent());
+
+ // If |url| matches one of the prerendered URLs, stop this navigation and try
@@ -24,84 +32,90 @@ index e03ad3a5a115383143d1324164dfd37f87c6f2f2..1c179e0cca8b0b1fc19971d1c9e93d59
+ return true;
+ }
+
return false;
}
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index b4895b8770bd58d400cc8ca55c74940b25b3a8d5..3c0d6bc9bb50abc5f02e07c24ed8ae424dcda1a5 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -1004,6 +1004,73 @@ TEST_F(RenderViewImplTest, BeginNavigationForWebUI) {
FrameHostMsg_OpenURL::ID));
}
+class AlwaysForkingRenderViewTest : public RenderViewImplTest {
+ public:
+ ContentRendererClient* CreateContentRendererClient() override {
+ return new TestContentRendererClient;
+ }
+ return false;
+}
+
+ private:
+ class TestContentRendererClient : public ContentRendererClient {
+ public:
+ bool ShouldFork(blink::WebLocalFrame* frame,
+ const GURL& url,
+ const std::string& http_method,
+ bool is_initial_navigation,
+ bool is_server_redirect) override {
+ return true;
void ChromeContentRendererClient::WillSendRequest(
WebLocalFrame* frame,
ui::PageTransition transition_type,
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index f46086288686d68c0ee0078c9deb97ba4177f79c..5422bb4bc6310da74cb60068455d1f58cd93ba65 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -131,6 +131,11 @@ class ChromeContentRendererClient
base::SingleThreadTaskRunner* compositor_thread_task_runner) override;
bool RunIdleHandlerWhenWidgetsHidden() override;
bool AllowPopup() override;
+ bool ShouldFork(blink::WebLocalFrame* frame,
+ const GURL& url,
+ const std::string& http_method,
+ bool is_initial_navigation,
+ bool is_server_redirect) override;
void WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
index c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa200fb9773c 100644
--- a/content/public/renderer/content_renderer_client.cc
+++ b/content/public/renderer/content_renderer_client.cc
@@ -104,6 +104,14 @@ bool ContentRendererClient::HandleNavigation(
}
#endif
+bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
+ const GURL& url,
+ const std::string& http_method,
+ bool is_initial_navigation,
+ bool is_server_redirect) {
+ return false;
+}
+
void ContentRendererClient::WillSendRequest(
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 0a4ec619e96a840b4b4d5b51246de6c91e0f94f2..5dabb49f061b4e0643256cbf9162d128c1e0bacf 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -213,6 +213,13 @@ class CONTENT_EXPORT ContentRendererClient {
bool is_redirect);
#endif
+ // Returns true if we should fork a new process for the given navigation.
+ virtual bool ShouldFork(blink::WebLocalFrame* frame,
+ const GURL& url,
+ const std::string& http_method,
+ bool is_initial_navigation,
+ bool is_server_redirect);
+
// Notifies the embedder that the given frame is requesting the resource at
// |url|. If the function returns a valid |new_url|, the request must be
// updated to use it. The |attach_same_site_cookies| output parameter
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0d3d1b8f0aeefbcf81d14460fd687ddd09ff9d98..e3b2829e875984c122e8f7d82447abb29b42ed5a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5788,6 +5788,23 @@ void RenderFrameImpl::BeginNavigation(
int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
(cumulative_bindings & kWebUIBindingsPolicyMask);
+
+ if (!should_fork && url.SchemeIs(url::kFileScheme)) {
+ // Fork non-file to file opens (see https://crbug.com/1031119). Note that
+ // this may fork unnecessarily if another tab (hosting a file or not)
+ // targeted this one before its initial navigation, but that shouldn't
+ // cause a problem.
+ should_fork = !old_url.SchemeIs(url::kFileScheme);
+ }
+ };
+};
+
+TEST_F(AlwaysForkingRenderViewTest, BeginNavigationDoesNotForkEmptyUrl) {
+ GURL example_url("http://example.com");
+ GURL empty_url("");
+ if (!should_fork) {
+ // Give the embedder a chance.
+ bool is_initial_navigation = render_view_->history_list_length_ == 0;
+ should_fork = GetContentClient()->renderer()->ShouldFork(
+ frame_, url, info->url_request.HttpMethod().Utf8(),
+ is_initial_navigation, false /* is_redirect */);
+ }
+
+ LoadHTMLWithUrlOverride("<body></body", example_url.spec().c_str());
+ EXPECT_EQ(example_url,
+ GURL(frame()->GetWebFrame()->GetDocumentLoader()->GetUrl()));
+
+ // Empty url should never fork.
+ blink::WebURLRequest request(empty_url);
+ request.SetMode(network::mojom::RequestMode::kNavigate);
+ request.SetRedirectMode(network::mojom::RedirectMode::kManual);
+ request.SetRequestContext(blink::mojom::RequestContextType::INTERNAL);
+ request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(example_url));
+ auto navigation_info = std::make_unique<blink::WebNavigationInfo>();
+ navigation_info->url_request = request;
+ navigation_info->frame_type =
+ network::mojom::RequestContextFrameType::kTopLevel;
+ navigation_info->navigation_policy = blink::kWebNavigationPolicyCurrentTab;
+ frame()->BeginNavigation(std::move(navigation_info));
+ EXPECT_FALSE(render_thread_->sink().GetUniqueMessageMatching(
+ FrameHostMsg_OpenURL::ID));
+}
+
+TEST_F(AlwaysForkingRenderViewTest, BeginNavigationDoesNotForkAboutBlank) {
+ GURL example_url("http://example.com");
+ GURL blank_url(url::kAboutBlankURL);
+
+ LoadHTMLWithUrlOverride("<body></body", example_url.spec().c_str());
+ EXPECT_EQ(example_url,
+ GURL(frame()->GetWebFrame()->GetDocumentLoader()->GetUrl()));
+
+ // about:blank should never fork.
+ blink::WebURLRequest request(blank_url);
+ request.SetMode(network::mojom::RequestMode::kNavigate);
+ request.SetRedirectMode(network::mojom::RedirectMode::kManual);
+ request.SetRequestContext(blink::mojom::RequestContextType::INTERNAL);
+ request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(example_url));
+ auto navigation_info = std::make_unique<blink::WebNavigationInfo>();
+ navigation_info->url_request = request;
+ navigation_info->frame_type =
+ network::mojom::RequestContextFrameType::kTopLevel;
+ navigation_info->navigation_policy = blink::kWebNavigationPolicyCurrentTab;
+ frame()->BeginNavigation(std::move(navigation_info));
+ EXPECT_FALSE(render_thread_->sink().GetUniqueMessageMatching(
+ FrameHostMsg_OpenURL::ID));
+}
+
// This test verifies that when device emulation is enabled, RenderFrameProxy
// continues to receive the original ScreenInfo and not the emualted
// ScreenInfo.
if (should_fork) {
OpenURL(std::move(info));
return; // Suppress the load here.

View File

@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
Patch to make scrollBounce option work.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index ae1a77a219f153f034c2702447a3ede9d9c9b960..4e50a255b99bbce1e3c4aa696bfc0fa8ae4dddee 100644
index 33ab18228d821c1d3a8361463db7f55727500309..c4462aec2f2bf1aa4b8bf7fcb21415888b658323 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1338,7 +1338,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
@@ -1345,7 +1345,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
}
bool RenderThreadImpl::IsElasticOverscrollEnabled() {

View File

@@ -22,7 +22,7 @@ However, the patch would need to be reviewed by the security team, as it
does touch a security-sensitive class.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index baf9e4ed20a41b9c1320ec6fbae290319e8e05e5..89fa83bbda39e90c1fcd6df83cd248c1f2de7195 100644
index fb7995dc1e80ba4bce5c466526d4119bbcf8f28a..8205a898bc368543ffe150a641c9f04c137fc072 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -414,6 +414,11 @@ class RendererSandboxedProcessLauncherDelegate
@@ -62,7 +62,7 @@ index baf9e4ed20a41b9c1320ec6fbae290319e8e05e5..89fa83bbda39e90c1fcd6df83cd248c1
};
const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey";
@@ -1746,11 +1757,18 @@ bool RenderProcessHostImpl::Init() {
@@ -1790,11 +1801,18 @@ bool RenderProcessHostImpl::Init() {
cmd_line->PrependWrapper(renderer_prefix);
AppendRendererCommandLine(cmd_line.get());

View File

@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Mon, 10 Feb 2020 10:37:48 -0800
Subject: use electron resources in pdf_util
Without this, the ID for IDR_PDF_MANIFEST will be wrong on linux
and cause a DCHECK(), since the resource will be loaded as an empty
string.
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
index 877d0ba2f48359243527ddebf1d91132b3d5c455..cd69de498c4968ade0ffabf45b72d4d63b70b10f 100644
--- a/chrome/browser/pdf/pdf_extension_util.cc
+++ b/chrome/browser/pdf/pdf_extension_util.cc
@@ -6,7 +6,7 @@
#include "base/strings/string_util.h"
#include "chrome/common/chrome_content_client.h"
-#include "chrome/grit/browser_resources.h"
+#include "electron/grit/electron_resources.h"
#include "ui/base/resource/resource_bundle.h"
namespace pdf_extension_util {

View File

@@ -9,10 +9,10 @@ is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ea2e52bf16dd7897a104c67dfcb2f95598cf291e..7ca7e5c594d729d365692336861abfc93a88680b 100644
index 4660c704904ba1c2366e34b768446a620e3814d8..2cdc3785010b78d74bb980de9211622130a3c072 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2062,6 +2062,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -2073,6 +2073,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
@@ -25,7 +25,7 @@ index ea2e52bf16dd7897a104c67dfcb2f95598cf291e..7ca7e5c594d729d365692336861abfc9
WebContentsViewDelegate* delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -2072,6 +2078,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
@@ -2083,6 +2089,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
view_.reset(CreateWebContentsView(this, delegate,
&render_view_host_delegate_view_));
}

View File

@@ -20,10 +20,10 @@ index 44bc4902a374821eecebf72bfcb150b7d86db621..c570fadb559230e17440c64b9042fbd9
GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
drag_start_view_id_;
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
index b35ff2edf854aa759a91fa708ed560d2f269e078..4ca6119b2105f27cabcb664d9ba7631973b49966 100644
index c2bf0258a94c39da79b3f3056f2fef93f86281a5..abd9a305ff0b4c4e60fe9e3d4ba46fc7983b50f4 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -337,6 +337,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
@@ -401,6 +401,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
}
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {

View File

@@ -10,10 +10,10 @@ An attempt to upstream this was made, but rejected:
https://chromium-review.googlesource.com/c/chromium/src/+/1954347
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 87df60c52d1e6adf464e85deccef87ae2c6cb48c..5dabb49f061b4e0643256cbf9162d128c1e0bacf 100644
index 39a0c8dd6e16146dd1c760db59786a1a6ef6342c..0a4ec619e96a840b4b4d5b51246de6c91e0f94f2 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -389,6 +389,11 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -382,6 +382,11 @@ class CONTENT_EXPORT ContentRendererClient {
virtual void DidInitializeWorkerContextOnWorkerThread(
v8::Local<v8::Context> context) {}
@@ -55,10 +55,10 @@ index 096cd162c7d5228fea0c56ad007b9939e6f27809..1c332800cb133f93d21ee628b3b85e89
const blink::WebString& header_name) override;
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
index 8690ec1fdd213a4898ebce1c8dce38079972f7df..b06e541ec3cbb6cac7b58222a4718b4560a49ff0 100644
index 7d00b2a49d37c6e5ecdbfb08c8f273cc1d5b61f2..a68f9d16fbd1142a1ebda0a8fd1b29defb632b8f 100644
--- a/third_party/blink/public/platform/platform.h
+++ b/third_party/blink/public/platform/platform.h
@@ -623,6 +623,7 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -622,6 +622,7 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
@@ -67,10 +67,10 @@ index 8690ec1fdd213a4898ebce1c8dce38079972f7df..b06e541ec3cbb6cac7b58222a4718b45
const WebSecurityOrigin& script_origin) {
return false;
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
index e00f788541d7c0f96d2c00c4840da1598c3f7a81..0c3d589ba1ca0727d46feda8ae48c5d0049c304e 100644
index c43f8b1e8f4a20ee0bf267ef78f2b067837be223..b34800d0a569b31f9ecc9c62d0e93e676eddf32d 100644
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
@@ -681,6 +681,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
@@ -688,6 +688,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
nested_runner_->QuitNow();
}

View File

@@ -36,3 +36,4 @@ remove_serialization_deserialization_of_wasmmoduleobject.patch
64bit_bump_typedarray_max_length_to_2_32-1_elements.patch
test_use_tmpdir_refresh_in_test-esm-windows_js.patch
override_existing_v8_reallocate.patch
avoid_calling_deprecated_method.patch

View File

@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Thu, 13 Feb 2020 10:34:31 -0800
Subject: Avoid calling deprecated method
The {SetExpectInlineWasm} method is deprecated and non-functional since
V8 v8.1.
Thus node should stop calling it, so that it can be fully removed in a
future v8 version.
diff --git a/src/node_serdes.cc b/src/node_serdes.cc
index a2d185c4167a75e227cd4b2abbf5c5abc7e16acb..e918ed9d12e9fb1d13b2fc05a98cab099fb71a68 100644
--- a/src/node_serdes.cc
+++ b/src/node_serdes.cc
@@ -286,7 +286,6 @@ DeserializerContext::DeserializerContext(Environment* env,
length_(Buffer::Length(buffer)),
deserializer_(env->isolate(), data_, length_, this) {
object()->Set(env->context(), env->buffer_string(), buffer).Check();
- deserializer_.SetExpectInlineWasm(true);
MakeWeak();
}

View File

@@ -7,3 +7,4 @@ workaround_an_undefined_symbol_error.patch
do_not_export_private_v8_symbols_on_windows.patch
revert_cleanup_switch_offset_of_to_offsetof_where_possible.patch
fix_build_deprecated_attirbute_for_older_msvc_versions.patch
fix_bug_in_receiver_maps_inference.patch

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Thu, 27 Feb 2020 11:47:31 -0800
Subject: Fix bug in receiver maps inference
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2062404
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc
index f43a348bb2d5b803270e42f64a3c790c52a3581b..ab4ced69ab60d6078aeb27c3d8b97e87400687ce 100644
--- a/src/compiler/node-properties.cc
+++ b/src/compiler/node-properties.cc
@@ -386,6 +386,7 @@ NodeProperties::InferReceiverMapsResult NodeProperties::InferReceiverMapsUnsafe(
// We reached the allocation of the {receiver}.
return kNoReceiverMaps;
}
+ result = kUnreliableReceiverMaps; // JSCreate can have side-effect.
break;
}
case IrOpcode::kJSCreatePromise: {

View File

@@ -9,7 +9,11 @@ async function checkIfDocOnlyChange () {
try {
let pullRequestNumber = args.prNumber
if (!pullRequestNumber || isNaN(pullRequestNumber)) {
if (args.prBranch) {
if (args.prURL) {
// CircleCI doesn't provide the PR number for branch builds, but it does provide the PR URL
const pullRequestParts = args.prURL.split('/')
pullRequestNumber = pullRequestParts[pullRequestParts.length - 1]
} else if (args.prBranch) {
// AppVeyor doesn't provide a PR number for branch builds - figure it out from the branch
const prsForBranch = await octokit.pulls.list({
owner: 'electron',
@@ -23,10 +27,6 @@ async function checkIfDocOnlyChange () {
// If there are 0 PRs or more than one PR on a branch, just assume that this is more than a doc change
process.exit(1)
}
} else if (args.prURL) {
// CircleCI doesn't provide the PR number for branch builds, but it does provide the PR URL
const pullRequestParts = args.prURL.split('/')
pullRequestNumber = pullRequestParts[pullRequestParts.length - 1]
}
}
const filesChanged = await octokit.pulls.listFiles({

View File

@@ -120,8 +120,8 @@ def extract_zip(zip_path, destination):
def make_zip(zip_file_path, files, dirs):
safe_unlink(zip_file_path)
if sys.platform == 'darwin':
files += dirs
execute(['zip', '-r', '-y', zip_file_path] + files)
allfiles = files + dirs
execute(['zip', '-r', '-y', zip_file_path] + allfiles)
else:
zip_file = zipfile.ZipFile(zip_file_path, "w", zipfile.ZIP_DEFLATED,
allowZip64=True)

View File

@@ -2,10 +2,16 @@ const cp = require('child_process')
const fs = require('fs')
const path = require('path')
const args = require('minimist')(process.argv.slice(2), {
boolean: ['default'],
string: ['jUnitDir']
})
const BASE = path.resolve(__dirname, '../..')
const DISABLED_TESTS = require('./node-disabled-tests.json')
const NODE_DIR = path.resolve(BASE, 'third_party', 'electron_node')
const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'
const JUNIT_DIR = process.argv[2] ? path.resolve(process.argv[2]) : null
const JUNIT_DIR = args.jUnitDir ? path.resolve(args.jUnitDir) : null
const TAP_FILE_NAME = 'test.tap'
const utils = require('./lib/utils')
@@ -15,10 +21,43 @@ if (!process.mainModule) {
throw new Error('Must call the node spec runner directly')
}
async function main () {
const DISABLED_TESTS = require('./node-disabled-tests.json')
const defaultOptions = [
'tools/test.py',
'-p',
'tap',
'--logfile',
TAP_FILE_NAME,
'--mode=debug',
'default',
`--skip-tests=${DISABLED_TESTS.join(',')}`,
'--shell',
utils.getAbsoluteElectronExec(),
'-J'
]
const testChild = cp.spawn('python', ['tools/test.py', '--verbose', '-p', 'tap', '--logfile', TAP_FILE_NAME, '--mode=debug', 'default', `--skip-tests=${DISABLED_TESTS.join(',')}`, '--shell', utils.getAbsoluteElectronExec(), '-J'], {
const getCustomOptions = () => {
let customOptions = ['tools/test.py']
// Add all custom arguments.
const extra = process.argv.slice(2)
if (extra) {
customOptions = customOptions.concat(extra)
}
// We need this unilaterally or Node.js will try
// to run from out/Release/node.
customOptions = customOptions.concat([
'--shell',
utils.getAbsoluteElectronExec()
])
return customOptions
}
async function main () {
const options = args.default ? defaultOptions : getCustomOptions()
const testChild = cp.spawn('python', options, {
env: {
...process.env,
ELECTRON_RUN_AS_NODE: 'true',

View File

@@ -23,6 +23,11 @@ const circleCIJobs = [
'osx-publish'
]
const circleCIPublishWorkflows = [
'linux-publish',
'macos-publish'
]
const vstsArmJobs = [
'electron-arm-testing',
'electron-arm64-testing',
@@ -87,13 +92,18 @@ async function circleCIcall (targetBranch, job, options) {
if (workflowId === -1) {
return
}
console.log(`CircleCI release build workflow running at https://circleci.com/workflow-run/${workflowId} for ${job}.`)
const jobNumber = await getCircleCIJobNumber(workflowId)
if (jobNumber === -1) {
return
const workFlowUrl = `https://circleci.com/workflow-run/${workflowId}`
if (options.runningPublishWorkflows) {
console.log(`CircleCI release workflow request for ${job} successful. Check ${workFlowUrl} for status.`)
} else {
console.log(`CircleCI release build workflow running at https://circleci.com/workflow-run/${workflowId} for ${job}.`)
const jobNumber = await getCircleCIJobNumber(workflowId)
if (jobNumber === -1) {
return
}
const jobUrl = `https://circleci.com/gh/electron/electron/${jobNumber}`
console.log(`CircleCI release build request for ${job} successful. Check ${jobUrl} for status.`)
}
const jobUrl = `https://circleci.com/gh/electron/electron/${jobNumber}`
console.log(`CircleCI release build request for ${job} successful. Check ${jobUrl} for status.`)
} catch (err) {
console.log('Error calling CircleCI: ', err)
}
@@ -232,7 +242,8 @@ function buildCircleCI (targetBranch, options) {
assert(circleCIJobs.includes(options.job), `Unknown CircleCI job name: ${options.job}. Valid values are: ${circleCIJobs}.`)
circleCIcall(targetBranch, options.job, options)
} else {
circleCIJobs.forEach((job) => circleCIcall(targetBranch, job, options))
options.runningPublishWorkflows = true
circleCIPublishWorkflows.forEach((job) => circleCIcall(targetBranch, job, options))
}
}

View File

@@ -18,7 +18,7 @@ const CHECK_INTERVAL = 5000
const CACHE_DIR = path.resolve(__dirname, '.cache')
const NO_NOTES = 'No notes'
const FOLLOW_REPOS = [ 'electron/electron', 'electron/libchromiumcontent', 'electron/node' ]
const FOLLOW_REPOS = [ 'electron/electron', 'electron/node' ]
const breakTypes = new Set(['breaking-change'])
const docTypes = new Set(['doc', 'docs'])
@@ -341,44 +341,6 @@ const addRepoToPool = async (pool, repo, from, to) => {
**** Other Repos
***/
// other repos - gyp
const getGypSubmoduleRef = async (dir, point) => {
// example: '160000 commit 028b0af83076cec898f4ebce208b7fadb715656e libchromiumcontent'
const response = await runGit(
path.dirname(dir),
['ls-tree', '-t', point, path.basename(dir)]
)
const line = response.split('\n').filter(line => line.startsWith('160000')).shift()
const tokens = line ? line.split(/\s/).map(token => token.trim()) : null
const ref = tokens && tokens.length >= 3 ? tokens[2] : null
return ref
}
const getDependencyCommitsGyp = async (pool, fromRef, toRef) => {
const commits = []
const repos = [{
owner: 'electron',
repo: 'libchromiumcontent',
dir: path.resolve(ELECTRON_VERSION, 'vendor', 'libchromiumcontent')
}, {
owner: 'electron',
repo: 'node',
dir: path.resolve(ELECTRON_VERSION, 'vendor', 'node')
}]
for (const repo of repos) {
const from = await getGypSubmoduleRef(repo.dir, fromRef)
const to = await getGypSubmoduleRef(repo.dir, toRef)
await addRepoToPool(pool, repo, from, to)
}
return commits
}
// other repos - gn
const getDepsVariable = async (ref, key) => {
@@ -416,17 +378,6 @@ const getDependencyCommitsGN = async (pool, fromRef, toRef) => {
}
}
// other repos - controller
const getDependencyCommits = async (pool, from, to) => {
const filename = path.resolve(ELECTRON_VERSION, 'vendor', 'libchromiumcontent')
const useGyp = fs.existsSync(filename)
return useGyp
? getDependencyCommitsGyp(pool, from, to)
: getDependencyCommitsGN(pool, from, to)
}
// Changes are interesting if they make a change relative to a previous
// release in the same series. For example if you fix a Y.0.0 bug, that
// should be included in the Y.0.1 notes even if it's also tropped back
@@ -474,7 +425,7 @@ const getNotes = async (fromRef, toRef, newVersion) => {
semver.major(fromRef) === semver.major(toRef)
if (includeDeps) {
await getDependencyCommits(pool, fromRef, toRef)
await getDependencyCommitsGN(pool, fromRef, toRef)
}
// remove any old commits

View File

@@ -44,7 +44,6 @@ async function deleteDraft (releaseId, targetRepo) {
repo: targetRepo,
release_id: parseInt(releaseId, 10)
})
console.log(result)
if (!result.data.draft) {
console.log(`${fail} published releases cannot be deleted.`)
return false
@@ -85,15 +84,11 @@ async function cleanReleaseArtifacts () {
if (releaseId) {
if (isNightly) {
const deletedNightlyDraft = await deleteDraft(releaseId, 'nightlies')
await deleteDraft(releaseId, 'nightlies')
// don't delete tag unless draft deleted successfully
if (deletedNightlyDraft) {
await Promise.all([
deleteTag(args.tag, 'electron'),
deleteTag(args.tag, 'nightlies')
])
}
// We only need to delete the Electron tag since the
// nightly tag is only created at publish-time.
await deleteTag(args.tag, 'electron')
} else {
const deletedElectronDraft = await deleteDraft(releaseId, 'electron')
// don't delete tag unless draft deleted successfully

View File

@@ -30,7 +30,7 @@ def main():
run_symstore(pdb, SYMBOLS_DIR, PRODUCT_NAME)
files = glob.glob(SYMBOLS_DIR + '/*.pdb/*/*.pdb')
else:
files = glob.glob(SYMBOLS_DIR + '/*/*/*.sym')
files = glob.glob(SYMBOLS_DIR + '/*/*/*.sym') + glob.glob(SYMBOLS_DIR + '/*/*/*.src.zip')
# The file upload needs to be atom-shell/symbols/:symbol_name/:hash/:symbol
os.chdir(SYMBOLS_DIR)

View File

@@ -35,9 +35,8 @@ const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'
const runners = new Map([
['main', { description: 'Main process specs', run: runMainProcessElectronTests }],
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }]
// TODO(codebytere): refactor native tests to only depend on what we need
/* ['native', { description: 'Native specs', run: runNativeElectronTests }] */
['remote', { description: 'Remote based specs', run: runRemoteBasedElectronTests }],
['native', { description: 'Native specs', run: runNativeElectronTests }]
])
const specHashPath = path.resolve(__dirname, '../spec/.hash')
@@ -204,13 +203,17 @@ async function runMainProcessElectronTests () {
exe = 'python'
}
const { status } = childProcess.spawnSync(exe, runnerArgs, {
const { status, signal } = childProcess.spawnSync(exe, runnerArgs, {
cwd: path.resolve(__dirname, '../..'),
stdio: 'inherit'
})
if (status !== 0) {
const textStatus = process.platform === 'win32' ? `0x${status.toString(16)}` : status.toString()
console.log(`${fail} Electron tests failed with code ${textStatus}.`)
if (status) {
const textStatus = process.platform === 'win32' ? `0x${status.toString(16)}` : status.toString()
console.log(`${fail} Electron tests failed with code ${textStatus}.`)
} else {
console.log(`${fail} Electron tests failed with kill signal ${signal}.`)
}
process.exit(1)
}
console.log(`${pass} Electron main process tests passed.`)

View File

@@ -1,7 +1,6 @@
param([string]$gomaDir=$PWD)
$cmdPath = Join-Path -Path $gomaDir -ChildPath "goma_ctl.py"
Start-Process -FilePath cmd -ArgumentList "/C", "python", "$cmdPath", "ensure_start"
$env:GLOG_logtostderr = "true"
$timedOut = $false; $waitTime = 0; $waitIncrement = 5; $timeout=120;
Do { sleep $waitIncrement; $timedOut = (($waitTime+=$waitIncrement) -gt $timeout); iex "$gomaDir\gomacc.exe port 2" > $null; } Until(($LASTEXITCODE -eq 0) -or $timedOut)
if ($timedOut) {

View File

@@ -4,7 +4,7 @@ import argparse
import os
import sys
from lib.config import LINUX_BINARIES
from lib.config import LINUX_BINARIES, enable_verbose_mode
from lib.util import execute, get_out_dir
def strip_binaries(directory, target_cpu):
@@ -22,10 +22,12 @@ def strip_binary(binary_path, target_cpu):
strip = 'mips64el-redhat-linux-strip'
else:
strip = 'strip'
execute([strip, binary_path])
execute([strip, '--preserve-dates', binary_path])
def main():
args = parse_args()
if args.verbose:
enable_verbose_mode()
if args.file:
strip_binary(args.file, args.target_cpu)
else:

View File

@@ -33,12 +33,13 @@
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "pdf/pdf.h" // nogncheck
#include "pdf/pdf_ppapi.h" // nogncheck
#include "shell/common/electron_constants.h" // nogncheck
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
#include "pdf/pdf.h" // nogncheck
#include "pdf/pdf_ppapi.h" // nogncheck
#include "shell/common/electron_constants.h"
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/browser/plugin_service.h"
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#endif // BUILDFLAG(ENABLE_PLUGINS)
@@ -155,7 +156,8 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
pdf_info.is_out_of_process = true;
pdf_info.name = "Chromium PDF Viewer";
pdf_info.description = "Portable Document Format";
pdf_info.path = base::FilePath(FILE_PATH_LITERAL("internal-pdf-viewer"));
// This isn't a real file path; it's just used as a unique identifier.
pdf_info.path = base::FilePath(kPdfPluginPath);
content::WebPluginMimeType pdf_mime_type(kPdfPluginMimeType, "pdf",
"Portable Document Format");
pdf_info.mime_types.push_back(pdf_mime_type);
@@ -166,6 +168,21 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
chrome_pdf::PPP_ShutdownModule;
pdf_info.permissions = ppapi::PERMISSION_PDF | ppapi::PERMISSION_DEV;
plugins->push_back(pdf_info);
// NB. in Chrome, this plugin isn't registered until the PDF extension is
// loaded. However, in Electron, we load the PDF extension unconditionally
// when it is enabled in the build, so we're OK to load the plugin eagerly
// here.
content::WebPluginInfo info;
info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN;
info.name = base::UTF8ToUTF16("Chromium PDF Viewer");
// This isn't a real file path; it's just used as a unique identifier.
info.path = base::FilePath::FromUTF8Unsafe(extension_misc::kPdfExtensionId);
info.background_color = content::WebPluginInfo::kDefaultBackgroundColor;
info.mime_types.emplace_back("application/pdf", "pdf",
"Portable Document Format");
content::PluginService::GetInstance()->RefreshPlugins();
content::PluginService::GetInstance()->RegisterInternalPlugin(info, true);
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
}
#endif // BUILDFLAG(ENABLE_PLUGINS)
@@ -216,8 +233,6 @@ base::RefCountedMemory* ElectronContentClient::GetDataResourceBytes(
void ElectronContentClient::AddAdditionalSchemes(Schemes* schemes) {
AppendDelimitedSwitchToVector(switches::kServiceWorkerSchemes,
&schemes->service_worker_schemes);
AppendDelimitedSwitchToVector(switches::kStandardSchemes,
&schemes->standard_schemes);
AppendDelimitedSwitchToVector(switches::kSecureSchemes,
&schemes->secure_schemes);
AppendDelimitedSwitchToVector(switches::kBypassCSPSchemes,

View File

@@ -118,15 +118,6 @@ void LoadResourceBundle(const std::string& locale) {
bundle.ReloadLocaleResources(locale);
bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL("resources.pak")),
ui::SCALE_FACTOR_NONE);
#if BUILDFLAG(ENABLE_PDF_VIEWER)
NOTIMPLEMENTED()
<< "Hi, whoever's fixing PDF support! Thanks! The pdf "
"viewer resources haven't been ported over to the GN build yet, so "
"you'll probably need to change this bit of code.";
bundle.AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("pdf_viewer_resources.pak")),
ui::GetSupportedScaleFactors()[0]);
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
}
ElectronMainDelegate::ElectronMainDelegate() = default;
@@ -224,6 +215,21 @@ bool ElectronMainDelegate::BasicStartupComplete(int* exit_code) {
<< " is not supported. See https://crbug.com/638180.";
#endif
#if defined(MAS_BUILD)
// In MAS build we are using --disable-remote-core-animation.
//
// According to ccameron:
// If you're running with --disable-remote-core-animation, you may want to
// also run with --disable-gpu-memory-buffer-compositor-resources as well.
// That flag makes it so we use regular GL textures instead of IOSurfaces
// for compositor resources. IOSurfaces are very heavyweight to
// create/destroy, but they can be displayed directly by CoreAnimation (and
// --disable-remote-core-animation makes it so we don't use this property,
// so they're just heavyweight with no upside).
command_line->AppendSwitch(
::switches::kDisableGpuMemoryBufferCompositorResources);
#endif
content_client_ = std::make_unique<ElectronContentClient>();
SetContentClient(content_client_.get());
@@ -336,15 +342,12 @@ int ElectronMainDelegate::RunProcess(
return -1;
}
#if defined(OS_MACOSX)
bool ElectronMainDelegate::DelaySandboxInitialization(
const std::string& process_type) {
return process_type == kRelauncherProcess;
}
#endif
bool ElectronMainDelegate::ShouldCreateFeatureList() {
return false;
}
bool ElectronMainDelegate::ShouldLockSchemeRegistry() {
return false;
}
} // namespace electron

View File

@@ -39,10 +39,8 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
int RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) override;
#if defined(OS_MACOSX)
bool DelaySandboxInitialization(const std::string& process_type) override;
#endif
bool ShouldCreateFeatureList() override;
bool ShouldLockSchemeRegistry() override;
private:
#if defined(OS_MACOSX)

View File

@@ -82,7 +82,7 @@ void ElectronMainDelegate::SetUpBundleOverrides() {
void RegisterAtomCrApp() {
// Force the NSApplication subclass to be used.
[ElectronApplication sharedApplication];
[AtomApplication sharedApplication];
}
} // namespace electron

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