mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
42 Commits
v21.0.0-ni
...
v21.0.0-ni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c2ec2280e | ||
|
|
de1cec8693 | ||
|
|
99c2706376 | ||
|
|
63593ffb22 | ||
|
|
b0c6fb5152 | ||
|
|
77b4aab720 | ||
|
|
7c2ed98214 | ||
|
|
62001dc6cb | ||
|
|
ff804e3a74 | ||
|
|
9416091180 | ||
|
|
6d9e8b65bc | ||
|
|
b42fd1ddca | ||
|
|
182ab9ad76 | ||
|
|
77e1a046ec | ||
|
|
0be73d18ef | ||
|
|
c842f63383 | ||
|
|
6674082041 | ||
|
|
cabfb8507d | ||
|
|
aa40652456 | ||
|
|
dd68fae081 | ||
|
|
ad1bbc198b | ||
|
|
2c51a81e85 | ||
|
|
648c9934c0 | ||
|
|
aeba6ca973 | ||
|
|
49302e4a2f | ||
|
|
57c265198e | ||
|
|
08dd38d9be | ||
|
|
dd82a26e95 | ||
|
|
3c63f075bd | ||
|
|
fec4cca8d4 | ||
|
|
1ed191114a | ||
|
|
d4e97483aa | ||
|
|
7ae3025fd5 | ||
|
|
67eda4bcc8 | ||
|
|
9f0e7126c4 | ||
|
|
be7f90481d | ||
|
|
6dc1218c37 | ||
|
|
cffcd0d47a | ||
|
|
9e0a3c44dd | ||
|
|
1b96a3aa1d | ||
|
|
3c7d446fad | ||
|
|
60b6e74e3f |
@@ -1006,9 +1006,17 @@ steps-electron-gn-check: &steps-electron-gn-check
|
||||
- *step-generate-deps-hash
|
||||
- *step-touch-sync-done
|
||||
- maybe-restore-portaled-src-cache
|
||||
- *step-wait-for-goma
|
||||
- *step-gn-gen-default
|
||||
- *step-gn-check
|
||||
- run:
|
||||
name: Ensure src checkout worked
|
||||
command: |
|
||||
if [ ! -d "src/third_party/blink" ]; then
|
||||
echo src cache was not restored for an unknown reason
|
||||
exit 1
|
||||
fi
|
||||
- run:
|
||||
name: Wipe Electron
|
||||
command: rm -rf src/electron
|
||||
- *step-checkout-electron
|
||||
|
||||
steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
|
||||
steps:
|
||||
|
||||
4
BUILD.gn
4
BUILD.gn
@@ -390,6 +390,7 @@ source_set("electron_lib") {
|
||||
"//components/user_prefs",
|
||||
"//components/viz/host",
|
||||
"//components/viz/service",
|
||||
"//components/webrtc",
|
||||
"//content/public/browser",
|
||||
"//content/public/child",
|
||||
"//content/public/gpu",
|
||||
@@ -565,8 +566,9 @@ source_set("electron_lib") {
|
||||
"//ui/base/ime/linux",
|
||||
"//ui/events/devices/x11",
|
||||
"//ui/events/platform/x11",
|
||||
"//ui/linux:linux_ui",
|
||||
"//ui/linux:linux_ui_factory",
|
||||
"//ui/views/controls/webview",
|
||||
"//ui/views/linux_ui:linux_ui_factory",
|
||||
"//ui/wm",
|
||||
]
|
||||
if (ozone_platform_x11) {
|
||||
|
||||
4
DEPS
4
DEPS
@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'105.0.5173.0',
|
||||
'105.0.5187.0',
|
||||
'node_version':
|
||||
'v16.15.1',
|
||||
'v16.16.0',
|
||||
'nan_version':
|
||||
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
|
||||
'squirrel.mac_version':
|
||||
|
||||
@@ -1 +1 @@
|
||||
21.0.0-nightly.20220719
|
||||
21.0.0-nightly.20220728
|
||||
@@ -170,19 +170,16 @@ build_script:
|
||||
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
|
||||
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
|
||||
- 7z a node_headers.zip out\Default\gen\node_headers
|
||||
# Temporarily disable symbol generation on 32-bit Windows due to failures
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release' -And $env:TARGET_ARCH -ne 'ia32') {
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
# Needed for msdia140.dll on 64-bit windows
|
||||
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
|
||||
ninja -C out/Default electron:electron_symbols
|
||||
}
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
if ($env:TARGET_ARCH -ne 'ia32') {
|
||||
python electron\script\zip-symbols.py
|
||||
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
|
||||
}
|
||||
python electron\script\zip-symbols.py
|
||||
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
|
||||
} else {
|
||||
# It's useful to have pdb files when debugging testing builds that are
|
||||
# built on CI.
|
||||
|
||||
@@ -1,33 +1,22 @@
|
||||
import("node.gni")
|
||||
template("node_action") {
|
||||
assert(defined(invoker.script), "Need script path to run")
|
||||
assert(defined(invoker.args), "Need script arguments")
|
||||
|
||||
# TODO(MarshallOfSound): Move to electron/node, this is the only place it is used now
|
||||
# Run an action with a given working directory. Behaves identically to the
|
||||
# action() target type, with the exception that it changes directory before
|
||||
# running the script.
|
||||
#
|
||||
# Parameters:
|
||||
# cwd [required]: Directory to change to before running the script.
|
||||
template("chdir_action") {
|
||||
action(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
"*",
|
||||
[
|
||||
"script",
|
||||
"args",
|
||||
"deps",
|
||||
"public_deps",
|
||||
"sources",
|
||||
"inputs",
|
||||
"outputs",
|
||||
])
|
||||
assert(defined(cwd), "Need cwd in $target_name")
|
||||
script = "//electron/build/run-in-dir.py"
|
||||
if (defined(sources)) {
|
||||
sources += [ invoker.script ]
|
||||
} else {
|
||||
assert(defined(inputs))
|
||||
inputs += [ invoker.script ]
|
||||
if (!defined(inputs)) {
|
||||
inputs = []
|
||||
}
|
||||
args = [
|
||||
rebase_path(cwd),
|
||||
rebase_path(invoker.script),
|
||||
]
|
||||
args += invoker.args
|
||||
inputs += [ invoker.script ]
|
||||
script = "//electron/build/run-node.py"
|
||||
args = [ rebase_path(invoker.script) ] + invoker.args
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,11 @@ template("extract_symbols") {
|
||||
assert(defined(invoker.binary), "Need binary to dump")
|
||||
assert(defined(invoker.symbol_dir), "Need directory for symbol output")
|
||||
|
||||
dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
|
||||
if (host_os == "win" && target_cpu == "x86") {
|
||||
dump_syms_label = "//third_party/breakpad:dump_syms(//build/toolchain/win:win_clang_x64)"
|
||||
} else {
|
||||
dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
|
||||
}
|
||||
dump_syms_binary = get_label_info(dump_syms_label, "root_out_dir") +
|
||||
"/dump_syms$_host_executable_suffix"
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
template("node_action") {
|
||||
assert(defined(invoker.script), "Need script path to run")
|
||||
assert(defined(invoker.args), "Need script arguments")
|
||||
|
||||
action(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"deps",
|
||||
"public_deps",
|
||||
"sources",
|
||||
"inputs",
|
||||
"outputs",
|
||||
])
|
||||
if (!defined(inputs)) {
|
||||
inputs = []
|
||||
}
|
||||
inputs += [ invoker.script ]
|
||||
script = "//electron/build/run-node.py"
|
||||
args = [ rebase_path(invoker.script) ] + invoker.args
|
||||
}
|
||||
}
|
||||
@@ -130,6 +130,11 @@ set `NSPrincipalClass` to `AtomApplication`.
|
||||
|
||||
You should call `event.preventDefault()` if you want to handle this event.
|
||||
|
||||
As with the `open-file` event, be sure to register a listener for the `open-url`
|
||||
event early in your application startup to detect if the the application being
|
||||
is being opened to handle a URL. If you register the listener in response to a
|
||||
`ready` event, you'll miss URLs that trigger the launch of your application.
|
||||
|
||||
### Event: 'activate' _macOS_
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -149,7 +149,7 @@ console.log(image)
|
||||
* `options` Object
|
||||
* `width` Integer
|
||||
* `height` Integer
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `NativeImage`
|
||||
|
||||
@@ -162,7 +162,7 @@ pixel data returned by `toBitmap()`. The specific format is platform-dependent.
|
||||
* `options` Object (optional)
|
||||
* `width` Integer (optional) - Required for bitmap buffers.
|
||||
* `height` Integer (optional) - Required for bitmap buffers.
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `NativeImage`
|
||||
|
||||
@@ -225,7 +225,7 @@ The following methods are available on instances of the `NativeImage` class:
|
||||
#### `image.toPNG([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's `PNG` encoded data.
|
||||
|
||||
@@ -238,7 +238,7 @@ Returns `Buffer` - A [Buffer][buffer] that contains the image's `JPEG` encoded d
|
||||
#### `image.toBitmap([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains a copy of the image's raw bitmap pixel
|
||||
data.
|
||||
@@ -246,14 +246,14 @@ data.
|
||||
#### `image.toDataURL([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `string` - The data URL of the image.
|
||||
|
||||
#### `image.getBitmap([options])`
|
||||
|
||||
* `options` Object (optional)
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.
|
||||
|
||||
@@ -276,7 +276,7 @@ Returns `boolean` - Whether the image is empty.
|
||||
|
||||
#### `image.getSize([scaleFactor])`
|
||||
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns [`Size`](structures/size.md).
|
||||
|
||||
@@ -317,20 +317,20 @@ will be preserved in the resized image.
|
||||
|
||||
#### `image.getAspectRatio([scaleFactor])`
|
||||
|
||||
* `scaleFactor` Double (optional) - Defaults to 1.0.
|
||||
* `scaleFactor` Number (optional) - Defaults to 1.0.
|
||||
|
||||
Returns `Float` - The image's aspect ratio.
|
||||
Returns `Number` - The image's aspect ratio.
|
||||
|
||||
If `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.
|
||||
|
||||
#### `image.getScaleFactors()`
|
||||
|
||||
Returns `Float[]` - An array of all scale factors corresponding to representations for a given nativeImage.
|
||||
Returns `Number[]` - An array of all scale factors corresponding to representations for a given nativeImage.
|
||||
|
||||
#### `image.addRepresentation(options)`
|
||||
|
||||
* `options` Object
|
||||
* `scaleFactor` Double - The scale factor to add the image representation for.
|
||||
* `scaleFactor` Number (optional) - The scale factor to add the image representation for.
|
||||
* `width` Integer (optional) - Defaults to 0. Required if a bitmap buffer
|
||||
is specified as `buffer`.
|
||||
* `height` Integer (optional) - Defaults to 0. Required if a bitmap buffer
|
||||
|
||||
@@ -47,10 +47,10 @@ $ sudo yum install clang dbus-devel gtk3-devel libnotify-devel \
|
||||
On Fedora, install the following libraries:
|
||||
|
||||
```sh
|
||||
$ sudo dnf install clang dbus-devel gtk3-devel libnotify-devel \
|
||||
libgnome-keyring-devel xorg-x11-server-utils libcap-devel \
|
||||
$ sudo dnf install clang dbus-devel gperf gtk3-devel \
|
||||
libnotify-devel libgnome-keyring-devel libcap-devel \
|
||||
cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \
|
||||
nss-devel python-dbusmock openjdk-8-jre
|
||||
nss-devel python-dbusmock
|
||||
```
|
||||
|
||||
On Arch Linux / Manjaro, install the following libraries:
|
||||
|
||||
@@ -66,6 +66,7 @@ Are you getting stuck anywhere? Here are a few links to places to look:
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[tutorial]: tutorial-1-prerequisites.md
|
||||
[api documentation]: ../api/app.md
|
||||
[chromium]: https://www.chromium.org/
|
||||
[discord]: https://discord.gg/electronjs
|
||||
|
||||
@@ -23,6 +23,7 @@ filenames = {
|
||||
|
||||
lib_sources_linux = [
|
||||
"shell/browser/browser_linux.cc",
|
||||
"shell/browser/electron_browser_main_parts_linux.cc",
|
||||
"shell/browser/lib/power_observer_linux.cc",
|
||||
"shell/browser/lib/power_observer_linux.h",
|
||||
"shell/browser/linux/unity_service.cc",
|
||||
@@ -415,8 +416,6 @@ filenames = {
|
||||
"shell/browser/media/media_capture_devices_dispatcher.h",
|
||||
"shell/browser/media/media_device_id_salt.cc",
|
||||
"shell/browser/media/media_device_id_salt.h",
|
||||
"shell/browser/media/media_stream_devices_controller.cc",
|
||||
"shell/browser/media/media_stream_devices_controller.h",
|
||||
"shell/browser/microtasks_runner.cc",
|
||||
"shell/browser/microtasks_runner.h",
|
||||
"shell/browser/native_browser_view.cc",
|
||||
|
||||
@@ -124,13 +124,6 @@ WebContents.prototype.sendToFrame = function (frameId, channel, ...args) {
|
||||
return true;
|
||||
};
|
||||
|
||||
WebContents.prototype._sendToFrameInternal = function (frameId, channel, ...args) {
|
||||
const frame = getWebFrame(this, frameId);
|
||||
if (!frame) return false;
|
||||
frame._sendInternal(channel, ...args);
|
||||
return true;
|
||||
};
|
||||
|
||||
// Following methods are mapped to webFrame.
|
||||
const webFrameMethods = [
|
||||
'insertCSS',
|
||||
|
||||
@@ -7,7 +7,7 @@ import { webViewEvents } from '@electron/internal/browser/web-view-events';
|
||||
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
|
||||
|
||||
interface GuestInstance {
|
||||
elementInstanceId?: number;
|
||||
elementInstanceId: number;
|
||||
visibilityState?: VisibilityState;
|
||||
embedder: Electron.WebContents;
|
||||
guest: Electron.WebContents;
|
||||
@@ -46,6 +46,7 @@ function makeWebPreferences (embedder: Electron.WebContents, params: Record<stri
|
||||
webSecurity: !params.disablewebsecurity,
|
||||
enableBlinkFeatures: params.blinkfeatures,
|
||||
disableBlinkFeatures: params.disableblinkfeatures,
|
||||
partition: params.partition,
|
||||
...parsedWebPreferences
|
||||
};
|
||||
|
||||
@@ -87,14 +88,26 @@ function makeLoadURLOptions (params: Record<string, any>) {
|
||||
|
||||
// Create a new guest instance.
|
||||
const createGuest = function (embedder: Electron.WebContents, embedderFrameId: number, elementInstanceId: number, params: Record<string, any>) {
|
||||
const webPreferences = makeWebPreferences(embedder, params);
|
||||
const event = eventBinding.createWithSender(embedder);
|
||||
|
||||
const { instanceId } = params;
|
||||
|
||||
embedder.emit('will-attach-webview', event, webPreferences, params);
|
||||
if (event.defaultPrevented) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
const guest = (webContents as typeof ElectronInternal.WebContents).create({
|
||||
...webPreferences,
|
||||
type: 'webview',
|
||||
partition: params.partition,
|
||||
embedder
|
||||
});
|
||||
|
||||
const guestInstanceId = guest.id;
|
||||
guestInstances.set(guestInstanceId, {
|
||||
elementInstanceId,
|
||||
guest,
|
||||
embedder
|
||||
});
|
||||
@@ -108,11 +121,8 @@ const createGuest = function (embedder: Electron.WebContents, embedderFrameId: n
|
||||
|
||||
// Init guest web view after attached.
|
||||
guest.once('did-attach' as any, function (this: Electron.WebContents, event: Electron.Event) {
|
||||
const params = this.attachParams!;
|
||||
delete this.attachParams;
|
||||
|
||||
const previouslyAttached = this.viewInstanceId != null;
|
||||
this.viewInstanceId = params.instanceId;
|
||||
this.viewInstanceId = instanceId;
|
||||
|
||||
// Only load URL and set size on first attach
|
||||
if (previouslyAttached) {
|
||||
@@ -120,7 +130,7 @@ const createGuest = function (embedder: Electron.WebContents, embedderFrameId: n
|
||||
}
|
||||
|
||||
if (params.src) {
|
||||
this.loadURL(params.src, params.opts);
|
||||
this.loadURL(params.src, makeLoadURLOptions(params));
|
||||
}
|
||||
embedder.emit('did-attach-webview', event, guest);
|
||||
});
|
||||
@@ -173,78 +183,25 @@ const createGuest = function (embedder: Electron.WebContents, embedderFrameId: n
|
||||
}
|
||||
});
|
||||
|
||||
if (attachGuest(embedder, embedderFrameId, elementInstanceId, guestInstanceId, params)) {
|
||||
return guestInstanceId;
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
||||
|
||||
// Attach the guest to an element of embedder.
|
||||
const attachGuest = function (embedder: Electron.WebContents, embedderFrameId: number, elementInstanceId: number, guestInstanceId: number, params: Record<string, any>) {
|
||||
// Destroy the old guest when attaching.
|
||||
const key = `${embedder.id}-${elementInstanceId}`;
|
||||
const oldGuestInstanceId = embedderElementsMap.get(key);
|
||||
if (oldGuestInstanceId != null) {
|
||||
// Reattachment to the same guest is just a no-op.
|
||||
if (oldGuestInstanceId === guestInstanceId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const oldGuestInstance = guestInstances.get(oldGuestInstanceId);
|
||||
if (oldGuestInstance) {
|
||||
oldGuestInstance.guest.detachFromOuterFrame();
|
||||
}
|
||||
}
|
||||
|
||||
const guestInstance = guestInstances.get(guestInstanceId);
|
||||
// If this isn't a valid guest instance then do nothing.
|
||||
if (!guestInstance) {
|
||||
console.error(new Error(`Guest attach failed: Invalid guestInstanceId ${guestInstanceId}`));
|
||||
return false;
|
||||
}
|
||||
const { guest } = guestInstance;
|
||||
if (guest.hostWebContents !== embedder) {
|
||||
console.error(new Error(`Guest attach failed: Access denied to guestInstanceId ${guestInstanceId}`));
|
||||
return false;
|
||||
}
|
||||
|
||||
const { instanceId } = params;
|
||||
|
||||
// If this guest is already attached to an element then remove it
|
||||
if (guestInstance.elementInstanceId) {
|
||||
const oldKey = `${guestInstance.embedder.id}-${guestInstance.elementInstanceId}`;
|
||||
embedderElementsMap.delete(oldKey);
|
||||
|
||||
// Remove guest from embedder if moving across web views
|
||||
if (guest.viewInstanceId !== instanceId) {
|
||||
webViewManager.removeGuest(guestInstance.embedder, guestInstanceId);
|
||||
guestInstance.embedder._sendInternal(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DESTROY_GUEST}-${guest.viewInstanceId}`);
|
||||
}
|
||||
}
|
||||
|
||||
const webPreferences = makeWebPreferences(embedder, params);
|
||||
|
||||
const event = eventBinding.createWithSender(embedder);
|
||||
embedder.emit('will-attach-webview', event, webPreferences, params);
|
||||
if (event.defaultPrevented) {
|
||||
if (guest.viewInstanceId == null) guest.viewInstanceId = instanceId;
|
||||
guest.destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
guest.attachParams = { instanceId, src: params.src, opts: makeLoadURLOptions(params) };
|
||||
embedderElementsMap.set(key, guestInstanceId);
|
||||
|
||||
guest.setEmbedder(embedder);
|
||||
guestInstance.embedder = embedder;
|
||||
guestInstance.elementInstanceId = elementInstanceId;
|
||||
|
||||
watchEmbedder(embedder);
|
||||
|
||||
webViewManager.addGuest(guestInstanceId, embedder, guest, webPreferences);
|
||||
guest.attachToIframe(embedder, embedderFrameId);
|
||||
return true;
|
||||
|
||||
return guestInstanceId;
|
||||
};
|
||||
|
||||
// Remove an guest-embedder relationship.
|
||||
|
||||
@@ -9,7 +9,6 @@ export const enum IPC_MESSAGES {
|
||||
|
||||
GUEST_INSTANCE_VISIBILITY_CHANGE = 'GUEST_INSTANCE_VISIBILITY_CHANGE',
|
||||
|
||||
GUEST_VIEW_INTERNAL_DESTROY_GUEST = 'GUEST_VIEW_INTERNAL_DESTROY_GUEST',
|
||||
GUEST_VIEW_INTERNAL_DISPATCH_EVENT = 'GUEST_VIEW_INTERNAL_DISPATCH_EVENT',
|
||||
|
||||
GUEST_VIEW_MANAGER_CREATE_AND_ATTACH_GUEST = 'GUEST_VIEW_MANAGER_CREATE_AND_ATTACH_GUEST',
|
||||
|
||||
@@ -6,22 +6,15 @@ const { mainFrame: webFrame } = process._linkedBinding('electron_renderer_web_fr
|
||||
|
||||
export interface GuestViewDelegate {
|
||||
dispatchEvent (eventName: string, props: Record<string, any>): void;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
export function registerEvents (viewInstanceId: number, delegate: GuestViewDelegate) {
|
||||
ipcRendererInternal.on(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DESTROY_GUEST}-${viewInstanceId}`, function () {
|
||||
delegate.reset();
|
||||
delegate.dispatchEvent('destroyed', {});
|
||||
});
|
||||
|
||||
ipcRendererInternal.on(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DISPATCH_EVENT}-${viewInstanceId}`, function (event, eventName, props) {
|
||||
delegate.dispatchEvent(eventName, props);
|
||||
});
|
||||
}
|
||||
|
||||
export function deregisterEvents (viewInstanceId: number) {
|
||||
ipcRendererInternal.removeAllListeners(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DESTROY_GUEST}-${viewInstanceId}`);
|
||||
ipcRendererInternal.removeAllListeners(`${IPC_MESSAGES.GUEST_VIEW_INTERNAL_DISPATCH_EVENT}-${viewInstanceId}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,8 +55,7 @@ const defineWebViewElement = (hooks: WebViewImplHooks) => {
|
||||
}
|
||||
if (!internal.elementAttached) {
|
||||
hooks.guestViewInternal.registerEvents(internal.viewInstanceId, {
|
||||
dispatchEvent: internal.dispatchEvent.bind(internal),
|
||||
reset: internal.reset.bind(internal)
|
||||
dispatchEvent: internal.dispatchEvent.bind(internal)
|
||||
});
|
||||
internal.elementAttached = true;
|
||||
(internal.attributes.get(WEB_VIEW_CONSTANTS.ATTRIBUTE_SRC) as SrcAttribute).parse();
|
||||
|
||||
@@ -191,7 +191,7 @@ export class WebViewImpl {
|
||||
|
||||
attachGuestInstance (guestInstanceId: number) {
|
||||
if (guestInstanceId === -1) {
|
||||
// Do nothing
|
||||
this.dispatchEvent('destroyed');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "21.0.0-nightly.20220719",
|
||||
"version": "21.0.0-nightly.20220728",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -112,3 +112,5 @@ custom_protocols_plzserviceworker.patch
|
||||
feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
|
||||
fix_allow_guest_webcontents_to_enter_fullscreen.patch
|
||||
disable_freezing_flags_after_init_in_node.patch
|
||||
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
|
||||
chore_add_electron_deps_to_gitignores.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ 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 ff57e2a67ccc37be912ba3fca9df4b9e28898c6e..0045b3c1b89728e3950929b49e15bbc67a826c02 100644
|
||||
index b692a49b71661b8394c1126250fb150653aece97..c087c0f99a15edd3a9c776a68c76b2cf46257123 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
|
||||
|
||||
@@ -23,10 +23,10 @@ index 5a7d3da58451f491ed6dfabd3bc31a645843bb60..36cbf8c5c01330acc8b3a708bd6481ed
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index eaf9a9483d89cd47bef63ff7f2868c0174a3c3bb..19bd5ef930bc094b315d2562c0f4917e78f63bad 100644
|
||||
index 4a69ce45890fd9ab730eef460396ab495b7a332a..3e186230715aaf840959a93038167749e3735a08 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4397,6 +4397,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4435,6 +4435,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index eaf9a9483d89cd47bef63ff7f2868c0174a3c3bb..19bd5ef930bc094b315d2562c0f4917e
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index feca00f2e36d1c02be5e56e787ea8f67eab45df6..9a4c57ddb3aebff2365ea7563803b169c7787c5e 100644
|
||||
index 351a3a257a3eca98c4a2caf724714cbc788b5d72..73dbb5a289411ea32f06cb1ea50ef98153923101 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -605,6 +605,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -606,6 +606,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
uint32_t ng_call_count) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index feca00f2e36d1c02be5e56e787ea8f67eab45df6..9a4c57ddb3aebff2365ea7563803b169
|
||||
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 9e2dc9b2ea07a1f9bdfd92284f73dd1977ea1437..18c07f44196e83cf16cace6863e3db368a86ce0d 100644
|
||||
index acb427e4a6688f14f4a6ceaec8bf3988525c5e08..35623174f16399d5fff637a07554e43c55f902d1 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -605,6 +605,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -606,6 +606,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -67,10 +67,10 @@ index 9e2dc9b2ea07a1f9bdfd92284f73dd1977ea1437..18c07f44196e83cf16cace6863e3db36
|
||||
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
index a6ba8411384855c82712960375bc949c5c2bd522..fc86ca807c9c1bda9236160580b094153778e18b 100644
|
||||
index c8af53d40eaa1dd3a0067948a8cda80d1599cee3..4de918ee52efa7ec27a21aa2f57616d31dfd07d1 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
||||
@@ -207,6 +207,7 @@ void LocalWindowProxy::Initialize() {
|
||||
@@ -209,6 +209,7 @@ void LocalWindowProxy::Initialize() {
|
||||
}
|
||||
|
||||
InstallConditionalFeatures();
|
||||
@@ -123,10 +123,10 @@ index c95ef4a4a3f9d40e0e4bedf6fc42225190626c42..36cc932782437b9f5d301416f5a4e8f4
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
index 6b4142bf7f85c64af6f845613568679276c7e698..21462bb2196b353c32cf05d0c53635ac77673567 100644
|
||||
index d44adfd65bd9a71996cdd323a5220d2dcaa09de2..1011a318a7d79186abe556d03f78badc725c802a 100644
|
||||
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
||||
@@ -359,6 +359,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
@@ -366,6 +366,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
||||
|
||||
void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) override {}
|
||||
|
||||
@@ -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 1f6d9be10432416f591a616805494b5d78975df1..e73f70c62ac2e69c918bdf39bd53f74a47066f4e 100644
|
||||
index 261e1dda1e128e22d15f3454f9012265db45bd74..98b130f0791d1ca2d59ef62151df7e60f3f40831 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -665,6 +665,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -666,6 +666,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ index 39bfc2200e924d0c589cfd07f085f182ef6853a6..bddff6d5ad3f6d08c4dc48e66ebc5319
|
||||
+ SetSchedulerThrottling(bool allowed);
|
||||
};
|
||||
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
|
||||
index 99f0ceb45972df14813b72300e6a59710f13597f..f5e15865bf0bad73d9505698e788c1e954f46c2c 100644
|
||||
index b01562ebe042bd23e7b5184aa28bb42f98f81ecb..5392b5ac0f95eab7fef3c59fd2e9b2dc2cfb7342 100644
|
||||
--- a/third_party/blink/public/web/web_view.h
|
||||
+++ b/third_party/blink/public/web/web_view.h
|
||||
@@ -361,6 +361,7 @@ class WebView {
|
||||
@@ -85,10 +85,10 @@ index 99f0ceb45972df14813b72300e6a59710f13597f..f5e15865bf0bad73d9505698e788c1e9
|
||||
// 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 96d329c005ad74f2409c42d2ef8e62b28a18174d..3e28873ed5181756ab62e14ca9c2c4b27b4378f1 100644
|
||||
index 390e47422a0a106d0e5746c0af0611d420af8025..9151815e6bf33a3a6980f8337f578dc90e458696 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -3723,6 +3723,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3742,6 +3742,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ index 96d329c005ad74f2409c42d2ef8e62b28a18174d..3e28873ed5181756ab62e14ca9c2c4b2
|
||||
void WebViewImpl::SetVisibilityState(
|
||||
mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) {
|
||||
@@ -3734,7 +3741,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
@@ -3753,7 +3760,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
}
|
||||
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
|
||||
GetPage()->GetPageScheduler()->SetPageVisible(
|
||||
@@ -113,7 +113,7 @@ index 96d329c005ad74f2409c42d2ef8e62b28a18174d..3e28873ed5181756ab62e14ca9c2c4b2
|
||||
|
||||
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
index 6a36275fdd7ac12f91a40b60284b73fc93679749..f264c5ee5c2c38d4ccf15877accfdc31c48ec9f9 100644
|
||||
index ce3a483a4c06dc56a8a71d32d4d4a7077d524c2e..1cab34e52858808bceb52556c7ad0bbaa7584225 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
|
||||
@@ -417,6 +417,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: Allow setting secondary label via SimpleMenuModel
|
||||
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
|
||||
|
||||
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
|
||||
index a787411f89e2d95e2fa636a7cc6723bdd227e563..f8c67d10957c26fbcd21fa1fe05507efd78f1c29 100644
|
||||
index 20a3b1efcb52be5e10dc184df620ec8102f2aff3..dfebc65b2ce180e4cd175ab8d09ad7e16f6b8df5 100644
|
||||
--- a/ui/base/models/simple_menu_model.cc
|
||||
+++ b/ui/base/models/simple_menu_model.cc
|
||||
@@ -53,6 +53,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId(
|
||||
@@ -47,7 +47,7 @@ index a787411f89e2d95e2fa636a7cc6723bdd227e563..f8c67d10957c26fbcd21fa1fe05507ef
|
||||
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 bd2ebaf9f84946c708eba13c18869afadd2fdbb0..880d6f12ad188c5f8abf037b3b8d27fcf1fc2cb6 100644
|
||||
index eadda341710f3a2e35f0e5c6aeb65a0dcc7bf0dd..2a7cbfa33702b9a5b89d1e69d5e8d0af83735bd7 100644
|
||||
--- a/ui/base/models/simple_menu_model.h
|
||||
+++ b/ui/base/models/simple_menu_model.h
|
||||
@@ -49,6 +49,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
|
||||
@@ -7,10 +7,10 @@ This is used by editors to obtain the filesystem path from a dragged file. See
|
||||
documentation at https://electronjs.org/docs/api/file-object
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h
|
||||
index 72d6b7e109779c9785130ebb0e1e23202c5bc68d..e12c4acfd87f1d698d7c8c8459e7231ee03789fd 100644
|
||||
index c061962bec620d2da0e217d8f55b7db57d120f97..59d9946ecfb7d68b41f539ce7c29c7398e00e9b2 100644
|
||||
--- a/third_party/blink/renderer/core/fileapi/file.h
|
||||
+++ b/third_party/blink/renderer/core/fileapi/file.h
|
||||
@@ -212,6 +212,9 @@ class CORE_EXPORT File final : public Blob {
|
||||
@@ -211,6 +211,9 @@ class CORE_EXPORT File final : public Blob {
|
||||
}
|
||||
const String& name() const { return name_; }
|
||||
|
||||
|
||||
@@ -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 80f4314d205f4cbf0d92a331062f8a01a46d6917..2e5c15fc2cf5d0db8d26c1eeb759f6d2837e0656 100644
|
||||
index 1ced95928589b38d76df1c460df7712e8e8c1611..2977ba7ce2f6a102f04bd9ad591fc583fd836051 100644
|
||||
--- a/third_party/blink/renderer/core/frame/frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/frame.cc
|
||||
@@ -123,14 +123,6 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
@@ -124,14 +124,6 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
|
||||
DCHECK(!IsDetached());
|
||||
|
||||
@@ -33,7 +33,7 @@ index 80f4314d205f4cbf0d92a331062f8a01a46d6917..2e5c15fc2cf5d0db8d26c1eeb759f6d2
|
||||
if (type == FrameDetachType::kRemove) {
|
||||
if (provisional_frame_) {
|
||||
provisional_frame_->Detach(FrameDetachType::kRemove);
|
||||
@@ -154,6 +146,14 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
@@ -155,6 +147,14 @@ bool Frame::Detach(FrameDetachType type) {
|
||||
GetWindowProxyManager()->ClearForSwap();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index 80f4314d205f4cbf0d92a331062f8a01a46d6917..2e5c15fc2cf5d0db8d26c1eeb759f6d2
|
||||
// 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 4730c853097462638d3bc41b7c905874ab3dc29a..18615761121f83262da362b10b8022f80809ea07 100644
|
||||
index 5fccf35dfef38989bd68c69cfc35ac5d716ec165..dc45af36b30091b98cb37c927abd9a294c27bb71 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -544,10 +544,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
|
||||
@@ -11,7 +11,7 @@ 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 672bc56194e1ad8b03acd639c17b7f7e67a5dba0..59ba25815e511af5ca6aca5467cc91d5cc3c6bf1 100644
|
||||
index a9e0afc645b8bd543590e80b55a7461381373187..3d2e799541e26f5e421e20ccaff65020687314c2 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -175,11 +175,16 @@ if (!is_android && !is_mac) {
|
||||
@@ -33,10 +33,10 @@ index 672bc56194e1ad8b03acd639c17b7f7e67a5dba0..59ba25815e511af5ca6aca5467cc91d5
|
||||
"//base",
|
||||
"//build:branding_buildflags",
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index fdc5d388f80dcae2f1dd8a05d7d24ed5e59250b5..4570ad0308083a62e56a5fa9c91866f9216eed5f 100644
|
||||
index 244373ba428ada917929c5161eb2c75ef1ccf8d3..556a613a6697eeea6b15894449fec884b97ec8b5 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -4582,7 +4582,7 @@ static_library("browser") {
|
||||
@@ -4574,7 +4574,7 @@ static_library("browser") {
|
||||
|
||||
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
|
||||
# than here in :chrome_dll.
|
||||
@@ -46,18 +46,18 @@ index fdc5d388f80dcae2f1dd8a05d7d24ed5e59250b5..4570ad0308083a62e56a5fa9c91866f9
|
||||
sources += [ "certificate_viewer_stub.cc" ]
|
||||
}
|
||||
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
||||
index 5584fa001cf9bb0fab31cc6de053a536d18c4492..6541358b2a5d41f94c1e2d5a9d57ce20661f61a7 100644
|
||||
index 8c1a1b9c39a4ba00784ef91aaa81bf2453ac13e6..95e2f70445568d95351e8b1b5da71dc8e85e46cd 100644
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -5953,7 +5953,6 @@ test("unit_tests") {
|
||||
@@ -5963,7 +5963,6 @@ test("unit_tests") {
|
||||
|
||||
deps += [
|
||||
"//chrome:other_version",
|
||||
- "//chrome:packed_resources_integrity",
|
||||
"//chrome//services/util_win:unit_tests",
|
||||
"//chrome/app:chrome_dll_resources",
|
||||
"//chrome/browser:chrome_process_finder",
|
||||
@@ -5977,6 +5976,10 @@ test("unit_tests") {
|
||||
"//chrome/app:crash_reporter_client_win_unit_tests",
|
||||
@@ -5988,6 +5987,10 @@ test("unit_tests") {
|
||||
"//ui/resources",
|
||||
]
|
||||
|
||||
@@ -68,16 +68,16 @@ index 5584fa001cf9bb0fab31cc6de053a536d18c4492..6541358b2a5d41f94c1e2d5a9d57ce20
|
||||
ldflags = [
|
||||
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
|
||||
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
|
||||
@@ -6867,7 +6870,7 @@ test("unit_tests") {
|
||||
@@ -6879,7 +6882,7 @@ test("unit_tests") {
|
||||
}
|
||||
|
||||
deps += [
|
||||
- "//chrome:packed_resources_integrity_hash",
|
||||
+ # "//chrome:packed_resources_integrity_hash",
|
||||
"//chrome/browser/ash/system_web_apps/test_support",
|
||||
"//chrome/browser/enterprise/connectors/analysis:features",
|
||||
"//chrome/browser/media/router:test_support",
|
||||
@@ -6982,6 +6985,10 @@ test("unit_tests") {
|
||||
"//chrome/browser/media/router/discovery:discovery",
|
||||
@@ -6993,6 +6996,10 @@ test("unit_tests") {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 59ad3749cee7f8892884033d7507def1314aec75..187b94d207570a77f058915b9e5b581c777adc5a 100644
|
||||
index bdfc0719057218afeb61fec8f4e75298c3baa54c..9c6f51f1667d9bf1b430a83747faebf633a324c7 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -7221,6 +7221,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -7283,6 +7283,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 59ad3749cee7f8892884033d7507def1314aec75..187b94d207570a77f058915b9e5b581c
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 2cd68060a6d73b12190692f5973224e4816630bb..c9f744c73f95ad6e63077fbfad2e0c935e6c44c1 100644
|
||||
index 860e52ddb3db1ccc38a7ef6e11acc0da67c98ac5..14bc2c9e77b7db69d03c00314fe55806d2a9e38c 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3983,6 +3983,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3990,6 +3990,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
}
|
||||
auto* new_contents_impl = new_contents.get();
|
||||
|
||||
@@ -39,7 +39,7 @@ index 2cd68060a6d73b12190692f5973224e4816630bb..c9f744c73f95ad6e63077fbfad2e0c93
|
||||
new_contents_impl->GetController().SetSessionStorageNamespace(
|
||||
partition_config, session_storage_namespace);
|
||||
|
||||
@@ -4027,12 +4035,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4034,12 +4042,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
AddWebContentsDestructionObserver(new_contents_impl);
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ index 2cd68060a6d73b12190692f5973224e4816630bb..c9f744c73f95ad6e63077fbfad2e0c93
|
||||
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 ac5575971f18588c25438a7285e1c25037c14b1b..af3c7dbb09de31e4079406cb5e18b5ffcc6e867c 100644
|
||||
index cc492885ec8ae5577c6e8702dc30749331332103..c852b894f976304e6b20908a6e66ccd698887604 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -579,6 +579,10 @@ struct CreateNewWindowParams {
|
||||
@@ -587,6 +587,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// Additional parameters for creating picture-in-picture windows.
|
||||
blink.mojom.PictureInPictureWindowOptions? pip_options;
|
||||
@@ -68,10 +68,10 @@ index ac5575971f18588c25438a7285e1c25037c14b1b..af3c7dbb09de31e4079406cb5e18b5ff
|
||||
|
||||
// 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 3101f5faa5d87f10e0859e8a09c6ebb2678eb478..39682dddf0ec449f0bc34124bf3de6f8c216fdf9 100644
|
||||
index 15620fd7b5d95eb031641e0eeb6d4c2ec74071d2..8f75315f0d4ba45314be5d2d88a417b44ba2c254 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -605,6 +605,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -617,6 +617,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -81,10 +81,10 @@ index 3101f5faa5d87f10e0859e8a09c6ebb2678eb478..39682dddf0ec449f0bc34124bf3de6f8
|
||||
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 0d79069d5a54a1a8907e459beb0235b2a78e1fa6..cfe1fc63e293cb2bcafb6c9e6778ee39ef266e89 100644
|
||||
index cadbd44a85b6117cd001c1dec120d18520ff2855..e0bfafe859b600ac5033f78d1eb5823ddda956c4 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -164,6 +164,7 @@ class NetworkService;
|
||||
@@ -165,6 +165,7 @@ class NetworkService;
|
||||
class TrustedURLLoaderHeaderClient;
|
||||
} // namespace mojom
|
||||
struct ResourceRequest;
|
||||
@@ -92,7 +92,7 @@ index 0d79069d5a54a1a8907e459beb0235b2a78e1fa6..cfe1fc63e293cb2bcafb6c9e6778ee39
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -977,6 +978,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -993,6 +994,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -124,7 +124,7 @@ index ef3889063b562a37fbd945fe30db0d776ecaee7a..99e8449e9c515dd70ed88546a71f83ae
|
||||
const OpenURLParams& params) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index 348dcde05d71e7d16e4c7bb1d8d9f8718070e669..5a9cc64d6e0d9d01f5dc133c7fcab34101bc32db 100644
|
||||
index b088cb301003359fefad0ea9ca42b96f0cf3de6c..eec7bf18d17e85bde8017d4c8e7f064987b4d4d3 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -16,6 +16,7 @@
|
||||
@@ -150,7 +150,7 @@ index 348dcde05d71e7d16e4c7bb1d8d9f8718070e669..5a9cc64d6e0d9d01f5dc133c7fcab341
|
||||
// typically happens when popups are created.
|
||||
virtual void WebContentsCreated(WebContents* source_contents,
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index 11eaa6b307811b0b327c60ca8ee343331ed18b1b..87f35d4477fef2d6f5ee58455c10e1780a090ef9 100644
|
||||
index 913b3647c4632b580fa1551f4ebfeaca6f9fe17e..9cc6a793a1ec3e53db1ef31aec37c569695b197e 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -315,6 +315,10 @@ WebView* RenderViewImpl::CreateView(
|
||||
@@ -165,7 +165,7 @@ index 11eaa6b307811b0b327c60ca8ee343331ed18b1b..87f35d4477fef2d6f5ee58455c10e178
|
||||
// moved on send.
|
||||
bool is_background_tab =
|
||||
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
|
||||
index e757a73ad55c997357bc26015423b69aaa3e895e..089b9e92b0b156fcdcf4b391c24b988a22e312c7 100644
|
||||
index d6dd69c53b66a89ea63927319d7b385f91921ea2..71748596f4d05de73263ed11b122d75a38b49616 100644
|
||||
--- a/content/web_test/browser/web_test_content_browser_client.cc
|
||||
+++ b/content/web_test/browser/web_test_content_browser_client.cc
|
||||
@@ -440,6 +440,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -212,10 +212,10 @@ index 34570168ccb123f5102dcf8fa6bbf98e7c373ec6..192701e56d258da41b3724292853885e
|
||||
|
||||
} // 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 6633a96d4eafce752b6a1dace29390203d7c4ac0..cb340f174618bd1c38e4216d85eb57f293f3367c 100644
|
||||
index ec10f16c6e6c5507ad2fb0afe306a744885eb58e..3f7a069c3f1b8412074864eb99bf47469a699837 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
@@ -2100,6 +2100,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
@@ -2084,6 +2084,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
WebWindowFeatures window_features =
|
||||
GetWindowFeaturesFromString(features, entered_window);
|
||||
|
||||
|
||||
47
patches/chromium/chore_add_electron_deps_to_gitignores.patch
Normal file
47
patches/chromium/chore_add_electron_deps_to_gitignores.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Attard <sattard@salesforce.com>
|
||||
Date: Tue, 26 Jul 2022 00:05:29 -0700
|
||||
Subject: chore: add electron deps to gitignores
|
||||
|
||||
Makes things like "git status" quicker when developing electron locally
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index d68a1b2dd91704a00be9cce6ccfa5daf7da35e1a..ab30dd802543491352d3b407f12127c04742d1ab 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -229,6 +229,7 @@ vs-chromium-project.txt
|
||||
/delegate_execute
|
||||
/device/serial/device_serial_mojo.xml
|
||||
/docs/website
|
||||
+/electron
|
||||
/google_apis/gcm/gcm.xml
|
||||
/google_apis/internal
|
||||
/googleurl
|
||||
diff --git a/third_party/.gitignore b/third_party/.gitignore
|
||||
index 63611fc675a17af16dc20cbd9b20e28db63a7ead..eb369ac8b3bc0c2344491438b67e1618d2efb244 100644
|
||||
--- a/third_party/.gitignore
|
||||
+++ b/third_party/.gitignore
|
||||
@@ -83,6 +83,7 @@
|
||||
/directxsdk
|
||||
/dom_distiller_js/dist
|
||||
/eigen3/src
|
||||
+/electron_node
|
||||
/elfutils/src
|
||||
/emoji-segmenter/src
|
||||
/emoji-metadata/src
|
||||
@@ -179,6 +180,7 @@
|
||||
/mocha
|
||||
/mockito/src
|
||||
/nacl_sdk_binaries/
|
||||
+/nan
|
||||
/nasm
|
||||
/nearby/src
|
||||
/neon_2_sse/src
|
||||
@@ -242,6 +244,7 @@
|
||||
/speex
|
||||
/sqlite/src
|
||||
/sqlite4java/lib/
|
||||
+/squirrel.mac
|
||||
/subresource-filter-ruleset/data/UnindexedRules
|
||||
/swift-format
|
||||
/swiftshader/
|
||||
@@ -108,10 +108,10 @@ index 1318d5e04d5448d2b357454c3ce4207264288760..3b0324c35d5b18ed2e29264aae860c48
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
|
||||
index ce86697e47437832cd0d9692e44a19885f3b7174..62f3371827343fb30d3202f78af70968f169d9f2 100644
|
||||
index fd22d62a1346ee0f7c10659681e9a0e44535b44a..d51973a4ffdd2ea448fc3e8fab7cf3a47e867c7a 100644
|
||||
--- a/chrome/browser/ui/browser.cc
|
||||
+++ b/chrome/browser/ui/browser.cc
|
||||
@@ -1794,12 +1794,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
@@ -1798,12 +1798,11 @@ bool Browser::IsWebContentsCreationOverridden(
|
||||
content::SiteInstance* source_site_instance,
|
||||
content::mojom::WindowContainerType window_container_type,
|
||||
const GURL& opener_url,
|
||||
@@ -246,10 +246,10 @@ index c6bd5c19f8a7ceec17c9e32af5296a9617f3a619..02199b439fba7fdc617b7f7980d958b7
|
||||
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 a06d49c3ed7d809ddd3ab43f1cc4e3044a6b14d2..1ebb4970ef9c440c5c2584785397696c7ebc14ce 100644
|
||||
index ad3f25362279d889e800cee3fd20240cc6d176a9..9b532970afe951f7c12629903baa39f2b8de1a5e 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3909,8 +3909,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3916,8 +3916,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
|
||||
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
|
||||
source_site_instance, params.window_container_type,
|
||||
@@ -274,7 +274,7 @@ index 99e8449e9c515dd70ed88546a71f83ae139178fe..4f395474d3e0e1bf7a594fe3fa3e4cb5
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
|
||||
index 5a9cc64d6e0d9d01f5dc133c7fcab34101bc32db..166e506f1afbcb1a3a661479d489e71d8d8ff552 100644
|
||||
index eec7bf18d17e85bde8017d4c8e7f064987b4d4d3..d5457e3a2ae96305cbd215f0340295339c7838e5 100644
|
||||
--- a/content/public/browser/web_contents_delegate.h
|
||||
+++ b/content/public/browser/web_contents_delegate.h
|
||||
@@ -317,8 +317,7 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
|
||||
@@ -21,10 +21,10 @@ index 6aa864db880408bf7021ac58673f4d8d489426b4..1fa85302da7a64abc42fd9558ddbcaf6
|
||||
uint64_t g_process_start_time = 0;
|
||||
pid_t g_pid = 0;
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.cc b/components/crash/core/app/crash_reporter_client.cc
|
||||
index 82b7f241e26184240260d0b6287ded159681e15b..abbb267f6a40de0cdf4d09700f9dd444a575fbdf 100644
|
||||
index 463f92a6e547006a46119f52203482dd6695a84a..34e6f087613d76947ae463fda2b107fad6ec14e9 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.cc
|
||||
+++ b/components/crash/core/app/crash_reporter_client.cc
|
||||
@@ -141,6 +141,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
|
||||
@@ -145,6 +145,17 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ index 82b7f241e26184240260d0b6287ded159681e15b..abbb267f6a40de0cdf4d09700f9dd444
|
||||
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
|
||||
return 100;
|
||||
diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h
|
||||
index 24e53fa62c2c4a11494ad3d43f0c5a806930fcdd..9b691baa6cc90cc3f9ada307c43f44c4353e2487 100644
|
||||
index 2532e99f00b39777cd9640c76704f7430d39502e..323e039e4591a4099b187f7a0097b4ee8be11a9f 100644
|
||||
--- a/components/crash/core/app/crash_reporter_client.h
|
||||
+++ b/components/crash/core/app/crash_reporter_client.h
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -54,7 +54,7 @@ index 24e53fa62c2c4a11494ad3d43f0c5a806930fcdd..9b691baa6cc90cc3f9ada307c43f44c4
|
||||
#include <string>
|
||||
|
||||
#include "build/build_config.h"
|
||||
@@ -146,6 +147,19 @@ class CrashReporterClient {
|
||||
@@ -151,6 +152,19 @@ class CrashReporterClient {
|
||||
// that case, |breakpad_enabled| is set to the value enforced by policies.
|
||||
virtual bool ReportingIsEnforcedByPolicy(bool* breakpad_enabled);
|
||||
|
||||
@@ -128,10 +128,10 @@ index dc041c43371fd58e3121ef6bc423aadb644bb8d0..a1fa566775724b4a1662a939fda3f0a5
|
||||
arguments.push_back("--monitor-self");
|
||||
}
|
||||
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
|
||||
index 80f33dc5e2f2ed330e0726a5735b247ea8e99fd7..b96bf703f6b691886d6e4d5cd6d775945a8995e1 100644
|
||||
index ad401a7711ceff58abacb99a03fda258fccd12a0..de04f4df602e3a0b20af045111faf8a7bf8e9e28 100644
|
||||
--- a/components/crash/core/app/crashpad_win.cc
|
||||
+++ b/components/crash/core/app/crashpad_win.cc
|
||||
@@ -90,6 +90,7 @@ bool PlatformCrashpadInitialization(
|
||||
@@ -91,6 +91,7 @@ bool PlatformCrashpadInitialization(
|
||||
|
||||
std::map<std::string, std::string> process_annotations;
|
||||
GetPlatformCrashpadAnnotations(&process_annotations);
|
||||
@@ -139,7 +139,7 @@ index 80f33dc5e2f2ed330e0726a5735b247ea8e99fd7..b96bf703f6b691886d6e4d5cd6d77594
|
||||
|
||||
std::string url = crash_reporter_client->GetUploadUrl();
|
||||
|
||||
@@ -128,6 +129,13 @@ bool PlatformCrashpadInitialization(
|
||||
@@ -129,6 +130,13 @@ bool PlatformCrashpadInitialization(
|
||||
|
||||
std::vector<std::string> arguments(start_arguments);
|
||||
|
||||
|
||||
@@ -16,20 +16,6 @@ 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 21e7b1cbada3856a7d91040c259be80ae95df07e..b19206ba58725f949403469a3e1d221b12833581 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
|
||||
@@ -542,8 +542,7 @@ void MobileFriendlinessChecker::NotifyInvalidatePaint(
|
||||
->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 fe8d191217e24b08d36339dbf047beaeb6bd6538..870db0552544e3e89d9498c22ec3db81b46df741 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
|
||||
@@ -15,7 +15,7 @@ the redraw locking mechanism, which fixes these issues. The electron issue
|
||||
can be found at https://github.com/electron/electron/issues/1821
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 1e6326a2f36f5a7e55e5193b69c36f870c1d00e7..2f51474d46544915b75185fc362aebf8b83164b0 100644
|
||||
index 1208238fbfb501e1776e8c3ba414a8c9ef23bc59..81f59c4476cd07930fc302ecbf0377a11bfee888 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -308,6 +308,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
|
||||
@@ -20,14 +20,15 @@ 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 65c468c4b882829fba7ab679c0fec3f637e96522..ca98a6e3992126b564d28e9d4429cd9a69cf7eed 100644
|
||||
index 6a148c3173f8f5653b945ed9b6ffcbf48d76d511..3809ffe0f487e60539db58980b3232030ce8d4f8 100644
|
||||
--- a/cc/trees/layer_tree_host_impl.cc
|
||||
+++ b/cc/trees/layer_tree_host_impl.cc
|
||||
@@ -1857,6 +1857,9 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
@@ -1864,6 +1864,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
|
||||
gfx::ContentColorUsage content_color_usage) const {
|
||||
TargetColorParams params;
|
||||
+ if (!settings_.enable_color_correct_rendering) {
|
||||
+ params.color_space = gfx::ColorSpace();
|
||||
+ return params;
|
||||
+ }
|
||||
|
||||
@@ -80,7 +81,7 @@ index 9d34ced366026eb7cdd00ce40a4eb1af56180d39..abf67f8246bfa37df08cd2216c388dd3
|
||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||
|
||||
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
||||
index 4be758a498c1e5b17fd8eea6c5a7719e4252723a..e166e96b4b23725ad8735ab87afd3660ed22de50 100644
|
||||
index 9b29ab96d6e7dd7160502ee2252843bdeeab84c9..a9889d625dac9148dd8bbc2853c4e09f6546bd0d 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -228,6 +228,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
@@ -92,7 +93,7 @@ index 4be758a498c1e5b17fd8eea6c5a7719e4252723a..e166e96b4b23725ad8735ab87afd3660
|
||||
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 ece0f7a284fc87f879d21e754b0b050236081d61..68277794cf54100592f36f0c95985b2911074c52 100644
|
||||
index 3f0a3b2133f0d48054f33df28b93a9ee40d7ed78..801bf4b1090a8f0de922fdac6c4145c27a154460 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -199,6 +199,7 @@
|
||||
@@ -103,7 +104,7 @@ index ece0f7a284fc87f879d21e754b0b050236081d61..68277794cf54100592f36f0c95985b29
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
@@ -3195,6 +3196,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
@@ -3185,6 +3186,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[] = {
|
||||
@@ -112,7 +113,7 @@ index ece0f7a284fc87f879d21e754b0b050236081d61..68277794cf54100592f36f0c95985b29
|
||||
sandbox::policy::switches::kDisableSeccompFilterSandbox,
|
||||
sandbox::policy::switches::kNoSandbox,
|
||||
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
|
||||
index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..b4ddafdd126edd16172f00448bbbd56eaf509b1f 100644
|
||||
index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..35b0bb908245330fbdc5205caa3299bf6fd8f7b4 100644
|
||||
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
@@ -131,7 +132,18 @@ index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..b4ddafdd126edd16172f00448bbbd56e
|
||||
|
||||
namespace blink {
|
||||
|
||||
@@ -118,6 +120,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
|
||||
@@ -19,6 +21,10 @@ namespace blink {
|
||||
// Level 4 specification.
|
||||
gfx::ColorSpace PredefinedColorSpaceToGfxColorSpace(
|
||||
PredefinedColorSpace color_space) {
|
||||
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
|
||||
+ return gfx::ColorSpace();
|
||||
+ }
|
||||
switch (color_space) {
|
||||
case PredefinedColorSpace::kSRGB:
|
||||
return gfx::ColorSpace::CreateSRGB();
|
||||
@@ -118,6 +124,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
|
||||
}
|
||||
|
||||
gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
|
||||
@@ -166,7 +178,7 @@ index 4f3b9b181b1998e0ebbd95955feeec28a5d6bcb7..00f2a213cded1985b3131fabf3560937
|
||||
// is what the renderer uses if its not threaded.
|
||||
settings.enable_checker_imaging =
|
||||
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
|
||||
index e030f01e72d18ef08d04ffbc72a5abb9a7b485c5..25155263bede8a465eb3f3bc2960f173c8f14935 100644
|
||||
index 8bdb9fafc4c5e59d6d6aad323ca2547ecc1b4069..069ed9744dca4fb208daaaf76d4618706c65b84e 100644
|
||||
--- a/ui/gfx/mac/io_surface.cc
|
||||
+++ b/ui/gfx/mac/io_surface.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
@@ -192,7 +204,7 @@ index e030f01e72d18ef08d04ffbc72a5abb9a7b485c5..25155263bede8a465eb3f3bc2960f173
|
||||
// Allow but ignore invalid color spaces.
|
||||
if (!color_space.IsValid())
|
||||
return true;
|
||||
@@ -311,6 +320,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
@@ -312,6 +321,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
|
||||
DCHECK_EQ(kIOReturnSuccess, r);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ at some point be an API to "unfreeze" the flags, or we may be able to refactor
|
||||
node initialization to not update flags after V8 initialization.
|
||||
|
||||
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc
|
||||
index 02b4f803369202a81f2d54f3b35aef04be13dfa2..76dd21fc8e97c1a2836ae5a5a11b56334a656fe2 100644
|
||||
index 02b4f803369202a81f2d54f3b35aef04be13dfa2..04a8d29ba210313076eacf5074ed86402160c0c3 100644
|
||||
--- a/content/renderer/render_process_impl.cc
|
||||
+++ b/content/renderer/render_process_impl.cc
|
||||
@@ -222,7 +222,8 @@ RenderProcessImpl::RenderProcessImpl()
|
||||
@@ -23,8 +23,8 @@ index 02b4f803369202a81f2d54f3b35aef04be13dfa2..76dd21fc8e97c1a2836ae5a5a11b5633
|
||||
"--no-wasm-dynamic-tiering");
|
||||
|
||||
- v8::V8::SetFlagsFromString("--freeze-flags-after-init");
|
||||
+ // This conflicts with node in the renderer.
|
||||
+ //v8::V8::SetFlagsFromString("--freeze-flags-after-init");
|
||||
+ // Freezing flags after init conflicts with node in the renderer.
|
||||
+ v8::V8::SetFlagsFromString("--no-freeze-flags-after-init");
|
||||
|
||||
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
|
||||
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 4b4a91a3fb6156ced046b414c131bc348f15b79f..852118f2599087c971ee6475f670a1f0e9d64bd3 100644
|
||||
index 3c934fe49b745d79d502311af02c4b2409f87742..5647890d0f62bcd5b1d1b2e6adc511b262a83b7f 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -809,6 +809,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
||||
@@ -20,7 +20,7 @@ index 4b4a91a3fb6156ced046b414c131bc348f15b79f..852118f2599087c971ee6475f670a1f0
|
||||
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 f63c1aa3007fa532af250e6f222ab588d949dccc..6183ee520b48e09958f320c1091a80ce947f21b7 100644
|
||||
index 4c568e15eaf82231004e89590dfe2e28e6ba0ac0..2ba5e20d961494995c11ac2a40d2c78b8b3d7de0 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
||||
@@ -881,6 +881,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
||||
|
||||
@@ -20,7 +20,7 @@ index 1e54559bd5f9a2ee889b921379d70c51e902502d..6797a076b612ad4ed6d5ce7d9868d944
|
||||
using PCScan = internal::PCScan;
|
||||
const auto invocation_mode = flags & PurgeFlags::kAggressiveReclaim
|
||||
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
|
||||
index 418efcb3c08c67e86ae3a0728f37c5a4b9e56e06..f5c3a127c4ac535773f087f8ee2306ab0433fbe6 100644
|
||||
index 714232b0c2707d6c256e634ff784c18322bf0a85..48c8d0051c427954fe7265fee9cd0c6b5f473984 100644
|
||||
--- a/base/threading/platform_thread_posix.cc
|
||||
+++ b/base/threading/platform_thread_posix.cc
|
||||
@@ -44,6 +44,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 19bd5ef930bc094b315d2562c0f4917e78f63bad..bb1c66173df927499f1f28039f2255e3d6c28c96 100644
|
||||
index 3e186230715aaf840959a93038167749e3735a08..4c2dbe2b7629c94a16620988ae96fb10da39e0b8 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -2287,7 +2287,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
|
||||
@@ -2294,7 +2294,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
|
||||
}
|
||||
|
||||
const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() {
|
||||
|
||||
@@ -19,7 +19,7 @@ index d7260950ca1ba9c71d9500560bc13314e78e2170..f6b37bdec2343d45447b419aeadbe2aa
|
||||
aspect_ratio.height());
|
||||
}
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 2f51474d46544915b75185fc362aebf8b83164b0..c893bc030b266539f65d31bdc40ba0ba31b70986 100644
|
||||
index 81f59c4476cd07930fc302ecbf0377a11bfee888..70e33b49e77240248c629fb18c5d3ca57ea32d66 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -1001,8 +1001,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
|
||||
|
||||
@@ -21,7 +21,7 @@ index 2f2e0d67c7141e5daad2d50031c71a542677e108..c53bd76fcd3703cb483949d5ec53f24f
|
||||
v8::ZoneBackingAllocator* GetZoneBackingAllocator() override;
|
||||
#endif
|
||||
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
|
||||
index 9e79f7e411a3242e3e7662933389e05b94a4818c..05e3156571ac0dc9ff71464b8e73d74db96496a0 100644
|
||||
index b02ab8b6ac701d948daac73bd89bc1fc6533d60c..36c096b4c053eae9326c8ccb7ed6aea07b68c3e5 100644
|
||||
--- a/gin/v8_platform.cc
|
||||
+++ b/gin/v8_platform.cc
|
||||
@@ -367,6 +367,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
|
||||
|
||||
@@ -33,10 +33,10 @@ index 14c71cc69388da46f62d9835e2a06fef0870da02..9481ea08401ae29ae9c1d960491b05b3
|
||||
|
||||
} // namespace net
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index 61030982c4391dd1b4b508042628e7f006047158..c4f422553185d416a6abfd4647b219060705d0ad 100644
|
||||
index d53e403bda407bb46f59395ebcbb39cd9495875b..4850469bb2bd96c87b0aa936c654f7bd58b7b17f 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1406,6 +1406,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -1410,6 +1410,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ index 61030982c4391dd1b4b508042628e7f006047158..c4f422553185d416a6abfd4647b21906
|
||||
// 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 d88d9d2bc4b95464ca9a8cacec33361f12d25ea4..74415ce53dc6d0b3e39dbe27ae9e225b281c8820 100644
|
||||
index 614ba5b278f8bed722072ca07399b247ddb971be..21024709a79dc2bb838492090ce1365450427430 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -296,6 +296,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) 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 3e28873ed5181756ab62e14ca9c2c4b27b4378f1..831b6bab8e491fc0750ecf05b3ef0f105a5478f4 100644
|
||||
index 9151815e6bf33a3a6980f8337f578dc90e458696..664b8c2b0a3eb5da577a6ac9d70cafff4702a622 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -161,6 +161,7 @@
|
||||
|
||||
@@ -572,7 +572,7 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index e0345f5903a48013930767bee713c177a704970a..2881a4fee66f16e6367724a727abe4643a965a24 100644
|
||||
index 5dee5932ce9cacc68af498ef2312fd58cd285e15..d8f977154e5f0c0456ee03ddf67f94b0e7ab475d 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -83,6 +83,7 @@ class DisplayPrivate;
|
||||
|
||||
@@ -103,7 +103,7 @@ index 3d2bcc3e81eb42f645fa4e8b1425cb5c54cfd3a1..4cdbe0e38609abfd0b0b5856deb8b2dd
|
||||
string mime_type;
|
||||
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 04ed3a3391b82751d0014027caf37c402a8f068a..7140c4ced6265c388a4015350b1da5d487a02569 100644
|
||||
index 6805b5f3976f60e0cc72634f71bcb21879ffbde1..4d60c127bec00859ed523ca652336239ab71ae00 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -603,6 +603,7 @@ URLLoader::URLLoader(
|
||||
@@ -114,7 +114,7 @@ index 04ed3a3391b82751d0014027caf37c402a8f068a..7140c4ced6265c388a4015350b1da5d4
|
||||
devtools_request_id_(request.devtools_request_id),
|
||||
request_mode_(request.mode),
|
||||
request_credentials_mode_(request.credentials_mode),
|
||||
@@ -794,7 +795,7 @@ URLLoader::URLLoader(
|
||||
@@ -792,7 +793,7 @@ URLLoader::URLLoader(
|
||||
url_request_->SetRequestHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawRequestHeadersAndNotify, base::Unretained(this)));
|
||||
|
||||
@@ -123,7 +123,7 @@ index 04ed3a3391b82751d0014027caf37c402a8f068a..7140c4ced6265c388a4015350b1da5d4
|
||||
url_request_->SetResponseHeadersCallback(base::BindRepeating(
|
||||
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
|
||||
}
|
||||
@@ -1536,6 +1537,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
@@ -1541,6 +1542,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
|
||||
}
|
||||
|
||||
response_ = BuildResponseHead();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen
|
||||
This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 5f200acb893f6c6b4ffb7c5a6ca010dde8a245e9..c3a5751233c48255408db41c10118ffde72f51d6 100644
|
||||
index 6f01f3eb8df96320700448e4583e4a4a0b3d2beb..e3c9f87e651be09fd40f1f51b3f9ba6fb18a770b 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3440,7 +3440,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
@@ -3447,7 +3447,7 @@ void WebContentsImpl::EnterFullscreenMode(
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
|
||||
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
|
||||
DCHECK(requesting_frame->IsActive());
|
||||
|
||||
@@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
|
||||
BrowserWindow.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index c893bc030b266539f65d31bdc40ba0ba31b70986..b1e8daf5e79cd838c87e01da0e764e12421747db 100644
|
||||
index 70e33b49e77240248c629fb18c5d3ca57ea32d66..3b546cf67089e6677fc668b4d1d6c0863282dff5 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -3696,6 +3696,21 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
|
||||
@@ -3694,6 +3694,21 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
|
||||
delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
|
||||
min_window_size = delegate_->DIPToScreenSize(min_window_size);
|
||||
max_window_size = delegate_->DIPToScreenSize(max_window_size);
|
||||
|
||||
@@ -13,7 +13,7 @@ This patch can be removed should we choose to support chrome.fileSystem
|
||||
or support it enough to fix the crash.
|
||||
|
||||
diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts
|
||||
index a22dd8209fd9c67e9c3637fee61bca5524ee51da..6e3c8da273aa4d24c32200f3d67210eb08ee3dad 100644
|
||||
index 96d6028af1408c34f98ee638b8b8d41e8dc8b2ee..6e3c8da273aa4d24c32200f3d67210eb08ee3dad 100644
|
||||
--- a/chrome/browser/resources/pdf/pdf_viewer.ts
|
||||
+++ b/chrome/browser/resources/pdf/pdf_viewer.ts
|
||||
@@ -860,26 +860,12 @@ export class PDFViewerElement extends PDFViewerBaseElement {
|
||||
@@ -60,7 +60,7 @@ index a22dd8209fd9c67e9c3637fee61bca5524ee51da..6e3c8da273aa4d24c32200f3d67210eb
|
||||
- {
|
||||
- type: 'saveFile',
|
||||
- accepts: [{description: '*.pdf', extensions: ['pdf']}],
|
||||
- suggestedName: fileName
|
||||
- suggestedName: fileName,
|
||||
- },
|
||||
- (entry?: FileSystemFileEntry) => {
|
||||
- if (chrome.runtime.lastError) {
|
||||
|
||||
@@ -8,10 +8,10 @@ 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 df53d0d8371b2f7bbd04ffe6c2d1c171ae457bc8..688883c80d5005b58c39d66c520726bcc62eeac1 100644
|
||||
index 53435224b5e331bbe24119752c1a44a8d58bfa88..de1a5b60474ce872eba03dfb8931b9b566fd6cee 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -1823,7 +1823,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
@@ -1828,7 +1828,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
// IncrementCapturerCount() is destructed.
|
||||
void DecrementCapturerCount(bool stay_hidden,
|
||||
bool stay_awake,
|
||||
@@ -21,10 +21,10 @@ index df53d0d8371b2f7bbd04ffe6c2d1c171ae457bc8..688883c80d5005b58c39d66c520726bc
|
||||
// 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 922048fbc03f7222e42e3640b46d3d5e1b2391ba..f2bdadbfaae703006f4888e3dd899a20bac84090 100644
|
||||
index a3ae580ea073024882bd860abf914bbf7c0ed54d..85ae2b5ba31926d21ffb52ab31fca6a66ad6d5ec 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -667,6 +667,10 @@ class WebContents : public PageNavigator,
|
||||
@@ -669,6 +669,10 @@ class WebContents : public PageNavigator,
|
||||
bool stay_awake,
|
||||
bool is_activity = true) = 0;
|
||||
|
||||
|
||||
@@ -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 acfea574749cce9c9babac12593679c1c2c3b1af..0d44d3b022042dbcbb9f188adb90074c752741b8 100644
|
||||
index a64114d9eeb56b3dc0389415d44a842d3cda12fb..6c3b36f36e375a626f9fc2a59935c5ac851a128c 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
|
||||
@@ -3177,6 +3177,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -3184,6 +3184,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ index acfea574749cce9c9babac12593679c1c2c3b1af..0d44d3b022042dbcbb9f188adb90074c
|
||||
}
|
||||
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index cfe1fc63e293cb2bcafb6c9e6778ee39ef266e89..bbbdd32152f904d10e040ccf80dd1d1406b3d7a1 100644
|
||||
index e0bfafe859b600ac5033f78d1eb5823ddda956c4..e2b0937007413b158ac28e48352acd3ab68e6dd0 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -271,6 +271,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -272,6 +272,11 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
|
||||
virtual ~ContentBrowserClient() = default;
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
|
||||
Add electron resources file to the list of resource ids generation.
|
||||
|
||||
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
|
||||
index 1c50dbb9503e755ebbad2ea6d66484331862b72f..b9188ede8a4dc45bb5c573bc2cd8642c9256de36 100644
|
||||
index 9a8d321de570ee1a0669aa6022e34f8ff604694f..abcdba63bcbd0b9e323bf482cc292360d30be8fe 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -967,6 +967,11 @@
|
||||
@@ -971,6 +971,11 @@
|
||||
"includes": [4960],
|
||||
},
|
||||
|
||||
|
||||
@@ -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 68b47d4f483b064d7be5a19552cddfe3f2b12bb2..d3191ad5984dcad633cbab5da45824871961d212 100755
|
||||
index 194ce0ca751da8677df74489a04e143276264fbe..9df287e5a9d122f26730480d54a1bbfd47e8d95e 100755
|
||||
--- a/tools/clang/scripts/update.py
|
||||
+++ b/tools/clang/scripts/update.py
|
||||
@@ -302,6 +302,8 @@ def GetDefaultHostOs():
|
||||
|
||||
@@ -39,7 +39,7 @@ index dd14c8cfa32ab0bb2e92f192c54a494c4f5b4fb7..2c6f0b336c97bc23995e9fe8cdc7f72a
|
||||
|
||||
} // namespace base
|
||||
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
|
||||
index bb1cb98f246f120f566fab65565f49a6468b82b4..929188b8d0e39f171679067347d4f83632364cc7 100644
|
||||
index cee826cf8ca533778c716fd2592e625e93fe7efb..adfec0021ae00b3a9ccc792695a51a182626fee5 100644
|
||||
--- a/base/mac/foundation_util.mm
|
||||
+++ b/base/mac/foundation_util.mm
|
||||
@@ -30,12 +30,6 @@
|
||||
@@ -76,7 +76,7 @@ index bb1cb98f246f120f566fab65565f49a6468b82b4..929188b8d0e39f171679067347d4f836
|
||||
if ([ns_val isKindOfClass:[NSFont class]]) {
|
||||
return (CTFontRef)(cf_val);
|
||||
diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc
|
||||
index e12c36384ddc05554ed362bba2c0a8b418634f0a..1c740410de70ee5a888ee7cf406dfa3bccc28c9b 100644
|
||||
index bf33d321197226a74d4f26731108ad8b0b8c72a0..349dc2cdde63e32daf06f1ccc0d29e7ce8b2ac46 100644
|
||||
--- a/base/process/launch_mac.cc
|
||||
+++ b/base/process/launch_mac.cc
|
||||
@@ -19,14 +19,19 @@
|
||||
|
||||
@@ -197,7 +197,7 @@ index 6975087ef6cc6483aa0d8c301cedfb126d471e11..fc7c4474aaa74000b901b93b26bb46d7
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
||||
index 7fc550eb16288cc5f4152362504a621abbaec3da..6be133c45a9b8c774b9f6e1e2de492c43bac33d3 100644
|
||||
index a922dc6ce99ed32ede8812a63a836f72691bece3..9e4ef4235c49eeb7cd34f05ae2d75169d787fa55 100644
|
||||
--- a/ui/base/BUILD.gn
|
||||
+++ b/ui/base/BUILD.gn
|
||||
@@ -341,6 +341,13 @@ component("base") {
|
||||
|
||||
@@ -50,7 +50,7 @@ index 506ff3c2b9a14a725d13e3933bc281d05c0b6b13..9726e2d34d6d123ad3e62d843d21b755
|
||||
|
||||
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 3378b9a6d411b853fe64e02812c329f68cbbd2ad..7b2f0b3dc28ff71ae84fe63aa9ea80c2aab75969 100644
|
||||
index 27b0c985b119095bd92ac021db10731a917dfa0c..83bd23a7ed0a5870f226442a6335b26de7676206 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -60,6 +60,7 @@
|
||||
@@ -79,7 +79,7 @@ index 3378b9a6d411b853fe64e02812c329f68cbbd2ad..7b2f0b3dc28ff71ae84fe63aa9ea80c2
|
||||
} else {
|
||||
IOSurfaceRef io_surface =
|
||||
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
|
||||
@@ -378,6 +382,7 @@
|
||||
@@ -379,6 +383,7 @@
|
||||
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
|
||||
use_remote_layer_api_, allow_av_sample_buffer_display_layer);
|
||||
|
||||
@@ -87,7 +87,7 @@ index 3378b9a6d411b853fe64e02812c329f68cbbd2ad..7b2f0b3dc28ff71ae84fe63aa9ea80c2
|
||||
// Create the CAContext to send this to the GPU process, and the layer for
|
||||
// the context.
|
||||
if (use_remote_layer_api_) {
|
||||
@@ -386,6 +391,7 @@
|
||||
@@ -387,6 +392,7 @@
|
||||
options:@{}] retain]);
|
||||
[ca_context_ setLayer:ca_layer_tree_coordinator_->GetCALayerForDisplay()];
|
||||
}
|
||||
@@ -95,7 +95,7 @@ index 3378b9a6d411b853fe64e02812c329f68cbbd2ad..7b2f0b3dc28ff71ae84fe63aa9ea80c2
|
||||
}
|
||||
|
||||
ImageTransportSurfaceOverlayMacEGL::~ImageTransportSurfaceOverlayMacEGL() {
|
||||
@@ -464,7 +470,9 @@
|
||||
@@ -465,7 +471,9 @@
|
||||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
if (use_remote_layer_api_) {
|
||||
|
||||
@@ -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 c2824b6bcfab1c13d0e44ca96fc05c97b4a13a6e..61030982c4391dd1b4b508042628e7f006047158 100644
|
||||
index 2aaf6fb9cca420cde28635d7628c1b7830570f5a..d53e403bda407bb46f59395ebcbb39cd9495875b 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -129,6 +129,11 @@
|
||||
@@ -130,6 +130,11 @@
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
@@ -22,7 +22,7 @@ index c2824b6bcfab1c13d0e44ca96fc05c97b4a13a6e..61030982c4391dd1b4b508042628e7f0
|
||||
#if BUILDFLAG(IS_CT_SUPPORTED)
|
||||
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
|
||||
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
|
||||
@@ -437,6 +442,91 @@ bool GetFullDataFilePath(
|
||||
@@ -438,6 +443,91 @@ bool GetFullDataFilePath(
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -114,7 +114,7 @@ index c2824b6bcfab1c13d0e44ca96fc05c97b4a13a6e..61030982c4391dd1b4b508042628e7f0
|
||||
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
|
||||
|
||||
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
|
||||
@@ -739,6 +829,13 @@ void NetworkContext::SetClient(
|
||||
@@ -743,6 +833,13 @@ void NetworkContext::SetClient(
|
||||
client_.Bind(std::move(client));
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ index c2824b6bcfab1c13d0e44ca96fc05c97b4a13a6e..61030982c4391dd1b4b508042628e7f0
|
||||
void NetworkContext::CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) {
|
||||
@@ -2303,6 +2400,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -2304,6 +2401,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
std::move(cert_verifier));
|
||||
cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_.get());
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -139,10 +139,10 @@ index c2824b6bcfab1c13d0e44ca96fc05c97b4a13a6e..61030982c4391dd1b4b508042628e7f0
|
||||
|
||||
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 34b3e31549ee37b58eee4c11c54bd34af73af263..d88d9d2bc4b95464ca9a8cacec33361f12d25ea4 100644
|
||||
index 97039f97082b79e4b7bd5cdb4a5b28023dc70e47..614ba5b278f8bed722072ca07399b247ddb971be 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -105,6 +105,7 @@ class URLMatcher;
|
||||
@@ -104,6 +104,7 @@ class URLMatcher;
|
||||
|
||||
namespace network {
|
||||
class CertVerifierWithTrustAnchors;
|
||||
|
||||
@@ -133,10 +133,10 @@ index 424fae79eb1c93f1fac293ae8fdeb6d067f523cc..6a2f074ad981deb15b46bd91b6d7eb5d
|
||||
const GURL& document_url,
|
||||
const WeakDocumentPtr& weak_document_ptr,
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index db1e97364a68fdc987274f2a7a940d9d63ac111e..8b236cbd54011bc0008d56ca4213920e478f7a90 100644
|
||||
index 4b40e3faa498b6c86b381f6efae9d04e48a85c0f..5499f85fa578511d5817ecd9be2f33cf56e2db4b 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2059,8 +2059,9 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2069,8 +2069,9 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
// For workers:
|
||||
if (render_frame_id == MSG_ROUTING_NONE) {
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
@@ -148,7 +148,7 @@ index db1e97364a68fdc987274f2a7a940d9d63ac111e..8b236cbd54011bc0008d56ca4213920e
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2068,7 +2069,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
@@ -2078,7 +2079,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
RenderFrameHost* rfh = RenderFrameHost::FromID(GetID(), render_frame_id);
|
||||
CHECK(rfh);
|
||||
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
||||
|
||||
@@ -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/BUILD.gn b/BUILD.gn
|
||||
index 861191e82aa304be0a71dcd356d31767540450ef..1f86538121bfc753b3587d9edaf1553726542af9 100644
|
||||
index a3cf0a49943f53608f783f439917c256ec5b9040..d52cc220107218e53290d21ce1c52a7f855385b4 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -974,7 +974,6 @@ if (is_win) {
|
||||
@@ -973,7 +973,6 @@ if (is_win) {
|
||||
"//media:media_unittests",
|
||||
"//media/midi:midi_unittests",
|
||||
"//net:net_unittests",
|
||||
@@ -22,7 +22,7 @@ index 861191e82aa304be0a71dcd356d31767540450ef..1f86538121bfc753b3587d9edaf15537
|
||||
"//sql:sql_unittests",
|
||||
"//third_party/breakpad:symupload($host_toolchain)",
|
||||
"//ui/base:ui_base_unittests",
|
||||
@@ -983,6 +982,10 @@ if (is_win) {
|
||||
@@ -982,6 +981,10 @@ if (is_win) {
|
||||
"//ui/views:views_unittests",
|
||||
"//url:url_unittests",
|
||||
]
|
||||
@@ -134,7 +134,7 @@ index 1e158ecd686e775f656d5a05a9d916ce8f075fa8..20613012d1e6f435c3211d78ec311cf0
|
||||
|
||||
void PrintJobWorkerOop::UnregisterServiceManagerClient() {
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d89882163c93ce89 100644
|
||||
index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..78f3db8a6fb8b9184cfd41188b11851ac8b8df85 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -30,8 +30,6 @@
|
||||
@@ -146,7 +146,22 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
@@ -87,6 +85,8 @@ using PrintSettingsCallback =
|
||||
@@ -83,10 +81,23 @@ namespace printing {
|
||||
|
||||
namespace {
|
||||
|
||||
+std::string PrintReasonFromPrintStatus(PrintViewManager::PrintStatus status) {
|
||||
+ if (status == PrintViewManager::PrintStatus::kInvalid) {
|
||||
+ return "Invalid printer settings";
|
||||
+ } else if (status == PrintViewManager::PrintStatus::kCanceled) {
|
||||
+ return "Print job canceled";
|
||||
+ } else if (status == PrintViewManager::PrintStatus::kFailed) {
|
||||
+ return "Print job failed";
|
||||
+ }
|
||||
+ return "";
|
||||
+}
|
||||
+
|
||||
using PrintSettingsCallback =
|
||||
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
|
||||
|
||||
void ShowWarningMessageBox(const std::u16string& message) {
|
||||
@@ -155,7 +170,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
// Runs always on the UI thread.
|
||||
static bool is_dialog_shown = false;
|
||||
if (is_dialog_shown)
|
||||
@@ -95,6 +95,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
|
||||
@@ -95,6 +106,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
|
||||
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
|
||||
|
||||
chrome::ShowWarningMessageBox(nullptr, std::u16string(), message);
|
||||
@@ -163,7 +178,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
}
|
||||
|
||||
void OnDidGetDefaultPrintSettings(
|
||||
@@ -144,7 +145,9 @@ void OnDidUpdatePrintSettings(
|
||||
@@ -144,7 +156,9 @@ void OnDidUpdatePrintSettings(
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
DCHECK(printer_query);
|
||||
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
|
||||
@@ -174,7 +189,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
RenderParamsFromPrintSettings(printer_query->settings(),
|
||||
params->params.get());
|
||||
params->params->document_cookie = printer_query->cookie();
|
||||
@@ -172,6 +175,7 @@ void OnDidScriptedPrint(
|
||||
@@ -172,6 +186,7 @@ void OnDidScriptedPrint(
|
||||
mojom::PrintManagerHost::ScriptedPrintCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
|
||||
@@ -182,7 +197,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
if (printer_query->last_status() == mojom::ResultCode::kSuccess &&
|
||||
printer_query->settings().dpi()) {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(),
|
||||
@@ -181,7 +185,8 @@ void OnDidScriptedPrint(
|
||||
@@ -181,7 +196,8 @@ void OnDidScriptedPrint(
|
||||
}
|
||||
bool has_valid_cookie = params->params->document_cookie;
|
||||
bool has_dpi = !params->params->dpi.IsEmpty();
|
||||
@@ -192,7 +207,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
|
||||
if (has_dpi && has_valid_cookie) {
|
||||
queue->QueuePrinterQuery(std::move(printer_query));
|
||||
@@ -196,12 +201,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
@@ -196,12 +212,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_);
|
||||
@@ -207,7 +222,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -209,7 +216,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -209,7 +227,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
@@ -219,7 +234,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
// Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
|
||||
// is still valid after a possible inner message loop runs in
|
||||
// `DisconnectFromCurrentPrintJob()`.
|
||||
@@ -237,6 +247,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -237,6 +258,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
#endif
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
@@ -229,7 +244,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
|
||||
enterprise_connectors::ContentAnalysisDelegate::Data scanning_data;
|
||||
@@ -405,7 +418,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
|
||||
@@ -405,7 +429,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
|
||||
void PrintViewManagerBase::ScriptedPrintReply(
|
||||
ScriptedPrintCallback callback,
|
||||
int process_id,
|
||||
@@ -239,7 +254,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
@@ -420,8 +434,11 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
@@ -420,8 +445,11 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,7 +267,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
@@ -429,8 +446,7 @@ void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
@@ -429,8 +457,7 @@ void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
// The Unretained() is safe because ForEachRenderFrameHost() is synchronous.
|
||||
web_contents()->GetPrimaryMainFrame()->ForEachRenderFrameHost(
|
||||
base::BindRepeating(&PrintViewManagerBase::SendPrintingEnabled,
|
||||
@@ -262,7 +277,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -546,11 +562,14 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
@@ -546,11 +573,14 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
void PrintViewManagerBase::GetDefaultPrintSettings(
|
||||
GetDefaultPrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
@@ -277,7 +292,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
|
||||
!service_manager_client_id_.has_value()) {
|
||||
@@ -588,18 +607,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -588,18 +618,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
base::Value::Dict job_settings,
|
||||
UpdatePrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
@@ -299,7 +314,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
content::BrowserContext* context =
|
||||
web_contents() ? web_contents()->GetBrowserContext() : nullptr;
|
||||
PrefService* prefs =
|
||||
@@ -609,6 +630,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -609,6 +641,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
if (value > 0)
|
||||
job_settings.Set(kSettingRasterizePdfDpi, value);
|
||||
}
|
||||
@@ -307,7 +322,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
|
||||
auto callback_wrapper =
|
||||
base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply,
|
||||
@@ -640,14 +662,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
||||
@@ -640,14 +673,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
||||
// didn't happen for some reason.
|
||||
bad_message::ReceivedBadMessage(
|
||||
render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME);
|
||||
@@ -324,7 +339,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -685,7 +707,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
||||
@@ -685,7 +718,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
||||
PrintManager::PrintingFailed(cookie, reason);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID) // Android does not implement this function.
|
||||
@@ -332,19 +347,19 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -700,6 +721,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
|
||||
@@ -700,6 +732,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
|
||||
+ if (!callback_.is_null()) {
|
||||
+ std::string cb_str = "Invalid printer settings";
|
||||
+ std::move(callback_).Run(printing_succeeded_, cb_str);
|
||||
+ printing_status_ = PrintStatus::kInvalid;
|
||||
+ TerminatePrintJob(true);
|
||||
+ }
|
||||
+
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
|
||||
l10n_util::GetStringUTF16(
|
||||
@@ -710,10 +736,12 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
|
||||
@@ -710,10 +747,12 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
content::RenderFrameHost::LifecycleState /*old_state*/,
|
||||
content::RenderFrameHost::LifecycleState new_state) {
|
||||
@@ -357,19 +372,30 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::DidStartLoading() {
|
||||
@@ -773,6 +801,11 @@ void PrintViewManagerBase::OnJobDone() {
|
||||
ReleasePrintJob();
|
||||
}
|
||||
|
||||
+void PrintViewManagerBase::UserInitCanceled() {
|
||||
+ printing_canceled_ = true;
|
||||
@@ -769,7 +808,12 @@ void PrintViewManagerBase::OnJobDone() {
|
||||
// Printing is done, we don't need it anymore.
|
||||
// print_job_->is_job_pending() may still be true, depending on the order
|
||||
// of object registration.
|
||||
- printing_succeeded_ = true;
|
||||
+ printing_status_ = PrintStatus::kSucceeded;
|
||||
+ ReleasePrintJob();
|
||||
+}
|
||||
+
|
||||
void PrintViewManagerBase::OnFailed() {
|
||||
TerminatePrintJob(true);
|
||||
+void PrintViewManagerBase::UserInitCanceled() {
|
||||
+ printing_status_ = PrintStatus::kCanceled;
|
||||
ReleasePrintJob();
|
||||
}
|
||||
@@ -831,7 +864,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
|
||||
@@ -783,7 +827,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
|
||||
|
||||
// Is the document already complete?
|
||||
if (print_job_->document() && print_job_->document()->IsComplete()) {
|
||||
- printing_succeeded_ = true;
|
||||
+ printing_status_ = PrintStatus::kSucceeded;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -831,7 +875,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
|
||||
// Disconnect the current `print_job_`.
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -381,21 +407,37 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
if (!weak_this)
|
||||
return false;
|
||||
|
||||
@@ -912,6 +948,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -852,7 +899,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
#endif
|
||||
print_job_->AddObserver(*this);
|
||||
|
||||
- printing_succeeded_ = false;
|
||||
+ printing_status_ = PrintStatus::kFailed;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -912,6 +959,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (!callback_.is_null()) {
|
||||
+ std::string cb_str = "";
|
||||
+ if (!printing_succeeded_)
|
||||
+ cb_str = printing_canceled_ ? "canceled" : "failed";
|
||||
+ std::move(callback_).Run(printing_succeeded_, cb_str);
|
||||
+ bool success = printing_status_ == PrintStatus::kSucceeded;
|
||||
+ std::move(callback_).Run(success, PrintReasonFromPrintStatus(printing_status_));
|
||||
+ }
|
||||
+
|
||||
if (!print_job_)
|
||||
return;
|
||||
|
||||
@@ -961,7 +1004,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -919,7 +971,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
// printing_rfh_ should only ever point to a RenderFrameHost with a live
|
||||
// RenderFrame.
|
||||
DCHECK(rfh->IsRenderFrameLive());
|
||||
- GetPrintRenderFrame(rfh)->PrintingDone(printing_succeeded_);
|
||||
+ GetPrintRenderFrame(rfh)->PrintingDone(printing_status_ == PrintStatus::kSucceeded);
|
||||
}
|
||||
|
||||
print_job_->RemoveObserver(*this);
|
||||
@@ -961,7 +1013,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
@@ -404,7 +446,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
return true;
|
||||
|
||||
if (!cookie) {
|
||||
@@ -1069,7 +1112,7 @@ void PrintViewManagerBase::SendPrintingEnabled(bool enabled,
|
||||
@@ -1069,7 +1121,7 @@ void PrintViewManagerBase::SendPrintingEnabled(bool enabled,
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -414,7 +456,7 @@ index 4bd871e5cadc693aea6e8c71b3fe3296b743d9ec..e6201cbf8d1ed64b1b53ed43d8988216
|
||||
for (auto& observer : GetObservers())
|
||||
observer.OnPrintNow(rfh);
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index 746df417a23f7760818ba265d4a7d589dec8bf34..0027387d4717c59f2df3f279caf7aa0de6669400 100644
|
||||
index 746df417a23f7760818ba265d4a7d589dec8bf34..0d3e4491826be629c7251a69afc7ebde990e10e1 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -41,6 +41,8 @@ namespace printing {
|
||||
@@ -446,7 +488,22 @@ index 746df417a23f7760818ba265d4a7d589dec8bf34..0027387d4717c59f2df3f279caf7aa0d
|
||||
|
||||
// Adds and removes observers for `PrintViewManagerBase` events. The order in
|
||||
// which notifications are sent to observers is undefined. Observers must be
|
||||
@@ -241,7 +247,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
@@ -120,6 +126,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
void AddObserver(Observer& observer);
|
||||
void RemoveObserver(Observer& observer);
|
||||
|
||||
+ enum class PrintStatus {
|
||||
+ kSucceeded,
|
||||
+ kCanceled,
|
||||
+ kFailed,
|
||||
+ kInvalid,
|
||||
+ kUnknown
|
||||
+ };
|
||||
+
|
||||
protected:
|
||||
explicit PrintViewManagerBase(content::WebContents* web_contents);
|
||||
|
||||
@@ -241,7 +255,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
// Runs `callback` with `params` to reply to ScriptedPrint().
|
||||
void ScriptedPrintReply(ScriptedPrintCallback callback,
|
||||
int process_id,
|
||||
@@ -456,7 +513,7 @@ index 746df417a23f7760818ba265d4a7d589dec8bf34..0027387d4717c59f2df3f279caf7aa0d
|
||||
|
||||
// Requests the RenderView to render all the missing pages for the print job.
|
||||
// No-op if no print job is pending. Returns true if at least one page has
|
||||
@@ -314,9 +321,15 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
@@ -314,8 +329,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;
|
||||
|
||||
@@ -464,16 +521,13 @@ index 746df417a23f7760818ba265d4a7d589dec8bf34..0027387d4717c59f2df3f279caf7aa0d
|
||||
+ CompletionCallback callback_;
|
||||
+
|
||||
// Indication of success of the print job.
|
||||
bool printing_succeeded_ = false;
|
||||
- bool printing_succeeded_ = false;
|
||||
+ PrintStatus printing_status_ = PrintStatus::kUnknown;
|
||||
|
||||
+ // Indication of whether the print job was manually canceled
|
||||
+ bool printing_canceled_ = false;
|
||||
+
|
||||
// Set while running an inner message loop inside RenderAllMissingPagesNow().
|
||||
// This means we are _blocking_ until all the necessary pages have been
|
||||
// rendered or the print settings are being loaded.
|
||||
diff --git a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
|
||||
index b2bd74f28f70bc601ec47820030ad965b19cf068..027e4c0b78d44b69504d248755bf7f25ff423361 100644
|
||||
index f3c3f85edb19489d079dc93411be64828ae581e2..ff303dcbc034cd8f1530fe1543729e98d3035826 100644
|
||||
--- a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
|
||||
+++ b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
|
||||
@@ -21,7 +21,7 @@ FakePrintRenderFrame::FakePrintRenderFrame(
|
||||
@@ -483,10 +537,10 @@ index b2bd74f28f70bc601ec47820030ad965b19cf068..027e4c0b78d44b69504d248755bf7f25
|
||||
-void FakePrintRenderFrame::PrintRequestedPages() {}
|
||||
+void FakePrintRenderFrame::PrintRequestedPages(bool /*silent*/, ::base::Value::Dict /*settings*/) {}
|
||||
|
||||
void FakePrintRenderFrame::PrintWithParams(mojom::PrintPagesParamsPtr params) {
|
||||
NOTREACHED();
|
||||
void FakePrintRenderFrame::PrintWithParams(mojom::PrintPagesParamsPtr params,
|
||||
PrintWithParamsCallback callback) {
|
||||
diff --git a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
|
||||
index 42f9f296e6ef65a934167c2d4773e504020378bc..3ac69d39e4eb380f97cb779be1e9ad8706ce8243 100644
|
||||
index 0e788384809f9f7218c6483822ffea08f86b4f79..c6f08845cb292ff406db5560c9a744dc7ab1c712 100644
|
||||
--- a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
|
||||
+++ b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
|
||||
@@ -25,7 +25,7 @@ class FakePrintRenderFrame : public mojom::PrintRenderFrame {
|
||||
@@ -495,14 +549,14 @@ index 42f9f296e6ef65a934167c2d4773e504020378bc..3ac69d39e4eb380f97cb779be1e9ad87
|
||||
// printing::mojom::PrintRenderFrame:
|
||||
- void PrintRequestedPages() override;
|
||||
+ void PrintRequestedPages(bool silent, ::base::Value::Dict settings) override;
|
||||
void PrintWithParams(mojom::PrintPagesParamsPtr params) override;
|
||||
void PrintWithParams(mojom::PrintPagesParamsPtr params,
|
||||
PrintWithParamsCallback callback) override;
|
||||
void PrintForSystemDialog() override;
|
||||
void SetPrintPreviewUI(
|
||||
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
|
||||
index f2c17a8fecc36ea18de71598b582e206661763c5..599b34690da042b57fcd78d0c0557d183ce10c0f 100644
|
||||
index 95d9f19082978772297cff1bcd9c5f73db50bd62..96fe7fbb54fe0908e2153d901c130b6a5c621522 100644
|
||||
--- a/components/printing/common/print.mojom
|
||||
+++ b/components/printing/common/print.mojom
|
||||
@@ -280,7 +280,7 @@ enum PrintFailureReason {
|
||||
@@ -285,7 +285,7 @@ union PrintWithParamsResult {
|
||||
interface PrintRenderFrame {
|
||||
// Tells the RenderFrame to switch the CSS to print media type, render every
|
||||
// requested page, and then switch back the CSS to display media type.
|
||||
@@ -511,7 +565,7 @@ index f2c17a8fecc36ea18de71598b582e206661763c5..599b34690da042b57fcd78d0c0557d18
|
||||
|
||||
// Requests the frame to be printed with specified parameters. This is used
|
||||
// to programmatically produce PDF by request from the browser (e.g. over
|
||||
@@ -362,7 +362,7 @@ interface PrintManagerHost {
|
||||
@@ -368,7 +368,7 @@ interface PrintManagerHost {
|
||||
// Request the print settings from the user. This step is about showing
|
||||
// UI to the user to select the final print settings.
|
||||
[Sync]
|
||||
@@ -521,7 +575,7 @@ index f2c17a8fecc36ea18de71598b582e206661763c5..599b34690da042b57fcd78d0c0557d18
|
||||
// Tells the browser that there are invalid printer settings.
|
||||
ShowInvalidPrinterSettingsError();
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7da7d5c9e 100644
|
||||
index 0766270f7c8ff9f903395229a541ae1f6183899c..3f9b4a7ade69f3447f8537d2585991aeed63e6d7 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -42,6 +42,7 @@
|
||||
@@ -560,7 +614,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
@@ -1391,7 +1393,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1402,7 +1404,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
}
|
||||
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
@@ -570,7 +624,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
if (!render_frame_gone_)
|
||||
print_preview_context_.DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1440,6 +1443,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
@@ -1451,6 +1454,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
|
||||
@@ -579,7 +633,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
@@ -2052,7 +2057,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2063,7 +2068,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
return;
|
||||
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
@@ -589,7 +643,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
// Check if |this| is still valid.
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -2067,7 +2073,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2078,7 +2084,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -600,7 +654,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -2075,7 +2083,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -2086,7 +2094,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
uint32_t expected_page_count = 0;
|
||||
@@ -609,7 +663,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -2094,8 +2102,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -2105,8 +2113,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -626,7 +680,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2328,36 +2343,52 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2364,36 +2379,52 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,7 +745,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
notify_browser_of_print_failure_ = false;
|
||||
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
|
||||
return false;
|
||||
@@ -2482,7 +2513,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
|
||||
@@ -2518,7 +2549,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
|
||||
std::move(params),
|
||||
base::BindOnce(
|
||||
[](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
|
||||
@@ -701,7 +755,7 @@ index bb0a934fb658256370fe29c6dbc9f72e992a9a5c..da7161c51e94f285d2ad6c9f0e2edba7
|
||||
std::move(quit_closure).Run();
|
||||
},
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index c2bf286ef1741b53022adf420809a87c3bb53cfd..f8b38d09abd3253bfd38b874ebdad753c3f8c4db 100644
|
||||
index 66026548181a897c161d7202646f33fd8847ccb8..113a8165b5db6294087773e5a4b2f0035f4c8f5d 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -255,7 +255,7 @@ class PrintRenderFrameHelper
|
||||
@@ -710,10 +764,10 @@ index c2bf286ef1741b53022adf420809a87c3bb53cfd..f8b38d09abd3253bfd38b874ebdad753
|
||||
// printing::mojom::PrintRenderFrame:
|
||||
- void PrintRequestedPages() override;
|
||||
+ void PrintRequestedPages(bool silent, base::Value::Dict settings) override;
|
||||
void PrintWithParams(mojom::PrintPagesParamsPtr params) override;
|
||||
void PrintWithParams(mojom::PrintPagesParamsPtr params,
|
||||
PrintWithParamsCallback callback) override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void PrintForSystemDialog() override;
|
||||
@@ -327,7 +327,9 @@ class PrintRenderFrameHelper
|
||||
@@ -328,7 +328,9 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
void Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -724,7 +778,7 @@ index c2bf286ef1741b53022adf420809a87c3bb53cfd..f8b38d09abd3253bfd38b874ebdad753
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -336,12 +338,14 @@ class PrintRenderFrameHelper
|
||||
@@ -337,12 +339,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
@@ -742,10 +796,10 @@ index c2bf286ef1741b53022adf420809a87c3bb53cfd..f8b38d09abd3253bfd38b874ebdad753
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Set options for print preset from source PDF document.
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index 9b8fe6eecdc7093ba43a324f37bbe380e43dc0c0..88164f568c27dc6bad4cedfd83bd2abeae956c5c 100644
|
||||
index 56e3651f7e79957e444ec82b534a07dff9ef7415..43f2d487947eaf77171d918cc5072aee4291290b 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -2756,8 +2756,9 @@ source_set("browser") {
|
||||
@@ -2766,8 +2766,9 @@ source_set("browser") {
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
|
||||
@@ -758,7 +812,7 @@ index 9b8fe6eecdc7093ba43a324f37bbe380e43dc0c0..88164f568c27dc6bad4cedfd83bd2abe
|
||||
if (is_chromeos) {
|
||||
sources += [
|
||||
diff --git a/content/browser/utility_sandbox_delegate_win.cc b/content/browser/utility_sandbox_delegate_win.cc
|
||||
index 5f6847dcc9aa6970d7c8c4831f2be160c0aa15ad..4bd1f7e3b4c50a319043c8041a9ecf4fa8a99ac1 100644
|
||||
index e3c1b29138f175836424bcfe917cd00bd081b34c..7d8b6f06c5d1a7ea9a5ed86c5c612e8df08f2659 100644
|
||||
--- a/content/browser/utility_sandbox_delegate_win.cc
|
||||
+++ b/content/browser/utility_sandbox_delegate_win.cc
|
||||
@@ -95,6 +95,7 @@ bool NetworkPreSpawnTarget(sandbox::TargetPolicy* policy) {
|
||||
@@ -778,7 +832,7 @@ index 5f6847dcc9aa6970d7c8c4831f2be160c0aa15ad..4bd1f7e3b4c50a319043c8041a9ecf4f
|
||||
|
||||
bool UtilitySandboxedProcessLauncherDelegate::GetAppContainerId(
|
||||
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
|
||||
index 93db1a80a360702a36f2d3113c9a83105bf7fffe..c3e012ec8d9a1c19434240d27553e486c0729d43 100644
|
||||
index 56ee836445c53c5cde3947fca19d8576d2684f6f..454e26baa8b3688c2af98081085aa5378ff0554b 100644
|
||||
--- a/printing/printing_context.cc
|
||||
+++ b/printing/printing_context.cc
|
||||
@@ -128,7 +128,6 @@ void PrintingContext::UsePdfSettings() {
|
||||
|
||||
@@ -30,7 +30,7 @@ index bdad25cd2c823fa2125fc523c400479882735ae6..bf2ddb136274eb3e4e597ed3060aabca
|
||||
// RenderWidgetHost on the primary main frame, and false otherwise.
|
||||
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
index 852118f2599087c971ee6475f670a1f0e9d64bd3..ed0e6cff036e76aa266306e5cb4202568ab5b952 100644
|
||||
index 5647890d0f62bcd5b1d1b2e6adc511b262a83b7f..9a818c66d76d50e9ba678e7a8e57381315eacf88 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
||||
@@ -2075,6 +2075,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
|
||||
@@ -43,10 +43,10 @@ index 852118f2599087c971ee6475f670a1f0e9d64bd3..ed0e6cff036e76aa266306e5cb420256
|
||||
|
||||
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index c9f744c73f95ad6e63077fbfad2e0c935e6c44c1..a06d49c3ed7d809ddd3ab43f1cc4e3044a6b14d2 100644
|
||||
index 14bc2c9e77b7db69d03c00314fe55806d2a9e38c..ad3f25362279d889e800cee3fd20240cc6d176a9 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -4571,6 +4571,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
@@ -4587,6 +4587,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
|
||||
return text_input_manager_.get();
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ index c9f744c73f95ad6e63077fbfad2e0c935e6c44c1..a06d49c3ed7d809ddd3ab43f1cc4e304
|
||||
RenderWidgetHostImpl* render_widget_host) {
|
||||
return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
|
||||
index 2ee5a7a78baba5974f99cd98d1ef378b6de2bcd7..df53d0d8371b2f7bbd04ffe6c2d1c171ae457bc8 100644
|
||||
index a636e3c31860f67b01c178fd580df466266481ed..53435224b5e331bbe24119752c1a44a8d58bfa88 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -957,6 +957,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
@@ -962,6 +962,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
|
||||
void SendScreenRects() override;
|
||||
void SendActiveState(bool active) override;
|
||||
TextInputManager* GetTextInputManager() override;
|
||||
|
||||
@@ -24,7 +24,7 @@ index eefdd87f1f85ac62079e97f1a7736234952d419c..f2b1959f7650ecd98ed2db870d1c723a
|
||||
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 912a21280fdd53e03cb92404b424f0b26740460a..98dda64426a1489cd44e90a211a6c4f94f62afb7 100644
|
||||
index 4174581cda568c887e34c2e2b29edf5ef6e2a092..770599358ca8badf180e249410ba71016d60ab99 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
||||
@@ -26,8 +26,10 @@
|
||||
@@ -60,7 +60,7 @@ index 912a21280fdd53e03cb92404b424f0b26740460a..98dda64426a1489cd44e90a211a6c4f9
|
||||
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
|
||||
// that handle content embedded within other RenderWidgetHostViews.
|
||||
gfx::PointF TransformPointToRootCoordSpaceF(
|
||||
@@ -300,6 +307,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
|
||||
@@ -308,6 +315,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
|
||||
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
|
||||
const ui::LatencyInfo& latency);
|
||||
|
||||
|
||||
@@ -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 06e3385d4f148eb23f9ddf560afb563897846609..672bc56194e1ad8b03acd639c17b7f7e67a5dba0 100644
|
||||
index f42cc96b606f07f66a9d4dfacbdcd5b8cb157d21..a9e0afc645b8bd543590e80b55a7461381373187 100644
|
||||
--- a/chrome/BUILD.gn
|
||||
+++ b/chrome/BUILD.gn
|
||||
@@ -1539,7 +1539,7 @@ if (is_chrome_branded && !is_android) {
|
||||
@@ -1546,7 +1546,7 @@ if (is_chrome_branded && !is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ index 06e3385d4f148eb23f9ddf560afb563897846609..672bc56194e1ad8b03acd639c17b7f7e
|
||||
chrome_paks("packed_resources") {
|
||||
if (is_mac) {
|
||||
output_dir = "$root_gen_dir/repack"
|
||||
@@ -1568,6 +1568,12 @@ if (!is_android) {
|
||||
@@ -1575,6 +1575,12 @@ if (!is_android) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
|
||||
Patch to make scrollBounce option work.
|
||||
|
||||
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
|
||||
index 2f86fff71f36353f1fc3d8024f16dbb4921a1db8..db9d0406637bca783f5a9f0beecbbaaac6d1c1cf 100644
|
||||
index 028c190ad21eb1899c61295695931bd2353518a5..9e74a54266460fc51e6b3492c842cda3c0b88538 100644
|
||||
--- a/content/renderer/render_thread_impl.cc
|
||||
+++ b/content/renderer/render_thread_impl.cc
|
||||
@@ -1279,7 +1279,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
@@ -1255,7 +1255,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
|
||||
}
|
||||
|
||||
bool RenderThreadImpl::IsElasticOverscrollEnabled() {
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Rose <japthorp@slack-corp.com>
|
||||
Date: Tue, 12 Jul 2022 16:51:43 -0700
|
||||
Subject: short-circuit permissions checks in MediaStreamDevicesController
|
||||
|
||||
The //components/permissions architecture is complicated and not that
|
||||
widely used in Chromium, and mostly oriented around showing permissions
|
||||
UI and/or remembering per-site permissions, which we're not interested
|
||||
in.
|
||||
|
||||
Since we do a permissions check prior to invoking the
|
||||
MediaStreamDevicesController, and don't (yet) provide the ability to set
|
||||
granular permissions (e.g. allow video but not audio), just
|
||||
short-circuit all the permissions checks in MSDC for now to allow us to
|
||||
unduplicate this code.
|
||||
|
||||
diff --git a/components/webrtc/media_stream_devices_controller.cc b/components/webrtc/media_stream_devices_controller.cc
|
||||
index 13bbeaac938b27446d5b62eb92ca761487db5fef..4cfe57a6356bbc2492f59957a0dfcf63052b7ee8 100644
|
||||
--- a/components/webrtc/media_stream_devices_controller.cc
|
||||
+++ b/components/webrtc/media_stream_devices_controller.cc
|
||||
@@ -93,11 +93,14 @@ void MediaStreamDevicesController::RequestPermissions(
|
||||
|
||||
std::vector<blink::PermissionType> permission_types;
|
||||
|
||||
+#if 0
|
||||
permissions::PermissionManager* permission_manager =
|
||||
permissions::PermissionsClient::Get()->GetPermissionManager(
|
||||
web_contents->GetBrowserContext());
|
||||
+#endif
|
||||
|
||||
if (controller->ShouldRequestAudio()) {
|
||||
+#if 0
|
||||
permissions::PermissionResult permission_status =
|
||||
permission_manager->GetPermissionStatusForCurrentDocument(
|
||||
ContentSettingsType::MEDIASTREAM_MIC, rfh);
|
||||
@@ -109,10 +112,12 @@ void MediaStreamDevicesController::RequestPermissions(
|
||||
permissions::PermissionStatusSource::FEATURE_POLICY);
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
|
||||
permission_types.push_back(blink::PermissionType::AUDIO_CAPTURE);
|
||||
}
|
||||
if (controller->ShouldRequestVideo()) {
|
||||
+#if 0
|
||||
permissions::PermissionResult permission_status =
|
||||
permission_manager->GetPermissionStatusForCurrentDocument(
|
||||
ContentSettingsType::MEDIASTREAM_CAMERA, rfh);
|
||||
@@ -124,6 +129,7 @@ void MediaStreamDevicesController::RequestPermissions(
|
||||
permissions::PermissionStatusSource::FEATURE_POLICY);
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
|
||||
permission_types.push_back(blink::PermissionType::VIDEO_CAPTURE);
|
||||
|
||||
@@ -135,6 +141,7 @@ void MediaStreamDevicesController::RequestPermissions(
|
||||
// pan-tilt-zoom permission and there are suitable PTZ capable devices
|
||||
// available.
|
||||
if (request.request_pan_tilt_zoom_permission && has_pan_tilt_zoom_camera) {
|
||||
+#if 0
|
||||
permission_status =
|
||||
permission_manager->GetPermissionStatusForCurrentDocument(
|
||||
ContentSettingsType::CAMERA_PAN_TILT_ZOOM, rfh);
|
||||
@@ -144,6 +151,7 @@ void MediaStreamDevicesController::RequestPermissions(
|
||||
controller->RunCallback(/*blocked_by_permissions_policy=*/false);
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
|
||||
permission_types.push_back(blink::PermissionType::CAMERA_PAN_TILT_ZOOM);
|
||||
}
|
||||
@@ -417,6 +425,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
|
||||
if (rfh->GetLastCommittedOrigin().GetURL() != request_.security_origin) {
|
||||
return false;
|
||||
}
|
||||
+#if 0
|
||||
permissions::PermissionResult result =
|
||||
permissions::PermissionsClient::Get()
|
||||
->GetPermissionManager(web_contents_->GetBrowserContext())
|
||||
@@ -425,6 +434,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
|
||||
DCHECK_EQ(CONTENT_SETTING_BLOCK, result.content_setting);
|
||||
return true;
|
||||
}
|
||||
+#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
|
||||
does touch a security-sensitive class.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 8b236cbd54011bc0008d56ca4213920e478f7a90..ece0f7a284fc87f879d21e754b0b050236081d61 100644
|
||||
index 5499f85fa578511d5817ecd9be2f33cf56e2db4b..3f0a3b2133f0d48054f33df28b93a9ee40d7ed78 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -1752,9 +1752,15 @@ bool RenderProcessHostImpl::Init() {
|
||||
@@ -1762,9 +1762,15 @@ bool RenderProcessHostImpl::Init() {
|
||||
std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
|
||||
std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
|
||||
cmd_line.get(), IsJitDisabled());
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch
|
||||
Unsandboxed ppapi processes should skip zygote.
|
||||
|
||||
diff --git a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
|
||||
index b0279116fef365106926dd3b5e4cd5f0670c70ae..0b9e71de7a94d8b19b3534e8b8b9a5d56193567b 100644
|
||||
index 6e1d72902ec3e4a479304ff39b8b537d23f5cdf3..b7b198b159d250eca1498206ec29cc0270071f2a 100644
|
||||
--- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
|
||||
+++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
@@ -9,10 +9,10 @@ is needed for OSR.
|
||||
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 1ebb4970ef9c440c5c2584785397696c7ebc14ce..5f200acb893f6c6b4ffb7c5a6ca010dde8a245e9 100644
|
||||
index 9b532970afe951f7c12629903baa39f2b8de1a5e..6f01f3eb8df96320700448e4583e4a4a0b3d2beb 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3059,6 +3059,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3066,6 +3066,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
site_instance.get(), params.renderer_initiated_creation,
|
||||
params.main_frame_name, GetOpener(), primary_main_frame_policy);
|
||||
|
||||
@@ -26,7 +26,7 @@ index 1ebb4970ef9c440c5c2584785397696c7ebc14ce..5f200acb893f6c6b4ffb7c5a6ca010dd
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3069,6 +3076,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3076,6 +3083,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -35,10 +35,10 @@ index 1ebb4970ef9c440c5c2584785397696c7ebc14ce..5f200acb893f6c6b4ffb7c5a6ca010dd
|
||||
CHECK(view_.get());
|
||||
|
||||
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
||||
index f1b8dee6699c02884372aa05279d2d23274efdfd..922048fbc03f7222e42e3640b46d3d5e1b2391ba 100644
|
||||
index 5c710ded76711125c8e2de8e2c9bce7569548732..a3ae580ea073024882bd860abf914bbf7c0ed54d 100644
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -93,10 +93,13 @@ class BrowserContext;
|
||||
@@ -94,10 +94,13 @@ class BrowserContext;
|
||||
class BrowserPluginGuestDelegate;
|
||||
class RenderFrameHost;
|
||||
class RenderViewHost;
|
||||
@@ -52,7 +52,7 @@ index f1b8dee6699c02884372aa05279d2d23274efdfd..922048fbc03f7222e42e3640b46d3d5e
|
||||
class WebUI;
|
||||
struct DropData;
|
||||
struct MHTMLGenerationParams;
|
||||
@@ -234,6 +237,10 @@ class WebContents : public PageNavigator,
|
||||
@@ -236,6 +239,10 @@ class WebContents : public PageNavigator,
|
||||
network::mojom::WebSandboxFlags starting_sandbox_flags =
|
||||
network::mojom::WebSandboxFlags::kNone;
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ Note that we also need to manually update embedder's
|
||||
`api::WebContents::IsFullscreenForTabOrPending` value.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
index 187b94d207570a77f058915b9e5b581c777adc5a..55b56c4b18bba342db29bc493e07b27aee1f586a 100644
|
||||
index 9c6f51f1667d9bf1b430a83747faebf633a324c7..edc7111e2a61c917ec987264ddfbc4ee55f33730 100644
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -6509,6 +6509,15 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
notified_instances.insert(parent_site_instance);
|
||||
@@ -6565,6 +6565,17 @@ void RenderFrameHostImpl::EnterFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
+ // Entering fullscreen from webview should also notify its outer frame.
|
||||
@@ -26,8 +26,10 @@ index 187b94d207570a77f058915b9e5b581c777adc5a..55b56c4b18bba342db29bc493e07b27a
|
||||
+ RenderFrameProxyHost* outer_proxy =
|
||||
+ frame_tree_node()->render_manager()->GetProxyToOuterDelegate();
|
||||
+ DCHECK(outer_proxy);
|
||||
+ outer_proxy->GetAssociatedRemoteFrame()->WillEnterFullscreen(
|
||||
+ options.Clone());
|
||||
+ if (outer_proxy->is_render_frame_proxy_live()) {
|
||||
+ outer_proxy->GetAssociatedRemoteFrame()->WillEnterFullscreen(
|
||||
+ options.Clone());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// Focus the window if another frame may have delegated the capability.
|
||||
|
||||
@@ -26,10 +26,10 @@ index 1dfe162dc69f404b49bae6197fa7b713600eb9bd..dedfb41c933ad7930cbab5aae502e1df
|
||||
// An empty URL is returned if the URL is not overriden.
|
||||
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index a5f2807bfa3bd2515aac5fb2090780720a860314..0533dbcdb64af9ebf3f3dcec36038fe76136a15a 100644
|
||||
index e6ed59bb367c2ec8997867d847d79304b5e78be4..f2401245c4feb507966a47c82c66d956802d5ede 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -909,6 +909,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
@@ -873,6 +873,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
||||
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ index a5f2807bfa3bd2515aac5fb2090780720a860314..0533dbcdb64af9ebf3f3dcec36038fe7
|
||||
const v8::Local<v8::Context>& worker) {
|
||||
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index 40146f89d1d946674025c51896fed23a9782b4fb..af85bef23dbc259ba4554aaa28cf3c06a80ea437 100644
|
||||
index 62370f36f8b19c409e65c3d19a7536a50c7f3d0c..ad67b32366ee276d4a9917e17ce335c3ec507a48 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -191,6 +191,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -183,6 +183,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
@@ -55,10 +55,10 @@ index 40146f89d1d946674025c51896fed23a9782b4fb..af85bef23dbc259ba4554aaa28cf3c06
|
||||
const blink::WebSecurityOrigin& script_origin) override;
|
||||
blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel()
|
||||
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
||||
index a9ba1b0ec765ee51b1341afe81210e87d2c93c82..2970cb32f408fa812cc006f3c70ec5c55115781b 100644
|
||||
index b3845ea3620684e3a89f9c2a99fb9c8505f942e2..d7fed3409f1846d9655aa2b4adc89768af8ba22f 100644
|
||||
--- a/third_party/blink/public/platform/platform.h
|
||||
+++ b/third_party/blink/public/platform/platform.h
|
||||
@@ -675,6 +675,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
@@ -638,6 +638,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
virtual void DidStartWorkerThread() {}
|
||||
virtual void WillStopWorkerThread() {}
|
||||
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
||||
|
||||
@@ -35,10 +35,10 @@ index dedfb41c933ad7930cbab5aae502e1df28cf05e4..8ad7306886109e827a8a692fee39f7c7
|
||||
// from the worker thread.
|
||||
virtual void WillDestroyWorkerContextOnWorkerThread(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
||||
index 0533dbcdb64af9ebf3f3dcec36038fe76136a15a..6f4019347855650cb2203f59c5568e2a029639a1 100644
|
||||
index f2401245c4feb507966a47c82c66d956802d5ede..916fc0110338224c21bc6cc29536a152659e9569 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.cc
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
||||
@@ -921,6 +921,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
|
||||
@@ -885,6 +885,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
|
||||
worker);
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ index 0533dbcdb64af9ebf3f3dcec36038fe76136a15a..6f4019347855650cb2203f59c5568e2a
|
||||
const blink::WebSecurityOrigin& script_origin) {
|
||||
return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker(
|
||||
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
||||
index af85bef23dbc259ba4554aaa28cf3c06a80ea437..d6368cee4c3a87882bac1d1d63df8698dd96b0fa 100644
|
||||
index ad67b32366ee276d4a9917e17ce335c3ec507a48..62bc2b9122733d397093fdba0b2315cb0993cb48 100644
|
||||
--- a/content/renderer/renderer_blink_platform_impl.h
|
||||
+++ b/content/renderer/renderer_blink_platform_impl.h
|
||||
@@ -191,6 +191,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
@@ -183,6 +183,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
||||
void DidStartWorkerThread() override;
|
||||
void WillStopWorkerThread() override;
|
||||
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
||||
@@ -65,10 +65,10 @@ index af85bef23dbc259ba4554aaa28cf3c06a80ea437..d6368cee4c3a87882bac1d1d63df8698
|
||||
bool AllowScriptExtensionForServiceWorker(
|
||||
const blink::WebSecurityOrigin& script_origin) override;
|
||||
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
||||
index 2970cb32f408fa812cc006f3c70ec5c55115781b..808234569ff2fc80945b2707020197302e20d856 100644
|
||||
index d7fed3409f1846d9655aa2b4adc89768af8ba22f..169916298918d19f23f4e4dce5a306e94d640226 100644
|
||||
--- a/third_party/blink/public/platform/platform.h
|
||||
+++ b/third_party/blink/public/platform/platform.h
|
||||
@@ -675,6 +675,8 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
@@ -638,6 +638,8 @@ class BLINK_PLATFORM_EXPORT Platform {
|
||||
virtual void DidStartWorkerThread() {}
|
||||
virtual void WillStopWorkerThread() {}
|
||||
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
||||
@@ -78,10 +78,10 @@ index 2970cb32f408fa812cc006f3c70ec5c55115781b..808234569ff2fc80945b270702019730
|
||||
virtual bool AllowScriptExtensionForServiceWorker(
|
||||
const WebSecurityOrigin& script_origin) {
|
||||
diff --git a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc
|
||||
index 03288c7b1897ee2c18b80677ee5837246d36568a..fc10bbf3d92c7f88c734d8ecfb20dbc4b72ae200 100644
|
||||
index ae3d2a664a9bd758d495f90f237f4f0ae768aef9..b56470ef35862f1b1b2af69bc48d842d2aa4ba7c 100644
|
||||
--- a/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc
|
||||
+++ b/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc
|
||||
@@ -257,6 +257,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() {
|
||||
@@ -262,6 +262,7 @@ void WorkerOrWorkletScriptController::PrepareForEvaluation() {
|
||||
V8PerContextData* per_context_data = script_state_->PerContextData();
|
||||
std::ignore =
|
||||
per_context_data->ConstructorForType(global_scope_->GetWrapperTypeInfo());
|
||||
|
||||
@@ -7,12 +7,12 @@ This adds GN build files for Node, so we don't have to build with GYP.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4afca42d22ee702af50da92aa08c1de897891424
|
||||
index 0000000000000000000000000000000000000000..9e34a074cfa7dec61c4e11821ba5f1969f393dfb
|
||||
--- /dev/null
|
||||
+++ b/BUILD.gn
|
||||
@@ -0,0 +1,403 @@
|
||||
+import("//electron/build/asar.gni")
|
||||
+import("//v8/gni/v8.gni")
|
||||
+import("node.gni")
|
||||
+
|
||||
+declare_args() {
|
||||
+ # Enable the V8 inspector protocol for use with node.
|
||||
@@ -1593,6 +1593,41 @@ index 0000000000000000000000000000000000000000..a2cfdffcd7308b73c5c302ebc4b946c6
|
||||
+ "//v8/include/v8.h"
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/node.gni b/node.gni
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9b1a4048a4a64c36d88de0bbe1a548c906aaa22c
|
||||
--- /dev/null
|
||||
+++ b/node.gni
|
||||
@@ -0,0 +1,29 @@
|
||||
+# Run an action with a given working directory. Behaves identically to the
|
||||
+# action() target type, with the exception that it changes directory before
|
||||
+# running the script.
|
||||
+#
|
||||
+# Parameters:
|
||||
+# cwd [required]: Directory to change to before running the script.
|
||||
+template("chdir_action") {
|
||||
+ action(target_name) {
|
||||
+ forward_variables_from(invoker,
|
||||
+ "*",
|
||||
+ [
|
||||
+ "script",
|
||||
+ "args",
|
||||
+ ])
|
||||
+ assert(defined(cwd), "Need cwd in $target_name")
|
||||
+ script = "//electron/build/run-in-dir.py"
|
||||
+ if (defined(sources)) {
|
||||
+ sources += [ invoker.script ]
|
||||
+ } else {
|
||||
+ assert(defined(inputs))
|
||||
+ inputs += [ invoker.script ]
|
||||
+ }
|
||||
+ args = [
|
||||
+ rebase_path(cwd),
|
||||
+ rebase_path(invoker.script),
|
||||
+ ]
|
||||
+ args += invoker.args
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/inspector/BUILD.gn b/src/inspector/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb3048361d9d591
|
||||
@@ -1799,7 +1834,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
|
||||
+ args = rebase_path(inputs + outputs, root_build_dir)
|
||||
+}
|
||||
diff --git a/src/node_version.h b/src/node_version.h
|
||||
index 39f6406dd2b52e16a2be5c00c554da30a806ead9..36117c5b36c65f0a8a9bb9c421bc74b82f2b1f3a 100644
|
||||
index 0f1a9b52cccba1e54150494a7ee5b28961a8d59d..bb68b2dfef4a693d8a1d0fe056fe696254d12d09 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
|
||||
@@ -45,10 +45,10 @@ index bdfe81d11cc50f492c93fe48f6946765b6fb5238..ca08deeb19f5fe9ee399ad809b24579f
|
||||
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
|
||||
}],
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 95b31769cb5756578d66193716c638f504bd44aa..fe741d15da821396883dd72b4e0a42c7758bd557 100755
|
||||
index fed2688c792486e5f86509eea0dd6d45f749a99d..426afed7cd0a3a403d4b753af0b25f55024d0f71 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -1433,6 +1433,7 @@ def configure_v8(o):
|
||||
@@ -1439,6 +1439,7 @@ def configure_v8(o):
|
||||
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
|
||||
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
|
||||
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
|
||||
|
||||
@@ -10,4 +10,3 @@ revert_fix_cppgc_removed_deleted_cstors_in_cppheapcreateparams.patch
|
||||
revert_runtime_dhceck_terminating_exception_in_microtasks.patch
|
||||
chore_disable_is_execution_terminating_dcheck.patch
|
||||
build_remove_legacy_oom_error_callback.patch
|
||||
cherry-pick-5e227bebf193.patch
|
||||
|
||||
@@ -9,10 +9,10 @@ necessary for native modules to load.
|
||||
Also, some fixes relating to mksnapshot on ARM.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index c51da9f12ecab41256bf0cdb7a0170e99302dc35..a0154b94bf390b639e1144bc3eb6041631b29716 100644
|
||||
index c918081b31fdf15efd325ae9d688f6c4f59aded1..3820a03365e58a05f2df16195ed6061f1c451a05 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -626,7 +626,7 @@ config("internal_config") {
|
||||
@@ -636,7 +636,7 @@ config("internal_config") {
|
||||
":cppgc_header_features",
|
||||
]
|
||||
|
||||
@@ -21,7 +21,7 @@ index c51da9f12ecab41256bf0cdb7a0170e99302dc35..a0154b94bf390b639e1144bc3eb60416
|
||||
defines += [ "BUILDING_V8_SHARED" ]
|
||||
}
|
||||
|
||||
@@ -5986,7 +5986,7 @@ if (current_toolchain == v8_generator_toolchain) {
|
||||
@@ -5999,7 +5999,7 @@ if (current_toolchain == v8_generator_toolchain) {
|
||||
"src/interpreter/bytecodes.h",
|
||||
]
|
||||
|
||||
@@ -30,7 +30,7 @@ index c51da9f12ecab41256bf0cdb7a0170e99302dc35..a0154b94bf390b639e1144bc3eb60416
|
||||
|
||||
deps = [
|
||||
":v8_libbase",
|
||||
@@ -6024,6 +6024,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
|
||||
@@ -6037,6 +6037,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
|
||||
|
||||
configs = [ ":internal_config" ]
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ index b39921dea0415362d1a30159f3fac0e345e2313e..810fc4edaf69565959148d3c1ec662f0
|
||||
bool is_heap_oom = false;
|
||||
const char* detail = nullptr;
|
||||
diff --git a/include/v8-initialization.h b/include/v8-initialization.h
|
||||
index 5cadd1788926a7b305ba4d05792b9efa6183d73e..c01c337317afb088927cae0239542281a89d1bb1 100644
|
||||
index 66adf98c17998dd81178e515db01ef43daae14d7..224ae0dc6b34b4724192a1b0547be110f796a9b2 100644
|
||||
--- a/include/v8-initialization.h
|
||||
+++ b/include/v8-initialization.h
|
||||
@@ -286,9 +286,6 @@ class V8_EXPORT V8 {
|
||||
@@ -284,9 +284,6 @@ class V8_EXPORT V8 {
|
||||
*/
|
||||
static void SetFatalMemoryErrorCallback(OOMErrorCallback callback);
|
||||
|
||||
@@ -69,10 +69,10 @@ index b54c7388603b4582356f6741c9a36f2835aa1928..b9533b78046228705e2038396eebf23b
|
||||
void SetOOMErrorHandler(OOMErrorCallback that);
|
||||
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a0b9ae99a 100644
|
||||
index 9fafa6b0089aabf55984b68cff85e353fe50ce52..9472ad8f4f776f98d398113b22a6a710596b3cde 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -167,13 +167,6 @@
|
||||
@@ -171,13 +171,6 @@
|
||||
|
||||
namespace v8 {
|
||||
|
||||
@@ -86,7 +86,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
static OOMErrorCallback g_oom_error_callback = nullptr;
|
||||
|
||||
static ScriptOrigin GetScriptOriginForScript(i::Isolate* i_isolate,
|
||||
@@ -231,9 +224,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location,
|
||||
@@ -235,9 +228,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location,
|
||||
// Give the embedder a chance to handle the condition. If it doesn't,
|
||||
// just crash.
|
||||
if (g_oom_error_callback) g_oom_error_callback(location, details);
|
||||
@@ -96,7 +96,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
FATAL("Fatal process out of memory: %s", location);
|
||||
UNREACHABLE();
|
||||
}
|
||||
@@ -309,9 +299,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location,
|
||||
@@ -313,9 +303,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location,
|
||||
}
|
||||
Utils::ReportOOMFailure(i_isolate, location, details);
|
||||
if (g_oom_error_callback) g_oom_error_callback(location, details);
|
||||
@@ -106,7 +106,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
// If the fatal error handler returns, we stop execution.
|
||||
FATAL("API fatal error handler returned after process out of memory");
|
||||
}
|
||||
@@ -343,8 +330,6 @@ void Utils::ReportOOMFailure(i::Isolate* i_isolate, const char* location,
|
||||
@@ -347,8 +334,6 @@ void Utils::ReportOOMFailure(i::Isolate* i_isolate, const char* location,
|
||||
const OOMDetails& details) {
|
||||
if (auto oom_callback = i_isolate->oom_behavior()) {
|
||||
oom_callback(location, details);
|
||||
@@ -115,7 +115,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
} else {
|
||||
// TODO(wfh): Remove this fallback once Blink is setting OOM handler. See
|
||||
// crbug.com/614440.
|
||||
@@ -6141,11 +6126,6 @@ void v8::V8::SetFatalMemoryErrorCallback(
|
||||
@@ -6175,11 +6160,6 @@ void v8::V8::SetFatalMemoryErrorCallback(
|
||||
g_oom_error_callback = oom_error_callback;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
void v8::V8::SetEntropySource(EntropySource entropy_source) {
|
||||
base::RandomNumberGenerator::SetEntropySource(entropy_source);
|
||||
}
|
||||
@@ -8654,8 +8634,6 @@ void Isolate::Initialize(Isolate* v8_isolate,
|
||||
@@ -8702,8 +8682,6 @@ void Isolate::Initialize(Isolate* v8_isolate,
|
||||
#endif
|
||||
if (params.oom_error_callback) {
|
||||
v8_isolate->SetOOMErrorHandler(params.oom_error_callback);
|
||||
@@ -136,7 +136,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
}
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
@@ -9397,8 +9375,6 @@ size_t Isolate::CopyCodePages(size_t capacity, MemoryRange* code_pages_out) {
|
||||
@@ -9445,8 +9423,6 @@ size_t Isolate::CopyCodePages(size_t capacity, MemoryRange* code_pages_out) {
|
||||
|
||||
CALLBACK_SETTER(FatalErrorHandler, FatalErrorCallback, exception_behavior)
|
||||
CALLBACK_SETTER(OOMErrorHandler, OOMErrorCallback, oom_behavior)
|
||||
@@ -146,7 +146,7 @@ index 82ed3b8c44b62d67fc7e897423ca1c1999befb7f..dcae2f80cba468c1a98e589fd68ce60a
|
||||
ModifyCodeGenerationFromStringsCallback2,
|
||||
modify_code_gen_callback2)
|
||||
diff --git a/src/execution/isolate.h b/src/execution/isolate.h
|
||||
index 00494e347438e92b509ec67f4d77688e091d348b..8c151c8674fdb5d4b3af3de88e97e70239fa8ed7 100644
|
||||
index 13100146bdc981480a08156b54649b8f995789ae..9a117c4220704ed512b117aa2f50c3791f8e9189 100644
|
||||
--- a/src/execution/isolate.h
|
||||
+++ b/src/execution/isolate.h
|
||||
@@ -487,16 +487,9 @@ V8_EXPORT_PRIVATE void FreeCurrentEmbeddedBlob();
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Date: Sat, 9 Jul 2022 14:05:56 +0200
|
||||
Subject: Fix undefined symbol linker error
|
||||
|
||||
Assembler::CheckBuffer() was defined inline in a header file but without
|
||||
inline linkage, causing an undefined symbol link error on arm64 macOS.
|
||||
|
||||
Fixes: https://github.com/nodejs/node-v8/issues/233
|
||||
Bug: v8:13055
|
||||
Change-Id: Ifb638705e95de72b2e8d472e7092e88d77cf8ba8
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3749583
|
||||
Auto-Submit: Ben Noordhuis <info@bnoordhuis.nl>
|
||||
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
|
||||
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
|
||||
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#81749}
|
||||
|
||||
diff --git a/src/codegen/arm64/assembler-arm64-inl.h b/src/codegen/arm64/assembler-arm64-inl.h
|
||||
index da4201b28307a71e988b50e26fc8854fdcc510d4..60deb07b65b5acaaa1e8762cc57730f366f483d2 100644
|
||||
--- a/src/codegen/arm64/assembler-arm64-inl.h
|
||||
+++ b/src/codegen/arm64/assembler-arm64-inl.h
|
||||
@@ -1066,21 +1066,6 @@ const Register& Assembler::AppropriateZeroRegFor(const CPURegister& reg) const {
|
||||
return reg.Is64Bits() ? xzr : wzr;
|
||||
}
|
||||
|
||||
-inline void Assembler::CheckBufferSpace() {
|
||||
- DCHECK_LT(pc_, buffer_start_ + buffer_->size());
|
||||
- if (V8_UNLIKELY(buffer_space() < kGap)) {
|
||||
- GrowBuffer();
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-V8_INLINE void Assembler::CheckBuffer() {
|
||||
- CheckBufferSpace();
|
||||
- if (pc_offset() >= next_veneer_pool_check_) {
|
||||
- CheckVeneerPool(false, true);
|
||||
- }
|
||||
- constpool_.MaybeCheck();
|
||||
-}
|
||||
-
|
||||
EnsureSpace::EnsureSpace(Assembler* assembler) : block_pools_scope_(assembler) {
|
||||
assembler->CheckBufferSpace();
|
||||
}
|
||||
diff --git a/src/codegen/arm64/assembler-arm64.h b/src/codegen/arm64/assembler-arm64.h
|
||||
index 703e4bba9381c57849882e7cb2cdeb751064dd2a..dceda86275d3ef0bfc2b5bea9d8f04957b2e721c 100644
|
||||
--- a/src/codegen/arm64/assembler-arm64.h
|
||||
+++ b/src/codegen/arm64/assembler-arm64.h
|
||||
@@ -2625,8 +2625,21 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
}
|
||||
|
||||
void GrowBuffer();
|
||||
- V8_INLINE void CheckBufferSpace();
|
||||
- void CheckBuffer();
|
||||
+
|
||||
+ void CheckBufferSpace() {
|
||||
+ DCHECK_LT(pc_, buffer_start_ + buffer_->size());
|
||||
+ if (V8_UNLIKELY(buffer_space() < kGap)) {
|
||||
+ GrowBuffer();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ void CheckBuffer() {
|
||||
+ CheckBufferSpace();
|
||||
+ if (pc_offset() >= next_veneer_pool_check_) {
|
||||
+ CheckVeneerPool(false, true);
|
||||
+ }
|
||||
+ constpool_.MaybeCheck();
|
||||
+ }
|
||||
|
||||
// Emission of the veneer pools may be blocked in some code sequences.
|
||||
int veneer_pool_blocked_nesting_; // Block emission if this is not zero.
|
||||
@@ -6,10 +6,10 @@ Subject: dcheck.patch
|
||||
https://github.com/auchenberg/volkswagen
|
||||
|
||||
diff --git a/src/api/api.cc b/src/api/api.cc
|
||||
index fb22f212024d84555e5a5acdfc70ffa6259b9846..82ed3b8c44b62d67fc7e897423ca1c1999befb7f 100644
|
||||
index bbab4c72ac93fe7a5bba5de531e66be0775244ca..9fafa6b0089aabf55984b68cff85e353fe50ce52 100644
|
||||
--- a/src/api/api.cc
|
||||
+++ b/src/api/api.cc
|
||||
@@ -9146,7 +9146,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
|
||||
@@ -9194,7 +9194,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
|
||||
}
|
||||
|
||||
void Isolate::PerformMicrotaskCheckpoint() {
|
||||
@@ -19,7 +19,7 @@ index fb22f212024d84555e5a5acdfc70ffa6259b9846..82ed3b8c44b62d67fc7e897423ca1c19
|
||||
i_isolate->default_microtask_queue()->PerformCheckpoint(this);
|
||||
}
|
||||
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
||||
index df03810a6fea9ee45a9e8dfb8845f8e6eebbcc08..e2a2fdf77d434c504547d7589f67c556f1f2ae2c 100644
|
||||
index 5ed434303b6be71dc99abd7600f4ef489f763419..7e2952b9b14f915df72573d6be0813401da0cafb 100644
|
||||
--- a/src/heap/heap.cc
|
||||
+++ b/src/heap/heap.cc
|
||||
@@ -6195,9 +6195,9 @@ void Heap::TearDown() {
|
||||
|
||||
@@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not
|
||||
contain any standard C++ library exports (e.g. `std::ostringstream`).
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index 12df5c4fb41f5e710dfeac145d69d6a28e53c064..012e1755e11afed5cb154240cce4c6996790aa57 100644
|
||||
index b6a232081301a74ffbffb98311fc29c4015fc9f9..f5d605043e7f43324fd0bdf74f1decf634143cb0 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -626,6 +626,10 @@ config("internal_config") {
|
||||
@@ -636,6 +636,10 @@ config("internal_config") {
|
||||
":cppgc_header_features",
|
||||
]
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch
|
||||
Needed in order to target mksnapshot for mksnapshot zip.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index a0154b94bf390b639e1144bc3eb6041631b29716..12df5c4fb41f5e710dfeac145d69d6a28e53c064 100644
|
||||
index 3820a03365e58a05f2df16195ed6061f1c451a05..b6a232081301a74ffbffb98311fc29c4015fc9f9 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -5998,7 +5998,6 @@ if (current_toolchain == v8_generator_toolchain) {
|
||||
@@ -6011,7 +6011,6 @@ if (current_toolchain == v8_generator_toolchain) {
|
||||
|
||||
if (current_toolchain == v8_snapshot_toolchain) {
|
||||
v8_executable("mksnapshot") {
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: usage of c++ [[deprecated]] attribute for older msvc versions
|
||||
This attribute can only be used in all contexts in Visual Studio 2019
|
||||
|
||||
diff --git a/include/v8config.h b/include/v8config.h
|
||||
index 714d8a6f057ae98d8809a55e83c323c805170e8d..66ee2bd73b47231c17795ad0b23e558216878cae 100644
|
||||
index 6213da2ef434fff934b298eada084647d7a6ddc4..754743b0c82e2ccf9a330d18785f8cb59df80869 100644
|
||||
--- a/include/v8config.h
|
||||
+++ b/include/v8config.h
|
||||
@@ -454,10 +454,13 @@ path. Add it with -I<path> to the command line
|
||||
|
||||
@@ -18,10 +18,10 @@ index ca4b1dc557f573bfcde200201cbd2f05e3c6b530..9edc8ce00c524a63cb23911a474f1904
|
||||
StoreRoot(RootIndex::kCurrentMicrotask, microtask);
|
||||
TNode<IntPtrT> saved_entered_context_count = GetEnteredContextCount();
|
||||
diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc
|
||||
index 2d2ac48555bdec0b96acd0cd8aafb47e71d4a53c..81d6204d3efd0f55105ec48ee6627293b2ffe5fc 100644
|
||||
index a984d2ce736a2c9a46eb7cc46eb03fc062f508d2..6bda9bc5878b1ee344eac9f9c4420db09a307792 100644
|
||||
--- a/src/codegen/code-stub-assembler.cc
|
||||
+++ b/src/codegen/code-stub-assembler.cc
|
||||
@@ -6156,12 +6156,6 @@ void CodeStubAssembler::SetPendingMessage(TNode<HeapObject> message) {
|
||||
@@ -6123,12 +6123,6 @@ void CodeStubAssembler::SetPendingMessage(TNode<HeapObject> message) {
|
||||
StoreFullTaggedNoWriteBarrier(pending_message, message);
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ index 2d2ac48555bdec0b96acd0cd8aafb47e71d4a53c..81d6204d3efd0f55105ec48ee6627293
|
||||
int type) {
|
||||
return Word32Equal(instance_type, Int32Constant(type));
|
||||
diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h
|
||||
index 79844e15dff8bcc9da7df17e3b76677c8cd5f87c..7efd34e45a3e263d86f1f3cef54b24c68424a8d4 100644
|
||||
index 9633ba5333c4f1c37e706f655fe37c59c4993b86..6022d5d5063bc6c4db1c15e1ffaaf4d5420c0a01 100644
|
||||
--- a/src/codegen/code-stub-assembler.h
|
||||
+++ b/src/codegen/code-stub-assembler.h
|
||||
@@ -2532,7 +2532,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
|
||||
@@ -2518,7 +2518,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
|
||||
|
||||
TNode<HeapObject> GetPendingMessage();
|
||||
void SetPendingMessage(TNode<HeapObject> message);
|
||||
|
||||
@@ -39,10 +39,10 @@ index 818af524388b1aba51e984b7ff7f7b856d1e590b..7ba8a0e9bc11a65e72e66aebd87e1935
|
||||
const Operand& operand, FlagsUpdate S, AddSubOp op) {
|
||||
DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits());
|
||||
diff --git a/src/codegen/arm64/assembler-arm64.h b/src/codegen/arm64/assembler-arm64.h
|
||||
index f12e1ef130451afa1cb334a4ba07bdb2588ccc24..703e4bba9381c57849882e7cb2cdeb751064dd2a 100644
|
||||
index e3d8eb27dea2d241933bcb597bef35b46fcd2a09..0a752245ec25c80d5ed34b1a858fa43cc0d6dd40 100644
|
||||
--- a/src/codegen/arm64/assembler-arm64.h
|
||||
+++ b/src/codegen/arm64/assembler-arm64.h
|
||||
@@ -2119,11 +2119,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
@@ -2120,11 +2120,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
return rm.code() << Rm_offset;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ index f12e1ef130451afa1cb334a4ba07bdb2588ccc24..703e4bba9381c57849882e7cb2cdeb75
|
||||
|
||||
static Instr Ra(CPURegister ra) {
|
||||
DCHECK_NE(ra.code(), kSPRegInternalCode);
|
||||
@@ -2147,15 +2143,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
@@ -2148,15 +2144,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
|
||||
|
||||
// These encoding functions allow the stack pointer to be encoded, and
|
||||
// disallow the zero register.
|
||||
|
||||
@@ -128,9 +128,8 @@ function assetsForVersion (version, validatingRelease) {
|
||||
`electron-${version}-mas-arm64-dsym-snapshot.zip`,
|
||||
`electron-${version}-mas-arm64-symbols.zip`,
|
||||
`electron-${version}-mas-arm64.zip`,
|
||||
// TODO(vertedinde) Symbol generation on 32-bit Windows is temporarily disabled due to CI failures
|
||||
// `electron-${version}-win32-ia32-pdb.zip`,
|
||||
// `electron-${version}-win32-ia32-symbols.zip`,
|
||||
`electron-${version}-win32-ia32-pdb.zip`,
|
||||
`electron-${version}-win32-ia32-symbols.zip`,
|
||||
`electron-${version}-win32-ia32.zip`,
|
||||
`electron-${version}-win32-x64-pdb.zip`,
|
||||
`electron-${version}-win32-x64-symbols.zip`,
|
||||
|
||||
@@ -76,10 +76,9 @@ def main():
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'dist.zip'), electron_zip)
|
||||
upload_electron(release, electron_zip, args)
|
||||
if get_target_arch() != 'mips64el':
|
||||
if (get_target_arch() != 'ia32' or PLATFORM != 'win32'):
|
||||
symbols_zip = os.path.join(OUT_DIR, SYMBOLS_NAME)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'symbols.zip'), symbols_zip)
|
||||
upload_electron(release, symbols_zip, args)
|
||||
symbols_zip = os.path.join(OUT_DIR, SYMBOLS_NAME)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'symbols.zip'), symbols_zip)
|
||||
upload_electron(release, symbols_zip, args)
|
||||
if PLATFORM == 'darwin':
|
||||
if get_platform_key() == 'darwin' and get_target_arch() == 'x64':
|
||||
api_path = os.path.join(ELECTRON_DIR, 'electron-api.json')
|
||||
@@ -96,10 +95,9 @@ def main():
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'dsym-snapshot.zip'), dsym_snapshot_zip)
|
||||
upload_electron(release, dsym_snapshot_zip, args)
|
||||
elif PLATFORM == 'win32':
|
||||
if get_target_arch() != 'ia32':
|
||||
pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)
|
||||
upload_electron(release, pdb_zip, args)
|
||||
pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)
|
||||
upload_electron(release, pdb_zip, args)
|
||||
elif PLATFORM == 'linux':
|
||||
debug_zip = os.path.join(OUT_DIR, DEBUG_NAME)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'debug.zip'), debug_zip)
|
||||
|
||||
@@ -190,7 +190,9 @@ bool ElectronCrashReporterClient::GetShouldCompressUploads() {
|
||||
|
||||
void ElectronCrashReporterClient::GetProcessSimpleAnnotations(
|
||||
std::map<std::string, std::string>* annotations) {
|
||||
*annotations = global_annotations_;
|
||||
for (auto&& pair : global_annotations_) {
|
||||
(*annotations)[pair.first] = pair.second;
|
||||
}
|
||||
(*annotations)["prod"] = ELECTRON_PRODUCT_NAME;
|
||||
(*annotations)["ver"] = ELECTRON_VERSION_STRING;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
||||
@@ -395,7 +395,7 @@ absl::optional<base::TimeDelta> GetCursorBlinkInterval() {
|
||||
if (system_value)
|
||||
return *system_value;
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
if (auto* linux_ui = views::LinuxUI::instance())
|
||||
if (auto* linux_ui = ui::LinuxUi::instance())
|
||||
return linux_ui->GetCursorBlinkInterval();
|
||||
#elif BUILDFLAG(IS_WIN)
|
||||
const auto system_msec = ::GetCaretBlinkTime();
|
||||
|
||||
@@ -28,10 +28,6 @@ void AddGuest(int guest_instance_id,
|
||||
electron::WebContentsZoomController::FromWebContents(guest_web_contents)
|
||||
->SetDefaultZoomFactor(zoom_factor);
|
||||
}
|
||||
|
||||
WebContentsPreferences::From(guest_web_contents)->Merge(options);
|
||||
// Trigger re-calculation of webkit prefs.
|
||||
guest_web_contents->NotifyPreferencesChanged();
|
||||
}
|
||||
|
||||
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
|
||||
|
||||
@@ -1541,8 +1541,8 @@ bool ElectronBrowserClient::PreSpawnChild(sandbox::TargetPolicy* policy,
|
||||
ChildSpawnFlags flags) {
|
||||
// Allow crashpad to communicate via named pipe.
|
||||
sandbox::ResultCode result = policy->AddRule(
|
||||
sandbox::TargetPolicy::SUBSYS_FILES,
|
||||
sandbox::TargetPolicy::FILES_ALLOW_ANY, L"\\??\\pipe\\crashpad_*");
|
||||
sandbox::SubSystem::kFiles, sandbox::Semantics::kFilesAllowAny,
|
||||
L"\\??\\pipe\\crashpad_*");
|
||||
if (result != sandbox::SBOX_ALL_OK)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
@@ -76,9 +76,9 @@
|
||||
#include "ui/gfx/color_utils.h"
|
||||
#include "ui/gtk/gtk_compat.h" // nogncheck
|
||||
#include "ui/gtk/gtk_util.h" // nogncheck
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#include "ui/linux/linux_ui_factory.h"
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/views/linux_ui/linux_ui_factory.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
@@ -217,6 +217,7 @@ int ElectronBrowserMainParts::PreEarlyInitialization() {
|
||||
HandleSIGCHLD();
|
||||
#endif
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
DetectOzonePlatform();
|
||||
ui::OzonePlatform::PreEarlyInitialization();
|
||||
#endif
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
@@ -277,12 +278,6 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
|
||||
}
|
||||
|
||||
int ElectronBrowserMainParts::PreCreateThreads() {
|
||||
#if defined(USE_AURA)
|
||||
if (!display::Screen::GetScreen()) {
|
||||
screen_ = views::CreateDesktopScreen();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!views::LayoutProvider::Get())
|
||||
layout_provider_ = std::make_unique<views::LayoutProvider>();
|
||||
|
||||
@@ -313,6 +308,14 @@ int ElectronBrowserMainParts::PreCreateThreads() {
|
||||
// Load resources bundle according to locale.
|
||||
std::string loaded_locale = LoadResourceBundle(locale);
|
||||
|
||||
#if defined(USE_AURA)
|
||||
// NB: must be called _after_ locale resource bundle is loaded,
|
||||
// because ui lib makes use of it in X11
|
||||
if (!display::Screen::GetScreen()) {
|
||||
screen_ = views::CreateDesktopScreen();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialize the app locale.
|
||||
std::string app_locale = l10n_util::GetApplicationLocale(loaded_locale);
|
||||
ElectronBrowserClient::SetApplicationLocale(app_locale);
|
||||
@@ -366,7 +369,7 @@ void ElectronBrowserMainParts::PostDestroyThreads() {
|
||||
|
||||
void ElectronBrowserMainParts::ToolkitInitialized() {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
auto linux_ui = CreateLinuxUi();
|
||||
auto linux_ui = ui::CreateLinuxUi();
|
||||
DCHECK(ui::LinuxInputMethodContextFactory::instance());
|
||||
|
||||
// Try loading gtk symbols used by Electron.
|
||||
@@ -388,7 +391,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() {
|
||||
// here returns a NativeThemeGtk, which monitors GTK settings.
|
||||
dark_theme_observer_ = std::make_unique<DarkThemeObserver>();
|
||||
linux_ui->GetNativeTheme(nullptr)->AddObserver(dark_theme_observer_.get());
|
||||
views::LinuxUI::SetInstance(std::move(linux_ui));
|
||||
ui::LinuxUi::SetInstance(std::move(linux_ui));
|
||||
|
||||
// Cursor theme changes are tracked by LinuxUI (via a CursorThemeManager
|
||||
// implementation). Start observing them once it's initialized.
|
||||
|
||||
@@ -122,6 +122,10 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
||||
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
void DetectOzonePlatform();
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void FreeAppDelegate();
|
||||
void RegisterURLHandler();
|
||||
|
||||
134
shell/browser/electron_browser_main_parts_linux.cc
Normal file
134
shell/browser/electron_browser_main_parts_linux.cc
Normal file
@@ -0,0 +1,134 @@
|
||||
// Copyright (c) 2022 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/electron_browser_main_parts.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/environment.h"
|
||||
#include "ui/ozone/public/ozone_switches.h"
|
||||
|
||||
#if BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
|
||||
constexpr char kPlatformWayland[] = "wayland";
|
||||
|
||||
bool HasWaylandDisplay(base::Environment* env) {
|
||||
std::string wayland_display;
|
||||
const bool has_wayland_display =
|
||||
env->GetVar("WAYLAND_DISPLAY", &wayland_display) &&
|
||||
!wayland_display.empty();
|
||||
if (has_wayland_display)
|
||||
return true;
|
||||
|
||||
std::string xdg_runtime_dir;
|
||||
const bool has_xdg_runtime_dir =
|
||||
env->GetVar("XDG_RUNTIME_DIR", &xdg_runtime_dir) &&
|
||||
!xdg_runtime_dir.empty();
|
||||
if (has_xdg_runtime_dir) {
|
||||
auto wayland_server_pipe =
|
||||
base::FilePath(xdg_runtime_dir).Append("wayland-0");
|
||||
// Normally, this should happen exactly once, at the startup of the main
|
||||
// process.
|
||||
base::ScopedAllowBlocking allow_blocking;
|
||||
return base::PathExists(wayland_server_pipe);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
|
||||
#if BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
constexpr char kPlatformX11[] = "x11";
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
// Evaluates the environment and returns the effective platform name for the
|
||||
// given |ozone_platform_hint|.
|
||||
// For the "auto" value, returns "wayland" if the XDG session type is "wayland",
|
||||
// "x11" otherwise.
|
||||
// For the "wayland" value, checks if the Wayland server is available, and
|
||||
// returns "x11" if it is not.
|
||||
// See https://crbug.com/1246928.
|
||||
std::string MaybeFixPlatformName(const std::string& ozone_platform_hint) {
|
||||
#if BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
// Wayland is selected if both conditions below are true:
|
||||
// 1. The user selected either 'wayland' or 'auto'.
|
||||
// 2. The XDG session type is 'wayland', OR the user has selected 'wayland'
|
||||
// explicitly and a Wayland server is running.
|
||||
// Otherwise, fall back to X11.
|
||||
if (ozone_platform_hint == kPlatformWayland ||
|
||||
ozone_platform_hint == "auto") {
|
||||
auto env(base::Environment::Create());
|
||||
|
||||
std::string xdg_session_type;
|
||||
const bool has_xdg_session_type =
|
||||
env->GetVar(base::nix::kXdgSessionTypeEnvVar, &xdg_session_type) &&
|
||||
!xdg_session_type.empty();
|
||||
|
||||
if ((has_xdg_session_type && xdg_session_type == "wayland") ||
|
||||
(ozone_platform_hint == kPlatformWayland &&
|
||||
HasWaylandDisplay(env.get()))) {
|
||||
return kPlatformWayland;
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
|
||||
#if BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
if (ozone_platform_hint == kPlatformX11) {
|
||||
return kPlatformX11;
|
||||
}
|
||||
#if BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
if (ozone_platform_hint == kPlatformWayland ||
|
||||
ozone_platform_hint == "auto") {
|
||||
// We are here if:
|
||||
// - The binary has both X11 and Wayland backends.
|
||||
// - The user wanted Wayland but that did not work, otherwise it would have
|
||||
// been returned above.
|
||||
if (ozone_platform_hint == kPlatformWayland) {
|
||||
LOG(WARNING) << "No Wayland server is available. Falling back to X11.";
|
||||
} else {
|
||||
LOG(WARNING) << "This is not a Wayland session. Falling back to X11. "
|
||||
"If you need to run Chrome on Wayland using some "
|
||||
"embedded compositor, e. g., Weston, please specify "
|
||||
"Wayland as your preferred Ozone platform, or use "
|
||||
"--ozone-platform=wayland.";
|
||||
}
|
||||
return kPlatformX11;
|
||||
}
|
||||
#endif // BUILDFLAG(OZONE_PLATFORM_WAYLAND)
|
||||
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
|
||||
return ozone_platform_hint;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void ElectronBrowserMainParts::DetectOzonePlatform() {
|
||||
auto* const command_line = base::CommandLine::ForCurrentProcess();
|
||||
if (!command_line->HasSwitch(switches::kOzonePlatform)) {
|
||||
const auto ozone_platform_hint =
|
||||
command_line->GetSwitchValueASCII(switches::kOzonePlatformHint);
|
||||
if (!ozone_platform_hint.empty()) {
|
||||
command_line->AppendSwitchASCII(
|
||||
switches::kOzonePlatform, MaybeFixPlatformName(ozone_platform_hint));
|
||||
}
|
||||
}
|
||||
|
||||
auto env = base::Environment::Create();
|
||||
std::string desktop_startup_id;
|
||||
if (env->GetVar("DESKTOP_STARTUP_ID", &desktop_startup_id))
|
||||
command_line->AppendSwitchASCII("desktop-startup-id", desktop_startup_id);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
@@ -253,6 +253,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) {
|
||||
// --js-flags.
|
||||
std::string js_flags =
|
||||
cmd->GetSwitchValueASCII(blink::switches::kJavaScriptFlags);
|
||||
js_flags.append(" --no-freeze-flags-after-init");
|
||||
if (!js_flags.empty())
|
||||
v8::V8::SetFlagsFromString(js_flags.c_str(), js_flags.size());
|
||||
|
||||
|
||||
@@ -12,23 +12,6 @@ using content::BrowserThread;
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
// Finds a device in |devices| that has |device_id|, or NULL if not found.
|
||||
const blink::MediaStreamDevice* FindDeviceWithId(
|
||||
const blink::MediaStreamDevices& devices,
|
||||
const std::string& device_id) {
|
||||
auto iter = devices.begin();
|
||||
for (; iter != devices.end(); ++iter) {
|
||||
if (iter->id == device_id) {
|
||||
return &(*iter);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
MediaCaptureDevicesDispatcher* MediaCaptureDevicesDispatcher::GetInstance() {
|
||||
return base::Singleton<MediaCaptureDevicesDispatcher>::get();
|
||||
}
|
||||
@@ -41,84 +24,6 @@ MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() {
|
||||
|
||||
MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() = default;
|
||||
|
||||
const blink::MediaStreamDevices&
|
||||
MediaCaptureDevicesDispatcher::GetAudioCaptureDevices() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (is_device_enumeration_disabled_)
|
||||
return test_audio_devices_;
|
||||
return content::MediaCaptureDevices::GetInstance()->GetAudioCaptureDevices();
|
||||
}
|
||||
|
||||
const blink::MediaStreamDevices&
|
||||
MediaCaptureDevicesDispatcher::GetVideoCaptureDevices() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
if (is_device_enumeration_disabled_)
|
||||
return test_video_devices_;
|
||||
return content::MediaCaptureDevices::GetInstance()->GetVideoCaptureDevices();
|
||||
}
|
||||
|
||||
void MediaCaptureDevicesDispatcher::GetDefaultDevices(
|
||||
bool audio,
|
||||
bool video,
|
||||
blink::mojom::StreamDevices& devices) { // NOLINT(runtime/references)
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
DCHECK(audio || video);
|
||||
|
||||
if (audio) {
|
||||
const blink::MediaStreamDevice* device = GetFirstAvailableAudioDevice();
|
||||
if (device)
|
||||
devices.audio_device = *device;
|
||||
}
|
||||
|
||||
if (video) {
|
||||
const blink::MediaStreamDevice* device = GetFirstAvailableVideoDevice();
|
||||
if (device)
|
||||
devices.video_device = *device;
|
||||
}
|
||||
}
|
||||
|
||||
const blink::MediaStreamDevice*
|
||||
MediaCaptureDevicesDispatcher::GetRequestedAudioDevice(
|
||||
const std::string& requested_audio_device_id) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
const blink::MediaStreamDevices& audio_devices = GetAudioCaptureDevices();
|
||||
const blink::MediaStreamDevice* const device =
|
||||
FindDeviceWithId(audio_devices, requested_audio_device_id);
|
||||
return device;
|
||||
}
|
||||
|
||||
const blink::MediaStreamDevice*
|
||||
MediaCaptureDevicesDispatcher::GetFirstAvailableAudioDevice() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
const blink::MediaStreamDevices& audio_devices = GetAudioCaptureDevices();
|
||||
if (audio_devices.empty())
|
||||
return nullptr;
|
||||
return &(*audio_devices.begin());
|
||||
}
|
||||
|
||||
const blink::MediaStreamDevice*
|
||||
MediaCaptureDevicesDispatcher::GetRequestedVideoDevice(
|
||||
const std::string& requested_video_device_id) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
const blink::MediaStreamDevices& video_devices = GetVideoCaptureDevices();
|
||||
const blink::MediaStreamDevice* const device =
|
||||
FindDeviceWithId(video_devices, requested_video_device_id);
|
||||
return device;
|
||||
}
|
||||
|
||||
const blink::MediaStreamDevice*
|
||||
MediaCaptureDevicesDispatcher::GetFirstAvailableVideoDevice() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
const blink::MediaStreamDevices& video_devices = GetVideoCaptureDevices();
|
||||
if (video_devices.empty())
|
||||
return nullptr;
|
||||
return &(*video_devices.begin());
|
||||
}
|
||||
|
||||
void MediaCaptureDevicesDispatcher::DisableDeviceEnumerationForTesting() {
|
||||
is_device_enumeration_disabled_ = true;
|
||||
}
|
||||
|
||||
void MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged() {}
|
||||
|
||||
void MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged() {}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/memory/singleton.h"
|
||||
#include "components/webrtc/media_stream_device_enumerator_impl.h"
|
||||
#include "content/public/browser/media_observer.h"
|
||||
#include "content/public/browser/media_stream_request.h"
|
||||
#include "third_party/blink/public/common/mediastream/media_stream_request.h"
|
||||
@@ -17,41 +18,12 @@ namespace electron {
|
||||
|
||||
// This singleton is used to receive updates about media events from the content
|
||||
// layer.
|
||||
class MediaCaptureDevicesDispatcher : public content::MediaObserver {
|
||||
class MediaCaptureDevicesDispatcher
|
||||
: public content::MediaObserver,
|
||||
public webrtc::MediaStreamDeviceEnumeratorImpl {
|
||||
public:
|
||||
static MediaCaptureDevicesDispatcher* GetInstance();
|
||||
|
||||
// Methods for observers. Called on UI thread.
|
||||
const blink::MediaStreamDevices& GetAudioCaptureDevices();
|
||||
const blink::MediaStreamDevices& GetVideoCaptureDevices();
|
||||
|
||||
// Helper to get the default devices which can be used by the media request.
|
||||
// Uses the first available devices if the default devices are not available.
|
||||
// If the return list is empty, it means there is no available device on the
|
||||
// OS.
|
||||
// Called on the UI thread.
|
||||
void GetDefaultDevices(
|
||||
bool audio,
|
||||
bool video,
|
||||
blink::mojom::StreamDevices& devices); // NOLINT(runtime/references)
|
||||
|
||||
// Helpers for picking particular requested devices, identified by raw id.
|
||||
// If the device requested is not available it will return NULL.
|
||||
const blink::MediaStreamDevice* GetRequestedAudioDevice(
|
||||
const std::string& requested_audio_device_id);
|
||||
const blink::MediaStreamDevice* GetRequestedVideoDevice(
|
||||
const std::string& requested_video_device_id);
|
||||
|
||||
// Returns the first available audio or video device, or NULL if no devices
|
||||
// are available.
|
||||
const blink::MediaStreamDevice* GetFirstAvailableAudioDevice();
|
||||
const blink::MediaStreamDevice* GetFirstAvailableVideoDevice();
|
||||
|
||||
// Unittests that do not require actual device enumeration should call this
|
||||
// API on the singleton. It is safe to call this multiple times on the
|
||||
// singleton.
|
||||
void DisableDeviceEnumerationForTesting();
|
||||
|
||||
// Overridden from content::MediaObserver:
|
||||
void OnAudioCaptureDevicesChanged() override;
|
||||
void OnVideoCaptureDevicesChanged() override;
|
||||
@@ -79,15 +51,6 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver {
|
||||
|
||||
MediaCaptureDevicesDispatcher();
|
||||
~MediaCaptureDevicesDispatcher() override;
|
||||
|
||||
// Only for testing, a list of cached audio capture devices.
|
||||
blink::MediaStreamDevices test_audio_devices_;
|
||||
|
||||
// Only for testing, a list of cached video capture devices.
|
||||
blink::MediaStreamDevices test_video_devices_;
|
||||
|
||||
// Flag used by unittests to disable device enumeration.
|
||||
bool is_device_enumeration_disabled_ = false;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE-CHROMIUM file.
|
||||
|
||||
#include "shell/browser/media/media_stream_devices_controller.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "content/public/browser/desktop_media_id.h"
|
||||
#include "content/public/browser/media_stream_request.h"
|
||||
#include "shell/browser/media/media_capture_devices_dispatcher.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
bool HasAnyAvailableDevice() {
|
||||
const blink::MediaStreamDevices& audio_devices =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()->GetAudioCaptureDevices();
|
||||
const blink::MediaStreamDevices& video_devices =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()->GetVideoCaptureDevices();
|
||||
|
||||
return !audio_devices.empty() || !video_devices.empty();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
MediaStreamDevicesController::MediaStreamDevicesController(
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback)
|
||||
: request_(request),
|
||||
callback_(std::move(callback)),
|
||||
// For MEDIA_OPEN_DEVICE requests (Pepper) we always request both webcam
|
||||
// and microphone to avoid popping two infobars.
|
||||
microphone_requested_(
|
||||
request.audio_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE ||
|
||||
request.request_type == blink::MEDIA_OPEN_DEVICE_PEPPER_ONLY),
|
||||
webcam_requested_(
|
||||
request.video_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE ||
|
||||
request.request_type == blink::MEDIA_OPEN_DEVICE_PEPPER_ONLY) {}
|
||||
|
||||
MediaStreamDevicesController::~MediaStreamDevicesController() {
|
||||
if (!callback_.is_null()) {
|
||||
std::move(callback_).Run(
|
||||
blink::mojom::StreamDevicesSet(),
|
||||
blink::mojom::MediaStreamRequestResult::FAILED_DUE_TO_SHUTDOWN,
|
||||
std::unique_ptr<content::MediaStreamUI>());
|
||||
}
|
||||
}
|
||||
|
||||
bool MediaStreamDevicesController::TakeAction() {
|
||||
// Do special handling of desktop screen cast.
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_AUDIO_CAPTURE ||
|
||||
request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE ||
|
||||
request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE ||
|
||||
request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) {
|
||||
HandleUserMediaRequest();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Deny the request if there is no device attached to the OS.
|
||||
if (!HasAnyAvailableDevice()) {
|
||||
Deny(blink::mojom::MediaStreamRequestResult::NO_HARDWARE);
|
||||
return true;
|
||||
}
|
||||
|
||||
Accept();
|
||||
return true;
|
||||
}
|
||||
|
||||
void MediaStreamDevicesController::Accept() {
|
||||
// Get the default devices for the request.
|
||||
blink::mojom::StreamDevicesSetPtr stream_devices_set =
|
||||
blink::mojom::StreamDevicesSet::New();
|
||||
stream_devices_set->stream_devices.emplace_back(
|
||||
blink::mojom::StreamDevices::New());
|
||||
blink::mojom::StreamDevices& stream_devices =
|
||||
*stream_devices_set->stream_devices[0];
|
||||
|
||||
if (microphone_requested_ || webcam_requested_) {
|
||||
switch (request_.request_type) {
|
||||
case blink::MEDIA_OPEN_DEVICE_PEPPER_ONLY: {
|
||||
const blink::MediaStreamDevice* device = nullptr;
|
||||
// For open device request pick the desired device or fall back to the
|
||||
// first available of the given type.
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE) {
|
||||
device =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetRequestedAudioDevice(request_.requested_audio_device_id);
|
||||
// TODO(wjia): Confirm this is the intended behavior.
|
||||
if (!device) {
|
||||
device = MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetFirstAvailableAudioDevice();
|
||||
}
|
||||
if (device)
|
||||
stream_devices.audio_device = *device;
|
||||
} else if (request_.video_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE) {
|
||||
// Pepper API opens only one device at a time.
|
||||
device =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetRequestedVideoDevice(request_.requested_video_device_id);
|
||||
// TODO(wjia): Confirm this is the intended behavior.
|
||||
if (!device) {
|
||||
device = MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetFirstAvailableVideoDevice();
|
||||
}
|
||||
if (device)
|
||||
stream_devices.video_device = *device;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case blink::MEDIA_GENERATE_STREAM: {
|
||||
bool needs_audio_device = microphone_requested_;
|
||||
bool needs_video_device = webcam_requested_;
|
||||
|
||||
// Get the exact audio or video device if an id is specified.
|
||||
if (!request_.requested_audio_device_id.empty()) {
|
||||
const blink::MediaStreamDevice* audio_device =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetRequestedAudioDevice(request_.requested_audio_device_id);
|
||||
if (audio_device) {
|
||||
stream_devices.audio_device = *audio_device;
|
||||
needs_audio_device = false;
|
||||
}
|
||||
}
|
||||
if (!request_.requested_video_device_id.empty()) {
|
||||
const blink::MediaStreamDevice* video_device =
|
||||
MediaCaptureDevicesDispatcher::GetInstance()
|
||||
->GetRequestedVideoDevice(request_.requested_video_device_id);
|
||||
if (video_device) {
|
||||
stream_devices.video_device = *video_device;
|
||||
needs_video_device = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If either or both audio and video devices were requested but not
|
||||
// specified by id, get the default devices.
|
||||
if (needs_audio_device || needs_video_device) {
|
||||
MediaCaptureDevicesDispatcher::GetInstance()->GetDefaultDevices(
|
||||
needs_audio_device, needs_video_device, stream_devices);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case blink::MEDIA_DEVICE_ACCESS: {
|
||||
// Get the default devices for the request.
|
||||
MediaCaptureDevicesDispatcher::GetInstance()->GetDefaultDevices(
|
||||
microphone_requested_, webcam_requested_, stream_devices);
|
||||
break;
|
||||
}
|
||||
case blink::MEDIA_DEVICE_UPDATE: {
|
||||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
case blink::MEDIA_GET_OPEN_DEVICE: {
|
||||
// Transferred tracks, that use blink::MEDIA_GET_OPEN_DEVICE type, do
|
||||
// not need to get permissions for blink::mojom::StreamDevices as those
|
||||
// are controlled by the original context.
|
||||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::move(callback_).Run(*stream_devices_set,
|
||||
blink::mojom::MediaStreamRequestResult::OK,
|
||||
std::unique_ptr<content::MediaStreamUI>());
|
||||
}
|
||||
|
||||
void MediaStreamDevicesController::Deny(
|
||||
blink::mojom::MediaStreamRequestResult result) {
|
||||
std::move(callback_).Run(blink::mojom::StreamDevicesSet(), result,
|
||||
std::unique_ptr<content::MediaStreamUI>());
|
||||
}
|
||||
|
||||
void MediaStreamDevicesController::HandleUserMediaRequest() {
|
||||
blink::mojom::StreamDevicesSetPtr stream_devices_set =
|
||||
blink::mojom::StreamDevicesSet::New();
|
||||
stream_devices_set->stream_devices.emplace_back(
|
||||
blink::mojom::StreamDevices::New());
|
||||
blink::mojom::StreamDevices& devices = *stream_devices_set->stream_devices[0];
|
||||
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_AUDIO_CAPTURE) {
|
||||
devices.audio_device = blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_TAB_AUDIO_CAPTURE, "", "");
|
||||
}
|
||||
if (request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE) {
|
||||
devices.video_device = blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_TAB_VIDEO_CAPTURE, "", "");
|
||||
}
|
||||
if (request_.audio_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE) {
|
||||
devices.audio_device = blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_AUDIO_CAPTURE, "loopback",
|
||||
"System Audio");
|
||||
}
|
||||
if (request_.video_type ==
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) {
|
||||
content::DesktopMediaID screen_id;
|
||||
// If the device id wasn't specified then this is a screen capture request
|
||||
// (i.e. chooseDesktopMedia() API wasn't used to generate device id).
|
||||
if (request_.requested_video_device_id.empty()) {
|
||||
screen_id = content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN,
|
||||
-1 /* kFullDesktopScreenId */);
|
||||
} else {
|
||||
screen_id =
|
||||
content::DesktopMediaID::Parse(request_.requested_video_device_id);
|
||||
}
|
||||
|
||||
devices.video_device = blink::MediaStreamDevice(
|
||||
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE,
|
||||
screen_id.ToString(), "Screen");
|
||||
}
|
||||
|
||||
bool empty =
|
||||
!devices.audio_device.has_value() && !devices.video_device.has_value();
|
||||
std::move(callback_).Run(
|
||||
*stream_devices_set,
|
||||
empty ? blink::mojom::MediaStreamRequestResult::NO_HARDWARE
|
||||
: blink::mojom::MediaStreamRequestResult::OK,
|
||||
std::unique_ptr<content::MediaStreamUI>());
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE-CHROMIUM file.
|
||||
|
||||
#ifndef ELECTRON_SHELL_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
||||
#define ELECTRON_SHELL_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
||||
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
#include "third_party/blink/public/common/mediastream/media_stream_request.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
class MediaStreamDevicesController {
|
||||
public:
|
||||
MediaStreamDevicesController(const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback);
|
||||
|
||||
virtual ~MediaStreamDevicesController();
|
||||
|
||||
// disable copy
|
||||
MediaStreamDevicesController(const MediaStreamDevicesController&) = delete;
|
||||
MediaStreamDevicesController& operator=(const MediaStreamDevicesController&) =
|
||||
delete;
|
||||
|
||||
// Accept or deny the request based on the default policy.
|
||||
bool TakeAction();
|
||||
|
||||
// Explicitly accept or deny the request.
|
||||
void Accept();
|
||||
void Deny(blink::mojom::MediaStreamRequestResult result);
|
||||
|
||||
private:
|
||||
// Handle the request of desktop or tab screen cast.
|
||||
void HandleUserMediaRequest();
|
||||
|
||||
// The original request for access to devices.
|
||||
const content::MediaStreamRequest request_;
|
||||
|
||||
// The callback that needs to be Run to notify WebRTC of whether access to
|
||||
// audio/video devices was granted or not.
|
||||
content::MediaResponseCallback callback_;
|
||||
|
||||
bool microphone_requested_;
|
||||
bool webcam_requested_;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // ELECTRON_SHELL_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
||||
@@ -729,7 +729,6 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bounds, bool animate) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
if (is_moving_ || is_resizing_) {
|
||||
pending_bounds_change_ = bounds;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ class NativeWindowViews : public NativeWindow,
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
void HandleSizeEvent(WPARAM w_param, LPARAM l_param);
|
||||
void ResetWindowControls();
|
||||
void SetForwardMouseMessages(bool forward);
|
||||
static LRESULT CALLBACK SubclassProc(HWND hwnd,
|
||||
UINT msg,
|
||||
|
||||
@@ -415,6 +415,7 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
|
||||
last_window_state_ != ui::SHOW_STATE_MAXIMIZED) {
|
||||
last_window_state_ = ui::SHOW_STATE_MAXIMIZED;
|
||||
NotifyWindowMaximize();
|
||||
ResetWindowControls();
|
||||
} else if (w_param == SIZE_MINIMIZED &&
|
||||
last_window_state_ != ui::SHOW_STATE_MINIMIZED) {
|
||||
last_window_state_ = ui::SHOW_STATE_MINIMIZED;
|
||||
@@ -440,18 +441,23 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// If a given window was minimized/maximized and has since been
|
||||
// restored, ensure the WCO buttons are set to normal state.
|
||||
auto* ncv = widget()->non_client_view();
|
||||
if (IsWindowControlsOverlayEnabled() && ncv) {
|
||||
auto* frame_view = static_cast<WinFrameView*>(ncv->frame_view());
|
||||
frame_view->caption_button_container()->ResetWindowControls();
|
||||
}
|
||||
ResetWindowControls();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowViews::ResetWindowControls() {
|
||||
// If a given window was minimized and has since been
|
||||
// unminimized (restored/maximized), ensure the WCO buttons
|
||||
// are reset to their default unpressed state.
|
||||
auto* ncv = widget()->non_client_view();
|
||||
if (IsWindowControlsOverlayEnabled() && ncv) {
|
||||
auto* frame_view = static_cast<WinFrameView*>(ncv->frame_view());
|
||||
frame_view->caption_button_container()->ResetWindowControls();
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetForwardMouseMessages(bool forward) {
|
||||
if (forward && !forwarding_mouse_messages_) {
|
||||
forwarding_mouse_messages_ = true;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/printing/browser/print_to_pdf/pdf_print_utils.h"
|
||||
#include "printing/mojom/print.mojom.h"
|
||||
@@ -133,7 +134,39 @@ void PrintViewManagerElectron::PrintToPdf(
|
||||
headless_jobs_.emplace_back(cookie);
|
||||
callback_ = std::move(callback);
|
||||
|
||||
GetPrintRenderFrame(rfh)->PrintWithParams(std::move(print_pages_params));
|
||||
// There is no need for a weak pointer here since the mojo proxy is held
|
||||
// in the base class. If we're gone, mojo will discard the callback.
|
||||
GetPrintRenderFrame(rfh)->PrintWithParams(
|
||||
std::move(print_pages_params),
|
||||
base::BindOnce(&PrintViewManagerElectron::OnDidPrintWithParams,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::OnDidPrintWithParams(
|
||||
printing::mojom::PrintWithParamsResultPtr result) {
|
||||
if (result->is_failure_reason()) {
|
||||
switch (result->get_failure_reason()) {
|
||||
case printing::mojom::PrintFailureReason::kGeneralFailure:
|
||||
ReleaseJob(PRINTING_FAILED);
|
||||
return;
|
||||
case printing::mojom::PrintFailureReason::kInvalidPageRange:
|
||||
ReleaseJob(PAGE_COUNT_EXCEEDED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto& content = *result->get_params()->content;
|
||||
if (!content.metafile_data_region.IsValid()) {
|
||||
ReleaseJob(INVALID_MEMORY_HANDLE);
|
||||
return;
|
||||
}
|
||||
base::ReadOnlySharedMemoryMapping map = content.metafile_data_region.Map();
|
||||
if (!map.IsValid()) {
|
||||
ReleaseJob(METAFILE_MAP_ERROR);
|
||||
return;
|
||||
}
|
||||
data_ = std::string(static_cast<const char*>(map.memory()), map.size());
|
||||
ReleaseJob(PRINT_SUCCESS);
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::GetDefaultPrintSettings(
|
||||
@@ -171,20 +204,6 @@ void PrintViewManagerElectron::ShowInvalidPrinterSettingsError() {
|
||||
ReleaseJob(INVALID_PRINTER_SETTINGS);
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::PrintingFailed(
|
||||
int32_t cookie,
|
||||
printing::mojom::PrintFailureReason reason) {
|
||||
auto entry = std::find(headless_jobs_.begin(), headless_jobs_.end(), cookie);
|
||||
if (entry == headless_jobs_.end()) {
|
||||
PrintViewManagerBase::PrintingFailed(cookie, reason);
|
||||
return;
|
||||
}
|
||||
|
||||
ReleaseJob(reason == printing::mojom::PrintFailureReason::kInvalidPageRange
|
||||
? PAGE_COUNT_EXCEEDED
|
||||
: PRINTING_FAILED);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void PrintViewManagerElectron::UpdatePrintSettings(
|
||||
int32_t cookie,
|
||||
@@ -245,37 +264,6 @@ void PrintViewManagerElectron::DidGetPrintedPagesCount(int32_t cookie,
|
||||
}
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::DidPrintDocument(
|
||||
printing::mojom::DidPrintDocumentParamsPtr params,
|
||||
DidPrintDocumentCallback callback) {
|
||||
auto entry = std::find(headless_jobs_.begin(), headless_jobs_.end(),
|
||||
params->document_cookie);
|
||||
if (entry == headless_jobs_.end()) {
|
||||
PrintViewManagerBase::DidPrintDocument(std::move(params),
|
||||
std::move(callback));
|
||||
return;
|
||||
}
|
||||
|
||||
auto& content = *params->content;
|
||||
if (!content.metafile_data_region.IsValid()) {
|
||||
ReleaseJob(INVALID_MEMORY_HANDLE);
|
||||
std::move(callback).Run(false);
|
||||
return;
|
||||
}
|
||||
|
||||
base::ReadOnlySharedMemoryMapping map = content.metafile_data_region.Map();
|
||||
if (!map.IsValid()) {
|
||||
ReleaseJob(METAFILE_MAP_ERROR);
|
||||
std::move(callback).Run(false);
|
||||
return;
|
||||
}
|
||||
|
||||
data_ = std::string(static_cast<const char*>(map.memory()), map.size());
|
||||
headless_jobs_.erase(entry);
|
||||
std::move(callback).Run(true);
|
||||
ReleaseJob(PRINT_SUCCESS);
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::Reset() {
|
||||
printing_rfh_ = nullptr;
|
||||
callback_.Reset();
|
||||
|
||||
@@ -61,23 +61,22 @@ class PrintViewManagerElectron
|
||||
PrintToPDFCallback callback);
|
||||
|
||||
private:
|
||||
explicit PrintViewManagerElectron(content::WebContents* web_contents);
|
||||
friend class content::WebContentsUserData<PrintViewManagerElectron>;
|
||||
|
||||
explicit PrintViewManagerElectron(content::WebContents* web_contents);
|
||||
|
||||
void OnDidPrintWithParams(printing::mojom::PrintWithParamsResultPtr result);
|
||||
|
||||
// WebContentsObserver overrides (via PrintManager):
|
||||
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
||||
|
||||
// printing::mojom::PrintManagerHost:
|
||||
void DidPrintDocument(printing::mojom::DidPrintDocumentParamsPtr params,
|
||||
DidPrintDocumentCallback callback) override;
|
||||
void DidGetPrintedPagesCount(int32_t cookie, uint32_t number_pages) override;
|
||||
void GetDefaultPrintSettings(
|
||||
GetDefaultPrintSettingsCallback callback) override;
|
||||
void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr params,
|
||||
ScriptedPrintCallback callback) override;
|
||||
void ShowInvalidPrinterSettingsError() override;
|
||||
void PrintingFailed(int32_t cookie,
|
||||
printing::mojom::PrintFailureReason reason) override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void UpdatePrintSettings(int32_t cookie,
|
||||
base::Value::Dict job_settings,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user