Compare commits

...

70 Commits

Author SHA1 Message Date
Electron Bot
e78fe7c8da Bump v8.0.0-beta.3 2019-11-20 11:24:28 -08:00
trop[bot]
7a7b944c74 build: update release build endpoint from /jobs to /job (#21233) 2019-11-20 14:23:13 -05:00
Electron Bot
09f5a2b741 Revert "Bump v8.0.0-beta.3"
This reverts commit cbf50eabd9.
2019-11-20 11:16:26 -08:00
Electron Bot
cbf50eabd9 Bump v8.0.0-beta.3 2019-11-20 11:14:52 -08:00
trop[bot]
90a74139c1 build: delete unneeded files when running a release (#21230)
* build: delete unneeded files when running a release

Needed to free up disk space on MacOS.

* Delete all the .git directories

* Update comment

* Run gn gen after deleting .git dirs
2019-11-20 14:04:25 -05:00
Cheng Zhao
3a6cc1b786 fix: menu should not be garbage-collected when popuping (8-x-y) (#21224)
* fix: retain menu when popuping

* test: menu should not be garbage-collected when popuping
2019-11-20 11:19:21 -05:00
trop[bot]
f5fde13b14 spec: skip flaky <webview>.capturePage() test on Windows (#21212) 2019-11-20 11:00:52 -05:00
John Kleinschmidt
c6d429d533 Revert "Bump v8.0.0-beta.3"
This reverts commit 269f4ba2bb.
2019-11-19 16:53:29 -05:00
Charles Kerr
73df925241 docs: document webkitdirectory breaking change (#21209) 2019-11-19 15:31:06 -05:00
Electron Bot
269f4ba2bb Bump v8.0.0-beta.3 2019-11-19 11:41:06 -08:00
Electron Bot
9b304beb54 Revert "Bump v8.0.0-beta.3"
This reverts commit 5ffad09e91.
2019-11-19 11:34:24 -08:00
Electron Bot
5ffad09e91 Bump v8.0.0-beta.3 2019-11-19 11:32:01 -08:00
John Kleinschmidt
b694315cd3 Revert "Bump v8.0.0-beta.3" (#21207)
This reverts commit 7fe2f25341.
2019-11-19 14:21:25 -05:00
trop[bot]
8566315902 fix: allow chromium to handle WM_NCCALCSIZE for frameless windows (#21201) 2019-11-19 14:18:50 -05:00
trop[bot]
cd94ab9de3 build: use python3 to download external binaries (#21202)
* build: use python3 to download external binaries

* Update config.py
2019-11-19 08:40:51 -08:00
trop[bot]
09ebadaf5b build: use symbol_level 1 for 32bit linux releases (#21204)
* build: use symbol_level 1 for 32bit linux releases

* Add comment
2019-11-19 08:14:34 -08:00
trop[bot]
990189ab35 fix: stream protocols sometimes flake out (#21180) 2019-11-19 06:31:07 -08:00
trop[bot]
049e536c5f docs: fix isMactemplateImage type definition (#21182) 2019-11-18 21:04:01 -08:00
Electron Bot
7fe2f25341 Bump v8.0.0-beta.3 2019-11-18 10:41:07 -08:00
Charles Kerr
c79809ddb9 build: missing include in windows release builds (#21132)
* fix: add missing `#include <algorithm>` as needed

Manual backport of #21045

* fix: add missing `#include <algorithm>` as needed

Manual backport of #21045

* chore: add patch to include missing `#include <memory>`

* chore: add another `#include <memory>` needed

* chore: regenerate patches w/correct breakpad root

* chore: regenerate breakpad include failure patches

* refactor: use --keep-cr in the git am patch script

We need something like this to patch files that have crlf endings. See
https://stackoverflow.com/questions/6289001/git-am-format-patch-control-format-of-line-endings

* chore: regenerate node patches

The udpated crlf support in git-{import,export}-patches caused a new
warning when applying patches from `electron/patches/nodes`, so refresh
the patches.

* chore: no need to regenerate node patches

* chore: silence whitespace warnings

* chore: fix FTBFS from stl features used but not included

* fixup! refactor: use --keep-cr in the git am patch script
2019-11-18 10:39:59 -08:00
Robo
b3edf86914 fix: incorrect size of windows on differently scaled monitors (#21139)
* Revert "fix: handle WM_GETMINMAXINFO instead of letting chromium do it (#19928)"

This reverts commit 27ce6a9cd3.

* fix: don't reset the width and height when correcting window placement
2019-11-15 09:28:47 -08:00
John Kleinschmidt
7044122f5d chore: Reset version for 8-x-y (#21134)
* Revert "Bump v8.0.0-beta.4"

This reverts commit 2560776888.

* Revert "Bump v8.0.0-beta.3"

This reverts commit d5d5fef931.
2019-11-14 16:34:57 -08:00
Jeremy Apthorp
b7bcce9576 fix: implement login event for WebContents (#21098)
* fix: implement login event for WebContents

* fix gin header path

* use mate

* correct path to native_mate/dictionary.h

* use BindRepeating bc apparently no BindOnce converter...?
2019-11-14 16:18:28 -08:00
Electron Bot
2560776888 Bump v8.0.0-beta.4 2019-11-14 10:20:46 -08:00
Electron Bot
d5d5fef931 Bump v8.0.0-beta.3 2019-11-14 09:50:16 -08:00
Cheng Zhao
6b158872fc fix: webRequest should be able to modify CORS headers (#21099) (#21122) 2019-11-14 12:45:25 -05:00
Andrew MacDonald
a4ef2d4356 feat: add app.getApplicationNameForProtocol API (#20399) (#21117)
* Add GetApplicationNameForProtocol.

* Fix Windows implementation.

* Fix up test.

* Add documentation.

* Implement for real on Linux using xdg-mime.

Also ensure we allow blocking calls here to avoid errant DCHECKing.

* Improve docs for Linux.

* Clean up tests.

* Add a note about not relying on the precise format.

* Update docs/api/app.md

Co-Authored-By: Shelley Vohr <codebytere@github.com>

* Remove needless `done()`s from tests.

* Use vector list initialization.

* Add a simple test for isDefaultProtocolClient.

* Remove unneeded include and skip a test on Linux CI.

* We no longer differentiate between CI and non-CI test runs.
2019-11-14 12:38:54 -05:00
Milan Burda
14cc902ad8 feat: add 'screen' to systemPreferences.getMediaAccessStatus() (#21116) 2019-11-14 15:15:24 +00:00
Milan Burda
a62a367b9f fix: NativeImage serialization of <webview>.capturePage() result (#21103)
* refactor: add Error to isSerializableObject() (#20886)

* fix: NativeImage serialization of <webview>.capturePage() result (#20825)
2019-11-14 10:36:22 +00:00
Shelley Vohr
8d67f16512 fix: refactor printing for mojo (#21059) 2019-11-13 17:43:38 +00:00
loc
59cb78e9aa fix: allow iframe-initiated HTML fullscreen to exit while in macOS fullscreen (8-x-y) (#21042)
* fix: explicitly resize the contents when exiting html fullscreen while in OS fullscreen

* test: ensure HTML fullscreen toggles while in OS fullscreen
2019-11-13 14:33:31 +09:00
Samuel Attard
032552df57 build: depend on chromium version not SHA (#20839) 2019-11-08 16:35:10 -08:00
trop[bot]
1913926ebc feat: deprecate <webview>.getWebContents() (#21039) 2019-11-07 15:31:54 -05:00
trop[bot]
dc979388ba fix: check for validity of guest webcontents (#21035) 2019-11-07 13:37:14 -05:00
trop[bot]
bcabc25b93 fix: Fix broken globalShortcuts.registerAll() on non-macOS platforms (#20984)
This was a regression in #16125, which unintentionally put
`GlobalShortcutListener::RegisterAccelerator` into a
`#if defined(OS_MACOSX)` block.

Notes: Fix broken `globalShortcut.registerAll()` on Windows and Linux
2019-11-06 23:01:51 -08:00
trop[bot]
ab6d22c958 docs: fix win.setIcon ts type (#20981)
* docs: fix win.setIcon ts type

* test: update smoke tests
2019-11-06 16:25:26 -08:00
trop[bot]
806925ee79 fix: proper i18n of recentDocuments item (#20956) 2019-11-06 13:57:42 -08:00
Samuel Attard
a46b50fc7b fix: correctly emplace optional values in the value converter (#20985)
* fix: correctly emplace optional values in the value converter

* chore: replace optional with nullopt when the conversion failed
2019-11-06 10:34:29 -08:00
trop[bot]
517a5915d7 chore: emit the document-start and document-end events in a sandboxed renderer (#20992) 2019-11-05 19:25:10 -08:00
trop[bot]
1de38af8cc chore: upgrade ts generator for better type safety (#20976)
* chore: upgrade ts generator for better type safety

* spec: fix tests
2019-11-05 15:20:08 -08:00
trop[bot]
66a95db3df docs: update installation instructions for proxies (#20979) 2019-11-05 13:45:14 -08:00
trop[bot]
7b779c6e6a fix: cannot access nativeTheme via electron.remote (#20953) 2019-11-04 16:00:28 -08:00
trop[bot]
429dfd7054 fix: don't export __esModule = true by electron.ts (#20952) 2019-11-04 16:00:03 -08:00
Samuel Attard
03f7a85cfb fix: capture the promise global to avoid userland mutation (#20925) (#20946) 2019-11-04 15:58:28 -08:00
trop[bot]
2d2a753dd9 fix: don't copy tray image when it's set (#20936) 2019-11-04 14:17:18 -08:00
trop[bot]
028e3889f0 fix: use Unicode version of ShellExecute() in OpenExternalOnWorkerThread() (#20906) 2019-11-01 18:25:29 -07:00
trop[bot]
47eb123649 build: lengthen wait times and retries for CircleCI releases (#20894)
* build: lengthen wait times and retries for CircleCI releases

* Review suggestions

* build: allow CircleCI timeout and retry to be set via env variables (#20896)

* build: allow circleci timeout and retry to be set via env variables

* check for more statuses and run indefinitely

(cherry picked from commit 4240017cb6)
2019-11-01 14:17:24 -04:00
trop[bot]
45ab098079 build: enable sccache on windows (#20898)
* build: enable sccache on windows

* chore: temporarily disable the docs only check

* build: fix escaping in sccache path on windows

* Update appveyor.yml

* Update appveyor.yml

* Use sccache settings from CI

* Use Azure enabled sccache for Windows
2019-11-01 11:46:10 -04:00
Electron Bot
6cfc05ded2 Bump v8.0.0-beta.2 2019-10-31 14:37:20 -07:00
Samuel Attard
40e0e8e499 feat: enable builtin spellchecker (#20897)
* feat: enable builtin spellchecker (#20692)

* chore: add code required to use chromes spellchecker

* chore: fix linting

* chore: manifests needs buildflags now

* chore: add dictionarySuggestions to the context menu event when the spellchecker is active

* chore: enable by default for windows builds

* chore: add patch to remove incognito usage in the spellchecker

* chore: add dependencies on spellcheck common and flags

* chore: conditionally include spell check panel impl

* chore: fix deps for spellcheck feature flags

* chore: add patch for electron resources

* chore: add dependency on //components/language/core/browser

* chore: patches to make hunspell work on windows

* build: collect hunspell dictionaries into a zip file and publish

* chore: clean up patches

* chore: add docs and set spell checker url method

* chore: fix error handling

* chore: fix hash logic

* build: update hunspell filename generator

* fix: default spellchecker list to the current system locale if we can

* docs: document the language getter

* chore: patch IDS_ resources for linux builds

* feat: add spellcheck webpref flag to disable the builtin spellchecker

* chore: fix docs typo

* chore: clean up spellchecker impl as per feedback

* remove unneeded deps

* chore: disable spellcheck by default in web prefs
2019-10-31 14:35:38 -07:00
trop[bot]
beff8b8b51 docs: clean up performance checklist formatting (#20888)
* docs: fix list formatting in performance checklist

* docs: remove unused link ref
2019-10-31 09:52:36 -07:00
trop[bot]
311723396a fix: swapped labels on open/save gtkdialog (#20883) 2019-10-31 08:42:37 -07:00
trop[bot]
d39d75321a build: do not try to run non existent VSTS release builds (#20878) 2019-10-31 10:53:44 -04:00
Birunthan Mohanathas
55201d7db6 fix: Disable compositor recycling only for attached views (8-x-y) (#20847)
Backport of #20829

Notes: Fix flicker when switching between `BrowserView`s
2019-10-30 16:52:33 -04:00
trop[bot]
ac46d5b16e fix: devtools extensions not loading (#20842) 2019-10-30 09:16:32 -07:00
Milan Burda
a1fb069624 fix: pass frameId to v8Util.setRemoteCallbackFreer() (#20732) (#20813) 2019-10-30 14:35:18 +09:00
trop[bot]
3aa33dd220 fix: do not DCHECK production-necessary methods (#20836) 2019-10-29 14:49:12 -07:00
trop[bot]
9b74d0d54a fix: properly generate requestID in webContents.printToPDF() (#20802) 2019-10-29 15:39:41 +09:00
trop[bot]
018fc2ca46 fix: deprecation warnings in Electron code (#20805) 2019-10-29 15:38:25 +09:00
trop[bot]
e286b78df7 docs: the ipc main listener being removed can have args (#20807) 2019-10-29 15:34:44 +09:00
Shelley Vohr
f77bd19a70 fix: prevent menu gc during popup (#20785) 2019-10-29 13:21:08 +09:00
trop[bot]
cff63d32a0 chore: fix formatting of a few Python files (#20778) 2019-10-28 15:36:53 -04:00
trop[bot]
a8e7696674 ci: skip build on doc only changes (#20717)
* ci: skip build on doc only changes

* Try using exit codes on doc-only-change

* Fixup

* Fixup circleci doc-only check

* Update appveyor.yml

Co-Authored-By: Samuel Attard <sattard@slack-corp.com>

* Properly detect doc only change on Windows

* Flip exit code per review

* build: fix doc only change when there isn't a PR (#20749)

* build: fix doc only change when there isn't a PR

Fixes issue where CI was mistakenly marking a PR as a doc only change because the CI was kicked off before the PR was created.

(cherry picked from commit 73da4b7215)
2019-10-28 11:14:50 -04:00
trop[bot]
5fc689dc4e docs: fix process.getSystemVersion() type (#20767) 2019-10-27 11:21:00 -07:00
Electron Bot
895bdc0ee0 Bump v8.0.0-beta.1 2019-10-24 12:05:38 -07:00
Electron Bot
c99f1d317e Revert "Bump v8.0.0-beta.1"
This reverts commit 315e3e325d.
2019-10-23 16:07:43 -07:00
Electron Bot
315e3e325d Bump v8.0.0-beta.1 2019-10-23 16:04:33 -07:00
Samuel Attard
8acce4279b Revert "Bump v8.0.0-beta.1"
This reverts commit c8943cdc3c.
2019-10-23 16:03:04 -07:00
Electron Bot
c8943cdc3c Bump v8.0.0-beta.1 2019-10-23 13:15:01 -07:00
trop[bot]
f74f009648 build: handle -x-y format for getCurrentBranch (#20711) 2019-10-23 13:03:50 -07:00
298 changed files with 4392 additions and 2558 deletions

View File

@@ -65,18 +65,22 @@ machine-linux-2xlarge: &machine-linux-2xlarge
machine-mac: &machine-mac
macos:
xcode: "9.4.1"
xcode: "10.3.0"
machine-mac-large: &machine-mac-large
resource_class: large
macos:
xcode: "9.4.1"
xcode: "10.3.0"
# Build configurations options.
env-debug-build: &env-debug-build
GN_CONFIG: //electron/build/args/debug.gn
SKIP_DIST_ZIP: '1'
env-mac-debug-build: &env-mac-debug-build
# Set symbol level to 1 so that debug builds do not run out of disk space
GN_BUILDFLAG_ARGS: 'symbol_level = 1'
env-testing-build: &env-testing-build
GN_CONFIG: //electron/build/args/testing.gn
CHECK_DIST_MANIFEST: '1'
@@ -155,6 +159,10 @@ env-ninja-status: &env-ninja-status
env-disable-run-as-node: &env-disable-run-as-node
GN_BUILDFLAG_ARGS: 'enable_run_as_node = false'
env-32bit-release: &env-32bit-release
# Set symbol level to 1 for 32 bit releases because of https://crbug.com/648948
GN_BUILDFLAG_ARGS: 'symbol_level = 1'
# Individual (shared) steps.
step-maybe-notify-slack-failure: &step-maybe-notify-slack-failure
run:
@@ -246,14 +254,21 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
command: |
if [ "`uname`" == "Darwin" ]; then
sudo rm -rf /Library/Developer/CoreSimulator
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
fi
step-delete-git-directories: &step-delete-git-directories
run:
name: Delete src/.git directory on MacOS to free space
name: Delete all .git directories under src on MacOS to free space
command: |
if [ "`uname`" == "Darwin" ]; then
sudo rm -rf src/.git
cd src
( find . -type d -name ".git" ) | xargs rm -rf
fi
# On macOS the yarn install command during gclient sync was run on a linux
@@ -319,6 +334,8 @@ step-gn-check: &step-gn-check
gn check out/Default //electron:electron_app
gn check out/Default //electron:manifests
gn check out/Default //electron/shell/common/api:mojo
# Check the hunspell filenames
node electron/script/gen-hunspell-filenames.js --check
step-electron-build: &step-electron-build
run:
@@ -534,6 +551,20 @@ step-mksnapshot-store: &step-mksnapshot-store
path: src/out/Default/mksnapshot.zip
destination: mksnapshot.zip
step-hunspell-build: &step-hunspell-build
run:
name: hunspell build
command: |
cd src
if [ "$SKIP_DIST_ZIP" != "1" ]; then
ninja -C out/Default electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
fi
step-hunspell-store: &step-hunspell-store
store_artifacts:
path: src/out/Default/hunspell_dictionaries.zip
destination: hunspell_dictionaries.zip
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
run:
name: Generate breakpad symbols
@@ -693,7 +724,6 @@ step-minimize-workspace-size-from-checkout: &step-minimize-workspace-size-from-c
rm -rf src/ios
rm -rf src/third_party/blink/web_tests
rm -rf src/third_party/blink/perf_tests
rm -rf src/third_party/hunspell_dictionaries
rm -rf src/third_party/WebKit/LayoutTests
# Save the src cache based on the deps hash
@@ -704,6 +734,51 @@ step-save-src-cache: &step-save-src-cache
key: v5-src-cache-{{ arch }}-{{ checksum "src/electron/.depshash" }}
name: Persisting src cache
# Check for doc only change
step-check-for-doc-only-change: &step-check-for-doc-only-change
run:
name: Check if commit is doc only change
command: |
cd src/electron
node script/yarn install --frozen-lockfile
if node script/doc-only-change.js --prNumber=$CIRCLE_PR_NUMBER --prURL=$CIRCLE_PULL_REQUEST; then
#PR is doc only change; save file with value true to indicate doc only change
echo "true" > .skip-ci-build
else
#PR is not a doc only change; create empty file to indicate check has been done
touch .skip-ci-build
fi
step-persist-doc-only-change: &step-persist-doc-only-change
persist_to_workspace:
root: .
paths:
- src/electron/.skip-ci-build
step-maybe-early-exit-doc-only-change: &step-maybe-early-exit-doc-only-change
run:
name: Shortcircuit build if doc only change
command: |
if [ -s src/electron/.skip-ci-build ]; then
circleci-agent step halt
fi
step-maybe-early-exit-no-doc-change: &step-maybe-early-exit-no-doc-change
run:
name: Shortcircuit job if change is not doc only
command: |
if [ ! -s src/electron/.skip-ci-build ]; then
circleci-agent step halt
fi
step-ts-compile: &step-ts-compile
run:
name: Run TS/JS compile on doc only change
command: |
cd src
ninja -C out/Default electron:default_app_js -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:atom_js2c -j $NUMBER_OF_NINJA_PROCESSES
# Lists of steps.
steps-lint: &steps-lint
steps:
@@ -752,6 +827,9 @@ steps-lint: &steps-lint
steps-checkout-fast: &steps-checkout-fast
steps:
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-persist-doc-only-change
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
@@ -783,6 +861,9 @@ steps-checkout-fast: &steps-checkout-fast
steps-checkout-and-save-cache: &steps-checkout-and-save-cache
steps:
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-persist-doc-only-change
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
@@ -813,6 +894,7 @@ steps-electron-gn-check: &steps-electron-gn-check
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-gn-gen-default
@@ -822,14 +904,15 @@ steps-electron-build: &steps-electron-build
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-restore-brew-cache
- *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
- *step-gn-gen-default
- *step-delete-git-directories
- *step-gn-gen-default
# Electron app
- *step-electron-build
@@ -859,6 +942,10 @@ steps-electron-build: &steps-electron-build
- *step-ffmpeg-build
- *step-ffmpeg-store
# hunspell
- *step-hunspell-build
- *step-hunspell-store
# Save all data needed for a further tests run.
- *step-persist-data-for-tests
@@ -875,6 +962,90 @@ steps-electron-build-with-inline-checkout-for-tests: &steps-electron-build-with-
steps:
# Checkout - Copied ffrom steps-checkout
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-persist-doc-only-change
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
- *step-get-more-space-on-mac
- *step-install-gnutar-on-mac
- *step-generate-deps-hash
- *step-touch-sync-done
- *step-maybe-restore-src-cache
- *step-maybe-restore-git-cache
- *step-set-git-cache-path
# This sync call only runs if .circle-sync-done is an EMPTY file
- *step-gclient-sync
# These next few steps reset Electron to the correct commit regardless of which cache was restored
- run:
name: Wipe Electron
command: rm -rf src/electron
- *step-checkout-electron
- *step-run-electron-only-hooks
- *step-generate-deps-hash-cleanly
- *step-mark-sync-done
- *step-minimize-workspace-size-from-checkout
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-restore-brew-cache
- *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
- *step-delete-git-directories
- *step-gn-gen-default
# Electron app
- *step-electron-build
- *step-maybe-electron-dist-strip
- *step-electron-dist-build
- *step-electron-dist-store
- *step-ninja-summary
# Native test targets
- *step-native-unittests-build
- *step-native-unittests-store
# Node.js headers
- *step-nodejs-headers-build
- *step-nodejs-headers-store
- *step-show-sccache-stats
# mksnapshot
- *step-mksnapshot-build
- *step-mksnapshot-store
- *step-maybe-cross-arch-snapshot
- *step-maybe-cross-arch-snapshot-store
# ffmpeg
- *step-ffmpeg-gn-gen
- *step-ffmpeg-build
- *step-ffmpeg-store
# hunspell
- *step-hunspell-build
- *step-hunspell-store
# Save all data needed for a further tests run.
- *step-persist-data-for-tests
- *step-maybe-generate-breakpad-symbols
- *step-maybe-zip-symbols
- *step-symbols-store
# Trigger tests on arm hardware if needed
- *step-maybe-trigger-arm-test
- *step-maybe-notify-slack-failure
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
steps:
# Checkout - Copied ffrom steps-checkout
- *step-checkout-electron
- *step-check-for-doc-only-change
- *step-maybe-early-exit-no-doc-change
- *step-depot-tools-get
- *step-depot-tools-add-to-path
- *step-restore-brew-cache
@@ -904,47 +1075,9 @@ steps-electron-build-with-inline-checkout-for-tests: &steps-electron-build-with-
- *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac
- *step-gn-gen-default
- *step-delete-git-directories
# Electron app
- *step-electron-build
- *step-maybe-electron-dist-strip
- *step-electron-dist-build
- *step-electron-dist-store
- *step-ninja-summary
# Native test targets
- *step-native-unittests-build
- *step-native-unittests-store
# Node.js headers
- *step-nodejs-headers-build
- *step-nodejs-headers-store
- *step-show-sccache-stats
# mksnapshot
- *step-mksnapshot-build
- *step-mksnapshot-store
- *step-maybe-cross-arch-snapshot
- *step-maybe-cross-arch-snapshot-store
# ffmpeg
- *step-ffmpeg-gn-gen
- *step-ffmpeg-build
- *step-ffmpeg-store
# Save all data needed for a further tests run.
- *step-persist-data-for-tests
- *step-maybe-generate-breakpad-symbols
- *step-maybe-zip-symbols
- *step-symbols-store
# Trigger tests on arm hardware if needed
- *step-maybe-trigger-arm-test
- *step-maybe-notify-slack-failure
#Compile ts/js to verify doc change didn't break anything
- *step-ts-compile
steps-electron-build-for-publish: &steps-electron-build-for-publish
steps:
@@ -955,8 +1088,9 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-get-more-space-on-mac
- *step-gclient-sync
- *step-setup-env-for-build
- *step-gn-gen-default
- *step-delete-git-directories
- *step-minimize-workspace-size-from-checkout
- *step-gn-gen-default
# Electron app
- *step-electron-build
@@ -984,6 +1118,10 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-ffmpeg-build
- *step-ffmpeg-store
# hunspell
- *step-hunspell-build
- *step-hunspell-store
# typescript defs
- *step-maybe-generate-typescript-defs
@@ -1064,6 +1202,7 @@ steps-tests: &steps-tests
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-electron-dist-unzip
- *step-mksnapshot-unzip
@@ -1106,6 +1245,7 @@ steps-test-nan: &steps-test-nan
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-electron-dist-unzip
- *step-setup-linux-for-headless-testing
@@ -1121,6 +1261,7 @@ steps-test-node: &steps-test-node
steps:
- attach_workspace:
at: .
- *step-maybe-early-exit-doc-only-change
- *step-depot-tools-add-to-path
- *step-electron-dist-unzip
- *step-setup-linux-for-headless-testing
@@ -1146,6 +1287,13 @@ jobs:
<<: *env-linux-medium
<<: *steps-lint
ts-compile-doc-change:
<<: *machine-linux-medium
environment:
<<: *env-linux-medium
<<: *env-testing-build
<<: *steps-electron-ts-compile-for-doc-change
# Layer 1: Checkout.
linux-checkout-fast:
<<: *machine-linux-2xlarge
@@ -1315,6 +1463,7 @@ jobs:
<<: *env-ia32
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *steps-electron-build-for-publish
@@ -1369,6 +1518,7 @@ jobs:
<<: *env-arm
<<: *env-release-build
<<: *env-enable-sccache
<<: *env-32bit-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
UPLOAD_TO_S3: << pipeline.parameters.upload-to-s3 >>
<<: *steps-electron-build-for-publish
@@ -1458,6 +1608,7 @@ jobs:
environment:
<<: *env-mac-large
<<: *env-debug-build
<<: *env-mac-debug-build
<<: *env-enable-sccache
<<: *env-ninja-status
<<: *steps-electron-build
@@ -1520,6 +1671,7 @@ jobs:
<<: *env-mac-large
<<: *env-mas
<<: *env-debug-build
<<: *env-mac-debug-build
<<: *env-enable-sccache
<<: *env-ninja-status
<<: *steps-electron-build
@@ -1917,6 +2069,7 @@ workflows:
- linux-arm64-testing-gn-check:
requires:
- linux-checkout-fast
- ts-compile-doc-change
build-mac:
when: << pipeline.parameters.run-build-mac >>

View File

@@ -1,6 +1,7 @@
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//content/public/app/mac_helpers.gni")
import("//pdf/features.gni")
import("//printing/buildflags/buildflags.gni")
@@ -21,6 +22,7 @@ import("buildflags/buildflags.gni")
import("electron_paks.gni")
import("filenames.auto.gni")
import("filenames.gni")
import("filenames.hunspell.gni")
if (is_mac) {
import("//build/config/mac/rules.gni")
@@ -358,12 +360,13 @@ source_set("electron_lib") {
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
"//components/language/core/browser",
"//components/net_log",
"//components/network_hints/common",
"//components/network_hints/browser",
"//components/network_hints/common:mojo_bindings",
"//components/network_hints/renderer",
"//components/network_session_configurator/common",
"//components/prefs",
"//components/spellcheck/renderer",
"//components/viz/host",
"//components/viz/service",
"//content/public/browser",
@@ -478,6 +481,10 @@ source_set("electron_lib") {
]
}
if (enable_builtin_spellchecker) {
deps += [ "chromium_src:chrome_spellchecker" ]
}
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
@@ -546,6 +553,10 @@ source_set("electron_lib") {
]
sources += filenames.lib_sources_nss
sources += [
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]
}
if (is_win) {
libs += [ "dwmapi.lib" ]
@@ -705,7 +716,6 @@ if (is_mac) {
public_deps += [ "//third_party/icu:icudata" ]
}
if (v8_use_external_startup_data) {
sources += [ "$root_out_dir/natives_blob.bin" ]
public_deps += [ "//v8" ]
if (use_v8_context_snapshot) {
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
@@ -1265,9 +1275,14 @@ template("dist_zip") {
"outputs",
"testonly",
])
flatten = false
if (defined(invoker.flatten)) {
flatten = invoker.flatten
}
args = rebase_path(outputs + [ _runtime_deps_file ], root_build_dir) + [
target_cpu,
target_os,
"$flatten",
]
}
}
@@ -1353,6 +1368,24 @@ dist_zip("electron_mksnapshot_zip") {
]
}
copy("hunspell_dictionaries") {
sources = hunspell_dictionaries + hunspell_licenses
outputs = [
"$target_gen_dir/electron_hunspell/{{source_file_part}}",
]
}
dist_zip("hunspell_dictionaries_zip") {
data_deps = [
":hunspell_dictionaries",
]
flatten = true
outputs = [
"$root_build_dir/hunspell_dictionaries.zip",
]
}
group("electron") {
public_deps = [
":electron_app",

4
DEPS
View File

@@ -11,7 +11,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'c3a0220e7bde049d599a8332b9b2785b0178be74',
'80.0.3955.0',
'node_version':
'v12.13.0',
'nan_version':
@@ -114,7 +114,7 @@ hooks = [
'pattern': 'src/electron/script/update-external-binaries.py',
'condition': 'download_external_binaries',
'action': [
'python',
'python3',
'src/electron/script/update-external-binaries.py',
],
},

View File

@@ -1 +1 @@
8.0.0-nightly.20191023
8.0.0-beta.3

View File

@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: libcc-20
image: vs2017-15.9-10.0.18362
image: vs2019-16.3-10.0.18362
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -50,6 +50,12 @@ build_script:
- ps: >-
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
} else {
node script/yarn.js install --frozen-lockfile
if ($(node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH;$LASTEXITCODE -eq 0)) {
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
}
}
- echo "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
@@ -73,7 +79,7 @@ build_script:
- gclient sync --with_branch_heads --with_tags --reset
- cd src
- ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn"
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS%"
- 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
@@ -85,8 +91,10 @@ build_script:
- ninja -C out/Default electron:electron_dist_zip
- ninja -C out/Default shell_browser_ui_unittests
- ninja -C out/Default electron:electron_mksnapshot_zip
- 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
- cmd /C %SCCACHE_PATH% --show-stats
- appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/shell_browser_ui_unittests.exe
- appveyor PushArtifact out/Default/chromedriver.zip
@@ -94,6 +102,7 @@ build_script:
- 7z a node_headers.zip out\Default\gen\node_headers
- appveyor PushArtifact node_headers.zip
- appveyor PushArtifact out/Default/mksnapshot.zip
- appveyor PushArtifact out/Default/hunspell_dictionaries.zip
- appveyor PushArtifact out/Default/electron.lib
- ps: >-
if ($env:GN_CONFIG -eq 'release') {

View File

@@ -1,5 +1,4 @@
is_electron_build = true
use_jumbo_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
@@ -21,9 +20,5 @@ angle_enable_vulkan_validation_layers = false
is_cfi = false
# TODO: Remove this and update CI to contain 10.14 SDK once
# crbug.com/986701 is fixed.
mac_sdk_min = "10.13"
# TODO: disabled due to crashes. re-enable.
enable_osr = false

View File

@@ -5,4 +5,3 @@ is_debug = false
is_component_build = false
is_component_ffmpeg = false
symbol_level = 1
use_jumbo_build = true

View File

@@ -1,9 +1,50 @@
import("//build/config/mac/mac_sdk.gni")
# This is imported from /ios becuase this functionality was moved
# after Chromium stopped using xib files for macOS menu functionality
# See https://chromium-review.googlesource.com/c/chromium/src/+/1648695
import("//build/config/ios/rules.gni")
# Template to compile .xib and .storyboard files.
# (copied from src/build/config/ios/rules.gni)
#
# Arguments
#
# sources:
# list of string, sources to compile
#
# ibtool_flags:
# (optional) list of string, additional flags to pass to the ibtool
template("compile_ib_files") {
action_foreach(target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
assert(defined(invoker.sources),
"sources must be specified for $target_name")
assert(defined(invoker.output_extension),
"output_extension must be specified for $target_name")
ibtool_flags = []
if (defined(invoker.ibtool_flags)) {
ibtool_flags = invoker.ibtool_flags
}
_output_extension = invoker.output_extension
script = "//build/config/ios/compile_ib_files.py"
sources = invoker.sources
outputs = [
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
]
args = [
"--input",
"{{source}}",
"--output",
rebase_path(
"$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension",
root_build_dir),
]
args += ibtool_flags
}
}
# Template is copied here from Chromium but was removed in
# https://chromium-review.googlesource.com/c/chromium/src/+/1637981

View File

@@ -74,7 +74,10 @@ module.exports = ({
global: ['@electron/internal/renderer/webpack-provider', '_global'],
Buffer: ['@electron/internal/renderer/webpack-provider', 'Buffer'],
})
] : [])
] : []),
new webpack.ProvidePlugin({
Promise: ['@electron/internal/common/webpack-globals-provider', 'Promise'],
}),
]
})
}
}

View File

@@ -46,13 +46,14 @@ def execute(argv):
raise e
def main(argv):
dist_zip, runtime_deps, target_cpu, target_os = argv
dist_zip, runtime_deps, target_cpu, target_os, flatten_val = argv
should_flatten = flatten_val == "true"
dist_files = set()
with open(runtime_deps) as f:
for dep in f.readlines():
dep = dep.strip()
dist_files.add(dep)
if sys.platform == 'darwin':
if sys.platform == 'darwin' and not should_flatten:
execute(['zip', '-r', '-y', dist_zip] + list(dist_files))
else:
with zipfile.ZipFile(dist_zip, 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as z:
@@ -67,7 +68,7 @@ def main(argv):
basename = os.path.basename(dep)
dirname = os.path.dirname(dep)
arcname = os.path.join(dirname, 'chrome-sandbox') if basename == 'chrome_sandbox' else dep
z.write(dep, arcname)
z.write(dep, os.path.basename(arcname) if should_flatten else arcname)
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))

View File

@@ -19,6 +19,7 @@ buildflag_header("buildflags") {
"ENABLE_TTS=$enable_tts",
"ENABLE_COLOR_CHOOSER=$enable_color_chooser",
"ENABLE_ELECTRON_EXTENSIONS=$enable_electron_extensions",
"ENABLE_BUILTIN_SPELLCHECKER=$enable_builtin_spellchecker",
"ENABLE_PICTURE_IN_PICTURE=$enable_picture_in_picture",
"OVERRIDE_LOCATION_PROVIDER=$enable_fake_location_provider",
]

View File

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

View File

@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/ui.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//electron/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//third_party/widevine/cdm/widevine.gni")
@@ -31,6 +32,8 @@ static_library("chrome") {
"//chrome/browser/icon_loader_win.cc",
"//chrome/browser/icon_manager.cc",
"//chrome/browser/icon_manager.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
"//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc",
"//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h",
"//chrome/browser/net/proxy_config_monitor.cc",
@@ -39,6 +42,8 @@ static_library("chrome") {
"//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/predictors/preconnect_manager.cc",
"//chrome/browser/predictors/preconnect_manager.h",
"//chrome/browser/predictors/predictors_features.cc",
"//chrome/browser/predictors/predictors_features.h",
"//chrome/browser/predictors/proxy_lookup_client_impl.cc",
"//chrome/browser/predictors/proxy_lookup_client_impl.h",
"//chrome/browser/predictors/resolve_host_client_impl.cc",
@@ -225,3 +230,52 @@ static_library("chrome") {
]
}
}
# This source set is just so we don't have to depend on all of //chrome/browser
# You may have to add new files here during the upgrade if //chrome/browser/spellchecker
# gets more files
source_set("chrome_spellchecker") {
sources = [
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc",
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.h",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_factory.cc",
"//chrome/browser/spellchecker/spellcheck_factory.h",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blacklist_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_policy_handler.h",
"//chrome/browser/spellchecker/spellcheck_service.cc",
"//chrome/browser/spellchecker/spellcheck_service.h",
]
if (has_spellcheck_panel) {
sources += [
"//chrome/browser/spellchecker/spell_check_panel_host_impl.cc",
"//chrome/browser/spellchecker/spell_check_panel_host_impl.h",
]
}
if (use_browser_spellchecker) {
sources += [
"//chrome/browser/spellchecker/spelling_request.cc",
"//chrome/browser/spellchecker/spelling_request.h",
]
}
deps = [
"//base:base_static",
"//components/language/core/browser",
"//components/spellcheck:buildflags",
"//components/sync",
]
public_deps = [
"//components/spellcheck/browser",
"//components/spellcheck/common",
"//components/spellcheck/renderer",
]
}

View File

@@ -37,10 +37,8 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext(
// public and private slot.
// Redirect any slot usage to this persistent slot on Linux.
g_nss_cert_database = new net::NSSCertDatabase(
crypto::ScopedPK11Slot(
crypto::GetPersistentNSSKeySlot()) /* public slot */,
crypto::ScopedPK11Slot(
crypto::GetPersistentNSSKeySlot()) /* private slot */);
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* public slot */,
crypto::ScopedPK11Slot(PK11_GetInternalKeySlot()) /* private slot */);
}
return g_nss_cert_database;
}

View File

@@ -314,10 +314,8 @@ Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `request` Object
* `method` String
* `authenticationResponseDetails` Object
* `url` URL
* `referrer` URL
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
@@ -337,7 +335,7 @@ should prevent the default behavior with `event.preventDefault()` and call
```javascript
const { app } = require('electron')
app.on('login', (event, webContents, request, authInfo, callback) => {
app.on('login', (event, webContents, details, authInfo, callback) => {
event.preventDefault()
callback('username', 'secret')
})
@@ -770,6 +768,21 @@ macOS machine. Please refer to
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
### `app.getApplicationNameForProtocol(url)`
* `url` String - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a
minimum (e.g. `https://`).
Returns `String` - Name of the application handling the protocol, or an empty
string if there is no handler. For instance, if Electron is the default
handler of the URL, this could be `Electron` on Windows and Mac. However,
don't rely on the precise format which is not guaranteed to remain unchanged.
Expect a different format on Linux, possibly with a `.desktop` suffix.
This method returns the application name of the default handler for the protocol
(aka URI scheme) of a URL.
### `app.setUserTasks(tasks)` _Windows_
* `tasks` [Task[]](structures/task.md) - Array of `Task` objects

View File

@@ -59,6 +59,47 @@ these kinds of objects will throw a 'could not be cloned' error.
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
### `<webview>.getWebContents()`
This API is implemented using the `remote` module, which has both performance
and security implications. Therefore its usage should be explicit.
```js
// Deprecated
webview.getWebContents()
// Replace with
const { remote } = require('electron')
remote.webContents.fromId(webview.getWebContentsId())
```
However, it is recommended to avoid using the `remote` module altogether.
```js
// main
const { ipcMain, webContents } = require('electron')
const getGuestForWebContents = function (webContentsId, contents) {
const guest = webContents.fromId(webContentsId)
if (!guest) {
throw new Error(`Invalid webContentsId: ${webContentsId}`)
}
if (guest.hostWebContents !== contents) {
throw new Error(`Access denied to webContents`)
}
return guest
}
ipcMain.handle('openDevTools', (event, webContentsId) => {
const guest = getGuestForWebContents(webContentsId, event.sender)
guest.openDevTools()
})
// renderer
const { ipcRenderer } = require('electron')
ipcRenderer.invoke('openDevTools', webview.getWebContentsId())
```
## Planned Breaking API Changes (7.0)
### Node Headers URL
@@ -103,7 +144,7 @@ const idleTime = getSystemIdleTime()
### webFrame Isolated World APIs
```js
// Removed in Elecron 7.0
// Removed in Electron 7.0
webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
webFrame.setIsolatedWorldHumanReadableName(worldId, name)
webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
@@ -121,6 +162,40 @@ webFrame.setIsolatedWorldInfo(
This property was removed in Chromium 77, and as such is no longer available.
### `webkitdirectory` attribute for `<input type="file"/>`
The `webkitdirectory` property on HTML file inputs allows them to select folders.
Previous versions of Electron had an incorrect implementation where the `event.target.files`
of the input returned a `FileList` that returned one `File` corresponding to the selected folder.
As of Electron 7, that `FileList` is now list of all files contained within
the folder, similarly to Chrome, Firefox, and Edge
([link to MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory)).
As an illustration, take a folder with this structure:
```console
folder
├── file1
├── file2
└── file3
```
In Electron <=6, this would return a `FileList` with a `File` object for:
```console
path/to/folder
```
In Electron 7, this now returns a `FileList` with a `File` object for:
```console
/path/to/folder/file3
/path/to/folder/file2
/path/to/folder/file1
```
Note that `webkitdirectory` no longer exposes the path to the selected folder.
If you require the path to the selected folder rather than the folder contents,
see the `dialog.showOpenDialog` API ([link](https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options)).
## Planned Breaking API Changes (6.0)
### `win.setMenu(null)`

View File

@@ -385,6 +385,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `accessibleTitle` String (optional) - An alternative title string provided only
to accessibility tools such as screen readers. This string is not directly
visible to users.
* `spellcheck` Boolean (optional) - Whether to enable the builtin spellchecker.
Default is `false`.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
@@ -1579,7 +1581,7 @@ Same as `webContents.showDefinitionForSelection()`.
#### `win.setIcon(icon)` _Windows_ _Linux_
* `icon` [NativeImage](native-image.md)
* `icon` [NativeImage](native-image.md) | String
Changes window icon.

View File

@@ -91,7 +91,11 @@ The `desktopCapturer` module has the following methods:
Returns `Promise<DesktopCapturerSource[]>` - Resolves with an array of [`DesktopCapturerSource`](structures/desktop-capturer-source.md) objects, each `DesktopCapturerSource` represents a screen or an individual window that can be captured.
**Note** Capturing the screen contents requires user consent on macOS 10.15 Catalina or higher,
which can detected by [`systemPreferences.getMediaAccessStatus`].
[`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia
[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-macos
## Caveats

View File

@@ -77,6 +77,7 @@ only the next time a message is sent to `channel`, after which it is removed.
* `channel` String
* `listener` Function
* `...args` any[]
Removes the specified `listener` from the listener array for the specified
`channel`.

View File

@@ -329,9 +329,9 @@ can be called on empty images.
[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer
## Properties
### Instance Properties
### `nativeImage.isMacTemplateImage` _macOS_
#### `nativeImage.isMacTemplateImage` _macOS_
A `Boolean` property that determines whether the image is considered a [template image](https://developer.apple.com/documentation/appkit/nsimage/1520017-template).

View File

@@ -217,11 +217,15 @@ that all statistics are reported in Kilobytes.
Returns `String` - The version of the host operating system.
Examples:
Example:
* `macOS` -> `10.13.6`
* `Windows` -> `10.0.17763`
* `Linux` -> `4.15.0-45-generic`
```js
const version = process.getSystemVersion()
console.log(version)
// On macOS -> '10.13.6'
// On Windows -> '10.0.17763'
// On Linux -> '4.15.0-45-generic'
```
**Note:** It returns the actual operating system version instead of kernel version on macOS unlike `os.release()`.

View File

@@ -389,9 +389,7 @@ which sends a `Buffer` as a response.
* `url` String
* `method` String (optional)
* `session` Session | null (optional)
* `uploadData` Object (optional)
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error

View File

@@ -456,10 +456,38 @@ this session just before normal `preload` scripts run.
Returns `String[]` an array of paths to preload scripts that have been
registered.
#### `ses.setSpellCheckerLanguages(languages)`
* `languages` String[] - An array of language codes to enable the spellchecker for.
The built in spellchecker does not automatically detect what language a user is typing in. In order for the
spell checker to correctly check their words you must call this API with an array of language codes. You can
get the list of supported language codes with the `ses.availableSpellCheckerLanguages` property.
#### `ses.getSpellCheckerLanguages()`
Returns `String[]` - An array of language codes the spellchecker is enabled for. If this list is empty the spellchecker
will fallback to using `en-US`. By default on launch if this setting is an empty list Electron will try to populate this
setting with the current OS locale. This setting is persisted across restarts.
#### `ses.setSpellCheckerDictionaryDownloadURL(url)`
* `url` String - A base URL for Electron to download hunspell dictionaries from.
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.
### Instance Properties
The following properties are available on instances of `Session`:
#### `ses.availableSpellCheckerLanguages` _Readonly_
A `String[]` array which consists of all the known available spell checker languages. Providing a language
code to the `setSpellCheckerLanaguages` API that isn't in this array will result in an error.
#### `ses.cookies` _Readonly_
A [`Cookies`](cookies.md) object for this session.

View File

@@ -1,4 +1,4 @@
# ProtocolResponseUploadData Object
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.
* `data` String | Buffer - Content to be sent.

View File

@@ -434,11 +434,13 @@ Returns `Boolean` - `true` if the current process is a trusted accessibility cli
### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_
* `mediaType` String - `microphone` or `camera`.
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
Returns `String` - Can be `not-determined`, `granted`, `denied`, `restricted` or `unknown`.
This user consent was not required until macOS 10.14 Mojave, so this method will always return `granted` if your system is running 10.13 High Sierra or lower.
This user consent was not required on macOS 10.13 High Sierra or lower so this method will always return `granted`.
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
macOS 10.15 Catalina or higher requires consent for `screen` access.
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_

View File

@@ -454,10 +454,8 @@ The usage is the same with [the `select-client-certificate` event of
Returns:
* `event` Event
* `request` Object
* `method` String
* `authenticationResponseDetails` Object
* `url` URL
* `referrer` URL
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
@@ -570,6 +568,9 @@ Returns:
* `titleText` String - Title or alt text of the selection that the context
was invoked on.
* `misspelledWord` String - The misspelled word under the cursor, if any.
* `dictionarySuggestions` String[] - An array of suggested words to show the
user to replace the `misspelledWord`. Only available if there is a misspelled
word and spellchecker is enabled.
* `frameCharset` String - The character encoding of the frame on which the
menu was invoked.
* `inputFieldType` String - If the context menu was invoked on an input

View File

@@ -74,6 +74,17 @@ Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
Sets a provider for spell checking in input fields and text areas.
If you want to use this method you must disable the builtin spellchecker when you
construct the window.
```js
const mainWindow = new BrowserWindow({
webPreferences: {
spellcheck: false
}
})
```
The `provider` must be an object that has a `spellCheck` method that accepts
an array of individual words for spellchecking.
The `spellCheck` function runs asynchronously and calls the `callback` function

View File

@@ -648,7 +648,7 @@ Sets the maximum and minimum layout-based (i.e. non-visual) zoom level.
Shows pop-up dictionary that searches the selected word on the page.
### `<webview>.getWebContents()`
### `<webview>.getWebContents()` _Deprecated_
Returns [`WebContents`](web-contents.md) - The web contents associated with
this `webview`.

View File

@@ -38,11 +38,15 @@ npm install --platform=win32 electron
## Proxies
If you need to use an HTTP proxy you can [set these environment variables][proxy-env].
If you need to use an HTTP proxy, you need to set the `ELECTRON_GET_USE_PROXY` variable to any
value, plus additional environment variables depending on your host system's Node version:
* [Node 10 and above][proxy-env-10]
* [Before Node 10][proxy-env]
## Custom Mirrors and Caches
During installation, the `electron` module will call out to
[`electron-download`][electron-download] to download prebuilt binaries of
[`@electron/get`][electron-get] to download prebuilt binaries of
Electron for your platform. It will do so by contacting GitHub's
release download page (`https://github.com/electron/electron/releases/tag/v$VERSION`,
where `$VERSION` is the exact version of Electron).
@@ -146,7 +150,8 @@ If you need to force a re-download of the asset and the SHASUM file set the
[npm]: https://docs.npmjs.com
[versioning]: ./electron-versioning.md
[releases]: https://github.com/electron/electron/releases
[proxy-env]: https://github.com/request/request/tree/f0c4ec061141051988d1216c24936ad2e7d5c45d#controlling-proxy-behaviour-using-environment-variables
[electron-download]: https://github.com/electron-userland/electron-download
[proxy-env-10]: https://github.com/gajus/global-agent/blob/v2.1.5/README.md#environment-variables
[proxy-env]: https://github.com/np-maintain/global-tunnel/blob/v2.7.1/README.md#auto-config
[electron-get]: https://github.com/electron/get
[npm-permissions]: https://docs.npmjs.com/getting-started/fixing-npm-permissions
[unsafe-perm]: https://docs.npmjs.com/misc/config#unsafe-perm

View File

@@ -54,13 +54,13 @@ at once, consider the [Chrome Tracing] tool.
Chances are that your app could be a little leaner, faster, and generally less
resource-hungry if you attempt these steps.
1) [Carelessly including modules](#1-carelessly-including-modules)
2) [Loading and running code too soon](#2-loading-and-running-code-too-soon)
3) [Blocking the main process](#3-blocking-the-main-process)
4) [Blocking the renderer process](#4-blocking-the-renderer-process)
5) [Unnecessary polyfills](#5-unnecessary-polyfills)
6) [Unnecessary or blocking network requests](#6-unnecessary-or-blocking-network-requests)
7) [Bundle your code](#7-bundle-your-code)
1. [Carelessly including modules](#1-carelessly-including-modules)
2. [Loading and running code too soon](#2-loading-and-running-code-too-soon)
3. [Blocking the main process](#3-blocking-the-main-process)
4. [Blocking the renderer process](#4-blocking-the-renderer-process)
5. [Unnecessary polyfills](#5-unnecessary-polyfills)
6. [Unnecessary or blocking network requests](#6-unnecessary-or-blocking-network-requests)
7. [Bundle your code](#7-bundle-your-code)
## 1) Carelessly including modules
@@ -418,7 +418,6 @@ As of writing this article, the popular choices include [Webpack][webpack],
[performance-cpu-prof]: ../images/performance-cpu-prof.png
[performance-heap-prof]: ../images/performance-heap-prof.png
[chrome-devtools-tutorial]: https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/
[chrome-tracing-tutorial]:
[worker-threads]: https://nodejs.org/api/worker_threads.html
[web-workers]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
[request-idle-callback]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback

View File

@@ -61,7 +61,6 @@ The output should look roughly like this:
├── libgcrypt.so.11
├── libnode.so
├── locales
├── natives_blob.bin
├── resources
├── v8_context_snapshot.bin
└── version

View File

@@ -62,7 +62,6 @@ The output should look roughly like this:
│   ├── am.pak
│   ├── ar.pak
│   ├── [...]
├── natives_blob.bin
├── node.dll
├── resources
│   ├── app

View File

@@ -69,4 +69,10 @@
<message name="IDS_PICTURE_IN_PICTURE_PREVIOUS_TRACK_CONTROL_ACCESSIBLE_TEXT" desc="Accessible text label used for the controls button in the Picture-in-Picture window. The button invokes previous track action.">
Previous track
</message>
<message name="IDS_SPELLCHECK_DICTIONARY" use_name_for_id="true">
en-US
</message>
<message name="IDS_ACCEPT_LANGUAGES" use_name_for_id="true">
en-US,en
</message>
</grit-part>

View File

@@ -135,12 +135,12 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/remote/type-utils.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
@@ -188,6 +188,7 @@ auto_filenames = {
content_script_bundle_deps = [
"lib/common/electron-binding-setup.ts",
"lib/common/webpack-globals-provider.ts",
"lib/content_script/init.js",
"lib/renderer/chrome-api.ts",
"lib/renderer/extensions/event.ts",
@@ -266,15 +267,15 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
"lib/common/parse-features-string.js",
"lib/common/remote/type-utils.ts",
"lib/common/reset-search-paths.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/ipc-renderer-internal-utils.ts",
"lib/renderer/ipc-renderer-internal.ts",
"package.json",
@@ -289,14 +290,14 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
"lib/common/remote/type-utils.ts",
"lib/common/reset-search-paths.ts",
"lib/common/type-utils.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
@@ -338,13 +339,13 @@ auto_filenames = {
"lib/common/api/module-list.ts",
"lib/common/api/native-image.js",
"lib/common/api/shell.js",
"lib/common/clipboard-utils.ts",
"lib/common/crash-reporter.js",
"lib/common/define-properties.ts",
"lib/common/electron-binding-setup.ts",
"lib/common/init.ts",
"lib/common/remote/type-utils.ts",
"lib/common/reset-search-paths.ts",
"lib/common/type-utils.ts",
"lib/common/webpack-globals-provider.ts",
"lib/renderer/api/context-bridge.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",

View File

@@ -22,6 +22,11 @@ filenames = {
]
lib_sources = [
"chromium_src/chrome/browser/process_singleton.h",
"chromium_src/chrome/browser/process_singleton_posix.cc",
"chromium_src/chrome/browser/process_singleton_win.cc",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h",
"shell/app/atom_content_client.cc",
"shell/app/atom_content_client.h",
"shell/app/atom_main_delegate.cc",
@@ -32,17 +37,17 @@ filenames = {
"shell/app/command_line_args.h",
"shell/app/uv_task_runner.cc",
"shell/app/uv_task_runner.h",
"shell/browser/api/atom_api_app_mac.mm",
"shell/browser/api/atom_api_app.cc",
"shell/browser/font_defaults.cc",
"shell/browser/font_defaults.h",
"shell/browser/feature_list.cc",
"shell/browser/feature_list.h",
"shell/browser/api/atom_api_app.h",
"shell/browser/api/atom_api_app_mac.mm",
"shell/browser/api/atom_api_auto_updater.cc",
"shell/browser/api/atom_api_auto_updater.h",
"shell/browser/api/atom_api_browser_view.cc",
"shell/browser/api/atom_api_browser_view.h",
"shell/browser/api/atom_api_browser_window.cc",
"shell/browser/api/atom_api_browser_window.h",
"shell/browser/api/atom_api_browser_window_mac.mm",
"shell/browser/api/atom_api_browser_window_views.cc",
"shell/browser/api/atom_api_content_tracing.cc",
"shell/browser/api/atom_api_cookies.cc",
"shell/browser/api/atom_api_cookies.h",
@@ -73,10 +78,10 @@ filenames = {
"shell/browser/api/atom_api_net_log.h",
"shell/browser/api/atom_api_notification.cc",
"shell/browser/api/atom_api_notification.h",
"shell/browser/api/atom_api_power_monitor_mac.mm",
"shell/browser/api/atom_api_power_monitor_win.cc",
"shell/browser/api/atom_api_power_monitor.cc",
"shell/browser/api/atom_api_power_monitor.h",
"shell/browser/api/atom_api_power_monitor_mac.mm",
"shell/browser/api/atom_api_power_monitor_win.cc",
"shell/browser/api/atom_api_power_save_blocker.cc",
"shell/browser/api/atom_api_power_save_blocker.h",
"shell/browser/api/atom_api_protocol_ns.cc",
@@ -106,16 +111,10 @@ filenames = {
"shell/browser/api/atom_api_web_request_ns.cc",
"shell/browser/api/atom_api_web_request_ns.h",
"shell/browser/api/atom_api_web_view_manager.cc",
"shell/browser/api/atom_api_browser_window.cc",
"shell/browser/api/atom_api_browser_window.h",
"shell/browser/api/atom_api_browser_window_mac.mm",
"shell/browser/api/atom_api_browser_window_views.cc",
"shell/browser/api/event.cc",
"shell/browser/api/event.h",
"shell/browser/api/event_emitter_deprecated.cc",
"shell/browser/api/event_emitter_deprecated.h",
"shell/browser/api/trackable_object.cc",
"shell/browser/api/trackable_object.h",
"shell/browser/api/frame_subscriber.cc",
"shell/browser/api/frame_subscriber.h",
"shell/browser/api/gpu_info_enumerator.cc",
@@ -126,29 +125,28 @@ filenames = {
"shell/browser/api/process_metric.h",
"shell/browser/api/save_page_handler.cc",
"shell/browser/api/save_page_handler.h",
"shell/browser/auto_updater.cc",
"shell/browser/auto_updater.h",
"shell/browser/auto_updater_mac.mm",
"shell/browser/atom_autofill_driver_factory.cc",
"shell/browser/atom_autofill_driver_factory.h",
"shell/browser/api/trackable_object.cc",
"shell/browser/api/trackable_object.h",
"shell/browser/atom_autofill_driver.cc",
"shell/browser/atom_autofill_driver.h",
"shell/browser/atom_autofill_driver_factory.cc",
"shell/browser/atom_autofill_driver_factory.h",
"shell/browser/atom_browser_client.cc",
"shell/browser/atom_browser_client.h",
"shell/browser/atom_browser_context.cc",
"shell/browser/atom_browser_context.h",
"shell/browser/atom_download_manager_delegate.cc",
"shell/browser/atom_download_manager_delegate.h",
"shell/browser/atom_gpu_client.cc",
"shell/browser/atom_gpu_client.h",
"shell/browser/atom_browser_main_parts.cc",
"shell/browser/atom_browser_main_parts.h",
"shell/browser/atom_browser_main_parts_mac.mm",
"shell/browser/atom_browser_main_parts_posix.cc",
"shell/browser/atom_download_manager_delegate.cc",
"shell/browser/atom_download_manager_delegate.h",
"shell/browser/atom_gpu_client.cc",
"shell/browser/atom_gpu_client.h",
"shell/browser/atom_javascript_dialog_manager.cc",
"shell/browser/atom_javascript_dialog_manager.h",
"shell/browser/atom_navigation_throttle.h",
"shell/browser/atom_navigation_throttle.cc",
"shell/browser/atom_navigation_throttle.h",
"shell/browser/atom_paths.h",
"shell/browser/atom_permission_manager.cc",
"shell/browser/atom_permission_manager.h",
@@ -158,29 +156,38 @@ filenames = {
"shell/browser/atom_speech_recognition_manager_delegate.h",
"shell/browser/atom_web_ui_controller_factory.cc",
"shell/browser/atom_web_ui_controller_factory.h",
"shell/browser/auto_updater.cc",
"shell/browser/auto_updater.h",
"shell/browser/auto_updater_mac.mm",
"shell/browser/browser.cc",
"shell/browser/browser.h",
"shell/browser/browser_linux.cc",
"shell/browser/browser_mac.mm",
"shell/browser/browser_win.cc",
"shell/browser/browser_observer.h",
"shell/browser/browser_process_impl.cc",
"shell/browser/browser_process_impl.h",
"shell/browser/browser_win.cc",
"shell/browser/child_web_contents_tracker.cc",
"shell/browser/child_web_contents_tracker.h",
"shell/browser/common_web_contents_delegate_mac.mm",
"shell/browser/common_web_contents_delegate_views.cc",
"shell/browser/common_web_contents_delegate.cc",
"shell/browser/common_web_contents_delegate.h",
"shell/browser/common_web_contents_delegate_mac.mm",
"shell/browser/common_web_contents_delegate_views.cc",
"shell/browser/cookie_change_notifier.cc",
"shell/browser/cookie_change_notifier.h",
"shell/browser/feature_list.cc",
"shell/browser/feature_list.h",
"shell/browser/font_defaults.cc",
"shell/browser/font_defaults.h",
"shell/browser/javascript_environment.cc",
"shell/browser/javascript_environment.h",
"shell/browser/lib/bluetooth_chooser.cc",
"shell/browser/lib/bluetooth_chooser.h",
"shell/browser/lib/power_observer.h",
"shell/browser/lib/power_observer_linux.h",
"shell/browser/lib/power_observer_linux.cc",
"shell/browser/lib/power_observer_linux.h",
"shell/browser/linux/unity_service.cc",
"shell/browser/linux/unity_service.h",
"shell/browser/login_handler.cc",
"shell/browser/login_handler.h",
"shell/browser/mac/atom_application.h",
@@ -195,48 +202,52 @@ filenames = {
"shell/browser/mac/in_app_purchase_observer.mm",
"shell/browser/mac/in_app_purchase_product.h",
"shell/browser/mac/in_app_purchase_product.mm",
"shell/browser/microtasks_runner.cc",
"shell/browser/microtasks_runner.h",
"shell/browser/native_browser_view.cc",
"shell/browser/native_browser_view.h",
"shell/browser/native_browser_view_mac.h",
"shell/browser/native_browser_view_mac.mm",
"shell/browser/native_browser_view_views.h",
"shell/browser/native_browser_view_views.cc",
"shell/browser/native_window.cc",
"shell/browser/native_window.h",
"shell/browser/native_window_views_win.cc",
"shell/browser/native_window_views.cc",
"shell/browser/native_window_views.h",
"shell/browser/native_window_mac.h",
"shell/browser/native_window_mac.mm",
"shell/browser/native_window_observer.h",
"shell/browser/media/media_capture_devices_dispatcher.cc",
"shell/browser/media/media_capture_devices_dispatcher.h",
"shell/browser/media/media_device_id_salt.cc",
"shell/browser/media/media_device_id_salt.h",
"shell/browser/media/media_stream_devices_controller.cc",
"shell/browser/media/media_stream_devices_controller.h",
"shell/browser/microtasks_runner.cc",
"shell/browser/microtasks_runner.h",
"shell/browser/native_browser_view.cc",
"shell/browser/native_browser_view.h",
"shell/browser/native_browser_view_mac.h",
"shell/browser/native_browser_view_mac.mm",
"shell/browser/native_browser_view_views.cc",
"shell/browser/native_browser_view_views.h",
"shell/browser/native_window.cc",
"shell/browser/native_window.h",
"shell/browser/native_window_mac.h",
"shell/browser/native_window_mac.mm",
"shell/browser/native_window_observer.h",
"shell/browser/native_window_views.cc",
"shell/browser/native_window_views.h",
"shell/browser/native_window_views_win.cc",
"shell/browser/net/asar/asar_url_loader.cc",
"shell/browser/net/asar/asar_url_loader.h",
"shell/browser/net/atom_url_loader_factory.cc",
"shell/browser/net/atom_url_loader_factory.h",
"shell/browser/net/cert_verifier_client.cc",
"shell/browser/net/cert_verifier_client.h",
"shell/browser/net/proxying_url_loader_factory.cc",
"shell/browser/net/proxying_url_loader_factory.h",
"shell/browser/net/network_context_service_factory.cc",
"shell/browser/net/network_context_service_factory.h",
"shell/browser/net/network_context_service.cc",
"shell/browser/net/network_context_service.h",
"shell/browser/net/network_context_service_factory.cc",
"shell/browser/net/network_context_service_factory.h",
"shell/browser/net/node_stream_loader.cc",
"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/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/network_hints_handler_impl.cc",
"shell/browser/network_hints_handler_impl.h",
"shell/browser/node_debugger.cc",
"shell/browser/node_debugger.h",
"shell/browser/notifications/linux/libnotify_notification.cc",
"shell/browser/notifications/linux/libnotify_notification.h",
"shell/browser/notifications/linux/notification_presenter_linux.cc",
@@ -269,17 +280,13 @@ 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/node_debugger.cc",
"shell/browser/node_debugger.h",
"shell/browser/pref_store_delegate.cc",
"shell/browser/pref_store_delegate.h",
"shell/browser/relauncher.cc",
"shell/browser/relauncher.h",
"shell/browser/relauncher_linux.cc",
"shell/browser/relauncher_mac.cc",
"shell/browser/relauncher_win.cc",
"shell/browser/relauncher.cc",
"shell/browser/relauncher.h",
"shell/browser/renderer_host/electron_render_message_filter.cc",
"shell/browser/renderer_host/electron_render_message_filter.h",
"shell/browser/session_preferences.cc",
"shell/browser/session_preferences.h",
"shell/browser/special_storage_policy.cc",
@@ -293,8 +300,14 @@ filenames = {
"shell/browser/ui/certificate_trust.h",
"shell/browser/ui/certificate_trust_mac.mm",
"shell/browser/ui/certificate_trust_win.cc",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/atom_bundle_mover.h",
"shell/browser/ui/cocoa/atom_bundle_mover.mm",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm",
"shell/browser/ui/cocoa/atom_menu_controller.h",
"shell/browser/ui/cocoa/atom_menu_controller.mm",
"shell/browser/ui/cocoa/atom_native_widget_mac.h",
@@ -309,27 +322,23 @@ filenames = {
"shell/browser/ui/cocoa/atom_touch_bar.mm",
"shell/browser/ui/cocoa/delayed_native_view_host.cc",
"shell/browser/ui/cocoa/delayed_native_view_host.h",
"shell/browser/ui/cocoa/views_delegate_mac.h",
"shell/browser/ui/cocoa/views_delegate_mac.mm",
"shell/browser/ui/cocoa/root_view_mac.mm",
"shell/browser/ui/cocoa/root_view_mac.h",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.mm",
"shell/browser/ui/cocoa/event_dispatching_window.h",
"shell/browser/ui/cocoa/event_dispatching_window.mm",
"shell/browser/ui/cocoa/root_view_mac.h",
"shell/browser/ui/cocoa/root_view_mac.mm",
"shell/browser/ui/cocoa/views_delegate_mac.h",
"shell/browser/ui/cocoa/views_delegate_mac.mm",
"shell/browser/ui/devtools_manager_delegate.cc",
"shell/browser/ui/devtools_manager_delegate.h",
"shell/browser/ui/devtools_ui.cc",
"shell/browser/ui/devtools_ui.h",
"shell/browser/ui/drag_util.h",
"shell/browser/ui/drag_util_mac.mm",
"shell/browser/ui/drag_util_views.cc",
"shell/browser/ui/drag_util.h",
"shell/browser/ui/file_dialog.h",
"shell/browser/ui/file_dialog_gtk.cc",
"shell/browser/ui/file_dialog_mac.mm",
"shell/browser/ui/file_dialog_win.cc",
"shell/browser/ui/util_gtk.cc",
"shell/browser/ui/util_gtk.h",
"shell/browser/ui/inspectable_web_contents.cc",
"shell/browser/ui/inspectable_web_contents.h",
"shell/browser/ui/inspectable_web_contents_delegate.h",
@@ -344,19 +353,16 @@ filenames = {
"shell/browser/ui/message_box_gtk.cc",
"shell/browser/ui/message_box_mac.mm",
"shell/browser/ui/message_box_win.cc",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/tray_icon.cc",
"shell/browser/ui/tray_icon.h",
"shell/browser/ui/tray_icon_gtk.cc",
"shell/browser/ui/tray_icon_gtk.h",
"shell/browser/ui/tray_icon_cocoa.h",
"shell/browser/ui/tray_icon_cocoa.mm",
"shell/browser/ui/tray_icon_gtk.cc",
"shell/browser/ui/tray_icon_gtk.h",
"shell/browser/ui/tray_icon_observer.h",
"shell/browser/ui/tray_icon_win.cc",
"shell/browser/ui/views/atom_views_delegate.cc",
"shell/browser/ui/views/atom_views_delegate_win.cc",
"shell/browser/ui/views/atom_views_delegate.h",
"shell/browser/ui/views/autofill_popup_view.cc",
"shell/browser/ui/views/autofill_popup_view.h",
@@ -386,10 +392,10 @@ filenames = {
"shell/browser/ui/win/atom_desktop_window_tree_host_win.h",
"shell/browser/ui/win/jump_list.cc",
"shell/browser/ui/win/jump_list.h",
"shell/browser/ui/win/notify_icon_host.cc",
"shell/browser/ui/win/notify_icon_host.h",
"shell/browser/ui/win/notify_icon.cc",
"shell/browser/ui/win/notify_icon.h",
"shell/browser/ui/win/notify_icon_host.cc",
"shell/browser/ui/win/notify_icon_host.h",
"shell/browser/ui/win/taskbar_host.cc",
"shell/browser/ui/win/taskbar_host.h",
"shell/browser/ui/x/event_disabler.cc",
@@ -400,8 +406,6 @@ filenames = {
"shell/browser/ui/x/x_window_utils.h",
"shell/browser/unresponsive_suppressor.cc",
"shell/browser/unresponsive_suppressor.h",
"shell/browser/win/scoped_hstring.cc",
"shell/browser/win/scoped_hstring.h",
"shell/browser/web_contents_permission_helper.cc",
"shell/browser/web_contents_permission_helper.h",
"shell/browser/web_contents_preferences.cc",
@@ -414,6 +418,8 @@ filenames = {
"shell/browser/web_view_guest_delegate.h",
"shell/browser/web_view_manager.cc",
"shell/browser/web_view_manager.h",
"shell/browser/win/scoped_hstring.cc",
"shell/browser/win/scoped_hstring.h",
"shell/browser/window_list.cc",
"shell/browser/window_list.h",
"shell/browser/window_list_observer.h",
@@ -431,25 +437,25 @@ filenames = {
"shell/common/api/atom_api_native_image_mac.mm",
"shell/common/api/atom_api_shell.cc",
"shell/common/api/atom_api_v8_util.cc",
"shell/common/api/constructor.h",
"shell/common/api/electron_bindings.cc",
"shell/common/api/electron_bindings.h",
"shell/common/api/constructor.h",
"shell/common/api/event_emitter_caller_deprecated.cc",
"shell/common/api/event_emitter_caller_deprecated.h",
"shell/common/api/features.cc",
"shell/common/api/locker.cc",
"shell/common/api/locker.h",
"shell/common/application_info.cc",
"shell/common/application_info.h",
"shell/common/application_info_linux.cc",
"shell/common/application_info_mac.mm",
"shell/common/application_info_win.cc",
"shell/common/asar/archive.cc",
"shell/common/asar/archive.h",
"shell/common/asar/asar_util.cc",
"shell/common/asar/asar_util.h",
"shell/common/asar/scoped_temporary_file.cc",
"shell/common/asar/scoped_temporary_file.h",
"shell/common/application_info_linux.cc",
"shell/common/application_info_mac.mm",
"shell/common/application_info_win.cc",
"shell/common/application_info.cc",
"shell/common/application_info.h",
"shell/common/atom_command_line.cc",
"shell/common/atom_command_line.h",
"shell/common/atom_constants.cc",
@@ -462,12 +468,15 @@ filenames = {
"shell/common/crash_reporter/crash_reporter_linux.h",
"shell/common/crash_reporter/crash_reporter_mac.h",
"shell/common/crash_reporter/crash_reporter_mac.mm",
"shell/common/crash_reporter/crash_reporter_win.h",
"shell/common/crash_reporter/crash_reporter_win.cc",
"shell/common/crash_reporter/crash_reporter_win.h",
"shell/common/crash_reporter/linux/crash_dump_handler.cc",
"shell/common/crash_reporter/linux/crash_dump_handler.h",
"shell/common/crash_reporter/win/crash_service_main.cc",
"shell/common/crash_reporter/win/crash_service_main.h",
"shell/common/deprecate_util.cc",
"shell/common/deprecate_util.h",
"shell/common/gin_converters/blink_converter_gin_adapter.h",
"shell/common/gin_converters/callback_converter.h",
"shell/common/gin_converters/file_dialog_converter.cc",
"shell/common/gin_converters/file_dialog_converter.h",
@@ -483,7 +492,6 @@ filenames = {
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/blink_converter_gin_adapter.h",
"shell/common/gin_converters/value_converter_gin_adapter.h",
"shell/common/gin_helper/arguments.cc",
"shell/common/gin_helper/arguments.h",
@@ -494,10 +502,10 @@ filenames = {
"shell/common/gin_helper/dictionary.h",
"shell/common/gin_helper/error_thrower.cc",
"shell/common/gin_helper/error_thrower.h",
"shell/common/gin_helper/event_emitter_caller.cc",
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/event_emitter.cc",
"shell/common/gin_helper/event_emitter.h",
"shell/common/gin_helper/event_emitter_caller.cc",
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/function_template.cc",
"shell/common/gin_helper/function_template.h",
"shell/common/gin_helper/object_template_builder.cc",
@@ -507,12 +515,10 @@ filenames = {
"shell/common/key_weak_map.h",
"shell/common/keyboard_util.cc",
"shell/common/keyboard_util.h",
"shell/common/deprecate_util.cc",
"shell/common/deprecate_util.h",
"shell/common/mouse_util.cc",
"shell/common/mouse_util.h",
"shell/common/mac/main_application_bundle.h",
"shell/common/mac/main_application_bundle.mm",
"shell/common/mouse_util.cc",
"shell/common/mouse_util.h",
"shell/common/native_mate_converters/accelerator_converter.cc",
"shell/common/native_mate_converters/accelerator_converter.h",
"shell/common/native_mate_converters/blink_converter.cc",
@@ -545,38 +551,38 @@ filenames = {
"shell/common/node_bindings_win.cc",
"shell/common/node_bindings_win.h",
"shell/common/node_includes.h",
"shell/common/node_util.h",
"shell/common/node_util.cc",
"shell/common/node_util.h",
"shell/common/options_switches.cc",
"shell/common/options_switches.h",
"shell/common/platform_util.h",
"shell/common/platform_util_linux.cc",
"shell/common/platform_util_mac.mm",
"shell/common/platform_util_win.cc",
"shell/common/promise_util.h",
"shell/common/promise_util.cc",
"shell/common/skia_util.h",
"shell/common/promise_util.h",
"shell/common/skia_util.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/common/skia_util.h",
"shell/renderer/api/atom_api_context_bridge.cc",
"shell/renderer/api/atom_api_context_bridge.h",
"shell/renderer/api/atom_api_renderer_ipc.cc",
"shell/renderer/api/atom_api_spell_check_client.cc",
"shell/renderer/api/atom_api_spell_check_client.h",
"shell/renderer/api/atom_api_web_frame.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/renderer/atom_autofill_agent.cc",
"shell/renderer/atom_autofill_agent.h",
"shell/renderer/atom_render_frame_observer.cc",
"shell/renderer/atom_render_frame_observer.h",
"shell/renderer/atom_renderer_client.cc",
"shell/renderer/atom_renderer_client.h",
"shell/renderer/atom_sandboxed_renderer_client.cc",
"shell/renderer/atom_sandboxed_renderer_client.h",
"shell/renderer/content_settings_observer.cc",
"shell/renderer/content_settings_observer.h",
"shell/renderer/electron_api_service_impl.cc",
"shell/renderer/electron_api_service_impl.h",
"shell/renderer/atom_sandboxed_renderer_client.cc",
"shell/renderer/atom_sandboxed_renderer_client.h",
"shell/renderer/guest_view_container.cc",
"shell/renderer/guest_view_container.h",
"shell/renderer/renderer_client_base.cc",
@@ -585,11 +591,6 @@ filenames = {
"shell/renderer/web_worker_observer.h",
"shell/utility/atom_content_utility_client.cc",
"shell/utility/atom_content_utility_client.h",
"chromium_src/chrome/browser/process_singleton_posix.cc",
"chromium_src/chrome/browser/process_singleton_win.cc",
"chromium_src/chrome/browser/process_singleton.h",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc",
"chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h",
]
lib_sources_nss = [

60
filenames.hunspell.gni Normal file
View File

@@ -0,0 +1,60 @@
hunspell_dictionaries = [
"//third_party/hunspell_dictionaries/af-ZA-3-0.bdic",
"//third_party/hunspell_dictionaries/bg-BG-3-0.bdic",
"//third_party/hunspell_dictionaries/ca-ES-3-0.bdic",
"//third_party/hunspell_dictionaries/cs-CZ-3-0.bdic",
"//third_party/hunspell_dictionaries/cy-GB-1-0.bdic",
"//third_party/hunspell_dictionaries/da-DK-3-0.bdic",
"//third_party/hunspell_dictionaries/de-DE-3-0.bdic",
"//third_party/hunspell_dictionaries/el-GR-3-0.bdic",
"//third_party/hunspell_dictionaries/en-AU-8-0.bdic",
"//third_party/hunspell_dictionaries/en-CA-8-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-8-0.bdic",
"//third_party/hunspell_dictionaries/en-US-8-0.bdic",
"//third_party/hunspell_dictionaries/es-ES-3-0.bdic",
"//third_party/hunspell_dictionaries/et-EE-3-0.bdic",
"//third_party/hunspell_dictionaries/fa-IR-8-0.bdic",
"//third_party/hunspell_dictionaries/fo-FO-3-0.bdic",
"//third_party/hunspell_dictionaries/fr-FR-3-0.bdic",
"//third_party/hunspell_dictionaries/he-IL-3-0.bdic",
"//third_party/hunspell_dictionaries/hi-IN-3-0.bdic",
"//third_party/hunspell_dictionaries/hr-HR-3-0.bdic",
"//third_party/hunspell_dictionaries/hu-HU-3-0.bdic",
"//third_party/hunspell_dictionaries/hy-1-0.bdic",
"//third_party/hunspell_dictionaries/id-ID-3-0.bdic",
"//third_party/hunspell_dictionaries/it-IT-3-0.bdic",
"//third_party/hunspell_dictionaries/ko-3-0.bdic",
"//third_party/hunspell_dictionaries/lt-LT-3-0.bdic",
"//third_party/hunspell_dictionaries/lv-LV-3-0.bdic",
"//third_party/hunspell_dictionaries/nb-NO-3-0.bdic",
"//third_party/hunspell_dictionaries/nl-NL-3-0.bdic",
"//third_party/hunspell_dictionaries/pl-PL-3-0.bdic",
"//third_party/hunspell_dictionaries/pt-BR-3-0.bdic",
"//third_party/hunspell_dictionaries/pt-PT-3-0.bdic",
"//third_party/hunspell_dictionaries/ro-RO-3-0.bdic",
"//third_party/hunspell_dictionaries/ru-RU-3-0.bdic",
"//third_party/hunspell_dictionaries/sh-3-0.bdic",
"//third_party/hunspell_dictionaries/sh-4-0.bdic",
"//third_party/hunspell_dictionaries/sk-SK-3-0.bdic",
"//third_party/hunspell_dictionaries/sl-SI-3-0.bdic",
"//third_party/hunspell_dictionaries/sq-3-0.bdic",
"//third_party/hunspell_dictionaries/sr-3-0.bdic",
"//third_party/hunspell_dictionaries/sr-4-0.bdic",
"//third_party/hunspell_dictionaries/sv-SE-3-0.bdic",
"//third_party/hunspell_dictionaries/ta-IN-3-0.bdic",
"//third_party/hunspell_dictionaries/tg-TG-5-0.bdic",
"//third_party/hunspell_dictionaries/tr-TR-4-0.bdic",
"//third_party/hunspell_dictionaries/uk-UA-3-0.bdic",
"//third_party/hunspell_dictionaries/vi-VN-3-0.bdic",
"//third_party/hunspell_dictionaries/xx-XX-3-0.bdic",
]
hunspell_licenses = [
"//third_party/hunspell_dictionaries/COPYING",
"//third_party/hunspell_dictionaries/COPYING.Apache",
"//third_party/hunspell_dictionaries/COPYING.LESSER",
"//third_party/hunspell_dictionaries/COPYING.LGPL",
"//third_party/hunspell_dictionaries/COPYING.MIT",
"//third_party/hunspell_dictionaries/COPYING.MPL",
"//third_party/hunspell_dictionaries/LICENSE",
]

View File

@@ -105,9 +105,9 @@ if (process.platform === 'linux') {
}
// Routes the events to webContents.
const events = ['login', 'certificate-error', 'select-client-certificate']
const events = ['certificate-error', 'select-client-certificate']
for (const name of events) {
app.on(name as 'login', (event, webContents, ...args: any[]) => {
app.on(name as 'certificate-error', (event, webContents, ...args: any[]) => {
webContents.emit(name, event, ...args)
})
}

View File

@@ -33,7 +33,7 @@ BrowserWindow.prototype._init = function () {
// Hide the auto-hide menu when webContents is focused.
this.webContents.on('activate', () => {
if (process.platform !== 'darwin' && this.isMenuBarAutoHide() && this.isMenuBarVisible()) {
if (process.platform !== 'darwin' && this.autoHideMenuBar && this.isMenuBarVisible()) {
this.setMenuBarVisibility(false)
}
})

View File

@@ -2,5 +2,7 @@ import { defineProperties } from '@electron/internal/common/define-properties'
import { commonModuleList } from '@electron/internal/common/api/module-list'
import { browserModuleList } from '@electron/internal/browser/api/module-list'
defineProperties(exports, commonModuleList)
defineProperties(exports, browserModuleList)
module.exports = {}
defineProperties(module.exports, commonModuleList)
defineProperties(module.exports, browserModuleList)

View File

@@ -21,6 +21,7 @@ module.exports = [
{ name: 'inAppPurchase' },
{ name: 'Menu' },
{ name: 'MenuItem' },
{ name: 'nativeTheme' },
{ name: 'net' },
{ name: 'netLog' },
{ name: 'Notification' },

View File

@@ -71,7 +71,6 @@ const defaultPrintingSetting = {
headerFooterEnabled: false,
marginsType: 0,
isFirstRequest: false,
requestID: getNextId(),
previewUIID: 0,
previewModifiable: true,
printToPDF: true,
@@ -204,7 +203,10 @@ WebContents.prototype.executeJavaScript = function (code, hasUserGesture) {
// Translate the options of printToPDF.
WebContents.prototype.printToPDF = function (options) {
const printingSetting = Object.assign({}, defaultPrintingSetting)
const printingSetting = {
...defaultPrintingSetting,
requestID: getNextId()
}
if (options.landscape) {
printingSetting.landscape = options.landscape
}
@@ -249,6 +251,8 @@ WebContents.prototype.printToPDF = function (options) {
// Chromium expects this in a 0-100 range number, not as float
printingSetting.scaleFactor = Math.ceil(printingSetting.scaleFactor) % 100
// PrinterType enum from //printing/print_job_constants.h
printingSetting.printerType = 2
if (features.isPrintingEnabled()) {
return this._printToPDF(printingSetting)
} else {
@@ -419,6 +423,10 @@ WebContents.prototype._init = function () {
})
}
this.on('login', (event, ...args) => {
app.emit('login', event, this, ...args)
})
const event = process.electronBinding('event').createEmpty()
app.emit('web-contents-created', event, this)
}

View File

@@ -5,6 +5,7 @@ const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-interna
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 { serialize } = require('@electron/internal/common/type-utils')
// Doesn't exist in early initialization.
let webViewManager = null
@@ -200,7 +201,7 @@ const attachGuest = function (event, embedderFrameId, elementInstanceId, guestIn
nodeIntegrationInSubFrames: params.nodeintegrationinsubframes != null ? params.nodeintegrationinsubframes : false,
enableRemoteModule: params.enableremotemodule,
plugins: params.plugins,
zoomFactor: embedder.getZoomFactor(),
zoomFactor: embedder.zoomFactor,
disablePopups: !params.allowpopups,
webSecurity: !params.disablewebsecurity,
enableBlinkFeatures: params.blinkfeatures,
@@ -387,6 +388,12 @@ handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_CALL', function (event, guestInst
return guest[method](...args)
})
handleMessage('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', async function (event, guestInstanceId, args) {
const guest = getGuestForWebContents(guestInstanceId, event.sender)
return serialize(await guest.capturePage(...args))
})
// Returns WebContents from its guest id hosted in given webContents.
const getGuestForWebContents = function (guestInstanceId, contents) {
const guest = getGuest(guestInstanceId)

View File

@@ -5,7 +5,7 @@ import { EventEmitter } from 'events'
import objectsRegistry from './objects-registry'
import { ipcMainInternal } from '../ipc-main-internal'
import * as guestViewManager from '@electron/internal/browser/guest-view-manager'
import { isPromise, isSerializableObject } from '@electron/internal/common/remote/type-utils'
import { isPromise, isSerializableObject } from '@electron/internal/common/type-utils'
const v8Util = process.electronBinding('v8_util')
const eventBinding = process.electronBinding('event')
@@ -309,7 +309,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
v8Util.setHiddenValue(callIntoRenderer, 'location', meta.location)
Object.defineProperty(callIntoRenderer, 'length', { value: meta.length })
v8Util.setRemoteCallbackFreer(callIntoRenderer, contextId, meta.id, sender)
v8Util.setRemoteCallbackFreer(callIntoRenderer, frameId, contextId, meta.id, sender)
rendererFunctions.set(objectId, callIntoRenderer)
return callIntoRenderer
}

View File

@@ -11,7 +11,7 @@ const { crashReporterInit } = require('@electron/internal/browser/crash-reporter
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
const guestViewManager = require('@electron/internal/browser/guest-view-manager')
const clipboardUtils = require('@electron/internal/common/clipboard-utils')
const typeUtils = require('@electron/internal/common/type-utils')
const emitCustomEvent = function (contents, eventName, ...args) {
const event = eventBinding.createWithSender(contents)
@@ -62,7 +62,7 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_CLIPBOARD', function (event, method, .
throw new Error(`Invalid method: ${method}`)
}
return clipboardUtils.serialize(electron.clipboard[method](...clipboardUtils.deserialize(args)))
return typeUtils.serialize(electron.clipboard[method](...typeUtils.deserialize(args)))
})
if (features.isDesktopCapturerEnabled()) {

View File

@@ -4,13 +4,13 @@ const clipboard = process.electronBinding('clipboard')
if (process.type === 'renderer') {
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
const clipboardUtils = require('@electron/internal/common/clipboard-utils')
const typeUtils = require('@electron/internal/common/type-utils')
const makeRemoteMethod = function (method) {
return (...args) => {
args = clipboardUtils.serialize(args)
args = typeUtils.serialize(args)
const result = ipcRendererUtils.invokeSync('ELECTRON_BROWSER_CLIPBOARD', method, ...args)
return clipboardUtils.deserialize(result)
return typeUtils.deserialize(result)
}
}

View File

@@ -8,6 +8,8 @@
const path = require('path')
const util = require('util')
const Promise = global.Promise
const envNoAsar = process.env.ELECTRON_NO_ASAR &&
process.type !== 'browser' &&
process.type !== 'renderer'

View File

@@ -1,25 +0,0 @@
export function isPromise (val: any) {
return (
val &&
val.then &&
val.then instanceof Function &&
val.constructor &&
val.constructor.reject &&
val.constructor.reject instanceof Function &&
val.constructor.resolve &&
val.constructor.resolve instanceof Function
)
}
const serializableTypes = [
Boolean,
Number,
String,
Date,
RegExp,
ArrayBuffer
]
export function isSerializableObject (value: any) {
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type)
}

View File

@@ -1,5 +1,32 @@
const { nativeImage, NativeImage } = process.electronBinding('native_image')
export function isPromise (val: any) {
return (
val &&
val.then &&
val.then instanceof Function &&
val.constructor &&
val.constructor.reject &&
val.constructor.reject instanceof Function &&
val.constructor.resolve &&
val.constructor.resolve instanceof Function
)
}
const serializableTypes = [
Boolean,
Number,
String,
Date,
Error,
RegExp,
ArrayBuffer
]
export function isSerializableObject (value: any) {
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type)
}
const objectMap = function (source: Object, mapper: (value: any) => any) {
const sourceEntries = Object.entries(source)
const targetEntries = sourceEntries.map(([key, val]) => [key, mapper(val)])
@@ -15,7 +42,7 @@ export function serialize (value: any): any {
}
} else if (Array.isArray(value)) {
return value.map(serialize)
} else if (value instanceof Buffer) {
} else if (isSerializableObject(value)) {
return value
} else if (value instanceof Object) {
return objectMap(value, serialize)
@@ -29,7 +56,7 @@ export function deserialize (value: any): any {
return nativeImage.createFromBitmap(value.buffer, value.size)
} else if (Array.isArray(value)) {
return value.map(deserialize)
} else if (value instanceof Buffer) {
} else if (isSerializableObject(value)) {
return value
} else if (value instanceof Object) {
return objectMap(value, deserialize)

View File

@@ -52,7 +52,6 @@ export const syncMethods = new Set([
export const asyncMethods = new Set([
'loadURL',
'capturePage',
'executeJavaScript',
'insertCSS',
'insertText',

View File

@@ -0,0 +1,8 @@
// Captures original globals into a scope to ensure that userland modifications do
// not impact Electron. Note that users doing:
//
// global.Promise.resolve = myFn
//
// Will mutate this captured one as well and that is OK.
export const Promise = global.Promise

View File

@@ -2,5 +2,7 @@ import { defineProperties } from '@electron/internal/common/define-properties'
import { commonModuleList } from '@electron/internal/common/api/module-list'
import { rendererModuleList } from '@electron/internal/renderer/api/module-list'
defineProperties(exports, commonModuleList)
defineProperties(exports, rendererModuleList)
module.exports = {}
defineProperties(module.exports, commonModuleList)
defineProperties(module.exports, rendererModuleList)

View File

@@ -4,7 +4,7 @@ const v8Util = process.electronBinding('v8_util')
const { hasSwitch } = process.electronBinding('command_line')
const { CallbacksRegistry } = require('@electron/internal/renderer/remote/callbacks-registry')
const { isPromise, isSerializableObject } = require('@electron/internal/common/remote/type-utils')
const { isPromise, isSerializableObject } = require('@electron/internal/common/type-utils')
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal')
const callbacksRegistry = new CallbacksRegistry()
@@ -64,11 +64,6 @@ function wrapArgs (args, visited = new Set()) {
type: 'remote-object',
id: v8Util.getHiddenValue(value, 'atomId')
}
} else if (value instanceof Error) {
return {
type: 'value',
value
}
}
const meta = {

View File

@@ -120,7 +120,11 @@ export function injectTo (extensionId: string, context: any) {
let targetExtensionId = extensionId
let connectInfo = { name: '' }
if (args.length === 1) {
targetExtensionId = args[0]
if (typeof args[0] === 'string') {
targetExtensionId = args[0]
} else {
connectInfo = args[0]
}
} else if (args.length === 2) {
[targetExtensionId, connectInfo] = args
}

View File

@@ -5,6 +5,7 @@ import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-inte
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 { deserialize } from '@electron/internal/common/type-utils'
const { webFrame } = electron
const v8Util = process.electronBinding('v8_util')
@@ -238,6 +239,12 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
return remote.getGuestWebContents(internal.guestInstanceId!)
}
WebViewElement.prototype.getWebContents = electron.deprecate.moveAPI(
WebViewElement.prototype.getWebContents,
'webview.getWebContents()',
'remote.webContents.fromId(webview.getWebContentsId())'
) as any
// Focusing the webview should move page focus to the underlying iframe.
WebViewElement.prototype.focus = function () {
this.contentWindow.focus()
@@ -263,6 +270,10 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
for (const method of asyncMethods) {
(WebViewElement.prototype as Record<string, any>)[method] = createNonBlockHandler(method)
}
WebViewElement.prototype.capturePage = async function (...args) {
return deserialize(await ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', this.getWebContentsId(), args))
}
}
export const webViewImplModule = {

View File

@@ -1,4 +1,6 @@
import { defineProperties } from '@electron/internal/common/define-properties'
import { moduleList } from '@electron/internal/sandboxed_renderer/api/module-list'
defineProperties(exports, moduleList)
module.exports = {}
defineProperties(module.exports, moduleList)

View File

@@ -94,6 +94,8 @@ Object.defineProperty(preloadProcess, 'noDeprecation', {
process.on('loaded', () => preloadProcess.emit('loaded'))
process.on('exit', () => preloadProcess.emit('exit'))
process.on('document-start', () => preloadProcess.emit('document-start'))
process.on('document-end', () => preloadProcess.emit('document-end'))
// This is the `require` function that will be visible to the preload script
function preloadRequire (module) {

View File

@@ -5,6 +5,8 @@
#ifndef NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
#define NATIVE_MATE_NATIVE_MATE_FUNCTION_TEMPLATE_H_
#include <utility>
#include "base/callback.h"
#include "native_mate/arguments.h"
#include "native_mate/wrappable_base.h"
@@ -194,7 +196,8 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
void DispatchToCallback(base::Callback<ReturnType(ArgTypes...)> callback) {
v8::MicrotasksScope script_scope(args_->isolate(),
v8::MicrotasksScope::kRunMicrotasks);
args_->Return(callback.Run(ArgumentHolder<indices, ArgTypes>::value...));
args_->Return(
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...));
}
// In C++, you can declare the function foo(void), but you can't pass a void
@@ -203,7 +206,7 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
void DispatchToCallback(base::Callback<void(ArgTypes...)> callback) {
v8::MicrotasksScope script_scope(args_->isolate(),
v8::MicrotasksScope::kRunMicrotasks);
callback.Run(ArgumentHolder<indices, ArgTypes>::value...);
callback.Run(std::move(ArgumentHolder<indices, ArgTypes>::value)...);
}
private:

View File

@@ -1,11 +1,11 @@
{
"name": "electron",
"version": "8.0.0-nightly.20191023",
"version": "8.0.0-beta.3",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@electron/docs-parser": "^0.4.2",
"@electron/typescript-definitions": "^8.6.1",
"@electron/typescript-definitions": "^8.6.4",
"@octokit/rest": "^16.3.2",
"@primer/octicons": "^9.1.1",
"@types/basic-auth": "^1.1.2",
@@ -129,6 +129,9 @@
"node script/gen-filenames.js",
"python script/check-trailing-whitespace.py --fix",
"git add filenames.auto.gni"
],
"DEPS": [
"node script/gen-hunspell-filenames.js"
]
},
"dependencies": {

View File

@@ -80,7 +80,7 @@ index d540144b293297791c087e0b968a47d368a73695..53cb9d2dc8f1962a70dc12b648d27c32
+ callback(EVP_ripemd160(), "ripemd160", NULL, arg);
}
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
index c7c679760a30329311b4a6c0db475b2375537028..991fa00b8330a663625719436075bcc8ae32e17a 100644
index c3ceb7f22a123353f23cb33de9cc2931fb5e1c11..704d43a326e7cced925c9db1c2a6094a16f9abe9 100644
--- a/include/openssl/digest.h
+++ b/include/openssl/digest.h
@@ -88,6 +88,9 @@ OPENSSL_EXPORT const EVP_MD *EVP_sha512(void);

View File

@@ -0,0 +1 @@
chore_fix_ftbfs_from_stl_features_used_but_not_included.patch

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <ckerr@github.com>
Date: Fri, 15 Nov 2019 17:14:54 -0600
Subject: chore: fix FTBFS from stl features used but not included
diff --git a/src/common/windows/pe_util.cc b/src/common/windows/pe_util.cc
index 6fa63fa3b5699b79d3479c6d4a37a1c68553223f..59c1c1d74f70dca8f871fdddd8e27da102ec9148 100644
--- a/src/common/windows/pe_util.cc
+++ b/src/common/windows/pe_util.cc
@@ -119,7 +119,6 @@ private:
namespace google_breakpad {
-using std::unique_ptr;
using google_breakpad::GUIDString;
bool ReadModuleInfo(const wstring & pe_file, PDBModuleInfo * info) {
diff --git a/src/tools/windows/dump_syms/dump_syms.cc b/src/tools/windows/dump_syms/dump_syms.cc
index 5b7d1777538cd3cfefd0bef45558f900798d6c51..2b2fdaf3f908db1d6f3f96a6bc23f0698cf879dc 100644
--- a/src/tools/windows/dump_syms/dump_syms.cc
+++ b/src/tools/windows/dump_syms/dump_syms.cc
@@ -41,7 +41,6 @@
using std::wstring;
using google_breakpad::PDBSourceLineWriter;
using google_breakpad::PESourceLineWriter;
-using std::unique_ptr;
int wmain(int argc, wchar_t **argv) {
bool success;

View File

@@ -34,8 +34,6 @@ scroll_bounce_flag.patch
mas-cfisobjc.patch
mas-cgdisplayusesforcetogray.patch
mas-audiodeviceduck.patch
mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
ignore_rc_check.patch
chrome_key_systems.patch
allow_nested_error_trackers.patch
blink_initialization_order.patch
@@ -68,7 +66,6 @@ crashpad_pid_check.patch
preconnect_feature.patch
network_service_allow_remote_certificate_verification_logic.patch
put_back_deleted_colors_for_autofill.patch
build_win_disable_zc_twophase.patch
disable_color_correct_rendering.patch
add_contentgpuclient_precreatemessageloop_callback.patch
picture-in-picture.patch
@@ -77,7 +74,14 @@ allow_new_privileges_in_unsandboxed_child_processes.patch
expose_setuseragent_on_networkcontext.patch
feat_add_set_theme_source_to_allow_apps_to.patch
revert_cleanup_remove_menu_subtitles_sublabels.patch
ui_views_fix_jumbo_build.patch
export_fetchapi_mojo_traits_to_fix_component_build.patch
build_fix_when_building_with_enable_plugins_false.patch
add_zoom_limit_setters_to_webcontents.patch
revert_remove_contentrendererclient_shouldfork.patch
build_win_disable_zc_twophase.patch
ignore_rc_check.patch
fix_ambiguous_reference_to_data.patch
backport_fix_msstl_compat_in_ui_events.patch
build_win_fix_msstl_compatibility_for_pdf.patch
remove_usage_of_incognito_apis_in_the_spellchecker.patch
chore_use_electron_resources_not_chrome_for_spellchecker.patch
fix_add_missing_include_algorithm_as_needed.patch

View File

@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
3. Ctrl-Shift-= should show as Ctrl-+
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index 841a8ccd1f0ca5073cf0f0621f81561ed6425e0d..ac4c04b74b0a3b8e6d6c375fef021abbd8789a14 100644
index a3e869a74c33b161215ab4eb6f6adc6a71c9fff5..83315ce63e7d39d3e47a8bb61ade728e20ac11c8 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -11,6 +11,7 @@

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936d48ad4ff 100644
index 0de66bc85b1d392fba44858e3a478d918e538393..a21e318b2108223bb4ca6a74d3c654c3ad7ba77a 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -228,6 +228,10 @@ int GpuMain(const MainFunctionParams& parameters) {
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
@@ -24,7 +24,7 @@ index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -349,7 +353,6 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -336,7 +340,6 @@ int GpuMain(const MainFunctionParams& parameters) {
GpuProcess gpu_process(io_thread_priority);
#endif
@@ -33,7 +33,7 @@ index 4373f508964cb1e9fd51c952122ac2f41fb35ae9..065a7a57b77f1e3bf5e03fac900f1936
client->PostIOThreadCreated(gpu_process.io_task_runner());
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index 830d5e89af7bd3ddb409ac7bf9d8eb3109830d41..7d544536ec846c294deb6626f51d5de7846fc5c2 100644
index 3331f7152da864712e1878b4d2a2f5e2fa34b4ed..38b14405b42813d51406671ce0c4655a85bd88d0 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -39,6 +39,10 @@ class CONTENT_EXPORT ContentGpuClient {

View File

@@ -39,45 +39,45 @@ 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 3b1ced15de47f6b88716db2b79306bb7d98cfdf4..0ed89b4147d98f2239a3504c898666a758cee618 100644
index 2d9f4e7f5690187e4b742e5c9d5ccc93fdb79872..9793f38d31103340ff34fa74a2749c059554ce5f 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -645,6 +645,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, WTF::ArrayBufferContents::kDontInitialize);
@@ -594,6 +594,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, ArrayBufferContents::kDontInitialize);
}
+ void* Realloc(void* data, size_t size) override {
+ return WTF::ArrayBufferContents::Realloc(data, size);
+ return ArrayBufferContents::Realloc(data, size);
+ }
+
void Free(void* data, size_t size) override {
WTF::ArrayBufferContents::FreeMemory(data);
ArrayBufferContents::FreeMemory(data);
}
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
index ac76d127b96b80c8260a7e2cda0b669cd98787ad..dcab64586700a8740262aede8dba2755f652d8e8 100644
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
@@ -130,6 +130,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
diff --git a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc
index ac525b62a1282839bc906b1ee59837211a83476c..5e6c54b87e88ea2741bc7986bf76ddaa48723e56 100644
--- a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc
+++ b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.cc
@@ -126,6 +126,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
return AllocateMemoryWithFlags(size, policy, base::PartitionAllocReturnNull);
}
+void* ArrayBufferContents::Realloc(void* data, size_t size) {
+ return Partitions::ArrayBufferPartition()->Realloc(data, size,
+ return WTF::Partitions::ArrayBufferPartition()->Realloc(data, size,
+ WTF_HEAP_PROFILER_TYPE_NAME(ArrayBufferContents));
+}
+
void ArrayBufferContents::FreeMemory(void* data) {
Partitions::ArrayBufferPartition()->Free(data);
WTF::Partitions::ArrayBufferPartition()->Free(data);
}
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
index ee7c89a4950d6b3c97a810c41a62fee7e372018d..c2b60f20a72cca46d05af369f33d9c19395b34ef 100644
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
@@ -140,6 +140,7 @@ class WTF_EXPORT ArrayBufferContents {
diff --git a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h
index 1adf4924657624059dcbe4e88cef684478787752..3b14d852b0654309cb53f933e396dc1e7b479790 100644
--- a/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h
+++ b/third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h
@@ -149,6 +149,7 @@ class CORE_EXPORT ArrayBufferContents {
void CopyTo(ArrayBufferContents& other);
static void* AllocateMemoryOrNull(size_t, InitializationPolicy);
+ static void* Realloc(void* data, size_t);
static void FreeMemory(void*);
static DataHandle CreateDataHandle(size_t, InitializationPolicy);
static void Initialize(

View File

@@ -8,10 +8,10 @@ This is needed by Electron to allow apps to limit how much an app can zoom in
or out.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8586f71224f1cae6a5e9b4005a6acfef9ff64d4d..4d4dce8124312d46f90db8d2fc59bd0b7acd498d 100644
index c13511e26189e68376e29f38c4ae2e1cc8fd3c57..a5c4162b3c69b534f843e1b6737392c867fc88ea 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4142,10 +4142,18 @@ bool WebContentsImpl::GetClosedByUserGesture() {
@@ -4124,10 +4124,18 @@ bool WebContentsImpl::GetClosedByUserGesture() {
return closed_by_user_gesture_;
}
@@ -31,10 +31,10 @@ index 8586f71224f1cae6a5e9b4005a6acfef9ff64d4d..4d4dce8124312d46f90db8d2fc59bd0b
return maximum_zoom_percent_;
}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 72f7570ed92886e97629116fec98c1c4dcf95f52..e876929be3df7ba7251886a56acf9b84bbe62e32 100644
index ea1b3581ead984ac084fc9a2b9daf85f6756ea5c..b967e02b4052426855a2af88abbced2076b3e04a 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -450,7 +450,9 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
@@ -447,7 +447,9 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void SystemDragEnded(RenderWidgetHost* source_rwh) override;
void SetClosedByUserGesture(bool value) override;
bool GetClosedByUserGesture() override;
@@ -44,7 +44,7 @@ index 72f7570ed92886e97629116fec98c1c4dcf95f52..e876929be3df7ba7251886a56acf9b84
int GetMaximumZoomPercent() override;
void SetPageScale(float page_scale_factor) override;
gfx::Size GetPreferredSize() override;
@@ -1714,8 +1716,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
@@ -1690,8 +1692,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
bool closed_by_user_gesture_;
// Minimum/maximum zoom percent.
@@ -56,10 +56,10 @@ index 72f7570ed92886e97629116fec98c1c4dcf95f52..e876929be3df7ba7251886a56acf9b84
// Used to correctly handle integer zooming through a smooth scroll device.
float zoom_scroll_remainder_;
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 94a5b87ca72998729f1fca14f247914bb81d60d1..3af575d51d0a36f9586a3cfc00575e83e70a46b9 100644
index 750de66b8002ba66d0f2247d0075da1e51ac764c..1a57feeb1dfe08f8ce1113cb5d8c8ab57d761094 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -808,8 +808,10 @@ class WebContents : public PageNavigator,
@@ -812,8 +812,10 @@ class WebContents : public PageNavigator,
virtual void SetClosedByUserGesture(bool value) = 0;
virtual bool GetClosedByUserGesture() = 0;

View File

@@ -0,0 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Thu, 31 Oct 2019 14:22:50 -0700
Subject: backport: fix MSSTL compat in ui/events
Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/1893754
diff --git a/ui/events/blink/prediction/least_squares_predictor.cc b/ui/events/blink/prediction/least_squares_predictor.cc
index b43fe1893134992937fc7d97ce335344683bfa6b..8a95e17d0835afebd7594c206438cb54022853c9 100644
--- a/ui/events/blink/prediction/least_squares_predictor.cc
+++ b/ui/events/blink/prediction/least_squares_predictor.cc
@@ -5,6 +5,8 @@
#include "ui/events/blink/prediction/least_squares_predictor.h"
#include "ui/events/blink/prediction/predictor_factory.h"
+#include <algorithm>
+
namespace ui {
namespace {
diff --git a/ui/events/blink/prediction/linear_predictor.cc b/ui/events/blink/prediction/linear_predictor.cc
index e97f579d80573a1f801986c724bb33cd8bc52e8a..190fa1b3894ef5f7828e2f265566e16ce10e84c5 100644
--- a/ui/events/blink/prediction/linear_predictor.cc
+++ b/ui/events/blink/prediction/linear_predictor.cc
@@ -5,6 +5,8 @@
#include "ui/events/blink/prediction/linear_predictor.h"
#include "ui/events/blink/prediction/predictor_factory.h"
+#include <algorithm>
+
namespace ui {
LinearPredictor::LinearPredictor(EquationOrder order) {
diff --git a/ui/events/blink/prediction/linear_resampling.cc b/ui/events/blink/prediction/linear_resampling.cc
index e2a8757b779ba270cd3ae8f1735543be3cc324e0..2b2efe7f132055dfc1f650707a9cbb7a5842ca1a 100644
--- a/ui/events/blink/prediction/linear_resampling.cc
+++ b/ui/events/blink/prediction/linear_resampling.cc
@@ -4,6 +4,8 @@
#include "ui/events/blink/prediction/linear_resampling.h"
+#include <algorithm>
+
#include "ui/events/blink/prediction/predictor_factory.h"
namespace ui {

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 0c69b3af9d2144b5d4d61e2d4add7edec839d0b5..acfba2544f6329348f60dd92ca5d9865960db371 100644
index fa4e26718e2d663305a2be664d8ffbf1a64b3c34..7ba237076e14f0806b94a2fcae3894fec31d0e71 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -325,10 +325,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -333,10 +333,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
}
CHECK(!view_ || !view_->IsAttached());
@@ -28,7 +28,7 @@ index 0c69b3af9d2144b5d4d61e2d4add7edec839d0b5..acfba2544f6329348f60dd92ca5d9865
if (!Client())
return;
@@ -346,6 +342,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -354,6 +350,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

@@ -5,10 +5,10 @@ Subject: blink_world_context.patch
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index 900c1e97bd5b8ad113def9001be495cae94bbcdf..6cec8d0bdfce94fd3980eb7509dfced79903f0d6 100644
index 0594883bc21d66704ef2f830863389d412179a29..b788ae92cacf588ad535887bb34ae3d3854bdb92 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -356,6 +356,9 @@ class WebLocalFrame : public WebFrame {
@@ -343,6 +343,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
@@ -19,10 +19,10 @@ index 900c1e97bd5b8ad113def9001be495cae94bbcdf..6cec8d0bdfce94fd3980eb7509dfced7
// 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 bb640f13de34de5d966d97cf617faa3cb3fd54c2..686cddd0755ee219eaf367b3ce84320aeeb5053d 100644
index e7e07ba6a6d22078d1a6e3eb33746d5fca64b3c0..50a154939a5e52e71b728e21939c75783a28a4f7 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
@@ -879,6 +879,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
@@ -880,6 +880,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
@@ -37,15 +37,15 @@ index bb640f13de34de5d966d97cf617faa3cb3fd54c2..686cddd0755ee219eaf367b3ce84320a
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 ab52cef219785766b1315ec7e17d15c2ba2d6138..cf12b32172a0dc814a1478c275d1b5c067d5eaeb 100644
index 6954e9726b5c5c48e377961224069a517e540753..42fdc1321efadccca38bf1bc1bbfa0f86c33f95a 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
@@ -150,6 +150,8 @@ class CORE_EXPORT WebLocalFrameImpl final
@@ -170,6 +170,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;
+ v8::Local<v8::Context> WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const override;
v8::Local<v8::Object> GlobalProxy() const override;
void StartReload(WebFrameLoadType) override;
void ReloadImage(const WebNode&) override;
void RequestExecuteScriptAndReturnValue(const WebScriptSource&,
bool user_gesture,
WebScriptExecutionCallback*) override;

View File

@@ -8,10 +8,10 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index dcb32a5eadb7fc3c431099107bdfdfba8764a187..e1a343fdbdc6098189bce9fc1d81e6df5555e7ab 100644
index 14fd70d103a707a4aa217f662037908178daf9cf..30011a1bda4ba3c11aa1811649730e781ccb5cbf 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -63,6 +63,7 @@
@@ -66,6 +66,7 @@
X("dwrite") \
X("DXVA Decoding") \
X("EarlyJava") \

View File

@@ -1,74 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Tue, 8 Oct 2019 15:40:50 +0000
Subject: build: fix when building with enable_plugins=false
Bug: none
Change-Id: If878b3a7f5bb051c6e99c617418475c12754ae90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845624
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703739}
diff --git a/AUTHORS b/AUTHORS
index 6714e69599bc87c47663bec740b91e352ef92780..41aa5584412e4a325d2360691b00c43d7b08f1bb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -223,6 +223,7 @@ Debashish Samantaray <d.samantaray@samsung.com>
Debug Wang <debugwang@tencent.com>
Deepak Dilip Borade <deepak.db@samsung.com>
Deepak Mittal <deepak.m1@samsung.com>
+Deepak Mohan <hop2deep@gmail.com>
Deepak Sharma <deepak.sharma@amd.com>
Deepak Singla <deepak.s@samsung.com>
Deokjin Kim <deokjin81.kim@samsung.com>
diff --git a/content/browser/sandbox_parameters_mac.mm b/content/browser/sandbox_parameters_mac.mm
index 5eead918eb9d9df03c86b5201b3f924643707f4b..a12cc8734c45a4ebb29672306da3a695a883eb9b 100644
--- a/content/browser/sandbox_parameters_mac.mm
+++ b/content/browser/sandbox_parameters_mac.mm
@@ -25,12 +25,16 @@
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/pepper_plugin_info.h"
+#include "ppapi/buildflags/buildflags.h"
#include "sandbox/mac/seatbelt_exec.h"
#include "services/service_manager/sandbox/mac/sandbox_mac.h"
#include "services/service_manager/sandbox/sandbox_type.h"
#include "services/service_manager/sandbox/switches.h"
+#if BUILDFLAG(ENABLE_PLUGINS)
+#include "content/public/common/pepper_plugin_info.h"
+#endif
+
namespace content {
namespace {
@@ -148,6 +152,7 @@ void SetupNetworkSandboxParameters(sandbox::SeatbeltExecClient* client) {
}
}
+#if BUILDFLAG(ENABLE_PLUGINS)
void SetupPPAPISandboxParameters(sandbox::SeatbeltExecClient* client) {
SetupCommonSandboxParameters(client);
@@ -172,6 +177,7 @@ void SetupPPAPISandboxParameters(sandbox::SeatbeltExecClient* client) {
// to n+1 more than the plugins added.
CHECK(index <= 5);
}
+#endif
void SetupCDMSandboxParameters(sandbox::SeatbeltExecClient* client) {
SetupCommonSandboxParameters(client);
@@ -212,9 +218,11 @@ void SetupSandboxParameters(service_manager::SandboxType sandbox_type,
case service_manager::SANDBOX_TYPE_NETWORK:
SetupNetworkSandboxParameters(client);
break;
+#if BUILDFLAG(ENABLE_PLUGINS)
case service_manager::SANDBOX_TYPE_PPAPI:
SetupPPAPISandboxParameters(client);
break;
+#endif
case service_manager::SANDBOX_TYPE_PROFILING:
case service_manager::SANDBOX_TYPE_UTILITY:
SetupUtilitySandboxParameters(client, command_line);

View File

@@ -8,7 +8,7 @@ Windows. This is to workaround the bug in crbug.com/969698#c10
until fixes have landed in upstream.
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index a3a164b41b45381061c7fceb7d7ec1fdb4907792..8de0cb6a8d1987f84aaca5c3bb30ead0a2019bef 100644
index 95e32520781fc225be1c2bf7d8bfe43925d16d45..8de0cb6a8d1987f84aaca5c3bb30ead0a2019bef 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -2,6 +2,7 @@
@@ -19,18 +19,13 @@ index a3a164b41b45381061c7fceb7d7ec1fdb4907792..8de0cb6a8d1987f84aaca5c3bb30ead0
import("//build/config/chrome_build.gni")
import("//build/config/clang/clang.gni")
import("//build/config/compiler/compiler.gni")
@@ -61,9 +62,13 @@ config("compiler") {
"/FS", # Preserve previous PDB behavior.
"/bigobj", # Some of our files are bigger than the regular limits.
@@ -63,7 +64,8 @@ config("compiler") {
"/utf-8", # Assume UTF-8 by default to avoid code page dependencies.
- "/Zc:twoPhase",
]
- if (is_clang) {
+ if (use_custom_libcxx) {
+ # Work around crbug.com/969698#c6, bug in MSSTL <xxatomic>.
+ cflags += [ "/Zc:twoPhase" ]
+ }
+
# Force C/C++ mode for the given GN detected file type. This is necessary
# for precompiled headers where the same source file is compiled in both
# modes.
cflags += [ "/Zc:twoPhase" ]
}

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Fri, 1 Nov 2019 15:13:55 -0700
Subject: build,[win]: fix msstl compatibility for //pdf
diff --git a/pdf/document_layout.cc b/pdf/document_layout.cc
index 51064a3496f8d9354d00db6085cc9c5d23f7ec0c..b53da54e153b2078a2e18c9af38cfbbbae8da5b8 100644
--- a/pdf/document_layout.cc
+++ b/pdf/document_layout.cc
@@ -4,6 +4,8 @@
#include "pdf/document_layout.h"
+#include <algorithm>
+
#include "base/logging.h"
#include "ppapi/cpp/rect.h"
#include "ppapi/cpp/size.h"
diff --git a/pdf/draw_utils/coordinates.cc b/pdf/draw_utils/coordinates.cc
index 49c272f269ce312a72921506bd0abeeea283050f..11b7cca86116940810da374dd64ec437986ccccc 100644
--- a/pdf/draw_utils/coordinates.cc
+++ b/pdf/draw_utils/coordinates.cc
@@ -4,6 +4,7 @@
#include "pdf/draw_utils/coordinates.h"
+#include <algorithm>
#include <math.h>
#include "base/logging.h"

View File

@@ -5,10 +5,10 @@ Subject: can_create_window.patch
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index d6d88e7b66f2de4b6733ea454fc45bb804f13a0e..30e9eabf785a0f241e9581ea38f55dd779acd8ce 100644
index b482fed5deb268b422da71ac323b88c5eba58f1c..535ab53bf35caa5b8c9c36e684831248a3b0100e 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -4054,6 +4054,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -4309,6 +4309,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,
@@ -17,10 +17,10 @@ index d6d88e7b66f2de4b6733ea454fc45bb804f13a0e..30e9eabf785a0f241e9581ea38f55dd7
&no_javascript_access);
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index f0d9cafca7efb0ae0440619b821b1976d8460396..e34e0e6387b907960d234da93a3e90a390488d02 100644
index 23aa37d474df2b52f91d6d07a3423728f2f6e776..4583407a4a287c9fe39e013fee3a0e3a1cf9fe12 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -313,6 +313,10 @@ struct CreateNewWindowParams {
@@ -296,6 +296,10 @@ struct CreateNewWindowParams {
// The window features to use for the new window.
blink.mojom.WindowFeatures features;
@@ -32,10 +32,10 @@ index f0d9cafca7efb0ae0440619b821b1976d8460396..e34e0e6387b907960d234da93a3e90a3
// 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 a9fddd7dd2d3f5c07a3b15925209a396c9aa096d..da7eca5f443e2ecdcb3f0819848735aafeb43a00 100644
index ee168f4c2dd6d3c81563baaa7476e80bb2aa7b95..3fdc443b408c3d8f7ffdabf6b010d5fc1ecd22d5 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -502,6 +502,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -506,6 +506,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -45,18 +45,18 @@ index a9fddd7dd2d3f5c07a3b15925209a396c9aa096d..da7eca5f443e2ecdcb3f0819848735aa
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 4e18dfd0dc8d4be9b59f12e7010b7f2be70d6cf0..07fa16953d6167a5a381b28a5da3c08a78de4306 100644
index 3792cba399a4b80f9fbb7fa1c5561f4614dbba62..891b69d65de0e47719af23eb7047d22d10417019 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -178,6 +178,7 @@ class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
class ResourceContext;
@@ -134,6 +134,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
+class ResourceRequestBody;
class SerialDelegate;
class SiteInstance;
class SpeechRecognitionManagerDelegate;
@@ -801,6 +802,8 @@ class CONTENT_EXPORT ContentBrowserClient {
} // namespace network
namespace rappor {
@@ -812,6 +813,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -66,7 +66,7 @@ index 4e18dfd0dc8d4be9b59f12e7010b7f2be70d6cf0..07fa16953d6167a5a381b28a5da3c08a
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 4a3c760000fca5f53244a03b9a2074991bc0c382..c5ab8ad81bf11d0ec151b9585a4f1a7f5397ae4b 100644
index 808b3fabd93bf3d7daa9e4b944df9f4a35b446b2..e31eca37ea538c1c26fe6be636d2b0372792653b 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -71,6 +71,7 @@
@@ -75,9 +75,9 @@ index 4a3c760000fca5f53244a03b9a2074991bc0c382..c5ab8ad81bf11d0ec151b9585a4f1a7f
#include "content/renderer/loader/request_extra_data.h"
+#include "content/renderer/loader/web_url_request_util.h"
#include "content/renderer/media/audio/audio_device_factory.h"
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
@@ -1367,6 +1368,8 @@ WebView* RenderViewImpl::CreateView(
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_frame_proxy.h"
@@ -1339,6 +1340,8 @@ WebView* RenderViewImpl::CreateView(
}
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
@@ -87,10 +87,10 @@ index 4a3c760000fca5f53244a03b9a2074991bc0c382..c5ab8ad81bf11d0ec151b9585a4f1a7f
// 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 5faaea374484d51b1af261ff93fb96aec2eaa4e1..786d3a904a765b5cb53859c35a045b9e04b6250b 100644
index 87667cbeca11db24199ece95c717dd6a42f7466c..5f5af14a08f70d9e6de4454d6f672699c3e85c8f 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
@@ -312,6 +312,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -315,6 +315,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -100,7 +100,7 @@ index 5faaea374484d51b1af261ff93fb96aec2eaa4e1..786d3a904a765b5cb53859c35a045b9e
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 435f204a364e54b59c0bd651b760bf350ea94d11..1e6bee1fa08fa2d2a396678838d475e0e7e4ce0c 100644
index 987f2228a312a3cb9c9a04dd682987d1af3f3fe0..30cde8a73a4ca67edd8f898ff63cf446f62bfc64 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
@@ -68,6 +68,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Wed, 23 Oct 2019 14:17:18 -0700
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/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fae4ee67ca 100644
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
+++ b/chrome/browser/spellchecker/spellcheck_factory.cc
@@ -6,7 +6,7 @@
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
-#include "chrome/grit/locale_settings.h"
+#include "electron/grit/electron_resources.h"
#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/language_prefs.cc b/components/language/core/browser/language_prefs.cc
index d5e4c09e1722232df44b112ce39cdacea03a4710..c6caf7eacd9eed439ab5167e51b9fcce5d6af664 100644
--- a/components/language/core/browser/language_prefs.cc
+++ b/components/language/core/browser/language_prefs.cc
@@ -21,7 +21,7 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
-#include "components/strings/grit/components_locale_settings.h"
+#include "electron/grit/electron_resources.h"
#include "ui/base/l10n/l10n_util.h"
namespace language {

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 82f291613ac9682ddf414699046393125eb102eb..440681987b4d6420be93fe2f17180cb42adc8d2c 100644
index 3af6a64be2f12cc4b7618f2c4db1a70fe7df0689..a81a8a3ba12b75fffd871b63bfc5c0564ea87826 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1505,7 +1505,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
@@ -1541,7 +1541,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
NOTREACHED();
#else
base::RunLoop run_loop;

View File

@@ -17,10 +17,10 @@ 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 f383b8ee13881b66144ca12e284e1ead4376a27f..42375cd33bb9759ef1c264672b250638a472fe7e 100644
index 6d52381b3cb1aa290d33ae07c6e4c499e007b928..60e8705fb3afe5e7712a159d79fee2efa4bd3587 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1209,8 +1209,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
@@ -1226,8 +1226,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
return NAVIGATION_TYPE_NEW_SUBFRAME;
}
@@ -33,7 +33,7 @@ index f383b8ee13881b66144ca12e284e1ead4376a27f..42375cd33bb9759ef1c264672b250638
if (rfh->GetParent()) {
// All manual subframes would be did_create_new_entry and handled above, so
@@ -1462,7 +1464,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
@@ -1483,7 +1485,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
}
@@ -46,10 +46,10 @@ index f383b8ee13881b66144ca12e284e1ead4376a27f..42375cd33bb9759ef1c264672b250638
// 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 34c13c28117fe5fced5ca3190c5f948168cd010f..554ddabee8952e578a61a9b9c3f358b2475abd69 100644
index 00a096c43f13d8addcf202545ac2aef97ef9c556..0145c63c41ba67b260b5df273d04e5b87c22af23 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -730,9 +730,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
@@ -744,9 +744,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
}
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {

View File

@@ -7,10 +7,20 @@ Subject: desktop_media_list.patch
* Free the one-time use capturer after thumbnails are fetched
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
index a489bf6ea2179059f53e53563e993db9c7cd123b..8d3df446290e2111e4952899539cbc16d37546e5 100644
index a489bf6ea2179059f53e53563e993db9c7cd123b..93e237569fe94ec8526f67d915e1a7352d586b16 100644
--- a/chrome/browser/media/webrtc/desktop_media_list.h
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
@@ -69,6 +69,7 @@ class DesktopMediaList {
@@ -38,6 +38,9 @@ class DesktopMediaList {
virtual ~DesktopMediaList() {}
+ // Allows listening to notifications generated by the model.
+ virtual void AddObserver(DesktopMediaListObserver* observer) = 0;
+
// Sets time interval between updates. By default list of sources and their
// thumbnail are updated once per second. If called after StartUpdating() then
// it will take effect only after the next update.
@@ -69,6 +72,7 @@ class DesktopMediaList {
virtual int GetSourceCount() const = 0;
virtual const Source& GetSource(int index) const = 0;
@@ -19,10 +29,22 @@ index a489bf6ea2179059f53e53563e993db9c7cd123b..8d3df446290e2111e4952899539cbc16
virtual content::DesktopMediaID::Type GetMediaListType() const = 0;
};
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
index 9d9b7435044c4b84f971bd94765eb875fbac1624..eb7e10f7d9e937ebd6f776e4b4ec495d02fb884b 100644
index 9d9b7435044c4b84f971bd94765eb875fbac1624..2918f91d8e1308bf5a47313e20ad3cec74918f3a 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
@@ -56,7 +56,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
@@ -22,6 +22,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
DesktopMediaListBase::~DesktopMediaListBase() {}
+void DesktopMediaListBase::AddObserver(DesktopMediaListObserver* observer) {
+ DCHECK(!observer_);
+ observer_ = observer;
+}
+
void DesktopMediaListBase::SetUpdatePeriod(base::TimeDelta period) {
DCHECK(!observer_);
update_period_ = period;
@@ -56,7 +61,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
DCHECK(sources_.empty());
DCHECK(!refresh_callback_);
refresh_callback_ = std::move(callback);
@@ -31,7 +53,7 @@ index 9d9b7435044c4b84f971bd94765eb875fbac1624..eb7e10f7d9e937ebd6f776e4b4ec495d
}
int DesktopMediaListBase::GetSourceCount() const {
@@ -70,6 +70,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
@@ -70,6 +75,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
return sources_[index];
}
@@ -43,11 +65,32 @@ index 9d9b7435044c4b84f971bd94765eb875fbac1624..eb7e10f7d9e937ebd6f776e4b4ec495d
DesktopMediaID::Type DesktopMediaListBase::GetMediaListType() const {
return type_;
}
@@ -81,6 +91,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
void DesktopMediaListBase::UpdateSourcesList(
const std::vector<SourceDescription>& new_sources) {
+ // Notify observer when there was no new source captured.
+ if (new_sources.empty()) {
+ observer_->OnSourceUnchanged(this);
+ return;
+ }
+
typedef std::set<DesktopMediaID> SourceSet;
SourceSet new_source_set;
for (size_t i = 0; i < new_sources.size(); ++i) {
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
index 3c09ec3111d54cb4f0b74f16a81292b779009eae..26acc18acaef21ced3604fe7ede079d8577f53f4 100644
index 3c09ec3111d54cb4f0b74f16a81292b779009eae..5c3667822afd47a22878b508b844a615c24f3162 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
@@ -34,6 +34,7 @@ class DesktopMediaListBase : public DesktopMediaList {
@@ -27,6 +27,7 @@ class DesktopMediaListBase : public DesktopMediaList {
~DesktopMediaListBase() override;
// DesktopMediaList interface.
+ void AddObserver(DesktopMediaListObserver* observer) override;
void SetUpdatePeriod(base::TimeDelta period) override;
void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
@@ -34,6 +35,7 @@ class DesktopMediaListBase : public DesktopMediaList {
void Update(UpdateCallback callback) override;
int GetSourceCount() const override;
const Source& GetSource(int index) const override;
@@ -55,6 +98,18 @@ index 3c09ec3111d54cb4f0b74f16a81292b779009eae..26acc18acaef21ced3604fe7ede079d8
content::DesktopMediaID::Type GetMediaListType() const override;
static uint32_t GetImageHash(const gfx::Image& image);
diff --git a/chrome/browser/media/webrtc/desktop_media_list_observer.h b/chrome/browser/media/webrtc/desktop_media_list_observer.h
index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c5916a9f2009 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_observer.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_observer.h
@@ -20,6 +20,7 @@ class DesktopMediaListObserver {
int new_index) = 0;
virtual void OnSourceNameChanged(DesktopMediaList* list, int index) = 0;
virtual void OnSourceThumbnailChanged(DesktopMediaList* list, int index) = 0;
+ virtual void OnSourceUnchanged(DesktopMediaList* list) = 0;
protected:
virtual ~DesktopMediaListObserver() {}
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 2b109bd1dea2aed647ec01c0660b2d4c963312f2..8567b4c84b55f1f7774ef3755dca63e94ddd7a29 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc

View File

@@ -15,10 +15,10 @@ the redraw locking mechanism, which fixes these issues. The electron issue
can be found at https://github.com/electron/electron/issues/1821
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 5a60f89ef1cb766a7b06ef80c4bee16c7de593e2..4a96f076a200e59289cbb1f152ec9d3d266f4214 100644
index 00971fc552171adb0ee9d4227a0bd03dfe1306be..10748277ed62c1e60bb95cfd9e8ddfe06dea4066 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -348,6 +348,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -305,6 +305,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
} // namespace
@@ -29,7 +29,7 @@ index 5a60f89ef1cb766a7b06ef80c4bee16c7de593e2..4a96f076a200e59289cbb1f152ec9d3d
// A scoping class that prevents a window from being able to redraw in response
// to invalidations that may occur within it for the lifetime of the object.
//
@@ -399,6 +403,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
@@ -356,6 +360,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
cancel_unlock_(false),
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
::IsWindow(hwnd_) &&
@@ -37,7 +37,7 @@ index 5a60f89ef1cb766a7b06ef80c4bee16c7de593e2..4a96f076a200e59289cbb1f152ec9d3d
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
!ui::win::IsAeroGlassEnabled())) {
if (should_lock_)
@@ -1022,6 +1027,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
@@ -976,6 +981,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
return scoped_enable;
}
@@ -49,7 +49,7 @@ index 5a60f89ef1cb766a7b06ef80c4bee16c7de593e2..4a96f076a200e59289cbb1f152ec9d3d
// HWNDMessageHandler, gfx::WindowImpl overrides:
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 4044afcc0fd1f076fc392d34417e3ccaa1347031..2bd5fcdf0293a07938d22902121517a458bd3e88 100644
index 8299c29aa1cff21c9ce66bb0a1934149f4be5d12..504bad57987009ec8c87641a52eb28d98e2d5c06 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -202,6 +202,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
@@ -62,7 +62,7 @@ index 4044afcc0fd1f076fc392d34417e3ccaa1347031..2bd5fcdf0293a07938d22902121517a4
HICON GetDefaultWindowIcon() const override;
HICON GetSmallWindowIcon() const override;
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
index ddc640e7a5d278e08c056f1989ac258c9ae8bfae..a5d050dadad3c565b0151ee945e5d17f42255aa3 100644
index 45c4e5b29d05ea0323596fa2c5034c2e30a68f70..e25aac69b09954fbc267309beba98ec0877fa2ac 100644
--- a/ui/views/win/hwnd_message_handler_delegate.h
+++ b/ui/views/win/hwnd_message_handler_delegate.h
@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {

View File

@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 8d8d18e2c62dbabfaa81d79f0555954b0b319d3d..298bfe91b9c9f4cbb3b07fe9bc368a1e84433ed1 100644
index 855b96ae0c398506ec81bd24c0430f2573706d80..977c07db32933a9cc04b1f0613014718d4725640 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1815,6 +1815,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {
@@ -1822,6 +1822,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {
const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpaceAndId(
int* id) const {
@@ -37,7 +37,7 @@ index 8d8d18e2c62dbabfaa81d79f0555954b0b319d3d..298bfe91b9c9f4cbb3b07fe9bc368a1e
// 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 b6dd56de7cde72051caeedeef3ee413b8f24eba6..0da3f40ebc81170f63e61d8dc5714df5dd72c049 100644
index 182eb5f68731afdaba5ce71d0fa67ea1051eb0dc..3dd350583c3f23445841c3e46122ae6e809508b2 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -96,6 +96,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -83,7 +83,7 @@ index f17aa1fa451f1b99d7f083e07edd49b11f7639e4..09f7c5d6a92d89c199b296771a8ff60c
!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 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa659941a68 100644
index cf811dcdec761ce6825cb1bffb83249b5e144cae..6303a6b2ab37548e580abe946be33ae75e5a0abe 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -83,6 +83,9 @@
@@ -108,7 +108,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
// Use the full quad_rect for debug quads to not move the edges based on
// partial swaps.
@@ -1428,7 +1432,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
@@ -1476,7 +1480,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
params->use_color_matrix, tint_gl_composited_content_,
params->apply_shader_based_rounded_corner &&
ShouldApplyRoundedCorner(params->quad)),
@@ -118,7 +118,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
@@ -1899,8 +1904,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -1947,8 +1952,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -129,7 +129,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
SetShaderColor(color, opacity);
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -2055,8 +2060,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
@@ -2103,8 +2108,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
: NON_PREMULTIPLIED_ALPHA,
false, false, tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -140,7 +140,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2152,8 +2157,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
@@ -2200,8 +2205,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -151,7 +151,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2256,7 +2261,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
@@ -2304,7 +2309,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
gfx::ColorSpace dst_color_space =
@@ -160,7 +160,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
// Force sRGB output on Windows for overlay candidate video quads to match
// DirectComposition behavior in case these switch between overlays and
// compositing. See https://crbug.com/811118 for details.
@@ -2412,8 +2417,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
@@ -2460,8 +2465,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
@@ -171,7 +171,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2475,8 +2480,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2523,8 +2528,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
@@ -182,7 +182,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -3185,7 +3190,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
@@ -3233,7 +3238,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,7 +193,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
gfx::ColorSpace adjusted_color_space = src_color_space;
float sdr_white_level = current_frame()->sdr_white_level;
@@ -3564,7 +3571,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
@@ -3612,7 +3619,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
*overlay_texture = FindOrCreateOverlayTexture(
params.quad->render_pass_id, iosurface_width, iosurface_height,
@@ -202,7 +202,7 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
gfx::SizeF((*overlay_texture)->texture.size()));
@@ -3782,8 +3789,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
@@ -3830,8 +3837,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
PrepareGeometry(SHARED_BINDING);
@@ -213,17 +213,17 @@ index 9eb0276cbedd99b41e537720ea159cdaac7ce705..fbc49a3aa2a5458050acf0280f6caaa6
gfx::Transform render_matrix;
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
@@ -3943,3 +3950,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
@@ -3991,3 +3998,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 e42a2f780170f01edce84753d60b1fba3a429aeb..3cb62924adf93c4d437c8fa81529efc5188d7f77 100644
index 6deb2a50ff258ce3b1f892abccd6be2f9cf4e255..ab723f93e259453689ece2b2f447cbed1854e4c1 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -196,6 +196,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -186,6 +186,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
// Command-line switches to propagate to the GPU process.
static const char* const kSwitchNames[] = {
@@ -232,18 +232,18 @@ index e42a2f780170f01edce84753d60b1fba3a429aeb..3cb62924adf93c4d437c8fa81529efc5
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 0408a35db18ecdcad1521e4123aed4bd12bcf2c8..94898420ab1b93f61c830e19cd31ed0a1716922e 100644
index 71e6b162a8e56e63731b61c171c20d134e7e8b47..ea6722ee4162bdc1e0d8f7548bc971d268d343c4 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -225,6 +225,7 @@
@@ -226,6 +226,7 @@
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/display/display_switches.h"
+#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "url/url_constants.h"
@@ -3015,6 +3016,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
#include "url/origin.h"
@@ -3039,6 +3040,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 +252,10 @@ index 0408a35db18ecdcad1521e4123aed4bd12bcf2c8..94898420ab1b93f61c830e19cd31ed0a
service_manager::switches::kDisableInProcessStackTraces,
service_manager::switches::kDisableSeccompFilterSandbox,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 74cdb6031587640946ed08f37f1579ea4e68414c..68a5ec2d04dc3ec1c81d8f62fa067416f2faee29 100644
index 84af6512284655c8781fd839fc50cd3a75395889..d51198f40580d023d2bfcb6a131b7e5a0e2d4769 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2930,6 +2930,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
@@ -2976,6 +2976,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
@@ -266,10 +266,18 @@ index 74cdb6031587640946ed08f37f1579ea4e68414c..68a5ec2d04dc3ec1c81d8f62fa067416
// is what the renderer uses if its not threaded.
settings.enable_checker_imaging =
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
index 1aedba288aed698fd1b7ac6a4ef1a67fc892f84a..df2b5b120483225c2bd21a337e6085dbceca4ec4 100644
index 1aedba288aed698fd1b7ac6a4ef1a67fc892f84a..0113b09e2f2bb85b4ec43a90503b9ed98e42fd0f 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
@@ -12,6 +12,7 @@
@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+#include "base/command_line.h"
#include "cc/paint/skia_paint_canvas.h"
#include "components/viz/common/resources/resource_format_utils.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
@@ -12,6 +13,7 @@
#include "third_party/khronos/GLES3/gl3.h"
#include "third_party/skia/include/core/SkSurfaceProps.h"
#include "ui/gfx/color_space.h"
@@ -277,7 +285,7 @@ index 1aedba288aed698fd1b7ac6a4ef1a67fc892f84a..df2b5b120483225c2bd21a337e6085db
namespace blink {
@@ -89,6 +90,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
@@ -89,6 +91,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
}
gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
@@ -289,7 +297,7 @@ index 1aedba288aed698fd1b7ac6a4ef1a67fc892f84a..df2b5b120483225c2bd21a337e6085db
gfx::ColorSpace::PrimaryID primary_id = GetPrimaryID(color_space_);
// TODO(ccameron): This needs to take into account whether or not this texture
@@ -102,6 +108,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
@@ -102,6 +109,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
}
gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
@@ -302,7 +310,7 @@ index 1aedba288aed698fd1b7ac6a4ef1a67fc892f84a..df2b5b120483225c2bd21a337e6085db
gfx::ColorSpace::TransferID transfer_id =
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index 41f7fcbdd63af315f4b4e768bfef3b5004807a0b..398a4fdea3cc0ab4f5132deeb9365189f9c928c3 100644
index c383d42c986aa29fcdfc2009901ed452ef480b55..1b8d0818155a407eb42c3f785e9609fe7bfa3dc7 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -16,6 +16,7 @@
@@ -313,19 +321,19 @@ index 41f7fcbdd63af315f4b4e768bfef3b5004807a0b..398a4fdea3cc0ab4f5132deeb9365189
namespace gfx {
@@ -186,6 +187,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
// Ensure that all IOSurfaces start as sRGB.
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ color_space = base::mac::GetSystemColorSpace();
+ }
@@ -261,6 +262,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
} else {
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ color_space = base::mac::GetSystemColorSpace();
+ }
+
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
CGColorSpaceCopyICCProfile(color_space));
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
@@ -197,6 +203,14 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
CGColorSpaceCopyICCProfile(color_space));
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
@@ -277,6 +283,14 @@ bool IOSurfaceCanSetColorSpace(const ColorSpace& color_space) {
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
const ColorSpace& color_space) {
@@ -337,9 +345,9 @@ index 41f7fcbdd63af315f4b4e768bfef3b5004807a0b..398a4fdea3cc0ab4f5132deeb9365189
+ return;
+ }
+
// Special-case sRGB.
if (color_space == ColorSpace::CreateSRGB()) {
base::ScopedCFTypeRef<CFDataRef> srgb_icc(
if (!internal::IOSurfaceSetColorSpace(io_surface, color_space)) {
DLOG(ERROR) << "Failed to set color space for IOSurface: "
<< color_space.ToString();
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index ba3dbf23d1df7a3b0cc199054f36a88014daa0e7..f8a563a78cee2856da0f2ad556beba19b01a2e59 100644
--- a/ui/gfx/switches.cc

View File

@@ -5,16 +5,20 @@ Subject: fix: disabling compositor recycling
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 18019d5794f688ca07b35a665cc9800bb1d3047a..60c7e980dd322ba012c564fca68848c3188ca5dc 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -209,7 +209,7 @@
}
void BrowserCompositorMac::SetRenderWidgetHostIsHidden(bool hidden) {
- render_widget_host_is_hidden_ = hidden;
+ render_widget_host_is_hidden_ = false;
UpdateState();
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index de722efe61cb6823e62f1101b5aa3447f6795687..b258bbb12b5c607e3fec600fbc7bcb376eb00c72 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -486,7 +486,11 @@
return;
host()->WasHidden();
- browser_compositor_->SetRenderWidgetHostIsHidden(true);
+ // Consider the RWHV occluded only if it is not attached to a window
+ // (e.g. unattached BrowserView). Otherwise we treat it as visible to
+ // prevent unnecessary compositor recycling.
+ const bool unattached = ![GetInProcessNSView() window];
+ browser_compositor_->SetRenderWidgetHostIsHidden(unattached);
}
void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) {

View File

@@ -5,10 +5,10 @@ Subject: disable_hidden.patch
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 55c13fa06f7c6a5e7b3bd072ed7ffc452fd24438..09b6a881a5644859eafb216eee1172aeb8d086b2 100644
index 98273d31f12a368675580e37e849e6afb0b9d048..089d2e596d6ba753a13f0f3f6791a35fbb40b51a 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -683,6 +683,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -674,6 +674,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
return;
@@ -19,10 +19,10 @@ index 55c13fa06f7c6a5e7b3bd072ed7ffc452fd24438..09b6a881a5644859eafb216eee1172ae
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 71bfb5e5e6e0aba5615bc76cae1b551ac1880d09..c5175b7fd5c5394703fca85e57b4be5faf618b63 100644
index b5c6734044e0361a2b9e3d2f6800bb9a679cd73d..477dac2d5ba5ef93f990f625d063be95b4c7a7d5 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -200,6 +200,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -185,6 +185,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// RenderWidgetHostImpl.
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);

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 3c8e5db44c4174d5e876a8874fc702cc3233fc7b..31d45afae965efeb15b83d9f4259cc50abe987dd 100644
index 511aac290866fa739e4c51d487baa8cfdbe52c78..c608456b22923568b83da5a0ae5c78c4af8c7970 100644
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -4181,7 +4181,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
@@ -4150,7 +4150,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

@@ -7,10 +7,10 @@ Compilation of those files fails with the Chromium 68.
Remove the patch during the Chromium 69 upgrade.
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index 854d6c6b9763cbec3a4dd74635726e2c0e7c6944..4fe9ee97104c2b021d00a661ff7dbb7fe9a6f681 100644
index 495b789a66e901e311e164a62e2024851b81fe60..f12b1b3d1de217bf52b098398d6db19a9504b5c5 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1781,7 +1781,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
@@ -1805,7 +1805,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
"graphics/paint/drawing_display_item_test.cc",
"graphics/paint/drawing_recorder_test.cc",
"graphics/paint/float_clip_rect_test.cc",

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 b9a8a12b8abb386fec548a26e4686af2e3822b8c..18af342553139669e485e5c34961de231f927f4c 100644
index 144714a3a1e63bb891b86cba12a27de50be7f976..e98a296a6b52ec4c6eb336e2d882a36e6f58b76c 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -928,6 +928,13 @@ void NetworkContext::SetNetworkConditions(
@@ -931,6 +931,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index b9a8a12b8abb386fec548a26e4686af2e3822b8c..18af342553139669e485e5c34961de23
// 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 e98063a71435ee8828f3b5a21b569325965f7c58..dd34e65752d54b193965b7e7fea2cae324782204 100644
index f0a41d64804eab8195c389b457f6c0119d24a783..b531fa64af4ae625cd8b79c40d08b64b40a76d1e 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -222,6 +222,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -226,6 +226,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 e98063a71435ee8828f3b5a21b569325965f7c58..dd34e65752d54b193965b7e7fea2cae3
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 4691fde53fd7d6ff6e89c55a7fec88d77b39701c..33021fcda6d2cbe46225ba8cf56e137ee7ef9912 100644
index 88e78f46415d7a416534e88c13bb45b26cc856f3..6b14d8354375377526e141ee499a7583be3f22b0 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -912,6 +912,9 @@ interface NetworkContext {
@@ -932,6 +932,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);
@@ -77,10 +77,10 @@ index 4691fde53fd7d6ff6e89c55a7fec88d77b39701c..33021fcda6d2cbe46225ba8cf56e137e
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 4fe68bb40d8e009e9765ed884bbf898a10b86124..a84cf0a1b07751bbcad9b193a4a3a1683e0db80c 100644
index f7f7e16c5bd6d85e3a65065a61df27d92f38ff1b..62161a5e54ddcbfd37c8ebfe631cb6d697b3d530 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -98,6 +98,7 @@ class TestNetworkContext : public mojom::NetworkContext {
@@ -99,6 +99,7 @@ class TestNetworkContext : public mojom::NetworkContext {
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
mojom::NetworkConditionsPtr conditions) override {}

View File

@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
We can remove this patch once it has in some shape been upstreamed.
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index 5fd3bb3b60bda4449cc4743922758d62ee6decac..860b92c47f42d7517adb5e3370cc02d7e1c67b62 100644
index a91c4e3fb94c19686f3325709b3003bf4998c538..20c9959ff47d2c4a83ff91e802a1336a4c37690f 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -40,6 +40,8 @@ NativeTheme::NativeTheme()
@@ -26,7 +26,7 @@ index 5fd3bb3b60bda4449cc4743922758d62ee6decac..860b92c47f42d7517adb5e3370cc02d7
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index ef45da79366c2e3ab242ec140989b407ac70dbb8..98ca8881b0b9f68a464e62f76589b29157126a86 100644
index e479fc84f7013984fc53d18cad8812fbd43cb670..47fce78d2a55c7344297ba92b0083c01e3d1b72b 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -429,6 +429,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -52,7 +52,7 @@ index ef45da79366c2e3ab242ec140989b407ac70dbb8..98ca8881b0b9f68a464e62f76589b291
// 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
@@ -550,6 +566,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -553,6 +569,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
PreferredColorScheme preferred_color_scheme_ =
PreferredColorScheme::kNoPreference;

View File

@@ -0,0 +1,85 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <ckerr@github.com>
Date: Thu, 14 Nov 2019 14:17:57 -0600
Subject: fix: add missing `#include <algorithm>` as needed
Backport of https://github.com/electron/electron/pull/21045
diff --git a/media/base/byte_queue.cc b/media/base/byte_queue.cc
index 245fafa668568fd308e5a2806dafc1c5f0bf3dbd..c54ac79bdfbba4614b9944f73269f5f30ec9a80a 100644
--- a/media/base/byte_queue.cc
+++ b/media/base/byte_queue.cc
@@ -4,6 +4,8 @@
#include "media/base/byte_queue.h"
+#include <algorithm>
+
#include "base/logging.h"
#include "base/numerics/checked_math.h"
diff --git a/third_party/blink/public/platform/web_time_range.h b/third_party/blink/public/platform/web_time_range.h
index 2c17f7c8ce58f1255994e9e6fd74f70fa1a22b1c..4b0a59bf3308b49d2c4ffd86120759417094cb21 100644
--- a/third_party/blink/public/platform/web_time_range.h
+++ b/third_party/blink/public/platform/web_time_range.h
@@ -31,6 +31,8 @@
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_TIME_RANGE_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_TIME_RANGE_H_
+#include <algorithm>
+
#include "third_party/blink/public/platform/web_vector.h"
namespace blink {
diff --git a/third_party/blink/renderer/core/layout/min_max_size.h b/third_party/blink/renderer/core/layout/min_max_size.h
index c3fdbde6e4bf585351b3fc8d0ce2bd2673a82b5e..4233e6c79a1d67dd6c1ca33929d0beedbf9a1116 100644
--- a/third_party/blink/renderer/core/layout/min_max_size.h
+++ b/third_party/blink/renderer/core/layout/min_max_size.h
@@ -5,6 +5,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MIN_MAX_SIZE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MIN_MAX_SIZE_H_
+#include <algorithm>
+
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/layout/ng/geometry/ng_margin_strut.h b/third_party/blink/renderer/core/layout/ng/geometry/ng_margin_strut.h
index 50f699428acf8251f14411dc30caa750cfac88bf..8236afa14ee99b5f61e6c785721abf62299cbaed 100644
--- a/third_party/blink/renderer/core/layout/ng/geometry/ng_margin_strut.h
+++ b/third_party/blink/renderer/core/layout/ng/geometry/ng_margin_strut.h
@@ -5,6 +5,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_GEOMETRY_NG_MARGIN_STRUT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_GEOMETRY_NG_MARGIN_STRUT_H_
+#include <algorithm>
+
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/style/style_difference.h b/third_party/blink/renderer/core/style/style_difference.h
index 91292961f1f02e53c58653f72297ea05d78fc07b..517fbb8f5a7aa549373e3806aaec4b3d1f0ec13f 100644
--- a/third_party/blink/renderer/core/style/style_difference.h
+++ b/third_party/blink/renderer/core/style/style_difference.h
@@ -5,7 +5,9 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_STYLE_DIFFERENCE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_STYLE_DIFFERENCE_H_
+#include <algorithm>
#include <iosfwd>
+
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
diff --git a/third_party/blink/renderer/core/svg/animation/smil_time.h b/third_party/blink/renderer/core/svg/animation/smil_time.h
index b4fec36d9ef15c5492ce6bbe544c11bdfc01ec10..7433a3a1c8578dbeb388628f1050629133c94f83 100644
--- a/third_party/blink/renderer/core/svg/animation/smil_time.h
+++ b/third_party/blink/renderer/core/svg/animation/smil_time.h
@@ -26,6 +26,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_SVG_ANIMATION_SMIL_TIME_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_SVG_ANIMATION_SMIL_TIME_H_
+#include <algorithm>
#include <ostream>
#include "base/time/time.h"

View File

@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Wed, 30 Oct 2019 16:26:29 -0700
Subject: fix ambiguous reference to 'data'
Upstreamed: https://chromium-review.googlesource.com/c/chromium/src/+/1891762
diff --git a/base/containers/span.h b/base/containers/span.h
index 2c402495a960f348275b7f925ca5dcdbf691ff7a..0faa4ad502d3982293f4faa50525a2340dbf2abd 100644
--- a/base/containers/span.h
+++ b/base/containers/span.h
@@ -498,7 +498,7 @@ template <size_t N,
decltype(base::data(std::declval<Container&>()))>,
typename = internal::EnableIfSpanCompatibleContainer<Container&, T>>
constexpr span<T, N> make_span(Container& container) noexcept {
- return span<T, N>(data(container), size(container));
+ return span<T, N>(base::data(container), base::size(container));
}
template <
@@ -509,7 +509,7 @@ template <
decltype(base::data(std::declval<const Container&>()))>,
typename = internal::EnableIfSpanCompatibleContainer<const Container&, T>>
constexpr span<T, N> make_span(const Container& container) noexcept {
- return span<T, N>(data(container), size(container));
+ return span<T, N>(base::data(container), base::size(container));
}
template <int&... ExplicitArgumentBarrier, typename T, size_t X>

View File

@@ -7,10 +7,10 @@ Disable usage of SetApplicationIsDaemon and
_LSSetApplicationLaunchServicesServerConnectionStatus in MAS builds
diff --git a/content/utility/utility_service_factory.cc b/content/utility/utility_service_factory.cc
index 9b0759ab820ddb0e2a9e609b88bbc1673607c4e3..2392fd01736550f404304df324da9d81dfb3d446 100644
index 2c1c7f992f2a40509d2d8854fcd7a023d7e06b6d..4c3f2dc2e1e1bf4c06764c97f9be5b5331e311bb 100644
--- a/content/utility/utility_service_factory.cc
+++ b/content/utility/utility_service_factory.cc
@@ -196,7 +196,7 @@ void UtilityServiceFactory::RunService(
@@ -162,7 +162,7 @@ void UtilityServiceFactory::RunService(
std::unique_ptr<service_manager::Service>
UtilityServiceFactory::CreateAudioService(
mojo::PendingReceiver<service_manager::mojom::Service> receiver) {
@@ -18,7 +18,7 @@ index 9b0759ab820ddb0e2a9e609b88bbc1673607c4e3..2392fd01736550f404304df324da9d81
+#if defined(OS_MACOSX) && !defined(MAS_BUILD)
// Don't connect to launch services when running sandboxed
// (https://crbug.com/874785).
if (base::FeatureList::IsEnabled(
if (service_manager::IsAudioSandboxEnabled()) {
diff --git a/sandbox/mac/system_services.cc b/sandbox/mac/system_services.cc
index caa30bb378b30331f90057fe7ce3aec724104bf8..a766daa808495f7872051e129c6ad9f76f54e4fe 100644
--- a/sandbox/mac/system_services.cc

View File

@@ -42,115 +42,95 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index b1be27659d80a3199242d43ec80ccd28a43059b1..f475ec2301011a0840e76dd0e8e40bf65fdf6106 100644
index f7fc9cbc5edb0bfe1b3da0abd03b2d8565772607..7804e660e5d87f53d8661e36acaaf2fc0b52ec0e 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2250,6 +2250,21 @@ bool RenderFrameHostManager::InitRenderView(
@@ -2126,6 +2126,16 @@ bool RenderFrameHostManager::InitRenderView(
scoped_refptr<SiteInstance>
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
NavigationRequest* request) {
+ BrowserContext* browser_context = nullptr;
+ scoped_refptr<SiteInstanceImpl> candidate_site_instance;
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance()) {
+ browser_context =
+ delegate_->GetControllerForRenderManager().GetBrowserContext();
+ // If the navigation can swap SiteInstances, compute the SiteInstance it
+ // should use.
+ // TODO(clamy): We should also consider as a candidate SiteInstance the
+ // speculative SiteInstance that was computed on redirects.
+ candidate_site_instance =
+ speculative_render_frame_host_
+ ? speculative_render_frame_host_->GetSiteInstance()
+ : nullptr;
+ }
+ // Compute the SiteInstance that the navigation should use, which will be
+ // either the current SiteInstance or a new one.
+ //
+ // TODO(clamy): We should also consider as a candidate SiteInstance the
+ // speculative SiteInstance that was computed on redirects.
+ SiteInstanceImpl* candidate_site_instance =
+ speculative_render_frame_host_
+ ? speculative_render_frame_host_->GetSiteInstance()
+ : nullptr;
+
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
// All children of MHTML documents must be MHTML documents. They all live in
@@ -2293,6 +2308,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->common_params().url);
no_renderer_swap_allowed |=
request->from_begin_navigation() && !can_renderer_initiate_transfer;
+
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance()) {
+ bool has_navigation_started = request->state() != NavigationRequest::NOT_STARTED;
+ bool has_response_started =
+ (request->state() == NavigationRequest::RESPONSE_STARTED ||
+ request->state() == NavigationRequest::FAILED) &&
+ !speculative_render_frame_host_;
+ // Gives user a chance to choose a custom site instance.
+ SiteInstance* affinity_site_instance = nullptr;
+ scoped_refptr<SiteInstance> overriden_site_instance;
+ bool should_register_site_instance = false;
+ ContentBrowserClient::SiteInstanceForNavigationType siteInstanceType =
+ GetContentClient()->browser()->ShouldOverrideSiteInstanceForNavigation(
+ current_frame_host(), speculative_frame_host(), browser_context,
+ request->common_params().url, has_navigation_started,
+ has_response_started, &affinity_site_instance);
+ switch (siteInstanceType) {
+ case ContentBrowserClient::SiteInstanceForNavigationType::
+ FORCE_CANDIDATE_OR_NEW:
+ overriden_site_instance =
+ candidate_site_instance
+ ? candidate_site_instance
+ : current_site_instance->CreateRelatedSiteInstance(
+ request->common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_NEW:
+ overriden_site_instance = current_site_instance->CreateRelatedSiteInstance(
+ request->common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
+ overriden_site_instance = render_frame_host_->GetSiteInstance();
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_AFFINITY:
+ DCHECK(affinity_site_instance);
+ overriden_site_instance =
+ scoped_refptr<SiteInstance>(affinity_site_instance);
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::ASK_CHROMIUM:
+ DCHECK(!affinity_site_instance);
+ break;
+ default:
+ break;
+ }
+ if (overriden_site_instance) {
+ if (should_register_site_instance) {
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
+ render_frame_host_.get(), overriden_site_instance.get());
+ }
+ return overriden_site_instance;
+ }
+ }
} else {
// Subframe navigations will use the current renderer, unless specifically
// allowed to swap processes.
@@ -2304,23 +2372,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
if (no_renderer_swap_allowed && !should_swap_for_error_isolation)
return scoped_refptr<SiteInstance>(current_site_instance);
+ if (GetContentClient()->browser()->CanUseCustomSiteInstance()) {
// If the navigation can swap SiteInstances, compute the SiteInstance it
// should use.
@@ -2145,10 +2155,61 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
//
// TODO(clamy): We should also consider as a candidate SiteInstance the
// speculative SiteInstance that was computed on redirects.
- SiteInstanceImpl* candidate_site_instance =
+ candidate_site_instance =
speculative_render_frame_host_
? speculative_render_frame_host_->GetSiteInstance()
: nullptr;
- speculative_render_frame_host_
- ? speculative_render_frame_host_->GetSiteInstance()
- : nullptr;
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance() &&
+ frame_tree_node_->IsMainFrame()) {
+ BrowserContext* browser_context =
+ delegate_->GetControllerForRenderManager().GetBrowserContext();
+ bool has_navigation_started = request->state() != NavigationRequest::NOT_STARTED;
+ bool has_response_started =
+ (request->state() == NavigationRequest::RESPONSE_STARTED ||
+ request->state() == NavigationRequest::FAILED) &&
+ !speculative_render_frame_host_;
+ // Gives user a chance to choose a custom site instance.
+ SiteInstance* affinity_site_instance = nullptr;
+ scoped_refptr<SiteInstance> overriden_site_instance;
+ bool should_register_site_instance = false;
+ ContentBrowserClient::SiteInstanceForNavigationType siteInstanceType =
+ GetContentClient()->browser()->ShouldOverrideSiteInstanceForNavigation(
+ current_frame_host(), speculative_frame_host(), browser_context,
+ request->common_params().url, has_navigation_started,
+ has_response_started, &affinity_site_instance);
+ switch (siteInstanceType) {
+ case ContentBrowserClient::SiteInstanceForNavigationType::
+ FORCE_CANDIDATE_OR_NEW:
+ overriden_site_instance =
+ candidate_site_instance
+ ? candidate_site_instance
+ : current_site_instance->CreateRelatedSiteInstance(
+ request->common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_NEW:
+ overriden_site_instance = current_site_instance->CreateRelatedSiteInstance(
+ request->common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
+ overriden_site_instance = render_frame_host_->GetSiteInstance();
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_AFFINITY:
+ DCHECK(affinity_site_instance);
+ overriden_site_instance =
+ scoped_refptr<SiteInstance>(affinity_site_instance);
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::ASK_CHROMIUM:
+ DCHECK(!affinity_site_instance);
+ break;
+ default:
+ break;
+ }
+ if (overriden_site_instance) {
+ if (should_register_site_instance) {
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
+ render_frame_host_.get(), overriden_site_instance.get());
+ }
+ return overriden_site_instance;
+ }
+ }
scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation(
request->common_params().url, request->source_site_instance(),
- request->dest_site_instance(), candidate_site_instance,
+ request->dest_site_instance(), candidate_site_instance.get(),
request->common_params().transition,
request->state() == NavigationRequest::FAILED,
request->common_params().url, request->GetSourceSiteInstance(),
@@ -2158,6 +2219,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->GetRestoreType() != RestoreType::NONE, request->is_view_source(),
was_server_redirect);
request->WasServerRedirect());
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
+ render_frame_host_.get(), dest_site_instance.get());
@@ -159,10 +139,10 @@ index b1be27659d80a3199242d43ec80ccd28a43059b1..f475ec2301011a0840e76dd0e8e40bf6
}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 2cee6bf52088a378a7c53343864d27aa78bdc106..4aca3c9724f8192a4f6e70e38473b408cadc6675 100644
index ea72b3a9d57383a47c91795c11bd0b8fc2b92e55..2adb671d8c36ad22814b75c4be61fb3925dd2258 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -368,6 +368,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
@@ -360,6 +360,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
return browsing_instance_->HasSiteInstance(url);
}
@@ -174,10 +154,10 @@ index 2cee6bf52088a378a7c53343864d27aa78bdc106..4aca3c9724f8192a4f6e70e38473b408
const GURL& url) {
return browsing_instance_->GetSiteInstanceForURL(
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index 1edb9fd6b0c383f291735dd1a952fcb7b17cc87f..23967f040eb346be265faa2a92562e1fed190b8d 100644
index 9fc7e1710f3038e82d7fac6c3fb608cd3a7071ba..ad1e884811e8f7de4dea43f9b754d578e62b4d92 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -83,6 +83,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
@@ -84,6 +84,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
BrowserContext* GetBrowserContext() override;
const GURL& GetSiteURL() override;
scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override;
@@ -186,10 +166,10 @@ index 1edb9fd6b0c383f291735dd1a952fcb7b17cc87f..23967f040eb346be265faa2a92562e1f
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 da7eca5f443e2ecdcb3f0819848735aafeb43a00..ee14a76bf705c41082c78f7f0fcce968acf3a3b7 100644
index 3fdc443b408c3d8f7ffdabf6b010d5fc1ecd22d5..0d0d0f8f90fd830882558b3358d4a168fe5746b7 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -44,6 +44,21 @@
@@ -49,6 +49,21 @@
namespace content {
@@ -212,10 +192,10 @@ index da7eca5f443e2ecdcb3f0819848735aafeb43a00..ee14a76bf705c41082c78f7f0fcce968
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 07fa16953d6167a5a381b28a5da3c08a78de4306..fe6864b5ba4c77a6694510db2f1add479241b156 100644
index 891b69d65de0e47719af23eb7047d22d10417019..425e7ab657a2de0ff11e6989a0dc34e11f883999 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -205,8 +205,45 @@ struct WebPreferences;
@@ -215,8 +215,45 @@ struct WebPreferences;
// the observer interfaces.)
class CONTENT_EXPORT ContentBrowserClient {
public:

View File

@@ -22,10 +22,10 @@ index 5f8aea7105a188846fd48d199bb4e0ca2017a0ab..2514f591208372d6654ff9c5be50a51a
g_reference_table = reference_table;
}
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 413e6c5bcc74cd01730c5d4dc66eb92aaf7df8de..6c5d101fef97e880bee20d2f76e4b339a624eb6f 100644
index f23af2d9738f3aa76e3a49301e1c3216ee4a64b4..ede178acabc63c3c33d6ce93efd5632bec50ba89 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -91,7 +91,8 @@ class GIN_EXPORT IsolateHolder {
@@ -88,7 +88,8 @@ class GIN_EXPORT IsolateHolder {
// reference pointers. Otherwise, it can be nullptr.
static void Initialize(ScriptMode mode,
v8::ArrayBuffer::Allocator* allocator,
@@ -36,10 +36,10 @@ index 413e6c5bcc74cd01730c5d4dc66eb92aaf7df8de..6c5d101fef97e880bee20d2f76e4b339
v8::Isolate* isolate() { return isolate_; }
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index aab46a000c5e9081440298ecef4844ead7a40b28..2cee8dee3f70148570613dc17827da19b193ff62 100644
index 9298a9c75540d40133a8fc58c128aea521f3a37c..9474b26eba6d9c41162a197e11d6a871a2dd0259 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -204,12 +204,14 @@ enum LoadV8FileResult {
@@ -190,12 +190,14 @@ enum LoadV8FileResult {
} // namespace
// static
@@ -57,7 +57,7 @@ index aab46a000c5e9081440298ecef4844ead7a40b28..2cee8dee3f70148570613dc17827da19
if (!base::FeatureList::IsEnabled(features::kV8OptimizeJavascript)) {
// We avoid explicitly passing --opt if kV8OptimizeJavascript is enabled
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
index aa3863abe0ea71fc26222564425f54ff80077719..fbf84c00174cc081d71aff8a16d51d2211614ec7 100644
index 2918c6235688ee4eb7c43387296e6d24145c14aa..069c2c96d5067f0444dac3c6ce6d83f75e770129 100644
--- a/gin/v8_initializer.h
+++ b/gin/v8_initializer.h
@@ -20,7 +20,8 @@ namespace gin {

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 b/tools/gritsettings/resource_ids
index be4d09028b1232594f90159fa11f67708a55afe8..9a3ae55c11a37ce00c19b63d882afd8c4548a6d9 100644
index 99f5bdd4665b865b5bc559644b7b5a268f9bfb20..899d72e6f0802e31c4ae70f3e0a19880b2557e8f 100644
--- a/tools/gritsettings/resource_ids
+++ b/tools/gritsettings/resource_ids
@@ -457,6 +457,11 @@
@@ -466,6 +466,11 @@
"includes": [28880],
},

View File

@@ -6,20 +6,19 @@ Subject: ignore_rc_check.patch
Dont compare RC.exe and RC.py output.
FIXME: It has to be reverted once the script is fixed.
diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py
index 3834cf2c01a9c63bfe7a6fc9e7549930a5eda01c..454b831a37c13fdd2fe4d8953d60dab661386f9a 100644
--- a/build/toolchain/win/tool_wrapper.py
+++ b/build/toolchain/win/tool_wrapper.py
@@ -250,7 +250,11 @@ class WinTool(object):
if rc_exe_exit_code == 0:
import filecmp
# Strip "/fo" prefix.
- assert filecmp.cmp(rc_res_output[3:], rcpy_res_output[3:])
+ # ------
+ # Temporarily ignore compares
+ # Nightly builds use very large version numbers that fail this check
+ # FIXME(zacwalk): Enable the assert.
+ # assert filecmp.cmp(rc_res_output[3:], rcpy_res_output[3:])
return rc_exe_exit_code
diff --git a/build/toolchain/win/rc/rc.py b/build/toolchain/win/rc/rc.py
index 5c0442bef19334004647bf6e5dcbabcf399f2ec6..05fb71a1a18d35d361cac8eddece95b665f74ed8 100755
--- a/build/toolchain/win/rc/rc.py
+++ b/build/toolchain/win/rc/rc.py
@@ -234,7 +234,10 @@ def CompareToMsRcOutput(preprocessed_output, is_utf8, flags):
# Assert Microsoft rc.exe and rc.py produced identical .res files.
if rc_exe_exit_code == 0:
import filecmp
- assert filecmp.cmp(msrc_out, flags.output)
+ # Temporarily ignore compares
+ # Nightly builds use very large version numbers that fail this check
+ # FIXME(zacwalk): Enable the assert.
+ # assert filecmp.cmp(msrc_out, flags.output)
return rc_exe_exit_code
def ExecActionWrapper(self, arch, rspfile, *dirname):

View File

@@ -35,7 +35,7 @@ index 2514f591208372d6654ff9c5be50a51a39a881cb..4dd48f6a871cccb374c58adacb8ad9a8
new PerIsolateData(isolate_, allocator, access_mode_, task_runner));
if (isolate_creation_mode == IsolateCreationMode::kCreateSnapshot) {
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 6c5d101fef97e880bee20d2f76e4b339a624eb6f..576086de0de0a6fea9e2f2077af3aff18fd3138a 100644
index ede178acabc63c3c33d6ce93efd5632bec50ba89..ffe7331cf1806417a32e66970f81b7797b9b80fc 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -75,7 +75,8 @@ class GIN_EXPORT IsolateHolder {

View File

@@ -6,103 +6,46 @@ Subject: libgtkui_export.patch
Export libgtkui symbols for the GN component build.
diff --git a/chrome/browser/ui/libgtkui/gtk_util.h b/chrome/browser/ui/libgtkui/gtk_util.h
index e0ab34ca088e65b97ea6ce19c765e514acda760f..8c742d93ffabbd9795f9ba021b23c972e66eaec3 100644
index c9712cd531c0e2114103bdf3f4cba3320b75c331..7fd8d177cec78e733c765097dcc0b9a65ed350ee 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.h
+++ b/chrome/browser/ui/libgtkui/gtk_util.h
@@ -11,6 +11,7 @@
@@ -8,6 +8,7 @@
#include <gtk/gtk.h>
#include <string>
+#include "base/component_export.h"
#include "ui/base/glib/scoped_gobject.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/window/frame_buttons.h"
+#include "chrome/browser/ui/libgtkui/libgtkui_export.h"
typedef union _GdkEvent GdkEvent;
@@ -36,10 +37,10 @@ namespace libgtkui {
@@ -34,11 +35,11 @@ namespace libgtkui {
extern const color_utils::HSL kDefaultTintFrameIncognito;
-void GtkInitFromCommandLine(const base::CommandLine& command_line);
+LIBGTKUI_EXPORT void GtkInitFromCommandLine(const base::CommandLine& command_line);
// Returns the name of the ".desktop" file associated with our running process.
-std::string GetDesktopName(base::Environment* env);
+LIBGTKUI_EXPORT std::string GetDesktopName(base::Environment* env);
GdkModifierType GetGdkModifierForAccelerator(
const ui::Accelerator& accelerator);
@@ -52,7 +53,7 @@ void TurnButtonBlue(GtkWidget* button);
+COMPONENT_EXPORT(LIBGTKUI) void GtkInitFromCommandLine(const base::CommandLine& command_line);
// Sets |dialog| as transient for |parent|, which will keep it on top and center
// it above |parent|. Do nothing if |parent| is nullptr.
-void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent);
+LIBGTKUI_EXPORT void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent);
+COMPONENT_EXPORT(LIBGTKUI) void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent);
// Gets the transient parent aura window for |dialog|.
aura::Window* GetAuraTransientParent(GtkWidget* dialog);
@@ -158,7 +159,7 @@ void ApplyCssToContext(GtkStyleContext* context, const std::string& css);
@@ -143,7 +144,7 @@ void ApplyCssToContext(GtkStyleContext* context, const std::string& css);
// Get the 'color' property from the style context created by
// GetStyleContextFromCss(|css_selector|).
-SkColor GetFgColor(const std::string& css_selector);
+LIBGTKUI_EXPORT SkColor GetFgColor(const std::string& css_selector);
+COMPONENT_EXPORT(LIBGTKUI) SkColor GetFgColor(const std::string& css_selector);
ScopedCssProvider GetCssProvider(const std::string& css);
@@ -171,7 +172,7 @@ void RenderBackground(const gfx::Size& size,
@@ -156,7 +157,7 @@ void RenderBackground(const gfx::Size& size,
// Renders a background from the style context created by
// GetStyleContextFromCss(|css_selector|) into a 24x24 bitmap and
// returns the average color.
-SkColor GetBgColor(const std::string& css_selector);
+LIBGTKUI_EXPORT SkColor GetBgColor(const std::string& css_selector);
+COMPONENT_EXPORT(LIBGTKUI) SkColor GetBgColor(const std::string& css_selector);
// Renders the border from the style context created by
// GetStyleContextFromCss(|css_selector|) into a 24x24 bitmap and
diff --git a/chrome/browser/ui/libgtkui/skia_utils_gtk.h b/chrome/browser/ui/libgtkui/skia_utils_gtk.h
index bd6ed68a11b0b6c08962f688c799bd0f6b8a8d0e..b1184475e0ab9f381dc3c78b1092e2e0ec59d60b 100644
--- a/chrome/browser/ui/libgtkui/skia_utils_gtk.h
+++ b/chrome/browser/ui/libgtkui/skia_utils_gtk.h
@@ -8,6 +8,7 @@
#include <gtk/gtk.h>
#include <stdint.h>
+#include "chrome/browser/ui/libgtkui/libgtkui_export.h"
#include "third_party/skia/include/core/SkColor.h"
#if !GTK_CHECK_VERSION(3, 90, 0)
@@ -48,7 +49,7 @@ const SkBitmap GdkPixbufToImageSkia(GdkPixbuf* pixbuf);
// Convert and copy a SkBitmap to a GdkPixbuf. NOTE: this uses BGRAToRGBA, so
// it is an expensive operation. The returned GdkPixbuf will have a refcount of
// 1, and the caller is responsible for unrefing it when done.
-GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
+LIBGTKUI_EXPORT GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap& bitmap);
} // namespace libgtkui
diff --git a/chrome/browser/ui/libgtkui/unity_service.h b/chrome/browser/ui/libgtkui/unity_service.h
index 8d67e1460837c7f8adb151adea131cc6440659a3..95fbb27b6a81e4d73d239e94f5105078a936b5af 100644
--- a/chrome/browser/ui/libgtkui/unity_service.h
+++ b/chrome/browser/ui/libgtkui/unity_service.h
@@ -5,18 +5,20 @@
#ifndef CHROME_BROWSER_UI_LIBGTKUI_UNITY_SERVICE_H_
#define CHROME_BROWSER_UI_LIBGTKUI_UNITY_SERVICE_H_
+#include "chrome/browser/ui/libgtkui/libgtkui_export.h"
+
namespace unity {
// Returns whether unity is currently running.
-bool IsRunning();
+LIBGTKUI_EXPORT bool IsRunning();
// If unity is running, sets the download counter in the dock icon. Any value
// other than 0 displays the badge.
-void SetDownloadCount(int count);
+LIBGTKUI_EXPORT void SetDownloadCount(int count);
// If unity is running, sets the download progress bar in the dock icon. Any
// value between 0.0 and 1.0 (exclusive) shows the progress bar.
-void SetProgressFraction(float percentage);
+LIBGTKUI_EXPORT void SetProgressFraction(float percentage);
} // namespace unity

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 85545ec7eaa6494fe542ee14e6f3e29ffa7d693e..bf352f9a6f087c28b6ce207bd0e5c09753ffb9cf 100644
index 95675ad6ddf61e3809833894f0962908d12be4ff..8cd379bb3d10e88c95902896684d443366c759c4 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -108,7 +108,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
display.set_color_depth(NSBitsPerPixelFromDepth([screen depth]));
display.set_depth_per_component(NSBitsPerSampleFromDepth([screen depth]));
@@ -116,7 +116,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
display.set_depth_per_component(Display::kHDR10BitsPerComponent);
}
}
+#ifdef MAS_BUILD
+ // This is equivalent to the CGDisplayUsesForceToGray() API as at 2018-08-06,
+ // but avoids usage of the private API.

View File

@@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Thu, 20 Sep 2018 17:49:34 -0700
Subject: mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
Removes usage of the _LSSetApplicationLaunchServicesServerConnectionStatus
private API.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index d257830f5943937a634aa85539ad654310579e2c..4373f508964cb1e9fd51c952122ac2f41fb35ae9 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -286,8 +286,10 @@ int GpuMain(const MainFunctionParams& parameters) {
std::make_unique<base::SingleThreadTaskExecutor>(
base::MessagePumpType::NS_RUNLOOP);
+#ifndef MAS_BUILD
// Tell LaunchServices to continue without a connection to the daemon.
_LSSetApplicationLaunchServicesServerConnectionStatus(0, nullptr);
+#endif
#else
main_thread_task_executor =
std::make_unique<base::SingleThreadTaskExecutor>(

View File

@@ -73,7 +73,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d
} // namespace blink
diff --git a/third_party/blink/renderer/core/paint/theme_painter_mac.mm b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
index e94235acb17335fbc78c606ff26036871117bd09..7c4bd19215c67f649636ae69b9a21b5c1ba21ecc 100644
index 8f4ae94bc1d8188d041654c50511f3346eee79de..fa06f47abbff3dcda937bf0b794f616e4818cd30 100644
--- a/third_party/blink/renderer/core/paint/theme_painter_mac.mm
+++ b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
@@ -41,6 +41,7 @@
@@ -92,7 +92,7 @@ index e94235acb17335fbc78c606ff26036871117bd09..7c4bd19215c67f649636ae69b9a21b5c
namespace blink {
@@ -72,10 +74,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
@@ -95,10 +97,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
// behavior change while remaining a fragile solution.
// https://bugs.chromium.org/p/chromium/issues/detail?id=658085#c3
if (!use_ns_text_field_cell) {
@@ -105,9 +105,9 @@ index e94235acb17335fbc78c606ff26036871117bd09..7c4bd19215c67f649636ae69b9a21b5c
return false;
}
@@ -161,10 +165,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
const PaintInfo& paint_info,
@@ -186,10 +190,12 @@ void _NSDrawCarbonThemeListBox(NSRect frame,
const IntRect& r) {
ScopedColorSchemeAppearance appearance(style.UsedColorScheme());
LocalCurrentGraphicsContext local_context(paint_info.context, r);
+#ifndef MAS_BUILD
_NSDrawCarbonThemeListBox(

View File

@@ -50,10 +50,26 @@ index 743d1364bcd13e24ecbe5ced730161d15b8c3e93..a5529ac8841b79f230f0fa8eae2b3cb2
// 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 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be868742069dafc72 100644
index 2851641d0219164185567a100c2c19d49274c233..778da01c7eaf11ef954e213a5a6ecb5e53f3eb42 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -229,6 +229,7 @@
@@ -207,6 +207,7 @@
NSString* const NSAccessibilityLengthForTextMarkerRangeParameterizedAttribute =
@"AXLengthForTextMarkerRange";
+#ifndef MAS_BUILD
// Private attributes that can be used for testing text markers, e.g. in dump
// tree tests.
NSString* const
@@ -218,6 +219,7 @@
NSString* const
NSAccessibilityTextMarkerNodeDebugDescriptionParameterizedAttribute =
@"AXTextMarkerNodeDebugDescription";
+#endif
// Other private attributes.
NSString* const NSAccessibilitySelectTextWithCriteriaParameterizedAttribute =
@@ -241,6 +243,7 @@
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
const int kAXResultsLimitNoLimit = -1;
@@ -61,7 +77,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
extern "C" {
// The following are private accessibility APIs required for cursor navigation
@@ -468,6 +469,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range,
@@ -480,6 +483,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range,
AddMisspelledTextAttributes(ax_range, attributed_text);
return attributed_text;
}
@@ -69,7 +85,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
// Returns an autoreleased copy of the AXNodeData's attribute.
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
@@ -735,7 +737,9 @@ + (void)initialize {
@@ -748,7 +752,9 @@ + (void)initialize {
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
{NSAccessibilityEnabledAttribute, @"enabled"},
@@ -79,7 +95,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
{NSAccessibilityExpandedAttribute, @"expanded"},
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
{NSAccessibilityFocusedAttribute, @"focused"},
@@ -747,8 +751,10 @@ + (void)initialize {
@@ -760,8 +766,10 @@ + (void)initialize {
{NSAccessibilityHighestEditableAncestorAttribute,
@"highestEditableAncestor"},
{NSAccessibilityIndexAttribute, @"index"},
@@ -90,7 +106,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
{NSAccessibilityInvalidAttribute, @"invalid"},
{NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
{NSAccessibilityLanguageAttribute, @"language"},
@@ -770,13 +776,17 @@ + (void)initialize {
@@ -783,13 +791,17 @@ + (void)initialize {
{NSAccessibilityRowsAttribute, @"rows"},
// TODO(aboxhall): expose
// NSAccessibilityServesAsTitleForUIElementsAttribute
@@ -108,7 +124,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
{NSAccessibilitySizeAttribute, @"size"},
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
{NSAccessibilitySubroleAttribute, @"subrole"},
@@ -1272,6 +1282,7 @@ - (NSNumber*)enabled {
@@ -1285,6 +1297,7 @@ - (NSNumber*)enabled {
ax::mojom::Restriction::kDisabled];
}
@@ -116,7 +132,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
// Returns a text marker that points to the last character in the document that
// can be selected with VoiceOver.
- (id)endTextMarker {
@@ -1282,6 +1293,7 @@ - (id)endTextMarker {
@@ -1295,6 +1308,7 @@ - (id)endTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
}
@@ -124,7 +140,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
- (NSNumber*)expanded {
if (![self instanceActive])
@@ -1427,6 +1439,8 @@ - (NSNumber*)index {
@@ -1440,6 +1454,8 @@ - (NSNumber*)index {
return nil;
}
@@ -133,7 +149,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
- (NSNumber*)insertionPointLineNumber {
if (![self instanceActive])
return nil;
@@ -1449,6 +1463,7 @@ - (NSNumber*)insertionPointLineNumber {
@@ -1462,6 +1478,7 @@ - (NSNumber*)insertionPointLineNumber {
caretPosition->AsTextPosition()->text_offset());
return @(std::distance(lineBreaks.begin(), iterator));
}
@@ -141,7 +157,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
// Returns whether or not this node should be ignored in the
// accessibility tree.
@@ -2134,6 +2149,7 @@ - (NSArray*)selectedChildren {
@@ -2147,6 +2164,7 @@ - (NSArray*)selectedChildren {
return ret;
}
@@ -149,7 +165,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
- (NSString*)selectedText {
if (![self instanceActive])
return nil;
@@ -2145,11 +2161,13 @@ - (NSString*)selectedText {
@@ -2158,11 +2176,13 @@ - (NSString*)selectedText {
return nil;
return base::SysUTF16ToNSString(range.GetText());
}
@@ -163,7 +179,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
- (NSValue*)selectedTextRange {
if (![self instanceActive])
return nil;
@@ -2170,12 +2188,15 @@ - (NSValue*)selectedTextRange {
@@ -2183,12 +2203,15 @@ - (NSValue*)selectedTextRange {
int selLength = range.GetText().length();
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
}
@@ -179,7 +195,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
- (NSValue*)size {
if (![self instanceActive])
@@ -2208,6 +2229,7 @@ - (NSString*)sortDirection {
@@ -2221,6 +2244,7 @@ - (NSString*)sortDirection {
return nil;
}
@@ -187,7 +203,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
// Returns a text marker that points to the first character in the document that
// can be selected with VoiceOver.
- (id)startTextMarker {
@@ -2218,6 +2240,7 @@ - (id)startTextMarker {
@@ -2231,6 +2255,7 @@ - (id)startTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
}
@@ -195,7 +211,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
// Returns a subrole based upon the role.
- (NSString*)subrole {
@@ -2509,11 +2532,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
@@ -2522,11 +2547,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
NSMutableAttributedString* attributedValue =
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
@@ -209,7 +225,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
return [attributedValue attributedSubstringFromRange:range];
}
@@ -2616,9 +2641,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
@@ -2629,9 +2656,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return ToBrowserAccessibilityCocoa(cell);
}
@@ -221,7 +237,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
BrowserAccessibilityPositionInstance position =
CreatePositionFromTextMarker(parameter);
if (!position->IsNullPosition())
@@ -2929,6 +2953,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -2942,6 +2968,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return CreateTextMarker(root->CreatePositionAt(index));
}
@@ -229,7 +245,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
if ([attribute isEqualToString:
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -2962,6 +2987,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -2975,6 +3002,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return nil;
}
@@ -237,7 +253,7 @@ index 5bdcea914780468d93b55b2e89dc3628a683f85c..0358f557432590ed48f9cd9be8687420
if ([attribute
isEqualToString:
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
@@ -3042,6 +3068,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
@@ -3081,6 +3109,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
return @(child->GetIndexInParent());
}

View File

@@ -5,10 +5,10 @@ Subject: network_service_allow_remote_certificate_verification_logic.patch
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 647fd0d633e868c5f06bbb97f03333e863075f06..b9a8a12b8abb386fec548a26e4686af2e3822b8c 100644
index a7598ca37cdd671cbafb5b69efe5d8c2932e7cd3..144714a3a1e63bb891b86cba12a27de50be7f976 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -90,6 +90,11 @@
@@ -91,6 +91,11 @@
#include "services/network/url_loader.h"
#include "services/network/url_request_context_builder_mojo.h"
@@ -20,7 +20,7 @@ index 647fd0d633e868c5f06bbb97f03333e863075f06..b9a8a12b8abb386fec548a26e4686af2
#if BUILDFLAG(IS_CT_SUPPORTED)
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
@@ -319,6 +324,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
@@ -325,6 +330,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
} // namespace
@@ -100,7 +100,7 @@ index 647fd0d633e868c5f06bbb97f03333e863075f06..b9a8a12b8abb386fec548a26e4686af2
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
@@ -474,6 +552,13 @@ void NetworkContext::SetClient(
@@ -477,6 +555,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -112,21 +112,40 @@ index 647fd0d633e868c5f06bbb97f03333e863075f06..b9a8a12b8abb386fec548a26e4686af2
+}
+
void NetworkContext::CreateURLLoaderFactory(
mojom::URLLoaderFactoryRequest request,
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -1552,12 +1637,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
net::SystemTrustStoreProvider::CreateDefaultForSSL())));
@@ -1545,6 +1630,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
base::CommandLine::ForCurrentProcess();
std::unique_ptr<net::CertVerifier> cert_verifier;
+ std::unique_ptr<net::CertVerifier> temp_verifier;
if (g_cert_verifier_for_testing) {
cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
} else {
@@ -1592,8 +1678,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
}
#endif
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
- if (!cert_verifier) {
- cert_verifier = std::make_unique<net::CachingCertVerifier>(
+ if (!temp_verifier) {
+ temp_verifier = std::make_unique<net::CachingCertVerifier>(
std::make_unique<net::CoalescingCertVerifier>(
std::make_unique<net::MultiThreadedCertVerifier>(
params_->use_builtin_cert_verifier
@@ -1603,12 +1689,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
cert_net_fetcher_))));
}
#endif
- if (!cert_verifier)
- cert_verifier = net::CertVerifier::CreateDefault(cert_net_fetcher_);
+ if (!cert_verifier) {
+ auto mt_verifier = std::make_unique<net::MultiThreadedCertVerifier>(
+ net::CertVerifyProc::CreateDefault(std::move(cert_net_fetcher_)));
+ auto remote_cert_verifier = std::make_unique<RemoteCertVerifier>(std::move(mt_verifier));
+ remote_cert_verifier_ = remote_cert_verifier.get();
+ cert_verifier = std::make_unique<net::CachingCertVerifier>(std::move(remote_cert_verifier));
+ if (!temp_verifier) {
+ temp_verifier = std::make_unique<net::MultiThreadedCertVerifier>(
+ net::CertVerifyProc::CreateSystemVerifyProc(std::move(cert_net_fetcher_)));
+ }
+ auto remote_cert_verifier = std::make_unique<RemoteCertVerifier>(std::move(temp_verifier));
+ remote_cert_verifier_ = remote_cert_verifier.get();
+ cert_verifier = std::make_unique<net::CachingCertVerifier>(std::move(remote_cert_verifier));
}
- builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
@@ -139,10 +158,10 @@ index 647fd0d633e868c5f06bbb97f03333e863075f06..b9a8a12b8abb386fec548a26e4686af2
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 98c968120b4ccedcdf321a365db038954095ae7a..e98063a71435ee8828f3b5a21b569325965f7c58 100644
index 696144daa4165c33287c8d982dbcbe861871302e..f0a41d64804eab8195c389b457f6c0119d24a783 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -81,6 +81,7 @@ class DomainReliabilityMonitor;
@@ -84,6 +84,7 @@ class DomainReliabilityMonitor;
namespace network {
class CertVerifierWithTrustAnchors;
@@ -150,16 +169,16 @@ index 98c968120b4ccedcdf321a365db038954095ae7a..e98063a71435ee8828f3b5a21b569325
class CookieManager;
class ExpectCTReporter;
class HostResolver;
@@ -170,6 +171,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
// mojom::NetworkContext implementation:
void SetClient(
mojo::PendingRemote<mojom::NetworkContextClient> client) override;
@@ -176,6 +177,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) override;
+ void SetCertVerifierClient(
+ mojo::PendingRemote<mojom::CertVerifierClient> client) override;
void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request,
mojom::URLLoaderFactoryParamsPtr params) override;
void ResetURLLoaderFactories() override;
@@ -564,6 +567,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void GetCookieManager(
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
@@ -586,6 +589,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
#endif
@@ -169,11 +188,11 @@ index 98c968120b4ccedcdf321a365db038954095ae7a..e98063a71435ee8828f3b5a21b569325
// CertNetFetcher is not used by the current platform.
scoped_refptr<net::CertNetFetcherImpl> cert_net_fetcher_;
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 322670fb32403266f25c9f49079a25ef90dc01e2..4691fde53fd7d6ff6e89c55a7fec88d77b39701c 100644
index 8628bc8e055bf483c39b745bb63371f1e363817a..88e78f46415d7a416534e88c13bb45b26cc856f3 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -168,6 +168,17 @@ interface TrustedURLLoaderHeaderClient {
pending_receiver<TrustedHeaderClient> header_client);
@@ -181,6 +181,17 @@ interface TrustedURLLoaderHeaderClient {
pending_receiver<TrustedHeaderClient> header_client);
};
+interface CertVerifierClient {
@@ -190,7 +209,7 @@ index 322670fb32403266f25c9f49079a25ef90dc01e2..4691fde53fd7d6ff6e89c55a7fec88d7
// Parameters for constructing a network context.
struct NetworkContextParams {
// Name used by memory tools to identify the context.
@@ -740,6 +751,9 @@ interface NetworkContext {
@@ -760,6 +771,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);
@@ -198,5 +217,5 @@ index 322670fb32403266f25c9f49079a25ef90dc01e2..4691fde53fd7d6ff6e89c55a7fec88d7
+ SetCertVerifierClient(pending_remote<CertVerifierClient>? client);
+
// Creates a new URLLoaderFactory with the given |params|.
CreateURLLoaderFactory(URLLoaderFactory& url_loader_factory,
CreateURLLoaderFactory(pending_receiver<URLLoaderFactory> url_loader_factory,
URLLoaderFactoryParams params);

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