Compare commits

...

57 Commits

Author SHA1 Message Date
Electron Bot
d4bc4e1d4c Bump v10.0.0-beta.3 2020-06-15 08:31:31 -07:00
trop[bot]
0c861dc83e fix: correctly handle nexttick scheduling in stream reads (#24081)
Co-authored-by: Paul Frazee <pfrazee@gmail.com>
2020-06-15 19:00:13 +09:00
trop[bot]
57b766aa82 fix: showing certificate dialog with no window (#24118)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-13 08:22:36 -07:00
trop[bot]
4b8295a24d fix: fs.readdir should support withFileTypes (#24106)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-12 13:42:17 -07:00
Samuel Attard
710199c308 Revert "fix: do not use CONTEXT_MENU flag for tray menu (#23879)" (#24077)
This reverts commit d4001c1787.
2020-06-11 14:27:25 -04:00
Shelley Vohr
c2d9cde38f chore: roll latest Node.js security release (#23945) 2020-06-11 11:18:10 -07:00
trop[bot]
fbaca68bd0 fix: Add .paks for media-internals and webrtc-internals pages (#24057)
* fix: adds paks for media-internals and webrtc-internals pages

* adds tests

Co-authored-by: gellert <gellert.hegyi@around.co>
2020-06-11 09:26:01 -07:00
trop[bot]
ee9f95df30 fix: assign session to remote webContents (#24064)
* fix: assign session to remote webContents

* fix: test name

Co-authored-by: sentialx <sentialx@gmail.com>
2020-06-11 08:49:59 -07:00
trop[bot]
9df936d941 fix: use system installed objcopy to copy debug symbols (#24031)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-06-11 10:56:59 +09:00
trop[bot]
baa2940488 fix: Allow windows behind macOS elements if frame = false (#24032)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
2020-06-11 10:56:25 +09:00
trop[bot]
25879ba929 chore: backport advapi32 libuv fix (#24038)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-11 10:55:22 +09:00
Electron Bot
34b04e5fbb Revert "Bump v10.0.0-beta.3"
This reverts commit 710ac2a5a8.
2020-06-09 12:02:57 -07:00
Electron Bot
710ac2a5a8 Bump v10.0.0-beta.3 2020-06-09 08:50:04 -07:00
trop[bot]
1f0d2594bd fix: throw instead of crash when using ipcRenderer after context released (#23977)
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-06-08 11:36:32 -07:00
trop[bot]
656d9e7490 build: fix filenames autogen with new BUILDFLAG syntax (#23958)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-08 11:09:34 -07:00
trop[bot]
5bf938f899 fix: add missing isComposing KeyboardEvent property (#23995)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-08 10:51:12 -05:00
trop[bot]
7759048136 fix: volume key globalShortcut deregistration (#24012)
Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-06-08 10:50:17 -04:00
trop[bot]
321c1c1075 fix: use acceptLanguages argument in session.setUserAgent() (#23961)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2020-06-05 09:46:03 -07:00
trop[bot]
d69d1bbf20 fix: missing handlescoped in touch bar (#23970)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-04 19:34:17 -07:00
trop[bot]
f3dd997dbd feat: add V8CacheOptions webpreference (#23867)
* feat: add V8CacheOptions webpreference

* address review comments

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2020-06-04 17:15:44 -04:00
trop[bot]
faf7951439 fix: destroy GetSize callback at last (#23954)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-03 15:54:24 -04:00
trop[bot]
3087492994 fix: compensate for lazy-loaded circular deps (#23951)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-06-03 15:18:55 -04:00
John Kleinschmidt
f7e4377ee8 chore: update chromium to 85.0.4161.2 (#23915)
* chore: update 10-x-y to 85.0.4161.2

* Update patches

* chore: SetHostCleanupFinalizationGroupCallback has been removed from V8

(cherry picked from commit 7aa3058829)

* Window Placement: Gate cross-screen fullscreen behavior on permission

https://chromium-review.googlesource.com/c/chromium/src/+/2203268
(cherry picked from commit fdccae9246)

* refactor: GetSublabelAt => GetSecondaryLabelAt

(cherry picked from commit cc8be2f634)

* refactor: use WebInputEvent::Namespace types directly

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2160523
(cherry picked from commit f35200077e)

* refactor: service_manager::BinderMapWithContext merged into mojo::BinderMap

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2174654
(cherry picked from commit c2a4d1b515)

* remove WebContentsView::SizeContents

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2188931
(cherry picked from commit f4ccf3556c)

* adapt to //content creating NetworkContexts

https://chromium-review.googlesource.com/c/chromium/src/+/2195196
(cherry picked from commit 6834366747)

* Use a normal return value for WebContentsView::GetContainerBounds.

https://chromium-review.googlesource.com/c/chromium/src/+/2212481
(cherry picked from commit 68c8ea6ea9)

* fixup patch

* refactor: AddNewContents now takes a target_url

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2167732
(cherry picked from commit 69fe1f6f47)

* refactor: FollowRedirect takes in cors exempt headers now

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2129787
(cherry picked from commit 58f3770c19)

* refactor: printing::DuplexMode moved to mojo

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2162388
(cherry picked from commit a14cdc465a)

* refactor: use MessagePortDescriptor instead of raw mojo::MessagePipeHandles

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1952124
(cherry picked from commit dce81ad06f)

* refactor: cursor.mojom and cursor_types.mojom moved to //ui/base/cursor/mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172874
(cherry picked from commit 7f3c13de3f)

* refactor: shuttle cursor changed event to WebContentsObserver

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779
(cherry picked from commit 2f3a23afb7)
Co-Authored-By: loc <loc@users.noreply.github.com>

* chore: unused argument removed from ReadAvailableTypes in ui::Clipboard

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2173666
(cherry picked from commit d9152c3668)

* remove ClientSideDetectionService from browser_process

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2175320
(cherry picked from commit 2461522752)

* Remove cors_exempt_headers.h

https://chromium-review.googlesource.com/c/chromium/src/+/2203759
(cherry picked from commit b73faa6411)

* [content] Remove unused methods from WebContents

https://chromium-review.googlesource.com/c/chromium/src/+/2199113
(cherry picked from commit 8b9ea9cd2b)

* Unnest CanonicalCookie::CookieInclusionStatus

https://chromium-review.googlesource.com/c/chromium/src/+/2203171
(cherry picked from commit 7d4349b37c)

* WebContentsObserver now implements OnRendererResponsive

https://chromium-review.googlesource.com/c/chromium/src/+/2211066
(cherry picked from commit 53f32b7e45)

* chore: remove NOTIFICATION_EXTENSIONS_READY_DEPRECATED

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2199874
(cherry picked from commit 7914445469)

* Supply speech recognition sandbox from service_sandbox_type.h

https://chromium-review.googlesource.com/c/chromium/src/+/2206918
(cherry picked from commit f15a0fdfab)

* [XProto] Replace XAtom with x11::Atom

https://chromium-review.googlesource.com/c/chromium/src/+/2202789
(cherry picked from commit 143110105a)

* update print-to-pdf.html with latest html data

https://bugs.chromium.org/p/chromium/issues/detail?id=1085667
(cherry picked from commit 205105fc16)

* fix build on windows

(cherry picked from commit 0a255c4fa7)

* [printing] Mojofy PrintHostMsg_CheckForCancel

https://chromium-review.googlesource.com/c/chromium/src/+/2212181
(cherry picked from commit 4f1064afa9)

* chore: update sysroots

(cherry picked from commit 2a1b78a4bf)

* chore: DesktopWindowTreeHostLinux becomes DesktopWindowTreeHostPlatform

Refs:
(cherry picked from commit 3fd0875d3d)

* refactor: LogErrorEventDescription moved from ui to x11

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2164245
(cherry picked from commit 9291fc4afc)

* fix: inherit base network context params

(cherry picked from commit 698c66f7f9)

* fix: use message handle api specific to embedders

(cherry picked from commit 23d01dc8e0)

* chore: update v8 headers

(cherry picked from commit 81bc1e0bee)

* add checkout_pgo_profiles to DEPS

(cherry picked from commit 9b73e6935c)

* refactor: use newly mojo-ified PrintPreviewFailed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2195343
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit de074ce23a)

* [printing] Mojofy PrintHostMsg_PrintPreviewCancelled

https://chromium-review.googlesource.com/c/chromium/src/+/2198331
(cherry picked from commit 7bd8a6a576)

* [printing] Mojofy PrintHostMsg_PrintPreviewInvalidPrinterSettings

https://chromium-review.googlesource.com/c/chromium/src/+/2200556
(cherry picked from commit dd68ba1ecf)

* Network service: Remove primary_network_context bool.

https://chromium-review.googlesource.com/c/chromium/src/+/2204678
(cherry picked from commit 6a0e8e5bf9)

* [printing] Move PrintHostMsg_DidPrintContent_Params to print.mojom

https://chromium-review.googlesource.com/c/chromium/src/+/2212110
(cherry picked from commit a6a3291d9a)

* [XProto] Move items from ::x11::XProto to ::x11

https://chromium-review.googlesource.com/c/chromium/src/+/2218476
(cherry picked from commit b16c48830a)

* Update patches

* Remove no longer needed patch

* update patches

* update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: loc <loc@users.noreply.github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-03 14:38:01 -04:00
trop[bot]
ef288a6ae2 fix: restore original GTK/appindicator implementation of tray icons (#23925)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-03 10:14:53 -07:00
trop[bot]
7797835f93 test: load page with some content when testing extension (#23939)
* test: load page with some content when testing extension

* test: use dom-ready to wait for page loaded with extension

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-03 09:51:06 -07:00
trop[bot]
9572209e91 fix: correctly support the --inspect-brk-node flag (#23918)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-03 17:01:17 +09:00
trop[bot]
3602216e6c fix: default to NTLM v2 in the network service for POSIX platforms (#23916)
* fix: default to NTLM v2 in the network service

* chore: update patch details

* update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-06-02 20:58:38 -07:00
trop[bot]
c29382b6d0 fix: Make the --disable-color-correct-rendering switch work again (#23899)
This regressed once again in Electron 8 due to Chromium changes.

Test Plan:

- Confirm that test case from https://github.com/electron/electron/pull/15898#issuecomment-443191770 now works

Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`

Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
2020-06-02 15:40:24 -04:00
trop[bot]
a8fc41d8b3 docs: default of allowRendererProcessReuse is true (#23912)
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-02 12:02:53 -07:00
trop[bot]
9ea42da40e docs: move protocol-ns to protocol.md (#23911)
* docs: move protocol-ns to protocol.md

* chore: fix up tests and implement missing pieces required for tests

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-02 10:55:50 -07:00
trop[bot]
87cd20b9e9 fix: add patch to prevent crash during frame swap with ctx isolation enabled (#23896)
* fix: add patch to prevent crash during frame swap with ctx isolation enabled

* Update .patches

* chore: update patches

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <sattard@slack-corp.com>
2020-06-02 10:55:14 -07:00
trop[bot]
79acd3e0ef fix: expose electron/common and electron/renderer modules in sandboxed preloads (#23893)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-02 14:23:19 +09:00
trop[bot]
67be46986c test: wait for beforeunload handler to be installed (#23898)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-02 14:21:42 +09:00
trop[bot]
d4001c1787 fix: do not use CONTEXT_MENU flag for tray menu (#23879)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-06-02 11:10:41 +09:00
trop[bot]
eeaad9c6ab build: make electron renderer init scripts profilable (#23891)
The devtools profiler is not attached at the point we run out init scripts (or our apps preload scripts), we do not really want to change when we run these init scripts but for when a dev is doing performance work it makes sense to give them an option to make the devtools profiler actually work on both our init scripts and their preload script.  This PR adds that logic behind an environment variable ELECTRON_PROFILE_INIT_SCRIPTS.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2020-06-01 17:38:33 -07:00
Alexey Kuzmin
cc0c7632ac build: fix for "enable_desktop_capturer = false" (#23864) (#23876)
(cherry picked from commit 4133c71105)
2020-06-01 17:23:33 -04:00
Electron Bot
12ea1c0c41 Bump v10.0.0-beta.2 2020-06-01 08:32:38 -07:00
Shelley Vohr
9d2aa93581 fix: ensure nativeImage serialization main->renderer (#23794)
* refactor: use typeutils for nativeImage serialization (#23693)

* fix: ensure nativeImage serialization main->renderer
2020-05-28 12:07:33 -07:00
trop[bot]
cee9e6f0d0 fix: weakly reference MenuModel from MenuController (#23806)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:47:43 -07:00
trop[bot]
eb93acc463 fix: handle asynchronous URL loading in bw proxy (#23804)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 09:41:54 -07:00
trop[bot]
241e74c098 test: refactor how spec files are collected (#23811)
Co-authored-by: Aleksei Kuzmin <alkuzmin@microsoft.com>
2020-05-28 09:40:59 -07:00
trop[bot]
c0183d15af fix: volume key globalShortcut registration (#23823)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 08:57:25 -07:00
trop[bot]
4fe7c9ac24 fix: only bezel frameless windows (#23809)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-28 08:52:58 -04:00
Cheng Zhao
50efa847a5 Revert "fix: trigger activate event when app is activated via app switcher (#23771)" (#23819)
This reverts commit 7709e600c6.
2020-05-28 08:47:55 -04:00
trop[bot]
c2354d44ea fix: pass correct buffer length (#23798)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-27 14:09:30 -07:00
trop[bot]
7709e600c6 fix: trigger activate event when app is activated via app switcher (#23771)
When application is activated thru macOS app switcher (cmd+tab) the
App's activate event is note emitted. The reason is that
`applicationShouldHandleReopen:hasVisibleWindows:` is sent only when app
is activated via Dock. Using `applicationDidBecomeActive:` is handling
all cases properly.

Co-authored-by: Lukas Weber <luweber@microsoft.com>
2020-05-27 09:52:10 +09:00
trop[bot]
0962c1bd74 ci: deflake WOA tests (#23769)
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-05-26 13:22:55 -04:00
trop[bot]
471f80521d test: use WebContents event to test beforeunload (#23766)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-26 10:53:23 -04:00
trop[bot]
1fb11e1e76 fix: trigger about panel for about role on on win (#23717)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2020-05-22 00:55:25 -07:00
trop[bot]
f8508b3c18 fix: read GTK dark theme setting on Linux (#23711)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2020-05-21 21:07:42 -04:00
Electron Bot
95e3853b77 Bump v10.0.0-beta.1 2020-05-21 14:28:15 -07:00
Samuel Attard
9de5ede1fb Revert "feat: look harder for a commit's pull request. (#23593)"
This reverts commit 2342aaffbd.
2020-05-21 14:27:04 -07:00
Electron Bot
05efbbcdd5 Revert "Bump v10.0.0-beta.1"
This reverts commit 2789f32efb.
2020-05-21 14:23:22 -07:00
Electron Bot
2789f32efb Bump v10.0.0-beta.1 2020-05-21 14:23:00 -07:00
Samuel Attard
4c8b884998 fix: support 10-x-y in the release notes generator (#23709) 2020-05-21 14:13:17 -07:00
Electron Bot
03ddd2d7af Revert "Bump v10.0.0-beta.1"
This reverts commit c141b1a906.
2020-05-21 13:33:35 -07:00
Electron Bot
c141b1a906 Bump v10.0.0-beta.1 2020-05-21 13:33:02 -07:00
240 changed files with 7481 additions and 4127 deletions

View File

@@ -322,6 +322,7 @@ source_set("electron_lib") {
"shell/common/api:mojo",
"//base:base_static",
"//base/allocator:buildflags",
"//chrome/app:command_ids",
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
@@ -523,6 +524,16 @@ source_set("electron_lib") {
sources += filenames.lib_sources_nss
sources += [
"shell/browser/ui/gtk/app_indicator_icon.cc",
"shell/browser/ui/gtk/app_indicator_icon.h",
"shell/browser/ui/gtk/app_indicator_icon_menu.cc",
"shell/browser/ui/gtk/app_indicator_icon_menu.h",
"shell/browser/ui/gtk/gtk_status_icon.cc",
"shell/browser/ui/gtk/gtk_status_icon.h",
"shell/browser/ui/gtk/menu_util.cc",
"shell/browser/ui/gtk/menu_util.h",
"shell/browser/ui/gtk/status_icon.cc",
"shell/browser/ui/gtk/status_icon.h",
"shell/browser/ui/gtk_util.cc",
"shell/browser/ui/gtk_util.h",
]

4
DEPS
View File

@@ -5,6 +5,7 @@ gclient_gn_args = [
'checkout_android_native_support',
'checkout_libaom',
'checkout_nacl',
'checkout_pgo_profiles',
'checkout_oculus_sdk',
'checkout_openxr',
'checkout_google_benchmark'
@@ -12,7 +13,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'17da1064b910f4170320ff37e971064916aed1dc',
'85.0.4161.2',
'node_version':
'v12.16.3',
'nan_version':
@@ -42,6 +43,7 @@ vars = {
'checkout_chromium': True,
'checkout_node': True,
'checkout_nan': True,
'checkout_pgo_profiles': True,
# It's only needed to parse the native tests configurations.
'checkout_pyyaml': False,

View File

@@ -1 +1 @@
10.0.0-nightly.20200521
10.0.0-beta.3

View File

@@ -71,7 +71,6 @@ steps:
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_TIMEOUT: 120000
- task: PublishTestResults@2
displayName: 'Publish Test Results'

View File

@@ -1,3 +1,4 @@
const fs = require('fs');
const path = require('path')
const webpack = require('webpack')
@@ -9,6 +10,9 @@ config.output = {
filename: path.basename(outPath)
}
const { wrapInitWithProfilingTimeout } = config;
delete config.wrapInitWithProfilingTimeout;
webpack(config, (err, stats) => {
if (err) {
console.error(err)
@@ -17,6 +21,18 @@ webpack(config, (err, stats) => {
console.error(stats.toString('normal'))
process.exit(1)
} else {
if (wrapInitWithProfilingTimeout) {
const contents = fs.readFileSync(outPath, 'utf8');
const newContents = `function ___electron_webpack_init__() {
${contents}
};
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
setTimeout(___electron_webpack_init__, 0);
} else {
___electron_webpack_init__();
}`;
fs.writeFileSync(outPath, newContents);
}
process.exit(0)
}
})

View File

@@ -21,7 +21,7 @@ class AccessDependenciesPlugin {
}
const defines = {
BUILDFLAG: ''
BUILDFLAG: onlyPrintingGraph ? '(a => a)' : ''
}
const buildFlagsPrefix = '--buildflags='
@@ -34,8 +34,7 @@ if (buildFlagArg) {
for (const line of flagFile.split(/(\r\n|\r|\n)/g)) {
const flagMatch = line.match(/#define BUILDFLAG_INTERNAL_(.+?)\(\) \(([01])\)/)
if (flagMatch) {
const flagName = flagMatch[1];
const flagValue = flagMatch[2];
const [, flagName, flagValue] = flagMatch;
defines[flagName] = JSON.stringify(Boolean(parseInt(flagValue, 10)));
}
}
@@ -64,16 +63,12 @@ if (defines['ENABLE_VIEWS_API'] === 'false') {
)
}
const alias = {}
for (const ignoredModule of ignoredModules) {
alias[ignoredModule] = path.resolve(electronRoot, 'lib/common/dummy.js')
}
module.exports = ({
alwaysHasNode,
loadElectronFromAlternateTarget,
targetDeletesNodeGlobals,
target
target,
wrapInitWithProfilingTimeout
}) => {
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
if (!fs.existsSync(entry)) {
@@ -88,24 +83,30 @@ module.exports = ({
output: {
filename: `${target}.bundle.js`
},
wrapInitWithProfilingTimeout,
resolve: {
alias: {
...alias,
'@electron/internal': path.resolve(electronRoot, 'lib'),
'electron': path.resolve(electronRoot, 'lib', loadElectronFromAlternateTarget || target, 'api', 'exports', 'electron.ts'),
// Force timers to resolve to our dependency that doens't use window.postMessage
// Force timers to resolve to our dependency that doesn't use window.postMessage
'timers': path.resolve(electronRoot, 'node_modules', 'timers-browserify', 'main.js')
},
extensions: ['.ts', '.js']
},
module: {
rules: [{
test: (moduleName) => !onlyPrintingGraph && ignoredModules.includes(moduleName),
loader: 'null-loader',
}, {
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(electronRoot, 'tsconfig.electron.json'),
transpileOnly: onlyPrintingGraph,
ignoreDiagnostics: [6059]
ignoreDiagnostics: [
// File '{0}' is not under 'rootDir' '{1}'.
6059,
]
}
}]
},

View File

@@ -1,5 +1,6 @@
module.exports = require('./webpack.config.base')({
target: 'renderer',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
targetDeletesNodeGlobals: true,
wrapInitWithProfilingTimeout: true
})

View File

@@ -1,4 +1,5 @@
module.exports = require('./webpack.config.base')({
target: 'sandboxed_renderer',
alwaysHasNode: false
alwaysHasNode: false,
wrapInitWithProfilingTimeout: true,
})

View File

@@ -16,6 +16,7 @@ template("webpack_build") {
inputs = [
invoker.config_file,
"//electron/build/webpack/webpack.config.base.js",
"//electron/build/webpack/run-compiler.js",
"//electron/tsconfig.json",
"//electron/yarn.lock",
"//electron/typings/internal-ambient.d.ts",

View File

@@ -72,6 +72,7 @@ static_library("chrome") {
]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/services/speech:buildflags",
"//components/feature_engagement:buildflags",
"//components/optimization_guide/proto:optimization_guide_proto",
]

View File

@@ -1403,7 +1403,7 @@ in your app's initialization to ensure that your overridden value is used.
A `Boolean` which when `true` disables the overrides that Electron has in place
to ensure renderer processes are restarted on every navigation. The current
default value for this property is `false`.
default value for this property is `true`.
The intention is for these overrides to become disabled by default and then at
some point in the future this property will be removed. This property impacts

View File

@@ -387,6 +387,13 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
Default is `true`.
* `enableWebSQL` Boolean (optional) - Whether to enable the [WebSQL api](https://www.w3.org/TR/webdatabase/).
Default is `true`.
* `v8CacheOptions` String (optional) - Enforces the v8 code caching policy
used by blink. Accepted values are
* `none` - Disables code caching
* `code` - Heuristic based code caching
* `bypassHeatCheck` - Bypass code caching heuristics but with lazy compilation
* `bypassHeatCheckAndEagerCompile` - Same as above except compilation is eager.
Default policy is `code`.
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from

View File

@@ -36,6 +36,10 @@ for integrated authentication. Without `*` prefix the URL has to match exactly.
A comma-separated list of servers for which delegation of user credentials is required.
Without `*` prefix the URL has to match exactly.
### --disable-ntlm-v2
Disables NTLM v2 for posix platforms, no effect elsewhere.
### --disable-http-cache
Disables the disk cache for HTTP requests.

View File

@@ -69,6 +69,7 @@ a `type`.
The `role` property can have following values:
* `undo`
* `about` - Trigger a native about panel (custom message box on Window, which does not provide its own).
* `redo`
* `cut`
* `copy`
@@ -94,7 +95,6 @@ The `role` property can have following values:
The following additional roles are available on _macOS_:
* `appMenu` - Whole default "App" menu (About, Services, etc.)
* `about` - Map to the `orderFrontStandardAboutPanel` action.
* `hide` - Map to the `hide` action.
* `hideOthers` - Map to the `hideOtherApplications` action.
* `unhide` - Map to the `unhideAllApplications` action.

View File

@@ -1,309 +0,0 @@
# protocol (NetworkService) (Draft)
This document describes the new protocol APIs based on the [NetworkService](https://www.chromium.org/servicification).
We don't currently have an estimate of when we will enable the `NetworkService` by
default in Electron, but as Chromium is already removing non-`NetworkService`
code, we will probably switch before Electron 10.
The content of this document should be moved to `protocol.md` after we have
enabled the `NetworkService` by default in Electron.
> Register a custom protocol and intercept existing protocol requests.
Process: [Main](../glossary.md#main-process)
An example of implementing a protocol that has the same effect as the
`file://` protocol:
```javascript
const { app, protocol } = require('electron')
const path = require('path')
app.whenReady().then(() => {
protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
})
})
```
**Note:** All methods unless specified can only be used after the `ready` event
of the `app` module gets emitted.
## Using `protocol` with a custom `partition` or `session`
A protocol is registered to a specific Electron [`session`](./session.md)
object. If you don't specify a session, then your `protocol` will be applied to
the default session that Electron uses. However, if you define a `partition` or
`session` on your `browserWindow`'s `webPreferences`, then that window will use
a different session and your custom protocol will not work if you just use
`electron.protocol.XXX`.
To have your custom protocol work in combination with a custom session, you need
to register it to that session explicitly.
```javascript
const { session, app, protocol } = require('electron')
const path = require('path')
app.whenReady().then(() => {
const partition = 'persist:example'
const ses = session.fromPartition(partition)
ses.protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
})
mainWindow = new BrowserWindow({ webPreferences: { partition } })
})
```
## Methods
The `protocol` module has the following methods:
### `protocol.registerSchemesAsPrivileged(customSchemes)`
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
**Note:** This method can only be used before the `ready` event of the `app`
module gets emitted and can be called only once.
Registers the `scheme` as standard, secure, bypasses content security policy for
resources, allows registering ServiceWorker and supports fetch API. Specify a
privilege with the value of `true` to enable the capability.
An example of registering a privileged scheme, that bypasses Content Security
Policy:
```javascript
const { protocol } = require('electron')
protocol.registerSchemesAsPrivileged([
{ scheme: 'foo', privileges: { bypassCSP: true } }
])
```
A standard scheme adheres to what RFC 3986 calls [generic URI
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
`https` are standard schemes, while `file` is not.
Registering a scheme as standard allows relative and absolute resources to
be resolved correctly when served. Otherwise the scheme will behave like the
`file` protocol, but without the ability to resolve relative URLs.
For example when you load following page with custom protocol without
registering it as standard scheme, the image will not be loaded because
non-standard schemes can not recognize relative URLs:
```html
<body>
<img src='test.png'>
</body>
```
Registering a scheme as standard will allow access to files through the
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
error for the scheme.
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
cookies) are disabled for non standard schemes. So in general if you want to
register a custom protocol to replace the `http` protocol, you have to register
it as a standard scheme.
### `protocol.registerFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a file as the response. The
`handler` will be called with `request` and `callback` where `request` is
an incoming request for the `scheme`.
To handle the `request`, the `callback` should be called with either the file's
path or an object that has a `path` property, e.g. `callback(filePath)` or
`callback({ path: filePath })`. The `filePath` must be an absolute path.
By default the `scheme` is treated like `http:`, which is parsed differently
from protocols that follow the "generic URI syntax" like `file:`.
### `protocol.registerBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a `Buffer` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `Buffer` object or an object that has the `data`
property.
Example:
```javascript
protocol.registerBufferProtocol('atom', (request, callback) => {
callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
})
```
### `protocol.registerStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a `String` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `String` or an object that has the `data`
property.
### `protocol.registerHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` ProtocolResponse
Registers a protocol of `scheme` that will send an HTTP request as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with an object that has the `url` property.
### `protocol.registerStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a stream as a response.
The usage is the same with `registerFileProtocol`, except that the
`callback` should be called with either a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable) object or an object that
has the `data` property.
Example:
```javascript
const { protocol } = require('electron')
const { PassThrough } = require('stream')
function createStream (text) {
const rv = new PassThrough() // PassThrough is also a Readable stream
rv.push(text)
rv.push(null)
return rv
}
protocol.registerStreamProtocol('atom', (request, callback) => {
callback({
statusCode: 200,
headers: {
'content-type': 'text/html'
},
data: createStream('<h5>Response</h5>')
})
})
```
It is possible to pass any object that implements the readable stream API (emits
`data`/`end`/`error` events). For example, here's how a file could be returned:
```javascript
protocol.registerStreamProtocol('atom', (request, callback) => {
callback(fs.createReadStream('index.html'))
})
```
### `protocol.unregisterProtocol(scheme)`
* `scheme` String
Unregisters the custom protocol of `scheme`.
### `protocol.isProtocolRegistered(scheme)`
* `scheme` String
Returns `Boolean` - Whether `scheme` is already registered.
### `protocol.interceptFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a file as a response.
### `protocol.interceptStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `String` as a response.
### `protocol.interceptBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `Buffer` as a response.
### `protocol.interceptHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` ProtocolResponse
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a new HTTP request as a response.
### `protocol.interceptStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` ProtocolRequest
* `callback` Function
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
protocol handler.
### `protocol.uninterceptProtocol(scheme)`
* `scheme` String
Remove the interceptor installed for `scheme` and restore its original handler.
### `protocol.isProtocolIntercepted(scheme)`
* `scheme` String
Returns `Boolean` - Whether `scheme` is already intercepted.
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem

View File

@@ -15,8 +15,6 @@ app.whenReady().then(() => {
protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
}, (error) => {
if (error) console.error('Failed to register protocol')
})
})
```
@@ -26,9 +24,15 @@ of the `app` module gets emitted.
## Using `protocol` with a custom `partition` or `session`
A protocol is registered to a specific Electron [`session`](./session.md) object. If you don't specify a session, then your `protocol` will be applied to the default session that Electron uses. However, if you define a `partition` or `session` on your `browserWindow`'s `webPreferences`, then that window will use a different session and your custom protocol will not work if you just use `electron.protocol.XXX`.
A protocol is registered to a specific Electron [`session`](./session.md)
object. If you don't specify a session, then your `protocol` will be applied to
the default session that Electron uses. However, if you define a `partition` or
`session` on your `browserWindow`'s `webPreferences`, then that window will use
a different session and your custom protocol will not work if you just use
`electron.protocol.XXX`.
To have your custom protocol work in combination with a custom session, you need to register it to that session explicitly.
To have your custom protocol work in combination with a custom session, you need
to register it to that session explicitly.
```javascript
const { session, app, protocol } = require('electron')
@@ -41,17 +45,9 @@ app.whenReady().then(() => {
ses.protocol.registerFileProtocol('atom', (request, callback) => {
const url = request.url.substr(7)
callback({ path: path.normalize(`${__dirname}/${url}`) })
}, (error) => {
if (error) console.error('Failed to register protocol')
})
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
partition: partition
}
})
mainWindow = new BrowserWindow({ webPreferences: { partition } })
})
```
@@ -63,15 +59,15 @@ The `protocol` module has the following methods:
* `customSchemes` [CustomScheme[]](structures/custom-scheme.md)
**Note:** This method can only be used before the `ready` event of the `app`
module gets emitted and can be called only once.
Registers the `scheme` as standard, secure, bypasses content security policy for resources,
allows registering ServiceWorker and supports fetch API.
Registers the `scheme` as standard, secure, bypasses content security policy for
resources, allows registering ServiceWorker and supports fetch API. Specify a
privilege with the value of `true` to enable the capability.
Specify a privilege with the value of `true` to enable the capability.
An example of registering a privileged scheme, with bypassing Content Security Policy:
An example of registering a privileged scheme, that bypasses Content Security
Policy:
```javascript
const { protocol } = require('electron')
@@ -84,7 +80,7 @@ A standard scheme adheres to what RFC 3986 calls [generic URI
syntax](https://tools.ietf.org/html/rfc3986#section-3). For example `http` and
`https` are standard schemes, while `file` is not.
Registering a scheme as standard, will allow relative and absolute resources to
Registering a scheme as standard allows relative and absolute resources to
be resolved correctly when served. Otherwise the scheme will behave like the
`file` protocol, but without the ability to resolve relative URLs.
@@ -102,168 +98,102 @@ Registering a scheme as standard will allow access to files through the
[FileSystem API][file-system-api]. Otherwise the renderer will throw a security
error for the scheme.
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB, cookies)
are disabled for non standard schemes. So in general if you want to register a
custom protocol to replace the `http` protocol, you have to register it as a standard scheme.
By default web storage apis (localStorage, sessionStorage, webSQL, indexedDB,
cookies) are disabled for non standard schemes. So in general if you want to
register a custom protocol to replace the `http` protocol, you have to register
it as a standard scheme.
`protocol.registerSchemesAsPrivileged` can be used to replicate the functionality of the previous `protocol.registerStandardSchemes`, `webFrame.registerURLSchemeAs*` and `protocol.registerServiceWorkerSchemes` functions that existed prior to Electron 5.0.0, for example:
**before (<= v4.x)**
```javascript
// Main
protocol.registerStandardSchemes(['scheme1', 'scheme2'], { secure: true })
// Renderer
webFrame.registerURLSchemeAsPrivileged('scheme1', { secure: true })
webFrame.registerURLSchemeAsPrivileged('scheme2', { secure: true })
```
**after (>= v5.x)**
```javascript
protocol.registerSchemesAsPrivileged([
{ scheme: 'scheme1', privileges: { standard: true, secure: true } },
{ scheme: 'scheme2', privileges: { standard: true, secure: true } }
])
```
### `protocol.registerFileProtocol(scheme, handler[, completion])`
### `protocol.registerFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `filePath` String | [FilePathWithHeaders](structures/file-path-with-headers.md) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send the file as a response. The
`handler` will be called with `handler(request, callback)` when a `request` is
going to be created with `scheme`. `completion` will be called with
`completion(null)` when `scheme` is successfully registered or
`completion(error)` when failed.
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a file as the response. The
`handler` will be called with `request` and `callback` where `request` is
an incoming request for the `scheme`.
To handle the `request`, the `callback` should be called with either the file's
path or an object that has a `path` property, e.g. `callback(filePath)` or
`callback({ path: filePath })`. The object may also have a `headers` property
which gives a map of headers to values for the response headers, e.g.
`callback({ path: filePath, headers: {"Content-Security-Policy": "default-src 'none'"]})`.
When `callback` is called with nothing, a number, or an object that has an
`error` property, the `request` will fail with the `error` number you
specified. For the available error numbers you can use, please see the
[net error list][net-error].
`callback({ path: filePath })`. The `filePath` must be an absolute path.
By default the `scheme` is treated like `http:`, which is parsed differently
than protocols that follow the "generic URI syntax" like `file:`.
from protocols that follow the "generic URI syntax" like `file:`.
### `protocol.registerBufferProtocol(scheme, handler[, completion])`
### `protocol.registerBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `buffer` (Buffer | [MimeTypedBuffer](structures/mime-typed-buffer.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `Buffer` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `Buffer` object or an object that has the `data`,
`mimeType`, and `charset` properties.
should be called with either a `Buffer` object or an object that has the `data`
property.
Example:
```javascript
const { protocol } = require('electron')
protocol.registerBufferProtocol('atom', (request, callback) => {
callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
}, (error) => {
if (error) console.error('Failed to register protocol')
})
```
### `protocol.registerStringProtocol(scheme, handler[, completion])`
### `protocol.registerStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `data` (String | [StringProtocolResponse](structures/string-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send a `String` as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with either a `String` or an object that has the `data`,
`mimeType`, and `charset` properties.
should be called with either a `String` or an object that has the `data`
property.
### `protocol.registerHttpProtocol(scheme, handler[, completion])`
### `protocol.registerHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Session | null (optional)
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error
* `response` ProtocolResponse
Returns `Boolean` - Whether the protocol was successfully registered
Registers a protocol of `scheme` that will send an HTTP request as a response.
The usage is the same with `registerFileProtocol`, except that the `callback`
should be called with a `redirectRequest` object that has the `url`, `method`,
`referrer`, `uploadData` and `session` properties.
should be called with an object that has the `url` property.
By default the HTTP request will reuse the current session. If you want the
request to have a different session you should set `session` to `null`.
For POST requests the `uploadData` object must be provided.
### `protocol.registerStreamProtocol(scheme, handler[, completion])`
### `protocol.registerStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `stream` (ReadableStream | [StreamProtocolResponse](structures/stream-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Registers a protocol of `scheme` that will send a `Readable` as a response.
Returns `Boolean` - Whether the protocol was successfully registered
The usage is similar to the other `register{Any}Protocol`, except that the
`callback` should be called with either a `Readable` object or an object that
has the `data`, `statusCode`, and `headers` properties.
Registers a protocol of `scheme` that will send a stream as a response.
The usage is the same with `registerFileProtocol`, except that the
`callback` should be called with either a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable) object or an object that
has the `data` property.
Example:
@@ -286,8 +216,6 @@ protocol.registerStreamProtocol('atom', (request, callback) => {
},
data: createStream('<h5>Response</h5>')
})
}, (error) => {
if (error) console.error('Failed to register protocol')
})
```
@@ -295,132 +223,102 @@ It is possible to pass any object that implements the readable stream API (emits
`data`/`end`/`error` events). For example, here's how a file could be returned:
```javascript
const { protocol } = require('electron')
const fs = require('fs')
protocol.registerStreamProtocol('atom', (request, callback) => {
callback(fs.createReadStream('index.html'))
}, (error) => {
if (error) console.error('Failed to register protocol')
})
```
### `protocol.unregisterProtocol(scheme[, completion])`
### `protocol.unregisterProtocol(scheme)`
* `scheme` String
* `completion` Function (optional)
* `error` Error
Returns `Boolean` - Whether the protocol was successfully unregistered
Unregisters the custom protocol of `scheme`.
### `protocol.isProtocolHandled(scheme)`
### `protocol.isProtocolRegistered(scheme)`
* `scheme` String
Returns `Promise<Boolean>` - fulfilled with a boolean that indicates whether there is
already a handler for `scheme`.
Returns `Boolean` - Whether `scheme` is already registered.
### `protocol.interceptFileProtocol(scheme, handler[, completion])`
### `protocol.interceptFileProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `filePath` String
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a file as a response.
### `protocol.interceptStringProtocol(scheme, handler[, completion])`
### `protocol.interceptStringProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `data` (String | [StringProtocolResponse](structures/string-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (String | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `String` as a response.
### `protocol.interceptBufferProtocol(scheme, handler[, completion])`
### `protocol.interceptBufferProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `buffer` Buffer (optional)
* `completion` Function (optional)
* `error` Error
* `response` (Buffer | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a `Buffer` as a response.
### `protocol.interceptHttpProtocol(scheme, handler[, completion])`
### `protocol.interceptHttpProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Session | null (optional)
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error
* `response` [ProtocolResponse](structures/protocol-response.md)
Returns `Boolean` - Whether the protocol was successfully intercepted
Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
which sends a new HTTP request as a response.
### `protocol.interceptStreamProtocol(scheme, handler[, completion])`
### `protocol.interceptStreamProtocol(scheme, handler)`
* `scheme` String
* `handler` Function
* `request` Object
* `url` String
* `headers` Record<String, String>
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](structures/upload-data.md)
* `request` ProtocolRequest
* `callback` Function
* `stream` (ReadableStream | [StreamProtocolResponse](structures/stream-protocol-response.md)) (optional)
* `completion` Function (optional)
* `error` Error
* `response` (ReadableStream | [ProtocolResponse](structures/protocol-response.md))
Returns `Boolean` - Whether the protocol was successfully intercepted
Same as `protocol.registerStreamProtocol`, except that it replaces an existing
protocol handler.
### `protocol.uninterceptProtocol(scheme[, completion])`
### `protocol.uninterceptProtocol(scheme)`
* `scheme` String
* `completion` Function (optional)
* `error` Error
Returns `Boolean` - Whether the protocol was successfully unintercepted
Remove the interceptor installed for `scheme` and restore its original handler.
[net-error]: https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h
### `protocol.isProtocolIntercepted(scheme)`
* `scheme` String
Returns `Boolean` - Whether `scheme` is already intercepted.
[file-system-api]: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem

View File

@@ -4,3 +4,4 @@
* `referrer` String
* `method` String
* `uploadData` [UploadData[]](upload-data.md) (optional)
* `headers` Record<String, String>

View File

@@ -402,6 +402,7 @@ Returns:
* `key` String - Equivalent to [KeyboardEvent.key][keyboardevent].
* `code` String - Equivalent to [KeyboardEvent.code][keyboardevent].
* `isAutoRepeat` Boolean - Equivalent to [KeyboardEvent.repeat][keyboardevent].
* `isComposing` Boolean - Equivalent to [KeyboardEvent.isComposing][keyboardevent].
* `shift` Boolean - Equivalent to [KeyboardEvent.shiftKey][keyboardevent].
* `control` Boolean - Equivalent to [KeyboardEvent.controlKey][keyboardevent].
* `alt` Boolean - Equivalent to [KeyboardEvent.altKey][keyboardevent].
@@ -907,10 +908,10 @@ Returns `String` - The URL of the current web page.
```javascript
const { BrowserWindow } = require('electron')
let win = new BrowserWindow({ width: 800, height: 600 })
win.loadURL('http://github.com')
let currentURL = win.webContents.getURL()
console.log(currentURL)
win.loadURL('http://github.com').then(() => {
const currentURL = win.webContents.getURL()
console.log(currentURL)
})
```
#### `contents.getTitle()`

View File

@@ -55,7 +55,9 @@ template("electron_extra_paks") {
output = "${invoker.output_dir}/resources.pak"
sources = [
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/content/dev_ui_content_resources.pak",
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
@@ -68,7 +70,9 @@ template("electron_extra_paks") {
"//components/resources",
"//content:content_resources",
"//content:dev_ui_content_resources",
"//content/browser/resources/media:media_internals_resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//electron:resources",
"//mojo/public/js:resources",
"//net:net_resources",

View File

@@ -43,7 +43,6 @@ auto_filenames = {
"docs/api/power-monitor.md",
"docs/api/power-save-blocker.md",
"docs/api/process.md",
"docs/api/protocol-ns.md",
"docs/api/protocol.md",
"docs/api/remote.md",
"docs/api/sandbox-option.md",

View File

@@ -249,7 +249,11 @@ module.exports = {
},
showCertificateTrustDialog: function (window, options) {
if (window && window.constructor !== BrowserWindow) options = window;
if (window && window.constructor !== BrowserWindow) {
options = window;
window = null;
}
if (options == null || typeof options !== 'object') {
throw new TypeError('options must be an object');
}

View File

@@ -10,7 +10,8 @@ const roles = {
about: {
get label () {
return isLinux ? 'About' : `About ${app.name}`;
}
},
...(isWindows && { appMethod: 'showAboutPanel' })
},
close: {
label: isMac ? 'Close Window' : 'Close',

View File

@@ -4,12 +4,13 @@ import * as electron from 'electron';
import { EventEmitter } from 'events';
import objectsRegistry from './objects-registry';
import { ipcMainInternal } from '../ipc-main-internal';
import { isPromise, isSerializableObject } from '@electron/internal/common/type-utils';
import { isPromise, isSerializableObject, deserialize, serialize } from '@electron/internal/common/type-utils';
import { Size } from 'electron/main';
const v8Util = process.electronBinding('v8_util');
const eventBinding = process.electronBinding('event');
const features = process.electronBinding('features');
const { NativeImage } = process.electronBinding('native_image');
if (!features.isRemoteModuleEnabled()) {
throw new Error('remote module is disabled');
@@ -114,6 +115,9 @@ type MetaType = {
} | {
type: 'promise',
then: MetaType
} | {
type: 'nativeimage'
value: electron.NativeImage
}
// Convert a real value into meta data.
@@ -124,6 +128,8 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
// Recognize certain types of objects.
if (value instanceof Buffer) {
type = 'buffer';
} else if (value instanceof NativeImage) {
type = 'nativeimage';
} else if (Array.isArray(value)) {
type = 'array';
} else if (value instanceof Error) {
@@ -147,6 +153,8 @@ const valueToMeta = function (sender: electron.WebContents, contextId: string, v
type,
members: value.map((el: any) => valueToMeta(sender, contextId, el, optimizeSimpleObject))
};
} else if (type === 'nativeimage') {
return { type, value: serialize(value) };
} else if (type === 'object' || type === 'function') {
return {
type,
@@ -234,7 +242,10 @@ type MetaTypeFromRenderer = {
} | {
type: 'object',
name: string,
members: { name: string, value: MetaTypeFromRenderer }[]
members: {
name: string,
value: MetaTypeFromRenderer
}[]
} | {
type: 'function-with-return-value',
value: MetaTypeFromRenderer
@@ -245,7 +256,12 @@ type MetaTypeFromRenderer = {
length: number
} | {
type: 'nativeimage',
value: { size: Size, buffer: Buffer, scaleFactor: number, dataURL: string }[]
value: {
size: Size,
buffer: Buffer,
scaleFactor: number,
dataURL: string
}[]
}
const fakeConstructor = (constructor: Function, name: string) =>
@@ -263,15 +279,8 @@ const fakeConstructor = (constructor: Function, name: string) =>
const unwrapArgs = function (sender: electron.WebContents, frameId: number, contextId: string, args: any[]) {
const metaToValue = function (meta: MetaTypeFromRenderer): any {
switch (meta.type) {
case 'nativeimage': {
const image = electron.nativeImage.createEmpty();
for (const rep of meta.value) {
const { size, scaleFactor, dataURL } = rep;
const { width, height } = size;
image.addRepresentation({ dataURL, scaleFactor, width, height });
}
return image;
}
case 'nativeimage':
return deserialize(meta.value);
case 'value':
return meta.value;
case 'remote-object':

View File

@@ -572,7 +572,7 @@
};
const { readdir } = fs;
fs.readdir = function (pathArgument, options, callback) {
fs.readdir = function (pathArgument, options = {}, callback) {
const { isAsar, asarPath, filePath } = splitPath(pathArgument);
if (typeof options === 'function') {
callback = options;
@@ -594,13 +594,29 @@
return;
}
if (options.withFileTypes) {
const dirents = [];
for (const file of files) {
const stats = archive.stat(file);
if (stats.isFile) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
} else if (stats.isDirectory) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_DIR));
} else if (stats.isLink) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_LINK));
}
}
nextTick(callback, [null, dirents]);
return;
}
nextTick(callback, [null, files]);
};
fs.promises.readdir = util.promisify(fs.readdir);
const { readdirSync } = fs;
fs.readdirSync = function (pathArgument, options) {
fs.readdirSync = function (pathArgument, options = {}) {
const { isAsar, asarPath, filePath } = splitPath(pathArgument);
if (!isAsar) return readdirSync.apply(this, arguments);
@@ -614,6 +630,21 @@
throw createError(AsarError.NOT_FOUND, { asarPath, filePath });
}
if (options.withFileTypes) {
const dirents = [];
for (const file of files) {
const stats = archive.stat(file);
if (stats.isFile) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_FILE));
} else if (stats.isDirectory) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_DIR));
} else if (stats.isLink) {
dirents.push(new fs.Dirent(file, fs.constants.UV_DIRENT_LINK));
}
}
return dirents;
}
return files;
};

View File

@@ -20,10 +20,10 @@ const serializableTypes = [
Date,
Error,
RegExp,
ArrayBuffer,
NativeImage
ArrayBuffer
];
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#Supported_types
export function isSerializableObject (value: any) {
return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type);
}
@@ -34,18 +34,55 @@ const objectMap = function (source: Object, mapper: (value: any) => any) {
return Object.fromEntries(targetEntries);
};
export function serialize (value: any): any {
if (value instanceof NativeImage) {
const representations = [];
for (const scaleFactor of value.getScaleFactors()) {
const size = value.getSize(scaleFactor);
const dataURL = value.toDataURL({ scaleFactor });
function serializeNativeImage (image: any) {
const representations = [];
const scaleFactors = image.getScaleFactors();
// Use Buffer when there's only one representation for better perf.
// This avoids compressing to/from PNG where it's not necessary to
// ensure uniqueness of dataURLs (since there's only one).
if (scaleFactors.length === 1) {
const scaleFactor = scaleFactors[0];
const size = image.getSize(scaleFactor);
const buffer = image.toBitmap({ scaleFactor });
representations.push({ scaleFactor, size, buffer });
} else {
// Construct from dataURLs to ensure that they are not lost in creation.
for (const scaleFactor of scaleFactors) {
const size = image.getSize(scaleFactor);
const dataURL = image.toDataURL({ scaleFactor });
representations.push({ scaleFactor, size, dataURL });
}
return { __ELECTRON_SERIALIZED_NativeImage__: true, representations };
} else if (value instanceof Buffer) {
return { __ELECTRON_SERIALIZED_Buffer__: true, data: value };
} else if (Array.isArray(value)) {
}
return { __ELECTRON_SERIALIZED_NativeImage__: true, representations };
}
function deserializeNativeImage (value: any) {
const image = nativeImage.createEmpty();
// Use Buffer when there's only one representation for better perf.
// This avoids compressing to/from PNG where it's not necessary to
// ensure uniqueness of dataURLs (since there's only one).
if (value.representations.length === 1) {
const { buffer, size, scaleFactor } = value.representations[0];
const { width, height } = size;
image.addRepresentation({ buffer, scaleFactor, width, height });
} else {
// Construct from dataURLs to ensure that they are not lost in creation.
for (const rep of value.representations) {
const { dataURL, size, scaleFactor } = rep;
const { width, height } = size;
image.addRepresentation({ dataURL, scaleFactor, width, height });
}
}
return image;
}
export function serialize (value: any): any {
if (value instanceof NativeImage) {
return serializeNativeImage(value);
} if (Array.isArray(value)) {
return value.map(serialize);
} else if (isSerializableObject(value)) {
return value;
@@ -58,16 +95,7 @@ export function serialize (value: any): any {
export function deserialize (value: any): any {
if (value && value.__ELECTRON_SERIALIZED_NativeImage__) {
const image = nativeImage.createEmpty();
for (const rep of value.representations) {
const { size, scaleFactor, dataURL } = rep;
const { width, height } = size;
image.addRepresentation({ dataURL, scaleFactor, width, height });
}
return image;
} else if (value && value.__ELECTRON_SERIALIZED_Buffer__) {
const { buffer, byteOffset, byteLength } = value.data;
return Buffer.from(buffer, byteOffset, byteLength);
return deserializeNativeImage(value);
} else if (Array.isArray(value)) {
return value.map(deserialize);
} else if (isSerializableObject(value)) {

View File

@@ -5,7 +5,7 @@ const { hasSwitch } = process.electronBinding('command_line');
const { NativeImage } = process.electronBinding('native_image');
const { CallbacksRegistry } = require('@electron/internal/renderer/remote/callbacks-registry');
const { isPromise, isSerializableObject } = require('@electron/internal/common/type-utils');
const { isPromise, isSerializableObject, serialize, deserialize } = require('@electron/internal/common/type-utils');
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal');
const callbacksRegistry = new CallbacksRegistry();
@@ -37,14 +37,7 @@ function wrapArgs (args, visited = new Set()) {
}
if (value instanceof NativeImage) {
const images = [];
for (const scaleFactor of value.getScaleFactors()) {
const size = value.getSize(scaleFactor);
const buffer = value.toBitmap({ scaleFactor });
const dataURL = value.toDataURL({ scaleFactor });
images.push({ buffer, scaleFactor, size, dataURL });
}
return { type: 'nativeimage', value: images };
return { type: 'nativeimage', value: serialize(value) };
} else if (Array.isArray(value)) {
visited.add(value);
const meta = {
@@ -226,6 +219,7 @@ function metaToValue (meta) {
const types = {
value: () => meta.value,
array: () => meta.members.map((member) => metaToValue(member)),
nativeimage: () => deserialize(meta.value),
buffer: () => Buffer.from(meta.value.buffer, meta.value.byteOffset, meta.value.byteLength),
promise: () => Promise.resolve({ then: metaToValue(meta.then) }),
error: () => metaToError(meta),

View File

@@ -125,7 +125,11 @@ class LocationProxy {
}
private getGuestURL (): URL | null {
const urlString = this._invokeWebContentsMethodSync('getURL') as string;
const maybeURL = this._invokeWebContentsMethodSync('getURL') as string;
// When there's no previous frame the url will be blank, so accountfor that here
// to prevent url parsing errors on an empty string.
const urlString = maybeURL !== '' ? maybeURL : 'about:blank';
try {
return new URL(urlString);
} catch (e) {

View File

@@ -45,6 +45,8 @@ const electron = require('electron');
const loadedModules = new Map([
['electron', electron],
['electron/common', electron],
['electron/renderer', electron],
['events', events],
['timers', require('timers')],
['url', require('url')]

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "10.0.0-nightly.20200521",
"version": "10.0.0-beta.3",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
@@ -46,6 +46,7 @@
"lint-staged": "^8.1.0",
"minimist": "^1.2.0",
"nugget": "^2.0.1",
"null-loader": "^4.0.0",
"pre-flight": "^1.1.0",
"remark-cli": "^4.0.0",
"remark-preset-lint-markdown-style-guide": "^2.1.1",

View File

@@ -66,7 +66,6 @@ disable_compositor_recycling.patch
allow_new_privileges_in_unsandboxed_child_processes.patch
expose_setuseragent_on_networkcontext.patch
feat_add_set_theme_source_to_allow_apps_to.patch
revert_cleanup_remove_menu_subtitles_sublabels.patch
add_webmessageportconverter_entangleandinjectmessageportchannel.patch
revert_remove_contentrendererclient_shouldfork.patch
ignore_rc_check.patch
@@ -89,10 +88,14 @@ feat_add_onclose_to_messageport.patch
fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
web_contents.patch
ui_gtk_public_header.patch
crash_allow_embedder_to_set_crash_upload_url.patch
crash_allow_setting_more_options.patch
breakpad_treat_node_processes_as_browser_processes.patch
upload_list_add_loadsync_method.patch
breakpad_allow_getting_string_values_for_crash_keys.patch
crash_allow_disabling_compression_on_linux.patch
fix_hunspell_crash.patch
fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
allow_setting_secondary_label_via_simplemenumodel.patch
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
disable_unnecessary_ischromefirstrun_check.patch
disable_dcheck_that_fails_with_software_compositing.patch
fix_default_to_ntlm_v2_in_network_service.patch

View File

@@ -10,18 +10,18 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
3. Ctrl-Shift-= should show as Ctrl-+
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c44617086b946a80 100644
index 7f26ef86fe967663a50bb556b49a37e1d10d5462..c83431034b9ddf0084f2ee2fc2538e4fb5aa0f0c 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
@@ -12,6 +12,7 @@
#include "base/notreached.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "ui/base/l10n/l10n_util.h"
@@ -22,9 +23,7 @@
@@ -23,9 +24,7 @@
#include <windows.h>
#endif
@@ -31,7 +31,7 @@ index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c4461708
#if defined(OS_CHROMEOS)
#include "ui/base/ui_base_features.h"
@@ -220,7 +219,15 @@ base::string16 Accelerator::GetShortcutText() const {
@@ -204,7 +203,15 @@ base::string16 Accelerator::GetShortcutText() const {
shortcut = KeyCodeToName();
#endif
@@ -47,7 +47,7 @@ index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c4461708
#if defined(OS_WIN)
// Our fallback is to try translate the key code to a regular character
// unless it is one of digits (VK_0 to VK_9). Some keyboard
@@ -229,21 +236,14 @@ base::string16 Accelerator::GetShortcutText() const {
@@ -213,21 +220,14 @@ base::string16 Accelerator::GetShortcutText() const {
// accent' for '0'). For display in the menu (e.g. Ctrl-0 for the
// default zoom level), we leave VK_[0-9] alone without translation.
wchar_t key;
@@ -75,7 +75,7 @@ index 291bdeec97bec510f7c86a8e8bccab22b7d5d8ac..926a705c23bd5adbfc0fe178c4461708
}
#if defined(OS_MACOSX)
@@ -426,7 +426,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
@@ -410,7 +410,7 @@ base::string16 Accelerator::ApplyLongFormModifiers(
// more information.
if (IsCtrlDown())
shortcut = ApplyModifierToAcceleratorString(shortcut, IDS_APP_CTRL_KEY);

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 4ba4a1505651f9e63c4476322a12762e46ac9c6b..39e81a63d549c690a040dd463d0300de01abf419 100644
index b502af8bb93dd45b5de046850f69ef34f9d04732..a6c84cd7909c6a1c70f3f4b5bd65531bf26f1a94 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -247,6 +247,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -255,6 +255,10 @@ int GpuMain(const MainFunctionParams& parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,8 +24,8 @@ index 4ba4a1505651f9e63c4476322a12762e46ac9c6b..39e81a63d549c690a040dd463d0300de
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -363,7 +367,6 @@ int GpuMain(const MainFunctionParams& parameters) {
}));
@@ -373,7 +377,6 @@ int GpuMain(const MainFunctionParams& parameters) {
}
#endif
- auto* client = GetContentClient()->gpu();

View File

@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
context, which can cause some preload scripts to trip.
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index 68822e9c91633d9433c52bdf3484f6c660eb7917..c14a7b2a1897f805f072d8156765f909f1410001 100644
index 831a3574055881f31a3e7dbc98c0525b47af5dcb..9626f181ee471fec68af7ddfc968f2d852698b74 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -114,6 +114,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -23,10 +23,10 @@ index 68822e9c91633d9433c52bdf3484f6c660eb7917..c14a7b2a1897f805f072d8156765f909
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1ca9dc1dab20fb1ca4d461fbe3068323ee6b9b44..95e9039217f44dcaf770ffea2979976e79d276ab 100644
index 0fe316e4d949bf2c0e64a2374a8f639e3afee104..cb612a7002a4ae808ca488e2aa2adbb759310964 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4865,6 +4865,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4729,6 +4729,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index 1ca9dc1dab20fb1ca4d461fbe3068323ee6b9b44..95e9039217f44dcaf770ffea2979976e
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index b839ead18e704d6e3cbb9ee62882438ca91d4823..f54218f24522ee2d28462e127b52d8ba4d529330 100644
index c8772a65b238f52855a6634dbe1722491a663354..c856fb03735e3a46135492513e71daf3b1dc6c1a 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -751,6 +751,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -724,6 +724,8 @@ class CONTENT_EXPORT RenderFrameImpl
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@@ -53,10 +53,10 @@ index b839ead18e704d6e3cbb9ee62882438ca91d4823..f54218f24522ee2d28462e127b52d8ba
int world_id) override;
void DidChangeScrollOffset() override;
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index e07795d6a2726738e743f38dff795a98663eb71c..d7be6078425928c0e9577d8401e328e5ed2bef0c 100644
index e8286b37ae00d2cbfea0f9138ecb6532c36324fc..1c5aae1c07e0c730a0cab28dccaa5a793d41d6ac 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -551,6 +551,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -547,6 +547,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -67,7 +67,7 @@ index e07795d6a2726738e743f38dff795a98663eb71c..d7be6078425928c0e9577d8401e328e5
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index 81457a2e2b5723aa2ff218b4e410d55d7b7f14f8..a62f6c58bb0aaac836edfd87ab2a6f61045059dc 100644
index 1841d4bea144e2fe0fb69839d52ff2ba4aa6b551..64c5eb7d0da7684531b044de9d6d114fc897786e 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -201,6 +201,7 @@ void LocalWindowProxy::Initialize() {
@@ -79,10 +79,10 @@ index 81457a2e2b5723aa2ff218b4e410d55d7b7f14f8..a62f6c58bb0aaac836edfd87ab2a6f61
if (World().IsMainWorld()) {
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
index 9bcd5333f0a097a2fcfec60152cfbaace0e3c1da..21bd2c2c05fa32de9442877dbb0261066d2d59a3 100644
index eae1fafbaab524e590f414b54b366a6d709fad47..97da1b1639618dded697eb72d5959926ce725e24 100644
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
@@ -345,6 +345,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -348,6 +348,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
web_frame_->Client()->DidCreateScriptContext(context, world_id);
}
@@ -97,7 +97,7 @@ index 9bcd5333f0a097a2fcfec60152cfbaace0e3c1da..21bd2c2c05fa32de9442877dbb026106
v8::Local<v8::Context> context,
int32_t world_id) {
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
index 5c554a74f4d3aca91d5a1428f0b1e871764a98b3..aeb930d769c9dbfeb97ca42b4e000ca5c79c49a6 100644
index 7494f29aebe486454f35209a4a72d42dd46431a0..89f4129124b7fb01c449c51f767f4fe0dcc9c299 100644
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
@@ -78,6 +78,8 @@ class LocalFrameClientImpl final : public LocalFrameClient {
@@ -110,10 +110,10 @@ index 5c554a74f4d3aca91d5a1428f0b1e871764a98b3..aeb930d769c9dbfeb97ca42b4e000ca5
int32_t world_id) override;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index f7cbcbc3ded7362a5fa19b0b50808e88d23838e0..cbcc0996690c63c0e0af500ac229cccbdf047b7c 100644
index a8443a8bfc2542ffad472206214279c1223d493f..8c7a4dec19d6fbca615b7bc282b0388189eef886 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -291,6 +291,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -297,6 +297,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
@@ -123,10 +123,10 @@ index f7cbcbc3ded7362a5fa19b0b50808e88d23838e0..cbcc0996690c63c0e0af500ac229cccb
int32_t world_id) = 0;
virtual bool AllowScriptExtensions() = 0;
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
index 605166b7950a37f7d85d9a71af8c042bcbcefc8d..a1ac286dd231436e86c24c9aa65300a534d641de 100644
index 7f060dbe946a6df2d4e4f376512679390edadc07..435882fafb3e08b94424e812ee825e7a042dfef3 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -336,6 +336,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
@@ -334,6 +334,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}

View File

@@ -12,7 +12,7 @@ when we override ReallocateBufferMemory, so we therefore need to implement
Realloc on the v8 side and correspondingly in gin.
diff --git a/gin/array_buffer.cc b/gin/array_buffer.cc
index b94a71ef856f92404e16544e22ebbadf57cff363..b15685f6907bcafeb1acd62bfe76f0713dea27f3 100644
index 891a2e316f6c9eeda9670aaf5201ed57e5f7ba49..00ea3682f491175c6f9bea727de120f5f0de3dac 100644
--- a/gin/array_buffer.cc
+++ b/gin/array_buffer.cc
@@ -43,6 +43,10 @@ void* ArrayBufferAllocator::AllocateUninitialized(size_t length) {
@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index 696a6170a584c1bb71c8ad253963d9f64395a13e..9677aa931cd543adfc1e9844d6afee8dcb0f4c2d 100644
index fa88b2bd0233a4c5ff35a26d10e20fa1b91e33b2..21504ce01403d20067c8439c0c61ee0d71de84a5 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -661,6 +661,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
@@ -672,6 +672,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, ArrayBufferContents::kDontInitialize);
}

View File

@@ -10,11 +10,11 @@ WebContents, and cancels the authentication if there's no WebContents
available, which there isn't in the case of the 'net' module.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 18c3c5312be05333e6ed19ad53bb6296be5db4b7..21299b9959c3f9f44c419d769b0aaff59b1d89f7 100644
index 2001e6202cf61d1c70bf81334b62d0502ea8c9ba..9dad884c877ae77d1a2460361112903c06023021 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -161,6 +161,25 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
@@ -198,6 +198,25 @@ struct CTPolicy {
array<string> excluded_legacy_spkis;
};
+interface TrustedAuthClient {
@@ -39,7 +39,7 @@ index 18c3c5312be05333e6ed19ad53bb6296be5db4b7..21299b9959c3f9f44c419d769b0aaff5
interface CertVerifierClient {
Verify(
int32 default_error,
@@ -605,6 +624,8 @@ struct URLLoaderFactoryParams {
@@ -627,6 +646,8 @@ struct URLLoaderFactoryParams {
// impact because of the extra process hops, so use should be minimized.
pending_remote<TrustedURLLoaderHeaderClient>? header_client;
@@ -49,18 +49,18 @@ index 18c3c5312be05333e6ed19ad53bb6296be5db4b7..21299b9959c3f9f44c419d769b0aaff5
// the per-context allow patterns that is managed via NetworkContext
// interface. This still respects the per-context block lists.
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2d7d1aa8a 100644
index 5d984482a2e5e18216bfc2229a18a513558dbcf4..1662f0878df16639ad585694be428058ab5a6c92 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -442,6 +442,7 @@ URLLoader::URLLoader(
@@ -437,6 +437,7 @@ URLLoader::URLLoader(
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
+ mojom::TrustedURLLoaderAuthClient* url_loader_auth_client,
mojom::OriginPolicyManager* origin_policy_manager,
std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory)
: url_request_context_(url_request_context),
@@ -498,6 +499,11 @@ URLLoader::URLLoader(
std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory,
mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer)
@@ -496,6 +497,11 @@ URLLoader::URLLoader(
header_client_.set_disconnect_handler(
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
}
@@ -72,7 +72,7 @@ index a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2
if (want_raw_headers_) {
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
@@ -978,7 +984,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
@@ -994,7 +1000,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 a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2
OnAuthCredentials(base::nullopt);
return;
}
@@ -994,11 +1000,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
@@ -1010,11 +1016,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
if (url_request->response_headers())
head->headers = url_request->response_headers();
head->auth_challenge_info = auth_info;
@@ -108,18 +108,18 @@ index a180f3fe9af9411dec7a6e49da5ee4ef3f7b00f5..92ecdeca6962697d6ca13ff3ad4de8c2
auth_challenge_responder_receiver_.set_disconnect_handler(
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 4e95817834afd7b9d3a3284a5924646ff784e636..e26a90754565a548d72a74b2936f15ab5c71debb 100644
index 077344d12f001b00590598bccbba2d614c8c1af2..d9c8a41c9c4fe11277392dd428c71f022f22063b 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -112,6 +112,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -115,6 +115,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
+ mojom::TrustedURLLoaderAuthClient* url_loader_auth_client,
mojom::OriginPolicyManager* origin_policy_manager,
std::unique_ptr<TrustTokenRequestHelperFactory>
trust_token_helper_factory);
@@ -443,6 +444,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
trust_token_helper_factory,
@@ -454,6 +455,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
base::Optional<base::UnguessableToken> fetch_window_id_;
mojo::Remote<mojom::TrustedHeaderClient> header_client_;
@@ -128,30 +128,30 @@ index 4e95817834afd7b9d3a3284a5924646ff784e636..e26a90754565a548d72a74b2936f15ab
std::unique_ptr<FileOpenerForUpload> file_opener_for_upload_;
diff --git a/services/network/url_loader_factory.cc b/services/network/url_loader_factory.cc
index 1c43785d9b2c19dd4129f030e3ec9475a9bb4b31..730635d7f18bf95100558c37a1d38304a22f650d 100644
index c8f02a3760f938c772c9e81afff8b37e49a73cbd..7e5bb5d1384488de2dee3672f933eba643dc14f7 100644
--- a/services/network/url_loader_factory.cc
+++ b/services/network/url_loader_factory.cc
@@ -68,6 +68,7 @@ URLLoaderFactory::URLLoaderFactory(
@@ -75,6 +75,7 @@ URLLoaderFactory::URLLoaderFactory(
resource_scheduler_client_(std::move(resource_scheduler_client)),
header_client_(std::move(params_->header_client)),
coep_reporter_(std::move(params_->coep_reporter)),
+ auth_client_(std::move(params_->auth_client)),
cors_url_loader_factory_(cors_url_loader_factory) {
cors_url_loader_factory_(cors_url_loader_factory),
cookie_observer_(std::move(params_->cookie_observer)) {
DCHECK(context);
DCHECK_NE(mojom::kInvalidProcessId, params_->process_id);
@@ -230,6 +231,7 @@ void URLLoaderFactory::CreateLoaderAndStart(
@@ -270,6 +271,7 @@ void URLLoaderFactory::CreateLoaderAndStart(
std::move(keepalive_statistics_recorder),
std::move(network_usage_accumulator),
header_client_.is_bound() ? header_client_.get() : nullptr,
+ auth_client_.is_bound() ? auth_client_.get() : nullptr,
context_->origin_policy_manager(),
url_request.trust_token_params
? std::make_unique<TrustTokenRequestHelperFactory>(
context_->origin_policy_manager(), std::move(trust_token_factory),
std::move(cookie_observer));
diff --git a/services/network/url_loader_factory.h b/services/network/url_loader_factory.h
index 1a623585035487de061ba6476914992ea2f7ac88..caa19dcd4b99296e50f8e22bfc92a70ba14473d1 100644
index 8b29b67a5b0663778df3169e09bf818e6bbcec3f..e504fa3d41066907a3fbc41e69daac968415dfa6 100644
--- a/services/network/url_loader_factory.h
+++ b/services/network/url_loader_factory.h
@@ -74,6 +74,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
@@ -75,6 +75,7 @@ class URLLoaderFactory : public mojom::URLLoaderFactory {
scoped_refptr<ResourceSchedulerClient> resource_scheduler_client_;
mojo::Remote<mojom::TrustedURLLoaderHeaderClient> header_client_;
mojo::Remote<mojom::CrossOriginEmbedderPolicyReporter> coep_reporter_;

View File

@@ -20,15 +20,15 @@ least harm in the interim by removing the check that prevents more than
one tracker from existing at a time.
diff --git a/ui/gfx/x/x11_error_tracker.cc b/ui/gfx/x/x11_error_tracker.cc
index af031de356c5e0938fd3b84a494e48dc9a0e0476..2a5c18dc473a4f88fc0427bec69142917159bbd9 100644
index 6592ae0483884815697358040123eed5ee657816..d6862673c0b5a61db550c084291787ad1549db69 100644
--- a/ui/gfx/x/x11_error_tracker.cc
+++ b/ui/gfx/x/x11_error_tracker.cc
@@ -24,7 +24,7 @@ namespace gfx {
X11ErrorTracker::X11ErrorTracker() {
// This is a non-exhaustive check for incorrect usage. It disallows nested
// X11ErrorTracker instances on the same thread.
- DCHECK(g_handler == NULL);
+ // DCHECK(g_handler == NULL);
- DCHECK(g_handler == nullptr);
+ // DCHECK(g_handler == nullptr);
g_handler = this;
XSync(GetXDisplay(), False);
old_handler_ = XSetErrorHandler(X11ErrorHandler);

View File

@@ -0,0 +1,86 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Thu, 21 May 2020 13:58:01 -0700
Subject: Allow setting secondary label via SimpleMenuModel
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10ce93fcdb8 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -49,6 +49,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
return base::string16();
}
+base::string16 SimpleMenuModel::Delegate::GetSecondaryLabelForCommandId(
+ int command_id) const {
+ return base::string16();
+}
+
ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
int command_id) const {
return ImageModel();
@@ -291,6 +296,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) {
MenuItemsChanged();
}
+void SimpleMenuModel::SetSecondaryLabel(int index, const base::string16& secondary_label) {
+ items_[ValidateItemIndex(index)].secondary_label = secondary_label;
+ MenuItemsChanged();
+}
+
void SimpleMenuModel::SetMinorText(int index,
const base::string16& minor_text) {
items_[ValidateItemIndex(index)].minor_text = minor_text;
@@ -364,6 +374,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
return items_[ValidateItemIndex(index)].label;
}
+base::string16 SimpleMenuModel::GetSecondaryLabelAt(int index) const {
+ if (IsItemDynamicAt(index))
+ return delegate_->GetSecondaryLabelForCommandId(GetCommandIdAt(index));
+ return items_[ValidateItemIndex(index)].secondary_label;
+}
+
base::string16 SimpleMenuModel::GetMinorTextAt(int index) const {
return items_[ValidateItemIndex(index)].minor_text;
}
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027057546cd 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -44,6 +44,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Some command ids have labels and icons that change over time.
virtual bool IsItemForCommandIdDynamic(int command_id) const;
virtual base::string16 GetLabelForCommandId(int command_id) const;
+ virtual base::string16 GetSecondaryLabelForCommandId(int command_id) const;
// Gets the icon for the item with the specified id.
virtual ImageModel GetIconForCommandId(int command_id) const;
@@ -147,6 +148,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Sets the label for the item at |index|.
void SetLabel(int index, const base::string16& label);
+ // Sets the secondary_label for the item at |index|.
+ void SetSecondaryLabel(int index, const base::string16& secondary_label);
+
// Sets the minor text for the item at |index|.
void SetMinorText(int index, const base::string16& minor_text);
@@ -173,6 +177,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
int GetCommandIdAt(int index) const override;
base::string16 GetLabelAt(int index) const override;
+ base::string16 GetSecondaryLabelAt(int index) const override;
base::string16 GetMinorTextAt(int index) const override;
ImageModel GetMinorIconAt(int index) const override;
bool IsItemDynamicAt(int index) const override;
@@ -207,6 +212,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
int command_id = 0;
ItemType type = TYPE_COMMAND;
base::string16 label;
+ base::string16 secondary_label;
base::string16 minor_text;
ImageModel minor_icon;
ImageModel icon;

View File

@@ -6,7 +6,7 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
This allows file:// URLs in workers to have a CSP.
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
index dc1858e41ce77fcb3cd9f828cc70ef9e09a23d15..8e1ffef4b630b4981cd37bd669b1187240bca280 100644
index c8a4f02e69491345a6353e557b6bbdc34bb2999a..982995c8bf4632a2970c90780f3c2da3f244634e 100644
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
@@ -323,7 +323,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(

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 89028fddac1f32a619a3d0b9216932515ef0ed86..c1ba8ffd313256001c99ad605906c11cd06274e9 100644
index 62f8218676e2a591fa53081ebb22e4c91f212ab2..3b25132c1a7f06e479d1fba2ab6054db9b24346e 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -469,10 +469,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -532,10 +532,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
}
CHECK(!view_ || !view_->IsAttached());
@@ -28,7 +28,7 @@ index 89028fddac1f32a619a3d0b9216932515ef0ed86..c1ba8ffd313256001c99ad605906c11c
if (!Client())
return;
@@ -490,6 +486,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -553,6 +549,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,24 +7,23 @@ This exposes a method for obtaining a reference to an isolated world, which is
otherwise not available in the Blink API.
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index 8231ed74df9c031a594eb1be607b171a78531010..c5621d9e7dc4f1c2a0c79a1d07e833874378b950 100644
index 52365dedbe109f5302ceabd6393a8a9ae104f392..c8f8f0f939e2bbe5e03867a02c2357086675210f 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -335,6 +335,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
@@ -340,6 +340,8 @@ class WebLocalFrame : public WebFrame {
// Returns the world ID associated with |script_context|.
virtual int32_t GetScriptContextWorldId(
v8::Local<v8::Context> script_context) const = 0;
+ virtual v8::Local<v8::Context> WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const = 0;
+
// Executes script in the context of the current page and returns the value
// that the script evaluated to with callback. Script execution can be
// suspend.
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index f8e90a17ca7cec06613b396a4e8351381772b692..008737d979c82bd1b07144a21f1c39de48c210a2 100644
index 26a3c819d5a212ef615bda20c56a76fe11a236a9..9c763bb22ecede8bb68cc81ba446f57ddf9430af 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -923,6 +923,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
@@ -952,6 +952,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
@@ -39,13 +38,13 @@ index f8e90a17ca7cec06613b396a4e8351381772b692..008737d979c82bd1b07144a21f1c39de
return BindingSecurity::ShouldAllowAccessToFrame(
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
index c80168558ff46553667f70f9fa82bf19ce5ecbce..1bc72e14acd253615c73571ac82e9970f5b91196 100644
index 8ec29bddfa75c11446ac7322dda2b9a12275dfcf..54f5e05c87205aa05fda990db21d0bf8ba92bcf5 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -161,6 +161,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;
int32_t GetScriptContextWorldId(
v8::Local<v8::Context> script_context) const override;
+ v8::Local<v8::Context> WorldScriptContext(
+ v8::Isolate* isolate, int world_id) const override;
void RequestExecuteScriptAndReturnValue(const WebScriptSource&,

View File

@@ -8,13 +8,13 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 97fe778a121a1fd3658db8c00d621a72c12e82d2..661a0ee2deff4dc1c4180ade161c9ff17cfc0226 100644
index 8f6f08406e743cfabd653c7f9e4bf32802e0cf65..5dfd3cc573d6c56c53f608c4258d7f0abc9f639a 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -74,6 +74,7 @@
@@ -73,6 +73,7 @@
X("drmcursor") \
X("dwrite") \
X("DXVA Decoding") \
X("EarlyJava") \
+ X("electron") \
X("evdev") \
X("event") \

View File

@@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
rebuild the entire tree.
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 6f5d5f123f89c5ef4dd601eddb6025bd4dc3b9ab..b39aa4b3181489e5ea270c6cd3f30adfbb9847a0 100644
index 33416d571f2d2a672daf62be21bfb97dfc998b51..a1f21871c1806857723d3a421e5ef3917d7f1ef0 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {

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 baee2af78cd679e458c336786326957b6ea32440..5aa26ca8eb3d5128cc217950fe8bba27b44c26b6 100644
index 21ff33131e62938ab04399a70d392ccbe5282034..79abda0cc919e3a79b49ebd417bf86368934bbd1 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -4363,6 +4363,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -4691,6 +4691,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index baee2af78cd679e458c336786326957b6ea32440..5aa26ca8eb3d5128cc217950fe8bba27
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6883f29361bab9a78ba93da92e7bd234f62e2f8f..6a18c7085f102d475bd36925106e86c56812accc 100644
index d2b8edd094a8585fe14e144e881feafd0917199a..e282718ec461f6c7bcb1fe36d5bb73359f04a30a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2962,9 +2962,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
@@ -2969,9 +2969,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
}
if (delegate_) {
@@ -38,10 +38,10 @@ index 6883f29361bab9a78ba93da92e7bd234f62e2f8f..6a18c7085f102d475bd36925106e86c5
for (auto& observer : observers_) {
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index ce836b666eaca4312b01dec1cb012bbcb23b9050..9009a8b7a23e170ab0fbf81a6d157e18fa4e1769 100644
index 21811c17c9ffc37ccae543a7f5d2181987e144ab..697acddd922caa5f5df27219b0e109a1c72b6b2b 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -305,6 +305,10 @@ struct CreateNewWindowParams {
@@ -256,6 +256,10 @@ struct CreateNewWindowParams {
// The window features to use for the new window.
blink.mojom.WindowFeatures features;
@@ -53,10 +53,10 @@ index ce836b666eaca4312b01dec1cb012bbcb23b9050..9009a8b7a23e170ab0fbf81a6d157e18
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 5990228237b99f382ba235a4bc59068ab12168de..c9fc489ded15dc3cfcdd71c86707e6e86a7e6ba3 100644
index 8cfe2bfebd69be8aa4ed4fd1a8b846e7237be68f..8f36f7277a59d297a0700d1dfd5d8120f6a0ffa1 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -508,6 +508,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -530,6 +530,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -66,10 +66,10 @@ index 5990228237b99f382ba235a4bc59068ab12168de..c9fc489ded15dc3cfcdd71c86707e6e8
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 7c7a70b95873ed089e311cc0917ad32d8e465a4e..2d8d316f948fbc25fd4b1aa899b38ba2607e24a1 100644
index 21c7cfe08903cf92948af5fe069d7b25035c23fe..463fcc56d05a2e18c1d3752b5e7e275c8797eca8 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -144,6 +144,7 @@ class NetworkService;
@@ -146,6 +146,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -77,7 +77,7 @@ index 7c7a70b95873ed089e311cc0917ad32d8e465a4e..2d8d316f948fbc25fd4b1aa899b38ba2
} // namespace network
namespace rappor {
@@ -831,6 +832,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -851,6 +852,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -87,7 +87,7 @@ index 7c7a70b95873ed089e311cc0917ad32d8e465a4e..2d8d316f948fbc25fd4b1aa899b38ba2
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 17281521f8109279fe68e11abc2fcec41cfdf9c0..83b951dcf55b54661c8f855a8e10984d262c91b2 100644
index 6017278cc0fa8d029477e7ef46a9c0cacae438be..18161c8f836134e470333381a16425e3347ea867 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -26,6 +26,17 @@ namespace content {
@@ -109,7 +109,7 @@ index 17281521f8109279fe68e11abc2fcec41cfdf9c0..83b951dcf55b54661c8f855a8e10984d
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index d10b0f458416044f0b5eaeac4160ac26a2857d94..4e3a846a3825216e1a77e17fd8e03331c6fb927b 100644
index 3844c78d8e56c43e08786af3128a1bcda3fc5839..089291f17512d24697ace85c93d1b3d4e024edf2 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -119,8 +119,8 @@ index d10b0f458416044f0b5eaeac4160ac26a2857d94..4e3a846a3825216e1a77e17fd8e03331
+#include "content/common/frame.mojom.h"
#include "content/public/browser/bluetooth_chooser.h"
#include "content/public/browser/bluetooth_scanning_prompt.h"
#include "content/public/browser/invalidate_type.h"
@@ -327,6 +328,13 @@ class CONTENT_EXPORT WebContentsDelegate {
#include "content/public/browser/eye_dropper.h"
@@ -331,6 +332,13 @@ class CONTENT_EXPORT WebContentsDelegate {
const std::string& partition_id,
SessionStorageNamespace* session_storage_namespace);
@@ -135,7 +135,7 @@ index d10b0f458416044f0b5eaeac4160ac26a2857d94..4e3a846a3825216e1a77e17fd8e03331
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 2a33016a5e54bbabfa8c534b954f6c72822ca70d..ea7084056f13c60bcc3ba8bd4991a924b6153ee2 100644
index 0d7c504ce1fb7cbd72e7b176f6d88d1734034cc0..80278388015825fee05771aff7af3376d327058a 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -68,6 +68,7 @@
@@ -158,10 +158,10 @@ index 2a33016a5e54bbabfa8c534b954f6c72822ca70d..ea7084056f13c60bcc3ba8bd4991a924
// moved on send.
bool is_background_tab =
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
index a10476afec548da09e44c1ea565c0ca7c9f902db..2b9d7fe3f57fa50036e8fc2e33daaae94ccbdcda 100644
index c69a7f463fbf629320c88f65a9c0f6ce9c3bf0db..6d7f47624414c4e9e77680e415facd8f3e2130ee 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
@@ -395,6 +395,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -400,6 +400,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -171,10 +171,10 @@ index a10476afec548da09e44c1ea565c0ca7c9f902db..2b9d7fe3f57fa50036e8fc2e33daaae9
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
index b59e7c255d90996dec1f02170ffa4e1d3ec2a0c6..56db656bd2b19ca2ae90ace6c813a719a6266217 100644
index 45b6bbbd41bbe19a39edb83b6ced844cb4c97244..90b5c696f4cc6b77d1377a628c9d8166c773bb60 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
@@ -78,6 +78,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -79,6 +79,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -206,10 +206,10 @@ index 4f735ad0d97eaac9a57dad137e479f8a7ec33a36..0a3c5821962c85609b64b3625fa6b8d6
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 8029e46e91697d6a8c1349519d2c6e68bfb443a5..4b75b3e28938e092bc575117bc6ed5c7607baf74 100644
index 5137d99c8e94b8f2dfb903b3de87d2dfcfd14380..5859fa66f7878b77ccea0c41f22845f617123684 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -1768,6 +1768,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -1837,6 +1837,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
}
WebWindowFeatures window_features = GetWindowFeaturesFromString(features);

View File

@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
Electrons grit header instead of Chromes
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index f853ba4924c5730cc9b0eafc2d15dbf3c1341542..9bb35ad9a3918d5fea8d66eb7f29c50058c87afc 100644
index c2b29ac310b445a9544bc7d81d3e54003f327c90..8740a49e0c3cf822da7cda504052ee7b93826bb8 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -5313,6 +5313,7 @@ jumbo_static_library("browser") {
@@ -5403,6 +5403,7 @@ static_library("browser") {
deps += [
"//components/spellcheck/browser",
"//components/spellcheck/common",

View File

@@ -3,17 +3,8 @@ From: Jeremy Apthorp <jeremya@chromium.org>
Date: Wed, 10 Oct 2018 15:07:34 -0700
Subject: command-ismediakey.patch
Override MediaKeysListener::IsMediaKeycode to also listen for Volume Up, Volume Down,
and Mute. We also need to patch out Chromium's usage of RemoteCommandCenterDelegate, as
it uses MPRemoteCommandCenter. MPRemoteCommandCenter makes it such that GlobalShortcuts
in Electron will not work as intended, because by design an app does not receive remote
control events until it begins playing audio. This means that a media shortcut would not kick
into effect until you, for example, began playing a YouTube video which sort of defeats the
purpose of GlobalShortcuts.
At the moment there is no upstream possibility for this; but perhaps Chromium may
consider some kind of switch, enabled by default, which would conditionally choose to avoid usage of
RemoteCommandCenterDelegate on macOS.
Override MediaKeysListener::IsMediaKeycode and associated functions to also listen for
Volume Up, Volume Down, and Mute.
Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
@@ -95,3 +86,31 @@ index 85378bb565de617b1bd611d28c8714361747a357..36de4c0b0353be2418dacd388e92d7c3
return event;
}
diff --git a/ui/base/accelerators/system_media_controls_media_keys_listener.cc b/ui/base/accelerators/system_media_controls_media_keys_listener.cc
index 9d6084ceaccfd071549e63e3015f55ef292312ec..846210b04d6e2e193413c643296938ec550f6d25 100644
--- a/ui/base/accelerators/system_media_controls_media_keys_listener.cc
+++ b/ui/base/accelerators/system_media_controls_media_keys_listener.cc
@@ -65,6 +65,11 @@ bool SystemMediaControlsMediaKeysListener::StartWatchingMediaKey(
case VKEY_MEDIA_STOP:
service_->SetIsStopEnabled(true);
break;
+ case VKEY_VOLUME_DOWN:
+ case VKEY_VOLUME_UP:
+ case VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
@@ -97,6 +102,11 @@ void SystemMediaControlsMediaKeysListener::StopWatchingMediaKey(
case VKEY_MEDIA_STOP:
service_->SetIsStopEnabled(false);
break;
+ case VKEY_VOLUME_DOWN:
+ case VKEY_VOLUME_UP:
+ case VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}

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 a4044d94e4cd420edecc98482f0d1cb4b8707039..036b9b5001d053bc8dab781b9c30c37a019f7a1e 100644
index d01f1fcfd6259c82b0fab35345b05b771c6a933b..554170ffdb2f9f852ade0be8173a2c306840401d 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1491,7 +1491,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
@@ -1482,7 +1482,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
NOTREACHED();
#else
base::RunLoop run_loop;

View File

@@ -1,192 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Wed, 13 May 2020 19:06:23 +0000
Subject: allow embedder to set crash upload url
Currently //components/crash hard-codes the crash report URL to be a
Google-specific target. This CL adds a hook which allows embedders to override
this URL. Without it, this module isn't usable for non-Google embedders.
Change-Id: I1251c3ef164f04de63cf8c66165180e897a91d78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2194585
Commit-Queue: Jeremy Apthorp <jeremya@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768385}
diff --git a/components/crash/core/app/BUILD.gn b/components/crash/core/app/BUILD.gn
index bb11c401ca7939ca04e90fd13f1b335bf5b60598..af031a027ee3e19e57e9c4d9a133127a3a637003 100644
--- a/components/crash/core/app/BUILD.gn
+++ b/components/crash/core/app/BUILD.gn
@@ -22,7 +22,10 @@ source_set("lib") {
"crash_reporter_client.h",
]
- deps = [ "//base" ]
+ deps = [
+ "//base",
+ "//build:branding_buildflags",
+ ]
}
source_set("crashpad_handler_main") {
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
index 192b0a7f137f311abb6a991f997e11f5eba52256..8ca43e2a8a104c3edf4087df5490fd47cd18f9a4 100644
--- a/components/crash/core/app/breakpad_linux.cc
+++ b/components/crash/core/app/breakpad_linux.cc
@@ -103,7 +103,11 @@ namespace {
// while we do have functions to deal with uint64_t's.
uint64_t g_crash_loop_before_time = 0;
#else
-const char kUploadURL[] = "https://clients2.google.com/cr/report";
+char* g_upload_url = nullptr;
+void SetUploadURL(const std::string& url) {
+ DCHECK(!g_upload_url);
+ g_upload_url = strdup(url.c_str());
+}
#endif
bool g_is_crash_reporter_enabled = false;
@@ -1400,16 +1404,16 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
static const char kWgetBinary[] = "/usr/bin/wget";
const char* args[] = {
- kWgetBinary,
- header_content_encoding,
- header_content_type,
- post_file,
- kUploadURL,
- "--timeout=10", // Set a timeout so we don't hang forever.
- "--tries=1", // Don't retry if the upload fails.
- "-O", // Output reply to the file descriptor path.
- status_fd_path,
- nullptr,
+ kWgetBinary,
+ header_content_encoding,
+ header_content_type,
+ post_file,
+ g_upload_url,
+ "--timeout=10", // Set a timeout so we don't hang forever.
+ "--tries=1", // Don't retry if the upload fails.
+ "-O", // Output reply to the file descriptor path.
+ status_fd_path,
+ nullptr,
};
static const char msg[] = "Cannot upload crash dump: cannot exec "
"/usr/bin/wget\n";
@@ -2037,6 +2041,10 @@ void InitCrashReporter(const std::string& process_type) {
#endif
process_type.empty();
+#if !defined(OS_CHROMEOS)
+ SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
+#endif
+
if (is_browser_process) {
bool enable_breakpad = GetCrashReporterClient()->GetCollectStatsConsent() ||
GetCrashReporterClient()->IsRunningUnattended();
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
index e778f68af30f8c071d1360d06b553cc957160c5b..0ef0f00e4320b2ab1584621df5b3b8081c65a788 100644
--- a/components/crash/core/app/crash_reporter_client.cc
+++ b/components/crash/core/app/crash_reporter_client.cc
@@ -4,6 +4,7 @@
#include "components/crash/core/app/crash_reporter_client.h"
+#include "build/branding_buildflags.h"
#include "build/build_config.h"
// On Windows don't use FilePath and logging.h.
@@ -22,6 +23,10 @@ namespace {
CrashReporterClient* g_client = nullptr;
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
+const char kDefaultUploadURL[] = "https://clients2.google.com/cr/report";
+#endif
+
} // namespace
void SetCrashReporterClient(CrashReporterClient* client) {
@@ -196,6 +201,16 @@ void CrashReporterClient::GetSanitizationInformation(
}
#endif
+std::string CrashReporterClient::GetUploadUrl() {
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
+ // Only allow the possibility of report upload in official builds. This
+ // crash server won't have symbols for any other build types.
+ return kDefaultUploadURL;
+#else
+ return std::string();
+#endif
+}
+
bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
return false;
}
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
index 9cc78fc2584061d26fd1e83b3ebf5ada0a12c138..ad4bbbc5de3feb8441ba613009452c920d925820 100644
--- a/components/crash/core/app/crash_reporter_client.h
+++ b/components/crash/core/app/crash_reporter_client.h
@@ -194,6 +194,9 @@ class CrashReporterClient {
bool* sanitize_stacks);
#endif
+ // Returns the URL target for crash report uploads.
+ virtual std::string GetUploadUrl();
+
// This method should return true to configure a crash reporter capable of
// monitoring itself for its own crashes to do so, even if self-monitoring
// would be expensive. "Expensive" self-monitoring dedicates an additional
diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc
index 5d31d0926cd1732bdd1808c232c18fc6ff550c05..56a79e28dece162210613c842df0a34aaa66f91c 100644
--- a/components/crash/core/app/crashpad_linux.cc
+++ b/components/crash/core/app/crashpad_linux.cc
@@ -120,9 +120,8 @@ base::FilePath PlatformCrashpadInitialization(
// to ChromeOS's /sbin/crash_reporter which in turn passes the dump to
// crash_sender which handles the upload.
std::string url;
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD) && \
- !defined(OS_CHROMEOS)
- url = "https://clients2.google.com/cr/report";
+#if !defined(OS_CHROMEOS)
+ url = crash_reporter_client->GetUploadUrl();
#else
url = std::string();
#endif
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
index b579521d55860823722df2ee849f6b1628b3c950..c49d38082c41c7eb71ed2c701b06ed5b7eaa514a 100644
--- a/components/crash/core/app/crashpad_mac.mm
+++ b/components/crash/core/app/crashpad_mac.mm
@@ -133,13 +133,7 @@ base::FilePath PlatformCrashpadInitialization(
crash_reporter_client->GetCrashDumpLocation(&database_path);
crash_reporter_client->GetCrashMetricsLocation(&metrics_path);
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
- // Only allow the possibility of report upload in official builds. This
- // crash server won't have symbols for any other build types.
- std::string url = "https://clients2.google.com/cr/report";
-#else
- std::string url;
-#endif
+ std::string url = crash_reporter_client->GetUploadUrl();
std::vector<std::string> arguments;
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
index 669f5bea844d75f0e5c34b58994f4cfb8e856af0..c199b467ffeb007f3098ccde6879fbd71e9ec9fd 100644
--- a/components/crash/core/app/crashpad_win.cc
+++ b/components/crash/core/app/crashpad_win.cc
@@ -85,11 +85,7 @@ base::FilePath PlatformCrashpadInitialization(
std::map<std::string, std::string> process_annotations;
GetPlatformCrashpadAnnotations(&process_annotations);
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
- std::string url = "https://clients2.google.com/cr/report";
-#else
- std::string url;
-#endif
+ std::string url = crash_reporter_client->GetUploadUrl();
// Allow the crash server to be overridden for testing. If the variable
// isn't present in the environment then the default URL will remain.

View File

@@ -21,10 +21,10 @@ index 8ca43e2a8a104c3edf4087df5490fd47cd18f9a4..bb0c6aebb4fdb9b24de8292a3f1c8dc7
uint64_t g_process_start_time = 0;
pid_t g_pid = 0;
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
index 0ef0f00e4320b2ab1584621df5b3b8081c65a788..bb30a0fdd797b80a345212828060a38f25d78e67 100644
index 44e81b2f95f6332df16cfa00bdd26c7abbc733dc..9b3db694b920048735789d4db0f8670addd22b40 100644
--- a/components/crash/core/app/crash_reporter_client.cc
+++ b/components/crash/core/app/crash_reporter_client.cc
@@ -153,6 +153,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
@@ -148,6 +148,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
return false;
}
@@ -43,7 +43,7 @@ index 0ef0f00e4320b2ab1584621df5b3b8081c65a788..bb30a0fdd797b80a345212828060a38f
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
return 100;
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
index ad4bbbc5de3feb8441ba613009452c920d925820..c2dfc8fc897d901d237670e7c305fd263606bee7 100644
index 05538423d0b9ad0d83e9326a58f8856e0403fed2..06d9f1e3b57db5cf33555eb5ad837f8d66aa8b3d 100644
--- a/components/crash/core/app/crash_reporter_client.h
+++ b/components/crash/core/app/crash_reporter_client.h
@@ -5,6 +5,7 @@
@@ -54,7 +54,7 @@ index ad4bbbc5de3feb8441ba613009452c920d925820..c2dfc8fc897d901d237670e7c305fd26
#include <string>
#include "base/strings/string16.h"
@@ -153,6 +154,19 @@ class CrashReporterClient {
@@ -150,6 +151,19 @@ class CrashReporterClient {
// that case, |breakpad_enabled| is set to the value enforced by policies.
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
@@ -75,7 +75,7 @@ index ad4bbbc5de3feb8441ba613009452c920d925820..c2dfc8fc897d901d237670e7c305fd26
// Used by WebView to sample crashes without generating the unwanted dumps. If
// the returned value is less than 100, crash dumping will be sampled to that
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
index c49d38082c41c7eb71ed2c701b06ed5b7eaa514a..7d3a52951ac525640974e03b13f8827d465adf1d 100644
index 0b594d053d7c7f2a8eae9a15e62daacab52ffa64..96210530f699a2331f57415beddc20ed19b9cb4b 100644
--- a/components/crash/core/app/crashpad_mac.mm
+++ b/components/crash/core/app/crashpad_mac.mm
@@ -67,6 +67,8 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {

View File

@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 16b7768fab7a43cf6ddf089fd9590bd333a766e3..b41519865e6babc829085880aadaaaea7e086e45 100644
index 86a9e8c358ca6c70b07e17cf8dbcdb013472a3be..633f93d28840c350e8cda3dde96b98ac019bc9e7 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1262,8 +1262,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
@@ -1253,8 +1253,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
return NAVIGATION_TYPE_NEW_SUBFRAME;
}
@@ -33,7 +33,7 @@ index 16b7768fab7a43cf6ddf089fd9590bd333a766e3..b41519865e6babc829085880aadaaaea
if (rfh->GetParent()) {
// All manual subframes would be did_create_new_entry and handled above, so
@@ -1518,7 +1520,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
@@ -1510,7 +1512,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
}
@@ -46,10 +46,10 @@ index 16b7768fab7a43cf6ddf089fd9590bd333a766e3..b41519865e6babc829085880aadaaaea
// navigation. Now we know that the renderer has updated its state accordingly
// and it is safe to also clear the browser side history.
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 4362daa04e89ca8f47c5e07e998fc9f1ad4f4c5b..9ecdb2e13235396aee11ae1be7e539f8e932e3f6 100644
index 9bfabd34eabcaf893b674e74e540f9258f1730bb..ea6e9f7b7161f9e3afa463fb8114479d3d10eb6b 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -776,10 +776,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
@@ -773,10 +773,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
UINT cf_format = format.ToFormatEtc().cfFormat;

View File

@@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
re-submitting the patch.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 67d7e8e69d8a9b8b34b82b83bdf688df4c17ed59..9f6b797ea0489fc87b33a36bbcaae84a2cbf05f3 100644
index 0d752de291c071e9a6054d7ced3ac1930fa38471..05e1e711e1a4abc1aab79fdbb4cda63cbf282e94 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -640,7 +640,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
@@ -656,7 +656,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
}
#endif
@@ -68,7 +68,7 @@ index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f8
// Re-initializes schemes for tests.
CONTENT_EXPORT void ReRegisterContentSchemesForTests();
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
index 6c27d324e6235051875b88c4bc5bd362d3907f3c..06c17d6673d280fabf5b47244e7f7f7ab374f9a3 100644
index ed5b0e2c0b4d453560ee9e2e4a55780b409eeea9..46e29dca5d13691bcf9494c0f90b68d6219a75ef 100644
--- a/content/public/app/content_main_delegate.cc
+++ b/content/public/app/content_main_delegate.cc
@@ -37,6 +37,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
@@ -83,7 +83,7 @@ index 6c27d324e6235051875b88c4bc5bd362d3907f3c..06c17d6673d280fabf5b47244e7f7f7a
return service_manager::ProcessType::kDefault;
}
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
index f8590642a8d6807a15746e9e7673b5e76cbe0e14..7d8df731b6dd18a42ec4fc2b1bb08a6198da8ff8 100644
index 2d9ee9fa20a9aba1de168cc86bfeea5eab71e6d3..4b163c3fa2ddd258b5527e0ccaf9fc9d2621ef75 100644
--- a/content/public/app/content_main_delegate.h
+++ b/content/public/app/content_main_delegate.h
@@ -77,6 +77,20 @@ class CONTENT_EXPORT ContentMainDelegate {

View File

@@ -29,10 +29,10 @@ index a489bf6ea2179059f53e53563e993db9c7cd123b..93e237569fe94ec8526f67d915e1a735
virtual content::DesktopMediaID::Type GetMediaListType() const = 0;
};
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965234c4542 100644
index 147d5be9f7f56fb71468b56e86eb33b59d51cd66..5930fe95e33a9e5a3108c31e8c34daa9c724511c 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
@@ -22,6 +22,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
@@ -20,6 +20,11 @@ DesktopMediaListBase::DesktopMediaListBase(base::TimeDelta update_period)
DesktopMediaListBase::~DesktopMediaListBase() {}
@@ -44,7 +44,7 @@ index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965
void DesktopMediaListBase::SetUpdatePeriod(base::TimeDelta period) {
DCHECK(!observer_);
update_period_ = period;
@@ -56,7 +61,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
@@ -54,7 +59,7 @@ void DesktopMediaListBase::Update(UpdateCallback callback) {
DCHECK(sources_.empty());
DCHECK(!refresh_callback_);
refresh_callback_ = std::move(callback);
@@ -53,7 +53,7 @@ index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965
}
int DesktopMediaListBase::GetSourceCount() const {
@@ -70,6 +75,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
@@ -68,6 +73,11 @@ const DesktopMediaList::Source& DesktopMediaListBase::GetSource(
return sources_[index];
}
@@ -65,7 +65,7 @@ index ba64a40697c7bb91d6e944ad9ea8fa50dd970633..d2600791197082c8c2e179ee4df66965
DesktopMediaID::Type DesktopMediaListBase::GetMediaListType() const {
return type_;
}
@@ -81,6 +91,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
@@ -79,6 +89,12 @@ DesktopMediaListBase::SourceDescription::SourceDescription(
void DesktopMediaListBase::UpdateSourcesList(
const std::vector<SourceDescription>& new_sources) {
@@ -111,16 +111,15 @@ index ad7f766a36b1b6b2a8bc0f96369f1aaadf6681f7..f6c6c14a0937430df62c9b9c1132c591
protected:
virtual ~DesktopMediaListObserver() {}
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 224d52b83533543398757ca487f99b3e59897e21..eb50b0393ba532766867aeec5ddeab1a6acd0bc2 100644
index 622d9a22c8e53ba13f00c078a8240c0449c0900a..a190f487c7c388631e83bb951420d699b913bdea 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -10,14 +10,15 @@
@@ -10,13 +10,14 @@
#include "base/hash/hash.h"
#include "base/message_loop/message_pump_type.h"
#include "base/single_thread_task_runner.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/media/webrtc/desktop_media_list.h"
@@ -132,11 +131,11 @@ index 224d52b83533543398757ca487f99b3e59897e21..eb50b0393ba532766867aeec5ddeab1a
#include "third_party/libyuv/include/libyuv/scale_argb.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -221,6 +222,8 @@ void NativeDesktopMediaList::Worker::RefreshThumbnails(
FROM_HERE, {BrowserThread::UI},
FROM_HERE,
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
media_list_));
+
+ capturer_.reset();
}
void NativeDesktopMediaList::Worker::OnCaptureResult(
bool NativeDesktopMediaList::Worker::IsCurrentFrameValid() const {

View File

@@ -15,7 +15,7 @@ the redraw locking mechanism, which fixes these issues. The electron issue
can be found at https://github.com/electron/electron/issues/1821
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 0328f536a10de1ff4b6fd0a70c1b80c260aa7b87..2bb93842c74feb1d3f33d4589b7a75ceff8858ef 100644
index c981cfc6b0ace5a0c60aa04af05f9a9e3158231d..eb43285dfacd700451dacb3a04546790298026ea 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -306,6 +306,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -49,7 +49,7 @@ index 0328f536a10de1ff4b6fd0a70c1b80c260aa7b87..2bb93842c74feb1d3f33d4589b7a75ce
// HWNDMessageHandler, gfx::WindowImpl overrides:
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 4da6edd086c9df20af7cdcb5c6020cd61166fbea..81b300c2533a3aaa6e0c343405a6040351061e27 100644
index a84076658b4e8e6817938fa889bcb11d5c68b354..fa1052eec362f090c59b98e7d6158b3849657afa 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -203,6 +203,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,

View File

@@ -19,8 +19,23 @@ This can be removed once web content (including WebGL) learn how
to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index f2beaa8238c66b942620e053f4abae32441f2851..82aa964e34a966e3e2300c2b951d6431d294d111 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1859,6 +1859,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace(
gfx::ContentColorUsage content_color_usage) const {
+ if (!settings_.enable_color_correct_rendering) {
+ return {};
+ }
+
constexpr gfx::ColorSpace srgb = gfx::ColorSpace::CreateSRGB();
if (settings_.prefer_raster_in_srgb &&
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index 95a901678c215220b9e88db768444d48e32f6dbd..841c809b0b50c8c34a9d9c972c511bd4fd57a7b0 100644
index c2684645484c7e1b6a555ba31f6634496a4fec76..9250d3b772fdeb6eb943f6cddeb96200e0f819f4 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -100,6 +100,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -66,10 +81,10 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
#if defined(OS_MACOSX)
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f00bfe2d8d 100644
index 1efef99651721d7cdb159ef9fe1aea6c5fb299f0..efcdc1dbe7207f66862a7ab93f0f226c8d27ba2e 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -84,6 +84,9 @@
@@ -85,6 +85,9 @@
using gpu::gles2::GLES2Interface;
@@ -79,7 +94,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
namespace viz {
namespace {
@@ -582,8 +585,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
@@ -583,8 +586,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
SetBlendEnabled(quad->ShouldDrawWithBlending());
@@ -91,7 +106,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
// Use the full quad_rect for debug quads to not move the edges based on
// partial swaps.
@@ -1553,7 +1557,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
@@ -1554,7 +1558,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
params->use_color_matrix, tint_gl_composited_content_,
params->apply_shader_based_rounded_corner &&
ShouldApplyRoundedCorner(params->quad)),
@@ -101,7 +116,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
@@ -2024,7 +2029,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -2025,7 +2030,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -111,7 +126,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
SetShaderColor(color, opacity);
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -2179,7 +2185,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
@@ -2180,7 +2186,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
: NON_PREMULTIPLIED_ALPHA,
false, false, tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -121,7 +136,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2275,7 +2282,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
@@ -2276,7 +2283,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -131,7 +146,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2377,7 +2385,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
@@ -2378,7 +2386,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
// The source color space should never be RGB.
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
@@ -141,7 +156,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
#if defined(OS_WIN)
// Force sRGB output on Windows for overlay candidate video quads to match
@@ -2541,7 +2550,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
@@ -2542,7 +2551,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
@@ -151,7 +166,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2606,8 +2616,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2607,8 +2617,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
@@ -162,7 +177,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -3346,7 +3356,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
@@ -3347,7 +3357,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
const gfx::ColorSpace& src_color_space,
const gfx::ColorSpace& dst_color_space) {
@@ -173,7 +188,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
// If the input color space is PQ, and it did not specify a white level,
// override it with the frame's white level.
@@ -3728,9 +3740,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
@@ -3729,9 +3741,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
}
@@ -186,7 +201,7 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
gfx::SizeF((*overlay_texture)->texture.size()));
@@ -3949,8 +3961,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
@@ -3950,8 +3962,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
PrepareGeometry(SHARED_BINDING);
@@ -197,14 +212,14 @@ index 085dbe8d7a92e541cbb92f08e9c01967b38262e0..31007e113e695ca9736d4927d088d2f0
gfx::Transform render_matrix;
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
@@ -4064,3 +4076,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
@@ -4065,3 +4077,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
}
} // namespace viz
+
+#undef PATCH_CS
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index d47312d5f89939eab55cfa94bd3fbd41a4bd7d2a..da2f5e9fdc0fda37c82357a12f4fa28f5c556273 100644
index 2ed4bf758cdc24de04b1cd37d5b0c0c195e5561d..f87824a4d6cf0f724f4b86c66f9d2a1c7f60b7ca 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -209,6 +209,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -216,10 +231,10 @@ index d47312d5f89939eab55cfa94bd3fbd41a4bd7d2a..da2f5e9fdc0fda37c82357a12f4fa28f
service_manager::switches::kGpuSandboxAllowSysVShm,
service_manager::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 618700cc99de3174b9de9bc26abcaac5880ec21e..aac0c3e5e19ee7bcf0de68a4f9f45c1cf46f9fad 100644
index 0e84525e677131b3428e5fe73dfb7b48bf65a692..c473f13efc218c98942166715504006d56f9a862 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -230,6 +230,7 @@
@@ -226,6 +226,7 @@
#include "ui/accessibility/accessibility_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/display/display_switches.h"
@@ -227,7 +242,7 @@ index 618700cc99de3174b9de9bc26abcaac5880ec21e..aac0c3e5e19ee7bcf0de68a4f9f45c1c
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "url/origin.h"
@@ -3213,6 +3214,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3246,6 +3247,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
@@ -236,10 +251,10 @@ index 618700cc99de3174b9de9bc26abcaac5880ec21e..aac0c3e5e19ee7bcf0de68a4f9f45c1c
service_manager::switches::kDisableInProcessStackTraces,
service_manager::switches::kDisableSeccompFilterSandbox,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 75558f0658a3760ce9dcf550b1ac134e30c686d8..40dc39bdcd08032e7af821beeb13373fd1c613e9 100644
index 186a80b795a3cc67cfa4f60fdc013a8f0a004fe0..fdf7a85298a00be8b1888b63a4bc229b6d5888b1 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2586,6 +2586,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
@@ -2540,6 +2540,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
@@ -250,7 +265,7 @@ index 75558f0658a3760ce9dcf550b1ac134e30c686d8..40dc39bdcd08032e7af821beeb13373f
// is what the renderer uses if its not threaded.
settings.enable_checker_imaging =
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75f1177cb9 100644
index 6bf7541499dd849439f191cfddae92dded99ef85..a023ddd9f8311bff998bb6655445bb44baa96cfc 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
@@ -4,6 +4,7 @@
@@ -269,7 +284,7 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
namespace blink {
@@ -89,6 +91,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
@@ -88,6 +90,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
}
gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
@@ -281,7 +296,7 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
gfx::ColorSpace::PrimaryID primary_id = GetPrimaryID(color_space_);
// TODO(ccameron): This needs to take into account whether or not this texture
@@ -102,6 +109,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
@@ -101,6 +108,11 @@ gfx::ColorSpace CanvasColorParams::GetSamplerGfxColorSpace() const {
}
gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
@@ -294,7 +309,7 @@ index d88680239152858689121d134559765fb8fae1b7..073ed8a8f84ebf994a2b9d9fa7e78f75
gfx::ColorSpace::TransferID transfer_id =
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..5b661c70c9c89883a1aaaf1a29a9ec9fe7f16da6 100644
index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..93a9652b71d86441e15b87aafd7a6b1a13f45830 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -16,6 +16,7 @@
@@ -305,33 +320,37 @@ index 2674784dca1ed12b2f5afc7b728e0c6e8cd6ca4a..5b661c70c9c89883a1aaaf1a29a9ec9f
namespace gfx {
@@ -258,6 +259,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
} else {
CGColorSpaceRef color_space = base::mac::GetSRGBColorSpace();
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ color_space = base::mac::GetSystemColorSpace();
+ }
+
base::ScopedCFTypeRef<CFDataRef> color_space_icc(
CGColorSpaceCopyICCProfile(color_space));
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
@@ -274,6 +280,14 @@ bool IOSurfaceCanSetColorSpace(const ColorSpace& color_space) {
void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
@@ -119,6 +120,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
// Common method used by IOSurfaceSetColorSpace and IOSurfaceCanSetColorSpace.
bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
const ColorSpace& color_space) {
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ base::ScopedCFTypeRef<CFDataRef> system_icc(
+ CGColorSpaceCopyICCProfile(base::mac::GetSystemColorSpace()));
+ IOSurfaceSetValue(io_surface, CFSTR("IOSurfaceColorSpace"), system_icc);
+ return;
+ return true;
+ }
+
if (!internal::IOSurfaceSetColorSpace(io_surface, color_space)) {
DLOG(ERROR) << "Failed to set color space for IOSurface: "
<< color_space.ToString();
// Allow but ignore invalid color spaces.
if (!color_space.IsValid())
return true;
@@ -253,6 +262,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
DCHECK_EQ(kIOReturnSuccess, r);
}
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ CGColorSpaceRef color_space = base::mac::GetSystemColorSpace();
+ base::ScopedCFTypeRef<CFDataRef> color_space_icc(
+ CGColorSpaceCopyICCProfile(color_space));
+ IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
+ return surface;
+ }
+
// Ensure that all IOSurfaces start as sRGB.
if (__builtin_available(macos 10.12, *)) {
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index 0f746ead72a2c195321384c9c4ced96d0608fb7b..a9cc7b6d93cdb42c5a9a177e8a09edeb36db8122 100644
--- a/ui/gfx/switches.cc

View File

@@ -6,7 +6,7 @@ Subject: fix: disabling compositor recycling
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 385b0dbeb7cbfb31ad0726051dc2e8fb4d7b16b2..9fe6d55cc0dbcc504cdf0eebe71899887de31b19 100644
index 1cf61e86d97c5735836d7d0211b179300b46b454..1fc038fa999702c91a9126df61567ba4c8601dad 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -472,7 +472,11 @@ void RenderWidgetHostViewMac::WasOccluded() {

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Fri, 22 May 2020 17:58:16 -0700
Subject: Disable DCHECK that fails with software compositing
Should be removed once https://bugs.chromium.org/p/chromium/issues/detail?id=1084625
is addressed.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index eb43285dfacd700451dacb3a04546790298026ea..faa47e9ef7f388dc0bfa5cd3efb961e6339ce390 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -2407,13 +2407,13 @@ void HWNDMessageHandler::OnPaint(HDC dc) {
RECT cr;
if (GetClientRect(hwnd(), &cr)) {
if (exposed_pixels_.height() > 0) {
- DCHECK_GE(cr.bottom, exposed_pixels_.height());
+ //DCHECK_GE(cr.bottom, exposed_pixels_.height());
RECT rect = {cr.left, cr.bottom - exposed_pixels_.height(), cr.right,
cr.bottom};
FillRect(ps.hdc, &rect, brush);
}
if (exposed_pixels_.width() > 0) {
- DCHECK_GE(cr.right, exposed_pixels_.width());
+ //DCHECK_GE(cr.right, exposed_pixels_.width());
RECT rect = {cr.right - exposed_pixels_.width(), cr.top, cr.right,
cr.bottom - exposed_pixels_.height()};
FillRect(ps.hdc, &rect, brush);

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 a0bb67b269f03ed6fa322fd156e9eb358eed1437..8c2d75c20afd5832371b04f50c9fb1ec5d9e8dc5 100644
index 6c201738acc6a0e269f3bbc8a0469d282a11c5ea..43691a30a65d93be24abcc8f300cc4ed932d66b1 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -653,6 +653,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -644,6 +644,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
return;
@@ -20,10 +20,10 @@ index a0bb67b269f03ed6fa322fd156e9eb358eed1437..8c2d75c20afd5832371b04f50c9fb1ec
blink::mojom::PointerLockResult::kWrongDocument);
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 947fb6ba02cde74da8787ccec689cd184f98aefd..67722b63693d28c828435d60ca167b5cda0a57b4 100644
index 3b4de3ff60f85db1f69aa791200cb19e8db5c795..22fca91b561312b4a747a9de62c455ead0ecb70e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -179,6 +179,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -180,6 +180,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// RenderWidgetHostImpl.
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
@@ -34,10 +34,10 @@ index 947fb6ba02cde74da8787ccec689cd184f98aefd..67722b63693d28c828435d60ca167b5c
const base::TimeDelta& delay) {
new_content_rendering_delay_ = delay;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 12e1923fd2943af92aaf6f691d28212bdd2a73dd..3b66abb180df5f3da7c4fa8de77279620cbc4aa3 100644
index 4802fcfbccc628d186c30f9941e5a6a7eeea06a0..099ac6cccd9d7b46d41c3356423f82d863fcca66 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -692,7 +692,7 @@ void RenderWidgetHostViewAura::HideImpl() {
@@ -641,7 +641,7 @@ void RenderWidgetHostViewAura::HideImpl() {
DCHECK(visibility_ == Visibility::HIDDEN ||
visibility_ == Visibility::OCCLUDED);

View File

@@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
Date: Fri, 22 May 2020 17:40:47 -0700
Subject: Disable unnecessary IsChromeFirstRun check
https://crrev.com/c/2155167/18/chrome/browser/spellchecker/spellcheck_service.cc#586
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index d353a024b8f18e8a02edd7bb9c8cdc76e1af1963..8aef24d488365398161a75790ad306e4b1fecb72 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -18,7 +18,9 @@
#include "base/synchronization/waitable_event.h"
#include "base/values.h"
#include "build/build_config.h"
+#if 0
#include "chrome/browser/first_run/first_run.h"
+#endif
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
#include "components/language/core/browser/pref_names.h"
@@ -566,7 +568,7 @@ void SpellcheckService::InitWindowsDictionaryLanguages(
.empty());
});
- if (first_run::IsChromeFirstRun()) {
+ //if (first_run::IsChromeFirstRun()) {
// Ensure that spellcheck is enabled for the first dialect of the
// accepted languages if there is a Windows dictionary installed for
// that dialect.
@@ -606,7 +608,7 @@ void SpellcheckService::InitWindowsDictionaryLanguages(
base::Value(first_user_language));
prefs->Set(spellcheck::prefs::kSpellCheckDictionaries, user_dictionaries);
}
- }
+ //}
// No need to call LoadHunspellDictionaries() as when the ListPrefUpdate
// object goes out of scope, the preference change handler will do this.

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 b7c83cceb2297eddcb345e75a95b7744b08d2e6b..7dda5ce275aef7670406e3cb3b08bd6d14d188ef 100644
index 5f2feba6f09327088badc56d76872d2c3920866f..803315067b4ceccd3ceb3c97ea186b5de7f64f1f 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1044,6 +1044,13 @@ void NetworkContext::SetNetworkConditions(
@@ -1009,6 +1009,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index b7c83cceb2297eddcb345e75a95b7744b08d2e6b..7dda5ce275aef7670406e3cb3b08bd6d
// This may only be called on NetworkContexts created with the constructor
// that calls MakeURLRequestContext().
diff --git a/services/network/network_context.h b/services/network/network_context.h
index cff8a36b7703df31d0823efb2549f57d7c6c6907..ae9c7a0d6cd98f59892fd5b0fcb6a0307cd842fc 100644
index 0bc906026e988819f66554749c8d6aa2f2accc49..b76ab13a2c02b5d61ff931564af743260fbeeae8 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -242,6 +242,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -235,6 +235,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 cff8a36b7703df31d0823efb2549f57d7c6c6907..ae9c7a0d6cd98f59892fd5b0fcb6a030
void SetEnableReferrers(bool enable_referrers) override;
#if defined(OS_CHROMEOS)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index e834a5f9a4b6c698ad20e3b9cdc99e871e4035df..18c3c5312be05333e6ed19ad53bb6296be5db4b7 100644
index 248108042a5be07a3ddf6a11880ddbf04470d673..2001e6202cf61d1c70bf81334b62d0502ea8c9ba 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1026,6 +1026,9 @@ interface NetworkContext {
@@ -1031,6 +1031,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);
@@ -77,10 +77,10 @@ index e834a5f9a4b6c698ad20e3b9cdc99e871e4035df..18c3c5312be05333e6ed19ad53bb6296
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index b2be49a841af089adb1c85eb87aa6c198a522001..eee74c88beffafcfba75bb76ad7c54154a57aa39 100644
index eff66d994c5c416a672405226172e640b65278ff..34e8182ad2b33598d7c91a63202516c5b7e42257 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -104,6 +104,7 @@ class TestNetworkContext : public mojom::NetworkContext {
@@ -105,6 +105,7 @@ class TestNetworkContext : public mojom::NetworkContext {
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
mojom::NetworkConditionsPtr conditions) override {}

View File

@@ -10,22 +10,22 @@ get this standardised, but in lieu of that, this makes MessagePort a
whole bunch more useful!
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index 3e71122bfbc87b481d620d67d01926690ae5270a..cd1abc51fa216215b5ab00d0a8b63638c24cbd57 100644
index 9e9de51e37ee46266c647bd9c0c27e02a42bf5f1..d16727bed1a99b8171d0c7c5c5b7f38289ae9e55 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -149,6 +149,7 @@ void MessagePort::close() {
Entangle(mojo::MessagePipe().handle0);
@@ -158,6 +158,7 @@ void MessagePort::close() {
Entangle(pipe.TakePort0());
}
closed_ = true;
+ DispatchEvent(*Event::Create(event_type_names::kClose));
}
void MessagePort::Entangle(mojo::ScopedMessagePipeHandle handle) {
void MessagePort::Entangle(MessagePortDescriptor port) {
diff --git a/third_party/blink/renderer/core/messaging/message_port.h b/third_party/blink/renderer/core/messaging/message_port.h
index d24804499949c237462ee455e7cec93836debca9..53e61229e73e2343414aa1ac5c5ac1ff2d3db439 100644
index d30195fc3cf96279426c7c23fa6f99f7cd193b26..95dc5b61a01452e64e5008e772367897445ca312 100644
--- a/third_party/blink/renderer/core/messaging/message_port.h
+++ b/third_party/blink/renderer/core/messaging/message_port.h
@@ -119,6 +119,13 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData,
@@ -121,6 +121,13 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData,
return GetAttributeEventListener(event_type_names::kMessageerror);
}

View File

@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
We can remove this patch once it has in some shape been upstreamed.
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index c0c55286676df02d1aae3afd15de745e9756dd3e..c791beb29543b84bcc0e1d7b464a0e0f4bc39cd4 100644
index 1d9716fc42193fce05418817ab259e55c8c08cc9..90d8fea6dffef7f0f12ae7fe2cb23b5517794765 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -247,6 +247,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors)
@@ -26,10 +26,10 @@ index c0c55286676df02d1aae3afd15de745e9756dd3e..c791beb29543b84bcc0e1d7b464a0e0f
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 8c60a3f7ba7cd3caec127028422be32024ff586b..7bffe0caa4a55728e45f2371bb594c96855d1bc5 100644
index fce4c73af25eea6a917031202ada54a62aca2545..8e54a2975b1e0eea49e0583fb2966d00c78aa747 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -363,6 +363,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -393,6 +393,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
ColorId color_id,
ColorScheme color_scheme = ColorScheme::kDefault) const;
@@ -52,7 +52,7 @@ index 8c60a3f7ba7cd3caec127028422be32024ff586b..7bffe0caa4a55728e45f2371bb594c96
// Returns a shared instance of the native theme that should be used for web
// rendering. Do not use it in a normal application context (i.e. browser).
// The returned object should not be deleted by the caller. This function is
@@ -497,6 +513,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -531,6 +547,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
PreferredColorScheme preferred_color_scheme_ =
PreferredColorScheme::kNoPreference;
@@ -62,10 +62,10 @@ index 8c60a3f7ba7cd3caec127028422be32024ff586b..7bffe0caa4a55728e45f2371bb594c96
};
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index f94a3ed2098d5f32ea0eb881be28d7a589b359a5..1bb8445ef2f68bdf1f2fc8a7a6f1cd0f4e0357d0 100644
index 54730260ccb2ca56fd3fa26db631821de0e7d796..f94097fb5be82f7e9a3e09d2446c17534c513832 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -733,6 +733,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
@@ -734,6 +734,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
// ...unless --force-dark-mode was specified in which case caveat emptor.
if (UsesHighContrastColors() && !IsForcedDarkMode())
return false;

View File

@@ -9,7 +9,7 @@ production use cases. This is unlikely to be upstreamed as the change
is entirely in //chrome.
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd9d907160 100644
index ca546f2253b5b49b7c4580798ee173ffdaaa9e30..71cfbc3cd2b5d0de13862e7fa300b9d2a2a3e862 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -50,6 +50,9 @@ namespace {
@@ -22,7 +22,7 @@ index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd
// Close the file.
void CloseDictionary(base::File file) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
@@ -248,6 +251,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
@@ -270,6 +273,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
g_download_url_for_testing.Get() = url;
}
@@ -33,7 +33,7 @@ index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd
GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
if (g_download_url_for_testing.Get() != GURL())
return g_download_url_for_testing.Get();
@@ -255,6 +262,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
@@ -277,6 +284,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
DCHECK(!bdict_file.empty());
@@ -44,10 +44,10 @@ index 25feeebf5367cec52c36cbfac4af71022c8716d2..653ef44ff095015ef25cc59bf42f9fbd
"https://redirector.gvt1.com/edgedl/chrome/dict/";
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index 4af3201238dfec14bd5a4241b662ca52799e6862..4662bdc08b54304a7f8b2995f60fea9dc5617fff 100644
index a8acd00dc449812d336364229fade2a16e21ccbc..8d8eca3c7de3080111043dc465ed4316af026c0b 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -85,6 +85,8 @@ class SpellcheckHunspellDictionary
@@ -88,6 +88,8 @@ class SpellcheckHunspellDictionary
// Tests use this method to set a custom URL for downloading dictionaries.
static void SetDownloadURLForTesting(const GURL url);

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 d07b3cd2f8a2658c46426a97c378e2aae469321c..f316733194014b9f4ab64a0d8c31436b5badf2e9 100644
index 938ff3a2c996a6eb22a1d5913941bf51d9ccebc0..df8c37c8aede6916ef8fb3e85f8c225146555c96 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -480,6 +480,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -491,6 +491,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -21,10 +21,10 @@ index d07b3cd2f8a2658c46426a97c378e2aae469321c..f316733194014b9f4ab64a0d8c31436b
return is_active();
}
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index cfb48f43295d74ab5c1c3cdafbb9ab4210344a15..c1c586f57ad45d33e926e27ef6d2985d10025cb0 100644
index dd5cf0829c91f1331ca07a3b799f8351947b05a2..ffb9b0c7e2842ad2d5939264e04e8970a12edf30 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -110,6 +110,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -111,6 +111,7 @@ class CONTENT_EXPORT RenderViewHostImpl
SiteInstanceImpl* GetSiteInstance() override;
bool IsRenderViewLive() override;
void NotifyMoveOrResizeStarted() override;
@@ -33,7 +33,7 @@ index cfb48f43295d74ab5c1c3cdafbb9ab4210344a15..c1c586f57ad45d33e926e27ef6d2985d
void UpdateWebkitPreferences(const WebPreferences& prefs) override;
void OnWebkitPreferencesChanged() override;
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 89239568df43a73b46ec433dfb3f96a14f92928e..2d58d35bcdd515112f088bcc02f8c251d80d0411 100644
index 85a8c7e9e283b20ad5ace2f8e02479d1ff212899..ccf8bb322ff8258a7006e4ecbee94bca7d675743 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -94,6 +94,9 @@ IPC_STRUCT_TRAITS_END()
@@ -47,7 +47,7 @@ index 89239568df43a73b46ec433dfb3f96a14f92928e..2d58d35bcdd515112f088bcc02f8c251
IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences,
content::WebPreferences)
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
index 893c45a5c71b4e55ea323ae60e11d12ddb099efd..db9a1ff0fe1a912db83692ab17c620cff7446bcb 100644
index dfd856eb481114fea9da3e26b4080c9a8473acf6..604a95a0427705eca523e91b08a136f806da68f0 100644
--- a/content/public/browser/render_view_host.h
+++ b/content/public/browser/render_view_host.h
@@ -96,6 +96,9 @@ class CONTENT_EXPORT RenderViewHost : public IPC::Sender {
@@ -61,10 +61,10 @@ index 893c45a5c71b4e55ea323ae60e11d12ddb099efd..db9a1ff0fe1a912db83692ab17c620cf
//
// Returns the current WebKit preferences. Note: WebPreferences is cached, so
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index ea7084056f13c60bcc3ba8bd4991a924b6153ee2..ccbe64ec13acb5e39ae869e30eebc3944e4e8ee9 100644
index 80278388015825fee05771aff7af3376d327058a..c681eb0fb52c0db810d1bb23f06929fd71873089 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1174,6 +1174,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
@@ -1180,6 +1180,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
@@ -73,7 +73,7 @@ index ea7084056f13c60bcc3ba8bd4991a924b6153ee2..ccbe64ec13acb5e39ae869e30eebc394
IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
@@ -1671,6 +1673,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
@@ -1680,6 +1682,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
return send_content_state_immediately_;
}
@@ -83,14 +83,14 @@ index ea7084056f13c60bcc3ba8bd4991a924b6153ee2..ccbe64ec13acb5e39ae869e30eebc394
+ GetWebView()->SetSchedulerThrottling(allowed);
+}
+
void RenderViewImpl::ApplyPageVisibilityState(
PageVisibilityState visibility_state,
bool initial_setting) {
void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) {
webkit_preferences_ = prefs;
ApplyWebPreferences(webkit_preferences_, GetWebView());
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 396c63b9dedde6c82b82edddbb35d010bf55474c..65fb52f7ba2f379c7ae1cab3250269172d83ad09 100644
index dac8651a96409c60684a99a7cf4d735b40decc33..438d0f79767665cc851115970525909d623a582d 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -402,6 +402,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
@@ -392,6 +392,7 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
void OnSetHistoryOffsetAndLength(int history_offset, int history_length);
void OnSetRendererPrefs(
const blink::mojom::RendererPreferences& renderer_prefs);
@@ -99,10 +99,10 @@ index 396c63b9dedde6c82b82edddbb35d010bf55474c..65fb52f7ba2f379c7ae1cab325026917
void OnUpdateTargetURLAck();
void OnUpdateWebPreferences(const WebPreferences& prefs);
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 3995c946382f54582e2de2720dfc3475f76806bb..73ae36568d34f4e40cc68ef53e719532100f88ed 100644
index 53faedcea05f045e42b87bf13db5961964f9c298..851409ebf365e74e4b2c9de4a658f67f3062052a 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -400,6 +400,7 @@ class WebView {
@@ -380,6 +380,7 @@ class WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@@ -111,10 +111,10 @@ index 3995c946382f54582e2de2720dfc3475f76806bb..73ae36568d34f4e40cc68ef53e719532
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 9098b1fa973dd57c5c1074fd73391888c4e6dac4..d5b696d7d372fc6caf3c281ea1c2ff2636a72fbd 100644
index 78b796cc46c479525b1c99ee39ed9576efc17d5b..119fcd4066eb57c9a919132b5e3c24cb00529768 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3322,12 +3322,20 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3342,6 +3342,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -122,34 +122,35 @@ index 9098b1fa973dd57c5c1074fd73391888c4e6dac4..d5b696d7d372fc6caf3c281ea1c2ff26
+ DCHECK(GetPage());
+ scheduler_throttling_allowed_ = allowed;
+ GetPage()->GetPageScheduler()->SetPageVisible(allowed ?
+ (GetVisibilityState() == PageVisibilityState::kVisible) : true);
+ (GetVisibilityState() == mojom::blink::PageVisibilityState::kVisible) : true);
+}
+
void WebViewImpl::SetVisibilityState(PageVisibilityState visibility_state,
bool is_initial_state) {
DCHECK(GetPage());
void WebViewImpl::SetVisibilityState(
mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) {
@@ -3352,7 +3359,8 @@ void WebViewImpl::SetVisibilityState(
}
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
- GetPage()->GetPageScheduler()->SetPageVisible(visibility_state ==
- PageVisibilityState::kVisible);
+ GetPage()->GetPageScheduler()->SetPageVisible(
GetPage()->GetPageScheduler()->SetPageVisible(
- visibility_state == mojom::blink::PageVisibilityState::kVisible);
+ scheduler_throttling_allowed_ ?
+ (visibility_state == PageVisibilityState::kVisible) : true);
+ (visibility_state ==mojom::blink::PageVisibilityState::kVisible) : true);
}
PageVisibilityState WebViewImpl::GetVisibilityState() {
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index 9624d433eea3e2e09d91ce9ad44198d5e045d41b..c30fa33dc1e3e0413a7d483959e8602721e8207a 100644
index 4ee975c80501c77e5bf7d599a69983a62a07989d..c5d174f045f8f9d6225aadc70dfe13ceca408dd4 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -328,6 +328,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -325,6 +325,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
+ void SetSchedulerThrottling(bool allowed) override;
void SetVisibilityState(PageVisibilityState visibility_state,
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
PageVisibilityState GetVisibilityState() override;
@@ -691,6 +692,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -681,6 +682,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// WebViewImpl::Close while handling an input event.
bool debug_inside_input_handling_ = false;

View File

@@ -5,12 +5,12 @@ Subject: feat: allow embedders to add observers on created hunspell
dictionaries
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index af11ea50738ca20453c5c20f7807455fca8becfa..301a9de1eb82ebea009f0c20028e8ed87764622b 100644
index d048c713cddc0f53595c142e01a91d12e3232ae7..d353a024b8f18e8a02edd7bb9c8cdc76e1af1963 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -363,6 +363,9 @@ void SpellcheckService::LoadHunspellDictionaries() {
std::make_unique<SpellcheckHunspellDictionary>(dictionary, context_,
this));
@@ -436,6 +436,9 @@ void SpellcheckService::LoadHunspellDictionaries() {
std::make_unique<SpellcheckHunspellDictionary>(
dictionary, platform_spellcheck_language, context_, this));
hunspell_dictionaries_.back()->AddObserver(this);
+ if (hunspell_observer_) {
+ hunspell_dictionaries_.back()->AddObserver(hunspell_observer_);
@@ -18,7 +18,7 @@ index af11ea50738ca20453c5c20f7807455fca8becfa..301a9de1eb82ebea009f0c20028e8ed8
hunspell_dictionaries_.back()->Load();
}
@@ -376,6 +379,20 @@ SpellcheckService::GetHunspellDictionaries() {
@@ -449,6 +452,20 @@ SpellcheckService::GetHunspellDictionaries() {
return hunspell_dictionaries_;
}
@@ -40,7 +40,7 @@ index af11ea50738ca20453c5c20f7807455fca8becfa..301a9de1eb82ebea009f0c20028e8ed8
std::string locale,
std::string path,
diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h
index 97df131375cb11eb562ac0097ab7c870755b46dd..485331591812d0f28011160b186dc2e78f1e77a7 100644
index ebb5db00c8215756978dab7f93bb15c41659f8ef..ed72a306c2e2b52256bba3b1cf9ab38f005f3632 100644
--- a/chrome/browser/spellchecker/spellcheck_service.h
+++ b/chrome/browser/spellchecker/spellcheck_service.h
@@ -123,6 +123,8 @@ class SpellcheckService : public KeyedService,
@@ -52,7 +52,7 @@ index 97df131375cb11eb562ac0097ab7c870755b46dd..485331591812d0f28011160b186dc2e7
// Load a dictionary from a given path. Format specifies how the dictionary
// is stored. Return value is true if successful.
bool LoadExternalDictionary(std::string language,
@@ -225,6 +227,8 @@ class SpellcheckService : public KeyedService,
@@ -273,6 +275,8 @@ class SpellcheckService : public KeyedService,
// A pointer to the BrowserContext which this service refers to.
content::BrowserContext* context_;

View File

@@ -94,7 +94,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3
private:
const HWND hwnd_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 3af93631092dc191c314f378b89ab09a56b36b3a..bcb285ee09d7218098d748d422e6dbbdafbc4c6a 100644
index b2ba22d8da656db0408194efad2a9999436ce9bc..e757de8ba0c6357275883f4c2bae51d61b98718a 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -111,6 +111,8 @@ viz_component("service") {
@@ -455,10 +455,10 @@ index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c0
waiting_on_draw_ack_ = true;
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
index ffb3a04236be821e7ba1c7370258eb0610497c8e..5fd16e51508dc3227798a7166226ff5d01dcd921 100644
index 0e1b4bf9d45582dcfa8882b73e4cd239baa0b1f1..645b4359f49e931f769d6ea7e3be98e8a70dd3f0 100644
--- a/content/browser/compositor/viz_process_transport_factory.cc
+++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -404,8 +404,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
@@ -403,8 +403,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
compositor_data.display_private.reset();
root_params->display_private =
compositor_data.display_private.BindNewEndpointAndPassReceiver();
@@ -527,10 +527,10 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
+ Draw(gfx.mojom.Rect damage_rect) => ();
};
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf64172d30ad8c 100644
index e47736aae80be8433fdb5afd4678efde1a60e6d4..de0560a32863d2bd5089aadcfd74202a6fe2b560 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -73,6 +73,7 @@ class DisplayPrivate;
@@ -74,6 +74,7 @@ class DisplayPrivate;
class ExternalBeginFrameController;
} // namespace mojom
class ContextProvider;
@@ -538,7 +538,7 @@ index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf6417
class HostFrameSinkManager;
class LocalSurfaceIdAllocation;
class RasterContextProvider;
@@ -126,6 +127,15 @@ class COMPOSITOR_EXPORT ContextFactory {
@@ -127,6 +128,15 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
};
@@ -554,7 +554,7 @@ index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf6417
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -160,6 +170,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
@@ -161,6 +171,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@@ -564,7 +564,7 @@ index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf6417
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -409,6 +422,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
@@ -419,6 +432,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;

View File

@@ -10,10 +10,10 @@ understanding, it seems like we slightly misuse the print preview API
and this is fallout from using it in a way the code doesn't expect.
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 5d829b6ef0c02d0f230c9581377fe3b5941d9b42..776ca12f4509d317ff10461efbad8b7a09bd3afd 100644
index e566b1d22a5bb0aa40f15db83f1dc89e9099f62c..8e8663d561d3ee1956ba5e980c23172bf784d080 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -1475,6 +1475,7 @@ PrintRenderFrameHelper::CreatePreviewDocument() {
@@ -1494,6 +1494,7 @@ PrintRenderFrameHelper::CreatePreviewDocument() {
const std::vector<int>& pages = print_pages_params_->pages;
bool require_document_metafile =

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Fri, 29 May 2020 02:12:56 -0700
Subject: fix: default to NTLM v2 in network service
Backports https://chromium-review.googlesource.com/c/chromium/src/+/2222116
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom
index 565d98ad87ca9c8f2fc5325ad25cbf18f500f36e..072d24087e1f1bed867788c068b651658ad6ce4e 100644
--- a/services/network/public/mojom/network_service.mojom
+++ b/services/network/public/mojom/network_service.mojom
@@ -152,7 +152,7 @@ struct HttpAuthDynamicParams {
bool enable_negotiate_port = true;
// Whether NTLM V2 is enabled on POSIX platforms. No effect elsewhere.
- bool ntlm_v2_enabled = false;
+ bool ntlm_v2_enabled = true;
// The AccountManager AccountManagerget.AccountsByTypeAndFeatures on Android
// when using Negotiate authentication.

View File

@@ -7,7 +7,7 @@ Subject:
Disable usage of pthread_fchdir_np and pthread_chdir_np in MAS builds.
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
index 62ffd51c4dd3166d6adbda24e6ee47805a69c93b..398290ffe8dd2d8d2ab13a6877a1932722968255 100644
index 6fc6ba115fb68072c1946d99710ea0a2c6233ecf..c4d31ee43ebac512f2de98e6a0d88d59bacd992d 100644
--- a/base/process/launch_mac.cc
+++ b/base/process/launch_mac.cc
@@ -26,8 +26,10 @@ extern "C" {
@@ -21,7 +21,7 @@ index 62ffd51c4dd3166d6adbda24e6ee47805a69c93b..398290ffe8dd2d8d2ab13a6877a19327
int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim)
API_AVAILABLE(macosx(10.14));
@@ -98,21 +100,29 @@ class PosixSpawnFileActions {
@@ -102,21 +104,29 @@ class PosixSpawnFileActions {
};
int ChangeCurrentThreadDirectory(const char* path) {
@@ -51,7 +51,7 @@ index 62ffd51c4dd3166d6adbda24e6ee47805a69c93b..398290ffe8dd2d8d2ab13a6877a19327
}
struct GetAppOutputOptions {
@@ -228,11 +238,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
@@ -232,11 +242,13 @@ Process LaunchProcess(const std::vector<std::string>& argv,
file_actions.Inherit(STDERR_FILENO);
}

View File

@@ -1,147 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 4 Oct 2018 14:57:02 -0700
Subject: Make sure hunspell file is not destroyed in UI thread
Submitted to Chromium at:
https://chromium-review.googlesource.com/c/chromium/src/+/2206199/1
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index 653ef44ff095015ef25cc59bf42f9fbd9d907160..d6f9bf8e0d2cf2e52698d4d132361a5d7118d00c 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -93,21 +93,28 @@ bool SaveDictionaryData(std::unique_ptr<std::string> data,
} // namespace
-SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile() {
-}
+SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile(
+ base::TaskRunner* task_runner) : task_runner_(task_runner) {}
SpellcheckHunspellDictionary::DictionaryFile::~DictionaryFile() {
+ if (file.IsValid()) {
+ task_runner_->PostTask(FROM_HERE,
+ base::BindOnce(&CloseDictionary, std::move(file)));
+ }
}
SpellcheckHunspellDictionary::DictionaryFile::DictionaryFile(
DictionaryFile&& other)
- : path(other.path), file(std::move(other.file)) {}
+ : path(other.path),
+ file(std::move(other.file)),
+ task_runner_(std::move(other.task_runner_)) {}
SpellcheckHunspellDictionary::DictionaryFile&
SpellcheckHunspellDictionary::DictionaryFile::operator=(
DictionaryFile&& other) {
path = other.path;
file = std::move(other.file);
+ task_runner_ = std::move(other.task_runner_);
return *this;
}
@@ -121,15 +128,10 @@ SpellcheckHunspellDictionary::SpellcheckHunspellDictionary(
use_browser_spellchecker_(false),
browser_context_(browser_context),
spellcheck_service_(spellcheck_service),
- download_status_(DOWNLOAD_NONE) {}
+ download_status_(DOWNLOAD_NONE),
+ dictionary_file_(task_runner_.get()) {}
SpellcheckHunspellDictionary::~SpellcheckHunspellDictionary() {
- if (dictionary_file_.file.IsValid()) {
- task_runner_->PostTask(
- FROM_HERE,
- base::BindOnce(&CloseDictionary, std::move(dictionary_file_.file)));
- }
-
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
// Disable the language from platform spellchecker.
if (spellcheck::UseBrowserSpellChecker())
@@ -324,7 +326,8 @@ void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
#if !defined(OS_ANDROID)
// static
SpellcheckHunspellDictionary::DictionaryFile
-SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
+SpellcheckHunspellDictionary::OpenDictionaryFile(base::TaskRunner* task_runner,
+ const base::FilePath& path) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
@@ -335,7 +338,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
// For systemwide installations on Windows, the default directory may not
// have permissions for download. In that case, the alternate directory for
// download is chrome::DIR_USER_DATA.
- DictionaryFile dictionary;
+ DictionaryFile dictionary(task_runner);
#if defined(OS_WIN)
// Check if the dictionary exists in the fallback location. If so, use it
@@ -377,7 +380,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
// static
SpellcheckHunspellDictionary::DictionaryFile
SpellcheckHunspellDictionary::InitializeDictionaryLocation(
- const std::string& language) {
+ base::TaskRunner* task_runner, const std::string& language) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);
@@ -392,7 +395,7 @@ SpellcheckHunspellDictionary::InitializeDictionaryLocation(
base::FilePath dict_path =
spellcheck::GetVersionedFileName(language, dict_dir);
- return OpenDictionaryFile(dict_path);
+ return OpenDictionaryFile(task_runner, dict_path);
}
void SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete(
@@ -481,7 +484,8 @@ void SpellcheckHunspellDictionary::PlatformSupportsLanguageComplete(
#if !defined(OS_ANDROID) && BUILDFLAG(USE_RENDERER_SPELLCHECKER)
base::PostTaskAndReplyWithResult(
task_runner_.get(), FROM_HERE,
- base::BindOnce(&InitializeDictionaryLocation, language_),
+ base::BindOnce(&InitializeDictionaryLocation,
+ base::RetainedRef(task_runner_.get()), language_),
base::BindOnce(
&SpellcheckHunspellDictionary::InitializeDictionaryLocationComplete,
weak_ptr_factory_.GetWeakPtr()));
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index 4662bdc08b54304a7f8b2995f60fea9dc5617fff..7679f526c05980889adb2f6a8a0c20dd7f5415c3 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -99,7 +99,7 @@ class SpellcheckHunspellDictionary
// blocking sequence.
struct DictionaryFile {
public:
- DictionaryFile();
+ explicit DictionaryFile(base::TaskRunner* task_runner);
~DictionaryFile();
DictionaryFile(DictionaryFile&& other);
@@ -112,6 +112,9 @@ class SpellcheckHunspellDictionary
base::File file;
private:
+ // Task runner where the file is created.
+ scoped_refptr<base::TaskRunner> task_runner_;
+
DISALLOW_COPY_AND_ASSIGN(DictionaryFile);
};
@@ -126,11 +129,12 @@ class SpellcheckHunspellDictionary
#if !defined(OS_ANDROID)
// Figures out the location for the dictionary, verifies its contents, and
// opens it.
- static DictionaryFile OpenDictionaryFile(const base::FilePath& path);
+ static DictionaryFile OpenDictionaryFile(base::TaskRunner* task_runner,
+ const base::FilePath& path);
// Gets the default location for the dictionary file.
static DictionaryFile InitializeDictionaryLocation(
- const std::string& language);
+ base::TaskRunner* task_runner, const std::string& language);
// The reply point for PostTaskAndReplyWithResult, called after the dictionary
// file has been initialized.

View File

@@ -13,10 +13,10 @@ This patch can be removed once app.allowRendererProcessReuse is forced
to true as then Chromiums assumptions around processes become correct.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6a18c7085f102d475bd36925106e86c56812accc..bcd52490b3ea333c521cf0ab63206a66889cf939 100644
index e282718ec461f6c7bcb1fe36d5bb73359f04a30a..725e9f890bf5479d4435b9e7366b8fe2a10e0919 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2365,11 +2365,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
@@ -2385,11 +2385,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
WebContentsImpl* outermost = GetOutermostWebContents();
if (event.button == blink::WebPointerProperties::Button::kBack &&
outermost->controller_.CanGoBack()) {

View File

@@ -0,0 +1,79 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Wed, 20 May 2020 13:48:51 -0700
Subject: fix: swap global proxies before initializing the windows proxies
Electron's Context Isolation implementation has a side-effect of initializing
the isolated worlds WindowProxy during the initialization of the main world
WindowProxy as a result of creating the isolated world inside the DidCreateScriptContext
hook. This results in an assertion failing in Chromium during a frame
swap where it expects to be able to set a new global_proxy in the WindowProxy
of the isolated world BEFORE it is initialized.
To meet this assumption this patch splits SetGlobalProxy into two calls,
SetGlobalProxyWithoutInitializing and InitializeIfNeeded which has the same
resultant effect but means that all of the global_proxy objects are set
BEFORE any WindowProxy's are initialized.
This could probably be upstreamed as it doesn't affect the way Chromium works
but also it has no benefit for them at this time.
diff --git a/third_party/blink/renderer/bindings/core/v8/window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/window_proxy.cc
index 3139b74a464888159cbb6b93f15e54b578986f92..784f3b31e1258ff29e01f556a0d37f45ddc9b117 100644
--- a/third_party/blink/renderer/bindings/core/v8/window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/window_proxy.cc
@@ -104,10 +104,7 @@ v8::Local<v8::Object> WindowProxy::ReleaseGlobalProxy() {
}
void WindowProxy::SetGlobalProxy(v8::Local<v8::Object> global_proxy) {
- DCHECK_EQ(lifecycle_, Lifecycle::kContextIsUninitialized);
-
- CHECK(global_proxy_.IsEmpty());
- global_proxy_.Set(isolate_, global_proxy);
+ SetGlobalProxyWithoutInitializing(global_proxy);
// Initialize the window proxy now, to re-establish the connection between
// the global object and the v8::Context. This is really only needed for a
@@ -118,6 +115,13 @@ void WindowProxy::SetGlobalProxy(v8::Local<v8::Object> global_proxy) {
Initialize();
}
+void WindowProxy::SetGlobalProxyWithoutInitializing(v8::Local<v8::Object> global_proxy) {
+ DCHECK_EQ(lifecycle_, Lifecycle::kContextIsUninitialized);
+
+ CHECK(global_proxy_.IsEmpty());
+ global_proxy_.Set(isolate_, global_proxy);
+}
+
// Create a new environment and setup the global object.
//
// The global object corresponds to a DOMWindow instance. However, to
diff --git a/third_party/blink/renderer/bindings/core/v8/window_proxy.h b/third_party/blink/renderer/bindings/core/v8/window_proxy.h
index 33d85e22813ee15ced7e8c41d1bc070c8dbbdd26..d9ff55f67ffa4208a6fa342ed24cd6e1a3af145e 100644
--- a/third_party/blink/renderer/bindings/core/v8/window_proxy.h
+++ b/third_party/blink/renderer/bindings/core/v8/window_proxy.h
@@ -156,6 +156,7 @@ class WindowProxy : public GarbageCollected<WindowProxy> {
CORE_EXPORT v8::Local<v8::Object> GlobalProxyIfNotDetached();
v8::Local<v8::Object> ReleaseGlobalProxy();
void SetGlobalProxy(v8::Local<v8::Object>);
+ void SetGlobalProxyWithoutInitializing(v8::Local<v8::Object>);
// TODO(dcheng): Temporarily exposed to avoid include cycles. Remove the need
// for this and remove this getter.
diff --git a/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc b/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc
index b302d33b3dfe211cacf4f3b842a5c52baa2788d1..f95018422eb8c9948f33687b0aaabcf3f003949e 100644
--- a/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc
+++ b/third_party/blink/renderer/bindings/core/v8/window_proxy_manager.cc
@@ -55,8 +55,11 @@ void WindowProxyManager::ReleaseGlobalProxies(
void WindowProxyManager::SetGlobalProxies(
const GlobalProxyVector& global_proxies) {
+ for (const auto& entry : global_proxies) {
+ WindowProxyMaybeUninitialized(*entry.first)->SetGlobalProxyWithoutInitializing(entry.second);
+ }
for (const auto& entry : global_proxies)
- WindowProxyMaybeUninitialized(*entry.first)->SetGlobalProxy(entry.second);
+ WindowProxyMaybeUninitialized(*entry.first)->InitializeIfNeeded();
}
WindowProxyManager::WindowProxyManager(Frame& frame, FrameType frame_type)

View File

@@ -22,11 +22,11 @@ index befe726af9c10b1563a7fc0bb77cc55f65943d5c..bac51f33f35f96fe4ecc764cf5ca8871
}
}
diff --git a/ui/base/accelerators/media_keys_listener.h b/ui/base/accelerators/media_keys_listener.h
index 997718d8affaa193fcaabff4cd4c8b0c23df8891..e121598d46e7c62a3b14cb7960136f655cc69ab6 100644
index 6787fa39da18ec26c215e4cbe0b3f69093323f8c..ec10c46cde437a935edfdf79e5ba9622c6ba1d67 100644
--- a/ui/base/accelerators/media_keys_listener.h
+++ b/ui/base/accelerators/media_keys_listener.h
@@ -20,8 +20,9 @@ class Accelerator;
class UI_BASE_EXPORT MediaKeysListener {
class COMPONENT_EXPORT(UI_BASE) MediaKeysListener {
public:
enum class Scope {
- kGlobal, // Listener works whenever application in focus or not.

View File

@@ -10,10 +10,10 @@ Should be removed once grit is fixed.
Tracking bug: https://crbug.com/1040605
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 1c5366d3096ff2616778b67f690521ddd3472030..96b96d23bb88f2c90265461b0ae11e276df1c644 100644
index ef7bf4b6997f9d655561c9031c0ad9af417fa22a..a2c4fdea9eea491147462521aee5b0eb974da381 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -594,15 +594,16 @@
@@ -601,15 +601,16 @@
"includes": [3840],
},

View File

@@ -8,7 +8,7 @@ and respond with custom instance. Also allows for us to at-runtime
enable or disable this patch.
diff --git a/content/browser/browsing_instance.cc b/content/browser/browsing_instance.cc
index f49ec7e1456751e506609a797f0b3b97b3e86a56..c7198c08d9292981d6fba12d5941f606c03b5d35 100644
index 8da8fc97f141159811e24b51ee9bdd6be045d726..e756441aa7a871934be72be67f35351316b59245 100644
--- a/content/browser/browsing_instance.cc
+++ b/content/browser/browsing_instance.cc
@@ -84,6 +84,13 @@ scoped_refptr<SiteInstanceImpl> BrowsingInstance::GetSiteInstanceForURL(
@@ -26,7 +26,7 @@ index f49ec7e1456751e506609a797f0b3b97b3e86a56..c7198c08d9292981d6fba12d5941f606
bool allow_default_instance,
GURL* site_url,
diff --git a/content/browser/browsing_instance.h b/content/browser/browsing_instance.h
index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c24798e204 100644
index 06f0961e122f326e41610dd7a1b32fa752f0c68f..a041189f79cea5b59e1792b79c1348e316ca3f1e 100644
--- a/content/browser/browsing_instance.h
+++ b/content/browser/browsing_instance.h
@@ -136,6 +136,11 @@ class CONTENT_EXPORT BrowsingInstance final
@@ -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 26fd7bdfb902508922b9a4c5f9f42ae9182356d4..fcd4f21f54066057a48b7b34657177fb28a80cf5 100644
index fa3ed4e33b4fbe274738442f22e07ba233056ce8..e8e4eb7963b443b95e98a173df497d1662f9226b 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -1284,6 +1284,24 @@ void NavigationRequest::BeginNavigation() {
@@ -1278,6 +1278,24 @@ void NavigationRequest::BeginNavigation() {
// it immediately.
EnterChildTraceEvent("ResponseStarted", this);
@@ -71,10 +71,10 @@ index 26fd7bdfb902508922b9a4c5f9f42ae9182356d4..fcd4f21f54066057a48b7b34657177fb
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 0feececd533b3e53b8dcfd36caf0f41fbd595fd2..b1e983078c3693c45ff30075e38f0ccef93206f3 100644
index 829a14c0cc306fa74c80b7c123ddaa309c0c18c9..49a47e1f8d1fc4161684a13b6fdaceb6762234ad 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2391,6 +2391,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -2464,6 +2464,16 @@ bool RenderFrameHostManager::InitRenderView(
scoped_refptr<SiteInstance>
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
NavigationRequest* request) {
@@ -91,7 +91,7 @@ index 0feececd533b3e53b8dcfd36caf0f41fbd595fd2..b1e983078c3693c45ff30075e38f0cce
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
// All children of MHTML documents must be MHTML documents. They all live in
@@ -2410,10 +2420,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2483,10 +2493,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 0feececd533b3e53b8dcfd36caf0f41fbd595fd2..b1e983078c3693c45ff30075e38f0cce
// Account for renderer-initiated reload as well.
// Needed as a workaround for https://crbug.com/1045524, remove it when it is
@@ -2456,6 +2516,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2551,6 +2611,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->ResetStateForSiteInstanceChange();
}
@@ -167,7 +167,7 @@ index 0feececd533b3e53b8dcfd36caf0f41fbd595fd2..b1e983078c3693c45ff30075e38f0cce
}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index f0d1e2915e89c05bb4b0f71f169b1fcdd812b004..cfb668b9250e48048d6959910c9f44c1e765d86b 100644
index e17d9239c65aac5d0038a2162405b9f8525603ba..44361c84ff6bdee12908d518a84ec773c067d614 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -456,6 +456,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
@@ -182,7 +182,7 @@ index f0d1e2915e89c05bb4b0f71f169b1fcdd812b004..cfb668b9250e48048d6959910c9f44c1
const GURL& url) {
return browsing_instance_->GetSiteInstanceForURL(
diff --git a/content/browser/site_instance_impl.h b/content/browser/site_instance_impl.h
index 85288dac0acfb51330669cd87cfc0343af3dfd2c..3bb39459fd3c87a0968044e02d684f6b777935bb 100644
index 10dd6f03af22bd7d0f7b65a58d4a58430c129b49..88504adb27e6461648f7dce48c93e2e1a7004fb8 100644
--- a/content/browser/site_instance_impl.h
+++ b/content/browser/site_instance_impl.h
@@ -98,6 +98,7 @@ class CONTENT_EXPORT SiteInstanceImpl final : public SiteInstance,
@@ -194,10 +194,10 @@ index 85288dac0acfb51330669cd87cfc0343af3dfd2c..3bb39459fd3c87a0968044e02d684f6b
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 c9fc489ded15dc3cfcdd71c86707e6e86a7e6ba3..96f7423b78c16b119b761b47c317d8c326a1868d 100644
index 8f36f7277a59d297a0700d1dfd5d8120f6a0ffa1..4858b868972c02f580789a6e396fd5db52154bad 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -57,6 +57,21 @@
@@ -59,6 +59,21 @@
namespace content {
@@ -220,10 +220,10 @@ index c9fc489ded15dc3cfcdd71c86707e6e86a7e6ba3..96f7423b78c16b119b761b47c317d8c3
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 2d8d316f948fbc25fd4b1aa899b38ba2607e24a1..6a9d69ee79eafe531bd974e3648e107a4c6de1e1 100644
index 463fcc56d05a2e18c1d3752b5e7e275c8797eca8..df1e5d1ed6e9e40ac14f1aef289801b6d63fa78d 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -234,8 +234,45 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -236,8 +236,45 @@ class CONTENT_EXPORT ContentBrowserClient {
using IsClipboardPasteAllowedCallback =
base::OnceCallback<void(ClipboardPasteAllowed)>;
@@ -270,7 +270,7 @@ index 2d8d316f948fbc25fd4b1aa899b38ba2607e24a1..6a9d69ee79eafe531bd974e3648e107a
// 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 0a5aec6455a9337f806a9376d83935b60891109b..b57294b1e19ce7a96aae05c23ab42190f35ae780 100644
index 82b5d4c25adc7071dfcfe56047520fa2fa7b72f2..8535ed4ab3ca5a90f3de7ab9e80159b2082e7dfa 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

@@ -7,7 +7,7 @@ We don't use gin to create the V8 platform, because we need to inject Node
things.
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index ee74e6ea92c64d0e95a4988557b236667f5b7e42..c3ae4c6221686479d05800c51d17d581c095e397 100644
index 570a23af3c0fb4839b063c742d1d345a27799cd0..ece381bb1ce22bc65c3d8e428354adeb4b6fe4c1 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -103,9 +103,10 @@ IsolateHolder::~IsolateHolder() {
@@ -38,10 +38,10 @@ index f23af2d9738f3aa76e3a49301e1c3216ee4a64b4..ede178acabc63c3c33d6ce93efd5632b
v8::Isolate* isolate() { return isolate_; }
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index 2e2e3464a3760c39471b6897eee2b337f611cce0..d6effe50b5213b308cf59cd1c8cc7f1a62225763 100644
index 517283e2f1886408ee5ad935e3bafecb9728ca94..e7224adc9f4def27a370bcca8effd7bccc01ab02 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -190,12 +190,14 @@ enum LoadV8FileResult {
@@ -191,12 +191,14 @@ enum LoadV8FileResult {
} // namespace
// static

View File

@@ -40,10 +40,10 @@ index ce8f9551f1b17c7508a0e0bd0ecc55eca2c0ac6e..2e71ce71ff9f18e2fc68f51ddbeedc39
// Update the GPU feature info. This updates the blacklist and enabled status
// of GPU rasterization. In the future this will be used for more features.
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index b09b8ffe7684f511e971d0c470c8b67a46288b6e..f41734cc66d7ee71509a66effec76be3797b00d6 100644
index f65d5d0eb7d10ec6887fc156d23ab948e10c1bc3..0e34fb12f6e08039fb541890ee869c1ad1e08948 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -923,6 +923,10 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
@@ -922,6 +922,10 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
host->ForceShutdown();
}

View File

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 4c358d9c9ee67fa1fed8144d894c9c51062a76e7..1c5366d3096ff2616778b67f690521ddd3472030 100644
index 1c7546fde012170f43c75e9863b3e9a402f860c9..ef7bf4b6997f9d655561c9031c0ad9af417fa22a 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -600,6 +600,11 @@
@@ -607,6 +607,11 @@
"includes": [3860],
},

View File

@@ -8,13 +8,13 @@ require a largeish patch to get working, so just redirect it to our
implementation instead.
diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
index 447dfa6f021ccba87d757f535f566fa3327aa7cd..090ea06708609f18750025b7895d6d97239f7fec 100644
index a692d5e33cfdad762eb0c59c6e14fab2675c603b..121424e9523a7977be64cbcd5b99ccb2947dff7e 100644
--- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
+++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
@@ -8,8 +8,8 @@
@@ -9,8 +9,8 @@
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/guid.h"
#include "base/task/post_task.h"
-#include "chrome/browser/extensions/api/streams_private/streams_private_api.h"
-#include "chrome/browser/plugins/plugin_utils.h"
+#include "electron/shell/browser/extensions/api/streams_private/streams_private_api.h"

View File

@@ -8,7 +8,7 @@ needs to register on an isolate so that it can be used later
down in the initialization process of an isolate.
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index c3ae4c6221686479d05800c51d17d581c095e397..e4c8a194418dc62f0e0222c08fe9ad39a4b9b9af 100644
index ece381bb1ce22bc65c3d8e428354adeb4b6fe4c1..161788e0ba5b12dff34d71ff9e84c71615d93a58 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -53,7 +53,8 @@ IsolateHolder::IsolateHolder(

View File

@@ -6,18 +6,23 @@ Subject: mas-cfisobjc.patch
Removes usage of the _CFIsObjC private API.
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index 2a83d4d8158422c1056725679309c6ced1e531bd..f52934712f8de78193127c426d02982b36e9d422 100644
index f37884f6f70e230555e1e0eb7585e108fd8015d6..4c7726c2cb1afbfd43518159d126a58fa1515c1e 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -27,7 +27,6 @@ CFTypeID SecKeyGetTypeID();
@@ -27,12 +27,6 @@ CFTypeID SecKeyGetTypeID();
#if !defined(OS_IOS)
CFTypeID SecACLGetTypeID();
CFTypeID SecTrustedApplicationGetTypeID();
-// The NSFont/CTFont toll-free bridging is broken before 10.15.
-// http://www.openradar.me/15341349 rdar://15341349
-//
-// TODO(https://crbug.com/1076527): This is fixed in 10.15. When 10.15 is the
-// minimum OS for Chromium, remove this SPI declaration.
-Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
#endif
} // extern "C"
@@ -316,8 +315,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
@@ -325,8 +319,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
const_cast<NSFont*>(reinterpret_cast<const NSFont*>(cf_val));
DCHECK(!cf_val ||
CTFontGetTypeID() == CFGetTypeID(cf_val) ||
@@ -27,7 +32,7 @@ index 2a83d4d8158422c1056725679309c6ced1e531bd..f52934712f8de78193127c426d02982b
return ns_val;
}
@@ -385,9 +383,6 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
@@ -397,9 +390,6 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
return (CTFontRef)(cf_val);
}

View File

@@ -6,10 +6,10 @@ Subject: mas-cgdisplayusesforcetogray.patch
Removes usage of the CGDisplayUsesForceToGray private API.
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 0d64613458b5da1211b8d2f8ec3088e19af0c10d..60b0680953647b410a2a7998544689ec2bf73c47 100644
index a4e374dd3552288ebead42c6c1e30e593496bafd..844f4c74d246b0008c270dc9721d15e9e0ebf0a5 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -133,7 +133,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
@@ -131,7 +131,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
display.set_color_depth(Display::kDefaultBitsPerPixel);
display.set_depth_per_component(Display::kDefaultBitsPerComponent);
}

View File

@@ -95,10 +95,10 @@ index e03bbc724cfd01967e71998394361556df1c4915..783745b11365c04c1e1052197d20d494
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
// can only be accomplished by overriding methods.
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
index c10c6633e7bc61cdc3ee41fc018786731177a948..09cc91eaab41e82165d550313579c9e1c8a8f158 100644
index 757c72d98de11f611309f4f5af8d0d9aab639181..a6319a0760308df6bac6b39ad3500ad77c1b6525 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -14,7 +14,9 @@
@@ -16,7 +16,9 @@
#import "ui/base/cocoa/window_size_constants.h"
@interface NSWindow (Private)
@@ -108,7 +108,7 @@ index c10c6633e7bc61cdc3ee41fc018786731177a948..09cc91eaab41e82165d550313579c9e1
- (BOOL)hasKeyAppearance;
- (long long)_resizeDirectionForMouseLocation:(CGPoint)location;
- (BOOL)_isConsideredOpenForPersistentState;
@@ -56,6 +58,8 @@
@@ -58,6 +60,8 @@
}
@end
@@ -116,8 +116,8 @@ index c10c6633e7bc61cdc3ee41fc018786731177a948..09cc91eaab41e82165d550313579c9e1
+
@implementation NativeWidgetMacNSWindowTitledFrame
- (void)mouseDown:(NSEvent*)event {
if (self.window.isMovable)
@@ -82,6 +86,8 @@
if (base::mac::IsAtMostOS10_11() && self.window.isMovable)
@@ -84,6 +88,8 @@
}
@end
@@ -126,7 +126,7 @@ index c10c6633e7bc61cdc3ee41fc018786731177a948..09cc91eaab41e82165d550313579c9e1
@implementation NativeWidgetMacNSWindow {
@private
base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
@@ -163,6 +169,8 @@
@@ -165,6 +171,8 @@
// NSWindow overrides.
@@ -135,7 +135,7 @@ index c10c6633e7bc61cdc3ee41fc018786731177a948..09cc91eaab41e82165d550313579c9e1
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
if (windowStyle & NSWindowStyleMaskTitled) {
if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
@@ -174,6 +182,8 @@
@@ -176,6 +184,8 @@
return [super frameViewClassForStyleMask:windowStyle];
}

View File

@@ -64,10 +64,10 @@ index 2ee45cb069ec5d78d9c7a3f61fdd1d444a590f41..badc4323b910f8e3957583e05af30347
// 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 82696053ce7cd1d47c9034899a76555af716f4ba..0ed7a32fa839b449aaacc2338f59f6ff17814891 100644
index c3a9fbf0f9d2b80c1de42a22ad094a286f0b559b..02493d4b62c98a3aebd3e460c459218a4dc4ea8e 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 @@ class RenderWidgetHostNSViewBridgeOwner
@@ -70,8 +70,10 @@ class RenderWidgetHostNSViewBridgeOwner
return nil;
}
void SetAccessibilityWindow(NSWindow* window) override {
@@ -78,7 +78,7 @@ index 82696053ce7cd1d47c9034899a76555af716f4ba..0ed7a32fa839b449aaacc2338f59f6ff
}
void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
@@ -126,8 +128,10 @@ class RenderWidgetHostNSViewBridgeOwner
@@ -133,8 +135,10 @@ class RenderWidgetHostNSViewBridgeOwner
mojo::AssociatedRemote<mojom::RenderWidgetHostNSViewHost> host_;
std::unique_ptr<RenderWidgetHostNSViewBridge> bridge_;
@@ -90,7 +90,7 @@ index 82696053ce7cd1d47c9034899a76555af716f4ba..0ed7a32fa839b449aaacc2338f59f6ff
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 c610426ad9b91505da7b529015fc19a27d5ee170..2858e299ab9788a17e006c1093f01803c223fb1b 100644
index ae33d10a25b1c3effdee4d308cb2b1ff5881fa79..8098362ccea0ce0739c2b5c9d30413047a9cd8ed 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;
@@ -103,7 +103,7 @@ index c610426ad9b91505da7b529015fc19a27d5ee170..2858e299ab9788a17e006c1093f01803
@class RenderWidgetHostViewCocoa;
namespace content {
@@ -619,10 +621,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
@@ -627,10 +629,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// EnsureSurfaceSynchronizedForWebTest().
uint32_t latest_capture_sequence_number_ = 0u;
@@ -117,7 +117,7 @@ index c610426ad9b91505da7b529015fc19a27d5ee170..2858e299ab9788a17e006c1093f01803
// 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 c56fb05c579f3c95a132ee00a2ed83bf2cb85268..385b0dbeb7cbfb31ad0726051dc2e8fb4d7b16b2 100644
index c0a8c7b7c3e4e0d9038ab08f63a8a5aaefd96122..1cf61e86d97c5735836d7d0211b179300b46b454 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 @@ RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
@@ -170,10 +170,10 @@ index c56fb05c579f3c95a132ee00a2ed83bf2cb85268..385b0dbeb7cbfb31ad0726051dc2e8fb
///////////////////////////////////////////////////////////////////////////////
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index a4c47479dd8a39f467e5ea8ed3e2bb934e911973..46047665d20233d22b0c8c451a1ce375dcb2567e 100644
index bc47a9182e1f8d0e9442e6f648144bb0550002ed..798f77824bd5ddd375c7c62038adbb6b672eb1ea 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -305,6 +305,13 @@ jumbo_component("base") {
@@ -309,6 +309,13 @@ jumbo_component("base") {
]
}
@@ -188,19 +188,19 @@ index a4c47479dd8a39f467e5ea8ed3e2bb934e911973..46047665d20233d22b0c8c451a1ce375
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
index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4bed139a27 100644
--- a/ui/base/cocoa/remote_accessibility_api.h
+++ b/ui/base/cocoa/remote_accessibility_api.h
@@ -11,6 +11,8 @@
#include "base/component_export.h"
#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 {
@@ -32,4 +34,6 @@ class COMPONENT_EXPORT(UI_BASE) RemoteAccessibility {
} // namespace ui

View File

@@ -17,7 +17,7 @@ cases where performance improves when disabling remote CoreAnimation (remote
CoreAnimation is really only about battery usage).
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
index a298747e3b755acd4f8d366d625142371ed1995e..9c9bdc53016637c6d6dbb27f3581b343ec96fb97 100644
index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e2c26ceb6 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
@@ -20,7 +20,9 @@
@@ -30,7 +30,7 @@ index a298747e3b755acd4f8d366d625142371ed1995e..9c9bdc53016637c6d6dbb27f3581b343
@class CALayer;
namespace ui {
@@ -97,7 +99,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
@@ -111,7 +113,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
bool use_remote_layer_api_;
@@ -41,7 +41,7 @@ index a298747e3b755acd4f8d366d625142371ed1995e..9c9bdc53016637c6d6dbb27f3581b343
gfx::Size pixel_size_;
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index eb46993b8f40fdc7da35dae1b850dad637f6b47d..05a9ae47620d17b5a53f991c0b3a0a5c153b599c 100644
index 7c97709a8dfe55fb91b5bdae3f7a83d8bdf93f1b..77d930293ff0b552a504464898ed809067b2cac0 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -63,6 +63,7 @@ ImageTransportSurfaceOverlayMacBase<
@@ -60,7 +60,7 @@ index eb46993b8f40fdc7da35dae1b850dad637f6b47d..05a9ae47620d17b5a53f991c0b3a0a5c
return true;
}
@@ -139,7 +141,9 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::SwapBuffersInternal(
@@ -140,7 +142,9 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::SwapBuffersInternal(
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
"width", pixel_size_.width());
if (use_remote_layer_api_) {
@@ -93,12 +93,12 @@ index 38f25d6314f653d7138d30c67c5ae49963863327..f2fda251ed975bd848a49b33830d329f
void DisplayCALayerTree::GotIOSurfaceFrame(
diff --git a/ui/base/cocoa/remote_layer_api.h b/ui/base/cocoa/remote_layer_api.h
index 2057fe69d1bb4a2eb0b1dabc5473a30d676847fe..2aba330fc488660ef874caae26a06e6847cdaf93 100644
index d684614589c9e55965450d712ee6dc0deef6aade..e0446753a3d972215423c079160fe8bfd2f9c3be 100644
--- a/ui/base/cocoa/remote_layer_api.h
+++ b/ui/base/cocoa/remote_layer_api.h
@@ -13,6 +13,7 @@
#include "ui/base/ui_base_export.h"
#include "base/component_export.h"
+#ifndef MAS_BUILD
// The CGSConnectionID is used to create the CAContext in the process that is

View File

@@ -50,7 +50,7 @@ index 5124b17f020849671a7f03d92bda052eff84d169..f9730f71c122965f7ce7815a1b9a7b32
// 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 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c4842a0bbc2c 100644
index a35b6dae73540518443a4b4d5745178e248c64f0..38ca03b2365e0d3a2c15abda6fb05256851deb57 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -206,6 +206,7 @@ NSString* const
@@ -124,7 +124,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
{NSAccessibilitySizeAttribute, @"size"},
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
{NSAccessibilitySubroleAttribute, @"subrole"},
@@ -1295,6 +1307,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1290,6 +1302,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
ax::mojom::Restriction::kDisabled];
}
@@ -132,7 +132,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
// Returns a text marker that points to the last character in the document that
// can be selected with VoiceOver.
- (id)endTextMarker {
@@ -1305,6 +1318,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1300,6 +1313,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
}
@@ -140,7 +140,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
- (NSNumber*)expanded {
if (![self instanceActive])
@@ -1454,6 +1468,8 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1449,6 +1463,8 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return nil;
}
@@ -149,7 +149,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
- (NSNumber*)insertionPointLineNumber {
if (![self instanceActive])
return nil;
@@ -1476,6 +1492,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -1471,6 +1487,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
caretPosition->AsTextPosition()->text_offset());
return @(std::distance(lineBreaks.begin(), iterator));
}
@@ -157,7 +157,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
// Returns whether or not this node should be ignored in the
// accessibility tree.
@@ -2153,6 +2170,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2147,6 +2164,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return ret;
}
@@ -165,7 +165,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
- (NSString*)selectedText {
if (![self instanceActive])
return nil;
@@ -2164,11 +2182,13 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2158,11 +2176,13 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return nil;
return base::SysUTF16ToNSString(range.GetText());
}
@@ -179,7 +179,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
- (NSValue*)selectedTextRange {
if (![self instanceActive])
return nil;
@@ -2189,12 +2209,15 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2183,12 +2203,15 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
int selLength = range.GetText().length();
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
}
@@ -195,7 +195,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
- (NSValue*)size {
if (![self instanceActive])
@@ -2227,6 +2250,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2221,6 +2244,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return nil;
}
@@ -203,7 +203,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
// Returns a text marker that points to the first character in the document that
// can be selected with VoiceOver.
- (id)startTextMarker {
@@ -2237,6 +2261,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2231,6 +2255,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
}
@@ -211,7 +211,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
// Returns a subrole based upon the role.
- (NSString*)subrole {
@@ -2562,11 +2587,13 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2553,11 +2578,13 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
NSMutableAttributedString* attributedInnerText =
[[[NSMutableAttributedString alloc]
initWithString:base::SysUTF16ToNSString(innerText)] autorelease];
@@ -225,7 +225,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
return [attributedInnerText attributedSubstringFromRange:range];
}
@@ -2670,9 +2697,8 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2661,9 +2688,8 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return ToBrowserAccessibilityCocoa(cell);
}
@@ -237,7 +237,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
BrowserAccessibilityPositionInstance position =
CreatePositionFromTextMarker(parameter);
if (!position->IsNullPosition())
@@ -2985,6 +3011,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -2976,6 +3002,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return CreateTextMarker(root->CreatePositionAt(index));
}
@@ -245,7 +245,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
if ([attribute isEqualToString:
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -3020,6 +3047,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -3011,6 +3038,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return nil;
}
@@ -253,7 +253,7 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
if ([attribute
isEqualToString:
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
@@ -3134,6 +3162,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
@@ -3125,6 +3153,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
return @(child->GetIndexInParent());
}
@@ -262,10 +262,10 @@ index 571c2519cce1c794aff380670d9d3eed1e341d96..e181d190006b2779a4c7f3271663c484
return nil;
}
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
index 9a9f6dea91cecc081010f4fd6c166921b7115a6e..c049bca40fb3b428361567b8ce3613ab7f347d67 100644
index 83d0106f0f237dea75dfafe011bf527d97240d0d..462577a0dbd0fcc1baf17acd9678317cb27503fa 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -526,6 +526,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
@@ -525,6 +525,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
[user_info setObject:native_focus_object
forKey:NSAccessibilityTextChangeElement];
@@ -273,7 +273,7 @@ index 9a9f6dea91cecc081010f4fd6c166921b7115a6e..c049bca40fb3b428361567b8ce3613ab
id selected_text = [native_focus_object selectedTextMarkerRange];
if (selected_text) {
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
@@ -533,6 +534,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
@@ -532,6 +533,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
[user_info setObject:selected_text
forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
}
@@ -282,7 +282,7 @@ index 9a9f6dea91cecc081010f4fd6c166921b7115a6e..c049bca40fb3b428361567b8ce3613ab
}
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
index e59ac93d0e1554a2df5d8c74db2beba25d090228..6657c48664bdec4964b382f80309d1bfd097a9e9 100644
index 28ca1646af0b0cce40d27baec71cbe65adc334fa..bae65c1f485bc02eb9ef2ebf7018af4a5a492397 100644
--- a/content/renderer/renderer_main_platform_delegate_mac.mm
+++ b/content/renderer/renderer_main_platform_delegate_mac.mm
@@ -10,9 +10,11 @@
@@ -314,7 +314,7 @@ index e59ac93d0e1554a2df5d8c74db2beba25d090228..6657c48664bdec4964b382f80309d1bf
} // namespace
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 7c018cce2c2d9981c94e91e5d97cff0d37548b13..cfb0fb20c81f908caac9933b820e40e03abf1e05 100644
index 0b2c4e6d169b08d82d2359576a29e2f7d2b09dcf..7b5fbbae1f9b2ade0c07360bd3fecda129a0c95b 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -35,6 +35,7 @@
@@ -333,7 +333,7 @@ index 7c018cce2c2d9981c94e91e5d97cff0d37548b13..cfb0fb20c81f908caac9933b820e40e0
namespace {
@@ -120,8 +122,10 @@ BluetoothAdapterMac::BluetoothAdapterMac()
@@ -117,8 +119,10 @@ BluetoothAdapterMac::BluetoothAdapterMac()
controller_state_function_(
base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
base::Unretained(this))),
@@ -344,7 +344,7 @@ index 7c018cce2c2d9981c94e91e5d97cff0d37548b13..cfb0fb20c81f908caac9933b820e40e0
should_update_name_(true),
classic_discovery_manager_(
BluetoothDiscoveryManagerMac::CreateClassic(this)),
@@ -306,8 +310,12 @@ base::WeakPtr<BluetoothAdapter> BluetoothAdapterMac::GetWeakPtr() {
@@ -303,8 +307,12 @@ base::WeakPtr<BluetoothAdapter> BluetoothAdapterMac::GetWeakPtr() {
}
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {
@@ -375,7 +375,7 @@ index 5acdb011a1f232569b43ba2f08a21f44b3c40151..9fca5b2e8c714308a404750cc9fc64dc
"AudioToolbox.framework",
"AudioUnit.framework",
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index 26436b47942b14e419adb5780c45a9d42224d39f..215abac9672f72aeef7694e97ff260ae7546d061 100644
index a994f74bb68d1e57ffa787e159f0a6c69e7b6953..1d84f84b59b2bae75c10c00da730022eca52d258 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -882,7 +882,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
@@ -444,18 +444,18 @@ index e0c31170acd13c9997c6b1d04c6de1420feaf422..0e561f97b33380bfbe52e64c2c4a6988
} // namespace sandbox
diff --git a/sandbox/mac/seatbelt_extension.cc b/sandbox/mac/seatbelt_extension.cc
index 9073364142e8f98c8872d9b5509f92f433e06624..2356add74dfae98299a4e2b207aa26fc109f47f3 100644
index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595c35cc4dc 100644
--- a/sandbox/mac/seatbelt_extension.cc
+++ b/sandbox/mac/seatbelt_extension.cc
@@ -8,6 +8,7 @@
#include "base/memory/ptr_util.h"
@@ -11,6 +11,7 @@
#include "base/notreached.h"
#include "sandbox/mac/seatbelt_extension_token.h"
+#ifndef MAS_BUILD
// libsandbox private API.
extern "C" {
extern const char* APP_SANDBOX_READ;
@@ -18,6 +19,7 @@ char* sandbox_extension_issue_file(const char* type,
@@ -21,6 +22,7 @@ char* sandbox_extension_issue_file(const char* type,
const char* path,
uint32_t flags);
}
@@ -463,7 +463,7 @@ index 9073364142e8f98c8872d9b5509f92f433e06624..2356add74dfae98299a4e2b207aa26fc
namespace sandbox {
@@ -46,7 +48,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
@@ -49,7 +51,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
bool SeatbeltExtension::Consume() {
DCHECK(!token_.empty());
@@ -475,7 +475,7 @@ index 9073364142e8f98c8872d9b5509f92f433e06624..2356add74dfae98299a4e2b207aa26fc
return handle_ > 0;
}
@@ -58,7 +64,11 @@ bool SeatbeltExtension::ConsumePermanently() {
@@ -61,7 +67,11 @@ bool SeatbeltExtension::ConsumePermanently() {
}
bool SeatbeltExtension::Revoke() {
@@ -487,7 +487,7 @@ index 9073364142e8f98c8872d9b5509f92f433e06624..2356add74dfae98299a4e2b207aa26fc
handle_ = 0;
token_.clear();
return rv == 0;
@@ -76,9 +86,11 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
@@ -79,9 +89,11 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type,
const std::string& resource) {
switch (type) {

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 dbf366ff78e1f4b2828ae3ccd8c0a08345942736..b7c83cceb2297eddcb345e75a95b7744b08d2e6b 100644
index 3cd537df5ee9b1c9da6571c63c0058b5a9b820fa..5f2feba6f09327088badc56d76872d2c3920866f 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -106,6 +106,11 @@
@@ -111,6 +111,11 @@
#include "services/network/url_loader.h"
#include "services/network/url_request_context_builder_mojo.h"
@@ -22,7 +22,7 @@ index dbf366ff78e1f4b2828ae3ccd8c0a08345942736..b7c83cceb2297eddcb345e75a95b7744
#if BUILDFLAG(IS_CT_SUPPORTED)
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
@@ -356,6 +361,79 @@ bool UsingBuiltinCertVerifier(
@@ -322,6 +327,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
} // namespace
@@ -102,7 +102,7 @@ index dbf366ff78e1f4b2828ae3ccd8c0a08345942736..b7c83cceb2297eddcb345e75a95b7744
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
@@ -524,6 +602,13 @@ void NetworkContext::SetClient(
@@ -492,6 +570,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -116,34 +116,51 @@ index dbf366ff78e1f4b2828ae3ccd8c0a08345942736..b7c83cceb2297eddcb345e75a95b7744
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -1714,6 +1799,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
@@ -1680,8 +1765,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
base::CommandLine::ForCurrentProcess();
std::unique_ptr<net::CertVerifier> cert_verifier;
+ std::unique_ptr<net::CertVerifier> temp_verifier;
if (g_cert_verifier_for_testing) {
cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
- cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
+ temp_verifier = std::make_unique<WrappedTestingCertVerifier>();
} else {
@@ -1762,8 +1848,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
}
#endif
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
- if (!cert_verifier) {
- cert_verifier = std::make_unique<net::CachingCertVerifier>(
+ if (!temp_verifier) {
+ temp_verifier = std::make_unique<net::CachingCertVerifier>(
std::make_unique<net::CoalescingCertVerifier>(
std::make_unique<net::MultiThreadedCertVerifier>(
UsingBuiltinCertVerifier(params_->use_builtin_cert_verifier)
@@ -1773,12 +1859,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
cert_net_fetcher_))));
}
#endif
- if (!cert_verifier)
- cert_verifier = net::CertVerifier::CreateDefault(cert_net_fetcher_);
mojom::CertVerifierCreationParams* creation_params = nullptr;
if (params_->cert_verifier_creation_params)
@@ -1690,13 +1776,13 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
if (IsUsingCertNetFetcher())
cert_net_fetcher_ = base::MakeRefCounted<net::CertNetFetcherURLRequest>();
- cert_verifier = CreateCertVerifier(creation_params, cert_net_fetcher_);
+ temp_verifier = CreateCertVerifier(creation_params, cert_net_fetcher_);
// Wrap the cert verifier in caching and coalescing layers to avoid extra
// verifications.
- cert_verifier = std::make_unique<net::CachingCertVerifier>(
+ temp_verifier = std::make_unique<net::CachingCertVerifier>(
std::make_unique<net::CoalescingCertVerifier>(
- std::move(cert_verifier)));
+ std::move(temp_verifier)));
#if defined(OS_CHROMEOS)
cert_verifier_with_trust_anchors_ =
@@ -1705,13 +1791,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
UpdateAdditionalCertificates(
std::move(params_->initial_additional_certificates));
cert_verifier_with_trust_anchors_->InitializeOnIOThread(
- std::move(cert_verifier));
- cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_);
+ std::move(temp_verifier));
+ temp_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_);
#endif // defined(OS_CHROMEOS)
+ if (!temp_verifier) {
+#if !defined(OS_LINUX)
+ temp_verifier = std::make_unique<net::MultiThreadedCertVerifier>(
+ net::CertVerifyProc::CreateSystemVerifyProc(std::move(cert_net_fetcher_)));
+#else
+ temp_verifier = std::make_unique<net::MultiThreadedCertVerifier>(
+ net::CertVerifyProc::CreateBuiltinVerifyProc(std::move(cert_net_fetcher_)));
+#endif
+ }
+ auto remote_cert_verifier = std::make_unique<RemoteCertVerifier>(std::move(temp_verifier));
+ remote_cert_verifier_ = remote_cert_verifier.get();
@@ -160,10 +177,10 @@ index dbf366ff78e1f4b2828ae3ccd8c0a08345942736..b7c83cceb2297eddcb345e75a95b7744
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 dc36e4eb72889ca9810a057e4d746399e1845b7f..cff8a36b7703df31d0823efb2549f57d7c6c6907 100644
index 669fdf6d6c1ffb292a25b7ec608149f433312800..0bc906026e988819f66554749c8d6aa2f2accc49 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -84,6 +84,7 @@ class DomainReliabilityMonitor;
@@ -86,6 +86,7 @@ class DomainReliabilityMonitor;
namespace network {
class CertVerifierWithTrustAnchors;
@@ -171,7 +188,7 @@ index dc36e4eb72889ca9810a057e4d746399e1845b7f..cff8a36b7703df31d0823efb2549f57d
class CookieManager;
class ExpectCTReporter;
class HostResolver;
@@ -187,6 +188,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -182,6 +183,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) override;
@@ -180,7 +197,7 @@ index dc36e4eb72889ca9810a057e4d746399e1845b7f..cff8a36b7703df31d0823efb2549f57d
void ResetURLLoaderFactories() override;
void GetCookieManager(
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
@@ -657,6 +660,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -643,6 +646,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
#endif
@@ -190,11 +207,11 @@ index dc36e4eb72889ca9810a057e4d746399e1845b7f..cff8a36b7703df31d0823efb2549f57d
// CertNetFetcher is not used by the current platform.
scoped_refptr<net::CertNetFetcherURLRequest> cert_net_fetcher_;
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 2774beb622cb44057cb45c07dd917d99bb6fc54f..e834a5f9a4b6c698ad20e3b9cdc99e871e4035df 100644
index 61c78d520becdb041f7b163bce5bb3fada44223a..248108042a5be07a3ddf6a11880ddbf04470d673 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -161,6 +161,17 @@ struct HttpAuthStaticNetworkContextParams {
= DefaultCredentials.ALLOW_DEFAULT_CREDENTIALS;
@@ -198,6 +198,17 @@ struct CTPolicy {
array<string> excluded_legacy_spkis;
};
+interface CertVerifierClient {
@@ -211,7 +228,7 @@ index 2774beb622cb44057cb45c07dd917d99bb6fc54f..e834a5f9a4b6c698ad20e3b9cdc99e87
// Parameters for constructing a network context.
struct NetworkContextParams {
// Name used by memory tools to identify the context.
@@ -831,6 +842,9 @@ interface NetworkContext {
@@ -837,6 +848,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);

View File

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

View File

@@ -7,7 +7,7 @@ Pass RenderProcessHost through to PlatformNotificationService
so Electron can identify which renderer a notification came from.
diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
index a717d9f3539dc0fe86b743c6e29e4311b8b5cec3..1351217319c57be414e6c66f8a01f71fe46d2c04 100644
index 659149f4c5dea45bead88d26369d8aeb9462b729..7105781e0019b456f287fd0ebb6e309efe2cecad 100644
--- a/content/browser/notifications/blink_notification_service_impl.cc
+++ b/content/browser/notifications/blink_notification_service_impl.cc
@@ -88,9 +88,11 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
@@ -68,10 +68,10 @@ index 619ad99bb52d489826d1e442a7719d985f0696ec..f7c9d3cac66879ce2be06a7a27ea96bf
notification_service_remote_.BindNewPipeAndPassReceiver());
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
index 2d76a71e57eade4f5fc01ff45a587ee9466baee0..62c0bb383813f07ef3a6d47988223f8c9e2788b0 100644
index d221f2747086452c59474f17211adbfeec5a58b0..feee9f0b5f783cb4fbc60d3c29bddfaf5b4b6c46 100644
--- a/content/browser/notifications/platform_notification_context_impl.cc
+++ b/content/browser/notifications/platform_notification_context_impl.cc
@@ -209,12 +209,13 @@ void PlatformNotificationContextImpl::Shutdown() {
@@ -208,12 +208,13 @@ void PlatformNotificationContextImpl::Shutdown() {
}
void PlatformNotificationContextImpl::CreateService(
@@ -108,10 +108,10 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 4c88b83382bfe08e91ceb981392e72cbc8cbd80b..9beff8728eba07fe5bbb50701dcec78d61149fde 100644
index 49af7bd3719fe3c9848050f3f336bc02cfbfd2fb..f33eb6d5a0e98e06cd3ba318e9b578df4bc9ab2c 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2110,7 +2110,7 @@ void RenderProcessHostImpl::CreateNotificationService(
@@ -2120,7 +2120,7 @@ void RenderProcessHostImpl::CreateNotificationService(
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
@@ -142,10 +142,10 @@ index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68
const GURL& origin,
const blink::PlatformNotificationData& notification_data,
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
index 73a1af201b12bf818af2eafadad478b8c422826c..fc7e74c0bf900d475fc134a7b606c5f9e404f934 100644
index 639a93ac8d4f295910fcfb64d69d1498c9dbbe94..25d7b29b53b426d02664bc904f1c646662d9a5d5 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -31,6 +31,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
@@ -30,6 +30,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
MockPlatformNotificationService::~MockPlatformNotificationService() = default;
void MockPlatformNotificationService::DisplayNotification(

View File

@@ -35,13 +35,13 @@ index 2e328c0fb5a6598c3ae911655b3e5016a02b7405..304364f7e02c19d2ad7d16433e92dcfe
// Permissions for the following interfaces will be checked at the
// time of the corresponding instance's methods calls (because
diff --git a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
index d72a867594acee97d50c5f905fc1a4df9aa9352e..8a4cc159cb490ebadbb1b54aa88223c0cbf8ffdb 100644
index 82fa5b7026e62cfe69700f30fcc84731fc30afe8..f4ad9fbc72a5cb27ed22ab014ccb2fcb4cb49284 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 @@
@@ -6,10 +6,12 @@
#include <string>
#include "base/task/post_task.h"
+#if 0
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -51,7 +51,7 @@ index d72a867594acee97d50c5f905fc1a4df9aa9352e..8a4cc159cb490ebadbb1b54aa88223c0
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@@ -59,6 +61,7 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
@@ -58,6 +60,7 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
RenderProcessHost::FromID(render_process_id_);
if (!render_process_host)
return PP_ERROR_FAILED;
@@ -59,7 +59,7 @@ index d72a867594acee97d50c5f905fc1a4df9aa9352e..8a4cc159cb490ebadbb1b54aa88223c0
Profile* profile =
Profile::FromBrowserContext(render_process_host->GetBrowserContext());
HostContentSettingsMap* content_settings =
@@ -68,5 +71,6 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
@@ -67,5 +70,6 @@ int32_t PepperBrokerMessageFilter::OnIsAllowed(
std::string());
if (setting == CONTENT_SETTING_ALLOW)
return PP_OK;
@@ -68,11 +68,11 @@ index d72a867594acee97d50c5f905fc1a4df9aa9352e..8a4cc159cb490ebadbb1b54aa88223c0
+ 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 c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d020866781 100644
index 839b95e6a27e1296bae5e1bc98d5aedd7b2c3041..677b65e44440825d7fbba18f736ff970a8da3559 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 @@
#include "base/task/post_task.h"
@@ -7,9 +7,11 @@
#include "base/bind.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#if 0
@@ -83,7 +83,7 @@ index c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d0
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_task_traits.h"
@@ -41,6 +43,7 @@ using content::RenderProcessHost;
@@ -40,6 +42,7 @@ using content::RenderProcessHost;
namespace {
@@ -91,7 +91,7 @@ index c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d0
// Get the CookieSettings on the UI thread for the given render process ID.
scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
int render_process_id) {
@@ -54,6 +57,7 @@ scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
@@ -53,6 +56,7 @@ scoped_refptr<content_settings::CookieSettings> GetCookieSettings(
}
return nullptr;
}
@@ -99,7 +99,7 @@ index c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d0
void BindWakeLockProviderOnUIThread(
mojo::PendingReceiver<device::mojom::WakeLockProvider> receiver) {
@@ -67,7 +71,9 @@ PepperFlashBrowserHost::PepperFlashBrowserHost(BrowserPpapiHost* host,
@@ -66,7 +70,9 @@ PepperFlashBrowserHost::PepperFlashBrowserHost(BrowserPpapiHost* host,
PP_Instance instance,
PP_Resource resource)
: ResourceHost(host->GetPpapiHost(), instance, resource),
@@ -109,7 +109,7 @@ index c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d0
delay_timer_(FROM_HERE,
base::TimeDelta::FromSeconds(45),
this,
@@ -120,6 +126,7 @@ int32_t PepperFlashBrowserHost::OnGetLocalTimeZoneOffset(
@@ -119,6 +125,7 @@ int32_t PepperFlashBrowserHost::OnGetLocalTimeZoneOffset(
int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
ppapi::host::HostMessageContext* context) {
@@ -117,7 +117,7 @@ index c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d0
// 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
@@ -140,9 +147,11 @@ int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
@@ -138,9 +145,11 @@ int32_t PepperFlashBrowserHost::OnGetLocalDataRestrictions(
context->MakeReplyMessageContext(), document_url,
plugin_url));
}
@@ -130,7 +130,7 @@ index c1fdd9dd86e4a205c6e2b51910f2bd2901501c75..77d65652808f2405881a8e1bb53d70d0
void PepperFlashBrowserHost::GetLocalDataRestrictions(
ppapi::host::ReplyMessageContext reply_context,
const GURL& document_url,
@@ -171,6 +180,7 @@ void PepperFlashBrowserHost::GetLocalDataRestrictions(
@@ -169,6 +178,7 @@ void PepperFlashBrowserHost::GetLocalDataRestrictions(
PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply(
static_cast<int32_t>(restrictions)));
}
@@ -186,10 +186,10 @@ index 6b13bae8def62d9a26d68ac8396b4bf6f7439c1a..d92b5a5855c0cebf94922a31f686e15e
DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHost);
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
index 7c8c292d6d422139be89632dcb6a9d44106b3ac9..276d2fa32b25984e50eb5422e60a650fcb67fb71 100644
index 7b774366e2ebd2405e0b85cdfbf1885c394afd0d..26996b7540d652ddb454cbb2fe3510d2a8aa31bf 100644
--- a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
@@ -21,6 +21,7 @@
@@ -20,6 +20,7 @@
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/pepper_plugin_info.h"
@@ -197,7 +197,7 @@ index 7c8c292d6d422139be89632dcb6a9d44106b3ac9..276d2fa32b25984e50eb5422e60a650f
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/host_message_context.h"
@@ -128,7 +129,9 @@ PepperFlashDRMHost::PepperFlashDRMHost(BrowserPpapiHost* host,
@@ -127,7 +128,9 @@ PepperFlashDRMHost::PepperFlashDRMHost(BrowserPpapiHost* host,
content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(
render_process_id, voucher_file);
@@ -207,7 +207,7 @@ index 7c8c292d6d422139be89632dcb6a9d44106b3ac9..276d2fa32b25984e50eb5422e60a650f
monitor_finder_ = new MonitorFinder(render_process_id, render_frame_id);
monitor_finder_->GetMonitor();
}
@@ -151,12 +154,18 @@ int32_t PepperFlashDRMHost::OnResourceMessageReceived(
@@ -150,12 +153,18 @@ int32_t PepperFlashDRMHost::OnResourceMessageReceived(
int32_t PepperFlashDRMHost::OnHostMsgGetDeviceID(
ppapi::host::HostMessageContext* context) {
@@ -227,7 +227,7 @@ index 7c8c292d6d422139be89632dcb6a9d44106b3ac9..276d2fa32b25984e50eb5422e60a650f
}
int32_t PepperFlashDRMHost::OnHostMsgGetHmonitor(
@@ -185,6 +194,7 @@ int32_t PepperFlashDRMHost::OnHostMsgMonitorIsExternal(
@@ -184,6 +193,7 @@ int32_t PepperFlashDRMHost::OnHostMsgMonitorIsExternal(
return PP_OK;
}
@@ -235,7 +235,7 @@ index 7c8c292d6d422139be89632dcb6a9d44106b3ac9..276d2fa32b25984e50eb5422e60a650f
void PepperFlashDRMHost::GotDeviceID(
ppapi::host::ReplyMessageContext reply_context,
const std::string& id,
@@ -197,3 +207,4 @@ void PepperFlashDRMHost::GotDeviceID(
@@ -196,3 +206,4 @@ void PepperFlashDRMHost::GotDeviceID(
host()->SendReply(reply_context,
PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id));
}
@@ -265,13 +265,13 @@ 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 c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f99fd42e9e 100644
index 0a04a1e0ec56126a7e44537141d024332b22a190..5384d7ac2f2eaf708bf001dd885f401783ac7133 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 @@
@@ -7,17 +7,21 @@
#include <stddef.h>
#include "base/stl_util.h"
#include "base/task/post_task.h"
+#if 0
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
@@ -290,7 +290,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/host_message_context.h"
@@ -27,12 +31,11 @@
@@ -26,12 +30,11 @@
#include "ppapi/shared_impl/file_system_util.h"
#include "storage/browser/file_system/isolated_context.h"
@@ -304,7 +304,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
namespace {
@@ -42,6 +45,7 @@ const char* kPredefinedAllowedCrxFsOrigins[] = {
@@ -41,6 +44,7 @@ const char* kPredefinedAllowedCrxFsOrigins[] = {
};
} // namespace
@@ -312,7 +312,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
// static
PepperIsolatedFileSystemMessageFilter*
@@ -69,8 +73,10 @@ PepperIsolatedFileSystemMessageFilter::PepperIsolatedFileSystemMessageFilter(
@@ -68,8 +72,10 @@ PepperIsolatedFileSystemMessageFilter::PepperIsolatedFileSystemMessageFilter(
profile_directory_(profile_directory),
document_url_(document_url),
ppapi_host_(ppapi_host) {
@@ -323,7 +323,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
}
PepperIsolatedFileSystemMessageFilter::
@@ -95,6 +101,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(
@@ -94,6 +100,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(
return PP_ERROR_FAILED;
}
@@ -331,7 +331,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
Profile* PepperIsolatedFileSystemMessageFilter::GetProfile() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
ProfileManager* profile_manager = g_browser_process->profile_manager();
@@ -121,6 +128,7 @@ PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem(Profile* profile) {
@@ -120,6 +127,7 @@ PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem(Profile* profile) {
return storage::IsolatedContext::ScopedFSHandle();
#endif
}
@@ -339,7 +339,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
ppapi::host::HostMessageContext* context,
@@ -129,7 +137,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
@@ -128,7 +136,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID:
break;
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
@@ -348,7 +348,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
return OpenPluginPrivateFileSystem(context);
}
@@ -139,6 +147,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
@@ -138,6 +146,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
return PP_ERROR_FAILED;
}
@@ -356,7 +356,7 @@ index c94e1947dc1b1ea83b27107c36e87c3dad5a61b1..b38862b776713958c54c3523b61a36f9
int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
ppapi::host::HostMessageContext* context) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -179,6 +188,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
@@ -178,6 +187,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
return PP_ERROR_NOTSUPPORTED;
#endif
}

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 883958a432fc791824e2f94cf2bcba633ac74467..c90787bbbbcd49b278490362c72a9434deed4fb4 100644
index 9b857313673a0233af1b20b72ecfeb52b2cff79d..3879843e937e134b74ea1a0a85a3ef5921a66eff 100644
--- a/chrome/browser/ui/views/overlay/overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
@@ -19,7 +19,7 @@

View File

@@ -8,10 +8,10 @@ this patch removes that dependency so we can reuse it.
Ideally we would change this class in upstream to not depend on Profile.
diff --git a/chrome/browser/predictors/preconnect_manager.cc b/chrome/browser/predictors/preconnect_manager.cc
index 50adee35887f799fea11a35eca1240851a0d1126..9935e068983de3342382f73889be41acc3fe8f4e 100644
index e6524169e022c98d07ca29fa7988c22b06f0a2e1..199837a907a8b9df0ef7d2cb9b369503ab655bf6 100644
--- a/chrome/browser/predictors/preconnect_manager.cc
+++ b/chrome/browser/predictors/preconnect_manager.cc
@@ -69,7 +69,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default;
@@ -68,7 +68,7 @@ PreresolveJob::PreresolveJob(PreresolveJob&& other) = default;
PreresolveJob::~PreresolveJob() = default;
PreconnectManager::PreconnectManager(base::WeakPtr<Delegate> delegate,
@@ -20,7 +20,7 @@ index 50adee35887f799fea11a35eca1240851a0d1126..9935e068983de3342382f73889be41ac
: delegate_(std::move(delegate)),
profile_(profile),
inflight_preresolves_count_(0) {
@@ -328,11 +328,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const {
@@ -325,11 +325,13 @@ network::mojom::NetworkContext* PreconnectManager::GetNetworkContext() const {
if (network_context_)
return network_context_;

View File

@@ -11,10 +11,10 @@ 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 65065b781a0ae6e70c59d7c31d1410b4457fca49..04a13092de8e18f6a960f7b46be217bb4af34301 100644
index 25fd623deb7a5d580d80dfa4d99d4628c6800eb3..dd76a610f05e636a6f01e4f21a11507f65867a15 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -21,7 +21,6 @@
@@ -20,7 +20,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/printing/print_job.h"
@@ -22,7 +22,7 @@ index 65065b781a0ae6e70c59d7c31d1410b4457fca49..04a13092de8e18f6a960f7b46be217bb
#include "components/crash/core/common/crash_keys.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@@ -29,6 +28,7 @@
@@ -28,6 +27,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "printing/backend/print_backend.h"
@@ -30,7 +30,7 @@ index 65065b781a0ae6e70c59d7c31d1410b4457fca49..04a13092de8e18f6a960f7b46be217bb
#include "printing/print_job_constants.h"
#include "printing/printed_document.h"
#include "printing/printing_utils.h"
@@ -224,16 +224,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
@@ -223,16 +223,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
print_backend->GetPrinterDriverInfo(printer_name));
}
@@ -55,7 +55,7 @@ index 65065b781a0ae6e70c59d7c31d1410b4457fca49..04a13092de8e18f6a960f7b46be217bb
}
#if defined(OS_CHROMEOS)
@@ -249,6 +254,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
@@ -248,6 +253,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
PrintingContext::Result result) {
@@ -70,7 +70,7 @@ index 65065b781a0ae6e70c59d7c31d1410b4457fca49..04a13092de8e18f6a960f7b46be217bb
}
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9aed9f561 100644
index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc473bbd0da 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -27,10 +27,7 @@
@@ -81,10 +81,10 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
-#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
#include "chrome/common/pref_names.h"
-#include "chrome/grit/generated_resources.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/prefs/pref_service.h"
#include "components/printing/browser/print_composite_client.h"
#include "components/printing/browser/print_manager_utils.h"
@@ -45,6 +42,7 @@
@@ -47,6 +44,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -92,7 +92,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
#include "mojo/public/cpp/system/buffer.h"
#include "printing/buildflags/buildflags.h"
#include "printing/metafile_skia.h"
@@ -68,6 +66,8 @@ using PrintSettingsCallback =
@@ -70,6 +68,8 @@ using PrintSettingsCallback =
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
void ShowWarningMessageBox(const base::string16& message) {
@@ -101,7 +101,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
// Runs always on the UI thread.
static bool is_dialog_shown = false;
if (is_dialog_shown)
@@ -76,6 +76,7 @@ void ShowWarningMessageBox(const base::string16& message) {
@@ -78,6 +78,7 @@ void ShowWarningMessageBox(const base::string16& message) {
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
chrome::ShowWarningMessageBox(nullptr, base::string16(), message);
@@ -109,7 +109,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
}
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -114,12 +115,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
@@ -116,12 +117,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
printing_succeeded_(false),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
@@ -124,7 +124,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -127,7 +130,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
@@ -129,7 +132,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
DisconnectFromCurrentPrintJob();
}
@@ -135,8 +135,8 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
+ CompletionCallback callback) {
DisconnectFromCurrentPrintJob();
// Don't print / print preview interstitials or crashed tabs.
@@ -135,7 +141,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
// Don't print / print preview crashed tabs.
@@ -137,7 +143,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
return false;
SetPrintingRFH(rfh);
@@ -152,7 +152,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
return true;
}
@@ -256,9 +269,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
@@ -258,9 +271,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
void PrintViewManagerBase::UpdatePrintingEnabled() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// The Unretained() is safe because ForEachFrame() is synchronous.
@@ -165,7 +165,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
}
void PrintViewManagerBase::NavigationStopped() {
@@ -361,7 +374,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
@@ -363,7 +376,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
PrintManager::OnPrintingFailed(cookie);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -174,7 +174,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
#endif
ReleasePrinterQuery();
@@ -461,9 +474,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
@@ -463,9 +476,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
content::NotificationService::NoDetails());
break;
}
@@ -190,7 +190,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
NOTREACHED();
break;
}
@@ -558,8 +575,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -560,8 +577,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
DCHECK(!quit_inner_loop_);
DCHECK(query);
@@ -203,16 +203,16 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
// We can't print if there is no renderer.
if (!web_contents()->GetRenderViewHost() ||
@@ -574,8 +593,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
print_job_->SetSource(PrintJob::Source::PRINT_PREVIEW, /*source_id=*/"");
#endif // defined(OS_CHROMEOS)
@@ -582,8 +601,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
print_job_->SetSource(source, /*source_id=*/"");
#endif
- registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- content::Source<PrintJob>(print_job_.get()));
printing_succeeded_ = false;
return true;
}
@@ -624,14 +641,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -632,14 +649,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@@ -237,7 +237,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
// Don't close the worker thread.
print_job_ = nullptr;
}
@@ -667,7 +692,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -675,7 +700,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@@ -247,7 +247,7 @@ index f767f2234e545d58365e99b0379c3a54a04ba8f0..b6e91d146498b6f268584794bf96aca9
if (!cookie) {
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index 3d434244927aca5e5dbec8d7c1cd212c5c260c71..9d62c903bf08fa8cfa8c425d430c5e995a04f7fc 100644
index 94b65e85561e1440b60086b668865bda07303d35..7044463d163fd74e55ff1a042c36739fdeff3689 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;
@@ -271,7 +271,7 @@ index 3d434244927aca5e5dbec8d7c1cd212c5c260c71..9d62c903bf08fa8cfa8c425d430c5e99
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Prints the document in |print_data| with settings specified in
@@ -206,9 +211,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
@@ -205,9 +210,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
// The current RFH that is printing with a system printing dialog.
content::RenderFrameHost* printing_rfh_;
@@ -288,10 +288,10 @@ index 3d434244927aca5e5dbec8d7c1cd212c5c260c71..9d62c903bf08fa8cfa8c425d430c5e99
// This means we are _blocking_ until all the necessary pages have been
// rendered or the print settings are being loaded.
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index d105aae9c8b949d2fe910467dd9a5209229b3592..4ac32e0306d75533e3a091cb512aa8d8f44757e3 100644
index f4094c54075b9d4cdcbf1aa78c7264882889c76e..1643c637cf0b05427b9dd72e60045a60952ca04f 100644
--- a/chrome/browser/printing/printing_message_filter.cc
+++ b/chrome/browser/printing/printing_message_filter.cc
@@ -22,6 +22,7 @@
@@ -21,6 +21,7 @@
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
#include "components/printing/browser/print_manager_utils.h"
#include "components/printing/common/print_messages.h"
@@ -299,7 +299,7 @@ index d105aae9c8b949d2fe910467dd9a5209229b3592..4ac32e0306d75533e3a091cb512aa8d8
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
@@ -90,20 +91,23 @@ void PrintingMessageFilter::SetDelegateForTesting(TestDelegate* delegate) {
@@ -89,19 +90,22 @@ void PrintingMessageFilter::SetDelegateForTesting(TestDelegate* delegate) {
g_test_delegate = delegate;
}
@@ -320,13 +320,12 @@ index d105aae9c8b949d2fe910467dd9a5209229b3592..4ac32e0306d75533e3a091cb512aa8d8
base::Unretained(this)));
+ #if 0
is_printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
is_printing_enabled_.MoveToSequence(
base::CreateSingleThreadTaskRunner({BrowserThread::IO}));
is_printing_enabled_.MoveToSequence(content::GetIOThreadTaskRunner({}));
+ #endif
}
PrintingMessageFilter::~PrintingMessageFilter() {
@@ -138,11 +142,13 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) {
@@ -133,11 +137,13 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) {
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -340,7 +339,7 @@ index d105aae9c8b949d2fe910467dd9a5209229b3592..4ac32e0306d75533e3a091cb512aa8d8
std::unique_ptr<PrinterQuery> printer_query = queue_->PopPrinterQuery(0);
if (!printer_query) {
printer_query =
@@ -228,12 +234,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
@@ -223,12 +229,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
void PrintingMessageFilter::OnUpdatePrintSettings(int document_cookie,
base::Value job_settings,
IPC::Message* reply_msg) {
@@ -355,7 +354,7 @@ index d105aae9c8b949d2fe910467dd9a5209229b3592..4ac32e0306d75533e3a091cb512aa8d8
if (!job_settings.is_dict() ||
!job_settings.FindIntKey(kSettingPrinterType)) {
// Reply with null query.
@@ -266,7 +273,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
@@ -261,7 +268,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
std::unique_ptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_PrintPages_Params params;
@@ -366,20 +365,11 @@ index d105aae9c8b949d2fe910467dd9a5209229b3592..4ac32e0306d75533e3a091cb512aa8d8
params.Reset();
} else {
RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
@@ -304,7 +313,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
bool* cancel) {
- *cancel = PrintPreviewUI::ShouldCancelRequest(ids);
+ *cancel = false;
}
#endif
diff --git a/chrome/browser/printing/printing_message_filter.h b/chrome/browser/printing/printing_message_filter.h
index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6305088d5 100644
index 49296adb525eeb511d4aad5f25ff1196f9f1333e..2d705bb98f47e79f0922af9675c42800aadc0206 100644
--- a/chrome/browser/printing/printing_message_filter.h
+++ b/chrome/browser/printing/printing_message_filter.h
@@ -24,6 +24,10 @@ struct PrintHostMsg_ScriptedPrint_Params;
@@ -23,6 +23,10 @@ struct PrintHostMsg_ScriptedPrint_Params;
struct PrintMsg_Print_Params;
class Profile;
@@ -390,7 +380,7 @@ index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6
namespace printing {
class PrintQueriesQueue;
@@ -44,7 +48,8 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
@@ -43,7 +47,8 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
static void SetDelegateForTesting(TestDelegate* delegate);
@@ -401,10 +391,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 3695656560c54b5aa1fb08fb5e7c17d54989c597..85ffa5704d8dea809e80b1993c7c852fc545c7a6 100644
index 5398362ff64fe948b492aa6dd362f2aa6ab19231..3ff75b7850e8ebb03cc202a2cc3f70fba0b1174f 100644
--- a/components/printing/common/print.mojom
+++ b/components/printing/common/print.mojom
@@ -35,7 +35,7 @@ interface PrintRenderer {
@@ -104,7 +104,7 @@ interface PrintPreviewUI {
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.
@@ -414,18 +404,18 @@ index 3695656560c54b5aa1fb08fb5e7c17d54989c597..85ffa5704d8dea809e80b1993c7c852f
// Tells the RenderFrame to switch the CSS to print media type, render every
// requested page using the print preview document's frame/node, and then
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5941d9b42 100644
index a5aa97ab6254c27d04beaf758fbf9916189e3284..e566b1d22a5bb0aa40f15db83f1dc89e9099f62c 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -42,6 +42,7 @@
#include "printing/buildflags/buildflags.h"
@@ -44,6 +44,7 @@
#include "printing/metafile_skia.h"
#include "printing/mojom/print.mojom.h"
#include "printing/printing_features.h"
+#include "printing/print_settings.h"
#include "printing/units.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
@@ -1160,7 +1161,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
#include "third_party/blink/public/common/css/page_orientation.h"
@@ -1173,7 +1174,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
web_frame->DispatchBeforePrintEvent();
if (!weak_this)
return;
@@ -435,7 +425,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
if (weak_this)
web_frame->DispatchAfterPrintEvent();
}
@@ -1181,7 +1183,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1194,7 +1196,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@@ -444,7 +434,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > 1)
return;
@@ -1195,7 +1197,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1208,7 +1210,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);
@@ -453,7 +443,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1212,7 +1214,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1225,7 +1227,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
return;
}
Print(frame, print_preview_context_.source_node(),
@@ -462,7 +452,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1252,6 +1254,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
@@ -1273,6 +1275,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -471,7 +461,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
print_preview_context_.OnPrintPreview();
base::UmaHistogramEnumeration(print_preview_context_.IsForArc()
@@ -1755,7 +1759,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1784,7 +1788,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
auto self = weak_ptr_factory_.GetWeakPtr();
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@@ -482,7 +472,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
// Check if |this| is still valid.
if (!self)
return;
@@ -1766,7 +1772,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1795,7 +1801,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -493,7 +483,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -1774,7 +1782,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1803,7 +1811,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
int expected_page_count = 0;
@@ -502,7 +492,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -1794,8 +1802,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1823,8 +1831,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
PrintMsg_PrintPages_Params print_settings;
auto self = weak_ptr_factory_.GetWeakPtr();
@@ -516,7 +506,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
// Check if |this| is still valid.
if (!self)
return;
@@ -2030,10 +2041,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
@@ -2060,10 +2071,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
@@ -543,7 +533,7 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
// 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.
@@ -2053,12 +2077,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
@@ -2083,12 +2107,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
return result;
}
@@ -563,10 +553,10 @@ index 1b995b1d7bbb972ce66e351a3bfef2fdae0ad25d..5d829b6ef0c02d0f230c9581377fe3b5
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 92ad8475b8268db89a5a7f22ad22547686388374..81df566a5908f1b35b9da5c2aad35ea7dec1dc3b 100644
index 85b7989513d014c2dea2b649248c85c912109904..a0d1b786dd21afd5047e84bf323171adef912835 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -226,7 +226,7 @@ class PrintRenderFrameHelper
@@ -225,7 +225,7 @@ class PrintRenderFrameHelper
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
// printing::mojom::PrintRenderFrame:
@@ -574,8 +564,8 @@ index 92ad8475b8268db89a5a7f22ad22547686388374..81df566a5908f1b35b9da5c2aad35ea7
+ void PrintRequestedPages(bool silent, base::Value settings) override;
void PrintForSystemDialog() override;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void InitiatePrintPreview(
@@ -290,7 +290,9 @@ class PrintRenderFrameHelper
void SetPrintPreviewUI(
@@ -291,7 +291,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -586,7 +576,7 @@ index 92ad8475b8268db89a5a7f22ad22547686388374..81df566a5908f1b35b9da5c2aad35ea7
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -299,12 +301,14 @@ class PrintRenderFrameHelper
@@ -300,12 +302,14 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
@@ -604,10 +594,10 @@ index 92ad8475b8268db89a5a7f22ad22547686388374..81df566a5908f1b35b9da5c2aad35ea7
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index a85f6812f010193a676494d297a21726611e2d35..d40df922111c0ecfc9a1ceebc3bad9f0c067bd1b 100644
index ad26397af46f024a81902949e1c7d627922ff492..e23abbac0014eac5fa0042111b920a1dec4723f8 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -92,8 +92,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
@@ -94,8 +94,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
PrintingContext::Result PrintingContext::UpdatePrintSettings(
base::Value job_settings) {

View File

@@ -8,7 +8,7 @@ needed in chromium but our autofill implementation uses them. This patch can be
our autofill implementation to work like Chromium's.
diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc
index 2840d54ef157f962a21ae6c2a32f07bbe4db250a..3061e1ad6dea4a75e4cee889a4015a39500ec5d9 100644
index e4b9c5e52d6f8408f8ab5ab7c4f8b28466e04626..9c32aaaa0d88a692632a2e888250c6fd04a46fef 100644
--- a/ui/gtk/native_theme_gtk.cc
+++ b/ui/gtk/native_theme_gtk.cc
@@ -353,6 +353,29 @@ base::Optional<SkColor> SkColorFromColorId(
@@ -42,10 +42,10 @@ index 2840d54ef157f962a21ae6c2a32f07bbe4db250a..3061e1ad6dea4a75e4cee889a4015a39
// 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 670f290aca43887460a4e8cfb5e2c805d78a6d8b..f564f13aac6dbd5881a351a7aaa5a02314c826a7 100644
index 5820f4ab68ba5effc867215bdecb23d2bc9396b3..5909a5c74394564a9ff2241242f05867f853eb06 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -43,7 +43,8 @@ base::Optional<SkColor> GetHighContrastColor(
@@ -63,7 +63,8 @@ base::Optional<SkColor> GetHighContrastColor(
}
}
@@ -55,7 +55,7 @@ index 670f290aca43887460a4e8cfb5e2c805d78a6d8b..f564f13aac6dbd5881a351a7aaa5a023
switch (color_id) {
// Dialogs
case NativeTheme::kColorId_WindowBackground:
@@ -58,6 +59,14 @@ base::Optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id) {
@@ -78,6 +79,14 @@ base::Optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id) {
case NativeTheme::kColorId_BubbleFooterBackground:
return SkColorSetRGB(0x32, 0x36, 0x39);
@@ -70,7 +70,7 @@ index 670f290aca43887460a4e8cfb5e2c805d78a6d8b..f564f13aac6dbd5881a351a7aaa5a023
// FocusableBorder
case NativeTheme::kColorId_FocusedBorderColor:
return SkColorSetA(gfx::kGoogleBlue300, 0x4D);
@@ -506,6 +515,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
@@ -551,6 +560,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_UnfocusedBorderColor:
return gfx::kGoogleGrey300;
@@ -89,7 +89,7 @@ index 670f290aca43887460a4e8cfb5e2c805d78a6d8b..f564f13aac6dbd5881a351a7aaa5a023
// Material spinner/throbber
case NativeTheme::kColorId_ThrobberSpinningColor:
return gfx::kGoogleBlue600;
@@ -572,7 +593,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
@@ -650,7 +671,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
}
if (color_scheme == NativeTheme::ColorScheme::kDark) {
@@ -99,10 +99,10 @@ index 670f290aca43887460a4e8cfb5e2c805d78a6d8b..f564f13aac6dbd5881a351a7aaa5a023
return color.value();
}
diff --git a/ui/native_theme/native_theme_color_id.h b/ui/native_theme/native_theme_color_id.h
index 0e729134b4bdfbba9e688794ff83d0273f70ce75..65c7b9c09bf974ef9721e37ad8d2e1cabbf287ad 100644
index 9b3d8039bc2dcded1fcf54327028e4335732026d..0bd3f08d3023f4cb219e9baae59823dfefed9d7e 100644
--- a/ui/native_theme/native_theme_color_id.h
+++ b/ui/native_theme/native_theme_color_id.h
@@ -134,6 +134,11 @@
@@ -141,6 +141,11 @@
OP(kColorId_TableHeaderText), \
OP(kColorId_TableHeaderBackground), \
OP(kColorId_TableHeaderSeparator), \
@@ -115,10 +115,10 @@ index 0e729134b4bdfbba9e688794ff83d0273f70ce75..65c7b9c09bf974ef9721e37ad8d2e1ca
OP(kColorId_ThrobberSpinningColor), \
OP(kColorId_ThrobberWaitingColor), \
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 536b2266508b9843756eccd6c96b0b07fc1392df..f94a3ed2098d5f32ea0eb881be28d7a589b359a5 100644
index 8cc9cdc5eab4ebab20fee78318d38b365e8408e9..54730260ccb2ca56fd3fa26db631821de0e7d796 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -644,6 +644,18 @@ base::Optional<SkColor> NativeThemeWin::GetPlatformHighContrastColor(
@@ -646,6 +646,18 @@ base::Optional<SkColor> NativeThemeWin::GetPlatformHighContrastColor(
case kColorId_ThrobberWaitingColor:
return system_colors_[SystemThemeColor::kGrayText];

View File

@@ -0,0 +1,94 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andy Locascio <andy@slack-corp.com>
Date: Wed, 13 May 2020 14:54:39 -0700
Subject: refactor: expose cursor changes to the WebContentsObserver
Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about `cursor-changed`.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index 7e9bddc9f002b938ed7804af7c484f4500988a9e..f77130c39b853ed6ba30e62dd59c4afec93d8d31 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -15,6 +15,7 @@
#include "components/viz/common/vertical_scroll_direction.h"
#include "content/browser/renderer_host/input_event_shim.h"
#include "content/common/content_export.h"
+#include "content/common/cursors/webcursor.h"
#include "content/common/drag_event_source_info.h"
#include "content/public/common/drop_data.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
@@ -281,6 +282,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
// Allow the delegate to handle the cursor update. Returns true if handled.
virtual bool OnUpdateDragCursor();
+ // Notify the delegate of the RenderWidget's changing cursor.
+ virtual void OnCursorChanged(const WebCursor& cursor) {}
+
// Returns true if the provided RenderWidgetHostImpl matches the current
// RenderWidgetHost on the main frame, and false otherwise.
virtual bool IsWidgetForMainFrame(RenderWidgetHostImpl*);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 43691a30a65d93be24abcc8f300cc4ed932d66b1..5628eeb3af1de28333d0c1cdb9c5cc470e3a8e09 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1597,6 +1597,8 @@ void RenderWidgetHostImpl::SetCursor(const WebCursor& cursor) {
if (!view_)
return;
view_->UpdateCursor(cursor);
+ if (delegate_)
+ delegate_->OnCursorChanged(cursor);
}
void RenderWidgetHostImpl::OnCursorVisibilityStateChanged(bool is_visible) {
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 9def30b2994eddef546509f90b6beba0da5815f1..004045e3223bf89d7e71f3dee5e221dbd1dc06cd 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3468,6 +3468,11 @@ bool WebContentsImpl::OnUpdateDragCursor() {
browser_plugin_embedder_->OnUpdateDragCursor();
}
+void WebContentsImpl::OnCursorChanged(const WebCursor& cursor) {
+ for (auto& observer : observers_)
+ observer.OnCursorChanged(cursor);
+}
+
bool WebContentsImpl::IsWidgetForMainFrame(
RenderWidgetHostImpl* render_widget_host) {
return render_widget_host == GetMainFrame()->GetRenderWidgetHost();
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 3316e61f8c1c1295748d5fc279fc3f14140fc59d..2558f46121c3635a54b22dde070def374d511bb3 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -912,6 +912,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void SendScreenRects() override;
TextInputManager* GetTextInputManager() override;
bool OnUpdateDragCursor() override;
+ void OnCursorChanged(const WebCursor& cursor) override;
bool IsWidgetForMainFrame(RenderWidgetHostImpl* render_widget_host) override;
bool AddDomainInfoToRapporSample(rappor::Sample* sample) override;
bool IsShowingContextMenuOnPage() const override;
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index da2c6572dd7e9bbd6f59b864edc73dae56ca2103..4eb46a9b37f66fe41ae9e62ac8848801e065acda 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -14,6 +14,7 @@
#include "base/threading/thread_restrictions.h"
#include "components/viz/common/vertical_scroll_direction.h"
#include "content/common/content_export.h"
+#include "content/common/cursors/webcursor.h"
#include "content/public/browser/allow_service_worker_result.h"
#include "content/public/browser/cookie_access_details.h"
#include "content/public/browser/navigation_controller.h"
@@ -365,6 +366,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener {
// Invoked every time the WebContents changes visibility.
virtual void OnVisibilityChanged(Visibility visibility) {}
+ // Invoked every time the RenderWidget's cursor changes.
+ virtual void OnCursorChanged(const WebCursor& cursor) {}
+
// Invoked when the main frame changes size.
virtual void MainFrameWasResized(bool width_changed) {}

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 f97342f99b9fb3d00761f6d4d27181a0f0edfdc7..a8c2ee219e16f4cd404f1e1d078416452a93e17a 100644
index 403a8c870a59d9dd46d20aa51b5bf966d47ed162..5914d502c879d32023a2659fac754aa925752145 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -603,6 +603,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
@@ -608,6 +608,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
return false;
}
@@ -24,7 +24,7 @@ index f97342f99b9fb3d00761f6d4d27181a0f0edfdc7..a8c2ee219e16f4cd404f1e1d07841645
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 30736d62881ba8e7515465b880556f6179077e96..d1bca5b1ac4a06bbc64ccef0d6310591da37908a 100644
index 39f1c8d6ee464ba577d483308e73bc028c901d27..880ddb6b20c3ef19a537fd96511a096a7d29c606 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -23,9 +23,11 @@

View File

@@ -10,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 9461c206fe9e7062d5b3f0af26d3afb7320aa7aa..4b3d0f92e0dfffda8e86e8eab0539425da2fbbad 100644
index a629da6b5496964814ddf144a9cfa3f1c586ee4f..866b25da5977c4ebc4569abb1869329809ab16d3 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -154,6 +154,11 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -225,6 +225,11 @@ void ExtractUnderlines(NSAttributedString* string,
} // namespace
@@ -25,7 +25,7 @@ index 9461c206fe9e7062d5b3f0af26d3afb7320aa7aa..4b3d0f92e0dfffda8e86e8eab0539425
// These are not documented, so use only after checking -respondsToSelector:.
@interface NSApplication (UndocumentedSpeechMethods)
- (void)speakString:(NSString*)string;
@@ -573,6 +578,9 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -644,6 +649,9 @@ void ExtractUnderlines(NSAttributedString* string,
}
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
@@ -35,7 +35,7 @@ index 9461c206fe9e7062d5b3f0af26d3afb7320aa7aa..4b3d0f92e0dfffda8e86e8eab0539425
return [self acceptsMouseEventsWhenInactive];
}
@@ -983,6 +991,10 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -1069,6 +1077,10 @@ void ExtractUnderlines(NSAttributedString* string,
eventType == NSKeyDown &&
!(modifierFlags & NSCommandKeyMask);
@@ -46,7 +46,7 @@ index 9461c206fe9e7062d5b3f0af26d3afb7320aa7aa..4b3d0f92e0dfffda8e86e8eab0539425
// We only handle key down events and just simply forward other events.
if (eventType != NSKeyDown) {
_hostHelper->ForwardKeyboardEvent(event, latency_info);
@@ -1759,9 +1771,11 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -1845,9 +1857,11 @@ void ExtractUnderlines(NSAttributedString* string,
// 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 9461c206fe9e7062d5b3f0af26d3afb7320aa7aa..4b3d0f92e0dfffda8e86e8eab0539425
- (NSArray*)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
@@ -1770,7 +1784,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
@@ -1856,7 +1870,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
initWithObjects:NSUnderlineStyleAttributeName,
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,

View File

@@ -52,10 +52,10 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 5ce71dd7f2e469a08b2f698cfcd313b9e010289e..b310951256feb884df6b2a7f59cfd286f06b3d76 100644
index d078afa65f08c847683897fba1952b098003f06b..268344419ba130700cf75fd8780678ad087a2970 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1372,7 +1372,7 @@ if (is_chrome_branded && !is_android) {
@@ -1423,7 +1423,7 @@ if (is_chrome_branded && !is_android) {
}
}
@@ -64,7 +64,7 @@ index 5ce71dd7f2e469a08b2f698cfcd313b9e010289e..b310951256feb884df6b2a7f59cfd286
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1392,6 +1392,12 @@ if (!is_android) {
@@ -1443,6 +1443,12 @@ if (!is_android) {
}
}

View File

@@ -1,478 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Wed, 28 Aug 2019 14:00:54 -0700
Subject: Revert "Cleanup: Remove Menu Subtitles/Sublabels"
This reverts commit 27a7b3648684204ccb16ede5cf3947579bd6c222.
diff --git a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
index 7b4531d031e6ba365fc4db35e9b68658f00f79fd..a7ef23c0d6623136531696928778bd0801726aa0 100644
--- a/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/mock_render_view_context_menu.cc
@@ -157,7 +157,7 @@ void MockRenderViewContextMenu::AppendSubMenuItems(ui::MenuModel* model) {
sub_item.enabled = model->IsEnabledAt(i);
sub_item.checked = model->IsItemCheckedAt(i);
sub_item.hidden = false;
- sub_item.title = model->GetLabelAt(i);
+ sub_item.title = model->GetSublabelAt(i);
items_.push_back(sub_item);
}
}
diff --git a/chrome/browser/status_icons/status_icon_menu_model.cc b/chrome/browser/status_icons/status_icon_menu_model.cc
index bc3cb82154ab964d7ef28fdb90db17782eb74564..d4da1ad6447e0241433019e726edecc66ed76ad6 100644
--- a/chrome/browser/status_icons/status_icon_menu_model.cc
+++ b/chrome/browser/status_icons/status_icon_menu_model.cc
@@ -20,6 +20,7 @@ struct StatusIconMenuModel::ItemState {
bool is_dynamic;
ui::Accelerator accelerator;
base::string16 label;
+ base::string16 sublabel;
gfx::Image icon;
};
@@ -61,6 +62,13 @@ void StatusIconMenuModel::ChangeLabelForCommandId(int command_id,
NotifyMenuStateChanged();
}
+void StatusIconMenuModel::ChangeSublabelForCommandId(
+ int command_id, const base::string16& sublabel) {
+ item_states_[command_id].is_dynamic = true;
+ item_states_[command_id].sublabel = sublabel;
+ NotifyMenuStateChanged();
+}
+
void StatusIconMenuModel::ChangeIconForCommandId(
int command_id, const gfx::Image& icon) {
item_states_[command_id].is_dynamic = true;
@@ -122,6 +130,14 @@ base::string16 StatusIconMenuModel::GetLabelForCommandId(int command_id) const {
return base::string16();
}
+base::string16 StatusIconMenuModel::GetSublabelForCommandId(
+ int command_id) const {
+ auto iter = item_states_.find(command_id);
+ if (iter != item_states_.end())
+ return iter->second.sublabel;
+ return base::string16();
+}
+
ui::ImageModel StatusIconMenuModel::GetIconForCommandId(int command_id) const {
auto iter = item_states_.find(command_id);
if (iter != item_states_.end() && !iter->second.icon.IsEmpty())
diff --git a/chrome/browser/status_icons/status_icon_menu_model.h b/chrome/browser/status_icons/status_icon_menu_model.h
index c69344ab9b4e1a4fb1293abf65a392d513099e4a..b6f90d0a6902848b18201d12b7441d874807eee9 100644
--- a/chrome/browser/status_icons/status_icon_menu_model.h
+++ b/chrome/browser/status_icons/status_icon_menu_model.h
@@ -62,9 +62,11 @@ class StatusIconMenuModel
// Calling any of these "change" methods will mark the menu item as "dynamic"
// (see menu_model.h:IsItemDynamicAt) which many platforms take as a cue to
- // refresh the label and icon of the menu item each time the menu is
+ // refresh the label, sublabel and icon of the menu item each time the menu is
// shown.
void ChangeLabelForCommandId(int command_id, const base::string16& label);
+ void ChangeSublabelForCommandId(
+ int command_id, const base::string16& sublabel);
void ChangeIconForCommandId(int command_id, const gfx::Image& icon);
void AddObserver(Observer* observer);
@@ -78,6 +80,7 @@ class StatusIconMenuModel
ui::Accelerator* accelerator) const override;
bool IsItemForCommandIdDynamic(int command_id) const override;
base::string16 GetLabelForCommandId(int command_id) const override;
+ base::string16 GetSublabelForCommandId(int command_id) const override;
ui::ImageModel GetIconForCommandId(int command_id) const override;
protected:
diff --git a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc
index 952714121ff7c5ffdcdb0d757450b53d926f2fc8..2c4de7bddc5d47ba4d0e528a98d4d1df65bc59f8 100644
--- a/chrome/browser/status_icons/status_icon_menu_model_unittest.cc
+++ b/chrome/browser/status_icons/status_icon_menu_model_unittest.cc
@@ -86,6 +86,10 @@ TEST_F(StatusIconMenuModelTest, SetProperties) {
menu_model()->ChangeLabelForCommandId(0, ASCIIToUTF16("label2"));
EXPECT_EQ(ASCIIToUTF16("label2"), menu_model()->GetLabelForCommandId(0));
+ // Set the sublabel and icon image for the second menu item.
+ menu_model()->ChangeSublabelForCommandId(1, ASCIIToUTF16("sublabel"));
+ EXPECT_EQ(ASCIIToUTF16("sublabel"), menu_model()->GetSublabelForCommandId(1));
+
// Try setting icon image and changing it.
menu_model()->ChangeIconForCommandId(1, test_image1);
image_arg = menu_model()->GetIconForCommandId(1);
@@ -96,8 +100,9 @@ TEST_F(StatusIconMenuModelTest, SetProperties) {
// Ensure changes to one menu item does not affect the other menu item.
EXPECT_FALSE(menu_model()->GetAcceleratorForCommandId(1, &accel_arg));
EXPECT_EQ(base::string16(), menu_model()->GetLabelForCommandId(1));
+ EXPECT_EQ(base::string16(), menu_model()->GetSublabelForCommandId(0));
EXPECT_TRUE(menu_model()->GetIconForCommandId(0).IsEmpty());
- // Menu state should have changed 6 times in this test.
- EXPECT_EQ(6, changed_count());
+ // Menu state should have changed 7 times in this test.
+ EXPECT_EQ(7, changed_count());
}
diff --git a/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc b/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc
index 331f33660d682c14f7c5d096d8d1241d3670f4ee..a1699d1bd23f3dc1e063bd1dc3f2818c543f40c2 100644
--- a/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/menu_item_view_interactive_uitest.cc
@@ -92,8 +92,9 @@ class MenuItemViewTestInsert : public MenuTestBase {
inserted_item_ = menu()->AddMenuItemAt(
INSERT_INDEX, 1000, ASCIIToUTF16("inserted item"), base::string16(),
- ui::ThemedVectorIcon(), gfx::ImageSkia(), ui::ThemedVectorIcon(),
- views::MenuItemView::Type::kNormal, ui::NORMAL_SEPARATOR);
+ base::string16(), ui::ThemedVectorIcon(), gfx::ImageSkia(),
+ ui::ThemedVectorIcon(), views::MenuItemView::Type::kNormal,
+ ui::NORMAL_SEPARATOR);
ASSERT_TRUE(inserted_item_);
menu()->ChildrenChanged();
@@ -187,7 +188,11 @@ class MenuItemViewTestInsertWithSubmenu : public MenuTestBase {
void Step2() {
inserted_item_ = menu()->AddMenuItemAt(
INSERT_INDEX, 1000, ASCIIToUTF16("inserted item"), base::string16(),
+<<<<<<< HEAD
ui::ThemedVectorIcon(), gfx::ImageSkia(), ui::ThemedVectorIcon(),
+=======
+ base::string16(), nullptr, gfx::ImageSkia(), nullptr,
+>>>>>>> Revert "Cleanup: Remove Menu Subtitles/Sublabels"
views::MenuItemView::Type::kNormal, ui::NORMAL_SEPARATOR);
ASSERT_TRUE(inserted_item_);
menu()->ChildrenChanged();
diff --git a/chrome/browser/ui/views/status_icons/concat_menu_model.cc b/chrome/browser/ui/views/status_icons/concat_menu_model.cc
index c6fb2f029c87391e13a9c05fe6c8f3f6e0b82779..5bf9acfa5c5ec08144b3e9e290fd19f15d307a8f 100644
--- a/chrome/browser/ui/views/status_icons/concat_menu_model.cc
+++ b/chrome/browser/ui/views/status_icons/concat_menu_model.cc
@@ -33,6 +33,10 @@ base::string16 ConcatMenuModel::GetLabelAt(int index) const {
return GetterImpl(&ui::MenuModel::GetLabelAt, index);
}
+base::string16 ConcatMenuModel::GetSublabelAt(int index) const {
+ return GetterImpl(&ui::MenuModel::GetSublabelAt, index);
+}
+
base::string16 ConcatMenuModel::GetMinorTextAt(int index) const {
return GetterImpl(&ui::MenuModel::GetMinorTextAt, index);
}
diff --git a/chrome/browser/ui/views/status_icons/concat_menu_model.h b/chrome/browser/ui/views/status_icons/concat_menu_model.h
index bad06f01f90b2ecfec3e7478034dde83ef643e53..c4414b8cb67f99dc4b1e4ed9088204f660a63098 100644
--- a/chrome/browser/ui/views/status_icons/concat_menu_model.h
+++ b/chrome/browser/ui/views/status_icons/concat_menu_model.h
@@ -24,6 +24,7 @@ class ConcatMenuModel : public ui::MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
int GetCommandIdAt(int index) const override;
base::string16 GetLabelAt(int index) const override;
+ base::string16 GetSublabelAt(int index) const override;
base::string16 GetMinorTextAt(int index) const override;
ui::ImageModel GetMinorIconAt(int index) const override;
bool IsItemDynamicAt(int index) const override;
diff --git a/ui/base/models/menu_model.cc b/ui/base/models/menu_model.cc
index 90a350cf9ce045b1f920ff58d84cd9a32ab4b267..e31b71712591e54a33f93d7a1e44353a8a36ffaa 100644
--- a/ui/base/models/menu_model.cc
+++ b/ui/base/models/menu_model.cc
@@ -48,6 +48,10 @@ bool MenuModel::GetModelAndIndexForCommandId(int command_id,
return false;
}
+base::string16 MenuModel::GetSublabelAt(int index) const {
+ return base::string16();
+}
+
base::string16 MenuModel::GetMinorTextAt(int index) const {
return base::string16();
}
diff --git a/ui/base/models/menu_model.h b/ui/base/models/menu_model.h
index 887eee64e27f7437be2b308c1d74b0ea49efc745..340109357fb9840744f231d583722f369fa885d7 100644
--- a/ui/base/models/menu_model.h
+++ b/ui/base/models/menu_model.h
@@ -65,6 +65,10 @@ class UI_BASE_EXPORT MenuModel : public base::SupportsWeakPtr<MenuModel> {
// Returns the label of the item at the specified index.
virtual base::string16 GetLabelAt(int index) const = 0;
+ // Returns the sublabel of the item at the specified index. The sublabel
+ // is rendered beneath the label and using the font GetLabelFontAt().
+ virtual base::string16 GetSublabelAt(int index) const;
+
// Returns the minor text of the item at the specified index. The minor text
// is rendered to the right of the label and using the font GetLabelFontAt().
virtual base::string16 GetMinorTextAt(int index) const;
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 88053e9d501413d18b6a6ae36b76668431db7ee9..2af6fb77acbe97e7dd7f02f646a91f0fb27878ab 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -49,6 +49,16 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
return base::string16();
}
+base::string16 SimpleMenuModel::Delegate::GetSublabelForCommandId(
+ int command_id) const {
+ return base::string16();
+}
+
+void SimpleMenuModel::SetSublabel(int index, const base::string16& sublabel) {
+ items_[ValidateItemIndex(index)].sublabel = sublabel;
+ MenuItemsChanged();
+}
+
ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
int command_id) const {
return ImageModel();
@@ -364,6 +374,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
return items_[ValidateItemIndex(index)].label;
}
+base::string16 SimpleMenuModel::GetSublabelAt(int index) const {
+ if (IsItemDynamicAt(index))
+ return delegate_->GetSublabelForCommandId(GetCommandIdAt(index));
+ return items_[ValidateItemIndex(index)].sublabel;
+}
+
base::string16 SimpleMenuModel::GetMinorTextAt(int index) const {
return items_[ValidateItemIndex(index)].minor_text;
}
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index 2b06f3f4a03227ac7898fc3563ab04518d24a313..f7c42c8cea2d7e8198e1fb58dbb2beaf006bf4b0 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -45,6 +45,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
virtual base::string16 GetLabelForCommandId(int command_id) const;
// Gets the icon for the item with the specified id.
virtual ImageModel GetIconForCommandId(int command_id) const;
+ virtual base::string16 GetSublabelForCommandId(int command_id) const;
// Performs the action associates with the specified command id.
// The passed |event_flags| are the flags from the event which issued this
@@ -146,6 +147,9 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
// Sets the label for the item at |index|.
void SetLabel(int index, const base::string16& label);
+ // Sets the sublabel for the item at |index|.
+ void SetSublabel(int index, const base::string16& sublabel);
+
// Sets the minor text for the item at |index|.
void SetMinorText(int index, const base::string16& minor_text);
@@ -172,6 +176,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
int GetCommandIdAt(int index) const override;
base::string16 GetLabelAt(int index) const override;
+ base::string16 GetSublabelAt(int index) const override;
base::string16 GetMinorTextAt(int index) const override;
ImageModel GetMinorIconAt(int index) const override;
bool IsItemDynamicAt(int index) const override;
@@ -206,6 +211,7 @@ class UI_BASE_EXPORT SimpleMenuModel : public MenuModel {
int command_id = 0;
ItemType type = TYPE_COMMAND;
base::string16 label;
+ base::string16 sublabel;
base::string16 minor_text;
ImageModel minor_icon;
ImageModel icon;
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index 6f45e5ac5d1cec52f6f9a434c06cd894a788e421..2167b02facb30fcff40a166038e093fc7855bf49 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -261,6 +261,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
int index,
int item_id,
const base::string16& label,
+ const base::string16& sublabel,
const base::string16& minor_text,
const ui::ThemedVectorIcon& minor_icon,
const gfx::ImageSkia& icon,
@@ -282,6 +283,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
item->SetTitle(GetDelegate()->GetLabel(item_id));
else
item->SetTitle(label);
+ item->SetSubtitle(sublabel);
item->SetMinorText(minor_text);
item->SetMinorIcon(minor_icon);
if (!vector_icon.empty()) {
@@ -322,21 +324,22 @@ void MenuItemView::RemoveAllMenuItems() {
MenuItemView* MenuItemView::AppendMenuItem(int item_id,
const base::string16& label,
const gfx::ImageSkia& icon) {
- return AppendMenuItemImpl(item_id, label, icon, Type::kNormal);
+ return AppendMenuItemImpl(item_id, label, base::string16(), icon, Type::kNormal);
}
MenuItemView* MenuItemView::AppendSubMenu(int item_id,
const base::string16& label,
const gfx::ImageSkia& icon) {
- return AppendMenuItemImpl(item_id, label, icon, Type::kSubMenu);
+ return AppendMenuItemImpl(item_id, label, base::string16(), icon, Type::kSubMenu);
}
void MenuItemView::AppendSeparator() {
- AppendMenuItemImpl(0, base::string16(), gfx::ImageSkia(), Type::kSeparator);
+ AppendMenuItemImpl(0, base::string16(), base::string16(), gfx::ImageSkia(), Type::kSeparator);
}
void MenuItemView::AddSeparatorAt(int index) {
AddMenuItemAt(index, /*item_id=*/0, /*label=*/base::string16(),
+ /*sub_label=*/base::string16(),
/*minor_text=*/base::string16(),
/*minor_icon=*/ui::ThemedVectorIcon(),
/*icon=*/gfx::ImageSkia(),
@@ -347,10 +350,11 @@ void MenuItemView::AddSeparatorAt(int index) {
MenuItemView* MenuItemView::AppendMenuItemImpl(int item_id,
const base::string16& label,
+ const base::string16& sublabel,
const gfx::ImageSkia& icon,
Type type) {
const int index = submenu_ ? int{submenu_->children().size()} : 0;
- return AddMenuItemAt(index, item_id, label, base::string16(),
+ return AddMenuItemAt(index, item_id, label, sublabel, base::string16(),
ui::ThemedVectorIcon(), icon, ui::ThemedVectorIcon(),
type, ui::NORMAL_SEPARATOR);
}
@@ -383,6 +387,11 @@ void MenuItemView::SetTitle(const base::string16& title) {
invalidate_dimensions(); // Triggers preferred size recalculation.
}
+void MenuItemView::SetSubtitle(const base::string16& subtitle) {
+ subtitle_ = subtitle;
+ invalidate_dimensions(); // Triggers preferred size recalculation.
+}
+
void MenuItemView::SetMinorText(const base::string16& minor_text) {
minor_text_ = minor_text;
invalidate_dimensions(); // Triggers preferred size recalculation.
@@ -937,13 +946,23 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
(!delegate || delegate->ShouldReserveSpaceForSubmenuIndicator()
? item_right_margin_
: config.arrow_to_edge_padding);
- gfx::Rect text_bounds(label_start, top_margin, width, available_height);
+ gfx::Rect text_bounds(label_start, top_margin, width,
+ subtitle_.empty() ? available_height
+ : available_height / 2);
text_bounds.set_x(GetMirroredXForRect(text_bounds));
int flags = GetDrawStringFlags();
if (mode == PaintButtonMode::kForDrag)
flags |= gfx::Canvas::NO_SUBPIXEL_RENDERING;
canvas->DrawStringRectWithFlags(title(), style.font_list, style.foreground,
text_bounds, flags);
+ if (!subtitle_.empty()) {
+ canvas->DrawStringRectWithFlags(
+ subtitle_, style.font_list,
+ GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_MenuItemMinorTextColor),
+ text_bounds + gfx::Vector2d(0, style.font_list.GetHeight()), flags);
+ }
+
PaintMinorIconAndText(canvas, style);
// Set the submenu indicator (arrow) image and color.
@@ -1195,15 +1214,20 @@ MenuItemView::MenuItemDimensions MenuItemView::CalculateDimensions() const {
// Determine the length of the label text.
int string_width = gfx::GetStringWidth(title_, style.font_list);
+ if (!subtitle_.empty()) {
+ string_width =
+ std::max(string_width, gfx::GetStringWidth(subtitle_, style.font_list));
+ }
dimensions.standard_width = string_width + label_start + item_right_margin_;
// Determine the length of the right-side text.
dimensions.minor_text_width =
minor_text.empty() ? 0 : gfx::GetStringWidth(minor_text, style.font_list);
// Determine the height to use.
- dimensions.height =
- std::max(dimensions.height, style.font_list.GetHeight() +
- GetBottomMargin() + GetTopMargin());
+ dimensions.height = std::max(
+ dimensions.height, (subtitle_.empty() ? 0 : style.font_list.GetHeight()) +
+ style.font_list.GetHeight() + GetBottomMargin() +
+ GetTopMargin());
dimensions.height =
std::max(dimensions.height, MenuConfig::instance().item_min_height);
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index b38a048c22e6f89dfc02d7bda2ed053519a80e29..2db46616cb9a443d6fd280947e5a2673f9ca670c 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -148,6 +148,7 @@ class VIEWS_EXPORT MenuItemView : public View {
MenuItemView* AddMenuItemAt(int index,
int item_id,
const base::string16& label,
+ const base::string16& sublabel,
const base::string16& minor_text,
const ui::ThemedVectorIcon& minor_icon,
const gfx::ImageSkia& icon,
@@ -190,6 +191,7 @@ class VIEWS_EXPORT MenuItemView : public View {
// All the AppendXXX methods funnel into this.
MenuItemView* AppendMenuItemImpl(int item_id,
const base::string16& label,
+ const base::string16& sublabel,
const gfx::ImageSkia& icon,
Type type);
@@ -214,6 +216,9 @@ class VIEWS_EXPORT MenuItemView : public View {
void SetTitle(const base::string16& title);
const base::string16& title() const { return title_; }
+ // Sets the subtitle.
+ void SetSubtitle(const base::string16& subtitle);
+
// Sets the minor text.
void SetMinorText(const base::string16& minor_text);
@@ -420,7 +425,7 @@ class VIEWS_EXPORT MenuItemView : public View {
void DestroyAllMenuHosts();
// Returns the text that should be displayed on the end (right) of the menu
- // item. This will be the accelerator (if one exists).
+ // item. This will be the accelerator (if one exists), otherwise |subtitle_|.
base::string16 GetMinorText() const;
// Returns the icon that should be displayed to the left of the minor text.
@@ -511,6 +516,9 @@ class VIEWS_EXPORT MenuItemView : public View {
// Title.
base::string16 title_;
+ // Subtitle/sublabel.
+ base::string16 subtitle_;
+
// Minor text.
base::string16 minor_text_;
diff --git a/ui/views/controls/menu/menu_item_view_unittest.cc b/ui/views/controls/menu/menu_item_view_unittest.cc
index 119aa4a49c32c2cb14832fd88a520e8645b732bd..e1f99e1fc7a3e42173250f5980a35378867ab298 100644
--- a/ui/views/controls/menu/menu_item_view_unittest.cc
+++ b/ui/views/controls/menu/menu_item_view_unittest.cc
@@ -324,8 +324,8 @@ class MenuItemViewPaintUnitTest : public ViewsTestBase {
TEST_F(MenuItemViewPaintUnitTest, MinorTextAndIconAssertionCoverage) {
auto AddItem = [this](auto label, auto minor_label, auto minor_icon) {
menu_item_view()->AddMenuItemAt(
- 0, 1000, base::ASCIIToUTF16(label), minor_label, minor_icon,
- gfx::ImageSkia(), ui::ThemedVectorIcon(),
+ 0, 1000, base::ASCIIToUTF16(label), base::string16(), minor_label,
+ minor_icon, gfx::ImageSkia(), ui::ThemedVectorIcon(),
views::MenuItemView::Type::kNormal, ui::NORMAL_SEPARATOR);
};
AddItem("No minor content", base::string16(), ui::ThemedVectorIcon());
diff --git a/ui/views/controls/menu/menu_model_adapter.cc b/ui/views/controls/menu/menu_model_adapter.cc
index cbf9288765ade430451251f8f266975b2047828d..2aea7766d807120866872cbd7fa17776259f30b8 100644
--- a/ui/views/controls/menu/menu_model_adapter.cc
+++ b/ui/views/controls/menu/menu_model_adapter.cc
@@ -99,8 +99,9 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model,
if (*type == MenuItemView::Type::kSeparator) {
return menu->AddMenuItemAt(menu_index, item_id, base::string16(),
- base::string16(), ui::ThemedVectorIcon(),
- gfx::ImageSkia(), ui::ThemedVectorIcon(), *type,
+ base::string16(), base::string16(),
+ ui::ThemedVectorIcon(), gfx::ImageSkia(),
+ ui::ThemedVectorIcon(), *type,
model->GetSeparatorTypeAt(model_index));
}
@@ -108,6 +109,7 @@ MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model,
ui::ImageModel minor_icon = model->GetMinorIconAt(model_index);
return menu->AddMenuItemAt(
menu_index, item_id, model->GetLabelAt(model_index),
+ model->GetSublabelAt(model_index),
model->GetMinorTextAt(model_index),
minor_icon.IsVectorIcon()
? ui::ThemedVectorIcon(minor_icon.GetVectorIcon())

View File

@@ -9,10 +9,10 @@ for every navigation to keep Node.js working properly. Once Native Modules in th
are required to be NAPI or context aware (Electron v11), this patch can be removed.
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 4a1bbc64b3bcc27d742fff2b7a7b3de73e9c7426..c5505f99bed35f0eaf5b968555ed5c3be4ec1e47 100644
index 86c0ba41074161a137a659afdd2d460dde07d589..de9c3e5f4f502c531af0d15529d535e31ba30dce 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -1294,6 +1294,25 @@ bool ChromeContentRendererClient::AllowPopup() {
@@ -1295,6 +1295,25 @@ bool ChromeContentRendererClient::AllowPopup() {
#endif
}
@@ -39,10 +39,10 @@ index 4a1bbc64b3bcc27d742fff2b7a7b3de73e9c7426..c5505f99bed35f0eaf5b968555ed5c3b
WebLocalFrame* frame,
ui::PageTransition transition_type,
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index 7cea12e179544e5700e6cb393fafc8437166da9b..1042f99e33a75b76d5b59a97e813024487e31470 100644
index 416b7a8f3ba1b6941761c1df4ea108219c415489..2733d0dbbc10c5465a319b080d9b079258ba896d 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -126,6 +126,11 @@ class ChromeContentRendererClient
@@ -127,6 +127,11 @@ class ChromeContentRendererClient
base::SingleThreadTaskRunner* compositor_thread_task_runner) override;
bool RunIdleHandlerWhenWidgetsHidden() override;
bool AllowPopup() override;
@@ -55,10 +55,10 @@ index 7cea12e179544e5700e6cb393fafc8437166da9b..1042f99e33a75b76d5b59a97e8130244
ui::PageTransition transition_type,
const blink::WebURL& url,
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
index a1a8284038231e61d9f1d6302441e871abab4209..67a92523d1078cc7f47251614e27a6d9e9dcfb95 100644
index ea6d8e6357233f519c3cf41a96d8453993a9ce71..c513aff3e1c3da45e45954bc0beb80469de6a450 100644
--- a/content/public/renderer/content_renderer_client.cc
+++ b/content/public/renderer/content_renderer_client.cc
@@ -105,6 +105,14 @@ bool ContentRendererClient::HandleNavigation(
@@ -114,6 +114,14 @@ bool ContentRendererClient::HandleNavigation(
}
#endif
@@ -74,10 +74,10 @@ index a1a8284038231e61d9f1d6302441e871abab4209..67a92523d1078cc7f47251614e27a6d9
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index b35f479d7ef121021a5df8dfb471aead9af3517b..4945bb1e132ac9b2f325850c51000b48ebd82c44 100644
index 9d321040de33acac09e83cc582f685740f425009..8f328979cc232c4f81a7f040e2424273a8248015 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -217,6 +217,13 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -228,6 +228,13 @@ class CONTENT_EXPORT ContentRendererClient {
bool is_redirect);
#endif
@@ -92,10 +92,10 @@ index b35f479d7ef121021a5df8dfb471aead9af3517b..4945bb1e132ac9b2f325850c51000b48
// |url|. If the function returns a valid |new_url|, the request must be
// updated to use it. The |force_ignore_site_for_cookies| output parameter
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 95e9039217f44dcaf770ffea2979976e79d276ab..1126ef0b8bd28142583d77261af6a9c8041d1538 100644
index cb612a7002a4ae808ca488e2aa2adbb759310964..6442139eba458788125c7dbb03d1af6a8c156255 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5647,6 +5647,23 @@ void RenderFrameImpl::BeginNavigation(
@@ -5502,6 +5502,23 @@ void RenderFrameImpl::BeginNavigation(
// we can do a per-frame check here rather than a process-wide check.
bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
(enabled_bindings_ & kWebUIBindingsPolicyMask);

View File

@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
Patch to make scrollBounce option work.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 9e4a61421d3c4980c775f3fa21781b6f8f679ca1..123622e032d7af432e6ee86e357eba5e56574adb 100644
index 1c01ee6dda5857559b089022d4fdde5b33273745..9b311fe4c118db35a9008a9ad153a52a71625771 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1346,7 +1346,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
@@ -1355,7 +1355,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
}
bool RenderThreadImpl::IsElasticOverscrollEnabled() {

View File

@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
does touch a security-sensitive class.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 9beff8728eba07fe5bbb50701dcec78d61149fde..618700cc99de3174b9de9bc26abcaac5880ec21e 100644
index f33eb6d5a0e98e06cd3ba318e9b578df4bc9ab2c..0e84525e677131b3428e5fe73dfb7b48bf65a692 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -416,6 +416,11 @@ class RendererSandboxedProcessLauncherDelegate
@@ -412,6 +412,11 @@ class RendererSandboxedProcessLauncherDelegate
{
}
@@ -37,7 +37,7 @@ index 9beff8728eba07fe5bbb50701dcec78d61149fde..618700cc99de3174b9de9bc26abcaac5
~RendererSandboxedProcessLauncherDelegate() override {}
#if defined(OS_WIN)
@@ -437,6 +442,9 @@ class RendererSandboxedProcessLauncherDelegate
@@ -433,6 +438,9 @@ class RendererSandboxedProcessLauncherDelegate
#if BUILDFLAG(USE_ZYGOTE_HANDLE)
service_manager::ZygoteHandle GetZygote() override {
@@ -47,7 +47,7 @@ index 9beff8728eba07fe5bbb50701dcec78d61149fde..618700cc99de3174b9de9bc26abcaac5
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();
base::CommandLine::StringType renderer_prefix =
@@ -451,10 +459,13 @@ class RendererSandboxedProcessLauncherDelegate
@@ -447,10 +455,13 @@ class RendererSandboxedProcessLauncherDelegate
return service_manager::SandboxType::kRenderer;
}
@@ -62,7 +62,7 @@ index 9beff8728eba07fe5bbb50701dcec78d61149fde..618700cc99de3174b9de9bc26abcaac5
};
const char kSessionStorageHolderKey[] = "kSessionStorageHolderKey";
@@ -1822,11 +1833,18 @@ bool RenderProcessHostImpl::Init() {
@@ -1831,11 +1842,18 @@ bool RenderProcessHostImpl::Init() {
cmd_line->PrependWrapper(renderer_prefix);
AppendRendererCommandLine(cmd_line.get());

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