Compare commits

..

76 Commits

Author SHA1 Message Date
Electron Bot
34baa02c28 Bump v9.0.0-nightly.20200121 2020-01-21 07:31:48 -08:00
Jeremy Apthorp
d802fe0fdd fix: [extensions] some chrome.extension APIs (#21804) 2020-01-21 09:44:09 +09:00
Samuel Attard
ebe8bddc31 fix: ignore (un)lock events for sessions that aren't the current session (#21805) 2020-01-20 15:48:12 +09:00
Shelley Vohr
38947f43de docs: menu item labels are not dynamic (#21823) 2020-01-20 15:44:22 +09:00
Electron Bot
64a2490efe Bump v9.0.0-nightly.20200119 2020-01-19 07:31:09 -08:00
Electron Bot
48b9c7df84 Bump v9.0.0-nightly.20200118 2020-01-18 07:31:19 -08:00
Martin
9636acb907 docs: update setAspectRatio documentation (#19945) 2020-01-17 20:35:27 +00:00
Cheng Zhao
42d8933d66 fix: crash when restoring minimized hidden window (#21813) 2020-01-17 11:29:01 -08:00
Electron Bot
bf6e4b1247 chore: bump chromium to 279aeeec3c9fe2237bc31f776f269 (master) (#21521)
* chore: bump chromium in DEPS to 46d2d82e84d73806da623c5333dae4dd218172df

* chore: bump chromium in DEPS to cbafe74731a5d1e59844ca59e0fc28f4a5f80a33

* chore: bump chromium in DEPS to d5dcd6b5cc76f4e1732083d775cdd7b533f0abe9

* Update patches

* update for lint

* Fix compilation errors

* chore: bump chromium in DEPS to 1c19360fdaaf65d4ed006736c7f9804104095990

* Replace removed constant

* chore: bump chromium in DEPS to 3b6639f5da26c1772c5d4f3ba634aca65df75fec

* chore: bump chromium in DEPS to cc6b1b930d4b5eca06701820dac54fa0f41e8999

* chore: bump chromium in DEPS to 7d1445641ad1032c67f731ba6ff7798f29349ade

* chore: bump chromium in DEPS to 6f7e5e79cefe982ad84a88927565a88db2e592be

* chore: bump chromium in DEPS to bfb25dafff19cb41bf9781331d19ef0be819d1e4

* chore: bump chromium in DEPS to 1a8196b39f0e0cdc4935fd122fff5625d5fab06e

* chore: bump chromium in DEPS to 9a03d8d2bb38ad8c0cbb9550ca81b2f94ff60c15

* chore: bump chromium in DEPS to 4c67f3505dab2d5457adb418cd3270a4f3236fd0

* chore: bump chromium in DEPS to 652394e7626fc1ae895a53fb34c64070494e648e

* chore: bump chromium in DEPS to 07653652c58cc019af7f833bd63eb0c2eceaab5e

* chore: bump chromium in DEPS to 451a1c5fec1fb073a5bae12a033bb342c72c905f

* chore: bump chromium in DEPS to 86cdba00e233899a232868b412b333d08db63478

* chore: bump chromium in DEPS to 7c322faad1aee8abef2330d74aabf09ecf8c11af

* Update patches

* chore: bump chromium in DEPS to d0044fae7efc29eb201cfdd5fdbed77d48aba212

* Replace IsProcessingUserGesture with HasTransientUserActivation

4baa9a6e85

* Fix 10.15 sdk build

0eaa6db358

* Remove CancelPrerender

5eb3329719

* Remove no longer used WebFloatPoint

43ab96ce6b

* Use base::span<const uint8_t> for devtools messages in content/public

21e19401af

* Update renamed header files

* TODO: update with upstream changes

This code needs to be updated to handle the changes made in:
19be6547a9

* chore: bump chromium in DEPS to 82e5a2c6bd33c2e53634a09fbcbc9fcac1e7ff93

* chore: bump chromium in DEPS to 91f877cadd2995201c276e952b3bf2c60b226c64

* chore: bump chromium in DEPS to 43fcd2ab2677a06d38246b42761dc5b40cf87177

* chore: bump chromium in DEPS to e30957dcb710c0977a7ff95b8d3cf65843df12ca

* chore: bump chromium in DEPS to 6a8335a56db12aae2fd06296f82579d804d92217

* chore: bump chromium in DEPS to a4a436cbc28ace88d71752f8f479e59559e54e46

* chore: bump chromium in DEPS to 982bbd0e4b2e1d57d515f384f6483ffc0d7073ad

* chore: bump chromium in DEPS to 92bb7a99f84ffcdf41d4edca57e90b1f0c7c6c8b

* update patches

* add checkout_google_benchmark gclient var

* FIXME: workaround grit bug

* chore: bump chromium in DEPS to d3623fc53615739e6b59340a5d349e4b397cb7c5

* update patches

* Remove color arg from DidChangeThemeColor().

https://chromium-review.googlesource.com/c/chromium/src/+/1982623

* update CreateFileURLLoader with new suffix

CL: https://chromium-review.googlesource.com/c/chromium/src/+/1981414

* add node patch for removal of task API in v8

CL: https://chromium-review.googlesource.com/c/v8/v8/+/1868620

* add disable_secure_dns param for WillCreateURLLoaderFactory

CL: https://chromium-review.googlesource.com/c/chromium/src/+/1888099

* switch to mojo-ified PrintMsg_PrintPreview

CL: https://chromium-review.googlesource.com/c/chromium/src/+/1972307

* chore: bump chromium in DEPS to e7a6d173632660b6aeb9806e9132c34a315331c2

* update missing chrome/browser/ssl:proto dependency after chrome removal

CL: https://chromium-review.googlesource.com/c/chromium/src/+/1986082

* chore: add libvulkan.so to the linux manifest

CL: https://chromium-review.googlesource.com/c/chromium/src/+/1973042

* revert DidChangeThemeColor ternary change due to templates

* match Chrome's mojo-ified implementation in geolocation_permission_context.cc

CL: https://chromium-review.googlesource.com/c/chromium/src/+/1963371

* add vulkan-1.dll to zips

2d6f74c6d4

* add bug link to fixme_grit_conflicts.patch

* Introduce device.mojom.DeviceService

https://chromium-review.googlesource.com/c/chromium/src/+/1956277

* PDF Compositor rename to Print Compositor

https://chromium-review.googlesource.com/c/chromium/src/+/1981135

* chore: bump chromium_version 00362ea584735b4acf4c5a0e1912d7987f8645ab

* chore: update patches

* Use a virtual base class to provide GetWidget().

https://chromium-review.googlesource.com/c/chromium/src/+/1996948

* [base] Remove usage of base::CurrentThread

https://chromium-review.googlesource.com/c/chromium/src/+/1962019

* chore: gn format

* Revert "ci: Use Visual Studio Build Tools instead of VS Studio (#21771)"

This reverts commit 9c1310dadc.

* fix: trigger resize when iframe requests fullscreen

* fix: Locking scheme registry is not necessary

https://chromium-review.googlesource.com/c/chromium/src/+/1973198

* chore: bump chromium f707f1d6d428f84cf14b64bc2ca74372e25c6ce7

* chore: update patches

* ui/base/clipboard: Remove redundant ANSI format functions

https://chromium-review.googlesource.com/c/chromium/src/+/1992015

* [base] Prepare //chrome for Value::GetList() switch

https://chromium-review.googlesource.com/c/chromium/src/+/1962255

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: loc <andy@slack-corp.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
Co-authored-by: Robo <hop2deep@gmail.com>
2020-01-17 10:41:52 -08:00
Shelley Vohr
5c6f9a6947 feat: add mouse-down & mouse-up to Tray (#21795) 2020-01-17 16:28:34 +00:00
Electron Bot
5feafaceee Bump v9.0.0-nightly.20200117 2020-01-17 07:31:47 -08:00
Max
ae49b8be42 fix: npm download failed when define 'npm_config_platform=mas' (#21801) 2020-01-17 14:44:21 +09:00
Electron Bot
09ad1807af Bump v9.0.0-nightly.20200116 2020-01-16 07:31:36 -08:00
Shelley Vohr
1e99907acc fix: printToPDF failing to generate PDF (#21783) 2020-01-15 21:05:36 -08:00
Jeremy Apthorp
b9eb68c0b4 feat: [extensions] implement a couple of tabs APIs (#21779) 2020-01-15 15:11:51 -08:00
Electron Bot
8278a64e00 Bump v9.0.0-nightly.20200115 2020-01-15 07:32:48 -08:00
Samuel Attard
b31c02ef31 test: fix some failing and disabled node specs (#19518)
* test: fix some failing and disabled node specs

These tests were failing due to mismatched stacktraces as a result of
our Module._load hook.  This fixes those by adding a flag to optionally
not hook those calls and instead do the asar override eagily.

* ELECTRON_EAGER_ASAR_HOOK => ELECTRON_EAGER_ASAR_HOOK_FOR_TESTING

* test: parallel/test-zlib-unused-weak consistently fails

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-15 16:07:03 +09:00
Cheng Zhao
49262b604d test: disable some flaky node tests (#21752) 2020-01-15 16:06:33 +09:00
Shelley Vohr
3019a2650d docs: ignore_locks not break_repo_locks (#21775) 2020-01-14 20:50:37 -08:00
Jeremy Apthorp
55368e4d97 feat: just enough //extensions to load a simple devtools extension (#19515) 2020-01-14 16:20:30 -08:00
John Kleinschmidt
9c1310dadc ci: Use Visual Studio Build Tools instead of VS Studio (#21771) 2020-01-14 17:10:50 -05:00
John Kleinschmidt
408d3d2a14 build: fix release asset names (#21772) 2020-01-14 17:10:08 -05:00
Cheng Zhao
ceacadb4f4 fix: pass full response headers in net module (#21552) 2020-01-14 09:36:08 -08:00
Felix Rieseberg
2d0bf81bd4 docs: Little fix in Goma docs (#21762)
* docs: Little fix in Goma docs

* docs: Remove space
2020-01-14 11:04:08 -05:00
Electron Bot
2d8839980c Bump v9.0.0-nightly.20200114 2020-01-14 07:32:51 -08:00
Shelley Vohr
83c19faf61 fix: pass startPage url correctly to extensions (#21711)
* fix: pass startPage url correctly to extensions

* check for devtools_page first
2020-01-14 15:47:56 +09:00
Samuel Attard
80a037db86 chore: update goma documentation (#21761) 2020-01-13 15:49:29 -08:00
Jeremy Apthorp
fa42b5980e feat: flesh out the api for //extensions (#21587) 2020-01-13 14:56:28 -08:00
Jeremy Apthorp
8bc0c92137 feat: [extensions] background pages (#21591) 2020-01-13 14:55:58 -08:00
Andrea Brancaleoni
cf497ea478 build: upload windows toolchain profile (#21327)
This commit uploads the output of the windows toolchain profiler.
The windows toolchain profiler is aimed at allowing the compilation
of electron release artifacts using the same windows toolchain on user
builder. This combined with the ability of electron of outputting
deterministic build should allow in future to check electron build
artifacts against CI artifacts.

See: 97959b5e5c include windows toolchain profiler (contd #20949)
2020-01-13 15:40:13 -05:00
Cheng Zhao
32af863e34 fix: double-autorelease of NSImage (#21757) 2020-01-13 11:37:11 -08:00
Jeremy Apthorp
d68f17b32c fix: stream protocols not completing (#21733) 2020-01-13 10:28:21 -08:00
Electron Bot
7723c2c16d Bump v9.0.0-nightly.20200113 2020-01-13 07:31:46 -08:00
Cheng Zhao
758863b84d fix: disable private macOS APIs in MAS build except for CAContext/CALayerHost (#21573)
* fix: add patch to disable remote accessibility APIs

* fix: add patch to disable private window frame APIs
2020-01-13 09:04:38 -05:00
Nate Wienert
425d2a2e1b add border radius to frameless window (#20360) 2020-01-13 15:43:00 +09:00
Konstantinos Ntoutsos-Oikonomou
20c910f98e docs: New fiddle example 'Create a new window' (#20480)
* add: New fiddle for Manage Windows section example

* Delete package.json

Not needed

* Address issue with .gitignore file, load new window, removing unwanted css class

* Delete package.json

* Pushing change regarding the use of shell.OpenExternal API with an event listener for the href tag on the link
2020-01-13 15:35:56 +09:00
Yaser
b31084493e docs: Added Window Management Fiddle example (#20535) 2020-01-13 15:34:13 +09:00
Jeremy Apthorp
2e1531ad90 feat: warn when remote is used without enableRemoteModule: true (#21546)
* feat: warn when remote is used without enableRemoteModule: true

* fix security warning
2020-01-13 15:23:03 +09:00
daveilers
2f394d46c7 docs: Update online-offline-events.md to reflect nodeIntegration required (#21707)
* Update online-offline-events.md

NodeIntegration is required for online/offline and the default changed, so the example should reflect the need for that config

* chore: fix lint warning

Co-authored-by: Cheng Zhao <zcbenz@github.com>
2020-01-13 14:56:39 +09:00
Shelley Vohr
2e7f9bffeb docs: update source code dir structure (#21659) 2020-01-12 21:08:00 -08:00
Jorn
aef9ab1bb7 Es6ify api docs (#21686)
* docs: es6ify docs -> var -> const / let

* docs: apply arrow functions throughout all of the docs
2020-01-13 10:29:46 +09:00
Daniel Playfair Cal
29b7d80eb5 fix(scripts): account for sys.platform being "linux" as well "linux2" (#21741) 2020-01-13 09:58:25 +09:00
loc
a0a932826c fix: prefer occluded rather than unloading layout info (#21585) 2020-01-13 09:56:49 +09:00
Shelley Vohr
19ef7a0fc9 fix: don't fallback to OpenFolderViaShell (#21668) 2020-01-13 09:49:51 +09:00
Milan Burda
c0bde4baa4 docs: responseHeaders should be Record<string, string[]> (#21730) 2020-01-12 09:20:13 -08:00
Electron Bot
702d18b2e3 Bump v9.0.0-nightly.20200111 2020-01-11 07:31:07 -08:00
loc
301bd8aec0 fix: avoid contextBridge double free on garbage collection (#21592)
* fix: reset next/prev pointers for life-monitored nodes

* fix: don't double-delete nodes in a linked list
2020-01-10 15:59:50 -08:00
Shelley Vohr
2858471151 feat: remove visibleOnFullscreen option (#21706) 2020-01-10 09:11:38 -08:00
Electron Bot
48ae7552f6 Bump v9.0.0-nightly.20200110 2020-01-10 07:32:59 -08:00
CezaryKulakowski
f461dc7002 fix: don't unnecessarily copy draggable regions (#21704) 2020-01-09 12:13:28 -08:00
Jeremy Apthorp
768a6ace1b test: move some fixtures from spec/ to spec-main/ (#21403) 2020-01-09 11:50:56 -08:00
Cheng Zhao
8a92b65fd3 test: retry for a few flaky tests (#21658) 2020-01-09 11:50:30 -08:00
Electron Bot
cfae97a64c chore: bump node to v12.14.1 (master) (#21703)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-01-09 10:42:53 -08:00
Shelley Vohr
f5e202a898 fix: Notification crash in before-quit (#21709) 2020-01-09 09:42:20 -08:00
Kilian Valkhof
bd923838c1 docs: initial document for comparing web embeds (#20478)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2020-01-09 09:29:22 -08:00
Shelley Vohr
bb054716c9 feat: allow http-parser NODE_OPTION in packaged apps (#21694) 2020-01-09 08:09:14 -08:00
Electron Bot
75e39be916 Bump v9.0.0-nightly.20200109 2020-01-09 07:31:24 -08:00
Electron Bot
349da6af7f Bump v9.0.0-nightly.20200108 2020-01-08 07:31:48 -08:00
Samuel Attard
e18acb4380 build: document electron goma usage and add the external binaries (#21622) 2020-01-07 10:35:52 -08:00
Shogun Sea
0a850fbc5d docs: Update react devtool version in document (#21601)
* docs: update react devtool version in document

* bump react devtool version ref to 4.3.0
2020-01-07 09:14:49 -05:00
Milan Burda
31c93fec67 fix: load window-setup in sandboxed renderer (#21416) 2020-01-06 22:23:03 +01:00
Shelley Vohr
d56f67b7af refactor: throw error for getLastCrashReport if crashReporter not started (#21643) 2020-01-06 11:00:27 -05:00
Electron Bot
7d2c97b671 Bump v9.0.0-nightly.20200106 2020-01-06 07:33:51 -08:00
Electron Bot
fb1131d531 Bump v9.0.0-nightly.20200105 2020-01-05 07:31:32 -08:00
Electron Bot
1abd24aa28 Bump v9.0.0-nightly.20200104 2020-01-04 07:33:32 -08:00
Kilian Valkhof
8dc4a20069 docs: fix typos in security.md (#21665) 2020-01-03 11:11:01 -05:00
Angel_Kitty
70029aa069 chore: update license year (#21657) 2020-01-03 11:10:23 -05:00
Electron Bot
b2071d2966 Bump v9.0.0-nightly.20200103 2020-01-03 07:31:59 -08:00
Electron Bot
35a7f76205 Bump v9.0.0-nightly.20200102 2020-01-02 07:31:08 -08:00
Electron Bot
55d8c4d937 Bump v9.0.0-nightly.20200101 2020-01-01 07:31:32 -08:00
Electron Bot
7b4a5a9f3a Bump v9.0.0-nightly.20191231 2019-12-31 07:32:05 -08:00
Shelley Vohr
fbb10beb40 fix: highlight defaulted button correctly (#21642) 2019-12-31 05:48:43 -08:00
Lutz Roeder
ed6a3877a4 fix: SimpleURLLoaderWrapper redirects (#21630) 2019-12-31 10:47:08 +11:00
Shelley Vohr
181eecd03e docs: fix shell.openPath documentation (#21641) 2019-12-30 11:40:30 -08:00
David Sanders
85382d8f1d fix: improve error handling in npm install (#21589)
* fix: improve error handling in npm install

* chore: simplify logic
2019-12-30 09:48:54 -08:00
Electron Bot
b41fb2e554 Bump v9.0.0-nightly.20191230 2019-12-30 07:32:58 -08:00
314 changed files with 4097 additions and 1304 deletions

285
BUILD.gn
View File

@@ -79,15 +79,11 @@ npm_action("build_electron_definitions") {
args = [ rebase_path("$target_gen_dir/tsc/typings/electron.d.ts") ]
inputs = auto_filenames.api_docs + [ "yarn.lock" ]
outputs = [
"$target_gen_dir/tsc/typings/electron.d.ts",
]
outputs = [ "$target_gen_dir/tsc/typings/electron.d.ts" ]
}
webpack_build("electron_browser_bundle") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.browser_bundle_deps
@@ -96,9 +92,7 @@ webpack_build("electron_browser_bundle") {
}
webpack_build("electron_renderer_bundle") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.renderer_bundle_deps
@@ -107,9 +101,7 @@ webpack_build("electron_renderer_bundle") {
}
webpack_build("electron_worker_bundle") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.worker_bundle_deps
@@ -118,9 +110,7 @@ webpack_build("electron_worker_bundle") {
}
webpack_build("electron_sandboxed_renderer_bundle") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.sandbox_bundle_deps
@@ -129,9 +119,7 @@ webpack_build("electron_sandboxed_renderer_bundle") {
}
webpack_build("electron_isolated_renderer_bundle") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.isolated_bundle_deps
@@ -140,9 +128,7 @@ webpack_build("electron_isolated_renderer_bundle") {
}
webpack_build("electron_content_script_bundle") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.content_script_bundle_deps
@@ -155,9 +141,7 @@ copy("atom_js2c_copy") {
"lib/common/asar.js",
"lib/common/asar_init.js",
]
outputs = [
"$target_gen_dir/js2c/{{source_file_part}}",
]
outputs = [ "$target_gen_dir/js2c/{{source_file_part}}" ]
}
action("atom_js2c") {
@@ -173,11 +157,11 @@ action("atom_js2c") {
webpack_sources = [
"$target_gen_dir/js2c/browser_init.js",
"$target_gen_dir/js2c/renderer_init.js",
"$target_gen_dir/js2c/worker_init.js",
"$target_gen_dir/js2c/content_script_bundle.js",
"$target_gen_dir/js2c/isolated_bundle.js",
"$target_gen_dir/js2c/renderer_init.js",
"$target_gen_dir/js2c/sandbox_bundle.js",
"$target_gen_dir/js2c/worker_init.js",
]
sources = webpack_sources + [
@@ -186,9 +170,7 @@ action("atom_js2c") {
]
inputs = sources + [ "//third_party/electron_node/tools/js2c.py" ]
outputs = [
"$root_gen_dir/atom_natives.cc",
]
outputs = [ "$root_gen_dir/atom_natives.cc" ]
script = "tools/js2c.py"
args = [ rebase_path("//third_party/electron_node") ] +
@@ -199,9 +181,7 @@ action("atom_js2c") {
target_gen_default_app_js = "$target_gen_dir/js/default_app"
typescript_build("default_app_js") {
deps = [
":build_electron_definitions",
]
deps = [ ":build_electron_definitions" ]
type_root = rebase_path("$target_gen_dir/tsc/electron/typings")
sources = filenames.default_app_ts_sources
@@ -213,16 +193,12 @@ typescript_build("default_app_js") {
copy("default_app_static") {
sources = filenames.default_app_static_sources
outputs = [
"$target_gen_default_app_js/{{source}}",
]
outputs = [ "$target_gen_default_app_js/{{source}}" ]
}
copy("default_app_octicon_deps") {
sources = filenames.default_app_octicon_sources
outputs = [
"$target_gen_default_app_js/electron/default_app/octicon/{{source_file_part}}",
]
outputs = [ "$target_gen_default_app_js/electron/default_app/octicon/{{source_file_part}}" ]
}
asar("default_app_asar") {
@@ -236,9 +212,7 @@ asar("default_app_asar") {
sources = get_target_outputs(":default_app_js") +
get_target_outputs(":default_app_static") +
get_target_outputs(":default_app_octicon_deps")
outputs = [
"$root_out_dir/resources/default_app.asar",
]
outputs = [ "$root_out_dir/resources/default_app.asar" ]
}
grit("resources") {
@@ -256,20 +230,14 @@ grit("resources") {
"target_gen_dir=" + rebase_path(target_gen_dir, root_build_dir),
]
deps = [
":copy_shell_devtools_discovery_page",
]
deps = [ ":copy_shell_devtools_discovery_page" ]
output_dir = "$target_gen_dir"
}
copy("copy_shell_devtools_discovery_page") {
sources = [
"//content/shell/resources/shell_devtools_discovery_page.html",
]
outputs = [
"$target_gen_dir/shell_devtools_discovery_page.html",
]
sources = [ "//content/shell/resources/shell_devtools_discovery_page.html" ]
outputs = [ "$target_gen_dir/shell_devtools_discovery_page.html" ]
}
if (is_linux) {
@@ -315,9 +283,7 @@ source_set("manifests") {
npm_action("electron_version_args") {
script = "generate-version-json"
outputs = [
"$target_gen_dir/electron_version.args",
]
outputs = [ "$target_gen_dir/electron_version.args" ]
args = rebase_path(outputs)
@@ -328,9 +294,7 @@ npm_action("electron_version_args") {
}
templated_file("electron_version_header") {
deps = [
":electron_version_args",
]
deps = [ ":electron_version_args" ]
template = "build/templates/electron_version.tmpl"
output = "$target_gen_dir/electron_version.h"
@@ -662,9 +626,11 @@ source_set("electron_lib") {
"shell/renderer/printing/print_render_frame_helper_delegate.cc",
"shell/renderer/printing/print_render_frame_helper_delegate.h",
]
deps += [ "//components/printing/common:mojo_interfaces" ]
}
public_deps += [ "shell/common/extensions/api:extensions_features" ]
deps += [ "shell/common/extensions/api:extensions_features" ]
deps += [ "shell/common/extensions/api" ]
deps += [
"//components/pref_registry",
"//components/user_prefs",
@@ -712,15 +678,11 @@ if (is_mac) {
electron_version = read_file("ELECTRON_VERSION", "trim string")
mac_xib_bundle_data("electron_xibs") {
sources = [
"shell/common/resources/mac/MainMenu.xib",
]
sources = [ "shell/common/resources/mac/MainMenu.xib" ]
}
bundle_data("electron_framework_resources") {
public_deps = [
":packed_resources",
]
public_deps = [ ":packed_resources" ]
sources = []
if (icu_use_data_file) {
sources += [ "$root_out_dir/icudtl.dat" ]
@@ -735,9 +697,7 @@ if (is_mac) {
sources += [ "$root_out_dir/snapshot_blob.bin" ]
}
}
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
if (!is_component_build) {
@@ -748,9 +708,7 @@ if (is_mac) {
sources += [ "$root_out_dir/libffmpeg.dylib" ]
public_deps += [ "//third_party/ffmpeg:ffmpeg" ]
}
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
}
} else {
group("electron_framework_libraries") {
@@ -763,12 +721,8 @@ if (is_mac) {
"$root_out_dir/egl_intermediates/libEGL.dylib",
"$root_out_dir/egl_intermediates/libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:angle_library_copy",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [ "//ui/gl:angle_library_copy" ]
}
# Add the SwiftShader .dylibs in the Libraries directory of the Framework.
@@ -777,42 +731,28 @@ if (is_mac) {
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/{{source_file_part}}",
]
public_deps = [
"//ui/gl:swiftshader_library_copy",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [ "//ui/gl:swiftshader_library_copy" ]
}
}
group("electron_angle_library") {
if (use_egl) {
deps = [
":electron_angle_binaries",
]
deps = [ ":electron_angle_binaries" ]
}
}
group("electron_swiftshader_library") {
if (use_egl) {
deps = [
":electron_swiftshader_binaries",
]
deps = [ ":electron_swiftshader_binaries" ]
}
}
bundle_data("electron_crashpad_helper") {
sources = [
"$root_out_dir/crashpad_handler",
]
sources = [ "$root_out_dir/crashpad_handler" ]
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
public_deps = [
"//third_party/crashpad/crashpad/handler:crashpad_handler",
]
public_deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
}
mac_framework_bundle("electron_framework") {
@@ -870,9 +810,7 @@ if (is_mac) {
assert(defined(invoker.helper_name_suffix))
output_name = electron_helper_name + invoker.helper_name_suffix
deps = [
":electron_framework+link",
]
deps = [ ":electron_framework+link" ]
if (!is_mas_build) {
deps += [ "//sandbox/mac:seatbelt" ]
}
@@ -906,9 +844,7 @@ if (is_mac) {
}
bundle_data("electron_app_framework_bundle_data") {
sources = [
"$root_out_dir/$electron_framework_name.framework",
]
sources = [ "$root_out_dir/$electron_framework_name.framework" ]
if (!is_mas_build) {
sources += [
"external_binaries/Mantle.framework",
@@ -916,12 +852,8 @@ if (is_mac) {
"external_binaries/Squirrel.framework",
]
}
outputs = [
"{{bundle_contents_dir}}/Frameworks/{{source_file_part}}",
]
public_deps = [
":electron_framework+link",
]
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
public_deps = [ ":electron_framework+link" ]
foreach(helper_params, content_mac_helpers) {
sources +=
@@ -941,15 +873,10 @@ if (is_mac) {
}
bundle_data("electron_login_helper_app") {
public_deps = [
":electron_login_helper",
]
sources = [
"$root_out_dir/$electron_login_helper_name.app",
]
outputs = [
"{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}",
]
public_deps = [ ":electron_login_helper" ]
sources = [ "$root_out_dir/$electron_login_helper_name.app" ]
outputs =
[ "{{bundle_contents_dir}}/Library/LoginItems/{{source_file_part}}" ]
}
action("electron_app_lproj_dirs") {
@@ -964,15 +891,9 @@ if (is_mac) {
foreach(locale, locales_as_mac_outputs) {
bundle_data("electron_app_strings_${locale}_bundle_data") {
sources = [
"$target_gen_dir/app_infoplist_strings/$locale.lproj",
]
outputs = [
"{{bundle_resources_dir}}/$locale.lproj",
]
public_deps = [
":electron_app_lproj_dirs",
]
sources = [ "$target_gen_dir/app_infoplist_strings/$locale.lproj" ]
outputs = [ "{{bundle_resources_dir}}/$locale.lproj" ]
public_deps = [ ":electron_app_lproj_dirs" ]
}
}
group("electron_app_strings_bundle_data") {
@@ -991,9 +912,7 @@ if (is_mac) {
"$root_out_dir/resources/default_app.asar",
"shell/browser/resources/mac/electron.icns",
]
outputs = [
"{{bundle_resources_dir}}/{{source_file_part}}",
]
outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
}
mac_app_bundle("electron_app") {
@@ -1024,9 +943,7 @@ if (is_mac) {
binary = "$root_out_dir/$electron_framework_name.framework/Versions/$electron_framework_version/$electron_framework_name"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/$electron_framework_name.dSYM/Contents/Resources/DWARF/$electron_framework_name"
deps = [
":electron_framework",
]
deps = [ ":electron_framework" ]
}
foreach(helper_params, content_mac_helpers) {
@@ -1037,9 +954,7 @@ if (is_mac) {
binary = "$root_out_dir/$electron_helper_name${_helper_suffix}.app/Contents/MacOS/$electron_helper_name${_helper_suffix}"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/$electron_helper_name${_helper_suffix}.dSYM/Contents/Resources/DWARF/$electron_helper_name${_helper_suffix}"
deps = [
":electron_helper_app_${_helper_target}",
]
deps = [ ":electron_helper_app_${_helper_target}" ]
}
}
@@ -1047,18 +962,15 @@ if (is_mac) {
binary = "$root_out_dir/$electron_product_name.app/Contents/MacOS/$electron_product_name"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/$electron_product_name.dSYM/Contents/Resources/DWARF/$electron_product_name"
deps = [
":electron_app",
]
deps = [ ":electron_app" ]
}
extract_symbols("swiftshader_egl_syms") {
binary = "$root_out_dir/libswiftshader_libEGL.dylib"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/libswiftshader_libEGL.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libEGL.dylib"
deps = [
"//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
]
deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
}
extract_symbols("swiftshader_gles_syms") {
@@ -1074,9 +986,7 @@ if (is_mac) {
binary = "$root_out_dir/crashpad_handler"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/crashpad_handler.dSYM/Contents/Resources/DWARF/crashpad_handler"
deps = [
"//third_party/crashpad/crashpad/handler:crashpad_handler",
]
deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
}
group("electron_symbols") {
@@ -1137,9 +1047,7 @@ if (is_mac) {
data += [ "$root_out_dir/resources/default_app.asar" ]
}
public_deps = [
"//tools/v8_context_snapshot:v8_context_snapshot",
]
public_deps = [ "//tools/v8_context_snapshot:v8_context_snapshot" ]
if (is_win) {
sources += [
@@ -1196,17 +1104,14 @@ if (is_mac) {
extract_symbols("electron_app_symbols") {
binary = "$root_out_dir/$electron_project_name$_target_executable_suffix"
symbol_dir = "$root_out_dir/breakpad_symbols"
deps = [
":electron_app",
]
deps = [ ":electron_app" ]
}
extract_symbols("swiftshader_egl_symbols") {
binary = "$root_out_dir/swiftshader/libEGL$_target_shared_library_suffix"
symbol_dir = "$root_out_dir/breakpad_symbols"
deps = [
"//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL",
]
deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
}
extract_symbols("swiftshader_gles_symbols") {
@@ -1278,9 +1183,7 @@ template("dist_zip") {
action(target_name) {
script = "//electron/build/zip.py"
deps = [
":$_runtime_deps_target",
]
deps = [ ":$_runtime_deps_target" ]
forward_variables_from(invoker,
[
"outputs",
@@ -1299,73 +1202,51 @@ template("dist_zip") {
}
copy("electron_license") {
sources = [
"LICENSE",
]
outputs = [
"$root_build_dir/{{source_file_part}}",
]
sources = [ "LICENSE" ]
outputs = [ "$root_build_dir/{{source_file_part}}" ]
}
copy("chromium_licenses") {
deps = [
"//components/resources:about_credits",
]
sources = [
"$root_gen_dir/components/resources/about_credits.html",
]
outputs = [
"$root_build_dir/LICENSES.chromium.html",
]
deps = [ "//components/resources:about_credits" ]
sources = [ "$root_gen_dir/components/resources/about_credits.html" ]
outputs = [ "$root_build_dir/LICENSES.chromium.html" ]
}
group("licenses") {
data_deps = [
":electron_license",
":chromium_licenses",
":electron_license",
]
}
copy("electron_version") {
sources = [
"ELECTRON_VERSION",
]
outputs = [
"$root_build_dir/version",
]
sources = [ "ELECTRON_VERSION" ]
outputs = [ "$root_build_dir/version" ]
}
dist_zip("electron_dist_zip") {
data_deps = [
":electron_app",
":licenses",
":electron_version",
":licenses",
]
if (is_linux) {
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
}
outputs = [
"$root_build_dir/dist.zip",
]
outputs = [ "$root_build_dir/dist.zip" ]
}
dist_zip("electron_ffmpeg_zip") {
data_deps = [
"//third_party/ffmpeg",
]
outputs = [
"$root_build_dir/ffmpeg.zip",
]
data_deps = [ "//third_party/ffmpeg" ]
outputs = [ "$root_build_dir/ffmpeg.zip" ]
}
dist_zip("electron_chromedriver_zip") {
testonly = true
data_deps = [
"//chrome/test/chromedriver",
":licenses",
"//chrome/test/chromedriver",
]
outputs = [
"$root_build_dir/chromedriver.zip",
]
outputs = [ "$root_build_dir/chromedriver.zip" ]
}
mksnapshot_deps = [
@@ -1380,31 +1261,21 @@ group("electron_mksnapshot") {
dist_zip("electron_mksnapshot_zip") {
data_deps = mksnapshot_deps
outputs = [
"$root_build_dir/mksnapshot.zip",
]
outputs = [ "$root_build_dir/mksnapshot.zip" ]
}
copy("hunspell_dictionaries") {
sources = hunspell_dictionaries + hunspell_licenses
outputs = [
"$target_gen_dir/electron_hunspell/{{source_file_part}}",
]
outputs = [ "$target_gen_dir/electron_hunspell/{{source_file_part}}" ]
}
dist_zip("hunspell_dictionaries_zip") {
data_deps = [
":hunspell_dictionaries",
]
data_deps = [ ":hunspell_dictionaries" ]
flatten = true
outputs = [
"$root_build_dir/hunspell_dictionaries.zip",
]
outputs = [ "$root_build_dir/hunspell_dictionaries.zip" ]
}
group("electron") {
public_deps = [
":electron_app",
]
public_deps = [ ":electron_app" ]
}

9
DEPS
View File

@@ -6,14 +6,15 @@ gclient_gn_args = [
'checkout_libaom',
'checkout_nacl',
'checkout_oculus_sdk',
'checkout_openxr'
'checkout_openxr',
'checkout_google_benchmark'
]
vars = {
'chromium_version':
'd0c764fc71894cc24d3bb17a7406ba6c6cc6dc29',
'f707f1d6d428f84cf14b64bc2ca74372e25c6ce7',
'node_version':
'v12.14.0',
'v12.14.1',
'nan_version':
'2ee313aaca52e2b478965ac50eb5082520380d1b',
@@ -69,6 +70,8 @@ vars = {
False,
'checkout_android_native_support':
False,
'checkout_google_benchmark':
False,
}
deps = {

View File

@@ -1 +1 @@
9.0.0-nightly.20191229
9.0.0-nightly.20200121

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2019 GitHub Inc.
Copyright (c) 2013-2020 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

2
build/args/goma.gn Normal file
View File

@@ -0,0 +1,2 @@
goma_dir = rebase_path("//electron/external_binaries/goma")
use_goma = true

View File

@@ -34,9 +34,7 @@ template("extract_symbols") {
dump_syms_binary,
]
stamp_file = "${target_gen_dir}/${target_name}.stamp"
outputs = [
stamp_file,
]
outputs = [ stamp_file ]
args = [
"./" + rebase_path(dump_syms_binary, root_build_dir),
rebase_path(invoker.binary, root_build_dir),

View File

@@ -10,9 +10,7 @@ template("npm_action") {
]
script = "//electron/build/npm-run.py"
outputs = [
"$target_gen_dir/npm_pre_stamps/" + target_name + ".stamp",
]
outputs = [ "$target_gen_dir/npm_pre_stamps/" + target_name + ".stamp" ]
args = [
"--silent",

View File

@@ -81,9 +81,7 @@ template("mac_xib_bundle_data") {
"visibility",
])
public_deps = [
":$_compile_target_name",
]
public_deps = [ ":$_compile_target_name" ]
sources = get_target_outputs(":$_compile_target_name")
_output_path = "{{bundle_resources_dir}}"
@@ -91,8 +89,6 @@ template("mac_xib_bundle_data") {
_output_path = invoker.output_path
}
outputs = [
"$_output_path/{{source_file_part}}",
]
outputs = [ "$_output_path/{{source_file_part}}" ]
}
}

View File

@@ -15,12 +15,8 @@ template("templated_file") {
"inputs",
"outputs",
])
inputs = [
invoker.template,
]
outputs = [
invoker.output,
]
inputs = [ invoker.template ]
outputs = [ invoker.output ]
script = "//electron/build/generate-template.py"
args = [
rebase_path(invoker.template),

View File

@@ -27,8 +27,6 @@ template("webpack_build") {
rebase_path(invoker.out_file),
]
outputs = [
invoker.out_file,
]
outputs = [ invoker.out_file ]
}
}

View File

@@ -68,6 +68,7 @@ static_library("chrome") {
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/browser/ssl:proto",
"//components/feature_engagement:buildflags",
]
@@ -184,9 +185,9 @@ static_library("chrome") {
"//chrome/services/printing:lib",
"//components/printing/browser",
"//components/printing/renderer",
"//components/services/pdf_compositor",
"//components/services/pdf_compositor/public/cpp",
"//components/services/pdf_compositor/public/mojom",
"//components/services/print_compositor",
"//components/services/print_compositor/public/cpp",
"//components/services/print_compositor/public/mojom",
]
deps += [
@@ -229,6 +230,15 @@ static_library("chrome") {
"//components/vector_icons:vector_icons",
]
}
if (enable_electron_extensions) {
sources += [
"//chrome/renderer/extensions/extension_hooks_delegate.cc",
"//chrome/renderer/extensions/extension_hooks_delegate.h",
"//chrome/renderer/extensions/tabs_hooks_delegate.cc",
"//chrome/renderer/extensions/tabs_hooks_delegate.h",
]
}
}
source_set("plugins") {

View File

@@ -1,33 +0,0 @@
## Docs Translations
This directory once contained unstructured translations of Electron's
documentation, but has been deprecated in favor of a new translation process
using [Crowdin], a GitHub-friendly platform for collaborative translation.
For more details, visit the [electron/i18n] repo.
## Contributing
If you're interested in helping translate Electron's docs, visit
[Crowdin] and log in with your GitHub account. And thanks!
## Offline Docs
If you miss having access to Electron's raw markdown files in your preferred
language, don't fret! You can still get raw docs, they're just in a
different place now. See [electron/i18n/tree/master/content]
To more easily view and browse offline docs in your language, clone the repo and use [vmd],
an Electron-based GitHub-styled markdown viewer:
```sh
npm i -g vmd
git clone https://github.com/electron/i18n
vmd electron-i18n/content/zh-CN
```
[crowdin.com/project/electron]: https://crowdin.com/project/electron
[Crowdin]: https://crowdin.com/project/electron
[electron/i18n]: https://github.com/electron/i18n#readme
[electron/i18n/tree/master/content]: https://github.com/electron/i18n/tree/master/content
[vmd]: http://ghub.io/vmd

View File

@@ -53,6 +53,7 @@ an issue:
* [Native File Drag & Drop](tutorial/native-file-drag-drop.md)
* [Offscreen Rendering](tutorial/offscreen-rendering.md)
* [Supporting macOS Dark Mode](tutorial/mojave-dark-mode-guide.md)
* [Web embeds in Electron](tutorial/web-embeds.md)
* [Accessibility](tutorial/accessibility.md)
* [Spectron](tutorial/accessibility.md#spectron)
* [Devtron](tutorial/accessibility.md#devtron)

View File

@@ -116,7 +116,7 @@ However, it is recommended to avoid using the `remote` module altogether.
// main
const { ipcMain, webContents } = require('electron')
const getGuestForWebContents = function (webContentsId, contents) {
const getGuestForWebContents = (webContentsId, contents) => {
const guest = webContents.fromId(webContentsId)
if (!guest) {
throw new Error(`Invalid webContentsId: ${webContentsId}`)

View File

@@ -963,13 +963,10 @@ Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls
on the right edge and 50 pixels of controls below the player. In order to
maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
the player itself we would call this function with arguments of 16/9 and
[ 40, 50 ]. The second argument doesn't care where the extra width and height
{ width: 40, height: 50 }. The second argument doesn't care where the extra width and height
are within the content view--only that they exist. Sum any extra width and
height areas you have within the overall content view.
Calling this function with a value of `0` will remove any previously set aspect
ratios.
#### `win.setBackgroundColor(backgroundColor)`
* `backgroundColor` String - Window's background color as a hexadecimal value,
@@ -1627,12 +1624,9 @@ can still bring up the menu bar by pressing the single `Alt` key.
Returns `Boolean` - Whether the menu bar is visible.
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
#### `win.setVisibleOnAllWorkspaces(visible)`
* `visible` Boolean
* `options` Object (optional)
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
the window should be visible above fullscreen windows
Sets whether the window should be visible on all workspaces.

View File

@@ -48,6 +48,7 @@ Unsupported options are:
```sh
--max-http-header-size
--http-parser
```
### `GOOGLE_API_KEY`

View File

@@ -130,8 +130,7 @@ dynamically changed.
#### `menuItem.label`
A `String` indicating the item's visible label, this property can be
dynamically changed.
A `String` indicating the item's visible label.
#### `menuItem.click`
@@ -165,7 +164,7 @@ item's icon, if set.
#### `menuItem.sublabel`
A `String` indicating the item's sublabel, this property can be dynamically changed.
A `String` indicating the item's sublabel.
#### `menuItem.toolTip` _macOS_
@@ -197,7 +196,9 @@ You can add a `click` function for additional behavior.
#### `menuItem.registerAccelerator`
A `Boolean` indicating if the accelerator should be registered with the
system or just displayed, this property can be dynamically changed.
system or just displayed.
This property can be dynamically changed.
#### `menuItem.commandId`

View File

@@ -519,12 +519,12 @@ A [`Protocol`](protocol.md) object for this session.
const { app, session } = require('electron')
const path = require('path')
app.on('ready', function () {
app.on('ready', () => {
const protocol = session.fromPartition('some-partition').protocol
protocol.registerFileProtocol('atom', function (request, callback) {
var url = request.url.substr(7)
protocol.registerFileProtocol('atom', (request, callback) => {
let url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
}, function (error) {
}, (error) => {
if (error) console.error('Failed to register protocol')
})
})
@@ -537,7 +537,7 @@ A [`NetLog`](net-log.md) object for this session.
```javascript
const { app, session } = require('electron')
app.on('ready', async function () {
app.on('ready', async () => {
const netLog = session.fromPartition('some-partition').netLog
netLog.startLogging('/path/to/net-log')
// After some network events

View File

@@ -28,10 +28,7 @@ Show the given file in a file manager. If possible, select the file.
* `path` String
Returns `Promise<Object>` - Resolve with an object containing the following:
* `success` Boolean - whether or not the path was successfully opened in the desktop's default manner.
* `errorMessage` String (optional) - The error message corresponding to the failure if a failure occurred, otherwise empty string.
Returns `Promise<String>` - Resolves with an string containing the error message corresponding to the failure if a failure occurred, otherwise "".
Open the given file in the desktop's default manner.

View File

@@ -143,6 +143,26 @@ Emitted when a drag operation exits the tray icon.
Emitted when a drag operation ends on the tray or ends at another location.
#### Event: 'mouse-up' _macOS_
Returns:
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `position` [Point](structures/point.md) - The position of the event.
Emitted when the mouse is released from clicking the tray icon.
Note: This will not be emitted if you have set a context menu for your Tray using `tray.setContextMenu`, as a result of macOS-level constraints.
#### Event: 'mouse-down' _macOS_
Returns:
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `position` [Point](structures/point.md) - The position of the event.
Emitted when the mouse clicks the tray icon.
#### Event: 'mouse-enter' _macOS_
Returns:

View File

@@ -987,7 +987,7 @@ Injects CSS into the current web page and returns a unique key for the inserted
stylesheet.
```js
contents.on('did-finish-load', function () {
contents.on('did-finish-load', () => {
contents.insertCSS('html, body { background-color: #f00; }')
})
```
@@ -1002,7 +1002,7 @@ Removes the inserted CSS from the current web page. The stylesheet is identified
by its key, which is returned from `contents.insertCSS(css)`.
```js
contents.on('did-finish-load', async function () {
contents.on('did-finish-load', async () => {
const key = await contents.insertCSS('html, body { background-color: #f00; }')
contents.removeInsertedCSS(key)
})

View File

@@ -146,7 +146,7 @@ response are visible by the time this listener is fired.
* `timestamp` Double
* `statusLine` String
* `statusCode` Integer
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
* `callback` Function
* `headersReceivedResponse` Object
* `cancel` Boolean (optional)
@@ -175,7 +175,7 @@ The `callback` has to be called with a `response` object.
* `resourceType` String
* `referrer` String
* `timestamp` Double
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
* `fromCache` Boolean - Indicates whether the response was fetched from disk
cache.
* `statusCode` Integer
@@ -205,7 +205,7 @@ and response headers are available.
* `ip` String (optional) - The server IP address that the request was
actually sent to.
* `fromCache` Boolean
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
The `listener` will be called with `listener(details)` when a server initiated
redirect is about to occur.
@@ -224,7 +224,7 @@ redirect is about to occur.
* `resourceType` String
* `referrer` String
* `timestamp` Double
* `responseHeaders` Record<string, string> (optional)
* `responseHeaders` Record<string, string[]> (optional)
* `fromCache` Boolean
* `statusCode` Integer
* `statusLine` String

View File

@@ -265,8 +265,7 @@ New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\Lanmanworkstatio
### Stale locks in the git cache
If `gclient sync` is interrupted while using the git cache, it will leave
the cache locked. To remove the lock, pass the `--break_repo_locks` argument to
`gclient sync`.
the cache locked. To remove the lock, pass the `--ignore_locks` argument to `gclient sync`.
### I'm being asked for a username/password for chromium-internal.googlesource.com
If you see a prompt for `Username for 'https://chrome-internal.googlesource.com':` when running `gclient sync` on Windows, it's probably because the `DEPOT_TOOLS_WIN_TOOLCHAIN` environment variable is not set to 0. Open `Control Panel``System and Security``System``Advanced system settings` and add a system variable

View File

@@ -57,7 +57,7 @@ you're currently working on using Mocha's
`.only` to any `describe` or `it` function call:
```js
describe.only('some feature', function () {
describe.only('some feature', () => {
// ... only tests in this block will be run
})
```

63
docs/development/goma.md Normal file
View File

@@ -0,0 +1,63 @@
# Goma
> Goma is a distributed compiler service for open-source projects such as
> Chromium and Android.
Electron has a deployment of a custom Goma Backend that we make available to
all Electron Maintainers. See the [Access](#access) section below for details
on authentication.
## Enabling Goma
Currently Electron Goma supports Windows, Linux, and macOS. If you are
on a supported platform you can enable goma by importing the `goma.gn` config
file when using `gn`.
```bash
gn gen out/Testing --args="import(\"//electron/build/args/testing.gn\") import(\"//electron/build/args/goma.gn\")"
```
You must ensure that you do not have `cc_wrapper` configured, this means you
can't use `sccache` or similar technology.
Before you can use goma to build Electron you need to authenticate against
the Goma service. You only need to do this once per-machine.
```bash
cd electron/external_binaries/goma
./goma_auth.py login
```
Once authenticated you need to make sure the goma daemon is running on your
machine.
```bash
cd electron/external_binaries/goma
./goma_ctl.py ensure_start
```
## Building with Goma
When you are using Goma you can run `ninja` with a substantially higher `j`
value than would normally be supported by your machine.
Please do not set a value higher than **300** on Windows or Linux and
**80** on macOS, we monitor the goma system and users found to be abusing
it with unreasonable concurrency will be de-activated.
```bash
ninja -C out/Testing electron -j 200
```
## Monitoring Goma
If you access [http://localhost:8088](http://localhost:8088) on your local
machine you can monitor compile jobs as they flow through the goma system.
## Access
For security and cost reasons access to Electron Goma is currently restricted
to Electron Maintainers. If you want access please head to `#access-requests` in
Slack and ping `@goma-squad` to ask for access. Please be aware that being a
maintainer does not *automatically* grant access and access is determined on a
case by case basis.

View File

@@ -11,7 +11,48 @@ to understand the source code better.
```diff
Electron
├── atom/ - C++ source code.
├── build/ - Build configuration files needed to build with GN.
├── buildflags/ - Determines the set of features that can be conditionally built.
├── chromium_src/ - Source code copied from Chromium that isn't part of the content layer.
├── default_app/ - A default app run when Electron is started without
| providing a consumer app.
├── docs/ - Electron's documentation.
| ├── api/ - Documentation for Electron's externally-facing modules and APIs.
| ├── development/ - Documentation to aid in developing for and with Electron.
| ├── fiddles/ - A set of code snippets one can run in Electron Fiddle.
| ├── images/ - Images used in documentation.
| └── tutorial/ - Tutorial documents for various aspects of Electron.
├── lib/ - JavaScript/TypeScript source code.
| ├── browser/ - Main process initialization code.
| | ├── api/ - API implementation for main process modules.
| | └── remote/ - Code related to the remote module as it is
| | used in the main process.
| ├── common/ - Relating to logic needed by both main and renderer processes.
| | └── api/ - API implementation for modules that can be used in
| | both the main and renderer processes
| ├── isolated_renderer/ - Handles creation of isolated renderer processes when
| | contextIsolation is enabled.
| ├── renderer/ - Renderer process initialization code.
| | ├── api/ - API implementation for renderer process modules.
| | ├── extension/ - Code related to use of Chrome Extensions
| | | in Electron's renderer process.
| | ├── remote/ - Logic that handes use of the remote module in
| | | the main process.
| | └── web-view/ - Logic that handles the use of webviews in the
| | renderer process.
| ├── sandboxed_renderer/ - Logic that handles creation of sandboxed renderer
| | | processes.
| | └── api/ - API implementation for sandboxed renderer processes.
| └── worker/ - Logic that handles proper functionality of Node.js
| environments in Web Workers.
├── patches/ - Patches applied on top of Electron's core dependencies
| | in order to handle differences between our use cases and
| | default functionality.
| ├── boringssl/ - Patches applied to Google's fork of OpenSSL, BoringSSL.
| ├── chromium/ - Patches applied to Chromium.
| ├── node/ - Patches applied on top of Node.js.
| └── v8/ - Patches applied on top of Google's V8 engine.
├── shell/ - C++ source code.
| ├── app/ - System entry code.
| ├── browser/ - The frontend including the main window, UI, and all of the
| | | main process things. This talks to the renderer to manage web
@@ -31,49 +72,36 @@ Electron
| | message loop into Chromium's message loop.
| └── api/ - The implementation of common APIs, and foundations of
| Electron's built-in modules.
├── chromium_src/ - Source code copied from Chromium. See below.
├── default_app/ - The default page to show when Electron is started without
| providing an app.
├── docs/ - Documentations.
├── lib/ - JavaScript source code.
| ├── browser/ - Javascript main process initialization code.
| | └── api/ - Javascript API implementation.
| ├── common/ - JavaScript used by both the main and renderer processes
| | └── api/ - Javascript API implementation.
| └── renderer/ - Javascript renderer process initialization code.
| └── api/ - Javascript API implementation.
├── spec/ - Automatic tests.
├── spec/ - Components of Electron's test suite run in the renderer process.
├── spec-main/ - Components of Electron's test suite run in the main process.
└── BUILD.gn - Building rules of Electron.
```
## `/chromium_src`
The files in `/chromium_src` tend to be pieces of Chromium that aren't part of
the content layer. For example to implement Pepper API, we need some wiring
similar to what official Chrome does. We could have built the relevant
sources as a part of [libcc](../glossary.md#libchromiumcontent) but most
often we don't require all the features (some tend to be proprietary,
analytics stuff) so we took parts of the code. These could have easily
been patches in libcc, but at the time when these were written the goal of
libcc was to maintain very minimal patches and chromium_src changes tend to be
big ones. Also, note that these patches can never be upstreamed unlike other
libcc patches we maintain now.
## Structure of Other Directories
* **script** - Scripts used for development purpose like building, packaging,
testing, etc.
* **tools** - Helper scripts used by GN files, unlike `script`, scripts put
here should never be invoked by users directly.
* **vendor** - Source code of third party dependencies, we didn't use
`third_party` as name because it would confuse it with the same directory in
Chromium's source code tree.
* **node_modules** - Third party node modules used for building.
* **out** - Temporary output directory of `ninja`.
* **.circleci** - Config file for CI with CircleCI.
* **.github** - GitHub-specific config files including issues templates and CODEOWNERS.
* **dist** - Temporary directory created by `script/create-dist.py` script
when creating a distribution.
* **external_binaries** - Downloaded binaries of third-party frameworks which
do not support building with `gn`.
* **node_modules** - Third party node modules used for building.
* **npm** - Logic for installation of Electron via npm.
* **out** - Temporary output directory of `ninja`.
* **script** - Scripts used for development purpose like building, packaging,
testing, etc.
```diff
script/ - The set of all scripts Electron runs for a variety of purposes.
├── codesign/ - Fakes codesigning for Electron apps; used for testing.
├── lib/ - Miscellaneous python utility scripts.
└── release/ - Scripts run during Electron's release process.
├── notes/ - Generates release notes for new Electron versions.
└── uploaders/ - Uploads various release-related files during release.
```
* **tools** - Helper scripts used by GN files.
* Scripts put here should never be invoked by users directly, unlike those in `script`.
* **typings** - TypeScript typings for Electron's internal code.
* **vendor** - Source code for some third party dependencies, including `boto` and `requests`.
## Keeping Git Submodules Up to Date

View File

@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Frameless window</title>
</head>
<body>
<div>
<h1>Create and Manage Windows</h1>
<h3>
The <code>BrowserWindow</code> module in Electron allows you to create a
new browser window or manage an existing one.
</h3>
<p>
Each browser window is a separate process, known as the renderer
process. This process, like the main process that controls the life
cycle of the app, has full access to the Node.js APIs.
</p>
<p>
Open the
<a href="http://electron.atom.io/docs/api/browser-window">
full API documentation (opens in new window)
</a>
in your browser.
</p>
</div>
<div>
<div>
<h2>Create a frameless window</h2>
<div>
<div>
<button id="frameless-window">View Demo</button>
</div>
<p>
A frameless window is a window that has no
<a href="https://developer.mozilla.org/en-US/docs/Glossary/Chrome">
"chrome"
</a>
, such as toolbars, title bars, status bars, borders, etc. You can
make a browser window frameless by setting <code>frame</code> to
<code>false</code> when creating the window.
</p>
<p>
Windows can have a transparent background, too. By setting the
<code>transparent</code> option to <code>true</code>, you can also
make your frameless window transparent:
</p>
<pre>
<code class="language-js">var win = new BrowserWindow({
transparent: true,
frame: false
})</code></pre>
<p>
For more details, see the
<a href="http://electron.atom.io/docs/api/frameless-window/">
Frameless Window
</a>
documentation.
</p>
</div>
</div>
</div>
<script>
// You can also require other files to run in this process
require("./renderer.js");
</script>
</body>
</html>

View File

@@ -0,0 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -0,0 +1,25 @@
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const framelessWindowBtn = document.getElementById('frameless-window')
const links = document.querySelectorAll('a[href]')
framelessWindowBtn.addEventListener('click', (event) => {
const modalPath = 'https://electronjs.org'
let win = new BrowserWindow({ frame: false })
win.on('close', () => { win = null })
win.loadURL(modalPath)
win.show()
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Manage window state</title>
</head>
<body>
<div>
<h1>Create and Manage Windows</h1>
<h3>
The <code>BrowserWindow</code> module in Electron allows you to create a
new browser window or manage an existing one.
</h3>
<p>
Each browser window is a separate process, known as the renderer
process. This process, like the main process that controls the life
cycle of the app, has full access to the Node.js APIs.
</p>
<p>
Open the
<a href="http://electron.atom.io/docs/api/browser-window">
full API documentation (opens in new window)
</a>
in your browser.
</p>
</div>
<div>
<div>
<h2>Manage window state</h2>
<div>
<div>
<button id="manage-window">View Demo</button>
<span id="manage-window-reply"></span>
</div>
<p>
In this demo we create a new window and listen for
<code>move</code> and <code>resize</code> events on it. Click the
demo button, change the new window and see the dimensions and
position update here, above.
</p>
<p>
There are a lot of methods for controlling the state of the window
such as the size, location, and focus status as well as events to
listen to for window changes. Visit the
<a href="http://electron.atom.io/docs/api/browser-window">
documentation (opens in new window)
</a>
for the full list.
</p>
</div>
</div>
</div>
<script>
// You can also require other files to run in this process
require("./renderer.js");
</script>
</body>
</html>

View File

@@ -0,0 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -0,0 +1,35 @@
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const manageWindowBtn = document.getElementById('manage-window')
const links = document.querySelectorAll('a[href]')
let win
manageWindowBtn.addEventListener('click', (event) => {
const modalPath = 'https://electronjs.org'
win = new BrowserWindow({ width: 400, height: 275 })
win.on('resize', updateReply)
win.on('move', updateReply)
win.on('close', () => { win = null })
win.loadURL(modalPath)
win.show()
function updateReply () {
const manageWindowReply = document.getElementById('manage-window-reply')
const message = `Size: ${win.getSize()} Position: ${win.getPosition()}`
manageWindowReply.innerText = message
}
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<h2>Create a new window</h2>
<h3>Supports: Win, MacOS, Linux <span>|</span> Process: Main</h3>
<button id="new-window">View Demo</button>
<p>The <code>BrowserWindow</code> module gives you the ability to create new windows in your app. This main process module can be used from the renderer process with the <code>remote</code> module, as is shown in this demo.</p>
<p>There are a lot of options when creating a new window. A few are in this demo, but visit the <a id="browser-window-link" href="">documentation<span>(opens in new window)</span></a>
<div>
<h2>ProTip</h2>
<strong>Use an invisible browser window to run background tasks.</strong>
<p>You can set a new browser window to not be shown (be invisible) in order to use that additional renderer process as a kind of new thread in which to run JavaScript in the background of your app. You do this by setting the <code>show</code> property to <code>false</code> when defining the new window.</p>
<pre><code><span>var</span> win = <span>new</span> BrowserWindow({
<span>width</span>: <span>400</span>, <span>height</span>: <span>225</span>, <span>show</span>: <span>false</span>
})</code></pre>
</div>
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>

View File

@@ -0,0 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -0,0 +1,19 @@
const { BrowserWindow } = require('electron').remote
const { shell } = require('electron').remote
const newWindowBtn = document.getElementById('new-window')
const link = document.getElementById('browser-window-link')
newWindowBtn.addEventListener('click', (event) => {
let win = new BrowserWindow({ width: 400, height: 320 })
win.on('close', () => { win = null })
win.loadURL('https://electronjs.org')
win.show()
})
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal("http://electron.atom.io/docs/api/browser-window")
})

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Window events</title>
</head>
<body>
<div>
<h1>Create and Manage Windows</h1>
<h3>
The <code>BrowserWindow</code> module in Electron allows you to create a
new browser window or manage an existing one.
</h3>
<p>
Each browser window is a separate process, known as the renderer
process. This process, like the main process that controls the life
cycle of the app, has full access to the Node.js APIs.
</p>
<p>
Open the
<a href="http://electron.atom.io/docs/api/browser-window">
full API documentation (opens in new window)
</a>
in your browser.
</p>
</div>
<div>
<div>
<h2>Window events</h2>
<div>
<div>
<button id="listen-to-window">View Demo</button>
<button id="focus-on-modal-window">
Focus on Demo
</button>
</div>
<p>
In this demo, we create a new window and listen for
<code>blur</code> event on it. Click the demo button to create a new
modal window, and switch focus back to the parent window by clicking
on it. You can click the <i>Focus on Demo</i> button to switch focus
to the modal window again.
</p>
</div>
</div>
</div>
<script>
// You can also require other files to run in this process
require("./renderer.js");
</script>
</body>
</html>

View File

@@ -0,0 +1,56 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -0,0 +1,48 @@
const { BrowserWindow } = require('electron').remote
const shell = require('electron').shell
const listenToWindowBtn = document.getElementById('listen-to-window')
const focusModalBtn = document.getElementById('focus-on-modal-window')
const links = document.querySelectorAll('a[href]')
let win
listenToWindowBtn.addEventListener('click', () => {
const modalPath = 'https://electronjs.org'
win = new BrowserWindow({ width: 600, height: 400 })
const hideFocusBtn = () => {
focusModalBtn.classList.add('disappear')
focusModalBtn.classList.remove('smooth-appear')
focusModalBtn.removeEventListener('click', clickHandler)
}
const showFocusBtn = (btn) => {
if (!win) return
focusModalBtn.classList.add('smooth-appear')
focusModalBtn.classList.remove('disappear')
focusModalBtn.addEventListener('click', clickHandler)
}
win.on('focus', hideFocusBtn)
win.on('blur', showFocusBtn)
win.on('close', () => {
hideFocusBtn()
win = null
})
win.loadURL(modalPath)
win.show()
const clickHandler = () => { win.focus() }
})
Array.prototype.forEach.call(links, (link) => {
const url = link.getAttribute('href')
if (url.indexOf('http') === 0) {
link.addEventListener('click', (e) => {
e.preventDefault()
shell.openExternal(url)
})
}
})

View File

@@ -5,13 +5,13 @@ To write automated tests for your Electron app, you will need a way to "drive" y
To create a custom driver, we'll use Node.js' [child_process](https://nodejs.org/api/child_process.html) API. The test suite will spawn the Electron process, then establish a simple messaging protocol:
```js
var childProcess = require('child_process')
var electronPath = require('electron')
const childProcess = require('child_process')
const electronPath = require('electron')
// spawn the process
var env = { /* ... */ }
var stdio = ['inherit', 'inherit', 'inherit', 'ipc']
var appProcess = childProcess.spawn(electronPath, ['./app'], { stdio, env })
let env = { /* ... */ }
let stdio = ['inherit', 'inherit', 'inherit', 'ipc']
let appProcess = childProcess.spawn(electronPath, ['./app'], { stdio, env })
// listen for IPC messages from the app
appProcess.on('message', (msg) => {
@@ -50,7 +50,7 @@ class TestDriver {
// handle rpc responses
this.process.on('message', (message) => {
// pop the handler
var rpcCall = this.rpcCalls[message.msgId]
let rpcCall = this.rpcCalls[message.msgId]
if (!rpcCall) return
this.rpcCalls[message.msgId] = null
// reject/resolve
@@ -70,7 +70,7 @@ class TestDriver {
// to use: driver.rpc('method', 1, 2, 3).then(...)
async rpc (cmd, ...args) {
// send rpc request
var msgId = this.rpcCalls.length
let msgId = this.rpcCalls.length
this.process.send({ msgId, cmd, args })
return new Promise((resolve, reject) => this.rpcCalls.push({ resolve, reject }))
}
@@ -89,13 +89,13 @@ if (process.env.APP_TEST_DRIVER) {
}
async function onMessage ({ msgId, cmd, args }) {
var method = METHODS[cmd]
let method = METHODS[cmd]
if (!method) method = () => new Error('Invalid method: ' + cmd)
try {
var resolve = await method(...args)
let resolve = await method(...args)
process.send({ msgId, resolve })
} catch (err) {
var reject = {
let reject = {
message: err.message,
stack: err.stack,
name: err.name
@@ -116,10 +116,10 @@ const METHODS = {
Then, in your test suite, you can use your test-driver as follows:
```js
var test = require('ava')
var electronPath = require('electron')
const test = require('ava')
const electronPath = require('electron')
var app = new TestDriver({
let app = new TestDriver({
path: electronPath,
args: ['./app'],
env: {

View File

@@ -34,7 +34,7 @@ Using the [React Developer Tools][react-devtools] as example:
const os = require('os')
BrowserWindow.addDevToolsExtension(
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/0.15.0_0')
path.join(os.homedir(), '/Library/Application Support/Google/Chrome/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/4.3.0_0')
)
```

View File

@@ -37,7 +37,7 @@ inAppPurchase.on('transactions-updated', (event, transactions) => {
// Check each transaction.
transactions.forEach(function (transaction) {
var payment = transaction.payment
let payment = transaction.payment
switch (transaction.transactionState) {
case 'purchasing':

View File

@@ -54,7 +54,7 @@ const { app, BrowserWindow, ipcMain } = require('electron')
let onlineStatusWindow
app.on('ready', () => {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false, webPreferences: { nodeIntegration: true } })
onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)
})

View File

@@ -241,7 +241,7 @@ prevent the use of Node primitives, `contextIsolation` must also be used.
### Why?
Context isolation allows each the scripts on running in the renderer to make
Context isolation allows each of the scripts running in the renderer to make
changes to its JavaScript environment without worrying about conflicting with
the scripts in the Electron API or the preload script.
@@ -422,8 +422,6 @@ on a page directly in the markup using a `<meta>` tag:
<meta http-equiv="Content-Security-Policy" content="default-src 'none'">
```
#### `webRequest.onHeadersReceived([filter, ]listener)`
## 7) Do Not Set `allowRunningInsecureContent` to `true`

View File

@@ -0,0 +1,22 @@
# Web embeds in Electron
If you want to embed (third party) web content in an Electron `BrowserWindow`, there are three options available to you: `<iframe>` tags, `<webview>` tags, and `BrowserViews`. Each one offers slightly different functionality and is useful in different situations. To help you choose between these, this guide will explain the differences and capabilities of each.
## Iframes
Iframes in Electron behave like iframes in regular browsers. An `<iframe>` element in your page can show external web pages, provided that their [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) allows it. To limit the amount of capabilities a site in an `<iframe>` tag, it's recommended to use the [`sandbox` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) and only allow the capabilities you want to support.
## WebViews
[WebViews](../api/webview-tag.md) are based on Chromium's WebViews and are not explicitly supported by Electron. We do not guarantee that the WebView API will remain available in future versions of Electron. This is why, if you want to use `<webview>` tags, you will need to set `webviewTag` to `true` in the `webPreferences` of your `BrowserWindow`.
WebViews are a custom element (`<webview>`) that will only work inside Electron.
They are implemented as an "out-of-process iframe". This means that all communication with the `<webview>` is done asynchronously using IPC. The `<webview>` element has many custom methods and events, similar to `webContents`, that allow you much greater control over the contents.
Compared to an `<iframe>`, `<webview>` tends to be slightly slower but offers much greater control in loading and communicating with the third party content and handling various events.
## BrowserViews
[BrowserViews](../api/browser-view.md) are not part of the DOM - instead, they are created in and controlled by your main process. They are simply another layer of web content on top of your existing window. This means that they are completely separate from your own `BrowserWindow` content and that their position is not controlled by the DOM or CSS but by setting the bounds in the main process.
BrowserViews offer the greatest control over their contents, since they implement the `webContents` similarly to how a `BrowserWindow` implements it. However, they are not part of your DOM but are overlaid on top of them, which means you will have to manage their position manually.

View File

@@ -1,4 +1,5 @@
import("//build/config/locales.gni")
import("//electron/buildflags/buildflags.gni")
import("//printing/buildflags/buildflags.gni")
import("//tools/grit/repack.gni")
import("//ui/base/ui_features.gni")
@@ -87,6 +88,13 @@ template("electron_extra_paks") {
sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ]
deps += [ "//chrome/browser/resources:print_preview_resources" ]
}
if (enable_electron_extensions) {
sources += [
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
"$root_gen_dir/extensions/extensions_resources.pak",
]
deps += [ "//extensions:extensions_resources" ]
}
}
}

View File

@@ -165,6 +165,7 @@ auto_filenames = {
"lib/renderer/web-view/web-view-element.ts",
"lib/renderer/web-view/web-view-impl.ts",
"lib/renderer/web-view/web-view-init.ts",
"lib/renderer/window-setup.ts",
"lib/sandboxed_renderer/api/exports/electron.ts",
"lib/sandboxed_renderer/api/module-list.ts",
"lib/sandboxed_renderer/init.js",

View File

@@ -14,11 +14,11 @@ filenames = {
default_app_octicon_sources = [
"node_modules/@primer/octicons/build/build.css",
"node_modules/@primer/octicons/build/svg/gear.svg",
"node_modules/@primer/octicons/build/svg/gift.svg",
"node_modules/@primer/octicons/build/svg/gist.svg",
"node_modules/@primer/octicons/build/svg/mark-github.svg",
"node_modules/@primer/octicons/build/svg/gear.svg",
"node_modules/@primer/octicons/build/svg/star.svg",
"node_modules/@primer/octicons/build/svg/gift.svg",
]
lib_sources = [
@@ -124,9 +124,9 @@ filenames = {
"shell/browser/api/save_page_handler.cc",
"shell/browser/api/save_page_handler.h",
"shell/browser/atom_autofill_driver.cc",
"shell/browser/atom_autofill_driver.h",
"shell/browser/atom_autofill_driver_factory.cc",
"shell/browser/atom_autofill_driver_factory.h",
"shell/browser/atom_autofill_driver.h",
"shell/browser/atom_browser_client.cc",
"shell/browser/atom_browser_client.h",
"shell/browser/atom_browser_context.cc",
@@ -186,10 +186,10 @@ filenames = {
"shell/browser/linux/unity_service.h",
"shell/browser/login_handler.cc",
"shell/browser/login_handler.h",
"shell/browser/mac/atom_application_delegate.h",
"shell/browser/mac/atom_application_delegate.mm",
"shell/browser/mac/atom_application.h",
"shell/browser/mac/atom_application.mm",
"shell/browser/mac/atom_application_delegate.h",
"shell/browser/mac/atom_application_delegate.mm",
"shell/browser/mac/dict_util.h",
"shell/browser/mac/dict_util.mm",
"shell/browser/mac/in_app_purchase.h",
@@ -227,9 +227,9 @@ filenames = {
"shell/browser/net/cert_verifier_client.cc",
"shell/browser/net/cert_verifier_client.h",
"shell/browser/net/network_context_service.cc",
"shell/browser/net/network_context_service.h",
"shell/browser/net/network_context_service_factory.cc",
"shell/browser/net/network_context_service_factory.h",
"shell/browser/net/network_context_service.h",
"shell/browser/net/node_stream_loader.cc",
"shell/browser/net/node_stream_loader.h",
"shell/browser/net/proxying_url_loader_factory.cc",
@@ -255,16 +255,16 @@ filenames = {
"shell/browser/notifications/mac/notification_presenter_mac.h",
"shell/browser/notifications/mac/notification_presenter_mac.mm",
"shell/browser/notifications/notification.cc",
"shell/browser/notifications/notification_delegate.h",
"shell/browser/notifications/notification.h",
"shell/browser/notifications/notification_delegate.h",
"shell/browser/notifications/notification_presenter.cc",
"shell/browser/notifications/notification_presenter.h",
"shell/browser/notifications/platform_notification_service.cc",
"shell/browser/notifications/platform_notification_service.h",
"shell/browser/notifications/win/notification_presenter_win7.cc",
"shell/browser/notifications/win/notification_presenter_win7.h",
"shell/browser/notifications/win/notification_presenter_win.cc",
"shell/browser/notifications/win/notification_presenter_win.h",
"shell/browser/notifications/win/notification_presenter_win7.cc",
"shell/browser/notifications/win/notification_presenter_win7.h",
"shell/browser/notifications/win/win32_desktop_notifications/common.h",
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc",
"shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h",
@@ -296,6 +296,10 @@ filenames = {
"shell/browser/ui/certificate_trust.h",
"shell/browser/ui/certificate_trust_mac.mm",
"shell/browser/ui/certificate_trust_win.cc",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/atom_bundle_mover.h",
"shell/browser/ui/cocoa/atom_bundle_mover.mm",
"shell/browser/ui/cocoa/atom_inspectable_web_contents_view.h",
@@ -304,10 +308,10 @@ filenames = {
"shell/browser/ui/cocoa/atom_menu_controller.mm",
"shell/browser/ui/cocoa/atom_native_widget_mac.h",
"shell/browser/ui/cocoa/atom_native_widget_mac.mm",
"shell/browser/ui/cocoa/atom_ns_window_delegate.h",
"shell/browser/ui/cocoa/atom_ns_window_delegate.mm",
"shell/browser/ui/cocoa/atom_ns_window.h",
"shell/browser/ui/cocoa/atom_ns_window.mm",
"shell/browser/ui/cocoa/atom_ns_window_delegate.h",
"shell/browser/ui/cocoa/atom_ns_window_delegate.mm",
"shell/browser/ui/cocoa/atom_preview_item.h",
"shell/browser/ui/cocoa/atom_preview_item.mm",
"shell/browser/ui/cocoa/atom_touch_bar.h",
@@ -316,10 +320,6 @@ filenames = {
"shell/browser/ui/cocoa/delayed_native_view_host.h",
"shell/browser/ui/cocoa/event_dispatching_window.h",
"shell/browser/ui/cocoa/event_dispatching_window.mm",
"shell/browser/ui/cocoa/NSColor+Hex.h",
"shell/browser/ui/cocoa/NSColor+Hex.mm",
"shell/browser/ui/cocoa/NSString+ANSI.h",
"shell/browser/ui/cocoa/NSString+ANSI.mm",
"shell/browser/ui/cocoa/root_view_mac.h",
"shell/browser/ui/cocoa/root_view_mac.mm",
"shell/browser/ui/cocoa/views_delegate_mac.h",
@@ -331,35 +331,35 @@ filenames = {
"shell/browser/ui/drag_util.h",
"shell/browser/ui/drag_util_mac.mm",
"shell/browser/ui/drag_util_views.cc",
"shell/browser/ui/file_dialog_gtk.cc",
"shell/browser/ui/file_dialog.h",
"shell/browser/ui/file_dialog_gtk.cc",
"shell/browser/ui/file_dialog_mac.mm",
"shell/browser/ui/file_dialog_win.cc",
"shell/browser/ui/inspectable_web_contents.cc",
"shell/browser/ui/inspectable_web_contents_delegate.h",
"shell/browser/ui/inspectable_web_contents.h",
"shell/browser/ui/inspectable_web_contents_delegate.h",
"shell/browser/ui/inspectable_web_contents_impl.cc",
"shell/browser/ui/inspectable_web_contents_impl.h",
"shell/browser/ui/inspectable_web_contents_view.h",
"shell/browser/ui/inspectable_web_contents_view_delegate.cc",
"shell/browser/ui/inspectable_web_contents_view_delegate.h",
"shell/browser/ui/inspectable_web_contents_view.h",
"shell/browser/ui/inspectable_web_contents_view_mac.h",
"shell/browser/ui/inspectable_web_contents_view_mac.mm",
"shell/browser/ui/message_box_gtk.cc",
"shell/browser/ui/message_box.h",
"shell/browser/ui/message_box_gtk.cc",
"shell/browser/ui/message_box_mac.mm",
"shell/browser/ui/message_box_win.cc",
"shell/browser/ui/tray_icon.cc",
"shell/browser/ui/tray_icon.h",
"shell/browser/ui/tray_icon_cocoa.h",
"shell/browser/ui/tray_icon_cocoa.mm",
"shell/browser/ui/tray_icon_gtk.cc",
"shell/browser/ui/tray_icon_gtk.h",
"shell/browser/ui/tray_icon.h",
"shell/browser/ui/tray_icon_observer.h",
"shell/browser/ui/tray_icon_win.cc",
"shell/browser/ui/views/atom_views_delegate.cc",
"shell/browser/ui/views/atom_views_delegate_win.cc",
"shell/browser/ui/views/atom_views_delegate.h",
"shell/browser/ui/views/atom_views_delegate_win.cc",
"shell/browser/ui/views/autofill_popup_view.cc",
"shell/browser/ui/views/autofill_popup_view.h",
"shell/browser/ui/views/frameless_view.cc",
@@ -414,11 +414,11 @@ filenames = {
"shell/browser/web_view_guest_delegate.h",
"shell/browser/web_view_manager.cc",
"shell/browser/web_view_manager.h",
"shell/browser/win/scoped_hstring.cc",
"shell/browser/win/scoped_hstring.h",
"shell/browser/window_list.cc",
"shell/browser/window_list.h",
"shell/browser/window_list_observer.h",
"shell/browser/win/scoped_hstring.cc",
"shell/browser/win/scoped_hstring.h",
"shell/browser/zoom_level_delegate.cc",
"shell/browser/zoom_level_delegate.h",
"shell/common/api/atom_api_asar.cc",
@@ -474,6 +474,8 @@ filenames = {
"shell/common/gin_converters/callback_converter.h",
"shell/common/gin_converters/content_converter.cc",
"shell/common/gin_converters/content_converter.h",
"shell/common/gin_converters/extension_converter.cc",
"shell/common/gin_converters/extension_converter.h",
"shell/common/gin_converters/file_dialog_converter.cc",
"shell/common/gin_converters/file_dialog_converter.h",
"shell/common/gin_converters/file_path_converter.h",
@@ -500,10 +502,10 @@ filenames = {
"shell/common/gin_helper/dictionary.h",
"shell/common/gin_helper/error_thrower.cc",
"shell/common/gin_helper/error_thrower.h",
"shell/common/gin_helper/event_emitter_caller.cc",
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/event_emitter.cc",
"shell/common/gin_helper/event_emitter.h",
"shell/common/gin_helper/event_emitter_caller.cc",
"shell/common/gin_helper/event_emitter_caller.h",
"shell/common/gin_helper/function_template.cc",
"shell/common/gin_helper/function_template.h",
"shell/common/gin_helper/locker.cc",
@@ -512,8 +514,8 @@ filenames = {
"shell/common/gin_helper/object_template_builder.h",
"shell/common/gin_helper/persistent_dictionary.cc",
"shell/common/gin_helper/persistent_dictionary.h",
"shell/common/gin_helper/promise.h",
"shell/common/gin_helper/promise.cc",
"shell/common/gin_helper/promise.h",
"shell/common/gin_helper/trackable_object.cc",
"shell/common/gin_helper/trackable_object.h",
"shell/common/gin_helper/wrappable.cc",
@@ -521,9 +523,9 @@ filenames = {
"shell/common/gin_helper/wrappable_base.h",
"shell/common/heap_snapshot.cc",
"shell/common/heap_snapshot.h",
"shell/common/key_weak_map.h",
"shell/common/keyboard_util.cc",
"shell/common/keyboard_util.h",
"shell/common/key_weak_map.h",
"shell/common/mac/main_application_bundle.h",
"shell/common/mac/main_application_bundle.mm",
"shell/common/mouse_util.cc",
@@ -559,10 +561,10 @@ filenames = {
"shell/renderer/api/context_bridge/render_frame_context_bridge_store.h",
"shell/renderer/atom_autofill_agent.cc",
"shell/renderer/atom_autofill_agent.h",
"shell/renderer/atom_renderer_client.cc",
"shell/renderer/atom_renderer_client.h",
"shell/renderer/atom_render_frame_observer.cc",
"shell/renderer/atom_render_frame_observer.h",
"shell/renderer/atom_renderer_client.cc",
"shell/renderer/atom_renderer_client.h",
"shell/renderer/atom_sandboxed_renderer_client.cc",
"shell/renderer/atom_sandboxed_renderer_client.h",
"shell/renderer/content_settings_observer.cc",
@@ -589,6 +591,8 @@ filenames = {
lib_sources_extensions = [
"shell/browser/extensions/api/runtime/atom_runtime_api_delegate.cc",
"shell/browser/extensions/api/runtime/atom_runtime_api_delegate.h",
"shell/browser/extensions/api/tabs/tabs_api.cc",
"shell/browser/extensions/api/tabs/tabs_api.h",
"shell/browser/extensions/atom_extensions_browser_client.cc",
"shell/browser/extensions/atom_extensions_browser_client.h",
"shell/browser/extensions/atom_browser_context_keyed_service_factories.cc",
@@ -607,12 +611,22 @@ filenames = {
"shell/browser/extensions/atom_extension_web_contents_observer.h",
"shell/browser/extensions/atom_navigation_ui_data.cc",
"shell/browser/extensions/atom_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_messaging_delegate.cc",
"shell/browser/extensions/electron_messaging_delegate.h",
"shell/common/extensions/atom_extensions_api_provider.cc",
"shell/common/extensions/atom_extensions_api_provider.h",
"shell/common/extensions/atom_extensions_client.cc",
"shell/common/extensions/atom_extensions_client.h",
"shell/renderer/extensions/atom_extensions_renderer_client.cc",
"shell/renderer/extensions/atom_extensions_renderer_client.h",
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.cc",
"shell/renderer/extensions/electron_extensions_dispatcher_delegate.h",
]
app_sources = [

View File

@@ -7,13 +7,13 @@ hunspell_dictionaries = [
"//third_party/hunspell_dictionaries/da-DK-3-0.bdic",
"//third_party/hunspell_dictionaries/de-DE-3-0.bdic",
"//third_party/hunspell_dictionaries/el-GR-3-0.bdic",
"//third_party/hunspell_dictionaries/en-AU-8-0.bdic",
"//third_party/hunspell_dictionaries/en-CA-8-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-8-0.bdic",
"//third_party/hunspell_dictionaries/en-US-8-0.bdic",
"//third_party/hunspell_dictionaries/en-AU-9-0.bdic",
"//third_party/hunspell_dictionaries/en-CA-9-0.bdic",
"//third_party/hunspell_dictionaries/en-GB-9-0.bdic",
"//third_party/hunspell_dictionaries/en-US-9-0.bdic",
"//third_party/hunspell_dictionaries/es-ES-3-0.bdic",
"//third_party/hunspell_dictionaries/et-EE-3-0.bdic",
"//third_party/hunspell_dictionaries/fa-IR-8-0.bdic",
"//third_party/hunspell_dictionaries/fa-IR-9-0.bdic",
"//third_party/hunspell_dictionaries/fo-FO-3-0.bdic",
"//third_party/hunspell_dictionaries/fr-FR-3-0.bdic",
"//third_party/hunspell_dictionaries/he-IL-3-0.bdic",

View File

@@ -53,18 +53,27 @@ class IncomingMessage extends Readable {
get headers () {
const filteredHeaders = {}
const rawHeaders = this._responseHead.headers
Object.keys(rawHeaders).forEach(header => {
if (header in filteredHeaders && discardableDuplicateHeaders.has(header)) {
const { rawHeaders } = this._responseHead
rawHeaders.forEach(header => {
if (Object.prototype.hasOwnProperty.call(filteredHeaders, header.key) &&
discardableDuplicateHeaders.has(header.key)) {
// do nothing with discardable duplicate headers
} else {
if (header === 'set-cookie') {
if (header.key === 'set-cookie') {
// keep set-cookie as an array per Node.js rules
// see https://nodejs.org/api/http.html#http_message_headers
filteredHeaders[header] = rawHeaders[header]
if (Object.prototype.hasOwnProperty.call(filteredHeaders, header.key)) {
filteredHeaders[header.key].push(header.value)
} else {
filteredHeaders[header.key] = [header.value]
}
} else {
// for non-cookie headers, the values are joined together with ', '
filteredHeaders[header] = rawHeaders[header].join(', ')
if (Object.prototype.hasOwnProperty.call(filteredHeaders, header.key)) {
filteredHeaders[header.key] += `, ${header.value}`
} else {
filteredHeaders[header.key] = header.value
}
}
}
})
@@ -398,7 +407,7 @@ class ClientRequest extends Writable {
this.emit('redirect', statusCode, newMethod, newUrl, headers)
} finally {
this._followRedirectCb = null
if (!_followRedirect) {
if (!_followRedirect && !this._aborted) {
this._die(new Error('Redirect was cancelled'))
}
}

View File

@@ -57,18 +57,25 @@ const getManifestFromPath = function (srcDirectory) {
if (!manifestNameMap[manifest.name]) {
const extensionId = generateExtensionIdFromName(manifest.name)
manifestMap[extensionId] = manifestNameMap[manifest.name] = manifest
let extensionURL = url.format({
protocol: 'chrome-extension',
slashes: true,
hostname: extensionId,
pathname: manifest.devtools_page
})
// Chromium requires that startPage matches '([^:]+:\/\/[^/]*)\/'
// We also can't use the file:// protocol here since that would make Chromium
// treat all extension resources as being relative to root which we don't want.
if (!manifest.devtools_page) extensionURL += '/'
Object.assign(manifest, {
srcDirectory: srcDirectory,
extensionId: extensionId,
// We can not use 'file://' directly because all resources in the extension
// will be treated as relative to the root in Chrome.
startPage: url.format({
protocol: 'chrome-extension',
slashes: true,
hostname: extensionId,
pathname: manifest.devtools_page
})
startPage: extensionURL
})
return manifest
} else if (manifest && manifest.name) {
console.warn(`Attempted to load extension "${manifest.name}" that has already been loaded.`)
@@ -389,7 +396,8 @@ const loadDevToolsExtensions = function (win, manifests) {
})
extensionInfoArray.forEach((extensionInfo) => {
win.devToolsWebContents.executeJavaScript(`Extensions.extensionServer._addExtension(${JSON.stringify(extensionInfo)})`)
const info = JSON.stringify(extensionInfo)
win.devToolsWebContents.executeJavaScript(`Extensions.extensionServer._addExtension(${info})`)
})
}

View File

@@ -75,8 +75,10 @@ const mergeBrowserWindowOptions = function (embedder, options) {
}
}
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
if (!webPreferences.nativeWindowOpen) {
// Sets correct openerId here to give correct options to 'new-window' event handler
options.webPreferences.openerId = embedder.id
}
return options
}

View File

@@ -321,7 +321,7 @@ const unwrapArgs = function (sender: electron.WebContents, frameId: number, cont
const isRemoteModuleEnabledImpl = function (contents: electron.WebContents) {
const webPreferences = (contents as any).getLastWebPreferences() || {}
return !!webPreferences.enableRemoteModule
return webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true
}
const isRemoteModuleEnabledCache = new WeakMap()

View File

@@ -112,11 +112,15 @@ ipcMainUtils.handleSync('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event)
contentScripts = getContentScripts()
}
const webPreferences = event.sender.getLastWebPreferences() || {}
return {
contentScripts,
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),
guestInstanceId: webPreferences.guestInstanceId,
openerId: webPreferences.openerId,
process: {
arch: process.arch,
platform: process.platform,

View File

@@ -711,31 +711,42 @@
overrideAPISync(Module._extensions, '.node', 1)
overrideAPISync(fs, 'openSync')
// Lazily override the child_process APIs only when child_process is fetched the first time
const originalModuleLoad = Module._load
Module._load = (request, ...args) => {
const loadResult = originalModuleLoad(request, ...args)
if (request === 'child_process') {
if (!v8Util.getHiddenValue(loadResult, 'asar-ready')) {
v8Util.setHiddenValue(loadResult, 'asar-ready', true)
// Just to make it obvious what we are dealing with here
const childProcess = loadResult
const overrideChildProcess = (childProcess) => {
// Executing a command string containing a path to an asar archive
// confuses `childProcess.execFile`, which is internally called by
// `childProcess.{exec,execSync}`, causing Electron to consider the full
// command as a single path to an archive.
const { exec, execSync } = childProcess
childProcess.exec = invokeWithNoAsar(exec)
childProcess.exec[util.promisify.custom] = invokeWithNoAsar(exec[util.promisify.custom])
childProcess.execSync = invokeWithNoAsar(execSync)
// Executing a command string containing a path to an asar
// archive confuses `childProcess.execFile`, which is internally
// called by `childProcess.{exec,execSync}`, causing
// Electron to consider the full command as a single path
// to an archive.
const { exec, execSync } = childProcess
childProcess.exec = invokeWithNoAsar(exec)
childProcess.exec[util.promisify.custom] = invokeWithNoAsar(exec[util.promisify.custom])
childProcess.execSync = invokeWithNoAsar(execSync)
overrideAPI(childProcess, 'execFile')
overrideAPISync(childProcess, 'execFileSync')
}
overrideAPI(childProcess, 'execFile')
overrideAPISync(childProcess, 'execFileSync')
// Lazily override the child_process APIs only when child_process is
// fetched the first time. We will eagerly override the child_process APIs
// when this env var is set so that stack traces generated inside node unit
// tests will match. This env var will only slow things down in users apps
// and should not be used.
if (process.env.ELECTRON_EAGER_ASAR_HOOK_FOR_TESTING) {
overrideChildProcess(require('child_process'))
} else {
const originalModuleLoad = Module._load
Module._load = (request, ...args) => {
const loadResult = originalModuleLoad(request, ...args)
if (request === 'child_process') {
if (!v8Util.getHiddenValue(loadResult, 'asar-ready')) {
v8Util.setHiddenValue(loadResult, 'asar-ready', true)
// Just to make it obvious what we are dealing with here
const childProcess = loadResult
overrideChildProcess(childProcess)
}
}
return loadResult
}
return loadResult
}
}
})()

View File

@@ -54,7 +54,12 @@ class CrashReporter {
}
getUploadedReports () {
return binding.getUploadedReports(this.getCrashesDirectory())
const crashDir = this.getCrashesDirectory()
if (!crashDir) {
throw new Error('crashReporter has not been started')
}
return binding.getUploadedReports(crashDir)
}
getCrashesDirectory () {

View File

@@ -13,6 +13,15 @@ const remoteObjectCache = v8Util.createIDWeakMap()
// An unique ID that can represent current context.
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.")
}
}, (err) => {
console.error('Failed to get web preferences:', err)
})
// Notify the main process when current context is going to be released.
// Note that when the renderer process is destroyed, the message may not be
// sent, we also listen to the "render-view-deleted" event in the main process

View File

@@ -268,7 +268,9 @@ const warnAboutAllowedPopups = function () {
// Logs a warning message about the remote module
const warnAboutRemoteModuleWithRemoteContent = function (webPreferences?: Electron.WebPreferences) {
if (!webPreferences || !webPreferences.enableRemoteModule || isLocalhost()) return
if (!webPreferences || isLocalhost()) return
const remoteModuleEnabled = webPreferences.enableRemoteModule != null ? !!webPreferences.enableRemoteModule : true
if (!remoteModuleEnabled) return
if (getIsRemoteProtocol()) {
const warning = `This renderer process has "enableRemoteModule" enabled

View File

@@ -177,7 +177,7 @@ class BrowserWindowProxy {
export const windowSetup = (
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean
) => {
if (guestInstanceId == null) {
if (!process.sandboxed && guestInstanceId == null) {
// Override default window.close.
window.close = function () {
ipcRendererInternal.send('ELECTRON_BROWSER_WINDOW_CLOSE')
@@ -197,10 +197,10 @@ export const windowSetup = (
return null
}
}
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId)
}
if (openerId != null) {
window.opener = getOrCreateProxy(openerId)
}
// But we do not support prompt().
@@ -208,43 +208,47 @@ export const windowSetup = (
throw new Error('prompt() is and will not be supported.')
}
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
_event, sourceId: number, message: any, sourceOrigin: string
) {
// Manually dispatch event instead of using postMessage because we also need to
// set event.source.
//
// Why any? We can't construct a MessageEvent and we can't
// use `as MessageEvent` because you're not supposed to override
// data, origin, and source
const event: any = document.createEvent('Event')
event.initEvent('message', false, false)
if (!usesNativeWindowOpen || openerId != null) {
ipcRendererInternal.on('ELECTRON_GUEST_WINDOW_POSTMESSAGE', function (
_event, sourceId: number, message: any, sourceOrigin: string
) {
// Manually dispatch event instead of using postMessage because we also need to
// set event.source.
//
// Why any? We can't construct a MessageEvent and we can't
// use `as MessageEvent` because you're not supposed to override
// data, origin, and source
const event: any = document.createEvent('Event')
event.initEvent('message', false, false)
event.data = message
event.origin = sourceOrigin
event.source = getOrCreateProxy(sourceId)
event.data = message
event.origin = sourceOrigin
event.source = getOrCreateProxy(sourceId)
window.dispatchEvent(event as MessageEvent)
})
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
window.dispatchEvent(event as MessageEvent)
})
}
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
}
if (!process.sandboxed) {
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
}
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
}
window.history.forward = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
}
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
},
set () {}
})
window.history.go = function (offset: number) {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
}
Object.defineProperty(window.history, 'length', {
get: function () {
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
},
set () {}
})
}
if (guestInstanceId != null) {
// Webview `document.visibilityState` tracks window visibility (and ignores

View File

@@ -30,7 +30,13 @@ const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-rendere
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
const {
contentScripts, preloadScripts, isRemoteModuleEnabled, isWebViewTagEnabled, process: processProps
contentScripts,
preloadScripts,
isRemoteModuleEnabled,
isWebViewTagEnabled,
guestInstanceId,
openerId,
process: processProps
} = ipcRendererUtils.invokeSync('ELECTRON_BROWSER_SANDBOX_LOAD')
process.isRemoteModuleEnabled = isRemoteModuleEnabled
@@ -109,6 +115,11 @@ function preloadRequire (module) {
const { hasSwitch } = process.electronBinding('command_line')
const contextIsolation = hasSwitch('context-isolation')
const isHiddenPage = hasSwitch('hidden-page')
const usesNativeWindowOpen = true
// The arguments to be passed to isolated world.
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen }
switch (window.location.protocol) {
case 'devtools:': {
@@ -127,6 +138,10 @@ switch (window.location.protocol) {
break
}
default: {
// Override default web functions.
const { windowSetup } = require('@electron/internal/renderer/window-setup')
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
// Inject content scripts.
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
@@ -134,14 +149,17 @@ switch (window.location.protocol) {
}
}
const guestInstanceId = binding.guestInstanceId && parseInt(binding.guestInstanceId)
// Load webview tag implementation.
if (process.isMainFrame) {
const { webViewInit } = require('@electron/internal/renderer/web-view/web-view-init')
webViewInit(contextIsolation, isWebViewTagEnabled, guestInstanceId)
}
// Pass the arguments to isolatedWorld.
if (contextIsolation) {
v8Util.setHiddenValue(global, 'isolated-world-args', isolatedWorldArgs)
}
// Wrap the script into a function executed in global scope. It won't have
// access to the current scope, so we'll expose a few objects as arguments:
//

View File

@@ -8,22 +8,13 @@ const path = require('path')
const extract = require('extract-zip')
const { downloadArtifact } = require('@electron/get')
let installedVersion = null
try {
installedVersion = fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '')
} catch (ignored) {
// do nothing
}
if (process.env.ELECTRON_SKIP_BINARY_DOWNLOAD) {
process.exit(0)
}
const platformPath = getPlatformPath()
const electronPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist', platformPath)
if (installedVersion === version && fs.existsSync(electronPath)) {
if (isInstalled()) {
process.exit(0)
}
@@ -35,26 +26,49 @@ downloadArtifact({
cacheRoot: process.env.electron_config_cache,
platform: process.env.npm_config_platform || process.platform,
arch: process.env.npm_config_arch || process.arch
}).then((zipPath) => extractFile(zipPath)).catch((err) => onerror(err))
}).then(extractFile).catch(err => {
console.error(err.stack)
process.exit(1)
})
function isInstalled () {
try {
if (fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '') !== version) {
return false
}
if (fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8') !== platformPath) {
return false
}
} catch (ignored) {
return false
}
const electronPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist', platformPath)
return fs.existsSync(electronPath)
}
// unzips and makes path.txt point at the correct executable
function extractFile (zipPath) {
extract(zipPath, { dir: path.join(__dirname, 'dist') }, function (err) {
if (err) return onerror(err)
fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, function (err) {
if (err) return onerror(err)
return new Promise((resolve, reject) => {
extract(zipPath, { dir: path.join(__dirname, 'dist') }, err => {
if (err) return reject(err)
fs.writeFile(path.join(__dirname, 'path.txt'), platformPath, err => {
if (err) return reject(err)
resolve()
})
})
})
}
function onerror (err) {
throw err
}
function getPlatformPath () {
const platform = process.env.npm_config_platform || os.platform()
switch (platform) {
case 'mas':
case 'darwin':
return 'Electron.app/Contents/MacOS/Electron'
case 'freebsd':

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "9.0.0-nightly.20191229",
"version": "9.0.0-nightly.20200121",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -32,6 +32,8 @@ scroll_bounce_flag.patch
mas-cfisobjc.patch
mas-cgdisplayusesforcetogray.patch
mas-audiodeviceduck.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
@@ -78,3 +80,4 @@ chore_use_electron_resources_not_chrome_for_spellchecker.patch
add_trustedauthclient_to_urlloaderfactory.patch
feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
accessible_pane_view.patch
fixme_grit_conflicts.patch

View File

@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
3. Ctrl-Shift-= should show as Ctrl-+
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index a3e869a74c33b161215ab4eb6f6adc6a71c9fff5..83315ce63e7d39d3e47a8bb61ade728e20ac11c8 100644
index 025a82c14dd379f82e6c8242727346bd21e768f3..8b8b0e77c355acd1ef22fb51b89f65f90bfe5cc6 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -11,6 +11,7 @@
@@ -74,7 +74,7 @@ index a3e869a74c33b161215ab4eb6f6adc6a71c9fff5..83315ce63e7d39d3e47a8bb61ade728e
+ base::StringPrintf("F%d", key_code_ - VKEY_F1 + 1));
}
// Checking whether the character used for the accelerator is alphanumeric.
#if defined(OS_MACOSX)
@@ -356,7 +356,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
// more information.
if (IsCtrlDown())

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 384f81bff1ae2551b180175a3ec88baf88677d12..166d2ef3e0d14a84ecbe3c5d0d0bd1c8329b3c9e 100644
index 0a56e27b49e101f4ac3bd1a0d386c3977666bb6d..d0ccfac9c90d1427778222badb6246aaa1f7b8a4 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -258,6 +258,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -259,6 +259,10 @@ int GpuMain(const MainFunctionParams& parameters) {
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
@@ -24,7 +24,7 @@ index 384f81bff1ae2551b180175a3ec88baf88677d12..166d2ef3e0d14a84ecbe3c5d0d0bd1c8
// 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
@@ -366,7 +370,6 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -371,7 +375,6 @@ int GpuMain(const MainFunctionParams& parameters) {
GpuProcess gpu_process(io_thread_priority);
#endif

View File

@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index c69cfebccd7d7bff35d2292e61bf6008f0ca7940..2cb5f5d3f89f2af13221e66b2277a28532d53deb 100644
index 6dc5d6d39c4fa28fc4c303ff704267ad60b050f2..9fd95c25db36b8e5e02cd971ae30608fba027346 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -654,6 +654,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
@@ -657,6 +657,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, ArrayBufferContents::kDontInitialize);
}

View File

@@ -10,10 +10,10 @@ WebContents, and cancels the authentication if there's no WebContents
available, which there isn't in the case of the 'net' module.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index def2cb5e252389879c6287d44d29e704703841cb..98d64785240bde3e182268e453dced41b432df9a 100644
index 541d8017d38cbede3199e0028f3b1b260bd61b34..ec2e6d52d247fbcc9f07c54518f860d1a30822f4 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -190,6 +190,25 @@ struct HttpAuthStaticNetworkContextParams {
@@ -191,6 +191,25 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
};
@@ -39,7 +39,7 @@ index def2cb5e252389879c6287d44d29e704703841cb..98d64785240bde3e182268e453dced41
interface CertVerifierClient {
Verify(
int32 default_error,
@@ -596,6 +615,8 @@ struct URLLoaderFactoryParams {
@@ -603,6 +622,8 @@ struct URLLoaderFactoryParams {
// interface. This still respects the per-context block lists.
CorsOriginAccessPatterns? factory_bound_access_patterns;
@@ -49,10 +49,10 @@ index def2cb5e252389879c6287d44d29e704703841cb..98d64785240bde3e182268e453dced41
NetworkIsolationKey? network_isolation_key;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 96ea5f62e5796810f87abfb2a3c400ffcc024ff0..d50831adb6ba65ece49b62ec4a8cd1a92fdb0d28 100644
index 6f69ca035500a7af795ccd93b689bcc3b376576e..bf112361de669c22532d269b5871c9b23ca7b694 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -334,6 +334,7 @@ URLLoader::URLLoader(
@@ -338,6 +338,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 96ea5f62e5796810f87abfb2a3c400ffcc024ff0..d50831adb6ba65ece49b62ec4a8cd1a9
mojom::OriginPolicyManager* origin_policy_manager)
: url_request_context_(url_request_context),
network_service_client_(network_service_client),
@@ -391,6 +392,11 @@ URLLoader::URLLoader(
@@ -396,6 +397,11 @@ URLLoader::URLLoader(
header_client_.set_disconnect_handler(
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
}
@@ -72,7 +72,7 @@ index 96ea5f62e5796810f87abfb2a3c400ffcc024ff0..d50831adb6ba65ece49b62ec4a8cd1a9
if (want_raw_headers_) {
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
@@ -826,7 +832,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
@@ -830,7 +836,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 96ea5f62e5796810f87abfb2a3c400ffcc024ff0..d50831adb6ba65ece49b62ec4a8cd1a9
OnAuthCredentials(base::nullopt);
return;
}
@@ -842,11 +848,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
@@ -846,11 +852,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,7 +108,7 @@ index 96ea5f62e5796810f87abfb2a3c400ffcc024ff0..d50831adb6ba65ece49b62ec4a8cd1a9
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 564851586d2ad5fe0ae6acd4457257ce8ed665b3..3291fe28deb20b9630589e8ea11ea1366583081c 100644
index 532ecdc0a9b386eb9ea04a480b18aeb1ac32a059..b3ad0f42ab9c2f513d8c4a06683d1af6f0219a56 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -85,6 +85,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -119,7 +119,7 @@ index 564851586d2ad5fe0ae6acd4457257ce8ed665b3..3291fe28deb20b9630589e8ea11ea136
mojom::OriginPolicyManager* origin_policy_manager);
~URLLoader() override;
@@ -378,6 +379,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -384,6 +385,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::Optional<base::UnguessableToken> fetch_window_id_;
mojo::Remote<mojom::TrustedHeaderClient> header_client_;

View File

@@ -6,10 +6,10 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
This allows file:// URLs in workers to have a CSP.
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
index 1f8273a782a5d3580e139d724ce8a791a100dcfb..90ad0d663003c0bded47183b61bff71a0c01a196 100644
index d490f57f7ad056a278bc50786e285d6757de6433..6bd0614c388dc581b50c6b01e9c6dabad5419b19 100644
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
@@ -308,7 +308,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
@@ -312,7 +312,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
// document (which is implemented in WorkerMessagingProxy, and
// m_contentSecurityPolicy should be left as nullptr to inherit the policy).
if (!response.CurrentRequestUrl().ProtocolIs("blob") &&

View File

@@ -7,7 +7,7 @@ This is used by editors to obtain the filesystem path from a dragged file. See
documentation at https://electronjs.org/docs/api/file-object
diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h
index 7ea8ad8fd162fd6a97052188a8e8868dab1c1fe9..a64966e2db0e2e7b0390a322525522e05ddbb022 100644
index 888fb19b976194c173286f92b26c4bc9362bcf9c..9d243bc70089685f018b14eba0025cfd11bb82f6 100644
--- a/third_party/blink/renderer/core/fileapi/file.h
+++ b/third_party/blink/renderer/core/fileapi/file.h
@@ -193,6 +193,9 @@ class CORE_EXPORT File final : public Blob {
@@ -21,12 +21,12 @@ index 7ea8ad8fd162fd6a97052188a8e8868dab1c1fe9..a64966e2db0e2e7b0390a322525522e0
// http://dev.w3.org/2006/webapi/FileAPI/#file-attrs
int64_t lastModified() const;
diff --git a/third_party/blink/renderer/core/fileapi/file.idl b/third_party/blink/renderer/core/fileapi/file.idl
index e5cf6cc926ff2670f713018dd750e79c53ee76eb..60eca3cf100b31c3d2c0c68271d98c60321e69a7 100644
index 8113ac9050c25a675eb20c90fdb4d037e171a5b6..9ca2d532dc4694d7a68ebd6b7988907132dae0e9 100644
--- a/third_party/blink/renderer/core/fileapi/file.idl
+++ b/third_party/blink/renderer/core/fileapi/file.idl
@@ -32,6 +32,7 @@
Serializable
@@ -31,6 +31,7 @@
] interface File : Blob {
[CallWith=ExecutionContext] constructor(sequence<BlobPart> fileBits, USVString fileName, optional FilePropertyBag options);
readonly attribute DOMString name;
+ readonly attribute DOMString path;
readonly attribute long long lastModified;

View File

@@ -10,10 +10,10 @@ 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 8095edd988c171a8ad7382d1c2f9fa63ee9e5ffc..802316843c6c270efb871a5d697c4e0d182605d0 100644
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
@@ -227,11 +227,10 @@ void LocalWindowProxy::Initialize() {
@@ -211,11 +211,10 @@ void LocalWindowProxy::Initialize() {
GetFrame()->IsMainFrame());
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
origin);

View File

@@ -14,10 +14,10 @@ when there is code doing that.
This patch reverts the change to fix the crash in Electron.
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 94019ebf806be6b0a9424b43579d46bf6a0e3de4..fa827b5846fc93c59f98795da51bab0f3b33de5e 100644
index f7536b085bc5c0fd4853ac905bf7b7c0160d60b7..36303725d92c76581ea91d06674408aa41bbf549 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -344,10 +344,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -347,10 +347,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
}
CHECK(!view_ || !view_->IsAttached());
@@ -28,7 +28,7 @@ index 94019ebf806be6b0a9424b43579d46bf6a0e3de4..fa827b5846fc93c59f98795da51bab0f
if (!Client())
return;
@@ -365,6 +361,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -368,6 +364,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
// Notify ScriptController that the frame is closing, since its cleanup ends
// up calling back to LocalFrameClient via WindowProxy.
GetScriptController().ClearForClose();

View File

@@ -7,10 +7,10 @@ This exposes a method for obtaining a reference to an isolated world, which is
otherwise not available in the Blink API.
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index 05a33b9a2cbed57e4e037428397b59f30f83ce66..0cd308b38a158a016b099beed6a31fa1c5a487ad 100644
index 461e1574cd55860ea62a2c7f509a2fdb4134c898..0f45096b984f64fb0c094cd0996a2afbb64ddfb6 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -341,6 +341,9 @@ class WebLocalFrame : public WebFrame {
@@ -347,6 +347,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
@@ -21,10 +21,10 @@ index 05a33b9a2cbed57e4e037428397b59f30f83ce66..0cd308b38a158a016b099beed6a31fa1
// 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 8c984ae92de2a53e59782bea94a143ee7fde2248..105e1e92002adde207db5c770197547ab6b55f97 100644
index 3de275c61ba6d1aa612de9036253906e4eb5638a..3912a5797fad331ab8b754abe9474b63f1a468df 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
@@ -935,6 +935,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
@@ -956,6 +956,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
@@ -39,10 +39,10 @@ index 8c984ae92de2a53e59782bea94a143ee7fde2248..105e1e92002adde207db5c770197547a
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 e3d4a369e6708827497b7ef8ce38817bde8c8010..ad7fd6c34f10d10257ef5c6e5b4b916dc924f20c 100644
index 8e28c1d87211567636b9e291c3969bd00c78ff38..585dd302815e51e33e03e3c5db2d3ea1621d0b4b 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
@@ -171,6 +171,8 @@ class CORE_EXPORT WebLocalFrameImpl final
@@ -172,6 +172,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;

View File

@@ -6,7 +6,7 @@ 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 a8aa9c9ece41fe6e55c19aa301ec8d3314ea3644..9de25650618847b6f4fc022f47a85c295b1323a7 100644
index e2b2a8eae3b051d9babc7af1b9f2ac5053bb7dc7..f6df2752367d4b81a03ab7d585c29452e79f6f6c 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -45,6 +45,19 @@ config("no_asm_config") {

View File

@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 095c6255cfe830049137e42ecc4668d1bf877f33..87abc44f392e47a7655c127edf27f4d5ff419bb0 100644
index 5c8844f699506362c21e7eb4b3ca5e869684c5bb..0884cd263f5f5e793932800bdbb50d6e33955ed0 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -66,6 +66,7 @@

View File

@@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index b7ed7e9f59b7cde06aa468e1fec708c791327a57..14b3d4603b8143ea2660c0fad5ab8e8547f2854a 100644
index 563e07a5ac2d9c44c4484d59e3fc025c70b961ea..60e36fab0e6999688b88665d9ad3181a26525a38 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -4397,6 +4397,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -4369,6 +4369,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,7 +21,7 @@ index b7ed7e9f59b7cde06aa468e1fec708c791327a57..14b3d4603b8143ea2660c0fad5ab8e85
&no_javascript_access);
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index 46d534b72813c8fb6dfa2ad42f2d81b983cfdf90..9c492e3c2ebd4f6e89ee883d08522145594a8e01 100644
index fb4cdca43e59c2dd8156cbe12bec391b128a6dd9..5c3645bebf2009def133fcd845f50e7745a243ca 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -302,6 +302,10 @@ struct CreateNewWindowParams {
@@ -36,10 +36,10 @@ index 46d534b72813c8fb6dfa2ad42f2d81b983cfdf90..9c492e3c2ebd4f6e89ee883d08522145
// 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 602008278edca8b34ba02e5c5d236ab9342b3cc0..76261e6b09094527327e068e183d3d3b2665467b 100644
index 0788e0f5e4311d8978768cb0d4d09736c19d2d25..0baf2ab441d48ee32a3ccf40fbc73c2c5cbcea2a 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -510,6 +510,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -501,6 +501,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -49,10 +49,10 @@ index 602008278edca8b34ba02e5c5d236ab9342b3cc0..76261e6b09094527327e068e183d3d3b
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 c2af7b3b2b38997b083bc860e4abca63a53d73e4..2196584c127c8a3f80bfe55aaff3187372c19b1e 100644
index 16c89377db5909ace2d12281a5ad4db49076e805..3a32228e8c131468c535f3586b1c54b307062c42 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -135,6 +135,7 @@ class NetworkService;
@@ -139,6 +139,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -60,7 +60,7 @@ index c2af7b3b2b38997b083bc860e4abca63a53d73e4..2196584c127c8a3f80bfe55aaff31873
} // namespace network
namespace rappor {
@@ -823,6 +824,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -824,6 +825,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -70,10 +70,10 @@ index c2af7b3b2b38997b083bc860e4abca63a53d73e4..2196584c127c8a3f80bfe55aaff31873
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 2c43fe2096f9c76b6ca757dcd2d53eb596bca2c1..f815739a06a60e050003d2819ddab82be2abf3a6 100644
index 23ea7af344a1eaca2d0301cee9fe4bedde57b93a..37ac96bb7d42fe4caeb31861875219079d986982 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -70,6 +70,7 @@
@@ -69,6 +69,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 2c43fe2096f9c76b6ca757dcd2d53eb596bca2c1..f815739a06a60e050003d2819ddab82b
#include "content/renderer/media/audio/audio_device_factory.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_frame_proxy.h"
@@ -1333,6 +1334,8 @@ WebView* RenderViewImpl::CreateView(
@@ -1294,6 +1295,8 @@ WebView* RenderViewImpl::CreateView(
}
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
@@ -91,10 +91,10 @@ index 2c43fe2096f9c76b6ca757dcd2d53eb596bca2c1..f815739a06a60e050003d2819ddab82b
// 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 5908c91e81f94575ec772fa86833fe1effe07c99..ac05f23929d1223646d6bc1956a581c48ee1f844 100644
index 4497b2d0c264f3e8ebc05230bdc117b6abccc23b..2eaa105035208d92cdcfe0e4de2a62ebbce1414b 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
@@ -331,6 +331,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -326,6 +326,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -104,10 +104,10 @@ index 5908c91e81f94575ec772fa86833fe1effe07c99..ac05f23929d1223646d6bc1956a581c4
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 63252a3503176be335510c0bbeaed2a39929930d..45fab07bdc9d11df755cb172f7314e6f131f31df 100644
index 5f985e2f11ebef42ed676260297e5e699096ba4a..2f3e68199f50b0e85dbb0d5cb95388279a194028 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
@@ -69,6 +69,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -66,6 +66,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,

View File

@@ -20,7 +20,7 @@ index 48ac0a24efde0cb7d3ba71c8b8bdf5178f606e80..e2beefc276098fdc8f1cdab2e0edb8fa
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
diff --git a/components/language/core/browser/language_prefs.cc b/components/language/core/browser/language_prefs.cc
index 4fd35c8d5bba01c25c906b19bb251222ba3d25b4..4770f0d6a8d145e5d16931d5caf4f1f85abead20 100644
index 7e06f689632ae67e3e17d7985c6e7b6ea0057f3c..0b4676f4c40b4a0eda927a51016ec91ec230291d 100644
--- a/components/language/core/browser/language_prefs.cc
+++ b/components/language/core/browser/language_prefs.cc
@@ -21,7 +21,7 @@

View File

@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
in atom::CommonWebContentsDelegate::ResetManageWebContents.
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index c7011af100a71b1ea90bc5d059bf1cc65f43f556..84e5ed786ac73497102ce82870e71ab085c626b4 100644
index 89a157897b578fe454ad795da06a935786618937..79fe191082e23f5a870cc46641dec702870665ac 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1483,7 +1483,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
@@ -1499,7 +1499,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
NOTREACHED();
#else
base::RunLoop run_loop;

View File

@@ -17,7 +17,7 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index aacac1dc1e6c70e63dce08e81327db9fbabb5148..49ac1945ccb523dff61caf5b88a2bbc906b6fd09 100644
index 0a1227d51c2413ec8467932cea294b988899778a..3ac22203ce7e435f0a31fe60e2605cb7ed074a86 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1250,8 +1250,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
@@ -46,18 +46,20 @@ index aacac1dc1e6c70e63dce08e81327db9fbabb5148..49ac1945ccb523dff61caf5b88a2bbc9
// 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 00a096c43f13d8addcf202545ac2aef97ef9c556..0145c63c41ba67b260b5df273d04e5b87c22af23 100644
index ac1e34f5ee216360a8899ec9c8c047eaa06470ac..5581b2fc813fcb48798f19fa67e14e4b71235f75 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -744,9 +744,9 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
@@ -743,10 +743,10 @@ void ClipboardWin::WriteBitmapFromHandle(HBITMAP source_hbitmap,
}
void ClipboardWin::WriteToClipboard(unsigned int format, HANDLE handle) {
- DCHECK(clipboard_owner_->hwnd() != nullptr);
+ // DCHECK(clipboard_owner_->hwnd() != nullptr);
- DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
+ //DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
if (handle && !::SetClipboardData(format, handle)) {
- DCHECK(ERROR_CLIPBOARD_NOT_OPEN != GetLastError());
+ // DCHECK(ERROR_CLIPBOARD_NOT_OPEN != GetLastError());
- 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);
}
}

View File

@@ -15,10 +15,10 @@ the redraw locking mechanism, which fixes these issues. The electron issue
can be found at https://github.com/electron/electron/issues/1821
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 08807dc1a6cabea84277de128a92bc8de2bbee63..1fd8da727592fec91056021ea9616996a8f54b92 100644
index c985bf35795211266e95364447e5462b63a4e657..1afa1b4bdb04b0c0a41b9198310b03fb77cb72bf 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;
@@ -304,6 +304,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
} // namespace
@@ -29,7 +29,7 @@ index 08807dc1a6cabea84277de128a92bc8de2bbee63..1fd8da727592fec91056021ea9616996
// A scoping class that prevents a window from being able to redraw in response
// to invalidations that may occur within it for the lifetime of the object.
//
@@ -356,6 +360,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
@@ -355,6 +359,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
cancel_unlock_(false),
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
::IsWindow(hwnd_) &&
@@ -37,7 +37,7 @@ index 08807dc1a6cabea84277de128a92bc8de2bbee63..1fd8da727592fec91056021ea9616996
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
!ui::win::IsAeroGlassEnabled())) {
if (should_lock_)
@@ -975,6 +980,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
@@ -971,6 +976,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
return scoped_enable;
}
@@ -49,10 +49,10 @@ index 08807dc1a6cabea84277de128a92bc8de2bbee63..1fd8da727592fec91056021ea9616996
// HWNDMessageHandler, gfx::WindowImpl overrides:
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 84dae56aad5bed31caf4e885cc919473f73decd2..4d094132f2c7f7f32328b27406cde8215dc56829 100644
index 276fc61b1ae98021a53d4cc2c23b708bdb6633f7..c717121d220ce993d9a984af6124375f0398ba2f 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -202,6 +202,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
@@ -203,6 +203,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
using TouchIDs = std::set<DWORD>;
enum class DwmFrameState { kOff, kOn };

View File

@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index eec90ffd526a1fce7dc05bcd47764ae2f9a34796..559503c10d4887209dfd31535c714f176bd5bf45 100644
index 9fc38f2d65ad283d9ca4c8360c0e471048e4abd3..97d93b6b2500f9489cf6e9bf4c995cd154083352 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1816,6 +1816,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {
@@ -1804,6 +1804,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {
const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpaceAndId(
int* id) const {
@@ -37,7 +37,7 @@ index eec90ffd526a1fce7dc05bcd47764ae2f9a34796..559503c10d4887209dfd31535c714f17
// 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 0743417d59c41ce2b4ba89f89f7f03db3849fc74..65f3ab8f48477908ed605f9c73d9d21f1a3709c3 100644
index 161ce54e75c0047797e9d0db27aafc3d0bfe7140..61838deb281cc11db50d195cf960970ee9cdac89 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -100,6 +100,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -83,7 +83,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 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319bc1a6ff15 100644
index faea02e2fecf6bf8f0ad055a864cf9a00e60efa6..36f365e50c84e10082774ff2930d6d651567221a 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -83,6 +83,9 @@
@@ -160,7 +160,7 @@ index 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319b
#if defined(OS_WIN)
// Force sRGB output on Windows for overlay candidate video quads to match
@@ -2463,8 +2468,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
@@ -2467,8 +2472,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
@@ -171,7 +171,7 @@ index 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319b
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2526,8 +2531,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2530,8 +2535,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
@@ -182,7 +182,7 @@ index 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319b
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -3239,7 +3244,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
@@ -3242,7 +3247,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
const gfx::ColorSpace& src_color_space,
const gfx::ColorSpace& dst_color_space) {
@@ -193,7 +193,7 @@ index 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319b
gfx::ColorSpace adjusted_color_space = src_color_space;
float sdr_white_level = current_frame()->sdr_white_level;
@@ -3634,7 +3641,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
@@ -3628,7 +3635,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
*overlay_texture = FindOrCreateOverlayTexture(
params.quad->render_pass_id, iosurface_width, iosurface_height,
@@ -202,7 +202,7 @@ index 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319b
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
gfx::SizeF((*overlay_texture)->texture.size()));
@@ -3853,8 +3860,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
@@ -3847,8 +3854,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
PrepareGeometry(SHARED_BINDING);
@@ -213,17 +213,17 @@ index 30533e787515416723ec41095119871a02fa7805..2682fb11f2c0049c3f3be9a34a2b319b
gfx::Transform render_matrix;
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
@@ -4014,3 +4021,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
@@ -4008,3 +4015,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 afda4382cde0e00a8ed19983b498c57bdf3a1cfe..347165e1806425c6bd6fe9573834fa7fb42ccafa 100644
index 20a2cae2de196aede4314e0a94638fdc5be04b75..160092c7e996d0f0232eda91e7a62bb7127c3080 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -193,6 +193,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -213,6 +213,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
// Command-line switches to propagate to the GPU process.
static const char* const kSwitchNames[] = {
@@ -232,7 +232,7 @@ index afda4382cde0e00a8ed19983b498c57bdf3a1cfe..347165e1806425c6bd6fe9573834fa7f
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 89a77a7c263eccbf4d6dd29bbfd7924647bd5f2e..db1201218322a3bb3955aeea6f1f2e74abc9b898 100644
index cd0bc10cda20c0f874d9c315ee16860255287631..0b0529f7000ced635df3442409056f79086b0c53 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -228,6 +228,7 @@
@@ -243,7 +243,7 @@ index 89a77a7c263eccbf4d6dd29bbfd7924647bd5f2e..db1201218322a3bb3955aeea6f1f2e74
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "url/origin.h"
@@ -2988,6 +2989,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3059,6 +3060,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
@@ -252,10 +252,10 @@ index 89a77a7c263eccbf4d6dd29bbfd7924647bd5f2e..db1201218322a3bb3955aeea6f1f2e74
service_manager::switches::kDisableInProcessStackTraces,
service_manager::switches::kDisableSeccompFilterSandbox,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 60fc1899350549866b1084175f8f7f31ee56e38b..120236bc3b0eadd1c5cfd51517309a4c603eb1c5 100644
index 12a3fd16b7da6b15a863c37e86fcb4f9dac08b84..c1d71f98f04ec7b3df0ea466bcbc2faaa13b20bd 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2938,6 +2938,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
@@ -2855,6 +2855,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
@@ -266,7 +266,7 @@ index 60fc1899350549866b1084175f8f7f31ee56e38b..120236bc3b0eadd1c5cfd51517309a4c
// is what the renderer uses if its not threaded.
settings.enable_checker_imaging =
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
index a947db5fb562fb4ccbfb94df88f460f1da9451f4..77c816b2c5e98a4546c74d9358dfcf3f205f1781 100644
index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75f1177cb9 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
@@ -4,6 +4,7 @@
@@ -285,7 +285,7 @@ index a947db5fb562fb4ccbfb94df88f460f1da9451f4..77c816b2c5e98a4546c74d9358dfcf3f
namespace blink {
@@ -85,6 +87,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
@@ -89,6 +91,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
}
gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
@@ -297,7 +297,7 @@ index a947db5fb562fb4ccbfb94df88f460f1da9451f4..77c816b2c5e98a4546c74d9358dfcf3f
gfx::ColorSpace::PrimaryID primary_id = GetPrimaryID(color_space_);
// TODO(ccameron): This needs to take into account whether or not this texture
@@ -98,6 +105,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
@@ -102,6 +109,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
}
gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
@@ -310,7 +310,7 @@ index a947db5fb562fb4ccbfb94df88f460f1da9451f4..77c816b2c5e98a4546c74d9358dfcf3f
gfx::ColorSpace::TransferID transfer_id =
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index c383d42c986aa29fcdfc2009901ed452ef480b55..1b8d0818155a407eb42c3f785e9609fe7bfa3dc7 100644
index 2b1691687293c069dad9d84b6d2a34a8bd9adde7..90b879ad3f1a7b265b825209185b52492d79c7d5 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -16,6 +16,7 @@

View File

@@ -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 b6897c88c2c433e73f092f2ccebf29f097db35b0..478a753393d37bf5dce09cfb415b51f3cd97c017 100644
index 064c44b2d056a3428428fd415b2a78c621cc09c2..ff183a91e42597835878c2be189229c28cb9792b 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -475,7 +475,11 @@
@@ -469,7 +469,11 @@
return;
host()->WasHidden();

View File

@@ -6,10 +6,10 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index fd91861198a0cd1724a8702ba436e63644d2360e..5d591ea96af1f26664fc39baf8fdc18938e7cf7a 100644
index cb19c7f0fb1fbda6e0b84062e4754622123e05e8..dc7169488b75972a22ed82eef564f8290be4ba36 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -636,6 +636,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -614,6 +614,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
return;
@@ -20,10 +20,10 @@ index fd91861198a0cd1724a8702ba436e63644d2360e..5d591ea96af1f26664fc39baf8fdc189
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 15a23f9540896fcb76796da1de8552e319d82f32..59a675ae58b5a46e63e187184b4359a62b6368e2 100644
index ff2505c99eff7a72528582753a1a161cd26264cc..0ae5bb7f78c3a29cbc146c69c7e7760092875f3e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -187,6 +187,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -176,6 +176,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// RenderWidgetHostImpl.
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);

View File

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

View File

@@ -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 8b51dbe8f2859de3be2e6dc918f4eb535a8a5622..f7e687aaeb4c0df5a73a0d94bdd2d75d1f367786 100644
index 7e7e50880804583acf75206d3f5f1c6f4c3b158d..3e69113249366e4bb6e62a9fe7085f608dd59755 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -981,6 +981,13 @@ void NetworkContext::SetNetworkConditions(
@@ -991,6 +991,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index 8b51dbe8f2859de3be2e6dc918f4eb535a8a5622..f7e687aaeb4c0df5a73a0d94bdd2d75d
// 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 829a26f486e1e7c7a24f1d273e9af48df5fbd9b1..e9f22a8f1bf8d2299e275c985b4cbb93d35607a2 100644
index 67f0e98426345beac34bfd41be384210be5911e4..b6fcd9920fcc047d58501dccc492bb0a118e654f 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -233,6 +233,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -234,6 +234,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 829a26f486e1e7c7a24f1d273e9af48df5fbd9b1..e9f22a8f1bf8d2299e275c985b4cbb93
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 f45ea3ba79d68d6d58aedba54c5bc9d7fc4935e9..def2cb5e252389879c6287d44d29e704703841cb 100644
index b3a2dd03807bc8deb867c5168af5251a818389a2..541d8017d38cbede3199e0028f3b1b260bd61b34 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -970,6 +970,9 @@ interface NetworkContext {
@@ -979,6 +979,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);
@@ -77,7 +77,7 @@ index f45ea3ba79d68d6d58aedba54c5bc9d7fc4935e9..def2cb5e252389879c6287d44d29e704
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index b1d38691d37d0319f746d0db21d21ba7bec83097..40996126da04fea86452949e11b4595badbf7fdb 100644
index cf8fe291c5d42ddc3fcaa4e062fcf8891a0af085..caf691e79d71982d65e10e6d398939e30f642f06 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 {

View File

@@ -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 d9175ae9661218b58e9b587ad3a9dbd540bfd384..ed178ea7b3d7f8039f47402bc08cae20e74aa789 100644
index c20f1455d9d81e6780deecdebfb1f1b4e125db66..8a933b20b4d5ca8c2c55c881e95695d8416a0163 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -40,6 +40,8 @@ NativeTheme::NativeTheme()
@@ -47,6 +47,8 @@ NativeTheme::NativeTheme()
NativeTheme::~NativeTheme() = default;
bool NativeTheme::ShouldUseDarkColors() const {
@@ -26,10 +26,10 @@ index d9175ae9661218b58e9b587ad3a9dbd540bfd384..ed178ea7b3d7f8039f47402bc08cae20
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 183fe5b316697e9478751bab4766238ec8e29bd2..b3855befd3586af8a36917f5a3a61b2a220842a5 100644
index 782dd1d122bfab4990c924a7fb0e7276fb51b18b..8ff66638296fefd66443ea83436258b07235aded 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -437,6 +437,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -449,6 +449,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
ColorId color_id,
ColorScheme color_scheme = ColorScheme::kDefault) const = 0;
@@ -52,7 +52,7 @@ index 183fe5b316697e9478751bab4766238ec8e29bd2..b3855befd3586af8a36917f5a3a61b2a
// 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
@@ -561,6 +577,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -573,6 +589,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
PreferredColorScheme preferred_color_scheme_ =
PreferredColorScheme::kNoPreference;

View File

@@ -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 eba0e7ff3344f571ca827f06615f0a4201ada435..f31f39afcdeb65aa4033045ac49cc7e3625a3ac8 100644
index 195b0f2da8a08f59566bb6306ccbec94b684d613..8d04d13574374a2cf2b09c2dd30b6b9f07b4ac84 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -434,6 +434,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -433,6 +433,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
Send(new ViewMsg_SetBackgroundOpaque(GetRoutingID(), opaque));
}
@@ -21,10 +21,10 @@ index eba0e7ff3344f571ca827f06615f0a4201ada435..f31f39afcdeb65aa4033045ac49cc7e3
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 64a3ad79707ccffa18eedef01e669167e87f6044..f7d0a59ad20c8e06d4af1f93ca6d4a98dfd759d2 100644
index 4311c3406cc8a3e2af505df182c890e4de6e5ea3..15daed8fd4071926c9fa7bf3aa00789b0dae0928 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -103,6 +103,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -108,6 +108,7 @@ class CONTENT_EXPORT RenderViewHostImpl
SiteInstanceImpl* GetSiteInstance() override;
bool IsRenderViewLive() override;
void NotifyMoveOrResizeStarted() override;
@@ -33,10 +33,10 @@ index 64a3ad79707ccffa18eedef01e669167e87f6044..f7d0a59ad20c8e06d4af1f93ca6d4a98
void UpdateWebkitPreferences(const WebPreferences& prefs) override;
void OnWebkitPreferencesChanged() override;
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index a609cc1fa1558987b634dcbc41120ddc93a711a0..3b3058398e97d2f21458ee427aeeee19c78ff649 100644
index accb317ce091177766a8c49054b3e274b57871d8..8e0c40cbb98e02849c4c9dffc714eb48fbb40d57 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -114,6 +114,9 @@ IPC_STRUCT_TRAITS_END()
@@ -109,6 +109,9 @@ IPC_STRUCT_TRAITS_END()
// Make the RenderWidget background transparent or opaque.
IPC_MESSAGE_ROUTED1(ViewMsg_SetBackgroundOpaque, bool /* opaque */)
@@ -61,10 +61,10 @@ 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 f815739a06a60e050003d2819ddab82be2abf3a6..0263848e99769af49641b2fad0575f714e797e5d 100644
index 37ac96bb7d42fe4caeb31861875219079d986982..d4b3d0f71ea6bc6aa9b927f32ee09eb9732c46c7 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1251,6 +1251,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
@@ -1210,6 +1210,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
IPC_MESSAGE_HANDLER(ViewMsg_SetPageScale, OnSetPageScale)
IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
@@ -73,7 +73,7 @@ index f815739a06a60e050003d2819ddab82be2abf3a6..0263848e99769af49641b2fad0575f71
IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage)
@@ -1843,6 +1845,12 @@ void RenderViewImpl::OnSetPageScale(float page_scale_factor) {
@@ -1800,6 +1802,12 @@ void RenderViewImpl::OnSetPageScale(float page_scale_factor) {
webview()->SetPageScaleFactor(page_scale_factor);
}
@@ -87,10 +87,10 @@ index f815739a06a60e050003d2819ddab82be2abf3a6..0263848e99769af49641b2fad0575f71
PageVisibilityState visibility_state,
bool initial_setting) {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 87994092a9b0e7ea0d33675c502408a5a47eac87..5d08253ed69e9a180251ad9693335c4ad43adba6 100644
index a6768059fb7e91115f4659f236f096d264977408..a5954b581e06f78d364f4525f1550f7f13c836ec 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -450,6 +450,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
@@ -452,6 +452,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
void OnSetInitialFocus(bool reverse);
void OnSetRendererPrefs(
const blink::mojom::RendererPreferences& renderer_prefs);
@@ -99,10 +99,10 @@ index 87994092a9b0e7ea0d33675c502408a5a47eac87..5d08253ed69e9a180251ad9693335c4a
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 53d6d4ebd22ad8f3dd9badba7601dcc27a002a2a..7abf1c05c8e821de8df26938e4f098a58a06655b 100644
index dc04ef3eb3a1a56d932a22ffce7b71bb60786f7a..3e7d605d7a0f884299e441d954877c03436aa618 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -404,6 +404,7 @@ class WebView {
@@ -399,6 +399,7 @@ class WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@@ -111,10 +111,10 @@ index 53d6d4ebd22ad8f3dd9badba7601dcc27a002a2a..7abf1c05c8e821de8df26938e4f098a5
// 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 2e2b95750635fa5aedc17eabcd84fa97ed0c951a..7649f65d5f05c4609c495ddf4d47f640a010d7e4 100644
index 34ff617acbd75b2d431aef194cceff651aadc24f..b681d16f2bf1aa9151d455f1a6d9ebb55adeae7b 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3364,12 +3364,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3326,12 +3326,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -138,10 +138,10 @@ index 2e2b95750635fa5aedc17eabcd84fa97ed0c951a..7649f65d5f05c4609c495ddf4d47f640
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 7161adf93687544024d7cc9d23fe423bb4e9eca3..d55296a159e9453add9a8a63058b5a5647cf5b3e 100644
index 3154dbd08dc8aa0386c6259afdec084570822a9e..b9f6ed110e4527a9a05074c31cc89982edaae4f2 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,
@@ -306,6 +306,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -149,7 +149,7 @@ index 7161adf93687544024d7cc9d23fe423bb4e9eca3..d55296a159e9453add9a8a63058b5a56
void SetVisibilityState(PageVisibilityState visibility_state,
bool is_initial_state) override;
PageVisibilityState GetVisibilityState() override;
@@ -682,6 +683,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -680,6 +681,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// WebViewImpl::Close while handling an input event.
bool debug_inside_input_handling_ = false;

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Wed, 8 Jan 2020 16:06:14 -0800
Subject: FIXME: grit conflicts
This works around a bug in grit's handling of generated .grd files.
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 9f66e1221eda1fbb6e86a4d7541e07d222512171..f47f8edb54984f7497e7c69e2565abc83f58dc8b 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -569,15 +569,16 @@
"includes": [3840],
},
+ # FIXME: put this back after devtools_resources once grit is fixed to respect META properly
+ "electron/electron_resources.grd": {
+ "messages": [3860],
+ "includes": [4100],
+ },
+
# This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": {
"META": {"sizes": {"includes": [500],}},
- "includes": [3860],
- },
-
- "electron/electron_resources.grd": {
- "messages": [31750],
- "includes": [31950],
+ "includes": [4860],
},
# END "everything else" section.

View File

@@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 413050e4779fc471da1d2219a55f0dc8378174b4..93aeacdab1e365d7dce4c6eb1c3da5916a0d05aa 100644
index a9502e1bb1be5e67bbec201405dd0995770444cb..654dfa5b3a1572dd741390a0ad1612b50e4552cd 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -1214,6 +1214,24 @@ void NavigationRequest::BeginNavigation() {
@@ -1186,6 +1186,24 @@ void NavigationRequest::BeginNavigation() {
TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationRequest", this,
"ResponseStarted");
@@ -71,10 +71,10 @@ index 413050e4779fc471da1d2219a55f0dc8378174b4..93aeacdab1e365d7dce4c6eb1c3da591
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 240850ff8ae0a73c85e840e0753c7c07135aae7a..528a02609f02c1e4912f0a10d76d74b27e201b6f 100644
index 5042925bf761245b3ab42e83b009190b390e33ab..913245edf9d64bb6bdbee5e96493ad5b8e5cde0a 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2137,6 +2137,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -2129,6 +2129,16 @@ bool RenderFrameHostManager::InitRenderView(
scoped_refptr<SiteInstance>
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
NavigationRequest* request) {
@@ -91,7 +91,7 @@ index 240850ff8ae0a73c85e840e0753c7c07135aae7a..528a02609f02c1e4912f0a10d76d74b2
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
// All children of MHTML documents must be MHTML documents. They all live in
@@ -2156,10 +2166,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2148,10 +2158,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
//
// TODO(clamy): We should also consider as a candidate SiteInstance the
// speculative SiteInstance that was computed on redirects.
@@ -156,7 +156,7 @@ index 240850ff8ae0a73c85e840e0753c7c07135aae7a..528a02609f02c1e4912f0a10d76d74b2
scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation(
request->common_params().url, request->GetSourceSiteInstance(),
@@ -2169,6 +2229,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2161,6 +2221,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->GetRestoreType() != RestoreType::NONE, request->is_view_source(),
request->WasServerRedirect());
@@ -167,10 +167,10 @@ index 240850ff8ae0a73c85e840e0753c7c07135aae7a..528a02609f02c1e4912f0a10d76d74b2
}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 6a0c85cad42da9e048fbbc7108f55368c81071c5..34b751d095fcc1e137bcb4ff44a059a3dd11b4a8 100644
index f16abf44e24c7173d721352c53241228fe72a3e4..3d33d492b8cf4d79b4c81dac53d30e03c7dddea3 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -369,6 +369,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
@@ -413,6 +413,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
return browsing_instance_->HasSiteInstance(url);
}
@@ -182,10 +182,10 @@ index 6a0c85cad42da9e048fbbc7108f55368c81071c5..34b751d095fcc1e137bcb4ff44a059a3
const GURL& url) {
return browsing_instance_->GetSiteInstanceForURL(
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index 59edc1fe0c22e82225bd2a3d8059f386d97db127..6bc92bbb5604111ecdc6b78be025bb7e7ee5ecb5 100644
index caa100b3889e17a9afdc8127e0e13bb6b86e8042..f08d3a2eb28f0f6fff89b5759eff5369b7111821 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -84,6 +84,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
@@ -98,6 +98,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
BrowserContext* GetBrowserContext() override;
const GURL& GetSiteURL() override;
scoped_refptr<SiteInstance> GetRelatedSiteInstance(const GURL& url) override;
@@ -194,10 +194,10 @@ index 59edc1fe0c22e82225bd2a3d8059f386d97db127..6bc92bbb5604111ecdc6b78be025bb7e
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 76261e6b09094527327e068e183d3d3b2665467b..fbd1be0f69aabdda47315e54518c0567b6aec3b8 100644
index 0baf2ab441d48ee32a3ccf40fbc73c2c5cbcea2a..b1646da3383f1799ff47900a00da333d1bdabff3 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -49,6 +49,21 @@
@@ -50,6 +50,21 @@
namespace content {
@@ -220,13 +220,13 @@ index 76261e6b09094527327e068e183d3d3b2665467b..fbd1be0f69aabdda47315e54518c0567
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 2196584c127c8a3f80bfe55aaff3187372c19b1e..b391bacc010ad973ae38e70cd56f33949ee0bd20 100644
index 3a32228e8c131468c535f3586b1c54b307062c42..835cdff288ddf57674d5cc44ea2aaacf6facd03d 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -216,8 +216,45 @@ struct WebPreferences;
// the observer interfaces.)
class CONTENT_EXPORT ContentBrowserClient {
public:
@@ -226,8 +226,45 @@ class CONTENT_EXPORT ContentBrowserClient {
using IsClipboardPasteAllowedCallback =
base::OnceCallback<void(ClipboardPasteAllowed)>;
+ // Identifies the type of site instance to use for a navigation.
+ enum SiteInstanceForNavigationType {
+ // Use either the candidate site instance or, if it doesn't exist
@@ -270,7 +270,7 @@ index 2196584c127c8a3f80bfe55aaff3187372c19b1e..b391bacc010ad973ae38e70cd56f3394
// implementations for the browser startup code. See comments in
// browser_main_parts.h.
diff --git a/content/public/browser/site_instance.h b/content/public/browser/site_instance.h
index a718f53111bbaa0c248930a577f25b34e2d15494..5fafbed85e5549f0039da6414a40a653bbb72853 100644
index e3095f34c057ccf25b46beb809fbb88a440cc230..9d4472415d87455468cff86217e7489d39383e4e 100644
--- a/content/public/browser/site_instance.h
+++ b/content/public/browser/site_instance.h
@@ -121,6 +121,11 @@ class CONTENT_EXPORT SiteInstance : public base::RefCounted<SiteInstance> {

View File

@@ -5,12 +5,12 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids
index 1699b6194dd75ffa84beb841c1dd1d7bcc25b216..45a511239f6a057f471e71d4f5aec1baf8cfc5df 100644
--- a/tools/gritsettings/resource_ids
+++ b/tools/gritsettings/resource_ids
@@ -573,6 +573,11 @@
"includes": [20080],
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index df4c6325986bee4642672ecd8a964a69fcee7681..9f66e1221eda1fbb6e86a4d7541e07d222512171 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -575,6 +575,11 @@
"includes": [3860],
},
+ "electron/electron_resources.grd": {

View File

@@ -7,7 +7,7 @@ Dont compare RC.exe and RC.py output.
FIXME: It has to be reverted once the script is fixed.
diff --git a/build/toolchain/win/rc/rc.py b/build/toolchain/win/rc/rc.py
index 5c0442bef19334004647bf6e5dcbabcf399f2ec6..05fb71a1a18d35d361cac8eddece95b665f74ed8 100755
index 74761866eecfe4e742af974aab71ec05817c3a6a..91ad9ac4c7d59be0cc95341d61e0e30a23869601 100755
--- a/build/toolchain/win/rc/rc.py
+++ b/build/toolchain/win/rc/rc.py
@@ -234,7 +234,10 @@ def CompareToMsRcOutput(preprocessed_output, is_utf8, flags):

View File

@@ -0,0 +1,146 @@
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_custom_window_frame.patch
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
--- 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 @@
#include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h"
#include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h"
+#ifndef MAS_BUILD
@interface NSWindow (PrivateBrowserNativeWidgetAPI)
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle;
@end
@@ -69,10 +70,13 @@ - (NSRect)_draggableFrame NS_DEPRECATED_MAC(10_10, 10_11) {
@end
+#endif // MAS_BUILD
+
@implementation BrowserNativeWidgetWindow
// NSWindow (PrivateAPI) overrides.
+#ifndef MAS_BUILD
+ (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 {
return NO;
}
+#endif // MAS_BUILD
+
// Handle "Move focus to the window toolbar" configured in System Preferences ->
// Keyboard -> Shortcuts -> Keyboard. Usually Ctrl+F5. The argument (|unknown|)
// tends to just be nil.
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm
index 8416c7c6e052dafb2aad61c0bd3224c36e945d23..cd356beda023ab2409b16d58ca38c70ba3674913 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm
@@ -4,6 +4,8 @@
#import "components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.h"
+#ifndef MAS_BUILD
+
@interface NSWindow (PrivateAPI)
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle;
@end
@@ -18,8 +20,12 @@ - (CGFloat)_titlebarHeight {
}
@end
+#endif // MAS_BUILD
+
@implementation NativeWidgetMacFramelessNSWindow
+#ifndef MAS_BUILD
+
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle {
if ([NativeWidgetMacFramelessNSWindowFrame class]) {
return [NativeWidgetMacFramelessNSWindowFrame class];
@@ -27,4 +33,6 @@ + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle {
return [super frameViewClassForStyleMask:windowStyle];
}
+#endif // MAS_BUILD
+
@end
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
index e03bbc724cfd01967e71998394361556df1c4915..783745b11365c04c1e1052197d20d494bc901d45 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
@@ -17,6 +17,7 @@ class NativeWidgetNSWindowBridge;
@protocol WindowTouchBarDelegate;
+#ifndef MAS_BUILD
// Weak lets Chrome launch even if a future macOS doesn't have the below classes
WEAK_IMPORT_ATTRIBUTE
@interface NSNextStepFrame : NSView
@@ -33,6 +34,7 @@ REMOTE_COCOA_APP_SHIM_EXPORT
REMOTE_COCOA_APP_SHIM_EXPORT
@interface NativeWidgetMacNSWindowTitledFrame : NSThemeFrame
@end
+#endif
// 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 3786db1f2fa8f617eb9cd59c85b84b7d020e4ff3..64e84b91236b382d4bdfb5ab2e26006952c869a0 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -15,7 +15,9 @@
#import "ui/base/cocoa/window_size_constants.h"
@interface NSWindow (Private)
+#ifndef MAS_BUILD
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle;
+#endif
- (BOOL)hasKeyAppearance;
- (long long)_resizeDirectionForMouseLocation:(CGPoint)location;
- (BOOL)_isConsideredOpenForPersistentState;
@@ -57,6 +59,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event {
}
@end
+#ifndef MAS_BUILD
+
@implementation NativeWidgetMacNSWindowTitledFrame
- (void)mouseDown:(NSEvent*)event {
if (self.window.isMovable)
@@ -78,6 +82,8 @@ - (BOOL)usesCustomDrawing {
}
@end
+#endif // MAS_BUILD
+
@implementation NativeWidgetMacNSWindow {
@private
base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
@@ -159,6 +165,8 @@ - (BOOL)hasViewsMenuActive {
// NSWindow overrides.
+#ifndef MAS_BUILD
+
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
if (windowStyle & NSWindowStyleMaskTitled) {
if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
@@ -170,6 +178,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
return [super frameViewClassForStyleMask:windowStyle];
}
+#endif
+
- (BOOL)_isTitleHidden {
bool shouldShowWindowTitle = YES;
if (_bridge)

View File

@@ -0,0 +1,290 @@
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_accessibility.patch
Disable remote accessibility APIs (NSAccessibilityRemoteUIElement) for MAS
build.
According to ccameron:
NSAccessibilityRemoteUIElement is unnecessary for Electron's use-case. We use it
for progressive web apps (where the AXTree is in the browser process, but macOS
needs to think it's coming from the PWA process). I think it can just be chopped
out -- if there are any side-effects, we should be able to work around them.
diff --git a/components/remote_cocoa/app_shim/application_bridge.mm b/components/remote_cocoa/app_shim/application_bridge.mm
index 9ddda9116e7284cbccde8a51e23ad7560dd06367..e846091ad99b0154636489e53491209ff3cbfaaa 100644
--- a/components/remote_cocoa/app_shim/application_bridge.mm
+++ b/components/remote_cocoa/app_shim/application_bridge.mm
@@ -49,6 +49,7 @@
// NativeWidgetNSWindowHostHelper:
id GetNativeViewAccessible() override {
+#ifndef MAS_BUILD
if (!remote_accessibility_element_) {
int64_t browser_pid = 0;
std::vector<uint8_t> element_token;
@@ -59,6 +60,9 @@ id GetNativeViewAccessible() override {
ui::RemoteAccessibility::GetRemoteElementFromToken(element_token);
}
return remote_accessibility_element_.get();
+#else
+ return nil;
+#endif
}
void DispatchKeyEvent(ui::KeyEvent* event) override {
bool event_handled = false;
@@ -96,8 +100,10 @@ void GetWordAt(const gfx::Point& location_in_content,
mojo::AssociatedRemote<mojom::TextInputHost> text_input_host_remote_;
std::unique_ptr<NativeWidgetNSWindowBridge> bridge_;
+#ifndef MAS_BUILD
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
remote_accessibility_element_;
+#endif
};
} // namespace
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
index 42167add601c67666bc9100d94f924fc0ed14fb1..3633605e353323cca805a951062be0e259c61ee7 100644
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -554,10 +554,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
// this should be treated as an error and caught early.
CHECK(bridged_view_);
+#ifndef MAS_BUILD
// Send the accessibility tokens for the NSView now that it exists.
host_->SetRemoteAccessibilityTokens(
ui::RemoteAccessibility::GetTokenForLocalElement(window_),
ui::RemoteAccessibility::GetTokenForLocalElement(bridged_view_));
+#endif
// Beware: This view was briefly removed (in favor of a bare CALayer) in
// crrev/c/1236675. The ordering of unassociated layers relative to NSView
diff --git a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
index a8e5c8888cb7ea8a85de7c8e8c613cc2b3c5be15..d01468fe77703b2812865b0198b84b0b645283c4 100644
--- a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
+++ b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
@@ -66,8 +66,10 @@ id GetFocusedBrowserAccessibilityElement() override {
return nil;
}
void SetAccessibilityWindow(NSWindow* window) override {
+#ifndef MAS_BUILD
host_->SetRemoteAccessibilityWindowToken(
ui::RemoteAccessibility::GetTokenForLocalElement(window));
+#endif
}
void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
@@ -126,8 +128,10 @@ void SmartMagnify(const blink::WebGestureEvent& web_event) override {
mojo::AssociatedRemote<mojom::RenderWidgetHostNSViewHost> host_;
std::unique_ptr<RenderWidgetHostNSViewBridge> bridge_;
+#ifndef MAS_BUILD
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
remote_accessibility_element_;
+#endif
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
--- 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;
@protocol RenderWidgetHostViewMacDelegate;
+#ifndef MAS_BUILD
@class NSAccessibilityRemoteUIElement;
+#endif
@class RenderWidgetHostViewCocoa;
namespace content {
@@ -617,10 +619,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// EnsureSurfaceSynchronizedForWebTest().
uint32_t latest_capture_sequence_number_ = 0u;
+#ifndef MAS_BUILD
// Remote accessibility objects corresponding to the NSWindow that this is
// displayed to the user in.
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
remote_window_accessible_;
+#endif
// 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 e6e26f703be064924dbb7e36555c60ba91b0123f..064c44b2d056a3428428fd415b2a78c621cc09c2 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 @@
void RenderWidgetHostViewMac::MigrateNSViewBridge(
remote_cocoa::mojom::Application* remote_cocoa_application,
uint64_t parent_ns_view_id) {
+#ifndef MAS_BUILD
// Destroy the previous remote accessibility element.
remote_window_accessible_.reset();
+#endif
// 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,
gfx::NativeViewAccessible
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
+#ifndef MAS_BUILD
if (remote_window_accessible_)
return remote_window_accessible_.get();
+#endif
return [GetInProcessNSView() window];
}
@@ -1367,9 +1371,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
}
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
+#ifndef MAS_BUILD
// When running in-process, just use the NSView's NSWindow as its own
// accessibility element.
remote_window_accessible_.reset();
+#endif
}
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
@@ -1852,12 +1858,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
const std::vector<uint8_t>& window_token) {
+#ifndef MAS_BUILD
if (window_token.empty()) {
remote_window_accessible_.reset();
} else {
remote_window_accessible_ =
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
}
+#endif
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index db6083732090b8ccee029aa6a7cc11f0d17ab218..3d34fc3a442f46abf4cad222b9d5e05db6762278 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -306,6 +306,13 @@ jumbo_component("base") {
]
}
+ if (is_mas_build) {
+ sources -= [
+ "cocoa/remote_accessibility_api.h",
+ "cocoa/remote_accessibility_api.mm",
+ ]
+ }
+
if (is_posix) {
sources += [ "l10n/l10n_util_posix.cc" ]
}
diff --git a/ui/base/cocoa/remote_accessibility_api.h b/ui/base/cocoa/remote_accessibility_api.h
index 2a58aebabb23443a2c11364af4988c573f3909ba..3424b6011e80e9c995519b6a8d652abd843d926b 100644
--- a/ui/base/cocoa/remote_accessibility_api.h
+++ b/ui/base/cocoa/remote_accessibility_api.h
@@ -11,6 +11,8 @@
#include "base/mac/scoped_nsobject.h"
#include "ui/base/ui_base_export.h"
+#ifndef MAS_BUILD
+
@interface NSAccessibilityRemoteUIElement : NSObject
+ (void)registerRemoteUIProcessIdentifier:(int)pid;
+ (NSData*)remoteTokenForLocalUIElement:(id)element;
@@ -32,4 +34,6 @@ class UI_BASE_EXPORT RemoteAccessibility {
} // namespace ui
+#endif // MAS_BUILD
+
#endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
index 1c68117a8987463e810d0d1da5e7e598ce8fc3e1..ad29e87c00db0d34ee3a7d95469fb3fbb1aa76c2 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -27,7 +27,9 @@
#include "ui/views/window/dialog_observer.h"
@class NativeWidgetMacNSWindow;
+#ifndef MAS_BUILD
@class NSAccessibilityRemoteUIElement;
+#endif
@class NSView;
namespace remote_cocoa {
@@ -406,11 +408,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
remote_ns_window_remote_;
+#ifndef MAS_BUILD
// Remote accessibility objects corresponding to the NSWindow and its root
// NSView.
base::scoped_nsobject<NSAccessibilityRemoteUIElement>
remote_window_accessible_;
base::scoped_nsobject<NSAccessibilityRemoteUIElement> remote_view_accessible_;
+#endif
// 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
--- 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,
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const {
if (in_process_ns_window_bridge_)
return in_process_ns_window_bridge_->ns_view();
+#ifndef MAS_BUILD
return remote_view_accessible_.get();
+#else
+ return nullptr;
+#endif
}
gfx::NativeViewAccessible
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSWindow() const {
if (in_process_ns_window_bridge_)
return in_process_ns_window_bridge_->ns_window();
+#ifndef MAS_BUILD
return remote_window_accessible_.get();
+#else
+ return nullptr;
+#endif
}
remote_cocoa::mojom::NativeWidgetNSWindow*
@@ -1133,6 +1141,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
const std::vector<uint8_t>& window_token,
const std::vector<uint8_t>& view_token) {
+#ifndef MAS_BUILD
remote_window_accessible_ =
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
remote_view_accessible_ =
@@ -1140,14 +1149,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
[remote_view_accessible_
setTopLevelUIElement:remote_window_accessible_.get()];
+#endif
}
bool NativeWidgetMacNSWindowHost::GetRootViewAccessibilityToken(
int64_t* pid,
std::vector<uint8_t>* token) {
+#ifndef MAS_BUILD
*pid = getpid();
id element_id = GetNativeViewAccessible();
*token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id);
+#endif
return true;
}

View File

@@ -50,7 +50,7 @@ index 9cc52238971a095421c3cde01a5df24a2f6f92cd..0216501dda1dc8b8fb4307785a0dab86
// is concerned.
@property(nonatomic, readonly) NSString* subrole;
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c3182048109de2 100644
index 7d47a60cca13a4f0c26edaefc430125a01c1cb02..3191f842a929fb15640d701efdadc983c2fa35fc 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -207,6 +207,7 @@
@@ -157,7 +157,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
// Returns whether or not this node should be ignored in the
// accessibility tree.
@@ -2169,6 +2186,7 @@ - (NSArray*)selectedChildren {
@@ -2164,6 +2181,7 @@ - (NSArray*)selectedChildren {
return ret;
}
@@ -165,7 +165,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
- (NSString*)selectedText {
if (![self instanceActive])
return nil;
@@ -2180,11 +2198,13 @@ - (NSString*)selectedText {
@@ -2175,11 +2193,13 @@ - (NSString*)selectedText {
return nil;
return base::SysUTF16ToNSString(range.GetText());
}
@@ -179,7 +179,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
- (NSValue*)selectedTextRange {
if (![self instanceActive])
return nil;
@@ -2205,12 +2225,15 @@ - (NSValue*)selectedTextRange {
@@ -2200,12 +2220,15 @@ - (NSValue*)selectedTextRange {
int selLength = range.GetText().length();
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
}
@@ -195,7 +195,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
- (NSValue*)size {
if (![self instanceActive])
@@ -2243,6 +2266,7 @@ - (NSString*)sortDirection {
@@ -2238,6 +2261,7 @@ - (NSString*)sortDirection {
return nil;
}
@@ -203,7 +203,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
// Returns a text marker that points to the first character in the document that
// can be selected with VoiceOver.
- (id)startTextMarker {
@@ -2253,6 +2277,7 @@ - (id)startTextMarker {
@@ -2248,6 +2272,7 @@ - (id)startTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
}
@@ -211,7 +211,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
// Returns a subrole based upon the role.
- (NSString*)subrole {
@@ -2560,11 +2585,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
@@ -2555,11 +2580,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
NSMutableAttributedString* attributedValue =
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
@@ -225,7 +225,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
return [attributedValue attributedSubstringFromRange:range];
}
@@ -2667,9 +2694,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
@@ -2662,9 +2689,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return ToBrowserAccessibilityCocoa(cell);
}
@@ -237,7 +237,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
BrowserAccessibilityPositionInstance position =
CreatePositionFromTextMarker(parameter);
if (!position->IsNullPosition())
@@ -2980,6 +3006,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -2975,6 +3001,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return CreateTextMarker(root->CreatePositionAt(index));
}
@@ -245,7 +245,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
if ([attribute isEqualToString:
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -3013,6 +3040,7 @@ AXPlatformRange range(std::move(lineStartPosition),
@@ -3008,6 +3035,7 @@ AXPlatformRange range(std::move(lineStartPosition),
return nil;
}
@@ -253,7 +253,7 @@ index 9ed2e56e9ebad1f084074c37484f7f68c8f98460..91ec30df10337f96151e4b2ee1c31820
if ([attribute
isEqualToString:
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
@@ -3119,6 +3147,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
@@ -3114,6 +3142,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
return @(child->GetIndexInParent());
}
@@ -358,10 +358,10 @@ index b2425416b1993f037530619df0458d43d008bd03..39b096120b57c3192519a607d96c8a3d
void BluetoothAdapterMac::RemovePairingDelegateInternal(
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index 3947aa5016f9a061d98cdb838c413b204dbcbd19..36ccf8cc6e0e91e0f754d22ac69e702007af6391 100644
index 32c78e9f533782e1cfca44217a8a831959bba5e6..655bcfb43e49440ce341b11013d0620b8c2354ce 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -175,6 +175,12 @@ source_set("audio") {
@@ -171,6 +171,12 @@ source_set("audio") {
"mac/scoped_audio_unit.cc",
"mac/scoped_audio_unit.h",
]

View File

@@ -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 e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb535a8a5622 100644
index e5dfb9c6fd2032608ac32cd997fb027fd9b324e5..7e7e50880804583acf75206d3f5f1c6f4c3b158d 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -93,6 +93,11 @@
@@ -95,6 +95,11 @@
#include "services/network/url_loader.h"
#include "services/network/url_request_context_builder_mojo.h"
@@ -22,7 +22,7 @@ index e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb53
#if BUILDFLAG(IS_CT_SUPPORTED)
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
@@ -327,6 +332,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
@@ -330,6 +335,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
} // namespace
@@ -102,7 +102,7 @@ index e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb53
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
@@ -513,6 +591,13 @@ void NetworkContext::SetClient(
@@ -516,6 +594,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -116,7 +116,7 @@ index e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb53
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -1643,6 +1728,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -1661,6 +1746,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
base::CommandLine::ForCurrentProcess();
std::unique_ptr<net::CertVerifier> cert_verifier;
@@ -124,7 +124,7 @@ index e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb53
if (g_cert_verifier_for_testing) {
cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
} else {
@@ -1695,8 +1781,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -1714,8 +1800,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
}
#endif
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
@@ -135,7 +135,7 @@ index e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb53
std::make_unique<net::CoalescingCertVerifier>(
std::make_unique<net::MultiThreadedCertVerifier>(
params_->use_builtin_cert_verifier
@@ -1706,12 +1792,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -1725,12 +1811,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
cert_net_fetcher_))));
}
#endif
@@ -160,7 +160,7 @@ index e12f76b1ca50efee574a7bbf852d2f6923d528cd..8b51dbe8f2859de3be2e6dc918f4eb53
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 55d2de8f1e5d538f3168808c0b3c2a19520cf824..829a26f486e1e7c7a24f1d273e9af48df5fbd9b1 100644
index 23a5fe596b2607fa2b95f601cb621e4e11f81d50..67f0e98426345beac34bfd41be384210be5911e4 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -87,6 +87,7 @@ class DomainReliabilityMonitor;
@@ -171,7 +171,7 @@ index 55d2de8f1e5d538f3168808c0b3c2a19520cf824..829a26f486e1e7c7a24f1d273e9af48d
class CookieManager;
class ExpectCTReporter;
class HostResolver;
@@ -183,6 +184,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -184,6 +185,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) override;
@@ -180,7 +180,7 @@ index 55d2de8f1e5d538f3168808c0b3c2a19520cf824..829a26f486e1e7c7a24f1d273e9af48d
void ResetURLLoaderFactories() override;
void GetCookieManager(
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
@@ -612,6 +615,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -621,6 +624,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
#endif
@@ -190,10 +190,10 @@ index 55d2de8f1e5d538f3168808c0b3c2a19520cf824..829a26f486e1e7c7a24f1d273e9af48d
// CertNetFetcher is not used by the current platform.
scoped_refptr<cert_verifier::CertNetFetcherURLLoader> cert_net_fetcher_;
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index ee5d5864eaf9fcb4bf5f13fc5e3a6ae70a6d7a86..f45ea3ba79d68d6d58aedba54c5bc9d7fc4935e9 100644
index 32a60d94e488b12acb27700416da90cd578bbd57..b3a2dd03807bc8deb867c5168af5251a818389a2 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -190,6 +190,17 @@ struct HttpAuthStaticNetworkContextParams {
@@ -191,6 +191,17 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
};
@@ -211,7 +211,7 @@ index ee5d5864eaf9fcb4bf5f13fc5e3a6ae70a6d7a86..f45ea3ba79d68d6d58aedba54c5bc9d7
// Parameters for constructing a network context.
struct NetworkContextParams {
// Name used by memory tools to identify the context.
@@ -798,6 +809,9 @@ interface NetworkContext {
@@ -808,6 +819,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);

View File

@@ -108,10 +108,10 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index d04fe57ac79c28307e119d068e3fcc16cc1560ae..3ff0d4050a9f6b960df5e02554217abbd350d817 100644
index 9fb44d0458606955e0d28ba9ef37f3a1eb7e58ab..a9edced0ef239cbb729e7b064f755536d92f57bc 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2006,7 +2006,7 @@ void RenderProcessHostImpl::CreateNotificationService(
@@ -2028,7 +2028,7 @@ void RenderProcessHostImpl::CreateNotificationService(
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(

View File

@@ -7,7 +7,7 @@ This tweaks Chrome's pepper flash and PDF plugin support to make it
usable from Electron.
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 4bb88c55a82a83cef8330ec8157b49d5adb097ce..48f4e385a57eb0e00c90488fbf052900b6884775 100644
index d72a867594acee97d50c5f905fc1a4df9aa9352e..8a4cc159cb490ebadbb1b54aa88223c0cbf8ffdb 100644
--- a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
@@ -7,10 +7,12 @@
@@ -40,7 +40,7 @@ index 4bb88c55a82a83cef8330ec8157b49d5adb097ce..48f4e385a57eb0e00c90488fbf052900
+ return PP_OK;
}
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
index 860c5738d5731c901aeb9074074f3337d7fc4053..27435c3c91440e8c83e209097aae2b2231061eee 100644
index 6d40a6b79d027df09412db2f5e3d573bc176cb31..03eb786787cdd349b33c2512ea32ceaceede9291 100644
--- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
@@ -8,9 +8,11 @@
@@ -55,7 +55,7 @@ index 860c5738d5731c901aeb9074074f3337d7fc4053..27435c3c91440e8c83e209097aae2b22
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_task_traits.h"
@@ -43,6 +45,7 @@ using content::RenderProcessHost;
@@ -41,6 +43,7 @@ using content::RenderProcessHost;
namespace {
@@ -63,15 +63,15 @@ index 860c5738d5731c901aeb9074074f3337d7fc4053..27435c3c91440e8c83e209097aae2b22
// Get the CookieSettings on the UI thread for the given render process ID.
scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
int render_process_id) {
@@ -56,6 +59,7 @@ scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
@@ -54,6 +57,7 @@ scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
}
return nullptr;
}
+#endif
void PepperBindConnectorReceiver(
mojo::PendingReceiver<service_manager::mojom::Connector>
@@ -72,7 +76,9 @@ PepperFlashBrowserHost::PepperFlashBrowserHost(BrowserPpapiHost* host,
void BindWakeLockProviderOnUIThread(
mojo::PendingReceiver<device::mojom::WakeLockProvider> receiver) {
@@ -67,7 +71,9 @@ PepperFlashBrowserHost::PepperFlashBrowserHost(BrowserPpapiHost* host,
PP_Instance instance,
PP_Resource resource)
: ResourceHost(host->GetPpapiHost(), instance, resource),
@@ -81,7 +81,7 @@ index 860c5738d5731c901aeb9074074f3337d7fc4053..27435c3c91440e8c83e209097aae2b22
delay_timer_(FROM_HERE,
base::TimeDelta::FromSeconds(45),
this,
@@ -125,6 +131,7 @@ int32_t PepperFlashBrowserHost::OnGetLocalTimeZoneOffset(
@@ -120,6 +126,7 @@ int32_t PepperFlashBrowserHost::OnGetLocalTimeZoneOffset(
int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
ppapi::host::HostMessageContext* context) {
@@ -89,7 +89,7 @@ index 860c5738d5731c901aeb9074074f3337d7fc4053..27435c3c91440e8c83e209097aae2b22
// Getting the Flash LSO settings requires using the CookieSettings which
// belong to the profile which lives on the UI thread. We lazily initialize
// |cookie_settings_| by grabbing the reference from the UI thread and then
@@ -145,9 +152,11 @@ int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
@@ -140,9 +147,11 @@ int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
context->MakeReplyMessageContext(), document_url,
plugin_url));
}
@@ -102,7 +102,7 @@ index 860c5738d5731c901aeb9074074f3337d7fc4053..27435c3c91440e8c83e209097aae2b22
void PepperFlashBrowserHost::GetLocalDataRestrictions(
ppapi::host::ReplyMessageContext reply_context,
const GURL& document_url,
@@ -176,6 +185,7 @@ void PepperFlashBrowserHost::GetLocalDataRestrictions(
@@ -171,6 +180,7 @@ void PepperFlashBrowserHost::GetLocalDataRestrictions(
PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply(
static_cast<int32_t>(restrictions)));
}
@@ -237,7 +237,7 @@ index b9d2ce7f7f6837ee7b304daac82d21a3147c6faf..4d4b023d62d12b4d119acbfdee64f415
base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_{this};
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
index 0fa0fa341e93bd089ef2a22f74450af55db69f5b..9a6d8e5740d6ccede998efd3a96496acd9efabfb 100644
index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f99fd42e9e 100644
--- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
@@ -8,17 +8,21 @@
@@ -337,7 +337,7 @@ index 0fa0fa341e93bd089ef2a22f74450af55db69f5b..9a6d8e5740d6ccede998efd3a96496ac
int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(
ppapi::host::HostMessageContext* context) {
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
index b36248debee4f5e0503e7611f7d1c47d59650f5b..7af31ee0d2cbb4c8fc7cd41c356305d6476815c5 100644
index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec89599280 100644
--- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
+++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
@@ -20,7 +20,9 @@

View File

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

View File

@@ -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 55469c2b13d43e788a85315cc14a9c6eabe8ad9b..453d6cbcad219d1ae3da285ec005b6a559452ead 100644
index ebffdb08d080eceb0ea9e96ee3ca7db627cfaf5e..bc00a7a00626cee17e5f5ea976f8248f71e06505 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 55469c2b13d43e788a85315cc14a9c6eabe8ad9b..453d6cbcad219d1ae3da285ec005b6a5
#include "printing/print_job_constants.h"
#include "printing/printed_document.h"
#include "printing/printing_utils.h"
@@ -222,9 +222,14 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
@@ -221,9 +221,14 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
print_backend->GetPrinterDriverInfo(printer_name));
}
@@ -48,7 +48,7 @@ index 55469c2b13d43e788a85315cc14a9c6eabe8ad9b..453d6cbcad219d1ae3da285ec005b6a5
}
#if defined(OS_CHROMEOS)
@@ -240,6 +245,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
@@ -239,6 +244,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
PrintingContext::Result result) {
@@ -63,7 +63,7 @@ index 55469c2b13d43e788a85315cc14a9c6eabe8ad9b..453d6cbcad219d1ae3da285ec005b6a5
}
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed1ad8dbbf 100644
index 155d86fe79b99989c3f604aeaab13782f8e6631c..b60263e722b2604ed35a1ed10469ac91e22aaa33 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -27,10 +27,7 @@
@@ -145,7 +145,7 @@ index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
return true;
}
@@ -246,9 +259,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
@@ -250,9 +263,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 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
}
void PrintViewManagerBase::NavigationStopped() {
@@ -351,7 +364,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
@@ -355,7 +368,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
PrintManager::OnPrintingFailed(cookie);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -167,7 +167,7 @@ index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
#endif
ReleasePrinterQuery();
@@ -451,9 +464,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
@@ -455,9 +468,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
content::NotificationService::NoDetails());
break;
}
@@ -183,7 +183,7 @@ index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
NOTREACHED();
break;
}
@@ -548,8 +565,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -552,8 +569,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
DCHECK(!quit_inner_loop_);
DCHECK(query);
@@ -192,7 +192,7 @@ index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
// We can't print if there is no renderer.
if (!web_contents()->GetRenderViewHost() ||
@@ -564,8 +579,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -568,8 +583,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
print_job_->SetSource(PrintJob::Source::PRINT_PREVIEW, /*source_id=*/"");
#endif // defined(OS_CHROMEOS)
@@ -201,7 +201,7 @@ index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
printing_succeeded_ = false;
return true;
}
@@ -614,14 +627,24 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -618,14 +631,24 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@@ -229,7 +229,7 @@ index 3d026cd11aa2c0b009812317995cd4e02161251e..2778bfd64270a2e93153f39e849316ed
print_job_ = nullptr;
}
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index af49d3e2f8abaf7dc4d82dc3f9beccdf4fbd9f18..c5ef1a4c1577c509e5fbe0fcf06e6dfdba30c92c 100644
index 3d434244927aca5e5dbec8d7c1cd212c5c260c71..9d62c903bf08fa8cfa8c425d430c5e995a04f7fc 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -33,6 +33,8 @@ class PrintJob;
@@ -382,10 +382,10 @@ index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6
// content::BrowserMessageFilter:
bool OnMessageReceived(const IPC::Message& message) override;
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
index 34e1cda035c042c8c4c55acd7716cf9473856fcf..199267d873f2343cdf401bb9a335dd753e0d4dfd 100644
index c4707f4680f1522689c77d3e8bbc57cb62787381..2909205539b2fcfc86e610cfdff0ca418b73d934 100644
--- a/components/printing/common/print.mojom
+++ b/components/printing/common/print.mojom
@@ -24,7 +24,7 @@ interface PrintRenderer {
@@ -35,7 +35,7 @@ interface PrintRenderer {
interface PrintRenderFrame {
// Tells the RenderFrame to switch the CSS to print media type, render every
// requested page, and then switch back the CSS to display media type.
@@ -395,18 +395,18 @@ index 34e1cda035c042c8c4c55acd7716cf9473856fcf..199267d873f2343cdf401bb9a335dd75
// 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 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938bd61768f 100644
index 1af8977aaa94dc9cb8b6587bff84884d5f0cd20f..819c9416a30aac7f10fd788c477a0c8e9f7e7cca 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -39,6 +39,7 @@
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -38,6 +38,7 @@
#include "net/base/escape.h"
#include "printing/buildflags/buildflags.h"
#include "printing/metafile_skia.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"
@@ -1166,7 +1167,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1120,7 +1121,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
web_frame->DispatchBeforePrintEvent();
if (!weak_this)
return;
@@ -416,7 +416,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
if (weak_this)
web_frame->DispatchAfterPrintEvent();
}
@@ -1202,7 +1204,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1141,7 +1143,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@@ -425,7 +425,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > 1)
return;
@@ -1216,7 +1218,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1155,7 +1157,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);
@@ -434,7 +434,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1233,7 +1235,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1172,7 +1174,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
return;
}
Print(frame, print_preview_context_.source_node(),
@@ -443,7 +443,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1315,6 +1317,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
@@ -1212,6 +1214,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -452,7 +452,28 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
print_preview_context_.OnPrintPreview();
base::UmaHistogramEnumeration(print_preview_context_.IsForArc()
@@ -1760,7 +1764,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1564,13 +1568,13 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() {
print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_CAPTURE_FAILED);
return false;
}
- } else {
- if (!CopyMetafileDataToReadOnlySharedMem(*metafile,
- &preview_params.content)) {
- LOG(ERROR) << "CopyMetafileDataToReadOnlySharedMem failed";
- print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_COPY_FAILED);
- return false;
- }
+ }
+
+ if (!CopyMetafileDataToReadOnlySharedMem(*metafile,
+ &preview_params.content)) {
+ LOG(ERROR) << "CopyMetafileDataToReadOnlySharedMem failed";
+ print_preview_context_.set_error(PREVIEW_ERROR_METAFILE_COPY_FAILED);
+ return false;
}
preview_params.document_cookie = print_pages_params_->params.document_cookie;
@@ -1705,7 +1709,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
auto self = weak_ptr_factory_.GetWeakPtr();
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@@ -463,7 +484,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
// Check if |this| is still valid.
if (!self)
return;
@@ -1771,7 +1777,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1716,7 +1722,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -474,7 +495,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -1779,7 +1787,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1724,7 +1732,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
int expected_page_count = 0;
@@ -483,7 +504,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -1799,8 +1807,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1744,8 +1752,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
PrintMsg_PrintPages_Params print_settings;
auto self = weak_ptr_factory_.GetWeakPtr();
@@ -497,7 +518,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
// Check if |this| is still valid.
if (!self)
return;
@@ -2024,10 +2035,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
@@ -1979,10 +1990,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
@@ -524,7 +545,7 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
// 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.
@@ -2047,12 +2071,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
@@ -2002,12 +2026,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
return result;
}
@@ -544,10 +565,10 @@ index 41f6c6ba9920c7fe2a0cf91458162afb70762c16..7315a2b5962f42b57d04655cea97a938
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 a432a1e007111d6c13c76255aa445d05b869e46c..3f66fd39345998fd11d0fd383b4262cca838abf8 100644
index 0778deefa7af69bb747719ab1c05c6de6c201be5..9d1872d79b4bf88a2d8db8b24eebfdc63c2ad2a8 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -224,7 +224,7 @@ class PrintRenderFrameHelper
@@ -222,7 +222,7 @@ class PrintRenderFrameHelper
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
// printing::mojom::PrintRenderFrame:
@@ -556,7 +577,7 @@ index a432a1e007111d6c13c76255aa445d05b869e46c..3f66fd39345998fd11d0fd383b4262cc
void PrintForSystemDialog() override;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void InitiatePrintPreview(
@@ -291,7 +291,9 @@ class PrintRenderFrameHelper
@@ -285,7 +285,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -567,7 +588,7 @@ index a432a1e007111d6c13c76255aa445d05b869e46c..3f66fd39345998fd11d0fd383b4262cc
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -300,12 +302,14 @@ class PrintRenderFrameHelper
@@ -294,12 +296,14 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.

View File

@@ -8,10 +8,10 @@ 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/libgtkui/native_theme_gtk.cc b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
index 9871a29db66aefdd2d9333645d9a445a5511bb7d..d7bd218fcea1428957265ba79e16df1c00037127 100644
index c34e3618c5124e3b10c25d434420cf85679e9c73..1cacab5eb9dc7dd754eb9f7a29d11319d633cdc8 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
@@ -292,6 +292,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
@@ -301,6 +301,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
case ui::NativeTheme::kColorId_TableHeaderSeparator:
return GetBorderColor("GtkTreeView#treeview.view GtkButton#button");
@@ -40,7 +40,7 @@ index 9871a29db66aefdd2d9333645d9a445a5511bb7d..d7bd218fcea1428957265ba79e16df1c
// 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 381f75f76757666adc5cbaf8274b0e9fed55c261..8a8ebeeeaa7942003ee7fc7898e79e12818f0c10 100644
index 90b86727d8ab48d25dcede1f18fd3107eba83e1b..4a4bf7f0f809d5a69f48eb47d631072c1c86ee3a 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 381f75f76757666adc5cbaf8274b0e9fed55c261..8a8ebeeeaa7942003ee7fc7898e79e12
// FocusableBorder
case NativeTheme::kColorId_FocusedBorderColor:
return SkColorSetA(gfx::kGoogleBlue300, 0x4D);
@@ -391,6 +399,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
@@ -401,6 +409,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_UnfocusedBorderColor:
return gfx::kGoogleGrey300;
@@ -78,10 +78,10 @@ index 381f75f76757666adc5cbaf8274b0e9fed55c261..8a8ebeeeaa7942003ee7fc7898e79e12
case NativeTheme::kColorId_ThrobberSpinningColor:
return gfx::kGoogleBlue600;
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index d266d92f9ceec23d38430ada176b753b34005749..183fe5b316697e9478751bab4766238ec8e29bd2 100644
index 0c26cce0cb14bd9e87c3a095116501bf0c1803e4..782dd1d122bfab4990c924a7fb0e7276fb51b18b 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -397,6 +397,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -409,6 +409,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
kColorId_TableHeaderText,
kColorId_TableHeaderBackground,
kColorId_TableHeaderSeparator,

View File

@@ -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 394b9ec0b7409465b0f9700a2d4a1eb1cf538e1f..a34dcdd124746b04d116e207b10395fc02649ec1 100644
index d82aff3ef7f2606cc996501bfbd5222a354c8639..56ab9fca845a0c84579b4a874c8007edebbb12fb 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -619,6 +619,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
@@ -618,6 +618,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
return false;
}
@@ -24,10 +24,10 @@ index 394b9ec0b7409465b0f9700a2d4a1eb1cf538e1f..a34dcdd124746b04d116e207b10395fc
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 9763b72a68992fc97cf1d1ec10d55c1198ec1771..1ece7c0cdfa2ab519d5ea0ef31465cda305830fd 100644
index a662f8bac41b01a9d8e56b8aa1b9f5336bfe265c..04c7913dc8c7b987bef4208fa417f8f79fe33977 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -24,9 +24,11 @@
@@ -23,9 +23,11 @@
#include "components/viz/common/surfaces/surface_id.h"
#include "components/viz/host/hit_test/hit_test_query.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
@@ -39,7 +39,7 @@ index 9763b72a68992fc97cf1d1ec10d55c1198ec1771..1ece7c0cdfa2ab519d5ea0ef31465cda
#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"
@@ -72,9 +74,11 @@ class CursorManager;
@@ -66,9 +68,11 @@ class CursorManager;
class MouseWheelPhaseHandler;
class RenderWidgetHostImpl;
class RenderWidgetHostViewBaseObserver;
@@ -51,7 +51,7 @@ index 9763b72a68992fc97cf1d1ec10d55c1198ec1771..1ece7c0cdfa2ab519d5ea0ef31465cda
class WebCursor;
class DelegatedFrameHost;
struct TextInputState;
@@ -132,6 +136,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
@@ -123,6 +127,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
bool destination_is_loaded,
bool destination_is_frozen) final;
@@ -61,7 +61,7 @@ index 9763b72a68992fc97cf1d1ec10d55c1198ec1771..1ece7c0cdfa2ab519d5ea0ef31465cda
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews.
gfx::PointF TransformPointToRootCoordSpaceF(
@@ -342,6 +349,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
@@ -312,6 +319,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
const ui::LatencyInfo& latency);

View File

@@ -10,10 +10,10 @@ 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 01159a8b5b28858e899808cc57862e54dd998b48..ff122c32e18fc16efd7c376d38499c1d69fab635 100644
index 4df726e8331572fe96551fdde60b4174aff30588..66b1e2b52c9da2d485fd9f076e1628861a74cb69 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
@@ -153,6 +153,11 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -154,6 +154,11 @@ void ExtractUnderlines(NSAttributedString* string,
} // namespace
@@ -25,7 +25,7 @@ index 01159a8b5b28858e899808cc57862e54dd998b48..ff122c32e18fc16efd7c376d38499c1d
// These are not documented, so use only after checking -respondsToSelector:.
@interface NSApplication (UndocumentedSpeechMethods)
- (void)speakString:(NSString*)string;
@@ -572,6 +577,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
@@ -573,6 +578,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
}
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
@@ -35,7 +35,7 @@ index 01159a8b5b28858e899808cc57862e54dd998b48..ff122c32e18fc16efd7c376d38499c1d
return [self acceptsMouseEventsWhenInactive];
}
@@ -990,6 +998,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
@@ -983,6 +991,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
eventType == NSKeyDown &&
!(modifierFlags & NSCommandKeyMask);
@@ -46,7 +46,7 @@ index 01159a8b5b28858e899808cc57862e54dd998b48..ff122c32e18fc16efd7c376d38499c1d
// We only handle key down events and just simply forward other events.
if (eventType != NSKeyDown) {
_hostHelper->ForwardKeyboardEvent(event, latency_info);
@@ -1769,9 +1781,11 @@ - (NSAccessibilityRole)accessibilityRole {
@@ -1762,9 +1774,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 01159a8b5b28858e899808cc57862e54dd998b48..ff122c32e18fc16efd7c376d38499c1d
- (NSArray*)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
@@ -1780,7 +1794,10 @@ - (NSArray*)validAttributesForMarkedText {
@@ -1773,7 +1787,10 @@ - (NSArray*)validAttributesForMarkedText {
initWithObjects:NSUnderlineStyleAttributeName,
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,

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