mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
201 Commits
roller/chr
...
v10.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34a246e3ce | ||
|
|
0dea6fa7f0 | ||
|
|
61dc1c88fd | ||
|
|
c63327f9b2 | ||
|
|
615dce3275 | ||
|
|
4ea6af64a7 | ||
|
|
66b6789c50 | ||
|
|
749b134e09 | ||
|
|
1c3ebfdc30 | ||
|
|
2206330795 | ||
|
|
10de79126a | ||
|
|
a42fa5158f | ||
|
|
f2c6053111 | ||
|
|
34a321f46b | ||
|
|
deb78453c0 | ||
|
|
d73b67f386 | ||
|
|
0b834877fe | ||
|
|
4df5ecdf82 | ||
|
|
a980ad5645 | ||
|
|
7cc0cb4331 | ||
|
|
414aa3111b | ||
|
|
5753370c8d | ||
|
|
606919f701 | ||
|
|
1861392561 | ||
|
|
e492b88f9f | ||
|
|
da5eac885d | ||
|
|
44ecd34289 | ||
|
|
c5b5ca50a6 | ||
|
|
4b7b3dc4f2 | ||
|
|
4a43487b39 | ||
|
|
a799860d7e | ||
|
|
93727d6a11 | ||
|
|
207fbecddf | ||
|
|
588ae53970 | ||
|
|
8a8fe090ae | ||
|
|
711bab1950 | ||
|
|
50046f8df6 | ||
|
|
9193d35769 | ||
|
|
8191a8418f | ||
|
|
f4600bdfdf | ||
|
|
7fd8e6a14e | ||
|
|
a1abe6b64c | ||
|
|
a6f22059af | ||
|
|
3089bf939f | ||
|
|
180204887a | ||
|
|
af59f68281 | ||
|
|
e9c9a6f177 | ||
|
|
6582017231 | ||
|
|
4e82a50883 | ||
|
|
7079304a6c | ||
|
|
8fb28051a4 | ||
|
|
72901f9d91 | ||
|
|
838e00a523 | ||
|
|
596136ae99 | ||
|
|
8e1daa4449 | ||
|
|
5c19e983f9 | ||
|
|
cf5be544b6 | ||
|
|
28a9fb8ea2 | ||
|
|
cf935eb81b | ||
|
|
f47f8df7f9 | ||
|
|
d77f4f62fd | ||
|
|
276d17a063 | ||
|
|
f6ddfd70b3 | ||
|
|
04f652a53b | ||
|
|
04c5f4acac | ||
|
|
ca15aa70d6 | ||
|
|
96bc80ace7 | ||
|
|
e3cf1ab030 | ||
|
|
04e3a95b85 | ||
|
|
58045d85c8 | ||
|
|
08fc9dfc40 | ||
|
|
5fb3e0359d | ||
|
|
325444e1c8 | ||
|
|
bc4884788c | ||
|
|
0a766acc73 | ||
|
|
578aef4714 | ||
|
|
c9c89f9c8e | ||
|
|
9d90a994cf | ||
|
|
3cfdc086bb | ||
|
|
6c04533fca | ||
|
|
99f1d7e57a | ||
|
|
009105db4f | ||
|
|
b2f09a1469 | ||
|
|
74212577e5 | ||
|
|
8da4e299c6 | ||
|
|
b2ffded4a9 | ||
|
|
039a8ab49b | ||
|
|
1b4b4fddaa | ||
|
|
fdde45379e | ||
|
|
9462e9a3ed | ||
|
|
d08e31c6b4 | ||
|
|
b2449f3ce1 | ||
|
|
683c0c0491 | ||
|
|
91a6399c22 | ||
|
|
799a04a4c0 | ||
|
|
82092471e4 | ||
|
|
39a931968c | ||
|
|
bd7f6a9090 | ||
|
|
2d747acd67 | ||
|
|
8371e83a9d | ||
|
|
22c804a4ad | ||
|
|
5481ddf9df | ||
|
|
4c596ab969 | ||
|
|
328c5c7b46 | ||
|
|
5b8d4240d6 | ||
|
|
d52412dea7 | ||
|
|
39edbd6af4 | ||
|
|
30db185060 | ||
|
|
c804212426 | ||
|
|
7a5b18b0d6 | ||
|
|
d608a30015 | ||
|
|
74efe8d834 | ||
|
|
3283211a15 | ||
|
|
d4a6affa4b | ||
|
|
73e13ab6d6 | ||
|
|
c32c69604a | ||
|
|
2761be6467 | ||
|
|
30cb2b134b | ||
|
|
48cd3eeced | ||
|
|
831b6fa227 | ||
|
|
91ce51cfb3 | ||
|
|
bf1870facc | ||
|
|
39bc7c82a6 | ||
|
|
991d982622 | ||
|
|
195662ead0 | ||
|
|
d580cc1578 | ||
|
|
d8de43f534 | ||
|
|
c48a6b48c9 | ||
|
|
d701c292a0 | ||
|
|
19e7af9841 | ||
|
|
86e4a96f45 | ||
|
|
e059ae7bd6 | ||
|
|
fb292c26d5 | ||
|
|
0e0dd6460f | ||
|
|
b464589143 | ||
|
|
ee372c152a | ||
|
|
53bdc4a71b | ||
|
|
ab0960ecd9 | ||
|
|
29c9c80c89 | ||
|
|
72f2dad3a1 | ||
|
|
64cdfda810 | ||
|
|
9f8f82af00 | ||
|
|
306d76b317 | ||
|
|
097c501cf5 | ||
|
|
d4bc4e1d4c | ||
|
|
0c861dc83e | ||
|
|
57b766aa82 | ||
|
|
4b8295a24d | ||
|
|
710199c308 | ||
|
|
c2d9cde38f | ||
|
|
fbaca68bd0 | ||
|
|
ee9f95df30 | ||
|
|
9df936d941 | ||
|
|
baa2940488 | ||
|
|
25879ba929 | ||
|
|
34b04e5fbb | ||
|
|
710ac2a5a8 | ||
|
|
1f0d2594bd | ||
|
|
656d9e7490 | ||
|
|
5bf938f899 | ||
|
|
7759048136 | ||
|
|
321c1c1075 | ||
|
|
d69d1bbf20 | ||
|
|
f3dd997dbd | ||
|
|
faf7951439 | ||
|
|
3087492994 | ||
|
|
f7e4377ee8 | ||
|
|
ef288a6ae2 | ||
|
|
7797835f93 | ||
|
|
9572209e91 | ||
|
|
3602216e6c | ||
|
|
c29382b6d0 | ||
|
|
a8fc41d8b3 | ||
|
|
9ea42da40e | ||
|
|
87cd20b9e9 | ||
|
|
79acd3e0ef | ||
|
|
67be46986c | ||
|
|
d4001c1787 | ||
|
|
eeaad9c6ab | ||
|
|
cc0c7632ac | ||
|
|
12ea1c0c41 | ||
|
|
9d2aa93581 | ||
|
|
cee9e6f0d0 | ||
|
|
eb93acc463 | ||
|
|
241e74c098 | ||
|
|
c0183d15af | ||
|
|
4fe7c9ac24 | ||
|
|
50efa847a5 | ||
|
|
c2354d44ea | ||
|
|
7709e600c6 | ||
|
|
0962c1bd74 | ||
|
|
471f80521d | ||
|
|
1fb11e1e76 | ||
|
|
f8508b3c18 | ||
|
|
95e3853b77 | ||
|
|
9de5ede1fb | ||
|
|
05efbbcdd5 | ||
|
|
2789f32efb | ||
|
|
4c8b884998 | ||
|
|
03ddd2d7af | ||
|
|
c141b1a906 |
@@ -313,12 +313,15 @@ 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
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/AppleTVOS.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/iPhoneOS.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/WatchOS.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/WatchSimulator.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/AppleTVSimulator.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/iPhoneSimulator.platform
|
||||
sudo rm -rf ~/.rubies
|
||||
sudo rm -rf ~/Library/Caches/Homebrew
|
||||
sudo rm -rf /usr/local/Homebrew
|
||||
fi
|
||||
|
||||
# On macOS delete all .git directories under src/ expect for
|
||||
@@ -418,6 +421,7 @@ step-electron-build: &step-electron-build
|
||||
fi
|
||||
cd src
|
||||
ninja -C out/Default electron -j $NUMBER_OF_NINJA_PROCESSES
|
||||
node electron/script/check-symlinks.js
|
||||
|
||||
step-native-unittests-build: &step-native-unittests-build
|
||||
run:
|
||||
@@ -706,12 +710,11 @@ step-hunspell-store: &step-hunspell-store
|
||||
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
|
||||
run:
|
||||
name: Generate breakpad symbols
|
||||
no_output_timeout: 30m
|
||||
command: |
|
||||
if [ "$GENERATE_SYMBOLS" == "true" ]; then
|
||||
cd src
|
||||
ninja -C out/Default electron:electron_symbols
|
||||
cd out/Default/breakpad_symbols
|
||||
find . -name \*.sym -print0 | xargs -0 npx @sentry/cli@1.51.1 difutil bundle-sources
|
||||
fi
|
||||
|
||||
step-maybe-zip-symbols: &step-maybe-zip-symbols
|
||||
@@ -830,7 +833,7 @@ step-restore-out-cache: &step-restore-out-cache
|
||||
paths:
|
||||
- ./src/out/Default
|
||||
keys:
|
||||
- v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
- v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
name: Restoring out cache
|
||||
|
||||
step-set-git-cache-path: &step-set-git-cache-path
|
||||
@@ -854,7 +857,7 @@ step-save-out-cache: &step-save-out-cache
|
||||
save_cache:
|
||||
paths:
|
||||
- ./src/out/Default
|
||||
key: v7-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
key: v8-out-cache-{{ checksum "src/electron/.depshash" }}-{{ checksum "src/electron/.depshash-target" }}
|
||||
name: Persisting out cache
|
||||
|
||||
step-run-electron-only-hooks: &step-run-electron-only-hooks
|
||||
@@ -1041,8 +1044,8 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
|
||||
- *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-get-more-space-on-mac
|
||||
- *step-generate-deps-hash
|
||||
- *step-touch-sync-done
|
||||
- maybe-restore-portaled-src-cache
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
"BUILDFLAG": "readonly",
|
||||
"ENABLE_DESKTOP_CAPTURER": "readonly",
|
||||
"ENABLE_REMOTE_MODULE": "readonly",
|
||||
"ENABLE_VIEWS_API": "readonly"
|
||||
"ENABLE_VIEWS_API": "readonly",
|
||||
"BigInt": "readonly"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
||||
36
BUILD.gn
36
BUILD.gn
@@ -322,10 +322,10 @@ source_set("electron_lib") {
|
||||
"shell/common/api:mojo",
|
||||
"//base:base_static",
|
||||
"//base/allocator:buildflags",
|
||||
"//chrome/app:command_ids",
|
||||
"//chrome/app/resources:platform_locale_settings",
|
||||
"//chrome/services/printing/public/mojom",
|
||||
"//components/certificate_transparency",
|
||||
"//components/crash/core/app",
|
||||
"//components/language/core/browser",
|
||||
"//components/net_log",
|
||||
"//components/network_hints/browser",
|
||||
@@ -362,6 +362,7 @@ source_set("electron_lib") {
|
||||
"//services/viz/privileged/mojom/compositing",
|
||||
"//skia",
|
||||
"//third_party/blink/public:blink",
|
||||
"//third_party/blink/public:blink_devtools_inspector_resources",
|
||||
"//third_party/boringssl",
|
||||
"//third_party/electron_node:node_lib",
|
||||
"//third_party/inspector_protocol:crdtp",
|
||||
@@ -432,6 +433,9 @@ source_set("electron_lib") {
|
||||
"*\bviews/*",
|
||||
]
|
||||
}
|
||||
if (!is_mas_build) {
|
||||
deps += [ "//components/crash/core/app" ]
|
||||
}
|
||||
|
||||
set_sources_assignment_filter(
|
||||
sources_assignment_filter + extra_source_filters)
|
||||
@@ -457,10 +461,13 @@ source_set("electron_lib") {
|
||||
deps += [
|
||||
"//components/remote_cocoa/app_shim",
|
||||
"//content/common:mac_helpers",
|
||||
"//third_party/crashpad/crashpad/client",
|
||||
"//ui/accelerated_widget_mac",
|
||||
]
|
||||
|
||||
if (!is_mas_build) {
|
||||
deps += [ "//third_party/crashpad/crashpad/client" ]
|
||||
}
|
||||
|
||||
libs = [
|
||||
"AVFoundation.framework",
|
||||
"Carbon.framework",
|
||||
@@ -481,6 +488,12 @@ source_set("electron_lib") {
|
||||
sources += [ "shell/browser/api/electron_api_app_mas.mm" ]
|
||||
sources -= [ "shell/browser/auto_updater_mac.mm" ]
|
||||
defines += [ "MAS_BUILD" ]
|
||||
sources -= [
|
||||
"shell/app/electron_crash_reporter_client.cc",
|
||||
"shell/app/electron_crash_reporter_client.h",
|
||||
"shell/common/crash_keys.cc",
|
||||
"shell/common/crash_keys.h",
|
||||
]
|
||||
} else {
|
||||
libs += [
|
||||
"Squirrel.framework",
|
||||
@@ -523,6 +536,16 @@ source_set("electron_lib") {
|
||||
|
||||
sources += filenames.lib_sources_nss
|
||||
sources += [
|
||||
"shell/browser/ui/gtk/app_indicator_icon.cc",
|
||||
"shell/browser/ui/gtk/app_indicator_icon.h",
|
||||
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
|
||||
"shell/browser/ui/gtk/app_indicator_icon_menu.h",
|
||||
"shell/browser/ui/gtk/gtk_status_icon.cc",
|
||||
"shell/browser/ui/gtk/gtk_status_icon.h",
|
||||
"shell/browser/ui/gtk/menu_util.cc",
|
||||
"shell/browser/ui/gtk/menu_util.h",
|
||||
"shell/browser/ui/gtk/status_icon.cc",
|
||||
"shell/browser/ui/gtk/status_icon.h",
|
||||
"shell/browser/ui/gtk_util.cc",
|
||||
"shell/browser/ui/gtk_util.h",
|
||||
]
|
||||
@@ -763,8 +786,10 @@ if (is_mac) {
|
||||
framework_contents = [
|
||||
"Resources",
|
||||
"Libraries",
|
||||
"Helpers",
|
||||
]
|
||||
if (!is_mas_build) {
|
||||
framework_contents += [ "Helpers" ]
|
||||
}
|
||||
public_deps = [
|
||||
":electron_framework_libraries",
|
||||
":electron_lib",
|
||||
@@ -995,13 +1020,16 @@ if (is_mac) {
|
||||
|
||||
group("electron_symbols") {
|
||||
deps = [
|
||||
":crashpad_handler_syms",
|
||||
":electron_app_syms",
|
||||
":electron_framework_syms",
|
||||
":swiftshader_egl_syms",
|
||||
":swiftshader_gles_syms",
|
||||
]
|
||||
|
||||
if (!is_mas_build) {
|
||||
deps += [ ":crashpad_handler_syms" ]
|
||||
}
|
||||
|
||||
foreach(helper_params, content_mac_helpers) {
|
||||
_helper_target = helper_params[0]
|
||||
deps += [ ":electron_helper_syms_${_helper_target}" ]
|
||||
|
||||
9
DEPS
9
DEPS
@@ -5,14 +5,16 @@ gclient_gn_args = [
|
||||
'checkout_android_native_support',
|
||||
'checkout_libaom',
|
||||
'checkout_nacl',
|
||||
'checkout_pgo_profiles',
|
||||
'checkout_oculus_sdk',
|
||||
'checkout_openxr',
|
||||
'checkout_google_benchmark'
|
||||
'checkout_google_benchmark',
|
||||
'mac_xcode_version',
|
||||
]
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'17da1064b910f4170320ff37e971064916aed1dc',
|
||||
'85.0.4183.93',
|
||||
'node_version':
|
||||
'v12.16.3',
|
||||
'nan_version':
|
||||
@@ -42,6 +44,7 @@ vars = {
|
||||
'checkout_chromium': True,
|
||||
'checkout_node': True,
|
||||
'checkout_nan': True,
|
||||
'checkout_pgo_profiles': True,
|
||||
|
||||
# It's only needed to parse the native tests configurations.
|
||||
'checkout_pyyaml': False,
|
||||
@@ -49,6 +52,8 @@ vars = {
|
||||
# Python "requests" module is used for releases only.
|
||||
'checkout_requests': False,
|
||||
|
||||
'mac_xcode_version': 'default',
|
||||
|
||||
# To allow running hooks without parsing the DEPS tree
|
||||
'process_deps': True,
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
10.0.0-nightly.20200521
|
||||
10.1.1
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electron-16-core
|
||||
image: vs2019bt-16.4.0
|
||||
image: vs2019bt-16.6.2
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
|
||||
@@ -71,7 +71,6 @@ steps:
|
||||
ELECTRON_TEST_RESULTS_DIR: junit
|
||||
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
MOCHA_TIMEOUT: 120000
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Test Results'
|
||||
@@ -88,7 +87,11 @@ steps:
|
||||
|
||||
- powershell: |
|
||||
Get-Process | Where Name –Like "electron*" | Stop-Process
|
||||
Get-Process | Where Name –Like "MicrosoftEdge*" | Stop-Process
|
||||
Get-Process | Where Name –Like "msedge*" | Stop-Process
|
||||
displayName: 'Kill processes left running from last test run'
|
||||
condition: always()
|
||||
|
||||
- powershell: |
|
||||
Remove-Item -path $env:APPDATA/Electron* -Recurse
|
||||
displayName: 'Delete user app data directories'
|
||||
condition: always()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
|
||||
@@ -9,6 +10,9 @@ config.output = {
|
||||
filename: path.basename(outPath)
|
||||
}
|
||||
|
||||
const { wrapInitWithProfilingTimeout } = config;
|
||||
delete config.wrapInitWithProfilingTimeout;
|
||||
|
||||
webpack(config, (err, stats) => {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
@@ -17,6 +21,18 @@ webpack(config, (err, stats) => {
|
||||
console.error(stats.toString('normal'))
|
||||
process.exit(1)
|
||||
} else {
|
||||
if (wrapInitWithProfilingTimeout) {
|
||||
const contents = fs.readFileSync(outPath, 'utf8');
|
||||
const newContents = `function ___electron_webpack_init__() {
|
||||
${contents}
|
||||
};
|
||||
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
|
||||
setTimeout(___electron_webpack_init__, 0);
|
||||
} else {
|
||||
___electron_webpack_init__();
|
||||
}`;
|
||||
fs.writeFileSync(outPath, newContents);
|
||||
}
|
||||
process.exit(0)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
|
||||
const electronRoot = path.resolve(__dirname, '../..')
|
||||
|
||||
@@ -21,7 +22,7 @@ class AccessDependenciesPlugin {
|
||||
}
|
||||
|
||||
const defines = {
|
||||
BUILDFLAG: ''
|
||||
BUILDFLAG: onlyPrintingGraph ? '(a => a)' : ''
|
||||
}
|
||||
|
||||
const buildFlagsPrefix = '--buildflags='
|
||||
@@ -34,8 +35,7 @@ if (buildFlagArg) {
|
||||
for (const line of flagFile.split(/(\r\n|\r|\n)/g)) {
|
||||
const flagMatch = line.match(/#define BUILDFLAG_INTERNAL_(.+?)\(\) \(([01])\)/)
|
||||
if (flagMatch) {
|
||||
const flagName = flagMatch[1];
|
||||
const flagValue = flagMatch[2];
|
||||
const [, flagName, flagValue] = flagMatch;
|
||||
defines[flagName] = JSON.stringify(Boolean(parseInt(flagValue, 10)));
|
||||
}
|
||||
}
|
||||
@@ -64,16 +64,12 @@ if (defines['ENABLE_VIEWS_API'] === 'false') {
|
||||
)
|
||||
}
|
||||
|
||||
const alias = {}
|
||||
for (const ignoredModule of ignoredModules) {
|
||||
alias[ignoredModule] = path.resolve(electronRoot, 'lib/common/dummy.js')
|
||||
}
|
||||
|
||||
module.exports = ({
|
||||
alwaysHasNode,
|
||||
loadElectronFromAlternateTarget,
|
||||
targetDeletesNodeGlobals,
|
||||
target
|
||||
target,
|
||||
wrapInitWithProfilingTimeout
|
||||
}) => {
|
||||
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
|
||||
if (!fs.existsSync(entry)) {
|
||||
@@ -82,30 +78,36 @@ module.exports = ({
|
||||
|
||||
return ({
|
||||
mode: 'development',
|
||||
devtool: 'inline-source-map',
|
||||
devtool: false,
|
||||
entry,
|
||||
target: alwaysHasNode ? 'node' : 'web',
|
||||
output: {
|
||||
filename: `${target}.bundle.js`
|
||||
},
|
||||
wrapInitWithProfilingTimeout,
|
||||
resolve: {
|
||||
alias: {
|
||||
...alias,
|
||||
'@electron/internal': path.resolve(electronRoot, 'lib'),
|
||||
'electron': path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts'),
|
||||
// Force timers to resolve to our dependency that doens't use window.postMessage
|
||||
// Force timers to resolve to our dependency that doesn't use window.postMessage
|
||||
'timers': path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
|
||||
},
|
||||
extensions: ['.ts', '.js']
|
||||
},
|
||||
module: {
|
||||
rules: [{
|
||||
test: (moduleName) => !onlyPrintingGraph && ignoredModules.includes(moduleName),
|
||||
loader: 'null-loader',
|
||||
}, {
|
||||
test: /\.ts$/,
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
|
||||
transpileOnly: onlyPrintingGraph,
|
||||
ignoreDiagnostics: [6059]
|
||||
ignoreDiagnostics: [
|
||||
// File '{0}' is not under 'rootDir' '{1}'.
|
||||
6059,
|
||||
]
|
||||
}
|
||||
}]
|
||||
},
|
||||
@@ -116,6 +118,17 @@ module.exports = ({
|
||||
// one of our renderer bundles should import it from the 'timers' package
|
||||
setImmediate: false,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
keep_classnames: true,
|
||||
keep_fnames: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new AccessDependenciesPlugin(),
|
||||
...(targetDeletesNodeGlobals ? [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module.exports = require('./webpack.config.base')({
|
||||
target: 'renderer',
|
||||
alwaysHasNode: true,
|
||||
targetDeletesNodeGlobals: true
|
||||
targetDeletesNodeGlobals: true,
|
||||
wrapInitWithProfilingTimeout: true
|
||||
})
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = require('./webpack.config.base')({
|
||||
target: 'sandboxed_renderer',
|
||||
alwaysHasNode: false
|
||||
alwaysHasNode: false,
|
||||
wrapInitWithProfilingTimeout: true,
|
||||
})
|
||||
|
||||
@@ -16,6 +16,7 @@ template("webpack_build") {
|
||||
inputs = [
|
||||
invoker.config_file,
|
||||
"//electron/build/webpack/webpack.config.base.js",
|
||||
"//electron/build/webpack/run-compiler.js",
|
||||
"//electron/tsconfig.json",
|
||||
"//electron/yarn.lock",
|
||||
"//electron/typings/internal-ambient.d.ts",
|
||||
|
||||
@@ -72,6 +72,7 @@ static_library("chrome") {
|
||||
]
|
||||
deps = [
|
||||
"//chrome/browser:resource_prefetch_predictor_proto",
|
||||
"//chrome/services/speech:buildflags",
|
||||
"//components/feature_engagement:buildflags",
|
||||
"//components/optimization_guide/proto:optimization_guide_proto",
|
||||
]
|
||||
@@ -92,6 +93,14 @@ static_library("chrome") {
|
||||
]
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
sources += [
|
||||
"//chrome/browser/win/icon_reader_service.cc",
|
||||
"//chrome/browser/win/icon_reader_service.h",
|
||||
]
|
||||
public_deps += [ "//chrome/services/util_win:lib" ]
|
||||
}
|
||||
|
||||
if (enable_desktop_capturer) {
|
||||
sources += [
|
||||
"//chrome/browser/media/webrtc/desktop_media_list.h",
|
||||
@@ -152,13 +161,6 @@ static_library("chrome") {
|
||||
}
|
||||
}
|
||||
|
||||
if (enable_tts) {
|
||||
sources += [
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.cc",
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_widevine) {
|
||||
sources += [
|
||||
"//chrome/renderer/media/chrome_key_systems.cc",
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
|
||||
@@ -24,18 +24,18 @@ GlobalMenuBarRegistrarX11* GlobalMenuBarRegistrarX11::GetInstance() {
|
||||
return base::Singleton<GlobalMenuBarRegistrarX11>::get();
|
||||
}
|
||||
|
||||
void GlobalMenuBarRegistrarX11::OnWindowMapped(unsigned long xid) {
|
||||
live_xids_.insert(xid);
|
||||
void GlobalMenuBarRegistrarX11::OnWindowMapped(x11::Window window) {
|
||||
live_windows_.insert(window);
|
||||
|
||||
if (registrar_proxy_)
|
||||
RegisterXID(xid);
|
||||
RegisterXWindow(window);
|
||||
}
|
||||
|
||||
void GlobalMenuBarRegistrarX11::OnWindowUnmapped(unsigned long xid) {
|
||||
void GlobalMenuBarRegistrarX11::OnWindowUnmapped(x11::Window window) {
|
||||
if (registrar_proxy_)
|
||||
UnregisterXID(xid);
|
||||
UnregisterXWindow(window);
|
||||
|
||||
live_xids_.erase(xid);
|
||||
live_windows_.erase(window);
|
||||
}
|
||||
|
||||
GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11()
|
||||
@@ -63,9 +63,9 @@ GlobalMenuBarRegistrarX11::~GlobalMenuBarRegistrarX11() {
|
||||
}
|
||||
}
|
||||
|
||||
void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
|
||||
void GlobalMenuBarRegistrarX11::RegisterXWindow(x11::Window window) {
|
||||
DCHECK(registrar_proxy_);
|
||||
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(xid);
|
||||
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window);
|
||||
|
||||
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
|
||||
// TODO(erg): The mozilla implementation goes to a lot of callback trouble
|
||||
@@ -76,13 +76,13 @@ void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
|
||||
// I don't see any reason why we should care if "RegisterWindow" completes or
|
||||
// not.
|
||||
g_dbus_proxy_call(registrar_proxy_, "RegisterWindow",
|
||||
g_variant_new("(uo)", xid, path.c_str()),
|
||||
g_variant_new("(uo)", window, path.c_str()),
|
||||
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
|
||||
void GlobalMenuBarRegistrarX11::UnregisterXWindow(x11::Window window) {
|
||||
DCHECK(registrar_proxy_);
|
||||
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(xid);
|
||||
std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window);
|
||||
|
||||
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
|
||||
// TODO(erg): The mozilla implementation goes to a lot of callback trouble
|
||||
@@ -93,7 +93,7 @@ void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
|
||||
// I don't see any reason why we should care if "UnregisterWindow" completes
|
||||
// or not.
|
||||
g_dbus_proxy_call(registrar_proxy_, "UnregisterWindow",
|
||||
g_variant_new("(u)", xid), G_DBUS_CALL_FLAGS_NONE, -1,
|
||||
g_variant_new("(u)", window), G_DBUS_CALL_FLAGS_NONE, -1,
|
||||
nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
@@ -120,10 +120,10 @@ void GlobalMenuBarRegistrarX11::OnProxyCreated(GObject* source,
|
||||
|
||||
void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */,
|
||||
GParamSpec* /* ignored */) {
|
||||
// If the name owner changed, we need to reregister all the live xids with
|
||||
// the system.
|
||||
for (std::set<unsigned long>::const_iterator it = live_xids_.begin();
|
||||
it != live_xids_.end(); ++it) {
|
||||
RegisterXID(*it);
|
||||
// If the name owner changed, we need to reregister all the live x11::Window
|
||||
// with the system.
|
||||
for (std::set<x11::Window>::const_iterator it = live_windows_.begin();
|
||||
it != live_windows_.end(); ++it) {
|
||||
RegisterXWindow(*it);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,19 +12,20 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
#include "ui/gfx/x/xproto.h"
|
||||
|
||||
// Advertises our menu bars to Unity.
|
||||
//
|
||||
// GlobalMenuBarX11 is responsible for managing the DbusmenuServer for each
|
||||
// XID. We need a separate object to own the dbus channel to
|
||||
// x11::Window. We need a separate object to own the dbus channel to
|
||||
// com.canonical.AppMenu.Registrar and to register/unregister the mapping
|
||||
// between a XID and the DbusmenuServer instance we are offering.
|
||||
// between a x11::Window and the DbusmenuServer instance we are offering.
|
||||
class GlobalMenuBarRegistrarX11 {
|
||||
public:
|
||||
static GlobalMenuBarRegistrarX11* GetInstance();
|
||||
|
||||
void OnWindowMapped(unsigned long xid);
|
||||
void OnWindowUnmapped(unsigned long xid);
|
||||
void OnWindowMapped(x11::Window window);
|
||||
void OnWindowUnmapped(x11::Window window);
|
||||
|
||||
private:
|
||||
friend struct base::DefaultSingletonTraits<GlobalMenuBarRegistrarX11>;
|
||||
@@ -33,8 +34,8 @@ class GlobalMenuBarRegistrarX11 {
|
||||
~GlobalMenuBarRegistrarX11();
|
||||
|
||||
// Sends the actual message.
|
||||
void RegisterXID(unsigned long xid);
|
||||
void UnregisterXID(unsigned long xid);
|
||||
void RegisterXWindow(x11::Window window);
|
||||
void UnregisterXWindow(x11::Window window);
|
||||
|
||||
CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11,
|
||||
void,
|
||||
@@ -49,9 +50,9 @@ class GlobalMenuBarRegistrarX11 {
|
||||
|
||||
GDBusProxy* registrar_proxy_;
|
||||
|
||||
// Window XIDs which want to be registered, but haven't yet been because
|
||||
// x11::Window which want to be registered, but haven't yet been because
|
||||
// we're waiting for the proxy to become available.
|
||||
std::set<unsigned long> live_xids_;
|
||||
std::set<x11::Window> live_windows_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarRegistrarX11);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { app, dialog, BrowserWindow, shell, ipcMain } from 'electron';
|
||||
import * as path from 'path';
|
||||
import * as url from 'url';
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
|
||||
@@ -29,12 +30,11 @@ function isTrustedSender (webContents: Electron.WebContents) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const parsedUrl = new URL(webContents.getURL());
|
||||
const urlPath = process.platform === 'win32'
|
||||
// Strip the prefixed "/" that occurs on windows
|
||||
? path.resolve(parsedUrl.pathname.substr(1))
|
||||
: parsedUrl.pathname;
|
||||
return parsedUrl.protocol === 'file:' && urlPath === indexPath;
|
||||
try {
|
||||
return url.fileURLToPath(webContents.getURL()) === indexPath;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ipcMain.handle('bootstrap', (event) => {
|
||||
|
||||
@@ -359,7 +359,7 @@ Returns:
|
||||
|
||||
Emitted when the GPU process crashes or is killed.
|
||||
|
||||
### Event: 'renderer-process-crashed'
|
||||
### Event: 'renderer-process-crashed' _Deprecated_
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -1403,7 +1403,7 @@ in your app's initialization to ensure that your overridden value is used.
|
||||
|
||||
A `Boolean` which when `true` disables the overrides that Electron has in place
|
||||
to ensure renderer processes are restarted on every navigation. The current
|
||||
default value for this property is `false`.
|
||||
default value for this property is `true`.
|
||||
|
||||
The intention is for these overrides to become disabled by default and then at
|
||||
some point in the future this property will be removed. This property impacts
|
||||
|
||||
@@ -207,11 +207,15 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
* `opacity` Number (optional) - Set the initial opacity of the window, between 0.0 (fully
|
||||
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
|
||||
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
|
||||
some GTK desktop environments. Default is [`nativeTheme.shouldUseDarkColors`](native-theme.md).
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
|
||||
Default is `false`. On Windows, does not work unless the window is frameless.
|
||||
* `type` String (optional) - The type of window, default is normal window. See more about
|
||||
this below.
|
||||
* `visualEffectState` String (optional) - Specify how the material appearance should reflect window activity state on macOS. Must be used with the `vibrancy` property. Possible values are:
|
||||
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
|
||||
* `active` - The backdrop should always appear active.
|
||||
* `inactive` - The backdrop should always appear inactive.
|
||||
* `titleBarStyle` String (optional) - The style of window title bar.
|
||||
Default is `default`. Possible values are:
|
||||
* `default` - Results in the standard gray opaque Mac title
|
||||
@@ -271,7 +275,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
the `nodeIntegration` option and the APIs available to the preload script
|
||||
are more limited. Read more about the option [here](sandbox-option.md).
|
||||
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
|
||||
Default is `true`.
|
||||
Default is `false`.
|
||||
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
|
||||
page. Instead of passing the Session object directly, you can also choose to
|
||||
use the `partition` option instead, which accepts a partition string. When
|
||||
@@ -348,6 +352,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
You can access this context in the dev tools by selecting the
|
||||
'Electron Isolated Context' entry in the combo box at the top of the
|
||||
Console tab.
|
||||
* `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values
|
||||
can't unsafely cross between worlds when using `contextIsolation`. The default
|
||||
is `false`. In Electron 12, the default will be changed to `true`. _Deprecated_
|
||||
* `nativeWindowOpen` Boolean (optional) - Whether to use native
|
||||
`window.open()`. Defaults to `false`. Child windows will always have node
|
||||
integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently
|
||||
@@ -387,6 +394,13 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
Default is `true`.
|
||||
* `enableWebSQL` Boolean (optional) - Whether to enable the [WebSQL api](https://www.w3.org/TR/webdatabase/).
|
||||
Default is `true`.
|
||||
* `v8CacheOptions` String (optional) - Enforces the v8 code caching policy
|
||||
used by blink. Accepted values are
|
||||
* `none` - Disables code caching
|
||||
* `code` - Heuristic based code caching
|
||||
* `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation
|
||||
* `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager.
|
||||
Default policy is `code`.
|
||||
|
||||
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
|
||||
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
|
||||
@@ -1116,7 +1130,7 @@ Disable or enable the window.
|
||||
|
||||
#### `win.isEnabled()`
|
||||
|
||||
Returns Boolean - whether the window is enabled.
|
||||
Returns `Boolean` - whether the window is enabled.
|
||||
|
||||
#### `win.setSize(width, height[, animate])`
|
||||
|
||||
@@ -1659,9 +1673,12 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
||||
|
||||
Returns `Boolean` - Whether the menu bar is visible.
|
||||
|
||||
#### `win.setVisibleOnAllWorkspaces(visible)`
|
||||
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
|
||||
|
||||
* `visible` Boolean
|
||||
* `options` Object (optional)
|
||||
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
|
||||
the window should be visible above fullscreen windows
|
||||
|
||||
Sets whether the window should be visible on all workspaces.
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ for integrated authentication. Without `*` prefix the URL has to match exactly.
|
||||
A comma-separated list of servers for which delegation of user credentials is required.
|
||||
Without `*` prefix the URL has to match exactly.
|
||||
|
||||
### --disable-ntlm-v2
|
||||
|
||||
Disables NTLM v2 for posix platforms, no effect elsewhere.
|
||||
|
||||
### --disable-http-cache
|
||||
|
||||
Disables the disk cache for HTTP requests.
|
||||
|
||||
@@ -156,10 +156,16 @@ parameters in a renderer process will not result in those parameters being sent
|
||||
with crashes that occur in other renderer processes or in the main process.
|
||||
|
||||
**Note:** Parameters have limits on the length of the keys and values. Key
|
||||
names must be no longer than 39 bytes, and values must be no longer than 127
|
||||
names must be no longer than 39 bytes, and values must be no longer than 20320
|
||||
bytes. Keys with names longer than the maximum will be silently ignored. Key
|
||||
values longer than the maximum length will be truncated.
|
||||
|
||||
**Note:** On linux values that are longer than 127 bytes will be chunked into
|
||||
multiple keys, each 127 bytes in length. E.g. `addExtraParameter('foo', 'a'.repeat(130))`
|
||||
will result in two chunked keys `foo__1` and `foo__2`, the first will contain
|
||||
the first 127 bytes and the second will contain the remaining 3 bytes. On
|
||||
your crash reporting backend you should stitch together keys in this format.
|
||||
|
||||
### `crashReporter.removeExtraParameter(key)`
|
||||
|
||||
* `key` String - Parameter key, must be no longer than 39 bytes.
|
||||
|
||||
@@ -52,6 +52,8 @@ Returns:
|
||||
* `method` String - Method name.
|
||||
* `params` any - Event parameters defined by the 'parameters'
|
||||
attribute in the remote debugging protocol.
|
||||
* `sessionId` String - Unique identifier of attached debugging session,
|
||||
will match the value sent from `debugger.sendCommand`.
|
||||
|
||||
Emitted whenever the debugging target issues an instrumentation event.
|
||||
|
||||
@@ -74,11 +76,16 @@ Returns `Boolean` - Whether a debugger is attached to the `webContents`.
|
||||
|
||||
Detaches the debugger from the `webContents`.
|
||||
|
||||
#### `debugger.sendCommand(method[, commandParams])`
|
||||
#### `debugger.sendCommand(method[, commandParams, sessionId])`
|
||||
|
||||
* `method` String - Method name, should be one of the methods defined by the
|
||||
[remote debugging protocol][rdp].
|
||||
* `commandParams` any (optional) - JSON object with request parameters.
|
||||
* `sessionId` String (optional) - send command to the target with associated
|
||||
debugging session id. The initial value can be obtained by sending
|
||||
[Target.attachToTarget][attachToTarget] message.
|
||||
|
||||
[attachToTarget]: https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-attachToTarget
|
||||
|
||||
Returns `Promise<any>` - A promise that resolves with the response defined by
|
||||
the 'returns' attribute of the command description in the remote debugging protocol
|
||||
|
||||
@@ -12,7 +12,7 @@ See [`Menu`](menu.md) for examples.
|
||||
* `click` Function (optional) - Will be called with
|
||||
`click(menuItem, browserWindow, event)` when the menu item is clicked.
|
||||
* `menuItem` MenuItem
|
||||
* `browserWindow` [BrowserWindow](browser-window.md)
|
||||
* `browserWindow` [BrowserWindow](browser-window.md) | undefined - This will not be defined if no window is open.
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
|
||||
`click` property will be ignored. See [roles](#roles).
|
||||
@@ -69,6 +69,7 @@ a `type`.
|
||||
The `role` property can have following values:
|
||||
|
||||
* `undo`
|
||||
* `about` - Trigger a native about panel (custom message box on Window, which does not provide its own).
|
||||
* `redo`
|
||||
* `cut`
|
||||
* `copy`
|
||||
@@ -94,7 +95,6 @@ The `role` property can have following values:
|
||||
The following additional roles are available on _macOS_:
|
||||
|
||||
* `appMenu` - Whole default "App" menu (About, Services, etc.)
|
||||
* `about` - Map to the `orderFrontStandardAboutPanel` action.
|
||||
* `hide` - Map to the `hide` action.
|
||||
* `hideOthers` - Map to the `hideOtherApplications` action.
|
||||
* `unhide` - Map to the `unhideAllApplications` action.
|
||||
|
||||
@@ -119,6 +119,13 @@ Returns `NativeImage`
|
||||
|
||||
Creates an empty `NativeImage` instance.
|
||||
|
||||
### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
|
||||
|
||||
* `path` String - path to a file that we intend to construct a thumbnail out of.
|
||||
* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
|
||||
|
||||
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
|
||||
|
||||
### `nativeImage.createFromPath(path)`
|
||||
|
||||
* `path` String
|
||||
|
||||
@@ -8,19 +8,19 @@ Process: [Main](../glossary.md#main-process)
|
||||
|
||||
The `powerMonitor` module emits the following events:
|
||||
|
||||
### Event: 'suspend'
|
||||
### Event: 'suspend' _macOS_ _Windows_
|
||||
|
||||
Emitted when the system is suspending.
|
||||
|
||||
### Event: 'resume'
|
||||
### Event: 'resume' _macOS_ _Windows_
|
||||
|
||||
Emitted when system is resuming.
|
||||
|
||||
### Event: 'on-ac' _Windows_
|
||||
### Event: 'on-ac' _macOS_ _Windows_
|
||||
|
||||
Emitted when the system changes to AC power.
|
||||
|
||||
### Event: 'on-battery' _Windows_
|
||||
### Event: 'on-battery' _macOS_ _Windows_
|
||||
|
||||
Emitted when system changes to battery power.
|
||||
|
||||
|
||||
@@ -1,309 +0,0 @@
|
||||
# protocol (NetworkService) (Draft)
|
||||
|
||||
This document describes the new protocol APIs based on the [NetworkService](https://www.chromium.org/servicification).
|
||||
|
||||
We don't currently have an estimate of when we will enable the `NetworkService` by
|
||||
default in Electron, but as Chromium is already removing non-`NetworkService`
|
||||
code, we will probably switch before Electron 10.
|
||||
|
||||
The content of this document should be moved to `protocol.md` after we have
|
||||
enabled the `NetworkService` by default in Electron.
|
||||
|
||||
> Register a custom protocol and intercept existing protocol requests.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
An example of implementing a protocol that has the same effect as the
|
||||
`file://` protocol:
|
||||
|
||||
```javascript
|
||||
const { app, protocol } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
protocol.registerFileProtocol('atom', (request, callback) => {
|
||||
const url = request.url.substr(7)
|
||||
callback({ path: path.normalize(`${__dirname}/${url}`) })
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
**Note:** All methods unless specified can only be used after the `ready` event
|
||||
of the `app` module gets emitted.
|
||||
|
||||
## Using `protocol` with a custom `partition` or `session`
|
||||
|
||||
A protocol is registered to a specific Electron [`session`](./session.md)
|
||||
object. If you don't specify a session, then your `protocol` will be applied to
|
||||
the default session that Electron uses. However, if you define a `partition` or
|
||||
`session` on your `browserWindow`'s `webPreferences`, then that window will use
|
||||
a different session and your custom protocol will not work if you just use
|
||||
`electron.protocol.XXX`.
|
||||
|
||||
To have your custom protocol work in combination with a custom session, you need
|
||||
to register it to that session explicitly.
|
||||
|
||||
```javascript
|
||||
const { session, app, protocol } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
app.whenReady().then(() => {
|
||||
const partition = 'persist:example'
|
||||
const ses = session.fromPartition(partition)
|
||||
|
||||
ses.protocol.registerFileProtocol('atom', (request, callback) => {
|
||||
const url = request.url.substr(7)
|
||||
callback({ path: path.normalize(`${__dirname}/${url}`) })
|
||||
})
|
||||
|
||||
mainWindow = new BrowserWindow({ webPreferences: { partition } })
|
||||
})
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
The `protocol` module has the following methods:
|
||||
|
||||
### `protocol.registerSchemesAsPrivileged(customSchemes)`
|
||||
|
||||
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
|
||||
|
||||
**Note:** This method can only be used before the `ready` event of the `app`
|
||||
module gets emitted and can be called only once.
|
||||
|
||||
Registers the `scheme` as standard, secure, bypasses content security policy for
|
||||
resources, allows registering ServiceWorker and supports fetch API. Specify a
|
||||
privilege with the value of `true` to enable the capability.
|
||||
|
||||
An example of registering a privileged scheme, that bypasses Content Security
|
||||
Policy:
|
||||
|
||||
```javascript
|
||||
const { protocol } = require('electron')
|
||||
protocol.registerSchemesAsPrivileged([
|
||||
{ scheme: 'foo', privileges: { bypassCSP: true } }
|
||||
])
|
||||
```
|
||||
|
||||
A standard scheme adheres to what RFC 3986 calls [generic URI
|
||||
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
|
||||
`https` are standard schemes, while `file` is not.
|
||||
|
||||
Registering a scheme as standard allows relative and absolute resources to
|
||||
be resolved correctly when served. Otherwise the scheme will behave like the
|
||||
`file` protocol, but without the ability to resolve relative URLs.
|
||||
|
||||
For example when you load following page with custom protocol without
|
||||
registering it as standard scheme, the image will not be loaded because
|
||||
non-standard schemes can not recognize relative URLs:
|
||||
|
||||
```html
|
||||
<body>
|
||||
<img src='test.png'>
|
||||
</body>
|
||||
```
|
||||
|
||||
Registering a scheme as standard will allow access to files through the
|
||||
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
|
||||
error for the scheme.
|
||||
|
||||
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
|
||||
cookies) are disabled for non standard schemes. So in general if you want to
|
||||
register a custom protocol to replace the `http` protocol, you have to register
|
||||
it as a standard scheme.
|
||||
|
||||
### `protocol.registerFileProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Registers a protocol of `scheme` that will send a file as the response. The
|
||||
`handler` will be called with `request` and `callback` where `request` is
|
||||
an incoming request for the `scheme`.
|
||||
|
||||
To handle the `request`, the `callback` should be called with either the file's
|
||||
path or an object that has a `path` property, e.g. `callback(filePath)` or
|
||||
`callback({ path: filePath })`. The `filePath` must be an absolute path.
|
||||
|
||||
By default the `scheme` is treated like `http:`, which is parsed differently
|
||||
from protocols that follow the "generic URI syntax" like `file:`.
|
||||
|
||||
### `protocol.registerBufferProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Registers a protocol of `scheme` that will send a `Buffer` as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the `callback`
|
||||
should be called with either a `Buffer` object or an object that has the `data`
|
||||
property.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
protocol.registerBufferProtocol('atom', (request, callback) => {
|
||||
callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
|
||||
})
|
||||
```
|
||||
|
||||
### `protocol.registerStringProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Registers a protocol of `scheme` that will send a `String` as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the `callback`
|
||||
should be called with either a `String` or an object that has the `data`
|
||||
property.
|
||||
|
||||
### `protocol.registerHttpProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` ProtocolResponse
|
||||
|
||||
Registers a protocol of `scheme` that will send an HTTP request as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the `callback`
|
||||
should be called with an object that has the `url` property.
|
||||
|
||||
### `protocol.registerStreamProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Registers a protocol of `scheme` that will send a stream as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the
|
||||
`callback` should be called with either a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable) object or an object that
|
||||
has the `data` property.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
const { protocol } = require('electron')
|
||||
const { PassThrough } = require('stream')
|
||||
|
||||
function createStream (text) {
|
||||
const rv = new PassThrough() // PassThrough is also a Readable stream
|
||||
rv.push(text)
|
||||
rv.push(null)
|
||||
return rv
|
||||
}
|
||||
|
||||
protocol.registerStreamProtocol('atom', (request, callback) => {
|
||||
callback({
|
||||
statusCode: 200,
|
||||
headers: {
|
||||
'content-type': 'text/html'
|
||||
},
|
||||
data: createStream('<h5>Response</h5>')
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
It is possible to pass any object that implements the readable stream API (emits
|
||||
`data`/`end`/`error` events). For example, here's how a file could be returned:
|
||||
|
||||
```javascript
|
||||
protocol.registerStreamProtocol('atom', (request, callback) => {
|
||||
callback(fs.createReadStream('index.html'))
|
||||
})
|
||||
```
|
||||
|
||||
### `protocol.unregisterProtocol(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
|
||||
Unregisters the custom protocol of `scheme`.
|
||||
|
||||
### `protocol.isProtocolRegistered(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
|
||||
Returns `Boolean` - Whether `scheme` is already registered.
|
||||
|
||||
### `protocol.interceptFileProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a file as a response.
|
||||
|
||||
### `protocol.interceptStringProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a `String` as a response.
|
||||
|
||||
### `protocol.interceptBufferProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a `Buffer` as a response.
|
||||
|
||||
### `protocol.interceptHttpProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` ProtocolResponse
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a new HTTP request as a response.
|
||||
|
||||
### `protocol.interceptStreamProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
|
||||
protocol handler.
|
||||
|
||||
### `protocol.uninterceptProtocol(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
|
||||
Remove the interceptor installed for `scheme` and restore its original handler.
|
||||
|
||||
### `protocol.isProtocolIntercepted(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
|
||||
Returns `Boolean` - Whether `scheme` is already intercepted.
|
||||
|
||||
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem
|
||||
@@ -15,8 +15,6 @@ app.whenReady().then(() => {
|
||||
protocol.registerFileProtocol('atom', (request, callback) => {
|
||||
const url = request.url.substr(7)
|
||||
callback({ path: path.normalize(`${__dirname}/${url}`) })
|
||||
}, (error) => {
|
||||
if (error) console.error('Failed to register protocol')
|
||||
})
|
||||
})
|
||||
```
|
||||
@@ -26,9 +24,15 @@ of the `app` module gets emitted.
|
||||
|
||||
## Using `protocol` with a custom `partition` or `session`
|
||||
|
||||
A protocol is registered to a specific Electron [`session`](./session.md) object. If you don't specify a session, then your `protocol` will be applied to the default session that Electron uses. However, if you define a `partition` or `session` on your `browserWindow`'s `webPreferences`, then that window will use a different session and your custom protocol will not work if you just use `electron.protocol.XXX`.
|
||||
A protocol is registered to a specific Electron [`session`](./session.md)
|
||||
object. If you don't specify a session, then your `protocol` will be applied to
|
||||
the default session that Electron uses. However, if you define a `partition` or
|
||||
`session` on your `browserWindow`'s `webPreferences`, then that window will use
|
||||
a different session and your custom protocol will not work if you just use
|
||||
`electron.protocol.XXX`.
|
||||
|
||||
To have your custom protocol work in combination with a custom session, you need to register it to that session explicitly.
|
||||
To have your custom protocol work in combination with a custom session, you need
|
||||
to register it to that session explicitly.
|
||||
|
||||
```javascript
|
||||
const { session, app, protocol } = require('electron')
|
||||
@@ -41,17 +45,9 @@ app.whenReady().then(() => {
|
||||
ses.protocol.registerFileProtocol('atom', (request, callback) => {
|
||||
const url = request.url.substr(7)
|
||||
callback({ path: path.normalize(`${__dirname}/${url}`) })
|
||||
}, (error) => {
|
||||
if (error) console.error('Failed to register protocol')
|
||||
})
|
||||
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
partition: partition
|
||||
}
|
||||
})
|
||||
mainWindow = new BrowserWindow({ webPreferences: { partition } })
|
||||
})
|
||||
```
|
||||
|
||||
@@ -63,15 +59,15 @@ The `protocol` module has the following methods:
|
||||
|
||||
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
|
||||
|
||||
|
||||
**Note:** This method can only be used before the `ready` event of the `app`
|
||||
module gets emitted and can be called only once.
|
||||
|
||||
Registers the `scheme` as standard, secure, bypasses content security policy for resources,
|
||||
allows registering ServiceWorker and supports fetch API.
|
||||
Registers the `scheme` as standard, secure, bypasses content security policy for
|
||||
resources, allows registering ServiceWorker and supports fetch API. Specify a
|
||||
privilege with the value of `true` to enable the capability.
|
||||
|
||||
Specify a privilege with the value of `true` to enable the capability.
|
||||
An example of registering a privileged scheme, with bypassing Content Security Policy:
|
||||
An example of registering a privileged scheme, that bypasses Content Security
|
||||
Policy:
|
||||
|
||||
```javascript
|
||||
const { protocol } = require('electron')
|
||||
@@ -84,7 +80,7 @@ A standard scheme adheres to what RFC 3986 calls [generic URI
|
||||
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
|
||||
`https` are standard schemes, while `file` is not.
|
||||
|
||||
Registering a scheme as standard, will allow relative and absolute resources to
|
||||
Registering a scheme as standard allows relative and absolute resources to
|
||||
be resolved correctly when served. Otherwise the scheme will behave like the
|
||||
`file` protocol, but without the ability to resolve relative URLs.
|
||||
|
||||
@@ -102,168 +98,102 @@ Registering a scheme as standard will allow access to files through the
|
||||
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
|
||||
error for the scheme.
|
||||
|
||||
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB, cookies)
|
||||
are disabled for non standard schemes. So in general if you want to register a
|
||||
custom protocol to replace the `http` protocol, you have to register it as a standard scheme.
|
||||
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
|
||||
cookies) are disabled for non standard schemes. So in general if you want to
|
||||
register a custom protocol to replace the `http` protocol, you have to register
|
||||
it as a standard scheme.
|
||||
|
||||
`protocol.registerSchemesAsPrivileged` can be used to replicate the functionality of the previous `protocol.registerStandardSchemes`, `webFrame.registerURLSchemeAs*` and `protocol.registerServiceWorkerSchemes` functions that existed prior to Electron 5.0.0, for example:
|
||||
|
||||
**before (<= v4.x)**
|
||||
```javascript
|
||||
// Main
|
||||
protocol.registerStandardSchemes(['scheme1', 'scheme2'], { secure: true })
|
||||
// Renderer
|
||||
webFrame.registerURLSchemeAsPrivileged('scheme1', { secure: true })
|
||||
webFrame.registerURLSchemeAsPrivileged('scheme2', { secure: true })
|
||||
```
|
||||
|
||||
**after (>= v5.x)**
|
||||
```javascript
|
||||
protocol.registerSchemesAsPrivileged([
|
||||
{ scheme: 'scheme1', privileges: { standard: true, secure: true } },
|
||||
{ scheme: 'scheme2', privileges: { standard: true, secure: true } }
|
||||
])
|
||||
```
|
||||
|
||||
### `protocol.registerFileProtocol(scheme, handler[, completion])`
|
||||
### `protocol.registerFileProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `filePath` String | [FilePathWithHeaders](structures/file-path-with-headers.md) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Registers a protocol of `scheme` that will send the file as a response. The
|
||||
`handler` will be called with `handler(request, callback)` when a `request` is
|
||||
going to be created with `scheme`. `completion` will be called with
|
||||
`completion(null)` when `scheme` is successfully registered or
|
||||
`completion(error)` when failed.
|
||||
Returns `Boolean` - Whether the protocol was successfully registered
|
||||
|
||||
Registers a protocol of `scheme` that will send a file as the response. The
|
||||
`handler` will be called with `request` and `callback` where `request` is
|
||||
an incoming request for the `scheme`.
|
||||
|
||||
To handle the `request`, the `callback` should be called with either the file's
|
||||
path or an object that has a `path` property, e.g. `callback(filePath)` or
|
||||
`callback({ path: filePath })`. The object may also have a `headers` property
|
||||
which gives a map of headers to values for the response headers, e.g.
|
||||
`callback({ path: filePath, headers: {"Content-Security-Policy": "default-src 'none'"]})`.
|
||||
|
||||
When `callback` is called with nothing, a number, or an object that has an
|
||||
`error` property, the `request` will fail with the `error` number you
|
||||
specified. For the available error numbers you can use, please see the
|
||||
[net error list][net-error].
|
||||
`callback({ path: filePath })`. The `filePath` must be an absolute path.
|
||||
|
||||
By default the `scheme` is treated like `http:`, which is parsed differently
|
||||
than protocols that follow the "generic URI syntax" like `file:`.
|
||||
from protocols that follow the "generic URI syntax" like `file:`.
|
||||
|
||||
### `protocol.registerBufferProtocol(scheme, handler[, completion])`
|
||||
### `protocol.registerBufferProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `buffer` (Buffer | [MimeTypedBuffer](structures/mime-typed-buffer.md)) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully registered
|
||||
|
||||
Registers a protocol of `scheme` that will send a `Buffer` as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the `callback`
|
||||
should be called with either a `Buffer` object or an object that has the `data`,
|
||||
`mimeType`, and `charset` properties.
|
||||
should be called with either a `Buffer` object or an object that has the `data`
|
||||
property.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
const { protocol } = require('electron')
|
||||
|
||||
protocol.registerBufferProtocol('atom', (request, callback) => {
|
||||
callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
|
||||
}, (error) => {
|
||||
if (error) console.error('Failed to register protocol')
|
||||
})
|
||||
```
|
||||
|
||||
### `protocol.registerStringProtocol(scheme, handler[, completion])`
|
||||
### `protocol.registerStringProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `data` (String | [StringProtocolResponse](structures/string-protocol-response.md)) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully registered
|
||||
|
||||
Registers a protocol of `scheme` that will send a `String` as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the `callback`
|
||||
should be called with either a `String` or an object that has the `data`,
|
||||
`mimeType`, and `charset` properties.
|
||||
should be called with either a `String` or an object that has the `data`
|
||||
property.
|
||||
|
||||
### `protocol.registerHttpProtocol(scheme, handler[, completion])`
|
||||
### `protocol.registerHttpProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `redirectRequest` Object
|
||||
* `url` String
|
||||
* `method` String (optional)
|
||||
* `session` Session | null (optional)
|
||||
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` ProtocolResponse
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully registered
|
||||
|
||||
Registers a protocol of `scheme` that will send an HTTP request as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the `callback`
|
||||
should be called with a `redirectRequest` object that has the `url`, `method`,
|
||||
`referrer`, `uploadData` and `session` properties.
|
||||
should be called with an object that has the `url` property.
|
||||
|
||||
By default the HTTP request will reuse the current session. If you want the
|
||||
request to have a different session you should set `session` to `null`.
|
||||
|
||||
For POST requests the `uploadData` object must be provided.
|
||||
|
||||
### `protocol.registerStreamProtocol(scheme, handler[, completion])`
|
||||
### `protocol.registerStreamProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `stream` (ReadableStream | [StreamProtocolResponse](structures/stream-protocol-response.md)) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Registers a protocol of `scheme` that will send a `Readable` as a response.
|
||||
Returns `Boolean` - Whether the protocol was successfully registered
|
||||
|
||||
The usage is similar to the other `register{Any}Protocol`, except that the
|
||||
`callback` should be called with either a `Readable` object or an object that
|
||||
has the `data`, `statusCode`, and `headers` properties.
|
||||
Registers a protocol of `scheme` that will send a stream as a response.
|
||||
|
||||
The usage is the same with `registerFileProtocol`, except that the
|
||||
`callback` should be called with either a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable) object or an object that
|
||||
has the `data` property.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -286,8 +216,6 @@ protocol.registerStreamProtocol('atom', (request, callback) => {
|
||||
},
|
||||
data: createStream('<h5>Response</h5>')
|
||||
})
|
||||
}, (error) => {
|
||||
if (error) console.error('Failed to register protocol')
|
||||
})
|
||||
```
|
||||
|
||||
@@ -295,132 +223,102 @@ It is possible to pass any object that implements the readable stream API (emits
|
||||
`data`/`end`/`error` events). For example, here's how a file could be returned:
|
||||
|
||||
```javascript
|
||||
const { protocol } = require('electron')
|
||||
const fs = require('fs')
|
||||
|
||||
protocol.registerStreamProtocol('atom', (request, callback) => {
|
||||
callback(fs.createReadStream('index.html'))
|
||||
}, (error) => {
|
||||
if (error) console.error('Failed to register protocol')
|
||||
})
|
||||
```
|
||||
|
||||
### `protocol.unregisterProtocol(scheme[, completion])`
|
||||
### `protocol.unregisterProtocol(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully unregistered
|
||||
|
||||
Unregisters the custom protocol of `scheme`.
|
||||
|
||||
### `protocol.isProtocolHandled(scheme)`
|
||||
### `protocol.isProtocolRegistered(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
|
||||
Returns `Promise<Boolean>` - fulfilled with a boolean that indicates whether there is
|
||||
already a handler for `scheme`.
|
||||
Returns `Boolean` - Whether `scheme` is already registered.
|
||||
|
||||
### `protocol.interceptFileProtocol(scheme, handler[, completion])`
|
||||
### `protocol.interceptFileProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `filePath` String
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully intercepted
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a file as a response.
|
||||
|
||||
### `protocol.interceptStringProtocol(scheme, handler[, completion])`
|
||||
### `protocol.interceptStringProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `data` (String | [StringProtocolResponse](structures/string-protocol-response.md)) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully intercepted
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a `String` as a response.
|
||||
|
||||
### `protocol.interceptBufferProtocol(scheme, handler[, completion])`
|
||||
### `protocol.interceptBufferProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `buffer` Buffer (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully intercepted
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a `Buffer` as a response.
|
||||
|
||||
### `protocol.interceptHttpProtocol(scheme, handler[, completion])`
|
||||
### `protocol.interceptHttpProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `redirectRequest` Object
|
||||
* `url` String
|
||||
* `method` String (optional)
|
||||
* `session` Session | null (optional)
|
||||
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` [ProtocolResponse](structures/protocol-response.md)
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully intercepted
|
||||
|
||||
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
|
||||
which sends a new HTTP request as a response.
|
||||
|
||||
### `protocol.interceptStreamProtocol(scheme, handler[, completion])`
|
||||
### `protocol.interceptStreamProtocol(scheme, handler)`
|
||||
|
||||
* `scheme` String
|
||||
* `handler` Function
|
||||
* `request` Object
|
||||
* `url` String
|
||||
* `headers` Record<String, String>
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](structures/upload-data.md)
|
||||
* `request` ProtocolRequest
|
||||
* `callback` Function
|
||||
* `stream` (ReadableStream | [StreamProtocolResponse](structures/stream-protocol-response.md)) (optional)
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully intercepted
|
||||
|
||||
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
|
||||
protocol handler.
|
||||
|
||||
### `protocol.uninterceptProtocol(scheme[, completion])`
|
||||
### `protocol.uninterceptProtocol(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
* `completion` Function (optional)
|
||||
* `error` Error
|
||||
|
||||
Returns `Boolean` - Whether the protocol was successfully unintercepted
|
||||
|
||||
Remove the interceptor installed for `scheme` and restore its original handler.
|
||||
|
||||
[net-error]: https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h
|
||||
### `protocol.isProtocolIntercepted(scheme)`
|
||||
|
||||
* `scheme` String
|
||||
|
||||
Returns `Boolean` - Whether `scheme` is already intercepted.
|
||||
|
||||
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
* `contentLengths` Number[] - The total size of the content, in bytes.
|
||||
* `price` Number - The cost of the product in the local currency.
|
||||
* `formattedPrice` String - The locale formatted price of the product.
|
||||
* `currencyCode` String - 3 character code presenting a product's currency based on the ISO 4217 standard.
|
||||
* `isDownloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
* `referrer` String
|
||||
* `method` String
|
||||
* `uploadData` [UploadData[]](upload-data.md) (optional)
|
||||
* `headers` Record<String, String>
|
||||
|
||||
@@ -416,7 +416,7 @@ This API itself will not protect your user data; rather, it is a mechanism to al
|
||||
|
||||
Returns `Boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
|
||||
|
||||
### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_
|
||||
### `systemPreferences.getMediaAccessStatus(mediaType)` _Windows_ _macOS_
|
||||
|
||||
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
|
||||
|
||||
@@ -426,6 +426,9 @@ This user consent was not required on macOS 10.13 High Sierra or lower so this m
|
||||
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
|
||||
macOS 10.15 Catalina or higher requires consent for `screen` access.
|
||||
|
||||
Windows 10 has a global setting controlling `microphone` and `camera` access for all win32 applications.
|
||||
It will always return `granted` for `screen` and for all media types on older versions of Windows.
|
||||
|
||||
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_
|
||||
|
||||
* `mediaType` String - the type of media being requested; can be `microphone`, `camera`.
|
||||
|
||||
@@ -402,6 +402,7 @@ Returns:
|
||||
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
|
||||
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
|
||||
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
|
||||
* `isComposing` Boolean - Equivalent to [KeyboardEvent.isComposing][keyboardevent].
|
||||
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
|
||||
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
|
||||
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
|
||||
@@ -907,10 +908,10 @@ Returns `String` - The URL of the current web page.
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
let win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.loadURL('http://github.com')
|
||||
|
||||
let currentURL = win.webContents.getURL()
|
||||
console.log(currentURL)
|
||||
win.loadURL('http://github.com').then(() => {
|
||||
const currentURL = win.webContents.getURL()
|
||||
console.log(currentURL)
|
||||
})
|
||||
```
|
||||
|
||||
#### `contents.getTitle()`
|
||||
@@ -1310,6 +1311,8 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
|
||||
* `success` Boolean - Indicates success of the print call.
|
||||
* `failureReason` String - Error description called back if the print fails.
|
||||
|
||||
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minumum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
|
||||
|
||||
Prints window's web page. When `silent` is set to `true`, Electron will pick
|
||||
the system's default printer if `deviceName` is empty and the default settings for printing.
|
||||
|
||||
@@ -1333,13 +1336,12 @@ win.webContents.print(options, (success, errorType) => {
|
||||
* `landscape` Boolean (optional) - `true` for landscape, `false` for portrait.
|
||||
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
|
||||
default margin, 1 for no margin, and 2 for minimum margin.
|
||||
and `width` in microns.
|
||||
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
||||
* `from` Number - the first page to print.
|
||||
* `to` Number - the last page to print (inclusive).
|
||||
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
|
||||
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
|
||||
* `printSelectionOnly` Boolean (optional) - Whether to print selection only.
|
||||
|
||||
@@ -1370,6 +1372,8 @@ An example of `webContents.printToPDF`:
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
|
||||
let win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.loadURL('http://github.com')
|
||||
@@ -1377,12 +1381,13 @@ win.loadURL('http://github.com')
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
// Use default printing options
|
||||
win.webContents.printToPDF({}).then(data => {
|
||||
fs.writeFile('/tmp/print.pdf', data, (error) => {
|
||||
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
|
||||
fs.writeFile(pdfPath, data, (error) => {
|
||||
if (error) throw error
|
||||
console.log('Write PDF successfully.')
|
||||
console.log(`Wrote PDF successfully to ${pdfPath}`)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
console.log(`Failed to write PDF to ${pdfPath}: `, error)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
@@ -54,24 +54,32 @@ template("electron_extra_paks") {
|
||||
])
|
||||
output = "${invoker.output_dir}/resources.pak"
|
||||
sources = [
|
||||
"$root_gen_dir/chrome/print_preview_pdf_resources.pak",
|
||||
"$root_gen_dir/components/components_resources.pak",
|
||||
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
||||
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
||||
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
|
||||
"$root_gen_dir/content/content_resources.pak",
|
||||
"$root_gen_dir/content/dev_ui_content_resources.pak",
|
||||
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
|
||||
"$root_gen_dir/net/net_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
|
||||
"$root_gen_dir/ui/resources/webui_resources.pak",
|
||||
"$target_gen_dir/electron_resources.pak",
|
||||
]
|
||||
deps = [
|
||||
"//chrome/browser/resources:print_preview_pdf_resources",
|
||||
"//components/resources",
|
||||
"//content:content_resources",
|
||||
"//content:dev_ui_content_resources",
|
||||
"//content/browser/resources/media:media_internals_resources",
|
||||
"//content/browser/tracing:resources",
|
||||
"//content/browser/webrtc/resources",
|
||||
"//electron:resources",
|
||||
"//mojo/public/js:resources",
|
||||
"//net:net_resources",
|
||||
"//third_party/blink/public:devtools_inspector_resources",
|
||||
"//third_party/blink/public:resources",
|
||||
"//ui/resources",
|
||||
]
|
||||
|
||||
@@ -75,4 +75,9 @@
|
||||
<message name="IDS_ACCEPT_LANGUAGES" use_name_for_id="true">
|
||||
en-US,en
|
||||
</message>
|
||||
<if expr="is_win">
|
||||
<message name="IDS_UTILITY_PROCESS_UTILITY_WIN_NAME" desc="The name of the utility process used to handle Windows utility operations.">
|
||||
Windows Utilities
|
||||
</message>
|
||||
</if>
|
||||
</grit-part>
|
||||
|
||||
@@ -43,7 +43,6 @@ auto_filenames = {
|
||||
"docs/api/power-monitor.md",
|
||||
"docs/api/power-save-blocker.md",
|
||||
"docs/api/process.md",
|
||||
"docs/api/protocol-ns.md",
|
||||
"docs/api/protocol.md",
|
||||
"docs/api/remote.md",
|
||||
"docs/api/sandbox-option.md",
|
||||
@@ -139,7 +138,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -150,6 +148,7 @@ auto_filenames = {
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/native-image.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/inspector.ts",
|
||||
@@ -205,6 +204,7 @@ auto_filenames = {
|
||||
"lib/browser/api/menu.js",
|
||||
"lib/browser/api/message-channel.ts",
|
||||
"lib/browser/api/module-list.ts",
|
||||
"lib/browser/api/native-image.ts",
|
||||
"lib/browser/api/native-theme.ts",
|
||||
"lib/browser/api/net-log.js",
|
||||
"lib/browser/api/net.ts",
|
||||
@@ -241,7 +241,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -263,7 +262,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -278,6 +276,7 @@ auto_filenames = {
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/native-image.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/init.ts",
|
||||
@@ -305,7 +304,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -319,6 +317,7 @@ auto_filenames = {
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/native-image.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
|
||||
@@ -451,6 +451,7 @@ filenames = {
|
||||
"shell/common/api/electron_api_native_image.cc",
|
||||
"shell/common/api/electron_api_native_image.h",
|
||||
"shell/common/api/electron_api_native_image_mac.mm",
|
||||
"shell/common/api/electron_api_native_image_win.cc",
|
||||
"shell/common/api/electron_api_shell.cc",
|
||||
"shell/common/api/electron_api_v8_util.cc",
|
||||
"shell/common/api/electron_bindings.cc",
|
||||
@@ -525,6 +526,8 @@ filenames = {
|
||||
"shell/common/gin_helper/function_template_extensions.h",
|
||||
"shell/common/gin_helper/locker.cc",
|
||||
"shell/common/gin_helper/locker.h",
|
||||
"shell/common/gin_helper/microtasks_scope.cc",
|
||||
"shell/common/gin_helper/microtasks_scope.h",
|
||||
"shell/common/gin_helper/object_template_builder.cc",
|
||||
"shell/common/gin_helper/object_template_builder.h",
|
||||
"shell/common/gin_helper/persistent_dictionary.cc",
|
||||
|
||||
@@ -249,7 +249,11 @@ module.exports = {
|
||||
},
|
||||
|
||||
showCertificateTrustDialog: function (window, options) {
|
||||
if (window && window.constructor !== BrowserWindow) options = window;
|
||||
if (window && window.constructor !== BrowserWindow) {
|
||||
options = window;
|
||||
window = null;
|
||||
}
|
||||
|
||||
if (options == null || typeof options !== 'object') {
|
||||
throw new TypeError('options must be an object');
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ const roles = {
|
||||
about: {
|
||||
get label () {
|
||||
return isLinux ? 'About' : `About ${app.name}`;
|
||||
}
|
||||
},
|
||||
...(isWindows && { appMethod: 'showAboutPanel' })
|
||||
},
|
||||
close: {
|
||||
label: isMac ? 'Close Window' : 'Close',
|
||||
@@ -70,7 +71,7 @@ const roles = {
|
||||
},
|
||||
pasteandmatchstyle: {
|
||||
label: 'Paste and Match Style',
|
||||
accelerator: 'Shift+CommandOrControl+V',
|
||||
accelerator: isMac ? 'Cmd+Option+Shift+V' : 'Shift+CommandOrControl+V',
|
||||
webContentsMethod: 'pasteAndMatchStyle',
|
||||
registerAccelerator: false
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'Menu', loader: () => require('./menu') },
|
||||
{ name: 'MenuItem', loader: () => require('./menu-item') },
|
||||
{ name: 'MessageChannelMain', loader: () => require('./message-channel') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'nativeTheme', loader: () => require('./native-theme') },
|
||||
{ name: 'net', loader: () => require('./net') },
|
||||
{ name: 'netLog', loader: () => require('./net-log') },
|
||||
|
||||
@@ -17,6 +17,7 @@ export const browserModuleNames = [
|
||||
'inAppPurchase',
|
||||
'Menu',
|
||||
'MenuItem',
|
||||
'nativeImage',
|
||||
'nativeTheme',
|
||||
'net',
|
||||
'netLog',
|
||||
|
||||
3
lib/browser/api/native-image.ts
Normal file
3
lib/browser/api/native-image.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
const { nativeImage } = process._linkedBinding('electron_common_native_image');
|
||||
|
||||
export default nativeImage;
|
||||
@@ -64,6 +64,19 @@ const PDFPageSizes = {
|
||||
}
|
||||
};
|
||||
|
||||
// The minimum micron size Chromium accepts is that where:
|
||||
// Per printing/units.h:
|
||||
// * kMicronsPerInch - Length of an inch in 0.001mm unit.
|
||||
// * kPointsPerInch - Length of an inch in CSS's 1pt unit.
|
||||
//
|
||||
// Formula: (kPointsPerInch / kMicronsPerInch) * size >= 1
|
||||
//
|
||||
// Practically, this means microns need to be > 352 microns.
|
||||
// We therefore need to verify this or it will silently fail.
|
||||
const isValidCustomPageSize = (width, height) => {
|
||||
return [width, height].every(x => x > 352);
|
||||
};
|
||||
|
||||
// Default printing setting
|
||||
const defaultPrintingSetting = {
|
||||
// Customizable.
|
||||
@@ -215,7 +228,9 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (code, h
|
||||
};
|
||||
|
||||
// Translate the options of printToPDF.
|
||||
WebContents.prototype.printToPDF = function (options) {
|
||||
|
||||
let pendingPromise;
|
||||
WebContents.prototype.printToPDF = async function (options) {
|
||||
const printSettings = {
|
||||
...defaultPrintingSetting,
|
||||
requestID: getNextId()
|
||||
@@ -318,13 +333,20 @@ WebContents.prototype.printToPDF = function (options) {
|
||||
const error = new Error('height and width properties are required for pageSize');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
// Dimensions in Microns
|
||||
// 1 meter = 10^6 microns
|
||||
|
||||
// Dimensions in Microns - 1 meter = 10^6 microns
|
||||
const height = Math.ceil(pageSize.height);
|
||||
const width = Math.ceil(pageSize.width);
|
||||
if (!isValidCustomPageSize(width, height)) {
|
||||
const error = new Error('height and width properties must be minimum 352 microns.');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
printSettings.mediaSize = {
|
||||
name: 'CUSTOM',
|
||||
custom_display_name: 'Custom',
|
||||
height_microns: Math.ceil(pageSize.height),
|
||||
width_microns: Math.ceil(pageSize.width)
|
||||
height_microns: height,
|
||||
width_microns: width
|
||||
};
|
||||
} else if (PDFPageSizes[pageSize]) {
|
||||
printSettings.mediaSize = PDFPageSizes[pageSize];
|
||||
@@ -341,7 +363,12 @@ WebContents.prototype.printToPDF = function (options) {
|
||||
// PrinterType enum from //printing/print_job_constants.h
|
||||
printSettings.printerType = 2;
|
||||
if (this._printToPDF) {
|
||||
return this._printToPDF(printSettings);
|
||||
if (pendingPromise) {
|
||||
pendingPromise = pendingPromise.then(() => this._printToPDF(printSettings));
|
||||
} else {
|
||||
pendingPromise = this._printToPDF(printSettings);
|
||||
}
|
||||
return pendingPromise;
|
||||
} else {
|
||||
const error = new Error('Printing feature is disabled');
|
||||
return Promise.reject(error);
|
||||
@@ -359,12 +386,19 @@ WebContents.prototype.print = function (options = {}, callback) {
|
||||
if (!pageSize.height || !pageSize.width) {
|
||||
throw new Error('height and width properties are required for pageSize');
|
||||
}
|
||||
|
||||
// Dimensions in Microns - 1 meter = 10^6 microns
|
||||
const height = Math.ceil(pageSize.height);
|
||||
const width = Math.ceil(pageSize.width);
|
||||
if (!isValidCustomPageSize(width, height)) {
|
||||
throw new Error('height and width properties must be minimum 352 microns.');
|
||||
}
|
||||
|
||||
options.mediaSize = {
|
||||
name: 'CUSTOM',
|
||||
custom_display_name: 'Custom',
|
||||
height_microns: Math.ceil(pageSize.height),
|
||||
width_microns: Math.ceil(pageSize.width)
|
||||
height_microns: height,
|
||||
width_microns: width
|
||||
};
|
||||
} else if (PDFPageSizes[pageSize]) {
|
||||
options.mediaSize = PDFPageSizes[pageSize];
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as fs from 'fs';
|
||||
import { Socket } from 'net';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
const Module = require('module');
|
||||
|
||||
// We modified the original process.argv to let node.js load the init.js,
|
||||
|
||||
@@ -4,12 +4,13 @@ import * as electron from 'electron';
|
||||
import { EventEmitter } from 'events';
|
||||
import objectsRegistry from './objects-registry';
|
||||
import { ipcMainInternal } from '../ipc-main-internal';
|
||||
import { isPromise, isSerializableObject } from '@electron/internal/common/type-utils';
|
||||
import { isPromise, isSerializableObject, deserialize, serialize } from '@electron/internal/common/type-utils';
|
||||
import { Size } from 'electron/main';
|
||||
|
||||
const v8Util = process.electronBinding('v8_util');
|
||||
const eventBinding = process.electronBinding('event');
|
||||
const features = process.electronBinding('features');
|
||||
const { NativeImage } = process.electronBinding('native_image');
|
||||
|
||||
if (!features.isRemoteModuleEnabled()) {
|
||||
throw new Error('remote module is disabled');
|
||||
@@ -114,6 +115,9 @@ type MetaType = {
|
||||
} | {
|
||||
type: 'promise',
|
||||
then: MetaType
|
||||
} | {
|
||||
type: 'nativeimage'
|
||||
value: electron.NativeImage
|
||||
}
|
||||
|
||||
// Convert a real value into meta data.
|
||||
@@ -124,6 +128,8 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
|
||||
// Recognize certain types of objects.
|
||||
if (value instanceof Buffer) {
|
||||
type = 'buffer';
|
||||
} else if (value instanceof NativeImage) {
|
||||
type = 'nativeimage';
|
||||
} else if (Array.isArray(value)) {
|
||||
type = 'array';
|
||||
} else if (value instanceof Error) {
|
||||
@@ -147,6 +153,8 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
|
||||
type,
|
||||
members: value.map((el: any) => valueToMeta(sender, contextId, el, optimizeSimpleObject))
|
||||
};
|
||||
} else if (type === 'nativeimage') {
|
||||
return { type, value: serialize(value) };
|
||||
} else if (type === 'object' || type === 'function') {
|
||||
return {
|
||||
type,
|
||||
@@ -234,7 +242,10 @@ type MetaTypeFromRenderer = {
|
||||
} | {
|
||||
type: 'object',
|
||||
name: string,
|
||||
members: { name: string, value: MetaTypeFromRenderer }[]
|
||||
members: {
|
||||
name: string,
|
||||
value: MetaTypeFromRenderer
|
||||
}[]
|
||||
} | {
|
||||
type: 'function-with-return-value',
|
||||
value: MetaTypeFromRenderer
|
||||
@@ -245,7 +256,12 @@ type MetaTypeFromRenderer = {
|
||||
length: number
|
||||
} | {
|
||||
type: 'nativeimage',
|
||||
value: { size: Size, buffer: Buffer, scaleFactor: number, dataURL: string }[]
|
||||
value: {
|
||||
size: Size,
|
||||
buffer: Buffer,
|
||||
scaleFactor: number,
|
||||
dataURL: string
|
||||
}[]
|
||||
}
|
||||
|
||||
const fakeConstructor = (constructor: Function, name: string) =>
|
||||
@@ -263,15 +279,8 @@ const fakeConstructor = (constructor: Function, name: string) =>
|
||||
const unwrapArgs = function (sender: electron.WebContents, frameId: number, contextId: string, args: any[]) {
|
||||
const metaToValue = function (meta: MetaTypeFromRenderer): any {
|
||||
switch (meta.type) {
|
||||
case 'nativeimage': {
|
||||
const image = electron.nativeImage.createEmpty();
|
||||
for (const rep of meta.value) {
|
||||
const { size, scaleFactor, dataURL } = rep;
|
||||
const { width, height } = size;
|
||||
image.addRepresentation({ dataURL, scaleFactor, width, height });
|
||||
}
|
||||
return image;
|
||||
}
|
||||
case 'nativeimage':
|
||||
return deserialize(meta.value);
|
||||
case 'value':
|
||||
return meta.value;
|
||||
case 'remote-object':
|
||||
|
||||
@@ -134,3 +134,7 @@ ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', (event,
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY', () => {
|
||||
return electron.crashReporter.getCrashesDirectory();
|
||||
});
|
||||
|
||||
ipcMainInternal.handle('ELECTRON_NATIVE_IMAGE_CREATE_THUMBNAIL_FROM_PATH', async (_, path, size) => {
|
||||
return typeUtils.serialize(await electron.nativeImage.createThumbnailFromPath(path, size));
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Common modules, please sort alphabetically
|
||||
export const commonModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'clipboard', loader: () => require('./clipboard') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'shell', loader: () => require('./shell') },
|
||||
// The internal modules, invisible unless you know their names.
|
||||
{ name: 'deprecate', loader: () => require('./deprecate'), private: true }
|
||||
|
||||
@@ -572,7 +572,7 @@
|
||||
};
|
||||
|
||||
const { readdir } = fs;
|
||||
fs.readdir = function (pathArgument, options, callback) {
|
||||
fs.readdir = function (pathArgument, options = {}, callback) {
|
||||
const { isAsar, asarPath, filePath } = splitPath(pathArgument);
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
@@ -594,13 +594,29 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.withFileTypes) {
|
||||
const dirents = [];
|
||||
for (const file of files) {
|
||||
const stats = archive.stat(file);
|
||||
if (stats.isFile) {
|
||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
|
||||
} else if (stats.isDirectory) {
|
||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_DIR));
|
||||
} else if (stats.isLink) {
|
||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_LINK));
|
||||
}
|
||||
}
|
||||
nextTick(callback, [null, dirents]);
|
||||
return;
|
||||
}
|
||||
|
||||
nextTick(callback, [null, files]);
|
||||
};
|
||||
|
||||
fs.promises.readdir = util.promisify(fs.readdir);
|
||||
|
||||
const { readdirSync } = fs;
|
||||
fs.readdirSync = function (pathArgument, options) {
|
||||
fs.readdirSync = function (pathArgument, options = {}) {
|
||||
const { isAsar, asarPath, filePath } = splitPath(pathArgument);
|
||||
if (!isAsar) return readdirSync.apply(this, arguments);
|
||||
|
||||
@@ -614,6 +630,21 @@
|
||||
throw createError(AsarError.NOT_FOUND, { asarPath, filePath });
|
||||
}
|
||||
|
||||
if (options.withFileTypes) {
|
||||
const dirents = [];
|
||||
for (const file of files) {
|
||||
const stats = archive.stat(file);
|
||||
if (stats.isFile) {
|
||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
|
||||
} else if (stats.isDirectory) {
|
||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_DIR));
|
||||
} else if (stats.isLink) {
|
||||
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_LINK));
|
||||
}
|
||||
}
|
||||
return dirents;
|
||||
}
|
||||
|
||||
return files;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ const serializableTypes = [
|
||||
Date,
|
||||
Error,
|
||||
RegExp,
|
||||
ArrayBuffer,
|
||||
NativeImage
|
||||
ArrayBuffer
|
||||
];
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#Supported_types
|
||||
export function isSerializableObject (value: any) {
|
||||
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type);
|
||||
}
|
||||
@@ -34,18 +34,55 @@ const objectMap = function (source: Object, mapper: (value: any) => any) {
|
||||
return Object.fromEntries(targetEntries);
|
||||
};
|
||||
|
||||
export function serialize (value: any): any {
|
||||
if (value instanceof NativeImage) {
|
||||
const representations = [];
|
||||
for (const scaleFactor of value.getScaleFactors()) {
|
||||
const size = value.getSize(scaleFactor);
|
||||
const dataURL = value.toDataURL({ scaleFactor });
|
||||
function serializeNativeImage (image: any) {
|
||||
const representations = [];
|
||||
const scaleFactors = image.getScaleFactors();
|
||||
|
||||
// Use Buffer when there's only one representation for better perf.
|
||||
// This avoids compressing to/from PNG where it's not necessary to
|
||||
// ensure uniqueness of dataURLs (since there's only one).
|
||||
if (scaleFactors.length === 1) {
|
||||
const scaleFactor = scaleFactors[0];
|
||||
const size = image.getSize(scaleFactor);
|
||||
const buffer = image.toBitmap({ scaleFactor });
|
||||
representations.push({ scaleFactor, size, buffer });
|
||||
} else {
|
||||
// Construct from dataURLs to ensure that they are not lost in creation.
|
||||
for (const scaleFactor of scaleFactors) {
|
||||
const size = image.getSize(scaleFactor);
|
||||
const dataURL = image.toDataURL({ scaleFactor });
|
||||
representations.push({ scaleFactor, size, dataURL });
|
||||
}
|
||||
return { __ELECTRON_SERIALIZED_NativeImage__: true, representations };
|
||||
} else if (value instanceof Buffer) {
|
||||
return { __ELECTRON_SERIALIZED_Buffer__: true, data: value };
|
||||
} else if (Array.isArray(value)) {
|
||||
}
|
||||
return { __ELECTRON_SERIALIZED_NativeImage__: true, representations };
|
||||
}
|
||||
|
||||
function deserializeNativeImage (value: any) {
|
||||
const image = nativeImage.createEmpty();
|
||||
|
||||
// Use Buffer when there's only one representation for better perf.
|
||||
// This avoids compressing to/from PNG where it's not necessary to
|
||||
// ensure uniqueness of dataURLs (since there's only one).
|
||||
if (value.representations.length === 1) {
|
||||
const { buffer, size, scaleFactor } = value.representations[0];
|
||||
const { width, height } = size;
|
||||
image.addRepresentation({ buffer, scaleFactor, width, height });
|
||||
} else {
|
||||
// Construct from dataURLs to ensure that they are not lost in creation.
|
||||
for (const rep of value.representations) {
|
||||
const { dataURL, size, scaleFactor } = rep;
|
||||
const { width, height } = size;
|
||||
image.addRepresentation({ dataURL, scaleFactor, width, height });
|
||||
}
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
export function serialize (value: any): any {
|
||||
if (value instanceof NativeImage) {
|
||||
return serializeNativeImage(value);
|
||||
} if (Array.isArray(value)) {
|
||||
return value.map(serialize);
|
||||
} else if (isSerializableObject(value)) {
|
||||
return value;
|
||||
@@ -58,16 +95,7 @@ export function serialize (value: any): any {
|
||||
|
||||
export function deserialize (value: any): any {
|
||||
if (value && value.__ELECTRON_SERIALIZED_NativeImage__) {
|
||||
const image = nativeImage.createEmpty();
|
||||
for (const rep of value.representations) {
|
||||
const { size, scaleFactor, dataURL } = rep;
|
||||
const { width, height } = size;
|
||||
image.addRepresentation({ dataURL, scaleFactor, width, height });
|
||||
}
|
||||
return image;
|
||||
} else if (value && value.__ELECTRON_SERIALIZED_Buffer__) {
|
||||
const { buffer, byteOffset, byteLength } = value.data;
|
||||
return Buffer.from(buffer, byteOffset, byteLength);
|
||||
return deserializeNativeImage(value);
|
||||
} else if (Array.isArray(value)) {
|
||||
return value.map(deserialize);
|
||||
} else if (isSerializableObject(value)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ export const rendererModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'contextBridge', loader: () => require('./context-bridge') },
|
||||
{ name: 'crashReporter', loader: () => require('./crash-reporter') },
|
||||
{ name: 'ipcRenderer', loader: () => require('./ipc-renderer') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'webFrame', loader: () => require('./web-frame') }
|
||||
];
|
||||
|
||||
|
||||
10
lib/renderer/api/native-image.ts
Normal file
10
lib/renderer/api/native-image.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
import { deserialize } from '@electron/internal/common/type-utils';
|
||||
|
||||
const { nativeImage } = process._linkedBinding('electron_common_native_image');
|
||||
|
||||
nativeImage.createThumbnailFromPath = async (path: string, size: Electron.Size) => {
|
||||
return deserialize(await ipcRendererInternal.invoke('ELECTRON_NATIVE_IMAGE_CREATE_THUMBNAIL_FROM_PATH', path, size));
|
||||
};
|
||||
|
||||
export default nativeImage;
|
||||
@@ -5,7 +5,7 @@ const { hasSwitch } = process.electronBinding('command_line');
|
||||
const { NativeImage } = process.electronBinding('native_image');
|
||||
|
||||
const { CallbacksRegistry } = require('@electron/internal/renderer/remote/callbacks-registry');
|
||||
const { isPromise, isSerializableObject } = require('@electron/internal/common/type-utils');
|
||||
const { isPromise, isSerializableObject, serialize, deserialize } = require('@electron/internal/common/type-utils');
|
||||
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal');
|
||||
|
||||
const callbacksRegistry = new CallbacksRegistry();
|
||||
@@ -37,14 +37,7 @@ function wrapArgs (args, visited = new Set()) {
|
||||
}
|
||||
|
||||
if (value instanceof NativeImage) {
|
||||
const images = [];
|
||||
for (const scaleFactor of value.getScaleFactors()) {
|
||||
const size = value.getSize(scaleFactor);
|
||||
const buffer = value.toBitmap({ scaleFactor });
|
||||
const dataURL = value.toDataURL({ scaleFactor });
|
||||
images.push({ buffer, scaleFactor, size, dataURL });
|
||||
}
|
||||
return { type: 'nativeimage', value: images };
|
||||
return { type: 'nativeimage', value: serialize(value) };
|
||||
} else if (Array.isArray(value)) {
|
||||
visited.add(value);
|
||||
const meta = {
|
||||
@@ -226,6 +219,7 @@ function metaToValue (meta) {
|
||||
const types = {
|
||||
value: () => meta.value,
|
||||
array: () => meta.members.map((member) => metaToValue(member)),
|
||||
nativeimage: () => deserialize(meta.value),
|
||||
buffer: () => Buffer.from(meta.value.buffer, meta.value.byteOffset, meta.value.byteLength),
|
||||
promise: () => Promise.resolve({ then: metaToValue(meta.then) }),
|
||||
error: () => metaToError(meta),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import deprecate from '@electron/internal/common/api/deprecate';
|
||||
|
||||
const binding = process.electronBinding('web_frame');
|
||||
|
||||
@@ -47,14 +48,26 @@ class WebFrame extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
const { hasSwitch } = process.electronBinding('command_line');
|
||||
const worldSafeJS = hasSwitch('world-safe-execute-javascript') && hasSwitch('context-isolation');
|
||||
|
||||
// Populate the methods.
|
||||
for (const name in binding) {
|
||||
if (!name.startsWith('_')) { // some methods are manually populated above
|
||||
// TODO(felixrieseberg): Once we can type web_frame natives, we could
|
||||
// use a neat `keyof` here
|
||||
(WebFrame as any).prototype[name] = function (...args: Array<any>) {
|
||||
if (!worldSafeJS && name.startsWith('executeJavaScript')) {
|
||||
deprecate.log(`Security Warning: webFrame.${name} was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.`);
|
||||
}
|
||||
return binding[name](this.context, ...args);
|
||||
};
|
||||
// TODO(MarshallOfSound): Remove once the above deprecation is removed
|
||||
if (name.startsWith('executeJavaScript')) {
|
||||
(WebFrame as any).prototype[`_${name}`] = function (...args: Array<any>) {
|
||||
return binding[name](this.context, ...args);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,11 @@ export const webFrameInit = () => {
|
||||
ipcRendererUtils.handle('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (
|
||||
event, method: keyof WebFrameMethod, ...args: any[]
|
||||
) => {
|
||||
// TODO(MarshallOfSound): Remove once the world-safe-execute-javascript deprecation warning is removed
|
||||
if (method.startsWith('executeJavaScript')) {
|
||||
return (webFrame as any)[`_${method}`](...args);
|
||||
}
|
||||
|
||||
// The TypeScript compiler cannot handle the sheer number of
|
||||
// call signatures here and simply gives up. Incorrect invocations
|
||||
// will be caught by "keyof WebFrameMethod" though.
|
||||
|
||||
@@ -125,7 +125,11 @@ class LocationProxy {
|
||||
}
|
||||
|
||||
private getGuestURL (): URL | null {
|
||||
const urlString = this._invokeWebContentsMethodSync('getURL') as string;
|
||||
const maybeURL = this._invokeWebContentsMethodSync('getURL') as string;
|
||||
|
||||
// When there's no previous frame the url will be blank, so accountfor that here
|
||||
// to prevent url parsing errors on an empty string.
|
||||
const urlString = maybeURL !== '' ? maybeURL : 'about:blank';
|
||||
try {
|
||||
return new URL(urlString);
|
||||
} catch (e) {
|
||||
|
||||
@@ -13,7 +13,7 @@ export const moduleList: ElectronInternal.ModuleEntry[] = [
|
||||
},
|
||||
{
|
||||
name: 'nativeImage',
|
||||
loader: () => require('@electron/internal/common/api/native-image')
|
||||
loader: () => require('@electron/internal/renderer/api/native-image')
|
||||
},
|
||||
{
|
||||
name: 'webFrame',
|
||||
|
||||
@@ -45,6 +45,8 @@ const electron = require('electron');
|
||||
|
||||
const loadedModules = new Map([
|
||||
['electron', electron],
|
||||
['electron/common', electron],
|
||||
['electron/renderer', electron],
|
||||
['events', events],
|
||||
['timers', require('timers')],
|
||||
['url', require('url')]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "10.0.0-nightly.20200521",
|
||||
"version": "10.1.1",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
@@ -46,6 +46,7 @@
|
||||
"lint-staged": "^8.1.0",
|
||||
"minimist": "^1.2.0",
|
||||
"nugget": "^2.0.1",
|
||||
"null-loader": "^4.0.0",
|
||||
"pre-flight": "^1.1.0",
|
||||
"remark-cli": "^4.0.0",
|
||||
"remark-preset-lint-markdown-style-guide": "^2.1.1",
|
||||
|
||||
@@ -44,7 +44,6 @@ notification_provenance.patch
|
||||
content_browser_main_loop.patch
|
||||
dump_syms.patch
|
||||
command-ismediakey.patch
|
||||
tts.patch
|
||||
printing.patch
|
||||
support_mixed_sandbox_with_zygote.patch
|
||||
fix_disable_usage_of_abort_report_np_in_mas_builds.patch
|
||||
@@ -66,7 +65,6 @@ disable_compositor_recycling.patch
|
||||
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
|
||||
add_webmessageportconverter_entangleandinjectmessageportchannel.patch
|
||||
revert_remove_contentrendererclient_shouldfork.patch
|
||||
ignore_rc_check.patch
|
||||
@@ -75,7 +73,6 @@ chore_use_electron_resources_not_chrome_for_spellchecker.patch
|
||||
add_trustedauthclient_to_urlloaderfactory.patch
|
||||
feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
|
||||
accessible_pane_view.patch
|
||||
fixme_grit_conflicts.patch
|
||||
fix_use_the_new_mediaplaypause_key_listener_for_internal_chrome.patch
|
||||
use_electron_resources_in_pdf_util.patch
|
||||
hack_plugin_response_interceptor_to_point_to_electron.patch
|
||||
@@ -86,13 +83,21 @@ delay_lock_the_protocol_scheme_registry.patch
|
||||
gpu_notify_when_dxdiag_request_fails.patch
|
||||
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
|
||||
feat_add_onclose_to_messageport.patch
|
||||
fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
|
||||
web_contents.patch
|
||||
ui_gtk_public_header.patch
|
||||
crash_allow_embedder_to_set_crash_upload_url.patch
|
||||
crash_allow_setting_more_options.patch
|
||||
breakpad_treat_node_processes_as_browser_processes.patch
|
||||
upload_list_add_loadsync_method.patch
|
||||
breakpad_allow_getting_string_values_for_crash_keys.patch
|
||||
crash_allow_disabling_compression_on_linux.patch
|
||||
fix_hunspell_crash.patch
|
||||
fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
|
||||
allow_setting_secondary_label_via_simplemenumodel.patch
|
||||
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
|
||||
disable_unnecessary_ischromefirstrun_check.patch
|
||||
use_electron_resources_in_icon_reader_service.patch
|
||||
fix_include_missing_header_file.patch
|
||||
cherrypick_future_chrome_commit_to_remove_superfluous_dcheck.patch
|
||||
worker_feat_add_hook_to_notify_script_ready.patch
|
||||
provide_axtextchangevaluestartmarker_for_macos_a11y_value_change.patch
|
||||
allow_focus_to_move_into_an_editable_combobox_s_listbox.patch
|
||||
reconnect_p2p_socket_dispatcher_if_network_service_dies.patch
|
||||
|
||||
@@ -10,18 +10,18 @@ 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 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c44617086b946a80 100644
|
||||
index 7f26ef86fe967663a50bb556b49a37e1d10d5462..c83431034b9ddf0084f2ee2fc2538e4fb5aa0f0c 100644
|
||||
--- a/ui/base/accelerators/accelerator.cc
|
||||
+++ b/ui/base/accelerators/accelerator.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/logging.h"
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_util.h"
|
||||
+#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@@ -22,9 +23,7 @@
|
||||
@@ -23,9 +24,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,7 @@ index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c4461708
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
@@ -220,7 +219,15 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
@@ -204,7 +203,15 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
shortcut = KeyCodeToName();
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@ index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c4461708
|
||||
#if defined(OS_WIN)
|
||||
// Our fallback is to try translate the key code to a regular character
|
||||
// unless it is one of digits (VK_0 to VK_9). Some keyboard
|
||||
@@ -229,21 +236,14 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
@@ -213,21 +220,14 @@ base::string16 Accelerator::GetShortcutText() const {
|
||||
// accent' for '0'). For display in the menu (e.g. Ctrl-0 for the
|
||||
// default zoom level), we leave VK_[0-9] alone without translation.
|
||||
wchar_t key;
|
||||
@@ -75,7 +75,7 @@ index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c4461708
|
||||
}
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
@@ -426,7 +426,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
|
||||
@@ -410,7 +410,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
|
||||
// more information.
|
||||
if (IsCtrlDown())
|
||||
shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_CTRL_KEY);
|
||||
|
||||
@@ -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 4ba4a1505651f9e63c4476322a12762e46ac9c6b..39e81a63d549c690a040dd463d0300de01abf419 100644
|
||||
index 82f55455fe365f54bdc3eefac8bd538af13f642d..5da552f02472299e09bc33c5ab0aa184b62953a4 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -247,6 +247,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -255,6 +255,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
// to the GpuProcessHost once the GpuServiceImpl has started.
|
||||
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
|
||||
|
||||
@@ -24,8 +24,8 @@ index 4ba4a1505651f9e63c4476322a12762e46ac9c6b..39e81a63d549c690a040dd463d0300de
|
||||
// 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
|
||||
@@ -363,7 +367,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
}));
|
||||
@@ -389,7 +393,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
}
|
||||
#endif
|
||||
|
||||
- auto* client = GetContentClient()->gpu();
|
||||
|
||||
@@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 68822e9c91633d9433c52bdf3484f6c660eb7917..c14a7b2a1897f805f072d8156765f909f1410001 100644
|
||||
index 4e195f960d7b9bf50f6784ce380a84a10867914f..dbf85ffe8504bdbab1c4c29f085e5307654d42f6 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -114,6 +114,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
@@ -115,6 +115,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidHandleOnloadEvents() {}
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
@@ -23,10 +23,10 @@ index 68822e9c91633d9433c52bdf3484f6c660eb7917..c14a7b2a1897f805f072d8156765f909
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 1ca9dc1dab20fb1ca4d461fbe3068323ee6b9b44..95e9039217f44dcaf770ffea2979976e79d276ab 100644
|
||||
index 74e98485b4646b5e91ff2c15e85d85205df2851c..55af1205b90a1fce035a6b7abf1797fe20ea1f7b 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4865,6 +4865,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4741,6 +4741,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 1ca9dc1dab20fb1ca4d461fbe3068323ee6b9b44..95e9039217f44dcaf770ffea2979976e
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index b839ead18e704d6e3cbb9ee62882438ca91d4823..f54218f24522ee2d28462e127b52d8ba4d529330 100644
|
||||
index c6d8de45561cbcb6beeb6a28ce0517587b72a030..aef52b00d00392490d43cf7b7ef96ebad7b227e4 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -751,6 +751,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -719,6 +719,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index b839ead18e704d6e3cbb9ee62882438ca91d4823..f54218f24522ee2d28462e127b52d8ba
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index e07795d6a2726738e743f38dff795a98663eb71c..d7be6078425928c0e9577d8401e328e5ed2bef0c 100644
|
||||
index f0a05ead42b7a5eb70fc4e5cae13710391f14b5c..b1bbdcf6f69128b9943001a2b64e8a92e5148ab1 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -551,6 +551,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -550,6 +550,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -67,7 +67,7 @@ index e07795d6a2726738e743f38dff795a98663eb71c..d7be6078425928c0e9577d8401e328e5
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index 81457a2e2b5723aa2ff218b4e410d55d7b7f14f8..a62f6c58bb0aaac836edfd87ab2a6f61045059dc 100644
|
||||
index 5ac9a7ed3d0f91764452579992471c83104de64f..15ac214bc9177f2fc228cf93c459a7b385bdc582 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -201,6 +201,7 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -79,10 +79,10 @@ index 81457a2e2b5723aa2ff218b4e410d55d7b7f14f8..a62f6c58bb0aaac836edfd87ab2a6f61
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
index 9bcd5333f0a097a2fcfec60152cfbaace0e3c1da..21bd2c2c05fa32de9442877dbb0261066d2d59a3 100644
|
||||
index adc00866f436b59bd50881949379014222d71a50..71631b77c13ea1e6e8a4f558ef5ac5a09886218d 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
@@ -345,6 +345,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -363,6 +363,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -97,10 +97,10 @@ index 9bcd5333f0a097a2fcfec60152cfbaace0e3c1da..21bd2c2c05fa32de9442877dbb026106
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
index 5c554a74f4d3aca91d5a1428f0b1e871764a98b3..aeb930d769c9dbfeb97ca42b4e000ca5c79c49a6 100644
|
||||
index 23a196c72164b41bfff97d105957889cce3a7fbe..c702d1dc09b5026ab77a0ba8ec03c4d0cc7c2d67 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
@@ -78,6 +78,8 @@ class LocalFrameClientImpl final : public LocalFrameClient {
|
||||
@@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override;
|
||||
@@ -110,10 +110,10 @@ index 5c554a74f4d3aca91d5a1428f0b1e871764a98b3..aeb930d769c9dbfeb97ca42b4e000ca5
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index f7cbcbc3ded7362a5fa19b0b50808e88d23838e0..cbcc0996690c63c0e0af500ac229cccbdf047b7c 100644
|
||||
index 27ab3b3056c81ca367f45e0a1f7bd74a153353c4..790f7fac77677aad8c1d69c287273a9bf9436ac2 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -291,6 +291,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
@@ -297,6 +297,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
@@ -123,7 +123,7 @@ index f7cbcbc3ded7362a5fa19b0b50808e88d23838e0..cbcc0996690c63c0e0af500ac229cccb
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index 605166b7950a37f7d85d9a71af8c042bcbcefc8d..a1ac286dd231436e86c24c9aa65300a534d641de 100644
|
||||
index a3797ca04ff968d67ce4c5da6b9f17abc1d7651d..e3f26a61cdc4042131ea58d744a9b487dd6f52ca 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -336,6 +336,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
@@ -12,7 +12,7 @@ when we override ReallocateBufferMemory, so we therefore need to implement
|
||||
Realloc on the v8 side and correspondingly in gin.
|
||||
|
||||
diff --git a/gin/array_buffer.cc b/gin/array_buffer.cc
|
||||
index b94a71ef856f92404e16544e22ebbadf57cff363..b15685f6907bcafeb1acd62bfe76f0713dea27f3 100644
|
||||
index 124c2f72a5cbc2abe8c7686c32b61718d4c95d4b..fa4a478450cc97d231496ab82c74c1a94d1f3557 100644
|
||||
--- a/gin/array_buffer.cc
|
||||
+++ b/gin/array_buffer.cc
|
||||
@@ -43,6 +43,10 @@ void* ArrayBufferAllocator::AllocateUninitialized(size_t length) {
|
||||
@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
|
||||
|
||||
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
index 696a6170a584c1bb71c8ad253963d9f64395a13e..9677aa931cd543adfc1e9844d6afee8dcb0f4c2d 100644
|
||||
index fa88b2bd0233a4c5ff35a26d10e20fa1b91e33b2..21504ce01403d20067c8439c0c61ee0d71de84a5 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
@@ -661,6 +661,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
@@ -672,6 +672,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
size, ArrayBufferContents::kDontInitialize);
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ index 696a6170a584c1bb71c8ad253963d9f64395a13e..9677aa931cd543adfc1e9844d6afee8d
|
||||
ArrayBufferContents::FreeMemory(data);
|
||||
}
|
||||
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 fe4485a34797c93dba0626356716d729f223d905..65cf74482128d84a0b955af49bf83d7c097b4af1 100644
|
||||
index 5026ce05c5eb0be037ce4085488eb473828175a5..639173c18ddb743a4abe650cefdd94d257437262 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
|
||||
@@ -129,6 +129,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
|
||||
@@ -128,6 +128,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
|
||||
return AllocateMemoryWithFlags(size, policy, base::PartitionAllocReturnNull);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@ WebContents, and cancels the authentication if there's no WebContents
|
||||
available, which there isn't in the case of the 'net' module.
|
||||
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 18c3c5312be05333e6ed19ad53bb6296be5db4b7..21299b9959c3f9f44c419d769b0aaff59b1d89f7 100644
|
||||
index 6d15b6b5ff7b36b85f6b8200b76a32b285f0e675..c21234572976a6de7db5b0f2f7f44ec770832178 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -161,6 +161,25 @@ struct HttpAuthStaticNetworkContextParams {
|
||||
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
|
||||
@@ -214,6 +214,25 @@ struct CTPolicy {
|
||||
array<string> excluded_legacy_spkis;
|
||||
};
|
||||
|
||||
+interface TrustedAuthClient {
|
||||
@@ -39,7 +39,7 @@ index 18c3c5312be05333e6ed19ad53bb6296be5db4b7..21299b9959c3f9f44c419d769b0aaff5
|
||||
interface CertVerifierClient {
|
||||
Verify(
|
||||
int32 default_error,
|
||||
@@ -605,6 +624,8 @@ struct URLLoaderFactoryParams {
|
||||
@@ -640,6 +659,8 @@ struct URLLoaderFactoryParams {
|
||||
// impact because of the extra process hops, so use should be minimized.
|
||||
pending_remote<TrustedURLLoaderHeaderClient>? header_client;
|
||||
|
||||
@@ -49,18 +49,18 @@ index 18c3c5312be05333e6ed19ad53bb6296be5db4b7..21299b9959c3f9f44c419d769b0aaff5
|
||||
// the per-context allow patterns that is managed via NetworkContext
|
||||
// interface. This still respects the per-context block lists.
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2d7d1aa8a 100644
|
||||
index 9d2d455613fa7fa46d156876fa80a1be8a18a992..0cc2e561667dd1454409365a13d1daaced997c62 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -442,6 +442,7 @@ URLLoader::URLLoader(
|
||||
@@ -470,6 +470,7 @@ URLLoader::URLLoader(
|
||||
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
|
||||
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
|
||||
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
|
||||
+ mojom::TrustedURLLoaderAuthClient* url_loader_auth_client,
|
||||
mojom::OriginPolicyManager* origin_policy_manager,
|
||||
std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory)
|
||||
: url_request_context_(url_request_context),
|
||||
@@ -498,6 +499,11 @@ URLLoader::URLLoader(
|
||||
std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory,
|
||||
mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer)
|
||||
@@ -533,6 +534,11 @@ URLLoader::URLLoader(
|
||||
header_client_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
|
||||
}
|
||||
@@ -72,16 +72,16 @@ index a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2
|
||||
if (want_raw_headers_) {
|
||||
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
|
||||
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
|
||||
@@ -978,7 +984,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
|
||||
|
||||
void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
const net::AuthChallengeInfo& auth_info) {
|
||||
@@ -1060,7 +1066,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
// |this| may have been deleted.
|
||||
return;
|
||||
}
|
||||
- if (!network_context_client_) {
|
||||
+ if (!network_context_client_ && !auth_client_) {
|
||||
OnAuthCredentials(base::nullopt);
|
||||
return;
|
||||
}
|
||||
@@ -994,11 +1000,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
@@ -1076,11 +1082,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
if (url_request->response_headers())
|
||||
head->headers = url_request->response_headers();
|
||||
head->auth_challenge_info = auth_info;
|
||||
@@ -108,18 +108,18 @@ index a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2
|
||||
auth_challenge_responder_receiver_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index 4e95817834afd7b9d3a3284a5924646ff784e636..e26a90754565a548d72a74b2936f15ab5c71debb 100644
|
||||
index 33e6b100ef3ebfea62a9445bb8aa4b45034f7f25..b70780428d056e5306e215ba7d86a2e729ffaeda 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -112,6 +112,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
@@ -115,6 +115,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
|
||||
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
|
||||
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
|
||||
+ mojom::TrustedURLLoaderAuthClient* url_loader_auth_client,
|
||||
mojom::OriginPolicyManager* origin_policy_manager,
|
||||
std::unique_ptr<TrustTokenRequestHelperFactory>
|
||||
trust_token_helper_factory);
|
||||
@@ -443,6 +444,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
trust_token_helper_factory,
|
||||
@@ -456,6 +457,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
base::Optional<base::UnguessableToken> fetch_window_id_;
|
||||
|
||||
mojo::Remote<mojom::TrustedHeaderClient> header_client_;
|
||||
@@ -128,30 +128,30 @@ index 4e95817834afd7b9d3a3284a5924646ff784e636..e26a90754565a548d72a74b2936f15ab
|
||||
std::unique_ptr<FileOpenerForUpload> file_opener_for_upload_;
|
||||
|
||||
diff --git a/services/network/url_loader_factory.cc b/services/network/url_loader_factory.cc
|
||||
index 1c43785d9b2c19dd4129f030e3ec9475a9bb4b31..730635d7f18bf95100558c37a1d38304a22f650d 100644
|
||||
index c8f02a3760f938c772c9e81afff8b37e49a73cbd..7e5bb5d1384488de2dee3672f933eba643dc14f7 100644
|
||||
--- a/services/network/url_loader_factory.cc
|
||||
+++ b/services/network/url_loader_factory.cc
|
||||
@@ -68,6 +68,7 @@ URLLoaderFactory::URLLoaderFactory(
|
||||
@@ -75,6 +75,7 @@ URLLoaderFactory::URLLoaderFactory(
|
||||
resource_scheduler_client_(std::move(resource_scheduler_client)),
|
||||
header_client_(std::move(params_->header_client)),
|
||||
coep_reporter_(std::move(params_->coep_reporter)),
|
||||
+ auth_client_(std::move(params_->auth_client)),
|
||||
cors_url_loader_factory_(cors_url_loader_factory) {
|
||||
cors_url_loader_factory_(cors_url_loader_factory),
|
||||
cookie_observer_(std::move(params_->cookie_observer)) {
|
||||
DCHECK(context);
|
||||
DCHECK_NE(mojom::kInvalidProcessId, params_->process_id);
|
||||
@@ -230,6 +231,7 @@ void URLLoaderFactory::CreateLoaderAndStart(
|
||||
@@ -270,6 +271,7 @@ void URLLoaderFactory::CreateLoaderAndStart(
|
||||
std::move(keepalive_statistics_recorder),
|
||||
std::move(network_usage_accumulator),
|
||||
header_client_.is_bound() ? header_client_.get() : nullptr,
|
||||
+ auth_client_.is_bound() ? auth_client_.get() : nullptr,
|
||||
context_->origin_policy_manager(),
|
||||
url_request.trust_token_params
|
||||
? std::make_unique<TrustTokenRequestHelperFactory>(
|
||||
context_->origin_policy_manager(), std::move(trust_token_factory),
|
||||
std::move(cookie_observer));
|
||||
|
||||
diff --git a/services/network/url_loader_factory.h b/services/network/url_loader_factory.h
|
||||
index 1a623585035487de061ba6476914992ea2f7ac88..caa19dcd4b99296e50f8e22bfc92a70ba14473d1 100644
|
||||
index 8b29b67a5b0663778df3169e09bf818e6bbcec3f..e504fa3d41066907a3fbc41e69daac968415dfa6 100644
|
||||
--- a/services/network/url_loader_factory.h
|
||||
+++ b/services/network/url_loader_factory.h
|
||||
@@ -74,6 +74,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
|
||||
@@ -75,6 +75,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
|
||||
scoped_refptr<ResourceSchedulerClient> resource_scheduler_client_;
|
||||
mojo::Remote<mojom::TrustedURLLoaderHeaderClient> header_client_;
|
||||
mojo::Remote<mojom::CrossOriginEmbedderPolicyReporter> coep_reporter_;
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aaron Leventhal <aleventhal@chromium.org>
|
||||
Date: Tue, 21 Jul 2020 19:41:11 +0000
|
||||
Subject: Allow focus to move into an editable combobox's listbox
|
||||
|
||||
In bug 593646 (https://codereview.chromium.org/2024053003/) a rule was
|
||||
added, apparently similar to a rule in WebKit, that prevents
|
||||
aria-activedescendant on an editable combobox field from moving focus
|
||||
into its listbox. However, removing this condition fixes an issue where
|
||||
the first item is not read. It also improves the verbalization,
|
||||
providing the user with the positional info, e.g. "2 of 5".
|
||||
Removing this line also does not seem to break the example attached to
|
||||
bug 593646.
|
||||
|
||||
Bug: 1082865
|
||||
Change-Id: I4250fb152f4b06f3c57b300ebe7ef5549c58d624
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303789
|
||||
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
|
||||
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#790502}
|
||||
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index 90bdee0cf769e872f2e9585eb5055429f12a9eda..614ea21f46190b14832ddba1e621464558630eb0 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -142,11 +142,6 @@ BrowserAccessibility* BrowserAccessibilityManagerMac::GetFocus() const {
|
||||
if (!focus)
|
||||
return nullptr;
|
||||
|
||||
- // For editable combo boxes, focus should stay on the combo box so the user
|
||||
- // will not be taken out of the combo box while typing.
|
||||
- if (focus->GetRole() == ax::mojom::Role::kTextFieldWithComboBox)
|
||||
- return focus;
|
||||
-
|
||||
// Otherwise, follow the active descendant.
|
||||
return GetActiveDescendant(focus);
|
||||
}
|
||||
diff --git a/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt b/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
|
||||
index 05121ca639d0e891de51fb65a96659bcc97493c9..802bf5319941ec872dc21bd634979ca91ff33740 100644
|
||||
--- a/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
AXWebArea
|
||||
++AXGroup
|
||||
++++AXStaticText AXValue='State'
|
||||
-++AXComboBox AXAutocompleteValue='list' AXFocused=1 AXTitle='State'
|
||||
+++AXComboBox AXAutocompleteValue='list' AXTitle='State'
|
||||
++AXList
|
||||
++++AXStaticText AXValue='Alabama'
|
||||
-++++AXStaticText AXValue='Alaska'
|
||||
+++++AXStaticText AXFocused=1 AXValue='Alaska'
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt
|
||||
index 97c3c417f30812abecdde273f130088df86bd4ae..93ef79e311977bb4277842fa5332f6097faba837 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt
|
||||
@@ -1,2 +1,3 @@
|
||||
AXExpandedChanged on AXComboBox
|
||||
-AXSelectedChildrenChanged on AXComboBox
|
||||
+AXFocusedUIElementChanged on AXComboBox
|
||||
+AXSelectedChildrenChanged on AXComboBox
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt
|
||||
index 47ff72a2689baa23600ededfe38d79fd6b5bedcf..f7d4c30f49fe3f3f62132cddf59942181b8127b8 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt
|
||||
@@ -1 +1,2 @@
|
||||
-AXSelectedChildrenChanged on AXComboBox
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple"
|
||||
+AXSelectedChildrenChanged on AXComboBox
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
|
||||
index ec6b5552605fcb7fc4fdada1265d5f25ee637dce..4de438fffab3c86b81961e1d989cd71de237eaa4 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
|
||||
@@ -1,2 +1,3 @@
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
AXSelectedChildrenChanged on AXList
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt
|
||||
index 97cdb8b8b67d46e0a952d22765c823bd346aef3a..343feae3d79a48981cc1e27015ba2a93423eedc0 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt
|
||||
@@ -1,3 +1,4 @@
|
||||
AXExpandedChanged on AXComboBox
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
-AXSelectedChildrenChanged on AXList
|
||||
+AXSelectedChildrenChanged on AXList
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt
|
||||
index 2bfc70f5fecea2c2a5e7268cef641d6d0e7d4a47..ad5e2bf2c8029185c51eecc94cac1dbe7608c99e 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt
|
||||
@@ -1,3 +1,3 @@
|
||||
-AXFocusedUIElementChanged on AXComboBox
|
||||
-AXSelectedTextChanged on AXComboBox
|
||||
-AXSelectedTextChanged on AXWebArea
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple not selected"
|
||||
+AXSelectedTextChanged on AXStaticText AXValue="Apple not selected"
|
||||
+AXSelectedTextChanged on AXWebArea
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt
|
||||
index d5f21183c3d0a1c24cb6665194a93c3299dbfd56..9e7d0c0aaeb1c52dc1f1b3afed36f287851b89ff 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt
|
||||
@@ -1,5 +1,7 @@
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Orange"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
AXSelectedChildrenChanged on AXList
|
||||
=== Start Continuation ===
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Banana"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
-AXSelectedChildrenChanged on AXList
|
||||
+AXSelectedChildrenChanged on AXList
|
||||
\ No newline at end of file
|
||||
@@ -20,15 +20,15 @@ least harm in the interim by removing the check that prevents more than
|
||||
one tracker from existing at a time.
|
||||
|
||||
diff --git a/ui/gfx/x/x11_error_tracker.cc b/ui/gfx/x/x11_error_tracker.cc
|
||||
index af031de356c5e0938fd3b84a494e48dc9a0e0476..2a5c18dc473a4f88fc0427bec69142917159bbd9 100644
|
||||
index 6592ae0483884815697358040123eed5ee657816..d6862673c0b5a61db550c084291787ad1549db69 100644
|
||||
--- a/ui/gfx/x/x11_error_tracker.cc
|
||||
+++ b/ui/gfx/x/x11_error_tracker.cc
|
||||
@@ -24,7 +24,7 @@ namespace gfx {
|
||||
X11ErrorTracker::X11ErrorTracker() {
|
||||
// This is a non-exhaustive check for incorrect usage. It disallows nested
|
||||
// X11ErrorTracker instances on the same thread.
|
||||
- DCHECK(g_handler == NULL);
|
||||
+ // DCHECK(g_handler == NULL);
|
||||
- DCHECK(g_handler == nullptr);
|
||||
+ // DCHECK(g_handler == nullptr);
|
||||
g_handler = this;
|
||||
XSync(GetXDisplay(), False);
|
||||
old_handler_ = XSetErrorHandler(X11ErrorHandler);
|
||||
|
||||
@@ -6,19 +6,19 @@ Subject: allow new privileges in unsandboxed child processes
|
||||
This allows unsandboxed renderers to launch setuid processes on Linux.
|
||||
|
||||
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
|
||||
index e53e60ef146f8024e503f9ffad663a4d2dbc4f80..cee204cf6447c4b2a8cfd9c4ca257fe46af3e2e9 100644
|
||||
index e63dfcf43147c7174942277b2c129675014c9e59..7121ec638809c5964d22af496559cb7f46c794ef 100644
|
||||
--- a/content/browser/child_process_launcher_helper_linux.cc
|
||||
+++ b/content/browser/child_process_launcher_helper_linux.cc
|
||||
@@ -54,6 +54,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
@@ -53,6 +53,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
if (GetProcessType() == switches::kRendererProcess) {
|
||||
const int sandbox_fd = SandboxHostLinux::GetInstance()->GetChildSocket();
|
||||
options->fds_to_remap.push_back(
|
||||
std::make_pair(sandbox_fd, service_manager::GetSandboxFD()));
|
||||
options->fds_to_remap.push_back(std::make_pair(sandbox_fd, GetSandboxFD()));
|
||||
+
|
||||
+ // (For Electron), if we're launching without zygote, that means we're
|
||||
+ // launching an unsandboxed process (since all sandboxed processes are
|
||||
+ // forked from the zygote). Relax the allow_new_privs option to permit
|
||||
+ // launching suid processes from unsandboxed renderers.
|
||||
+ service_manager::ZygoteHandle zygote_handle =
|
||||
+ ZygoteHandle zygote_handle =
|
||||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
|
||||
+ ? nullptr
|
||||
+ : delegate_->GetZygote();
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Thu, 21 May 2020 13:58:01 -0700
|
||||
Subject: Allow setting secondary label via SimpleMenuModel
|
||||
|
||||
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
|
||||
|
||||
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
|
||||
index 0c37f6e2caead2f3004f1fbdd2abe7921ef4bea7..6f46775d96153d0c6a0795a1d6085f532daf985c 100644
|
||||
--- a/ui/base/models/simple_menu_model.cc
|
||||
+++ b/ui/base/models/simple_menu_model.cc
|
||||
@@ -53,6 +53,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
|
||||
return base::string16();
|
||||
}
|
||||
|
||||
+base::string16 SimpleMenuModel::Delegate::GetSecondaryLabelForCommandId(
|
||||
+ int command_id) const {
|
||||
+ return base::string16();
|
||||
+}
|
||||
+
|
||||
ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
|
||||
int command_id) const {
|
||||
return ImageModel();
|
||||
@@ -295,6 +300,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) {
|
||||
MenuItemsChanged();
|
||||
}
|
||||
|
||||
+void SimpleMenuModel::SetSecondaryLabel(int index, const base::string16& secondary_label) {
|
||||
+ items_[ValidateItemIndex(index)].secondary_label = secondary_label;
|
||||
+ MenuItemsChanged();
|
||||
+}
|
||||
+
|
||||
void SimpleMenuModel::SetMinorText(int index,
|
||||
const base::string16& minor_text) {
|
||||
items_[ValidateItemIndex(index)].minor_text = minor_text;
|
||||
@@ -372,6 +382,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
|
||||
return items_[ValidateItemIndex(index)].label;
|
||||
}
|
||||
|
||||
+base::string16 SimpleMenuModel::GetSecondaryLabelAt(int index) const {
|
||||
+ if (IsItemDynamicAt(index))
|
||||
+ return delegate_->GetSecondaryLabelForCommandId(GetCommandIdAt(index));
|
||||
+ return items_[ValidateItemIndex(index)].secondary_label;
|
||||
+}
|
||||
+
|
||||
base::string16 SimpleMenuModel::GetMinorTextAt(int index) const {
|
||||
return items_[ValidateItemIndex(index)].minor_text;
|
||||
}
|
||||
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
|
||||
index 5f1116ba19b8160a2fee008415b8841f056aad98..9c07e44c484a9a15b7d16d592311eb07d9b3734a 100644
|
||||
--- a/ui/base/models/simple_menu_model.h
|
||||
+++ b/ui/base/models/simple_menu_model.h
|
||||
@@ -48,6 +48,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
// Some command ids have labels and icons that change over time.
|
||||
virtual bool IsItemForCommandIdDynamic(int command_id) const;
|
||||
virtual base::string16 GetLabelForCommandId(int command_id) const;
|
||||
+ virtual base::string16 GetSecondaryLabelForCommandId(int command_id) const;
|
||||
// Gets the icon for the item with the specified id.
|
||||
virtual ImageModel GetIconForCommandId(int command_id) const;
|
||||
|
||||
@@ -151,6 +152,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
// Sets the label for the item at |index|.
|
||||
void SetLabel(int index, const base::string16& label);
|
||||
|
||||
+ // Sets the secondary_label for the item at |index|.
|
||||
+ void SetSecondaryLabel(int index, const base::string16& secondary_label);
|
||||
+
|
||||
// Sets the minor text for the item at |index|.
|
||||
void SetMinorText(int index, const base::string16& minor_text);
|
||||
|
||||
@@ -180,6 +184,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
|
||||
int GetCommandIdAt(int index) const override;
|
||||
base::string16 GetLabelAt(int index) const override;
|
||||
+ base::string16 GetSecondaryLabelAt(int index) const override;
|
||||
base::string16 GetMinorTextAt(int index) const override;
|
||||
ImageModel GetMinorIconAt(int index) const override;
|
||||
bool IsItemDynamicAt(int index) const override;
|
||||
@@ -216,6 +221,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
int command_id = 0;
|
||||
ItemType type = TYPE_COMMAND;
|
||||
base::string16 label;
|
||||
+ base::string16 secondary_label;
|
||||
base::string16 minor_text;
|
||||
ImageModel minor_icon;
|
||||
ImageModel icon;
|
||||
@@ -6,7 +6,7 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
|
||||
This allows file:// URLs in workers to have a CSP.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
index dc1858e41ce77fcb3cd9f828cc70ef9e09a23d15..8e1ffef4b630b4981cd37bd669b1187240bca280 100644
|
||||
index c8a4f02e69491345a6353e557b6bbdc34bb2999a..982995c8bf4632a2970c90780f3c2da3f244634e 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
|
||||
@@ -323,7 +323,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
|
||||
|
||||
@@ -11,7 +11,7 @@ In the long term we should investigate why it happened, and take a more
|
||||
formal fix. But for now I'm just make this assertion silently pass away.
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
|
||||
index e1378ffcd7e061aae635ad25078ee23674542786..6b07828930a9d5691609da394c192b9b5f531b5a 100644
|
||||
index ac84b10418753f1df8e9f21c9dbbe9dff2f85194..36146a5939c0cc70f18c0ffc459940e3ea041180 100644
|
||||
--- a/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
|
||||
+++ b/third_party/blink/renderer/platform/bindings/v8_object_constructor.cc
|
||||
@@ -98,8 +98,10 @@ v8::Local<v8::Function> V8ObjectConstructor::CreateInterfaceObject(
|
||||
|
||||
@@ -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 89028fddac1f32a619a3d0b9216932515ef0ed86..c1ba8ffd313256001c99ad605906c11cd06274e9 100644
|
||||
index 6032e38bfd641f96db44ac75beb07c5b035da840..a693d3936c493296072796c1c557790139af3d34 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -469,10 +469,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -539,10 +539,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
CHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -28,7 +28,7 @@ index 89028fddac1f32a619a3d0b9216932515ef0ed86..c1ba8ffd313256001c99ad605906c11c
|
||||
if (!Client())
|
||||
return;
|
||||
|
||||
@@ -490,6 +486,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -560,6 +556,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();
|
||||
|
||||
@@ -7,24 +7,23 @@ This exposes a method for obtaining a reference to an isolated world, which is
|
||||
otherwise not available in the Blink API.
|
||||
|
||||
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
|
||||
index 8231ed74df9c031a594eb1be607b171a78531010..c5621d9e7dc4f1c2a0c79a1d07e833874378b950 100644
|
||||
index 2b6ac1ab4377695246f09de772c17db1a0fa0fe4..1d8dd050662db2197d571b677e4c2bc255d56255 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame.h
|
||||
@@ -335,6 +335,9 @@ class WebLocalFrame : public WebFrame {
|
||||
// be calling this API.
|
||||
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
|
||||
|
||||
@@ -355,6 +355,8 @@ class WebLocalFrame : public WebFrame {
|
||||
// Returns the world ID associated with |script_context|.
|
||||
virtual int32_t GetScriptContextWorldId(
|
||||
v8::Local<v8::Context> script_context) const = 0;
|
||||
+ virtual v8::Local<v8::Context> WorldScriptContext(
|
||||
+ v8::Isolate* isolate, int world_id) const = 0;
|
||||
+
|
||||
|
||||
// Executes script in the context of the current page and returns the value
|
||||
// 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 f8e90a17ca7cec06613b396a4e8351381772b692..008737d979c82bd1b07144a21f1c39de48c210a2 100644
|
||||
index 74cc39af0a7c528ebf78954927dd022e44711981..f92da67a14ee2799c405ea038936d3d0d30e71a7 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
|
||||
@@ -923,6 +923,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
@@ -971,6 +971,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
return MainWorldScriptContext()->Global();
|
||||
}
|
||||
|
||||
@@ -39,13 +38,13 @@ index f8e90a17ca7cec06613b396a4e8351381772b692..008737d979c82bd1b07144a21f1c39de
|
||||
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 c80168558ff46553667f70f9fa82bf19ce5ecbce..1bc72e14acd253615c73571ac82e9970f5b91196 100644
|
||||
index 4555bd981a201899158711e54f943f67b951266c..43aeda11b6c7c51220b7cd32be5a6e6c266218be 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
|
||||
@@ -161,6 +161,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]) override;
|
||||
@@ -166,6 +166,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
v8::Local<v8::Context> MainWorldScriptContext() const override;
|
||||
int32_t GetScriptContextWorldId(
|
||||
v8::Local<v8::Context> script_context) const override;
|
||||
+ v8::Local<v8::Context> WorldScriptContext(
|
||||
+ v8::Isolate* isolate, int world_id) const override;
|
||||
void RequestExecuteScriptAndReturnValue(const WebScriptSource&,
|
||||
|
||||
@@ -10,10 +10,10 @@ breakpad independently, as a "browser" process. This patches
|
||||
crash annotation.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index bb0c6aebb4fdb9b24de8292a3f1c8dc77f21e051..4bd9bfebb4e5119a5cdc48bb322745cfd9f98c02 100644
|
||||
index a3599b4403b7be33cb4aa300746c3ade962627de..342f16a4c8418c1e56703d8969d0f31d834ad74c 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -718,8 +718,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
|
||||
@@ -719,8 +719,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
|
||||
log_path[log_path_len] = '\0';
|
||||
info.log_filename = log_path;
|
||||
#endif
|
||||
@@ -29,7 +29,7 @@ index bb0c6aebb4fdb9b24de8292a3f1c8dc77f21e051..4bd9bfebb4e5119a5cdc48bb322745cf
|
||||
info.distro = base::g_linux_distro;
|
||||
info.distro_length = my_strlen(base::g_linux_distro);
|
||||
info.upload = upload;
|
||||
@@ -2040,8 +2045,13 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
@@ -2041,8 +2046,13 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
process_type == kWebViewSingleProcessType ||
|
||||
process_type == kBrowserProcessType ||
|
||||
#endif
|
||||
|
||||
@@ -8,13 +8,13 @@ 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 97fe778a121a1fd3658db8c00d621a72c12e82d2..661a0ee2deff4dc1c4180ade161c9ff17cfc0226 100644
|
||||
index 31f563dd4d59ce23c1c6e31aa80c68089e5f2195..1a6b644ce88a5aece4382b66479da60e21194564 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -74,6 +74,7 @@
|
||||
@@ -73,6 +73,7 @@
|
||||
X("drmcursor") \
|
||||
X("dwrite") \
|
||||
X("DXVA Decoding") \
|
||||
X("EarlyJava") \
|
||||
+ X("electron") \
|
||||
X("evdev") \
|
||||
X("event") \
|
||||
|
||||
@@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
|
||||
rebuild the entire tree.
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index 6f5d5f123f89c5ef4dd601eddb6025bd4dc3b9ab..b39aa4b3181489e5ea270c6cd3f30adfbb9847a0 100644
|
||||
index 4cc6bfc45e647e656934b331793faef1ba0f4b14..b585c11f9b43bfd9f0d79dc5103fd844224e3586 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index baee2af78cd679e458c336786326957b6ea32440..5aa26ca8eb3d5128cc217950fe8bba27b44c26b6 100644
|
||||
index 0e54861c260ecfa1635ee56c1c9e931914afe901..948e3e5cf64f74ae560c64d0490c22a810d0d96f 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -4363,6 +4363,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -4823,6 +4823,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
@@ -21,10 +21,10 @@ index baee2af78cd679e458c336786326957b6ea32440..5aa26ca8eb3d5128cc217950fe8bba27
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 6883f29361bab9a78ba93da92e7bd234f62e2f8f..6a18c7085f102d475bd36925106e86c56812accc 100644
|
||||
index 1db46cd9bee49617a045753340d35e0e74ebf1ed..b62a639e51886ddc500d7aa78aa2f9c2efc75514 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2962,9 +2962,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3091,9 +3091,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
|
||||
}
|
||||
|
||||
if (delegate_) {
|
||||
@@ -38,10 +38,10 @@ index 6883f29361bab9a78ba93da92e7bd234f62e2f8f..6a18c7085f102d475bd36925106e86c5
|
||||
|
||||
for (auto& observer : observers_) {
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index ce836b666eaca4312b01dec1cb012bbcb23b9050..9009a8b7a23e170ab0fbf81a6d157e18fa4e1769 100644
|
||||
index 40821a2c3d7cf13136944e5bc6852047045a6be2..90c3ab998a8707eb91fc016ce56e9248194deeeb 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -305,6 +305,10 @@ struct CreateNewWindowParams {
|
||||
@@ -278,6 +278,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// The window features to use for the new window.
|
||||
blink.mojom.WindowFeatures features;
|
||||
@@ -53,10 +53,10 @@ index ce836b666eaca4312b01dec1cb012bbcb23b9050..9009a8b7a23e170ab0fbf81a6d157e18
|
||||
|
||||
// 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 5990228237b99f382ba235a4bc59068ab12168de..c9fc489ded15dc3cfcdd71c86707e6e86a7e6ba3 100644
|
||||
index 87375b2ef10c24b5d8d0f604f6a9ee601a706a0c..84ca4325a72a5c4267d43e5be9bfd7b73efa0b86 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -508,6 +508,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -529,6 +529,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -66,18 +66,18 @@ index 5990228237b99f382ba235a4bc59068ab12168de..c9fc489ded15dc3cfcdd71c86707e6e8
|
||||
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 7c7a70b95873ed089e311cc0917ad32d8e465a4e..2d8d316f948fbc25fd4b1aa899b38ba2607e24a1 100644
|
||||
index edf60410ba571866b03968804543188f7f00c088..00f3f557ccf69760c4e0ac7c9fcc7d048e21e8d8 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -144,6 +144,7 @@ class NetworkService;
|
||||
@@ -147,6 +147,7 @@ class NetworkService;
|
||||
class TrustedURLLoaderHeaderClient;
|
||||
} // namespace mojom
|
||||
struct ResourceRequest;
|
||||
+class ResourceRequestBody;
|
||||
} // namespace network
|
||||
|
||||
namespace rappor {
|
||||
@@ -831,6 +832,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
namespace sandbox {
|
||||
@@ -849,6 +850,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -87,7 +87,7 @@ index 7c7a70b95873ed089e311cc0917ad32d8e465a4e..2d8d316f948fbc25fd4b1aa899b38ba2
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
|
||||
index 17281521f8109279fe68e11abc2fcec41cfdf9c0..83b951dcf55b54661c8f855a8e10984d262c91b2 100644
|
||||
index 50936cd961bf4d0e026ee3d150a34892e94601dd..f62a39dc9904f4edd7cc4e407c3d1ec58c0853c8 100644
|
||||
--- a/content/public/browser/web_contents_delegate.cc
|
||||
+++ b/content/public/browser/web_contents_delegate.cc
|
||||
@@ -26,6 +26,17 @@ namespace content {
|
||||
@@ -109,7 +109,7 @@ index 17281521f8109279fe68e11abc2fcec41cfdf9c0..83b951dcf55b54661c8f855a8e10984d
|
||||
const OpenURLParams& params) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index d10b0f458416044f0b5eaeac4160ac26a2857d94..4e3a846a3825216e1a77e17fd8e03331c6fb927b 100644
|
||||
index e545ff70c612e98cdd79230303273a3ec7bfcaac..405152e0e90bc76b7de9c3e6946944f3ad852e5d 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -119,8 +119,8 @@ index d10b0f458416044f0b5eaeac4160ac26a2857d94..4e3a846a3825216e1a77e17fd8e03331
|
||||
+#include "content/common/frame.mojom.h"
|
||||
#include "content/public/browser/bluetooth_chooser.h"
|
||||
#include "content/public/browser/bluetooth_scanning_prompt.h"
|
||||
#include "content/public/browser/invalidate_type.h"
|
||||
@@ -327,6 +328,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
#include "content/public/browser/eye_dropper.h"
|
||||
@@ -337,6 +338,13 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
const std::string& partition_id,
|
||||
SessionStorageNamespace* session_storage_namespace);
|
||||
|
||||
@@ -135,18 +135,18 @@ index d10b0f458416044f0b5eaeac4160ac26a2857d94..4e3a846a3825216e1a77e17fd8e03331
|
||||
// typically happens when popups are created.
|
||||
virtual void WebContentsCreated(WebContents* source_contents,
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index 2a33016a5e54bbabfa8c534b954f6c72822ca70d..ea7084056f13c60bcc3ba8bd4991a924b6153ee2 100644
|
||||
index efab61352658f6d1dc9370c8826af25e22b97b38..c1b0d1f5f7acb82f559ba90f24b6f9e5e7c44dad 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -68,6 +68,7 @@
|
||||
#include "content/renderer/ime_event_guard.h"
|
||||
@@ -67,6 +67,7 @@
|
||||
#include "content/renderer/history_serialization.h"
|
||||
#include "content/renderer/internal_document_state_data.h"
|
||||
#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/render_frame_impl.h"
|
||||
#include "content/renderer/render_frame_proxy.h"
|
||||
@@ -1245,6 +1246,10 @@ WebView* RenderViewImpl::CreateView(
|
||||
@@ -1235,6 +1236,10 @@ WebView* RenderViewImpl::CreateView(
|
||||
}
|
||||
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
||||
|
||||
@@ -158,10 +158,10 @@ index 2a33016a5e54bbabfa8c534b954f6c72822ca70d..ea7084056f13c60bcc3ba8bd4991a924
|
||||
// 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 a10476afec548da09e44c1ea565c0ca7c9f902db..2b9d7fe3f57fa50036e8fc2e33daaae94ccbdcda 100644
|
||||
index 1d17a41e553bf4d7181a1dcfac9f9e379b6dffcb..384d7150daaeda547e0085e3031b706784ceb7dd 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
|
||||
@@ -395,6 +395,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -399,6 +399,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -171,10 +171,10 @@ index a10476afec548da09e44c1ea565c0ca7c9f902db..2b9d7fe3f57fa50036e8fc2e33daaae9
|
||||
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 b59e7c255d90996dec1f02170ffa4e1d3ec2a0c6..56db656bd2b19ca2ae90ace6c813a719a6266217 100644
|
||||
index 21f7e0d85006bc35872c237b98a14d9644bb1488..d3fef30d9731e4cc6cfe404003b9b1fa8cea53e1 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
|
||||
@@ -78,6 +78,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
@@ -79,6 +79,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -206,14 +206,14 @@ index 4f735ad0d97eaac9a57dad137e479f8a7ec33a36..0a3c5821962c85609b64b3625fa6b8d6
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
index 8029e46e91697d6a8c1349519d2c6e68bfb443a5..4b75b3e28938e092bc575117bc6ed5c7607baf74 100644
|
||||
index 3ac97b71b1b97c5bd105af2ea7df467ab0649544..0c17598fe4e6633ea84749e0fbf7f01d3dd9cd1f 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
@@ -1768,6 +1768,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
@@ -2021,6 +2021,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
}
|
||||
|
||||
WebWindowFeatures window_features = GetWindowFeaturesFromString(features);
|
||||
+ window_features.raw_features = features;
|
||||
|
||||
FrameLoadRequest frame_request(active_document,
|
||||
FrameLoadRequest frame_request(incumbent_window->document(),
|
||||
ResourceRequest(completed_url));
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Locascio <andy@slack-corp.com>
|
||||
Date: Wed, 22 Jul 2020 11:33:03 -0400
|
||||
Subject: cherrypick future chrome commit to remove superfluous DCHECK
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2273957
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/html/canvas/text_metrics.cc b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
index d3fadad089cce5ce653264d1e219c979d2038688..f1ad599a020dd207651a9d9eb809f39f956a8911 100644
|
||||
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
@@ -100,19 +100,6 @@ void TextMetrics::Update(const Font& font,
|
||||
xpos += run_width;
|
||||
}
|
||||
double real_width = xpos;
|
||||
-#if DCHECK_IS_ON()
|
||||
- // This DCHECK is for limited time only; to use |glyph_bounds| instead of
|
||||
- // |BoundingBox| and make sure they are compatible.
|
||||
- if (runs.size() == 1 && direction == runs[0].Direction()) {
|
||||
- FloatRect bbox = font.BoundingBox(text_run);
|
||||
- // |GetCharacterRange|, the underlying function of |BoundingBox|, clamps
|
||||
- // negative |MaxY| to 0. This is unintentional, and that we are not copying
|
||||
- // the behavior.
|
||||
- DCHECK_EQ(bbox.Y(), std::min(glyph_bounds.Y(), .0f));
|
||||
- DCHECK_EQ(bbox.MaxY(), std::max(glyph_bounds.MaxY(), .0f));
|
||||
- DCHECK_EQ(bbox.Width(), real_width);
|
||||
- }
|
||||
-#endif
|
||||
width_ = real_width;
|
||||
|
||||
float dx = 0.0f;
|
||||
diff --git a/third_party/blink/renderer/platform/fonts/font.cc b/third_party/blink/renderer/platform/fonts/font.cc
|
||||
index 2cb10421dcc44d17add0e813cf6847d8efe1905d..7d9f98145237c94e6136eddbd60ad6804eb3ad45 100644
|
||||
--- a/third_party/blink/renderer/platform/fonts/font.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font.cc
|
||||
@@ -484,14 +484,6 @@ FloatRect Font::SelectionRectForText(const TextRun& run,
|
||||
FloatRect(point.X() + range.start, point.Y(), range.Width(), height));
|
||||
}
|
||||
|
||||
-FloatRect Font::BoundingBox(const TextRun& run, int from, int to) const {
|
||||
- to = (to == -1 ? run.length() : to);
|
||||
- FontCachePurgePreventer purge_preventer;
|
||||
- CachingWordShaper shaper(*this);
|
||||
- CharacterRange range = shaper.GetCharacterRange(run, from, to);
|
||||
- return FloatRect(range.start, -range.ascent, range.Width(), range.Height());
|
||||
-}
|
||||
-
|
||||
int Font::OffsetForPosition(const TextRun& run,
|
||||
float x_float,
|
||||
IncludePartialGlyphsOption partial_glyphs,
|
||||
diff --git a/third_party/blink/renderer/platform/fonts/font.h b/third_party/blink/renderer/platform/fonts/font.h
|
||||
index b6dbb6f31e6f48ac1f7e0ceb386a63e0cbaf67f1..8864a71c4c3441e0cb639d86b3ebda2e66014586 100644
|
||||
--- a/third_party/blink/renderer/platform/fonts/font.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font.h
|
||||
@@ -162,7 +162,6 @@ class PLATFORM_EXPORT Font {
|
||||
float height,
|
||||
int from = 0,
|
||||
int to = -1) const;
|
||||
- FloatRect BoundingBox(const TextRun&, int from = 0, int to = -1) const;
|
||||
CharacterRange GetCharacterRange(const TextRun&,
|
||||
unsigned from,
|
||||
unsigned to) const;
|
||||
@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
|
||||
Electrons grit header instead of Chromes
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index f853ba4924c5730cc9b0eafc2d15dbf3c1341542..9bb35ad9a3918d5fea8d66eb7f29c50058c87afc 100644
|
||||
index 995b99c5ba9d388de83d6a4dc30bf0ae74fbeb4a..879703baee2017a272e4b8d2f4ce976ed712e155 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -5313,6 +5313,7 @@ jumbo_static_library("browser") {
|
||||
@@ -5538,6 +5538,7 @@ static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
@@ -19,7 +19,7 @@ index f853ba4924c5730cc9b0eafc2d15dbf3c1341542..9bb35ad9a3918d5fea8d66eb7f29c500
|
||||
|
||||
if (!is_android) {
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fae4ee67ca 100644
|
||||
index cf9c14cddfdf94d3819f42918ac3687b7b005e44..1379322e526fad5735c8caaaf813ca540534b3b8 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@@ -3,17 +3,8 @@ From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Wed, 10 Oct 2018 15:07:34 -0700
|
||||
Subject: command-ismediakey.patch
|
||||
|
||||
Override MediaKeysListener::IsMediaKeycode to also listen for Volume Up, Volume Down,
|
||||
and Mute. We also need to patch out Chromium's usage of RemoteCommandCenterDelegate, as
|
||||
it uses MPRemoteCommandCenter. MPRemoteCommandCenter makes it such that GlobalShortcuts
|
||||
in Electron will not work as intended, because by design an app does not receive remote
|
||||
control events until it begins playing audio. This means that a media shortcut would not kick
|
||||
into effect until you, for example, began playing a YouTube video which sort of defeats the
|
||||
purpose of GlobalShortcuts.
|
||||
|
||||
At the moment there is no upstream possibility for this; but perhaps Chromium may
|
||||
consider some kind of switch, enabled by default, which would conditionally choose to avoid usage of
|
||||
RemoteCommandCenterDelegate on macOS.
|
||||
Override MediaKeysListener::IsMediaKeycode and associated functions to also listen for
|
||||
Volume Up, Volume Down, and Mute.
|
||||
|
||||
Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
|
||||
and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
|
||||
@@ -41,10 +32,10 @@ index c5125495b4d178ffb18be4d2d9670f7556412cbd..cddb321abb938c667a4a2089f87eab99
|
||||
// Create an observer that registers a hot key for |accelerator|.
|
||||
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
index 9b6bba3ed87cae8ecc4288d01e5e7a3f74f71510..a4e4a5d6f1096754bf20c3438f47ebe60147f184 100644
|
||||
index a33ff046e940880f9c1ad15769325b0dac22ee43..a4cf5dd70cd2ab6a5246b06790f2f7f6c9fd8631 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
@@ -39,6 +39,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
|
||||
@@ -38,6 +38,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
|
||||
modifiers |= accelerator.IsShiftDown() ? ShiftMask : 0;
|
||||
modifiers |= accelerator.IsCtrlDown() ? ControlMask : 0;
|
||||
modifiers |= accelerator.IsAltDown() ? Mod1Mask : 0;
|
||||
@@ -67,10 +58,10 @@ index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc
|
||||
|
||||
} // namespace ui
|
||||
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
index 85378bb565de617b1bd611d28c8714361747a357..36de4c0b0353be2418dacd388e92d7c38a7ee139 100644
|
||||
index 6052fd13ff3d63cf8a4b019b058efb61aad39c3b..42eac7a7b656096c1d2039e340037ac8a70678c9 100644
|
||||
--- a/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
@@ -32,6 +32,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
|
||||
@@ -33,6 +33,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
|
||||
case NX_KEYTYPE_NEXT:
|
||||
case NX_KEYTYPE_FAST:
|
||||
return VKEY_MEDIA_NEXT_TRACK;
|
||||
@@ -83,7 +74,7 @@ index 85378bb565de617b1bd611d28c8714361747a357..36de4c0b0353be2418dacd388e92d7c3
|
||||
}
|
||||
return VKEY_UNKNOWN;
|
||||
}
|
||||
@@ -192,7 +198,10 @@ CGEventRef MediaKeysListenerImpl::EventTapCallback(CGEventTapProxy proxy,
|
||||
@@ -193,7 +199,10 @@ CGEventRef MediaKeysListenerImpl::EventTapCallback(CGEventTapProxy proxy,
|
||||
int key_code = (data1 & 0xFFFF0000) >> 16;
|
||||
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
|
||||
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&
|
||||
@@ -95,3 +86,31 @@ index 85378bb565de617b1bd611d28c8714361747a357..36de4c0b0353be2418dacd388e92d7c3
|
||||
return event;
|
||||
}
|
||||
|
||||
diff --git a/ui/base/accelerators/system_media_controls_media_keys_listener.cc b/ui/base/accelerators/system_media_controls_media_keys_listener.cc
|
||||
index 9d6084ceaccfd071549e63e3015f55ef292312ec..846210b04d6e2e193413c643296938ec550f6d25 100644
|
||||
--- a/ui/base/accelerators/system_media_controls_media_keys_listener.cc
|
||||
+++ b/ui/base/accelerators/system_media_controls_media_keys_listener.cc
|
||||
@@ -65,6 +65,11 @@ bool SystemMediaControlsMediaKeysListener::StartWatchingMediaKey(
|
||||
case VKEY_MEDIA_STOP:
|
||||
service_->SetIsStopEnabled(true);
|
||||
break;
|
||||
+ case VKEY_VOLUME_DOWN:
|
||||
+ case VKEY_VOLUME_UP:
|
||||
+ case VKEY_VOLUME_MUTE:
|
||||
+ // Do nothing.
|
||||
+ break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -97,6 +102,11 @@ void SystemMediaControlsMediaKeysListener::StopWatchingMediaKey(
|
||||
case VKEY_MEDIA_STOP:
|
||||
service_->SetIsStopEnabled(false);
|
||||
break;
|
||||
+ case VKEY_VOLUME_DOWN:
|
||||
+ case VKEY_VOLUME_UP:
|
||||
+ case VKEY_VOLUME_MUTE:
|
||||
+ // Do nothing.
|
||||
+ break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
@@ -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 a4044d94e4cd420edecc98482f0d1cb4b8707039..036b9b5001d053bc8dab781b9c30c37a019f7a1e 100644
|
||||
index 4ada8596176e8581f8e5db15f91c1cd70f41d7e9..4d600e5d34a0a7514c17c7d02bdabdc796660c9a 100644
|
||||
--- a/content/browser/browser_main_loop.cc
|
||||
+++ b/content/browser/browser_main_loop.cc
|
||||
@@ -1491,7 +1491,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
@@ -1436,7 +1436,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
NOTREACHED();
|
||||
#else
|
||||
base::RunLoop run_loop;
|
||||
|
||||
@@ -13,10 +13,10 @@ Ultimately we should remove the option to disable compression, and
|
||||
subsequently remove this patch.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 4bd9bfebb4e5119a5cdc48bb322745cfd9f98c02..a897622de0ea7a9e79955d7b80dfeafe3ec6fc94 100644
|
||||
index 342f16a4c8418c1e56703d8969d0f31d834ad74c..454e1c0d58a39cbf23da32f56af7cdf16e9085f0 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -108,6 +108,8 @@ void SetUploadURL(const std::string& url) {
|
||||
@@ -109,6 +109,8 @@ void SetUploadURL(const std::string& url) {
|
||||
DCHECK(!g_upload_url);
|
||||
g_upload_url = strdup(url.c_str());
|
||||
}
|
||||
@@ -25,7 +25,7 @@ index 4bd9bfebb4e5119a5cdc48bb322745cfd9f98c02..a897622de0ea7a9e79955d7b80dfeafe
|
||||
#endif
|
||||
|
||||
bool g_is_node = false;
|
||||
@@ -1335,56 +1337,60 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
@@ -1336,56 +1338,60 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
|
||||
#else // defined(OS_CHROMEOS)
|
||||
|
||||
@@ -127,7 +127,7 @@ index 4bd9bfebb4e5119a5cdc48bb322745cfd9f98c02..a897622de0ea7a9e79955d7b80dfeafe
|
||||
static const char header_msg[] =
|
||||
"--header=Content-Type: multipart/form-data; boundary=";
|
||||
const size_t header_content_type_size =
|
||||
@@ -1411,7 +1417,8 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
@@ -1412,7 +1418,8 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
static const char kWgetBinary[] = "/usr/bin/wget";
|
||||
const char* args[] = {
|
||||
kWgetBinary,
|
||||
@@ -137,7 +137,7 @@ index 4bd9bfebb4e5119a5cdc48bb322745cfd9f98c02..a897622de0ea7a9e79955d7b80dfeafe
|
||||
header_content_type,
|
||||
post_file,
|
||||
g_upload_url,
|
||||
@@ -2054,6 +2061,7 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
@@ -2055,6 +2062,7 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
|
||||
#if !defined(OS_CHROMEOS)
|
||||
SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Date: Wed, 13 May 2020 19:06:23 +0000
|
||||
Subject: allow embedder to set crash upload url
|
||||
|
||||
Currently //components/crash hard-codes the crash report URL to be a
|
||||
Google-specific target. This CL adds a hook which allows embedders to override
|
||||
this URL. Without it, this module isn't usable for non-Google embedders.
|
||||
|
||||
Change-Id: I1251c3ef164f04de63cf8c66165180e897a91d78
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2194585
|
||||
Commit-Queue: Jeremy Apthorp <jeremya@chromium.org>
|
||||
Reviewed-by: Robert Sesek <rsesek@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#768385}
|
||||
|
||||
diff --git a/components/crash/core/app/BUILD.gn b/components/crash/core/app/BUILD.gn
|
||||
index bb11c401ca7939ca04e90fd13f1b335bf5b60598..af031a027ee3e19e57e9c4d9a133127a3a637003 100644
|
||||
--- a/components/crash/core/app/BUILD.gn
|
||||
+++ b/components/crash/core/app/BUILD.gn
|
||||
@@ -22,7 +22,10 @@ source_set("lib") {
|
||||
"crash_reporter_client.h",
|
||||
]
|
||||
|
||||
- deps = [ "//base" ]
|
||||
+ deps = [
|
||||
+ "//base",
|
||||
+ "//build:branding_buildflags",
|
||||
+ ]
|
||||
}
|
||||
|
||||
source_set("crashpad_handler_main") {
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 192b0a7f137f311abb6a991f997e11f5eba52256..8ca43e2a8a104c3edf4087df5490fd47cd18f9a4 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -103,7 +103,11 @@ namespace {
|
||||
// while we do have functions to deal with uint64_t's.
|
||||
uint64_t g_crash_loop_before_time = 0;
|
||||
#else
|
||||
-const char kUploadURL[] = "https://clients2.google.com/cr/report";
|
||||
+char* g_upload_url = nullptr;
|
||||
+void SetUploadURL(const std::string& url) {
|
||||
+ DCHECK(!g_upload_url);
|
||||
+ g_upload_url = strdup(url.c_str());
|
||||
+}
|
||||
#endif
|
||||
|
||||
bool g_is_crash_reporter_enabled = false;
|
||||
@@ -1400,16 +1404,16 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
|
||||
static const char kWgetBinary[] = "/usr/bin/wget";
|
||||
const char* args[] = {
|
||||
- kWgetBinary,
|
||||
- header_content_encoding,
|
||||
- header_content_type,
|
||||
- post_file,
|
||||
- kUploadURL,
|
||||
- "--timeout=10", // Set a timeout so we don't hang forever.
|
||||
- "--tries=1", // Don't retry if the upload fails.
|
||||
- "-O", // Output reply to the file descriptor path.
|
||||
- status_fd_path,
|
||||
- nullptr,
|
||||
+ kWgetBinary,
|
||||
+ header_content_encoding,
|
||||
+ header_content_type,
|
||||
+ post_file,
|
||||
+ g_upload_url,
|
||||
+ "--timeout=10", // Set a timeout so we don't hang forever.
|
||||
+ "--tries=1", // Don't retry if the upload fails.
|
||||
+ "-O", // Output reply to the file descriptor path.
|
||||
+ status_fd_path,
|
||||
+ nullptr,
|
||||
};
|
||||
static const char msg[] = "Cannot upload crash dump: cannot exec "
|
||||
"/usr/bin/wget\n";
|
||||
@@ -2037,6 +2041,10 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
#endif
|
||||
process_type.empty();
|
||||
|
||||
+#if !defined(OS_CHROMEOS)
|
||||
+ SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
|
||||
+#endif
|
||||
+
|
||||
if (is_browser_process) {
|
||||
bool enable_breakpad = GetCrashReporterClient()->GetCollectStatsConsent() ||
|
||||
GetCrashReporterClient()->IsRunningUnattended();
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
|
||||
index e778f68af30f8c071d1360d06b553cc957160c5b..0ef0f00e4320b2ab1584621df5b3b8081c65a788 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.cc
|
||||
+++ b/components/crash/core/app/crash_reporter_client.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/crash/core/app/crash_reporter_client.h"
|
||||
|
||||
+#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
// On Windows don't use FilePath and logging.h.
|
||||
@@ -22,6 +23,10 @@ namespace {
|
||||
|
||||
CrashReporterClient* g_client = nullptr;
|
||||
|
||||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
|
||||
+const char kDefaultUploadURL[] = "https://clients2.google.com/cr/report";
|
||||
+#endif
|
||||
+
|
||||
} // namespace
|
||||
|
||||
void SetCrashReporterClient(CrashReporterClient* client) {
|
||||
@@ -196,6 +201,16 @@ void CrashReporterClient::GetSanitizationInformation(
|
||||
}
|
||||
#endif
|
||||
|
||||
+std::string CrashReporterClient::GetUploadUrl() {
|
||||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
|
||||
+ // Only allow the possibility of report upload in official builds. This
|
||||
+ // crash server won't have symbols for any other build types.
|
||||
+ return kDefaultUploadURL;
|
||||
+#else
|
||||
+ return std::string();
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
|
||||
return false;
|
||||
}
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
|
||||
index 9cc78fc2584061d26fd1e83b3ebf5ada0a12c138..ad4bbbc5de3feb8441ba613009452c920d925820 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.h
|
||||
+++ b/components/crash/core/app/crash_reporter_client.h
|
||||
@@ -194,6 +194,9 @@ class CrashReporterClient {
|
||||
bool* sanitize_stacks);
|
||||
#endif
|
||||
|
||||
+ // Returns the URL target for crash report uploads.
|
||||
+ virtual std::string GetUploadUrl();
|
||||
+
|
||||
// This method should return true to configure a crash reporter capable of
|
||||
// monitoring itself for its own crashes to do so, even if self-monitoring
|
||||
// would be expensive. "Expensive" self-monitoring dedicates an additional
|
||||
diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc
|
||||
index 5d31d0926cd1732bdd1808c232c18fc6ff550c05..56a79e28dece162210613c842df0a34aaa66f91c 100644
|
||||
--- a/components/crash/core/app/crashpad_linux.cc
|
||||
+++ b/components/crash/core/app/crashpad_linux.cc
|
||||
@@ -120,9 +120,8 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
// to ChromeOS's /sbin/crash_reporter which in turn passes the dump to
|
||||
// crash_sender which handles the upload.
|
||||
std::string url;
|
||||
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD) && \
|
||||
- !defined(OS_CHROMEOS)
|
||||
- url = "https://clients2.google.com/cr/report";
|
||||
+#if !defined(OS_CHROMEOS)
|
||||
+ url = crash_reporter_client->GetUploadUrl();
|
||||
#else
|
||||
url = std::string();
|
||||
#endif
|
||||
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
|
||||
index b579521d55860823722df2ee849f6b1628b3c950..c49d38082c41c7eb71ed2c701b06ed5b7eaa514a 100644
|
||||
--- a/components/crash/core/app/crashpad_mac.mm
|
||||
+++ b/components/crash/core/app/crashpad_mac.mm
|
||||
@@ -133,13 +133,7 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
crash_reporter_client->GetCrashDumpLocation(&database_path);
|
||||
crash_reporter_client->GetCrashMetricsLocation(&metrics_path);
|
||||
|
||||
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
|
||||
- // Only allow the possibility of report upload in official builds. This
|
||||
- // crash server won't have symbols for any other build types.
|
||||
- std::string url = "https://clients2.google.com/cr/report";
|
||||
-#else
|
||||
- std::string url;
|
||||
-#endif
|
||||
+ std::string url = crash_reporter_client->GetUploadUrl();
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
|
||||
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
|
||||
index 669f5bea844d75f0e5c34b58994f4cfb8e856af0..c199b467ffeb007f3098ccde6879fbd71e9ec9fd 100644
|
||||
--- a/components/crash/core/app/crashpad_win.cc
|
||||
+++ b/components/crash/core/app/crashpad_win.cc
|
||||
@@ -85,11 +85,7 @@ base::FilePath PlatformCrashpadInitialization(
|
||||
std::map<std::string, std::string> process_annotations;
|
||||
GetPlatformCrashpadAnnotations(&process_annotations);
|
||||
|
||||
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
- std::string url = "https://clients2.google.com/cr/report";
|
||||
-#else
|
||||
- std::string url;
|
||||
-#endif
|
||||
+ std::string url = crash_reporter_client->GetUploadUrl();
|
||||
|
||||
// Allow the crash server to be overridden for testing. If the variable
|
||||
// isn't present in the environment then the default URL will remain.
|
||||
@@ -9,10 +9,10 @@ rate-limiting, compression and global annotations.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 8ca43e2a8a104c3edf4087df5490fd47cd18f9a4..bb0c6aebb4fdb9b24de8292a3f1c8dc77f21e051 100644
|
||||
index d2ca4a9056e56c1e3e38a5aeaf97daa3a731de3c..a3599b4403b7be33cb4aa300746c3ade962627de 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -110,6 +110,7 @@ void SetUploadURL(const std::string& url) {
|
||||
@@ -111,6 +111,7 @@ void SetUploadURL(const std::string& url) {
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -21,10 +21,10 @@ index 8ca43e2a8a104c3edf4087df5490fd47cd18f9a4..bb0c6aebb4fdb9b24de8292a3f1c8dc7
|
||||
uint64_t g_process_start_time = 0;
|
||||
pid_t g_pid = 0;
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
|
||||
index 0ef0f00e4320b2ab1584621df5b3b8081c65a788..bb30a0fdd797b80a345212828060a38f25d78e67 100644
|
||||
index 44e81b2f95f6332df16cfa00bdd26c7abbc733dc..9b3db694b920048735789d4db0f8670addd22b40 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.cc
|
||||
+++ b/components/crash/core/app/crash_reporter_client.cc
|
||||
@@ -153,6 +153,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
|
||||
@@ -148,6 +148,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ index 0ef0f00e4320b2ab1584621df5b3b8081c65a788..bb30a0fdd797b80a345212828060a38f
|
||||
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
|
||||
return 100;
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
|
||||
index ad4bbbc5de3feb8441ba613009452c920d925820..c2dfc8fc897d901d237670e7c305fd263606bee7 100644
|
||||
index 05538423d0b9ad0d83e9326a58f8856e0403fed2..06d9f1e3b57db5cf33555eb5ad837f8d66aa8b3d 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.h
|
||||
+++ b/components/crash/core/app/crash_reporter_client.h
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -54,7 +54,7 @@ index ad4bbbc5de3feb8441ba613009452c920d925820..c2dfc8fc897d901d237670e7c305fd26
|
||||
#include <string>
|
||||
|
||||
#include "base/strings/string16.h"
|
||||
@@ -153,6 +154,19 @@ class CrashReporterClient {
|
||||
@@ -150,6 +151,19 @@ class CrashReporterClient {
|
||||
// that case, |breakpad_enabled| is set to the value enforced by policies.
|
||||
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
|
||||
|
||||
@@ -75,7 +75,7 @@ index ad4bbbc5de3feb8441ba613009452c920d925820..c2dfc8fc897d901d237670e7c305fd26
|
||||
// Used by WebView to sample crashes without generating the unwanted dumps. If
|
||||
// the returned value is less than 100, crash dumping will be sampled to that
|
||||
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
|
||||
index c49d38082c41c7eb71ed2c701b06ed5b7eaa514a..7d3a52951ac525640974e03b13f8827d465adf1d 100644
|
||||
index 0b594d053d7c7f2a8eae9a15e62daacab52ffa64..96210530f699a2331f57415beddc20ed19b9cb4b 100644
|
||||
--- a/components/crash/core/app/crashpad_mac.mm
|
||||
+++ b/components/crash/core/app/crashpad_mac.mm
|
||||
@@ -67,6 +67,8 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
|
||||
|
||||
@@ -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 16b7768fab7a43cf6ddf089fd9590bd333a766e3..b41519865e6babc829085880aadaaaea7e086e45 100644
|
||||
index d6c77f00ee6fb5f0a21d2d3df2bc00aea3f7e5dc..f8aade234eab49e3600e5d78d9ce71af66646ba3 100644
|
||||
--- a/content/browser/frame_host/navigation_controller_impl.cc
|
||||
+++ b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
@@ -1262,8 +1262,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
@@ -1267,8 +1267,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
return NAVIGATION_TYPE_NEW_SUBFRAME;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 16b7768fab7a43cf6ddf089fd9590bd333a766e3..b41519865e6babc829085880aadaaaea
|
||||
|
||||
if (rfh->GetParent()) {
|
||||
// All manual subframes would be did_create_new_entry and handled above, so
|
||||
@@ -1518,7 +1520,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
@@ -1524,7 +1526,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 16b7768fab7a43cf6ddf089fd9590bd333a766e3..b41519865e6babc829085880aadaaaea
|
||||
// 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 4362daa04e89ca8f47c5e07e998fc9f1ad4f4c5b..9ecdb2e13235396aee11ae1be7e539f8e932e3f6 100644
|
||||
index 421f22eaaf6dbb90c8e3a4bb78d9d017bac8db94..959666ba60c97e0c2f082867c8ebd77de45d8788 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -776,10 +776,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
|
||||
@@ -782,10 +782,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
|
||||
|
||||
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
|
||||
UINT cf_format = format.ToFormatEtc().cfFormat;
|
||||
|
||||
@@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
|
||||
re-submitting the patch.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 67d7e8e69d8a9b8b34b82b83bdf688df4c17ed59..9f6b797ea0489fc87b33a36bbcaae84a2cbf05f3 100644
|
||||
index f5e5576fd7455336481111c24b436457e235e43c..4af47c892ce5485ff18de67e1af8962cd7315406 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -640,7 +640,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
@@ -662,7 +662,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ index 67d7e8e69d8a9b8b34b82b83bdf688df4c17ed59..9f6b797ea0489fc87b33a36bbcaae84a
|
||||
|
||||
#if !defined(OS_ANDROID)
|
||||
diff --git a/content/common/url_schemes.cc b/content/common/url_schemes.cc
|
||||
index c00901a2a4ef59a63033c6669171ec9e3ffd2686..d637b79d9df82ad44b1eed8529024a21e0b3555b 100644
|
||||
index dc37f121130d83e200d73dd1ad566847548ac0fd..63080c1bc486a488841fc5d2081f4d5d4a00bde3 100644
|
||||
--- a/content/common/url_schemes.cc
|
||||
+++ b/content/common/url_schemes.cc
|
||||
@@ -49,7 +49,7 @@ std::vector<std::string>& GetMutableServiceWorkerSchemes() {
|
||||
@@ -44,7 +44,7 @@ index c00901a2a4ef59a63033c6669171ec9e3ffd2686..d637b79d9df82ad44b1eed8529024a21
|
||||
// On Android and in tests, schemes may have been registered already.
|
||||
if (g_registered_url_schemes)
|
||||
return;
|
||||
@@ -105,7 +105,8 @@ void RegisterContentSchemes() {
|
||||
@@ -106,7 +106,8 @@ void RegisterContentSchemes() {
|
||||
// threadsafe so must be called when GURL isn't used on any other thread. This
|
||||
// is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
|
||||
// must be inside this function.
|
||||
@@ -68,10 +68,10 @@ index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f8
|
||||
// Re-initializes schemes for tests.
|
||||
CONTENT_EXPORT void ReRegisterContentSchemesForTests();
|
||||
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
|
||||
index 6c27d324e6235051875b88c4bc5bd362d3907f3c..06c17d6673d280fabf5b47244e7f7f7ab374f9a3 100644
|
||||
index 02985a525c98999f469906c8ff3647b740d9f962..e52e8d69c2d05b31d1f28b19752be362941e52be 100644
|
||||
--- a/content/public/app/content_main_delegate.cc
|
||||
+++ b/content/public/app/content_main_delegate.cc
|
||||
@@ -37,6 +37,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
|
||||
@@ -36,6 +36,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -83,10 +83,10 @@ index 6c27d324e6235051875b88c4bc5bd362d3907f3c..06c17d6673d280fabf5b47244e7f7f7a
|
||||
return service_manager::ProcessType::kDefault;
|
||||
}
|
||||
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
|
||||
index f8590642a8d6807a15746e9e7673b5e76cbe0e14..7d8df731b6dd18a42ec4fc2b1bb08a6198da8ff8 100644
|
||||
index 0ca924769b98009264b53121dfe6a892b81e8530..606a5cb8d89216a95e9187fba2ea9b6d4121a394 100644
|
||||
--- a/content/public/app/content_main_delegate.h
|
||||
+++ b/content/public/app/content_main_delegate.h
|
||||
@@ -77,6 +77,20 @@ class CONTENT_EXPORT ContentMainDelegate {
|
||||
@@ -76,6 +76,20 @@ class CONTENT_EXPORT ContentMainDelegate {
|
||||
// returning initialization error code. Default behavior is CHECK(false).
|
||||
virtual int TerminateForFatalInitializationError();
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ index a489bf6ea2179059f53e53563e993db9c7cd123b..93e237569fe94ec8526f67d915e1a735
|
||||
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 ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965234c4542 100644
|
||||
index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9c724511c 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
@@ -22,6 +22,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
|
||||
@@ -20,6 +20,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
|
||||
|
||||
DesktopMediaListBase::~DesktopMediaListBase() {}
|
||||
|
||||
@@ -44,7 +44,7 @@ index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965
|
||||
void DesktopMediaListBase::SetUpdatePeriod(base::TimeDelta period) {
|
||||
DCHECK(!observer_);
|
||||
update_period_ = period;
|
||||
@@ -56,7 +61,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
|
||||
@@ -54,7 +59,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
|
||||
DCHECK(sources_.empty());
|
||||
DCHECK(!refresh_callback_);
|
||||
refresh_callback_ = std::move(callback);
|
||||
@@ -53,7 +53,7 @@ index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965
|
||||
}
|
||||
|
||||
int DesktopMediaListBase::GetSourceCount() const {
|
||||
@@ -70,6 +75,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
|
||||
@@ -68,6 +73,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
|
||||
return sources_[index];
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965
|
||||
DesktopMediaID::Type DesktopMediaListBase::GetMediaListType() const {
|
||||
return type_;
|
||||
}
|
||||
@@ -81,6 +91,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
|
||||
@@ -79,6 +89,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
|
||||
|
||||
void DesktopMediaListBase::UpdateSourcesList(
|
||||
const std::vector<SourceDescription>& new_sources) {
|
||||
@@ -111,16 +111,15 @@ index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c591
|
||||
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 224d52b83533543398757ca487f99b3e59897e21..eb50b0393ba532766867aeec5ddeab1a6acd0bc2 100644
|
||||
index af3a6dab055f2e2215e4602697dbe35507b7ed96..fcb06b764b618fe7162243b6e52e53261b473bee 100644
|
||||
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
@@ -10,14 +10,15 @@
|
||||
@@ -10,13 +10,14 @@
|
||||
#include "base/hash/hash.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/media/webrtc/desktop_media_list.h"
|
||||
@@ -131,12 +130,12 @@ index 224d52b83533543398757ca487f99b3e59897e21..eb50b0393ba532766867aeec5ddeab1a
|
||||
#include "media/base/video_util.h"
|
||||
#include "third_party/libyuv/include/libyuv/scale_argb.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
@@ -221,6 +222,8 @@ void NativeDesktopMediaList::Worker::RefreshThumbnails(
|
||||
FROM_HERE, {BrowserThread::UI},
|
||||
@@ -223,6 +224,8 @@ void NativeDesktopMediaList::Worker::RefreshThumbnails(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
|
||||
media_list_));
|
||||
+
|
||||
+ capturer_.reset();
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::Worker::OnCaptureResult(
|
||||
bool NativeDesktopMediaList::Worker::IsCurrentFrameValid() const {
|
||||
|
||||
@@ -15,7 +15,7 @@ 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 0328f536a10de1ff4b6fd0a70c1b80c260aa7b87..2bb93842c74feb1d3f33d4589b7a75ceff8858ef 100644
|
||||
index db4fe784c7e119111917757b2d1de4d7cc1e5f2b..f6e9f97e47b44fa47e8e6c237be371754a5204bd 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -306,6 +306,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
@@ -37,7 +37,7 @@ index 0328f536a10de1ff4b6fd0a70c1b80c260aa7b87..2bb93842c74feb1d3f33d4589b7a75ce
|
||||
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
|
||||
!ui::win::IsAeroGlassEnabled())) {
|
||||
if (should_lock_)
|
||||
@@ -969,6 +974,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
|
||||
@@ -970,6 +975,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
|
||||
return scoped_enable;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index 0328f536a10de1ff4b6fd0a70c1b80c260aa7b87..2bb93842c74feb1d3f33d4589b7a75ce
|
||||
// HWNDMessageHandler, gfx::WindowImpl overrides:
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
|
||||
index 4da6edd086c9df20af7cdcb5c6020cd61166fbea..81b300c2533a3aaa6e0c343405a6040351061e27 100644
|
||||
index 7118ff56f0dd1c6291e4095ce7f3d8fc723f0398..5dbaab15ee1667ed1caf0b746b8e31d1b12a7b52 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.h
|
||||
+++ b/ui/views/win/hwnd_message_handler.h
|
||||
@@ -203,6 +203,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
|
||||
|
||||
@@ -19,8 +19,23 @@ This can be removed once web content (including WebGL) learn how
|
||||
to deal with color spaces. That is being tracked at
|
||||
https://crbug.com/634542 and https://crbug.com/711107.
|
||||
|
||||
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
||||
index 2c8bb4fe9c8cf592cc83fce164f21209e5dd1465..a6fde7b42fd854a56226acb4766274621aa7b3e6 100644
|
||||
--- a/cc/trees/layer_tree_host_impl.cc
|
||||
+++ b/cc/trees/layer_tree_host_impl.cc
|
||||
@@ -1861,6 +1861,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
|
||||
gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace(
|
||||
gfx::ContentColorUsage content_color_usage) const {
|
||||
+ if (!settings_.enable_color_correct_rendering) {
|
||||
+ return {};
|
||||
+ }
|
||||
+
|
||||
constexpr gfx::ColorSpace srgb = gfx::ColorSpace::CreateSRGB();
|
||||
|
||||
if (settings_.prefer_raster_in_srgb &&
|
||||
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
|
||||
index 95a901678c215220b9e88db768444d48e32f6dbd..841c809b0b50c8c34a9d9c972c511bd4fd57a7b0 100644
|
||||
index 446d46764c5d001df665fea8737a95b4243f8ac8..c9a0244a0027d8918960e6441b4a49af0b7e71af 100644
|
||||
--- a/cc/trees/layer_tree_settings.h
|
||||
+++ b/cc/trees/layer_tree_settings.h
|
||||
@@ -100,6 +100,8 @@ class CC_EXPORT LayerTreeSettings {
|
||||
@@ -45,7 +60,7 @@ index 8bde4796ebcf40f7f10c62f4005eabb84af9de04..913ab005e582b3d1ab0df8f88ac1df62
|
||||
bool force_antialiasing = false;
|
||||
bool force_blending_with_shaders = false;
|
||||
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
|
||||
index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8ce1c02da 100644
|
||||
index f28c3218baa08e7ae885567e0ede1d8108f8a373..a5f4a4a10a776fc92a5e9fbc9593563d548ccbc8 100644
|
||||
--- a/components/viz/host/renderer_settings_creation.cc
|
||||
+++ b/components/viz/host/renderer_settings_creation.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
@@ -56,7 +71,7 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "ui/base/cocoa/remote_layer_api.h"
|
||||
@@ -50,6 +51,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
@@ -51,6 +52,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
RendererSettings CreateRendererSettings() {
|
||||
RendererSettings renderer_settings;
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
@@ -66,10 +81,10 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
|
||||
!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 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f00bfe2d8d 100644
|
||||
index 591e5c4e6f7291412a5f05c244d6256a4b4fd57d..2af556050b7fe4ce7404d0c5ce6f2328a1e863fd 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -84,6 +84,9 @@
|
||||
@@ -89,6 +89,9 @@
|
||||
|
||||
using gpu::gles2::GLES2Interface;
|
||||
|
||||
@@ -79,7 +94,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
namespace viz {
|
||||
namespace {
|
||||
|
||||
@@ -582,8 +585,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
@@ -587,8 +590,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
|
||||
SetBlendEnabled(quad->ShouldDrawWithBlending());
|
||||
|
||||
@@ -91,7 +106,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1553,7 +1557,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
@@ -1558,7 +1562,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
params->apply_shader_based_rounded_corner &&
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
@@ -101,7 +116,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -2024,7 +2029,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
@@ -2029,7 +2034,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -111,7 +126,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
SetShaderColor(color, opacity);
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -2179,7 +2185,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2184,7 +2190,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -121,7 +136,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2275,7 +2282,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2280,7 +2287,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -131,7 +146,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2377,7 +2385,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
@@ -2382,7 +2390,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
// The source color space should never be RGB.
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
@@ -141,7 +156,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
@@ -2541,7 +2550,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
@@ -2546,7 +2555,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -151,7 +166,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2606,8 +2616,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
@@ -2611,8 +2621,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
@@ -162,7 +177,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -3346,7 +3356,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
@@ -3357,7 +3367,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) {
|
||||
@@ -173,7 +188,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
// If the input color space is PQ, and it did not specify a white level,
|
||||
// override it with the frame's white level.
|
||||
@@ -3728,9 +3740,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
@@ -3739,9 +3751,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
|
||||
}
|
||||
|
||||
@@ -186,7 +201,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -3949,8 +3961,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
@@ -3960,8 +3972,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
@@ -197,17 +212,17 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -4064,3 +4076,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
@@ -4079,3 +4091,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 d47312d5f89939eab55cfa94bd3fbd41a4bd7d2a..da2f5e9fdc0fda37c82357a12f4fa28f5c556273 100644
|
||||
index 9f9d3422ad128fe3bfc305baa57971bd03e1b676..02747c0d4d7f0bb7ba034f35bcce86a91774bb36 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -209,6 +209,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
@@ -215,6 +215,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
|
||||
// Command-line switches to propagate to the GPU process.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -216,10 +231,10 @@ index d47312d5f89939eab55cfa94bd3fbd41a4bd7d2a..da2f5e9fdc0fda37c82357a12f4fa28f
|
||||
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 618700cc99de3174b9de9bc26abcaac5880ec21e..aac0c3e5e19ee7bcf0de68a4f9f45c1cf46f9fad 100644
|
||||
index e5a82f46cd58b0da9959930ee85303e4a1530425..753b926fbe0c6a3ef2b2e244d7f80f4f4574bc5c 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -230,6 +230,7 @@
|
||||
@@ -227,6 +227,7 @@
|
||||
#include "ui/accessibility/accessibility_switches.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/display/display_switches.h"
|
||||
@@ -227,7 +242,7 @@ index 618700cc99de3174b9de9bc26abcaac5880ec21e..aac0c3e5e19ee7bcf0de68a4f9f45c1c
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "ui/native_theme/native_theme_features.h"
|
||||
#include "url/origin.h"
|
||||
@@ -3213,6 +3214,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
@@ -3283,6 +3284,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[] = {
|
||||
@@ -236,10 +251,10 @@ index 618700cc99de3174b9de9bc26abcaac5880ec21e..aac0c3e5e19ee7bcf0de68a4f9f45c1c
|
||||
service_manager::switches::kDisableInProcessStackTraces,
|
||||
service_manager::switches::kDisableSeccompFilterSandbox,
|
||||
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
||||
index 75558f0658a3760ce9dcf550b1ac134e30c686d8..40dc39bdcd08032e7af821beeb13373fd1c613e9 100644
|
||||
index 30e6638b9c5bf4b04e73156ee4b0f70a91134010..6a05f399a8a70f5d7f4f04ec9b02968bf2c0ef6d 100644
|
||||
--- a/content/renderer/render_widget.cc
|
||||
+++ b/content/renderer/render_widget.cc
|
||||
@@ -2586,6 +2586,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
@@ -2216,6 +2216,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
settings.main_frame_before_activation_enabled =
|
||||
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
|
||||
|
||||
@@ -250,7 +265,7 @@ index 75558f0658a3760ce9dcf550b1ac134e30c686d8..40dc39bdcd08032e7af821beeb13373f
|
||||
// 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 d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75f1177cb9 100644
|
||||
index 3dc0fb19b33daf14cbf8550cbb58e3e146830f26..da34be87f36c6e50286d0ef24cade53156f0a688 100644
|
||||
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
@@ -269,7 +284,7 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -89,6 +91,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
|
||||
@@ -90,6 +92,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
|
||||
}
|
||||
|
||||
gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
|
||||
@@ -278,10 +293,10 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
|
||||
+ return gfx::ColorSpace();
|
||||
+ }
|
||||
+
|
||||
gfx::ColorSpace::PrimaryID primary_id = GetPrimaryID(color_space_);
|
||||
|
||||
// TODO(ccameron): This needs to take into account whether or not this texture
|
||||
@@ -102,6 +109,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
|
||||
// TODO(ccameron): If we add support for uint8srgb as a pixel format, this
|
||||
// will need to take into account whether or not this texture will be sampled
|
||||
// in linear or nonlinear space.
|
||||
@@ -97,6 +104,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
|
||||
}
|
||||
|
||||
gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
|
||||
@@ -290,11 +305,11 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
|
||||
+ return gfx::ColorSpace();
|
||||
+ }
|
||||
+
|
||||
gfx::ColorSpace::PrimaryID primary_id = GetPrimaryID(color_space_);
|
||||
return CanvasColorSpaceToGfxColorSpace(color_space_);
|
||||
}
|
||||
|
||||
gfx::ColorSpace::TransferID transfer_id =
|
||||
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
|
||||
index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..5b661c70c9c89883a1aaaf1a29a9ec9fe7f16da6 100644
|
||||
index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..93a9652b71d86441e15b87aafd7a6b1a13f45830 100644
|
||||
--- a/ui/gfx/mac/io_surface.cc
|
||||
+++ b/ui/gfx/mac/io_surface.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -305,35 +320,39 @@ index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..5b661c70c9c89883a1aaaf1a29a9ec9f
|
||||
|
||||
namespace gfx {
|
||||
|
||||
@@ -258,6 +259,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
|
||||
} else {
|
||||
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
|
||||
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
|
||||
+ color_space = base::mac::GetSystemColorSpace();
|
||||
+ }
|
||||
+
|
||||
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
|
||||
CGColorSpaceCopyICCProfile(color_space));
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
|
||||
@@ -274,6 +280,14 @@ bool IOSurfaceCanSetColorSpace(const ColorSpace& color_space) {
|
||||
|
||||
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
|
||||
@@ -119,6 +120,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
|
||||
// Common method used by IOSurfaceSetColorSpace and IOSurfaceCanSetColorSpace.
|
||||
bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
|
||||
const ColorSpace& color_space) {
|
||||
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
|
||||
+ base::ScopedCFTypeRef<CFDataRef> system_icc(
|
||||
+ CGColorSpaceCopyICCProfile(base::mac::GetSystemColorSpace()));
|
||||
+ IOSurfaceSetValue(io_surface, CFSTR("IOSurfaceColorSpace"), system_icc);
|
||||
+ return;
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
if (!internal::IOSurfaceSetColorSpace(io_surface, color_space)) {
|
||||
DLOG(ERROR) << "Failed to set color space for IOSurface: "
|
||||
<< color_space.ToString();
|
||||
// Allow but ignore invalid color spaces.
|
||||
if (!color_space.IsValid())
|
||||
return true;
|
||||
@@ -253,6 +262,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
DCHECK_EQ(kIOReturnSuccess, r);
|
||||
}
|
||||
|
||||
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
|
||||
+ CGColorSpaceRef color_space = base::mac::GetSystemColorSpace();
|
||||
+ base::ScopedCFTypeRef<CFDataRef> color_space_icc(
|
||||
+ CGColorSpaceCopyICCProfile(color_space));
|
||||
+ IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
|
||||
+ return surface;
|
||||
+ }
|
||||
+
|
||||
// Ensure that all IOSurfaces start as sRGB.
|
||||
if (__builtin_available(macos 10.12, *)) {
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
|
||||
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
|
||||
index 0f746ead72a2c195321384c9c4ced96d0608fb7b..a9cc7b6d93cdb42c5a9a177e8a09edeb36db8122 100644
|
||||
index 16eeda0d910c555aae074fe1ed8ba04c4be76d9e..095b704442f55e978c7f60e9c97c2abe20b131a7 100644
|
||||
--- a/ui/gfx/switches.cc
|
||||
+++ b/ui/gfx/switches.cc
|
||||
@@ -10,6 +10,7 @@ namespace switches {
|
||||
@@ -345,7 +364,7 @@ index 0f746ead72a2c195321384c9c4ced96d0608fb7b..a9cc7b6d93cdb42c5a9a177e8a09edeb
|
||||
// Force disables font subpixel positioning. This affects the character glyph
|
||||
// sharpness, kerning, hinting and layout.
|
||||
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
|
||||
index abe0a58a9ccbcd1610f728baa5d9a1155402af0c..e48d800b432f77d364541c432a1ce8865e888766 100644
|
||||
index fa86fc52621f4cf12bad58f8c1dd7ca6b29a307c..6b98b75c05643036ecd0fb71a8682ee1088ac52e 100644
|
||||
--- a/ui/gfx/switches.h
|
||||
+++ b/ui/gfx/switches.h
|
||||
@@ -11,6 +11,8 @@
|
||||
@@ -355,5 +374,5 @@ index abe0a58a9ccbcd1610f728baa5d9a1155402af0c..e48d800b432f77d364541c432a1ce886
|
||||
+GFX_SWITCHES_EXPORT extern const char kDisableColorCorrectRendering[];
|
||||
+
|
||||
GFX_SWITCHES_EXPORT extern const char kDisableFontSubpixelPositioning[];
|
||||
GFX_SWITCHES_EXPORT extern const char kDisableYuv420Biplanar[];
|
||||
GFX_SWITCHES_EXPORT extern const char kEnableNativeGpuMemoryBuffers[];
|
||||
GFX_SWITCHES_EXPORT extern const char kForcePrefersReducedMotion[];
|
||||
|
||||
@@ -6,10 +6,10 @@ 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/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 385b0dbeb7cbfb31ad0726051dc2e8fb4d7b16b2..9fe6d55cc0dbcc504cdf0eebe71899887de31b19 100644
|
||||
index aef2f3625465d5de36d0ce496f7133865a7ba18a..3c8735755deb2b2ff4b00cff16292ae003a8670d 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -472,7 +472,11 @@ void RenderWidgetHostViewMac::WasOccluded() {
|
||||
@@ -478,7 +478,11 @@ void RenderWidgetHostViewMac::WasOccluded() {
|
||||
return;
|
||||
|
||||
host()->WasHidden();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index a0bb67b269f03ed6fa322fd156e9eb358eed1437..8c2d75c20afd5832371b04f50c9fb1ec5d9e8dc5 100644
|
||||
index 1bce7961d24d29cf8d14c8f7646e88e5f9d72ee6..bf6baff690af930acf19c2a544c8f00ab492bb8e 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -653,6 +653,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -667,6 +667,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
if (is_hidden_)
|
||||
return;
|
||||
|
||||
@@ -20,10 +20,10 @@ index a0bb67b269f03ed6fa322fd156e9eb358eed1437..8c2d75c20afd5832371b04f50c9fb1ec
|
||||
blink::mojom::PointerLockResult::kWrongDocument);
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
index 947fb6ba02cde74da8787ccec689cd184f98aefd..67722b63693d28c828435d60ca167b5cda0a57b4 100644
|
||||
index 5f3f2feec8c787ff1e086bf256ef9353732037af..a127ec54042ef869f0e19ba6b86b86d4d071304c 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -179,6 +179,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
@@ -177,6 +177,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
// RenderWidgetHostImpl.
|
||||
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
|
||||
|
||||
@@ -34,10 +34,10 @@ index 947fb6ba02cde74da8787ccec689cd184f98aefd..67722b63693d28c828435d60ca167b5c
|
||||
const base::TimeDelta& delay) {
|
||||
new_content_rendering_delay_ = delay;
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 12e1923fd2943af92aaf6f691d28212bdd2a73dd..3b66abb180df5f3da7c4fa8de77279620cbc4aa3 100644
|
||||
index 338fd87a55cbf4688079daa5ec86d81d8258339e..5477ee5ca3974aa043939c79bef2f8e12925148d 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -692,7 +692,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
@@ -623,7 +623,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
DCHECK(visibility_ == Visibility::HIDDEN ||
|
||||
visibility_ == Visibility::OCCLUDED);
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Deepak Mohan <hop2deep@gmail.com>
|
||||
Date: Fri, 22 May 2020 17:40:47 -0700
|
||||
Subject: Disable unnecessary IsChromeFirstRun check
|
||||
|
||||
https://crrev.com/c/2155167/18/chrome/browser/spellchecker/spellcheck_service.cc#586
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
index 717d9c4da5ff4550b1e769bbe5347247ca596006..b7ee91bbd849da29590f00efaafc5ce0357d485d 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
@@ -18,7 +18,9 @@
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
+#if 0
|
||||
#include "chrome/browser/first_run/first_run.h"
|
||||
+#endif
|
||||
#include "chrome/browser/spellchecker/spellcheck_factory.h"
|
||||
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
|
||||
#include "components/language/core/browser/pref_names.h"
|
||||
@@ -610,7 +612,7 @@ void SpellcheckService::InitWindowsDictionaryLanguages(
|
||||
.empty());
|
||||
});
|
||||
|
||||
- if (first_run::IsChromeFirstRun()) {
|
||||
+ //if (first_run::IsChromeFirstRun()) {
|
||||
// Ensure that spellcheck is enabled for the first dialect of the
|
||||
// accepted languages if there is a Windows dictionary installed for
|
||||
// that dialect.
|
||||
@@ -650,7 +652,7 @@ void SpellcheckService::InitWindowsDictionaryLanguages(
|
||||
base::Value(first_user_language));
|
||||
prefs->Set(spellcheck::prefs::kSpellCheckDictionaries, user_dictionaries);
|
||||
}
|
||||
- }
|
||||
+ //}
|
||||
|
||||
// No need to call LoadDictionaries() as when the ListPrefUpdate
|
||||
// object goes out of scope, the preference change handler will do this.
|
||||
@@ -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 b7c83cceb2297eddcb345e75a95b7744b08d2e6b..7dda5ce275aef7670406e3cb3b08bd6d14d188ef 100644
|
||||
index 170ba3cf6176e8423b6009a0ac0299bf1e411158..14f8cb99631232cc225026c345e95df2b548bcff 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1044,6 +1044,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -1035,6 +1035,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ index b7c83cceb2297eddcb345e75a95b7744b08d2e6b..7dda5ce275aef7670406e3cb3b08bd6d
|
||||
// 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 cff8a36b7703df31d0823efb2549f57d7c6c6907..ae9c7a0d6cd98f59892fd5b0fcb6a0307cd842fc 100644
|
||||
index 391a02c108debdd5e5572b4a666d30dc68ece76b..0d9c4cce09db485b5e750921eed703c75ffdf15a 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -242,6 +242,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -63,10 +63,10 @@ index cff8a36b7703df31d0823efb2549f57d7c6c6907..ae9c7a0d6cd98f59892fd5b0fcb6a030
|
||||
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 e834a5f9a4b6c698ad20e3b9cdc99e871e4035df..18c3c5312be05333e6ed19ad53bb6296be5db4b7 100644
|
||||
index 577c2b431ae8026b34fa1d881b0b29db478dc213..6d15b6b5ff7b36b85f6b8200b76a32b285f0e675 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1026,6 +1026,9 @@ interface NetworkContext {
|
||||
@@ -1050,6 +1050,9 @@ interface NetworkContext {
|
||||
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
||||
NetworkConditions? conditions);
|
||||
|
||||
@@ -77,10 +77,10 @@ index e834a5f9a4b6c698ad20e3b9cdc99e871e4035df..18c3c5312be05333e6ed19ad53bb6296
|
||||
SetAcceptLanguage(string new_accept_language);
|
||||
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index b2be49a841af089adb1c85eb87aa6c198a522001..eee74c88beffafcfba75bb76ad7c54154a57aa39 100644
|
||||
index ef97b4cef0aa4d67926cf42c8ae20e9b90e73531..65831a37e753a9255507a905f80f727f4214441e 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -104,6 +104,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
@@ -105,6 +105,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override {}
|
||||
|
||||
@@ -10,22 +10,22 @@ get this standardised, but in lieu of that, this makes MessagePort a
|
||||
whole bunch more useful!
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
|
||||
index 3e71122bfbc87b481d620d67d01926690ae5270a..cd1abc51fa216215b5ab00d0a8b63638c24cbd57 100644
|
||||
index 9e9de51e37ee46266c647bd9c0c27e02a42bf5f1..d16727bed1a99b8171d0c7c5c5b7f38289ae9e55 100644
|
||||
--- a/third_party/blink/renderer/core/messaging/message_port.cc
|
||||
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
|
||||
@@ -149,6 +149,7 @@ void MessagePort::close() {
|
||||
Entangle(mojo::MessagePipe().handle0);
|
||||
@@ -158,6 +158,7 @@ void MessagePort::close() {
|
||||
Entangle(pipe.TakePort0());
|
||||
}
|
||||
closed_ = true;
|
||||
+ DispatchEvent(*Event::Create(event_type_names::kClose));
|
||||
}
|
||||
|
||||
void MessagePort::Entangle(mojo::ScopedMessagePipeHandle handle) {
|
||||
void MessagePort::Entangle(MessagePortDescriptor port) {
|
||||
diff --git a/third_party/blink/renderer/core/messaging/message_port.h b/third_party/blink/renderer/core/messaging/message_port.h
|
||||
index d24804499949c237462ee455e7cec93836debca9..53e61229e73e2343414aa1ac5c5ac1ff2d3db439 100644
|
||||
index d30195fc3cf96279426c7c23fa6f99f7cd193b26..95dc5b61a01452e64e5008e772367897445ca312 100644
|
||||
--- a/third_party/blink/renderer/core/messaging/message_port.h
|
||||
+++ b/third_party/blink/renderer/core/messaging/message_port.h
|
||||
@@ -119,6 +119,13 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData,
|
||||
@@ -121,6 +121,13 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData,
|
||||
return GetAttributeEventListener(event_type_names::kMessageerror);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 c0c55286676df02d1aae3afd15de745e9756dd3e..c791beb29543b84bcc0e1d7b464a0e0f4bc39cd4 100644
|
||||
index 150f4455d497c6e1ac84948eac088c9dc3a4d729..84a4d6dfc33ae7ba7e21efc5f38405e24749edd6 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -247,6 +247,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors)
|
||||
@@ -26,10 +26,10 @@ index c0c55286676df02d1aae3afd15de745e9756dd3e..c791beb29543b84bcc0e1d7b464a0e0f
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index 8c60a3f7ba7cd3caec127028422be32024ff586b..7bffe0caa4a55728e45f2371bb594c96855d1bc5 100644
|
||||
index f4e9cc14b0b8406d255bbed56d98dcf61f24a405..e1b9298532b2676aa4d9cdacb15e9398be3ccc3f 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -363,6 +363,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -392,6 +392,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
ColorId color_id,
|
||||
ColorScheme color_scheme = ColorScheme::kDefault) const;
|
||||
|
||||
@@ -52,9 +52,9 @@ index 8c60a3f7ba7cd3caec127028422be32024ff586b..7bffe0caa4a55728e45f2371bb594c96
|
||||
// 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
|
||||
@@ -497,6 +513,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
PreferredColorScheme preferred_color_scheme_ =
|
||||
PreferredColorScheme::kNoPreference;
|
||||
@@ -527,6 +543,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
bool is_high_contrast_ = false;
|
||||
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
|
||||
|
||||
+ ThemeSource theme_source_ = ThemeSource::kSystem;
|
||||
+
|
||||
@@ -62,10 +62,10 @@ index 8c60a3f7ba7cd3caec127028422be32024ff586b..7bffe0caa4a55728e45f2371bb594c96
|
||||
};
|
||||
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index f94a3ed2098d5f32ea0eb881be28d7a589b359a5..1bb8445ef2f68bdf1f2fc8a7a6f1cd0f4e0357d0 100644
|
||||
index 1ff5451c10c4843557746df9daf879d422b9855a..b215a4b7965f180f71a84b022f15f7f636924124 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -733,6 +733,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
@@ -734,6 +734,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
// ...unless --force-dark-mode was specified in which case caveat emptor.
|
||||
if (UsesHighContrastColors() && !IsForcedDarkMode())
|
||||
return false;
|
||||
|
||||
@@ -9,7 +9,7 @@ production use cases. This is unlikely to be upstreamed as the change
|
||||
is entirely in //chrome.
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd9d907160 100644
|
||||
index 5272b99db1d066c1c40e607de2a8570baedcf15f..ab017736f946c687e3b300d3f2c5b47697263963 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
@@ -50,6 +50,9 @@ namespace {
|
||||
@@ -22,7 +22,7 @@ index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd
|
||||
// Close the file.
|
||||
void CloseDictionary(base::File file) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
@@ -248,6 +251,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
|
||||
@@ -270,6 +273,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
|
||||
g_download_url_for_testing.Get() = url;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd
|
||||
GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
if (g_download_url_for_testing.Get() != GURL())
|
||||
return g_download_url_for_testing.Get();
|
||||
@@ -255,6 +262,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
@@ -277,6 +284,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
|
||||
DCHECK(!bdict_file.empty());
|
||||
|
||||
@@ -44,10 +44,10 @@ index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd
|
||||
"https://redirector.gvt1.com/edgedl/chrome/dict/";
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
index 4af3201238dfec14bd5a4241b662ca52799e6862..4662bdc08b54304a7f8b2995f60fea9dc5617fff 100644
|
||||
index a8acd00dc449812d336364229fade2a16e21ccbc..8d8eca3c7de3080111043dc465ed4316af026c0b 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
@@ -85,6 +85,8 @@ class SpellcheckHunspellDictionary
|
||||
@@ -88,6 +88,8 @@ class SpellcheckHunspellDictionary
|
||||
// Tests use this method to set a custom URL for downloading dictionaries.
|
||||
static void SetDownloadURLForTesting(const GURL url);
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: feat: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index d07b3cd2f8a2658c46426a97c378e2aae469321c..f316733194014b9f4ab64a0d8c31436b5badf2e9 100644
|
||||
index c5140471ec2ade58948972f433d79c11932e2f17..12db0a89ac0f37ecab137841264ddd108d622dc8 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -480,6 +480,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -512,6 +512,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ index d07b3cd2f8a2658c46426a97c378e2aae469321c..f316733194014b9f4ab64a0d8c31436b
|
||||
return is_active();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
|
||||
index cfb48f43295d74ab5c1c3cdafbb9ab4210344a15..c1c586f57ad45d33e926e27ef6d2985d10025cb0 100644
|
||||
index e1f95d702844a687342f484e3c572686064dc498..0233242c0d2b4bde4e32931f30777ee26dc02619 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -110,6 +110,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -33,7 +33,7 @@ index cfb48f43295d74ab5c1c3cdafbb9ab4210344a15..c1c586f57ad45d33e926e27ef6d2985d
|
||||
void UpdateWebkitPreferences(const WebPreferences& prefs) override;
|
||||
void OnWebkitPreferencesChanged() override;
|
||||
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
|
||||
index 89239568df43a73b46ec433dfb3f96a14f92928e..2d58d35bcdd515112f088bcc02f8c251d80d0411 100644
|
||||
index 19fa7ac26926231b01fe19f7adf62dd0e08edb1b..d4d3b97811a656d40884d7e4b872fdf72dfb11fa 100644
|
||||
--- a/content/common/view_messages.h
|
||||
+++ b/content/common/view_messages.h
|
||||
@@ -94,6 +94,9 @@ IPC_STRUCT_TRAITS_END()
|
||||
@@ -47,7 +47,7 @@ index 89239568df43a73b46ec433dfb3f96a14f92928e..2d58d35bcdd515112f088bcc02f8c251
|
||||
IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences,
|
||||
content::WebPreferences)
|
||||
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
|
||||
index 893c45a5c71b4e55ea323ae60e11d12ddb099efd..db9a1ff0fe1a912db83692ab17c620cff7446bcb 100644
|
||||
index dfd856eb481114fea9da3e26b4080c9a8473acf6..604a95a0427705eca523e91b08a136f806da68f0 100644
|
||||
--- a/content/public/browser/render_view_host.h
|
||||
+++ b/content/public/browser/render_view_host.h
|
||||
@@ -96,6 +96,9 @@ class CONTENT_EXPORT RenderViewHost : public IPC::Sender {
|
||||
@@ -61,10 +61,10 @@ index 893c45a5c71b4e55ea323ae60e11d12ddb099efd..db9a1ff0fe1a912db83692ab17c620cf
|
||||
//
|
||||
// Returns the current WebKit preferences. Note: WebPreferences is cached, so
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index ea7084056f13c60bcc3ba8bd4991a924b6153ee2..ccbe64ec13acb5e39ae869e30eebc3944e4e8ee9 100644
|
||||
index c1b0d1f5f7acb82f559ba90f24b6f9e5e7c44dad..dacde7b382a698309e3b5644003d359e273d5bd1 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -1174,6 +1174,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
@@ -1170,6 +1170,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
|
||||
@@ -73,7 +73,7 @@ index ea7084056f13c60bcc3ba8bd4991a924b6153ee2..ccbe64ec13acb5e39ae869e30eebc394
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
|
||||
@@ -1671,6 +1673,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
|
||||
@@ -1667,6 +1669,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
|
||||
return send_content_state_immediately_;
|
||||
}
|
||||
|
||||
@@ -83,14 +83,14 @@ index ea7084056f13c60bcc3ba8bd4991a924b6153ee2..ccbe64ec13acb5e39ae869e30eebc394
|
||||
+ GetWebView()->SetSchedulerThrottling(allowed);
|
||||
+}
|
||||
+
|
||||
void RenderViewImpl::ApplyPageVisibilityState(
|
||||
PageVisibilityState visibility_state,
|
||||
bool initial_setting) {
|
||||
void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) {
|
||||
webkit_preferences_ = prefs;
|
||||
ApplyWebPreferences(webkit_preferences_, GetWebView());
|
||||
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
|
||||
index 396c63b9dedde6c82b82edddbb35d010bf55474c..65fb52f7ba2f379c7ae1cab3250269172d83ad09 100644
|
||||
index 79ffb7a4a0ecef7c2e0583ca06a42c7bf6146bcc..ccb6f98da708fba99579623d92f9e40607e94dda 100644
|
||||
--- a/content/renderer/render_view_impl.h
|
||||
+++ b/content/renderer/render_view_impl.h
|
||||
@@ -402,6 +402,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
|
||||
@@ -391,6 +391,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
|
||||
void OnSetHistoryOffsetAndLength(int history_offset, int history_length);
|
||||
void OnSetRendererPrefs(
|
||||
const blink::mojom::RendererPreferences& renderer_prefs);
|
||||
@@ -99,10 +99,10 @@ index 396c63b9dedde6c82b82edddbb35d010bf55474c..65fb52f7ba2f379c7ae1cab325026917
|
||||
void OnUpdateTargetURLAck();
|
||||
void OnUpdateWebPreferences(const WebPreferences& prefs);
|
||||
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
|
||||
index 3995c946382f54582e2de2720dfc3475f76806bb..73ae36568d34f4e40cc68ef53e719532100f88ed 100644
|
||||
index baa1cec07522a23221b146165a638d3f679f9817..50f0c46c8fcbb4ee8ebb316f859f84d02d93ceda 100644
|
||||
--- a/third_party/blink/public/web/web_view.h
|
||||
+++ b/third_party/blink/public/web/web_view.h
|
||||
@@ -400,6 +400,7 @@ class WebView {
|
||||
@@ -393,6 +393,7 @@ class WebView {
|
||||
// Scheduling -----------------------------------------------------------
|
||||
|
||||
virtual PageScheduler* Scheduler() const = 0;
|
||||
@@ -111,10 +111,10 @@ index 3995c946382f54582e2de2720dfc3475f76806bb..73ae36568d34f4e40cc68ef53e719532
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 9098b1fa973dd57c5c1074fd73391888c4e6dac4..d5b696d7d372fc6caf3c281ea1c2ff2636a72fbd 100644
|
||||
index 27adaed62fe204202b4716cd573165b7456dbd29..2ba1cb1605ba5a10d5db78f4d3b440d431baceb1 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -3322,12 +3322,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3368,6 +3368,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -122,34 +122,35 @@ index 9098b1fa973dd57c5c1074fd73391888c4e6dac4..d5b696d7d372fc6caf3c281ea1c2ff26
|
||||
+ DCHECK(GetPage());
|
||||
+ scheduler_throttling_allowed_ = allowed;
|
||||
+ GetPage()->GetPageScheduler()->SetPageVisible(allowed ?
|
||||
+ (GetVisibilityState() == PageVisibilityState::kVisible) : true);
|
||||
+ (GetVisibilityState() == mojom::blink::PageVisibilityState::kVisible) : true);
|
||||
+}
|
||||
+
|
||||
void WebViewImpl::SetVisibilityState(PageVisibilityState visibility_state,
|
||||
bool is_initial_state) {
|
||||
DCHECK(GetPage());
|
||||
void WebViewImpl::SetVisibilityState(
|
||||
mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) {
|
||||
@@ -3378,7 +3385,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
}
|
||||
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
|
||||
- GetPage()->GetPageScheduler()->SetPageVisible(visibility_state ==
|
||||
- PageVisibilityState::kVisible);
|
||||
+ GetPage()->GetPageScheduler()->SetPageVisible(
|
||||
GetPage()->GetPageScheduler()->SetPageVisible(
|
||||
- visibility_state == mojom::blink::PageVisibilityState::kVisible);
|
||||
+ scheduler_throttling_allowed_ ?
|
||||
+ (visibility_state == PageVisibilityState::kVisible) : true);
|
||||
+ (visibility_state ==mojom::blink::PageVisibilityState::kVisible) : true);
|
||||
}
|
||||
|
||||
PageVisibilityState WebViewImpl::GetVisibilityState() {
|
||||
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index 9624d433eea3e2e09d91ce9ad44198d5e045d41b..c30fa33dc1e3e0413a7d483959e8602721e8207a 100644
|
||||
index e2124434e0d8ba3416179534ababca9d3b7f1708..3881e7a9f6fb25cbec37ddce6f87bf25b0d4a400 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -328,6 +328,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -329,6 +329,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
LocalDOMWindow* PagePopupWindow() const;
|
||||
|
||||
PageScheduler* Scheduler() const override;
|
||||
+ void SetSchedulerThrottling(bool allowed) override;
|
||||
void SetVisibilityState(PageVisibilityState visibility_state,
|
||||
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) override;
|
||||
PageVisibilityState GetVisibilityState() override;
|
||||
@@ -691,6 +692,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
mojom::blink::PageVisibilityState GetVisibilityState() override;
|
||||
@@ -681,6 +682,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
// WebViewImpl::Close while handling an input event.
|
||||
bool debug_inside_input_handling_ = false;
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ Subject: feat: allow embedders to add observers on created hunspell
|
||||
dictionaries
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
index af11ea50738ca20453c5c20f7807455fca8becfa..301a9de1eb82ebea009f0c20028e8ed87764622b 100644
|
||||
index 69a1dd21df96a5e4a727d568bde91e80d6eb1ee0..717d9c4da5ff4550b1e769bbe5347247ca596006 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
@@ -363,6 +363,9 @@ void SpellcheckService::LoadHunspellDictionaries() {
|
||||
std::make_unique<SpellcheckHunspellDictionary>(dictionary, context_,
|
||||
this));
|
||||
@@ -426,6 +426,9 @@ void SpellcheckService::LoadDictionaries() {
|
||||
std::make_unique<SpellcheckHunspellDictionary>(
|
||||
dictionary, platform_spellcheck_language, context_, this));
|
||||
hunspell_dictionaries_.back()->AddObserver(this);
|
||||
+ if (hunspell_observer_) {
|
||||
+ hunspell_dictionaries_.back()->AddObserver(hunspell_observer_);
|
||||
@@ -18,7 +18,7 @@ index af11ea50738ca20453c5c20f7807455fca8becfa..301a9de1eb82ebea009f0c20028e8ed8
|
||||
hunspell_dictionaries_.back()->Load();
|
||||
}
|
||||
|
||||
@@ -376,6 +379,20 @@ SpellcheckService::GetHunspellDictionaries() {
|
||||
@@ -458,6 +461,20 @@ SpellcheckService::GetHunspellDictionaries() {
|
||||
return hunspell_dictionaries_;
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index af11ea50738ca20453c5c20f7807455fca8becfa..301a9de1eb82ebea009f0c20028e8ed8
|
||||
std::string locale,
|
||||
std::string path,
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h
|
||||
index 97df131375cb11eb562ac0097ab7c870755b46dd..485331591812d0f28011160b186dc2e78f1e77a7 100644
|
||||
index 4c3d45d9ce6a14093126fbeb353d73124c7dff31..e3aabdc075b23ea38124de2e9b7cd80834d75b41 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.h
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.h
|
||||
@@ -123,6 +123,8 @@ class SpellcheckService : public KeyedService,
|
||||
@@ -126,6 +126,8 @@ class SpellcheckService : public KeyedService,
|
||||
const std::vector<std::unique_ptr<SpellcheckHunspellDictionary>>&
|
||||
GetHunspellDictionaries();
|
||||
|
||||
@@ -52,7 +52,7 @@ index 97df131375cb11eb562ac0097ab7c870755b46dd..485331591812d0f28011160b186dc2e7
|
||||
// Load a dictionary from a given path. Format specifies how the dictionary
|
||||
// is stored. Return value is true if successful.
|
||||
bool LoadExternalDictionary(std::string language,
|
||||
@@ -225,6 +227,8 @@ class SpellcheckService : public KeyedService,
|
||||
@@ -298,6 +300,8 @@ class SpellcheckService : public KeyedService,
|
||||
// A pointer to the BrowserContext which this service refers to.
|
||||
content::BrowserContext* context_;
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 3af93631092dc191c314f378b89ab09a56b36b3a..bcb285ee09d7218098d748d422e6dbbdafbc4c6a 100644
|
||||
index 0979770409131aed4bea76d33b2748c01dde9541..d256ec42bb2154628de7d8d08cc8cf4b6d928911 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -111,6 +111,8 @@ viz_component("service") {
|
||||
@@ -107,7 +107,7 @@ index 3af93631092dc191c314f378b89ab09a56b36b3a..bcb285ee09d7218098d748d422e6dbbd
|
||||
"display_embedder/software_output_surface.h",
|
||||
"display_embedder/viz_process_context_provider.cc",
|
||||
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
index b4d4b1c1c5978ca9369f7348e51dde4d935c72b3..e70d95818adf62f2e966e715a5043f91b255b799 100644
|
||||
index da8936a87cfe156a90952c1ca79d9faf6ef2cd1f..6fd321aaf610ee985868af62b0e856f19e8be264 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -126,7 +126,7 @@ index b4d4b1c1c5978ca9369f7348e51dde4d935c72b3..e70d95818adf62f2e966e715a5043f91
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/init/gl_factory.h"
|
||||
@@ -224,6 +226,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
@@ -223,6 +225,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
if (headless_)
|
||||
return std::make_unique<SoftwareOutputDevice>();
|
||||
|
||||
@@ -455,10 +455,10 @@ index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c0
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
index ffb3a04236be821e7ba1c7370258eb0610497c8e..5fd16e51508dc3227798a7166226ff5d01dcd921 100644
|
||||
index 641a63e8c18e3e81acacb67a59b285dac44abbb1..72b74ec00402ff7b5b4853c08365eb2f69d62713 100644
|
||||
--- a/content/browser/compositor/viz_process_transport_factory.cc
|
||||
+++ b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
@@ -404,8 +404,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
@@ -403,8 +403,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
compositor_data.display_private.reset();
|
||||
root_params->display_private =
|
||||
compositor_data.display_private.BindNewEndpointAndPassReceiver();
|
||||
@@ -475,10 +475,10 @@ index ffb3a04236be821e7ba1c7370258eb0610497c8e..5fd16e51508dc3227798a7166226ff5d
|
||||
compositor_data.display_client->GetBoundRemote(resize_task_runner_);
|
||||
|
||||
diff --git a/mojo/public/cpp/bindings/sync_call_restrictions.h b/mojo/public/cpp/bindings/sync_call_restrictions.h
|
||||
index 60e1149205750740ab5bde81029e7e3b370bd1ed..abfb772cd318b4cca3aed167a8808839d947f896 100644
|
||||
index 599d24e260ae85a2f71054cc64f296875b97170d..70269ce3332edd07f1760476f3592d08c3dc3130 100644
|
||||
--- a/mojo/public/cpp/bindings/sync_call_restrictions.h
|
||||
+++ b/mojo/public/cpp/bindings/sync_call_restrictions.h
|
||||
@@ -29,6 +29,7 @@ class Compositor;
|
||||
@@ -33,6 +33,7 @@ class Compositor;
|
||||
|
||||
namespace viz {
|
||||
class HostFrameSinkManager;
|
||||
@@ -486,7 +486,7 @@ index 60e1149205750740ab5bde81029e7e3b370bd1ed..abfb772cd318b4cca3aed167a8808839
|
||||
}
|
||||
|
||||
namespace mojo {
|
||||
@@ -79,6 +80,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
|
||||
@@ -83,6 +84,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
|
||||
// For destroying the GL context/surface that draw to a platform window before
|
||||
// the platform window is destroyed.
|
||||
friend class viz::HostFrameSinkManager;
|
||||
@@ -527,10 +527,10 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf64172d30ad8c 100644
|
||||
index 438dd212d881abf70362f12391b6a85f697785d0..34bd0cbf18714ac24355e603806cc36986f24e30 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -73,6 +73,7 @@ class DisplayPrivate;
|
||||
@@ -74,6 +74,7 @@ class DisplayPrivate;
|
||||
class ExternalBeginFrameController;
|
||||
} // namespace mojom
|
||||
class ContextProvider;
|
||||
@@ -538,7 +538,7 @@ index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf6417
|
||||
class HostFrameSinkManager;
|
||||
class LocalSurfaceIdAllocation;
|
||||
class RasterContextProvider;
|
||||
@@ -126,6 +127,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
@@ -127,6 +128,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
|
||||
};
|
||||
|
||||
@@ -554,7 +554,7 @@ index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf6417
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -160,6 +170,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -161,6 +171,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
@@ -564,7 +564,7 @@ index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf6417
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -409,6 +422,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -424,6 +437,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
|
||||
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Locascio <andy@slack-corp.com>
|
||||
Date: Thu, 2 Apr 2020 15:05:00 -0700
|
||||
Subject: fix: account for print preview disabled when printing to pdf
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2068936
|
||||
|
||||
Avoid an optimization introduced in the above CL. In my limited
|
||||
understanding, it seems like we slightly misuse the print preview API
|
||||
and this is fallout from using it in a way the code doesn't expect.
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 5d829b6ef0c02d0f230c9581377fe3b5941d9b42..776ca12f4509d317ff10461efbad8b7a09bd3afd 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -1475,6 +1475,7 @@ PrintRenderFrameHelper::CreatePreviewDocument() {
|
||||
const std::vector<int>& pages = print_pages_params_->pages;
|
||||
|
||||
bool require_document_metafile =
|
||||
+ !g_is_preview_enabled ||
|
||||
print_renderer_ ||
|
||||
print_params.printed_doc_type != SkiaDocumentType::MSKP;
|
||||
if (!print_preview_context_.CreatePreviewDocument(
|
||||
@@ -7,7 +7,7 @@ Subject:
|
||||
Disable usage of pthread_fchdir_np and pthread_chdir_np in MAS builds.
|
||||
|
||||
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
|
||||
index 62ffd51c4dd3166d6adbda24e6ee47805a69c93b..398290ffe8dd2d8d2ab13a6877a1932722968255 100644
|
||||
index 9e523d39181865aea8d35d998bc38a3a086943f6..57dd01b917242e0e83ade09a7356b351c666ab6d 100644
|
||||
--- a/base/process/launch_mac.cc
|
||||
+++ b/base/process/launch_mac.cc
|
||||
@@ -26,8 +26,10 @@ extern "C" {
|
||||
@@ -21,7 +21,7 @@ index 62ffd51c4dd3166d6adbda24e6ee47805a69c93b..398290ffe8dd2d8d2ab13a6877a19327
|
||||
|
||||
int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim)
|
||||
API_AVAILABLE(macosx(10.14));
|
||||
@@ -98,21 +100,29 @@ class PosixSpawnFileActions {
|
||||
@@ -102,21 +104,29 @@ class PosixSpawnFileActions {
|
||||
};
|
||||
|
||||
int ChangeCurrentThreadDirectory(const char* path) {
|
||||
@@ -51,7 +51,7 @@ index 62ffd51c4dd3166d6adbda24e6ee47805a69c93b..398290ffe8dd2d8d2ab13a6877a19327
|
||||
}
|
||||
|
||||
struct GetAppOutputOptions {
|
||||
@@ -228,11 +238,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
|
||||
@@ -232,11 +242,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
|
||||
file_actions.Inherit(STDERR_FILENO);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 4 Oct 2018 14:57:02 -0700
|
||||
Subject: Make sure hunspell file is not destroyed in UI thread
|
||||
|
||||
Submitted to Chromium at:
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/2206199/1
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
index 653ef44ff095015ef25cc59bf42f9fbd9d907160..d6f9bf8e0d2cf2e52698d4d132361a5d7118d00c 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
@@ -93,21 +93,28 @@ bool SaveDictionaryData(std::unique_ptr<std::string> data,
|
||||
|
||||
} // namespace
|
||||
|
||||
-SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile() {
|
||||
-}
|
||||
+SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile(
|
||||
+ base::TaskRunner* task_runner) : task_runner_(task_runner) {}
|
||||
|
||||
SpellcheckHunspellDictionary::DictionaryFile::~DictionaryFile() {
|
||||
+ if (file.IsValid()) {
|
||||
+ task_runner_->PostTask(FROM_HERE,
|
||||
+ base::BindOnce(&CloseDictionary, std::move(file)));
|
||||
+ }
|
||||
}
|
||||
|
||||
SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile(
|
||||
DictionaryFile&& other)
|
||||
- : path(other.path), file(std::move(other.file)) {}
|
||||
+ : path(other.path),
|
||||
+ file(std::move(other.file)),
|
||||
+ task_runner_(std::move(other.task_runner_)) {}
|
||||
|
||||
SpellcheckHunspellDictionary::DictionaryFile&
|
||||
SpellcheckHunspellDictionary::DictionaryFile::operator=(
|
||||
DictionaryFile&& other) {
|
||||
path = other.path;
|
||||
file = std::move(other.file);
|
||||
+ task_runner_ = std::move(other.task_runner_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -121,15 +128,10 @@ SpellcheckHunspellDictionary::SpellcheckHunspellDictionary(
|
||||
use_browser_spellchecker_(false),
|
||||
browser_context_(browser_context),
|
||||
spellcheck_service_(spellcheck_service),
|
||||
- download_status_(DOWNLOAD_NONE) {}
|
||||
+ download_status_(DOWNLOAD_NONE),
|
||||
+ dictionary_file_(task_runner_.get()) {}
|
||||
|
||||
SpellcheckHunspellDictionary::~SpellcheckHunspellDictionary() {
|
||||
- if (dictionary_file_.file.IsValid()) {
|
||||
- task_runner_->PostTask(
|
||||
- FROM_HERE,
|
||||
- base::BindOnce(&CloseDictionary, std::move(dictionary_file_.file)));
|
||||
- }
|
||||
-
|
||||
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
|
||||
// Disable the language from platform spellchecker.
|
||||
if (spellcheck::UseBrowserSpellChecker())
|
||||
@@ -324,7 +326,8 @@ void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
|
||||
#if !defined(OS_ANDROID)
|
||||
// static
|
||||
SpellcheckHunspellDictionary::DictionaryFile
|
||||
-SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
|
||||
+SpellcheckHunspellDictionary::OpenDictionaryFile(base::TaskRunner* task_runner,
|
||||
+ const base::FilePath& path) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
base::BlockingType::MAY_BLOCK);
|
||||
|
||||
@@ -335,7 +338,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
|
||||
// For systemwide installations on Windows, the default directory may not
|
||||
// have permissions for download. In that case, the alternate directory for
|
||||
// download is chrome::DIR_USER_DATA.
|
||||
- DictionaryFile dictionary;
|
||||
+ DictionaryFile dictionary(task_runner);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Check if the dictionary exists in the fallback location. If so, use it
|
||||
@@ -377,7 +380,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
|
||||
// static
|
||||
SpellcheckHunspellDictionary::DictionaryFile
|
||||
SpellcheckHunspellDictionary::InitializeDictionaryLocation(
|
||||
- const std::string& language) {
|
||||
+ base::TaskRunner* task_runner, const std::string& language) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
base::BlockingType::MAY_BLOCK);
|
||||
|
||||
@@ -392,7 +395,7 @@ SpellcheckHunspellDictionary::InitializeDictionaryLocation(
|
||||
base::FilePath dict_path =
|
||||
spellcheck::GetVersionedFileName(language, dict_dir);
|
||||
|
||||
- return OpenDictionaryFile(dict_path);
|
||||
+ return OpenDictionaryFile(task_runner, dict_path);
|
||||
}
|
||||
|
||||
void SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete(
|
||||
@@ -481,7 +484,8 @@ void SpellcheckHunspellDictionary::PlatformSupportsLanguageComplete(
|
||||
#if !defined(OS_ANDROID) && BUILDFLAG(USE_RENDERER_SPELLCHECKER)
|
||||
base::PostTaskAndReplyWithResult(
|
||||
task_runner_.get(), FROM_HERE,
|
||||
- base::BindOnce(&InitializeDictionaryLocation, language_),
|
||||
+ base::BindOnce(&InitializeDictionaryLocation,
|
||||
+ base::RetainedRef(task_runner_.get()), language_),
|
||||
base::BindOnce(
|
||||
&SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
index 4662bdc08b54304a7f8b2995f60fea9dc5617fff..7679f526c05980889adb2f6a8a0c20dd7f5415c3 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
@@ -99,7 +99,7 @@ class SpellcheckHunspellDictionary
|
||||
// blocking sequence.
|
||||
struct DictionaryFile {
|
||||
public:
|
||||
- DictionaryFile();
|
||||
+ explicit DictionaryFile(base::TaskRunner* task_runner);
|
||||
~DictionaryFile();
|
||||
|
||||
DictionaryFile(DictionaryFile&& other);
|
||||
@@ -112,6 +112,9 @@ class SpellcheckHunspellDictionary
|
||||
base::File file;
|
||||
|
||||
private:
|
||||
+ // Task runner where the file is created.
|
||||
+ scoped_refptr<base::TaskRunner> task_runner_;
|
||||
+
|
||||
DISALLOW_COPY_AND_ASSIGN(DictionaryFile);
|
||||
};
|
||||
|
||||
@@ -126,11 +129,12 @@ class SpellcheckHunspellDictionary
|
||||
#if !defined(OS_ANDROID)
|
||||
// Figures out the location for the dictionary, verifies its contents, and
|
||||
// opens it.
|
||||
- static DictionaryFile OpenDictionaryFile(const base::FilePath& path);
|
||||
+ static DictionaryFile OpenDictionaryFile(base::TaskRunner* task_runner,
|
||||
+ const base::FilePath& path);
|
||||
|
||||
// Gets the default location for the dictionary file.
|
||||
static DictionaryFile InitializeDictionaryLocation(
|
||||
- const std::string& language);
|
||||
+ base::TaskRunner* task_runner, const std::string& language);
|
||||
|
||||
// The reply point for PostTaskAndReplyWithResult, called after the dictionary
|
||||
// file has been initialized.
|
||||
30
patches/chromium/fix_include_missing_header_file.patch
Normal file
30
patches/chromium/fix_include_missing_header_file.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Kallai <kadam@inf.u-szeged.hu>
|
||||
Date: Thu, 2 Jul 2020 17:09:16 +0200
|
||||
Subject: fix: include missing header file
|
||||
|
||||
Include the header from base/ where NOTREACHED is defined.
|
||||
This fixes a build failure on Windows on Arm.
|
||||
|
||||
The patch was originally created by Richard Townsend <richard.townsend@arm.com>.
|
||||
|
||||
Bug: 1100363
|
||||
Change-Id: Ic97f7c217f22e51f1d4c9bd87ae434e263975c6d
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2279091
|
||||
Commit-Queue: Mark Mentovai <mark@chromium.org>
|
||||
Reviewed-by: Mark Mentovai <mark@chromium.org>
|
||||
|
||||
diff --git a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
|
||||
index 88cbc800de81de88d08c41e893ad4f64dc65ef47..778892c50be5e2acaaed3d47e45fb8a8261e695e 100644
|
||||
--- a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
|
||||
+++ b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
|
||||
@@ -23,7 +23,9 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
+#include "base/check_op.h"
|
||||
#include "base/logging.h"
|
||||
+#include "base/notreached.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user