mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
109 Commits
v25.0.0
...
v9.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6539f0d01 | ||
|
|
bef8448393 | ||
|
|
27619e8ab0 | ||
|
|
89c23f313f | ||
|
|
a9b9016b99 | ||
|
|
f1c1542958 | ||
|
|
cb90ef47bb | ||
|
|
a345fe2b4f | ||
|
|
0cf02dd78b | ||
|
|
3d941fc464 | ||
|
|
d32e1f8d97 | ||
|
|
b798e1ff54 | ||
|
|
bcb1d529ff | ||
|
|
e217a9416a | ||
|
|
4be52b8f78 | ||
|
|
2bc7aaf2ef | ||
|
|
1114954cbf | ||
|
|
a76ea622b9 | ||
|
|
7ee7890fd8 | ||
|
|
851ed7a6e7 | ||
|
|
16c4d6e487 | ||
|
|
56c0ba138b | ||
|
|
1883edd869 | ||
|
|
9b5f2159a2 | ||
|
|
60f16eaf95 | ||
|
|
0f08c6c874 | ||
|
|
e227578ae0 | ||
|
|
f413cda758 | ||
|
|
c41b543842 | ||
|
|
7bb430dc44 | ||
|
|
231f5af1a1 | ||
|
|
539ca773de | ||
|
|
1fc197bedb | ||
|
|
926bea232d | ||
|
|
db664f3433 | ||
|
|
9ec73a3dcf | ||
|
|
c1c1ac2b2e | ||
|
|
9c931136d0 | ||
|
|
f01ee72ea5 | ||
|
|
f6b4c39195 | ||
|
|
578f59532d | ||
|
|
dcf9e4b2dd | ||
|
|
2021f25453 | ||
|
|
faee8a092d | ||
|
|
3d65d84193 | ||
|
|
5e05df9f71 | ||
|
|
df2d03fe9b | ||
|
|
80967287ad | ||
|
|
2855f1d237 | ||
|
|
5e25649e77 | ||
|
|
3e90e523eb | ||
|
|
c702aec1f8 | ||
|
|
ede40f260e | ||
|
|
ca53cc8380 | ||
|
|
7ec9b4e252 | ||
|
|
0d7e13d2a6 | ||
|
|
a5c56684b9 | ||
|
|
68d96459c3 | ||
|
|
6cf4757019 | ||
|
|
6e80d6fba5 | ||
|
|
ec07954d5d | ||
|
|
7fd2d39f72 | ||
|
|
64880c75a3 | ||
|
|
cc94689db1 | ||
|
|
806e483049 | ||
|
|
8129e92d2b | ||
|
|
660706ba2c | ||
|
|
2feca9d35a | ||
|
|
3a4118703a | ||
|
|
bd669f72ee | ||
|
|
1f3c3eee83 | ||
|
|
6e84ebee8e | ||
|
|
f22376ef32 | ||
|
|
324b49a5eb | ||
|
|
0e9727e8d5 | ||
|
|
44ee90e5cf | ||
|
|
2b9ef75d82 | ||
|
|
4dc2b4d55f | ||
|
|
69f77d309d | ||
|
|
9cd1744a2b | ||
|
|
c6e411173e | ||
|
|
8b11adc6f2 | ||
|
|
57ec30e459 | ||
|
|
c4a836f95a | ||
|
|
9b2de2583e | ||
|
|
7b2bfb4a0f | ||
|
|
0e31826043 | ||
|
|
7b3c073b3e | ||
|
|
2dc900b95d | ||
|
|
f41423501a | ||
|
|
07d9728b63 | ||
|
|
d4c90e80a5 | ||
|
|
91141028e6 | ||
|
|
9d69d4b9ef | ||
|
|
d57d5c544e | ||
|
|
74d4dab157 | ||
|
|
94246dabe3 | ||
|
|
4fe91e56ac | ||
|
|
0d7440d676 | ||
|
|
60edd2d3b1 | ||
|
|
d4d06660f3 | ||
|
|
8d8f15121b | ||
|
|
1f8cb5144d | ||
|
|
667ee359a1 | ||
|
|
4b009159ba | ||
|
|
89f66bd00c | ||
|
|
2d542c6028 | ||
|
|
68346fec55 | ||
|
|
23f32ca9f3 |
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@
|
||||
"no-var": "error",
|
||||
"no-unused-vars": 0,
|
||||
"no-global-assign": 0,
|
||||
"guard-for-in": 2,
|
||||
"@typescript-eslint/no-unused-vars": ["error", {
|
||||
"vars": "all",
|
||||
"args": "after-used",
|
||||
|
||||
23
BUILD.gn
23
BUILD.gn
@@ -629,8 +629,6 @@ source_set("electron_lib") {
|
||||
deps += [ "//components/printing/common:mojo_interfaces" ]
|
||||
}
|
||||
|
||||
deps += [ "shell/common/extensions/api:extensions_features" ]
|
||||
deps += [ "shell/common/extensions/api" ]
|
||||
deps += [
|
||||
"//components/pref_registry",
|
||||
"//components/user_prefs",
|
||||
@@ -642,12 +640,22 @@ source_set("electron_lib") {
|
||||
]
|
||||
if (enable_electron_extensions) {
|
||||
sources += filenames.lib_sources_extensions
|
||||
deps += [
|
||||
"shell/browser/extensions/api:api_registration",
|
||||
"shell/common/extensions/api",
|
||||
"shell/common/extensions/api:extensions_features",
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
"//components/zoom",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_pdf) {
|
||||
# Printing depends on some //pdf code, so it needs to be built even if the
|
||||
# pdf viewer isn't enabled.
|
||||
deps += [ "//pdf" ]
|
||||
deps += [
|
||||
"//pdf",
|
||||
"//pdf:features",
|
||||
]
|
||||
}
|
||||
if (enable_pdf_viewer) {
|
||||
deps += [
|
||||
@@ -718,6 +726,7 @@ if (is_mac) {
|
||||
sources = [
|
||||
"$root_out_dir/egl_intermediates/libEGL.dylib",
|
||||
"$root_out_dir/egl_intermediates/libGLESv2.dylib",
|
||||
"$root_out_dir/egl_intermediates/libvulkan.dylib",
|
||||
]
|
||||
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
|
||||
public_deps = [ "//ui/gl:angle_library_copy" ]
|
||||
@@ -728,9 +737,14 @@ if (is_mac) {
|
||||
sources = [
|
||||
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
|
||||
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
|
||||
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
|
||||
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
|
||||
]
|
||||
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
|
||||
public_deps = [ "//ui/gl:swiftshader_library_copy" ]
|
||||
public_deps = [
|
||||
"//ui/gl:swiftshader_egl_library_copy",
|
||||
"//ui/gl:swiftshader_vk_library_copy",
|
||||
]
|
||||
}
|
||||
}
|
||||
group("electron_angle_library") {
|
||||
@@ -783,6 +797,7 @@ if (is_mac) {
|
||||
|
||||
include_dirs = [ "." ]
|
||||
sources = filenames.framework_sources
|
||||
libs = []
|
||||
|
||||
if (enable_osr) {
|
||||
libs += [ "IOSurface.framework" ]
|
||||
|
||||
2
DEPS
2
DEPS
@@ -12,7 +12,7 @@ gclient_gn_args = [
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'2102ff0fb03469ca5ff317a168e6ad99ca0f23f1',
|
||||
'82.0.4085.10',
|
||||
'node_version':
|
||||
'v12.14.1',
|
||||
'nan_version':
|
||||
|
||||
@@ -1 +1 @@
|
||||
9.0.0-nightly.20200205
|
||||
9.0.0-beta.10
|
||||
24
appveyor.yml
24
appveyor.yml
@@ -118,19 +118,29 @@ build_script:
|
||||
}
|
||||
}
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||
.\src\electron\script\start-goma.ps1 -gomaDir "$pwd\src\electron\external_binaries\goma"
|
||||
if ($env:GN_CONFIG -ne 'release') {
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
|
||||
}
|
||||
git clone https://github.com/electron/build-tools.git
|
||||
cd build-tools
|
||||
npm install
|
||||
mkdir third_party
|
||||
node -e "require('./src/utils/goma.js').downloadAndPrepare()"
|
||||
$env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||
$env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||
cd ..
|
||||
.\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
||||
}
|
||||
- cd src
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- if DEFINED RAW_GOMA_AUTH (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"//electron/build/args/goma.gn\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
|
||||
- if DEFINED GN_GOMA_FILE (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% ") else (gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS% cc_wrapper=\"%SCCACHE_PATH%\"")
|
||||
- gn check out/Default //electron:electron_lib
|
||||
- gn check out/Default //electron:electron_app
|
||||
- gn check out/Default //electron:manifests
|
||||
- gn check out/Default //electron/shell/common/api:mojo
|
||||
- if DEFINED RAW_GOMA_AUTH (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
|
||||
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
|
||||
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
|
||||
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
|
||||
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||
@@ -140,7 +150,7 @@ build_script:
|
||||
- ninja -C out/Default electron:hunspell_dictionaries_zip
|
||||
- ninja -C out/Default electron:electron_chromedriver_zip
|
||||
- ninja -C out/Default third_party/electron_node:headers
|
||||
- if DEFINED RAW_GOMA_AUTH (python electron\external_binaries\goma\goma_ctl.py stat)
|
||||
- if "%GN_CONFIG%"=="testing" ( python %LOCAL_GOMA_DIR%\goma_ctl.py stat )
|
||||
- python electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
||||
- appveyor PushArtifact out/Default/windows_toolchain_profile.json
|
||||
- appveyor PushArtifact out/Default/dist.zip
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
|
||||
node_module_version = 76
|
||||
node_module_version = 80
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_typed_array_max_size_in_heap = 0
|
||||
@@ -21,7 +21,6 @@ dawn_enable_vulkan_validation_layers = false
|
||||
|
||||
is_cfi = false
|
||||
|
||||
# TODO: disabled due to crashes. re-enable.
|
||||
enable_osr = false
|
||||
enable_osr = true
|
||||
|
||||
enable_electron_extensions = true
|
||||
|
||||
@@ -14,7 +14,7 @@ declare_args() {
|
||||
|
||||
enable_view_api = false
|
||||
|
||||
enable_pdf_viewer = false
|
||||
enable_pdf_viewer = true
|
||||
|
||||
enable_tts = true
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ static_library("chrome") {
|
||||
]
|
||||
deps = [
|
||||
"//chrome/browser:resource_prefetch_predictor_proto",
|
||||
"//chrome/browser/ssl:proto",
|
||||
"//components/feature_engagement:buildflags",
|
||||
]
|
||||
|
||||
@@ -233,6 +232,12 @@ static_library("chrome") {
|
||||
|
||||
if (enable_electron_extensions) {
|
||||
sources += [
|
||||
"//chrome/browser/extensions/chrome_url_request_util.cc",
|
||||
"//chrome/browser/extensions/chrome_url_request_util.h",
|
||||
"//chrome/browser/pdf/pdf_extension_util.cc",
|
||||
"//chrome/browser/pdf/pdf_extension_util.h",
|
||||
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc",
|
||||
"//chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.h",
|
||||
"//chrome/renderer/extensions/extension_hooks_delegate.cc",
|
||||
"//chrome/renderer/extensions/extension_hooks_delegate.h",
|
||||
"//chrome/renderer/extensions/tabs_hooks_delegate.cc",
|
||||
@@ -293,8 +298,6 @@ source_set("plugins") {
|
||||
sources += [
|
||||
"//chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc",
|
||||
"//chrome/renderer/pepper/pepper_flash_drm_renderer_host.h",
|
||||
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
|
||||
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
|
||||
"//chrome/renderer/pepper/pepper_flash_fullscreen_host.cc",
|
||||
"//chrome/renderer/pepper/pepper_flash_fullscreen_host.h",
|
||||
"//chrome/renderer/pepper/pepper_flash_menu_host.cc",
|
||||
@@ -303,6 +306,12 @@ source_set("plugins") {
|
||||
"//chrome/renderer/pepper/pepper_flash_renderer_host.h",
|
||||
]
|
||||
}
|
||||
if (enable_pepper_flash || enable_pdf_viewer) {
|
||||
sources += [
|
||||
"//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
|
||||
"//chrome/renderer/pepper/pepper_flash_font_file_host.h",
|
||||
]
|
||||
}
|
||||
deps += [
|
||||
"//components/strings",
|
||||
"//media:media_buildflags",
|
||||
|
||||
@@ -703,34 +703,34 @@ Clears the recent documents list.
|
||||
|
||||
### `app.setAsDefaultProtocolClient(protocol[, path, args])`
|
||||
|
||||
* `protocol` String - The name of your protocol, without `://`. If you want your
|
||||
app to handle `electron://` links, call this method with `electron` as the
|
||||
parameter.
|
||||
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
|
||||
* `args` String[] (optional) _Windows_ - Defaults to an empty array
|
||||
* `protocol` String - The name of your protocol, without `://`. For example,
|
||||
if you want your app to handle `electron://` links, call this method with
|
||||
`electron` as the parameter.
|
||||
* `path` String (optional) _Windows_ - The path to the Electron executable.
|
||||
Defaults to `process.execPath`
|
||||
* `args` String[] (optional) _Windows_ - Arguments passed to the executable.
|
||||
Defaults to an empty array
|
||||
|
||||
Returns `Boolean` - Whether the call succeeded.
|
||||
|
||||
This method sets the current executable as the default handler for a protocol
|
||||
(aka URI scheme). It allows you to integrate your app deeper into the operating
|
||||
system. Once registered, all links with `your-protocol://` will be opened with
|
||||
the current executable. The whole link, including protocol, will be passed to
|
||||
your application as a parameter.
|
||||
|
||||
On Windows, you can provide optional parameters path, the path to your executable,
|
||||
and args, an array of arguments to be passed to your executable when it launches.
|
||||
Sets the current executable as the default handler for a protocol (aka URI
|
||||
scheme). It allows you to integrate your app deeper into the operating system.
|
||||
Once registered, all links with `your-protocol://` will be opened with the
|
||||
current executable. The whole link, including protocol, will be passed to your
|
||||
application as a parameter.
|
||||
|
||||
**Note:** On macOS, you can only register protocols that have been added to
|
||||
your app's `info.plist`, which can not be modified at runtime. You can however
|
||||
change the file with a simple text editor or script during build time.
|
||||
Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
||||
your app's `info.plist`, which cannot be modified at runtime. However, you can
|
||||
change the file during build time via [Electron Forge][electron-forge],
|
||||
[Electron Packager][electron-packager], or by editing `info.plist` with a text
|
||||
editor. Please refer to [Apple's documentation][CFBundleURLTypes] for details.
|
||||
|
||||
**Note:** In a Windows Store environment (when packaged as an `appx`) this API
|
||||
will return `true` for all calls but the registry key it sets won't be accessible
|
||||
by other applications. In order to register your Windows Store application
|
||||
as a default protocol handler you must [declare the protocol in your manifest](https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-protocol).
|
||||
|
||||
The API uses the Windows Registry and LSSetDefaultHandlerForURLScheme internally.
|
||||
The API uses the Windows Registry and `LSSetDefaultHandlerForURLScheme` internally.
|
||||
|
||||
### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_
|
||||
|
||||
@@ -749,10 +749,8 @@ protocol (aka URI scheme). If so, it will remove the app as the default handler.
|
||||
* `path` String (optional) _Windows_ - Defaults to `process.execPath`
|
||||
* `args` String[] (optional) _Windows_ - Defaults to an empty array
|
||||
|
||||
Returns `Boolean`
|
||||
|
||||
This method checks if the current executable is the default handler for a protocol
|
||||
(aka URI scheme). If so, it will return true. Otherwise, it will return false.
|
||||
Returns `Boolean` - Whether the current executable is the default handler for a
|
||||
protocol (aka URI scheme).
|
||||
|
||||
**Note:** On macOS, you can use this method to check if the app has been
|
||||
registered as the default protocol handler for a protocol. You can also verify
|
||||
@@ -760,7 +758,7 @@ this by checking `~/Library/Preferences/com.apple.LaunchServices.plist` on the
|
||||
macOS machine. Please refer to
|
||||
[Apple's documentation][LSCopyDefaultHandlerForURLScheme] for details.
|
||||
|
||||
The API uses the Windows Registry and LSCopyDefaultHandlerForURLScheme internally.
|
||||
The API uses the Windows Registry and `LSCopyDefaultHandlerForURLScheme` internally.
|
||||
|
||||
### `app.getApplicationNameForProtocol(url)`
|
||||
|
||||
@@ -1327,6 +1325,8 @@ A `Boolean` property that returns `true` if the app is packaged, `false` otherw
|
||||
[dock-menu]:https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
|
||||
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
|
||||
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
|
||||
[electron-forge]: https://www.electronforge.io/
|
||||
[electron-packager]: https://github.com/electron/electron-packager
|
||||
[CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
|
||||
[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme
|
||||
[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html
|
||||
|
||||
@@ -289,7 +289,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
between the web pages even when you specified different values for them,
|
||||
including but not limited to `preload`, `sandbox` and `nodeIntegration`.
|
||||
So it is suggested to use exact same `webPreferences` for web pages with
|
||||
the same `affinity`. _This property is experimental_
|
||||
the same `affinity`. _Deprecated_
|
||||
* `zoomFactor` Number (optional) - The default zoom factor of the page, `3.0` represents
|
||||
`300%`. Default is `1.0`.
|
||||
* `javascript` Boolean (optional) - Enables JavaScript support. Default is `true`.
|
||||
@@ -369,6 +369,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
consecutive dialog protection is triggered. If not defined the default
|
||||
message would be used, note that currently the default message is in
|
||||
English and not localized.
|
||||
* `disableDialogs` Boolean (optional) - Whether to disable dialogs
|
||||
completely. Overrides `safeDialogs`. Default is `false`.
|
||||
* `navigateOnDragDrop` Boolean (optional) - Whether dragging and dropping a
|
||||
file or link onto the page causes a navigation. Default is `false`.
|
||||
* `autoplayPolicy` String (optional) - Autoplay policy to apply to
|
||||
@@ -1113,15 +1115,11 @@ Returns `Integer[]` - Contains the window's maximum width and height.
|
||||
|
||||
* `resizable` Boolean
|
||||
|
||||
Sets whether the window can be manually resized by user.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
Sets whether the window can be manually resized by the user.
|
||||
|
||||
#### `win.isResizable()`
|
||||
|
||||
Returns `Boolean` - Whether the window can be manually resized by user.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
Returns `Boolean` - Whether the window can be manually resized by the user.
|
||||
|
||||
#### `win.setMovable(movable)` _macOS_ _Windows_
|
||||
|
||||
@@ -1129,41 +1127,29 @@ Returns `Boolean` - Whether the window can be manually resized by user.
|
||||
|
||||
Sets whether the window can be moved by user. On Linux does nothing.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.isMovable()` _macOS_ _Windows_
|
||||
|
||||
Returns `Boolean` - Whether the window can be moved by user.
|
||||
|
||||
On Linux always returns `true`.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.setMinimizable(minimizable)` _macOS_ _Windows_
|
||||
|
||||
* `minimizable` Boolean
|
||||
|
||||
Sets whether the window can be manually minimized by user. On Linux does
|
||||
nothing.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
Sets whether the window can be manually minimized by user. On Linux does nothing.
|
||||
|
||||
#### `win.isMinimizable()` _macOS_ _Windows_
|
||||
|
||||
Returns `Boolean` - Whether the window can be manually minimized by user
|
||||
Returns `Boolean` - Whether the window can be manually minimized by the user.
|
||||
|
||||
On Linux always returns `true`.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.setMaximizable(maximizable)` _macOS_ _Windows_
|
||||
|
||||
* `maximizable` Boolean
|
||||
|
||||
Sets whether the window can be manually maximized by user. On Linux does
|
||||
nothing.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
Sets whether the window can be manually maximized by user. On Linux does nothing.
|
||||
|
||||
#### `win.isMaximizable()` _macOS_ _Windows_
|
||||
|
||||
@@ -1171,23 +1157,15 @@ Returns `Boolean` - Whether the window can be manually maximized by user.
|
||||
|
||||
On Linux always returns `true`.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.setFullScreenable(fullscreenable)`
|
||||
|
||||
* `fullscreenable` Boolean
|
||||
|
||||
Sets whether the maximize/zoom window button toggles fullscreen mode or
|
||||
maximizes the window.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.
|
||||
|
||||
#### `win.isFullScreenable()`
|
||||
|
||||
Returns `Boolean` - Whether the maximize/zoom window button toggles fullscreen mode or
|
||||
maximizes the window.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
Returns `Boolean` - Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.
|
||||
|
||||
#### `win.setClosable(closable)` _macOS_ _Windows_
|
||||
|
||||
@@ -1195,16 +1173,12 @@ maximizes the window.
|
||||
|
||||
Sets whether the window can be manually closed by user. On Linux does nothing.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.isClosable()` _macOS_ _Windows_
|
||||
|
||||
Returns `Boolean` - Whether the window can be manually closed by user.
|
||||
|
||||
On Linux always returns `true`.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.setAlwaysOnTop(flag[, level][, relativeLevel])`
|
||||
|
||||
* `flag` Boolean
|
||||
@@ -1616,23 +1590,17 @@ This cannot be called when `titleBarStyle` is set to `customButtonsOnHover`.
|
||||
Sets whether the window menu bar should hide itself automatically. Once set the
|
||||
menu bar will only show when users press the single `Alt` key.
|
||||
|
||||
If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't
|
||||
hide it immediately.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately.
|
||||
|
||||
#### `win.isMenuBarAutoHide()`
|
||||
|
||||
Returns `Boolean` - Whether menu bar automatically hides itself.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `win.setMenuBarVisibility(visible)` _Windows_ _Linux_
|
||||
|
||||
* `visible` Boolean
|
||||
|
||||
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
||||
can still bring up the menu bar by pressing the single `Alt` key.
|
||||
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
|
||||
|
||||
#### `win.isMenuBarVisible()`
|
||||
|
||||
@@ -1748,6 +1716,17 @@ will remove the vibrancy effect on the window.
|
||||
Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
|
||||
deprecated and will be removed in an upcoming version of macOS.
|
||||
|
||||
#### `win.setTrafficLightPosition(position)` _macOS_
|
||||
|
||||
* `position` [Point](structures/point.md)
|
||||
|
||||
Set a custom position for the traffic light buttons. Can only be used with `titleBarStyle` set to `hidden`.
|
||||
|
||||
#### `win.getTrafficLightPosition()` _macOS_
|
||||
|
||||
Returns `Point` - The current position for the traffic light buttons. Can only be used with `titleBarStyle`
|
||||
set to `hidden`.
|
||||
|
||||
#### `win.setTouchBar(touchBar)` _macOS_ _Experimental_
|
||||
|
||||
* `touchBar` TouchBar | null
|
||||
|
||||
@@ -53,16 +53,23 @@ Unsupported options are:
|
||||
|
||||
### `GOOGLE_API_KEY`
|
||||
|
||||
You can provide an API key for making requests to Google's geocoding webservice. To do this, place the following code in your main process
|
||||
file, before opening any browser windows that will make geocoding requests:
|
||||
Geolocation support in Electron requires the use of Google Cloud Platform's
|
||||
geolocation webservice. To enable this feature, acquire a
|
||||
[Google API key](https://developers.google.com/maps/documentation/geolocation/get-api-key)
|
||||
and place the following code in your main process file, before opening any
|
||||
browser windows that will make geolocation requests:
|
||||
|
||||
```javascript
|
||||
process.env.GOOGLE_API_KEY = 'YOUR_KEY_HERE'
|
||||
```
|
||||
|
||||
For instructions on how to acquire a Google API key, visit [this page](https://developers.google.com/maps/documentation/javascript/get-api-key).
|
||||
By default, a newly generated Google API key may not be allowed to make
|
||||
geocoding requests. To enable geocoding requests, visit [this page](https://developers.google.com/maps/documentation/geocoding/get-api-key).
|
||||
By default, a newly generated Google API key may not be allowed to make geolocation requests.
|
||||
To enable the geolocation webservice for your project, enable it through the
|
||||
[API library](https://console.cloud.google.com/apis/library).
|
||||
|
||||
N.B. You will need to add a
|
||||
[Billing Account](https://cloud.google.com/billing/docs/how-to/payment-methods#add_a_payment_method)
|
||||
to the project associated to the API key for the geolocation webservice to work.
|
||||
|
||||
### `ELECTRON_NO_ASAR`
|
||||
|
||||
|
||||
62
docs/api/service-workers.md
Normal file
62
docs/api/service-workers.md
Normal file
@@ -0,0 +1,62 @@
|
||||
## Class: ServiceWorkers
|
||||
|
||||
> Query and receive events from a sessions active service workers.
|
||||
|
||||
Process: [Main](../glossary.md#main-process)
|
||||
|
||||
Instances of the `ServiceWorkers` class are accessed by using `serviceWorkers` property of
|
||||
a `Session`.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const { session } = require('electron')
|
||||
|
||||
// Get all service workers.
|
||||
console.log(session.defaultSession.serviceWorkers.getAllRunning())
|
||||
|
||||
// Handle logs and get service worker info
|
||||
session.defaultSession.serviceWorkers.on('console-message', (event, messageDetails) => {
|
||||
console.log(
|
||||
'Got service worker message',
|
||||
messageDetails,
|
||||
'from',
|
||||
session.defaultSession.serviceWorkers.getFromVersionID(messageDetails.versionId)
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
### Instance Events
|
||||
|
||||
The following events are available on instances of `ServiceWorkers`:
|
||||
|
||||
#### Event: 'console-message'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `messageDetails` Object - Information about the console message
|
||||
* `message` String - The actual console message
|
||||
* `versionId` Number - The version ID of the service worker that sent the log message
|
||||
* `source` String - The type of source for this message. Can be `javascript`, `xml`, `network`, `console-api`, `storage`, `app-cache`, `rendering`, `security`, `deprecation`, `worker`, `violation`, `intervention`, `recommendation` or `other`.
|
||||
* `level` Number - The log level, from 0 to 3. In order it matches `verbose`, `info`, `warning` and `error`.
|
||||
* `sourceUrl` String - The URL the message came from
|
||||
* `lineNumber` Number - The line number of the source that triggered this console message
|
||||
|
||||
Emitted when a service worker logs something to the console.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
The following methods are available on instances of `ServiceWorkers`:
|
||||
|
||||
#### `serviceWorkers.getAllRunning()`
|
||||
|
||||
Returns `Record<Number, ServiceWorkerInfo>` - A [ServiceWorkerInfo](structures/service-worker-info.md) object where the keys are the service worker version ID and the values are the information about that service worker.
|
||||
|
||||
#### `serviceWorkers.getFromVersionID(versionId)`
|
||||
|
||||
* `versionId` Number
|
||||
|
||||
Returns [`ServiceWorkerInfo`](structures/service-worker-info.md) - Information about this service worker
|
||||
|
||||
If the service worker does not exist or is not running this method will throw an exception.
|
||||
@@ -105,6 +105,45 @@ Returns:
|
||||
Emitted when a render process requests preconnection to a URL, generally due to
|
||||
a [resource hint](https://w3c.github.io/resource-hints/).
|
||||
|
||||
#### Event: 'spellcheck-dictionary-initialized'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `languageCode` String - The language code of the dictionary file
|
||||
|
||||
Emitted when a hunspell dictionary file has been successfully initialized. This
|
||||
occurs after the file has been downloaded.
|
||||
|
||||
#### Event: 'spellcheck-dictionary-download-begin'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `languageCode` String - The language code of the dictionary file
|
||||
|
||||
Emitted when a hunspell dictionary file starts downloading
|
||||
|
||||
#### Event: 'spellcheck-dictionary-download-success'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `languageCode` String - The language code of the dictionary file
|
||||
|
||||
Emitted when a hunspell dictionary file has been successfully downloaded
|
||||
|
||||
#### Event: 'spellcheck-dictionary-download-failure'
|
||||
|
||||
Returns:
|
||||
|
||||
* `event` Event
|
||||
* `languageCode` String - The language code of the dictionary file
|
||||
|
||||
Emitted when a hunspell dictionary file download fails. For details
|
||||
on the failure you should collect a netlog and inspect the download
|
||||
request.
|
||||
|
||||
### Instance Methods
|
||||
|
||||
The following methods are available on instances of `Session`:
|
||||
@@ -483,18 +522,38 @@ setting with the current OS locale. This setting is persisted across restarts.
|
||||
By default Electron will download hunspell dictionaries from the Chromium CDN. If you want to override this
|
||||
behavior you can use this API to point the dictionary downloader at your own hosted version of the hunspell
|
||||
dictionaries. We publish a `hunspell_dictionaries.zip` file with each release which contains the files you need
|
||||
to host here.
|
||||
to host here, the file server must be **case insensitive** you must upload each file twice, once with the case it
|
||||
has in the ZIP file and once with the filename as all lower case.
|
||||
|
||||
If the files present in `hunspell_dictionaries.zip` are available at `https://example.com/dictionaries/language-code.bdic`
|
||||
then you should call this api with `ses.setSpellCheckerDictionaryDownloadURL('https://example.com/dictionaries/')`. Please
|
||||
note the trailing slash. The URL to the dictionaries is formed as `${url}${filename}`.
|
||||
|
||||
**Note:** On macOS the OS spellchecker is used and therefore we do not download any dictionary files. This API is a no-op on macOS.
|
||||
|
||||
#### `ses.listWordsInSpellCheckerDictionary()`
|
||||
|
||||
Returns `Promise<String[]>` - An array of all words in app's custom dictionary.
|
||||
Resolves when the full dictionary is loaded from disk.
|
||||
|
||||
#### `ses.addWordToSpellCheckerDictionary(word)`
|
||||
|
||||
* `word` String - The word you want to add to the dictionary
|
||||
|
||||
Returns `Boolean` - Whether the word was successfully written to the custom dictionary.
|
||||
Returns `Boolean` - Whether the word was successfully written to the custom dictionary. This API
|
||||
will not work on non-persistent (in-memory) sessions.
|
||||
|
||||
**Note:** On macOS and Windows 10 this word will be written to the OS custom dictionary as well
|
||||
|
||||
#### `ses.removeWordFromSpellCheckerDictionary(word)`
|
||||
|
||||
* `word` String - The word you want to remove from the dictionary
|
||||
|
||||
Returns `Boolean` - Whether the word was successfully removed from the custom dictionary. This API
|
||||
will not work on non-persistent (in-memory) sessions.
|
||||
|
||||
**Note:** On macOS and Windows 10 this word will be removed from the OS custom dictionary as well
|
||||
|
||||
#### `ses.loadExtension(path)`
|
||||
|
||||
* `path` String - Path to a directory containing an unpacked Chrome extension
|
||||
@@ -567,6 +626,10 @@ code to the `setSpellCheckerLanaguages` API that isn't in this array will result
|
||||
|
||||
A [`Cookies`](cookies.md) object for this session.
|
||||
|
||||
#### `ses.serviceWorkers` _Readonly_
|
||||
|
||||
A [`ServiceWorkers`](service-workers.md) object for this session.
|
||||
|
||||
#### `ses.webRequest` _Readonly_
|
||||
|
||||
A [`WebRequest`](web-request.md) object for this session.
|
||||
|
||||
5
docs/api/structures/service-worker-info.md
Normal file
5
docs/api/structures/service-worker-info.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# ServiceWorkerInfo Object
|
||||
|
||||
* `scriptUrl` String - The full URL to the script that this service worker runs
|
||||
* `scope` String - The base URL that this service worker is active for.
|
||||
* `renderProcessId` Number - The virtual ID of the process that this service worker is running in. This is not an OS level PID. This aligns with the ID set used for `webContents.getProcessId()`.
|
||||
@@ -369,14 +369,6 @@ Returns `String` - Can be `dark`, `light` or `unknown`.
|
||||
Gets the macOS appearance setting that is currently applied to your application,
|
||||
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
|
||||
|
||||
Please note that until Electron is built targeting the 10.14 SDK, your application's
|
||||
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
|
||||
the interim in order for your application to inherit the OS preference you must set the
|
||||
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
|
||||
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
|
||||
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
|
||||
for more details.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
### `systemPreferences.getAppLevelAppearance()` _macOS_ _Deprecated_
|
||||
@@ -404,8 +396,6 @@ Returns `Boolean` - whether or not this device has the ability to use Touch ID.
|
||||
|
||||
**NOTE:** This API will return `false` on macOS systems older than Sierra 10.12.2.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
### `systemPreferences.promptTouchID(reason)` _macOS_
|
||||
|
||||
* `reason` String - The reason you are asking for Touch ID authentication
|
||||
@@ -480,11 +470,3 @@ A `String` property that can be `dark`, `light` or `unknown`.
|
||||
|
||||
Returns the macOS appearance setting that is currently applied to your application,
|
||||
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
|
||||
|
||||
Please note that until Electron is built targeting the 10.14 SDK, your application's
|
||||
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
|
||||
the interim in order for your application to inherit the OS preference you must set the
|
||||
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
|
||||
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
|
||||
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
|
||||
for more details.
|
||||
|
||||
@@ -1068,11 +1068,13 @@ Returns `Boolean` - Whether audio is currently playing.
|
||||
|
||||
#### `contents.setZoomFactor(factor)`
|
||||
|
||||
* `factor` Number - Zoom factor.
|
||||
* `factor` Double - Zoom factor; default is 1.0.
|
||||
|
||||
Changes the zoom factor to the specified factor. Zoom factor is
|
||||
zoom percent divided by 100, so 300% = 3.0.
|
||||
|
||||
The factor must be greater than 0.0.
|
||||
|
||||
**[Deprecated](modernization/property-updates.md)**
|
||||
|
||||
#### `contents.getZoomFactor()`
|
||||
@@ -1286,7 +1288,7 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`.
|
||||
* `callback` Function (optional)
|
||||
* `success` Boolean - Indicates success of the print call.
|
||||
* `failureReason` String - Called back if the print fails; can be `cancelled` or `failed`.
|
||||
* `failureReason` String - Error description called back if the print fails.
|
||||
|
||||
Prints window's web page. When `silent` is set to `true`, Electron will pick
|
||||
the system's default printer if `deviceName` is empty and the default settings for printing.
|
||||
|
||||
@@ -22,11 +22,13 @@ The `WebFrame` class has the following instance methods:
|
||||
|
||||
### `webFrame.setZoomFactor(factor)`
|
||||
|
||||
* `factor` Number - Zoom factor.
|
||||
* `factor` Double - Zoom factor; default is 1.0.
|
||||
|
||||
Changes the zoom factor to the specified factor. Zoom factor is
|
||||
zoom percent divided by 100, so 300% = 3.0.
|
||||
|
||||
The factor must be greater than 0.0.
|
||||
|
||||
### `webFrame.getZoomFactor()`
|
||||
|
||||
Returns `Number` - The current zoom factor.
|
||||
@@ -122,13 +124,20 @@ by its key, which is returned from `webFrame.insertCSS(css)`.
|
||||
|
||||
Inserts `text` to the focused element.
|
||||
|
||||
### `webFrame.executeJavaScript(code[, userGesture])`
|
||||
### `webFrame.executeJavaScript(code[, userGesture, callback])`
|
||||
|
||||
* `code` String
|
||||
* `userGesture` Boolean (optional) - Default is `false`.
|
||||
* `callback` Function (optional) - Called after script has been executed. Unless
|
||||
the frame is suspended (e.g. showing a modal alert), execution will be
|
||||
synchronous and the callback will be invoked before the method returns. For
|
||||
compatibility with an older version of this method, the error parameter is
|
||||
second.
|
||||
* `result` Any
|
||||
* `error` Error
|
||||
|
||||
Returns `Promise<any>` - A promise that resolves with the result of the executed code
|
||||
or is rejected if the result of the code is a rejected promise.
|
||||
Returns `Promise<any>` - A promise that resolves with the result of the executed
|
||||
code or is rejected if execution throws or results in a rejected promise.
|
||||
|
||||
Evaluates `code` in page.
|
||||
|
||||
@@ -136,14 +145,24 @@ In the browser window some HTML APIs like `requestFullScreen` can only be
|
||||
invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
||||
this limitation.
|
||||
|
||||
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])`
|
||||
### `webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture, callback])`
|
||||
|
||||
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. You can provide any integer here.
|
||||
* `worldId` Integer - The ID of the world to run the javascript
|
||||
in, `0` is the default main world (where content runs), `999` is the
|
||||
world used by Electron's `contextIsolation` feature. Accepts values
|
||||
in the range 1..536870911.
|
||||
* `scripts` [WebSource[]](structures/web-source.md)
|
||||
* `userGesture` Boolean (optional) - Default is `false`.
|
||||
* `callback` Function (optional) - Called after script has been executed. Unless
|
||||
the frame is suspended (e.g. showing a modal alert), execution will be
|
||||
synchronous and the callback will be invoked before the method returns. For
|
||||
compatibility with an older version of this method, the error parameter is
|
||||
second.
|
||||
* `result` Any
|
||||
* `error` Error
|
||||
|
||||
Returns `Promise<any>` - A promise that resolves with the result of the executed code
|
||||
or is rejected if the result of the code is a rejected promise.
|
||||
Returns `Promise<any>` - A promise that resolves with the result of the executed
|
||||
code or is rejected if execution throws or results in a rejected promise.
|
||||
|
||||
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ response are visible by the time this listener is fired.
|
||||
* `timestamp` Double
|
||||
* `statusLine` String
|
||||
* `statusCode` Integer
|
||||
* `requestHeaders` Record<string, string>
|
||||
* `responseHeaders` Record<string, string[]> (optional)
|
||||
* `callback` Function
|
||||
* `headersReceivedResponse` Object
|
||||
@@ -228,6 +229,7 @@ redirect is about to occur.
|
||||
* `fromCache` Boolean
|
||||
* `statusCode` Integer
|
||||
* `statusLine` String
|
||||
* `error` String
|
||||
|
||||
The `listener` will be called with `listener(details)` when a request is
|
||||
completed.
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
# Mojave Dark Mode
|
||||
# Supporting macOS Dark Mode
|
||||
|
||||
In macOS 10.14 Mojave, Apple introduced a new [system-wide dark mode](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/)
|
||||
for all macOS computers. If your app does have a dark mode, you can make your Electron app
|
||||
follow the system-wide dark mode setting using [the nativeTheme api](../api/native-theme.md).
|
||||
for all macOS computers. If your Electron app has a dark mode, you can make it follow the
|
||||
system-wide dark mode setting using [the `nativeTheme` api](../api/native-theme.md).
|
||||
|
||||
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order
|
||||
for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on Catalina you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your `Info.plist` file or be on Electron `>=7.0.0`.
|
||||
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers.
|
||||
In order for the `nativeTheme.shouldUseDarkColors` and `Tray` APIs to work correctly in this mode on
|
||||
Catalina, you need to either have `NSRequiresAquaSystemAppearance` set to `false` in your
|
||||
`Info.plist` file, or be on Electron `>=7.0.0`. Both [Electron Packager][electron-packager] and
|
||||
[Electron Forge][electron-forge] have a [`darwinDarkModeSupport` option][packager-darwindarkmode-api]
|
||||
to automate the `Info.plist` changes during app build time.
|
||||
|
||||
## Automatically updating the native interfaces
|
||||
|
||||
"Native Interfaces" include the file picker, window border, dialogs, context menus and more; basically anything where
|
||||
the UI comes from macOS and not your app. The default behavior as of Electron 7.0.0 is to opt in to this automatic
|
||||
theming from the OS. If you wish to opt out you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file
|
||||
to `true`. Please note that once Electron starts building against the 10.14 SDK it will not be possible for you to opt
|
||||
out of this theming.
|
||||
"Native Interfaces" include the file picker, window border, dialogs, context menus and more; basically,
|
||||
anything where the UI comes from macOS and not your app. As of Electron 7.0.0, the default behavior
|
||||
is to opt in to this automatic theming from the OS. If you wish to opt out and are using Electron
|
||||
> 8.0.0, you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file to `true`.
|
||||
Please note that Electron 8.0.0 and above will not let your opt out of this theming, due to the use
|
||||
of the macOS 10.14 SDK.
|
||||
|
||||
## Automatically updating your own interfaces
|
||||
|
||||
If your app has its own dark mode you should toggle it on and off in sync with the system's dark mode setting. You can do
|
||||
this by listening for the theme updated event on Electron's `nativeTheme` module. E.g.
|
||||
If your app has its own dark mode, you should toggle it on and off in sync with the system's dark
|
||||
mode setting. You can do this by listening for the theme updated event on Electron's `nativeTheme` module.
|
||||
|
||||
```js
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
const { nativeTheme } = require('electron')
|
||||
|
||||
nativeTheme.on('updated', function theThemeHasChanged () {
|
||||
updateMyAppTheme(nativeTheme.shouldUseDarkColors)
|
||||
})
|
||||
```
|
||||
|
||||
[electron-forge]: https://www.electronforge.io/
|
||||
[electron-packager]: https://github.com/electron/electron-packager
|
||||
[packager-darwindarkmode-api]: https://electron.github.io/electron-packager/master/interfaces/electronpackager.options.html#darwindarkmodesupport
|
||||
|
||||
@@ -92,10 +92,14 @@ template("electron_extra_paks") {
|
||||
}
|
||||
if (enable_electron_extensions) {
|
||||
sources += [
|
||||
"$root_gen_dir/chrome/component_extension_resources.pak",
|
||||
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
|
||||
"$root_gen_dir/extensions/extensions_resources.pak",
|
||||
]
|
||||
deps += [ "//extensions:extensions_resources" ]
|
||||
deps += [
|
||||
"//chrome/browser/resources:component_extension_resources",
|
||||
"//extensions:extensions_resources",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
<part file="electron_strings.grdp" />
|
||||
</messages>
|
||||
<includes>
|
||||
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}\shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE" file="${target_gen_dir}/shell_devtools_discovery_page.html" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_PDF_MANIFEST" file="../chrome/browser/resources/pdf/manifest.json" type="BINDATA" />
|
||||
</includes>
|
||||
</release>
|
||||
</grit>
|
||||
|
||||
@@ -45,6 +45,7 @@ auto_filenames = {
|
||||
"docs/api/remote.md",
|
||||
"docs/api/sandbox-option.md",
|
||||
"docs/api/screen.md",
|
||||
"docs/api/service-workers.md",
|
||||
"docs/api/session.md",
|
||||
"docs/api/shell.md",
|
||||
"docs/api/structures",
|
||||
@@ -110,6 +111,7 @@ auto_filenames = {
|
||||
"docs/api/structures/remove-password.md",
|
||||
"docs/api/structures/scrubber-item.md",
|
||||
"docs/api/structures/segmented-control-segment.md",
|
||||
"docs/api/structures/service-worker-info.md",
|
||||
"docs/api/structures/shared-worker-info.md",
|
||||
"docs/api/structures/shortcut-details.md",
|
||||
"docs/api/structures/size.md",
|
||||
|
||||
@@ -88,6 +88,8 @@ filenames = {
|
||||
"shell/browser/api/electron_api_protocol.h",
|
||||
"shell/browser/api/electron_api_screen.cc",
|
||||
"shell/browser/api/electron_api_screen.h",
|
||||
"shell/browser/api/electron_api_service_worker_context.cc",
|
||||
"shell/browser/api/electron_api_service_worker_context.h",
|
||||
"shell/browser/api/electron_api_session.cc",
|
||||
"shell/browser/api/electron_api_session.h",
|
||||
"shell/browser/api/electron_api_system_preferences.cc",
|
||||
@@ -234,12 +236,15 @@ filenames = {
|
||||
"shell/browser/net/node_stream_loader.h",
|
||||
"shell/browser/net/proxying_url_loader_factory.cc",
|
||||
"shell/browser/net/proxying_url_loader_factory.h",
|
||||
"shell/browser/net/proxying_websocket.cc",
|
||||
"shell/browser/net/proxying_websocket.h",
|
||||
"shell/browser/net/resolve_proxy_helper.cc",
|
||||
"shell/browser/net/resolve_proxy_helper.h",
|
||||
"shell/browser/net/system_network_context_manager.cc",
|
||||
"shell/browser/net/system_network_context_manager.h",
|
||||
"shell/browser/net/url_pipe_loader.cc",
|
||||
"shell/browser/net/url_pipe_loader.h",
|
||||
"shell/browser/net/web_request_api_interface.h",
|
||||
"shell/browser/network_hints_handler_impl.cc",
|
||||
"shell/browser/network_hints_handler_impl.h",
|
||||
"shell/browser/node_debugger.cc",
|
||||
@@ -276,6 +281,8 @@ filenames = {
|
||||
"shell/browser/notifications/win/win32_notification.h",
|
||||
"shell/browser/notifications/win/windows_toast_notification.cc",
|
||||
"shell/browser/notifications/win/windows_toast_notification.h",
|
||||
"shell/browser/plugins/plugin_utils.cc",
|
||||
"shell/browser/plugins/plugin_utils.h",
|
||||
"shell/browser/pref_store_delegate.cc",
|
||||
"shell/browser/pref_store_delegate.h",
|
||||
"shell/browser/relauncher.cc",
|
||||
@@ -551,8 +558,11 @@ filenames = {
|
||||
"shell/common/skia_util.h",
|
||||
"shell/common/v8_value_converter.cc",
|
||||
"shell/common/v8_value_converter.h",
|
||||
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.cc",
|
||||
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
|
||||
"shell/common/world_ids.h",
|
||||
"shell/renderer/api/context_bridge/object_cache.cc",
|
||||
"shell/renderer/api/context_bridge/object_cache.h",
|
||||
"shell/renderer/api/context_bridge/render_frame_function_store.cc",
|
||||
"shell/renderer/api/context_bridge/render_frame_function_store.h",
|
||||
"shell/renderer/api/electron_api_context_bridge.cc",
|
||||
"shell/renderer/api/electron_api_context_bridge.h",
|
||||
"shell/renderer/api/electron_api_renderer_ipc.cc",
|
||||
@@ -591,44 +601,54 @@ filenames = {
|
||||
]
|
||||
|
||||
lib_sources_extensions = [
|
||||
"shell/browser/extensions/api/i18n/i18n_api.cc",
|
||||
"shell/browser/extensions/api/i18n/i18n_api.h",
|
||||
"shell/browser/extensions/api/resources_private/resources_private_api.cc",
|
||||
"shell/browser/extensions/api/resources_private/resources_private_api.h",
|
||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
|
||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.cc",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.h",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.cc",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.h",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.h",
|
||||
"shell/browser/extensions/electron_browser_context_keyed_service_factories.cc",
|
||||
"shell/browser/extensions/electron_browser_context_keyed_service_factories.h",
|
||||
"shell/browser/extensions/electron_component_extension_resource_manager.cc",
|
||||
"shell/browser/extensions/electron_component_extension_resource_manager.h",
|
||||
"shell/browser/extensions/electron_display_info_provider.cc",
|
||||
"shell/browser/extensions/electron_display_info_provider.h",
|
||||
"shell/browser/extensions/electron_extension_host_delegate.cc",
|
||||
"shell/browser/extensions/electron_extension_host_delegate.h",
|
||||
"shell/browser/extensions/electron_extension_loader.cc",
|
||||
"shell/browser/extensions/electron_extension_loader.h",
|
||||
"shell/browser/extensions/electron_extension_message_filter.cc",
|
||||
"shell/browser/extensions/electron_extension_message_filter.h",
|
||||
"shell/browser/extensions/electron_extension_system.cc",
|
||||
"shell/browser/extensions/electron_extension_system.h",
|
||||
"shell/browser/extensions/electron_extension_system_factory.cc",
|
||||
"shell/browser/extensions/electron_extension_system_factory.h",
|
||||
"shell/browser/extensions/electron_extension_web_contents_observer.cc",
|
||||
"shell/browser/extensions/electron_extension_web_contents_observer.h",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.cc",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.h",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.cc",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.h",
|
||||
"shell/browser/extensions/electron_extensions_api_client.cc",
|
||||
"shell/browser/extensions/electron_extensions_api_client.h",
|
||||
"shell/browser/extensions/electron_extensions_browser_api_provider.cc",
|
||||
"shell/browser/extensions/electron_extensions_browser_api_provider.h",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.cc",
|
||||
"shell/browser/extensions/electron_extensions_browser_client.h",
|
||||
"shell/browser/extensions/electron_messaging_delegate.cc",
|
||||
"shell/browser/extensions/electron_messaging_delegate.h",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.cc",
|
||||
"shell/browser/extensions/electron_navigation_ui_data.h",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.cc",
|
||||
"shell/browser/extensions/electron_process_manager_delegate.h",
|
||||
"shell/common/extensions/electron_extensions_api_provider.cc",
|
||||
"shell/common/extensions/electron_extensions_api_provider.h",
|
||||
"shell/common/extensions/electron_extensions_client.cc",
|
||||
"shell/common/extensions/electron_extensions_client.h",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.h",
|
||||
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.cc",
|
||||
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.h",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.cc",
|
||||
"shell/renderer/extensions/electron_extensions_renderer_client.h",
|
||||
]
|
||||
|
||||
app_sources = [
|
||||
|
||||
@@ -92,6 +92,43 @@ BrowserWindow.prototype._init = function () {
|
||||
return this.webContents.devToolsWebContents
|
||||
}
|
||||
})
|
||||
|
||||
// Properties
|
||||
|
||||
Object.defineProperty(this, 'autoHideMenuBar', {
|
||||
get: () => this.isMenuBarAutoHide(),
|
||||
set: (autoHide) => this.setAutoHideMenuBar(autoHide)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'minimizable', {
|
||||
get: () => this.isMinimizable(),
|
||||
set: (min) => this.setMinimizable(min)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'maximizable', {
|
||||
get: () => this.isMaximizable(),
|
||||
set: (max) => this.setMaximizable(max)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'resizable', {
|
||||
get: () => this.isResizable(),
|
||||
set: (res) => this.setResizable(res)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'fullScreenable', {
|
||||
get: () => this.isFullScreenable(),
|
||||
set: (full) => this.setFullScreenable(full)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'closable', {
|
||||
get: () => this.isClosable(),
|
||||
set: (close) => this.setClosable(close)
|
||||
})
|
||||
|
||||
Object.defineProperty(this, 'movable', {
|
||||
get: () => this.isMovable(),
|
||||
set: (move) => this.setMovable(move)
|
||||
})
|
||||
}
|
||||
|
||||
const isBrowserWindow = (win) => {
|
||||
@@ -185,13 +222,4 @@ Object.assign(BrowserWindow.prototype, {
|
||||
}
|
||||
})
|
||||
|
||||
// Deprecations
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'autoHideMenuBar', '_isMenuBarAutoHide', '_setAutoHideMenuBar')
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'minimizable', '_isMinimizable', '_setMinimizable')
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'maximizable', '_isMaximizable', '_setMaximizable')
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'resizable', '_isResizable', '_setResizable')
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'fullScreenable', '_isFullScreenable', '_setFullScreenable')
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'closable', '_isClosable', '_setClosable')
|
||||
deprecate.fnToProperty(BrowserWindow.prototype, 'movable', '_isMovable', '_setMovable')
|
||||
|
||||
module.exports = BrowserWindow
|
||||
|
||||
@@ -33,7 +33,7 @@ const delegate = {
|
||||
},
|
||||
menuWillShow: (menu) => {
|
||||
// Ensure radio groups have at least one menu item selected
|
||||
for (const id in menu.groupsMap) {
|
||||
for (const id of Object.keys(menu.groupsMap)) {
|
||||
const found = menu.groupsMap[id].find(item => item.checked) || null
|
||||
if (!found) v8Util.setHiddenValue(menu.groupsMap[id][0], 'checked', true)
|
||||
}
|
||||
@@ -201,8 +201,7 @@ function areValidTemplateItems (template) {
|
||||
|
||||
function sortTemplate (template) {
|
||||
const sorted = sortMenuItems(template)
|
||||
for (const id in sorted) {
|
||||
const item = sorted[id]
|
||||
for (const item of sorted) {
|
||||
if (Array.isArray(item.submenu)) {
|
||||
item.submenu = sortTemplate(item.submenu)
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ class ClientRequest extends Writable {
|
||||
this._started = true
|
||||
const stringifyValues = (obj) => {
|
||||
const ret = {}
|
||||
for (const k in obj) {
|
||||
for (const k of Object.keys(obj)) {
|
||||
ret[k] = obj[k].toString()
|
||||
}
|
||||
return ret
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { app, deprecate } = require('electron')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.electronBinding('session')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol, ServiceWorkerContext } = process.electronBinding('session')
|
||||
|
||||
// Public API.
|
||||
Object.defineProperties(exports, {
|
||||
@@ -16,8 +16,9 @@ Object.defineProperties(exports, {
|
||||
}
|
||||
})
|
||||
|
||||
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
|
||||
Object.setPrototypeOf(Cookies.prototype, EventEmitter.prototype)
|
||||
Object.setPrototypeOf(ServiceWorkerContext.prototype, EventEmitter.prototype)
|
||||
Object.setPrototypeOf(Session.prototype, EventEmitter.prototype)
|
||||
|
||||
Session.prototype._init = function () {
|
||||
app.emit('session-created', this)
|
||||
|
||||
@@ -51,13 +51,25 @@ class TouchBar extends EventEmitter {
|
||||
item.child.ordereredItems.forEach(registerItem)
|
||||
}
|
||||
}
|
||||
|
||||
const idSet = new Set()
|
||||
items.forEach((item) => {
|
||||
if (!(item instanceof TouchBarItem)) {
|
||||
throw new Error('Each item must be an instance of TouchBarItem')
|
||||
}
|
||||
|
||||
if (!idSet.has(item.id)) {
|
||||
idSet.add(item.id)
|
||||
} else {
|
||||
throw new Error('Cannot add a single instance of TouchBarItem multiple times in a TouchBar')
|
||||
}
|
||||
})
|
||||
|
||||
// register in separate loop after all items are validated
|
||||
for (const item of items) {
|
||||
this.ordereredItems.push(item)
|
||||
registerItem(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
set escapeItem (item) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const { webContents } = require('electron')
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
|
||||
const parseFeaturesString = require('@electron/internal/common/parse-features-string')
|
||||
const { syncMethods, asyncMethods } = require('@electron/internal/common/web-view-methods')
|
||||
const { syncMethods, asyncMethods, properties } = require('@electron/internal/common/web-view-methods')
|
||||
const { serialize } = require('@electron/internal/common/type-utils')
|
||||
|
||||
// Doesn't exist in early initialization.
|
||||
@@ -74,7 +74,7 @@ const createGuest = function (embedder, params) {
|
||||
|
||||
// Clear the guest from map when it is destroyed.
|
||||
guest.once('destroyed', () => {
|
||||
if (guestInstanceId in guestInstances) {
|
||||
if (Object.prototype.hasOwnProperty.call(guestInstances, guestInstanceId)) {
|
||||
detachGuest(embedder, guestInstanceId)
|
||||
}
|
||||
})
|
||||
@@ -288,7 +288,7 @@ const watchEmbedder = function (embedder) {
|
||||
|
||||
// Forward embedder window visiblity change events to guest
|
||||
const onVisibilityChange = function (visibilityState) {
|
||||
for (const guestInstanceId in guestInstances) {
|
||||
for (const guestInstanceId of Object.keys(guestInstances)) {
|
||||
const guestInstance = guestInstances[guestInstanceId]
|
||||
guestInstance.visibilityState = visibilityState
|
||||
if (guestInstance.embedder === embedder) {
|
||||
@@ -302,7 +302,7 @@ const watchEmbedder = function (embedder) {
|
||||
// Usually the guestInstances is cleared when guest is destroyed, but it
|
||||
// may happen that the embedder gets manually destroyed earlier than guest,
|
||||
// and the embedder will be invalid in the usual code path.
|
||||
for (const guestInstanceId in guestInstances) {
|
||||
for (const guestInstanceId of Object.keys(guestInstances)) {
|
||||
const guestInstance = guestInstances[guestInstanceId]
|
||||
if (guestInstance.embedder === embedder) {
|
||||
detachGuest(embedder, parseInt(guestInstanceId))
|
||||
@@ -384,6 +384,24 @@ handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_CALL', function (event, guestInst
|
||||
return guest[method](...args)
|
||||
})
|
||||
|
||||
handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_GET', function (event, guestInstanceId, property) {
|
||||
const guest = getGuestForWebContents(guestInstanceId, event.sender)
|
||||
if (!properties.has(property)) {
|
||||
throw new Error(`Invalid property: ${property}`)
|
||||
}
|
||||
|
||||
return guest[property]
|
||||
})
|
||||
|
||||
handleMessageSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_SET', function (event, guestInstanceId, property, val) {
|
||||
const guest = getGuestForWebContents(guestInstanceId, event.sender)
|
||||
if (!properties.has(property)) {
|
||||
throw new Error(`Invalid property: ${property}`)
|
||||
}
|
||||
|
||||
guest[property] = val
|
||||
})
|
||||
|
||||
handleMessage('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', async function (event, guestInstanceId, args) {
|
||||
const guest = getGuestForWebContents(guestInstanceId, event.sender)
|
||||
|
||||
|
||||
@@ -18,8 +18,10 @@ require('@electron/internal/common/init')
|
||||
if (process.platform === 'win32') {
|
||||
// Redirect node's console to use our own implementations, since node can not
|
||||
// handle console output when running as GUI program.
|
||||
const consoleLog = (format: any, ...args: any[]) => {
|
||||
return process.log(util.format(format, ...args) + '\n')
|
||||
const consoleLog = (...args: any[]) => {
|
||||
// @ts-ignore this typing is incorrect; 'format' is an optional parameter
|
||||
// See https://nodejs.org/api/util.html#util_util_format_format_args
|
||||
return process.log(util.format(...args) + '\n')
|
||||
}
|
||||
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
|
||||
if (Buffer.isBuffer(chunk)) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export function createLazyInstance (
|
||||
) {
|
||||
let lazyModule: Object
|
||||
const module: any = {}
|
||||
for (const method in (holder as any).prototype) {
|
||||
for (const method in (holder as any).prototype) { // eslint-disable-line guard-for-in
|
||||
module[method] = (...args: any) => {
|
||||
// create new instance of module at runtime if none exists
|
||||
if (!lazyModule) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
const binding = process.electronBinding('crash_reporter')
|
||||
|
||||
class CrashReporter {
|
||||
contructor () {
|
||||
constructor () {
|
||||
this.productName = null
|
||||
this.crashesDirectory = null
|
||||
}
|
||||
|
||||
@@ -50,6 +50,14 @@ export const syncMethods = new Set([
|
||||
'setZoomLevel'
|
||||
])
|
||||
|
||||
export const properties = new Set([
|
||||
'audioMuted',
|
||||
'userAgent',
|
||||
'zoomLevel',
|
||||
'zoomFactor',
|
||||
'frameRate'
|
||||
])
|
||||
|
||||
export const asyncMethods = new Set([
|
||||
'loadURL',
|
||||
'executeJavaScript',
|
||||
|
||||
@@ -14,7 +14,6 @@ const remoteObjectCache = v8Util.createIDWeakMap()
|
||||
const contextId = v8Util.getHiddenValue(global, 'contextId')
|
||||
|
||||
ipcRendererInternal.invoke('ELECTRON_BROWSER_GET_LAST_WEB_PREFERENCES').then(preferences => {
|
||||
console.log(preferences)
|
||||
if (!preferences.enableRemoteModule) {
|
||||
console.warn('%cElectron Deprecation Warning', 'font-weight: bold', "The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.")
|
||||
}
|
||||
@@ -81,7 +80,7 @@ function wrapArgs (args, visited = new Set()) {
|
||||
members: []
|
||||
}
|
||||
visited.add(value)
|
||||
for (const prop in value) {
|
||||
for (const prop in value) { // eslint-disable-line guard-for-in
|
||||
meta.members.push({
|
||||
name: prop,
|
||||
value: valueToMeta(value[prop])
|
||||
@@ -228,7 +227,7 @@ function metaToValue (meta) {
|
||||
exception: () => { throw metaToError(meta.value) }
|
||||
}
|
||||
|
||||
if (meta.type in types) {
|
||||
if (Object.prototype.hasOwnProperty.call(types, meta.type)) {
|
||||
return types[meta.type]()
|
||||
} else {
|
||||
let ret
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-in
|
||||
import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils'
|
||||
import * as guestViewInternal from '@electron/internal/renderer/web-view/guest-view-internal'
|
||||
import { WEB_VIEW_CONSTANTS } from '@electron/internal/renderer/web-view/web-view-constants'
|
||||
import { syncMethods, asyncMethods } from '@electron/internal/common/web-view-methods'
|
||||
import { syncMethods, asyncMethods, properties } from '@electron/internal/common/web-view-methods'
|
||||
import { deserialize } from '@electron/internal/common/type-utils'
|
||||
const { webFrame } = electron
|
||||
|
||||
@@ -249,6 +249,25 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
|
||||
WebViewElement.prototype.capturePage = async function (...args) {
|
||||
return deserialize(await ipcRendererInternal.invoke('ELECTRON_GUEST_VIEW_MANAGER_CAPTURE_PAGE', this.getWebContentsId(), args))
|
||||
}
|
||||
|
||||
const createPropertyGetter = function (property: string) {
|
||||
return function (this: ElectronInternal.WebViewElement) {
|
||||
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_GET', this.getWebContentsId(), property)
|
||||
}
|
||||
}
|
||||
|
||||
const createPropertySetter = function (property: string) {
|
||||
return function (this: ElectronInternal.WebViewElement, arg: any) {
|
||||
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_VIEW_MANAGER_PROPERTY_SET', this.getWebContentsId(), property, arg)
|
||||
}
|
||||
}
|
||||
|
||||
for (const property of properties) {
|
||||
Object.defineProperty(WebViewElement.prototype, property, {
|
||||
get: createPropertyGetter(property) as any,
|
||||
set: createPropertySetter(property)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const webViewImplModule = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "9.0.0-nightly.20200205",
|
||||
"version": "9.0.0-beta.10",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
@@ -19,6 +19,7 @@
|
||||
"@types/semver": "^6.0.1",
|
||||
"@types/send": "^0.14.5",
|
||||
"@types/split": "^1.0.0",
|
||||
"@types/uuid": "^3.4.6",
|
||||
"@types/webpack": "^4.4.32",
|
||||
"@types/webpack-env": "^1.13.9",
|
||||
"@typescript-eslint/eslint-plugin": "^2.6.0",
|
||||
|
||||
@@ -31,11 +31,12 @@ scroll_bounce_flag.patch
|
||||
mas-cfisobjc.patch
|
||||
mas-cgdisplayusesforcetogray.patch
|
||||
mas-audiodeviceduck.patch
|
||||
mas_disable_remote_layer.patch
|
||||
mas_disable_remote_accessibility.patch
|
||||
mas_disable_custom_window_frame.patch
|
||||
chrome_key_systems.patch
|
||||
allow_nested_error_trackers.patch
|
||||
blink_initialization_order.patch
|
||||
add_didinstallconditionalfeatures.patch
|
||||
ssl_security_state_tab_helper.patch
|
||||
desktop_media_list.patch
|
||||
proxy_config_monitor.patch
|
||||
@@ -81,3 +82,11 @@ feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
|
||||
accessible_pane_view.patch
|
||||
fixme_grit_conflicts.patch
|
||||
fix_use_the_new_mediaplaypause_key_listener_for_internal_chrome.patch
|
||||
use_electron_resources_in_pdf_util.patch
|
||||
hack_plugin_response_interceptor_to_point_to_electron.patch
|
||||
delay_lock_the_protocol_scheme_registry.patch
|
||||
fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
|
||||
feat_enable_offscreen_rendering_with_viz_compositor.patch
|
||||
feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
|
||||
gpu_notify_when_dxdiag_request_fails.patch
|
||||
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
|
||||
|
||||
@@ -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 6c446a1506dd1c7728c82f5b11cf7fd3575383d9..057fe111375542e68cad4283dbf2295a977a891a 100644
|
||||
index 24f9e8efd14ea8e4bb739655c662d01c8c4b80c5..c354891df92db510291ba351ee3bc88b07b4d990 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -261,6 +261,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -262,6 +262,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
|
||||
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
|
||||
|
||||
@@ -24,7 +24,7 @@ index 6c446a1506dd1c7728c82f5b11cf7fd3575383d9..057fe111375542e68cad4283dbf2295a
|
||||
// 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
|
||||
@@ -383,7 +387,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -384,7 +388,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
}));
|
||||
#endif
|
||||
|
||||
|
||||
137
patches/chromium/add_didinstallconditionalfeatures.patch
Normal file
137
patches/chromium/add_didinstallconditionalfeatures.patch
Normal file
@@ -0,0 +1,137 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Wed, 15 Jan 2020 16:35:18 -0800
|
||||
Subject: add DidInstallConditionalFeatures
|
||||
|
||||
This adds a hook on script context creation _after conditional features
|
||||
have been installed_. Electron uses this to run preload scripts and
|
||||
various other initialization. This is necessary because at the time
|
||||
DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 156ba739a984347135857f8019fda0bfb01c97ad..f4093e9bb8b54d82c6d70375977c0ad91dc90580 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -115,6 +115,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidHandleOnloadEvents() {}
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
|
||||
+ int32_t world_id) {}
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 813fd92481d598abf616cf3370ee55f541df1c97..8dd80a3d7880eec9a4adb2288b883514b86e8880 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4933,6 +4933,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
+void RenderFrameImpl::DidInstallConditionalFeatures(
|
||||
+ v8::Local<v8::Context> context, int world_id) {
|
||||
+ for (auto& observer : observers_)
|
||||
+ observer.DidInstallConditionalFeatures(context, world_id);
|
||||
+}
|
||||
+
|
||||
void RenderFrameImpl::WillReleaseScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index d34fa34fe84390895c605e0ef799c78d50125abf..318f77471b65e74c7c12636e81601472e6957d6e 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -747,6 +747,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
+ void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
|
||||
+ int world_id) override;
|
||||
void WillReleaseScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index cee72cbe2a0a48dce51cbf7e9ba14a1b326afb6b..f73db341765f68b7b9fac043e070ef02227173c2 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -548,6 +548,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) {}
|
||||
+
|
||||
// WebKit is about to release its reference to a v8 context for a frame.
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index d20d24c0ba6025af06f5f61cefd3e96e687c123d..c6cb7af9c2ec7e812954b7725f8506c1d9d115de 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -215,6 +215,7 @@ void LocalWindowProxy::Initialize() {
|
||||
}
|
||||
|
||||
InstallConditionalFeatures();
|
||||
+ GetFrame()->Client()->DidInstallConditionalFeatures(context, world_->GetWorldId());
|
||||
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
index 60496637209755d5f6ecaab7dd56c1e54bcdfda8..83c8a71fff6cc4230a9ae372fab8a536120f3ad5 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
|
||||
@@ -344,6 +344,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
+void LocalFrameClientImpl::DidInstallConditionalFeatures(
|
||||
+ v8::Local<v8::Context> context,
|
||||
+ int32_t world_id) {
|
||||
+ if (web_frame_->Client())
|
||||
+ web_frame_->Client()->DidInstallConditionalFeatures(context, world_id);
|
||||
+}
|
||||
+
|
||||
void LocalFrameClientImpl::WillReleaseScriptContext(
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
index eb40ab259bab5cbec42d153ad6de26a45781210f..5b18acb942fe1d106a63d045263df38c7d8fe58c 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 {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override;
|
||||
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) override;
|
||||
void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index d6e4924bd04c826a91e717c16382c5519d9ddd39..bcf83d016368d6fa6fc763b835e5dd318d9c1785 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -286,6 +286,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) = 0;
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index aba9bc199c253f5093c516122ce6f1c7071de714..f1dfaf015b08f2b0804d400f88263cc5d9cf7f4c 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -362,6 +362,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
||||
+ int32_t world_id) override {}
|
||||
void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
bool AllowScriptExtensions() override { return false; }
|
||||
@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
|
||||
|
||||
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
index 7aa84a3e19c257dde8f48d25743dc8ab2a3a0a30..58cbfc6e6f9f916ace683705d8a87ee05dc73422 100644
|
||||
index 696a6170a584c1bb71c8ad253963d9f64395a13e..9677aa931cd543adfc1e9844d6afee8dcb0f4c2d 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
@@ -659,6 +659,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
@@ -661,6 +661,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
|
||||
size, ArrayBufferContents::kDontInitialize);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ WebContents, and cancels the authentication if there's no WebContents
|
||||
available, which there isn't in the case of the 'net' module.
|
||||
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 78fd4bd72b07f38b447840b584253883756fe021..6d8aaecc08207456f243125db8e6d7c74f731d87 100644
|
||||
index c37432121142472010b767b7fb257e20bc60b3fc..099c94d1db7994a0608864cb05e3686a85b7070d 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -191,6 +191,25 @@ struct HttpAuthStaticNetworkContextParams {
|
||||
@@ -193,6 +193,25 @@ struct HttpAuthStaticNetworkContextParams {
|
||||
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ index 78fd4bd72b07f38b447840b584253883756fe021..6d8aaecc08207456f243125db8e6d7c7
|
||||
interface CertVerifierClient {
|
||||
Verify(
|
||||
int32 default_error,
|
||||
@@ -608,6 +627,8 @@ struct URLLoaderFactoryParams {
|
||||
@@ -633,6 +652,8 @@ struct URLLoaderFactoryParams {
|
||||
// interface. This still respects the per-context block lists.
|
||||
CorsOriginAccessPatterns? factory_bound_access_patterns;
|
||||
|
||||
@@ -49,10 +49,10 @@ index 78fd4bd72b07f38b447840b584253883756fe021..6d8aaecc08207456f243125db8e6d7c7
|
||||
NetworkIsolationKey? network_isolation_key;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b23ca7b694 100644
|
||||
index 9452018180979377728162209651ebd914bd95a4..6c9f3192260bcce252c7868e042bd40a205b55b8 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -338,6 +338,7 @@ URLLoader::URLLoader(
|
||||
@@ -486,6 +486,7 @@ URLLoader::URLLoader(
|
||||
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
|
||||
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
|
||||
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
|
||||
@@ -60,7 +60,7 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
|
||||
mojom::OriginPolicyManager* origin_policy_manager)
|
||||
: url_request_context_(url_request_context),
|
||||
network_service_client_(network_service_client),
|
||||
@@ -396,6 +397,11 @@ URLLoader::URLLoader(
|
||||
@@ -544,6 +545,11 @@ URLLoader::URLLoader(
|
||||
header_client_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
|
||||
}
|
||||
@@ -72,7 +72,7 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
|
||||
if (want_raw_headers_) {
|
||||
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
|
||||
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
|
||||
@@ -830,7 +836,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
|
||||
@@ -982,7 +988,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
|
||||
|
||||
void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
const net::AuthChallengeInfo& auth_info) {
|
||||
@@ -81,7 +81,7 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
|
||||
OnAuthCredentials(base::nullopt);
|
||||
return;
|
||||
}
|
||||
@@ -846,11 +852,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
@@ -998,11 +1004,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
if (url_request->response_headers())
|
||||
head->headers = url_request->response_headers();
|
||||
head->auth_challenge_info = auth_info;
|
||||
@@ -108,10 +108,10 @@ index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b2
|
||||
auth_challenge_responder_receiver_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index 532ecdc0a9b386eb9ea04a480b18aeb1ac32a059..b3ad0f42ab9c2f513d8c4a06683d1af6f0219a56 100644
|
||||
index 5b8e727e4a8f71d646eb2502d27256dcdae22e78..8b63418451933382b414e47001b9859017b60f7f 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -85,6 +85,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
@@ -106,6 +106,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
|
||||
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
|
||||
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
|
||||
@@ -119,7 +119,7 @@ index 532ecdc0a9b386eb9ea04a480b18aeb1ac32a059..b3ad0f42ab9c2f513d8c4a06683d1af6
|
||||
mojom::OriginPolicyManager* origin_policy_manager);
|
||||
~URLLoader() override;
|
||||
|
||||
@@ -384,6 +385,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
@@ -413,6 +414,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
base::Optional<base::UnguessableToken> fetch_window_id_;
|
||||
|
||||
mojo::Remote<mojom::TrustedHeaderClient> header_client_;
|
||||
@@ -128,19 +128,19 @@ index 532ecdc0a9b386eb9ea04a480b18aeb1ac32a059..b3ad0f42ab9c2f513d8c4a06683d1af6
|
||||
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 9e9baaf8ecd33e6416027014361edc332ab71e3c..cc2c59828f56988d43b680588d4625d9864aa9b6 100644
|
||||
index f3a9baefc1a18924503d7a6850bc704310e50015..9b3802dbdf7a1ab3f132529b794665a68eeac673 100644
|
||||
--- a/services/network/url_loader_factory.cc
|
||||
+++ b/services/network/url_loader_factory.cc
|
||||
@@ -65,6 +65,7 @@ URLLoaderFactory::URLLoaderFactory(
|
||||
params_(std::move(params)),
|
||||
@@ -66,6 +66,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) {
|
||||
DCHECK(context);
|
||||
DCHECK_NE(mojom::kInvalidProcessId, params_->process_id);
|
||||
@@ -207,6 +208,7 @@ void URLLoaderFactory::CreateLoaderAndStart(
|
||||
resource_scheduler_client_, std::move(keepalive_statistics_recorder),
|
||||
@@ -209,6 +210,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,
|
||||
@@ -148,13 +148,13 @@ index 9e9baaf8ecd33e6416027014361edc332ab71e3c..cc2c59828f56988d43b680588d4625d9
|
||||
cors_url_loader_factory_->OnLoaderCreated(std::move(loader));
|
||||
}
|
||||
diff --git a/services/network/url_loader_factory.h b/services/network/url_loader_factory.h
|
||||
index 7d13494649c43be52b06774f2cf5763ebe9129c0..d4b19342c44f86c685f700e4260475ff2235b298 100644
|
||||
index 1a623585035487de061ba6476914992ea2f7ac88..caa19dcd4b99296e50f8e22bfc92a70ba14473d1 100644
|
||||
--- a/services/network/url_loader_factory.h
|
||||
+++ b/services/network/url_loader_factory.h
|
||||
@@ -72,6 +72,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
|
||||
mojom::URLLoaderFactoryParamsPtr params_;
|
||||
@@ -74,6 +74,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
|
||||
scoped_refptr<ResourceSchedulerClient> resource_scheduler_client_;
|
||||
mojo::Remote<mojom::TrustedURLLoaderHeaderClient> header_client_;
|
||||
mojo::Remote<mojom::CrossOriginEmbedderPolicyReporter> coep_reporter_;
|
||||
+ mojo::Remote<mojom::TrustedURLLoaderAuthClient> auth_client_;
|
||||
|
||||
// |cors_url_loader_factory_| owns this.
|
||||
|
||||
@@ -6,10 +6,10 @@ 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 ea5258a03f83bcbda7bae296392a46cdd63d6fe1..14eed861e8828fd2ed7d8f27f9fd3bf180d04677 100644
|
||||
index e53e60ef146f8024e503f9ffad663a4d2dbc4f80..cee204cf6447c4b2a8cfd9c4ca257fe46af3e2e9 100644
|
||||
--- a/content/browser/child_process_launcher_helper_linux.cc
|
||||
+++ b/content/browser/child_process_launcher_helper_linux.cc
|
||||
@@ -53,6 +53,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
@@ -54,6 +54,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
const int sandbox_fd = SandboxHostLinux::GetInstance()->GetChildSocket();
|
||||
options->fds_to_remap.push_back(
|
||||
std::make_pair(sandbox_fd, service_manager::GetSandboxFD()));
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <samuel.r.attard@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:50:24 -0700
|
||||
Subject: blink_initialization_order.patch
|
||||
|
||||
Backport of https://chromium-review.googlesource.com/c/chromium/src/+/1030530
|
||||
to fix the order of V8 and Blink initialization. Also fixes order
|
||||
of DidCreateScriptContext notification with initialization of window globals
|
||||
to fix electron/electron#13787. The backport landed in Chromium 67 but the
|
||||
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index c845acb8321e94c916798826a168e06df34ffff4..941ca9d3905c0c2f36606655bf60e9e9bd1f9196 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -211,11 +211,10 @@ void LocalWindowProxy::Initialize() {
|
||||
GetFrame()->IsMainFrame());
|
||||
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
|
||||
origin);
|
||||
+ InstallConditionalFeatures();
|
||||
GetFrame()->Client()->DidCreateScriptContext(context, world_->GetWorldId());
|
||||
}
|
||||
|
||||
- InstallConditionalFeatures();
|
||||
-
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
}
|
||||
@@ -14,10 +14,10 @@ when there is code doing that.
|
||||
This patch reverts the change to fix the crash in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index 28d4c323a1c94ad61f83d4d9cc37863801f02276..85cb2f33afff53c8e524b04e398241928acf8305 100644
|
||||
index bd3e6c88f1ec5d69e832c1e9c3bdde8f2d3c1186..60ad5021df58f6673262d32e9d895411eb3b3951 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -357,10 +357,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -473,10 +473,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
CHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -28,7 +28,7 @@ index 28d4c323a1c94ad61f83d4d9cc37863801f02276..85cb2f33afff53c8e524b04e39824192
|
||||
if (!Client())
|
||||
return;
|
||||
|
||||
@@ -378,6 +374,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -494,6 +490,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,7 +7,7 @@ This exposes a method for obtaining a reference to an isolated world, which is
|
||||
otherwise not available in the Blink API.
|
||||
|
||||
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
|
||||
index 6f52b7e81585ad04ed8c14331aa07654354de386..812e555b9df7d39977798997f7517b1eb0467393 100644
|
||||
index 2aefec4bd9877ee9109e3ab8ca9a8ab94d21b420..14a9a3c30164ced30d4bae47ea53f29ad831ab0d 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame.h
|
||||
@@ -333,6 +333,9 @@ class WebLocalFrame : public WebFrame {
|
||||
@@ -21,10 +21,10 @@ index 6f52b7e81585ad04ed8c14331aa07654354de386..812e555b9df7d39977798997f7517b1e
|
||||
// that the script evaluated to with callback. Script execution can be
|
||||
// suspend.
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
index e3dc69f4df92cc731c93373fa2579a3eb58ae2bc..be9626f3c594aef8fa9b9fa09b7e65716afcd5fd 100644
|
||||
index da1e0054a3bf57364055b37aad06a65a3bab783e..99cd24e4665943369f38278ba0737d2eb79e713a 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
|
||||
@@ -943,6 +943,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
@@ -922,6 +922,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
return MainWorldScriptContext()->Global();
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ index e3dc69f4df92cc731c93373fa2579a3eb58ae2bc..be9626f3c594aef8fa9b9fa09b7e6571
|
||||
return BindingSecurity::ShouldAllowAccessToFrame(
|
||||
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
|
||||
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
index 26184ae197e935335420bb85f639f3cf1c8f8020..ff05a80f48533b3c1ec4f934bc4788663f9fef09 100644
|
||||
index 1a349aee35a766015692922211b225e6cdeed97a..2e248e65407833ef893784b15e3e11d8cfeec371 100644
|
||||
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
|
||||
@@ -165,6 +165,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
@@ -160,6 +160,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
int argc,
|
||||
v8::Local<v8::Value> argv[]) override;
|
||||
v8::Local<v8::Context> MainWorldScriptContext() const override;
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: boringssl BUILD.gn
|
||||
Build BoringSSL with some extra functions that nodejs needs.
|
||||
|
||||
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
|
||||
index e2b2a8eae3b051d9babc7af1b9f2ac5053bb7dc7..f6df2752367d4b81a03ab7d585c29452e79f6f6c 100644
|
||||
index b435499f459b6c128ce516be7d69089d096c5827..5c024d321dda7cf7810190ac9afc6d563385024c 100644
|
||||
--- a/third_party/boringssl/BUILD.gn
|
||||
+++ b/third_party/boringssl/BUILD.gn
|
||||
@@ -45,6 +45,19 @@ config("no_asm_config") {
|
||||
@@ -46,6 +46,19 @@ config("no_asm_config") {
|
||||
|
||||
all_sources = crypto_sources + ssl_sources
|
||||
all_headers = crypto_headers + ssl_headers
|
||||
|
||||
@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
|
||||
to introduce a new Electron category for Electron-specific tracing.
|
||||
|
||||
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
|
||||
index bf408c6bff28f05b91dae284565e6f4ecf2b03d1..6bbf011aad1a6fc20ea5c3f0adee9e6b2f11d707 100644
|
||||
index 6f07209af5dce58b312d44a2bdb98d9186eab71c..51ad7bf75077308c058ba66f67daa7a9b6b2eed1 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -67,6 +67,7 @@
|
||||
|
||||
@@ -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 f89e7e831b79f82bd11a5dd8cee6ab49d8de724e..f8a611bf0676ce323cdbb5d639333df9875dd0ca 100644
|
||||
index 11e0a21820f34ac99bc2e9322e0c8bd1314045c3..5301eb0b4d7947c5e797d3ba8973a3ac5ff653f3 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
@@ -27,8 +27,8 @@ index f89e7e831b79f82bd11a5dd8cee6ab49d8de724e..f8a611bf0676ce323cdbb5d639333df9
|
||||
# Set to enable the official build level of optimization. This has nothing
|
||||
# to do with branding, but enables an additional level of optimization above
|
||||
# release (!is_debug). This might be better expressed as a tri-state
|
||||
@@ -438,6 +441,7 @@ default_compiler_configs = [
|
||||
"//build/config/compiler:default_init_stack_vars",
|
||||
@@ -439,6 +442,7 @@ default_compiler_configs = [
|
||||
"//build/config/compiler/pgo:default_pgo_flags",
|
||||
"//build/config/coverage:default_coverage",
|
||||
"//build/config/sanitizers:default_sanitizer_flags",
|
||||
+ "//electron/build/config:mas_build",
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index 49587997fa1ebe73dd00e96c95ae0448fcc7fa62..7e203486c32617e325c8aa6305c4ee57c93540f7 100644
|
||||
index b052809db3b3b6b00bc80546f49cdd3e43297e4a..8b3619268e3a495a51cbcaa2ce71e77139c677b5 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -4487,6 +4487,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -4441,6 +4441,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
last_committed_origin_, params->window_container_type,
|
||||
params->target_url, params->referrer.To<Referrer>(),
|
||||
params->frame_name, params->disposition, *params->features,
|
||||
@@ -21,10 +21,10 @@ index 49587997fa1ebe73dd00e96c95ae0448fcc7fa62..7e203486c32617e325c8aa6305c4ee57
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index abd2be4bc8e81a28209aa551f4435b9e8d37a249..f33766c98e1a28c89fc41f9e5cfd098ca6bc6150 100644
|
||||
index db3ef3455077a2cbf3503eca4434c9135fd31082..5d022b7ccbb05ba155cdc81dbe60b34864fa6c6a 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -305,6 +305,10 @@ struct CreateNewWindowParams {
|
||||
@@ -296,6 +296,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// The window features to use for the new window.
|
||||
blink.mojom.WindowFeatures features;
|
||||
@@ -36,10 +36,10 @@ index abd2be4bc8e81a28209aa551f4435b9e8d37a249..f33766c98e1a28c89fc41f9e5cfd098c
|
||||
|
||||
// Operation result when the renderer asks the browser to create a new window.
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index bcdc73fdf89d46e267f0c9568e46172ec89f9f23..930e043a0fdf40ef0e48a19597da567c8603878c 100644
|
||||
index 4e95486031b49c9cc3f5b025916c47a538aa3780..0520b0b7d4144666b95dc2bfd25c0b0ae5892bfe 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -505,6 +505,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -508,6 +508,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -49,10 +49,10 @@ index bcdc73fdf89d46e267f0c9568e46172ec89f9f23..930e043a0fdf40ef0e48a19597da567c
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 51f31b2c7e431004f2f1bf54e043ed497d166d4f..f9601b5813746ce930bb7082178e1f826aaeb62e 100644
|
||||
index a13172df620df804c6b4458d3b768bb5e26fd469..8ae9b370cf842a4c6d95d96d94f8b2d7a2122966 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -146,6 +146,7 @@ class NetworkService;
|
||||
@@ -142,6 +142,7 @@ class NetworkService;
|
||||
class TrustedURLLoaderHeaderClient;
|
||||
} // namespace mojom
|
||||
struct ResourceRequest;
|
||||
@@ -60,7 +60,7 @@ index 51f31b2c7e431004f2f1bf54e043ed497d166d4f..f9601b5813746ce930bb7082178e1f82
|
||||
} // namespace network
|
||||
|
||||
namespace rappor {
|
||||
@@ -831,6 +832,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -823,6 +824,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -70,10 +70,10 @@ index 51f31b2c7e431004f2f1bf54e043ed497d166d4f..f9601b5813746ce930bb7082178e1f82
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access);
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index bd44565e78aaa70e9402312830d30c4a908ede11..463906df3f761bb321c8580185c5e12dceb96854 100644
|
||||
index 9c452f46c9a1fe8644271ec9c8f34b51ec88c10a..d2aaba85dcf63d357d521d017425318d79dbd16b 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -69,6 +69,7 @@
|
||||
@@ -68,6 +68,7 @@
|
||||
#include "content/renderer/ime_event_guard.h"
|
||||
#include "content/renderer/internal_document_state_data.h"
|
||||
#include "content/renderer/loader/request_extra_data.h"
|
||||
@@ -81,7 +81,7 @@ index bd44565e78aaa70e9402312830d30c4a908ede11..463906df3f761bb321c8580185c5e12d
|
||||
#include "content/renderer/media/audio/audio_device_factory.h"
|
||||
#include "content/renderer/render_frame_impl.h"
|
||||
#include "content/renderer/render_frame_proxy.h"
|
||||
@@ -1276,6 +1277,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
@@ -1246,6 +1247,8 @@ WebView* RenderViewImpl::CreateView(
|
||||
}
|
||||
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
||||
|
||||
@@ -91,10 +91,10 @@ index bd44565e78aaa70e9402312830d30c4a908ede11..463906df3f761bb321c8580185c5e12d
|
||||
// moved on send.
|
||||
bool is_background_tab =
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
index 62e1749ae329791ed31374b255958bfc971599ab..64285a53a4baa65216f58412909202ce085fca12 100644
|
||||
index bf7c4bf0b76a89b1ecee6edc11fcfd06fe679968..79b2ba79653a251d3a4c3a54adbcd5c10c460b19 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
||||
@@ -326,6 +326,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -333,6 +333,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -104,10 +104,10 @@ index 62e1749ae329791ed31374b255958bfc971599ab..64285a53a4baa65216f58412909202ce
|
||||
bool opener_suppressed,
|
||||
bool* no_javascript_access) {
|
||||
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
index 5f985e2f11ebef42ed676260297e5e699096ba4a..2f3e68199f50b0e85dbb0d5cb95388279a194028 100644
|
||||
index aaf3b8fed16bc2959941effaffd3aec87017ca59..1ea96df464f61c963a6d9aa224b9607e4221daa6 100644
|
||||
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
|
||||
@@ -66,6 +66,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
@@ -71,6 +71,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
|
||||
@@ -6,6 +6,18 @@ Subject: chore: use electron resources not chrome for spellchecker
|
||||
spellchecker uses a few IDS_ resources. We need to load these from
|
||||
Electrons grit header instead of Chromes
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 021b133ee20ebf3c8b4798be2f0c195127619bf0..83d29c1555ece904f772c21cf22923b860ed38ae 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -5285,6 +5285,7 @@ jumbo_static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
+ "//electron:resources",
|
||||
]
|
||||
|
||||
if (!is_android) {
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fae4ee67ca 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_factory.cc
|
||||
@@ -19,6 +31,18 @@ index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fa
|
||||
#include "components/keyed_service/content/browser_context_dependency_manager.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
diff --git a/components/language/core/browser/BUILD.gn b/components/language/core/browser/BUILD.gn
|
||||
index f28230ea94fece5ae8ca7ac27a14da48f40fadbb..c10eea103852b9411a644e1fe20a7e20a38bf187 100644
|
||||
--- a/components/language/core/browser/BUILD.gn
|
||||
+++ b/components/language/core/browser/BUILD.gn
|
||||
@@ -31,6 +31,7 @@ static_library("browser") {
|
||||
"//components/pref_registry",
|
||||
"//components/prefs",
|
||||
"//components/strings",
|
||||
+ "//electron:resources",
|
||||
"//ui/base",
|
||||
]
|
||||
}
|
||||
diff --git a/components/language/core/browser/language_prefs.cc b/components/language/core/browser/language_prefs.cc
|
||||
index 7e06f689632ae67e3e17d7985c6e7b6ea0057f3c..0b4676f4c40b4a0eda927a51016ec91ec230291d 100644
|
||||
--- a/components/language/core/browser/language_prefs.cc
|
||||
|
||||
@@ -41,10 +41,10 @@ index c5125495b4d178ffb18be4d2d9670f7556412cbd..cddb321abb938c667a4a2089f87eab99
|
||||
// Create an observer that registers a hot key for |accelerator|.
|
||||
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e48792cc4159 100644
|
||||
index 9b6bba3ed87cae8ecc4288d01e5e7a3f74f71510..a4e4a5d6f1096754bf20c3438f47ebe60147f184 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
@@ -38,6 +38,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
|
||||
@@ -39,6 +39,7 @@ int GetNativeModifiers(const ui::Accelerator& accelerator) {
|
||||
modifiers |= accelerator.IsShiftDown() ? ShiftMask : 0;
|
||||
modifiers |= accelerator.IsCtrlDown() ? ControlMask : 0;
|
||||
modifiers |= accelerator.IsAltDown() ? Mod1Mask : 0;
|
||||
@@ -52,15 +52,6 @@ index 392cf3d58c64c088596e8d321a2ce37b0ec60b6e..43e30f47240dc10a3a9b950255d4e487
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
@@ -151,6 +152,8 @@ void GlobalShortcutListenerX11::OnXKeyPressEvent(::XEvent* x_event) {
|
||||
modifiers |= (x_event->xkey.state & ShiftMask) ? ui::EF_SHIFT_DOWN : 0;
|
||||
modifiers |= (x_event->xkey.state & ControlMask) ? ui::EF_CONTROL_DOWN : 0;
|
||||
modifiers |= (x_event->xkey.state & Mod1Mask) ? ui::EF_ALT_DOWN : 0;
|
||||
+ // For Windows key
|
||||
+ modifiers |= (x_event->xkey.state & Mod4Mask) ? ui::EF_COMMAND_DOWN: 0;
|
||||
|
||||
ui::Accelerator accelerator(
|
||||
ui::KeyboardCodeFromXKeyEvent(x_event), modifiers);
|
||||
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
|
||||
index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc7951d372 100644
|
||||
--- a/ui/base/accelerators/media_keys_listener.cc
|
||||
|
||||
@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
|
||||
in atom::CommonWebContentsDelegate::ResetManageWebContents.
|
||||
|
||||
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
||||
index 00d50221bbb63070be48e2493e766242b76724c8..ce20a8dc5135a9b9b6565ac3f1daf0cbeb2df185 100644
|
||||
index 1d291121fdf431adb459ad490258efb07677c275..0dc33867fb59c2cd7e95fb3d8ee9c8eb85600e63 100644
|
||||
--- a/content/browser/browser_main_loop.cc
|
||||
+++ b/content/browser/browser_main_loop.cc
|
||||
@@ -1504,7 +1504,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
@@ -1494,7 +1494,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
NOTREACHED();
|
||||
#else
|
||||
base::RunLoop run_loop;
|
||||
|
||||
@@ -17,7 +17,7 @@ only one or two specific checks fail. Then it's better to simply comment out the
|
||||
failing checks and allow the rest of the target to have them enabled.
|
||||
|
||||
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
index 1bb7007c16029db901514e79171952d07b47058e..5f5e887f85abc5c4f948de034feb4482571144fc 100644
|
||||
index f950552abbe9e9a0002156b596438fe9aa4f01b9..23931899eb58432fd8eabf4d681d2294a88fd97d 100644
|
||||
--- a/content/browser/frame_host/navigation_controller_impl.cc
|
||||
+++ b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
@@ -1250,8 +1250,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
@@ -33,7 +33,7 @@ index 1bb7007c16029db901514e79171952d07b47058e..5f5e887f85abc5c4f948de034feb4482
|
||||
|
||||
if (rfh->GetParent()) {
|
||||
// All manual subframes would be did_create_new_entry and handled above, so
|
||||
@@ -1507,7 +1509,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
@@ -1506,7 +1508,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
|
||||
}
|
||||
|
||||
@@ -46,20 +46,20 @@ index 1bb7007c16029db901514e79171952d07b47058e..5f5e887f85abc5c4f948de034feb4482
|
||||
// navigation. Now we know that the renderer has updated its state accordingly
|
||||
// and it is safe to also clear the browser side history.
|
||||
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
||||
index 1308bcb042b38d502b1b65b04affabf7e09d6fcd..52c9da3ea565d131ea8704f34f743f6661d42e84 100644
|
||||
index 23681d4192ac329a68822dbcdb06369f34e5e28a..ecb4cd19c364285044da60830fb1b4d4f52204f3 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -768,10 +768,10 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
|
||||
}
|
||||
@@ -767,10 +767,10 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
|
||||
|
||||
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {
|
||||
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
|
||||
UINT cf_format = format.ToFormatEtc().cfFormat;
|
||||
- DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
|
||||
+ //DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
|
||||
if (handle && !::SetClipboardData(format, handle)) {
|
||||
if (handle && !::SetClipboardData(cf_format, handle)) {
|
||||
- DCHECK_NE(GetLastError(),
|
||||
- static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
|
||||
+ //DCHECK_NE(GetLastError(),
|
||||
+ // static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
|
||||
FreeData(format, handle);
|
||||
FreeData(cf_format, handle);
|
||||
}
|
||||
}
|
||||
|
||||
109
patches/chromium/delay_lock_the_protocol_scheme_registry.patch
Normal file
109
patches/chromium/delay_lock_the_protocol_scheme_registry.patch
Normal file
@@ -0,0 +1,109 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Locascio <andy@slack-corp.com>
|
||||
Date: Tue, 18 Feb 2020 14:35:04 -0800
|
||||
Subject: content: allow embedder to prevent locking scheme registry
|
||||
|
||||
The //content layer requires all schemes to be registered during startup,
|
||||
because Add*Scheme aren't threadsafe. However, Electron exposes the option to
|
||||
register additional schemes via JavaScript in the main process before the app
|
||||
is ready, but after the //content layer has already locked the registry.
|
||||
|
||||
This allows embedders to optionally keep the scheme registry unlocked, and it
|
||||
is their responsibility to ensure that it is not accessed in a way that would
|
||||
cause potential thread-safety issues.
|
||||
|
||||
Previously upstreamed patch: https://chromium-review.googlesource.com/c/chromium/src/+/1637040
|
||||
|
||||
This change was lost during upstream refactor in
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
|
||||
re-submitting the patch.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index d769b656dbe9e88a3e2533f82cb8daebe871d88b..0955e03a1ff9347b1d7d692e16ff62f350453f7d 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -670,7 +670,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
}
|
||||
#endif
|
||||
|
||||
- RegisterContentSchemes();
|
||||
+ RegisterContentSchemes(delegate_->ShouldLockSchemeRegistry());
|
||||
ContentClientInitializer::Set(process_type, delegate_);
|
||||
|
||||
#if !defined(OS_ANDROID)
|
||||
diff --git a/content/common/url_schemes.cc b/content/common/url_schemes.cc
|
||||
index d0a31f2406ee5c0dcc1f49e09177c914e8602132..a46deedb27c6509afaad40563bb2cbf49777fe68 100644
|
||||
--- a/content/common/url_schemes.cc
|
||||
+++ b/content/common/url_schemes.cc
|
||||
@@ -49,7 +49,7 @@ std::vector<std::string>& GetMutableServiceWorkerSchemes() {
|
||||
|
||||
} // namespace
|
||||
|
||||
-void RegisterContentSchemes() {
|
||||
+void RegisterContentSchemes(bool should_lock_registry) {
|
||||
// On Android and in tests, schemes may have been registered already.
|
||||
if (g_registered_url_schemes)
|
||||
return;
|
||||
@@ -104,7 +104,8 @@ void RegisterContentSchemes() {
|
||||
// threadsafe so must be called when GURL isn't used on any other thread. This
|
||||
// is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
|
||||
// must be inside this function.
|
||||
- url::LockSchemeRegistries();
|
||||
+ if (should_lock_registry)
|
||||
+ url::LockSchemeRegistries();
|
||||
|
||||
// Combine the default savable schemes with the additional ones given.
|
||||
GetMutableSavableSchemes().assign(std::begin(kDefaultSavableSchemes),
|
||||
diff --git a/content/common/url_schemes.h b/content/common/url_schemes.h
|
||||
index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f889977bee 100644
|
||||
--- a/content/common/url_schemes.h
|
||||
+++ b/content/common/url_schemes.h
|
||||
@@ -16,7 +16,7 @@ namespace content {
|
||||
// parsed as "standard" or "referrer" with the src/url/ library, then locks the
|
||||
// sets of schemes down. The embedder can add additional schemes by
|
||||
// overriding the ContentClient::AddAdditionalSchemes method.
|
||||
-CONTENT_EXPORT void RegisterContentSchemes();
|
||||
+CONTENT_EXPORT void RegisterContentSchemes(bool should_lock_registry = true);
|
||||
|
||||
// Re-initializes schemes for tests.
|
||||
CONTENT_EXPORT void ReRegisterContentSchemesForTests();
|
||||
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
|
||||
index af1200a0f2e04c1582e527b609a2e89a97bb0f4c..7ab4cd4a1d8aefcb4bd90d68870f02f3edcff5a7 100644
|
||||
--- a/content/public/app/content_main_delegate.cc
|
||||
+++ b/content/public/app/content_main_delegate.cc
|
||||
@@ -40,6 +40,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+bool ContentMainDelegate::ShouldLockSchemeRegistry() {
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
service_manager::ProcessType ContentMainDelegate::OverrideProcessType() {
|
||||
return service_manager::ProcessType::kDefault;
|
||||
}
|
||||
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
|
||||
index f8590642a8d6807a15746e9e7673b5e76cbe0e14..7d8df731b6dd18a42ec4fc2b1bb08a6198da8ff8 100644
|
||||
--- a/content/public/app/content_main_delegate.h
|
||||
+++ b/content/public/app/content_main_delegate.h
|
||||
@@ -77,6 +77,20 @@ class CONTENT_EXPORT ContentMainDelegate {
|
||||
// returning initialization error code. Default behavior is CHECK(false).
|
||||
virtual int TerminateForFatalInitializationError();
|
||||
|
||||
+ // Allows the embedder to prevent locking the scheme registry. The scheme
|
||||
+ // registry is the list of URL schemes we recognize, with some additional
|
||||
+ // information about each scheme such as whether it expects a host. The
|
||||
+ // scheme registry is not thread-safe, so by default it is locked before any
|
||||
+ // threads are created to ensure single-threaded access. An embedder can
|
||||
+ // override this to prevent the scheme registry from being locked during
|
||||
+ // startup, but if they do so then they are responsible for making sure that
|
||||
+ // the registry is only accessed in a thread-safe way, and for calling
|
||||
+ // url::LockSchemeRegistries() when initialization is complete. If possible,
|
||||
+ // prefer registering additional schemes through
|
||||
+ // ContentClient::AddAdditionalSchemes over preventing the scheme registry
|
||||
+ // from being locked.
|
||||
+ virtual bool ShouldLockSchemeRegistry();
|
||||
+
|
||||
// Overrides the Service Manager process type to use for the currently running
|
||||
// process.
|
||||
virtual service_manager::ProcessType OverrideProcessType();
|
||||
@@ -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 a5e45290e69648177440032da3f2f793b9c65600..4e17c9e207a540862138be576f9deb1a4c8d7b3c 100644
|
||||
index 10f39e919d5692ad265086aa6d95d975df7a21fa..4ecb8fc211e2c1d80fb8b0541b489950026e0f8c 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -305,6 +305,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
@@ -37,7 +37,7 @@ index a5e45290e69648177440032da3f2f793b9c65600..4e17c9e207a540862138be576f9deb1a
|
||||
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
|
||||
!ui::win::IsAeroGlassEnabled())) {
|
||||
if (should_lock_)
|
||||
@@ -970,6 +975,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
|
||||
@@ -969,6 +974,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
|
||||
return scoped_enable;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index a5e45290e69648177440032da3f2f793b9c65600..4e17c9e207a540862138be576f9deb1a
|
||||
// HWNDMessageHandler, gfx::WindowImpl overrides:
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
|
||||
index 12f449fd097662a49a7bd4a7fce0cbd4f9cead58..0de89fe8f856143b76682c1d5455d5f990930aab 100644
|
||||
index 6c94ab3e4972fff2fe984be748bcbc41fc6c97fc..2ca10cec3c065c3a7d5a42d3377ec9ba01524569 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,
|
||||
@@ -62,7 +62,7 @@ index 12f449fd097662a49a7bd4a7fce0cbd4f9cead58..0de89fe8f856143b76682c1d5455d5f9
|
||||
HICON GetDefaultWindowIcon() const override;
|
||||
HICON GetSmallWindowIcon() const override;
|
||||
diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
index 45c4e5b29d05ea0323596fa2c5034c2e30a68f70..e25aac69b09954fbc267309beba98ec0877fa2ac 100644
|
||||
index 649163d22b7ebe5be8e2010cd30eea96587be578..d7d971937362d08f7b508244f58cc1e2d2993e9f 100644
|
||||
--- a/ui/views/win/hwnd_message_handler_delegate.h
|
||||
+++ b/ui/views/win/hwnd_message_handler_delegate.h
|
||||
@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
|
||||
|
||||
@@ -19,28 +19,11 @@ This can be removed once web content (including WebGL) learn how
|
||||
to deal with color spaces. That is being tracked at
|
||||
https://crbug.com/634542 and https://crbug.com/711107.
|
||||
|
||||
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
||||
index 4691cedce6d16b5ffcbed995bc2a4a49dda2556b..7c95c65dbb7067524f8696ea4d86e27dacc815cb 100644
|
||||
--- a/cc/trees/layer_tree_host_impl.cc
|
||||
+++ b/cc/trees/layer_tree_host_impl.cc
|
||||
@@ -1814,6 +1814,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {
|
||||
|
||||
const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpaceAndId(
|
||||
int* id) const {
|
||||
+ if (!settings_.enable_color_correct_rendering) {
|
||||
+ static gfx::ColorSpace invalid_color_space;
|
||||
+ *id = -1;
|
||||
+ return invalid_color_space;
|
||||
+ }
|
||||
+
|
||||
const gfx::ColorSpace* result = nullptr;
|
||||
// The pending tree will have the most recently updated color space, so
|
||||
// prefer that.
|
||||
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
|
||||
index 161ce54e75c0047797e9d0db27aafc3d0bfe7140..61838deb281cc11db50d195cf960970ee9cdac89 100644
|
||||
index 499d5f149ed2a83ba0d6174d4d940b0b58e5580c..748335f21d92c858ff1efebe4ce85e7405e3bdce 100644
|
||||
--- a/cc/trees/layer_tree_settings.h
|
||||
+++ b/cc/trees/layer_tree_settings.h
|
||||
@@ -100,6 +100,8 @@ class CC_EXPORT LayerTreeSettings {
|
||||
@@ -101,6 +101,8 @@ class CC_EXPORT LayerTreeSettings {
|
||||
bool use_rgba_4444 = false;
|
||||
bool unpremultiply_and_dither_low_bit_depth_tiles = false;
|
||||
|
||||
@@ -50,7 +33,7 @@ index 161ce54e75c0047797e9d0db27aafc3d0bfe7140..61838deb281cc11db50d195cf960970e
|
||||
// Image Decode Service and raster tiles without images until the decode is
|
||||
// ready.
|
||||
diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h
|
||||
index 389f2ed29bd85c35b38df92346a8d6c76ce22fd6..02cf492fa4068d10c4b8b2addee8102b35aac3e0 100644
|
||||
index a27d84cc640a5a2af25e8b4475a499eeb298f16a..de9ffade449dcc8652481ce98306fdd59962bfa2 100644
|
||||
--- a/components/viz/common/display/renderer_settings.h
|
||||
+++ b/components/viz/common/display/renderer_settings.h
|
||||
@@ -23,6 +23,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
|
||||
@@ -83,7 +66,7 @@ index cb69e08c0185f55497089505ed5b226e57140321..362f28accc248248f3bcb54955c23528
|
||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||
#if defined(OS_MACOSX)
|
||||
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
||||
index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070ac6f80fa 100644
|
||||
index bd5b3e0fd07e2417cae37a8a7282dffbef178827..68f7203072ff567b473e8906de1af780977ad277 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -84,6 +84,9 @@
|
||||
@@ -96,19 +79,19 @@ index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070
|
||||
namespace viz {
|
||||
namespace {
|
||||
|
||||
@@ -577,8 +580,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
@@ -588,8 +591,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
|
||||
SetBlendEnabled(quad->ShouldDrawWithBlending());
|
||||
|
||||
- SetUseProgram(ProgramKey::DebugBorder(), gfx::ColorSpace::CreateSRGB(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
- CurrentRenderPassColorSpace());
|
||||
+ SetUseProgram(ProgramKey::DebugBorder(),
|
||||
+ PATCH_CS(gfx::ColorSpace::CreateSRGB()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1508,7 +1512,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
@@ -1519,7 +1523,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
params->apply_shader_based_rounded_corner &&
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
@@ -118,71 +101,67 @@ index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -1979,8 +1984,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
@@ -1990,7 +1995,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- quad_color_space,
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
- quad_color_space, CurrentRenderPassColorSpace());
|
||||
+ PATCH_CS(quad_color_space),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
SetShaderColor(color, opacity);
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -2135,8 +2140,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2145,7 +2151,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- quad_resource_lock.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
- quad_resource_lock.color_space(), CurrentRenderPassColorSpace());
|
||||
+ PATCH_CS(quad_resource_lock.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2232,8 +2237,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2241,7 +2248,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- quad_resource_lock.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
- quad_resource_lock.color_space(), CurrentRenderPassColorSpace());
|
||||
+ PATCH_CS(quad_resource_lock.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2336,7 +2341,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
@@ -2343,7 +2351,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
// The source color space should never be RGB.
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
gfx::ColorSpace dst_color_space =
|
||||
- current_frame()->current_render_pass->color_space;
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space);
|
||||
- gfx::ColorSpace dst_color_space = CurrentRenderPassColorSpace();
|
||||
+ gfx::ColorSpace dst_color_space = PATCH_CS(CurrentRenderPassColorSpace());
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
@@ -2499,8 +2504,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
@@ -2507,7 +2515,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
- lock.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
- lock.color_space(), CurrentRenderPassColorSpace());
|
||||
+ PATCH_CS(lock.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2562,8 +2567,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
@@ -2572,8 +2581,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
- SetUseProgram(draw_cache_.program_key, locked_quad.color_space(),
|
||||
- current_frame()->current_render_pass->color_space);
|
||||
- CurrentRenderPassColorSpace());
|
||||
+ SetUseProgram(draw_cache_.program_key, PATCH_CS(locked_quad.color_space()),
|
||||
+ PATCH_CS(current_frame()->current_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -3300,7 +3305,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
@@ -3312,7 +3321,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
|
||||
const gfx::ColorSpace& src_color_space,
|
||||
const gfx::ColorSpace& dst_color_space) {
|
||||
@@ -193,37 +172,41 @@ index be727deec562337330e29570cfc232d57cc69a83..fee41b66cf4b3b14c6f5b1b7278c9070
|
||||
|
||||
// If the input color space is PQ, and it did not specify a white level,
|
||||
// override it with the frame's white level.
|
||||
@@ -3683,7 +3690,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
@@ -3694,9 +3705,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
|
||||
}
|
||||
|
||||
*overlay_texture = FindOrCreateOverlayTexture(
|
||||
params.quad->render_pass_id, iosurface_width, iosurface_height,
|
||||
- current_frame()->root_render_pass->color_space);
|
||||
+ PATCH_CS(current_frame()->root_render_pass->color_space));
|
||||
- *overlay_texture =
|
||||
- FindOrCreateOverlayTexture(params.quad->render_pass_id, iosurface_width,
|
||||
- iosurface_height, RootRenderPassColorSpace());
|
||||
+ *overlay_texture = FindOrCreateOverlayTexture(
|
||||
+ params.quad->render_pass_id, iosurface_width, iosurface_height,
|
||||
+ PATCH_CS(RootRenderPassColorSpace()));
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -3902,8 +3909,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
@@ -3915,8 +3926,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
- SetUseProgram(ProgramKey::DebugBorder(), gfx::ColorSpace::CreateSRGB(),
|
||||
- current_frame()->root_render_pass->color_space);
|
||||
- CurrentRenderPassColorSpace());
|
||||
+ SetUseProgram(ProgramKey::DebugBorder(), PATCH_CS(gfx::ColorSpace::CreateSRGB()),
|
||||
+ PATCH_CS(current_frame()->root_render_pass->color_space));
|
||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -4012,3 +4019,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
@@ -4025,3 +4036,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
}
|
||||
|
||||
} // namespace viz
|
||||
+
|
||||
+#undef PATCH_CS
|
||||
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
||||
index 34510d80f708b2e61dac8605526d7b34c484a962..3ba61b3c1fbec6e9d5d9fe62704f6a9d05c4cbdd 100644
|
||||
index bf63bb9c03852263e9341c671be1ee4e7c1a3dc2..d06e2f99739298a4de13ebbce5606b68f5523df3 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -221,6 +221,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
@@ -209,6 +209,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
|
||||
// Command-line switches to propagate to the GPU process.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -232,18 +215,18 @@ index 34510d80f708b2e61dac8605526d7b34c484a962..3ba61b3c1fbec6e9d5d9fe62704f6a9d
|
||||
service_manager::switches::kGpuSandboxAllowSysVShm,
|
||||
service_manager::switches::kGpuSandboxFailuresFatal,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 89fa83bbda39e90c1fcd6df83cd248c1f2de7195..8d69e9a2f2ee1ea7e639c1bfcdf42eb89a4099ff 100644
|
||||
index 016684c4340318308666545ddd8e4e85632d4ed2..fb015b5d3b2a82cd76cf166b1d694b3587906975 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -228,6 +228,7 @@
|
||||
@@ -229,6 +229,7 @@
|
||||
#include "ui/accessibility/accessibility_switches.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/base/ui_base_switches_util.h"
|
||||
#include "ui/display/display_switches.h"
|
||||
+#include "ui/gfx/switches.h"
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "ui/native_theme/native_theme_features.h"
|
||||
#include "url/origin.h"
|
||||
@@ -3083,6 +3084,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
@@ -3168,6 +3169,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
// Propagate the following switches to the renderer command line (along
|
||||
// with any associated values) if present in the browser command line.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -252,10 +235,10 @@ index 89fa83bbda39e90c1fcd6df83cd248c1f2de7195..8d69e9a2f2ee1ea7e639c1bfcdf42eb8
|
||||
service_manager::switches::kDisableInProcessStackTraces,
|
||||
service_manager::switches::kDisableSeccompFilterSandbox,
|
||||
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
||||
index bef9630bc7a15b9b8fcebd064d4cea013e6adc4d..c376dab8247eb8352f045dbcd1b8d01a6571aaa3 100644
|
||||
index 48965b64fd7ec59b2132dc2c2fb47d4276fc945c..6d95719f7af3df9e1225e2547723d2231c25c612 100644
|
||||
--- a/content/renderer/render_widget.cc
|
||||
+++ b/content/renderer/render_widget.cc
|
||||
@@ -2853,6 +2853,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
@@ -2735,6 +2735,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
settings.main_frame_before_activation_enabled =
|
||||
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
|
||||
|
||||
@@ -310,7 +293,7 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
|
||||
|
||||
gfx::ColorSpace::TransferID transfer_id =
|
||||
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
|
||||
index 2b1691687293c069dad9d84b6d2a34a8bd9adde7..90b879ad3f1a7b265b825209185b52492d79c7d5 100644
|
||||
index 4c47a1132ea3d53b6c63882e98374196ac7ce069..a7f00f426cc6a75d7b942581696332756f2cb792 100644
|
||||
--- a/ui/gfx/mac/io_surface.cc
|
||||
+++ b/ui/gfx/mac/io_surface.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -321,7 +304,7 @@ index 2b1691687293c069dad9d84b6d2a34a8bd9adde7..90b879ad3f1a7b265b825209185b5249
|
||||
|
||||
namespace gfx {
|
||||
|
||||
@@ -261,6 +262,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
@@ -254,6 +255,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
|
||||
} else {
|
||||
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
|
||||
@@ -333,7 +316,7 @@ index 2b1691687293c069dad9d84b6d2a34a8bd9adde7..90b879ad3f1a7b265b825209185b5249
|
||||
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
|
||||
CGColorSpaceCopyICCProfile(color_space));
|
||||
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
|
||||
@@ -277,6 +283,14 @@ bool IOSurfaceCanSetColorSpace(const ColorSpace& color_space) {
|
||||
@@ -270,6 +276,14 @@ bool IOSurfaceCanSetColorSpace(const ColorSpace& color_space) {
|
||||
|
||||
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
|
||||
const ColorSpace& color_space) {
|
||||
@@ -349,28 +332,27 @@ index 2b1691687293c069dad9d84b6d2a34a8bd9adde7..90b879ad3f1a7b265b825209185b5249
|
||||
DLOG(ERROR) << "Failed to set color space for IOSurface: "
|
||||
<< color_space.ToString();
|
||||
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
|
||||
index ba3dbf23d1df7a3b0cc199054f36a88014daa0e7..f8a563a78cee2856da0f2ad556beba19b01a2e59 100644
|
||||
index 0f746ead72a2c195321384c9c4ced96d0608fb7b..a9cc7b6d93cdb42c5a9a177e8a09edeb36db8122 100644
|
||||
--- a/ui/gfx/switches.cc
|
||||
+++ b/ui/gfx/switches.cc
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace switches {
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace switches {
|
||||
// Scale factor to apply to every animation duration. Must be >= 0.0. This will
|
||||
// only apply to LinearAnimation and its subclasses.
|
||||
const char kAnimationDurationScale[] = "animation-duration-scale";
|
||||
+const char kDisableColorCorrectRendering[] = "disable-color-correct-rendering";
|
||||
+
|
||||
|
||||
// Force disables font subpixel positioning. This affects the character glyph
|
||||
// sharpness, kerning, hinting and layout.
|
||||
const char kDisableFontSubpixelPositioning[] =
|
||||
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
|
||||
index 1f0e63383213ac5ebc67691e5e89b501d7480e1b..14e3d1928f7485684b646629f853ea39a616995e 100644
|
||||
index abe0a58a9ccbcd1610f728baa5d9a1155402af0c..e48d800b432f77d364541c432a1ce8865e888766 100644
|
||||
--- a/ui/gfx/switches.h
|
||||
+++ b/ui/gfx/switches.h
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
namespace switches {
|
||||
|
||||
GFX_SWITCHES_EXPORT extern const char kAnimationDurationScale[];
|
||||
+GFX_SWITCHES_EXPORT extern const char kDisableColorCorrectRendering[];
|
||||
+
|
||||
GFX_SWITCHES_EXPORT extern const char kDisableFontSubpixelPositioning[];
|
||||
|
||||
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 6e8d054ba55b927b08aeaee46676886220ef1045..221b596c774a42487b95d678fde2db730b4b1288 100644
|
||||
index 7f638d6881d6934bcff85c88804e130677ea9711..dd21fbb05501329afed80e42262342c4f337dc44 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -469,7 +469,11 @@
|
||||
@@ -472,7 +472,11 @@
|
||||
return;
|
||||
|
||||
host()->WasHidden();
|
||||
|
||||
@@ -6,24 +6,24 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 954011b5d5623ddb24971e8797d3ba9c957b2e94..8e095e6cbc3408c8b884ea0cecb5f869c7b83ffd 100644
|
||||
index 40b9e634b8bf09a0bbded7cc0648ed58b76825fa..0d290b86b9ad6d8152526e1433f88e035fb09b91 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -613,6 +613,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -614,6 +614,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
if (is_hidden_)
|
||||
return;
|
||||
|
||||
+ if (disable_hidden_)
|
||||
+ return;
|
||||
+
|
||||
RejectMouseLockOrUnlockIfNecessary();
|
||||
RejectMouseLockOrUnlockIfNecessary(
|
||||
blink::mojom::PointerLockResult::kWrongDocument);
|
||||
|
||||
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
index 9faf49a3fd83fa162de5478065007b0a85b49003..bef9bd9ab188af5c75fb92737579c52b0bf2bef1 100644
|
||||
index b6f95fdfa88b0094dc8316d61660a16e8ac0e8a8..b8d70e8973518f46f0c322af4bd2c86af626175a 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -176,6 +176,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
@@ -175,6 +175,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
// RenderWidgetHostImpl.
|
||||
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
|
||||
See https://github.com/electron/electron/issues/10754
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
index f7a30a0bd0d37b0a23ae441794f5a968e45dc3d9..74e1143f30411106b598fb7bd12f618fd439b041 100644
|
||||
index 31cbbadddd28540096263dd4811b0f098eff6e0a..aa76a4efd290b142bcc87ee960e79ec366ddceb8 100644
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -3896,7 +3896,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
@@ -4147,7 +4147,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
|
||||
"frame that never had a user gesture since its load. "
|
||||
"https://www.chromestatus.com/feature/5082396709879808";
|
||||
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);
|
||||
|
||||
@@ -32,10 +32,10 @@ index 3fd108c89c3b070a08790850db4dfd6cc8a3ce44..c393f51709efd8b28b07edfe452d2b84
|
||||
|
||||
} // namespace storage
|
||||
diff --git a/third_party/blink/public/mojom/dom_storage/storage_area.mojom b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
|
||||
index 1f1b2c6fa109aa52c4e7c7f5fcaac91beb538449..d8f15eed9be83340ffd1f2400df08558e9554710 100644
|
||||
index c9f9124eb6f4900988ad63fa38a03b7b6c5d1abb..9cba4e5af9a624d358697d806f151ee3998f0b58 100644
|
||||
--- a/third_party/blink/public/mojom/dom_storage/storage_area.mojom
|
||||
+++ b/third_party/blink/public/mojom/dom_storage/storage_area.mojom
|
||||
@@ -40,7 +40,8 @@ interface StorageAreaGetAllCallback {
|
||||
@@ -50,7 +50,8 @@ struct KeyValue {
|
||||
interface StorageArea {
|
||||
// The quota for each storage area.
|
||||
// This value is enforced in renderer processes and the browser process.
|
||||
|
||||
@@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970
|
||||
DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
|
||||
};
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 7e7e50880804583acf75206d3f5f1c6f4c3b158d..3e69113249366e4bb6e62a9fe7085f608dd59755 100644
|
||||
index 04463f777467a9f3ff6a9959d490d79c2e472c69..8e8853d741b8867d49be94fcc8428b7917d40f1d 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -991,6 +991,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -1009,6 +1009,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index 7e7e50880804583acf75206d3f5f1c6f4c3b158d..3e69113249366e4bb6e62a9fe7085f60
|
||||
// This may only be called on NetworkContexts created with the constructor
|
||||
// that calls MakeURLRequestContext().
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 67f0e98426345beac34bfd41be384210be5911e4..b6fcd9920fcc047d58501dccc492bb0a118e654f 100644
|
||||
index 2cc0dc76a55026dea5db962df8c79bf85754912d..2d42b7197b61bed3af8e1859a9945318c96f8946 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -234,6 +234,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -236,6 +236,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override;
|
||||
@@ -63,10 +63,10 @@ index 67f0e98426345beac34bfd41be384210be5911e4..b6fcd9920fcc047d58501dccc492bb0a
|
||||
void SetEnableReferrers(bool enable_referrers) override;
|
||||
#if defined(OS_CHROMEOS)
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 6adfd8969148daba3f77aea4c5f89adec6338e6b..78fd4bd72b07f38b447840b584253883756fe021 100644
|
||||
index 1d9ffd3de180e3256fb63a497544feeb427ae7ff..c37432121142472010b767b7fb257e20bc60b3fc 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -984,6 +984,9 @@ interface NetworkContext {
|
||||
@@ -1016,6 +1016,9 @@ interface NetworkContext {
|
||||
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
||||
NetworkConditions? conditions);
|
||||
|
||||
@@ -77,7 +77,7 @@ index 6adfd8969148daba3f77aea4c5f89adec6338e6b..78fd4bd72b07f38b447840b584253883
|
||||
SetAcceptLanguage(string new_accept_language);
|
||||
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index cf8fe291c5d42ddc3fcaa4e062fcf8891a0af085..caf691e79d71982d65e10e6d398939e30f642f06 100644
|
||||
index 4d832a7980805ac48938579ea587b474bbeb35d7..402d546fd26a91409bf4df3574b76ac8cbc32152 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -99,6 +99,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
|
||||
@@ -13,10 +13,10 @@ 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 c20f1455d9d81e6780deecdebfb1f1b4e125db66..8a933b20b4d5ca8c2c55c881e95695d8416a0163 100644
|
||||
index bfca4412f0045bdd23a76597a803145e9f7f22c5..5337fa3fe2653684ff1688f1cf8a52c908ee1d61 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -47,6 +47,8 @@ NativeTheme::NativeTheme()
|
||||
@@ -53,6 +53,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors)
|
||||
NativeTheme::~NativeTheme() = default;
|
||||
|
||||
bool NativeTheme::ShouldUseDarkColors() const {
|
||||
@@ -26,12 +26,12 @@ index c20f1455d9d81e6780deecdebfb1f1b4e125db66..8a933b20b4d5ca8c2c55c881e95695d8
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index 782dd1d122bfab4990c924a7fb0e7276fb51b18b..8ff66638296fefd66443ea83436258b07235aded 100644
|
||||
index d0fb56734a9cb102c7c709873a4ec07a3af6b2e8..250cdbbbc95897e9e2162311bf1f97c9dbd93330 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -449,6 +449,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -353,6 +353,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
ColorId color_id,
|
||||
ColorScheme color_scheme = ColorScheme::kDefault) const = 0;
|
||||
ColorScheme color_scheme = ColorScheme::kDefault) const;
|
||||
|
||||
+ enum ThemeSource {
|
||||
+ kSystem,
|
||||
@@ -52,7 +52,7 @@ index 782dd1d122bfab4990c924a7fb0e7276fb51b18b..8ff66638296fefd66443ea83436258b0
|
||||
// Returns a shared instance of the native theme that should be used for web
|
||||
// rendering. Do not use it in a normal application context (i.e. browser).
|
||||
// The returned object should not be deleted by the caller. This function is
|
||||
@@ -573,6 +589,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -483,6 +499,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
PreferredColorScheme preferred_color_scheme_ =
|
||||
PreferredColorScheme::kNoPreference;
|
||||
|
||||
@@ -62,7 +62,7 @@ index 782dd1d122bfab4990c924a7fb0e7276fb51b18b..8ff66638296fefd66443ea83436258b0
|
||||
};
|
||||
|
||||
diff --git a/ui/native_theme/native_theme_dark_aura.cc b/ui/native_theme/native_theme_dark_aura.cc
|
||||
index a8fbfee3b13672902aac05fd5a65fa8ee81f9f7e..1be6369acf0b7c02a6f862636c2b2de1fbf8cb5a 100644
|
||||
index 87b0abc9c646ace8cafc2b83eb4da6ffd3370237..75c677def845711ef4f3414f0a7df4f88431bf25 100644
|
||||
--- a/ui/native_theme/native_theme_dark_aura.cc
|
||||
+++ b/ui/native_theme/native_theme_dark_aura.cc
|
||||
@@ -20,6 +20,8 @@ SkColor NativeThemeDarkAura::GetSystemColor(ColorId color_id,
|
||||
@@ -75,10 +75,10 @@ index a8fbfee3b13672902aac05fd5a65fa8ee81f9f7e..1be6369acf0b7c02a6f862636c2b2de1
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index cff7681a4e0023a67edda37bf9865ab073b32549..83507081e0734b53fd37133014256243dda6864d 100644
|
||||
index dedaaaeaa93e55ec784f94864d670e0659d839bf..57009894edb9ad9422e24bf40f4100964fd32d1c 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -706,6 +706,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
@@ -726,6 +726,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
// ...unless --force-dark-mode was specified in which case caveat emptor.
|
||||
if (UsesHighContrastColors() && !IsForcedDarkMode())
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Tue, 25 Feb 2020 13:28:30 -0800
|
||||
Subject: feat: add support for overriding the base spellchecker download URL
|
||||
|
||||
This patch is required as the testing-only method we were using does not
|
||||
take into account the dictionary name and therefore will not work for
|
||||
production use cases. This is unlikely to be upstreamed as the change
|
||||
is entirely in //chrome.
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
index 47179fbe844505c1401b0ff56ba9695c9390272e..c9c9f18b5cb176d74729cea8e5fee12f7fcf74f2 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
|
||||
@@ -49,6 +49,9 @@ namespace {
|
||||
base::LazyInstance<GURL>::Leaky g_download_url_for_testing =
|
||||
LAZY_INSTANCE_INITIALIZER;
|
||||
|
||||
+base::LazyInstance<GURL>::Leaky g_base_download_url_override =
|
||||
+ LAZY_INSTANCE_INITIALIZER;
|
||||
+
|
||||
// Close the file.
|
||||
void CloseDictionary(base::File file) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
@@ -247,6 +250,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
|
||||
g_download_url_for_testing.Get() = url;
|
||||
}
|
||||
|
||||
+void SpellcheckHunspellDictionary::SetBaseDownloadURL(const GURL url) {
|
||||
+ g_base_download_url_override.Get() = url;
|
||||
+}
|
||||
+
|
||||
GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
if (g_download_url_for_testing.Get() != GURL())
|
||||
return g_download_url_for_testing.Get();
|
||||
@@ -254,6 +261,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
|
||||
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
|
||||
DCHECK(!bdict_file.empty());
|
||||
|
||||
+ if (g_base_download_url_override.Get() != GURL())
|
||||
+ return GURL(g_base_download_url_override.Get().spec() + base::ToLowerASCII(bdict_file));
|
||||
+
|
||||
static const char kDownloadServerUrl[] =
|
||||
"https://redirector.gvt1.com/edgedl/chrome/dict/";
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
index 4af3201238dfec14bd5a4241b662ca52799e6862..4662bdc08b54304a7f8b2995f60fea9dc5617fff 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
|
||||
@@ -85,6 +85,8 @@ class SpellcheckHunspellDictionary
|
||||
// Tests use this method to set a custom URL for downloading dictionaries.
|
||||
static void SetDownloadURLForTesting(const GURL url);
|
||||
|
||||
+ static void SetBaseDownloadURL(const GURL url);
|
||||
+
|
||||
private:
|
||||
// Dictionary download status.
|
||||
enum DownloadStatus {
|
||||
@@ -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 26df70e508cd60ddc96d668697e76542a7f1cd2c..dd3eb6426bdeeb641f551be6f92665589823e597 100644
|
||||
index 464c6df3e17a93c591701f23470b445a95cc8855..8e5f755f25cf09260d1612c1e54652d4f4c7caac 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -432,6 +432,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -440,6 +440,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
Send(new ViewMsg_SetBackgroundOpaque(GetRoutingID(), opaque));
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ index 26df70e508cd60ddc96d668697e76542a7f1cd2c..dd3eb6426bdeeb641f551be6f9266558
|
||||
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 2f666f75debc36767a9746bdfb2c99d7c8ee71a0..0ed154e56ad144750ecf0cc25118e00dca06dacb 100644
|
||||
index 9418a3622afb6a394391bb8420f2fdc3e8c08a61..6d74ea1ca2d1a9cf81838867532b14cd33fb9f74 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -108,6 +108,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -109,6 +109,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
SiteInstanceImpl* GetSiteInstance() override;
|
||||
bool IsRenderViewLive() override;
|
||||
void NotifyMoveOrResizeStarted() override;
|
||||
@@ -33,10 +33,10 @@ index 2f666f75debc36767a9746bdfb2c99d7c8ee71a0..0ed154e56ad144750ecf0cc25118e00d
|
||||
void UpdateWebkitPreferences(const WebPreferences& prefs) override;
|
||||
void OnWebkitPreferencesChanged() override;
|
||||
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
|
||||
index 18d157538ec3cc6a6bfde3eda3873d61336ed649..54d7085355e42e5d7ced7262b6b6e91e19b24e9e 100644
|
||||
index ee01a4430f8e3098fbf741010394ad1a8fd6528b..01327559222ebd3e9de954cf9c9137cc105cbee0 100644
|
||||
--- a/content/common/view_messages.h
|
||||
+++ b/content/common/view_messages.h
|
||||
@@ -109,6 +109,9 @@ IPC_STRUCT_TRAITS_END()
|
||||
@@ -98,6 +98,9 @@ IPC_STRUCT_TRAITS_END()
|
||||
// Make the RenderWidget background transparent or opaque.
|
||||
IPC_MESSAGE_ROUTED1(ViewMsg_SetBackgroundOpaque, bool /* opaque */)
|
||||
|
||||
@@ -47,10 +47,10 @@ index 18d157538ec3cc6a6bfde3eda3873d61336ed649..54d7085355e42e5d7ced7262b6b6e91e
|
||||
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 95679ab2915ad496ca0018aa13874b84eb11d7fd..c278e0fc072409677beafc7f252ebcf6002f16d4 100644
|
||||
index 893c45a5c71b4e55ea323ae60e11d12ddb099efd..db9a1ff0fe1a912db83692ab17c620cff7446bcb 100644
|
||||
--- a/content/public/browser/render_view_host.h
|
||||
+++ b/content/public/browser/render_view_host.h
|
||||
@@ -99,6 +99,9 @@ class CONTENT_EXPORT RenderViewHost : public IPC::Sender {
|
||||
@@ -96,6 +96,9 @@ class CONTENT_EXPORT RenderViewHost : public IPC::Sender {
|
||||
// started.
|
||||
virtual void NotifyMoveOrResizeStarted() = 0;
|
||||
|
||||
@@ -61,37 +61,37 @@ index 95679ab2915ad496ca0018aa13874b84eb11d7fd..c278e0fc072409677beafc7f252ebcf6
|
||||
//
|
||||
// Returns the current WebKit preferences. Note: WebPreferences is cached, so
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index 463906df3f761bb321c8580185c5e12dceb96854..053abd33b8f73b0f12a7729b507914516dff584e 100644
|
||||
index d2aaba85dcf63d357d521d017425318d79dbd16b..6927c27c62b5797b9b6fc3d05002a9e6b1b8fc70 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -1192,6 +1192,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
@@ -1174,6 +1174,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
|
||||
+ IPC_MESSAGE_HANDLER(ViewMsg_SetSchedulerThrottling,
|
||||
+ OnSetSchedulerThrottling)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
|
||||
@@ -1748,6 +1750,12 @@ void RenderViewImpl::OnSetPageScale(float page_scale_factor) {
|
||||
webview()->SetPageScaleFactor(page_scale_factor);
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
|
||||
@@ -1691,6 +1693,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
|
||||
return send_content_state_immediately_;
|
||||
}
|
||||
|
||||
+void RenderViewImpl::OnSetSchedulerThrottling(bool allowed) {
|
||||
+ if (!webview())
|
||||
+ if (!GetWebView())
|
||||
+ return;
|
||||
+ webview()->SetSchedulerThrottling(allowed);
|
||||
+ GetWebView()->SetSchedulerThrottling(allowed);
|
||||
+}
|
||||
+
|
||||
void RenderViewImpl::ApplyPageVisibilityState(
|
||||
PageVisibilityState visibility_state,
|
||||
bool initial_setting) {
|
||||
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
|
||||
index edefd461a9d6b127886a2e84355a3a99e891ade7..af5fc0cc3334e66368c1780b4e79e923aeac1394 100644
|
||||
index 78fa09039c0458c9df3f6f93c28950a3ae1aa3ff..b12e78fa52c9ec80e388c40525f801857fa5521a 100644
|
||||
--- a/content/renderer/render_view_impl.h
|
||||
+++ b/content/renderer/render_view_impl.h
|
||||
@@ -440,6 +440,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
|
||||
void OnSetInitialFocus(bool reverse);
|
||||
@@ -415,6 +415,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
|
||||
void OnSetHistoryOffsetAndLength(int history_offset, int history_length);
|
||||
void OnSetRendererPrefs(
|
||||
const blink::mojom::RendererPreferences& renderer_prefs);
|
||||
+ void OnSetSchedulerThrottling(bool allowed);
|
||||
@@ -99,10 +99,10 @@ index edefd461a9d6b127886a2e84355a3a99e891ade7..af5fc0cc3334e66368c1780b4e79e923
|
||||
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 a6d03eca18db4566002d71ec0b6aedae39a78be7..5eaf6fa6e7568d89d3051617f3ac99b37161fd17 100644
|
||||
index c2c079e51358696f18f8f4733bc904f9ac6f7ed6..3f11aa7cab36f45fd26ea0eb2babe6927f5b3539 100644
|
||||
--- a/third_party/blink/public/web/web_view.h
|
||||
+++ b/third_party/blink/public/web/web_view.h
|
||||
@@ -407,6 +407,7 @@ class WebView {
|
||||
@@ -412,6 +412,7 @@ class WebView {
|
||||
// Scheduling -----------------------------------------------------------
|
||||
|
||||
virtual PageScheduler* Scheduler() const = 0;
|
||||
@@ -111,10 +111,10 @@ index a6d03eca18db4566002d71ec0b6aedae39a78be7..5eaf6fa6e7568d89d3051617f3ac99b3
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 7f58ed742695387c9516dd5c5c3f195e66348cfc..0688b04bc98cecc7506aa69af6b1c2a355dddf62 100644
|
||||
index bcf5d6b07b2620ed71cff55927ff4a3326d85fa4..f25ee2578a49f5b8dc3db3d831b29d996031f273 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -3334,12 +3334,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3354,12 +3354,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -138,10 +138,10 @@ index 7f58ed742695387c9516dd5c5c3f195e66348cfc..0688b04bc98cecc7506aa69af6b1c2a3
|
||||
|
||||
PageVisibilityState WebViewImpl::GetVisibilityState() {
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index 710607bd9112b399e14826105e45f5bf93ab6524..dafc73dc85222298a3e027433939632f4fddb9c1 100644
|
||||
index ea6325cccfe6274f41525fe586c05f8b7018307c..046a3b9ff1c378adb6d4b2610051271be8a1aa0b 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -310,6 +310,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -317,6 +317,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
LocalDOMWindow* PagePopupWindow() const;
|
||||
|
||||
PageScheduler* Scheduler() const override;
|
||||
@@ -149,7 +149,7 @@ index 710607bd9112b399e14826105e45f5bf93ab6524..dafc73dc85222298a3e027433939632f
|
||||
void SetVisibilityState(PageVisibilityState visibility_state,
|
||||
bool is_initial_state) override;
|
||||
PageVisibilityState GetVisibilityState() override;
|
||||
@@ -680,6 +681,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
@@ -686,6 +687,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
// WebViewImpl::Close while handling an input event.
|
||||
bool debug_inside_input_handling_ = false;
|
||||
|
||||
@@ -157,4 +157,4 @@ index 710607bd9112b399e14826105e45f5bf93ab6524..dafc73dc85222298a3e027433939632f
|
||||
+
|
||||
FloatSize elastic_overscroll_;
|
||||
|
||||
Persistent<EventListener> popup_mouse_wheel_event_listener_;
|
||||
// If true, we send IPC messages when |preferred_size_| changes.
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Sun, 1 Mar 2020 16:33:55 -0800
|
||||
Subject: feat: allow embedders to add observers on created hunspell
|
||||
dictionaries
|
||||
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
index 7d3ddb783ca82c88b1d2fd388b9e33e20f06b833..543c8026ead55e135b923ae99cb90f117f5d7f51 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
|
||||
@@ -283,6 +283,9 @@ void SpellcheckService::LoadHunspellDictionaries() {
|
||||
std::make_unique<SpellcheckHunspellDictionary>(dictionary, context_,
|
||||
this));
|
||||
hunspell_dictionaries_.back()->AddObserver(this);
|
||||
+ if (hunspell_observer_) {
|
||||
+ hunspell_dictionaries_.back()->AddObserver(hunspell_observer_);
|
||||
+ }
|
||||
hunspell_dictionaries_.back()->Load();
|
||||
}
|
||||
|
||||
@@ -296,6 +299,20 @@ SpellcheckService::GetHunspellDictionaries() {
|
||||
return hunspell_dictionaries_;
|
||||
}
|
||||
|
||||
+void SpellcheckService::SetHunspellObserver(SpellcheckHunspellDictionary::Observer* observer) {
|
||||
+ if (hunspell_observer_) {
|
||||
+ for (auto& dict : hunspell_dictionaries_) {
|
||||
+ dict->RemoveObserver(hunspell_observer_);
|
||||
+ }
|
||||
+ }
|
||||
+ if (observer) {
|
||||
+ for (auto& dict : hunspell_dictionaries_) {
|
||||
+ dict->AddObserver(observer);
|
||||
+ }
|
||||
+ }
|
||||
+ hunspell_observer_ = observer;
|
||||
+}
|
||||
+
|
||||
bool SpellcheckService::LoadExternalDictionary(std::string language,
|
||||
std::string locale,
|
||||
std::string path,
|
||||
diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h
|
||||
index 803c7dad0d30af2c5ebd9b3e2f200183fa20d15a..5afca1e55685efea1f17dfba98db3ebd51c849de 100644
|
||||
--- a/chrome/browser/spellchecker/spellcheck_service.h
|
||||
+++ b/chrome/browser/spellchecker/spellcheck_service.h
|
||||
@@ -116,6 +116,8 @@ class SpellcheckService : public KeyedService,
|
||||
const std::vector<std::unique_ptr<SpellcheckHunspellDictionary>>&
|
||||
GetHunspellDictionaries();
|
||||
|
||||
+ void SetHunspellObserver(SpellcheckHunspellDictionary::Observer* observer);
|
||||
+
|
||||
// Load a dictionary from a given path. Format specifies how the dictionary
|
||||
// is stored. Return value is true if successful.
|
||||
bool LoadExternalDictionary(std::string language,
|
||||
@@ -213,6 +215,8 @@ class SpellcheckService : public KeyedService,
|
||||
// A pointer to the BrowserContext which this service refers to.
|
||||
content::BrowserContext* context_;
|
||||
|
||||
+ SpellcheckHunspellDictionary::Observer* hunspell_observer_ = nullptr;
|
||||
+
|
||||
std::unique_ptr<SpellCheckHostMetrics> metrics_;
|
||||
|
||||
std::unique_ptr<SpellcheckCustomDictionary> custom_dictionary_;
|
||||
@@ -0,0 +1,636 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Dill <andy.dill@gmail.com>
|
||||
Date: Thu, 30 Jan 2020 09:36:07 -0800
|
||||
Subject: feat: enable off-screen rendering with viz compositor
|
||||
|
||||
This patch adds hooks in the relevant places that allow for off-screen
|
||||
rendering with the viz compositor by way of a custom HostDisplayClient
|
||||
and LayeredWindowUpdater.
|
||||
|
||||
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
|
||||
index 3547ee865c220731a6b4be4c1b32ec899b3dd11f..715bfa4b5db5fc4beb83c26b1eedda82c87a245b 100644
|
||||
--- a/components/viz/host/host_display_client.cc
|
||||
+++ b/components/viz/host/host_display_client.cc
|
||||
@@ -43,9 +43,13 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
+void HostDisplayClient::IsOffscreen(IsOffscreenCallback callback) {
|
||||
+ std::move(callback).Run(false);
|
||||
+}
|
||||
+
|
||||
void HostDisplayClient::CreateLayeredWindowUpdater(
|
||||
mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) {
|
||||
+#if defined(OS_WIN)
|
||||
if (!NeedsToUseLayerWindow(widget_)) {
|
||||
DLOG(ERROR) << "HWND shouldn't be using a layered window";
|
||||
return;
|
||||
@@ -53,8 +57,12 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
|
||||
|
||||
layered_window_updater_ =
|
||||
std::make_unique<LayeredWindowUpdaterImpl>(widget_, std::move(receiver));
|
||||
-}
|
||||
+#else
|
||||
+ CHECK(false) << "Chromium is calling CreateLayeredWindowUpdater for non-OSR "
|
||||
+ "windows on POSIX platforms, something is wrong with "
|
||||
+ "Electron's OSR implementation.";
|
||||
#endif
|
||||
+}
|
||||
|
||||
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
|
||||
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
|
||||
index cedf833d23589dc3157168cfc7e6d3bb12939f7a..4437a7875076ef5a99ddcd767036ec37c2d48d44 100644
|
||||
--- a/components/viz/host/host_display_client.h
|
||||
+++ b/components/viz/host/host_display_client.h
|
||||
@@ -31,17 +31,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
|
||||
mojo::PendingRemote<mojom::DisplayClient> GetBoundRemote(
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
||||
|
||||
- private:
|
||||
+ protected:
|
||||
// mojom::DisplayClient implementation:
|
||||
+ void IsOffscreen(IsOffscreenCallback callback) override;
|
||||
+
|
||||
#if defined(OS_MACOSX)
|
||||
void OnDisplayReceivedCALayerParams(
|
||||
const gfx::CALayerParams& ca_layer_params) override;
|
||||
#endif
|
||||
|
||||
-#if defined(OS_WIN)
|
||||
void CreateLayeredWindowUpdater(
|
||||
mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) override;
|
||||
-#endif
|
||||
|
||||
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
||||
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.cc b/components/viz/host/layered_window_updater_impl.cc
|
||||
index b04f654fe820f821b18e059cdd40085fc2384c4e..ee22012b01ef92bb3b32b5b1081609a7bdfb0d93 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.cc
|
||||
+++ b/components/viz/host/layered_window_updater_impl.cc
|
||||
@@ -44,7 +44,9 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory(
|
||||
// |region|'s handle will close when it goes out of scope.
|
||||
}
|
||||
|
||||
-void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) {
|
||||
+void LayeredWindowUpdaterImpl::Draw(
|
||||
+ const gfx::Rect& damage_rect,
|
||||
+ DrawCallback draw_callback) {
|
||||
TRACE_EVENT0("viz", "LayeredWindowUpdaterImpl::Draw");
|
||||
|
||||
if (!canvas_) {
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
|
||||
index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb319a4dd04 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.h
|
||||
+++ b/components/viz/host/layered_window_updater_impl.h
|
||||
@@ -35,7 +35,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
|
||||
// mojom::LayeredWindowUpdater implementation.
|
||||
void OnAllocatedSharedMemory(const gfx::Size& pixel_size,
|
||||
base::UnsafeSharedMemoryRegion region) override;
|
||||
- void Draw(DrawCallback draw_callback) override;
|
||||
+ void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override;
|
||||
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 84a16ad496b5e443555ac41bb969b855f5aed091..e2a478ef9b51117316a0c1fca45c5e193053b4c0 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -111,6 +111,8 @@ viz_component("service") {
|
||||
"display_embedder/output_surface_provider_impl.h",
|
||||
"display_embedder/server_shared_bitmap_manager.cc",
|
||||
"display_embedder/server_shared_bitmap_manager.h",
|
||||
+ "display_embedder/software_output_device_proxy.cc",
|
||||
+ "display_embedder/software_output_device_proxy.h",
|
||||
"display_embedder/software_output_surface.cc",
|
||||
"display_embedder/software_output_surface.h",
|
||||
"display_embedder/viz_process_context_provider.cc",
|
||||
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
index b4d4b1c1c5978ca9369f7348e51dde4d935c72b3..e70d95818adf62f2e966e715a5043f91b255b799 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
|
||||
#include "components/viz/service/display_embedder/skia_output_surface_dependency_impl.h"
|
||||
#include "components/viz/service/display_embedder/skia_output_surface_impl.h"
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
#include "components/viz/service/display_embedder/software_output_surface.h"
|
||||
#include "components/viz/service/display_embedder/viz_process_context_provider.h"
|
||||
#include "components/viz/service/gl/gpu_service_impl.h"
|
||||
@@ -34,6 +35,7 @@
|
||||
#include "gpu/ipc/scheduler_sequence.h"
|
||||
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
|
||||
#include "gpu/ipc/service/image_transport_surface.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/init/gl_factory.h"
|
||||
@@ -224,6 +226,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
if (headless_)
|
||||
return std::make_unique<SoftwareOutputDevice>();
|
||||
|
||||
+#if !defined(OS_MACOSX)
|
||||
+ {
|
||||
+ mojo::ScopedAllowSyncCallForTesting allow_sync;
|
||||
+ DCHECK(display_client);
|
||||
+ bool offscreen = false;
|
||||
+ if (display_client->IsOffscreen(&offscreen) && offscreen) {
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater;
|
||||
+ display_client->CreateLayeredWindowUpdater(
|
||||
+ mojo::MakeRequest(&layered_window_updater));
|
||||
+
|
||||
+ return std::make_unique<SoftwareOutputDeviceProxy>(
|
||||
+ std::move(layered_window_updater));
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WIN)
|
||||
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
|
||||
display_client);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
index 49149081cc603f14eacee647cbb2fcf8ed5e66fd..9ff3f2ee203403fdaa31edb8a0bcc000c4d214d7 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
|
||||
|
||||
SkCanvas* SoftwareOutputDeviceMac::BeginPaint(
|
||||
const gfx::Rect& new_damage_rect) {
|
||||
+ last_damage = new_damage_rect;
|
||||
+
|
||||
// Record the previous paint buffer.
|
||||
Buffer* previous_paint_buffer =
|
||||
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
|
||||
@@ -187,6 +189,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
||||
ca_layer_params.is_empty = false;
|
||||
ca_layer_params.scale_factor = scale_factor_;
|
||||
ca_layer_params.pixel_size = pixel_size_;
|
||||
+ ca_layer_params.damage = last_damage;
|
||||
ca_layer_params.io_surface_mach_port.reset(
|
||||
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
|
||||
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e5ffe86dd 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
|
||||
void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer,
|
||||
const SkRegion& new_damage_rect);
|
||||
|
||||
+ gfx::Rect last_damage;
|
||||
gfx::Size pixel_size_;
|
||||
float scale_factor_ = 1;
|
||||
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4efea02f80f8b6818291321a7c63f0f4815a5b98
|
||||
--- /dev/null
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc
|
||||
@@ -0,0 +1,157 @@
|
||||
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
|
||||
+
|
||||
+#include "base/memory/unsafe_shared_memory_region.h"
|
||||
+#include "base/threading/thread_checker.h"
|
||||
+#include "base/trace_event/trace_event.h"
|
||||
+#include "components/viz/common/resources/resource_sizes.h"
|
||||
+#include "components/viz/service/display_embedder/output_device_backing.h"
|
||||
+#include "mojo/public/cpp/system/platform_handle.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
+#include "skia/ext/platform_canvas.h"
|
||||
+#include "third_party/skia/include/core/SkCanvas.h"
|
||||
+#include "ui/gfx/skia_util.h"
|
||||
+
|
||||
+#if defined(OS_WIN)
|
||||
+#include "skia/ext/skia_utils_win.h"
|
||||
+#include "ui/gfx/gdi_util.h"
|
||||
+#include "ui/gfx/win/hwnd_util.h"
|
||||
+#else
|
||||
+#include "mojo/public/cpp/base/shared_memory_utils.h"
|
||||
+#endif
|
||||
+
|
||||
+namespace viz {
|
||||
+
|
||||
+SoftwareOutputDeviceBase::~SoftwareOutputDeviceBase() {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceBase::Resize(const gfx::Size& viewport_pixel_size,
|
||||
+ float scale_factor) {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+
|
||||
+ if (viewport_pixel_size_ == viewport_pixel_size)
|
||||
+ return;
|
||||
+
|
||||
+ viewport_pixel_size_ = viewport_pixel_size;
|
||||
+ ResizeDelegated();
|
||||
+}
|
||||
+
|
||||
+SkCanvas* SoftwareOutputDeviceBase::BeginPaint(
|
||||
+ const gfx::Rect& damage_rect) {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(!in_paint_);
|
||||
+
|
||||
+ damage_rect_ = damage_rect;
|
||||
+ in_paint_ = true;
|
||||
+ return BeginPaintDelegated();
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceBase::EndPaint() {
|
||||
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
+ DCHECK(in_paint_);
|
||||
+
|
||||
+ in_paint_ = false;
|
||||
+
|
||||
+ gfx::Rect intersected_damage_rect = damage_rect_;
|
||||
+ intersected_damage_rect.Intersect(gfx::Rect(viewport_pixel_size_));
|
||||
+ if (intersected_damage_rect.IsEmpty())
|
||||
+ return;
|
||||
+
|
||||
+ EndPaintDelegated(intersected_damage_rect);
|
||||
+}
|
||||
+
|
||||
+SoftwareOutputDeviceProxy::~SoftwareOutputDeviceProxy() = default;
|
||||
+
|
||||
+SoftwareOutputDeviceProxy::SoftwareOutputDeviceProxy(
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater)
|
||||
+ : layered_window_updater_(std::move(layered_window_updater)) {
|
||||
+ DCHECK(layered_window_updater_.is_bound());
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::OnSwapBuffers(
|
||||
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) {
|
||||
+ DCHECK(swap_ack_callback_.is_null());
|
||||
+
|
||||
+ // We aren't waiting on DrawAck() and can immediately run the callback.
|
||||
+ if (!waiting_on_draw_ack_) {
|
||||
+ task_runner_->PostTask(FROM_HERE,
|
||||
+ base::BindOnce(std::move(swap_ack_callback), viewport_pixel_size_));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ swap_ack_callback_ = std::move(swap_ack_callback);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::ResizeDelegated() {
|
||||
+ canvas_.reset();
|
||||
+
|
||||
+ size_t required_bytes;
|
||||
+ if (!ResourceSizes::MaybeSizeInBytes(
|
||||
+ viewport_pixel_size_, ResourceFormat::RGBA_8888, &required_bytes)) {
|
||||
+ DLOG(ERROR) << "Invalid viewport size " << viewport_pixel_size_.ToString();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ base::UnsafeSharedMemoryRegion region =
|
||||
+ base::UnsafeSharedMemoryRegion::Create(required_bytes);
|
||||
+ if (!region.IsValid()) {
|
||||
+ DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ #if defined(WIN32)
|
||||
+ canvas_ = skia::CreatePlatformCanvasWithSharedSection(
|
||||
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
|
||||
+ region.GetPlatformHandle(), skia::CRASH_ON_FAILURE);
|
||||
+ #else
|
||||
+ shm_mapping_ = region.Map();
|
||||
+ if (!shm_mapping_.IsValid()) {
|
||||
+ DLOG(ERROR) << "Failed to map " << required_bytes << " bytes";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ canvas_ = skia::CreatePlatformCanvasWithPixels(
|
||||
+ viewport_pixel_size_.width(), viewport_pixel_size_.height(), false,
|
||||
+ static_cast<uint8_t*>(shm_mapping_.memory()), skia::CRASH_ON_FAILURE);
|
||||
+ #endif
|
||||
+
|
||||
+ // Transfer region ownership to the browser process.
|
||||
+ layered_window_updater_->OnAllocatedSharedMemory(viewport_pixel_size_,
|
||||
+ std::move(region));
|
||||
+}
|
||||
+
|
||||
+SkCanvas* SoftwareOutputDeviceProxy::BeginPaintDelegated() {
|
||||
+ return canvas_.get();
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::EndPaintDelegated(
|
||||
+ const gfx::Rect& damage_rect) {
|
||||
+ DCHECK(!waiting_on_draw_ack_);
|
||||
+
|
||||
+ if (!canvas_)
|
||||
+ return;
|
||||
+
|
||||
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
||||
+ &SoftwareOutputDeviceProxy::DrawAck, base::Unretained(this)));
|
||||
+ waiting_on_draw_ack_ = true;
|
||||
+
|
||||
+ TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceProxy::Draw", this);
|
||||
+}
|
||||
+
|
||||
+void SoftwareOutputDeviceProxy::DrawAck() {
|
||||
+ DCHECK(waiting_on_draw_ack_);
|
||||
+ DCHECK(!swap_ack_callback_.is_null());
|
||||
+
|
||||
+ TRACE_EVENT_ASYNC_END0("viz", "SoftwareOutputDeviceProxy::Draw", this);
|
||||
+
|
||||
+ waiting_on_draw_ack_ = false;
|
||||
+ std::move(swap_ack_callback_).Run(viewport_pixel_size_);
|
||||
+}
|
||||
+
|
||||
+} // namespace viz
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..48fa86caaab3c15764f105eb7ad2aecf2b89bf36
|
||||
--- /dev/null
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_proxy.h
|
||||
@@ -0,0 +1,90 @@
|
||||
+// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
+// Use of this source code is governed by a BSD-style license that can be
|
||||
+// found in the LICENSE file.
|
||||
+
|
||||
+#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
+#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
+
|
||||
+#if defined(OS_WIN)
|
||||
+#include <windows.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <memory>
|
||||
+
|
||||
+#include "base/memory/shared_memory_mapping.h"
|
||||
+#include "base/threading/thread_checker.h"
|
||||
+#include "components/viz/host/host_display_client.h"
|
||||
+#include "components/viz/service/display/software_output_device.h"
|
||||
+#include "components/viz/service/viz_service_export.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
|
||||
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
|
||||
+
|
||||
+namespace viz {
|
||||
+
|
||||
+// Shared base class for SoftwareOutputDevice implementations.
|
||||
+class SoftwareOutputDeviceBase : public SoftwareOutputDevice {
|
||||
+ public:
|
||||
+ SoftwareOutputDeviceBase() = default;
|
||||
+ ~SoftwareOutputDeviceBase() override;
|
||||
+
|
||||
+ // SoftwareOutputDevice implementation.
|
||||
+ void Resize(const gfx::Size& viewport_pixel_size,
|
||||
+ float scale_factor) override;
|
||||
+ SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
|
||||
+ void EndPaint() override;
|
||||
+
|
||||
+ // Called from Resize() if |viewport_pixel_size_| has changed.
|
||||
+ virtual void ResizeDelegated() = 0;
|
||||
+
|
||||
+ // Called from BeginPaint() and should return an SkCanvas.
|
||||
+ virtual SkCanvas* BeginPaintDelegated() = 0;
|
||||
+
|
||||
+ // Called from EndPaint() if there is damage.
|
||||
+ virtual void EndPaintDelegated(const gfx::Rect& damage_rect) = 0;
|
||||
+
|
||||
+ private:
|
||||
+ bool in_paint_ = false;
|
||||
+
|
||||
+ THREAD_CHECKER(thread_checker_);
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceBase);
|
||||
+};
|
||||
+
|
||||
+// SoftwareOutputDevice implementation that draws indirectly. An implementation
|
||||
+// of mojom::LayeredWindowUpdater in the browser process handles the actual
|
||||
+// drawing. Pixel backing is in SharedMemory so no copying between processes
|
||||
+// is required.
|
||||
+class SoftwareOutputDeviceProxy : public SoftwareOutputDeviceBase {
|
||||
+ public:
|
||||
+ explicit SoftwareOutputDeviceProxy(
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater);
|
||||
+ ~SoftwareOutputDeviceProxy() override;
|
||||
+
|
||||
+ // SoftwareOutputDevice implementation.
|
||||
+ void OnSwapBuffers(SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback) override;
|
||||
+
|
||||
+ // SoftwareOutputDeviceBase implementation.
|
||||
+ void ResizeDelegated() override;
|
||||
+ SkCanvas* BeginPaintDelegated() override;
|
||||
+ void EndPaintDelegated(const gfx::Rect& rect) override;
|
||||
+
|
||||
+ private:
|
||||
+ // Runs |swap_ack_callback_| after draw has happened.
|
||||
+ void DrawAck();
|
||||
+
|
||||
+ mojom::LayeredWindowUpdaterPtr layered_window_updater_;
|
||||
+
|
||||
+ std::unique_ptr<SkCanvas> canvas_;
|
||||
+ bool waiting_on_draw_ack_ = false;
|
||||
+ SoftwareOutputDevice::SwapBuffersCallback swap_ack_callback_;
|
||||
+
|
||||
+#if !defined(WIN32)
|
||||
+ base::WritableSharedMemoryMapping shm_mapping_;
|
||||
+#endif
|
||||
+
|
||||
+ DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceProxy);
|
||||
+};
|
||||
+
|
||||
+} // namespace viz
|
||||
+
|
||||
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
index 94ea55487f85ab32d862e913c476bc95f388dce9..d055a18bbc186facd88d496d589be78068c4ca64 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
@@ -268,7 +268,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
||||
if (!canvas_)
|
||||
return;
|
||||
|
||||
- layered_window_updater_->Draw(base::BindOnce(
|
||||
+ layered_window_updater_->Draw(damage_rect, base::BindOnce(
|
||||
&SoftwareOutputDeviceWinProxy::DrawAck, base::Unretained(this)));
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
index 8e10af98f2b039d0d96f8be908f751b9117193d5..f9501da88a008131e3d046b452ba9c34455a1da4 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(
|
||||
compositor_data.display_private.reset();
|
||||
root_params->display_private =
|
||||
compositor_data.display_private.BindNewEndpointAndPassReceiver();
|
||||
- compositor_data.display_client =
|
||||
- std::make_unique<HostDisplayClient>(compositor);
|
||||
+ if (compositor->delegate()) {
|
||||
+ compositor_data.display_client = compositor->delegate()->CreateHostDisplayClient(
|
||||
+ compositor);
|
||||
+ } else {
|
||||
+ compositor_data.display_client =
|
||||
+ std::make_unique<HostDisplayClient>(compositor);
|
||||
+ }
|
||||
root_params->display_client =
|
||||
compositor_data.display_client->GetBoundRemote(resize_task_runner_);
|
||||
|
||||
diff --git a/mojo/public/cpp/bindings/sync_call_restrictions.h b/mojo/public/cpp/bindings/sync_call_restrictions.h
|
||||
index 60e1149205750740ab5bde81029e7e3b370bd1ed..c158ca4b867f20bb04a9e1ea16fa44f639ac736c 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;
|
||||
|
||||
namespace viz {
|
||||
class HostFrameSinkManager;
|
||||
+class GpuDisplayProvider;
|
||||
}
|
||||
|
||||
namespace mojo {
|
||||
@@ -82,6 +83,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions {
|
||||
// For preventing frame swaps of wrong size during resize on Windows.
|
||||
// (https://crbug.com/811945)
|
||||
friend class ui::Compositor;
|
||||
+ // For query of whether to use SoftwareOutputDevice or not
|
||||
+ friend class viz::GpuDisplayProvider;
|
||||
// END ALLOWED USAGE.
|
||||
|
||||
#if ENABLE_SYNC_CALL_RESTRICTIONS
|
||||
diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
index d36f62e6ee4166f0e27f6534c804430374bfa298..6575d7e6cafdca8cdc172e0f9912648570c1deeb 100644
|
||||
--- a/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
+++ b/services/viz/privileged/mojom/compositing/display_private.mojom
|
||||
@@ -74,12 +74,14 @@ interface DisplayPrivate {
|
||||
};
|
||||
|
||||
interface DisplayClient {
|
||||
+ [Sync]
|
||||
+ IsOffscreen() => (bool success);
|
||||
+
|
||||
[EnableIf=is_mac]
|
||||
OnDisplayReceivedCALayerParams(gfx.mojom.CALayerParams ca_layer_params);
|
||||
|
||||
// Creates a LayeredWindowUpdater implementation to draw into a layered
|
||||
// window.
|
||||
- [EnableIf=is_win]
|
||||
CreateLayeredWindowUpdater(pending_receiver<LayeredWindowUpdater> receiver);
|
||||
|
||||
// Notifies that a swap has occurred and provides information about the pixel
|
||||
diff --git a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
||||
index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a285498c3f8e72 100644
|
||||
--- a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
||||
+++ b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
|
||||
@@ -26,5 +26,5 @@ interface LayeredWindowUpdater {
|
||||
// Draws to the HWND by copying pixels from shared memory. Callback must be
|
||||
// called after draw operation is complete to signal shared memory can be
|
||||
// modified.
|
||||
- Draw() => ();
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 3e2d2304faf75d1ec6cc830d756cbf31767dacfd..b4ec5b6e34f901ace7975e5e906e01177f04e8be 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -70,6 +70,7 @@ class DisplayPrivate;
|
||||
class ExternalBeginFrameController;
|
||||
} // namespace mojom
|
||||
class ContextProvider;
|
||||
+class HostDisplayClient;
|
||||
class HostFrameSinkManager;
|
||||
class LocalSurfaceIdAllocation;
|
||||
class RasterContextProvider;
|
||||
@@ -122,6 +123,15 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
|
||||
};
|
||||
|
||||
+class COMPOSITOR_EXPORT CompositorDelegate {
|
||||
+ public:
|
||||
+ virtual std::unique_ptr<viz::HostDisplayClient> CreateHostDisplayClient(
|
||||
+ ui::Compositor* compositor) = 0;
|
||||
+
|
||||
+ protected:
|
||||
+ virtual ~CompositorDelegate() {}
|
||||
+};
|
||||
+
|
||||
// Compositor object to take care of GPU painting.
|
||||
// A Browser compositor object is responsible for generating the final
|
||||
// displayable form of pixels comprising a single widget's contents. It draws an
|
||||
@@ -155,6 +165,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
+ CompositorDelegate* delegate() const { return delegate_; }
|
||||
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
|
||||
+
|
||||
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
||||
// must have no parent. The compositor's root layer is reset if the root layer
|
||||
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
||||
@@ -390,6 +403,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
|
||||
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;
|
||||
|
||||
+ CompositorDelegate* delegate_ = nullptr;
|
||||
+
|
||||
// The root of the Layer tree drawn by this compositor.
|
||||
Layer* root_layer_ = nullptr;
|
||||
|
||||
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
|
||||
index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059c468432f 100644
|
||||
--- a/ui/gfx/ca_layer_params.h
|
||||
+++ b/ui/gfx/ca_layer_params.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#define UI_GFX_CA_LAYER_PARAMS_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
+#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/gfx/gfx_export.h"
|
||||
|
||||
@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams {
|
||||
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
|
||||
#endif
|
||||
|
||||
+ gfx::Rect damage;
|
||||
+
|
||||
// The geometry of the frame.
|
||||
gfx::Size pixel_size;
|
||||
float scale_factor = 1.f;
|
||||
diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom
|
||||
index de00e766ba17532e10dcf5d0fd31fa344920a9f7..7aaedf83ad22dcc1d2dd39a31cf7e08b7b6ba4d3 100644
|
||||
--- a/ui/gfx/mojom/ca_layer_params.mojom
|
||||
+++ b/ui/gfx/mojom/ca_layer_params.mojom
|
||||
@@ -18,5 +18,6 @@ struct CALayerParams {
|
||||
bool is_empty;
|
||||
CALayerContent content;
|
||||
gfx.mojom.Size pixel_size;
|
||||
+ gfx.mojom.Rect damage;
|
||||
float scale_factor;
|
||||
};
|
||||
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
||||
index 3f050fcf52ebb2dc2a5510d9489255ee22bfbcc8..61383dbed35dc72060a1e422fd68437fa4729ce3 100644
|
||||
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
||||
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
|
||||
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
|
||||
if (!data.ReadPixelSize(&out->pixel_size))
|
||||
return false;
|
||||
|
||||
+ if (!data.ReadDamage(&out->damage))
|
||||
+ return false;
|
||||
+
|
||||
out->scale_factor = data.scale_factor();
|
||||
return true;
|
||||
}
|
||||
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
||||
index 4cac766eae3161baedac4202f694129cd90c80de..0821495ad22944d8856bb750cac8912a2f8328c3 100644
|
||||
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
||||
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
|
||||
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
|
||||
return ca_layer_params.pixel_size;
|
||||
}
|
||||
|
||||
+ static gfx::Rect damage(const gfx::CALayerParams& ca_layer_params) {
|
||||
+ return ca_layer_params.damage;
|
||||
+ }
|
||||
+
|
||||
static float scale_factor(const gfx::CALayerParams& ca_layer_params) {
|
||||
return ca_layer_params.scale_factor;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@slack-corp.com>
|
||||
Date: Fri, 14 Feb 2020 13:35:47 -0800
|
||||
Subject: fix: route mouse event navigations through the web_contents delegate
|
||||
|
||||
This ensures that embedders can handle browser-side mouse navigations
|
||||
themselves. We need this so that we can correctly ensure that processes
|
||||
are not restarted for in-document navigations.
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1769525
|
||||
|
||||
This patch can be removed once app.allowRendererProcessReuse is forced
|
||||
to true as then Chromiums assumptions around processes become correct.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 6f2e0c12e7b4a2928346f6690c2e8a072822124b..d6cad38b1e0ca9aeb96eeaaf8b1bb39fc23893ea 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2351,11 +2351,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
WebContentsImpl* outermost = GetOutermostWebContents();
|
||||
if (event.button == blink::WebPointerProperties::Button::kBack &&
|
||||
outermost->controller_.CanGoBack()) {
|
||||
- outermost->controller_.GoBack();
|
||||
+ if (delegate_->OnGoToEntryOffset(-1))
|
||||
+ outermost->controller_.GoBack();
|
||||
return true;
|
||||
} else if (event.button == blink::WebPointerProperties::Button::kForward &&
|
||||
outermost->controller_.CanGoForward()) {
|
||||
- outermost->controller_.GoForward();
|
||||
+ if (delegate_->OnGoToEntryOffset(1))
|
||||
+ outermost->controller_.GoForward();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@ Should be removed once grit is fixed.
|
||||
Tracking bug: https://crbug.com/1040605
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
|
||||
index 9def0bb9dda87c476fdf3b52ce4d4125f37c7f49..90c81d2a9711d88284d960149e25db55ae8dc1c2 100644
|
||||
index 9ca93ffa79d6fb8658d1d0f3581f91c229b737e0..4dbeb30632654ce6e65b0acd69a0526eae42cc54 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -573,15 +573,16 @@
|
||||
@@ -587,15 +587,16 @@
|
||||
"includes": [3840],
|
||||
},
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
|
||||
// another SiteInstance for the same site.
|
||||
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
|
||||
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
|
||||
index e911c3aa1cf13b17bd43ad8c9d50f0fd59996907..373e36eb61d57e1bcd98d45419ee4b434820bf02 100644
|
||||
index dbfc24395349cfa40b5783590d60cc7e44b31205..499af1cdcf13cf57f97a0c28430cbe874c8ed7e7 100644
|
||||
--- a/content/browser/frame_host/navigation_request.cc
|
||||
+++ b/content/browser/frame_host/navigation_request.cc
|
||||
@@ -1185,6 +1185,24 @@ void NavigationRequest::BeginNavigation() {
|
||||
TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationRequest", this,
|
||||
"ResponseStarted");
|
||||
@@ -1257,6 +1257,24 @@ void NavigationRequest::BeginNavigation() {
|
||||
// it immediately.
|
||||
EnterChildTraceEvent("ResponseStarted", this);
|
||||
|
||||
+ // In Electron, a new process is started for every navigation when node is
|
||||
+ // integrated in the renderer. Since GetFrameHostForNavigation is called more
|
||||
@@ -71,10 +71,10 @@ index e911c3aa1cf13b17bd43ad8c9d50f0fd59996907..373e36eb61d57e1bcd98d45419ee4b43
|
||||
render_frame_host_ =
|
||||
frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
|
||||
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
index e41e833e963617cf5b2e463e839b2ae0bfd212ae..f544da86cb12d2786f7aad24953741ed77a0ac24 100644
|
||||
index 083dc2c8314e631329bfe81d1120d35fd3c9bfb6..dce5d1e96276dccddde3c3b3d10373fc443d1f9f 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -2247,6 +2247,16 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
@@ -2335,6 +2335,16 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
scoped_refptr<SiteInstance>
|
||||
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
NavigationRequest* request) {
|
||||
@@ -91,7 +91,7 @@ index e41e833e963617cf5b2e463e839b2ae0bfd212ae..f544da86cb12d2786f7aad24953741ed
|
||||
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
|
||||
|
||||
// All children of MHTML documents must be MHTML documents. They all live in
|
||||
@@ -2266,10 +2276,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -2354,10 +2364,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
//
|
||||
// TODO(clamy): We should also consider as a candidate SiteInstance the
|
||||
// speculative SiteInstance that was computed on redirects.
|
||||
@@ -156,21 +156,20 @@ index e41e833e963617cf5b2e463e839b2ae0bfd212ae..f544da86cb12d2786f7aad24953741ed
|
||||
|
||||
// Account for renderer-initiated reload as well.
|
||||
// Needed as a workaround for https://crbug.com/1045524, remove it when it is
|
||||
@@ -2300,6 +2360,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->GetRestoreType() != RestoreType::NONE, request->is_view_source(),
|
||||
request->WasServerRedirect(), cross_origin_policy_swap);
|
||||
|
||||
@@ -2398,6 +2458,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->dest_site_instance() != dest_site_instance) {
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
|
||||
+ render_frame_host_.get(), dest_site_instance.get());
|
||||
+
|
||||
|
||||
return dest_site_instance;
|
||||
}
|
||||
|
||||
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
|
||||
index eb20d84de260b35049cac72fdc8d0645688fdd9a..eb3106ece80f3b347b7b13efbd77b11a60e03169 100644
|
||||
index 9dbc9bb7114e1dea5e8a24395f39bd9d068eeb76..31bddf69f2e805451d42d1a284a53f41bdaa5650 100644
|
||||
--- a/content/browser/site_instance_impl.cc
|
||||
+++ b/content/browser/site_instance_impl.cc
|
||||
@@ -427,6 +427,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
|
||||
@@ -426,6 +426,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
|
||||
return browsing_instance_->HasSiteInstance(url);
|
||||
}
|
||||
|
||||
@@ -194,10 +193,10 @@ index caa100b3889e17a9afdc8127e0e13bb6b86e8042..f08d3a2eb28f0f6fff89b5759eff5369
|
||||
size_t GetRelatedActiveContentsCount() override;
|
||||
bool RequiresDedicatedProcess() override;
|
||||
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
||||
index 930e043a0fdf40ef0e48a19597da567c8603878c..b6ba4dfad79d6031efd725de795bf901bab1a06c 100644
|
||||
index 0520b0b7d4144666b95dc2bfd25c0b0ae5892bfe..384812677668fb487cdfed2c7ad898e3591e1022 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -50,6 +50,21 @@
|
||||
@@ -58,6 +58,21 @@
|
||||
|
||||
namespace content {
|
||||
|
||||
@@ -220,10 +219,10 @@ index 930e043a0fdf40ef0e48a19597da567c8603878c..b6ba4dfad79d6031efd725de795bf901
|
||||
const MainFunctionParams& parameters) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index f9601b5813746ce930bb7082178e1f826aaeb62e..f94bc9e640b54c6abf05bfe074ae0635d57470e8 100644
|
||||
index 8ae9b370cf842a4c6d95d96d94f8b2d7a2122966..7da056827a8ed77de708b8a378dcdccf0c98bb1a 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -233,8 +233,45 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -231,8 +231,45 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
using IsClipboardPasteAllowedCallback =
|
||||
base::OnceCallback<void(ClipboardPasteAllowed)>;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ index f23af2d9738f3aa76e3a49301e1c3216ee4a64b4..ede178acabc63c3c33d6ce93efd5632b
|
||||
v8::Isolate* isolate() { return isolate_; }
|
||||
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 48bd647dcf7ecd121cd250bec1f7c2fc093a03fb..02468b82e0e304a76b9653c511ed0697dfd9b5f7 100644
|
||||
index 3a3742ed911cf49b6c93d02763d6eaa9554df62b..c53ea98d3897675c18c1eb8ad37dbce61110fa2e 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -190,12 +190,14 @@ enum LoadV8FileResult {
|
||||
|
||||
69
patches/chromium/gpu_notify_when_dxdiag_request_fails.patch
Normal file
69
patches/chromium/gpu_notify_when_dxdiag_request_fails.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Deepak Mohan <hop2deep@gmail.com>
|
||||
Date: Fri, 28 Feb 2020 15:08:26 -0800
|
||||
Subject: gpu: notify when dxdiag request for gpu info fails
|
||||
|
||||
We rely on the signal OnGpuInfoUpdate to process gpu info.
|
||||
When Electron wants to collect the complete info in a single run
|
||||
it checks for the presence of dx_diagnostics attribute, as these
|
||||
are the only async calls that happens in the gpu process, but
|
||||
there are times when this call can fail due to crash or software
|
||||
rendering and there is no signal from browser process on this event
|
||||
to identify it.
|
||||
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
|
||||
index bf76db245cb4a9de24500c74f415c5ab23c64ce4..2dbd8e485c5138101921972d632a67d934120c16 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl.cc
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
|
||||
@@ -146,6 +146,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
|
||||
base::AutoLock auto_lock(lock_);
|
||||
return private_->Dx12VulkanRequested();
|
||||
}
|
||||
+
|
||||
+bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const {
|
||||
+ base::AutoLock auto_lock(lock_);
|
||||
+ return private_->DxdiagDx12VulkanRequested();
|
||||
+}
|
||||
#endif
|
||||
|
||||
void GpuDataManagerImpl::UpdateGpuFeatureInfo(
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
|
||||
index 917b55d4dd0f2a5e8de8267d27f094e13b2935c1..934e52d29ac545e61945504576a421befe70d033 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl.h
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl.h
|
||||
@@ -87,6 +87,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
|
||||
void UpdateDxDiagNodeRequestStatus(bool request_continues);
|
||||
void UpdateDx12VulkanRequestStatus(bool request_continues);
|
||||
bool Dx12VulkanRequested() const;
|
||||
+ bool DxdiagDx12VulkanRequested() const;
|
||||
#endif
|
||||
// Update the GPU feature info. This updates the blacklist and enabled status
|
||||
// of GPU rasterization. In the future this will be used for more features.
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
index 3dfda3d93904d9eb323dae585404e7c4c46f84c2..5a76ff6f0b792e16a7ba1517ec2f91cb8755113f 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
@@ -890,6 +890,11 @@ void GpuDataManagerImplPrivate::UpdateDx12VulkanRequestStatus(
|
||||
bool GpuDataManagerImplPrivate::Dx12VulkanRequested() const {
|
||||
return gpu_info_dx12_vulkan_requested_;
|
||||
}
|
||||
+
|
||||
+bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const {
|
||||
+ return !(gpu_info_dx12_vulkan_request_failed_ ||
|
||||
+ gpu_info_dx_diag_request_failed_);
|
||||
+}
|
||||
#endif
|
||||
|
||||
void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo(
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
|
||||
index dc1f2a69a5ed25a1067c442528725864a53cd891..f617fef81a34499dcbcee2ac1cc9382fda8e8981 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
|
||||
@@ -70,6 +70,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
|
||||
void UpdateDx12VulkanRequestStatus(bool request_continues);
|
||||
void UpdateDxDiagNodeRequestStatus(bool request_continues);
|
||||
bool Dx12VulkanRequested() const;
|
||||
+ bool DxdiagDx12VulkanRequested() const;
|
||||
#endif
|
||||
void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info,
|
||||
const base::Optional<gpu::GpuFeatureInfo>&
|
||||
@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
|
||||
Add electron resources file to the list of resource ids generation.
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
|
||||
index cd531c9abd2da78f0edb718575ea219d8edd456e..9def0bb9dda87c476fdf3b52ce4d4125f37c7f49 100644
|
||||
index f8e27f6df77302a9af952493ebf946349466225e..9ca93ffa79d6fb8658d1d0f3581f91c229b737e0 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -579,6 +579,11 @@
|
||||
@@ -593,6 +593,11 @@
|
||||
"includes": [3860],
|
||||
},
|
||||
|
||||
|
||||
@@ -6,14 +6,15 @@ Subject: gtk_visibility.patch
|
||||
Allow electron to depend on GTK in the GN build.
|
||||
|
||||
diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn
|
||||
index a58b089869b7db19d0af81de7120c5af964efc2f..ca4d44ca2a659af9c2c2781c7e9bd4a6b8b70d6c 100644
|
||||
index 27cf4bb38f8d902927338e29e6e57c688eb77172..55a9dfe48421a8308acf945b2db5344e3a5173fb 100644
|
||||
--- a/build/config/linux/gtk/BUILD.gn
|
||||
+++ b/build/config/linux/gtk/BUILD.gn
|
||||
@@ -26,6 +26,7 @@ group("gtk") {
|
||||
@@ -24,6 +24,8 @@ group("gtk") {
|
||||
visibility = [
|
||||
"//chrome/test:interactive_ui_tests",
|
||||
"//chrome/test:unit_tests",
|
||||
# This is the only target in Chrome that should depend on GTK.
|
||||
"//chrome/browser/ui/gtk:*",
|
||||
+
|
||||
+ "//electron:*",
|
||||
|
||||
# These are all for WebRTC.
|
||||
"//examples:peerconnection_client",
|
||||
"//gpu/gles2_conform_support:gles2_conform_test_windowless",
|
||||
"//remoting/host/linux",
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Mon, 10 Feb 2020 11:52:23 -0800
|
||||
Subject: hack plugin response interceptor to point to electron
|
||||
|
||||
chrome's streams_private_api does prerender and other things and would
|
||||
require a largeish patch to get working, so just redirect it to our
|
||||
implementation instead.
|
||||
|
||||
diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
|
||||
index 1c9aeb8fa71d054159c2ccccccbe57aa474d417e..0bd6412f2c79f77f936720b1a0795b50ecefd26c 100644
|
||||
--- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
|
||||
+++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/guid.h"
|
||||
#include "base/task/post_task.h"
|
||||
-#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
|
||||
-#include "chrome/browser/plugins/plugin_utils.h"
|
||||
+#include "electron/shell/browser/extensions/api/streams_private/streams_private_api.h"
|
||||
+#include "electron/shell/browser/plugins/plugin_utils.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/download_utils.h"
|
||||
@@ -6,13 +6,13 @@ Subject: mas-cgdisplayusesforcetogray.patch
|
||||
Removes usage of the CGDisplayUsesForceToGray private API.
|
||||
|
||||
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
|
||||
index 43b5ae0c4fcbbaa3fc95ed15a9b02289e45c0cff..a743edce57b31b867afbc9676ac9c3e7475e5fe9 100644
|
||||
index de5994300fc405fe9e63f11023230f448f6109e9..78b880cd1064dc04fc9cd357d122e52179cdd90c 100644
|
||||
--- a/ui/display/mac/screen_mac.mm
|
||||
+++ b/ui/display/mac/screen_mac.mm
|
||||
@@ -107,7 +107,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
|
||||
|
||||
display.set_color_depth(Display::kDefaultBitsPerPixel);
|
||||
display.set_depth_per_component(Display::kDefaultBitsPerComponent);
|
||||
@@ -133,7 +133,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
|
||||
display.set_color_depth(Display::kDefaultBitsPerPixel);
|
||||
display.set_depth_per_component(Display::kDefaultBitsPerComponent);
|
||||
}
|
||||
+#ifdef MAS_BUILD
|
||||
+ // This is equivalent to the CGDisplayUsesForceToGray() API as at 2018-08-06,
|
||||
+ // but avoids usage of the private API.
|
||||
|
||||
@@ -7,7 +7,7 @@ Disable private window frame APIs (NSNextStepFrame and NSThemeFrame) for MAS
|
||||
build.
|
||||
|
||||
diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
index 1ffb647e85e00ff60d84234e47f5d7d385f65245..439cc6df5e0cc1ec3732d6f2a2e00d543c73e837 100644
|
||||
index cf88f696a46ff0ac84bcf466b44d1080438426c1..7672eee30a811001a0149edfa4eed9dc6a4b11f6 100644
|
||||
--- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
+++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -18,7 +18,7 @@ index 1ffb647e85e00ff60d84234e47f5d7d385f65245..439cc6df5e0cc1ec3732d6f2a2e00d54
|
||||
@interface NSWindow (PrivateBrowserNativeWidgetAPI)
|
||||
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle;
|
||||
@end
|
||||
@@ -69,10 +70,13 @@ - (NSRect)_draggableFrame NS_DEPRECATED_MAC(10_10, 10_11) {
|
||||
@@ -63,10 +64,13 @@ - (NSRect)_draggableFrame NS_DEPRECATED_MAC(10_10, 10_11) {
|
||||
|
||||
@end
|
||||
|
||||
@@ -32,7 +32,7 @@ index 1ffb647e85e00ff60d84234e47f5d7d385f65245..439cc6df5e0cc1ec3732d6f2a2e00d54
|
||||
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle {
|
||||
// - NSThemeFrame and its subclasses will be nil if it's missing at runtime.
|
||||
if ([BrowserWindowFrame class])
|
||||
@@ -87,6 +91,8 @@ - (BOOL)_usesCustomDrawing {
|
||||
@@ -81,6 +85,8 @@ - (BOOL)_usesCustomDrawing {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ index e03bbc724cfd01967e71998394361556df1c4915..783745b11365c04c1e1052197d20d494
|
||||
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
|
||||
// can only be accomplished by overriding methods.
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
index 9117bd3ab1f5a3d7cb26fe9b066424b8c2927377..9905e1c8914f852e250480797f43d17bf9d7f794 100644
|
||||
index c10c6633e7bc61cdc3ee41fc018786731177a948..09cc91eaab41e82165d550313579c9e1c8a8f158 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
@@ -14,7 +14,9 @@
|
||||
@@ -117,7 +117,7 @@ index 9117bd3ab1f5a3d7cb26fe9b066424b8c2927377..9905e1c8914f852e250480797f43d17b
|
||||
@implementation NativeWidgetMacNSWindowTitledFrame
|
||||
- (void)mouseDown:(NSEvent*)event {
|
||||
if (self.window.isMovable)
|
||||
@@ -77,6 +81,8 @@ - (BOOL)usesCustomDrawing {
|
||||
@@ -82,6 +86,8 @@ - (BOOL)usesCustomDrawing {
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -126,7 +126,7 @@ index 9117bd3ab1f5a3d7cb26fe9b066424b8c2927377..9905e1c8914f852e250480797f43d17b
|
||||
@implementation NativeWidgetMacNSWindow {
|
||||
@private
|
||||
base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
|
||||
@@ -158,6 +164,8 @@ - (BOOL)hasViewsMenuActive {
|
||||
@@ -163,6 +169,8 @@ - (BOOL)hasViewsMenuActive {
|
||||
|
||||
// NSWindow overrides.
|
||||
|
||||
@@ -135,7 +135,7 @@ index 9117bd3ab1f5a3d7cb26fe9b066424b8c2927377..9905e1c8914f852e250480797f43d17b
|
||||
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
if (windowStyle & NSWindowStyleMaskTitled) {
|
||||
if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
|
||||
@@ -169,6 +177,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
@@ -174,6 +182,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
return [super frameViewClassForStyleMask:windowStyle];
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ index a8e5c8888cb7ea8a85de7c8e8c613cc2b3c5be15..d01468fe77703b2812865b0198b84b0b
|
||||
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridgeOwner);
|
||||
};
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
index 1b1847cfd0dd0498da645e34cd5ab1b2bc87fc0c..da98761f0d8d4844f54f4558746649ecd4237065 100644
|
||||
index 83c74b6245981863546295b5ce405fe3770671b6..82bc8415235357bfe78f67492e3406884fc5ff8c 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
@@ -46,7 +46,9 @@ class ScopedPasswordInputEnabler;
|
||||
@@ -117,7 +117,7 @@ index 1b1847cfd0dd0498da645e34cd5ab1b2bc87fc0c..da98761f0d8d4844f54f4558746649ec
|
||||
// Used to force the NSApplication's focused accessibility element to be the
|
||||
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
|
||||
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 16b1a28bae2c7ac7647294b301d69dbc17780639..6e8d054ba55b927b08aeaee46676886220ef1045 100644
|
||||
index c8b9491aa61f0fccff6b83aaf6a77ec20c5606dc..7f638d6881d6934bcff85c88804e130677ea9711 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -231,8 +231,10 @@
|
||||
@@ -131,7 +131,7 @@ index 16b1a28bae2c7ac7647294b301d69dbc17780639..6e8d054ba55b927b08aeaee466768862
|
||||
|
||||
// Disconnect from the previous bridge (this will have the effect of
|
||||
// destroying the associated bridge), and close the receiver (to allow it
|
||||
@@ -1334,8 +1336,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1338,8 +1340,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
|
||||
gfx::NativeViewAccessible
|
||||
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
|
||||
@@ -142,7 +142,7 @@ index 16b1a28bae2c7ac7647294b301d69dbc17780639..6e8d054ba55b927b08aeaee466768862
|
||||
return [GetInProcessNSView() window];
|
||||
}
|
||||
|
||||
@@ -1367,9 +1371,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1371,9 +1375,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
|
||||
@@ -154,7 +154,7 @@ index 16b1a28bae2c7ac7647294b301d69dbc17780639..6e8d054ba55b927b08aeaee466768862
|
||||
}
|
||||
|
||||
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
|
||||
@@ -1852,12 +1858,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1856,12 +1862,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
|
||||
void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
|
||||
const std::vector<uint8_t>& window_token) {
|
||||
@@ -170,10 +170,10 @@ index 16b1a28bae2c7ac7647294b301d69dbc17780639..6e8d054ba55b927b08aeaee466768862
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
||||
index 7ec4b390a6c805868076177b02312352d825a553..ac544812b3f8197ae709cb93840f142e2f75daea 100644
|
||||
index 33b8a3bb7fae6941f0aa7af47aa048ac4a932b8f..49a7edc01183813d7411494a60c8dc1569961368 100644
|
||||
--- a/ui/base/BUILD.gn
|
||||
+++ b/ui/base/BUILD.gn
|
||||
@@ -304,6 +304,13 @@ jumbo_component("base") {
|
||||
@@ -299,6 +299,13 @@ jumbo_component("base") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ index 1c68117a8987463e810d0d1da5e7e598ce8fc3e1..ad29e87c00db0d34ee3a7d95469fb3fb
|
||||
// Used to force the NSApplication's focused accessibility element to be the
|
||||
// views::Views accessibility tree when the NSView for this is focused.
|
||||
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
||||
index d4209f169d3e468339371e661db6ae84ed20bbe3..7223e9c769904a0aa2ba082d99d597c775e66970 100644
|
||||
index 2256c365af5b1af79458fdcb0cb9d44c9ff641fd..f4949b071a177452b0074a2436669e9846558d1a 100644
|
||||
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
||||
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
|
||||
@@ -282,14 +282,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
@@ -262,7 +262,7 @@ index d4209f169d3e468339371e661db6ae84ed20bbe3..7223e9c769904a0aa2ba082d99d597c7
|
||||
}
|
||||
|
||||
remote_cocoa::mojom::NativeWidgetNSWindow*
|
||||
@@ -1133,6 +1141,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
@@ -1118,6 +1126,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
|
||||
const std::vector<uint8_t>& window_token,
|
||||
const std::vector<uint8_t>& view_token) {
|
||||
@@ -270,7 +270,7 @@ index d4209f169d3e468339371e661db6ae84ed20bbe3..7223e9c769904a0aa2ba082d99d597c7
|
||||
remote_window_accessible_ =
|
||||
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
|
||||
remote_view_accessible_ =
|
||||
@@ -1140,14 +1149,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
@@ -1125,14 +1134,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
|
||||
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
|
||||
[remote_view_accessible_
|
||||
setTopLevelUIElement:remote_window_accessible_.get()];
|
||||
|
||||
137
patches/chromium/mas_disable_remote_layer.patch
Normal file
137
patches/chromium/mas_disable_remote_layer.patch
Normal file
@@ -0,0 +1,137 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 20 Sep 2018 17:48:49 -0700
|
||||
Subject: mas_disable_remote_layer.patch
|
||||
|
||||
Disable remote layer APIs (CAContext and CALayerHost) for MAS build.
|
||||
|
||||
Accordin to ccameron:
|
||||
|
||||
For apps that spend a lot of time watching video (especially fullscreen video),
|
||||
the power/battery usage will likely increase 1.5x to 2x. For something that is,
|
||||
e.g, scrolling, it'll be smaller, more like 1.15x or 1.25x.
|
||||
|
||||
In terms of performance, the impact will likely be fairly small -- any app that
|
||||
could hit 60fps before will likely still be able to hit 60fps. There may even be
|
||||
cases where performance improves when disabling remote CoreAnimation (remote
|
||||
CoreAnimation is really only about battery usage).
|
||||
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
index a298747e3b755acd4f8d366d625142371ed1995e..9c9bdc53016637c6d6dbb27f3581b343ec96fb97 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
@@ -20,7 +20,9 @@
|
||||
#include "ui/gl/gl_surface_egl.h"
|
||||
#endif
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
@class CAContext;
|
||||
+#endif
|
||||
@class CALayer;
|
||||
|
||||
namespace ui {
|
||||
@@ -97,7 +99,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
|
||||
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
||||
|
||||
bool use_remote_layer_api_;
|
||||
+#ifndef MAS_BUILD
|
||||
base::scoped_nsobject<CAContext> ca_context_;
|
||||
+#endif
|
||||
std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_;
|
||||
|
||||
gfx::Size pixel_size_;
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
index eb46993b8f40fdc7da35dae1b850dad637f6b47d..05a9ae47620d17b5a53f991c0b3a0a5c153b599c 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -63,6 +63,7 @@
|
||||
template <typename BaseClass>
|
||||
bool ImageTransportSurfaceOverlayMacBase<BaseClass>::Initialize(
|
||||
gl::GLSurfaceFormat format) {
|
||||
+#ifndef MAS_BUILD
|
||||
// Create the CAContext to send this to the GPU process, and the layer for
|
||||
// the context.
|
||||
if (use_remote_layer_api_) {
|
||||
@@ -71,6 +72,7 @@
|
||||
[CAContext contextWithCGSConnection:connection_id options:@{}] retain]);
|
||||
[ca_context_ setLayer:ca_layer_tree_coordinator_->GetCALayerForDisplay()];
|
||||
}
|
||||
+#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -139,7 +141,9 @@
|
||||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
if (use_remote_layer_api_) {
|
||||
+#ifndef MAS_BUILD
|
||||
params.ca_layer_params.ca_context_id = [ca_context_ contextId];
|
||||
+#endif
|
||||
} else {
|
||||
IOSurfaceRef io_surface =
|
||||
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
|
||||
diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
index 38f25d6314f653d7138d30c67c5ae49963863327..f2fda251ed975bd848a49b33830d329fc8954826 100644
|
||||
--- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
+++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
|
||||
@@ -97,6 +97,7 @@ - (void)setContentsChanged;
|
||||
}
|
||||
|
||||
void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) {
|
||||
+#ifndef MAS_BUILD
|
||||
// Early-out if the remote layer has not changed.
|
||||
if ([remote_layer_ contextId] == ca_context_id)
|
||||
return;
|
||||
@@ -121,6 +122,9 @@ - (void)setContentsChanged;
|
||||
[io_surface_layer_ removeFromSuperlayer];
|
||||
io_surface_layer_.reset();
|
||||
}
|
||||
+#else
|
||||
+ NOTREACHED() << "Remote layer is being used in MAS build";
|
||||
+#endif
|
||||
}
|
||||
|
||||
void DisplayCALayerTree::GotIOSurfaceFrame(
|
||||
diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h
|
||||
index 2057fe69d1bb4a2eb0b1dabc5473a30d676847fe..2aba330fc488660ef874caae26a06e6847cdaf93 100644
|
||||
--- a/ui/base/cocoa/remote_layer_api.h
|
||||
+++ b/ui/base/cocoa/remote_layer_api.h
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "ui/base/ui_base_export.h"
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// The CGSConnectionID is used to create the CAContext in the process that is
|
||||
// going to share the CALayers that it is rendering to another process to
|
||||
// display.
|
||||
@@ -50,6 +51,8 @@ typedef uint32_t CAContextID;
|
||||
|
||||
#endif // __OBJC__
|
||||
|
||||
+#endif // MAS_BUILD
|
||||
+
|
||||
namespace ui {
|
||||
|
||||
// This function will check if all of the interfaces listed above are supported
|
||||
diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm
|
||||
index bbaf9f466f4999acb5bfccf3b9565fd8f556ca2f..8c846ce9523a4b2f6fbdbdbeae4f94b45ac3c115 100644
|
||||
--- a/ui/base/cocoa/remote_layer_api.mm
|
||||
+++ b/ui/base/cocoa/remote_layer_api.mm
|
||||
@@ -12,6 +12,7 @@
|
||||
namespace ui {
|
||||
|
||||
bool RemoteLayerAPISupported() {
|
||||
+#ifndef MAS_BUILD
|
||||
static bool disabled_at_command_line =
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kDisableRemoteCoreAnimation);
|
||||
@@ -46,6 +47,9 @@ bool RemoteLayerAPISupported() {
|
||||
|
||||
// If everything is there, we should be able to use the API.
|
||||
return true;
|
||||
+#else
|
||||
+ return false;
|
||||
+#endif // MAS_BUILD
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -7,10 +7,10 @@ Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be
|
||||
excluded for people who want to submit their apps to the Mac App store.
|
||||
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
index 9cc52238971a095421c3cde01a5df24a2f6f92cd..0216501dda1dc8b8fb4307785a0dab868bc3315a 100644
|
||||
index 5124b17f020849671a7f03d92bda052eff84d169..f9730f71c122965f7ce7815a1b9a7b32f8a224f0 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
@@ -109,7 +109,9 @@ struct AXTextEdit {
|
||||
@@ -112,7 +112,9 @@ struct AXTextEdit {
|
||||
@property(nonatomic, readonly) NSNumber* enabled;
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with Voiceover.
|
||||
@@ -20,7 +20,7 @@ index 9cc52238971a095421c3cde01a5df24a2f6f92cd..0216501dda1dc8b8fb4307785a0dab86
|
||||
@property(nonatomic, readonly) NSNumber* expanded;
|
||||
@property(nonatomic, readonly) NSNumber* focused;
|
||||
@property(nonatomic, readonly) NSNumber* grabbed;
|
||||
@@ -120,7 +122,9 @@ struct AXTextEdit {
|
||||
@@ -123,7 +125,9 @@ struct AXTextEdit {
|
||||
@property(nonatomic, readonly, getter=isIgnored) BOOL ignored;
|
||||
// Index of a row, column, or tree item.
|
||||
@property(nonatomic, readonly) NSNumber* index;
|
||||
@@ -30,7 +30,7 @@ index 9cc52238971a095421c3cde01a5df24a2f6f92cd..0216501dda1dc8b8fb4307785a0dab86
|
||||
@property(nonatomic, readonly) NSString* invalid;
|
||||
@property(nonatomic, readonly) NSNumber* isMultiSelectable;
|
||||
@property(nonatomic, readonly) NSString* placeholderValue;
|
||||
@@ -143,14 +147,18 @@ struct AXTextEdit {
|
||||
@@ -146,14 +150,18 @@ struct AXTextEdit {
|
||||
// The object is selected as a whole.
|
||||
@property(nonatomic, readonly) NSNumber* selected;
|
||||
@property(nonatomic, readonly) NSArray* selectedChildren;
|
||||
@@ -50,7 +50,7 @@ index 9cc52238971a095421c3cde01a5df24a2f6f92cd..0216501dda1dc8b8fb4307785a0dab86
|
||||
// is concerned.
|
||||
@property(nonatomic, readonly) NSString* subrole;
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e46166935012cad 100644
|
||||
index bd9fa917f7b5cabb5d2b21dfb9c8b427440ff067..bd573f2d0e39218f802f35e0e3bd4e5d5f902d3f 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
@@ -206,6 +206,7 @@
|
||||
@@ -124,7 +124,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
{NSAccessibilitySizeAttribute, @"size"},
|
||||
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
||||
{NSAccessibilitySubroleAttribute, @"subrole"},
|
||||
@@ -1309,6 +1321,7 @@ - (NSNumber*)enabled {
|
||||
@@ -1308,6 +1320,7 @@ - (NSNumber*)enabled {
|
||||
ax::mojom::Restriction::kDisabled];
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)endTextMarker {
|
||||
@@ -1319,6 +1332,7 @@ - (id)endTextMarker {
|
||||
@@ -1318,6 +1331,7 @@ - (id)endTextMarker {
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
|
||||
}
|
||||
@@ -140,7 +140,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
|
||||
- (NSNumber*)expanded {
|
||||
if (![self instanceActive])
|
||||
@@ -1468,6 +1482,8 @@ - (NSNumber*)index {
|
||||
@@ -1467,6 +1481,8 @@ - (NSNumber*)index {
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
- (NSNumber*)insertionPointLineNumber {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -1490,6 +1506,7 @@ - (NSNumber*)insertionPointLineNumber {
|
||||
@@ -1489,6 +1505,7 @@ - (NSNumber*)insertionPointLineNumber {
|
||||
caretPosition->AsTextPosition()->text_offset());
|
||||
return @(std::distance(lineBreaks.begin(), iterator));
|
||||
}
|
||||
@@ -157,7 +157,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
|
||||
// Returns whether or not this node should be ignored in the
|
||||
// accessibility tree.
|
||||
@@ -2163,6 +2180,7 @@ - (NSArray*)selectedChildren {
|
||||
@@ -2166,6 +2183,7 @@ - (NSArray*)selectedChildren {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
- (NSString*)selectedText {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2174,11 +2192,13 @@ - (NSString*)selectedText {
|
||||
@@ -2177,11 +2195,13 @@ - (NSString*)selectedText {
|
||||
return nil;
|
||||
return base::SysUTF16ToNSString(range.GetText());
|
||||
}
|
||||
@@ -179,7 +179,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
- (NSValue*)selectedTextRange {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2199,12 +2219,15 @@ - (NSValue*)selectedTextRange {
|
||||
@@ -2202,12 +2222,15 @@ - (NSValue*)selectedTextRange {
|
||||
int selLength = range.GetText().length();
|
||||
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
||||
}
|
||||
@@ -195,7 +195,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
|
||||
- (NSValue*)size {
|
||||
if (![self instanceActive])
|
||||
@@ -2237,6 +2260,7 @@ - (NSString*)sortDirection {
|
||||
@@ -2240,6 +2263,7 @@ - (NSString*)sortDirection {
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
// Returns a text marker that points to the first character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)startTextMarker {
|
||||
@@ -2247,6 +2271,7 @@ - (id)startTextMarker {
|
||||
@@ -2250,6 +2274,7 @@ - (id)startTextMarker {
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
|
||||
}
|
||||
@@ -211,7 +211,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
|
||||
// Returns a subrole based upon the role.
|
||||
- (NSString*)subrole {
|
||||
@@ -2554,11 +2579,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
@@ -2570,11 +2595,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
NSMutableAttributedString* attributedValue =
|
||||
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
|
||||
|
||||
@@ -225,7 +225,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
|
||||
return [attributedValue attributedSubstringFromRange:range];
|
||||
}
|
||||
@@ -2661,9 +2688,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -2677,9 +2704,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return ToBrowserAccessibilityCocoa(cell);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
BrowserAccessibilityPositionInstance position =
|
||||
CreatePositionFromTextMarker(parameter);
|
||||
if (!position->IsNullPosition())
|
||||
@@ -2974,6 +3000,7 @@ AXPlatformRange range(std::move(lineStartPosition),
|
||||
@@ -2990,6 +3016,7 @@ AXPlatformRange range(std::move(lineStartPosition),
|
||||
|
||||
return CreateTextMarker(root->CreatePositionAt(index));
|
||||
}
|
||||
@@ -245,7 +245,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
|
||||
if ([attribute isEqualToString:
|
||||
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
||||
@@ -3007,6 +3034,7 @@ AXPlatformRange range(std::move(lineStartPosition),
|
||||
@@ -3025,6 +3052,7 @@ AXPlatformRange range(std::move(lineStartPosition),
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
if ([attribute
|
||||
isEqualToString:
|
||||
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
||||
@@ -3121,6 +3149,7 @@ AXPlatformRange range(std::move(lineStartPosition),
|
||||
@@ -3139,6 +3167,7 @@ AXPlatformRange range(std::move(lineStartPosition),
|
||||
|
||||
return @(child->GetIndexInParent());
|
||||
}
|
||||
@@ -262,7 +262,7 @@ index fed745716ad3d0d9152c20353372c34740c097e4..1381a64458dd37d07c72c3265e461669
|
||||
return nil;
|
||||
}
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index d7f4f9364441aed3eda1e0b22e646f04182b6965..48408ca844ed3e7080410fc780764e8748ac2341 100644
|
||||
index 292d3ed82bf5cc6fdfbda2b05fb211afff5f0b69..5bdacb75ddafd56901d298993d71d772f0f51c0d 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -531,6 +531,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
||||
@@ -358,10 +358,10 @@ index 7c018cce2c2d9981c94e91e5d97cff0d37548b13..cfb0fb20c81f908caac9933b820e40e0
|
||||
|
||||
void BluetoothAdapterMac::RemovePairingDelegateInternal(
|
||||
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
|
||||
index 32c78e9f533782e1cfca44217a8a831959bba5e6..655bcfb43e49440ce341b11013d0620b8c2354ce 100644
|
||||
index a86080cf72d23cc6004547dfaad0e4ae65a60412..230954f574802a9692c723190cba3c8325ce1ad1 100644
|
||||
--- a/media/audio/BUILD.gn
|
||||
+++ b/media/audio/BUILD.gn
|
||||
@@ -171,6 +171,12 @@ source_set("audio") {
|
||||
@@ -173,6 +173,12 @@ source_set("audio") {
|
||||
"mac/scoped_audio_unit.cc",
|
||||
"mac/scoped_audio_unit.h",
|
||||
]
|
||||
@@ -388,7 +388,7 @@ index 26436b47942b14e419adb5780c45a9d42224d39f..215abac9672f72aeef7694e97ff260ae
|
||||
}
|
||||
|
||||
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
||||
index 2e0f06b0c1e4b1670bfe8145b3c5abb178b47d62..2f9483283a789a69d7e85536620daa2e35ee9155 100644
|
||||
index eaa5336c3391a2babf133109805218e7253ea8ff..e64e93d602265133549b7c86605a8998e09f530e 100644
|
||||
--- a/net/dns/dns_config_service_posix.cc
|
||||
+++ b/net/dns/dns_config_service_posix.cc
|
||||
@@ -246,6 +246,7 @@ class DnsConfigServicePosix::Watcher {
|
||||
@@ -396,8 +396,8 @@ index 2e0f06b0c1e4b1670bfe8145b3c5abb178b47d62..2f9483283a789a69d7e85536620daa2e
|
||||
bool Watch() {
|
||||
bool success = true;
|
||||
+#ifndef MAS_BUILD
|
||||
if (!config_watcher_.Watch(base::Bind(&Watcher::OnConfigChanged,
|
||||
base::Unretained(this)))) {
|
||||
if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
|
||||
base::Unretained(this)))) {
|
||||
LOG(ERROR) << "DNS config watch failed to start.";
|
||||
@@ -267,6 +268,7 @@ class DnsConfigServicePosix::Watcher {
|
||||
DNS_CONFIG_WATCH_MAX);
|
||||
|
||||
@@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement
|
||||
session.setCertificateVerifyCallback.
|
||||
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f4c3b158d 100644
|
||||
index 05bd6dc34b94bff0cfa828692e50e01a80a5759d..04463f777467a9f3ff6a9959d490d79c2e472c69 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -95,6 +95,11 @@
|
||||
@@ -99,6 +99,11 @@
|
||||
#include "services/network/url_loader.h"
|
||||
#include "services/network/url_request_context_builder_mojo.h"
|
||||
|
||||
@@ -22,7 +22,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
|
||||
#if BUILDFLAG(IS_CT_SUPPORTED)
|
||||
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
|
||||
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
|
||||
@@ -330,6 +335,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
|
||||
@@ -355,6 +360,79 @@ bool UsingBuiltinCertVerifier(
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -102,7 +102,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
|
||||
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
|
||||
|
||||
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
|
||||
@@ -516,6 +594,13 @@ void NetworkContext::SetClient(
|
||||
@@ -523,6 +601,13 @@ void NetworkContext::SetClient(
|
||||
client_.Bind(std::move(client));
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
|
||||
void NetworkContext::CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) {
|
||||
@@ -1661,6 +1746,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -1686,6 +1771,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
|
||||
base::CommandLine::ForCurrentProcess();
|
||||
|
||||
std::unique_ptr<net::CertVerifier> cert_verifier;
|
||||
@@ -124,7 +124,7 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
|
||||
if (g_cert_verifier_for_testing) {
|
||||
cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
|
||||
} else {
|
||||
@@ -1714,8 +1800,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -1734,8 +1820,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
|
||||
}
|
||||
#endif
|
||||
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
|
||||
@@ -134,8 +134,8 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
|
||||
+ temp_verifier = std::make_unique<net::CachingCertVerifier>(
|
||||
std::make_unique<net::CoalescingCertVerifier>(
|
||||
std::make_unique<net::MultiThreadedCertVerifier>(
|
||||
params_->use_builtin_cert_verifier
|
||||
@@ -1725,12 +1811,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
UsingBuiltinCertVerifier(params_->use_builtin_cert_verifier)
|
||||
@@ -1745,12 +1831,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
|
||||
cert_net_fetcher_))));
|
||||
}
|
||||
#endif
|
||||
@@ -160,10 +160,10 @@ index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f
|
||||
std::unique_ptr<NetworkServiceNetworkDelegate> network_delegate =
|
||||
std::make_unique<NetworkServiceNetworkDelegate>(
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210be5911e4 100644
|
||||
index 8e52d22f5775fa727dd67e98bcf89caf5cfcd22e..2cc0dc76a55026dea5db962df8c79bf85754912d 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -87,6 +87,7 @@ class DomainReliabilityMonitor;
|
||||
@@ -84,6 +84,7 @@ class DomainReliabilityMonitor;
|
||||
|
||||
namespace network {
|
||||
class CertVerifierWithTrustAnchors;
|
||||
@@ -171,7 +171,7 @@ index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210
|
||||
class CookieManager;
|
||||
class ExpectCTReporter;
|
||||
class HostResolver;
|
||||
@@ -184,6 +185,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -186,6 +187,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) override;
|
||||
@@ -180,7 +180,7 @@ index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210
|
||||
void ResetURLLoaderFactories() override;
|
||||
void GetCookieManager(
|
||||
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
|
||||
@@ -621,6 +624,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -653,6 +656,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
|
||||
#endif
|
||||
|
||||
@@ -190,10 +190,10 @@ index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210
|
||||
// CertNetFetcher is not used by the current platform.
|
||||
scoped_refptr<net::CertNetFetcherURLRequest> cert_net_fetcher_;
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index c37e71fb1eac0c568f91676eddcd624f491a7b69..6adfd8969148daba3f77aea4c5f89adec6338e6b 100644
|
||||
index b74677de805cc6f46c34b79883e0500ba337d82a..1d9ffd3de180e3256fb63a497544feeb427ae7ff 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -191,6 +191,17 @@ struct HttpAuthStaticNetworkContextParams {
|
||||
@@ -193,6 +193,17 @@ struct HttpAuthStaticNetworkContextParams {
|
||||
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
|
||||
};
|
||||
|
||||
@@ -211,7 +211,7 @@ index c37e71fb1eac0c568f91676eddcd624f491a7b69..6adfd8969148daba3f77aea4c5f89ade
|
||||
// Parameters for constructing a network context.
|
||||
struct NetworkContextParams {
|
||||
// Name used by memory tools to identify the context.
|
||||
@@ -813,6 +824,9 @@ interface NetworkContext {
|
||||
@@ -845,6 +856,9 @@ interface NetworkContext {
|
||||
// Sets a client for this network context.
|
||||
SetClient(pending_remote<NetworkContextClient> client);
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ Do not check for unique origin in CacheStorage, in Electron we may have
|
||||
scripts running without an origin.
|
||||
|
||||
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.cc b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
|
||||
index a2c9bc873ae4def01bc31a5b4a280a799b241213..3cb71674bc5a000bca1e3473cf7ad6b8437ab507 100644
|
||||
index 0abdf04f5fa016d7ee8241eab60375944fe8fe62..95f62ba41bd28c08364c5f13927bc90c4567f88b 100644
|
||||
--- a/content/browser/cache_storage/legacy/legacy_cache_storage.cc
|
||||
+++ b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
|
||||
@@ -106,7 +106,7 @@ class LegacyCacheStorage::CacheLoader {
|
||||
@@ -107,7 +107,7 @@ class LegacyCacheStorage::CacheLoader {
|
||||
cache_storage_(cache_storage),
|
||||
origin_(origin),
|
||||
owner_(owner) {
|
||||
|
||||
@@ -68,10 +68,10 @@ index 619ad99bb52d489826d1e442a7719d985f0696ec..f7c9d3cac66879ce2be06a7a27ea96bf
|
||||
notification_service_remote_.BindNewPipeAndPassReceiver());
|
||||
|
||||
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
index d68765bcd17e93cdbad875311375153133ee45d9..cefaac6dded65e57dced955ae9bfa2ff65bc4e66 100644
|
||||
index 2d76a71e57eade4f5fc01ff45a587ee9466baee0..62c0bb383813f07ef3a6d47988223f8c9e2788b0 100644
|
||||
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
||||
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
@@ -208,12 +208,13 @@ void PlatformNotificationContextImpl::Shutdown() {
|
||||
@@ -209,12 +209,13 @@ void PlatformNotificationContextImpl::Shutdown() {
|
||||
}
|
||||
|
||||
void PlatformNotificationContextImpl::CreateService(
|
||||
@@ -108,10 +108,10 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
|
||||
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 5c07cb506115cdc846952d9b8e1061b6de6042d0..baf9e4ed20a41b9c1320ec6fbae290319e8e05e5 100644
|
||||
index 22ff7354f692993b58d0a5b6b28f30f694a39d0b..60d0aab5416cb237c6de5013a6724fdb95a5422e 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2033,7 +2033,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2082,7 +2082,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
|
||||
@@ -6,6 +6,34 @@ Subject: pepper plugin support
|
||||
This tweaks Chrome's pepper flash and PDF plugin support to make it
|
||||
usable from Electron.
|
||||
|
||||
diff --git a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc
|
||||
index 2e328c0fb5a6598c3ae911655b3e5016a02b7405..304364f7e02c19d2ad7d16433e92dcfecfc8eb41 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc
|
||||
+++ b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h"
|
||||
#include "chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h"
|
||||
#include "content/public/browser/browser_ppapi_host.h"
|
||||
+#include "electron/buildflags/buildflags.h"
|
||||
#include "ppapi/host/message_filter_host.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "ppapi/host/resource_host.h"
|
||||
@@ -52,6 +53,7 @@ ChromeBrowserPepperHostFactory::CreateResourceHost(
|
||||
}
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_PEPPER_FLASH)
|
||||
// Flash interfaces.
|
||||
if (host_->GetPpapiHost()->permissions().HasPermission(
|
||||
ppapi::PERMISSION_FLASH)) {
|
||||
@@ -70,6 +72,7 @@ ChromeBrowserPepperHostFactory::CreateResourceHost(
|
||||
new PepperFlashDRMHost(host_, instance, resource));
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Permissions for the following interfaces will be checked at the
|
||||
// time of the corresponding instance's methods calls (because
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
|
||||
index d72a867594acee97d50c5f905fc1a4df9aa9352e..8a4cc159cb490ebadbb1b54aa88223c0cbf8ffdb 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
|
||||
@@ -384,7 +412,7 @@ index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec
|
||||
DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
|
||||
};
|
||||
diff --git a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..f1d4503d1f72df67ffcc73000a8a2ad3e2c93327 100644
|
||||
index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..ec8c1e7cfbaec3e0876325e6b9ebb01581988bee 100644
|
||||
--- a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
+++ b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
@@ -10,8 +10,13 @@
|
||||
@@ -401,15 +429,45 @@ index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..f1d4503d1f72df67ffcc73000a8a2ad3
|
||||
#include "content/public/renderer/renderer_ppapi_host.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "ppapi/host/resource_host.h"
|
||||
@@ -86,6 +91,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
@@ -39,6 +44,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
if (!host_->IsValidInstance(instance))
|
||||
return nullptr;
|
||||
|
||||
+#if BUILDFLAG(ENABLE_PEPPER_FLASH)
|
||||
if (host_->GetPpapiHost()->permissions().HasPermission(
|
||||
ppapi::PERMISSION_FLASH)) {
|
||||
switch (message.type()) {
|
||||
@@ -61,10 +67,12 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
// TODO(raymes): PDF also needs access to the FlashFontFileHost currently.
|
||||
// We should either rename PPB_FlashFont_File to PPB_FontFile_Private or get
|
||||
// rid of its use in PDF if possible.
|
||||
+#if BUILDFLAG(ENABLE_PEPPER_FLASH) || BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
if (host_->GetPpapiHost()->permissions().HasPermission(
|
||||
ppapi::PERMISSION_FLASH) ||
|
||||
host_->GetPpapiHost()->permissions().HasPermission(
|
||||
@@ -80,12 +88,16 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
}
|
||||
break;
|
||||
}
|
||||
+#if BUILDFLAG(ENABLE_PEPPER_FLASH)
|
||||
case PpapiHostMsg_FlashDRM_Create::ID:
|
||||
return std::make_unique<PepperFlashDRMRendererHost>(host_, instance,
|
||||
resource);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
+#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
if (host_->GetPpapiHost()->permissions().HasPermission(
|
||||
ppapi::PERMISSION_PDF)) {
|
||||
switch (message.type()) {
|
||||
@@ -94,7 +100,9 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
@@ -94,7 +106,9 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -419,7 +477,7 @@ index d63e90b6c5079ab3237c4bad3d5e63ce2f99c657..f1d4503d1f72df67ffcc73000a8a2ad3
|
||||
// Permissions for the following interfaces will be checked at the
|
||||
// time of the corresponding instance's method calls. Currently these
|
||||
// interfaces are available only for whitelisted apps which may not have
|
||||
@@ -104,6 +112,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
@@ -104,6 +118,7 @@ ChromeRendererPepperHostFactory::CreateResourceHost(
|
||||
return std::make_unique<PepperUMAHost>(host_, instance, resource);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ index e9b64a823ae7e25361f37190d247af0fa6a6f68a..43fdb0ad50d2b11a1bc28aa0f358c6dd
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/color_palette.h"
|
||||
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
index 02c05417bf3a2b6ca1bfc839d76262b97e9b2d69..3ac71544700f517b4c7397fa7a838ca8d778d2b1 100644
|
||||
index 4af5ead7df57e26ceb64ab909c4dc2de86ccfc41..294e6c08975fae62ca8dbe9e471f39a5adbf03e3 100644
|
||||
--- a/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
@@ -8,7 +8,7 @@ this patch removes that dependency so we can reuse it.
|
||||
Ideally we would change this class in upstream to not depend on Profile.
|
||||
|
||||
diff --git a/chrome/browser/predictors/preconnect_manager.cc b/chrome/browser/predictors/preconnect_manager.cc
|
||||
index 6f6539689a2d57d6dcedb04e23c00fb1fce482c5..03790f759a472bade4e201177d0f393ba645bfac 100644
|
||||
index 50adee35887f799fea11a35eca1240851a0d1126..9935e068983de3342382f73889be41acc3fe8f4e 100644
|
||||
--- a/chrome/browser/predictors/preconnect_manager.cc
|
||||
+++ b/chrome/browser/predictors/preconnect_manager.cc
|
||||
@@ -69,7 +69,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default;
|
||||
@@ -20,7 +20,7 @@ index 6f6539689a2d57d6dcedb04e23c00fb1fce482c5..03790f759a472bade4e201177d0f393b
|
||||
: delegate_(std::move(delegate)),
|
||||
profile_(profile),
|
||||
inflight_preresolves_count_(0) {
|
||||
@@ -327,11 +327,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const {
|
||||
@@ -328,11 +328,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const {
|
||||
if (network_context_)
|
||||
return network_context_;
|
||||
|
||||
@@ -35,7 +35,7 @@ index 6f6539689a2d57d6dcedb04e23c00fb1fce482c5..03790f759a472bade4e201177d0f393b
|
||||
return content::BrowserContext::GetDefaultStoragePartition(profile_)
|
||||
->GetNetworkContext();
|
||||
diff --git a/chrome/browser/predictors/preconnect_manager.h b/chrome/browser/predictors/preconnect_manager.h
|
||||
index 9c0efc9d04b9825786d22a56ab39fb80f65f59cb..d587722d4a2ff6416bab060bdc716b3051a4753b 100644
|
||||
index 7c99f4543095f600a5a7705846bc01f5656a9c8d..bbd62bccef6a3c5013c5f3ee4f24443835728d44 100644
|
||||
--- a/chrome/browser/predictors/preconnect_manager.h
|
||||
+++ b/chrome/browser/predictors/preconnect_manager.h
|
||||
@@ -22,6 +22,10 @@
|
||||
@@ -66,4 +66,4 @@ index 9c0efc9d04b9825786d22a56ab39fb80f65f59cb..d587722d4a2ff6416bab060bdc716b30
|
||||
+ content::BrowserContext* const profile_;
|
||||
std::list<PreresolveJobId> queued_jobs_;
|
||||
PreresolveJobMap preresolve_jobs_;
|
||||
std::map<std::string, std::unique_ptr<PreresolveInfo>> preresolve_info_;
|
||||
std::map<GURL, std::unique_ptr<PreresolveInfo>> preresolve_info_;
|
||||
|
||||
@@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
|
||||
This patch also fixes callback for manual user cancellation and success.
|
||||
|
||||
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
|
||||
index ebffdb08d080eceb0ea9e96ee3ca7db627cfaf5e..bc00a7a00626cee17e5f5ea976f8248f71e06505 100644
|
||||
index 33e17f0df3563726767d912fb828ab959c8ec252..780967949746cbe957cd7b3487507892b3df607c 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -21,7 +21,6 @@
|
||||
@@ -30,7 +30,7 @@ index ebffdb08d080eceb0ea9e96ee3ca7db627cfaf5e..bc00a7a00626cee17e5f5ea976f8248f
|
||||
#include "printing/print_job_constants.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printing_utils.h"
|
||||
@@ -221,9 +221,14 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
@@ -222,9 +222,14 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
print_backend->GetPrinterDriverInfo(printer_name));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ index ebffdb08d080eceb0ea9e96ee3ca7db627cfaf5e..bc00a7a00626cee17e5f5ea976f8248f
|
||||
}
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -239,6 +244,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
@@ -240,6 +245,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
|
||||
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
|
||||
PrintingContext::Result result) {
|
||||
@@ -63,7 +63,7 @@ index ebffdb08d080eceb0ea9e96ee3ca7db627cfaf5e..bc00a7a00626cee17e5f5ea976f8248f
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac921170345f86b8d0 100644
|
||||
index f008ef9a25feda763d7a5a169aae0f47bf2dc347..b3dd9836e452947c21aa404d1c24ac10a66474ab 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -27,10 +27,7 @@
|
||||
@@ -85,7 +85,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
#include "mojo/public/cpp/system/buffer.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/metafile_skia.h"
|
||||
@@ -64,6 +62,8 @@ using PrintSettingsCallback =
|
||||
@@ -68,6 +66,8 @@ using PrintSettingsCallback =
|
||||
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
|
||||
|
||||
void ShowWarningMessageBox(const base::string16& message) {
|
||||
@@ -94,7 +94,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
// Runs always on the UI thread.
|
||||
static bool is_dialog_shown = false;
|
||||
if (is_dialog_shown)
|
||||
@@ -72,6 +72,7 @@ void ShowWarningMessageBox(const base::string16& message) {
|
||||
@@ -76,6 +76,7 @@ void ShowWarningMessageBox(const base::string16& message) {
|
||||
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
|
||||
|
||||
chrome::ShowWarningMessageBox(nullptr, base::string16(), message);
|
||||
@@ -102,7 +102,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -110,12 +111,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
@@ -114,12 +115,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
printing_succeeded_(false),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_);
|
||||
@@ -117,7 +117,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -123,7 +126,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -127,7 +130,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
DisconnectFromCurrentPrintJob();
|
||||
|
||||
// Don't print / print preview interstitials or crashed tabs.
|
||||
@@ -131,7 +137,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -135,7 +141,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
return false;
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
@@ -145,7 +145,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -250,9 +263,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
|
||||
@@ -256,9 +269,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
|
||||
void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
// The Unretained() is safe because ForEachFrame() is synchronous.
|
||||
@@ -158,7 +158,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -355,7 +368,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
|
||||
@@ -361,7 +374,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
|
||||
PrintManager::OnPrintingFailed(cookie);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -167,7 +167,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -455,9 +468,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
@@ -461,9 +474,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
content::NotificationService::NoDetails());
|
||||
break;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
@@ -552,8 +569,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -558,8 +575,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
DCHECK(!quit_inner_loop_);
|
||||
DCHECK(query);
|
||||
|
||||
@@ -196,7 +196,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
|
||||
// We can't print if there is no renderer.
|
||||
if (!web_contents()->GetRenderViewHost() ||
|
||||
@@ -568,8 +587,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -574,8 +593,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
print_job_->SetSource(PrintJob::Source::PRINT_PREVIEW, /*source_id=*/"");
|
||||
#endif // defined(OS_CHROMEOS)
|
||||
|
||||
@@ -205,7 +205,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
printing_succeeded_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -618,14 +635,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -624,14 +641,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
@@ -230,7 +230,7 @@ index 155d86fe79b99989c3f604aeaab13782f8e6631c..f801bb8010240bc9ddb35cac92117034
|
||||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -661,7 +686,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -667,7 +692,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
@@ -406,18 +406,18 @@ index 3695656560c54b5aa1fb08fb5e7c17d54989c597..85ffa5704d8dea809e80b1993c7c852f
|
||||
// Tells the RenderFrame to switch the CSS to print media type, render every
|
||||
// requested page using the print preview document's frame/node, and then
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095ca67c9472 100644
|
||||
index 12268c0ca1b7ecdeb4a856c7c607d875f50bb7c3..16a9bdfb8c482356e357707ba4e8d846b5e4c0f3 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "net/base/escape.h"
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/metafile_skia.h"
|
||||
#include "printing/printing_features.h"
|
||||
+#include "printing/print_settings.h"
|
||||
#include "printing/units.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
||||
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
|
||||
@@ -1120,7 +1121,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1136,7 +1137,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
web_frame->DispatchBeforePrintEvent();
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -427,7 +427,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
if (weak_this)
|
||||
web_frame->DispatchAfterPrintEvent();
|
||||
}
|
||||
@@ -1141,7 +1143,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1157,7 +1159,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
@@ -1155,7 +1157,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
@@ -1171,7 +1173,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// If we are printing a PDF extension frame, find the plugin node and print
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
@@ -445,7 +445,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1172,7 +1174,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1188,7 +1190,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
return;
|
||||
}
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
@@ -454,7 +454,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1212,6 +1214,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
@@ -1228,6 +1230,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -463,7 +463,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
base::UmaHistogramEnumeration(print_preview_context_.IsForArc()
|
||||
@@ -1569,13 +1573,13 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() {
|
||||
@@ -1585,13 +1589,13 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() {
|
||||
print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_CAPTURE_FAILED);
|
||||
return false;
|
||||
}
|
||||
@@ -484,7 +484,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
}
|
||||
|
||||
preview_params.document_cookie = print_pages_params_->params.document_cookie;
|
||||
@@ -1710,7 +1714,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1726,7 +1730,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
@@ -495,7 +495,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1721,7 +1727,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1737,7 +1743,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -506,7 +506,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1729,7 +1737,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1745,7 +1753,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
int expected_page_count = 0;
|
||||
@@ -515,7 +515,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1749,8 +1757,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1765,8 +1773,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
|
||||
PrintMsg_PrintPages_Params print_settings;
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -529,7 +529,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1984,10 +1995,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2001,10 +2012,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
// Check if the printer returned any settings, if the settings is empty, we
|
||||
// can safely assume there are no printer drivers configured. So we safely
|
||||
// terminate.
|
||||
@@ -2007,12 +2031,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
@@ -2024,12 +2048,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -576,10 +576,10 @@ index 17c865379c303aa65e134e850c4f7cffe18c410c..c50980a7d38b1110e8f3e7c177c4095c
|
||||
Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
|
||||
return false;
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index 51cfabd4dbeaa63538f4483c7a1948afaa665de1..0850b96b7511c494692a24026734d7574a390974 100644
|
||||
index 7b23fdb789562ff05290819d3d48b8f382183d86..8d21b11abb3a3c09569eb661aa3167400d37aa82 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -222,7 +222,7 @@ class PrintRenderFrameHelper
|
||||
@@ -226,7 +226,7 @@ class PrintRenderFrameHelper
|
||||
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
|
||||
|
||||
// printing::mojom::PrintRenderFrame:
|
||||
@@ -588,7 +588,7 @@ index 51cfabd4dbeaa63538f4483c7a1948afaa665de1..0850b96b7511c494692a24026734d757
|
||||
void PrintForSystemDialog() override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void InitiatePrintPreview(
|
||||
@@ -286,7 +286,9 @@ class PrintRenderFrameHelper
|
||||
@@ -290,7 +290,9 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
void Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -599,7 +599,7 @@ index 51cfabd4dbeaa63538f4483c7a1948afaa665de1..0850b96b7511c494692a24026734d757
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -295,12 +297,14 @@ class PrintRenderFrameHelper
|
||||
@@ -299,12 +301,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
|
||||
@@ -8,39 +8,39 @@ needed in chromium but our autofill implementation uses them. This patch can be
|
||||
our autofill implementation to work like Chromium's.
|
||||
|
||||
diff --git a/chrome/browser/ui/gtk/native_theme_gtk.cc b/chrome/browser/ui/gtk/native_theme_gtk.cc
|
||||
index 26f1842494bdbcf5ffefb07e8fc74ba816a2a2d8..8ef9c27728a5b3166732d753d582e30a015cc0a6 100644
|
||||
index 0b035ec92d0df57e36be7ef5dd18baf9395b0dca..daf4f524a401c752cddfd9919b36516214fcd180 100644
|
||||
--- a/chrome/browser/ui/gtk/native_theme_gtk.cc
|
||||
+++ b/chrome/browser/ui/gtk/native_theme_gtk.cc
|
||||
@@ -301,6 +301,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
|
||||
@@ -341,6 +341,27 @@ base::Optional<SkColor> SkColorFromColorId(
|
||||
case ui::NativeTheme::kColorId_TableHeaderSeparator:
|
||||
return GetBorderColor("GtkTreeView#treeview.view GtkButton#button");
|
||||
|
||||
+ // Results Table
|
||||
+ case ui::NativeTheme::kColorId_ResultsTableNormalBackground:
|
||||
+ return SkColorFromColorId(
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground);
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground, base_theme, color_scheme);
|
||||
+ case ui::NativeTheme::kColorId_ResultsTableHoveredBackground:
|
||||
+ return color_utils::AlphaBlend(
|
||||
+ SkColorFromColorId(
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground),
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground, base_theme, color_scheme).value(),
|
||||
+ SkColorFromColorId(
|
||||
+ ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused),
|
||||
+ ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused, base_theme, color_scheme).value(),
|
||||
+ 0.5f);
|
||||
+ case ui::NativeTheme::kColorId_ResultsTableNormalText:
|
||||
+ return SkColorFromColorId(
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultColor);
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultColor, base_theme, color_scheme);
|
||||
+ case ui::NativeTheme::kColorId_ResultsTableDimmedText:
|
||||
+ return color_utils::AlphaBlend(
|
||||
+ SkColorFromColorId(ui::NativeTheme::kColorId_TextfieldDefaultColor),
|
||||
+ SkColorFromColorId(ui::NativeTheme::kColorId_TextfieldDefaultColor, base_theme, color_scheme).value(),
|
||||
+ SkColorFromColorId(
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground),
|
||||
+ ui::NativeTheme::kColorId_TextfieldDefaultBackground, base_theme, color_scheme).value(),
|
||||
+ 0.5f);
|
||||
+
|
||||
// Throbber
|
||||
// TODO(thomasanderson): Render GtkSpinner directly.
|
||||
case ui::NativeTheme::kColorId_ThrobberSpinningColor:
|
||||
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
|
||||
index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c1c86ee3a 100644
|
||||
index baa857e8655977fa524621c63e3382fadd3a6d9e..c629cec16ef9db7ebb28c4a15ea4741d8ddc4fd7 100644
|
||||
--- a/ui/native_theme/common_theme.cc
|
||||
+++ b/ui/native_theme/common_theme.cc
|
||||
@@ -59,6 +59,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
@@ -58,7 +58,7 @@ index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c
|
||||
// FocusableBorder
|
||||
case NativeTheme::kColorId_FocusedBorderColor:
|
||||
return SkColorSetA(gfx::kGoogleBlue300, 0x4D);
|
||||
@@ -401,6 +409,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
@@ -460,6 +468,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
|
||||
case NativeTheme::kColorId_UnfocusedBorderColor:
|
||||
return gfx::kGoogleGrey300;
|
||||
|
||||
@@ -78,26 +78,26 @@ index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c
|
||||
case NativeTheme::kColorId_ThrobberSpinningColor:
|
||||
return gfx::kGoogleBlue600;
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index 0c26cce0cb14bd9e87c3a095116501bf0c1803e4..782dd1d122bfab4990c924a7fb0e7276fb51b18b 100644
|
||||
index edd042cfe327810c120c4b446c043761c0d21b9f..d0fb56734a9cb102c7c709873a4ec07a3af6b2e8 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -409,6 +409,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
kColorId_TableHeaderText,
|
||||
kColorId_TableHeaderBackground,
|
||||
kColorId_TableHeaderSeparator,
|
||||
@@ -324,6 +324,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
#define OP(enum_name) enum_name
|
||||
NATIVE_THEME_COLOR_IDS,
|
||||
#undef OP
|
||||
+ // Results Tables, such as the omnibox
|
||||
+ kColorId_ResultsTableNormalBackground,
|
||||
+ kColorId_ResultsTableHoveredBackground,
|
||||
+ kColorId_ResultsTableNormalText,
|
||||
+ kColorId_ResultsTableDimmedText,
|
||||
// Colors for the material spinner (aka throbber).
|
||||
kColorId_ThrobberSpinningColor,
|
||||
kColorId_ThrobberWaitingColor,
|
||||
|
||||
kColorId_NumColors,
|
||||
};
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index a7c06b8a046bba7096bfb41c84d2073980ffa6d3..cff7681a4e0023a67edda37bf9865ab073b32549 100644
|
||||
index 07db545df305a0c22375e9be3fad05621f69867a..dedaaaeaa93e55ec784f94864d670e0659d839bf 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -619,6 +619,18 @@ SkColor NativeThemeWin::GetPlatformHighContrastColor(ColorId color_id) const {
|
||||
@@ -639,6 +639,18 @@ SkColor NativeThemeWin::GetPlatformHighContrastColor(ColorId color_id) const {
|
||||
case kColorId_ThrobberWaitingColor:
|
||||
return system_colors_[SystemThemeColor::kGrayText];
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch
|
||||
... something to do with OSR? and maybe <webview> as well? terrifying.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
index 95724e75d7c9d1582bb820321c1c47774e49dd7d..7d8c0f47e41e2bcf4ef29aec1c0873098e40d8ee 100644
|
||||
index 6fc2ae557a265ea0965707786c38a2bf8684cf1b..de62972bd8f9c136589169b8d34bcf0a3d9a0d9c 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -618,6 +618,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
|
||||
@@ -614,6 +614,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ index 95724e75d7c9d1582bb820321c1c47774e49dd7d..7d8c0f47e41e2bcf4ef29aec1c087309
|
||||
const blink::WebMouseEvent& event,
|
||||
const ui::LatencyInfo& latency) {
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
index 226e7c96a2b7539890b297c05d3c963c5d4d193f..8a75e5253dd8ee66fc05232fccb3502b320ac353 100644
|
||||
index fca7a56a4b7f062ed3eee37e92c9e0c893af25fc..b862113765fdeace6b214332bab05a21a4681d91 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -23,9 +23,11 @@
|
||||
@@ -39,7 +39,7 @@ index 226e7c96a2b7539890b297c05d3c963c5d4d193f..8a75e5253dd8ee66fc05232fccb3502b
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/common/input_event_ack_state.h"
|
||||
#include "content/public/common/screen_info.h"
|
||||
@@ -66,9 +68,11 @@ class CursorManager;
|
||||
@@ -65,9 +67,11 @@ class CursorManager;
|
||||
class MouseWheelPhaseHandler;
|
||||
class RenderWidgetHostImpl;
|
||||
class RenderWidgetHostViewBaseObserver;
|
||||
@@ -52,8 +52,8 @@ index 226e7c96a2b7539890b297c05d3c963c5d4d193f..8a75e5253dd8ee66fc05232fccb3502b
|
||||
class DelegatedFrameHost;
|
||||
struct TextInputState;
|
||||
@@ -126,6 +130,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
|
||||
bool show_reason_tab_switching,
|
||||
bool show_reason_unoccluded) final;
|
||||
bool show_reason_unoccluded,
|
||||
bool show_reason_bfcache_restore) final;
|
||||
|
||||
+ virtual void InitAsGuest(RenderWidgetHostView* parent_host_view,
|
||||
+ RenderWidgetHostViewGuest* guest_view) {}
|
||||
|
||||
@@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`.
|
||||
Additionally, disables usage of some private APIs in MAS builds.
|
||||
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e1628861a74cb69 100644
|
||||
index c242af13bdf58b1c830781badaf27aadc3c0179b..2ba56a1951c7a1a76c5a6ecef1d04235d49451d8 100644
|
||||
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
@@ -154,6 +154,11 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
@@ -46,7 +46,7 @@ index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e162886
|
||||
// We only handle key down events and just simply forward other events.
|
||||
if (eventType != NSKeyDown) {
|
||||
_hostHelper->ForwardKeyboardEvent(event, latency_info);
|
||||
@@ -1762,9 +1774,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
@@ -1759,9 +1771,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
||||
// make any key-typing jank. --hbono 7/23/09
|
||||
//
|
||||
@@ -58,7 +58,7 @@ index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e162886
|
||||
|
||||
- (NSArray*)validAttributesForMarkedText {
|
||||
// This code is just copied from WebKit except renaming variables.
|
||||
@@ -1773,7 +1787,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
@@ -1770,7 +1784,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
initWithObjects:NSUnderlineStyleAttributeName,
|
||||
NSUnderlineColorAttributeName,
|
||||
NSMarkedClauseSegmentAttributeName,
|
||||
|
||||
@@ -52,10 +52,10 @@ Some alternatives to this patch:
|
||||
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index fe09f99a91e3b1d2abfb335ec2771d1ed8592d87..050102ea2d7cac519c5bba4845021df6f671b4fa 100644
|
||||
index bcb3ba42257d9c5098c8dff84adbcbb972ce3f66..288ce1fee493c371fead863977b88fe31f3e0b39 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1489,7 +1489,7 @@ if (is_chrome_branded && !is_android) {
|
||||
@@ -1470,7 +1470,7 @@ if (is_chrome_branded && !is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index fe09f99a91e3b1d2abfb335ec2771d1ed8592d87..050102ea2d7cac519c5bba4845021df6
|
||||
chrome_paks("packed_resources") {
|
||||
if (is_mac) {
|
||||
output_dir = "$root_gen_dir/repack"
|
||||
@@ -1509,6 +1509,12 @@ if (!is_android) {
|
||||
@@ -1490,6 +1490,12 @@ if (!is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,10 +267,10 @@ index 1ae8909a1404a43b34b9ef585511c7a3de39fa28..0d2a74ab5e9d55201a4992d81aecf9c2
|
||||
const gfx::VectorIcon* minor_icon = nullptr;
|
||||
gfx::Image icon;
|
||||
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
|
||||
index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1e35672b0 100644
|
||||
index c67fc8503db775079068d23c84bee615506ee81f..4522060274f0dd4081d39fbd07b6ae9022655d02 100644
|
||||
--- a/ui/views/controls/menu/menu_item_view.cc
|
||||
+++ b/ui/views/controls/menu/menu_item_view.cc
|
||||
@@ -278,6 +278,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
|
||||
@@ -279,6 +279,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
|
||||
int index,
|
||||
int item_id,
|
||||
const base::string16& label,
|
||||
@@ -278,7 +278,7 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
const base::string16& minor_text,
|
||||
const gfx::VectorIcon* minor_icon,
|
||||
const gfx::ImageSkia& icon,
|
||||
@@ -298,6 +299,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
|
||||
@@ -299,6 +300,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
|
||||
item->SetTitle(GetDelegate()->GetLabel(item_id));
|
||||
else
|
||||
item->SetTitle(label);
|
||||
@@ -286,7 +286,7 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
item->SetMinorText(minor_text);
|
||||
item->SetMinorIcon(minor_icon);
|
||||
if (vector_icon) {
|
||||
@@ -339,21 +341,22 @@ void MenuItemView::RemoveAllMenuItems() {
|
||||
@@ -340,21 +342,22 @@ void MenuItemView::RemoveAllMenuItems() {
|
||||
MenuItemView* MenuItemView::AppendMenuItem(int item_id,
|
||||
const base::string16& label,
|
||||
const gfx::ImageSkia& icon) {
|
||||
@@ -312,7 +312,7 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
/*minor_text=*/base::string16(), /*minor_icon=*/nullptr,
|
||||
/*icon=*/gfx::ImageSkia(), /*vector_icon=*/nullptr,
|
||||
/*type=*/Type::kSeparator,
|
||||
@@ -362,10 +365,11 @@ void MenuItemView::AddSeparatorAt(int index) {
|
||||
@@ -363,10 +366,11 @@ void MenuItemView::AddSeparatorAt(int index) {
|
||||
|
||||
MenuItemView* MenuItemView::AppendMenuItemImpl(int item_id,
|
||||
const base::string16& label,
|
||||
@@ -325,7 +325,7 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
nullptr, type, ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
@@ -398,6 +402,11 @@ void MenuItemView::SetTitle(const base::string16& title) {
|
||||
@@ -399,6 +403,11 @@ void MenuItemView::SetTitle(const base::string16& title) {
|
||||
invalidate_dimensions(); // Triggers preferred size recalculation.
|
||||
}
|
||||
|
||||
@@ -337,10 +337,10 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
void MenuItemView::SetMinorText(const base::string16& minor_text) {
|
||||
minor_text_ = minor_text;
|
||||
invalidate_dimensions(); // Triggers preferred size recalculation.
|
||||
@@ -988,13 +997,23 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
|
||||
(!delegate ||
|
||||
delegate->ShouldReserveSpaceForSubmenuIndicator() ?
|
||||
item_right_margin_ : config.arrow_to_edge_padding);
|
||||
@@ -989,13 +998,23 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
|
||||
(!delegate || delegate->ShouldReserveSpaceForSubmenuIndicator()
|
||||
? item_right_margin_
|
||||
: config.arrow_to_edge_padding);
|
||||
- gfx::Rect text_bounds(label_start, top_margin, width, available_height);
|
||||
+ gfx::Rect text_bounds(label_start, top_margin, width,
|
||||
+ subtitle_.empty() ? available_height
|
||||
@@ -362,7 +362,7 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
PaintMinorIconAndText(canvas, style);
|
||||
|
||||
// Set the submenu indicator (arrow) image and color.
|
||||
@@ -1245,6 +1264,11 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const {
|
||||
@@ -1244,15 +1263,21 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const {
|
||||
|
||||
// Determine the length of the label text.
|
||||
int string_width = gfx::GetStringWidth(title_, style.font_list);
|
||||
@@ -371,10 +371,9 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
+ std::max(string_width, gfx::GetStringWidth(subtitle_, style.font_list));
|
||||
+ }
|
||||
+
|
||||
dimensions.standard_width = string_width + label_start +
|
||||
item_right_margin_;
|
||||
dimensions.standard_width = string_width + label_start + item_right_margin_;
|
||||
// Determine the length of the right-side text.
|
||||
@@ -1252,9 +1276,10 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const {
|
||||
dimensions.minor_text_width =
|
||||
minor_text.empty() ? 0 : gfx::GetStringWidth(minor_text, style.font_list);
|
||||
|
||||
// Determine the height to use.
|
||||
@@ -389,10 +388,10 @@ index 07fc2153d8ad802a6ad1db9a2fc85498ce9a2dd0..2bfb29aaebe7a5a192a469519090bdc1
|
||||
std::max(dimensions.height, MenuConfig::instance().item_min_height);
|
||||
|
||||
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
|
||||
index 6a69047e9c1ba7e1a93e1d730edc7639476561dd..1720c480fb72fb7a4aed551c30a252fbb813873c 100644
|
||||
index 294b0ea5d2bf28a41a1ae5e114d6e68936b958a9..ae97f8d3bb4b94ea89957cb761ee63ffab78b26a 100644
|
||||
--- a/ui/views/controls/menu/menu_item_view.h
|
||||
+++ b/ui/views/controls/menu/menu_item_view.h
|
||||
@@ -152,6 +152,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
@@ -153,6 +153,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
MenuItemView* AddMenuItemAt(int index,
|
||||
int item_id,
|
||||
const base::string16& label,
|
||||
@@ -400,7 +399,7 @@ index 6a69047e9c1ba7e1a93e1d730edc7639476561dd..1720c480fb72fb7a4aed551c30a252fb
|
||||
const base::string16& minor_text,
|
||||
const gfx::VectorIcon* minor_icon,
|
||||
const gfx::ImageSkia& icon,
|
||||
@@ -194,6 +195,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
@@ -195,6 +196,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
// All the AppendXXX methods funnel into this.
|
||||
MenuItemView* AppendMenuItemImpl(int item_id,
|
||||
const base::string16& label,
|
||||
@@ -408,7 +407,7 @@ index 6a69047e9c1ba7e1a93e1d730edc7639476561dd..1720c480fb72fb7a4aed551c30a252fb
|
||||
const gfx::ImageSkia& icon,
|
||||
Type type);
|
||||
|
||||
@@ -218,6 +220,9 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
@@ -219,6 +221,9 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
void SetTitle(const base::string16& title);
|
||||
const base::string16& title() const { return title_; }
|
||||
|
||||
@@ -418,7 +417,7 @@ index 6a69047e9c1ba7e1a93e1d730edc7639476561dd..1720c480fb72fb7a4aed551c30a252fb
|
||||
// Sets the minor text.
|
||||
void SetMinorText(const base::string16& minor_text);
|
||||
|
||||
@@ -428,7 +433,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
@@ -427,7 +432,7 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
void DestroyAllMenuHosts();
|
||||
|
||||
// Returns the text that should be displayed on the end (right) of the menu
|
||||
@@ -427,7 +426,7 @@ index 6a69047e9c1ba7e1a93e1d730edc7639476561dd..1720c480fb72fb7a4aed551c30a252fb
|
||||
base::string16 GetMinorText() const;
|
||||
|
||||
// Returns the icon that should be displayed to the left of the minor text.
|
||||
@@ -519,6 +524,9 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
@@ -518,6 +523,9 @@ class VIEWS_EXPORT MenuItemView : public View {
|
||||
// Title.
|
||||
base::string16 title_;
|
||||
|
||||
@@ -457,7 +456,7 @@ index 6b5229578e0856a07c85db7d5eb36ffee812cef8..3d90eefa5345f4dc8563dfcefb2ee137
|
||||
AddItem("No minor content", base::string16(), nullptr);
|
||||
AddItem("Minor text only", base::ASCIIToUTF16("minor text"), nullptr);
|
||||
diff --git a/ui/views/controls/menu/menu_model_adapter.cc b/ui/views/controls/menu/menu_model_adapter.cc
|
||||
index 792b864594b36526cfb77292e921f9a62e1de7e4..d37d949a0db198b89f75603720e65ef35e9dc37b 100644
|
||||
index 373ea41937feea562ed25dbcb8c1ad6546beecb5..7307ac7b82b6432343c404d19cf0cdd60557d3d5 100644
|
||||
--- a/ui/views/controls/menu/menu_model_adapter.cc
|
||||
+++ b/ui/views/controls/menu/menu_model_adapter.cc
|
||||
@@ -99,8 +99,8 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model,
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Wed, 23 Oct 2019 15:30:18 -0700
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Tue, 4 Feb 2020 08:59:32 -0700
|
||||
Subject: Revert "Remove ContentRendererClient::ShouldFork."
|
||||
|
||||
This reverts commit 6b068eb8ca4a3c7350bdafa22fc0cf0636ef8b74.
|
||||
This reverts the CL at https://chromium-review.googlesource.com/c/chromium/src/+/1812128.
|
||||
We use it to force a new renderer process for navigations, and need to start a new renderer process
|
||||
for every navigation to keep Node.js working properly. Once Native Modules in the renderer process
|
||||
are required to be NAPI or context aware (Electron v11), this patch can be removed.
|
||||
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
index e03ad3a5a115383143d1324164dfd37f87c6f2f2..1c179e0cca8b0b1fc19971d1c9e93d59af7b9383 100644
|
||||
index 6600de77c3f6c6a1a2409e0afe503d752038c9fa..9fa08ef75c82a75de4edad5694b8d07aae3fba83 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -1291,6 +1291,17 @@ bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
|
||||
return true;
|
||||
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
@@ -1273,6 +1273,25 @@ bool ChromeContentRendererClient::AllowPopup() {
|
||||
#endif
|
||||
}
|
||||
|
||||
+bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) {
|
||||
+ DCHECK(!frame->Parent());
|
||||
+
|
||||
+ // If |url| matches one of the prerendered URLs, stop this navigation and try
|
||||
@@ -24,84 +32,90 @@ index e03ad3a5a115383143d1324164dfd37f87c6f2f2..1c179e0cca8b0b1fc19971d1c9e93d59
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
return false;
|
||||
}
|
||||
|
||||
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
|
||||
index b4895b8770bd58d400cc8ca55c74940b25b3a8d5..3c0d6bc9bb50abc5f02e07c24ed8ae424dcda1a5 100644
|
||||
--- a/content/renderer/render_view_browsertest.cc
|
||||
+++ b/content/renderer/render_view_browsertest.cc
|
||||
@@ -1004,6 +1004,73 @@ TEST_F(RenderViewImplTest, BeginNavigationForWebUI) {
|
||||
FrameHostMsg_OpenURL::ID));
|
||||
}
|
||||
|
||||
+class AlwaysForkingRenderViewTest : public RenderViewImplTest {
|
||||
+ public:
|
||||
+ ContentRendererClient* CreateContentRendererClient() override {
|
||||
+ return new TestContentRendererClient;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+ private:
|
||||
+ class TestContentRendererClient : public ContentRendererClient {
|
||||
+ public:
|
||||
+ bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) override {
|
||||
+ return true;
|
||||
void ChromeContentRendererClient::WillSendRequest(
|
||||
WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
|
||||
index 8969adb44800e925c9066e51793463c09eb78622..d11a4fdf04f7632fb1191c28c83f1d66ce0e5bf2 100644
|
||||
--- a/chrome/renderer/chrome_content_renderer_client.h
|
||||
+++ b/chrome/renderer/chrome_content_renderer_client.h
|
||||
@@ -126,6 +126,11 @@ class ChromeContentRendererClient
|
||||
base::SingleThreadTaskRunner* compositor_thread_task_runner) override;
|
||||
bool RunIdleHandlerWhenWidgetsHidden() override;
|
||||
bool AllowPopup() override;
|
||||
+ bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) override;
|
||||
void WillSendRequest(blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
const blink::WebURL& url,
|
||||
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
|
||||
index c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa200fb9773c 100644
|
||||
--- a/content/public/renderer/content_renderer_client.cc
|
||||
+++ b/content/public/renderer/content_renderer_client.cc
|
||||
@@ -104,6 +104,14 @@ bool ContentRendererClient::HandleNavigation(
|
||||
}
|
||||
#endif
|
||||
|
||||
+bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect) {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
void ContentRendererClient::WillSendRequest(
|
||||
blink::WebLocalFrame* frame,
|
||||
ui::PageTransition transition_type,
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index ee2079537feb23869fe4f812bcef33e1d7de29a7..93287ae0928b52f9df34834ad1a8ef0e54367882 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -213,6 +213,13 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
bool is_redirect);
|
||||
#endif
|
||||
|
||||
+ // Returns true if we should fork a new process for the given navigation.
|
||||
+ virtual bool ShouldFork(blink::WebLocalFrame* frame,
|
||||
+ const GURL& url,
|
||||
+ const std::string& http_method,
|
||||
+ bool is_initial_navigation,
|
||||
+ bool is_server_redirect);
|
||||
+
|
||||
// Notifies the embedder that the given frame is requesting the resource at
|
||||
// |url|. If the function returns a valid |new_url|, the request must be
|
||||
// updated to use it. The |attach_same_site_cookies| output parameter
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 8dd80a3d7880eec9a4adb2288b883514b86e8880..fce52a0bf34c7ff66196951c2f72333e1cb45397 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -5705,6 +5705,23 @@ void RenderFrameImpl::BeginNavigation(
|
||||
int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
|
||||
bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
|
||||
(cumulative_bindings & kWebUIBindingsPolicyMask);
|
||||
+
|
||||
+ if (!should_fork && url.SchemeIs(url::kFileScheme)) {
|
||||
+ // Fork non-file to file opens (see https://crbug.com/1031119). Note that
|
||||
+ // this may fork unnecessarily if another tab (hosting a file or not)
|
||||
+ // targeted this one before its initial navigation, but that shouldn't
|
||||
+ // cause a problem.
|
||||
+ should_fork = !old_url.SchemeIs(url::kFileScheme);
|
||||
+ }
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+TEST_F(AlwaysForkingRenderViewTest, BeginNavigationDoesNotForkEmptyUrl) {
|
||||
+ GURL example_url("http://example.com");
|
||||
+ GURL empty_url("");
|
||||
+ if (!should_fork) {
|
||||
+ // Give the embedder a chance.
|
||||
+ bool is_initial_navigation = render_view_->history_list_length_ == 0;
|
||||
+ should_fork = GetContentClient()->renderer()->ShouldFork(
|
||||
+ frame_, url, info->url_request.HttpMethod().Utf8(),
|
||||
+ is_initial_navigation, false /* is_redirect */);
|
||||
+ }
|
||||
+
|
||||
+ LoadHTMLWithUrlOverride("<body></body", example_url.spec().c_str());
|
||||
+ EXPECT_EQ(example_url,
|
||||
+ GURL(frame()->GetWebFrame()->GetDocumentLoader()->GetUrl()));
|
||||
+
|
||||
+ // Empty url should never fork.
|
||||
+ blink::WebURLRequest request(empty_url);
|
||||
+ request.SetMode(network::mojom::RequestMode::kNavigate);
|
||||
+ request.SetRedirectMode(network::mojom::RedirectMode::kManual);
|
||||
+ request.SetRequestContext(blink::mojom::RequestContextType::INTERNAL);
|
||||
+ request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(example_url));
|
||||
+ auto navigation_info = std::make_unique<blink::WebNavigationInfo>();
|
||||
+ navigation_info->url_request = request;
|
||||
+ navigation_info->frame_type =
|
||||
+ network::mojom::RequestContextFrameType::kTopLevel;
|
||||
+ navigation_info->navigation_policy = blink::kWebNavigationPolicyCurrentTab;
|
||||
+ frame()->BeginNavigation(std::move(navigation_info));
|
||||
+ EXPECT_FALSE(render_thread_->sink().GetUniqueMessageMatching(
|
||||
+ FrameHostMsg_OpenURL::ID));
|
||||
+}
|
||||
+
|
||||
+TEST_F(AlwaysForkingRenderViewTest, BeginNavigationDoesNotForkAboutBlank) {
|
||||
+ GURL example_url("http://example.com");
|
||||
+ GURL blank_url(url::kAboutBlankURL);
|
||||
+
|
||||
+ LoadHTMLWithUrlOverride("<body></body", example_url.spec().c_str());
|
||||
+ EXPECT_EQ(example_url,
|
||||
+ GURL(frame()->GetWebFrame()->GetDocumentLoader()->GetUrl()));
|
||||
+
|
||||
+ // about:blank should never fork.
|
||||
+ blink::WebURLRequest request(blank_url);
|
||||
+ request.SetMode(network::mojom::RequestMode::kNavigate);
|
||||
+ request.SetRedirectMode(network::mojom::RedirectMode::kManual);
|
||||
+ request.SetRequestContext(blink::mojom::RequestContextType::INTERNAL);
|
||||
+ request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(example_url));
|
||||
+ auto navigation_info = std::make_unique<blink::WebNavigationInfo>();
|
||||
+ navigation_info->url_request = request;
|
||||
+ navigation_info->frame_type =
|
||||
+ network::mojom::RequestContextFrameType::kTopLevel;
|
||||
+ navigation_info->navigation_policy = blink::kWebNavigationPolicyCurrentTab;
|
||||
+ frame()->BeginNavigation(std::move(navigation_info));
|
||||
+ EXPECT_FALSE(render_thread_->sink().GetUniqueMessageMatching(
|
||||
+ FrameHostMsg_OpenURL::ID));
|
||||
+}
|
||||
+
|
||||
// This test verifies that when device emulation is enabled, RenderFrameProxy
|
||||
// continues to receive the original ScreenInfo and not the emualted
|
||||
// ScreenInfo.
|
||||
if (should_fork) {
|
||||
OpenURL(std::move(info));
|
||||
return; // Suppress the load here.
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
|
||||
Patch to make scrollBounce option work.
|
||||
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
index ae1a77a219f153f034c2702447a3ede9d9c9b960..4e50a255b99bbce1e3c4aa696bfc0fa8ae4dddee 100644
|
||||
index 1ba5936414aa46efae4999b2b06bf4f71904ef7b..b9c2de3aa2bb2647c85cf51a0990260a51f53be5 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1338,7 +1338,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
|
||||
@@ -1345,7 +1345,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
|
||||
}
|
||||
|
||||
bool RenderThreadImpl::IsElasticOverscrollEnabled() {
|
||||
|
||||
@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index baf9e4ed20a41b9c1320ec6fbae290319e8e05e5..89fa83bbda39e90c1fcd6df83cd248c1f2de7195 100644
|
||||
index 60d0aab5416cb237c6de5013a6724fdb95a5422e..016684c4340318308666545ddd8e4e85632d4ed2 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -414,6 +414,11 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
@@ -415,6 +415,11 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ index baf9e4ed20a41b9c1320ec6fbae290319e8e05e5..89fa83bbda39e90c1fcd6df83cd248c1
|
||||
~RendererSandboxedProcessLauncherDelegate() override {}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@@ -435,6 +440,9 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
@@ -436,6 +441,9 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
|
||||
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
|
||||
service_manager::ZygoteHandle GetZygote() override {
|
||||
@@ -47,7 +47,7 @@ index baf9e4ed20a41b9c1320ec6fbae290319e8e05e5..89fa83bbda39e90c1fcd6df83cd248c1
|
||||
const base::CommandLine& browser_command_line =
|
||||
*base::CommandLine::ForCurrentProcess();
|
||||
base::CommandLine::StringType renderer_prefix =
|
||||
@@ -449,10 +457,13 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
@@ -450,10 +458,13 @@ class RendererSandboxedProcessLauncherDelegate
|
||||
return service_manager::SandboxType::kRenderer;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ index baf9e4ed20a41b9c1320ec6fbae290319e8e05e5..89fa83bbda39e90c1fcd6df83cd248c1
|
||||
};
|
||||
|
||||
const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey";
|
||||
@@ -1746,11 +1757,18 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1791,11 +1802,18 @@ bool RenderProcessHostImpl::Init() {
|
||||
cmd_line->PrependWrapper(renderer_prefix);
|
||||
AppendRendererCommandLine(cmd_line.get());
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch
|
||||
Unsandboxed ppapi processes should skip zygote.
|
||||
|
||||
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
|
||||
index 620bd686edb8d623f790909db745f16eba507a1a..6ca4cabbdd451b5ef4cd9ee30d3160e4d27c9030 100644
|
||||
index 0fa99dc66e837110595d993114bb12b93ebf8a2d..ff5eeec244933de21afa8f97c574c1c4988d83f1 100644
|
||||
--- a/content/browser/ppapi_plugin_process_host.cc
|
||||
+++ b/content/browser/ppapi_plugin_process_host.cc
|
||||
@@ -123,6 +123,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate
|
||||
|
||||
22
patches/chromium/use_electron_resources_in_pdf_util.patch
Normal file
22
patches/chromium/use_electron_resources_in_pdf_util.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Apthorp <nornagon@nornagon.net>
|
||||
Date: Mon, 10 Feb 2020 10:37:48 -0800
|
||||
Subject: use electron resources in pdf_util
|
||||
|
||||
Without this, the ID for IDR_PDF_MANIFEST will be wrong on linux
|
||||
and cause a DCHECK(), since the resource will be loaded as an empty
|
||||
string.
|
||||
|
||||
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
|
||||
index 877d0ba2f48359243527ddebf1d91132b3d5c455..cd69de498c4968ade0ffabf45b72d4d63b70b10f 100644
|
||||
--- a/chrome/browser/pdf/pdf_extension_util.cc
|
||||
+++ b/chrome/browser/pdf/pdf_extension_util.cc
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "base/strings/string_util.h"
|
||||
#include "chrome/common/chrome_content_client.h"
|
||||
-#include "chrome/grit/browser_resources.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace pdf_extension_util {
|
||||
@@ -9,10 +9,10 @@ is needed for OSR.
|
||||
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index ea2e52bf16dd7897a104c67dfcb2f95598cf291e..7ca7e5c594d729d365692336861abfc93a88680b 100644
|
||||
index b57520fe4254335fd31bb86673d30e79c0656d51..6f2e0c12e7b4a2928346f6690c2e8a072822124b 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2062,6 +2062,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -2066,6 +2066,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
std::string unique_name;
|
||||
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
|
||||
|
||||
@@ -25,7 +25,7 @@ index ea2e52bf16dd7897a104c67dfcb2f95598cf291e..7ca7e5c594d729d365692336861abfc9
|
||||
WebContentsViewDelegate* delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -2072,6 +2078,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
@@ -2076,6 +2082,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
||||
view_.reset(CreateWebContentsView(this, delegate,
|
||||
&render_view_host_delegate_view_));
|
||||
}
|
||||
@@ -34,10 +34,10 @@ index ea2e52bf16dd7897a104c67dfcb2f95598cf291e..7ca7e5c594d729d365692336861abfc9
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 40e1e940f87bdf375bd966086893cd829cb7c7bd..eb3523996af34cf8b7b48ae8aa6ad96f83568892 100644
|
||||
index cf98180740c4adaf0082e987e4b7fc482b11d348..376aaaebcb45b078c59f013437ac9baf7c9dd037 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -79,9 +79,12 @@ class BrowserPluginGuestDelegate;
|
||||
@@ -82,9 +82,12 @@ class BrowserPluginGuestDelegate;
|
||||
class InterstitialPage;
|
||||
class RenderFrameHost;
|
||||
class RenderViewHost;
|
||||
@@ -47,10 +47,10 @@ index 40e1e940f87bdf375bd966086893cd829cb7c7bd..eb3523996af34cf8b7b48ae8aa6ad96f
|
||||
+class RenderWidgetHostViewBase;
|
||||
class WebContentsDelegate;
|
||||
+class WebContentsView;
|
||||
class WebUI;
|
||||
struct CustomContextMenuContext;
|
||||
struct DropData;
|
||||
struct FaviconURL;
|
||||
@@ -214,6 +217,10 @@ class WebContents : public PageNavigator,
|
||||
@@ -209,6 +212,10 @@ class WebContents : public PageNavigator,
|
||||
kInitializeAndWarmupRendererProcess,
|
||||
} desired_renderer_state;
|
||||
|
||||
@@ -59,5 +59,5 @@ index 40e1e940f87bdf375bd966086893cd829cb7c7bd..eb3523996af34cf8b7b48ae8aa6ad96f
|
||||
+ content::RenderViewHostDelegateView* delegate_view = nullptr;
|
||||
+
|
||||
// Sandboxing flags set on the new WebContents.
|
||||
blink::WebSandboxFlags starting_sandbox_flags;
|
||||
blink::mojom::WebSandboxFlags starting_sandbox_flags;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ This allows dragging and dropping between <webview>s.
|
||||
Originally landed in https://github.com/electron/libchromiumcontent/pull/267
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
|
||||
index 44bc4902a374821eecebf72bfcb150b7d86db621..c570fadb559230e17440c64b9042fbd9e73a910c 100644
|
||||
index 025f82ede5c7105ffcf5cd834c8ab6392de672bc..1792809631d50e2a2761d385ffb8b526fe4d9833 100644
|
||||
--- a/content/browser/web_contents/web_contents_view_aura.cc
|
||||
+++ b/content/browser/web_contents/web_contents_view_aura.cc
|
||||
@@ -792,6 +792,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
|
||||
@@ -796,6 +796,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
|
||||
|
||||
bool WebContentsViewAura::IsValidDragTarget(
|
||||
RenderWidgetHostImpl* target_rwh) const {
|
||||
@@ -20,10 +20,10 @@ index 44bc4902a374821eecebf72bfcb150b7d86db621..c570fadb559230e17440c64b9042fbd9
|
||||
GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
|
||||
drag_start_view_id_;
|
||||
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
|
||||
index b35ff2edf854aa759a91fa708ed560d2f269e078..4ca6119b2105f27cabcb664d9ba7631973b49966 100644
|
||||
index b874b3c4b16ca87c9730c6caaf5788cff0ab3493..8931859b944905a80bb9d174a67d3aee0f0bf5d6 100644
|
||||
--- a/content/browser/web_contents/web_drag_dest_mac.mm
|
||||
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
|
||||
@@ -337,6 +337,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
|
||||
@@ -419,6 +419,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
|
||||
}
|
||||
|
||||
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {
|
||||
|
||||
@@ -10,10 +10,10 @@ An attempt to upstream this was made, but rejected:
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/1954347
|
||||
|
||||
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
||||
index 87df60c52d1e6adf464e85deccef87ae2c6cb48c..5dabb49f061b4e0643256cbf9162d128c1e0bacf 100644
|
||||
index 56062bb2680a71103d3c600697dfae03e265ef15..ee2079537feb23869fe4f812bcef33e1d7de29a7 100644
|
||||
--- a/content/public/renderer/content_renderer_client.h
|
||||
+++ b/content/public/renderer/content_renderer_client.h
|
||||
@@ -389,6 +389,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
@@ -373,6 +373,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
||||
virtual void DidInitializeWorkerContextOnWorkerThread(
|
||||
v8::Local<v8::Context> context) {}
|
||||
|
||||
@@ -26,10 +26,10 @@ index 87df60c52d1e6adf464e85deccef87ae2c6cb48c..5dabb49f061b4e0643256cbf9162d128
|
||||
// An empty URL is returned if the URL is not overriden.
|
||||
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index 58c1b0e78a66229a23cf2c930fa059a94dc70323..d549bdc3d300f8eb11e7fd9127cb06e1a0e9c720 100644
|
||||
index 8c641e6e3a6f05a87c2a0570ae4091fe7b4a0356..a2fe4cc09ffdcdf93199c01c316a4173a6f84d32 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -879,6 +879,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
@@ -864,6 +864,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ index 58c1b0e78a66229a23cf2c930fa059a94dc70323..d549bdc3d300f8eb11e7fd9127cb06e1
|
||||
const v8::Local<v8::Context>& worker) {
|
||||
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index 096cd162c7d5228fea0c56ad007b9939e6f27809..1c332800cb133f93d21ee628b3b85e89ab6d7da7 100644
|
||||
index 80490f5b8d523f18906c372804bae9ee56d368de..236894dc0dd7242c1f47caeb982c4f24b784ce95 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -181,6 +181,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -182,6 +182,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
@@ -55,10 +55,10 @@ index 096cd162c7d5228fea0c56ad007b9939e6f27809..1c332800cb133f93d21ee628b3b85e89
|
||||
const blink::WebString& header_name) override;
|
||||
|
||||
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
||||
index 8690ec1fdd213a4898ebce1c8dce38079972f7df..b06e541ec3cbb6cac7b58222a4718b4560a49ff0 100644
|
||||
index c7bc68000ad0a9b49e9638e5413e0c3e4db508b0..3edcb4715c2dd8b2cf33f093710f14816b061117 100644
|
||||
--- a/third_party/blink/public/platform/platform.h
|
||||
+++ b/third_party/blink/public/platform/platform.h
|
||||
@@ -623,6 +623,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
@@ -615,6 +615,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
virtual void DidStartWorkerThread() {}
|
||||
virtual void WillStopWorkerThread() {}
|
||||
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
||||
@@ -67,10 +67,10 @@ index 8690ec1fdd213a4898ebce1c8dce38079972f7df..b06e541ec3cbb6cac7b58222a4718b45
|
||||
const WebSecurityOrigin& script_origin) {
|
||||
return false;
|
||||
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
index e00f788541d7c0f96d2c00c4840da1598c3f7a81..0c3d589ba1ca0727d46feda8ae48c5d0049c304e 100644
|
||||
index c43f8b1e8f4a20ee0bf267ef78f2b067837be223..b34800d0a569b31f9ecc9c62d0e93e676eddf32d 100644
|
||||
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
||||
@@ -681,6 +681,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
@@ -688,6 +688,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
||||
nested_runner_->QuitNow();
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user