mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
Compare commits
45 Commits
v16.0.0-be
...
v16.0.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c16e94ebbf | ||
|
|
48be5c3387 | ||
|
|
9fd781073f | ||
|
|
c25edb5fdd | ||
|
|
cf6df4ae36 | ||
|
|
6729edf590 | ||
|
|
2415813313 | ||
|
|
136c539836 | ||
|
|
a76f2a07a9 | ||
|
|
8b6aecc6f0 | ||
|
|
3186a246a5 | ||
|
|
15ff515437 | ||
|
|
d3a24c24af | ||
|
|
f4a51e2adc | ||
|
|
cdc897c745 | ||
|
|
8c842552b0 | ||
|
|
e918fe6030 | ||
|
|
d9e0025429 | ||
|
|
5fc4a4768e | ||
|
|
cf54123ec6 | ||
|
|
948aa12af0 | ||
|
|
5fdf37eac9 | ||
|
|
1dcf237c8d | ||
|
|
8285172412 | ||
|
|
5735cb3cb0 | ||
|
|
1adea9e34e | ||
|
|
0cb6a2ea8a | ||
|
|
48e9e34acd | ||
|
|
1433180472 | ||
|
|
48a1117cbf | ||
|
|
b213c345bf | ||
|
|
46b8dcfb03 | ||
|
|
5c48a94b48 | ||
|
|
22df8eadbf | ||
|
|
8520fa8e6f | ||
|
|
517493a1f3 | ||
|
|
c10c449258 | ||
|
|
5026e7823e | ||
|
|
c063a2d9fe | ||
|
|
c46620d4ba | ||
|
|
92f20955bd | ||
|
|
762ecfef24 | ||
|
|
ea96f4c176 | ||
|
|
d085de4787 | ||
|
|
dd7a8da6be |
4
BUILD.gn
4
BUILD.gn
@@ -420,7 +420,6 @@ source_set("electron_lib") {
|
||||
]
|
||||
|
||||
include_dirs = [
|
||||
"chromium_src",
|
||||
".",
|
||||
"$target_gen_dir",
|
||||
|
||||
@@ -554,8 +553,9 @@ source_set("electron_lib") {
|
||||
"GLIB_DISABLE_DEPRECATION_WARNINGS",
|
||||
]
|
||||
|
||||
sources += filenames.lib_sources_nss
|
||||
sources += [
|
||||
"shell/browser/certificate_manager_model.cc",
|
||||
"shell/browser/certificate_manager_model.h",
|
||||
"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",
|
||||
|
||||
2
DEPS
2
DEPS
@@ -15,7 +15,7 @@ gclient_gn_args = [
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'96.0.4647.0',
|
||||
'96.0.4664.35',
|
||||
'node_version':
|
||||
'v16.9.1',
|
||||
'nan_version':
|
||||
|
||||
@@ -1 +1 @@
|
||||
16.0.0-beta.2
|
||||
16.0.0-beta.9
|
||||
@@ -15,6 +15,8 @@ static_library("chrome") {
|
||||
sources = [
|
||||
"//chrome/browser/accessibility/accessibility_ui.cc",
|
||||
"//chrome/browser/accessibility/accessibility_ui.h",
|
||||
"//chrome/browser/app_mode/app_mode_utils.cc",
|
||||
"//chrome/browser/app_mode/app_mode_utils.h",
|
||||
"//chrome/browser/browser_process.cc",
|
||||
"//chrome/browser/browser_process.h",
|
||||
"//chrome/browser/devtools/devtools_contents_resizing_strategy.cc",
|
||||
@@ -25,6 +27,7 @@ static_library("chrome") {
|
||||
"//chrome/browser/devtools/devtools_eye_dropper.h",
|
||||
"//chrome/browser/devtools/devtools_file_system_indexer.cc",
|
||||
"//chrome/browser/devtools/devtools_file_system_indexer.h",
|
||||
"//chrome/browser/devtools/devtools_settings.h",
|
||||
"//chrome/browser/extensions/global_shortcut_listener.cc",
|
||||
"//chrome/browser/extensions/global_shortcut_listener.h",
|
||||
"//chrome/browser/icon_loader.cc",
|
||||
@@ -50,6 +53,20 @@ static_library("chrome") {
|
||||
"//chrome/browser/process_singleton.h",
|
||||
"//chrome/browser/ui/browser_dialogs.cc",
|
||||
"//chrome/browser/ui/browser_dialogs.h",
|
||||
"//chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc",
|
||||
"//chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h",
|
||||
"//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc",
|
||||
"//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h",
|
||||
"//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc",
|
||||
"//chrome/browser/ui/exclusive_access/exclusive_access_manager.h",
|
||||
"//chrome/browser/ui/exclusive_access/fullscreen_controller.cc",
|
||||
"//chrome/browser/ui/exclusive_access/fullscreen_controller.h",
|
||||
"//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc",
|
||||
"//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h",
|
||||
"//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc",
|
||||
"//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
|
||||
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
|
||||
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
|
||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
|
||||
"//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
|
||||
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
|
||||
@@ -96,7 +113,7 @@ static_library("chrome") {
|
||||
}
|
||||
|
||||
if (is_linux) {
|
||||
sources += [ "//chrome/browser/media/webrtc/window_icon_util_linux.cc" ]
|
||||
sources += [ "//chrome/browser/media/webrtc/window_icon_util_ozone.cc" ]
|
||||
}
|
||||
|
||||
if (use_aura) {
|
||||
@@ -113,13 +130,13 @@ static_library("chrome") {
|
||||
"//components/keyed_service/content",
|
||||
"//components/paint_preview/buildflags",
|
||||
"//components/proxy_config",
|
||||
"//components/services/language_detection/public/mojom",
|
||||
"//content/public/browser",
|
||||
"//services/strings",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//chrome/browser:resource_prefetch_predictor_proto",
|
||||
"//chrome/services/speech:buildflags",
|
||||
"//components/optimization_guide/proto:optimization_guide_proto",
|
||||
]
|
||||
|
||||
@@ -129,16 +146,6 @@ static_library("chrome") {
|
||||
|
||||
if (is_linux) {
|
||||
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
|
||||
if (use_x11 || use_ozone) {
|
||||
sources +=
|
||||
[ "//chrome/browser/extensions/global_shortcut_listener_linux.cc" ]
|
||||
}
|
||||
if (use_x11) {
|
||||
sources += [
|
||||
"//chrome/browser/extensions/global_shortcut_listener_x11.cc",
|
||||
"//chrome/browser/extensions/global_shortcut_listener_x11.h",
|
||||
]
|
||||
}
|
||||
if (use_ozone) {
|
||||
deps += [ "//ui/ozone" ]
|
||||
sources += [
|
||||
@@ -168,6 +175,7 @@ static_library("chrome") {
|
||||
|
||||
if (enable_desktop_capturer) {
|
||||
sources += [
|
||||
"//chrome/browser/media/webrtc/desktop_media_list.cc",
|
||||
"//chrome/browser/media/webrtc/desktop_media_list.h",
|
||||
"//chrome/browser/media/webrtc/desktop_media_list_base.cc",
|
||||
"//chrome/browser/media/webrtc/desktop_media_list_base.h",
|
||||
@@ -205,6 +213,13 @@ static_library("chrome") {
|
||||
"//chrome/browser/printing/printing_service.h",
|
||||
]
|
||||
|
||||
if (enable_oop_printing) {
|
||||
sources += [
|
||||
"//chrome/browser/printing/print_backend_service_manager.cc",
|
||||
"//chrome/browser/printing/print_backend_service_manager.h",
|
||||
]
|
||||
}
|
||||
|
||||
public_deps += [
|
||||
"//chrome/services/printing:lib",
|
||||
"//components/printing/browser",
|
||||
|
||||
@@ -59,10 +59,9 @@ an issue:
|
||||
* [Testing and Debugging](tutorial/application-debugging.md)
|
||||
* [Debugging the Main Process](tutorial/debugging-main-process.md)
|
||||
* [Debugging with Visual Studio Code](tutorial/debugging-vscode.md)
|
||||
* [Using Selenium and WebDriver](tutorial/using-selenium-and-webdriver.md)
|
||||
* [Testing on Headless CI Systems (Travis, Jenkins)](tutorial/testing-on-headless-ci.md)
|
||||
* [DevTools Extension](tutorial/devtools-extension.md)
|
||||
* [Automated Testing with a Custom Driver](tutorial/automated-testing-with-a-custom-driver.md)
|
||||
* [Automated Testing](tutorial/automated-testing.md)
|
||||
* [REPL](tutorial/repl.md)
|
||||
* [Distribution](tutorial/application-distribution.md)
|
||||
* [Supported Platforms](tutorial/support.md#supported-platforms)
|
||||
|
||||
@@ -36,10 +36,10 @@ Returns:
|
||||
* `launchInfo` Record<string, any> | [NotificationResponse](structures/notification-response.md) _macOS_
|
||||
|
||||
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
|
||||
holds the `userInfo` of the `NSUserNotification` or information from
|
||||
[`UNNotificationResponse`](structures/notification-response.md) that was used to open the
|
||||
application, if it was launched from Notification Center. You can also call
|
||||
`app.isReady()` to check if this event has already fired and `app.whenReady()`
|
||||
holds the `userInfo` of the [`NSUserNotification`](https://developer.apple.com/documentation/foundation/nsusernotification)
|
||||
or information from [`UNNotificationResponse`](https://developer.apple.com/documentation/usernotifications/unnotificationresponse)
|
||||
that was used to open the application, if it was launched from Notification Center.
|
||||
You can also call `app.isReady()` to check if this event has already fired and `app.whenReady()`
|
||||
to get a Promise that is fulfilled when Electron is initialized.
|
||||
|
||||
### Event: 'window-all-closed'
|
||||
|
||||
@@ -17,10 +17,11 @@ win.loadURL('https://github.com')
|
||||
win.loadFile('index.html')
|
||||
```
|
||||
|
||||
## Frameless window
|
||||
## Window customization
|
||||
|
||||
To create a window without chrome, or a transparent window in arbitrary shape,
|
||||
you can use the [Frameless Window](frameless-window.md) API.
|
||||
The `BrowserWindow` class exposes various ways to modify the look and behavior of
|
||||
your app's windows. For more details, see the [Window Customization](../tutorial/window-customization.md)
|
||||
tutorial.
|
||||
|
||||
## Showing the window gracefully
|
||||
|
||||
@@ -184,7 +185,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
`true`.
|
||||
* `paintWhenInitiallyHidden` Boolean (optional) - Whether the renderer should be active when `show` is `false` and it has just been created. In order for `document.visibilityState` to work correctly on first load with `show: false` you should set this to `false`. Setting this to `false` will cause the `ready-to-show` event to not fire. Default is `true`.
|
||||
* `frame` Boolean (optional) - Specify `false` to create a
|
||||
[Frameless Window](frameless-window.md). Default is `true`.
|
||||
[frameless window](../tutorial/window-customization.md#create-frameless-windows). Default is `true`.
|
||||
* `parent` BrowserWindow (optional) - Specify parent window. Default is `null`.
|
||||
* `modal` Boolean (optional) - Whether this is a modal window. This only works when the
|
||||
window is a child window. Default is `false`.
|
||||
@@ -206,7 +207,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
|
||||
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
|
||||
* `transparent` Boolean (optional) - Makes the window [transparent](../tutorial/window-customization.md#create-transparent-windows).
|
||||
Default is `false`. On Windows, does not work unless the window is frameless.
|
||||
* `type` String (optional) - The type of window, default is normal window. See more about
|
||||
this below.
|
||||
@@ -1696,7 +1697,7 @@ current window into a top-level window.
|
||||
|
||||
#### `win.getParentWindow()`
|
||||
|
||||
Returns `BrowserWindow` - The parent window.
|
||||
Returns `BrowserWindow | null` - The parent window or `null` if there is no parent.
|
||||
|
||||
#### `win.getChildWindows()`
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ Returns `Boolean` - Whether the clipboard supports the specified `format`.
|
||||
```js
|
||||
const { clipboard } = require('electron')
|
||||
|
||||
const hasFormat = clipboard.has('<p>selection</p>')
|
||||
const hasFormat = clipboard.has('public/utf8-plain-text')
|
||||
console.log(hasFormat)
|
||||
// 'true' or 'false'
|
||||
```
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
# Frameless Window
|
||||
|
||||
> Open a window without toolbars, borders, or other graphical "chrome".
|
||||
|
||||
A frameless window is a window that has no
|
||||
[chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome), the parts of
|
||||
the window, like toolbars, that are not a part of the web page. These are
|
||||
options on the [`BrowserWindow`](browser-window.md) class.
|
||||
|
||||
## Create a frameless window
|
||||
|
||||
To create a frameless window, you need to set `frame` to `false` in
|
||||
[BrowserWindow](browser-window.md)'s `options`:
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ width: 800, height: 600, frame: false })
|
||||
win.show()
|
||||
```
|
||||
|
||||
### Alternatives
|
||||
|
||||
There's an alternative way to specify a chromeless window on macOS and Windows.
|
||||
Instead of setting `frame` to `false` which disables both the titlebar and window controls,
|
||||
you may want to have the title bar hidden and your content extend to the full window size,
|
||||
yet still preserve the window controls ("traffic lights" on macOS) for standard window actions.
|
||||
You can do so by specifying the `titleBarStyle` option:
|
||||
|
||||
#### `hidden`
|
||||
|
||||
Results in a hidden title bar and a full size content window. On macOS, the title bar still has the standard window controls (“traffic lights”) in the top left.
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ titleBarStyle: 'hidden' })
|
||||
win.show()
|
||||
```
|
||||
|
||||
### Alternatives on macOS
|
||||
|
||||
#### `hiddenInset`
|
||||
|
||||
Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
|
||||
win.show()
|
||||
```
|
||||
|
||||
#### `customButtonsOnHover`
|
||||
|
||||
Uses custom drawn close, and miniaturize buttons that display
|
||||
when hovering in the top left of the window. The fullscreen button
|
||||
is not available due to restrictions of frameless windows as they
|
||||
interface with Apple's macOS window masks. These custom buttons prevent
|
||||
issues with mouse events that occur with the standard window toolbar buttons.
|
||||
This option is only applicable for frameless windows.
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: false })
|
||||
win.show()
|
||||
```
|
||||
|
||||
## Windows Control Overlay
|
||||
|
||||
When using a frameless window in conjuction with `win.setWindowButtonVisibility(true)` on macOS, using one of the `titleBarStyle`s as described above so
|
||||
that the traffic lights are visible, or using `titleBarStyle: hidden` on Windows, you can access the Window Controls Overlay [JavaScript APIs][overlay-javascript-apis] and
|
||||
[CSS Environment Variables][overlay-css-env-vars] by setting the `titleBarOverlay` option to true. Specifying `true` will result in an overlay with default system colors.
|
||||
|
||||
On Windows, you can also specify the color of the overlay and its symbols by setting `titleBarOverlay` to an object with the options `color` and `symbolColor`. If an option is not specified, the color will default to its system color for the window control buttons:
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({
|
||||
titleBarStyle: 'hidden',
|
||||
titleBarOverlay: true
|
||||
})
|
||||
win.show()
|
||||
```
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({
|
||||
titleBarStyle: 'hidden',
|
||||
titleBarOverlay: {
|
||||
color: '#2f3241',
|
||||
symbolColor: '#74b1be'
|
||||
}
|
||||
})
|
||||
win.show()
|
||||
```
|
||||
|
||||
## Transparent window
|
||||
|
||||
By setting the `transparent` option to `true`, you can also make the frameless
|
||||
window transparent:
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ transparent: true, frame: false })
|
||||
win.show()
|
||||
```
|
||||
|
||||
### Limitations
|
||||
|
||||
* You can not click through the transparent area. We are going to introduce an
|
||||
API to set window shape to solve this, see
|
||||
[our issue](https://github.com/electron/electron/issues/1335) for details.
|
||||
* Transparent windows are not resizable. Setting `resizable` to `true` may make
|
||||
a transparent window stop working on some platforms.
|
||||
* The `blur` filter only applies to the web page, so there is no way to apply
|
||||
blur effect to the content below the window (i.e. other applications open on
|
||||
the user's system).
|
||||
* The window will not be transparent when DevTools is opened.
|
||||
* On Windows operating systems,
|
||||
* transparent windows will not work when DWM is
|
||||
disabled.
|
||||
* transparent windows can not be maximized using the Windows system menu or by double clicking the title bar. The reasoning behind this can be seen on [this pull request](https://github.com/electron/electron/pull/28207).
|
||||
* On Linux, users have to put `--enable-transparent-visuals --disable-gpu` in
|
||||
the command line to disable GPU and allow ARGB to make transparent window,
|
||||
this is caused by an upstream bug that [alpha channel doesn't work on some
|
||||
NVidia drivers](https://bugs.chromium.org/p/chromium/issues/detail?id=369209) on
|
||||
Linux.
|
||||
* On Mac, the native window shadow will not be shown on a transparent window.
|
||||
|
||||
## Click-through window
|
||||
|
||||
To create a click-through window, i.e. making the window ignore all mouse
|
||||
events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events]
|
||||
API:
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow()
|
||||
win.setIgnoreMouseEvents(true)
|
||||
```
|
||||
|
||||
### Forwarding
|
||||
|
||||
Ignoring mouse messages makes the web page oblivious to mouse movement, meaning
|
||||
that mouse movement events will not be emitted. On Windows operating systems an
|
||||
optional parameter can be used to forward mouse move messages to the web page,
|
||||
allowing events such as `mouseleave` to be emitted:
|
||||
|
||||
```javascript
|
||||
const { ipcRenderer } = require('electron')
|
||||
const el = document.getElementById('clickThroughElement')
|
||||
el.addEventListener('mouseenter', () => {
|
||||
ipcRenderer.send('set-ignore-mouse-events', true, { forward: true })
|
||||
})
|
||||
el.addEventListener('mouseleave', () => {
|
||||
ipcRenderer.send('set-ignore-mouse-events', false)
|
||||
})
|
||||
|
||||
// Main process
|
||||
const { ipcMain } = require('electron')
|
||||
ipcMain.on('set-ignore-mouse-events', (event, ...args) => {
|
||||
BrowserWindow.fromWebContents(event.sender).setIgnoreMouseEvents(...args)
|
||||
})
|
||||
```
|
||||
|
||||
This makes the web page click-through when over `el`, and returns to normal
|
||||
outside it.
|
||||
|
||||
## Draggable region
|
||||
|
||||
By default, the frameless window is non-draggable. Apps need to specify
|
||||
`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable
|
||||
(like the OS's standard titlebar), and apps can also use
|
||||
`-webkit-app-region: no-drag` to exclude the non-draggable area from the
|
||||
draggable region. Note that only rectangular shapes are currently supported.
|
||||
|
||||
Note: `-webkit-app-region: drag` is known to have problems while the developer tools are open. See this [GitHub issue](https://github.com/electron/electron/issues/3647) for more information including a workaround.
|
||||
|
||||
To make the whole window draggable, you can add `-webkit-app-region: drag` as
|
||||
`body`'s style:
|
||||
|
||||
```html
|
||||
<body style="-webkit-app-region: drag">
|
||||
</body>
|
||||
```
|
||||
|
||||
And note that if you have made the whole window draggable, you must also mark
|
||||
buttons as non-draggable, otherwise it would be impossible for users to click on
|
||||
them:
|
||||
|
||||
```css
|
||||
button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
```
|
||||
|
||||
If you're only setting a custom titlebar as draggable, you also need to make all
|
||||
buttons in titlebar non-draggable.
|
||||
|
||||
## Text selection
|
||||
|
||||
In a frameless window the dragging behavior may conflict with selecting text.
|
||||
For example, when you drag the titlebar you may accidentally select the text on
|
||||
the titlebar. To prevent this, you need to disable text selection within a
|
||||
draggable area like this:
|
||||
|
||||
```css
|
||||
.titlebar {
|
||||
-webkit-user-select: none;
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
```
|
||||
|
||||
## Context menu
|
||||
|
||||
On some platforms, the draggable area will be treated as a non-client frame, so
|
||||
when you right click on it a system menu will pop up. To make the context menu
|
||||
behave correctly on all platforms you should never use a custom context menu on
|
||||
draggable areas.
|
||||
|
||||
[ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore-options
|
||||
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
||||
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
||||
@@ -59,8 +59,9 @@
|
||||
|
||||
<p>
|
||||
For more details, see the
|
||||
<a href="https://electronjs.org/docs/api/frameless-window/">
|
||||
Frameless Window
|
||||
<a href="https://electronjs.org/docs/tutorial/window-customization/">
|
||||
Window Customization
|
||||
|
||||
</a>
|
||||
documentation.
|
||||
</p>
|
||||
|
||||
@@ -1,48 +1,7 @@
|
||||
# Accessibility
|
||||
|
||||
Making accessible applications is important and we're happy to provide
|
||||
functionality to [Devtron][devtron] and [Spectron][spectron] that gives
|
||||
developers the opportunity to make their apps better for everyone.
|
||||
|
||||
---
|
||||
|
||||
Accessibility concerns in Electron applications are similar to those of
|
||||
websites because they're both ultimately HTML. With Electron apps, however,
|
||||
you can't use the online resources for accessibility audits because your app
|
||||
doesn't have a URL to point the auditor to.
|
||||
|
||||
These features bring those auditing tools to your Electron app. You can
|
||||
choose to add audits to your tests with Spectron or use them within DevTools
|
||||
with Devtron. Read on for a summary of the tools.
|
||||
|
||||
## Spectron
|
||||
|
||||
In the testing framework Spectron, you can now audit each window and `<webview>`
|
||||
tag in your application. For example:
|
||||
|
||||
```javascript
|
||||
app.client.auditAccessibility().then((audit) => {
|
||||
if (audit.failed) {
|
||||
console.error(audit.message)
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
You can read more about this feature in [Spectron's documentation][spectron-a11y].
|
||||
|
||||
## Devtron
|
||||
|
||||
In Devtron, there is an accessibility tab which will allow you to audit a
|
||||
page in your app, sort and filter the results.
|
||||
|
||||
![devtron screenshot][devtron-screenshot]
|
||||
|
||||
Both of these tools are using the [Accessibility Developer Tools][a11y-devtools]
|
||||
library built by Google for Chrome. You can learn more about the accessibility
|
||||
audit rules this library uses on that [repository's wiki][a11y-devtools-wiki].
|
||||
|
||||
If you know of other great accessibility tools for Electron, add them to the
|
||||
accessibility documentation with a pull request.
|
||||
websites because they're both ultimately HTML.
|
||||
|
||||
## Manually enabling accessibility features
|
||||
|
||||
@@ -84,10 +43,6 @@ CFStringRef kAXManualAccessibility = CFSTR("AXManualAccessibility");
|
||||
}
|
||||
```
|
||||
|
||||
[devtron]: https://electronjs.org/devtron
|
||||
[devtron-screenshot]: https://cloud.githubusercontent.com/assets/1305617/17156618/9f9bcd72-533f-11e6-880d-389115f40a2a.png
|
||||
[spectron]: https://electronjs.org/spectron
|
||||
[spectron-a11y]: https://github.com/electron/spectron#accessibility-testing
|
||||
[a11y-docs]: https://www.chromium.org/developers/design-documents/accessibility#TOC-How-Chrome-detects-the-presence-of-Assistive-Technology
|
||||
[a11y-devtools]: https://github.com/GoogleChrome/accessibility-developer-tools
|
||||
[a11y-devtools-wiki]: https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
# Automated Testing with a Custom Driver
|
||||
|
||||
To write automated tests for your Electron app, you will need a way to "drive" your application. [Spectron](https://electronjs.org/spectron) is a commonly-used solution which lets you emulate user actions via [WebDriver](https://webdriver.io/). However, it's also possible to write your own custom driver using node's builtin IPC-over-STDIO. The benefit of a custom driver is that it tends to require less overhead than Spectron, and lets you expose custom methods to your test suite.
|
||||
|
||||
To create a custom driver, we'll use Node.js' [child_process](https://nodejs.org/api/child_process.html) API. The test suite will spawn the Electron process, then establish a simple messaging protocol:
|
||||
|
||||
```js
|
||||
const childProcess = require('child_process')
|
||||
const electronPath = require('electron')
|
||||
|
||||
// spawn the process
|
||||
const env = { /* ... */ }
|
||||
const stdio = ['inherit', 'inherit', 'inherit', 'ipc']
|
||||
const appProcess = childProcess.spawn(electronPath, ['./app'], { stdio, env })
|
||||
|
||||
// listen for IPC messages from the app
|
||||
appProcess.on('message', (msg) => {
|
||||
// ...
|
||||
})
|
||||
|
||||
// send an IPC message to the app
|
||||
appProcess.send({ my: 'message' })
|
||||
```
|
||||
|
||||
From within the Electron app, you can listen for messages and send replies using the Node.js [process](https://nodejs.org/api/process.html) API:
|
||||
|
||||
```js
|
||||
// listen for IPC messages from the test suite
|
||||
process.on('message', (msg) => {
|
||||
// ...
|
||||
})
|
||||
|
||||
// send an IPC message to the test suite
|
||||
process.send({ my: 'message' })
|
||||
```
|
||||
|
||||
We can now communicate from the test suite to the Electron app using the `appProcess` object.
|
||||
|
||||
For convenience, you may want to wrap `appProcess` in a driver object that provides more high-level functions. Here is an example of how you can do this:
|
||||
|
||||
```js
|
||||
class TestDriver {
|
||||
constructor ({ path, args, env }) {
|
||||
this.rpcCalls = []
|
||||
|
||||
// start child process
|
||||
env.APP_TEST_DRIVER = 1 // let the app know it should listen for messages
|
||||
this.process = childProcess.spawn(path, args, { stdio: ['inherit', 'inherit', 'inherit', 'ipc'], env })
|
||||
|
||||
// handle rpc responses
|
||||
this.process.on('message', (message) => {
|
||||
// pop the handler
|
||||
const rpcCall = this.rpcCalls[message.msgId]
|
||||
if (!rpcCall) return
|
||||
this.rpcCalls[message.msgId] = null
|
||||
// reject/resolve
|
||||
if (message.reject) rpcCall.reject(message.reject)
|
||||
else rpcCall.resolve(message.resolve)
|
||||
})
|
||||
|
||||
// wait for ready
|
||||
this.isReady = this.rpc('isReady').catch((err) => {
|
||||
console.error('Application failed to start', err)
|
||||
this.stop()
|
||||
process.exit(1)
|
||||
})
|
||||
}
|
||||
|
||||
// simple RPC call
|
||||
// to use: driver.rpc('method', 1, 2, 3).then(...)
|
||||
async rpc (cmd, ...args) {
|
||||
// send rpc request
|
||||
const msgId = this.rpcCalls.length
|
||||
this.process.send({ msgId, cmd, args })
|
||||
return new Promise((resolve, reject) => this.rpcCalls.push({ resolve, reject }))
|
||||
}
|
||||
|
||||
stop () {
|
||||
this.process.kill()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In the app, you'd need to write a simple handler for the RPC calls:
|
||||
|
||||
```js
|
||||
const METHODS = {
|
||||
isReady () {
|
||||
// do any setup needed
|
||||
return true
|
||||
}
|
||||
// define your RPC-able methods here
|
||||
}
|
||||
|
||||
const onMessage = async ({ msgId, cmd, args }) => {
|
||||
let method = METHODS[cmd]
|
||||
if (!method) method = () => new Error('Invalid method: ' + cmd)
|
||||
try {
|
||||
const resolve = await method(...args)
|
||||
process.send({ msgId, resolve })
|
||||
} catch (err) {
|
||||
const reject = {
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
name: err.name
|
||||
}
|
||||
process.send({ msgId, reject })
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.APP_TEST_DRIVER) {
|
||||
process.on('message', onMessage)
|
||||
}
|
||||
```
|
||||
|
||||
Then, in your test suite, you can use your test-driver as follows:
|
||||
|
||||
```js
|
||||
const test = require('ava')
|
||||
const electronPath = require('electron')
|
||||
|
||||
const app = new TestDriver({
|
||||
path: electronPath,
|
||||
args: ['./app'],
|
||||
env: {
|
||||
NODE_ENV: 'test'
|
||||
}
|
||||
})
|
||||
test.before(async t => {
|
||||
await app.isReady
|
||||
})
|
||||
test.after.always('cleanup', async t => {
|
||||
await app.stop()
|
||||
})
|
||||
```
|
||||
265
docs/tutorial/automated-testing.md
Normal file
265
docs/tutorial/automated-testing.md
Normal file
@@ -0,0 +1,265 @@
|
||||
# Automated Testing
|
||||
|
||||
Test automation is an efficient way of validating that your application code works as intended.
|
||||
While Electron doesn't actively maintain its own testing solution, this guide will go over a couple
|
||||
ways you can run end-to-end automated tests on your Electron app.
|
||||
|
||||
## Using the WebDriver interface
|
||||
|
||||
From [ChromeDriver - WebDriver for Chrome][chrome-driver]:
|
||||
|
||||
> WebDriver is an open source tool for automated testing of web apps across many
|
||||
> browsers. It provides capabilities for navigating to web pages, user input,
|
||||
> JavaScript execution, and more. ChromeDriver is a standalone server which
|
||||
> implements WebDriver's wire protocol for Chromium. It is being developed by
|
||||
> members of the Chromium and WebDriver teams.
|
||||
|
||||
There are a few ways that you can set up testing using WebDriver.
|
||||
|
||||
### With WebdriverIO
|
||||
|
||||
[WebdriverIO](https://webdriver.io/) (WDIO) is a test automation framework that provides a
|
||||
Node.js package for testing with WebDriver. Its ecosystem also includes various plugins
|
||||
(e.g. reporter and services) that can help you put together your test setup.
|
||||
|
||||
#### Install the testrunner
|
||||
|
||||
First you need to run the WebdriverIO starter toolkit in your project root directory:
|
||||
|
||||
```sh npm2yarn
|
||||
npx wdio . --yes
|
||||
```
|
||||
|
||||
This installs all necessary packages for you and generates a `wdio.conf.js` configuration file.
|
||||
|
||||
#### Connect WDIO to your Electron app
|
||||
|
||||
Update the capabilities in your configuration file to point to your Electron app binary:
|
||||
|
||||
```javascript title='wdio.conf.js'
|
||||
export.config = {
|
||||
// ...
|
||||
capabilities: [{
|
||||
browserName: 'chrome',
|
||||
'goog:chromeOptions': {
|
||||
binary: '/path/to/your/electron/binary', // Path to your Electron binary.
|
||||
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
|
||||
}
|
||||
}]
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
#### Run your tests
|
||||
|
||||
To run your tests:
|
||||
|
||||
```sh
|
||||
$ npx wdio run wdio.conf.js
|
||||
```
|
||||
|
||||
[chrome-driver]: https://sites.google.com/chromium.org/driver/
|
||||
|
||||
### With Selenium
|
||||
|
||||
[Selenium](https://www.selenium.dev/) is a web automation framework that
|
||||
exposes bindings to WebDriver APIs in many languages. Their Node.js bindings
|
||||
are available under the `selenium-webdriver` package on NPM.
|
||||
|
||||
#### Run a ChromeDriver server
|
||||
|
||||
In order to use Selenium with Electron, you need to download the `electron-chromedriver`
|
||||
binary, and run it:
|
||||
|
||||
```sh npm2yarn
|
||||
npm install --save-dev electron-chromedriver
|
||||
./node_modules/.bin/chromedriver
|
||||
Starting ChromeDriver (v2.10.291558) on port 9515
|
||||
Only local connections are allowed.
|
||||
```
|
||||
|
||||
Remember the port number `9515`, which will be used later.
|
||||
|
||||
#### Connect Selenium to ChromeDriver
|
||||
|
||||
Next, install Selenium into your project:
|
||||
|
||||
```sh npm2yarn
|
||||
npm install --save-dev selenium-webdriver
|
||||
```
|
||||
|
||||
Usage of `selenium-webdriver` with Electron is the same as with
|
||||
normal websites, except that you have to manually specify how to connect
|
||||
ChromeDriver and where to find the binary of your Electron app:
|
||||
|
||||
```js title='test.js'
|
||||
const webdriver = require('selenium-webdriver')
|
||||
const driver = new webdriver.Builder()
|
||||
// The "9515" is the port opened by ChromeDriver.
|
||||
.usingServer('http://localhost:9515')
|
||||
.withCapabilities({
|
||||
'goog:chromeOptions': {
|
||||
// Here is the path to your Electron binary.
|
||||
binary: '/Path-to-Your-App.app/Contents/MacOS/Electron'
|
||||
}
|
||||
})
|
||||
.forBrowser('chrome') // note: use .forBrowser('electron') for selenium-webdriver <= 3.6.0
|
||||
.build()
|
||||
driver.get('http://www.google.com')
|
||||
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver')
|
||||
driver.findElement(webdriver.By.name('btnG')).click()
|
||||
driver.wait(() => {
|
||||
return driver.getTitle().then((title) => {
|
||||
return title === 'webdriver - Google Search'
|
||||
})
|
||||
}, 1000)
|
||||
driver.quit()
|
||||
```
|
||||
|
||||
## Using a custom test driver
|
||||
|
||||
It's also possible to write your own custom driver using Node.js' built-in IPC-over-STDIO.
|
||||
Custom test drivers require you to write additional app code, but have lower overhead and let you
|
||||
expose custom methods to your test suite.
|
||||
|
||||
To create a custom driver, we'll use Node.js' [`child_process`](https://nodejs.org/api/child_process.html) API.
|
||||
The test suite will spawn the Electron process, then establish a simple messaging protocol:
|
||||
|
||||
```js title='testDriver.js'
|
||||
const childProcess = require('child_process')
|
||||
const electronPath = require('electron')
|
||||
|
||||
// spawn the process
|
||||
const env = { /* ... */ }
|
||||
const stdio = ['inherit', 'inherit', 'inherit', 'ipc']
|
||||
const appProcess = childProcess.spawn(electronPath, ['./app'], { stdio, env })
|
||||
|
||||
// listen for IPC messages from the app
|
||||
appProcess.on('message', (msg) => {
|
||||
// ...
|
||||
})
|
||||
|
||||
// send an IPC message to the app
|
||||
appProcess.send({ my: 'message' })
|
||||
```
|
||||
|
||||
From within the Electron app, you can listen for messages and send replies using the Node.js
|
||||
[`process`](https://nodejs.org/api/process.html) API:
|
||||
|
||||
```js title='main.js'
|
||||
// listen for messages from the test suite
|
||||
process.on('message', (msg) => {
|
||||
// ...
|
||||
})
|
||||
|
||||
// send a message to the test suite
|
||||
process.send({ my: 'message' })
|
||||
```
|
||||
|
||||
We can now communicate from the test suite to the Electron app using the `appProcess` object.
|
||||
|
||||
For convenience, you may want to wrap `appProcess` in a driver object that provides more
|
||||
high-level functions. Here is an example of how you can do this. Let's start by creating
|
||||
a `TestDriver` class:
|
||||
|
||||
```js title='testDriver.js'
|
||||
class TestDriver {
|
||||
constructor ({ path, args, env }) {
|
||||
this.rpcCalls = []
|
||||
|
||||
// start child process
|
||||
env.APP_TEST_DRIVER = 1 // let the app know it should listen for messages
|
||||
this.process = childProcess.spawn(path, args, { stdio: ['inherit', 'inherit', 'inherit', 'ipc'], env })
|
||||
|
||||
// handle rpc responses
|
||||
this.process.on('message', (message) => {
|
||||
// pop the handler
|
||||
const rpcCall = this.rpcCalls[message.msgId]
|
||||
if (!rpcCall) return
|
||||
this.rpcCalls[message.msgId] = null
|
||||
// reject/resolve
|
||||
if (message.reject) rpcCall.reject(message.reject)
|
||||
else rpcCall.resolve(message.resolve)
|
||||
})
|
||||
|
||||
// wait for ready
|
||||
this.isReady = this.rpc('isReady').catch((err) => {
|
||||
console.error('Application failed to start', err)
|
||||
this.stop()
|
||||
process.exit(1)
|
||||
})
|
||||
}
|
||||
|
||||
// simple RPC call
|
||||
// to use: driver.rpc('method', 1, 2, 3).then(...)
|
||||
async rpc (cmd, ...args) {
|
||||
// send rpc request
|
||||
const msgId = this.rpcCalls.length
|
||||
this.process.send({ msgId, cmd, args })
|
||||
return new Promise((resolve, reject) => this.rpcCalls.push({ resolve, reject }))
|
||||
}
|
||||
|
||||
stop () {
|
||||
this.process.kill()
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { TestDriver };
|
||||
```
|
||||
|
||||
In your app code, can then write a simple handler to receive RPC calls:
|
||||
|
||||
```js title='main.js'
|
||||
const METHODS = {
|
||||
isReady () {
|
||||
// do any setup needed
|
||||
return true
|
||||
}
|
||||
// define your RPC-able methods here
|
||||
}
|
||||
|
||||
const onMessage = async ({ msgId, cmd, args }) => {
|
||||
let method = METHODS[cmd]
|
||||
if (!method) method = () => new Error('Invalid method: ' + cmd)
|
||||
try {
|
||||
const resolve = await method(...args)
|
||||
process.send({ msgId, resolve })
|
||||
} catch (err) {
|
||||
const reject = {
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
name: err.name
|
||||
}
|
||||
process.send({ msgId, reject })
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.APP_TEST_DRIVER) {
|
||||
process.on('message', onMessage)
|
||||
}
|
||||
```
|
||||
|
||||
Then, in your test suite, you can use your `TestDriver` class with the test automation
|
||||
framework of your choosing. The following example uses
|
||||
[`ava`](https://www.npmjs.com/package/ava), but other popular choices like Jest
|
||||
or Mocha would work as well:
|
||||
|
||||
```js title='test.js'
|
||||
const test = require('ava')
|
||||
const electronPath = require('electron')
|
||||
const { TestDriver } = require('./testDriver')
|
||||
|
||||
const app = new TestDriver({
|
||||
path: electronPath,
|
||||
args: ['./app'],
|
||||
env: {
|
||||
NODE_ENV: 'test'
|
||||
}
|
||||
})
|
||||
test.before(async t => {
|
||||
await app.isReady
|
||||
})
|
||||
test.after.always('cleanup', async t => {
|
||||
await app.stop()
|
||||
})
|
||||
```
|
||||
@@ -17,7 +17,7 @@ the dirty area is passed to the `paint` event to be more efficient.
|
||||
losses with no benefits.
|
||||
* When nothing is happening on a webpage, no frames are generated.
|
||||
* An offscreen window is always created as a
|
||||
[Frameless Window](../api/frameless-window.md).
|
||||
[Frameless Window](../tutorial/window-customization.md)..
|
||||
|
||||
### Rendering Modes
|
||||
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
# Selenium and WebDriver
|
||||
|
||||
From [ChromeDriver - WebDriver for Chrome][chrome-driver]:
|
||||
|
||||
> WebDriver is an open source tool for automated testing of web apps across many
|
||||
> browsers. It provides capabilities for navigating to web pages, user input,
|
||||
> JavaScript execution, and more. ChromeDriver is a standalone server which
|
||||
> implements WebDriver's wire protocol for Chromium. It is being developed by
|
||||
> members of the Chromium and WebDriver teams.
|
||||
|
||||
## Setting up Spectron
|
||||
|
||||
[Spectron][spectron] is the officially supported ChromeDriver testing framework
|
||||
for Electron. It is built on top of [WebdriverIO](https://webdriver.io/) and
|
||||
has helpers to access Electron APIs in your tests and bundles ChromeDriver.
|
||||
|
||||
```sh
|
||||
$ npm install --save-dev spectron
|
||||
```
|
||||
|
||||
```javascript
|
||||
// A simple test to verify a visible window is opened with a title
|
||||
const Application = require('spectron').Application
|
||||
const assert = require('assert')
|
||||
|
||||
const myApp = new Application({
|
||||
path: '/Applications/MyApp.app/Contents/MacOS/MyApp'
|
||||
})
|
||||
|
||||
const verifyWindowIsVisibleWithTitle = async (app) => {
|
||||
await app.start()
|
||||
try {
|
||||
// Check if the window is visible
|
||||
const isVisible = await app.browserWindow.isVisible()
|
||||
// Verify the window is visible
|
||||
assert.strictEqual(isVisible, true)
|
||||
// Get the window's title
|
||||
const title = await app.client.getTitle()
|
||||
// Verify the window's title
|
||||
assert.strictEqual(title, 'My App')
|
||||
} catch (error) {
|
||||
// Log any failures
|
||||
console.error('Test failed', error.message)
|
||||
}
|
||||
// Stop the application
|
||||
await app.stop()
|
||||
}
|
||||
|
||||
verifyWindowIsVisibleWithTitle(myApp)
|
||||
```
|
||||
|
||||
## Setting up with WebDriverJs
|
||||
|
||||
[WebDriverJs](https://www.selenium.dev/selenium/docs/api/javascript/index.html) provides
|
||||
a Node package for testing with web driver, we will use it as an example.
|
||||
|
||||
### 1. Start ChromeDriver
|
||||
|
||||
First you need to download the `chromedriver` binary, and run it:
|
||||
|
||||
```sh
|
||||
$ npm install electron-chromedriver
|
||||
$ ./node_modules/.bin/chromedriver
|
||||
Starting ChromeDriver (v2.10.291558) on port 9515
|
||||
Only local connections are allowed.
|
||||
```
|
||||
|
||||
Remember the port number `9515`, which will be used later
|
||||
|
||||
### 2. Install WebDriverJS
|
||||
|
||||
```sh
|
||||
$ npm install selenium-webdriver
|
||||
```
|
||||
|
||||
### 3. Connect to ChromeDriver
|
||||
|
||||
The usage of `selenium-webdriver` with Electron is the same with
|
||||
upstream, except that you have to manually specify how to connect
|
||||
chrome driver and where to find Electron's binary:
|
||||
|
||||
```javascript
|
||||
const webdriver = require('selenium-webdriver')
|
||||
|
||||
const driver = new webdriver.Builder()
|
||||
// The "9515" is the port opened by chrome driver.
|
||||
.usingServer('http://localhost:9515')
|
||||
.withCapabilities({
|
||||
'goog:chromeOptions': {
|
||||
// Here is the path to your Electron binary.
|
||||
binary: '/Path-to-Your-App.app/Contents/MacOS/Electron'
|
||||
}
|
||||
})
|
||||
.forBrowser('chrome') // note: use .forBrowser('electron') for selenium-webdriver <= 3.6.0
|
||||
.build()
|
||||
|
||||
driver.get('http://www.google.com')
|
||||
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver')
|
||||
driver.findElement(webdriver.By.name('btnG')).click()
|
||||
driver.wait(() => {
|
||||
return driver.getTitle().then((title) => {
|
||||
return title === 'webdriver - Google Search'
|
||||
})
|
||||
}, 1000)
|
||||
|
||||
driver.quit()
|
||||
```
|
||||
|
||||
## Setting up with WebdriverIO
|
||||
|
||||
[WebdriverIO](https://webdriver.io/) provides a Node package for testing with web
|
||||
driver.
|
||||
|
||||
### 1. Start ChromeDriver
|
||||
|
||||
First you need to download the `chromedriver` binary, and run it:
|
||||
|
||||
```sh
|
||||
$ npm install electron-chromedriver
|
||||
$ ./node_modules/.bin/chromedriver --url-base=wd/hub --port=9515
|
||||
Starting ChromeDriver (v2.10.291558) on port 9515
|
||||
Only local connections are allowed.
|
||||
```
|
||||
|
||||
Remember the port number `9515`, which will be used later
|
||||
|
||||
### 2. Install WebdriverIO
|
||||
|
||||
```sh
|
||||
$ npm install webdriverio
|
||||
```
|
||||
|
||||
### 3. Connect to chrome driver
|
||||
|
||||
```javascript
|
||||
const webdriverio = require('webdriverio')
|
||||
const options = {
|
||||
host: 'localhost', // Use localhost as chrome driver server
|
||||
port: 9515, // "9515" is the port opened by chrome driver.
|
||||
desiredCapabilities: {
|
||||
browserName: 'chrome',
|
||||
'goog:chromeOptions': {
|
||||
binary: '/Path-to-Your-App/electron', // Path to your Electron binary.
|
||||
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const client = webdriverio.remote(options)
|
||||
|
||||
client
|
||||
.init()
|
||||
.url('http://google.com')
|
||||
.setValue('#q', 'webdriverio')
|
||||
.click('#btnG')
|
||||
.getTitle().then((title) => {
|
||||
console.log('Title was: ' + title)
|
||||
})
|
||||
.end()
|
||||
```
|
||||
|
||||
## Workflow
|
||||
|
||||
To test your application without rebuilding Electron,
|
||||
[place](application-distribution.md)
|
||||
your app source into Electron's resource directory.
|
||||
|
||||
Alternatively, pass an argument to run with your Electron binary that points to
|
||||
your app's folder. This eliminates the need to copy-paste your app into
|
||||
Electron's resource directory.
|
||||
|
||||
[chrome-driver]: https://sites.google.com/a/chromium.org/chromedriver/
|
||||
[spectron]: https://electronjs.org/spectron
|
||||
271
docs/tutorial/window-customization.md
Normal file
271
docs/tutorial/window-customization.md
Normal file
@@ -0,0 +1,271 @@
|
||||
# Window Customization
|
||||
|
||||
The `BrowserWindow` module is the foundation of your Electron application, and it exposes
|
||||
many APIs that can change the look and behavior of your browser windows. In this
|
||||
tutorial, we will be going over the various use-cases for window customization on
|
||||
macOS, Windows, and Linux.
|
||||
|
||||
## Create frameless windows
|
||||
|
||||
A frameless window is a window that has no [chrome]. Not to be confused with the Google
|
||||
Chrome browser, window _chrome_ refers to the parts of the window (e.g. toolbars, controls)
|
||||
that are not a part of the web page.
|
||||
|
||||
To create a frameless window, you need to set `frame` to `false` in the `BrowserWindow`
|
||||
constructor.
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ frame: false })
|
||||
```
|
||||
|
||||
## Apply custom title bar styles _macOS_ _Windows_
|
||||
|
||||
Title bar styles allow you to hide most of a BrowserWindow's chrome while keeping the
|
||||
system's native window controls intact and can be configured with the `titleBarStyle`
|
||||
option in the `BrowserWindow` constructor.
|
||||
|
||||
Applying the `hidden` title bar style results in a hidden title bar and a full-size
|
||||
content window.
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ titleBarStyle: 'hidden' })
|
||||
```
|
||||
|
||||
### Control the traffic lights _macOS_
|
||||
|
||||
On macOS, applying the `hidden` title bar style will still expose the standard window
|
||||
controls (“traffic lights”) in the top left.
|
||||
|
||||
#### Customize the look of your traffic lights _macOS_
|
||||
|
||||
The `customButtonsOnHover` title bar style will hide the traffic lights until you hover
|
||||
over them. This is useful if you want to create custom traffic lights in your HTML but still
|
||||
use the native UI to control the window.
|
||||
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover' })
|
||||
```
|
||||
|
||||
#### Customize the traffic light position _macOS_
|
||||
|
||||
To modify the position of the traffic light window controls, there are two configuration
|
||||
options available.
|
||||
|
||||
Applying `hiddenInset` title bar style will shift the vertical inset of the traffic lights
|
||||
by a fixed amount.
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
|
||||
```
|
||||
|
||||
If you need more granular control over the positioning of the traffic lights, you can pass
|
||||
a set of coordinates to the `trafficLightPosition` option in the `BrowserWindow`
|
||||
constructor.
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({
|
||||
titleBarStyle: 'hidden',
|
||||
trafficLightPosition: { x: 10, y: 10 }
|
||||
})
|
||||
```
|
||||
|
||||
#### Show and hide the traffic lights programmatically _macOS_
|
||||
|
||||
You can also show and hide the traffic lights programmatically from the main process.
|
||||
The `win.setWindowButtonVisibility` forces traffic lights to be show or hidden depending
|
||||
on the value of its boolean parameter.
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow()
|
||||
// hides the traffic lights
|
||||
win.setWindowButtonVisibility(false)
|
||||
```
|
||||
|
||||
> Note: Given the number of APIs available, there are many ways of achieving this. For instance,
|
||||
> combining `frame: false` with `win.setWindowButtonVisibility(true)` will yield the same
|
||||
> layout outcome as setting `titleBarStyle: 'hidden'`.
|
||||
|
||||
## Window Controls Overlay _macOS_ _Windows_
|
||||
|
||||
The [Window Controls Overlay API] is a web standard that gives web apps the ability to
|
||||
customize their title bar region when installed on desktop. Electron exposes this API
|
||||
through the `BrowserWindow` constructor option `titleBarOverlay`.
|
||||
|
||||
This option only works whenever a custom `titlebarStyle` is applied on macOS or Windows.
|
||||
When `titleBarOverlay` is enabled, the window controls become exposed in their default
|
||||
position, and DOM elements cannot use the area underneath this region.
|
||||
|
||||
The `titleBarOverlay` option accepts two different value formats.
|
||||
|
||||
Specifying `true` on either platform will result in an overlay region with default
|
||||
system colors:
|
||||
|
||||
```javascript title='main.js'
|
||||
// on macOS or Windows
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({
|
||||
titleBarStyle: 'hidden',
|
||||
titleBarOverlay: true
|
||||
})
|
||||
```
|
||||
|
||||
On Windows, you can also specify the color of the overlay and its symbols by setting
|
||||
`titleBarOverlay` to an object with the `color` and `symbolColor` properties. If an option
|
||||
is not specified, the color will default to its system color for the window control buttons:
|
||||
|
||||
```javascript title='main.js'
|
||||
// on Windows
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({
|
||||
titleBarStyle: 'hidden',
|
||||
titleBarOverlay: {
|
||||
color: '#2f3241',
|
||||
symbolColor: '#74b1be'
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
> Note: Once your title bar overlay is enabled from the main process, you can access the overlay's
|
||||
> color and dimension values from a renderer using a set of readonly
|
||||
> [JavaScript APIs][overlay-javascript-apis] and [CSS Environment Variables][overlay-css-env-vars].
|
||||
|
||||
## Create transparent windows
|
||||
|
||||
By setting the `transparent` option to `true`, you can make a fully transparent window.
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow({ transparent: true })
|
||||
```
|
||||
|
||||
### Limitations
|
||||
|
||||
* You cannot click through the transparent area. See
|
||||
[#1335](https://github.com/electron/electron/issues/1335) for details.
|
||||
* Transparent windows are not resizable. Setting `resizable` to `true` may make
|
||||
a transparent window stop working on some platforms.
|
||||
* The CSS [`blur()`] filter only applies to the window's web contents, so there is no way to apply
|
||||
blur effect to the content below the window (i.e. other applications open on
|
||||
the user's system).
|
||||
* The window will not be transparent when DevTools is opened.
|
||||
* On _Windows_:
|
||||
* Transparent windows will not work when DWM is disabled.
|
||||
* Transparent windows can not be maximized using the Windows system menu or by double
|
||||
clicking the title bar. The reasoning behind this can be seen on
|
||||
PR [#28207](https://github.com/electron/electron/pull/28207).
|
||||
* On _macOS_:
|
||||
* The native window shadow will not be shown on a transparent window.
|
||||
|
||||
## Create click-through windows
|
||||
|
||||
To create a click-through window, i.e. making the window ignore all mouse
|
||||
events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events]
|
||||
API:
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow } = require('electron')
|
||||
const win = new BrowserWindow()
|
||||
win.setIgnoreMouseEvents(true)
|
||||
```
|
||||
|
||||
### Forward mouse events _macOS_ _Windows_
|
||||
|
||||
Ignoring mouse messages makes the web contents oblivious to mouse movement,
|
||||
meaning that mouse movement events will not be emitted. On Windows and macOS, an
|
||||
optional parameter can be used to forward mouse move messages to the web page,
|
||||
allowing events such as `mouseleave` to be emitted:
|
||||
|
||||
```javascript title='main.js'
|
||||
const { BrowserWindow, ipcMain } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
const win = new BrowserWindow({
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('set-ignore-mouse-events', (event, ...args) => {
|
||||
const win = BrowserWindow.fromWebContents(event.sender)
|
||||
win.setIgnoreMouseEvents(...args)
|
||||
})
|
||||
```
|
||||
|
||||
```javascript title='preload.js'
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const el = document.getElementById('clickThroughElement')
|
||||
el.addEventListener('mouseenter', () => {
|
||||
ipcRenderer.send('set-ignore-mouse-events', true, { forward: true })
|
||||
})
|
||||
el.addEventListener('mouseleave', () => {
|
||||
ipcRenderer.send('set-ignore-mouse-events', false)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
This makes the web page click-through when over the `#clickThroughElement` element,
|
||||
and returns to normal outside it.
|
||||
|
||||
## Set custom draggable region
|
||||
|
||||
By default, the frameless window is non-draggable. Apps need to specify
|
||||
`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable
|
||||
(like the OS's standard titlebar), and apps can also use
|
||||
`-webkit-app-region: no-drag` to exclude the non-draggable area from the
|
||||
draggable region. Note that only rectangular shapes are currently supported.
|
||||
|
||||
To make the whole window draggable, you can add `-webkit-app-region: drag` as
|
||||
`body`'s style:
|
||||
|
||||
```css title='styles.css'
|
||||
body {
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
```
|
||||
|
||||
And note that if you have made the whole window draggable, you must also mark
|
||||
buttons as non-draggable, otherwise it would be impossible for users to click on
|
||||
them:
|
||||
|
||||
```css title='styles.css'
|
||||
button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
```
|
||||
|
||||
If you're only setting a custom titlebar as draggable, you also need to make all
|
||||
buttons in titlebar non-draggable.
|
||||
|
||||
### Tip: disable text selection
|
||||
|
||||
When creating a draggable region, the dragging behavior may conflict with text selection.
|
||||
For example, when you drag the titlebar, you may accidentally select its text contents.
|
||||
To prevent this, you need to disable text selection within a draggable area like this:
|
||||
|
||||
```css
|
||||
.titlebar {
|
||||
-webkit-user-select: none;
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
```
|
||||
|
||||
### Tip: disable context menus
|
||||
|
||||
On some platforms, the draggable area will be treated as a non-client frame, so
|
||||
when you right click on it, a system menu will pop up. To make the context menu
|
||||
behave correctly on all platforms, you should never use a custom context menu on
|
||||
draggable areas.
|
||||
|
||||
[`blur()`]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/blur()
|
||||
[`BrowserWindow`]: ../api/browser-window.md
|
||||
[chrome]: https://developer.mozilla.org/en-US/docs/Glossary/Chrome
|
||||
[ignore-mouse-events]: ../api/browser-window.md#winsetignoremouseeventsignore-options
|
||||
[overlay-css-env-vars]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables
|
||||
[overlay-javascript-apis]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis
|
||||
[Window Controls Overlay API]: https://github.com/WICG/window-controls-overlay/blob/main/explainer.md
|
||||
@@ -23,7 +23,6 @@ auto_filenames = {
|
||||
"docs/api/environment-variables.md",
|
||||
"docs/api/extensions.md",
|
||||
"docs/api/file-object.md",
|
||||
"docs/api/frameless-window.md",
|
||||
"docs/api/global-shortcut.md",
|
||||
"docs/api/in-app-purchase.md",
|
||||
"docs/api/incoming-message.md",
|
||||
|
||||
@@ -675,11 +675,6 @@ filenames = {
|
||||
"shell/utility/electron_content_utility_client.h",
|
||||
]
|
||||
|
||||
lib_sources_nss = [
|
||||
"chromium_src/chrome/browser/certificate_manager_model.cc",
|
||||
"chromium_src/chrome/browser/certificate_manager_model.h",
|
||||
]
|
||||
|
||||
lib_sources_extensions = [
|
||||
"shell/browser/extensions/api/i18n/i18n_api.cc",
|
||||
"shell/browser/extensions/api/i18n/i18n_api.h",
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
export const enum IPC_MESSAGES {
|
||||
BROWSER_REQUIRE = 'REMOTE_BROWSER_REQUIRE',
|
||||
BROWSER_GET_BUILTIN = 'REMOTE_BROWSER_GET_BUILTIN',
|
||||
BROWSER_GET_GLOBAL = 'REMOTE_BROWSER_GET_GLOBAL',
|
||||
BROWSER_GET_CURRENT_WINDOW = 'REMOTE_BROWSER_GET_CURRENT_WINDOW',
|
||||
BROWSER_GET_CURRENT_WEB_CONTENTS = 'REMOTE_BROWSER_GET_CURRENT_WEB_CONTENTS',
|
||||
BROWSER_CONSTRUCTOR = 'REMOTE_BROWSER_CONSTRUCTOR',
|
||||
BROWSER_FUNCTION_CALL = 'REMOTE_BROWSER_FUNCTION_CALL',
|
||||
BROWSER_MEMBER_CONSTRUCTOR = 'REMOTE_BROWSER_MEMBER_CONSTRUCTOR',
|
||||
BROWSER_MEMBER_CALL = 'REMOTE_BROWSER_MEMBER_CALL',
|
||||
BROWSER_MEMBER_GET = 'REMOTE_BROWSER_MEMBER_GET',
|
||||
BROWSER_MEMBER_SET = 'REMOTE_BROWSER_MEMBER_SET',
|
||||
BROWSER_DEREFERENCE = 'REMOTE_BROWSER_DEREFERENCE',
|
||||
BROWSER_CONTEXT_RELEASE = 'REMOTE_BROWSER_CONTEXT_RELEASE',
|
||||
BROWSER_WRONG_CONTEXT_ERROR = 'REMOTE_BROWSER_WRONG_CONTEXT_ERROR',
|
||||
|
||||
RENDERER_CALLBACK = 'REMOTE_RENDERER_CALLBACK',
|
||||
RENDERER_RELEASE_CALLBACK = 'REMOTE_RENDERER_RELEASE_CALLBACK',
|
||||
}
|
||||
@@ -77,15 +77,8 @@ const isLocalhost = function () {
|
||||
*
|
||||
* @returns {boolean} Is a CSP with `unsafe-eval` set?
|
||||
*/
|
||||
const isUnsafeEvalEnabled: () => Promise<boolean> = function () {
|
||||
return webFrame.executeJavaScript(`(${(() => {
|
||||
try {
|
||||
eval(window.trustedTypes.emptyScript); // eslint-disable-line no-eval
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).toString()})()`, false);
|
||||
const isUnsafeEvalEnabled = () => {
|
||||
return webFrame._isEvalAllowed();
|
||||
};
|
||||
|
||||
const moreInformation = `\nFor more information and help, consult
|
||||
@@ -174,16 +167,14 @@ const warnAboutDisabledWebSecurity = function (webPreferences?: Electron.WebPref
|
||||
* Logs a warning message about unset or insecure CSP
|
||||
*/
|
||||
const warnAboutInsecureCSP = function () {
|
||||
isUnsafeEvalEnabled().then((enabled) => {
|
||||
if (!enabled) return;
|
||||
if (!isUnsafeEvalEnabled()) return;
|
||||
|
||||
const warning = `This renderer process has either no Content Security
|
||||
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
|
||||
this app to unnecessary security risks.\n${moreInformation}`;
|
||||
const warning = `This renderer process has either no Content Security
|
||||
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
|
||||
this app to unnecessary security risks.\n${moreInformation}`;
|
||||
|
||||
console.warn('%cElectron Security Warning (Insecure Content-Security-Policy)',
|
||||
'font-weight: bold;', warning);
|
||||
}).catch(() => {});
|
||||
console.warn('%cElectron Security Warning (Insecure Content-Security-Policy)',
|
||||
'font-weight: bold;', warning);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "16.0.0-beta.2",
|
||||
"version": "16.0.0-beta.9",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
@@ -78,7 +78,7 @@
|
||||
"generate-version-json": "node script/generate-version-json.js",
|
||||
"lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs",
|
||||
"lint:js": "node ./script/lint.js --js",
|
||||
"lint:clang-format": "python script/run-clang-format.py -r -c chromium_src/ shell/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
|
||||
"lint:clang-format": "python script/run-clang-format.py -r -c shell/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
|
||||
"lint:clang-tidy": "ts-node ./script/run-clang-tidy.ts",
|
||||
"lint:cpp": "node ./script/lint.js --cc",
|
||||
"lint:objc": "node ./script/lint.js --objc",
|
||||
|
||||
@@ -12,24 +12,25 @@ https://boringssl-review.googlesource.com/c/boringssl/+/33984 for a
|
||||
similar patch that was merged upstream.
|
||||
|
||||
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c
|
||||
index 786a5d5fb13d7ceafc9b7d58c0aaccb88552506d..5ede89f9f0761d1da1baa899e9a02b77ffcffe93 100644
|
||||
index 62850ab6a216d401d023f81007fb59a33b4585f3..0c30b0329d32b94b22f342f95035e927797d0aaf 100644
|
||||
--- a/crypto/cipher_extra/cipher_extra.c
|
||||
+++ b/crypto/cipher_extra/cipher_extra.c
|
||||
@@ -105,10 +105,14 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name) {
|
||||
return EVP_des_ede3_cbc();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-128-cbc") == 0) {
|
||||
return EVP_aes_128_cbc();
|
||||
+ } else if (OPENSSL_strcasecmp(name, "aes-128-cfb") == 0) {
|
||||
+ return EVP_aes_128_cfb128();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-192-cbc") == 0) {
|
||||
return EVP_aes_192_cbc();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-256-cbc") == 0) {
|
||||
return EVP_aes_256_cbc();
|
||||
+ } else if (OPENSSL_strcasecmp(name, "aes-256-cfb") == 0) {
|
||||
+ return EVP_aes_256_cfb128();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-128-ctr") == 0) {
|
||||
return EVP_aes_128_ctr();
|
||||
} else if (OPENSSL_strcasecmp(name, "aes-192-ctr") == 0) {
|
||||
@@ -73,6 +73,7 @@ static const struct {
|
||||
const EVP_CIPHER *(*func)(void);
|
||||
} kCiphers[] = {
|
||||
{NID_aes_128_cbc, "aes-128-cbc", EVP_aes_128_cbc},
|
||||
+ {NID_aes_128_cfb128, "aes-128-cfb", EVP_aes_128_cfb128},
|
||||
{NID_aes_128_ctr, "aes-128-ctr", EVP_aes_128_ctr},
|
||||
{NID_aes_128_ecb, "aes-128-ecb", EVP_aes_128_ecb},
|
||||
{NID_aes_128_gcm, "aes-128-gcm", EVP_aes_128_gcm},
|
||||
@@ -83,6 +84,7 @@ static const struct {
|
||||
{NID_aes_192_gcm, "aes-192-gcm", EVP_aes_192_gcm},
|
||||
{NID_aes_192_ofb128, "aes-192-ofb", EVP_aes_192_ofb},
|
||||
{NID_aes_256_cbc, "aes-256-cbc", EVP_aes_256_cbc},
|
||||
+ {NID_aes_256_cfb128, "aes-256-cfb", EVP_aes_256_cfb128},
|
||||
{NID_aes_256_ctr, "aes-256-ctr", EVP_aes_256_ctr},
|
||||
{NID_aes_256_ecb, "aes-256-ecb", EVP_aes_256_ecb},
|
||||
{NID_aes_256_gcm, "aes-256-gcm", EVP_aes_256_gcm},
|
||||
diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c
|
||||
index 852b76bea69988e0b3ac76a17b603128f239dde0..d443f4dc2daea0b7aa86ae75d31d995fae667ba9 100644
|
||||
--- a/decrepit/evp/evp_do_all.c
|
||||
@@ -57,10 +58,10 @@ index 852b76bea69988e0b3ac76a17b603128f239dde0..d443f4dc2daea0b7aa86ae75d31d995f
|
||||
callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg);
|
||||
callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg);
|
||||
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
|
||||
index badd496293fb9748adacff10478ea702d1155c5f..8565934bac9a810281b04946cb9f38d7623320f7 100644
|
||||
index 09d72ec2c343f23409d35eca804a02e3290c86f1..1bea1a88b265312d700729ad2828f0b5d9f2d84f 100644
|
||||
--- a/include/openssl/cipher.h
|
||||
+++ b/include/openssl/cipher.h
|
||||
@@ -430,6 +430,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
|
||||
@@ -436,6 +436,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
|
||||
|
||||
// EVP_aes_128_cfb128 is only available in decrepit.
|
||||
OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void);
|
||||
|
||||
@@ -6,18 +6,17 @@ Subject: expose des-ede3
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c
|
||||
index 5ede89f9f0761d1da1baa899e9a02b77ffcffe93..8205e121c152fe4e2d8df34a1ac2fe0498381f31 100644
|
||||
index 0c30b0329d32b94b22f342f95035e927797d0aaf..d97f67fb03756169446edf6b41d3a33fe3ae8205 100644
|
||||
--- a/crypto/cipher_extra/cipher_extra.c
|
||||
+++ b/crypto/cipher_extra/cipher_extra.c
|
||||
@@ -97,6 +97,8 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name) {
|
||||
return EVP_rc4();
|
||||
} else if (OPENSSL_strcasecmp(name, "des-cbc") == 0) {
|
||||
return EVP_des_cbc();
|
||||
+ } else if (OPENSSL_strcasecmp(name, "des-ede3") == 0) {
|
||||
+ return EVP_des_ede3();
|
||||
} else if (OPENSSL_strcasecmp(name, "des-ede3-cbc") == 0 ||
|
||||
// This is not a name used by OpenSSL, but tcpdump registers it
|
||||
// with |EVP_add_cipher_alias|. Our |EVP_add_cipher_alias| is a
|
||||
@@ -93,6 +93,7 @@ static const struct {
|
||||
{NID_des_ecb, "des-ecb", EVP_des_ecb},
|
||||
{NID_des_ede_cbc, "des-ede-cbc", EVP_des_ede_cbc},
|
||||
{NID_des_ede_ecb, "des-ede", EVP_des_ede},
|
||||
+ {NID_des_ede3_ecb, "des-ede3", EVP_des_ede3},
|
||||
{NID_des_ede3_cbc, "des-ede3-cbc", EVP_des_ede3_cbc},
|
||||
{NID_rc2_cbc, "rc2-cbc", EVP_rc2_cbc},
|
||||
{NID_rc4, "rc4", EVP_rc4},
|
||||
diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c
|
||||
index d443f4dc2daea0b7aa86ae75d31d995fae667ba9..5e71420b765019edea82a33884ace539cd91bda5 100644
|
||||
--- a/decrepit/evp/evp_do_all.c
|
||||
|
||||
@@ -12,71 +12,14 @@ and should also hold in BoringSSL.
|
||||
This will be upstreamed.
|
||||
|
||||
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c
|
||||
index 8205e121c152fe4e2d8df34a1ac2fe0498381f31..0870ffe6bff3f647907d7df66d7bf74916be1836 100644
|
||||
index d97f67fb03756169446edf6b41d3a33fe3ae8205..cfdb69e3c556fea11aa7c2d28d4b7da524df15c3 100644
|
||||
--- a/crypto/cipher_extra/cipher_extra.c
|
||||
+++ b/crypto/cipher_extra/cipher_extra.c
|
||||
@@ -69,20 +69,58 @@
|
||||
@@ -97,6 +97,7 @@ static const struct {
|
||||
{NID_des_ede3_cbc, "des-ede3-cbc", EVP_des_ede3_cbc},
|
||||
{NID_rc2_cbc, "rc2-cbc", EVP_rc2_cbc},
|
||||
{NID_rc4, "rc4", EVP_rc4},
|
||||
+ {NID_rc2_40_cbc, "rc2-40-cbc", EVP_rc2_40_cbc}
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_get_cipherbynid(int nid) {
|
||||
switch (nid) {
|
||||
- case NID_rc2_cbc:
|
||||
- return EVP_rc2_cbc();
|
||||
- case NID_rc2_40_cbc:
|
||||
- return EVP_rc2_40_cbc();
|
||||
+ case NID_rc4:
|
||||
+ return EVP_rc4();
|
||||
+ case NID_des_cbc:
|
||||
+ return EVP_des_cbc();
|
||||
+ case NID_des_ede3_ecb:
|
||||
+ return EVP_des_ede3();
|
||||
case NID_des_ede3_cbc:
|
||||
return EVP_des_ede3_cbc();
|
||||
- case NID_des_ede_cbc:
|
||||
- return EVP_des_cbc();
|
||||
case NID_aes_128_cbc:
|
||||
return EVP_aes_128_cbc();
|
||||
+ case NID_aes_128_cfb128:
|
||||
+ return EVP_aes_128_cfb128();
|
||||
case NID_aes_192_cbc:
|
||||
return EVP_aes_192_cbc();
|
||||
case NID_aes_256_cbc:
|
||||
return EVP_aes_256_cbc();
|
||||
+ case NID_aes_256_cfb128:
|
||||
+ return EVP_aes_256_cfb128();
|
||||
+ case NID_aes_128_ctr:
|
||||
+ return EVP_aes_128_ctr();
|
||||
+ case NID_aes_192_ctr:
|
||||
+ return EVP_aes_192_ctr();
|
||||
+ case NID_aes_256_ctr:
|
||||
+ return EVP_aes_256_ctr();
|
||||
+ case NID_aes_128_ecb:
|
||||
+ return EVP_aes_128_ecb();
|
||||
+ case NID_aes_192_ecb:
|
||||
+ return EVP_aes_192_ecb();
|
||||
+ case NID_aes_256_ecb:
|
||||
+ return EVP_aes_256_ecb();
|
||||
+ case NID_aes_128_gcm:
|
||||
+ return EVP_aes_128_gcm();
|
||||
+ case NID_aes_192_gcm:
|
||||
+ return EVP_aes_192_gcm();
|
||||
+ case NID_aes_256_gcm:
|
||||
+ return EVP_aes_256_gcm();
|
||||
+ case NID_aes_128_ofb128:
|
||||
+ return EVP_aes_128_ofb();
|
||||
+ case NID_aes_192_ofb128:
|
||||
+ return EVP_aes_192_ofb();
|
||||
+ case NID_aes_256_ofb128:
|
||||
+ return EVP_aes_256_ofb();
|
||||
+ case NID_des_ecb:
|
||||
+ return EVP_des_ecb();
|
||||
+ case NID_des_ede_ecb:
|
||||
+ return EVP_des_ede();
|
||||
+ case NID_des_ede_cbc:
|
||||
+ return EVP_des_ede_cbc();
|
||||
+ case NID_rc2_cbc:
|
||||
+ return EVP_rc2_cbc();
|
||||
+ case NID_rc2_40_cbc:
|
||||
+ return EVP_rc2_40_cbc();
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ feat_expose_raw_response_headers_from_urlloader.patch
|
||||
chore_do_not_use_chrome_windows_in_cryptotoken_webrequestsender.patch
|
||||
process_singleton.patch
|
||||
fix_expose_decrementcapturercount_in_web_contents_impl.patch
|
||||
cherry-pick-ec42dfd3545f.patch
|
||||
cherry-pick-39090918efac.patch
|
||||
roll_perfetto_trace_processor_linux_from_b852166f90d5_to_e90b9fb93385.patch
|
||||
add_ui_scopedcliboardwriter_writeunsaferawdata.patch
|
||||
feat_add_data_parameter_to_processsingleton.patch
|
||||
mas_gate_private_enterprise_APIs
|
||||
load_v8_snapshot_in_browser_process.patch
|
||||
fix_patch_out_permissions_checks_in_exclusive_access.patch
|
||||
|
||||
@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
||||
index d5bb3412094125492ecf9b5d2c34ce5df16a7c6f..cce3fb48264b0585fa4672d6249c11510e4e5d9d 100644
|
||||
index 51b004f5e459eb265627c01e9e38acd655a65481..7140d92416709c467ae9b65860ac32947913989d 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -237,6 +237,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -239,6 +239,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
// to the GpuProcessHost once the GpuServiceImpl has started.
|
||||
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
|
||||
|
||||
@@ -24,7 +24,7 @@ index d5bb3412094125492ecf9b5d2c34ce5df16a7c6f..cce3fb48264b0585fa4672d6249c1151
|
||||
// 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
|
||||
@@ -374,7 +378,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -376,7 +380,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the
|
||||
context, which can cause some preload scripts to trip.
|
||||
|
||||
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
||||
index 808bbcb0a13bbf069b2354bf39aabcd6d316d514..20e4cbe56bdb8dca3883778b16b9c127aca34793 100644
|
||||
index 94fbf201b82ac000ceac21685f09f68497be1350..70766b01824e63c45e5c035848e5814876956c77 100644
|
||||
--- a/content/public/renderer/render_frame_observer.h
|
||||
+++ b/content/public/renderer/render_frame_observer.h
|
||||
@@ -127,6 +127,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
@@ -128,6 +128,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
||||
virtual void DidHandleOnloadEvents() {}
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int32_t world_id) {}
|
||||
@@ -23,10 +23,10 @@ index 808bbcb0a13bbf069b2354bf39aabcd6d316d514..20e4cbe56bdb8dca3883778b16b9c127
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 4560b2e363e7392467ff623691d3bd0302b5a502..ebf2d997f03c36e5242405002c7dce583aec31dc 100644
|
||||
index 78ec20c40e5dbf7f706b57d9b810b4149510defc..900b8125f3fc6dcec4a1637fae6fcb2af40af5ab 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4460,6 +4460,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4442,6 +4442,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 4560b2e363e7392467ff623691d3bd0302b5a502..ebf2d997f03c36e5242405002c7dce58
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 100e382cc73c1f107cd1b7e618b93e009a1f6c65..afebce99ebbcb28aff27d2d7044bb080ce9fd40e 100644
|
||||
index 5f89641216bc467ea52619b1732c13174a16c723..061fc0c4a265335faccbf81594504eafabae77f8 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -594,6 +594,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -601,6 +601,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index 100e382cc73c1f107cd1b7e618b93e009a1f6c65..afebce99ebbcb28aff27d2d7044bb080
|
||||
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 0ccf54bd50144bc890c96651978f54b0d33713b6..de26aa9f319bd0c762b96f729ccf25a72dd90eb3 100644
|
||||
index 994841c02b0472e5239d9b73a07b2592a39df8be..ad19a3cddf200f6600a04c1136fd21218d496ba8 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -589,6 +589,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -596,6 +596,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -79,10 +79,10 @@ index b0d5db60fbe57275dda835113b0fb21acb9a422f..b6c9c389943088004a419677a2a17be0
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
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 727b770b33f209288904cc10f486ab25f82b4cd6..b25c945378a01ac918ff6dc6caf69effde3685e6 100644
|
||||
index 19a1ef792848026cb6a125124acd9e798e077e35..bb8220819750a6499568b64b49ca7710035d6092 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -303,6 +303,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
@@ -310,6 +310,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) = 0;
|
||||
@@ -92,7 +92,7 @@ index 727b770b33f209288904cc10f486ab25f82b4cd6..b25c945378a01ac918ff6dc6caf69eff
|
||||
int32_t world_id) = 0;
|
||||
virtual bool AllowScriptExtensions() = 0;
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
index ba855e42e395f1ba1838400f08827a5bdc19d90f..c74031e118ffb7ff6312c33f99a6ff9d67b5bf19 100644
|
||||
index 4b1bfb735082513071181f30e8e8af1b699847b1..21f6a54f0255df0d88894860da83b1459c3a378f 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
||||
@@ -273,6 +273,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -110,10 +110,10 @@ index ba855e42e395f1ba1838400f08827a5bdc19d90f..c74031e118ffb7ff6312c33f99a6ff9d
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
index 57c9b6b733ebf5b9483d31959fbdccad8b72031c..13c7e6924a19717473379045ae1c1f0e6f6d52cf 100644
|
||||
index 45d493d7a9846c7f4ad567cec6d5fac4aadf9be3..23759d417d81d5bb6c920c94bacd66c303804319 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
||||
@@ -77,6 +77,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
||||
@@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override;
|
||||
|
||||
@@ -10,10 +10,10 @@ valid use cases for setting custom exit codes of the main loop. This
|
||||
exposes a simple setter that embedders can call.
|
||||
|
||||
diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h
|
||||
index 5d41104a616c53d93ff8eb68ce2f87b1c2be7025..21223accc340242d2e0e301e92d7dafd01023e23 100644
|
||||
index 2c13914c1fbf8b81b6b0dc5d059d48525ac9f059..1c6179a00f404cc8d19e47b2e1bb635a6893e751 100644
|
||||
--- a/content/browser/browser_main_loop.h
|
||||
+++ b/content/browser/browser_main_loop.h
|
||||
@@ -161,6 +161,10 @@ class CONTENT_EXPORT BrowserMainLoop {
|
||||
@@ -165,6 +165,10 @@ class CONTENT_EXPORT BrowserMainLoop {
|
||||
|
||||
int GetResultCode() const { return result_code_; }
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Henri Torgemane <henrit@gmail.com>
|
||||
Date: Thu, 23 Sep 2021 21:30:33 -0500
|
||||
Subject: add ui::ScopedCliboardWriter::WriteUnsafeRawData
|
||||
|
||||
This restores some ability to write to the clipboard using raw formats, which
|
||||
was removed as part of the Raw Clipboard API scrubbing.
|
||||
https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
|
||||
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
index 153f169d2cdef6f8a726c188283a5bc1b7395fa3..3a5d9ab8dafacafb1025e1cb8c157e8a82078424 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
|
||||
@@ -212,6 +212,16 @@ void ScopedClipboardWriter::WriteData(const std::u16string& format,
|
||||
}
|
||||
}
|
||||
|
||||
+void ScopedClipboardWriter::WriteUnsafeRawData(const std::u16string& format,
|
||||
+ mojo_base::BigBuffer data) {
|
||||
+ static constexpr int kMaxRegisteredFormats = 100;
|
||||
+ if (counter_ >= kMaxRegisteredFormats)
|
||||
+ return;
|
||||
+ counter_++;
|
||||
+ platform_representations_.push_back(
|
||||
+ {base::UTF16ToUTF8(format), std::move(data)});
|
||||
+}
|
||||
+
|
||||
void ScopedClipboardWriter::Reset() {
|
||||
objects_.clear();
|
||||
platform_representations_.clear();
|
||||
diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
index 879acd4f6f0101a6da3af58d78eeda877ea41a4a..4d4149b6aa34c7073804994cb1c03368830c736d 100644
|
||||
--- a/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
+++ b/ui/base/clipboard/scoped_clipboard_writer.h
|
||||
@@ -80,6 +80,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
|
||||
// This is only used to write custom format data.
|
||||
void WriteData(const std::u16string& format, mojo_base::BigBuffer data);
|
||||
|
||||
+ // write raw (non-pickled) data to the clipboard
|
||||
+ void WriteUnsafeRawData(const std::u16string& format,
|
||||
+ mojo_base::BigBuffer data);
|
||||
+
|
||||
void WriteImage(const SkBitmap& bitmap);
|
||||
|
||||
// Mark the data to be written as confidential.
|
||||
@@ -6,10 +6,10 @@ Subject: 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 af75828e89e8cb1cca20c8acd64c9f864c0ffab7..182a6ebdf1ccad6b6ef7a2d45791bc0f5dc456f2 100644
|
||||
index 21cbb423d083a985b288c0b040cdd8ae7df56222..ca83e01e82bd55b2c7aaee2361493776b458ebac 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -627,6 +627,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -630,6 +630,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ index af75828e89e8cb1cca20c8acd64c9f864c0ffab7..182a6ebdf1ccad6b6ef7a2d45791bc0f
|
||||
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 b51bd8160bf63a75066d23514b727eb365a3918c..48413119621f6b118b80d681f777e74af8dc8ab7 100644
|
||||
index 9760b7657584b81558a7dbba03258baaee2471fd..53cf6282bfe5a1f1b98a001e1aa82eb45fcb2252 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -85,7 +85,7 @@ index f54b993e9fb9fedcedef327290c2e5d706c699a7..73874e124e2810f07b72fc094f57c85c
|
||||
// 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 7995eb16a7cf6a824653736ca067baa5e688834f..c26e087f2f4d7a1446ce439e5a08a34aa2ccfec4 100644
|
||||
index 44474a8e56c5f1751e395f375cedb39656f6d5a8..baf07861d4be89485605f87d344fcffdd220a063 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -3630,6 +3630,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
|
||||
@@ -8,10 +8,10 @@ WebPreferences of in-process child windows, rather than relying on
|
||||
process-level command line switches, as before.
|
||||
|
||||
diff --git a/third_party/blink/common/web_preferences/web_preferences.cc b/third_party/blink/common/web_preferences/web_preferences.cc
|
||||
index 8a1315f7f89588bb21c6d3c21a7de7c07fed9679..c23443c7816e38836b2f4233ca3a742693888f39 100644
|
||||
index 8eb1bca3638678041a8ed739cfe3907406455ac2..0d05d32420590a1a589f23aa468086f142cbb45f 100644
|
||||
--- a/third_party/blink/common/web_preferences/web_preferences.cc
|
||||
+++ b/third_party/blink/common/web_preferences/web_preferences.cc
|
||||
@@ -148,6 +148,22 @@ WebPreferences::WebPreferences()
|
||||
@@ -145,6 +145,22 @@ WebPreferences::WebPreferences()
|
||||
fake_no_alloc_direct_call_for_testing_enabled(false),
|
||||
v8_cache_options(blink::mojom::V8CacheOptions::kDefault),
|
||||
record_whole_document(false),
|
||||
|
||||
@@ -47,7 +47,7 @@ index 1bfe8fb90673a0d0f9f9228a43eafc3b01b00c5f..1484fc4e477b97b6deb8e23b8a749264
|
||||
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 529be99f6c5aa64c79745ecf83601ea11fe47c1c..ae9c78a65a5e32de90ae190b7ff170c6de82d84d 100644
|
||||
index 60a5e6490d5153772c28551a160ac7c95a744279..e04f0e4d6f9d54cb6b50346ddcbbd16f73135db6 100644
|
||||
--- a/ui/base/models/simple_menu_model.h
|
||||
+++ b/ui/base/models/simple_menu_model.h
|
||||
@@ -50,6 +50,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -58,7 +58,7 @@ index 529be99f6c5aa64c79745ecf83601ea11fe47c1c..ae9c78a65a5e32de90ae190b7ff170c6
|
||||
// Gets the icon for the item with the specified id.
|
||||
virtual ImageModel GetIconForCommandId(int command_id) const;
|
||||
|
||||
@@ -157,6 +158,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -161,6 +162,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
// Sets the label for the item at |index|.
|
||||
void SetLabel(int index, const std::u16string& label);
|
||||
|
||||
@@ -68,7 +68,7 @@ index 529be99f6c5aa64c79745ecf83601ea11fe47c1c..ae9c78a65a5e32de90ae190b7ff170c6
|
||||
// Sets the minor text for the item at |index|.
|
||||
void SetMinorText(int index, const std::u16string& minor_text);
|
||||
|
||||
@@ -196,6 +200,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -200,6 +204,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
|
||||
int GetCommandIdAt(int index) const override;
|
||||
std::u16string GetLabelAt(int index) const override;
|
||||
@@ -76,7 +76,7 @@ index 529be99f6c5aa64c79745ecf83601ea11fe47c1c..ae9c78a65a5e32de90ae190b7ff170c6
|
||||
std::u16string GetMinorTextAt(int index) const override;
|
||||
ImageModel GetMinorIconAt(int index) const override;
|
||||
bool IsItemDynamicAt(int index) const override;
|
||||
@@ -235,6 +240,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -239,6 +244,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
int command_id = 0;
|
||||
ItemType type = TYPE_COMMAND;
|
||||
std::u16string label;
|
||||
|
||||
@@ -15,10 +15,10 @@ Refs changes in:
|
||||
This patch reverts the changes to fix associated crashes in Electron.
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
|
||||
index 8bf6b4bc077cc41da5e0e6b13302bc343537c68f..01bddc0bcb7476408023c4cfc042a0883c16430c 100644
|
||||
index 58622d645f657dbb08489a5202df3dfe6c7a85ce..af2ad009f9f14fad2d18b39198b100ee0dafa556 100644
|
||||
--- a/third_party/blink/renderer/core/frame/frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/frame.cc
|
||||
@@ -120,14 +120,6 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
@@ -122,14 +122,6 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
|
||||
DCHECK(!IsDetached());
|
||||
|
||||
@@ -33,7 +33,7 @@ index 8bf6b4bc077cc41da5e0e6b13302bc343537c68f..01bddc0bcb7476408023c4cfc042a088
|
||||
if (type == FrameDetachType::kRemove) {
|
||||
if (provisional_frame_) {
|
||||
provisional_frame_->Detach(FrameDetachType::kRemove);
|
||||
@@ -150,6 +142,14 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
@@ -152,6 +144,14 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
GetWindowProxyManager()->ClearForSwap();
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ index 8bf6b4bc077cc41da5e0e6b13302bc343537c68f..01bddc0bcb7476408023c4cfc042a088
|
||||
// its owning reference back to our owning LocalFrame.
|
||||
client_->Detached(type);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
index be646cf80c0d3490979e3500821c5fc4351af2a7..dca161475f9e0cd86db8675faec3d375d94c490f 100644
|
||||
index cc3b5af94302c43f1eca0bcb3b765befcea7d300..c6507f83c1d11f09967a6186e895bc86c6f01a61 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -553,10 +553,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -578,10 +578,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
DCHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -63,7 +63,7 @@ index be646cf80c0d3490979e3500821c5fc4351af2a7..dca161475f9e0cd86db8675faec3d375
|
||||
if (!Client())
|
||||
return false;
|
||||
|
||||
@@ -603,6 +599,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -628,6 +624,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
DCHECK(!view_->IsAttached());
|
||||
Client()->WillBeDetached();
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ on linux. If removing this patch doesn't cause a compile failure, it's
|
||||
fine to delete!
|
||||
|
||||
diff --git a/components/crash/core/common/crash_key.h b/components/crash/core/common/crash_key.h
|
||||
index 9d193ea962e919d4509eef296c900e47059761f4..225b8ce822a42d31d59bc89aab473710384c3010 100644
|
||||
index e3509027cab01f74d92b339f7b880d3f42aabe64..bf1d6a5691c292d0814ceb80eee01d847d8db87c 100644
|
||||
--- a/components/crash/core/common/crash_key.h
|
||||
+++ b/components/crash/core/common/crash_key.h
|
||||
@@ -212,6 +212,10 @@ class CrashKeyStringCombined : public internal::CrashKeyStringCombinedImpl {
|
||||
@@ -219,6 +219,10 @@ class CrashKeyStringCombined : public internal::CrashKeyStringCombinedImpl {
|
||||
crashpad_key_.Set(value);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ breakpad independently, as a "browser" process. This patches
|
||||
crash annotation.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 5eb19c8a47467d8df30316bfbd7f3c2f38aea7c0..094244b198745e6fbbfb8d72e7bc2e0ceb4db88c 100644
|
||||
index b1392d74ca4ff08f6e293a72d1d453baa5f91cbc..003702f4f0b1ddab26dee9a6154297fc0204b716 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -717,8 +717,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
|
||||
@@ -718,8 +718,13 @@ bool CrashDone(const MinidumpDescriptor& minidump,
|
||||
log_path[log_path_len] = '\0';
|
||||
info.log_filename = log_path;
|
||||
#endif
|
||||
@@ -29,7 +29,7 @@ index 5eb19c8a47467d8df30316bfbd7f3c2f38aea7c0..094244b198745e6fbbfb8d72e7bc2e0c
|
||||
info.distro = base::g_linux_distro;
|
||||
info.distro_length = my_strlen(base::g_linux_distro);
|
||||
info.upload = upload;
|
||||
@@ -2024,8 +2029,13 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
@@ -2026,8 +2031,13 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
process_type == kWebViewSingleProcessType ||
|
||||
process_type == kBrowserProcessType ||
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
|
||||
to introduce a new Electron category for Electron-specific tracing.
|
||||
|
||||
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
|
||||
index 702ac1a5464635acb1064ca31f7ef211cc0b4a66..6adcf56ca83237d93cd289744b4eb29d7f9e39d6 100644
|
||||
index 60bba6a85d393ddb19e954503c663b06244ad160..ca5169408a8daed7c798a0354a1cd9a6df217ce0 100644
|
||||
--- a/base/trace_event/builtin_categories.h
|
||||
+++ b/base/trace_event/builtin_categories.h
|
||||
@@ -77,6 +77,7 @@
|
||||
|
||||
@@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
|
||||
patch.
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index abab9c8e8c60a6d1690acca5133b3c54d0ccc793..f4378acd7c92193c6e6ac2785cd8a670bd9c650c 100644
|
||||
index 5a35396df314ab547990a53c90ebb75d337bcc77..537d746e8828089e88a8d42e86d482ee00b46e6b 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -165,11 +165,16 @@ if (!is_android && !is_mac) {
|
||||
@@ -171,11 +171,16 @@ if (!is_android && !is_mac) {
|
||||
"common/crash_keys.h",
|
||||
]
|
||||
|
||||
@@ -33,10 +33,10 @@ index abab9c8e8c60a6d1690acca5133b3c54d0ccc793..f4378acd7c92193c6e6ac2785cd8a670
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 27f4f83da31dbd3a1e754279e760dddf00224e1b..5cdcad53c32d7f25fe041344cb7441bdd6c524a5 100644
|
||||
index 5016aa8bcbcc0c8db3e8e42b04ccef3552adda8b..21e92b783a9c9af54fb81174dddbc4a5f954d4da 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4415,7 +4415,7 @@ static_library("browser") {
|
||||
@@ -4471,7 +4471,7 @@ static_library("browser") {
|
||||
|
||||
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
|
||||
# than here in :chrome_dll.
|
||||
@@ -46,10 +46,10 @@ index 27f4f83da31dbd3a1e754279e760dddf00224e1b..5cdcad53c32d7f25fe041344cb7441bd
|
||||
}
|
||||
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index a7e09cea9b71e810e08790d109e805a8119c0825..52f9f2b0d4e3ee7d3221f04f122f41e1429f6016 100644
|
||||
index 5f351bbdd5d71af84c9acabe745be4f0d7b77f94..ca85a577d29c301cb0cf7ab7118557663edba119 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -5482,7 +5482,6 @@ test("unit_tests") {
|
||||
@@ -5499,7 +5499,6 @@ test("unit_tests") {
|
||||
assert(toolkit_views)
|
||||
sources += [ "../browser/ui/startup/credential_provider_signin_info_fetcher_win_unittest.cc" ]
|
||||
deps += [
|
||||
@@ -57,7 +57,7 @@ index a7e09cea9b71e810e08790d109e805a8119c0825..52f9f2b0d4e3ee7d3221f04f122f41e1
|
||||
"//chrome/browser:chrome_process_finder",
|
||||
"//chrome/browser/safe_browsing/chrome_cleaner",
|
||||
"//chrome/browser/safe_browsing/chrome_cleaner:public",
|
||||
@@ -5495,6 +5494,12 @@ test("unit_tests") {
|
||||
@@ -5512,6 +5511,12 @@ test("unit_tests") {
|
||||
"//components/chrome_cleaner/public/proto",
|
||||
"//ui/events/devices:test_support",
|
||||
]
|
||||
@@ -70,15 +70,15 @@ index a7e09cea9b71e810e08790d109e805a8119c0825..52f9f2b0d4e3ee7d3221f04f122f41e1
|
||||
}
|
||||
|
||||
# TODO(crbug.com/931218): Ninja cannot handle certain characters appearing
|
||||
@@ -6088,7 +6093,6 @@ test("unit_tests") {
|
||||
@@ -6109,7 +6114,6 @@ test("unit_tests") {
|
||||
}
|
||||
|
||||
deps += [
|
||||
- "//chrome:packed_resources_integrity_hash",
|
||||
"//chrome/browser:cart_db_content_proto",
|
||||
"//chrome/browser:coupon_db_content_proto",
|
||||
"//chrome/browser/media/router:test_support",
|
||||
"//chrome/browser/resource_coordinator:intervention_policy_database_proto",
|
||||
@@ -6124,6 +6128,9 @@ test("unit_tests") {
|
||||
@@ -6149,6 +6153,9 @@ test("unit_tests") {
|
||||
"//ui/native_theme:test_support",
|
||||
"//ui/webui/resources/js/browser_command:mojo_bindings",
|
||||
]
|
||||
|
||||
@@ -32,7 +32,7 @@ index 01d122aa78f15e0c94b1ee8ae54e08dace0aca0d..5ed9952afd4f4331c98ad41b7d799367
|
||||
]
|
||||
if (is_linux && !is_chromeos) {
|
||||
diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
|
||||
index 8b1da01ce87ff6db8e67938d4c083312cfa3101f..1668eba70db1933a434709c0140fe125991249b3 100644
|
||||
index b70deeb9c8ff34f31cbe3b3c33802605af62f726..4879f27427b53065ad44f46423c1f4cd164358d0 100644
|
||||
--- a/buildtools/third_party/libc++abi/BUILD.gn
|
||||
+++ b/buildtools/third_party/libc++abi/BUILD.gn
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 78eb422f2ac9c56f7a601f2e82a759817be23f82..1a62a9669484980a69d658ca6729e7caf3db96fb 100644
|
||||
index 7a7cc0ebf81bcecc7141ddbe217b770846a9b6ce..af9f5db7e38bd48d478b346325bb4944fb3bb0d8 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -6533,6 +6533,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -6497,6 +6497,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 78eb422f2ac9c56f7a601f2e82a759817be23f82..1a62a9669484980a69d658ca6729e7ca
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index b9aa5d69242727e1a01df7a0d00d592c58e3815a..5a86229bf1fc52e6cccbf609ed029fe88d35cd8f 100644
|
||||
index 818585d3aca6dce4daff03e68f23266ef1c85a9a..d3145c4dc21e6e47915a5b96224972f70b633fda 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3734,6 +3734,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3753,6 +3753,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
}
|
||||
auto* new_contents_impl = new_contents.get();
|
||||
|
||||
@@ -39,7 +39,7 @@ index b9aa5d69242727e1a01df7a0d00d592c58e3815a..5a86229bf1fc52e6cccbf609ed029fe8
|
||||
new_contents_impl->GetController().SetSessionStorageNamespace(
|
||||
partition_id, session_storage_namespace);
|
||||
|
||||
@@ -3776,12 +3784,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3795,12 +3803,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ index b9aa5d69242727e1a01df7a0d00d592c58e3815a..5a86229bf1fc52e6cccbf609ed029fe8
|
||||
new_contents_impl, opener, params.target_url,
|
||||
params.referrer.To<Referrer>(), params.disposition,
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index 74ed9ae0eae10e77dace6905b5108a834b07f8b4..924d6b43d444ccb919d6985c975eb8862ca35b20 100644
|
||||
index 268a2395423ebcd1eded3d8ead5f7775cd5895be..c0cad20dc8273576dea2a9f3fe0c67be101a2193 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -533,6 +533,10 @@ struct CreateNewWindowParams {
|
||||
@@ -550,6 +550,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// Governs how downloads are handled if `target_url` results in a download.
|
||||
blink.mojom.NavigationDownloadPolicy download_policy;
|
||||
@@ -68,10 +68,10 @@ index 74ed9ae0eae10e77dace6905b5108a834b07f8b4..924d6b43d444ccb919d6985c975eb886
|
||||
|
||||
// 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 0cf1f777dc5ffbca606fff558ef6a41e8ed60a99..40bd443cb3c82d9671c4716900a1f19b3c26de69 100644
|
||||
index 248a90c7682001296d623eb80e925f03360a5510..bd15404a10db2f4641763da260a84bb76d3739ab 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -555,6 +555,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -569,6 +569,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -81,10 +81,10 @@ index 0cf1f777dc5ffbca606fff558ef6a41e8ed60a99..40bd443cb3c82d9671c4716900a1f19b
|
||||
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 b6dae0082a297a6dbafd63bd56729b77ffb832fc..66ff9593b8f3d62c486ef83c4c682edf73081d88 100644
|
||||
index 7dfc30f346a9420be631c466ffa2d8b8adabf556..f0e2a061bb35fd3db26c7d235e1196273036925f 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -167,6 +167,7 @@ class NetworkService;
|
||||
@@ -168,6 +168,7 @@ class NetworkService;
|
||||
class TrustedURLLoaderHeaderClient;
|
||||
} // namespace mojom
|
||||
struct ResourceRequest;
|
||||
@@ -92,7 +92,7 @@ index b6dae0082a297a6dbafd63bd56729b77ffb832fc..66ff9593b8f3d62c486ef83c4c682edf
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -922,6 +923,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -936,6 +937,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -220,10 +220,10 @@ index 84d32491a56528a84b4395fba1d54cdbb38d522b..09998a83c449ef8cd9f360fbcdcf7edc
|
||||
|
||||
} // 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 3915f0df47d5a2ae1a5f2909d2aa59192c0cc44b..ada26f26f2ac0fab4a2dc02a5b64c72614c06965 100644
|
||||
index 1cab0b95a9f828791188ca6ad3adb416f864e008..f8ec60fae8eabda4019dd9f6903bfcbf00d423ce 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
@@ -2027,6 +2027,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
@@ -2030,6 +2030,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
|
||||
WebWindowFeatures window_features =
|
||||
GetWindowFeaturesFromString(features, incumbent_window);
|
||||
|
||||
@@ -1,455 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: cfredric <cfredric@chromium.org>
|
||||
Date: Mon, 27 Sep 2021 22:14:18 +0000
|
||||
Subject: Consider HTTPS and WSS schemes identically for FPS.
|
||||
|
||||
This modifies the FPS implementation to normalize wss:// URLs into
|
||||
https:// URLs when determining the same-partiness of a request.
|
||||
|
||||
This allows SameParty cookies to be sent on same-party WSS connection
|
||||
requests. A browsertest is included to verify this.
|
||||
|
||||
Bug: 1251688
|
||||
Change-Id: Id277288982805e0d29c6683e0c13d4b7c7cfe359
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3182786
|
||||
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
|
||||
Reviewed-by: Shuran Huang <shuuran@chromium.org>
|
||||
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#925457}
|
||||
|
||||
diff --git a/chrome/browser/net/websocket_browsertest.cc b/chrome/browser/net/websocket_browsertest.cc
|
||||
index 8a9fe6db3b0030496d00cf57d96a90ee899babaf..de48b97b96c22eeae5fe680868c48381d9a13cc2 100644
|
||||
--- a/chrome/browser/net/websocket_browsertest.cc
|
||||
+++ b/chrome/browser/net/websocket_browsertest.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "base/test/bind.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/login/login_handler.h"
|
||||
#include "chrome/browser/ui/login/login_handler_test_utils.h"
|
||||
@@ -45,25 +46,31 @@
|
||||
#include "mojo/public/cpp/system/data_pipe.h"
|
||||
#include "net/base/network_isolation_key.h"
|
||||
#include "net/cookies/site_for_cookies.h"
|
||||
+#include "net/dns/mock_host_resolver.h"
|
||||
#include "net/test/embedded_test_server/embedded_test_server.h"
|
||||
#include "net/test/spawned_test_server/spawned_test_server.h"
|
||||
#include "net/test/test_data_directory.h"
|
||||
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
|
||||
+#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/websocket.mojom.h"
|
||||
+#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
namespace {
|
||||
|
||||
+using SSLOptions = net::SpawnedTestServer::SSLOptions;
|
||||
+
|
||||
class WebSocketBrowserTest : public InProcessBrowserTest {
|
||||
public:
|
||||
- WebSocketBrowserTest()
|
||||
+ explicit WebSocketBrowserTest(
|
||||
+ SSLOptions::ServerCertificate cert = SSLOptions::CERT_OK)
|
||||
: ws_server_(net::SpawnedTestServer::TYPE_WS,
|
||||
net::GetWebSocketTestDataDirectory()),
|
||||
wss_server_(net::SpawnedTestServer::TYPE_WSS,
|
||||
- SSLOptions(SSLOptions::CERT_OK),
|
||||
+ SSLOptions(cert),
|
||||
net::GetWebSocketTestDataDirectory()) {}
|
||||
|
||||
protected:
|
||||
@@ -145,7 +152,6 @@ class WebSocketBrowserTest : public InProcessBrowserTest {
|
||||
net::SpawnedTestServer wss_server_;
|
||||
|
||||
private:
|
||||
- typedef net::SpawnedTestServer::SSLOptions SSLOptions;
|
||||
std::unique_ptr<content::TitleWatcher> watcher_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebSocketBrowserTest);
|
||||
@@ -162,37 +168,72 @@ class WebSocketBrowserTestWithAllowFileAccessFromFiles
|
||||
};
|
||||
|
||||
// Framework for tests using the connect_to.html page served by a separate HTTP
|
||||
-// server.
|
||||
+// or HTTPS server.
|
||||
class WebSocketBrowserConnectToTest : public WebSocketBrowserTest {
|
||||
protected:
|
||||
- WebSocketBrowserConnectToTest() {
|
||||
- http_server_.ServeFilesFromSourceDirectory(
|
||||
- net::GetWebSocketTestDataDirectory());
|
||||
- }
|
||||
+ explicit WebSocketBrowserConnectToTest(
|
||||
+ SSLOptions::ServerCertificate cert = SSLOptions::CERT_OK)
|
||||
+ : WebSocketBrowserTest(cert) {}
|
||||
|
||||
// The title watcher and HTTP server are set up automatically by the test
|
||||
// framework. Each test case still needs to configure and start the
|
||||
// WebSocket server(s) it needs.
|
||||
void SetUpOnMainThread() override {
|
||||
+ server().ServeFilesFromSourceDirectory(
|
||||
+ net::GetWebSocketTestDataDirectory());
|
||||
WebSocketBrowserTest::SetUpOnMainThread();
|
||||
- ASSERT_TRUE(http_server_.Start());
|
||||
+ ASSERT_TRUE(server().Start());
|
||||
}
|
||||
|
||||
- // Supply a ws: or wss: URL to connect to.
|
||||
- void ConnectTo(GURL url) {
|
||||
- ASSERT_TRUE(http_server_.Started());
|
||||
+ // Supply a ws: or wss: URL to connect to. Serves connect_to.html from the
|
||||
+ // server's default host.
|
||||
+ void ConnectTo(const GURL& url) {
|
||||
+ ConnectTo(server().base_url().host(), url);
|
||||
+ }
|
||||
+
|
||||
+ // Supply a ws: or wss: URL to connect to via loading `host`/connect_to.html.
|
||||
+ void ConnectTo(const std::string& host, const GURL& url) {
|
||||
+ ASSERT_TRUE(server().Started());
|
||||
std::string query("url=" + url.spec());
|
||||
GURL::Replacements replacements;
|
||||
replacements.SetQueryStr(query);
|
||||
ASSERT_TRUE(ui_test_utils::NavigateToURL(
|
||||
- browser(), http_server_.GetURL("/connect_to.html")
|
||||
+ browser(), server()
|
||||
+ .GetURL(host, "/connect_to.html")
|
||||
.ReplaceComponents(replacements)));
|
||||
}
|
||||
|
||||
- private:
|
||||
+ virtual net::EmbeddedTestServer& server() = 0;
|
||||
+};
|
||||
+
|
||||
+// Concrete impl for tests that use connect_to.html over HTTP.
|
||||
+class WebSocketBrowserHTTPConnectToTest : public WebSocketBrowserConnectToTest {
|
||||
+ protected:
|
||||
+ net::EmbeddedTestServer& server() override { return http_server_; }
|
||||
+
|
||||
net::EmbeddedTestServer http_server_;
|
||||
};
|
||||
|
||||
+// Concrete impl for tests that use connect_to.html over HTTPS.
|
||||
+class WebSocketBrowserHTTPSConnectToTest
|
||||
+ : public WebSocketBrowserConnectToTest {
|
||||
+ protected:
|
||||
+ explicit WebSocketBrowserHTTPSConnectToTest(
|
||||
+ SSLOptions::ServerCertificate cert = SSLOptions::CERT_OK)
|
||||
+ : WebSocketBrowserConnectToTest(cert),
|
||||
+ https_server_(net::test_server::EmbeddedTestServer::TYPE_HTTPS) {}
|
||||
+
|
||||
+ void SetUpOnMainThread() override {
|
||||
+ host_resolver()->AddRule("*", "127.0.0.1");
|
||||
+ server().SetSSLConfig(net::EmbeddedTestServer::CERT_TEST_NAMES);
|
||||
+ WebSocketBrowserConnectToTest::SetUpOnMainThread();
|
||||
+ }
|
||||
+
|
||||
+ net::EmbeddedTestServer& server() override { return https_server_; }
|
||||
+
|
||||
+ net::EmbeddedTestServer https_server_;
|
||||
+};
|
||||
+
|
||||
// Automatically fill in any login prompts that appear with the supplied
|
||||
// credentials.
|
||||
class AutoLogin : public content::NotificationObserver {
|
||||
@@ -352,7 +393,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTest,
|
||||
EXPECT_EQ("PASS", WaitAndGetTitle());
|
||||
}
|
||||
|
||||
-IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
|
||||
+IN_PROC_BROWSER_TEST_F(WebSocketBrowserHTTPConnectToTest,
|
||||
WebSocketBasicAuthInWSURL) {
|
||||
// Launch a basic-auth-protected WebSocket server.
|
||||
ws_server_.set_websocket_basic_auth(true);
|
||||
@@ -364,7 +405,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
|
||||
EXPECT_EQ("PASS", WaitAndGetTitle());
|
||||
}
|
||||
|
||||
-IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
|
||||
+IN_PROC_BROWSER_TEST_F(WebSocketBrowserHTTPConnectToTest,
|
||||
WebSocketBasicAuthInWSURLBadCreds) {
|
||||
// Launch a basic-auth-protected WebSocket server.
|
||||
ws_server_.set_websocket_basic_auth(true);
|
||||
@@ -376,7 +417,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
|
||||
EXPECT_EQ("FAIL", WaitAndGetTitle());
|
||||
}
|
||||
|
||||
-IN_PROC_BROWSER_TEST_F(WebSocketBrowserConnectToTest,
|
||||
+IN_PROC_BROWSER_TEST_F(WebSocketBrowserHTTPConnectToTest,
|
||||
WebSocketBasicAuthNoCreds) {
|
||||
// Launch a basic-auth-protected WebSocket server.
|
||||
ws_server_.set_websocket_basic_auth(true);
|
||||
@@ -420,8 +461,7 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTest, MAYBE_WebSocketAppliesHSTS) {
|
||||
https_server.ServeFilesFromSourceDirectory(GetChromeTestDataDir());
|
||||
net::SpawnedTestServer wss_server(
|
||||
net::SpawnedTestServer::TYPE_WSS,
|
||||
- net::SpawnedTestServer::SSLOptions(
|
||||
- net::SpawnedTestServer::SSLOptions::CERT_COMMON_NAME_IS_DOMAIN),
|
||||
+ SSLOptions(SSLOptions::CERT_COMMON_NAME_IS_DOMAIN),
|
||||
net::GetWebSocketTestDataDirectory());
|
||||
// This test sets HSTS on localhost. To avoid being redirected to https, start
|
||||
// the http server on 127.0.0.1 instead.
|
||||
@@ -711,4 +751,43 @@ IN_PROC_BROWSER_TEST_F(WebSocketBrowserTestWithAllowFileAccessFromFiles,
|
||||
EXPECT_EQ("FILE", WaitAndGetTitle());
|
||||
}
|
||||
|
||||
+// A test fixture that enables First-Party Sets.
|
||||
+class FirstPartySetsWebSocketBrowserTest
|
||||
+ : public WebSocketBrowserHTTPSConnectToTest {
|
||||
+ public:
|
||||
+ FirstPartySetsWebSocketBrowserTest()
|
||||
+ : WebSocketBrowserHTTPSConnectToTest(SSLOptions::CERT_TEST_NAMES) {}
|
||||
+
|
||||
+ void SetUpCommandLine(base::CommandLine* command_line) override {
|
||||
+ WebSocketBrowserTest::SetUpCommandLine(command_line);
|
||||
+ command_line->AppendSwitchASCII(
|
||||
+ network::switches::kUseFirstPartySet,
|
||||
+ "https://a.test,https://b.test,https://c.test");
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+IN_PROC_BROWSER_TEST_F(FirstPartySetsWebSocketBrowserTest,
|
||||
+ SendsSamePartyCookies) {
|
||||
+ ASSERT_TRUE(wss_server_.Start());
|
||||
+
|
||||
+ ASSERT_TRUE(content::SetCookie(browser()->profile(),
|
||||
+ server().GetURL("a.test", "/"),
|
||||
+ "same-party-cookie=1; SameParty; Secure"));
|
||||
+ ASSERT_TRUE(content::SetCookie(browser()->profile(),
|
||||
+ server().GetURL("a.test", "/"),
|
||||
+ "same-site-cookie=1; SameSite=Lax; Secure"));
|
||||
+
|
||||
+ content::DOMMessageQueue message_queue;
|
||||
+ ConnectTo("b.test", wss_server_.GetURL("a.test", "echo-request-headers"));
|
||||
+
|
||||
+ std::string message;
|
||||
+ EXPECT_TRUE(message_queue.WaitForMessage(&message));
|
||||
+ // Only the SameParty cookie should have been sent, since it was a cross-site
|
||||
+ // but same-party connection.
|
||||
+ EXPECT_THAT(message, testing::HasSubstr("same-party-cookie=1"));
|
||||
+ EXPECT_THAT(message, testing::Not(testing::HasSubstr("same-site-cookie=1")));
|
||||
+
|
||||
+ EXPECT_EQ("PASS", WaitAndGetTitle());
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
diff --git a/net/data/websocket/connect_to.html b/net/data/websocket/connect_to.html
|
||||
index 05c653fc5d2ab9a333efea5b4c5eee83a03bbe07..8a6d78214fe5974cbb0ec62b61f4d7fdcdf42c3b 100644
|
||||
--- a/net/data/websocket/connect_to.html
|
||||
+++ b/net/data/websocket/connect_to.html
|
||||
@@ -29,6 +29,17 @@ ws.onclose = function()
|
||||
document.title = 'FAIL';
|
||||
}
|
||||
|
||||
+ws.onmessage = function(evt)
|
||||
+{
|
||||
+ domAutomationController.send(evt.data);
|
||||
+}
|
||||
+
|
||||
+ws.onerror = function(evt)
|
||||
+{
|
||||
+ console.error(`WebSocket error: '${evt.message}'`);
|
||||
+}
|
||||
+
|
||||
+
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
|
||||
index 71199ca12a6b805f288349b0d702b834d4e51df7..90626857ea6452a04e872d13f4474c67a905353c 100644
|
||||
--- a/net/test/spawned_test_server/base_test_server.cc
|
||||
+++ b/net/test/spawned_test_server/base_test_server.cc
|
||||
@@ -137,6 +137,8 @@ base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
|
||||
case CERT_KEY_USAGE_RSA_DIGITAL_SIGNATURE:
|
||||
return base::FilePath(
|
||||
FILE_PATH_LITERAL("key_usage_rsa_digitalsignature.pem"));
|
||||
+ case CERT_TEST_NAMES:
|
||||
+ return base::FilePath(FILE_PATH_LITERAL("test_names.pem"));
|
||||
default:
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -228,6 +230,14 @@ GURL BaseTestServer::GetURL(const std::string& path) const {
|
||||
return GURL(GetScheme() + "://" + host_port_pair_.ToString() + "/" + path);
|
||||
}
|
||||
|
||||
+GURL BaseTestServer::GetURL(const std::string& hostname,
|
||||
+ const std::string& relative_url) const {
|
||||
+ GURL local_url = GetURL(relative_url);
|
||||
+ GURL::Replacements replace_host;
|
||||
+ replace_host.SetHostStr(hostname);
|
||||
+ return local_url.ReplaceComponents(replace_host);
|
||||
+}
|
||||
+
|
||||
GURL BaseTestServer::GetURLWithUser(const std::string& path,
|
||||
const std::string& user) const {
|
||||
return GURL(GetScheme() + "://" + user + "@" + host_port_pair_.ToString() +
|
||||
diff --git a/net/test/spawned_test_server/base_test_server.h b/net/test/spawned_test_server/base_test_server.h
|
||||
index e16c548686fd00517493a33ad390dfd2a4ead380..091c5b3ea3f910bfe188c82bc1be85f75dd7dc78 100644
|
||||
--- a/net/test/spawned_test_server/base_test_server.h
|
||||
+++ b/net/test/spawned_test_server/base_test_server.h
|
||||
@@ -77,6 +77,11 @@ class BaseTestServer {
|
||||
// A certificate with invalid notBefore and notAfter times. Windows'
|
||||
// certificate library will not parse this certificate.
|
||||
CERT_BAD_VALIDITY,
|
||||
+
|
||||
+ // A certificate that covers a number of test names. See [test_names] in
|
||||
+ // net/data/ssl/scripts/ee.cnf. More may be added by editing this list and
|
||||
+ // and rerunning net/data/ssl/scripts/generate-test-certs.sh.
|
||||
+ CERT_TEST_NAMES,
|
||||
};
|
||||
|
||||
// NOTE: the values of these enumerators are passed to the the Python test
|
||||
@@ -206,6 +211,8 @@ class BaseTestServer {
|
||||
bool GetAddressList(AddressList* address_list) const WARN_UNUSED_RESULT;
|
||||
|
||||
GURL GetURL(const std::string& path) const;
|
||||
+ GURL GetURL(const std::string& hostname,
|
||||
+ const std::string& relative_url) const;
|
||||
|
||||
GURL GetURLWithUser(const std::string& path,
|
||||
const std::string& user) const;
|
||||
diff --git a/services/network/first_party_sets/first_party_sets.cc b/services/network/first_party_sets/first_party_sets.cc
|
||||
index 1650c28d8b6c61b30531e1e2ef3e2869d8450360..826b403a2a9702c255ee9b7ea38dc74b9e18791d 100644
|
||||
--- a/services/network/first_party_sets/first_party_sets.cc
|
||||
+++ b/services/network/first_party_sets/first_party_sets.cc
|
||||
@@ -91,16 +91,17 @@ bool FirstPartySets::IsContextSamePartyWithSite(
|
||||
const net::SchemefulSite* top_frame_site,
|
||||
const std::set<net::SchemefulSite>& party_context,
|
||||
bool infer_singleton_sets) const {
|
||||
- const net::SchemefulSite* site_owner = FindOwner(site, infer_singleton_sets);
|
||||
- if (!site_owner)
|
||||
+ const absl::optional<net::SchemefulSite> site_owner =
|
||||
+ FindOwner(site, infer_singleton_sets);
|
||||
+ if (!site_owner.has_value())
|
||||
return false;
|
||||
|
||||
const auto is_owned_by_site_owner =
|
||||
- [this, site_owner,
|
||||
+ [this, &site_owner,
|
||||
infer_singleton_sets](const net::SchemefulSite& context_site) -> bool {
|
||||
- const net::SchemefulSite* context_owner =
|
||||
+ const absl::optional<net::SchemefulSite> context_owner =
|
||||
FindOwner(context_site, infer_singleton_sets);
|
||||
- return context_owner && *context_owner == *site_owner;
|
||||
+ return context_owner.has_value() && *context_owner == *site_owner;
|
||||
};
|
||||
|
||||
if (top_frame_site && !is_owned_by_site_owner(*top_frame_site))
|
||||
@@ -131,7 +132,8 @@ net::FirstPartySetsContextType FirstPartySets::ComputeContextType(
|
||||
const absl::optional<net::SchemefulSite>& top_frame_site,
|
||||
const std::set<net::SchemefulSite>& party_context) const {
|
||||
constexpr bool infer_singleton_sets = true;
|
||||
- const net::SchemefulSite* site_owner = FindOwner(site, infer_singleton_sets);
|
||||
+ const absl::optional<net::SchemefulSite> site_owner =
|
||||
+ FindOwner(site, infer_singleton_sets);
|
||||
// Note: the `party_context` consists of the intermediate frames (for frame
|
||||
// requests) or intermediate frames and current frame for subresource
|
||||
// requests.
|
||||
@@ -152,18 +154,22 @@ net::FirstPartySetsContextType FirstPartySets::ComputeContextType(
|
||||
: net::FirstPartySetsContextType::kTopResourceMatchMixed;
|
||||
}
|
||||
|
||||
-const net::SchemefulSite* FirstPartySets::FindOwner(
|
||||
+const absl::optional<net::SchemefulSite> FirstPartySets::FindOwner(
|
||||
const net::SchemefulSite& site,
|
||||
bool infer_singleton_sets) const {
|
||||
- const auto it = sets_.find(site);
|
||||
- if (it == sets_.end())
|
||||
- return infer_singleton_sets ? &site : nullptr;
|
||||
- return &it->second;
|
||||
+ net::SchemefulSite normalized_site = site;
|
||||
+ normalized_site.ConvertWebSocketToHttp();
|
||||
+ const auto it = sets_.find(normalized_site);
|
||||
+ if (it != sets_.end())
|
||||
+ return it->second;
|
||||
+ if (infer_singleton_sets)
|
||||
+ return normalized_site;
|
||||
+ return absl::nullopt;
|
||||
}
|
||||
|
||||
bool FirstPartySets::IsInNontrivialFirstPartySet(
|
||||
const net::SchemefulSite& site) const {
|
||||
- return base::Contains(sets_, site);
|
||||
+ return FindOwner(site, /*infer_singleton_sets=*/false).has_value();
|
||||
}
|
||||
|
||||
base::flat_map<net::SchemefulSite, std::set<net::SchemefulSite>>
|
||||
@@ -244,7 +250,8 @@ base::flat_set<net::SchemefulSite> FirstPartySets::ComputeSetsDiff(
|
||||
for (const auto& old_pair : old_sets) {
|
||||
const net::SchemefulSite& old_member = old_pair.first;
|
||||
const net::SchemefulSite& old_owner = old_pair.second;
|
||||
- const net::SchemefulSite* current_owner = FindOwner(old_member, false);
|
||||
+ const absl::optional<net::SchemefulSite> current_owner =
|
||||
+ FindOwner(old_member, false);
|
||||
// Look for the removed sites and the ones have owner changed.
|
||||
if (!current_owner || *current_owner != old_owner) {
|
||||
result.emplace(old_member);
|
||||
diff --git a/services/network/first_party_sets/first_party_sets.h b/services/network/first_party_sets/first_party_sets.h
|
||||
index 8158b555856526170051cba72a08312a5528de51..fc87e5155667befc5a94bbe539ca71dc47d5f7d1 100644
|
||||
--- a/services/network/first_party_sets/first_party_sets.h
|
||||
+++ b/services/network/first_party_sets/first_party_sets.h
|
||||
@@ -97,11 +97,12 @@ class FirstPartySets {
|
||||
base::OnceCallback<void(const std::string&)> callback);
|
||||
|
||||
private:
|
||||
- // Returns a pointer to `site`'s owner (optionally inferring a singleton set
|
||||
- // if necessary), or `nullptr` if `site` has no owner. Must not return
|
||||
- // `nullptr` if `infer_singleton_sets` is true.
|
||||
- const net::SchemefulSite* FindOwner(const net::SchemefulSite& site,
|
||||
- bool infer_singleton_sets) const;
|
||||
+ // Returns `site`'s owner (optionally inferring a singleton set if necessary),
|
||||
+ // or `nullopt` if `site` has no owner. Must not return `nullopt` if
|
||||
+ // `infer_singleton_sets` is true.
|
||||
+ const absl::optional<net::SchemefulSite> FindOwner(
|
||||
+ const net::SchemefulSite& site,
|
||||
+ bool infer_singleton_sets) const;
|
||||
|
||||
// We must ensure there's no intersection between the manually-specified set
|
||||
// and the sets that came from Component Updater. (When reconciling the
|
||||
diff --git a/services/network/first_party_sets/first_party_sets_unittest.cc b/services/network/first_party_sets/first_party_sets_unittest.cc
|
||||
index 2055619f4c999cbfd5a5ee4780e2eb5c1dad5816..52eb8e8a3d87172353c64bba972311db2889c693 100644
|
||||
--- a/services/network/first_party_sets/first_party_sets_unittest.cc
|
||||
+++ b/services/network/first_party_sets/first_party_sets_unittest.cc
|
||||
@@ -1167,6 +1167,8 @@ TEST_F(FirstPartySetsTest, ComputeContext) {
|
||||
net::SchemefulSite nonmember1(GURL("https://nonmember1.test"));
|
||||
net::SchemefulSite member(GURL("https://member1.test"));
|
||||
net::SchemefulSite owner(GURL("https://example.test"));
|
||||
+ net::SchemefulSite wss_member(GURL("wss://member1.test"));
|
||||
+ net::SchemefulSite wss_nonmember(GURL("wss://nonmember.test"));
|
||||
|
||||
// Works as usual for sites that are in First-Party sets.
|
||||
EXPECT_THAT(sets().ComputeContext(member, &member, {member}),
|
||||
@@ -1180,10 +1182,17 @@ TEST_F(FirstPartySetsTest, ComputeContext) {
|
||||
EXPECT_THAT(sets().ComputeContext(member, &member, {member, owner}),
|
||||
net::SamePartyContext(SamePartyContextType::kSameParty));
|
||||
|
||||
+ // Works if the site is provided with WSS scheme instead of HTTPS.
|
||||
+ EXPECT_THAT(sets().ComputeContext(wss_member, &member, {member, owner}),
|
||||
+ net::SamePartyContext(SamePartyContextType::kSameParty));
|
||||
+
|
||||
EXPECT_THAT(sets().ComputeContext(nonmember, &member, {member}),
|
||||
net::SamePartyContext(SamePartyContextType::kCrossParty));
|
||||
EXPECT_THAT(sets().ComputeContext(member, &nonmember, {member}),
|
||||
net::SamePartyContext(SamePartyContextType::kCrossParty));
|
||||
+ EXPECT_THAT(
|
||||
+ sets().ComputeContext(wss_nonmember, &wss_member, {member, owner}),
|
||||
+ net::SamePartyContext(SamePartyContextType::kCrossParty));
|
||||
|
||||
// Top&resource differs from Ancestors.
|
||||
EXPECT_THAT(sets().ComputeContext(member, &member, {nonmember}),
|
||||
@@ -1225,6 +1234,12 @@ TEST_F(FirstPartySetsTest, IsInNontrivialFirstPartySet) {
|
||||
EXPECT_TRUE(sets().IsInNontrivialFirstPartySet(
|
||||
net::SchemefulSite(GURL("https://member1.test"))));
|
||||
|
||||
+ EXPECT_TRUE(sets().IsInNontrivialFirstPartySet(
|
||||
+ net::SchemefulSite(GURL("wss://member1.test"))));
|
||||
+
|
||||
+ EXPECT_FALSE(sets().IsInNontrivialFirstPartySet(
|
||||
+ net::SchemefulSite(GURL("ws://member1.test"))));
|
||||
+
|
||||
EXPECT_FALSE(sets().IsInNontrivialFirstPartySet(
|
||||
net::SchemefulSite(GURL("https://nonmember.test"))));
|
||||
}
|
||||
@@ -1,626 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shuran Huang <shuuran@chromium.org>
|
||||
Date: Fri, 24 Sep 2021 00:47:47 +0000
|
||||
Subject: Add functions to pass in persisted FPSs and compute diffs.
|
||||
|
||||
Pass the persisted FPSs and a callback that takes a FPSs into Network
|
||||
Service. The persisted FPSs is parsed and compared to the current FPSs
|
||||
in the FirstPartySets class, then call the callback with the current
|
||||
FPSs. The function that passes in the persisted FPSs and the callback
|
||||
has not been called anywhere yet.
|
||||
|
||||
Bug: 1219656
|
||||
Change-Id: I08c531aa08d3aeeb772c1eb9a3a453a07b0349d3
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3103693
|
||||
Commit-Queue: Shuran Huang <shuuran@chromium.org>
|
||||
Reviewed-by: Will Harris <wfh@chromium.org>
|
||||
Reviewed-by: Matt Menke <mmenke@chromium.org>
|
||||
Reviewed-by: Chris Fredrickson <cfredric@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#924570}
|
||||
|
||||
diff --git a/services/network/first_party_sets/first_party_sets.cc b/services/network/first_party_sets/first_party_sets.cc
|
||||
index f7e732e88d6e6ebc5daed9169d5eee336a9de8c1..1650c28d8b6c61b30531e1e2ef3e2869d8450360 100644
|
||||
--- a/services/network/first_party_sets/first_party_sets.cc
|
||||
+++ b/services/network/first_party_sets/first_party_sets.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/ranges/algorithm.h"
|
||||
#include "base/strings/string_split.h"
|
||||
+#include "base/task/post_task.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "net/cookies/cookie_constants.h"
|
||||
#include "net/cookies/same_party_context.h"
|
||||
@@ -72,12 +73,16 @@ void FirstPartySets::SetManuallySpecifiedSet(const std::string& flag_value) {
|
||||
flag_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY));
|
||||
|
||||
ApplyManuallySpecifiedSet();
|
||||
+ manual_sets_ready_ = true;
|
||||
+ ClearSiteDataOnChangedSetsIfReady();
|
||||
}
|
||||
|
||||
base::flat_map<net::SchemefulSite, net::SchemefulSite>*
|
||||
FirstPartySets::ParseAndSet(base::StringPiece raw_sets) {
|
||||
sets_ = FirstPartySetParser::ParseSetsFromComponentUpdater(raw_sets);
|
||||
ApplyManuallySpecifiedSet();
|
||||
+ component_sets_ready_ = true;
|
||||
+ ClearSiteDataOnChangedSetsIfReady();
|
||||
return &sets_;
|
||||
}
|
||||
|
||||
@@ -218,4 +223,48 @@ void FirstPartySets::ApplyManuallySpecifiedSet() {
|
||||
sets_.emplace(manual_owner, manual_owner);
|
||||
}
|
||||
|
||||
+void FirstPartySets::SetPersistedSets(base::StringPiece raw_sets) {
|
||||
+ raw_persisted_sets_ = std::string(raw_sets);
|
||||
+ persisted_sets_ready_ = true;
|
||||
+ ClearSiteDataOnChangedSetsIfReady();
|
||||
+}
|
||||
+
|
||||
+void FirstPartySets::SetOnSiteDataCleared(
|
||||
+ base::OnceCallback<void(const std::string&)> callback) {
|
||||
+ on_site_data_cleared_ = std::move(callback);
|
||||
+ ClearSiteDataOnChangedSetsIfReady();
|
||||
+}
|
||||
+
|
||||
+base::flat_set<net::SchemefulSite> FirstPartySets::ComputeSetsDiff(
|
||||
+ const base::flat_map<net::SchemefulSite, net::SchemefulSite>& old_sets) {
|
||||
+ if (old_sets.empty())
|
||||
+ return {};
|
||||
+
|
||||
+ base::flat_set<net::SchemefulSite> result;
|
||||
+ for (const auto& old_pair : old_sets) {
|
||||
+ const net::SchemefulSite& old_member = old_pair.first;
|
||||
+ const net::SchemefulSite& old_owner = old_pair.second;
|
||||
+ const net::SchemefulSite* current_owner = FindOwner(old_member, false);
|
||||
+ // Look for the removed sites and the ones have owner changed.
|
||||
+ if (!current_owner || *current_owner != old_owner) {
|
||||
+ result.emplace(old_member);
|
||||
+ }
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+void FirstPartySets::ClearSiteDataOnChangedSetsIfReady() {
|
||||
+ if (!persisted_sets_ready_ || !component_sets_ready_ || !manual_sets_ready_ ||
|
||||
+ on_site_data_cleared_.is_null())
|
||||
+ return;
|
||||
+
|
||||
+ base::flat_set<net::SchemefulSite> diff = ComputeSetsDiff(
|
||||
+ FirstPartySetParser::DeserializeFirstPartySets(raw_persisted_sets_));
|
||||
+
|
||||
+ // TODO(shuuran@chromium.org): Implement site state clearing.
|
||||
+
|
||||
+ std::move(on_site_data_cleared_)
|
||||
+ .Run(FirstPartySetParser::SerializeFirstPartySets(sets_));
|
||||
+}
|
||||
+
|
||||
} // namespace network
|
||||
diff --git a/services/network/first_party_sets/first_party_sets.h b/services/network/first_party_sets/first_party_sets.h
|
||||
index 81e0e1080d965947a2ebc1635638c25ad75a1bf7..8158b555856526170051cba72a08312a5528de51 100644
|
||||
--- a/services/network/first_party_sets/first_party_sets.h
|
||||
+++ b/services/network/first_party_sets/first_party_sets.h
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
+#include "base/callback.h"
|
||||
#include "base/containers/flat_map.h"
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
@@ -87,6 +88,14 @@ class FirstPartySets {
|
||||
// the members of the set includes the owner.
|
||||
base::flat_map<net::SchemefulSite, std::set<net::SchemefulSite>> Sets() const;
|
||||
|
||||
+ // Sets the `raw_persisted_sets_`, which is a JSON-encoded
|
||||
+ // string representation of a map of site -> site.
|
||||
+ void SetPersistedSets(base::StringPiece persisted_sets);
|
||||
+ // Sets the `on_site_data_cleared_` callback, which takes input of a
|
||||
+ // JSON-encoded string representation of a map of site -> site.
|
||||
+ void SetOnSiteDataCleared(
|
||||
+ base::OnceCallback<void(const std::string&)> callback);
|
||||
+
|
||||
private:
|
||||
// Returns a pointer to `site`'s owner (optionally inferring a singleton set
|
||||
// if necessary), or `nullptr` if `site` has no owner. Must not return
|
||||
@@ -101,6 +110,19 @@ class FirstPartySets {
|
||||
// `manually_specified_set_`.
|
||||
void ApplyManuallySpecifiedSet();
|
||||
|
||||
+ // Compares the map `old_sets` to `sets_` and returns the set of sites that:
|
||||
+ // 1) were in `old_sets` but are no longer in `sets_`, i.e. leave the FPSs;
|
||||
+ // or, 2) mapped to a different owner site.
|
||||
+ base::flat_set<net::SchemefulSite> ComputeSetsDiff(
|
||||
+ const base::flat_map<net::SchemefulSite, net::SchemefulSite>& old_sets);
|
||||
+
|
||||
+ // Checks the required inputs have been received, and if so, computes the diff
|
||||
+ // between the `sets_` and the parsed `raw_persisted_sets_`, and clears the
|
||||
+ // site data of the set of sites based on the diff.
|
||||
+ //
|
||||
+ // TODO(shuuran@chromium.org): Implement the code to clear site state.
|
||||
+ void ClearSiteDataOnChangedSetsIfReady();
|
||||
+
|
||||
// Represents the mapping of site -> site, where keys are members of sets, and
|
||||
// values are owners of the sets. Owners are explicitly represented as members
|
||||
// of the set.
|
||||
@@ -108,6 +130,22 @@ class FirstPartySets {
|
||||
absl::optional<
|
||||
std::pair<net::SchemefulSite, base::flat_set<net::SchemefulSite>>>
|
||||
manually_specified_set_;
|
||||
+
|
||||
+ std::string raw_persisted_sets_;
|
||||
+
|
||||
+ bool persisted_sets_ready_ = false;
|
||||
+ bool component_sets_ready_ = false;
|
||||
+ bool manual_sets_ready_ = false;
|
||||
+
|
||||
+ // The callback runs after the site state clearing is completed.
|
||||
+ base::OnceCallback<void(const std::string&)> on_site_data_cleared_;
|
||||
+
|
||||
+ FRIEND_TEST_ALL_PREFIXES(FirstPartySets, ComputeSetsDiff_SitesJoined);
|
||||
+ FRIEND_TEST_ALL_PREFIXES(FirstPartySets, ComputeSetsDiff_SitesLeft);
|
||||
+ FRIEND_TEST_ALL_PREFIXES(FirstPartySets, ComputeSetsDiff_OwnerChanged);
|
||||
+ FRIEND_TEST_ALL_PREFIXES(FirstPartySets, ComputeSetsDiff_OwnerLeft);
|
||||
+ FRIEND_TEST_ALL_PREFIXES(FirstPartySets, ComputeSetsDiff_OwnerMemberRotate);
|
||||
+ FRIEND_TEST_ALL_PREFIXES(FirstPartySets, ComputeSetsDiff_EmptySets);
|
||||
};
|
||||
|
||||
} // namespace network
|
||||
diff --git a/services/network/first_party_sets/first_party_sets_unittest.cc b/services/network/first_party_sets/first_party_sets_unittest.cc
|
||||
index b929315d9b857e0f86d1d726f7cefefb7ad8e54c..2055619f4c999cbfd5a5ee4780e2eb5c1dad5816 100644
|
||||
--- a/services/network/first_party_sets/first_party_sets_unittest.cc
|
||||
+++ b/services/network/first_party_sets/first_party_sets_unittest.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <initializer_list>
|
||||
|
||||
#include "base/json/json_reader.h"
|
||||
+#include "base/test/bind.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "net/cookies/cookie_constants.h"
|
||||
#include "net/cookies/same_party_context.h"
|
||||
@@ -204,6 +205,30 @@ TEST(FirstPartySets, SetsManuallySpecified_Invalid_RegisteredDomain_Member) {
|
||||
EXPECT_THAT(sets.ParseAndSet("[]"), Pointee(IsEmpty()));
|
||||
}
|
||||
|
||||
+TEST(FirstPartySets, SetsManuallySpecified_Valid_EmptyValue) {
|
||||
+ FirstPartySets sets;
|
||||
+ sets.SetManuallySpecifiedSet("");
|
||||
+
|
||||
+ // Set non-empty existing sets to distinguish the failure case from the no-op
|
||||
+ // case when processing the manually-specified sets.
|
||||
+ const std::string existing_sets = R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )";
|
||||
+ ASSERT_TRUE(base::JSONReader::Read(existing_sets));
|
||||
+
|
||||
+ EXPECT_THAT(sets.ParseAndSet(existing_sets),
|
||||
+ Pointee(UnorderedElementsAre(
|
||||
+ Pair(SerializesTo("https://example.test"),
|
||||
+ SerializesTo("https://example.test")),
|
||||
+ Pair(SerializesTo("https://member.test"),
|
||||
+ SerializesTo("https://example.test")))));
|
||||
+}
|
||||
+
|
||||
TEST(FirstPartySets, SetsManuallySpecified_Valid_SingleMember) {
|
||||
FirstPartySets sets;
|
||||
sets.SetManuallySpecifiedSet("https://example.test,https://member.test");
|
||||
@@ -469,6 +494,311 @@ TEST(FirstPartySets, SetsManuallySpecified_PrunesInducedSingletons) {
|
||||
SerializesTo("https://example.test")))));
|
||||
}
|
||||
|
||||
+TEST(FirstPartySets, ComputeSetsDiff_SitesJoined) {
|
||||
+ auto old_sets = base::flat_map<net::SchemefulSite, net::SchemefulSite>{
|
||||
+ {net::SchemefulSite(GURL("https://example.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member1.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member3.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))}};
|
||||
+
|
||||
+ // Consistency check the reviewer-friendly JSON format matches the input.
|
||||
+ ASSERT_THAT(FirstPartySets().ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test", "https://member3.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )"),
|
||||
+ Pointee(old_sets));
|
||||
+
|
||||
+ FirstPartySets sets;
|
||||
+ sets.ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test", "https://member3.test"]
|
||||
+ },
|
||||
+ {
|
||||
+ "owner": "https://foo.test",
|
||||
+ "members": ["https://member2.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )");
|
||||
+ // "https://foo.test" and "https://member2.test" joined FPSs. We don't clear
|
||||
+ // site data upon joining, so the computed diff should be empty set.
|
||||
+ EXPECT_THAT(sets.ComputeSetsDiff(old_sets), IsEmpty());
|
||||
+}
|
||||
+
|
||||
+TEST(FirstPartySets, ComputeSetsDiff_SitesLeft) {
|
||||
+ auto old_sets = base::flat_map<net::SchemefulSite, net::SchemefulSite>{
|
||||
+ {net::SchemefulSite(GURL("https://example.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member1.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member3.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://foo.test")),
|
||||
+ net::SchemefulSite(GURL("https://foo.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member2.test")),
|
||||
+ net::SchemefulSite(GURL("https://foo.test"))}};
|
||||
+
|
||||
+ // Consistency check the reviewer-friendly JSON format matches the input.
|
||||
+ ASSERT_THAT(FirstPartySets().ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test", "https://member3.test"]
|
||||
+ },
|
||||
+ {
|
||||
+ "owner": "https://foo.test",
|
||||
+ "members": ["https://member2.test"]
|
||||
+ },
|
||||
+ ]
|
||||
+ )"),
|
||||
+ Pointee(old_sets));
|
||||
+
|
||||
+ FirstPartySets sets;
|
||||
+ sets.ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test"]
|
||||
+ },
|
||||
+ ]
|
||||
+ )");
|
||||
+ // Expected diff: "https://foo.test", "https://member2.test" and
|
||||
+ // "https://member3.test" left FPSs.
|
||||
+ EXPECT_THAT(sets.ComputeSetsDiff(old_sets),
|
||||
+ UnorderedElementsAre(SerializesTo("https://foo.test"),
|
||||
+ SerializesTo("https://member2.test"),
|
||||
+ SerializesTo("https://member3.test")));
|
||||
+}
|
||||
+
|
||||
+TEST(FirstPartySets, ComputeSetsDiff_OwnerChanged) {
|
||||
+ auto old_sets = base::flat_map<net::SchemefulSite, net::SchemefulSite>{
|
||||
+ {net::SchemefulSite(GURL("https://example.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member1.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://foo.test")),
|
||||
+ net::SchemefulSite(GURL("https://foo.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member2.test")),
|
||||
+ net::SchemefulSite(GURL("https://foo.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member3.test")),
|
||||
+ net::SchemefulSite(GURL("https://foo.test"))}};
|
||||
+
|
||||
+ // Consistency check the reviewer-friendly JSON format matches the input.
|
||||
+ ASSERT_THAT(FirstPartySets().ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test"]
|
||||
+ },
|
||||
+ {
|
||||
+ "owner": "https://foo.test",
|
||||
+ "members": ["https://member2.test", "https://member3.test"]
|
||||
+ },
|
||||
+ ]
|
||||
+ )"),
|
||||
+ Pointee(old_sets));
|
||||
+
|
||||
+ FirstPartySets sets;
|
||||
+ sets.ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test", "https://member3.test"]
|
||||
+ },
|
||||
+ {
|
||||
+ "owner": "https://foo.test",
|
||||
+ "members": ["https://member2.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )");
|
||||
+ // Expected diff: "https://member3.test" changed owner.
|
||||
+ EXPECT_THAT(sets.ComputeSetsDiff(old_sets),
|
||||
+ UnorderedElementsAre(SerializesTo("https://member3.test")));
|
||||
+}
|
||||
+
|
||||
+TEST(FirstPartySets, ComputeSetsDiff_OwnerLeft) {
|
||||
+ auto old_sets = base::flat_map<net::SchemefulSite, net::SchemefulSite>{
|
||||
+ {net::SchemefulSite(GURL("https://example.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://foo.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://bar.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))}};
|
||||
+
|
||||
+ // Consistency check the reviewer-friendly JSON format matches the input.
|
||||
+ ASSERT_THAT(FirstPartySets().ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://foo.test", "https://bar.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )"),
|
||||
+ Pointee(old_sets));
|
||||
+
|
||||
+ FirstPartySets sets;
|
||||
+ sets.ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://foo.test",
|
||||
+ "members": ["https://bar.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )");
|
||||
+ // Expected diff: "https://example.test" left FPSs, "https://foo.test" and
|
||||
+ // "https://bar.test" changed owner.
|
||||
+ // It would be valid to only have example.test in the diff, but our logic
|
||||
+ // isn't sophisticated enough yet to know that foo.test and bar.test don't
|
||||
+ // need to be included in the result.
|
||||
+ EXPECT_THAT(sets.ComputeSetsDiff(old_sets),
|
||||
+ UnorderedElementsAre(SerializesTo("https://example.test"),
|
||||
+ SerializesTo("https://foo.test"),
|
||||
+ SerializesTo("https://bar.test")));
|
||||
+}
|
||||
+
|
||||
+TEST(FirstPartySets, ComputeSetsDiff_OwnerMemberRotate) {
|
||||
+ auto old_sets = base::flat_map<net::SchemefulSite, net::SchemefulSite>{
|
||||
+ {net::SchemefulSite(GURL("https://example.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://foo.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))}};
|
||||
+
|
||||
+ // Consistency check the reviewer-friendly JSON format matches the input.
|
||||
+ ASSERT_THAT(FirstPartySets().ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://foo.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )"),
|
||||
+ Pointee(old_sets));
|
||||
+
|
||||
+ FirstPartySets sets;
|
||||
+ sets.ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://foo.test",
|
||||
+ "members": ["https://example.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )");
|
||||
+ // Expected diff: "https://example.test" and "https://foo.test" changed owner.
|
||||
+ // It would be valid to not include example.test and foo.test in the result,
|
||||
+ // but our logic isn't sophisticated enough yet to know that.ß
|
||||
+ EXPECT_THAT(sets.ComputeSetsDiff(old_sets),
|
||||
+ UnorderedElementsAre(SerializesTo("https://example.test"),
|
||||
+ SerializesTo("https://foo.test")));
|
||||
+}
|
||||
+
|
||||
+TEST(FirstPartySets, ComputeSetsDiff_EmptySets) {
|
||||
+ // Empty old_sets.
|
||||
+ FirstPartySets sets;
|
||||
+ sets.ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test"]
|
||||
+ },
|
||||
+ ]
|
||||
+ )");
|
||||
+ EXPECT_THAT(sets.ComputeSetsDiff({}), IsEmpty());
|
||||
+
|
||||
+ // Empty current sets.
|
||||
+ auto old_sets = base::flat_map<net::SchemefulSite, net::SchemefulSite>{
|
||||
+ {net::SchemefulSite(GURL("https://example.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))},
|
||||
+ {net::SchemefulSite(GURL("https://member1.test")),
|
||||
+ net::SchemefulSite(GURL("https://example.test"))}};
|
||||
+ // Consistency check the reviewer-friendly JSON format matches the input.
|
||||
+ ASSERT_THAT(FirstPartySets().ParseAndSet(R"(
|
||||
+ [
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test"]
|
||||
+ }
|
||||
+ ]
|
||||
+ )"),
|
||||
+ Pointee(old_sets));
|
||||
+ EXPECT_THAT(FirstPartySets().ComputeSetsDiff(old_sets),
|
||||
+ UnorderedElementsAre(SerializesTo("https://example.test"),
|
||||
+ SerializesTo("https://member1.test")));
|
||||
+}
|
||||
+
|
||||
+TEST(FirstPartySets, ClearSiteDataOnChangedSetsIfReady_NotReady) {
|
||||
+ int callback_calls = 0;
|
||||
+ auto callback = base::BindLambdaForTesting(
|
||||
+ [&](const std::string& got) { callback_calls++; });
|
||||
+ // component sets not ready.
|
||||
+ {
|
||||
+ FirstPartySets sets;
|
||||
+ callback_calls = 0;
|
||||
+ sets.SetPersistedSets("{}");
|
||||
+ sets.SetManuallySpecifiedSet("");
|
||||
+ sets.SetOnSiteDataCleared(callback);
|
||||
+ EXPECT_EQ(callback_calls, 0);
|
||||
+ }
|
||||
+ // manual sets not ready.
|
||||
+ {
|
||||
+ FirstPartySets sets;
|
||||
+ callback_calls = 0;
|
||||
+ sets.ParseAndSet("[]");
|
||||
+ sets.SetPersistedSets("{}");
|
||||
+ sets.SetOnSiteDataCleared(callback);
|
||||
+ EXPECT_EQ(callback_calls, 0);
|
||||
+ }
|
||||
+ // persisted sets not ready.
|
||||
+ {
|
||||
+ FirstPartySets sets;
|
||||
+ callback_calls = 0;
|
||||
+ sets.ParseAndSet("[]");
|
||||
+ sets.SetManuallySpecifiedSet("");
|
||||
+ sets.SetOnSiteDataCleared(callback);
|
||||
+ EXPECT_EQ(callback_calls, 0);
|
||||
+ }
|
||||
+ // callback not set.
|
||||
+ {
|
||||
+ FirstPartySets sets;
|
||||
+ callback_calls = 0;
|
||||
+ sets.ParseAndSet("[]");
|
||||
+ sets.SetManuallySpecifiedSet("");
|
||||
+ sets.SetPersistedSets("{}");
|
||||
+ EXPECT_EQ(callback_calls, 0);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+// The callback only runs when `old_sets` is generated and `sets` has merged the
|
||||
+// inputs from Component Updater and command line flag.
|
||||
+TEST(FirstPartySets, ClearSiteDataOnChangedSetsIfReady_Ready) {
|
||||
+ FirstPartySets sets;
|
||||
+ int callback_calls = 0;
|
||||
+ sets.ParseAndSet(R"([
|
||||
+ {
|
||||
+ "owner": "https://example.test",
|
||||
+ "members": ["https://member1.test"]
|
||||
+ }
|
||||
+ ])");
|
||||
+ sets.SetManuallySpecifiedSet("https://example2.test,https://member2.test");
|
||||
+ sets.SetPersistedSets(
|
||||
+ R"({"https://example.test":"https://example.test",
|
||||
+ "https://member1.test":"https://example.test"})");
|
||||
+ sets.SetOnSiteDataCleared(base::BindLambdaForTesting([&](const std::string&
|
||||
+ got) {
|
||||
+ EXPECT_EQ(
|
||||
+ got,
|
||||
+ R"({"https://member1.test":"https://example.test","https://member2.test":"https://example2.test"})");
|
||||
+ callback_calls++;
|
||||
+ }));
|
||||
+ EXPECT_EQ(callback_calls, 1);
|
||||
+}
|
||||
+
|
||||
class FirstPartySetsTest : public ::testing::Test {
|
||||
public:
|
||||
FirstPartySetsTest() {
|
||||
diff --git a/services/network/network_service.cc b/services/network/network_service.cc
|
||||
index 5d598ff6c626510bf1da00d35bc9ba4179bac93e..c850d6950aa7777cdc5c2056d4b80c9dd44d3af9 100644
|
||||
--- a/services/network/network_service.cc
|
||||
+++ b/services/network/network_service.cc
|
||||
@@ -343,8 +343,7 @@ void NetworkService::Initialize(mojom::NetworkServiceParamsPtr params,
|
||||
}
|
||||
|
||||
first_party_sets_ = std::make_unique<FirstPartySets>();
|
||||
- if (net::cookie_util::IsFirstPartySetsEnabled() &&
|
||||
- command_line->HasSwitch(switches::kUseFirstPartySet)) {
|
||||
+ if (net::cookie_util::IsFirstPartySetsEnabled()) {
|
||||
first_party_sets_->SetManuallySpecifiedSet(
|
||||
command_line->GetSwitchValueASCII(switches::kUseFirstPartySet));
|
||||
}
|
||||
@@ -785,6 +784,14 @@ void NetworkService::SetFirstPartySets(const std::string& raw_sets) {
|
||||
first_party_sets_->ParseAndSet(raw_sets);
|
||||
}
|
||||
|
||||
+void NetworkService::SetPersistedFirstPartySetsAndGetCurrentSets(
|
||||
+ const std::string& persisted_sets,
|
||||
+ mojom::NetworkService::SetPersistedFirstPartySetsAndGetCurrentSetsCallback
|
||||
+ callback) {
|
||||
+ first_party_sets_->SetPersistedSets(persisted_sets);
|
||||
+ first_party_sets_->SetOnSiteDataCleared(std::move(callback));
|
||||
+}
|
||||
+
|
||||
void NetworkService::SetExplicitlyAllowedPorts(
|
||||
const std::vector<uint16_t>& ports) {
|
||||
net::SetExplicitlyAllowedPorts(ports);
|
||||
diff --git a/services/network/network_service.h b/services/network/network_service.h
|
||||
index 1da4505fc9fe478e00353cd55e615878ea875aa0..963e22f6d5e957684dc56dd6e3ae31fa430a355e 100644
|
||||
--- a/services/network/network_service.h
|
||||
+++ b/services/network/network_service.h
|
||||
@@ -204,6 +204,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkService
|
||||
void BindTestInterface(
|
||||
mojo::PendingReceiver<mojom::NetworkServiceTest> receiver) override;
|
||||
void SetFirstPartySets(const std::string& raw_sets) override;
|
||||
+ void SetPersistedFirstPartySetsAndGetCurrentSets(
|
||||
+ const std::string& persisted_sets,
|
||||
+ mojom::NetworkService::SetPersistedFirstPartySetsAndGetCurrentSetsCallback
|
||||
+ callback) override;
|
||||
void SetExplicitlyAllowedPorts(const std::vector<uint16_t>& ports) override;
|
||||
|
||||
// Returns an HttpAuthHandlerFactory for the given NetworkContext.
|
||||
diff --git a/services/network/network_service_unittest.cc b/services/network/network_service_unittest.cc
|
||||
index bd8ed7abe5870d23e3b0430f29f0448cf425fabc..dffa318ab85d6851c54d0f3c38ab6bb72f274f40 100644
|
||||
--- a/services/network/network_service_unittest.cc
|
||||
+++ b/services/network/network_service_unittest.cc
|
||||
@@ -925,6 +925,7 @@ class NetworkServiceTestWithService : public testing::Test {
|
||||
void SetUp() override {
|
||||
test_server_.AddDefaultHandlers(base::FilePath(kServicesTestData));
|
||||
ASSERT_TRUE(test_server_.Start());
|
||||
+ scoped_features_.InitAndEnableFeature(net::features::kFirstPartySets);
|
||||
service_ = NetworkService::CreateForTesting();
|
||||
service_->Bind(network_service_.BindNewPipeAndPassReceiver());
|
||||
}
|
||||
@@ -989,7 +990,7 @@ class NetworkServiceTestWithService : public testing::Test {
|
||||
mojo::Remote<mojom::NetworkContext> network_context_;
|
||||
mojo::Remote<mojom::URLLoader> loader_;
|
||||
|
||||
- DISALLOW_COPY_AND_ASSIGN(NetworkServiceTestWithService);
|
||||
+ base::test::ScopedFeatureList scoped_features_;
|
||||
};
|
||||
|
||||
// Verifies that loading a URL through the network service's mojo interface
|
||||
@@ -1169,6 +1170,18 @@ TEST_F(NetworkServiceTestWithService, GetNetworkList) {
|
||||
run_loop.Run();
|
||||
}
|
||||
|
||||
+TEST_F(NetworkServiceTestWithService,
|
||||
+ SetPersistedFirstPartySetsAndGetCurrentSets) {
|
||||
+ base::RunLoop run_loop;
|
||||
+ network_service_->SetPersistedFirstPartySetsAndGetCurrentSets(
|
||||
+ "", base::BindLambdaForTesting([&](const std::string& got) {
|
||||
+ EXPECT_EQ(got, "{}");
|
||||
+ run_loop.Quit();
|
||||
+ }));
|
||||
+ network_service_->SetFirstPartySets("");
|
||||
+ run_loop.Run();
|
||||
+}
|
||||
+
|
||||
class TestNetworkChangeManagerClient
|
||||
: public mojom::NetworkChangeManagerClient {
|
||||
public:
|
||||
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom
|
||||
index fe5450b20b3c4a8490e853dd236bf6baefa90b81..59fbbde6ffc30d51304a72f402eee7c664ea111b 100644
|
||||
--- a/services/network/public/mojom/network_service.mojom
|
||||
+++ b/services/network/public/mojom/network_service.mojom
|
||||
@@ -373,6 +373,14 @@ interface NetworkService {
|
||||
// cleared (except for the manually-specified set, if one exists).
|
||||
SetFirstPartySets(string raw_sets);
|
||||
|
||||
+ // Sets the First-Party Sets data that was persisted to compare it with the
|
||||
+ // current First-Party Sets data set by `SetFirstPartySets()`, which is
|
||||
+ // considered more up-to-date, and returns a serialized version of the current
|
||||
+ // one. Both input and output are in format of the JSON-encoded string
|
||||
+ // representation of a map of site -> site.
|
||||
+ SetPersistedFirstPartySetsAndGetCurrentSets(string persisted_sets)
|
||||
+ => (string up_to_date_sets);
|
||||
+
|
||||
// Sets the list of ports which will be permitted even if they normally would
|
||||
// be restricted.
|
||||
SetExplicitlyAllowedPorts(array<uint16> ports);
|
||||
@@ -10,10 +10,10 @@ In Electron that can be simplified to webContents.isFocused() which maps to "is
|
||||
This can't be upstreamed but the patch is minimal.
|
||||
|
||||
diff --git a/chrome/browser/resources/cryptotoken/webrequestsender.js b/chrome/browser/resources/cryptotoken/webrequestsender.js
|
||||
index 734abbbf3132d245c2c39bbe9b7780acbea196b0..adff416286eaa10a099be83aaf07e56ec323fe3d 100644
|
||||
index 67385e25a9233ce7a5077e69e9be1f457252ea5d..3e6864e6ea3374874598a0175746451126ddb165 100644
|
||||
--- a/chrome/browser/resources/cryptotoken/webrequestsender.js
|
||||
+++ b/chrome/browser/resources/cryptotoken/webrequestsender.js
|
||||
@@ -134,10 +134,11 @@ function tabInForeground(tabId) {
|
||||
@@ -141,10 +141,11 @@ function tabInForeground(tabId) {
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ index 734abbbf3132d245c2c39bbe9b7780acbea196b0..adff416286eaa10a099be83aaf07e56e
|
||||
chrome.tabs.get(tabId, function(tab) {
|
||||
if (chrome.runtime.lastError) {
|
||||
resolve(false);
|
||||
@@ -147,9 +148,13 @@ function tabInForeground(tabId) {
|
||||
@@ -154,9 +155,13 @@ function tabInForeground(tabId) {
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ we're running with contextIsolation enabled, we should be falling back
|
||||
to Blink's logic. This will be upstreamed in some form.
|
||||
|
||||
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 c98a621a366c21fef73be108c7ac809517ca9815..62cd22b0b42df76c5e527d0ad0b953a460f3aaee 100644
|
||||
index f98a55b4afb91fba1db30a30fe76051539afd763..1c8d2fa6fe8978085b81b11443b8f8957edb6599 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
|
||||
@@ -448,7 +448,7 @@ CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
|
||||
|
||||
@@ -7,7 +7,7 @@ Pending upstream patch, this gives us fuller access to the window.open params
|
||||
so that we will be able to decide whether to cancel it or not.
|
||||
|
||||
diff --git a/chrome/browser/android/document/document_web_contents_delegate.cc b/chrome/browser/android/document/document_web_contents_delegate.cc
|
||||
index 0e90487923c57c0570e73ef0f0e8c5acc2576932..fcdc88233b2277f3b37a2a2b0bdee7d71b721bf8 100644
|
||||
index 0e90487923c57c0570e73ef0f0e8c5acc2576932..20fece7e761c28d8d13f53de5b5b521a73f4f168 100644
|
||||
--- a/chrome/browser/android/document/document_web_contents_delegate.cc
|
||||
+++ b/chrome/browser/android/document/document_web_contents_delegate.cc
|
||||
@@ -46,8 +46,7 @@ bool DocumentWebContentsDelegate::IsWebContentsCreationOverridden(
|
||||
@@ -16,12 +16,12 @@ index 0e90487923c57c0570e73ef0f0e8c5acc2576932..fcdc88233b2277f3b37a2a2b0bdee7d7
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
NOTREACHED();
|
||||
return true;
|
||||
}
|
||||
diff --git a/chrome/browser/android/document/document_web_contents_delegate.h b/chrome/browser/android/document/document_web_contents_delegate.h
|
||||
index 5b4d70991e19edcdfee731c56251932bf43e535f..fe1977c5e6ce0f5b30e8be529b9efa51785db57f 100644
|
||||
index 5b4d70991e19edcdfee731c56251932bf43e535f..4d996e3821410b2325ef85499f8c307c6e043b2a 100644
|
||||
--- a/chrome/browser/android/document/document_web_contents_delegate.h
|
||||
+++ b/chrome/browser/android/document/document_web_contents_delegate.h
|
||||
@@ -41,8 +41,7 @@ class DocumentWebContentsDelegate
|
||||
@@ -30,12 +30,12 @@ index 5b4d70991e19edcdfee731c56251932bf43e535f..fe1977c5e6ce0f5b30e8be529b9efa51
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
};
|
||||
|
||||
#endif // CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_
|
||||
diff --git a/chrome/browser/media/offscreen_tab.cc b/chrome/browser/media/offscreen_tab.cc
|
||||
index c0823105ecc86ce2e60ede44be29a14889dad887..bb0f2672c6e565657500e617b4eb416c0575dac7 100644
|
||||
index 363a0d6979aaa8fb1047f6e0ed8b4bf58f547c6f..5f155518a179d4556c3993711e688f88e3f04091 100644
|
||||
--- a/chrome/browser/media/offscreen_tab.cc
|
||||
+++ b/chrome/browser/media/offscreen_tab.cc
|
||||
@@ -284,8 +284,7 @@ bool OffscreenTab::IsWebContentsCreationOverridden(
|
||||
@@ -44,12 +44,12 @@ index c0823105ecc86ce2e60ede44be29a14889dad887..bb0f2672c6e565657500e617b4eb416c
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
// Disallow creating separate WebContentses. The WebContents implementation
|
||||
// uses this to spawn new windows/tabs, which is also not allowed for
|
||||
// offscreen tabs.
|
||||
diff --git a/chrome/browser/media/offscreen_tab.h b/chrome/browser/media/offscreen_tab.h
|
||||
index c80128b816cc77b95af215384fdc36b2150f95ea..3fe773e671d1c087eaf1303ca60883597c0c3907 100644
|
||||
index c80128b816cc77b95af215384fdc36b2150f95ea..2063233f6f36829e91ba503d0d66fa5cde994cf3 100644
|
||||
--- a/chrome/browser/media/offscreen_tab.h
|
||||
+++ b/chrome/browser/media/offscreen_tab.h
|
||||
@@ -107,8 +107,7 @@ class OffscreenTab final : public ProfileObserver,
|
||||
@@ -58,12 +58,12 @@ index c80128b816cc77b95af215384fdc36b2150f95ea..3fe773e671d1c087eaf1303ca6088359
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) final;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
void EnterFullscreenModeForTab(
|
||||
content::RenderFrameHost* requesting_frame,
|
||||
const blink::mojom::FullscreenOptions& options) final;
|
||||
diff --git a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc
|
||||
index e4f3632c84ebe4dcbbc3deb2f49e351c75ec93fd..58902fdaf316ad371ddb3e79e6ebc74cbbafc138 100644
|
||||
index e4f3632c84ebe4dcbbc3deb2f49e351c75ec93fd..08227615c2370bf55edfc373a40d9b488d775ba7 100644
|
||||
--- a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc
|
||||
+++ b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc
|
||||
@@ -77,10 +77,9 @@ bool AssistantWebViewImpl::IsWebContentsCreationOverridden(
|
||||
@@ -72,7 +72,7 @@ index e4f3632c84ebe4dcbbc3deb2f49e351c75ec93fd..58902fdaf316ad371ddb3e79e6ebc74c
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
if (params_.suppress_navigation) {
|
||||
- NotifyDidSuppressNavigation(target_url,
|
||||
+ NotifyDidSuppressNavigation(params.target_url,
|
||||
@@ -80,7 +80,7 @@ index e4f3632c84ebe4dcbbc3deb2f49e351c75ec93fd..58902fdaf316ad371ddb3e79e6ebc74c
|
||||
/*from_user_gesture=*/true);
|
||||
return true;
|
||||
diff --git a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h
|
||||
index 07014765f33bdddebcc5bc32a2713d6523faf394..f866f69f9c810d89f1a0e9e4952293f66804602a 100644
|
||||
index 07014765f33bdddebcc5bc32a2713d6523faf394..b76a6e4f5d79ad53caba3044c1d9d6e6b9e066f8 100644
|
||||
--- a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h
|
||||
+++ b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h
|
||||
@@ -48,8 +48,7 @@ class AssistantWebViewImpl : public ash::AssistantWebView,
|
||||
@@ -89,12 +89,12 @@ index 07014765f33bdddebcc5bc32a2713d6523faf394..f866f69f9c810d89f1a0e9e4952293f6
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
content::WebContents* OpenURLFromTab(
|
||||
content::WebContents* source,
|
||||
const content::OpenURLParams& params) override;
|
||||
diff --git a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
|
||||
index ba376cca99e6b8b367c6a4cfc9925b940728b9fc..f1b831507d628d35cc65f697ffc832568fc28193 100644
|
||||
index ba376cca99e6b8b367c6a4cfc9925b940728b9fc..51731a94efdbba6b582a1a317303c26dd7f06c6c 100644
|
||||
--- a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
|
||||
+++ b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
|
||||
@@ -72,8 +72,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate,
|
||||
@@ -103,21 +103,21 @@ index ba376cca99e6b8b367c6a4cfc9925b940728b9fc..f1b831507d628d35cc65f697ffc83256
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override {
|
||||
+ const mojom::CreateNewWindowParams& params) override {
|
||||
+ const content::mojom::CreateNewWindowParams& params) override {
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index c8d3c04475fe3ee60ec4671ee47c18aa78840dd1..e5d95132b4f20f17f328e41cf6d0cf839787222a 100644
|
||||
index c764e3607d274b9ec3f645c2b5fc9c8c1e98ad47..9c177080b4aee8ad71dd9a4c438d5a6daec2c25d 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -1790,12 +1790,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -1789,12 +1789,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
return window_container_type ==
|
||||
content::mojom::WindowContainerType::BACKGROUND &&
|
||||
ShouldCreateBackgroundContents(source_site_instance, opener_url,
|
||||
@@ -127,21 +127,21 @@ index c8d3c04475fe3ee60ec4671ee47c18aa78840dd1..e5d95132b4f20f17f328e41cf6d0cf83
|
||||
|
||||
WebContents* Browser::CreateCustomWebContents(
|
||||
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
|
||||
index 7649c59dde3f58b5ec153eb6146b159cfc190975..c1cc53b89d805f63fe4dcda12e02cd0a2687f926 100644
|
||||
index 69911da4fe7b9894f718fac8d59af1dcc9d18593..eeeef53bd967131d77d440cc61ad3acbb07bd9d7 100644
|
||||
--- a/chrome/browser/ui/browser.h
|
||||
+++ b/chrome/browser/ui/browser.h
|
||||
@@ -807,8 +807,7 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -813,8 +813,7 @@ class Browser : public TabStripModelObserver,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
content::WebContents* CreateCustomWebContents(
|
||||
content::RenderFrameHost* opener,
|
||||
content::SiteInstance* source_site_instance,
|
||||
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
|
||||
index ff97ac6e97c688d677053a5f01546a4c2d91ff1d..1da6a9c32b883a17975e61d60363918251c78ffd 100644
|
||||
index ff97ac6e97c688d677053a5f01546a4c2d91ff1d..c095be21525d85e3d6c1f4a0c1dda5c8579e1ec3 100644
|
||||
--- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
|
||||
+++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
|
||||
@@ -201,8 +201,7 @@ bool PresentationReceiverWindowController::IsWebContentsCreationOverridden(
|
||||
@@ -150,12 +150,12 @@ index ff97ac6e97c688d677053a5f01546a4c2d91ff1d..1da6a9c32b883a17975e61d603639182
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
// Disallow creating separate WebContentses. The WebContents implementation
|
||||
// uses this to spawn new windows/tabs, which is also not allowed for
|
||||
// local presentations.
|
||||
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
|
||||
index 45cd02ecf7b7acb107f95656b3fa07a5fca2ea95..b06ca2dbdd0c21554802ab3b99576b381d0e4ddb 100644
|
||||
index 45cd02ecf7b7acb107f95656b3fa07a5fca2ea95..953ea8ae44f7f2bd0623591249cb85f9d0eda543 100644
|
||||
--- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
|
||||
+++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
|
||||
@@ -104,8 +104,7 @@ class PresentationReceiverWindowController final
|
||||
@@ -164,12 +164,12 @@ index 45cd02ecf7b7acb107f95656b3fa07a5fca2ea95..b06ca2dbdd0c21554802ab3b99576b38
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
|
||||
// The profile used for the presentation.
|
||||
Profile* otr_profile_;
|
||||
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
index 9364a722de5183c077a9c50b8c8a48ffa3a0fea6..ddde17de38bc5ca904046702a28a88d7c00f18c4 100644
|
||||
index 9364a722de5183c077a9c50b8c8a48ffa3a0fea6..58d9e6c24d70dbedeb41f0b29ed1cb03a1bdcde3 100644
|
||||
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
|
||||
@@ -170,14 +170,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
|
||||
@@ -178,7 +178,7 @@ index 9364a722de5183c077a9c50b8c8a48ffa3a0fea6..ddde17de38bc5ca904046702a28a88d7
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
JNIEnv* env = AttachCurrentThread();
|
||||
ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
|
||||
if (obj.is_null())
|
||||
@@ -190,7 +190,7 @@ index 9364a722de5183c077a9c50b8c8a48ffa3a0fea6..ddde17de38bc5ca904046702a28a88d7
|
||||
java_gurl);
|
||||
}
|
||||
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.h b/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
index 4b832f4c3a051eefca57909958334631335e03e1..8aed42112d8fad7df813524cf700d8082ad75c47 100644
|
||||
index 4b832f4c3a051eefca57909958334631335e03e1..b665a3cac289409280e61f75eb7d7eb83517f603 100644
|
||||
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.h
|
||||
@@ -78,8 +78,7 @@ class WebContentsDelegateAndroid : public content::WebContentsDelegate {
|
||||
@@ -199,12 +199,12 @@ index 4b832f4c3a051eefca57909958334631335e03e1..8aed42112d8fad7df813524cf700d808
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
void CloseContents(content::WebContents* source) override;
|
||||
void SetContentsBounds(content::WebContents* source,
|
||||
const gfx::Rect& bounds) override;
|
||||
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.cc b/components/offline_pages/content/background_loader/background_loader_contents.cc
|
||||
index 53fad64f87a952fd0d7398958288ecde259b57bf..0b8359b6179bf16e58978e5f3e51a911ad3d0a3f 100644
|
||||
index 53fad64f87a952fd0d7398958288ecde259b57bf..26f64dabcbee575034e97ada29c7de48b315080f 100644
|
||||
--- a/components/offline_pages/content/background_loader/background_loader_contents.cc
|
||||
+++ b/components/offline_pages/content/background_loader/background_loader_contents.cc
|
||||
@@ -80,8 +80,7 @@ bool BackgroundLoaderContents::IsWebContentsCreationOverridden(
|
||||
@@ -213,29 +213,29 @@ index 53fad64f87a952fd0d7398958288ecde259b57bf..0b8359b6179bf16e58978e5f3e51a911
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
// Background pages should not create other webcontents/tabs.
|
||||
return true;
|
||||
}
|
||||
diff --git a/components/offline_pages/content/background_loader/background_loader_contents.h b/components/offline_pages/content/background_loader/background_loader_contents.h
|
||||
index c5c5a7b63b5b3b62a9517cbef3ae23ce57a3c89c..4f1b7e88d6d2ae89a60311c8aeb1fceea87f2b02 100644
|
||||
index 75eff96958b086ebfe7f99adf0d986213074c45b..ae1f59db9569cd65a5ae92a37af19f9e47eee0aa 100644
|
||||
--- a/components/offline_pages/content/background_loader/background_loader_contents.h
|
||||
+++ b/components/offline_pages/content/background_loader/background_loader_contents.h
|
||||
@@ -60,8 +60,7 @@ class BackgroundLoaderContents : public content::WebContentsDelegate {
|
||||
@@ -64,8 +64,7 @@ class BackgroundLoaderContents : public content::WebContentsDelegate {
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
|
||||
void AddNewContents(content::WebContents* source,
|
||||
std::unique_ptr<content::WebContents> new_contents,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index ad1b4abe0390215e007ad2db8d972661470e94ed..d3593a6f3e9f6cba5823169d36fd93a6f97608ae 100644
|
||||
index 9d932b3d21dc74ef710d631ab43a348c45da5eb7..e63e11903927e47410201faa01907174d2110e1a 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3682,8 +3682,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3701,8 +3701,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -288,10 +288,10 @@ index 78d1bed80f2cf0f0774617c149d695f3dce3d712..ed08199cea6137d09cb95f0da4a283ca
|
||||
// view is used for displaying embedded extension options, we want any
|
||||
// external links to be opened in a new tab, not in a new guest view so we
|
||||
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h
|
||||
index 9b293d0df6c634bf44a69d607c4eee839a74b4a1..7e5b9cbdcc232c5e20eae0130d800f508411b827 100644
|
||||
index d9e6b8c6941feb7dd0afd759f92753ab46545365..2216ee05f26efdc4e1b3f0f55db8d5f30b3c18e0 100644
|
||||
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.h
|
||||
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h
|
||||
@@ -55,8 +55,7 @@ class ExtensionOptionsGuest
|
||||
@@ -59,8 +59,7 @@ class ExtensionOptionsGuest
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -302,7 +302,7 @@ index 9b293d0df6c634bf44a69d607c4eee839a74b4a1..7e5b9cbdcc232c5e20eae0130d800f50
|
||||
content::RenderFrameHost* opener,
|
||||
content::SiteInstance* source_site_instance,
|
||||
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
index b794ee4204fb8eaf90084e762f80988af13609b4..ac4e00f2ef1d2a722851d88531c28e65dea0341e 100644
|
||||
index df1d12a9dcd3809a43f2de769492f66c8098313d..f6f5c052d897814913022491d893a9bade91db47 100644
|
||||
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
|
||||
@@ -385,8 +385,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
|
||||
@@ -316,10 +316,10 @@ index b794ee4204fb8eaf90084e762f80988af13609b4..ac4e00f2ef1d2a722851d88531c28e65
|
||||
}
|
||||
|
||||
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
index 647a9bdf39c60f61cf3c9520bc7e57e206678cd0..59860dc143467168e2ce596f26c84ed8a26be6ed 100644
|
||||
index 663322919d45362718399b5265f9dd16acaea894..e4e599c2ee10ed0a650d6d77c6cfdfd62678b613 100644
|
||||
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
|
||||
@@ -167,8 +167,7 @@ class MimeHandlerViewGuest
|
||||
@@ -172,8 +172,7 @@ class MimeHandlerViewGuest
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -330,35 +330,35 @@ index 647a9bdf39c60f61cf3c9520bc7e57e206678cd0..59860dc143467168e2ce596f26c84ed8
|
||||
content::RenderFrameHost* opener,
|
||||
content::SiteInstance* source_site_instance,
|
||||
diff --git a/fuchsia/engine/browser/frame_impl.cc b/fuchsia/engine/browser/frame_impl.cc
|
||||
index 2863abb239a77b96e638c83f47ae7219cf0ccec8..5675ad386efa99383067eb404b385cf2ec46142e 100644
|
||||
index 264846f62b075fd31be93d65b033ad65fb865b90..1325f58e02f7f28fd58d58c3d8317587c4827e19 100644
|
||||
--- a/fuchsia/engine/browser/frame_impl.cc
|
||||
+++ b/fuchsia/engine/browser/frame_impl.cc
|
||||
@@ -388,8 +388,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
|
||||
@@ -379,8 +379,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) {
|
||||
+ const mojom::CreateNewWindowParams& params) {
|
||||
+ const content::mojom::CreateNewWindowParams& params) {
|
||||
// Specify a generous upper bound for unacknowledged popup windows, so that we
|
||||
// can catch bad client behavior while not interfering with normal operation.
|
||||
constexpr size_t kMaxPendingWebContentsCount = 10;
|
||||
diff --git a/fuchsia/engine/browser/frame_impl.h b/fuchsia/engine/browser/frame_impl.h
|
||||
index 3e65c4e8faf63ab1d42e3f57457a071e322383dc..5f4d859f8f3ebb58336485a0a39837eec2c46294 100644
|
||||
index 90fe755aa7dddee8c1f129a4e125efba060ce055..7be424f7b49e37f6d67a4d5d4e105dc292a2f816 100644
|
||||
--- a/fuchsia/engine/browser/frame_impl.h
|
||||
+++ b/fuchsia/engine/browser/frame_impl.h
|
||||
@@ -246,8 +246,7 @@ class FrameImpl : public fuchsia::web::Frame,
|
||||
@@ -247,8 +247,7 @@ class FrameImpl : public fuchsia::web::Frame,
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
- const std::string& frame_name,
|
||||
- const GURL& target_url) override;
|
||||
+ const mojom::CreateNewWindowParams& params) override;
|
||||
+ const content::mojom::CreateNewWindowParams& params) override;
|
||||
void WebContentsCreated(content::WebContents* source_contents,
|
||||
int opener_render_process_id,
|
||||
int opener_render_frame_id,
|
||||
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
|
||||
index 09bb4b3ef68aeb6dc2fa83ab574c46bebc68dcd1..e104fcba8c5c2e5530ae9a231c21fb1cd69ee303 100644
|
||||
index a98d00127990627a39fc1349c22b28921a3b3cbb..a4143738b611bc01427f185bc95d2faab865a7c6 100644
|
||||
--- a/headless/lib/browser/headless_web_contents_impl.cc
|
||||
+++ b/headless/lib/browser/headless_web_contents_impl.cc
|
||||
@@ -192,8 +192,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
|
||||
|
||||
@@ -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 7f050d074a057b9226444432625e3df856c5d1d8..27f4f83da31dbd3a1e754279e760dddf00224e1b 100644
|
||||
index 9572c236c2db5c23d910354ed9b07cc8ea82cfb1..5016aa8bcbcc0c8db3e8e42b04ccef3552adda8b 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -6736,6 +6736,7 @@ static_library("browser") {
|
||||
@@ -6822,6 +6822,7 @@ static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
|
||||
@@ -11,7 +11,7 @@ and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
|
||||
patches.
|
||||
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.cc b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
|
||||
index d6d896b87bb327bd7387335bd5bbac4616316f1e..ec0293ba8b66df5c9a34435cb2a0c9a333ebdf7a 100644
|
||||
index ed2ac20679a9357c9493224ec5e08837c7860d6e..7f9a97e11395e5521e100694cd37bcd95bcd8e35 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_ozone.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
|
||||
@@ -58,7 +58,8 @@ bool GlobalShortcutListenerOzone::RegisterAcceleratorImpl(
|
||||
@@ -86,61 +86,6 @@ index 0f344ee352a48497e77a72bb298146c61e7fcf2a..3bad4263ea552fc63445bf5613f8add7
|
||||
|
||||
// Create an observer that registers a hot key for |accelerator|.
|
||||
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.cc b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
index ab719d290288a0cd35851f4e952b39180f4f3a22..882bd38d886d3b499fa8a6403c409fcee1374953 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.cc
|
||||
@@ -33,7 +33,7 @@ bool GlobalShortcutListenerX11::RegisterAcceleratorImpl(
|
||||
|
||||
const bool registered = XGlobalShortcutListener::RegisterAccelerator(
|
||||
accelerator.key_code(), accelerator.IsAltDown(), accelerator.IsCtrlDown(),
|
||||
- accelerator.IsShiftDown());
|
||||
+ accelerator.IsShiftDown(), accelerator.IsCmdDown());
|
||||
if (registered)
|
||||
registered_hot_keys_.insert(accelerator);
|
||||
|
||||
@@ -46,7 +46,7 @@ void GlobalShortcutListenerX11::UnregisterAcceleratorImpl(
|
||||
|
||||
XGlobalShortcutListener::UnregisterAccelerator(
|
||||
accelerator.key_code(), accelerator.IsAltDown(), accelerator.IsCtrlDown(),
|
||||
- accelerator.IsShiftDown());
|
||||
+ accelerator.IsShiftDown(), accelerator.IsCmdDown());
|
||||
|
||||
registered_hot_keys_.erase(accelerator);
|
||||
}
|
||||
@@ -54,7 +54,8 @@ void GlobalShortcutListenerX11::UnregisterAcceleratorImpl(
|
||||
void GlobalShortcutListenerX11::OnKeyPressed(ui::KeyboardCode key_code,
|
||||
bool is_alt_down,
|
||||
bool is_ctrl_down,
|
||||
- bool is_shift_down) {
|
||||
+ bool is_shift_down,
|
||||
+ bool is_cmd_down) {
|
||||
int modifiers = 0;
|
||||
if (is_alt_down)
|
||||
modifiers |= ui::EF_ALT_DOWN;
|
||||
@@ -62,6 +63,8 @@ void GlobalShortcutListenerX11::OnKeyPressed(ui::KeyboardCode key_code,
|
||||
modifiers |= ui::EF_CONTROL_DOWN;
|
||||
if (is_shift_down)
|
||||
modifiers |= ui::EF_SHIFT_DOWN;
|
||||
+ if (is_cmd_down)
|
||||
+ modifiers |= ui::EF_COMMAND_DOWN;
|
||||
NotifyKeyPressed(ui::Accelerator(key_code, modifiers));
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener_x11.h b/chrome/browser/extensions/global_shortcut_listener_x11.h
|
||||
index 49d1c3224fdab07526a6150318d7603bf4a3f27c..3aab0d9033554035ca2b0909f219592d71213de1 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener_x11.h
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener_x11.h
|
||||
@@ -34,7 +34,8 @@ class GlobalShortcutListenerX11 : public GlobalShortcutListener,
|
||||
void OnKeyPressed(ui::KeyboardCode key_code,
|
||||
bool is_alt_down,
|
||||
bool is_ctrl_down,
|
||||
- bool is_shift_down) override;
|
||||
+ bool is_shift_down,
|
||||
+ bool is_cmd_down) override;
|
||||
|
||||
std::set<ui::Accelerator> registered_hot_keys_;
|
||||
};
|
||||
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
|
||||
index 4145418210c2b1033390ec8a2e657cb1fcd048f8..5938f75742b793868638e693a9a8c8dc686dfc46 100644
|
||||
--- a/content/browser/media/media_keys_listener_manager_impl.cc
|
||||
@@ -172,7 +117,7 @@ index 1145e1f3d79482b5bb468c3128431ac674310e5f..e9f595045e0c076e0735f27dfc38bfbc
|
||||
|
||||
} // namespace ui
|
||||
diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
index 60f7ad6ffb28fa6554e02a7e031408f4d1124d86..0e8325e993178443d926249c427957bb16991861 100644
|
||||
index ada705fb42e88d4bfa05b212c84111be9057a50e..a866b975687dd08ad88031a63f161b3164e82455 100644
|
||||
--- a/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
+++ b/ui/base/accelerators/media_keys_listener_mac.mm
|
||||
@@ -32,6 +32,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) {
|
||||
@@ -188,7 +133,7 @@ index 60f7ad6ffb28fa6554e02a7e031408f4d1124d86..0e8325e993178443d926249c427957bb
|
||||
}
|
||||
return VKEY_UNKNOWN;
|
||||
}
|
||||
@@ -191,7 +197,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
|
||||
@@ -192,7 +198,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy,
|
||||
int key_code = (data1 & 0xFFFF0000) >> 16;
|
||||
if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT &&
|
||||
key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST &&
|
||||
|
||||
@@ -13,7 +13,7 @@ Ultimately we should remove the option to disable compression, and
|
||||
subsequently remove this patch.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 094244b198745e6fbbfb8d72e7bc2e0ceb4db88c..5786d0ea9dd272ffa8140ce490d0d09f60f8b373 100644
|
||||
index 003702f4f0b1ddab26dee9a6154297fc0204b716..9986974ad1c76269ae0aae5ad14b1c9ac268d87e 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -110,6 +110,8 @@ void SetUploadURL(const std::string& url) {
|
||||
@@ -25,7 +25,7 @@ index 094244b198745e6fbbfb8d72e7bc2e0ceb4db88c..5786d0ea9dd272ffa8140ce490d0d09f
|
||||
#endif
|
||||
|
||||
bool g_is_node = false;
|
||||
@@ -1321,56 +1323,60 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
@@ -1323,56 +1325,60 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
|
||||
#else // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
@@ -127,7 +127,7 @@ index 094244b198745e6fbbfb8d72e7bc2e0ceb4db88c..5786d0ea9dd272ffa8140ce490d0d09f
|
||||
static const char header_msg[] =
|
||||
"--header=Content-Type: multipart/form-data; boundary=";
|
||||
const size_t header_content_type_size =
|
||||
@@ -1397,7 +1403,8 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
@@ -1399,7 +1405,8 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
|
||||
static const char kWgetBinary[] = "/usr/bin/wget";
|
||||
const char* args[] = {
|
||||
kWgetBinary,
|
||||
@@ -137,7 +137,7 @@ index 094244b198745e6fbbfb8d72e7bc2e0ceb4db88c..5786d0ea9dd272ffa8140ce490d0d09f
|
||||
header_content_type,
|
||||
post_file,
|
||||
g_upload_url,
|
||||
@@ -2038,6 +2045,7 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
@@ -2040,6 +2047,7 @@ void InitCrashReporter(const std::string& process_type) {
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
SetUploadURL(GetCrashReporterClient()->GetUploadUrl());
|
||||
|
||||
@@ -9,7 +9,7 @@ rate-limiting, compression and global annotations.
|
||||
This should be upstreamed.
|
||||
|
||||
diff --git a/components/crash/core/app/breakpad_linux.cc b/components/crash/core/app/breakpad_linux.cc
|
||||
index 00009dacdc2b084d7c647ab34c8c8be6decf1a5b..5eb19c8a47467d8df30316bfbd7f3c2f38aea7c0 100644
|
||||
index 93d05b949c26c3ff96f62504760dbb96c1054387..b1392d74ca4ff08f6e293a72d1d453baa5f91cbc 100644
|
||||
--- a/components/crash/core/app/breakpad_linux.cc
|
||||
+++ b/components/crash/core/app/breakpad_linux.cc
|
||||
@@ -112,6 +112,7 @@ void SetUploadURL(const std::string& url) {
|
||||
|
||||
@@ -16,10 +16,10 @@ https://github.com/electron/electron/pull/18483#discussion_r292703588
|
||||
https://github.com/electron/electron/pull/18483#issuecomment-501090683
|
||||
|
||||
diff --git a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
|
||||
index 9394256e05748297988dd457439875409ed96461..a5502155e6bb9370cf73a9a571054eac9b0253a2 100644
|
||||
index 92d5c5d47cfa5bd70300bb8bbc16ab944cd93509..87c14718221a83d531d15abf1f1d2d1bbc020e77 100644
|
||||
--- a/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
|
||||
+++ b/third_party/crashpad/crashpad/util/win/exception_handler_server.cc
|
||||
@@ -444,9 +444,16 @@ bool ExceptionHandlerServer::ServiceClientConnection(
|
||||
@@ -446,9 +446,16 @@ bool ExceptionHandlerServer::ServiceClientConnection(
|
||||
DWORD real_pid = 0;
|
||||
if (get_named_pipe_client_process_id(service_context.pipe(), &real_pid) &&
|
||||
message.registration.client_process_id != real_pid) {
|
||||
|
||||
@@ -16,11 +16,24 @@ example, the checks might be disabled for a whole build target, but actually
|
||||
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/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc b/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc
|
||||
index c490dd7ca2dbe499fbf99509293900318c6b7739..2de3b90801b2daba2eac0263f010c834468b7fd6 100644
|
||||
--- a/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc
|
||||
+++ b/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc
|
||||
@@ -423,7 +423,7 @@ void MobileFriendlinessChecker::ComputeSmallTextRatio(
|
||||
->GetPageScaleConstraintsSet()
|
||||
.FinalConstraints()
|
||||
.initial_scale;
|
||||
- DCHECK_GT(initial_scale, 0);
|
||||
+ // DCHECK_GT(initial_scale, 0);
|
||||
double actual_font_size =
|
||||
style.FontSize() * initial_scale / viewport_scalar_;
|
||||
double area = text->PhysicalAreaSize();
|
||||
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
||||
index 68c758df6954c0deb25d8d93da2d22f8cdf00771..03bdc80a1e1b5db4731a81f5a2851722e3c0d652 100644
|
||||
index fe8d191217e24b08d36339dbf047beaeb6bd6538..870db0552544e3e89d9498c22ec3db81b46df741 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -923,10 +923,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
|
||||
@@ -891,10 +891,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
|
||||
|
||||
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
|
||||
UINT cf_format = format.ToFormatEtc().cfFormat;
|
||||
|
||||
@@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
|
||||
re-submitting the patch.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 29fd158813a0d4ecd5f7cb41cd2c9a6bf8a29f6c..b3f2e64cb729f43faeb0e3af39ca5469d77fb503 100644
|
||||
index 915ae322cb6a21668553e196bab5fbca891028a3..c97118c1380734e9cdc91b9d7191e0dc71d8b8ed 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -752,7 +752,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
@@ -763,7 +763,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ Subject: desktop_media_list.patch
|
||||
* Disabled WindowCaptureMacV2 feature for https://github.com/electron/electron/pull/30507
|
||||
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
index d9737047f54bbf3811ae2a347790f6b3d286da3d..5b69c3a4ade9fa7f105f42ebf0e82750a83cf276 100644
|
||||
index 57cfc646f8ea545271c22d79ec158a04b148bc9c..db4d608d3bed841ddf7225d0918e82112c8d08b5 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
|
||||
@@ -86,7 +86,7 @@ class DesktopMediaList {
|
||||
@@ -94,7 +94,7 @@ class DesktopMediaList {
|
||||
// once per DesktopMediaList instance. It should not be called after
|
||||
// StartUpdating(), and StartUpdating() should not be called until |callback|
|
||||
// has been called.
|
||||
@@ -20,15 +20,16 @@ index d9737047f54bbf3811ae2a347790f6b3d286da3d..5b69c3a4ade9fa7f105f42ebf0e82750
|
||||
virtual int GetSourceCount() const = 0;
|
||||
virtual const Source& GetSource(int index) 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 a3e1de40e843b5450f417a0455e0e7d7dee1d1bd..63befdc162a4b4a16e8c5099abb0f5af602894fc 100644
|
||||
index 24bd95b79479c21182a0d1a61364e1794f900261..2b2a7494ee9bd88fd5c8ebf50a5e29738b2dffd0 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
||||
@@ -54,11 +54,11 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
|
||||
@@ -63,12 +63,12 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
|
||||
Refresh(true);
|
||||
}
|
||||
|
||||
-void DesktopMediaListBase::Update(UpdateCallback callback) {
|
||||
+void DesktopMediaListBase::Update(UpdateCallback callback, bool refresh_thumbnails) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
DCHECK(sources_.empty());
|
||||
DCHECK(!refresh_callback_);
|
||||
refresh_callback_ = std::move(callback);
|
||||
@@ -38,7 +39,7 @@ index a3e1de40e843b5450f417a0455e0e7d7dee1d1bd..63befdc162a4b4a16e8c5099abb0f5af
|
||||
|
||||
int DesktopMediaListBase::GetSourceCount() const {
|
||||
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
|
||||
index c87535950fdc6cf1c5641835a69971d0e1654025..a6151407ae3ac3456d0af07330db3d1ae82bd6a9 100644
|
||||
index 98cc4e039ba2b5a467175b15650a7b8ef38e8249..f5aea6a5916b9aa56ee7b81a8de97dc44e04a759 100644
|
||||
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
|
||||
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
|
||||
@@ -35,7 +35,7 @@ class DesktopMediaListBase : public DesktopMediaList {
|
||||
@@ -51,7 +52,7 @@ index c87535950fdc6cf1c5641835a69971d0e1654025..a6151407ae3ac3456d0af07330db3d1a
|
||||
const Source& GetSource(int index) const override;
|
||||
DesktopMediaList::Type GetMediaListType() const override;
|
||||
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
index 4c822ebcca602ecbd30fbc79d72a1ecabc273229..d9f45c280ce4f5771c379033d8034e68681e42f8 100644
|
||||
index c899b52ef01d2c9ea16b281a2b7c4d37f175fa36..a5fc476a52215eba33193012629ab1f73d679c88 100644
|
||||
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
||||
@@ -16,7 +16,7 @@
|
||||
@@ -63,17 +64,14 @@ index 4c822ebcca602ecbd30fbc79d72a1ecabc273229..d9f45c280ce4f5771c379033d8034e68
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/common/content_features.h"
|
||||
@@ -94,8 +94,9 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
|
||||
@@ -94,6 +94,7 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
|
||||
}
|
||||
|
||||
#if defined(OS_MAC)
|
||||
+// Refs https://github.com/electron/electron/pull/30507
|
||||
const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
#endif
|
||||
|
||||
} // namespace
|
||||
@@ -427,6 +428,8 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
|
||||
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
|
||||
base::Unretained(worker_.get()),
|
||||
|
||||
@@ -15,10 +15,10 @@ the redraw locking mechanism, which fixes these issues. The electron issue
|
||||
can be found at https://github.com/electron/electron/issues/1821
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 81132959080d21a341fcc418fcd7c73cf62b78c4..9cac7284aeacda2d877502f97d9e442ae4fdadd3 100644
|
||||
index 8694e28a174b937e39cbfcbf1eb9e67123c7b93c..149edcde6c1ad336f39f65c36ed2bb87a2b2a800 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -309,6 +309,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
@@ -308,6 +308,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -29,7 +29,7 @@ index 81132959080d21a341fcc418fcd7c73cf62b78c4..9cac7284aeacda2d877502f97d9e442a
|
||||
// A scoping class that prevents a window from being able to redraw in response
|
||||
// to invalidations that may occur within it for the lifetime of the object.
|
||||
//
|
||||
@@ -360,6 +364,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
|
||||
@@ -359,6 +363,7 @@ class HWNDMessageHandler::ScopedRedrawLock {
|
||||
cancel_unlock_(false),
|
||||
should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() &&
|
||||
::IsWindow(hwnd_) &&
|
||||
@@ -37,7 +37,7 @@ index 81132959080d21a341fcc418fcd7c73cf62b78c4..9cac7284aeacda2d877502f97d9e442a
|
||||
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
|
||||
!ui::win::IsAeroGlassEnabled())) {
|
||||
if (should_lock_)
|
||||
@@ -979,6 +984,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
|
||||
@@ -978,6 +983,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
|
||||
return scoped_enable;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
|
||||
https://crbug.com/634542 and https://crbug.com/711107.
|
||||
|
||||
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
||||
index c841d7f51ea7a99fe2e806e4102bf91d75853ed0..ed983081afb0f4ead01da32cd56d61ecb63d33dd 100644
|
||||
index f898c7dd71ed30624fc16651fce1e1519d142a6a..2331fdc7e8bb8efce35c620b6f9e95ccb117938e 100644
|
||||
--- a/cc/trees/layer_tree_host_impl.cc
|
||||
+++ b/cc/trees/layer_tree_host_impl.cc
|
||||
@@ -1789,6 +1789,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
@@ -1800,6 +1800,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
|
||||
gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace(
|
||||
gfx::ContentColorUsage content_color_usage) const {
|
||||
@@ -60,7 +60,7 @@ index e58b4023652785fa8ea47236a5ad7237c7ea6ed2..4ec673ea93410ee00b1af4330fdc8b52
|
||||
bool force_antialiasing = false;
|
||||
bool force_blending_with_shaders = false;
|
||||
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
|
||||
index aab0c5d1dbdfce9b56ada8861a0a7ffb42704a96..430ad6cfc7bba31bc097e654765fb94d42bcdfe5 100644
|
||||
index d79f3beb58085672e0a67825a0b60de2a3aeb499..5f7ca2ea0d012be5518dd07ade8cf2820b4fd7a9 100644
|
||||
--- a/components/viz/host/renderer_settings_creation.cc
|
||||
+++ b/components/viz/host/renderer_settings_creation.cc
|
||||
@@ -17,6 +17,7 @@
|
||||
@@ -71,7 +71,7 @@ index aab0c5d1dbdfce9b56ada8861a0a7ffb42704a96..430ad6cfc7bba31bc097e654765fb94d
|
||||
|
||||
#if defined(OS_APPLE)
|
||||
#include "ui/base/cocoa/remote_layer_api.h"
|
||||
@@ -54,6 +55,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
@@ -53,6 +54,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
RendererSettings CreateRendererSettings() {
|
||||
RendererSettings renderer_settings;
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
@@ -81,10 +81,10 @@ index aab0c5d1dbdfce9b56ada8861a0a7ffb42704a96..430ad6cfc7bba31bc097e654765fb94d
|
||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||
|
||||
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
||||
index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e7340d455b2a 100644
|
||||
index 98de8cd6372daf7d1c94353e6a9b2663a5325bca..d2d0ebc2dd2dbf5cd31bfa5071d82ce112065303 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -90,6 +90,9 @@
|
||||
@@ -86,6 +86,9 @@
|
||||
|
||||
using gpu::gles2::GLES2Interface;
|
||||
|
||||
@@ -94,7 +94,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
namespace viz {
|
||||
namespace {
|
||||
|
||||
@@ -680,8 +683,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
@@ -677,8 +680,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
|
||||
SetBlendEnabled(quad->ShouldDrawWithBlending());
|
||||
|
||||
@@ -106,7 +106,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1671,7 +1675,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
@@ -1668,7 +1672,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
params->apply_shader_based_rounded_corner &&
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
@@ -116,7 +116,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -2144,15 +2149,16 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
@@ -2141,15 +2146,16 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -136,7 +136,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
gfx::ColorTransform::TriStim col(color_f.fR, color_f.fG, color_f.fB);
|
||||
color_transform->Transform(&col, 1);
|
||||
color_f.fR = col.x();
|
||||
@@ -2374,7 +2380,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2371,7 +2377,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -146,7 +146,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2473,7 +2480,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2470,7 +2477,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -156,7 +156,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2583,7 +2591,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
@@ -2580,7 +2588,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
// The source color space should never be RGB.
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
@@ -166,7 +166,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
@@ -2764,7 +2773,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
@@ -2761,7 +2770,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -176,7 +176,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2835,8 +2845,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
@@ -2832,8 +2842,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
@@ -187,7 +187,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
/*adjust_src_white_level=*/draw_cache_.is_video_frame,
|
||||
locked_quad.hdr_metadata());
|
||||
|
||||
@@ -3694,7 +3704,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
|
||||
@@ -3686,7 +3696,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
|
||||
const gfx::ColorSpace& dst_color_space,
|
||||
bool adjust_src_white_level,
|
||||
absl::optional<gfx::HDRMetadata> hdr_metadata) {
|
||||
@@ -198,7 +198,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
gfx::ColorSpace adjusted_src_color_space = src_color_space;
|
||||
if (adjust_src_white_level && src_color_space.IsHDR()) {
|
||||
// TODO(b/183236148): consider using the destination's HDR static metadata
|
||||
@@ -4077,9 +4089,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
@@ -4069,9 +4081,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -4299,8 +4311,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
@@ -4291,8 +4303,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
@@ -222,17 +222,17 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -4489,3 +4501,5 @@ GLRenderer::OverlayTexture::OverlayTexture() = default;
|
||||
@@ -4481,3 +4493,5 @@ GLRenderer::OverlayTexture::OverlayTexture() = default;
|
||||
GLRenderer::OverlayTexture::~OverlayTexture() = default;
|
||||
|
||||
} // namespace viz
|
||||
+
|
||||
+#undef PATCH_CS
|
||||
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
||||
index 49d6d4107c0e4e0c37471394c5b7bdf84b3c823a..f0773c8fe1ccf0a3f920c840719ad7ee07d5d0db 100644
|
||||
index 3a8decde7b5ce9ae3b20041885749e4763b3d311..390af09a9e53ac30c5682746dc40ccd0edaf7ecb 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -224,6 +224,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
@@ -225,6 +225,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
|
||||
// Command-line switches to propagate to the GPU process.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -241,7 +241,7 @@ index 49d6d4107c0e4e0c37471394c5b7bdf84b3c823a..f0773c8fe1ccf0a3f920c840719ad7ee
|
||||
sandbox::policy::switches::kGpuSandboxAllowSysVShm,
|
||||
sandbox::policy::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 3555928a29b3c6022621c4e9b65531edbefa7797..9b36af8cd02f56810b6b8ed86d1c8ba544567233 100644
|
||||
index 2f980b8f92516a4edab3d9363ab76666e1dcfab6..d244ec871c7c86e7da19b5c2892dd42980fb97a3 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -182,6 +182,7 @@
|
||||
@@ -252,7 +252,7 @@ index 3555928a29b3c6022621c4e9b65531edbefa7797..9b36af8cd02f56810b6b8ed86d1c8ba5
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
@@ -3416,6 +3417,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
@@ -3408,6 +3409,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[] = {
|
||||
@@ -293,7 +293,7 @@ index 94ca8fd75212fa5c7b90823a112309dd7961353b..566393827ef739eb8fc0e24e6ee505e1
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
|
||||
index 62ff201dae894250b84ad3c32f477ff9324e1906..e53116a55c234f1cbc2d8f05cc8090e931095f1a 100644
|
||||
index 895b440cc19c2bd9e14490171c7765fa278677af..487779555c1b5da2cda4d7ae4fa32a378987c3ce 100644
|
||||
--- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
|
||||
+++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling
|
||||
Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
index 5aac5fcfe781e282b748630c07341d1b465d99ac..987b0e85ead3a33c8d0a93ac9a6c95782b22af96 100644
|
||||
index ec191047cca6d8e7d00e445942461e9b47098ec1..67adae61e7fa6ea0cab7c028132fce5f0c64b876 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -491,7 +491,11 @@
|
||||
@@ -478,7 +478,11 @@
|
||||
return;
|
||||
|
||||
host()->WasHidden();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: disable_hidden.patch
|
||||
Electron uses this to disable background throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 3ec7188cc015df085e46d3dac1374af1d92ae4d3..a1632e19959d163eecafef484204aa0dba919897 100644
|
||||
index cc527298ebe3cb9dc5b5d3fde3e4854a2062ec45..80b15389f7dcb946c9bb29359fa89f5d72f4e99b 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -776,6 +776,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -778,6 +778,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
if (is_hidden_)
|
||||
return;
|
||||
|
||||
@@ -20,10 +20,10 @@ index 3ec7188cc015df085e46d3dac1374af1d92ae4d3..a1632e19959d163eecafef484204aa0d
|
||||
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 b7a3b2bc9032934a8537a49b8e1fd895eae721dd..aa864537cf2c3002623427ecd10ff62c88e75aba 100644
|
||||
index da1bc9c7e01c6eef07b1066976e7487767d716f2..5d123c6c48b299745f7524ea8927043e1bd430a3 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -864,6 +864,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
@@ -865,6 +865,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
void OnLocalSurfaceIdChanged(
|
||||
const cc::RenderFrameMetadata& metadata) override;
|
||||
|
||||
@@ -34,10 +34,10 @@ index b7a3b2bc9032934a8537a49b8e1fd895eae721dd..aa864537cf2c3002623427ecd10ff62c
|
||||
// |routing_id| must not be MSG_ROUTING_NONE.
|
||||
// If this object outlives |delegate|, DetachDelegate() must be called when
|
||||
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 afdd5aa89be899a1176a770c7a4c06f7fa2579ef..0ea6f2ee5bfd41bfb36db6de19a42128b4894dd8 100644
|
||||
index 239088813b9fa96e9e9899acee6f02bcb828ecde..7955f2cb725ef4c011bbbce74820d98783d56a0c 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -605,7 +605,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
@@ -611,7 +611,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
DCHECK(visibility_ == Visibility::HIDDEN ||
|
||||
visibility_ == Visibility::OCCLUDED);
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we
|
||||
should continue seeking for a real fix.
|
||||
|
||||
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
|
||||
index cb2bde331db92cd29a3af5ca2c065bbf02b39208..46ba89e09cf228bc022142e040763b5a9332764c 100644
|
||||
index 034aaf10263002789e941dbf989b407817030fbc..3af98993ba83688a1ba36008758ea9c489e2373e 100644
|
||||
--- a/content/browser/renderer_host/navigator.cc
|
||||
+++ b/content/browser/renderer_host/navigator.cc
|
||||
@@ -1105,6 +1105,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
@@ -1110,6 +1110,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
.InMilliseconds());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ index cb2bde331db92cd29a3af5ca2c065bbf02b39208..46ba89e09cf228bc022142e040763b5a
|
||||
// If this is a same-process navigation and we have timestamps for unload
|
||||
// durations, fill those metrics out as well.
|
||||
if (params.unload_start && params.unload_end &&
|
||||
@@ -1151,6 +1152,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
@@ -1156,6 +1157,7 @@ void Navigator::RecordNavigationMetrics(
|
||||
first_before_unload_start_time)
|
||||
.InMilliseconds());
|
||||
}
|
||||
|
||||
@@ -6,30 +6,23 @@ Subject: Don't run PCScan functions if PCScan is disabled
|
||||
PCScan should not be invoked if PCScan is disabled. Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/2916657.
|
||||
|
||||
diff --git a/base/allocator/partition_allocator/memory_reclaimer.cc b/base/allocator/partition_allocator/memory_reclaimer.cc
|
||||
index fd846ca91cb17638bf07ca35bf695099174f8f00..5b2ab293ade39b2ecd68d0438034da77417b1e94 100644
|
||||
index 479b7caf6a2142e5097fd5dd75282deb35a1c402..9c2ab518fabebf58d081e3656affc0ea40f497ac 100644
|
||||
--- a/base/allocator/partition_allocator/memory_reclaimer.cc
|
||||
+++ b/base/allocator/partition_allocator/memory_reclaimer.cc
|
||||
@@ -121,6 +121,7 @@ void PartitionAllocMemoryReclaimer::Reclaim(int flags) {
|
||||
AutoLock lock(lock_); // Has to protect from concurrent (Un)Register calls.
|
||||
TRACE_EVENT0("base", "PartitionAllocMemoryReclaimer::Reclaim()");
|
||||
|
||||
+#if defined(PA_ALLOW_PCSCAN)
|
||||
// PCScan quarantines freed slots. Trigger the scan first to let it call
|
||||
// FreeNoHooksImmediate on slots that pass the quarantine.
|
||||
@@ -136,7 +136,7 @@ void PartitionAllocMemoryReclaimer::Reclaim(int flags) {
|
||||
//
|
||||
@@ -137,6 +138,7 @@ void PartitionAllocMemoryReclaimer::Reclaim(int flags) {
|
||||
: PCScan::InvocationMode::kBlocking;
|
||||
PCScan::PerformScanIfNeeded(invocation_mode);
|
||||
}
|
||||
+#endif
|
||||
|
||||
#if defined(PA_THREAD_CACHE_SUPPORTED)
|
||||
// Don't completely empty the thread cache outside of low memory situations,
|
||||
// Lastly decommit empty slot spans and lastly try to discard unused pages at
|
||||
// the end of the remaining active slots.
|
||||
-#if PA_STARSCAN_ENABLE_STARSCAN_ON_RECLAIM
|
||||
+#if PA_STARSCAN_ENABLE_STARSCAN_ON_RECLAIM && defined(PA_ALLOW_PCSCAN)
|
||||
{
|
||||
using PCScan = internal::PCScan;
|
||||
const auto invocation_mode = flags & PartitionPurgeAggressiveReclaim
|
||||
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
|
||||
index e6c8ec66ab837ffa9c47495c170854a6fa000476..3e6eeda6e57a06b680cbfadea6fc886bbccbc247 100644
|
||||
index 4d717742610b6dc4419c632aa3f6b5494fa90c5e..8c5e20df3f7630610c88cf28420f3460531003e6 100644
|
||||
--- a/base/threading/platform_thread_posix.cc
|
||||
+++ b/base/threading/platform_thread_posix.cc
|
||||
@@ -39,6 +39,7 @@
|
||||
@@ -40,6 +40,7 @@
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
|
||||
@@ -37,8 +30,8 @@ index e6c8ec66ab837ffa9c47495c170854a6fa000476..3e6eeda6e57a06b680cbfadea6fc886b
|
||||
#include "base/allocator/partition_allocator/starscan/pcscan.h"
|
||||
#include "base/allocator/partition_allocator/starscan/stack/stack.h"
|
||||
#endif
|
||||
@@ -72,7 +73,7 @@ void* ThreadFunc(void* params) {
|
||||
base::ThreadRestrictions::SetSingletonAllowed(false);
|
||||
@@ -73,7 +74,7 @@ void* ThreadFunc(void* params) {
|
||||
base::DisallowSingleton();
|
||||
|
||||
#if !defined(OS_NACL)
|
||||
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
|
||||
@@ -46,7 +39,7 @@ index e6c8ec66ab837ffa9c47495c170854a6fa000476..3e6eeda6e57a06b680cbfadea6fc886b
|
||||
internal::PCScan::NotifyThreadCreated(internal::GetStackPointer());
|
||||
#endif
|
||||
|
||||
@@ -98,7 +99,7 @@ void* ThreadFunc(void* params) {
|
||||
@@ -99,7 +100,7 @@ void* ThreadFunc(void* params) {
|
||||
PlatformThread::CurrentHandle().platform_handle(),
|
||||
PlatformThread::CurrentId());
|
||||
|
||||
@@ -56,7 +49,7 @@ index e6c8ec66ab837ffa9c47495c170854a6fa000476..3e6eeda6e57a06b680cbfadea6fc886b
|
||||
#endif
|
||||
|
||||
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
|
||||
index 86e240b231d3236aea1b0343e0e6763282ff70c9..0d85d2acb6652a580f79a2c4ca2277562dd5156b 100644
|
||||
index 2959a82daffd1a59fb0bcda5b31023c039933faf..9b59e0bf9c74d423892909b44623a1a6cd96839e 100644
|
||||
--- a/base/threading/platform_thread_win.cc
|
||||
+++ b/base/threading/platform_thread_win.cc
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
@@ -11,10 +11,10 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572
|
||||
Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393
|
||||
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index ebf2d997f03c36e5242405002c7dce583aec31dc..2cf1ac25f3c4ca0348502a37dbf84111842ced93 100644
|
||||
index 900b8125f3fc6dcec4a1637fae6fcb2af40af5ab..d37001436b32848ac4929f831560fa02cea7a22a 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -2347,7 +2347,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
|
||||
@@ -2344,7 +2344,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
|
||||
}
|
||||
|
||||
const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() {
|
||||
|
||||
@@ -8,7 +8,7 @@ this but it is not a blocker for releasing Electron. This patch removes
|
||||
tthe hard fail on dylib resolve failure from dump_syms
|
||||
|
||||
diff --git a/components/crash/content/tools/generate_breakpad_symbols.py b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
index 149c2b49c21efe7f6c5449ea225c8ed7d52287a8..4b68592d88cf703a6abbe8f875bffefdee8272bc 100755
|
||||
index f8802dae3832ce5f92ce0585d8489167b7d18ceb..873d1d79af70f3cde37db8aed7117be254ce23b6 100755
|
||||
--- a/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
+++ b/components/crash/content/tools/generate_breakpad_symbols.py
|
||||
@@ -206,7 +206,7 @@ def GetSharedLibraryDependenciesMac(binary, exe_path):
|
||||
|
||||
@@ -19,10 +19,10 @@ index d8411ddc4fd88a1416181cce366b112df3f48d63..a33ec53b96fec67feacc92e71fa6ed17
|
||||
aspect_ratio.height());
|
||||
}
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 9cac7284aeacda2d877502f97d9e442ae4fdadd3..33c533665589f78425488547b550876c5161f010 100644
|
||||
index 149edcde6c1ad336f39f65c36ed2bb87a2b2a800..a235cab941ec583a8dc9cb5e4105c2d7baae02df 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -929,8 +929,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
|
||||
@@ -928,8 +928,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
|
||||
}
|
||||
|
||||
void HWNDMessageHandler::SetAspectRatio(float aspect_ratio) {
|
||||
|
||||
@@ -9,7 +9,7 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead
|
||||
of the default V8 allocator. This probably can't be usptreamed.
|
||||
|
||||
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
|
||||
index e5da06566ffef8d0b394c0d7fde3916ce49da06e..76bbdf35f4751c87a6d25cc5e8db7aebf43bc821 100644
|
||||
index c9b535eb083c250f4f874d8e6bd0c29ea9f3a10f..f220b8669507a4aea616b0dfbabda509647b714c 100644
|
||||
--- a/gin/public/v8_platform.h
|
||||
+++ b/gin/public/v8_platform.h
|
||||
@@ -30,6 +30,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
|
||||
@@ -18,10 +18,10 @@ index e5da06566ffef8d0b394c0d7fde3916ce49da06e..76bbdf35f4751c87a6d25cc5e8db7aeb
|
||||
PageAllocator* GetPageAllocator() override;
|
||||
+ static PageAllocator* PageAllocator();
|
||||
void OnCriticalMemoryPressure() override;
|
||||
v8::ZoneBackingAllocator* GetZoneBackingAllocator() override;
|
||||
#endif
|
||||
|
||||
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
|
||||
index 44f8ffeda27cbfebcfc57e1312e9e9f4ca3ab576..356b5a7c8f39fab97ff434850038f8f6cee750c8 100644
|
||||
index 563888e117dd234056a38a7bba971033e31d0484..cc808c563bbd95e39b6238adcccb3b32575b573e 100644
|
||||
--- a/gin/v8_platform.cc
|
||||
+++ b/gin/v8_platform.cc
|
||||
@@ -368,6 +368,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
|
||||
|
||||
@@ -10,10 +10,10 @@ patch may be merged upstream, at which point this patch should be
|
||||
removed.
|
||||
|
||||
diff --git a/net/url_request/static_http_user_agent_settings.h b/net/url_request/static_http_user_agent_settings.h
|
||||
index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a289703d8b0577 100644
|
||||
index ab97cbf061c89be9f11dde42b7371668658208a6..718209098ee4fb6cfc9aaa1ef4af691cf8d79366 100644
|
||||
--- a/net/url_request/static_http_user_agent_settings.h
|
||||
+++ b/net/url_request/static_http_user_agent_settings.h
|
||||
@@ -26,13 +26,17 @@ class NET_EXPORT StaticHttpUserAgentSettings : public HttpUserAgentSettings {
|
||||
@@ -31,13 +31,17 @@ class NET_EXPORT StaticHttpUserAgentSettings : public HttpUserAgentSettings {
|
||||
accept_language_ = new_accept_language;
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970
|
||||
std::string accept_language_;
|
||||
- const std::string user_agent_;
|
||||
+ std::string user_agent_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 7bd73dae3a77cb16cf282d2df7f4ff7a8f412805..3d3795cd1911647f026addf0d6e6bcc18325f641 100644
|
||||
index 39ff43884fbc2b6768d7ddb6e9d63031a973b8fa..5d985fc94f35a1258ecee212c56561d56a9a3ff6 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1292,6 +1292,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -1295,6 +1295,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index 7bd73dae3a77cb16cf282d2df7f4ff7a8f412805..3d3795cd1911647f026addf0d6e6bcc1
|
||||
// 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 049c8e5e0e34454f03a823b31a5f7755d67cfb07..d928b8c314f8c3384215a87aacd01a7f570316c9 100644
|
||||
index 8362af824a8dd4f721eebdbff2d544f7f5093d16..28a9ce2bfc0d84bb15b5e40d9697fbdeaa57a96a 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -271,6 +271,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -274,6 +274,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 049c8e5e0e34454f03a823b31a5f7755d67cfb07..d928b8c314f8c3384215a87aacd01a7f
|
||||
void SetEnableReferrers(bool enable_referrers) override;
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index d8e7d0d35317fe1124bf81f60faf2b35ae19a3d7..eed5109002dd99a6e65c8882530a5fd2a69ce28c 100644
|
||||
index 8f8b496324265b25046a88cbac7decec056f061e..d7c20f76f96d43df71b503ca7a2a14446e9bbe96 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1029,6 +1029,9 @@ interface NetworkContext {
|
||||
@@ -1030,6 +1030,9 @@ interface NetworkContext {
|
||||
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
||||
NetworkConditions? conditions);
|
||||
|
||||
@@ -77,7 +77,7 @@ index d8e7d0d35317fe1124bf81f60faf2b35ae19a3d7..eed5109002dd99a6e65c8882530a5fd2
|
||||
SetAcceptLanguage(string new_accept_language);
|
||||
|
||||
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
||||
index f1fbbf10df01876e8ae3418b72cd0f4fcbda542b..780ccbe1a9ff8ab91b39fdcef74cd5805ba8583d 100644
|
||||
index e41a44deca2e33b8c3f2c9c2123326b832246529..5bdc6b5a75eae0f3fb049998a7c1671753d17285 100644
|
||||
--- a/services/network/test/test_network_context.h
|
||||
+++ b/services/network/test/test_network_context.h
|
||||
@@ -134,6 +134,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
||||
|
||||
@@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be
|
||||
done in future work.
|
||||
|
||||
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 c26e087f2f4d7a1446ce439e5a08a34aa2ccfec4..e4e942300652dfff86aded228307d800c59c1012 100644
|
||||
index baf07861d4be89485605f87d344fcffdd220a063..efdb4d157a378b26f9356eaa12e78762904dc4e7 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -155,6 +155,7 @@
|
||||
|
||||
@@ -61,10 +61,10 @@ index eec994c4252f17d9c9c41e66d5dae6509ed98a18..e538c9b76da4d4435e10cd3848438446
|
||||
#if defined(OS_WIN)
|
||||
bool EscapeVirtualization(const base::FilePath& user_data_dir);
|
||||
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
|
||||
index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf949203c2ac 100644
|
||||
index a04d139f958a7aaef9b96e8c29317ccf7c97f009..e77cebd31967d28f3cb0db78e736011510634c0e 100644
|
||||
--- a/chrome/browser/process_singleton_posix.cc
|
||||
+++ b/chrome/browser/process_singleton_posix.cc
|
||||
@@ -564,6 +564,7 @@ class ProcessSingleton::LinuxWatcher
|
||||
@@ -567,6 +567,7 @@ class ProcessSingleton::LinuxWatcher
|
||||
// |reader| is for sending back ACK message.
|
||||
void HandleMessage(const std::string& current_dir,
|
||||
const std::vector<std::string>& argv,
|
||||
@@ -72,7 +72,7 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
SocketReader* reader);
|
||||
|
||||
private:
|
||||
@@ -620,13 +621,16 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
|
||||
@@ -621,13 +622,16 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
|
||||
}
|
||||
|
||||
void ProcessSingleton::LinuxWatcher::HandleMessage(
|
||||
@@ -91,7 +91,7 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
// Send back "ACK" message to prevent the client process from starting up.
|
||||
reader->FinishWithACK(kACKToken, base::size(kACKToken) - 1);
|
||||
} else {
|
||||
@@ -674,7 +678,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
|
||||
@@ -675,7 +679,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
const size_t kMinMessageLength = base::size(kStartToken) + 4;
|
||||
if (bytes_read_ < kMinMessageLength) {
|
||||
buf_[bytes_read_] = 0;
|
||||
@@ -704,10 +709,25 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
|
||||
@@ -705,10 +710,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
|
||||
tokens.erase(tokens.begin());
|
||||
tokens.erase(tokens.begin());
|
||||
|
||||
@@ -110,13 +110,16 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
+ std::vector<std::string> command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args);
|
||||
+
|
||||
+ std::vector<const uint8_t> additional_data;
|
||||
+ if (tokens.size() == 3 + num_args) {
|
||||
+ if (tokens.size() >= 3 + num_args) {
|
||||
+ size_t additional_data_size;
|
||||
+ base::StringToSizeT(tokens[1 + num_args], &additional_data_size);
|
||||
+ std::string remaining_args = base::JoinString(
|
||||
+ base::make_span(tokens.begin() + 2 + num_args, tokens.end()),
|
||||
+ std::string(1, kTokenDelimiter));
|
||||
+ const uint8_t* additional_data_bits =
|
||||
+ reinterpret_cast<const uint8_t*>(tokens[2 + num_args].c_str());
|
||||
+ additional_data = std::vector<const uint8_t>(additional_data_bits,
|
||||
+ additional_data_bits + additional_data_size);
|
||||
+ reinterpret_cast<const uint8_t*>(remaining_args.c_str());
|
||||
+ additional_data = std::vector<const uint8_t>(
|
||||
+ additional_data_bits, additional_data_bits + additional_data_size);
|
||||
+ }
|
||||
+
|
||||
// Return to the UI thread to handle opening a new browser tab.
|
||||
@@ -128,7 +131,7 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
fd_watch_controller_.reset();
|
||||
|
||||
// LinuxWatcher::HandleMessage() is in charge of destroying this SocketReader
|
||||
@@ -736,8 +756,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
|
||||
@@ -737,8 +760,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
|
||||
//
|
||||
ProcessSingleton::ProcessSingleton(
|
||||
const base::FilePath& user_data_dir,
|
||||
@@ -139,7 +142,7 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
current_pid_(base::GetCurrentProcId()),
|
||||
watcher_(new LinuxWatcher(this)) {
|
||||
socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename);
|
||||
@@ -854,7 +876,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
|
||||
@@ -855,7 +880,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
|
||||
sizeof(socket_timeout));
|
||||
|
||||
// Found another process, prepare our command line
|
||||
@@ -149,7 +152,7 @@ index 05c86df6c871ca7d0926836edc2f6137fcf229cb..01627f6b46c64a24870fa05b9efeaf94
|
||||
std::string to_send(kStartToken);
|
||||
to_send.push_back(kTokenDelimiter);
|
||||
|
||||
@@ -864,11 +887,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
|
||||
@@ -865,11 +891,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
|
||||
to_send.append(current_dir.value());
|
||||
|
||||
const std::vector<std::string>& argv = cmd_line.argv();
|
||||
@@ -271,7 +274,7 @@ index 19d5659d665321da54e05cee01be7da02e0c283b..600ff701b025ba190d05bc30994e3d3e
|
||||
return PROCESS_NOTIFIED;
|
||||
case chrome::NOTIFY_FAILED:
|
||||
diff --git a/chrome/browser/win/chrome_process_finder.cc b/chrome/browser/win/chrome_process_finder.cc
|
||||
index 788abf9a04f2a3725d67f7f8d84615016b241c8e..6ae6d97708e18c25c59a0b1e3d2d58f27d980ffb 100644
|
||||
index b4fec8878c37b9d157ea768e3b6d99399a988c75..e1cb0f21f752aaeee2c360ce9c5fd08bfede26e3 100644
|
||||
--- a/chrome/browser/win/chrome_process_finder.cc
|
||||
+++ b/chrome/browser/win/chrome_process_finder.cc
|
||||
@@ -34,7 +34,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) {
|
||||
|
||||
@@ -13,10 +13,10 @@ uses internally for things like menus and devtools.
|
||||
We can remove this patch once it has in some shape been upstreamed.
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
|
||||
index 6471581569072714141e1ccea083f5600def6c4f..b203baecad684f37d9f193da12647767ffc938ef 100644
|
||||
index 3a023294c980ac89204b14748dc05bfdb1fbd4ad..94d25b52228d40ac685ae32a3fd99816b20a014b 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -149,6 +149,8 @@ absl::optional<SkColor> NativeTheme::GetColorProviderColor(
|
||||
@@ -150,6 +150,8 @@ absl::optional<SkColor> NativeTheme::GetColorProviderColor(
|
||||
}
|
||||
|
||||
bool NativeTheme::ShouldUseDarkColors() const {
|
||||
@@ -26,10 +26,10 @@ index 6471581569072714141e1ccea083f5600def6c4f..b203baecad684f37d9f193da12647767
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index 44cd465c17b509b247b2257b1c978504e2eb2254..7e5666964836c71e587ba230320afe70b69afe24 100644
|
||||
index 01c999166dd30d3f994d2e449c524f9e8676ad0d..b4d46f557d9ea4ef62f6ae1acd2b9b45c79ebea9 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -405,6 +405,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -398,6 +398,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
SkColor GetUnprocessedSystemColor(ColorId color_id,
|
||||
ColorScheme color_scheme) const;
|
||||
|
||||
@@ -52,19 +52,19 @@ index 44cd465c17b509b247b2257b1c978504e2eb2254..7e5666964836c71e587ba230320afe70
|
||||
// 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
|
||||
@@ -580,6 +596,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -577,6 +593,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
bool forced_colors_ = false;
|
||||
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
|
||||
PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;
|
||||
+ ThemeSource theme_source_ = ThemeSource::kSystem;
|
||||
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
|
||||
};
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index f9772f86a1e233bbf3cc429e36dac8c62f61cd20..2615af462feed395974e76a4fbaf8ee4b3b4c0a1 100644
|
||||
index 07852493fd23b8c1f057dc7ad830b6884db50a88..fee85c5c95bf7908cbd460619f71977cc73f3e6a 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -748,6 +748,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
@@ -677,6 +677,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
|
||||
// ...unless --force-dark-mode was specified in which case caveat emptor.
|
||||
if (InForcedColorsMode() && !IsForcedDarkMode())
|
||||
return false;
|
||||
|
||||
@@ -26,7 +26,7 @@ index 274308e54f2b5c6311d68daa162c146113ba669e..e450fe31011620d87219ce28ef37fb5e
|
||||
// in-memory sliding window.
|
||||
//
|
||||
diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
|
||||
index fa51f3f0c43a4b2e33fb8dc94bba18462903a051..e1ec6fe15613a55aa71b31d136a3c12b461cb784 100644
|
||||
index fcc1a116176a372095b4d032a45a05e225c10a1a..aad9ba1910f70d4377c9e131787e4b57c6477863 100644
|
||||
--- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
|
||||
+++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
|
||||
@@ -10,8 +10,10 @@
|
||||
@@ -42,7 +42,7 @@ index fa51f3f0c43a4b2e33fb8dc94bba18462903a051..e1ec6fe15613a55aa71b31d136a3c12b
|
||||
#include "third_party/blink/public/platform/media/buffered_data_source_host_impl.h"
|
||||
@@ -60,8 +62,20 @@ const int kUpdateBufferSizeFrequency = 32;
|
||||
// How long to we delay a seek after a read?
|
||||
constexpr base::TimeDelta kSeekDelay = base::TimeDelta::FromMilliseconds(20);
|
||||
constexpr base::TimeDelta kSeekDelay = base::Milliseconds(20);
|
||||
|
||||
+std::vector<std::string>* GetStreamingSchemes() {
|
||||
+ static base::NoDestructor<std::vector<std::string>> streaming_schemes({
|
||||
|
||||
@@ -37,10 +37,10 @@ index 3b00759e513dc7e19fd68398e853c8ce6ac73905..47f4e7cc2e8b3141dcaf9e7a498fec32
|
||||
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
|
||||
// of lacros-chrome is complete.
|
||||
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
|
||||
index 94c5293d528a60c16ec209b68da93217d030e068..e833b204d02869b57d888d6e9480a6a484013581 100644
|
||||
index 888133f8e05fb02792ed43d8997e0732aa2d9fe3..eb4723689413cca494fdf9b9d052249405fb5584 100644
|
||||
--- a/components/viz/host/host_display_client.h
|
||||
+++ b/components/viz/host/host_display_client.h
|
||||
@@ -38,10 +38,9 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
|
||||
@@ -42,10 +42,9 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
|
||||
const gfx::CALayerParams& ca_layer_params) override;
|
||||
#endif
|
||||
|
||||
@@ -68,10 +68,10 @@ index b04f654fe820f821b18e059cdd40085fc2384c4e..ee22012b01ef92bb3b32b5b1081609a7
|
||||
|
||||
if (!canvas_) {
|
||||
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
|
||||
index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb319a4dd04 100644
|
||||
index 894237a777fbf829e309772153fa5fcb9eec5598..4310c08b0c2cf97f387d290ae85c14f8539f2002 100644
|
||||
--- a/components/viz/host/layered_window_updater_impl.h
|
||||
+++ b/components/viz/host/layered_window_updater_impl.h
|
||||
@@ -35,7 +35,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
|
||||
@@ -39,7 +39,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
|
||||
// mojom::LayeredWindowUpdater implementation.
|
||||
void OnAllocatedSharedMemory(const gfx::Size& pixel_size,
|
||||
base::UnsafeSharedMemoryRegion region) override;
|
||||
@@ -81,7 +81,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 34dad16dac56631dae62e2c38b8ed7bf6ca2eb41..25f114ceb4c18a88bd23975c85fab67a6311f808 100644
|
||||
index eb36a21f0f79a84a3517b55f9a83f6a4c93dea77..53528e8d340f9417d2a3bf95c092ac2e7f2b3500 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -137,6 +137,8 @@ viz_component("service") {
|
||||
@@ -108,7 +108,7 @@ index 77d463e683d8b8d3a202681a6884eacaab79d70d..05d51cb2637d34c073cd0025e3658036
|
||||
|
||||
} // namespace viz
|
||||
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
index 827084542417d45c9db8082e2c2537e7bdb8ff7f..927b48bbd855fdaebe2b26b8efbb7c48fec0c1a6 100644
|
||||
index 40a9a82819702852427435e497427a0d0067f5c4..eb0065802bac4647bbbb50af97d1dc92fac90804 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -25,6 +25,7 @@
|
||||
@@ -127,7 +127,7 @@ index 827084542417d45c9db8082e2c2537e7bdb8ff7f..927b48bbd855fdaebe2b26b8efbb7c48
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/init/gl_factory.h"
|
||||
@@ -130,7 +132,8 @@ std::unique_ptr<OutputSurface> OutputSurfaceProviderImpl::CreateOutputSurface(
|
||||
@@ -125,7 +127,8 @@ std::unique_ptr<OutputSurface> OutputSurfaceProviderImpl::CreateOutputSurface(
|
||||
mojom::DisplayClient* display_client,
|
||||
DisplayCompositorMemoryAndTaskController* gpu_dependency,
|
||||
const RendererSettings& renderer_settings,
|
||||
@@ -137,7 +137,7 @@ index 827084542417d45c9db8082e2c2537e7bdb8ff7f..927b48bbd855fdaebe2b26b8efbb7c48
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
if (surface_handle == gpu::kNullSurfaceHandle)
|
||||
return std::make_unique<OutputSurfaceUnified>();
|
||||
@@ -142,7 +145,7 @@ std::unique_ptr<OutputSurface> OutputSurfaceProviderImpl::CreateOutputSurface(
|
||||
@@ -137,7 +140,7 @@ std::unique_ptr<OutputSurface> OutputSurfaceProviderImpl::CreateOutputSurface(
|
||||
|
||||
if (!gpu_compositing) {
|
||||
output_surface = std::make_unique<SoftwareOutputSurface>(
|
||||
@@ -146,7 +146,7 @@ index 827084542417d45c9db8082e2c2537e7bdb8ff7f..927b48bbd855fdaebe2b26b8efbb7c48
|
||||
} else if (renderer_settings.use_skia_renderer) {
|
||||
DCHECK(gpu_dependency);
|
||||
{
|
||||
@@ -251,10 +254,22 @@ std::unique_ptr<OutputSurface> OutputSurfaceProviderImpl::CreateOutputSurface(
|
||||
@@ -242,10 +245,22 @@ std::unique_ptr<OutputSurface> OutputSurfaceProviderImpl::CreateOutputSurface(
|
||||
std::unique_ptr<SoftwareOutputDevice>
|
||||
OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
gpu::SurfaceHandle surface_handle,
|
||||
@@ -171,10 +171,10 @@ index 827084542417d45c9db8082e2c2537e7bdb8ff7f..927b48bbd855fdaebe2b26b8efbb7c48
|
||||
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
|
||||
display_client);
|
||||
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.h b/components/viz/service/display_embedder/output_surface_provider_impl.h
|
||||
index a6bb42cdbc567f526cc70c5c4d9b967274dc0332..d116844635922c8a1086dfa13063b8ae8b43ce59 100644
|
||||
index e62a7c718e704725ad88f25cba82855b1b22fd64..4508ff299c495f14f0e63f55d617bb449aa78050 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.h
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.h
|
||||
@@ -61,12 +61,14 @@ class VIZ_SERVICE_EXPORT OutputSurfaceProviderImpl
|
||||
@@ -66,12 +66,14 @@ class VIZ_SERVICE_EXPORT OutputSurfaceProviderImpl
|
||||
mojom::DisplayClient* display_client,
|
||||
DisplayCompositorMemoryAndTaskController* gpu_dependency,
|
||||
const RendererSettings& renderer_settings,
|
||||
@@ -192,10 +192,10 @@ index a6bb42cdbc567f526cc70c5c4d9b967274dc0332..d116844635922c8a1086dfa13063b8ae
|
||||
GpuServiceImpl* const gpu_service_impl_;
|
||||
gpu::CommandBufferTaskExecutor* const task_executor_;
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
index 49149081cc603f14eacee647cbb2fcf8ed5e66fd..9ff3f2ee203403fdaa31edb8a0bcc000c4d214d7 100644
|
||||
index 33e12349a951ef533b964d1158f8fa124623e946..fc04bcaffefc277dd1d0cdd766168de017fedca8 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
|
||||
@@ -102,6 +102,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
|
||||
@@ -105,6 +105,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
|
||||
|
||||
SkCanvas* SoftwareOutputDeviceMac::BeginPaint(
|
||||
const gfx::Rect& new_damage_rect) {
|
||||
@@ -204,7 +204,7 @@ index 49149081cc603f14eacee647cbb2fcf8ed5e66fd..9ff3f2ee203403fdaa31edb8a0bcc000
|
||||
// Record the previous paint buffer.
|
||||
Buffer* previous_paint_buffer =
|
||||
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
|
||||
@@ -187,6 +189,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
||||
@@ -190,6 +192,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
|
||||
ca_layer_params.is_empty = false;
|
||||
ca_layer_params.scale_factor = scale_factor_;
|
||||
ca_layer_params.pixel_size = pixel_size_;
|
||||
@@ -213,10 +213,10 @@ index 49149081cc603f14eacee647cbb2fcf8ed5e66fd..9ff3f2ee203403fdaa31edb8a0bcc000
|
||||
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface));
|
||||
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e5ffe86dd 100644
|
||||
index 1558d731a57332a66f9ef76b9cd252ba8cfa5a7b..06b954e01be417f49ea8211973920904be920709 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
|
||||
@@ -56,6 +56,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
|
||||
@@ -60,6 +60,7 @@ class VIZ_SERVICE_EXPORT SoftwareOutputDeviceMac : public SoftwareOutputDevice {
|
||||
void UpdateAndCopyBufferDamage(Buffer* previous_paint_buffer,
|
||||
const SkRegion& new_damage_rect);
|
||||
|
||||
@@ -484,7 +484,7 @@ index 0000000000000000000000000000000000000000..48fa86caaab3c15764f105eb7ad2aecf
|
||||
+
|
||||
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
|
||||
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
index 599b06c1765ef4ddbfeb2fd96e0875098f7c6ae1..2151fc8aa710162a3870639bd6e952df9d15a0be 100644
|
||||
index 583e3e2525c753a0962d481fc67a3582df75d0e9..9416ec929bebcff7f07088e635376ef232eb515f 100644
|
||||
--- a/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
|
||||
@@ -191,7 +191,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
|
||||
@@ -497,7 +497,7 @@ index 599b06c1765ef4ddbfeb2fd96e0875098f7c6ae1..2151fc8aa710162a3870639bd6e952df
|
||||
waiting_on_draw_ack_ = true;
|
||||
|
||||
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
index be4b04dc525a548276eed50cbfc83603b1f2095b..d9995ac8b5e832ac329ce113aa837a6a587c39bd 100644
|
||||
index 8ed8bfb01ae60f1bed9d54b98afe1820c4858532..690d9bc6e96d1d933cc6f2279494489a505db6e7 100644
|
||||
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
|
||||
@@ -47,7 +47,8 @@ RootCompositorFrameSinkImpl::Create(
|
||||
@@ -511,10 +511,10 @@ index be4b04dc525a548276eed50cbfc83603b1f2095b..d9995ac8b5e832ac329ce113aa837a6a
|
||||
// Creating output surface failed. The host can send a new request, possibly
|
||||
// with a different compositing mode.
|
||||
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
index 50ff2c9facc2a2155bd0882924335294277fe3b6..ef7707d5195bfba3675e5aed6f2bc3b63bec51cf 100644
|
||||
index 53c23a97a54a432b2aefe148657a27ac254e98c3..0d1694e58c6807eacc074aaab4aad2e227d1a306 100644
|
||||
--- a/content/browser/compositor/viz_process_transport_factory.cc
|
||||
+++ b/content/browser/compositor/viz_process_transport_factory.cc
|
||||
@@ -395,8 +395,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
@@ -382,8 +382,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
|
||||
compositor_data.display_private.reset();
|
||||
root_params->display_private =
|
||||
compositor_data.display_private.BindNewEndpointAndPassReceiver();
|
||||
@@ -567,10 +567,10 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index dfb0c89dc7bd8edf5787ddab50c54a847e6a0140..316d970d1327755768fd92d7457d8b9b26804503 100644
|
||||
index 6220caafb2cbad4dcd251767c546e72aae03af8b..2bbc85cc6db1cad719eeadb0c256f9d001ba50c1 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -81,6 +81,7 @@ class DisplayPrivate;
|
||||
@@ -80,6 +80,7 @@ class DisplayPrivate;
|
||||
class ExternalBeginFrameController;
|
||||
} // namespace mojom
|
||||
class ContextProvider;
|
||||
@@ -578,7 +578,7 @@ index dfb0c89dc7bd8edf5787ddab50c54a847e6a0140..316d970d1327755768fd92d7457d8b9b
|
||||
class HostFrameSinkManager;
|
||||
class LocalSurfaceId;
|
||||
class RasterContextProvider;
|
||||
@@ -137,6 +138,16 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
@@ -136,6 +137,16 @@ class COMPOSITOR_EXPORT ContextFactory {
|
||||
virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
|
||||
};
|
||||
|
||||
@@ -595,7 +595,7 @@ index dfb0c89dc7bd8edf5787ddab50c54a847e6a0140..316d970d1327755768fd92d7457d8b9b
|
||||
// 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
|
||||
@@ -172,6 +183,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -175,6 +186,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
// Schedules a redraw of the layer tree associated with this compositor.
|
||||
void ScheduleDraw();
|
||||
|
||||
@@ -605,7 +605,7 @@ index dfb0c89dc7bd8edf5787ddab50c54a847e6a0140..316d970d1327755768fd92d7457d8b9b
|
||||
// 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
|
||||
@@ -443,6 +457,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
@@ -449,6 +463,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
|
||||
|
||||
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ headers, moving forward we should find a way in upstream to provide
|
||||
access to these headers for loader clients created on the browser process.
|
||||
|
||||
diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc
|
||||
index b405a82fd2bfed451f86907e66ae3a4ab5838fbb..988aa62b2d78b736b34e947e42f965fd6b2b563f 100644
|
||||
index a24972bd0d082e47036082983d93e862b6c28ab0..74ed551279314b728e129b6c344ee1b5de58701a 100644
|
||||
--- a/services/network/public/cpp/resource_request.cc
|
||||
+++ b/services/network/public/cpp/resource_request.cc
|
||||
@@ -231,6 +231,7 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {
|
||||
@@ -29,10 +29,10 @@ index b405a82fd2bfed451f86907e66ae3a4ab5838fbb..988aa62b2d78b736b34e947e42f965fd
|
||||
upgrade_if_insecure == request.upgrade_if_insecure &&
|
||||
is_revalidating == request.is_revalidating &&
|
||||
diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h
|
||||
index 2b7832dd2c2d006bf8ef382cdf3f7f52e0edd385..f872596bc1236323ecdf1de699c513e40c42592c 100644
|
||||
index 2857fb52a542eab7fa52938cbc6a292328cc2003..3a21c9f473f5c042a880d633f4b83a8f1c92fd1f 100644
|
||||
--- a/services/network/public/cpp/resource_request.h
|
||||
+++ b/services/network/public/cpp/resource_request.h
|
||||
@@ -160,6 +160,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
@@ -161,6 +161,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
bool do_not_prompt_for_login = false;
|
||||
bool is_main_frame = false;
|
||||
int transition_type = 0;
|
||||
@@ -41,10 +41,10 @@ index 2b7832dd2c2d006bf8ef382cdf3f7f52e0edd385..f872596bc1236323ecdf1de699c513e4
|
||||
bool upgrade_if_insecure = false;
|
||||
bool is_revalidating = false;
|
||||
diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc
|
||||
index 0bcf9231f6a20d5b673d601e84e91f5db34274dd..6b3f5169f9495e8d2b9bb63b12e22b20000fe88d 100644
|
||||
index 6bd39133e2d5b2bbad9ccbbded1e41eddce2a424..05d40087e89ec1edabb6017931f0d9e54a467b78 100644
|
||||
--- a/services/network/public/cpp/url_request_mojom_traits.cc
|
||||
+++ b/services/network/public/cpp/url_request_mojom_traits.cc
|
||||
@@ -197,6 +197,7 @@ bool StructTraits<
|
||||
@@ -198,6 +198,7 @@ bool StructTraits<
|
||||
out->do_not_prompt_for_login = data.do_not_prompt_for_login();
|
||||
out->is_main_frame = data.is_main_frame();
|
||||
out->transition_type = data.transition_type();
|
||||
@@ -53,10 +53,10 @@ index 0bcf9231f6a20d5b673d601e84e91f5db34274dd..6b3f5169f9495e8d2b9bb63b12e22b20
|
||||
out->upgrade_if_insecure = data.upgrade_if_insecure();
|
||||
out->is_revalidating = data.is_revalidating();
|
||||
diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h
|
||||
index 2ad640951ae17588ac98d9cf2ade197786178257..a617132e8db8f059c15ba26438ac3a70382f4cd6 100644
|
||||
index 86e6558f3ebfb5d0f3dee3cee70fc45f0f33123f..54efb232bf7316ce3aabbb787676acb093910047 100644
|
||||
--- a/services/network/public/cpp/url_request_mojom_traits.h
|
||||
+++ b/services/network/public/cpp/url_request_mojom_traits.h
|
||||
@@ -266,6 +266,9 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
@@ -267,6 +267,9 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
static int32_t transition_type(const network::ResourceRequest& request) {
|
||||
return request.transition_type;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ index 2ad640951ae17588ac98d9cf2ade197786178257..a617132e8db8f059c15ba26438ac3a70
|
||||
return request.previews_state;
|
||||
}
|
||||
diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom
|
||||
index 8ad56cb2ba2195ec5edd9d36a88ebc3f73b720ff..09dfa592e2960cc82541bb8d2dce3522d5d0142e 100644
|
||||
index 6ad61365a1dac6c18609ed63e7ab992c8949e70c..039f27017521b94eb2768f949b7217a9102aa61c 100644
|
||||
--- a/services/network/public/mojom/url_request.mojom
|
||||
+++ b/services/network/public/mojom/url_request.mojom
|
||||
@@ -313,6 +313,9 @@ struct URLRequest {
|
||||
@@ -103,10 +103,10 @@ index cea1fb864ab46b4b0eabf1db11a0392d6cd575c1..df033f65d50b088778268827e506963a
|
||||
string mime_type;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index e8d83ecd221e28182be3443fca89ba6a125622a1..9206c91efe2b08d9b2a4c829fa0135d31244b3fc 100644
|
||||
index 136427ff144f7ce23674f2b18e7deac5f5a5c8dd..94212b48f0a31de898f351c824b289c8c8e4dfad 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -490,6 +490,7 @@ URLLoader::URLLoader(
|
||||
@@ -526,6 +526,7 @@ URLLoader::URLLoader(
|
||||
peer_closed_handle_watcher_(FROM_HERE,
|
||||
mojo::SimpleWatcher::ArmingPolicy::MANUAL,
|
||||
base::SequencedTaskRunnerHandle::Get()),
|
||||
@@ -114,7 +114,7 @@ index e8d83ecd221e28182be3443fca89ba6a125622a1..9206c91efe2b08d9b2a4c829fa0135d3
|
||||
devtools_request_id_(request.devtools_request_id),
|
||||
request_mode_(request.mode),
|
||||
request_credentials_mode_(request.credentials_mode),
|
||||
@@ -632,7 +633,7 @@ URLLoader::URLLoader(
|
||||
@@ -669,7 +670,7 @@ URLLoader::URLLoader(
|
||||
url_request_->SetRequestHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawRequestHeadersAndNotify, base::Unretained(this)));
|
||||
|
||||
@@ -123,7 +123,7 @@ index e8d83ecd221e28182be3443fca89ba6a125622a1..9206c91efe2b08d9b2a4c829fa0135d3
|
||||
url_request_->SetResponseHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
|
||||
}
|
||||
@@ -1255,6 +1256,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
@@ -1299,6 +1300,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
response_ = network::mojom::URLResponseHead::New();
|
||||
PopulateResourceResponse(url_request_.get(), is_load_timing_enabled_,
|
||||
options_, response_.get());
|
||||
@@ -144,10 +144,10 @@ index e8d83ecd221e28182be3443fca89ba6a125622a1..9206c91efe2b08d9b2a4c829fa0135d3
|
||||
// Parse and remove the Trust Tokens response headers, if any are expected,
|
||||
// potentially failing the request if an error occurs.
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index 6d53bc8f9eef1446d764cb92943a3f9723390ed6..171f2015f09040297afba25218292c304a864758 100644
|
||||
index f40ab2d8823e0b7f71b9ea7932d258022518e632..a36ab764380d542b060979763d20dbf65e1925b5 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -467,6 +467,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
@@ -497,6 +497,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
|
||||
resource_scheduler_request_handle_;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ patch and doing further investigation in the future. This patch cannot
|
||||
be upstreamed.
|
||||
|
||||
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl.cc b/sandbox/linux/bpf_dsl/bpf_dsl.cc
|
||||
index 846dc7a83d12be57cb91bd0a7f9e698990776684..1c3dba162b8eb4af28c78e84b5553447e4f1c76a 100644
|
||||
index 90139669e657863f2580ea6848a15fcc90f05125..48ee440fef90d467ccf0217caed9700a767f49d0 100644
|
||||
--- a/sandbox/linux/bpf_dsl/bpf_dsl.cc
|
||||
+++ b/sandbox/linux/bpf_dsl/bpf_dsl.cc
|
||||
@@ -305,6 +305,7 @@ Elser::~Elser() {
|
||||
@@ -321,6 +321,7 @@ Elser::~Elser() {
|
||||
}
|
||||
|
||||
Elser Elser::ElseIf(BoolExpr cond, ResultExpr then_result) const {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: fix: export zlib symbols
|
||||
This patch sets ZLIB_DLL so that we properly export zlib symbols.
|
||||
|
||||
diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn
|
||||
index 74ecbd19ae270e3fead8702187aa0c78d42fcc4d..72cb46657a800259ce6541164909694fd54a3aaf 100644
|
||||
index a3378e43ac99e611925bd28b3d78f3683d4d57cc..4113be75214f864560efab5da88e51f7887654ef 100644
|
||||
--- a/third_party/zlib/BUILD.gn
|
||||
+++ b/third_party/zlib/BUILD.gn
|
||||
@@ -301,6 +301,10 @@ component("zlib") {
|
||||
@@ -312,6 +312,10 @@ component("zlib") {
|
||||
defines = []
|
||||
deps = []
|
||||
|
||||
|
||||
@@ -8,27 +8,29 @@ we invoke it in order to expose contents.decrementCapturerCount([stayHidden, sta
|
||||
to users. We should try to upstream this.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
|
||||
index 97e6ccbfbd58482299a831c63573890d1f7d46f3..1e6b5ed19688993a750af0fd1fee72a4f67eab28 100644
|
||||
index 289f4c08e16fd13ca4b28229549ac634313da70f..48e8fcaec2a7a4e09f9f1c99d2f2a1b4cc9c75a3 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1765,7 +1765,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
|
||||
// Called when the base::ScopedClosureRunner returned by
|
||||
@@ -1773,7 +1773,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
// IncrementCapturerCount() is destructed.
|
||||
- void DecrementCapturerCount(bool stay_hidden, bool stay_awake);
|
||||
+ void DecrementCapturerCount(bool stay_hidden, bool stay_awake) override;
|
||||
void DecrementCapturerCount(bool stay_hidden,
|
||||
bool stay_awake,
|
||||
- bool is_activity = true);
|
||||
+ bool is_activity = true) override;
|
||||
|
||||
// Calculates the PageVisibilityState for |visibility|, taking the capturing
|
||||
// state into account.
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index 95bcea15ea704f11e8daab49de6d958fb2d15127..f2e9a772fe9449fe0e4be55567019c46ef2d8c6a 100644
|
||||
index 6a761f9f127c3965b06f9667d173c3091330c19c..2514246b66b7fc1174c9f90017d26799db260319 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -645,6 +645,8 @@ class WebContents : public PageNavigator,
|
||||
bool stay_hidden,
|
||||
bool stay_awake) WARN_UNUSED_RESULT = 0;
|
||||
@@ -666,6 +666,10 @@ class WebContents : public PageNavigator,
|
||||
bool stay_awake,
|
||||
bool is_activity = true) WARN_UNUSED_RESULT = 0;
|
||||
|
||||
+ virtual void DecrementCapturerCount(bool stay_hidden, bool stay_awake) = 0;
|
||||
+ virtual void DecrementCapturerCount(bool stay_hidden,
|
||||
+ bool stay_awake,
|
||||
+ bool is_activity = true) = 0;
|
||||
+
|
||||
// Getter for the capture handle, which allows a captured application to
|
||||
// opt-in to exposing information to its capturer(s).
|
||||
|
||||
@@ -10,33 +10,94 @@ receive remote control events until it begins playing audio. This runs
|
||||
counter to the design of globalShortcuts, and so we need to instead
|
||||
use `ui::MediaKeysListener`.
|
||||
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener.cc b/chrome/browser/extensions/global_shortcut_listener.cc
|
||||
index bc009606d01469125052e68a9cdc82aaa697c764..ff18043cb07d748a49adea9874517fb29e3e7f9f 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener.cc
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "base/check.h"
|
||||
#include "base/notreached.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
+#include "content/public/browser/media_keys_listener_manager.h"
|
||||
#include "ui/base/accelerators/accelerator.h"
|
||||
|
||||
using content::BrowserThread;
|
||||
@@ -66,6 +67,22 @@ void GlobalShortcutListener::UnregisterAccelerator(
|
||||
StopListening();
|
||||
}
|
||||
|
||||
+// static
|
||||
+void GlobalShortcutListener::SetShouldUseInternalMediaKeyHandling(bool should_use) {
|
||||
+ if (content::MediaKeysListenerManager::
|
||||
+ IsMediaKeysListenerManagerEnabled()) {
|
||||
+ content::MediaKeysListenerManager* media_keys_listener_manager =
|
||||
+ content::MediaKeysListenerManager::GetInstance();
|
||||
+ DCHECK(media_keys_listener_manager);
|
||||
+
|
||||
+ if (should_use) {
|
||||
+ media_keys_listener_manager->EnableInternalMediaKeyHandling();
|
||||
+ } else {
|
||||
+ media_keys_listener_manager->DisableInternalMediaKeyHandling();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void GlobalShortcutListener::UnregisterAccelerators(Observer* observer) {
|
||||
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (IsShortcutHandlingSuspended())
|
||||
diff --git a/chrome/browser/extensions/global_shortcut_listener.h b/chrome/browser/extensions/global_shortcut_listener.h
|
||||
index 554930bc33d87ee88a9bcc5f0cf17cef09c27ef0..8df4f91d3db453afb9f73bcaeb82c919ca8d1841 100644
|
||||
--- a/chrome/browser/extensions/global_shortcut_listener.h
|
||||
+++ b/chrome/browser/extensions/global_shortcut_listener.h
|
||||
@@ -34,6 +34,8 @@ class GlobalShortcutListener {
|
||||
|
||||
static GlobalShortcutListener* GetInstance();
|
||||
|
||||
+ static void SetShouldUseInternalMediaKeyHandling(bool should_use);
|
||||
+
|
||||
// Register an observer for when a certain |accelerator| is struck. Returns
|
||||
// true if register successfully, or false if 1) the specificied |accelerator|
|
||||
// has been registered by another caller or other native applications, or
|
||||
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
|
||||
index 5938f75742b793868638e693a9a8c8dc686dfc46..bf8782c23095a09dec62c68d7d902df24abcb13e 100644
|
||||
index 5938f75742b793868638e693a9a8c8dc686dfc46..1263d679a5174beb960265989c370dd4a58ae7b4 100644
|
||||
--- a/content/browser/media/media_keys_listener_manager_impl.cc
|
||||
+++ b/content/browser/media/media_keys_listener_manager_impl.cc
|
||||
@@ -231,7 +231,7 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
|
||||
@@ -231,18 +231,24 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
|
||||
media::AudioManager::GetGlobalAppName());
|
||||
#endif
|
||||
|
||||
- if (system_media_controls_) {
|
||||
+ if (/* DISABLES CODE */ (0)) {
|
||||
system_media_controls_->AddObserver(this);
|
||||
system_media_controls_notifier_ =
|
||||
std::make_unique<SystemMediaControlsNotifier>(
|
||||
@@ -239,8 +239,13 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
|
||||
} else {
|
||||
// If we can't access system media controls, then directly listen for media
|
||||
// key keypresses instead.
|
||||
+#if defined(OS_MAC)
|
||||
+ media_keys_listener_ = ui::MediaKeysListener::Create(
|
||||
+ this, ui::MediaKeysListener::Scope::kGlobalRequiresAccessibility);
|
||||
+#else
|
||||
- system_media_controls_->AddObserver(this);
|
||||
- system_media_controls_notifier_ =
|
||||
- std::make_unique<SystemMediaControlsNotifier>(
|
||||
- system_media_controls_.get());
|
||||
- } else {
|
||||
- // If we can't access system media controls, then directly listen for media
|
||||
- // key keypresses instead.
|
||||
+ // This is required for proper functioning of MediaMetadata.
|
||||
+ system_media_controls_->AddObserver(this);
|
||||
+ system_media_controls_notifier_ =
|
||||
+ std::make_unique<SystemMediaControlsNotifier>(
|
||||
+ system_media_controls_.get());
|
||||
+
|
||||
+ // Directly listen for media key keypresses when using GlobalShortcuts.
|
||||
+#if defined(OS_MACOS)
|
||||
+ auto scope = media_key_handling_enabled_ ?
|
||||
+ ui::MediaKeysListener::Scope::kGlobal :
|
||||
+ ui::MediaKeysListener::Scope::kGlobalRequiresAccessibility;
|
||||
media_keys_listener_ = ui::MediaKeysListener::Create(
|
||||
this, ui::MediaKeysListener::Scope::kGlobal);
|
||||
- this, ui::MediaKeysListener::Scope::kGlobal);
|
||||
- DCHECK(media_keys_listener_);
|
||||
- }
|
||||
+ this, scope);
|
||||
+#else
|
||||
+ media_keys_listener_ = ui::MediaKeysListener::Create(
|
||||
+ this, ui::MediaKeysListener::Scope::kGlobal);
|
||||
+#endif
|
||||
DCHECK(media_keys_listener_);
|
||||
}
|
||||
+ DCHECK(media_keys_listener_);
|
||||
|
||||
EnsureAuxiliaryServices();
|
||||
}
|
||||
diff --git a/ui/base/accelerators/media_keys_listener.h b/ui/base/accelerators/media_keys_listener.h
|
||||
index c2b03328c0e508995bdc135031500783f500ceba..1b6b14dc2999c99445cef6ffc04d49a7c1728a54 100644
|
||||
--- a/ui/base/accelerators/media_keys_listener.h
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Mon, 25 Oct 2021 21:45:57 +0200
|
||||
Subject: fix: patch out permissions checks in exclusive_access
|
||||
|
||||
This patch is necessary in order to properly enable
|
||||
navigator.keyboard.{(un)?lock}() functionality. We don't have a concept
|
||||
of PermissionManager nor of a Profile, so this would not affect usage of
|
||||
the API.
|
||||
|
||||
We might consider potentially using our own permissions handler,
|
||||
but it's not strictly necessary for this API to work to spec.
|
||||
|
||||
Profile check has been upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3247196
|
||||
|
||||
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
index e9c8a4a4bb7334682ceeec05b3a3e872de0192ab..861307591f3721c398c454126cb5a9be9a5e9764 100644
|
||||
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
|
||||
@@ -368,13 +368,9 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
|
||||
// from manually entering fullscreen mode and also disables kiosk mode on
|
||||
// desktop platforms.
|
||||
- if (!exclusive_access_manager()
|
||||
- ->context()
|
||||
- ->GetProfile()
|
||||
- ->GetPrefs()
|
||||
- ->GetBoolean(prefs::kFullscreenAllowed)) {
|
||||
+ auto* profile = exclusive_access_manager()->context()->GetProfile();
|
||||
+ if (!profile || !profile->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed))
|
||||
return;
|
||||
- }
|
||||
#endif
|
||||
|
||||
toggled_into_fullscreen_ = true;
|
||||
@@ -387,6 +383,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
url = extension_caused_fullscreen_;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
if (display_id != display::kInvalidDisplayId) {
|
||||
// Check, but do not prompt, for permission to request a specific screen.
|
||||
// Sites generally need permission to get the display id in the first place.
|
||||
@@ -400,6 +397,7 @@ void FullscreenController::EnterFullscreenModeInternal(
|
||||
display_id = display::kInvalidDisplayId;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (option == BROWSER)
|
||||
base::RecordAction(base::UserMetricsAction("ToggleFullscreen"));
|
||||
@@ -10,7 +10,7 @@ them should they exist.
|
||||
This will be upstreamed.
|
||||
|
||||
diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h
|
||||
index 0fb5c91b8abcdd7e674251bafebfc2c51044ef77..8c134bae25afeb0dbbb6e33182f053bb34e2f978 100644
|
||||
index 7fde07c789c35d103174020f590e177eefbe6f2b..07f10be994fcf7d7845f6c297e17f86f27cc4fe9 100644
|
||||
--- a/printing/printing_context_mac.h
|
||||
+++ b/printing/printing_context_mac.h
|
||||
@@ -83,6 +83,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContextMac : public PrintingContext {
|
||||
@@ -25,10 +25,10 @@ index 0fb5c91b8abcdd7e674251bafebfc2c51044ef77..8c134bae25afeb0dbbb6e33182f053bb
|
||||
// Returns true if duplex mode is set.
|
||||
bool SetDuplexModeInPrintSettings(mojom::DuplexMode mode);
|
||||
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
|
||||
index dfa69dfec319e48e1475cf8b40ec7414cab00e5e..6dcff7c9b0b5f9ad1e41407037b96ba52f313977 100644
|
||||
index dd9bb775164ad483cf7cc26be150da0abba2433f..3704d75b9b25e4b8205736666cb8496225672df5 100644
|
||||
--- a/printing/printing_context_mac.mm
|
||||
+++ b/printing/printing_context_mac.mm
|
||||
@@ -191,7 +191,8 @@ PMPaper MatchPaper(CFArrayRef paper_list,
|
||||
@@ -192,7 +192,8 @@ PMPaper MatchPaper(CFArrayRef paper_list,
|
||||
!SetCollateInPrintSettings(settings_->collate()) ||
|
||||
!SetDuplexModeInPrintSettings(settings_->duplex_mode()) ||
|
||||
!SetOutputColor(static_cast<int>(settings_->color())) ||
|
||||
@@ -38,7 +38,7 @@ index dfa69dfec319e48e1475cf8b40ec7414cab00e5e..6dcff7c9b0b5f9ad1e41407037b96ba5
|
||||
return OnError();
|
||||
}
|
||||
}
|
||||
@@ -344,6 +345,22 @@ PMPaper MatchPaper(CFArrayRef paper_list,
|
||||
@@ -345,6 +346,22 @@ PMPaper MatchPaper(CFArrayRef paper_list,
|
||||
return PMSetCopies(print_settings, copies, false) == noErr;
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ index dfa69dfec319e48e1475cf8b40ec7414cab00e5e..6dcff7c9b0b5f9ad1e41407037b96ba5
|
||||
PMPrintSettings print_settings =
|
||||
static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
|
||||
diff --git a/printing/printing_context_system_dialog_win.cc b/printing/printing_context_system_dialog_win.cc
|
||||
index 891e9574625bfbaf2a00eeeb54a20834a2a5fa21..4f47ad753c7593c83fdfd832a9d4a53d2094becf 100644
|
||||
index acb040f998546b0e01be45c28c505bbafcf2c141..1083db84804e5ed8b420d3e8e3da372ff15ec2cf 100644
|
||||
--- a/printing/printing_context_system_dialog_win.cc
|
||||
+++ b/printing/printing_context_system_dialog_win.cc
|
||||
@@ -53,14 +53,28 @@ void PrintingContextSystemDialogWin::AskUserForSettings(
|
||||
@@ -54,14 +54,28 @@ void PrintingContextSystemDialogWin::AskUserForSettings(
|
||||
PRINTPAGERANGE ranges[32];
|
||||
dialog_options.nStartPage = START_PAGE_GENERAL;
|
||||
if (max_pages) {
|
||||
@@ -100,10 +100,10 @@ index 891e9574625bfbaf2a00eeeb54a20834a2a5fa21..4f47ad753c7593c83fdfd832a9d4a53d
|
||||
} else {
|
||||
// No need to bother, we don't know how many pages are available.
|
||||
diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc
|
||||
index 62108f0eb91fd04235d29a5e010aa600f76f8288..0e21b30dbe3f6daca9dce6d2b89b063c13d044ee 100644
|
||||
index c2b2455516cd156dfa12a62cac5b3a4b847cbd5b..e2243bbfbd34fe0b899645698455bc7f116feb0e 100644
|
||||
--- a/ui/gtk/printing/print_dialog_gtk.cc
|
||||
+++ b/ui/gtk/printing/print_dialog_gtk.cc
|
||||
@@ -238,6 +238,24 @@ void PrintDialogGtk::UpdateSettings(
|
||||
@@ -241,6 +241,24 @@ void PrintDialogGtk::UpdateSettings(
|
||||
|
||||
gtk_print_settings_set_n_copies(gtk_settings_, settings->copies());
|
||||
gtk_print_settings_set_collate(gtk_settings_, settings->collate());
|
||||
|
||||
@@ -26,7 +26,7 @@ index f72431f5bc7ba82316cf318f7845e7523c366d92..5133f3cd28c0d630a039118eb91c6c37
|
||||
#include "components/zoom/page_zoom_constants.h"
|
||||
#include "pdf/pdf_features.h"
|
||||
diff --git a/chrome/browser/printing/printing_service.cc b/chrome/browser/printing/printing_service.cc
|
||||
index 986568e30a4c40104a4e2a681a1b8a22110d4cf8..36758a9ee5eea37ce5199460bb9dc893d7bf250f 100644
|
||||
index ec70ac13f96a0085747ecc3f275fb392d3dcca42..6b470dad30760ee709e702e94c19eaeb3099442a 100644
|
||||
--- a/chrome/browser/printing/printing_service.cc
|
||||
+++ b/chrome/browser/printing/printing_service.cc
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
|
||||
Allows embedder to intercept site instances created by chromium.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
index 67bdf4ff62fd59e86df30e083110501f8181dbe6..b435953e8325046370b4d2b3550c9c069653d56a 100644
|
||||
index d4a74c24605e1fc4e723f7252052cd123a8303b9..54772fce1a4204f545cecdd0e51c5a62b41bb14d 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
@@ -3035,6 +3035,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -3078,6 +3078,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ index 67bdf4ff62fd59e86df30e083110501f8181dbe6..b435953e8325046370b4d2b3550c9c06
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 66ff9593b8f3d62c486ef83c4c682edf73081d88..7d0318a137ad2f2b7bc8743bbad419d3f8f9ce12 100644
|
||||
index f0e2a061bb35fd3db26c7d235e1196273036925f..263ce75539f2fd215a45645e93271b3e65451d1a 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -272,6 +272,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -274,6 +274,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
virtual ~ContentBrowserClient() = default;
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ index f0a7d0c05fa3c68b22b1d36e2c0810fe70f5a8a0..8ecce17b5bb8b5106de913a2d0197fd3
|
||||
// Returns whether `Initialize` has already been invoked in the process.
|
||||
// Initialization is a one-way operation (i.e., this method cannot return
|
||||
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
||||
index 8177563df293ae9b4bb8cc46cfe81402f2bf50e0..f2eb8677c095a6d24202a524991c3d8aea39c406 100644
|
||||
index 3d8d99cc5840cd1abc72694fc717587aadd1badd..94340cbb1a7a75bcc24dea06b1b5c5ceb4571913 100644
|
||||
--- a/gin/v8_initializer.cc
|
||||
+++ b/gin/v8_initializer.cc
|
||||
@@ -269,7 +269,8 @@ void SetV8FlagsIfOverridden(const base::Feature& feature,
|
||||
@@ -226,12 +226,14 @@ void SetV8FlagsIfOverridden(const base::Feature& feature,
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
@@ -51,16 +51,13 @@ index 8177563df293ae9b4bb8cc46cfe81402f2bf50e0..f2eb8677c095a6d24202a524991c3d8a
|
||||
static bool v8_is_initialized = false;
|
||||
if (v8_is_initialized)
|
||||
return;
|
||||
@@ -279,7 +280,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
|
||||
RunArrayBufferCageReservationExperiment();
|
||||
}
|
||||
|
||||
- v8::V8::InitializePlatform(V8Platform::Get());
|
||||
+ if (create_v8_platform)
|
||||
+ v8::V8::InitializePlatform(V8Platform::Get());
|
||||
|
||||
if (!base::FeatureList::IsEnabled(features::kV8OptimizeJavascript)) {
|
||||
// We avoid explicitly passing --opt if kV8OptimizeJavascript is enabled
|
||||
#if defined(V8_VIRTUAL_MEMORY_CAGE)
|
||||
static_assert(ARCH_CPU_64_BITS,
|
||||
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
|
||||
index 955be10e118e1c54515dd0ee19edec7504419bdc..699f84c73b71a6d870ae93f2fce98174c924e2fa 100644
|
||||
--- a/gin/v8_initializer.h
|
||||
|
||||
@@ -40,10 +40,10 @@ index a8c0d59cb825a791c44c54e55ad7f295ad07a309..a1ef53aa46fb0cfc7bcac121244f77af
|
||||
void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);
|
||||
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
index 8ec17755a906ae60a1424b75ee21bd29fb62ab3f..0d8642a1034abe817ea3434359185b2e5d985879 100644
|
||||
index 43dd51a57a806fb79798b481b6daadcb7400dd34..b038159656d06ee3882b73d38ea83aa1a9af02af 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
@@ -1219,6 +1219,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
|
||||
@@ -1181,6 +1181,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
|
||||
if (host)
|
||||
host->ForceShutdown();
|
||||
}
|
||||
@@ -57,10 +57,10 @@ index 8ec17755a906ae60a1424b75ee21bd29fb62ab3f..0d8642a1034abe817ea3434359185b2e
|
||||
|
||||
void GpuDataManagerImplPrivate::UpdateDawnInfo(
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
|
||||
index afd9e892bd94314b5dc979dadf6fd91f8ad9ff04..02134414e3bab125697b5f3080af2c90d4cee07c 100644
|
||||
index 3a9630dd05df8d07bd7520530ad57b6a76f39cec..205e8f44ddbf6e1ed39a2f6ef5c1bd0036831e50 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
|
||||
@@ -84,6 +84,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
|
||||
@@ -89,6 +89,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
|
||||
bool VulkanRequested() const;
|
||||
void PostCreateThreads();
|
||||
void TerminateInfoCollectionGpuProcess();
|
||||
|
||||
@@ -6,11 +6,11 @@ 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 509687647e3566f48c89bfb2bebdfb17fa54fbc2..df1d19126456618529c951a70889edde12005a1c 100644
|
||||
index 4e80d8de308271bdad6b3315c5c01e5abf94624c..c7f3409b4d1772b65e570c785a826855b9972b0a 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -851,6 +851,11 @@
|
||||
"includes": [3880],
|
||||
@@ -884,6 +884,11 @@
|
||||
"includes": [4960],
|
||||
},
|
||||
|
||||
+ "electron/electron_resources.grd": {
|
||||
|
||||
@@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1:
|
||||
Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903
|
||||
|
||||
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
|
||||
index addc389948378353edb1f24e7416a2a9fbafed14..de2e861859efdcb99a5fd18a6d94efa0d2e17832 100755
|
||||
index b5f9205707bc77bbfd0516240bd5cb803a06f61e..2d390aad0b8e40a48f1357e24587b27e3407aeab 100755
|
||||
--- a/tools/clang/scripts/update.py
|
||||
+++ b/tools/clang/scripts/update.py
|
||||
@@ -286,6 +286,8 @@ def main():
|
||||
|
||||
28
patches/chromium/load_v8_snapshot_in_browser_process.patch
Normal file
28
patches/chromium/load_v8_snapshot_in_browser_process.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: John Kleinschmidt <jkleinsc@electronjs.org>
|
||||
Date: Mon, 11 Oct 2021 14:08:06 -0400
|
||||
Subject: load v8 snapshot in browser process
|
||||
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/3183394
|
||||
made a change to not load the v8 snapshot in the browser process,
|
||||
but due to the nature of electron, we need to load the v8 snapshot
|
||||
in the browser process.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index c97118c1380734e9cdc91b9d7191e0dc71d8b8ed..0a8eb0eddcc0e30b365c293e61c9a7b99ee39eaf 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -233,11 +233,8 @@ void LoadV8SnapshotFile() {
|
||||
|
||||
bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
|
||||
const std::string& process_type) {
|
||||
- // The gpu does not need v8, and the browser only needs v8 when in single
|
||||
- // process mode.
|
||||
- if (process_type == switches::kGpuProcess ||
|
||||
- (process_type.empty() &&
|
||||
- !command_line.HasSwitch(switches::kSingleProcess))) {
|
||||
+ // The gpu does not need v8
|
||||
+ if (process_type == switches::kGpuProcess) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -6,7 +6,7 @@ Subject: mas: avoid usage of AudioDeviceDuck
|
||||
Removes usage of the AudioDeviceDuck private API.
|
||||
|
||||
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
index eb39b38c308ddd876e3fbc142d4fdfd5dc002cb5..137ccd81aa98f6d44969e7b7733e2cfb1fb615a9 100644
|
||||
index e28d37435da00153e34132f49ce8f6b240e70a65..77ce459d969022b7c5a4d1e57bb1f7e6fa7a9898 100644
|
||||
--- a/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
|
||||
@@ -34,19 +34,23 @@
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: mas: avoid usage of CGDisplayUsesForceToGray
|
||||
Removes usage of the CGDisplayUsesForceToGray private API.
|
||||
|
||||
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
|
||||
index 697c81abd428676d13de7c34313134f6333962c3..50c535d93c198b2b0c358550552ea6b3ccd35ef5 100644
|
||||
index 7354a04f927af9a61eff83a8a5a9bc1054da80ec..f38ef7e9e1781f0c880ffcccabb984dcafdaada8 100644
|
||||
--- a/ui/display/mac/screen_mac.mm
|
||||
+++ b/ui/display/mac/screen_mac.mm
|
||||
@@ -149,7 +149,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) {
|
||||
|
||||
@@ -44,7 +44,7 @@ index 6af35b457b4acc4bbbac36b2f8a2617495d9d1f4..3c377839a8882d8e842edd8ca4b9b64c
|
||||
|
||||
} // namespace
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
index 2a4679b620db93d9eeb45873a97f5daba6e19456..04414494a859438972cb266aabdd47687bdafca5 100644
|
||||
index b17d46de296964120e5083c00a3ea9bdaded221f..af30adb8b6074864ca19e8235a248c5d77781468 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
|
||||
@@ -557,10 +557,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
|
||||
@@ -87,7 +87,7 @@ index c3a9fbf0f9d2b80c1de42a22ad094a286f0b559b..02493d4b62c98a3aebd3e460c459218a
|
||||
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 e7a1a348280c96a31fac75616d6e3034d1863a06..7631c62e2e799770f6abbb9af158235c00ce6185 100644
|
||||
index 2b262cc807162d91cb09393d58ceb4e7d9c2be34..5e66be5ceb963e6f13742c66b0a9cd79f0d91446 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
|
||||
@@ -49,7 +49,9 @@ class ScopedPasswordInputEnabler;
|
||||
@@ -114,10 +114,10 @@ index e7a1a348280c96a31fac75616d6e3034d1863a06..7631c62e2e799770f6abbb9af158235c
|
||||
// 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 922e51e7debac09e5444027c87603d40b972ffc7..5aac5fcfe781e282b748630c07341d1b465d99ac 100644
|
||||
index d1aae9cbefad2b31dcd98e0c95891943b027cc5f..ec191047cca6d8e7d00e445942461e9b47098ec1 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
||||
@@ -251,8 +251,10 @@
|
||||
@@ -249,8 +249,10 @@
|
||||
void RenderWidgetHostViewMac::MigrateNSViewBridge(
|
||||
remote_cocoa::mojom::Application* remote_cocoa_application,
|
||||
uint64_t parent_ns_view_id) {
|
||||
@@ -128,7 +128,7 @@ index 922e51e7debac09e5444027c87603d40b972ffc7..5aac5fcfe781e282b748630c07341d1b
|
||||
|
||||
// Disconnect from the previous bridge (this will have the effect of
|
||||
// destroying the associated bridge), and close the receiver (to allow it
|
||||
@@ -1469,8 +1471,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1455,8 +1457,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
|
||||
gfx::NativeViewAccessible
|
||||
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
|
||||
@@ -139,7 +139,7 @@ index 922e51e7debac09e5444027c87603d40b972ffc7..5aac5fcfe781e282b748630c07341d1b
|
||||
return [GetInProcessNSView() window];
|
||||
}
|
||||
|
||||
@@ -1514,9 +1518,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1500,9 +1504,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
}
|
||||
|
||||
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
|
||||
@@ -151,7 +151,7 @@ index 922e51e7debac09e5444027c87603d40b972ffc7..5aac5fcfe781e282b748630c07341d1b
|
||||
}
|
||||
|
||||
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
|
||||
@@ -2009,12 +2015,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
@@ -1995,12 +2001,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
|
||||
|
||||
void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
|
||||
const std::vector<uint8_t>& window_token) {
|
||||
@@ -167,7 +167,7 @@ index 922e51e7debac09e5444027c87603d40b972ffc7..5aac5fcfe781e282b748630c07341d1b
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
||||
index ae61e09deae53071c3a00d054cde3c57a8ac143a..7f91c46cd437f269b76fda383fd2d6ab990d310c 100644
|
||||
index 9cce2f63140db5370ef9400dd83cc3d8fe0e9323..909ffe62a19bf8752abb038223a0823dd613586c 100644
|
||||
--- a/ui/base/BUILD.gn
|
||||
+++ b/ui/base/BUILD.gn
|
||||
@@ -322,6 +322,13 @@ component("base") {
|
||||
|
||||
@@ -16,7 +16,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 caeaaf96088709486688ba1ca231b928f600c3f1..27024e051cf9e7424c9187f6af5e3b03ca1edaf2 100644
|
||||
index c384f18ec959303bd3671c570af87b604d20cf23..f420bd94951f5a2b03d20e5892a4039271ed2078 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 @@
|
||||
@@ -29,7 +29,7 @@ index caeaaf96088709486688ba1ca231b928f600c3f1..27024e051cf9e7424c9187f6af5e3b03
|
||||
@class CALayer;
|
||||
|
||||
namespace ui {
|
||||
@@ -119,7 +121,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
|
||||
@@ -113,7 +115,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
|
||||
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
||||
|
||||
bool use_remote_layer_api_;
|
||||
@@ -40,7 +40,7 @@ index caeaaf96088709486688ba1ca231b928f600c3f1..27024e051cf9e7424c9187f6af5e3b03
|
||||
|
||||
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 54c5b7bcbe4ead3653bcea1f82ac34212d87392e..d7ce7c04e1fcab4949e1340901aacfac14bb383e 100644
|
||||
index 55340e6c038485e3a75126e85fd166c6569b39e6..8afeb88576adcd06d7bb0a52250fbff98f0b513a 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
@@ -65,7 +65,7 @@ index f1a82347e5c982609b8dcad10b969d332a665b30..26ab7745450cc807761026a677c435db
|
||||
gfx::NativeViewAccessible LineIndexToNode(
|
||||
const std::u16string line_index) const;
|
||||
diff --git a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
||||
index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c875495156 100644
|
||||
index 37d54fb830e039077375d1d0c1aefea9bafebc2e..68148b48610d13a89a3afad58a034001ea120712 100644
|
||||
--- a/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
||||
+++ b/content/browser/accessibility/accessibility_tree_formatter_utils_mac.mm
|
||||
@@ -178,9 +178,11 @@
|
||||
@@ -80,7 +80,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
|
||||
if ([target isKindOfClass:[NSArray class]])
|
||||
return InvokeForArray(target, property_node);
|
||||
@@ -373,6 +375,7 @@
|
||||
@@ -383,6 +385,7 @@
|
||||
property_name == "AXTextMarkerRangeForUIElement") { // UIElement
|
||||
return OptionalNSObject::NotNilOrError(PropertyNodeToUIElement(arg_node));
|
||||
}
|
||||
@@ -88,7 +88,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
if (property_name == "AXIndexForTextMarker" ||
|
||||
property_name == "AXNextWordEndTextMarkerForTextMarker" ||
|
||||
property_name ==
|
||||
@@ -384,6 +387,7 @@
|
||||
@@ -394,6 +397,7 @@
|
||||
return OptionalNSObject::NotNilOrError(
|
||||
PropertyNodeToTextMarkerRange(arg_node));
|
||||
}
|
||||
@@ -96,7 +96,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
|
||||
return OptionalNSObject::NotApplicable();
|
||||
}
|
||||
@@ -396,6 +400,7 @@
|
||||
@@ -406,6 +410,7 @@
|
||||
return value;
|
||||
|
||||
// NSRange
|
||||
@@ -104,7 +104,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
value = PropertyNodeToRange(property_node, false);
|
||||
if (value)
|
||||
return value;
|
||||
@@ -412,6 +417,10 @@
|
||||
@@ -422,6 +427,10 @@
|
||||
|
||||
// TextMarkerRange
|
||||
return PropertyNodeToTextMarkerRange(property_node, false);
|
||||
@@ -115,7 +115,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
}
|
||||
|
||||
// NSNumber. Format: integer.
|
||||
@@ -522,6 +531,7 @@
|
||||
@@ -532,6 +541,7 @@
|
||||
return uielement;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
id AttributeInvoker::DictNodeToTextMarker(const AXPropertyNode& dictnode,
|
||||
bool log_failure) const {
|
||||
if (!dictnode.IsDict()) {
|
||||
@@ -567,6 +577,7 @@
|
||||
@@ -577,6 +587,7 @@
|
||||
return content::AXTextMarkerFrom(anchor_cocoa, *offset, affinity);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
id AttributeInvoker::PropertyNodeToTextMarker(const AXPropertyNode& dictnode,
|
||||
bool log_failure) const {
|
||||
return DictNodeToTextMarker(dictnode, log_failure);
|
||||
@@ -611,6 +622,7 @@
|
||||
@@ -621,6 +632,7 @@
|
||||
|
||||
return content::AXTextMarkerRangeFrom(anchor_textmarker, focus_textmarker);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
|
||||
OptionalNSObject TextMarkerRangeGetStartMarker(const OptionalNSObject& obj) {
|
||||
if (!IsAXTextMarkerRange(*obj))
|
||||
@@ -650,6 +662,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) {
|
||||
@@ -660,6 +672,7 @@ OptionalNSObject TextMarkerRangeGetEndMarker(const OptionalNSObject& obj) {
|
||||
return OptionalNSObject::NotNilOrError(content::AXTextMarkerFrom(
|
||||
cocoa_node, range.focus()->text_offset(), range.focus()->affinity()));
|
||||
}
|
||||
@@ -148,10 +148,10 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8
|
||||
OptionalNSObject MakePairArray(const OptionalNSObject& obj1,
|
||||
const OptionalNSObject& obj2) {
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
index b2da63a5831595944b9e12ba8386167bd0bb6c7c..dac074cc081cc12948f0d9b2e2b89ef1b10cbb66 100644
|
||||
index 0282b3c04cf0281820b716d0991af5ac4d6304de..ad0da68df963cc0872dc545ef525128ff0f8a0b0 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
@@ -160,7 +160,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
||||
@@ -157,7 +157,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
||||
@property(nonatomic, readonly) NSNumber* enabled;
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with Voiceover.
|
||||
@@ -161,7 +161,7 @@ index b2da63a5831595944b9e12ba8386167bd0bb6c7c..dac074cc081cc12948f0d9b2e2b89ef1
|
||||
@property(nonatomic, readonly) NSNumber* expanded;
|
||||
@property(nonatomic, readonly) NSNumber* focused;
|
||||
@property(nonatomic, readonly) NSNumber* grabbed;
|
||||
@@ -172,7 +174,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
||||
@@ -169,7 +171,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
||||
// Index of a row, column, or tree item.
|
||||
@property(nonatomic, readonly) NSNumber* index;
|
||||
@property(nonatomic, readonly) NSNumber* treeItemRowIndex;
|
||||
@@ -170,8 +170,8 @@ index b2da63a5831595944b9e12ba8386167bd0bb6c7c..dac074cc081cc12948f0d9b2e2b89ef1
|
||||
+#endif
|
||||
@property(nonatomic, readonly) NSString* invalid;
|
||||
@property(nonatomic, readonly) NSNumber* isMultiSelectable;
|
||||
@property(nonatomic, readonly) NSString* placeholderValue;
|
||||
@@ -195,14 +199,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
||||
@property(nonatomic, readonly) NSNumber* loaded;
|
||||
@@ -191,14 +195,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker);
|
||||
// The object is selected as a whole.
|
||||
@property(nonatomic, readonly) NSNumber* selected;
|
||||
@property(nonatomic, readonly) NSArray* selectedChildren;
|
||||
@@ -191,7 +191,7 @@ index b2da63a5831595944b9e12ba8386167bd0bb6c7c..dac074cc081cc12948f0d9b2e2b89ef1
|
||||
// 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 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1c314cbb4 100644
|
||||
index 06e0766c6023768dc88f4d7deb28b1960c594ebb..980b855b6c52bdc39bf9e79e2b1618bd5d31c0cb 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
@@ -206,6 +206,7 @@
|
||||
@@ -263,7 +263,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
{NSAccessibilityInvalidAttribute, @"invalid"},
|
||||
{NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
|
||||
{NSAccessibilityLanguageAttribute, @"language"},
|
||||
@@ -874,13 +884,17 @@ + (void)initialize {
|
||||
@@ -873,13 +883,17 @@ + (void)initialize {
|
||||
{NSAccessibilityRowsAttribute, @"rows"},
|
||||
// TODO(aboxhall): expose
|
||||
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
||||
@@ -281,7 +281,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
{NSAccessibilitySizeAttribute, @"size"},
|
||||
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
||||
{NSAccessibilitySubroleAttribute, @"subrole"},
|
||||
@@ -1412,6 +1426,7 @@ - (NSNumber*)enabled {
|
||||
@@ -1411,6 +1425,7 @@ - (NSNumber*)enabled {
|
||||
ax::mojom::Restriction::kDisabled);
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)endTextMarker {
|
||||
@@ -1420,6 +1435,7 @@ - (id)endTextMarker {
|
||||
@@ -1419,6 +1434,7 @@ - (id)endTextMarker {
|
||||
BrowserAccessibility::AXPosition position = _owner->CreateTextPositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtEndOfContent());
|
||||
}
|
||||
@@ -297,7 +297,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
- (NSNumber*)expanded {
|
||||
if (![self instanceActive])
|
||||
@@ -1620,6 +1636,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind
|
||||
@@ -1619,6 +1635,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
- (NSNumber*)AXInsertionPointLineNumber {
|
||||
return [self insertionPointLineNumber];
|
||||
}
|
||||
@@ -1649,6 +1666,7 @@ - (NSNumber*)insertionPointLineNumber {
|
||||
@@ -1648,6 +1665,7 @@ - (NSNumber*)insertionPointLineNumber {
|
||||
caretPosition->AsTextPosition()->text_offset());
|
||||
return @(std::distance(lineBreaks.begin(), iterator));
|
||||
}
|
||||
@@ -313,7 +313,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
// Returns whether or not this node should be ignored in the
|
||||
// accessibility tree.
|
||||
@@ -2016,8 +2034,12 @@ - (BOOL)shouldExposeTitleUIElement {
|
||||
@@ -1998,8 +2016,12 @@ - (BOOL)shouldExposeTitleUIElement {
|
||||
return content::AXTextEdit(newValue, std::u16string(), nil);
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
}
|
||||
|
||||
// internal
|
||||
@@ -2346,6 +2368,7 @@ - (NSArray*)selectedChildren {
|
||||
@@ -2328,6 +2350,7 @@ - (NSArray*)selectedChildren {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
- (NSString*)AXSelectedText {
|
||||
return [self selectedText];
|
||||
}
|
||||
@@ -2394,7 +2417,9 @@ - (NSValue*)selectedTextRange {
|
||||
@@ -2376,7 +2399,9 @@ - (NSValue*)selectedTextRange {
|
||||
int selLength = range.GetText().length();
|
||||
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
||||
}
|
||||
@@ -344,7 +344,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
- (id)selectedTextMarkerRange {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2406,6 +2431,7 @@ - (id)selectedTextMarkerRange {
|
||||
@@ -2388,6 +2413,7 @@ - (id)selectedTextMarkerRange {
|
||||
// words correctly.
|
||||
return CreateTextMarkerRange(ax_range.AsBackwardRange());
|
||||
}
|
||||
@@ -352,7 +352,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
- (NSValue*)size {
|
||||
if (![self instanceActive])
|
||||
@@ -2438,6 +2464,7 @@ - (NSString*)sortDirection {
|
||||
@@ -2420,6 +2446,7 @@ - (NSString*)sortDirection {
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
// Returns a text marker that points to the first character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)startTextMarker {
|
||||
@@ -2446,6 +2473,7 @@ - (id)startTextMarker {
|
||||
@@ -2428,6 +2455,7 @@ - (id)startTextMarker {
|
||||
BrowserAccessibility::AXPosition position = _owner->CreateTextPositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtStartOfContent());
|
||||
}
|
||||
@@ -368,7 +368,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
- (NSString*)AXSubrole {
|
||||
return [self subrole];
|
||||
@@ -2793,12 +2821,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
@@ -2771,12 +2799,14 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
|
||||
NSMutableAttributedString* attributedInnerText =
|
||||
[[[NSMutableAttributedString alloc]
|
||||
initWithString:base::SysUTF16ToNSString(innerText)] autorelease];
|
||||
@@ -383,7 +383,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
return [attributedInnerText attributedSubstringFromRange:range];
|
||||
}
|
||||
@@ -2930,6 +2960,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -2908,6 +2938,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return ToBrowserAccessibilityCocoa(cell);
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
if ([attribute
|
||||
isEqualToString:
|
||||
NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
|
||||
@@ -3253,6 +3284,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -3231,6 +3262,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
|
||||
return CreateTextMarker(root->CreateTextPositionAt(index));
|
||||
}
|
||||
@@ -399,7 +399,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
if ([attribute isEqualToString:
|
||||
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
||||
@@ -3283,6 +3315,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -3261,6 +3293,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
if ([attribute
|
||||
isEqualToString:
|
||||
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
||||
@@ -3402,6 +3435,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
@@ -3380,6 +3413,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
|
||||
|
||||
return @(child->GetIndexInParent());
|
||||
}
|
||||
@@ -415,7 +415,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
return nil;
|
||||
}
|
||||
@@ -3968,6 +4002,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
||||
@@ -3946,6 +3980,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
||||
->AsTextSelectionPosition()));
|
||||
}
|
||||
}
|
||||
@@ -423,7 +423,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
if ([attribute
|
||||
isEqualToString:NSAccessibilitySelectedTextMarkerRangeAttribute]) {
|
||||
BrowserAccessibility::AXRange range = CreateRangeFromTextMarkerRange(value);
|
||||
@@ -3978,6 +4013,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
||||
@@ -3956,6 +3991,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
||||
range.anchor()->AsTextSelectionPosition(),
|
||||
range.focus()->AsTextSelectionPosition()));
|
||||
}
|
||||
@@ -432,7 +432,7 @@ index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1
|
||||
|
||||
- (id)accessibilityFocusedUIElement {
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index 58f6c6ad44112166f4ff14912a2cc2b8be81c887..716a83853985dced4ec09d137e84dd0356e4aa2c 100644
|
||||
index c4c0e0aaa1be36160152388a304bbc62d73cb01c..44dfc7394784c32e3f3c8bab7b6304229862ce3e 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -502,7 +502,7 @@ void PostAnnouncementNotification(NSString* announcement) {
|
||||
@@ -541,7 +541,7 @@ index c15f3a631292b538698625328fb429ee3c9964f5..37e038753ecf1b82ec92c06b2c0729b5
|
||||
}
|
||||
|
||||
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
index 54d902424796eb0687ebeedb6f1a9cd4a926e5b0..9d3ca310a7554c5606f95e9df26ea35ec37879d9 100644
|
||||
index 91ed4a803558524223931d913ca9fd6dd00d7e37..b4c59d1ad7df77743dc4cc8f4e378b21f2b5e553 100644
|
||||
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
@@ -42,6 +42,7 @@
|
||||
@@ -602,10 +602,10 @@ index 9c8628a08045c7793f088200b58b492b9f0581cf..1c5b6e85bce201fc13c34671b0761767
|
||||
"AudioToolbox.framework",
|
||||
"AudioUnit.framework",
|
||||
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
||||
index 261596b9b7414e5c732bef945610c0cdf1384da8..f58ac1d55acac1895391579275a12b0f9802491d 100644
|
||||
index 2066a12b1940bcec87ab01e94cb63ea46b1c46db..d6e08b56420077bbdddd81c12a535fea62197aca 100644
|
||||
--- a/media/audio/mac/audio_manager_mac.cc
|
||||
+++ b/media/audio/mac/audio_manager_mac.cc
|
||||
@@ -883,7 +883,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
||||
@@ -887,7 +887,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
||||
|
||||
void AudioManagerMac::InitializeOnAudioThread() {
|
||||
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
|
||||
@@ -615,10 +615,10 @@ index 261596b9b7414e5c732bef945610c0cdf1384da8..f58ac1d55acac1895391579275a12b0f
|
||||
}
|
||||
|
||||
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
||||
index 2de14574f1b7e848fc03ff1071fddf8307bc9ea2..75a86416bad754f1e9c92afb2fad27a501b9cc6c 100644
|
||||
index 1aef5a0d9d4cdfcb669118a4f7244819ff14ed39..e418ef18ed7e1855090f201ab2de9bc240643e84 100644
|
||||
--- a/net/dns/dns_config_service_posix.cc
|
||||
+++ b/net/dns/dns_config_service_posix.cc
|
||||
@@ -136,8 +136,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
||||
@@ -140,8 +140,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
||||
|
||||
bool Watch() override {
|
||||
CheckOnCorrectSequence();
|
||||
@@ -628,7 +628,7 @@ index 2de14574f1b7e848fc03ff1071fddf8307bc9ea2..75a86416bad754f1e9c92afb2fad27a5
|
||||
if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
|
||||
base::Unretained(this)))) {
|
||||
LOG(ERROR) << "DNS config watch failed to start.";
|
||||
@@ -154,6 +154,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
||||
@@ -158,6 +158,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
||||
success = false;
|
||||
}
|
||||
#endif // !defined(OS_IOS)
|
||||
|
||||
@@ -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 2dda0e753a89fcbf446212f429e90659ca289bf0..7bd73dae3a77cb16cf282d2df7f4ff7a8f412805 100644
|
||||
index f8fddf1b0a2c7b0eefaa0e7dd550594cc274b91b..39ff43884fbc2b6768d7ddb6e9d63031a973b8fa 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -118,6 +118,11 @@
|
||||
@@ -119,6 +119,11 @@
|
||||
#include "services/network/web_transport.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
@@ -22,7 +22,7 @@ index 2dda0e753a89fcbf446212f429e90659ca289bf0..7bd73dae3a77cb16cf282d2df7f4ff7a
|
||||
#if BUILDFLAG(IS_CT_SUPPORTED)
|
||||
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
|
||||
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
|
||||
@@ -419,6 +424,79 @@ bool GetFullDataFilePath(
|
||||
@@ -420,6 +425,79 @@ bool GetFullDataFilePath(
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -102,7 +102,7 @@ index 2dda0e753a89fcbf446212f429e90659ca289bf0..7bd73dae3a77cb16cf282d2df7f4ff7a
|
||||
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
|
||||
|
||||
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
|
||||
@@ -643,6 +721,13 @@ void NetworkContext::SetClient(
|
||||
@@ -644,6 +722,13 @@ void NetworkContext::SetClient(
|
||||
client_.Bind(std::move(client));
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ index 2dda0e753a89fcbf446212f429e90659ca289bf0..7bd73dae3a77cb16cf282d2df7f4ff7a
|
||||
void NetworkContext::CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) {
|
||||
@@ -2085,6 +2170,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -2088,6 +2173,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
std::move(cert_verifier));
|
||||
cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
@@ -127,7 +127,7 @@ index 2dda0e753a89fcbf446212f429e90659ca289bf0..7bd73dae3a77cb16cf282d2df7f4ff7a
|
||||
|
||||
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 9339c55c5e818a2a7bd8800d9b1cb64553369c24..049c8e5e0e34454f03a823b31a5f7755d67cfb07 100644
|
||||
index 9f204502a1d58e16ef191efc7bda2315dc0e3d50..8362af824a8dd4f721eebdbff2d544f7f5093d16 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -99,6 +99,7 @@ class DomainReliabilityMonitor;
|
||||
@@ -138,7 +138,7 @@ index 9339c55c5e818a2a7bd8800d9b1cb64553369c24..049c8e5e0e34454f03a823b31a5f7755
|
||||
class CookieManager;
|
||||
class ExpectCTReporter;
|
||||
class HostResolver;
|
||||
@@ -210,6 +211,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -213,6 +214,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) override;
|
||||
@@ -147,7 +147,7 @@ index 9339c55c5e818a2a7bd8800d9b1cb64553369c24..049c8e5e0e34454f03a823b31a5f7755
|
||||
void ResetURLLoaderFactories() override;
|
||||
void GetCookieManager(
|
||||
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
|
||||
@@ -743,6 +746,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -746,6 +749,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
CertVerifierWithTrustAnchors* cert_verifier_with_trust_anchors_ = nullptr;
|
||||
#endif
|
||||
|
||||
@@ -157,7 +157,7 @@ index 9339c55c5e818a2a7bd8800d9b1cb64553369c24..049c8e5e0e34454f03a823b31a5f7755
|
||||
// CertNetFetcher is not used by the current platform, or if the actual
|
||||
// net::CertVerifier is instantiated outside of the network service.
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
index 6d2ab194fd2330426f56602cd2e586f096750acd..d8e7d0d35317fe1124bf81f60faf2b35ae19a3d7 100644
|
||||
index f3f625cc6d5457012703c25a89684f9ad9f05768..8f8b496324265b25046a88cbac7decec056f061e 100644
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -265,6 +265,17 @@ struct NetworkContextFilePaths {
|
||||
|
||||
@@ -33,7 +33,7 @@ index 442b856f8bcfbcea7742188897f0ce0a25cd60f4..6165eb772901faa25514c9bbefd13ff6
|
||||
}
|
||||
|
||||
diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h
|
||||
index 19c2beb1f1949f0dc4466a8728f151c035544b24..f7aa5f94d6dea0e6b2c1107b8ef01600bf13903b 100644
|
||||
index e4b630b54fe782879f7c79afb13aa025dd1505b2..983804b6846a4f5b07e72a1c7c7e0b871b4eddf7 100644
|
||||
--- a/content/browser/notifications/blink_notification_service_impl.h
|
||||
+++ b/content/browser/notifications/blink_notification_service_impl.h
|
||||
@@ -41,6 +41,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
||||
@@ -44,7 +44,7 @@ index 19c2beb1f1949f0dc4466a8728f151c035544b24..f7aa5f94d6dea0e6b2c1107b8ef01600
|
||||
const url::Origin& origin,
|
||||
const GURL& document_url,
|
||||
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
|
||||
@@ -96,6 +97,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
||||
@@ -101,6 +102,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
||||
// The notification context that owns this service instance.
|
||||
PlatformNotificationContextImpl* notification_context_;
|
||||
|
||||
@@ -53,10 +53,10 @@ index 19c2beb1f1949f0dc4466a8728f151c035544b24..f7aa5f94d6dea0e6b2c1107b8ef01600
|
||||
|
||||
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
|
||||
diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
index 740b591e68522f211177f4578d8cd3b9aa49f152..6190edab32f373a8076820eac943afb1c6bebe99 100644
|
||||
index e1fe936d73bb74a2708993ce72443f62ebb969f8..ba46243ca95466243afbc82fc689aa43cd84e61b 100644
|
||||
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
||||
@@ -122,7 +122,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
|
||||
@@ -127,7 +127,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
|
||||
|
||||
notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
|
||||
notification_context_.get(), &browser_context_,
|
||||
@@ -66,10 +66,10 @@ index 740b591e68522f211177f4578d8cd3b9aa49f152..6190edab32f373a8076820eac943afb1
|
||||
/*document_url=*/GURL(),
|
||||
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 32f66cfb52ae240f5a8311779421f01920a31bb2..128355a4791ebb68045522627a5a8db183c1c070 100644
|
||||
index 883cfb82286da5237e3b7ec35632bf575be6c413..805c6476e09857af75d391276357b2c2e08ea8c0 100644
|
||||
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
||||
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
||||
@@ -282,13 +282,14 @@ void PlatformNotificationContextImpl::Shutdown() {
|
||||
@@ -281,13 +281,14 @@ void PlatformNotificationContextImpl::Shutdown() {
|
||||
}
|
||||
|
||||
void PlatformNotificationContextImpl::CreateService(
|
||||
@@ -107,10 +107,10 @@ index 78f9ab684d2eeef9a647d82ccb39c1b208e999d4..d55a4e51a0d263ec07ca115715cccc30
|
||||
const GURL& document_url,
|
||||
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 f788e63de17e478ad749c61a2744747ef59af75a..d64ad2d8d3a9515768d82ff02e7be26383dd5b66 100644
|
||||
index d26c4d7ce3501a9adc03049c232542624b023d22..3d17af73a34eb4bbc71119cd8019547cc757565e 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2273,7 +2273,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2245,7 +2245,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
document_url = rfh->GetLastCommittedURL();
|
||||
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
@@ -153,10 +153,10 @@ index 7397963a36bec7016ae92fbc4bb741825e5fb8d1..d928e1ea629cd69ff188ce53e311786a
|
||||
const GURL& origin,
|
||||
const GURL& document_url,
|
||||
diff --git a/content/test/mock_platform_notification_service.h b/content/test/mock_platform_notification_service.h
|
||||
index f2047771199f29ef4fe2a1817bf44acb54fe99b9..bea2d5e78bceb48678bfaeebe1745173967b983f 100644
|
||||
index ac33e0fb5a4eda45a300b7dd60a320468a857ed3..2f85e387c33628ac28ba95f04d4bd7d97b72fc51 100644
|
||||
--- a/content/test/mock_platform_notification_service.h
|
||||
+++ b/content/test/mock_platform_notification_service.h
|
||||
@@ -46,6 +46,7 @@ class MockPlatformNotificationService : public PlatformNotificationService {
|
||||
@@ -52,6 +52,7 @@ class MockPlatformNotificationService : public PlatformNotificationService {
|
||||
|
||||
// PlatformNotificationService implementation.
|
||||
void DisplayNotification(
|
||||
|
||||
@@ -107,7 +107,7 @@ index d75adab3141094e2897b2ed4ca9005bf82d70979..7ee78a7345e29a3ee8836a7a06af9a63
|
||||
int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem(
|
||||
ppapi::host::HostMessageContext* context) {
|
||||
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
|
||||
index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec89599280 100644
|
||||
index b94f5144538258555cda5d42fe7bd5e5af3ac902..2be302b4c7d85ed4382561202e4c03fb71166069 100644
|
||||
--- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
|
||||
+++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h
|
||||
@@ -20,7 +20,9 @@
|
||||
@@ -120,7 +120,7 @@ index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec
|
||||
|
||||
namespace content {
|
||||
class BrowserPpapiHost;
|
||||
@@ -54,6 +56,7 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
@@ -59,6 +61,7 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
|
||||
~PepperIsolatedFileSystemMessageFilter() override;
|
||||
|
||||
@@ -128,7 +128,7 @@ index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec
|
||||
Profile* GetProfile();
|
||||
|
||||
// Returns filesystem id of isolated filesystem if valid, or empty string
|
||||
@@ -61,10 +64,13 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
@@ -66,10 +69,13 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
// allows access on that thread.
|
||||
storage::IsolatedContext::ScopedFSHandle CreateCrxFileSystem(
|
||||
Profile* profile);
|
||||
@@ -142,7 +142,7 @@ index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec
|
||||
int32_t OpenPluginPrivateFileSystem(ppapi::host::HostMessageContext* context);
|
||||
|
||||
const int render_process_id_;
|
||||
@@ -75,8 +81,10 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
@@ -80,8 +86,10 @@ class PepperIsolatedFileSystemMessageFilter
|
||||
// Not owned by this object.
|
||||
ppapi::host::PpapiHost* ppapi_host_;
|
||||
|
||||
@@ -150,9 +150,9 @@ index 56a23e8f41bb418d414f11af5797b30571d4cc2b..6f9f577f16de80dd2ab194b557bbd9ec
|
||||
// Set of origins that can use CrxFs private APIs from NaCl.
|
||||
std::set<std::string> allowed_crxfs_origins_;
|
||||
+#endif
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PepperIsolatedFileSystemMessageFilter);
|
||||
};
|
||||
|
||||
#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_ISOLATED_FILE_SYSTEM_MESSAGE_FILTER_H_
|
||||
diff --git a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc b/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
index 60cfd89dfd18eced6f6d103267b80d547d2e9f26..95d36e99832f434d878a2a2fc3101a611926acb2 100644
|
||||
--- a/chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
||||
|
||||
@@ -61,7 +61,7 @@ index 7b711bdbaf4afddd6ccf300af7bab26487942243..987a60b81554b676661d8f1a53facbc9
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/paint_vector_icon.h"
|
||||
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
index 3db862e69264ddf9e850f1354fce402a3e920b75..4a667a2bbd2d36d275438b63c56fa219e79631f6 100644
|
||||
index c920adbbd8db50dd253d17e954d1a96d7599bfcc..67ba2c16cfa66cb5a8983fa2cb6f5a8d4e791712 100644
|
||||
--- a/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
+++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
|
||||
@@ -15,9 +15,11 @@
|
||||
|
||||
@@ -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.cc b/chrome/browser/printing/print_job.cc
|
||||
index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd103939429beeb 100644
|
||||
index baf39affec92126a6f998636bf35d1f2563fa47f..18c61ff4b2145881fd396b6e397eb7c4f9468558 100644
|
||||
--- a/chrome/browser/printing/print_job.cc
|
||||
+++ b/chrome/browser/printing/print_job.cc
|
||||
@@ -89,6 +89,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
|
||||
@@ -88,6 +88,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
|
||||
return base::FeatureList::IsEnabled(features::kPrintWithReducedRasterization);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
||||
PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
|
||||
// TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely
|
||||
// because `web_contents` was null. As a result, this section has many more
|
||||
@@ -97,6 +98,7 @@ PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
|
||||
@@ -96,6 +97,7 @@ PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
|
||||
web_contents ? web_contents->GetBrowserContext() : nullptr;
|
||||
return context ? Profile::FromBrowserContext(context)->GetPrefs() : nullptr;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
||||
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
@@ -381,11 +383,18 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
@@ -380,11 +382,18 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
// seems to work with the fix for this bug applied.
|
||||
const PrintSettings& settings = document()->settings();
|
||||
bool print_text_with_gdi =
|
||||
@@ -51,7 +51,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
||||
|
||||
using RenderMode = PdfRenderSettings::Mode;
|
||||
RenderMode mode;
|
||||
@@ -480,8 +489,10 @@ void PrintJob::StartPdfToPostScriptConversion(
|
||||
@@ -479,8 +488,10 @@ void PrintJob::StartPdfToPostScriptConversion(
|
||||
if (ps_level2) {
|
||||
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
|
||||
} else {
|
||||
@@ -63,7 +63,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
||||
? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3_WITH_TYPE42_FONTS
|
||||
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
|
||||
}
|
||||
@@ -531,6 +542,10 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) {
|
||||
@@ -530,6 +541,10 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
switch (event_details.type()) {
|
||||
@@ -75,10 +75,10 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
||||
// No need to cancel since the worker already canceled itself.
|
||||
Stop();
|
||||
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h
|
||||
index b8b83529be4c7da661032d3b941984c02b978047..98ef6cfad5dc46d9dcb65a0ce506db3729410239 100644
|
||||
index 5914354ac77532eadb26bd09cffc8470fcf41c4b..18a92f5a9a35b7a86f47f6555b37d3c729c468cd 100644
|
||||
--- a/chrome/browser/printing/print_job.h
|
||||
+++ b/chrome/browser/printing/print_job.h
|
||||
@@ -242,6 +242,9 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
|
||||
@@ -243,6 +243,9 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
|
||||
public:
|
||||
// Event type.
|
||||
enum Type {
|
||||
@@ -89,7 +89,7 @@ index b8b83529be4c7da661032d3b941984c02b978047..98ef6cfad5dc46d9dcb65a0ce506db37
|
||||
NEW_DOC,
|
||||
|
||||
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
|
||||
index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700bf05600c3 100644
|
||||
index 288b9f89129de88ea078b2e6d3b2d255dd527a95..e9979d5c9707e94580d4a10b4c48c32ce07cfc70 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -21,13 +21,13 @@
|
||||
@@ -105,13 +105,13 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
||||
#include "content/public/browser/web_contents.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "printing/backend/print_backend.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/mojom/print.mojom.h"
|
||||
#include "printing/print_job_constants.h"
|
||||
@@ -240,16 +240,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
@@ -301,16 +301,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
#endif // defined(OS_LINUX) && defined(USE_CUPS)
|
||||
}
|
||||
|
||||
- PrintingContext::Result result;
|
||||
- mojom::ResultCode result;
|
||||
{
|
||||
#if defined(OS_WIN)
|
||||
// Blocking is needed here because Windows printer drivers are oftentimes
|
||||
@@ -121,9 +121,9 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
||||
- result = printing_context_->UpdatePrintSettings(std::move(new_settings));
|
||||
+ // Reset settings from previous print job
|
||||
+ printing_context_->ResetSettings();
|
||||
+ PrintingContext::Result get_default_result = printing_context_->UseDefaultSettings();
|
||||
+ if (get_default_result == PrintingContext::Result::OK) {
|
||||
+ PrintingContext::Result update_result =
|
||||
+ mojom::ResultCode get_default_result = printing_context_->UseDefaultSettings();
|
||||
+ if (get_default_result == mojom::ResultCode::kSuccess) {
|
||||
+ mojom::ResultCode update_result =
|
||||
+ printing_context_->UpdatePrintSettings(std::move(new_settings));
|
||||
+ GetSettingsDone(std::move(callback), update_result);
|
||||
+ }
|
||||
@@ -132,11 +132,11 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
||||
}
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -265,6 +270,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
@@ -326,6 +331,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
|
||||
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
|
||||
PrintingContext::Result result) {
|
||||
+ if (result == PrintingContext::CANCEL) {
|
||||
mojom::ResultCode result) {
|
||||
+ if (result == mojom::ResultCode::kCanceled) {
|
||||
+ print_job_->PostTask(
|
||||
+ FROM_HERE,
|
||||
+ base::BindOnce(&NotificationCallback, base::RetainedRef(print_job_),
|
||||
@@ -147,7 +147,7 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f4a33a433 100644
|
||||
index 2011d52338081666b4761e0bf66d01245abd0213..647ac4cd9730c8983868ea165907b7c9a42767aa 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -28,10 +28,10 @@
|
||||
@@ -188,18 +188,18 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -237,7 +241,9 @@ void UpdatePrintSettingsReplyOnIO(
|
||||
@@ -238,7 +242,9 @@ void UpdatePrintSettingsReplyOnIO(
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
||||
DCHECK(printer_query);
|
||||
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
|
||||
- if (printer_query->last_status() == PrintingContext::OK) {
|
||||
- if (printer_query->last_status() == mojom::ResultCode::kSuccess) {
|
||||
+ // We call update without first printing from defaults,
|
||||
+ // so the last printer status will still be defaulted to PrintingContext::FAILED
|
||||
+ if (printer_query) {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(),
|
||||
params->params.get());
|
||||
params->params->document_cookie = printer_query->cookie();
|
||||
@@ -340,12 +346,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
@@ -341,12 +347,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_);
|
||||
@@ -214,7 +214,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -353,7 +361,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -354,7 +362,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
DisconnectFromCurrentPrintJob();
|
||||
if (!weak_this)
|
||||
@@ -368,7 +379,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -369,7 +380,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
// go in `ReleasePrintJob()`.
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
@@ -239,10 +239,10 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
+ }
|
||||
+
|
||||
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(silent, std::move(settings));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -523,9 +541,9 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
for (auto& observer : GetObservers())
|
||||
observer.OnPrintNow(rfh);
|
||||
@@ -528,9 +546,9 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
// The Unretained() is safe because ForEachFrame() is synchronous.
|
||||
@@ -255,7 +255,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -639,12 +657,13 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
@@ -644,12 +662,13 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
void PrintViewManagerBase::GetDefaultPrintSettings(
|
||||
GetDefaultPrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
@@ -270,7 +270,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame();
|
||||
auto callback_wrapper =
|
||||
base::BindOnce(&PrintViewManagerBase::GetDefaultPrintSettingsReply,
|
||||
@@ -662,18 +681,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -667,18 +686,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
base::Value job_settings,
|
||||
UpdatePrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
@@ -292,7 +292,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
content::BrowserContext* context =
|
||||
web_contents() ? web_contents()->GetBrowserContext() : nullptr;
|
||||
PrefService* prefs =
|
||||
@@ -683,6 +704,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -688,6 +709,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
if (value > 0)
|
||||
job_settings.SetIntKey(kSettingRasterizePdfDpi, value);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
|
||||
content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame();
|
||||
auto callback_wrapper =
|
||||
@@ -722,13 +744,17 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
|
||||
@@ -727,7 +749,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
|
||||
PrintManager::PrintingFailed(cookie);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -308,6 +308,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -742,6 +763,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
|
||||
@@ -319,7 +320,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
|
||||
l10n_util::GetStringUTF16(
|
||||
@@ -807,6 +833,11 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
@@ -820,6 +846,11 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -331,7 +332,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
case JobEventDetails::JOB_DONE:
|
||||
// Printing is done, we don't need it anymore.
|
||||
// print_job_->is_job_pending() may still be true, depending on the order
|
||||
@@ -876,7 +907,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -889,7 +920,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
|
||||
// Disconnect the current |print_job_|.
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -343,7 +344,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
if (!weak_this)
|
||||
return false;
|
||||
|
||||
@@ -899,8 +933,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -912,8 +946,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
/*source_id=*/"");
|
||||
#endif
|
||||
|
||||
@@ -352,7 +353,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
printing_succeeded_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -952,14 +984,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -965,14 +997,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
@@ -377,7 +378,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -998,7 +1038,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -1010,7 +1050,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
@@ -387,10 +388,10 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
||||
|
||||
if (!cookie) {
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113104ce49c 100644
|
||||
index c4bcf96d0ac0130a74a9b5400546dfdf335dbd68..eb946b1f599629f663b79d11039e853a5b013d29 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -38,6 +38,8 @@ class PrintJob;
|
||||
@@ -40,6 +40,8 @@ class PrintJob;
|
||||
class PrintQueriesQueue;
|
||||
class PrinterQuery;
|
||||
|
||||
@@ -399,7 +400,7 @@ index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113
|
||||
// Base class for managing the print commands for a WebContents.
|
||||
class PrintViewManagerBase : public content::NotificationObserver,
|
||||
public PrintManager {
|
||||
@@ -50,7 +52,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -62,7 +64,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// Prints the current document immediately. Since the rendering is
|
||||
// asynchronous, the actual printing will not be completed on the return of
|
||||
// this function. Returns false if printing is impossible at the moment.
|
||||
@@ -411,7 +412,7 @@ index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Prints the document in |print_data| with settings specified in
|
||||
@@ -237,9 +242,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -257,9 +262,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
content::RenderFrameHost* printing_rfh_ = nullptr;
|
||||
|
||||
@@ -441,7 +442,7 @@ index 51ebcb4ae399018d3fd8566656596a7ef1f148af..5f2b807fc364131f4c3e6a1646ec522d
|
||||
// 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 ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938fbad4cf5f 100644
|
||||
index c16d8984805619f1f1382e1e5b932771fcc0f44b..01c18d78221bbb7fa26638d778d4a7d33264d129 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -38,6 +38,7 @@
|
||||
@@ -452,7 +453,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
#include "printing/units.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
||||
@@ -1221,7 +1222,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1222,7 +1223,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
|
||||
@@ -462,7 +463,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
if (!weak_this)
|
||||
return;
|
||||
|
||||
@@ -1252,7 +1254,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1253,7 +1255,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
@@ -471,8 +472,8 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
@@ -1267,7 +1269,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// that instead.
|
||||
@@ -1268,7 +1270,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// plugin node and print that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
|
||||
- Print(frame, plugin, PrintRequestType::kRegular);
|
||||
@@ -480,7 +481,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
@@ -1298,7 +1300,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1299,7 +1301,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
}
|
||||
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
@@ -490,7 +491,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
if (!render_frame_gone_)
|
||||
print_preview_context_.DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1345,6 +1348,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
@@ -1346,6 +1349,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
|
||||
@@ -499,7 +500,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
if (print_preview_context_.IsForArc()) {
|
||||
@@ -1881,7 +1886,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1882,7 +1887,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
return;
|
||||
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
@@ -509,7 +510,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
// Check if |this| is still valid.
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -1896,7 +1902,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1897,7 +1903,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -520,7 +521,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1904,7 +1912,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1905,7 +1913,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
uint32_t expected_page_count = 0;
|
||||
@@ -529,7 +530,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1923,8 +1931,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1924,8 +1932,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -546,18 +547,52 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2172,7 +2187,9 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2173,36 +2188,51 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
}
|
||||
}
|
||||
|
||||
-bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
- mojom::PrintPagesParams settings;
|
||||
- settings.params = mojom::PrintParams::New();
|
||||
- GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params);
|
||||
+bool PrintRenderFrameHelper::InitPrintSettings(
|
||||
+ bool fit_to_paper_size,
|
||||
+ const base::DictionaryValue& new_settings) {
|
||||
mojom::PrintPagesParams settings;
|
||||
settings.params = mojom::PrintParams::New();
|
||||
GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params);
|
||||
@@ -2196,12 +2213,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
+ mojom::PrintPagesParamsPtr settings;
|
||||
+
|
||||
+ if (new_settings.DictEmpty()) {
|
||||
+ settings = mojom::PrintPagesParams::New();
|
||||
+ settings->params = mojom::PrintParams::New();
|
||||
+ GetPrintManagerHost()->GetDefaultPrintSettings(&settings->params);
|
||||
+ } else {
|
||||
+ bool canceled = false;
|
||||
+ int cookie =
|
||||
+ print_pages_params_ ? print_pages_params_->params->document_cookie : 0;
|
||||
+ GetPrintManagerHost()->UpdatePrintSettings(cookie, new_settings.Clone(), &settings, &canceled);
|
||||
+ if (canceled)
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
// 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.
|
||||
bool result = true;
|
||||
- if (!PrintMsg_Print_Params_IsValid(*settings.params))
|
||||
+ if (!PrintMsg_Print_Params_IsValid(*settings->params))
|
||||
result = false;
|
||||
|
||||
// Reset to default values.
|
||||
ignore_css_margins_ = false;
|
||||
- settings.pages.clear();
|
||||
+ settings->pages.clear();
|
||||
|
||||
- settings.params->print_scaling_option =
|
||||
+ settings->params->print_scaling_option =
|
||||
fit_to_paper_size ? mojom::PrintScalingOption::kFitToPrintableArea
|
||||
: mojom::PrintScalingOption::kSourceSize;
|
||||
|
||||
- SetPrintPagesParams(settings);
|
||||
+ SetPrintPagesParams(*settings);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -576,7 +611,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
||||
notify_browser_of_print_failure_ = false;
|
||||
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
|
||||
return false;
|
||||
@@ -2572,18 +2591,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) {
|
||||
@@ -2573,18 +2603,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) {
|
||||
}
|
||||
|
||||
bool PrintRenderFrameHelper::CheckForCancel() {
|
||||
@@ -638,22 +673,22 @@ index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519
|
||||
#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 744c3acfb9637aa64785dabd041ee416d56c3e43..9dadda9dfecdcf7826a3766064530a10126df66b 100644
|
||||
index cdfb2e0abd17b95bae4e1fd86aaf7364a76be1f6..446ae2060a27d6fa3d9b2f2691243369ad56f440 100644
|
||||
--- a/printing/printing_context.cc
|
||||
+++ b/printing/printing_context.cc
|
||||
@@ -115,7 +115,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
|
||||
@@ -116,7 +116,6 @@ mojom::ResultCode PrintingContext::UsePdfSettings() {
|
||||
|
||||
PrintingContext::Result PrintingContext::UpdatePrintSettings(
|
||||
mojom::ResultCode PrintingContext::UpdatePrintSettings(
|
||||
base::Value job_settings) {
|
||||
- ResetSettings();
|
||||
{
|
||||
std::unique_ptr<PrintSettings> settings =
|
||||
PrintSettingsFromJobSettings(job_settings);
|
||||
diff --git a/printing/printing_context.h b/printing/printing_context.h
|
||||
index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57ba5771a3b 100644
|
||||
index b28af89c67f88cc86f4604cd6204ca6231c5908c..cbfeb7234ba26f08ae3cddf6a6dd4014f04c4285 100644
|
||||
--- a/printing/printing_context.h
|
||||
+++ b/printing/printing_context.h
|
||||
@@ -149,6 +149,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
@@ -143,6 +143,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
|
||||
int job_id() const { return job_id_; }
|
||||
|
||||
@@ -663,7 +698,7 @@ index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57b
|
||||
protected:
|
||||
explicit PrintingContext(Delegate* delegate);
|
||||
|
||||
@@ -156,9 +159,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
@@ -150,9 +153,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
// implement this method to create an object of their implementation.
|
||||
static std::unique_ptr<PrintingContext> CreateImpl(Delegate* delegate);
|
||||
|
||||
@@ -671,5 +706,5 @@ index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57b
|
||||
- void ResetSettings();
|
||||
-
|
||||
// Does bookkeeping when an error occurs.
|
||||
PrintingContext::Result OnError();
|
||||
virtual mojom::ResultCode OnError();
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ index 0d7c1db6489d95a40c66808c3f838b0740e46ff6..eec994c4252f17d9c9c41e66d5dae650
|
||||
|
||||
#if defined(OS_MAC)
|
||||
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
|
||||
index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137fcf229cb 100644
|
||||
index 4547eb8563e1af57aad991d9d1e2cf02c778380a..a04d139f958a7aaef9b96e8c29317ccf7c97f009 100644
|
||||
--- a/chrome/browser/process_singleton_posix.cc
|
||||
+++ b/chrome/browser/process_singleton_posix.cc
|
||||
@@ -80,6 +80,7 @@
|
||||
@@ -139,7 +139,7 @@ index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137
|
||||
bool ConnectSocket(ScopedSocket* socket,
|
||||
const base::FilePath& socket_path,
|
||||
const base::FilePath& cookie_path) {
|
||||
@@ -728,6 +750,10 @@ ProcessSingleton::ProcessSingleton(
|
||||
@@ -729,6 +751,10 @@ ProcessSingleton::ProcessSingleton(
|
||||
|
||||
ProcessSingleton::~ProcessSingleton() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
@@ -150,8 +150,8 @@ index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137
|
||||
}
|
||||
|
||||
ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
||||
@@ -896,6 +922,20 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
|
||||
base::TimeDelta::FromSeconds(kTimeoutInSeconds));
|
||||
@@ -897,6 +923,20 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
|
||||
base::Seconds(kTimeoutInSeconds));
|
||||
}
|
||||
|
||||
+void ProcessSingleton::StartListeningOnSocket() {
|
||||
@@ -171,7 +171,7 @@ index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137
|
||||
ProcessSingleton::NotifyResult
|
||||
ProcessSingleton::NotifyOtherProcessWithTimeoutOrCreate(
|
||||
const base::CommandLine& command_line,
|
||||
@@ -998,12 +1038,26 @@ bool ProcessSingleton::Create() {
|
||||
@@ -999,14 +1039,32 @@ bool ProcessSingleton::Create() {
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -180,15 +180,15 @@ index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137
|
||||
- // do not support Unix domain sockets.
|
||||
- if (!socket_dir_.CreateUniqueTempDir()) {
|
||||
- LOG(ERROR) << "Failed to create socket directory.";
|
||||
- return false;
|
||||
+ base::FilePath tmp_dir;
|
||||
+ if (!base::GetTempDir(&tmp_dir)) {
|
||||
+ LOG(ERROR) << "Failed to get temporary directory.";
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (IsAppSandboxed()) {
|
||||
+ // For sandboxed applications, the tmp dir could be too long to fit
|
||||
+ // addr->sun_path, so we need to make it as short as possible.
|
||||
+ base::FilePath tmp_dir;
|
||||
+ if (!base::GetTempDir(&tmp_dir)) {
|
||||
+ LOG(ERROR) << "Failed to get temporary directory.";
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (!socket_dir_.Set(tmp_dir.Append("S"))) {
|
||||
+ LOG(ERROR) << "Failed to set socket directory.";
|
||||
+ return false;
|
||||
@@ -197,14 +197,19 @@ index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137
|
||||
+ // Create the socket file somewhere in /tmp which is usually mounted as a
|
||||
+ // normal filesystem. Some network filesystems (notably AFS) are screwy and
|
||||
+ // do not support Unix domain sockets.
|
||||
+ if (!socket_dir_.CreateUniqueTempDir()) {
|
||||
+ // Prefer CreateUniqueTempDirUnderPath rather than CreateUniqueTempDir as
|
||||
+ // the latter will calculate unique paths based on bundle ids which can
|
||||
+ // increase the socket path length than what is allowed.
|
||||
+ if (!socket_dir_.CreateUniqueTempDirUnderPath(tmp_dir)) {
|
||||
+ LOG(ERROR) << "Failed to create socket directory.";
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
// Check that the directory was created with the correct permissions.
|
||||
@@ -1045,10 +1099,13 @@ bool ProcessSingleton::Create() {
|
||||
int dir_mode = 0;
|
||||
CHECK(base::GetPosixFilePermissions(socket_dir_.GetPath(), &dir_mode) &&
|
||||
@@ -1046,10 +1104,13 @@ bool ProcessSingleton::Create() {
|
||||
if (listen(sock, 5) < 0)
|
||||
NOTREACHED() << "listen failed: " << base::safe_strerror(errno);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: proxy_config_monitor.patch
|
||||
Allow monitoring proxy config changes for a pref service.
|
||||
|
||||
diff --git a/chrome/browser/net/proxy_config_monitor.cc b/chrome/browser/net/proxy_config_monitor.cc
|
||||
index 55cc762b92193ed3f65b4d0b562202869530e1ac..d4c2a4e49eb469d3e2278fdc972c0aedc849d3f6 100644
|
||||
index 583ae4a36a5dae700a8e11767839e4d9a5c6e9b4..2510362a4df21fd57c56ec1f336589ccde86694c 100644
|
||||
--- a/chrome/browser/net/proxy_config_monitor.cc
|
||||
+++ b/chrome/browser/net/proxy_config_monitor.cc
|
||||
@@ -11,7 +11,9 @@
|
||||
@@ -42,7 +42,7 @@ index 55cc762b92193ed3f65b4d0b562202869530e1ac..d4c2a4e49eb469d3e2278fdc972c0aed
|
||||
|
||||
ProxyConfigMonitor::ProxyConfigMonitor(PrefService* local_state) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
|
||||
@@ -134,9 +138,11 @@ void ProxyConfigMonitor::OnLazyProxyConfigPoll() {
|
||||
@@ -133,9 +137,11 @@ void ProxyConfigMonitor::OnLazyProxyConfigPoll() {
|
||||
void ProxyConfigMonitor::OnPACScriptError(int32_t line_number,
|
||||
const std::string& details) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
@@ -54,7 +54,7 @@ index 55cc762b92193ed3f65b4d0b562202869530e1ac..d4c2a4e49eb469d3e2278fdc972c0aed
|
||||
}
|
||||
|
||||
void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
|
||||
@@ -150,9 +156,10 @@ void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
|
||||
@@ -149,9 +155,10 @@ void ProxyConfigMonitor::OnRequestMaybeFailedDueToProxySettings(
|
||||
// controlled.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8,13 +8,22 @@ 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/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
|
||||
index 37fe41cb525ebc19a32a592f5695f7a083135116..d70767e072799c15b5ee0c4eeb4c76d82dfb247c 100644
|
||||
index a8d95abb69da8d42aed26d3b215cc05d79ba676b..74fc4d9bb7f183765b05e94b7133599ccf714042 100644
|
||||
--- a/ui/native_theme/common_theme.cc
|
||||
+++ b/ui/native_theme/common_theme.cc
|
||||
@@ -68,6 +68,14 @@ absl::optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id,
|
||||
@@ -32,6 +32,7 @@ absl::optional<SkColor> GetHighContrastColor(
|
||||
NativeTheme::ColorScheme color_scheme) {
|
||||
switch (color_id) {
|
||||
case NativeTheme::kColorId_MenuSeparatorColor:
|
||||
+ case NativeTheme::kColorId_UnfocusedBorderColor:
|
||||
return color_scheme == NativeTheme::ColorScheme::kDark ? SK_ColorWHITE
|
||||
: SK_ColorBLACK;
|
||||
case NativeTheme::kColorId_FocusedBorderColor:
|
||||
@@ -53,6 +54,15 @@ absl::optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id,
|
||||
return gfx::kGoogleBlue400;
|
||||
|
||||
case NativeTheme::kColorId_MenuSeparatorColor:
|
||||
return gfx::kGoogleGrey800;
|
||||
+
|
||||
+ // Results Tables
|
||||
+ case NativeTheme::kColorId_ResultsTableNormalBackground:
|
||||
+ return SkColorSetRGB(0x28, 0x28, 0x28);
|
||||
@@ -23,10 +32,19 @@ index 37fe41cb525ebc19a32a592f5695f7a083135116..d70767e072799c15b5ee0c4eeb4c76d8
|
||||
+ case NativeTheme::kColorId_ResultsTableDimmedText:
|
||||
+ return SkColorSetA(base_theme->GetSystemColor(NativeTheme::kColorId_ResultsTableNormalText), 0x80);
|
||||
+
|
||||
// Button
|
||||
case NativeTheme::kColorId_ProminentButtonColor:
|
||||
return gfx::kGoogleBlue300;
|
||||
@@ -587,6 +595,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
|
||||
case NativeTheme::kColorId_WindowBackground:
|
||||
@@ -67,6 +77,8 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
|
||||
NativeTheme::ColorScheme color_scheme) {
|
||||
switch (color_id) {
|
||||
// Border
|
||||
+ case NativeTheme::kColorId_UnfocusedBorderColor:
|
||||
+ return gfx::kGoogleGrey300;
|
||||
case NativeTheme::kColorId_FocusedBorderColor:
|
||||
return gfx::kGoogleBlue500;
|
||||
|
||||
@@ -136,6 +148,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
|
||||
case NativeTheme::kColorId_WindowBackground:
|
||||
return SK_ColorWHITE;
|
||||
|
||||
@@ -46,26 +64,34 @@ index 37fe41cb525ebc19a32a592f5695f7a083135116..d70767e072799c15b5ee0c4eeb4c76d8
|
||||
// Keeping the kColorId_NumColors case instead of using the default case
|
||||
// allows ColorId additions to trigger compile error for an incomplete
|
||||
diff --git a/ui/native_theme/native_theme_color_id.h b/ui/native_theme/native_theme_color_id.h
|
||||
index 84848edbbe9de7ef9fe6e2ab0a34d3b9428cde10..5e07980e4793cc3b19140510fb3fd3b23c6a88ef 100644
|
||||
index a1b39a03776c287bc2b1f9a0a6ce11d0d9efde79..9132ff83b672b51c5f2f7ed95da877be7114c691 100644
|
||||
--- a/ui/native_theme/native_theme_color_id.h
|
||||
+++ b/ui/native_theme/native_theme_color_id.h
|
||||
@@ -157,6 +157,11 @@
|
||||
OP(kColorId_TableHeaderText), \
|
||||
OP(kColorId_TableHeaderBackground), \
|
||||
OP(kColorId_TableHeaderSeparator), \
|
||||
@@ -10,6 +10,7 @@
|
||||
#define NATIVE_THEME_CROSS_PLATFORM_COLOR_IDS \
|
||||
OP(kColorId_DefaultIconColor), \
|
||||
OP(kColorId_FocusedBorderColor), \
|
||||
+ OP(kColorId_UnfocusedBorderColor), \
|
||||
OP(kColorId_FocusedMenuItemBackgroundColor), \
|
||||
OP(kColorId_MenuBackgroundColor), \
|
||||
OP(kColorId_MenuIconColor), \
|
||||
@@ -20,6 +21,11 @@
|
||||
OP(kColorId_OverlayScrollbarThumbStroke), \
|
||||
OP(kColorId_ProminentButtonColor), \
|
||||
OP(kColorId_TextOnProminentButtonColor), \
|
||||
+ /* Results Tables, such as the omnibox */ \
|
||||
+ OP(kColorId_ResultsTableNormalBackground), \
|
||||
+ OP(kColorId_ResultsTableHoveredBackground), \
|
||||
+ OP(kColorId_ResultsTableNormalText), \
|
||||
+ OP(kColorId_ResultsTableDimmedText), \
|
||||
/* Colors for the material spinner (aka throbber). */ \
|
||||
OP(kColorId_ThrobberSpinningColor), \
|
||||
OP(kColorId_ThrobberWaitingColor), \
|
||||
OP(kColorId_WindowBackground)
|
||||
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
|
||||
index 485930b6875acc14f2fdd6e39632ae5d3d9f3904..f9772f86a1e233bbf3cc429e36dac8c62f61cd20 100644
|
||||
index 99256ffaf918e9d12a7c21b89d66cd41a0d29ac2..07852493fd23b8c1f057dc7ad830b6884db50a88 100644
|
||||
--- a/ui/native_theme/native_theme_win.cc
|
||||
+++ b/ui/native_theme/native_theme_win.cc
|
||||
@@ -658,6 +658,18 @@ absl::optional<SkColor> NativeThemeWin::GetPlatformHighContrastColor(
|
||||
@@ -623,10 +623,23 @@ absl::optional<SkColor> NativeThemeWin::GetPlatformHighContrastColor(
|
||||
case kColorId_ThrobberWaitingColor:
|
||||
return system_colors_[SystemThemeColor::kGrayText];
|
||||
|
||||
@@ -81,6 +107,11 @@ index 485930b6875acc14f2fdd6e39632ae5d3d9f3904..f9772f86a1e233bbf3cc429e36dac8c6
|
||||
+ return color_utils::AlphaBlend(system_colors_[SystemThemeColor::kWindowText],
|
||||
+ system_colors_[SystemThemeColor::kWindow], 0.5f);
|
||||
+
|
||||
// Button Background
|
||||
case kColorId_ButtonColor:
|
||||
case kColorId_MenuBackgroundColor:
|
||||
return system_colors_[SystemThemeColor::kButtonFace];
|
||||
|
||||
case kColorId_MenuSeparatorColor:
|
||||
+ case kColorId_UnfocusedBorderColor:
|
||||
case kColorId_FocusedBorderColor:
|
||||
return system_colors_[SystemThemeColor::kButtonText];
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ index f540ea381e9b80fd4a8e1e6a4fe4ed577396feb2..b7328fa53fa1c241dc90e9613b33a38c
|
||||
// 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 a1632e19959d163eecafef484204aa0dba919897..d7189a47e37a5ce2a48ffdb0685016aa0eeb200b 100644
|
||||
index 80b15389f7dcb946c9bb29359fa89f5d72f4e99b..725f32c4701f08226e76e4da22ad98d596c62547 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2012,6 +2012,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
|
||||
@@ -2019,6 +2019,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
|
||||
void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
|
||||
if (view_)
|
||||
view_->UpdateCursor(WebCursor(cursor));
|
||||
@@ -43,10 +43,10 @@ index a1632e19959d163eecafef484204aa0dba919897..d7189a47e37a5ce2a48ffdb0685016aa
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 5a86229bf1fc52e6cccbf609ed029fe88d35cd8f..ad1b4abe0390215e007ad2db8d972661470e94ed 100644
|
||||
index d3145c4dc21e6e47915a5b96224972f70b633fda..9d932b3d21dc74ef710d631ab43a348c45da5eb7 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4302,6 +4302,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -4313,6 +4313,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ index 5a86229bf1fc52e6cccbf609ed029fe88d35cd8f..ad1b4abe0390215e007ad2db8d972661
|
||||
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 2eaec6f5ddbc04f75207348e0f09e34c57a0c3b7..97e6ccbfbd58482299a831c63573890d1f7d46f3 100644
|
||||
index 35c04c52d80f1125e159dde1b9b8982d5b890503..289f4c08e16fd13ca4b28229549ac634313da70f 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -947,6 +947,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
@@ -949,6 +949,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
blink::mojom::FrameVisibility visibility) override;
|
||||
void SendScreenRects() override;
|
||||
TextInputManager* GetTextInputManager() override;
|
||||
@@ -71,7 +71,7 @@ index 2eaec6f5ddbc04f75207348e0f09e34c57a0c3b7..97e6ccbfbd58482299a831c63573890d
|
||||
bool IsShowingContextMenuOnPage() const override;
|
||||
void DidChangeScreenOrientation() override;
|
||||
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
|
||||
index 7132de463591a1bb3879be5147b6ecfead77f1b8..f205d4394c5ee5fac79fe7b99e7c54f01895cc73 100644
|
||||
index 6921e5e094cfdd4a813c11f152e4569f77bba6e6..ca2a5d211ab0f972f6ac3bfc957e4065543fbad0 100644
|
||||
--- a/content/public/browser/web_contents_observer.h
|
||||
+++ b/content/public/browser/web_contents_observer.h
|
||||
@@ -13,6 +13,7 @@
|
||||
@@ -82,7 +82,7 @@ index 7132de463591a1bb3879be5147b6ecfead77f1b8..f205d4394c5ee5fac79fe7b99e7c54f0
|
||||
#include "content/public/browser/allow_service_worker_result.h"
|
||||
#include "content/public/browser/reload_type.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
@@ -472,6 +473,9 @@ class CONTENT_EXPORT WebContentsObserver {
|
||||
@@ -484,6 +485,9 @@ class CONTENT_EXPORT WebContentsObserver {
|
||||
// Invoked every time the WebContents changes visibility.
|
||||
virtual void OnVisibilityChanged(Visibility visibility) {}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ should be removed as soon as those have been updated. Patching because
|
||||
every instance is a FTBFS that prevents testing any one instance's fix.
|
||||
|
||||
diff --git a/base/callback_helpers.h b/base/callback_helpers.h
|
||||
index 864296839c7131a42569de35bec72ad33adf3b25..20b3436d5f0129963d023a548d54bb9f168f5b65 100644
|
||||
index da876907836f0dbbd02a90ad7e0556304a9532cf..c3401f4cdd276e0f1b094b29753f37b10e72222d 100644
|
||||
--- a/base/callback_helpers.h
|
||||
+++ b/base/callback_helpers.h
|
||||
@@ -94,6 +94,22 @@ class OnceCallbackHolder final {
|
||||
|
||||
@@ -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 251157d2014be8aecb1a2554794257c43ae78dff..93adaa18da9a7c9d6a40c955c934810bde2394fc 100644
|
||||
index 97e76d6be1ccfcd26470bb6383d81d1b49f6c026..d7bcd8dabe2fe606568f238ba1aa8aa0b5b81270 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
|
||||
@@ -661,6 +661,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
|
||||
@@ -673,6 +673,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ index 251157d2014be8aecb1a2554794257c43ae78dff..93adaa18da9a7c9d6a40c955c934810b
|
||||
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 b3f79d5b38e10bf660f2a109ee1014ed24c54bbc..4cad83c43010f4d66fe9bc71d186b98b4fc0ffe9 100644
|
||||
index 3eb1f2f549305dacb437d856cdefcc80367ed9fa..d703e15a04160a1e8df231d395a2dfb54ee9c335 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -25,8 +25,10 @@
|
||||
@@ -50,7 +50,7 @@ index b3f79d5b38e10bf660f2a109ee1014ed24c54bbc..4cad83c43010f4d66fe9bc71d186b98b
|
||||
class WebCursor;
|
||||
class WebContentsAccessibility;
|
||||
class DelegatedFrameHost;
|
||||
@@ -143,6 +147,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
|
||||
@@ -145,6 +149,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
|
||||
const gfx::Rect& keyboard_rect) override {}
|
||||
bool IsHTMLFormPopup() const override;
|
||||
|
||||
@@ -60,7 +60,7 @@ index b3f79d5b38e10bf660f2a109ee1014ed24c54bbc..4cad83c43010f4d66fe9bc71d186b98b
|
||||
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
|
||||
// that handle content embedded within other RenderWidgetHostViews.
|
||||
gfx::PointF TransformPointToRootCoordSpaceF(
|
||||
@@ -305,6 +312,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
|
||||
@@ -304,6 +311,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
|
||||
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
|
||||
const ui::LatencyInfo& latency);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`.
|
||||
Additionally, disables usage of some private APIs in MAS builds.
|
||||
|
||||
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
|
||||
index 7a8e4653a0a962730ad5b5895cfbab8d2db92f24..0e139a88b7c6f341e1f7bc60c81378f53de830d8 100644
|
||||
index 881b0fda3c15db42a6ad68c011c6952147bdaa1d..46e3f1e16093683c5d0205134c2ef9246e99e730 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
|
||||
@@ -150,6 +150,15 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
@@ -61,7 +61,7 @@ index 7a8e4653a0a962730ad5b5895cfbab8d2db92f24..0e139a88b7c6f341e1f7bc60c81378f5
|
||||
// We only handle key down events and just simply forward other events.
|
||||
if (eventType != NSKeyDown) {
|
||||
_hostHelper->ForwardKeyboardEvent(event, latency_info);
|
||||
@@ -1692,9 +1712,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
@@ -1693,9 +1713,11 @@ - (NSAccessibilityRole)accessibilityRole {
|
||||
// Since this implementation doesn't have to wait any IPC calls, this doesn't
|
||||
// make any key-typing jank. --hbono 7/23/09
|
||||
//
|
||||
@@ -73,7 +73,7 @@ index 7a8e4653a0a962730ad5b5895cfbab8d2db92f24..0e139a88b7c6f341e1f7bc60c81378f5
|
||||
|
||||
- (NSArray*)validAttributesForMarkedText {
|
||||
// This code is just copied from WebKit except renaming variables.
|
||||
@@ -1703,7 +1725,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
@@ -1704,7 +1726,10 @@ - (NSArray*)validAttributesForMarkedText {
|
||||
initWithObjects:NSUnderlineStyleAttributeName,
|
||||
NSUnderlineColorAttributeName,
|
||||
NSMarkedClauseSegmentAttributeName,
|
||||
|
||||
@@ -52,10 +52,10 @@ Some alternatives to this patch:
|
||||
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
|
||||
|
||||
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
||||
index 8078897ba61cf9da717254727a8f97b6772d1cc6..abab9c8e8c60a6d1690acca5133b3c54d0ccc793 100644
|
||||
index 77bcd0dd7ddddfea030d71c31956f873d4ac778a..5a35396df314ab547990a53c90ebb75d337bcc77 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1543,7 +1543,7 @@ if (is_chrome_branded && !is_android) {
|
||||
@@ -1549,7 +1549,7 @@ if (is_chrome_branded && !is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index 8078897ba61cf9da717254727a8f97b6772d1cc6..abab9c8e8c60a6d1690acca5133b3c54
|
||||
chrome_paks("packed_resources") {
|
||||
if (is_mac) {
|
||||
output_dir = "$root_gen_dir/repack"
|
||||
@@ -1571,6 +1571,12 @@ if (!is_android) {
|
||||
@@ -1577,6 +1577,12 @@ if (!is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user