Compare commits

...

11 Commits

Author SHA1 Message Date
Charles Kerr
c257cc25a2 refactor: make NativeWindow getter methods const (#40887)
refactor: make NativeWindow getter methods const (#40804)

* refactor: make NativeWindow getter methods const

* fixup! refactor: make NativeWindow getter methods const

make GetZOrderLevel() const

* fixup! refactor: make NativeWindow getter methods const

fix oops
2024-01-05 15:08:58 +01:00
trop[bot]
e1ec17d641 chore: bump chromium to 122.0.6194.0 (29-x-y) (#40872)
* chore: bump chromium in DEPS to 122.0.6180.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update render_widget_host_view_base.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update printing.patch

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

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

Update patch to upstream changes in print_view_manager_base.cc.
CC @codebytere for 👀

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update feat_add_onclose_to_messageport.patch

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

no manual changes; patch applied with fuzz 1

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update build_do_not_depend_on_packed_resource_integrity.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update port_autofill_colors_to_the_color_pipeline.patch

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

no manual changes; patch applied with fuzz 2

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch

Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5076902
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5096253

The `bailout_value` variable, which allowed us to fail gracefully in
these macros, has been removed upstream. This raises the temperature
on https://github.com/electron/electron/issues/40741 ...

Since we don't have a bailout value, return a default-constructed
instance of whatever the return type is of the function that invokes
the macro.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* Remove performActionOnRemotePage

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

It appears it is not used by anything within Chromium or outside.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: in SubmenuButton ctor, move() the PressedCallback

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

The copy construtor is more expensive and has been removed upstream

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update constructor call for ElectronExtensionsRendererClient::dispatcher_

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: handle CAPTURED_SURFACE_CONTROL in Converter<blink::PermissionType>::ToV8()

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: e patches all

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium to 122.0.6181.0

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: e patches all

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: Add lookup for per-RenderFrame SpellCheckProvider

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

Previously we could pass a routing ID into the spellcheck methods.
This ID arg has been replaced with a SpellCheckHost& arg.

We can get the SpellCheckHost from an accessor in SpellCheckProvider,
which was already being created on a per-render-frame basis in
RenderClientBase.

This commit adds a RenderFrame-to-SpellCheckProvider accessor
in RenderClientBase so that it can be used to get that needed
SpellCheckHost.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: make lint happy

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: restore the will_cause_resize arg to WebContents::ExitFullscreen

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

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

upstream reverted this change

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium in DEPS to 122.0.6182.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: fix virtual function names that were renamed upstream

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: handle new blink::PermissionType::SMART_CARD in PermissionType converter

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: node script/gen-libc++-filenames.js

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! chore: update build_do_not_depend_on_packed_resource_integrity.patch

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: remove revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch

The previous experiment of removing the DCHECK in 35093783 was a huge
failure. We either need to either:

A) use upstream as-is and fix the DCHECK failure, or
B) revert https://chromium-review.googlesource.com/c/v8/v8/+/5076902 too
C) find some other workaround

This commit is the first half of option A, removing the patch to use
upstream as-is.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium in DEPS to 122.0.6184.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6186.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore; update mas_avoid_private_macos_api_usage.patch.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update build_do_not_depend_on_packed_resource_integrity.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update fix_move_autopipsettingshelper_behind_branding_buildflag.patch

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

no manual changes; patch applied with fuzz 1

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: e patches all

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: add refactor_update_node-platform_to_match_v8-platform_api_changes.patch

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium in DEPS to 122.0.6188.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6190.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6192.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6194.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* Remove an unnecessary DCHECK which causes Lacros to crash.

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Add shared regular profile function that includes ash

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Simplify the PrintManagerHost::ScriptedPrint() call

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Add tests

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! chore: add refactor_update_node-platform_to_match_v8-platform_api_changes.patch

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: node script/gen-libc++-filenames.js

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Remove //ui/ozone/buildflags.h

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! Remove //ui/ozone/buildflags.h

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! Remove //ui/ozone/buildflags.h

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! refactor: Add lookup for per-RenderFrame SpellCheckProvider

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! Remove //ui/ozone/buildflags.h

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Add permission policy verification in PermissionControllerImpl

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: ensure spellcheck interface is registered for frame

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Unify pending and scheduled exceptions

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: dchecks in node.js tests

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: try adding termination check

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: document breaking iframe change

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: update patches after trop

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-01-04 16:17:50 -05:00
trop[bot]
ce7e0afd0a chore: add disclaimer to release timeline (#40885)
* chore: add disclaimer to release timeline

Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>

* Update docs/tutorial/electron-timelines.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-04 12:44:59 -08:00
trop[bot]
f589b73dee fix: ignore all NODE_ envs from foreign parent in node process (#40881) 2024-01-04 11:52:03 +01:00
trop[bot]
44f29fc675 fix: make grant_file_protocol_extra_privileges fuse also block CORS fetches (#40864)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2024-01-03 13:30:26 +01:00
trop[bot]
daf00de2ed fix: titlebar incorrectly displayed on frameless windows (#40862)
* fix: titlebar incorrectly displayed on frameless windows

Co-authored-by: brhenrique <bruno.d@miro.com>

* fix: enable transparency for Mica windows

Co-authored-by: brhenrique <bruno.d@miro.com>

* Refactor ShouldWindowContentsBeTransparent

Co-authored-by: clavin <clavin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: brhenrique <bruno.d@miro.com>
Co-authored-by: clavin <clavin@electronjs.org>
2024-01-02 16:39:57 -05:00
trop[bot]
877a3b9fe2 docs: corrected the ipcMain import path (#40794)
Update tutorial-3-preload.md

corrected the import path for ipcMain

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Nikhil Simon Toppo <nikhilsimontoppo@gmail.com>
2023-12-21 09:19:12 -06:00
trop[bot]
0bcaaca6bd refactor: use a FixedFlatMap for v8 converting ui::MenuSourceType (#40805)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-12-20 22:24:39 -06:00
trop[bot]
8619bd5027 fix: add partition alloc check for MacOS 13/14+ (#40766)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2023-12-15 12:00:58 -08:00
trop[bot]
4875c9b645 chore: bump chromium to 121.0.6159.0 (29-x-y) (#40751)
* chore: bump chromium to 121.0.6159.0 29-x-y

* chore: bump chromium in DEPS to 121.0.6154.0

* chore: bump chromium in DEPS to 121.0.6155.0

* fix patches

* chore: update patches

* patch out reference to GetOcclusionTracker

* un-flag PIPOcclusionTracker

* chore: bump chromium in DEPS to 121.0.6157.0

* fix conflicts

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

* add PIP occlusion tracker sources to chromium_src

* 5037591: Replace feature_list's Initialize* methods with Init*.

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

* 4811903: Move //content/browser/renderer_host/input/synthetic_gesture_controller to //content/common/input

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

* 4917953: usb: Add usb-unrestricted to permission policy

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

* 5072395: Remove unused `creation_context` parameter from blink/public APIs

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

* 5052035: [X11] Change AtomCache from a singleton to owned by Connection

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

* fix v8/.patches

* node script/gen-libc++-filenames.js

* 5035771: Remove the SetImage method of ImageButton

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

* fixup! 5052035: [X11] Change AtomCache from a singleton to owned by Connection

* fixup! 5035771: Remove the SetImage method of ImageButton

* chore: bump chromium in DEPS to 121.0.6159.0

* 4505903: [Extensions] Add lastAccessed property to chrome.tabs.Tab

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

* update patches

* don't duplicate tabs API types

this causes weird memory bugs if the two get out of sync

* fix UAF in TrayIconCocoa

not sure why this is popping up just now ... this has been broken for ages afaict

* Revert "don't duplicate tabs API types"

This reverts commit 80dff2efaa.

This is failing tests with extensions API schema check failures, so
revert for now. we'll fix it later.

* revert v8 change causing node crashes

* chore: reduce diffs in revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2023-12-12 13:59:27 -06:00
trop[bot]
f4979e3cd2 docs: fix year typos in electron-timelines.md (#40730)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Yureka <yuka@yuka.dev>
2023-12-08 13:26:25 +01:00
147 changed files with 1705 additions and 1944 deletions

View File

@@ -492,6 +492,7 @@ source_set("electron_lib") {
"//third_party/webrtc_overrides:webrtc_component",
"//third_party/widevine/cdm:headers",
"//third_party/zlib/google:zip",
"//ui/base:ozone_buildflags",
"//ui/base/idle",
"//ui/compositor",
"//ui/events:dom_keycode_converter",

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'121.0.6147.0',
'122.0.6194.0',
'node_version':
'v20.9.0',
'nan_version':

View File

@@ -32,6 +32,13 @@ extern const volatile char kFuseWire[];
TEMPLATE_CC = """
#include "electron/fuses.h"
#include "base/dcheck_is_on.h"
#if DCHECK_IS_ON()
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include <string>
#endif
namespace electron::fuses {
@@ -66,9 +73,20 @@ for fuse in fuses:
getters_h += "FUSE_EXPORT bool Is{name}Enabled();\n".replace("{name}", name)
getters_cc += """
bool Is{name}Enabled() {
#if DCHECK_IS_ON()
// RunAsNode is checked so early that base::CommandLine isn't yet
// initialized, so guard here to avoid a CHECK.
if (base::CommandLine::InitializedForCurrentProcess()) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch("{switch_name}")) {
std::string switch_value = command_line->GetSwitchValueASCII("{switch_name}");
return switch_value == "1";
}
}
#endif
return kFuseWire[{index}] == '1';
}
""".replace("{name}", name).replace("{index}", str(index))
""".replace("{name}", name).replace("{switch_name}", f"set-fuse-{fuse.lower()}").replace("{index}", str(index))
def c_hex(n):
s = hex(n)[2:]

View File

@@ -59,8 +59,14 @@ static_library("chrome") {
"//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/picture_in_picture/picture_in_picture_bounds_cache.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_bounds_cache.h",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.h",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker_observer.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker_observer.h",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.cc",
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.h",
"//chrome/browser/platform_util.cc",
"//chrome/browser/platform_util.h",
"//chrome/browser/predictors/preconnect_manager.cc",
@@ -446,6 +452,8 @@ source_set("chrome_spellchecker") {
"//chrome/browser/profiles/profile_selections.h",
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc",
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.h",
"//chrome/browser/spellchecker/spell_check_initialization_host_impl.cc",
"//chrome/browser/spellchecker/spell_check_initialization_host_impl.h",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_factory.cc",

View File

@@ -12,6 +12,16 @@ This document uses the following convention to categorize breaking changes:
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (30.0)
### Behavior Changed: cross-origin iframes now use Permission Policy to access features
Cross-origin iframes must now specify features available to a given `iframe` via the `allow`
attribute in order to access them.
See [documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#allow) for
more information.
## Planned Breaking API Changes (29.0)
### Behavior Changed: `ipcRenderer` can no longer be sent over the `contextBridge`

View File

@@ -9,7 +9,7 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
| 29.0.0 | 2023-Dec-07 | 2023-Jan-24 | 2023-Feb-20 | 2024-Aug-20 | M122 | v18.19 | ✅ |
| 29.0.0 | 2023-Dec-07 | 2024-Jan-24 | 2024-Feb-20 | 2024-Aug-20 | M122 | v18.19 | ✅ |
| 28.0.0 | 2023-Oct-11 | 2023-Nov-06 | 2023-Dec-05 | 2024-Jun-11 | M120 | v18.18 | ✅ |
| 27.0.0 | 2023-Aug-17 | 2023-Sep-13 | 2023-Oct-10 | 2024-Apr-16 | M118 | v18.17 | ✅ |
| 26.0.0 | 2023-Jun-01 | 2023-Jun-27 | 2023-Aug-15 | 2024-Feb-20 | M116 | v18.16 | ✅ |
@@ -38,6 +38,19 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| 3.0.0 | -- | 2018-Jun-21 | 2018-Sep-18 | 2019-Jul-30 | M66 | v10.2 | 🚫 |
| 2.0.0 | -- | 2018-Feb-21 | 2018-May-01 | 2019-Apr-23 | M61 | v8.9 | 🚫 |
:::info Official support dates may change
Electron's official support policy is the latest 3 stable releases. Our stable
release and end-of-life dates are determined by Chromium, and may be subject to
change. While we try to keep our planned release and end-of-life dates frequently
updated here, future dates may change if affected by upstream scheduling changes,
and may not always be accurately reflected.
See [Chromium's public release schedule](https://chromiumdash.appspot.com/schedule) for
definitive information about Chromium's scheduled release dates.
:::
**Notes:**
* The `-alpha.1`, `-beta.1`, and `stable` dates are our solid release dates.
@@ -49,20 +62,10 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
* Since Electron 5, Electron has been publicizing its release dates ([see blog post](https://www.electronjs.org/blog/electron-5-0-timeline)).
* Since Electron 6, Electron major versions have been targeting every other Chromium major version. Each Electron stable should happen on the same day as Chrome stable ([see blog post](https://www.electronjs.org/blog/12-week-cadence)).
* Since Electron 16, Electron has been releasing major versions on an 8-week cadence in accordance to Chrome's change to a 4-week release cadence ([see blog post](https://www.electronjs.org/blog/8-week-cadence)).
* Electron temporarily extended support for Electron 22 until October 10, 2023, to support an extended end-of-life for Windows 7/8/8.1
## Version support policy
:::info
The Electron team will temporarily support Electron 22 until October 10, 2023.
This extended support is intended to help Electron developers who still need
support for Windows 7/8/8.1, which ended support in Electron 23. The October
support date follows the extended support dates from both Chromium and Microsoft.
On October 11, the Electron team will drop support back to the latest three
stable major versions.
:::
The latest three _stable_ major versions are supported by the Electron team.
For example, if the latest release is 6.1.x, then the 5.0.x as well
as the 4.2.x series are supported. We only support the latest minor release

View File

@@ -203,7 +203,7 @@ loading the HTML file so that the handler is guaranteed to be ready before
you send out the `invoke` call from the renderer.
```js {1,15} title="main.js"
const { app, BrowserWindow, ipcMain } = require('electron')
const { app, BrowserWindow, ipcMain } = require('electron/main')
const path = require('node:path')
const createWindow = () => {

View File

@@ -660,6 +660,7 @@ filenames = {
"shell/common/node_includes.h",
"shell/common/node_util.cc",
"shell/common/node_util.h",
"shell/common/node_util_mac.mm",
"shell/common/options_switches.cc",
"shell/common/options_switches.h",
"shell/common/platform_util.cc",

View File

@@ -23,6 +23,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__algorithm/find_first_of.h",
"//third_party/libc++/src/include/__algorithm/find_if.h",
"//third_party/libc++/src/include/__algorithm/find_if_not.h",
"//third_party/libc++/src/include/__algorithm/find_segment_if.h",
"//third_party/libc++/src/include/__algorithm/for_each.h",
"//third_party/libc++/src/include/__algorithm/for_each_n.h",
"//third_party/libc++/src/include/__algorithm/for_each_segment.h",
@@ -88,6 +89,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h",
"//third_party/libc++/src/include/__algorithm/pstl_copy.h",
"//third_party/libc++/src/include/__algorithm/pstl_count.h",
"//third_party/libc++/src/include/__algorithm/pstl_equal.h",
"//third_party/libc++/src/include/__algorithm/pstl_fill.h",
"//third_party/libc++/src/include/__algorithm/pstl_find.h",
"//third_party/libc++/src/include/__algorithm/pstl_for_each.h",
@@ -838,6 +840,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__type_traits/void_t.h",
"//third_party/libc++/src/include/__undef_macros",
"//third_party/libc++/src/include/__utility/as_const.h",
"//third_party/libc++/src/include/__utility/as_lvalue.h",
"//third_party/libc++/src/include/__utility/auto_cast.h",
"//third_party/libc++/src/include/__utility/cmp.h",
"//third_party/libc++/src/include/__utility/convert_to_integral.h",
@@ -851,6 +854,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__utility/integer_sequence.h",
"//third_party/libc++/src/include/__utility/is_pointer_in_range.h",
"//third_party/libc++/src/include/__utility/move.h",
"//third_party/libc++/src/include/__utility/no_destroy.h",
"//third_party/libc++/src/include/__utility/pair.h",
"//third_party/libc++/src/include/__utility/piecewise_construct.h",
"//third_party/libc++/src/include/__utility/priority_tag.h",
@@ -921,23 +925,12 @@ libcxx_headers = [
"//third_party/libc++/src/include/experimental/__simd/traits.h",
"//third_party/libc++/src/include/experimental/__simd/utility.h",
"//third_party/libc++/src/include/experimental/__simd/vec_ext.h",
"//third_party/libc++/src/include/experimental/deque",
"//third_party/libc++/src/include/experimental/forward_list",
"//third_party/libc++/src/include/experimental/iterator",
"//third_party/libc++/src/include/experimental/list",
"//third_party/libc++/src/include/experimental/map",
"//third_party/libc++/src/include/experimental/memory",
"//third_party/libc++/src/include/experimental/memory_resource",
"//third_party/libc++/src/include/experimental/propagate_const",
"//third_party/libc++/src/include/experimental/regex",
"//third_party/libc++/src/include/experimental/set",
"//third_party/libc++/src/include/experimental/simd",
"//third_party/libc++/src/include/experimental/string",
"//third_party/libc++/src/include/experimental/type_traits",
"//third_party/libc++/src/include/experimental/unordered_map",
"//third_party/libc++/src/include/experimental/unordered_set",
"//third_party/libc++/src/include/experimental/utility",
"//third_party/libc++/src/include/experimental/vector",
"//third_party/libc++/src/include/ext/__hash",
"//third_party/libc++/src/include/ext/hash_map",
"//third_party/libc++/src/include/ext/hash_set",

View File

@@ -127,5 +127,5 @@ fix_activate_background_material_on_windows.patch
feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch
chore_remove_check_is_test_on_script_injection_tracker.patch
fix_restore_original_resize_performance_on_macos.patch
fix_font_flooding_in_dev_tools.patch
feat_allow_code_cache_in_custom_schemes.patch
enable_partition_alloc_ref_count_size.patch

View File

@@ -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 8d9c853f7fe861ed7ff790fa2c02706b3a2c7264..fa9717eeb7a6f46aebf14d1fc00e2b19741b55a2 100644
index 3f18e426a88127090a6f62a08a5e09185f704c35..a04b115c45a24936a5418af179d6e35312c6fd31 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -264,6 +264,10 @@ int GpuMain(MainFunctionParams parameters) {

View File

@@ -10,10 +10,10 @@ DidCreateScriptContext is called, not all JS APIs are available in the
context, which can cause some preload scripts to trip.
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index c302f3e672cea9b73591048cf581f3e81078d5cb..eb1d1b0b59e687b996e76c205a8712346089c04b 100644
index 79162faef6654f52651ffdff5705f7b27d2ae4f2..8148896d3f12772a1b4ba04601c57d9e5c386ce7 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -140,6 +140,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -146,6 +146,8 @@ class CONTENT_EXPORT RenderFrameObserver
virtual void DidHandleOnloadEvents() {}
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
@@ -23,10 +23,10 @@ index c302f3e672cea9b73591048cf581f3e81078d5cb..eb1d1b0b59e687b996e76c205a871234
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 9bea02ba22dc601e57406513ed02c8704bf587de..ccd3c27b7537f9c1adce9d32137d0e596be7c545 100644
index c7ecc1b876e6825c76155d28bb8a8d0aabeb49fd..9305000541b1ac9c232ffb364ed21f120e417cdb 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4565,6 +4565,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4564,6 +4564,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index 9bea02ba22dc601e57406513ed02c8704bf587de..ccd3c27b7537f9c1adce9d32137d0e59
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 6fa0c635d1080cf2d7dbc0c7bd2c9bb5c083b986..dee1c7e60a998fd1947b4ff542872de0eb8d87cd 100644
index f6a8e125b367a147ff5c63ead8beded8c000cc10..9a468f7796bdf95e40ab9c31fd9fa36d1ea0bd3b 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -621,6 +621,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -623,6 +623,8 @@ class CONTENT_EXPORT RenderFrameImpl
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@@ -53,10 +53,10 @@ index 6fa0c635d1080cf2d7dbc0c7bd2c9bb5c083b986..dee1c7e60a998fd1947b4ff542872de0
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 ac82f8a9c14546d09e0181da93fbc361dc09dd78..94e177829c75ba3f4b33b4ca0802173e7faa1b92 100644
index 3bc8608e6954aa607c224665e7720d6580f35e22..b9e4ef7ae602b00131c3cafebb92fb9875158833 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -619,6 +619,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -634,6 +634,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -67,7 +67,7 @@ index ac82f8a9c14546d09e0181da93fbc361dc09dd78..94e177829c75ba3f4b33b4ca0802173e
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 e22ccf32a9e3c596e44506244f284f1c2be86762..65ff494dc7c5676fbb534c1dd1854010c507a1eb 100644
index fd81b966a99b407d7704f204a09979d27c2bdfc1..92309e81b2e752cf779da88b272b0b7112d1c8d7 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
@@ -202,6 +202,7 @@ void LocalWindowProxy::Initialize() {
@@ -79,7 +79,7 @@ index e22ccf32a9e3c596e44506244f284f1c2be86762..65ff494dc7c5676fbb534c1dd1854010
if (World().IsMainWorld()) {
probe::DidCreateMainWorldContext(GetFrame());
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index e982a11fc5412a9dce2ecde8af2fdaab4b2d56e7..a2169ba91e8856667b300672ed1a64841bf9c3a6 100644
index 2709519d0bbf33548704c14a99324b504d27ccbf..aa3c2d3c1ea73da128616fe676ac09e2095623f5 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -302,6 +302,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -92,7 +92,7 @@ index e982a11fc5412a9dce2ecde8af2fdaab4b2d56e7..a2169ba91e8856667b300672ed1a6484
int32_t world_id) = 0;
virtual bool AllowScriptExtensions() = 0;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
index 150f4280ec4c3829c14da8166ab2a4e9c043d551..b9dd77befa57677fa2b1f507c90cf0bedd09eafa 100644
index 87b8cbdc3f799822e3138b29c8ad7cd553a51cc0..123d4039721ba8d96ca27d30b8204a191e1a945c 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -110,7 +110,7 @@ index 150f4280ec4c3829c14da8166ab2a4e9c043d551..b9dd77befa57677fa2b1f507c90cf0be
v8::Local<v8::Context> context,
int32_t world_id) {
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
index 19b6d04a1dc5ae33fa1ede248fd580a4eb95ede6..2b238811b634f449a90ee7cf5d19c2e55343eb10 100644
index 8a16e37c32d29d21b0358f2a9dbe61b962d615a7..a1a73ebbeb0288f7e14280fa277451e046a65c9e 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -84,6 +84,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {

View File

@@ -7,10 +7,10 @@ Ensure that licenses for the dependencies introduced by Electron
are included in `LICENSES.chromium.html`
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
index 71dbd96a807f338752dd45bbb81a4b0e7ff63ca2..659caaf9e1ab93954704b2e5dbe7ddedc11f6a6d 100755
index 30f81dd2bf32205867d5dd5f72ed308e4abbfcc5..8f9a59dd4fe6f779ea4fc736693eb5cb31ab002d 100755
--- a/tools/licenses/licenses.py
+++ b/tools/licenses/licenses.py
@@ -415,6 +415,31 @@ SPECIAL_CASES = {
@@ -425,6 +425,31 @@ SPECIAL_CASES = {
"License": "Apache 2.0",
"License File": ["//third_party/selenium-atoms/LICENSE.closure"],
},

View File

@@ -8,10 +8,10 @@ decorations in maximized mode where needed, preventing empty space caused
by decoration shadows and rounded titlebars around the window while maximized.
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
index ce42101bdec901047af1f97287d83879541ab53e..785382fdc0f47ff31baef16da13eab688be3689d 100644
index a26cc74fc660c4d4873dd67e7c1c2b1223923ec8..6dfd2532bdd749adaeea820db0b88431f599a64a 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -527,12 +527,13 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
@@ -520,12 +520,13 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
return std::make_unique<gtk::NavButtonProviderGtk>();
}

View File

@@ -8,7 +8,7 @@ was removed as part of the Raw Clipboard API scrubbing.
https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
index e27df1c5b234490a2679fc3428e59b92970f1ec0..54a0be1dde7d059f5102ead4a77b828eff1eeadb 100644
index 5f28fee3f6d5e25a318e352f237cea2666671845..9bd5250012249ef0ac7b4013b448acc747dc9736 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
@@ -239,6 +239,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(

View File

@@ -51,10 +51,10 @@ index afd5368ffd7c7ef5db6e30b7468554d8ec07c77a..1b0c498edd71987f004bc20e9d7957cc
void SendRendererPreferencesToRenderer(
const blink::RendererPreferences& preferences);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index f14a7c55f6db46d9684639fcac3a203af792d65a..8cb43ab350c24d8193ccdbf3f2596d926ff552b1 100644
index a967365095f3ca4c1b57b0dcbfa8b148a5e1e683..54ae10307c6ceea27046b9bd7b1a1322b331d954 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -564,8 +564,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
@@ -563,8 +563,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
// OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
// which updates `visibility_`, unless the host is hidden. Make sure no update
// is needed.
@@ -104,7 +104,7 @@ index ed73a6fe6d146eac904f0aa0d88facf055df503e..4bbc792068db75739a7ceb8ad01c85f9
+ SetSchedulerThrottling(bool allowed);
};
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 6219eadefa976145469ec8be2fd312af1a955c7a..fdb76579679e1f4c5f43b934d4edaa2c6e32d43a 100644
index 2ba868f0efb2ee082d452bb011409f1b4c5c5e1e..6caab2df3cfc367c63839b7ac635d8d072ef8a57 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -378,6 +378,7 @@ class BLINK_EXPORT WebView {
@@ -116,7 +116,7 @@ index 6219eadefa976145469ec8be2fd312af1a955c7a..fdb76579679e1f4c5f43b934d4edaa2c
// 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 adb1c7ca2fcdf69d991f1355057adbd172c3989c..64228ce3fb2134b28ac153a6088c26049c6f203c 100644
index 81a6dbe0c3efc859cdd6124f2ff328b424e297c5..5a70b02f2217cf3c0e8d9a2cca8e2d565b6057bc 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2421,6 +2421,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
@@ -155,10 +155,10 @@ index adb1c7ca2fcdf69d991f1355057adbd172c3989c..64228ce3fb2134b28ac153a6088c2604
// Do not throttle if the page should be painting.
bool is_visible =
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 5a9992141dbbf6955beeb295145044a66fcaf754..42d57fd374ed307b5640dc57ed78d588e5ee5c65 100644
index 3aeffb166b2b8680fe226aec40febc928c272661..e9bac30aae75901dd07f1e28110289915d8d789e 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -452,6 +452,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -453,6 +453,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -166,7 +166,7 @@ index 5a9992141dbbf6955beeb295145044a66fcaf754..42d57fd374ed307b5640dc57ed78d588
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -917,6 +918,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -918,6 +919,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// If true, we send IPC messages when |preferred_size_| changes.
bool send_preferred_size_changes_ = false;

View File

@@ -49,7 +49,7 @@ index a1732d9bf9267e52a74350483fa946b5a0a0662b..25d36b301309ac9f8c1a4d75545fa741
// 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 5987aaa537ea37ef6c1145b606d5aee5b5511c0a..3d564401f00f9b65ea232470602d5215caf0d94f 100644
index 12941f34625d8578c2fed5f1d19529b09a3c544b..3964559a7caf7657a134d8a69d1587084e0ecfbb 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -674,10 +674,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {

View File

@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 85e831614b7f02c6a8537b4a67968bff8ca0c6e0..2394926bacf2e02716facd5ed8458e4ebfc449a1 100644
index 0cc26b32992cbbd5f599e0e062dd5b22bbf6d2dc..fd6a0eebd004f9e92ba577d73dfa75f685476288 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -82,6 +82,8 @@

View File

@@ -6,7 +6,7 @@ Subject: build: allow electron to use exec_script
This is similar to the //build usecase so we're OK adding ourselves here
diff --git a/.gn b/.gn
index 321877844bd21408fef009159dea6cf84c25d260..1dbf8b70c3ef4a567691268034f58787e3ac0192 100644
index afe0b3e90fafb9413cc49198cf3ad5d66d433b54..a8d83d6c95ebda9a898a383a8a1581d75da09f2e 100644
--- a/.gn
+++ b/.gn
@@ -167,4 +167,6 @@ exec_script_whitelist =

View File

@@ -11,16 +11,16 @@ 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 cc22e9c43562086396509548a4fe7e2f0ae22f80..705b0e067d8b702a5306334ae9d68eef2c11106d 100644
index 4b4545013d6de396a660b234ded3f16f8bb0e983..36b8ac1ee569041d7687f457320aa8f6e4b26f85 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -200,11 +200,16 @@ if (!is_android && !is_mac) {
@@ -200,11 +200,16 @@ if (!is_android && !is_mac && !is_fuchsia) {
"common/crash_keys.h",
]
+ if (!is_electron_build) {
+ deps = [
+ ":packed_resources_integrity",
+ ":packed_resources_integrity_header",
+ ]
+ }
+
@@ -28,62 +28,62 @@ index cc22e9c43562086396509548a4fe7e2f0ae22f80..705b0e067d8b702a5306334ae9d68eef
":chrome_dll",
":chrome_exe_version",
":copy_first_run",
- ":packed_resources_integrity",
- ":packed_resources_integrity_header",
":visual_elements_resources",
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 8704f445741b416c7763d53440cb410bd72d0fc4..a708ee20c84ee2cb667bcae5fc493803b3f044b7 100644
index ea574b1863e186401094d9e9d55c08c10424b671..b7cdbd3f650c37c798e6d95f4f3721ead3ad1fbf 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4811,7 +4811,7 @@ static_library("browser") {
@@ -4750,7 +4750,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
- if (!is_win) {
+ if (!is_win && !is_electron_build) {
deps += [ "//chrome:packed_resources_integrity" ]
deps += [ "//chrome:packed_resources_integrity_header" ]
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index cd439e952c39a02d326f114acf7da18eac404692..540ef46a5d7708d0385dd57c8e68579e52fb32d8 100644
index 09cf5b94c26c978d4a41b7e634a394a946783a4d..188755a0031c98be54fc58e232f0e6066f7e7931 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7156,7 +7156,6 @@ test("unit_tests") {
@@ -7179,7 +7179,6 @@ if (!is_fuchsia) {
deps += [
"//chrome:other_version",
- "//chrome:packed_resources_integrity",
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -7177,6 +7176,10 @@ test("unit_tests") {
"//ui/resources",
]
deps += [
"//chrome:other_version",
- "//chrome:packed_resources_integrity_header",
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -7200,6 +7199,10 @@ if (!is_fuchsia) {
"//ui/resources",
]
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity" ]
+ }
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_header" ]
+ }
+
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -8193,7 +8196,6 @@ test("unit_tests") {
}
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -8223,7 +8226,6 @@ if (!is_fuchsia) {
}
deps += [
- "//chrome:packed_resources_integrity_hash",
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:app_registry_cache_waiter",
@@ -8285,6 +8287,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
deps += [
- "//chrome:packed_resources_integrity_header",
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:app_registry_cache_waiter",
@@ -8316,6 +8318,10 @@ if (!is_fuchsia) {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_hash" ]
+ }
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_header" ]
+ }
+
data += [ "//ash/components/arc/test/data/icons/" ]
data += [ "//ash/components/arc/test/data/icons/" ]
if (include_js2gtest_tests && is_chromeos_ash) {
if (include_js2gtest_tests && is_chromeos_ash) {

View File

@@ -7,10 +7,10 @@ Build libc++ as static library to compile and pass
nan tests
diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
index d17711b23ea067e7a6a722b4af47210b48082076..1853ae383c34981d861ad6b28da1ff06e641d977 100644
index 4670c3b237aedcf930e718584cba6ce2ca505e62..57690c86fe78a4c2e692f0865919dd50e458b02d 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -44,7 +44,11 @@ config("winver") {
@@ -45,7 +45,11 @@ config("winver") {
if (libcxx_is_shared) {
_libcxx_target_type = "shared_library"
} else {
@@ -23,7 +23,7 @@ index d17711b23ea067e7a6a722b4af47210b48082076..1853ae383c34981d861ad6b28da1ff06
}
target(_libcxx_target_type, "libc++") {
# Most things that need to depend on libc++ should do so via the implicit
@@ -52,6 +56,7 @@ target(_libcxx_target_type, "libc++") {
@@ -53,6 +57,7 @@ target(_libcxx_target_type, "libc++") {
# need to explicitly depend on libc++.
visibility = [
"//build/config:common_deps",

View File

@@ -6,7 +6,7 @@ Subject: build: make libcxx_abi_unstable false for electron
https://nornagon.medium.com/a-libc-odyssey-973e51649063
diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site
index 862591058bacf2b526482c17eb84b204d1960422..6bce7ab7e33c602b8f733a3f39e6bdd778697b10 100644
index 6c1f0aecbc0425ebbf0f718abc58bc763c25b1a9..4af673d3041fe6fb74eb65fda588edf791c98eca 100644
--- a/buildtools/third_party/libc++/__config_site
+++ b/buildtools/third_party/libc++/__config_site
@@ -12,7 +12,6 @@

View File

@@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index cddbb941507a880ac6e69955fca7f2a1b4fcd0e2..6b2c1207d3e226c095b84edf10e468d554b6ae1a 100644
index 077a3c49768aa24591b0eb4a438cd87c38208200..429f9e77be832297448bdcd020b7878d3c07703f 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -8181,6 +8181,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -8259,6 +8259,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 cddbb941507a880ac6e69955fca7f2a1b4fcd0e2..6b2c1207d3e226c095b84edf10e468d5
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7680d447ea4883ad45f27e402719006b580a55ba..6f19be9694e46213636f6555e12b8679a48cb867 100644
index 84c061364bcfe27ce5631d567ac80dcc5cb1dc12..213cfa19ecd8f831107e1e6cff5c38480f3715a7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4479,6 +4479,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4490,6 +4490,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@@ -37,7 +37,7 @@ index 7680d447ea4883ad45f27e402719006b580a55ba..6f19be9694e46213636f6555e12b8679
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -4520,12 +4526,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4531,12 +4537,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -51,10 +51,10 @@ index 7680d447ea4883ad45f27e402719006b580a55ba..6f19be9694e46213636f6555e12b8679
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 d062bc29cfef239f9dc86278c2e01276cb334e54..a237c5817651532151c344f9f02c771c82a0ced9 100644
index ecdc75ae7888096922fb1ae1c86e9b80595d6570..feb8f08b44568f2c09359c8f3ec343fdec2615de 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -602,6 +602,10 @@ struct CreateNewWindowParams {
@@ -609,6 +609,10 @@ struct CreateNewWindowParams {
// The navigation initiator's user activation and ad status.
blink.mojom.NavigationInitiatorActivationAndAdStatus
initiator_activation_and_ad_status;
@@ -66,10 +66,10 @@ index d062bc29cfef239f9dc86278c2e01276cb334e54..a237c5817651532151c344f9f02c771c
// 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 6db465a37369674b26fdc1b7406151b9d91daf45..990dc12632f0faa5a1e0d9b92073a1e5c7d41ffb 100644
index 1c5717272933f75d789d9b727402d2c2cf13cbb0..56d476fa09a1648451b9f0e14c298024160f3da2 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -709,6 +709,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -725,6 +725,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -79,10 +79,10 @@ index 6db465a37369674b26fdc1b7406151b9d91daf45..990dc12632f0faa5a1e0d9b92073a1e5
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 1ec7c7299e7abf0be994e9d2518acdcfa38f1960..ac85bc0cc8a5bc557636fb1203c2e408dba0df1b 100644
index 966f79ab782fac2cfb4234eb333c423205467820..83aa3dd465cb02a3b15852764c00746c205b5b0f 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -179,6 +179,7 @@ class NetworkService;
@@ -181,6 +181,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -90,7 +90,7 @@ index 1ec7c7299e7abf0be994e9d2518acdcfa38f1960..ac85bc0cc8a5bc557636fb1203c2e408
} // namespace network
namespace sandbox {
@@ -1162,6 +1163,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1182,6 +1183,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -148,10 +148,10 @@ index 4b32bf8ccc4ed370e2d1a218ae1fd69a98e23636..b9168a2488f5c4977eba5856882b561e
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 7eca286713f1972844de21cb2c8c8e808ab900f0..9bea02ba22dc601e57406513ed02c8704bf587de 100644
index c5d2bb8e92d8341e791d78310d9984ea8d8b4b92..c7ecc1b876e6825c76155d28bb8a8d0aabeb49fd 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6559,6 +6559,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6551,6 +6551,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
GetWebFrame()->IsAdScriptInStack());
@@ -210,10 +210,10 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59
} // 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 88b4060c027def288bda0b74427eb6fffbdbcad6..a126e5e0019da2a776ce927ca821f05cb509e094 100644
index de9377575794e93864db43b59807e3af6c16f33d..338ce9de5de984ecfdf68bb17736e45a400ed8c9 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2180,6 +2180,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2233,6 +2233,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);

View File

@@ -9,10 +9,10 @@ This is an experimental commit; but if it's successful,
This patch should be upstreamed and then removed from electron's code.
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 2e4054890db7593aeddd4bb3270dc2acdfa831d4..51a5fe152ad1bf334f19963e2c38e37e50a2b3ad 100644
index 033994435788694211052bd7d6e16fa9417f5628..07944d2678d303457204543ba392d011fe399930 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -42,7 +42,6 @@
@@ -43,7 +43,6 @@
#include "chrome/browser/ui/views/user_education/browser_feature_promo_controller.h"
#include "chrome/common/buildflags.h"
#include "components/infobars/core/infobar_container.h"

View File

@@ -6,10 +6,10 @@ Subject: chore: add electron deps to gitignores
Makes things like "git status" quicker when developing electron locally
diff --git a/.gitignore b/.gitignore
index 22417f27125a44d481483439066d73e60348b414..82e5084b0e12231e5cc96a38d99b7238ebd0565c 100644
index 2f9164594b1bbf9f6d7af875ab65ee0cb24b1227..4c969db1812ef64647e9d8f139961911439d0551 100644
--- a/.gitignore
+++ b/.gitignore
@@ -210,6 +210,7 @@ vs-chromium-project.txt
@@ -208,6 +208,7 @@ vs-chromium-project.txt
/data
/delegate_execute
/device/serial/device_serial_mojo.xml

View File

@@ -7,7 +7,7 @@ With WCO, allow chromium to handle synthetic mouse events generated for touch
actions in the non-client caption area.
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index c72621c0e0fb4be2061ffa75196b6d0b6aa3e019..1247de97981b86f412c8e578b89059966f1554bc 100644
index a85fa97d213058196e4703166cf974497e89e2d6..39778ad7cdfec863d1acb7eb51438f5070c47318 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -1222,6 +1222,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(

View File

@@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
of explicitly adding ScopedAllowBlocking calls as friends.
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f5466963d 100644
index 67f0ff1785559143cbff0e81e6630c4d5a86bc90..c049707872f2585535b03fb5b55463b2d4323d16 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -135,6 +135,7 @@ class KeyStorageLinux;
@@ -18,7 +18,7 @@ index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f
class Profile;
class ProfileImpl;
class ScopedAllowBlockingForProfile;
@@ -275,6 +276,9 @@ class BackendImpl;
@@ -270,6 +271,9 @@ class BackendImpl;
class InFlightIO;
bool CleanupDirectorySync(const base::FilePath&);
} // namespace disk_cache
@@ -28,7 +28,7 @@ index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f
namespace enterprise_connectors {
class LinuxKeyRotationCommand;
} // namespace enterprise_connectors
@@ -563,6 +567,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -559,6 +563,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class ::DesktopNotificationBalloon;
friend class ::FirefoxProfileLock;
friend class ::GaiaConfig;
@@ -36,7 +36,7 @@ index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f
friend class ::ProfileImpl;
friend class ::ScopedAllowBlockingForProfile;
friend class ::StartupTabProviderImpl;
@@ -601,6 +606,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -597,6 +602,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class crosapi::LacrosThreadTypeDelegate;
friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
friend class drive::FakeDriveService;

View File

@@ -80,7 +80,7 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index c36f7833a9cbe91ca09a89728bc2811605658aaa..aa2d43da9c63302b9185e9f7bdef285e1499a2a3 100644
index e8310edc4c783976f9cb1a6624084812676d1f5c..45aedec3b34103f734415413241849054b5b0aed 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1885,12 +1885,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -99,7 +99,7 @@ index c36f7833a9cbe91ca09a89728bc2811605658aaa..aa2d43da9c63302b9185e9f7bdef285e
WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 91ff945f74fd342e70b53f22640c2e144f719ae9..6c31d755390dd12ff3b4118f0b173377a696c1b8 100644
index 456bdd201ed3f4a136857d84d0f5b9889c857980..7ee6a0b58d5e435cdca5dfb4e10858527e8f4658 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -890,8 +890,7 @@ class Browser : public TabStripModelObserver,
@@ -218,10 +218,10 @@ index c5b0d3b23b8da318ae55fcac2515a1187f261469..16ed1f46c9afde0ff25750128b4fcff6
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 7ec03754ef46ed72886994c0eab7ce2596ee5fb4..2f6f997eede33373a3b7ef43885cde5cc5c1d8a0 100644
index b057b66c99a7f91b40b803f51e9b1c225e4bba4a..81c2ea6d3266068593388211043c670bbdffe006 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4385,8 +4385,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4396,8 +4396,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,
@@ -358,7 +358,7 @@ index 60acb83c8d76f71db689f9d188bb6e8f64a74ffb..aa6cee708d1e451b443bc26528b56cc8
->options()
->block_new_web_contents();
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
index 8c5324b8d2a6a5a2f1fb855a98b42ab2b669ce75..f8956250fa78ef0354c1b0f31e2c9bd93d3e82b8 100644
index 719b23a9b3c03324a1be5cb80f4bc77b88cd8f9d..99039fcc3918c5bdbc00a808870d0dfd1e8d6d2d 100644
--- a/ui/views/controls/webview/web_dialog_view.cc
+++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -426,8 +426,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
@@ -372,7 +372,7 @@ index 8c5324b8d2a6a5a2f1fb855a98b42ab2b669ce75..f8956250fa78ef0354c1b0f31e2c9bd9
return delegate_->HandleShouldOverrideWebContentsCreation();
return false;
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h
index 3c74782fa1353cde102dc85314124fe91325d49a..e7c362b675871051cdc963c7b01975d30820814d 100644
index 6f7713dee8fa997be326384548c995b2e4887ccb..f8b81dcbd00c5f4eb6279f763663a224d19973a5 100644
--- a/ui/views/controls/webview/web_dialog_view.h
+++ b/ui/views/controls/webview/web_dialog_view.h
@@ -158,8 +158,7 @@ class WEBVIEW_EXPORT WebDialogView : public ClientView,

View File

@@ -9,7 +9,7 @@ Electron when a session is non persistent we do not initialize the
ExtensionSystem, so this check is not relevant for Electron.
diff --git a/extensions/browser/script_injection_tracker.cc b/extensions/browser/script_injection_tracker.cc
index 3c05ded105420450ce4c0009a9f6b4090d28ff8d..d68b7d928763616b41368a586a46c59f18d4d579 100644
index 1750588ca30761a41dec3bb3f1bfe5ac4eee699c..b7042b745c9496ba9c637bb15eb1bc442d353ab4 100644
--- a/extensions/browser/script_injection_tracker.cc
+++ b/extensions/browser/script_injection_tracker.cc
@@ -169,7 +169,6 @@ std::vector<const UserScript*> GetLoadedDynamicScripts(

View File

@@ -87,21 +87,33 @@ index 943168e2c72c0aeb59f1ea21b14f2dc8e6cfd7e0..db3ca2ed0ba0994caa4d26436b942166
// Create an observer that registers a hot key for |accelerator|.
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
index 65fa0fdec6316183a0e13210c2860548adee68ae..fd95c8c5b62a447542e38bf69acc86303be8fd9a 100644
index 9057dbf62e6270707924e8f842d81545bae86d08..aa21320061131a051f1393e2a71181fd49d1d938 100644
--- a/content/browser/media/media_keys_listener_manager_impl.cc
+++ b/content/browser/media/media_keys_listener_manager_impl.cc
@@ -316,6 +316,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
system_media_controls_->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
@@ -395,6 +395,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
browser_system_media_controls_->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
@@ -437,6 +442,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
smc->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
index db596585cbb44b3710636e3fc013f288966f604f..6d5557ee1a2c35ee15e695e024834184a525e2a7 100644
--- a/ui/base/accelerators/media_keys_listener.cc

View File

@@ -102,10 +102,10 @@ index c891c5649a6ae76c9f0f988359649ece0e8ac1d9..54e30c4dd82042c283e36cae767dcdd7
friend class ContentClientCreator;
friend class ContentClientInitializer;
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index 7cd74afcf678b90314120ee252decc381f90271a..3fe71efd30b945da209a5074d3cc9c718fc12381 100644
index af5eb8ae2efd2544889250537f0014d318aaa2ab..59daad3f2460939ccb046508d7733a94460a571d 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -556,8 +556,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
@@ -559,8 +559,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
@@ -115,7 +115,7 @@ index 7cd74afcf678b90314120ee252decc381f90271a..3fe71efd30b945da209a5074d3cc9c71
if (g_mapped_snapshot) {
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
// files in a process.
@@ -566,10 +565,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
@@ -569,10 +568,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
base::MemoryMappedFile::Region file_region;
base::File file =

View File

@@ -8,7 +8,7 @@ Allow registering custom protocols to handle service worker main script fetching
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 630b04c463843274790ad1f47ebee3cf47e334bd..54404051eeafa407561050254362c62497ec427b 100644
index 23955d2aa239c99afa71de5a8d66d35aa58e40ac..f6cafa8d1490aa8f7300e29a29dea1f3eaafcd3b 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1916,6 +1916,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(

View File

@@ -22,7 +22,7 @@ index 42da00a0f473928263df89f11d80830b6986292b..6a556939d0acfbd910ebb0923e198e2f
virtual int GetSourceCount() const = 0;
virtual const Source& GetSource(int index) const = 0;
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
index 489e6f7b7b0bb52b938a4fc137b983f3330cd4d2..1f2754dae9b81a7d233539a7e4e6ac77b3c5941f 100644
index 0389599ac786b6abd61ca921347fe12ddd5d0ee7..780927301744ea7312f230cec76a24a33d71f767 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
@@ -69,12 +69,12 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
@@ -41,7 +41,7 @@ index 489e6f7b7b0bb52b938a4fc137b983f3330cd4d2..1f2754dae9b81a7d233539a7e4e6ac77
int DesktopMediaListBase::GetSourceCount() const {
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
index 2cd1000b90fb5af464f81ac25b63092b638c6d40..8f18adb5641b3fa5f9defd3490e20a5d86b672e9 100644
index b65012985ff1797203160d9e26af17fefee5c244..9ee211fb487007bd37b57cfa7b4ffbe5307af637 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
@@ -39,7 +39,7 @@ class DesktopMediaListBase : public DesktopMediaList {
@@ -82,7 +82,7 @@ index 33ca7a53dfb6d2c9e3a33f0065a3acd806e82e01..9fdf2e8ff0056ff407015b914c6b03eb
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ffbbcb25ee 100644
index c76a6fffe76ad4932d9ea3557cc58c39a64fa485..cb16c002227b4e8a9603269498f3a90dbc840ba3 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
@@ -94,7 +94,7 @@ index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ff
#endif
content::DesktopMediaID::Type ConvertToDesktopMediaIDType(
@@ -331,7 +331,7 @@ class NativeDesktopMediaList::Worker
@@ -345,7 +345,7 @@ class NativeDesktopMediaList::Worker
base::WeakPtr<NativeDesktopMediaList> media_list_;
DesktopMediaID::Type source_type_;
@@ -103,7 +103,7 @@ index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ff
const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
const bool add_current_process_windows_;
@@ -615,6 +615,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
@@ -633,6 +633,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
FROM_HERE,
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
media_list_));
@@ -116,7 +116,7 @@ index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ff
}
void NativeDesktopMediaList::Worker::OnCaptureResult(
@@ -991,6 +997,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
@@ -1017,6 +1023,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
base::Unretained(worker_.get()),
std::move(native_ids), thumbnail_size_));

View File

@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 3e7608703c8e7ab212a283a5db512ec7e6bdc1e6..75a8ae51753b183bd3cdefb0ae41bb9e18da1157 100644
index 9066427f903cb78b75ff72f3653495c4f66028c8..41511b0d089598c505cac3b6197b0e63089eaf06 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1880,6 +1880,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -1888,6 +1888,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
gfx::ContentColorUsage content_color_usage) const {
TargetColorParams params;
@@ -81,7 +81,7 @@ index e4deb71ea3afa1ef9d6ddac9c61f5916ff608514..d2e6854ac2aaa3cc83c0b72ebc03193b
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 7c0598fb3f9f08d8d9905c5487f3a128f1262b15..314d443a60d0c9093dd06cd1589ab639dc81fabf 100644
index 53e23c2b791b9f8851ecac455c3adefd8fc37688..857b648acf17742e7d904ece93ee113f4dc553b6 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -227,6 +227,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -93,10 +93,10 @@ index 7c0598fb3f9f08d8d9905c5487f3a128f1262b15..314d443a60d0c9093dd06cd1589ab639
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 8e7cca5026c165c06687210b3206eac21e70e89c..14e4ecad4284e433b72b091451a53e4115a86d8f 100644
index 82b4a00f9c66627ef897c717a0f2e93ac0f13e08..195b147c927c1b09dc24928ec4e3755b3ee1af14 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3350,6 +3350,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3357,6 +3357,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[] = {
@@ -148,7 +148,7 @@ index 6892376fa33d006453977c354734d880a7ef7c91..4cd7b762d5fe1c54f5b06cc0d8f50560
}
diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
index 0e5ecb97bff85e0775a840f205893b5d6d12f38e..986f9a6f3de813feb16711d65d03dc8200215e27 100644
index ab5742a30a9d8319ec4596bb99313ea05841e316..5ffc2a38f66f3ab2c82102e996f8e9314da1286e 100644
--- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
+++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
@@ -30,6 +30,7 @@
@@ -159,7 +159,7 @@ index 0e5ecb97bff85e0775a840f205893b5d6d12f38e..986f9a6f3de813feb16711d65d03dc82
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
@@ -342,6 +343,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
@@ -266,6 +267,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
@@ -170,7 +170,7 @@ index 0e5ecb97bff85e0775a840f205893b5d6d12f38e..986f9a6f3de813feb16711d65d03dc82
// 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 2f2eb750b71e6a219af9f8601c6053a9799a0044..9d4daa0d5d2df9c55caad9881ee462e20beff2b9 100644
index 8a4e2f567831f5a295346062302470d2705ad9a4..2f9d13f03fc943342c156b676a7244348943d85f 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -21,6 +21,7 @@
@@ -196,7 +196,7 @@ index 2f2eb750b71e6a219af9f8601c6053a9799a0044..9d4daa0d5d2df9c55caad9881ee462e2
// Allow but ignore invalid color spaces.
if (!color_space.IsValid())
return true;
@@ -340,6 +349,15 @@ base::apple::ScopedCFTypeRef<IOSurfaceRef> CreateIOSurface(
@@ -342,6 +351,15 @@ base::apple::ScopedCFTypeRef<IOSurfaceRef> CreateIOSurface(
DCHECK_EQ(kIOReturnSuccess, r);
}

View File

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

View File

@@ -15,16 +15,16 @@ 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 be1f39d4038a80b9d73ae0cb0a6709d280501bd4..d3ae9bcab7e28145c3c196f6c5bba56597c29ee4 100644
index 0739558b3912221356ed1a4491bab95eca8e7156..613c757eb7366263df2781da16e18266cb2f5ba4 100644
--- a/content/renderer/render_process_impl.cc
+++ b/content/renderer/render_process_impl.cc
@@ -224,6 +224,9 @@ RenderProcessImpl::RenderProcessImpl()
@@ -229,6 +229,9 @@ RenderProcessImpl::RenderProcessImpl()
v8::V8::SetFlagsFromString(kSABPerContextFlag, sizeof(kSABPerContextFlag));
}
+ // 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)
#ifdef ENABLE_WEB_ASSEMBLY_TRAP_HANDLER_LINUX
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
base::CommandLine* const command_line =

View File

@@ -6,10 +6,10 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 22eccd1647c4ff48e994366527e45154d986d164..b7a3f5643ced5013c38197f654bd616ffe0f73de 100644
index fd723c19a4861721abb47ded1d1281d1c3235716..4b9f416e501a1c5af64e9e716a0ce47cfc32af1c 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -818,6 +818,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -832,6 +832,9 @@ void RenderWidgetHostImpl::WasHidden() {
return;
}
@@ -20,10 +20,10 @@ index 22eccd1647c4ff48e994366527e45154d986d164..b7a3f5643ced5013c38197f654bd616f
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 561bd928028df438e4184d07316ef98d9d9c91c0..1485e8d345adbdb5fdb055e1ff325bcd48121d72 100644
index e78085c9eae180daa58fb66f5c12fa8c53ccd8e1..cc9c023daf63551875aa97a0ffa93d2aa6dfe1bd 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -911,6 +911,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -914,6 +914,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void UpdateBrowserControlsState(cc::BrowserControlsState constraints,
cc::BrowserControlsState current,
bool animate);
@@ -33,10 +33,10 @@ index 561bd928028df438e4184d07316ef98d9d9c91c0..1485e8d345adbdb5fdb055e1ff325bcd
void StartDragging(blink::mojom::DragDataPtr drag_data,
const url::Origin& source_origin,
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 268533e5bd0ef599dc7ea82bb4d68fd2d814c729..f14a7c55f6db46d9684639fcac3a203af792d65a 100644
index 4f2a3b287076dc236058a2e6778ab067c3a4eb89..a967365095f3ca4c1b57b0dcbfa8b148a5e1e683 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -625,7 +625,7 @@ void RenderWidgetHostViewAura::HideImpl() {
@@ -624,7 +624,7 @@ void RenderWidgetHostViewAura::HideImpl() {
DCHECK(visibility_ == Visibility::HIDDEN ||
visibility_ == Visibility::OCCLUDED);

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <vertedinde@electronjs.org>
Date: Wed, 13 Dec 2023 12:53:11 -0800
Subject: fix: enable partition alloc ref count size for MacOS 13+
Modifies an existing check to check for all versions of MacOS 13
or higher, including MacOS 14 and potential beta versions.
This patch is currently being added upstream, and can be removed
when we integrate the upstream changes into Electron.
diff --git a/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h b/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h
index adc3160a0bb52af8d8ddecd05eeff63ae1f67fd3..2dc40cc55fb5d5d6724d8114718c0bf1bc044564 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_ref_count.h
@@ -32,7 +32,7 @@ namespace partition_alloc::internal {
// Aligns up (on 8B boundary) and returns `ref_count_size` if needed.
// * Known to be needed on MacOS 13: https://crbug.com/1378822.
-// * Thought to be needed on MacOS 14: https://crbug.com/1457756.
+// * Thought to be needed on MacOS 14 and higher: https://crbug.com/1457756.
// * No-op everywhere else.
//
// Placed outside `BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT)`
@@ -40,8 +40,7 @@ namespace partition_alloc::internal {
// this gating.
PA_ALWAYS_INLINE size_t AlignUpRefCountSizeForMac(size_t ref_count_size) {
#if BUILDFLAG(IS_MAC)
- if (internal::base::mac::MacOSMajorVersion() == 13 ||
- internal::base::mac::MacOSMajorVersion() == 14) {
+ if (internal::base::mac::MacOSMajorVersion() >= 13) {
return internal::base::bits::AlignUp<size_t>(ref_count_size, 8);
}
#endif // BUILDFLAG(IS_MAC)

View File

@@ -6,7 +6,7 @@ Subject: feat: enable setting aspect ratio to 0
Make SetAspectRatio accept 0 as valid input, which would reset to null.
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index 6e314250aafafd165e1a50baeb476e1bec6e8701..c72621c0e0fb4be2061ffa75196b6d0b6aa3e019 100644
index e4ab78b55cf4a2aee0c06bb0fc7732ad6aeb367e..a85fa97d213058196e4703166cf974497e89e2d6 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -579,7 +579,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {

View File

@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
} // namespace net
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index b3ef314dfe19a92ebb11ae34405b37c4424efe9a..4ab0420e80cf450ca49b456fedfbf1b887573432 100644
index f176d1a7086305a9f06a6dca3c4fc428cdf73d0c..dfd215d86da7e319534d5f410051bbdbd1c13fd8 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1568,6 +1568,13 @@ void NetworkContext::SetNetworkConditions(
@@ -1534,6 +1534,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,7 +51,7 @@ index b3ef314dfe19a92ebb11ae34405b37c4424efe9a..4ab0420e80cf450ca49b456fedfbf1b8
// 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 21f2966b086b029561bbed1bb37b87f2d79f5407..13f3952889c0e04c966e0d5f704261872cf4e6fb 100644
index fceb8d8a2daae235380fca7a163be001d0c19aa3..71e2834a361a23f5808eacdec8e67ce4e6691d14 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -317,6 +317,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -63,7 +63,7 @@ index 21f2966b086b029561bbed1bb37b87f2d79f5407..13f3952889c0e04c966e0d5f70426187
void SetEnableReferrers(bool enable_referrers) override;
#if BUILDFLAG(IS_CT_SUPPORTED)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 46520ea94b20d59acc0bd0158cea4b3e289e0cee..f463639a4925d929cbf4c8114b09c57c4d967c9f 100644
index a9212c8c51ce96c4313dfc8f955be737f5917079..c2fc030544303f7d6a6173728cddc76adce71ad3 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1240,6 +1240,9 @@ interface NetworkContext {
@@ -77,7 +77,7 @@ index 46520ea94b20d59acc0bd0158cea4b3e289e0cee..f463639a4925d929cbf4c8114b09c57c
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 94c01006242cdf73b66faa1503701f2e1aca2057..186cb3bf636b91bd233e84c573eadddcd0db6b14 100644
index 7bf8209052544647721535a331825286fee478dc..eb0461d8b5fe881128c177859a8b4326078f5539 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -147,6 +147,7 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -18,10 +18,10 @@ index 384a59138db11ea38028f844dd67e328ebffbe7b..f153997c2afccef1fa1b64ee5f162c28
bool IsNull() const { return private_.IsNull(); }
diff --git a/third_party/blink/renderer/core/exported/web_blob.cc b/third_party/blink/renderer/core/exported/web_blob.cc
index ce7b5e229789d606df5e74461f09e2e1db59fc95..b1bf2affa5b7f10d9b45d062a2ce0479f5a3b80a 100644
index 4d0d10c1fb87429f874bc89063b1f719873154e7..b5cc01801aece4623706cc5de9ccae809f270a3f 100644
--- a/third_party/blink/renderer/core/exported/web_blob.cc
+++ b/third_party/blink/renderer/core/exported/web_blob.cc
@@ -40,6 +40,7 @@
@@ -41,6 +41,7 @@
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/fileapi/blob.h"
#include "third_party/blink/renderer/core/fileapi/file_backed_blob_factory_dispatcher.h"
@@ -29,7 +29,7 @@ index ce7b5e229789d606df5e74461f09e2e1db59fc95..b1bf2affa5b7f10d9b45d062a2ce0479
#include "third_party/blink/renderer/platform/blob/blob_data.h"
#include "third_party/blink/renderer/platform/file_metadata.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
@@ -83,6 +84,14 @@ WebString WebBlob::Uuid() {
@@ -84,6 +85,14 @@ WebString WebBlob::Uuid() {
return private_->Uuid();
}

View File

@@ -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 64228ce3fb2134b28ac153a6088c26049c6f203c..6c6af1b9fde3924bad07316860347a93b0660bcc 100644
index 5a70b02f2217cf3c0e8d9a2cca8e2d565b6057bc..ad261f6c3079d88571bfd356aad74986af81a958 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -167,6 +167,7 @@

View File

@@ -7,7 +7,7 @@ This adds the 'onclose' event to MessagePort. Can be removed once
https://bugs.chromium.org/p/chromium/issues/detail?id=1495616 is fixed.
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index 5d7780c48a74fc7d95aeb690c90ab394b1e01a83..15f5f0f6aa05d3b17adae87286c92df9cc26a712 100644
index 2e0961fd8c0bc8f9a2a7c124693033eb234928bd..5c54705e3c1766553e9cba13142345485ca44578 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -195,6 +195,7 @@ void MessagePort::close() {
@@ -17,7 +17,7 @@ index 5d7780c48a74fc7d95aeb690c90ab394b1e01a83..15f5f0f6aa05d3b17adae87286c92df9
+ DispatchEvent(*Event::Create(event_type_names::kClose));
}
void MessagePort::Entangle(MessagePortDescriptor port_descriptor,
void MessagePort::OnConnectionError() {
diff --git a/third_party/blink/renderer/core/messaging/message_port.idl b/third_party/blink/renderer/core/messaging/message_port.idl
index 9df43655b569428a6abc54341b4b0023e159f99b..3f1f181d9b8a66997136f870f55c97c08294b6eb 100644
--- a/third_party/blink/renderer/core/messaging/message_port.idl

View File

@@ -13,10 +13,10 @@ uses internally for things like menus and devtools.
We can remove this patch once it has in some shape been upstreamed.
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index ce34cced354b092b8e8cf04a8c034c9833765e71..67c1c16b028f87b04007242d60d9cf90a61731da 100644
index fbbc35818cfa1709b30520e2336eeab2d96693d0..814230e423a44bfc71b6e028fb870f2a1d15e15f 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -191,6 +191,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
@@ -198,6 +198,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
NativeTheme::~NativeTheme() = default;
bool NativeTheme::ShouldUseDarkColors() const {
@@ -26,10 +26,10 @@ index ce34cced354b092b8e8cf04a8c034c9833765e71..67c1c16b028f87b04007242d60d9cf90
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef3554808389 100644
index 772c7a34a97588dd20c040be5ca482696990c880..fe1c04d6f9c9e9ca6a3aeacbaf897f1df5783248 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -441,6 +441,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -442,6 +442,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
scoped_refptr<ColorProviderKey::ThemeInitializerSupplier> custom_theme,
bool use_custom_frame = true) const;
@@ -53,7 +53,7 @@ index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef35
// Returns a shared instance of the native theme that should be used for web
// rendering. Do not use it in a normal application context (i.e. browser).
// The returned object should not be deleted by the caller. This function is
@@ -662,6 +679,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -658,6 +675,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
bool inverted_colors_ = false;
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;
@@ -62,10 +62,10 @@ index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef35
SEQUENCE_CHECKER(sequence_checker_);
};
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 50647269ec84f1a543132b3d102152a40e1e65e1..41a7df7e873a7d3300fd48db0ffa5f1fc8e43198 100644
index 6af4df92820d5a9d247a927244522f4c4acd164d..92af8c4a933b8462dce2524b0623a6843abd2600 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -664,6 +664,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
@@ -655,6 +655,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
// ...unless --force-dark-mode was specified in which case caveat emptor.
if (InForcedColorsMode() && !IsForcedDarkMode())
return false;

View File

@@ -65,7 +65,7 @@ index a7e9ab69fa13a0ad2e5aa97f09a8da4d9d51a48f..f994f23c16cc7dbc703d5e2289803940
void MultiBufferDataSource::SetReader(MultiBufferReader* reader) {
diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
index 578374d9a4fbaa9001e2dc39e4c7fa2a09658dde..64031ef9928ec86bf7e46c77c05ba7ca2e7f2d28 100644
index faad2219254615fedba155c41598478026190788..f1e8feb1f235faed58f76346622eaa22f5a351f4 100644
--- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
+++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
@@ -34,6 +34,8 @@ namespace blink {

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 26 Oct 2023 11:07:47 +0900
Date: Thu, 14 Dec 2023 21:16:53 +0900
Subject: Enable V8 code cache for custom schemes
Add a new category in ContentClient::AddAdditionalSchemes which allows
@@ -9,7 +9,7 @@ embedders to make custom schemes allow V8 code cache.
Chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/5019665
diff --git a/content/browser/code_cache/generated_code_cache.cc b/content/browser/code_cache/generated_code_cache.cc
index 65ac47b199b3f6d37fe78495eeb3d3598c4add8d..5230bf2cf1387ca73b34e0be2e0cffecd46a3653 100644
index 65ac47b199b3f6d37fe78495eeb3d3598c4add8d..b2d84eef99d64b2b591dbbf735ff29882cacc297 100644
--- a/content/browser/code_cache/generated_code_cache.cc
+++ b/content/browser/code_cache/generated_code_cache.cc
@@ -6,6 +6,7 @@
@@ -28,48 +28,90 @@ index 65ac47b199b3f6d37fe78495eeb3d3598c4add8d..5230bf2cf1387ca73b34e0be2e0cffec
using storage::BigIOBuffer;
@@ -46,24 +48,37 @@ void CheckValidKeys(const GURL& resource_url,
@@ -36,7 +38,7 @@ constexpr char kSeparator[] = " \n";
// We always expect to receive valid URLs that can be used as keys to the code
// cache. The relevant checks (for ex: resource_url is valid, origin_lock is
-// not opque etc.,) must be done prior to requesting the code cache.
+// not opaque etc.,) must be done prior to requesting the code cache.
//
// This function doesn't enforce anything in the production code. It is here
// to make the assumptions explicit and to catch any errors when DCHECKs are
@@ -46,30 +48,54 @@ void CheckValidKeys(const GURL& resource_url,
GeneratedCodeCache::CodeCacheType cache_type) {
// If the resource url is invalid don't cache the code.
DCHECK(resource_url.is_valid());
+ bool resource_url_allows_code_cache =
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme());
bool resource_url_is_chrome_or_chrome_untrusted =
- bool resource_url_is_chrome_or_chrome_untrusted =
+
+ // There are 3 kind of URL scheme compatible for the `resource_url`.
+ // 1. http: and https: URLs.
+ // 2. chrome: and chrome-untrusted: URLs.
+ // 3. URLs whose scheme are allowed by the content/ embedder.
+ const bool resource_url_http = resource_url.SchemeIsHTTPOrHTTPS();
+ const bool resource_url_webui =
resource_url.SchemeIs(content::kChromeUIScheme) ||
resource_url.SchemeIs(content::kChromeUIUntrustedScheme);
DCHECK(resource_url.SchemeIsHTTPOrHTTPS() ||
+ resource_url_allows_code_cache ||
resource_url_is_chrome_or_chrome_untrusted);
- DCHECK(resource_url.SchemeIsHTTPOrHTTPS() ||
- resource_url_is_chrome_or_chrome_untrusted);
-
- // |origin_lock| should be either empty or should have
- // Http/Https/chrome/chrome-untrusted schemes and it should not be a URL with
- // opaque origin. Empty origin_locks are allowed when the renderer is not
- // locked to an origin.
- bool origin_lock_is_chrome_or_chrome_untrusted =
+ const bool resource_url_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme());
+ DCHECK(resource_url_http || resource_url_webui || resource_url_embedder);
+
+ // |origin_lock| should be either empty or should have code cache allowed
+ // schemes (http/https/chrome/chrome-untrusted or other custom schemes added
+ // by url::AddCodeCacheScheme), and it should not be a URL with opaque
+ // origin. Empty origin_locks are allowed when the renderer is not locked to
+ // an origin.
+ bool origin_lock_allows_code_cache =
+ base::Contains(url::GetCodeCacheSchemes(), origin_lock.scheme());
bool origin_lock_is_chrome_or_chrome_untrusted =
+ const bool origin_lock_empty = origin_lock.is_empty();
+ const bool origin_lock_for_http = origin_lock.SchemeIsHTTPOrHTTPS();
+ const bool origin_lock_for_webui =
origin_lock.SchemeIs(content::kChromeUIScheme) ||
origin_lock.SchemeIs(content::kChromeUIUntrustedScheme);
DCHECK(origin_lock.is_empty() ||
((origin_lock.SchemeIsHTTPOrHTTPS() ||
+ origin_lock_allows_code_cache ||
origin_lock_is_chrome_or_chrome_untrusted) &&
!url::Origin::Create(origin_lock).opaque()));
- DCHECK(origin_lock.is_empty() ||
- ((origin_lock.SchemeIsHTTPOrHTTPS() ||
- origin_lock_is_chrome_or_chrome_untrusted) &&
- !url::Origin::Create(origin_lock).opaque()));
-
- // The chrome and chrome-untrusted schemes are only used with the WebUI
- // code cache type.
- DCHECK_EQ(origin_lock_is_chrome_or_chrome_untrusted,
- cache_type == GeneratedCodeCache::kWebUIJavaScript);
- DCHECK_EQ(resource_url_is_chrome_or_chrome_untrusted,
- cache_type == GeneratedCodeCache::kWebUIJavaScript);
+ const bool origin_lock_for_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), origin_lock.scheme());
+
+ DCHECK(origin_lock_empty || ((origin_lock_for_http || origin_lock_for_webui ||
+ origin_lock_for_embedder) &&
+ !url::Origin::Create(origin_lock).opaque()));
+
+ // The webui schemes are only used with their dedicated code cache type.
+ switch (cache_type) {
+ case GeneratedCodeCache::kJavaScript:
+ case GeneratedCodeCache::kWebAssembly:
+ DCHECK(!origin_lock_for_webui);
+ DCHECK(!resource_url_webui);
+ break;
+ case GeneratedCodeCache::kWebUIJavaScript:
+ DCHECK(origin_lock_for_webui);
+ DCHECK(resource_url_webui);
+ break;
+ }
+
+ // The custom schemes share the cache type with http(s).
+ if (origin_lock_allows_code_cache || resource_url_allows_code_cache) {
+ if (origin_lock_for_embedder || resource_url_embedder) {
+ DCHECK(cache_type == GeneratedCodeCache::kJavaScript ||
+ cache_type == GeneratedCodeCache::kWebAssembly);
+ }
+
// The chrome and chrome-untrusted schemes are only used with the WebUI
// code cache type.
DCHECK_EQ(origin_lock_is_chrome_or_chrome_untrusted,
}
// Generates the cache key for the given |resource_url|, |origin_lock| and
diff --git a/content/browser/code_cache/generated_code_cache.h b/content/browser/code_cache/generated_code_cache.h
index f5c5ff2c89489257003dfe3284ee9de9f517c99b..fdd2e2483171c4d43963590200817dac27d22cf9 100644
--- a/content/browser/code_cache/generated_code_cache.h
@@ -94,23 +136,18 @@ index f5c5ff2c89489257003dfe3284ee9de9f517c99b..fdd2e2483171c4d43963590200817dac
// JavaScript from chrome and chrome-untrusted pages. The resource URLs are
diff --git a/content/browser/code_cache/generated_code_cache_browsertest.cc b/content/browser/code_cache/generated_code_cache_browsertest.cc
index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768a6fb197d 100644
index 2b84d4ef58986bb2eb8da1e62edd31769004bd98..7b213ad2757ece877d93e9f2cfdcaf666a6c054c 100644
--- a/content/browser/code_cache/generated_code_cache_browsertest.cc
+++ b/content/browser/code_cache/generated_code_cache_browsertest.cc
@@ -2,21 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/test/test_future.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
+#include "components/services/storage/storage_service_impl.h"
@@ -8,12 +8,17 @@
#include "content/browser/code_cache/generated_code_cache.h"
+#include "content/browser/code_cache/generated_code_cache_context.h"
#include "content/browser/code_cache/generated_code_cache_context.h"
#include "content/browser/renderer_host/code_cache_host_impl.h"
+#include "content/browser/storage_partition_impl.h"
+#include "content/common/url_schemes.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
@@ -119,9 +156,8 @@ index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768
+#include "content/test/test_content_client.h"
#include "net/dns/mock_host_resolver.h"
#include "third_party/blink/public/common/features.h"
+#include "url/url_util.h"
namespace content {
#include "third_party/blink/public/common/page/v8_compile_hints_histograms.h"
@@ -22,6 +27,8 @@ namespace content {
namespace {
@@ -130,37 +166,46 @@ index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768
bool SupportsSharedWorker() {
#if BUILDFLAG(IS_ANDROID)
// SharedWorkers are not enabled on Android. https://crbug.com/154571
@@ -427,4 +438,80 @@ IN_PROC_BROWSER_TEST_P(CodeCacheBrowserTest,
@@ -115,8 +122,7 @@ class CodeCacheBrowserTest
// Worker scripts will fetch this once the cacheable resource has been
// loaded and the test logic (checking histograms) can continue.
if (absolute_url.path() == "/done.js") {
- content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
- std::move(done_callback_));
+ GetUIThreadTaskRunner({})->PostTask(FROM_HERE, std::move(done_callback_));
auto http_response =
std::make_unique<net::test_server::BasicHttpResponse>();
@@ -629,4 +635,82 @@ IN_PROC_BROWSER_TEST_F(LocalCompileHintsBrowserTest, LocalCompileHints) {
}
}
+class CodeCacheInCustomSchemeBrowserTest : public ContentBrowserTest {
+class CodeCacheInCustomSchemeBrowserTest : public ContentBrowserTest,
+ public TestContentClient {
+ public:
+ CodeCacheInCustomSchemeBrowserTest() {
+ SetContentClient(&test_content_client_);
+ SetContentClient(this);
+ ReRegisterContentSchemesForTests();
+ }
+
+ private:
+ class CustomSchemeContentClient : public TestContentClient {
+ public:
+ void AddAdditionalSchemes(Schemes* schemes) override {
+ schemes->standard_schemes.push_back(kCodeCacheScheme);
+ schemes->code_cache_schemes.push_back(kCodeCacheScheme);
+ }
+ };
+ ~CodeCacheInCustomSchemeBrowserTest() override { SetContentClient(nullptr); }
+
+ private:
+ void AddAdditionalSchemes(Schemes* schemes) override {
+ schemes->standard_schemes.push_back(kCodeCacheScheme);
+ schemes->code_cache_schemes.push_back(kCodeCacheScheme);
+ }
+
+ CustomSchemeContentClient test_content_client_;
+ url::ScopedSchemeRegistryForTests scheme_registry_;
+};
+
+IN_PROC_BROWSER_TEST_F(CodeCacheInCustomSchemeBrowserTest,
+ AllowedCustomSchemeCanGenerateCodeCache) {
+ // Create browser context and get code cache context.
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ TestBrowserContext browser_context;
+ StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
+ browser_context.GetDefaultStoragePartition());
+ StoragePartitionImpl* partition =
+ static_cast<StoragePartitionImpl*>(shell()
+ ->web_contents()
+ ->GetBrowserContext()
+ ->GetDefaultStoragePartition());
+ scoped_refptr<GeneratedCodeCacheContext> context =
+ partition->GetGeneratedCodeCacheContext();
+ EXPECT_NE(context, nullptr);
@@ -175,44 +220,47 @@ index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768
+ base::test::TestFuture<void> add_entry_future;
+ GeneratedCodeCacheContext::RunOrPostTask(
+ context.get(), FROM_HERE,
+ base::BindOnce([](scoped_refptr<GeneratedCodeCacheContext> context,
+ const GURL& url,
+ const GURL& origin,
+ const std::string& data,
+ base::OnceClosure callback) {
+ context->generated_js_code_cache()->WriteEntry(
+ url, origin, net::NetworkIsolationKey(),
+ base::Time::Now(), std::vector<uint8_t>(data.begin(), data.end()));
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, std::move(callback));
+ }, context, url, origin, data, add_entry_future.GetCallback()));
+ base::BindOnce(
+ [](scoped_refptr<GeneratedCodeCacheContext> context, const GURL& url,
+ const GURL& origin, const std::string& data,
+ base::OnceClosure callback) {
+ context->generated_js_code_cache()->WriteEntry(
+ url, origin, net::NetworkIsolationKey(), base::Time::Now(),
+ std::vector<uint8_t>(data.begin(), data.end()));
+ GetUIThreadTaskRunner({})->PostTask(FROM_HERE, std::move(callback));
+ },
+ context, url, origin, data, add_entry_future.GetCallback()));
+ ASSERT_TRUE(add_entry_future.Wait());
+
+ // Get the code cache entry.
+ base::test::TestFuture<std::string> get_entry_future;
+ GeneratedCodeCacheContext::RunOrPostTask(
+ context.get(), FROM_HERE,
+ base::BindOnce([](scoped_refptr<GeneratedCodeCacheContext> context,
+ const GURL& url,
+ const GURL& origin,
+ base::OnceCallback<void(std::string)> callback) {
+ context->generated_js_code_cache()->FetchEntry(
+ url, origin, net::NetworkIsolationKey(),
+ base::BindOnce([](base::OnceCallback<void(std::string)> callback,
+ const base::Time& response_time,
+ mojo_base::BigBuffer buffer) {
+ std::string data(buffer.data(), buffer.data() + buffer.size());
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, base::BindOnce(std::move(callback), data));
+ }, std::move(callback)));
+ }, context, url, origin, get_entry_future.GetCallback()));
+ base::BindOnce(
+ [](scoped_refptr<GeneratedCodeCacheContext> context, const GURL& url,
+ const GURL& origin,
+ base::OnceCallback<void(std::string)> callback) {
+ context->generated_js_code_cache()->FetchEntry(
+ url, origin, net::NetworkIsolationKey(),
+ base::BindOnce(
+ [](base::OnceCallback<void(std::string)> callback,
+ const base::Time& response_time,
+ mojo_base::BigBuffer buffer) {
+ std::string data(buffer.data(),
+ buffer.data() + buffer.size());
+ GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, base::BindOnce(std::move(callback), data));
+ },
+ std::move(callback)));
+ },
+ context, url, origin, get_entry_future.GetCallback()));
+ ASSERT_TRUE(get_entry_future.Wait());
+ ASSERT_EQ(data, get_entry_future.Get<0>());
+}
+
} // namespace content
diff --git a/content/browser/renderer_host/code_cache_host_impl.cc b/content/browser/renderer_host/code_cache_host_impl.cc
index 6b9e5065dc570b506c4c2606d536319d98684e12..9d1f337b9c9890b6b7afda40bf2f829ff2a25bfd 100644
index 222b62b17f85c8eafc6920f22d5bac516118f1ac..72519f7a35c5cafd50f7dbb454c44eb469f4905f 100644
--- a/content/browser/renderer_host/code_cache_host_impl.cc
+++ b/content/browser/renderer_host/code_cache_host_impl.cc
@@ -6,6 +6,7 @@
@@ -231,100 +279,123 @@ index 6b9e5065dc570b506c4c2606d536319d98684e12..9d1f337b9c9890b6b7afda40bf2f829f
using blink::mojom::CacheStorageError;
@@ -40,6 +42,11 @@ enum class Operation {
kWrite,
};
@@ -35,6 +37,11 @@ namespace content {
namespace {
+bool ProcessLockURLIsCodeCacheScheme(const ProcessLock& process_lock) {
+ return base::Contains(url::GetCodeCacheSchemes(),
+ process_lock.lock_url().scheme());
+}
+
bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
int render_process_id,
Operation operation) {
@@ -47,11 +54,12 @@ bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
bool CheckSecurityForAccessingCodeCacheData(
const GURL& resource_url,
int render_process_id,
@@ -43,40 +50,57 @@ bool CheckSecurityForAccessingCodeCacheData(
ChildProcessSecurityPolicyImpl::GetInstance()->GetProcessLock(
render_process_id);
- // Code caching is only allowed for http(s) and chrome/chrome-untrusted
- // scripts. Furthermore, there is no way for http(s) pages to load chrome or
- // chrome-untrusted scripts, so any http(s) page attempting to store data
- // about a chrome or chrome-untrusted script would be an indication of
- // suspicious activity.
+ // Code caching is only allowed for scripts from open-web (http/https and
+ // custom schemes registered with url::AddCodeCacheScheme) and
+ // chrome/chrome-untrusted schemes. Furthermore, there is no way for
+ // open-web pages to load chrome or chrome-untrusted scripts, so any
+ // open-web page attempting to store data about a chrome or
+ // chrome-untrusted script would be an indication of suspicious activity.
if (resource_url.SchemeIs(content::kChromeUIScheme) ||
resource_url.SchemeIs(content::kChromeUIUntrustedScheme)) {
if (!process_lock.is_locked_to_site()) {
@@ -60,9 +68,10 @@ bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
return false;
}
+ // Code caching is only allowed for scripts from:
+ // 1. http: and https: schemes.
+ // 2. chrome: and chrome-untrusted: schemes.
+ // 3. Schemes registered by content/ embedder via url::AddCodeCacheScheme.
+ //
+ // Furthermore, we know there are no way for http(s) pages to load chrome or
// chrome-untrusted scripts, so any http(s) page attempting to store data
// about a chrome or chrome-untrusted script would be an indication of
// suspicious activity.
- if (resource_url.SchemeIs(content::kChromeUIScheme) ||
- resource_url.SchemeIs(content::kChromeUIUntrustedScheme)) {
- if (!process_lock.is_locked_to_site()) {
- // We can't tell for certain whether this renderer is doing something
- // malicious, but we don't trust it enough to store data.
- return false;
- }
+ if (resource_url.SchemeIsHTTPOrHTTPS()) {
if (process_lock.matches_scheme(url::kHttpScheme) ||
- process_lock.matches_scheme(url::kHttpsScheme)) {
+ process_lock.matches_scheme(url::kHttpsScheme) ||
+ ProcessLockURLIsCodeCacheScheme(process_lock)) {
if (operation == Operation::kWrite) {
- mojo::ReportBadMessage("HTTP(S) pages cannot cache WebUI code");
+ mojo::ReportBadMessage("Open-web pages cannot cache WebUI code");
}
return false;
}
@@ -72,7 +81,16 @@ bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
return process_lock.matches_scheme(content::kChromeUIScheme) ||
process_lock.matches_scheme(content::kChromeUIUntrustedScheme);
}
- if (resource_url.SchemeIsHTTPOrHTTPS()) {
+ if (base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme()) &&
+ (process_lock.matches_scheme(url::kHttpScheme) ||
+ process_lock.matches_scheme(url::kHttpsScheme))) {
+ // While custom schemes registered with url::AddCodeCacheScheme are
+ // considered as open-web pages, we still do not trust http(s) pages
+ // loading resources from custom schemes.
process_lock.matches_scheme(url::kHttpsScheme)) {
- if (operation == CodeCacheHostImpl::Operation::kWrite) {
+ return true;
+ }
+ // Pages in custom schemes like isolated-app: are allowed to load http(s)
+ // resources.
+ if (ProcessLockURLIsCodeCacheScheme(process_lock)) {
+ return true;
+ }
+ // It is possible for WebUI pages to include open-web content, but such
+ // usage is rare and we've decided that reasoning about security is easier
+ // if the WebUI code cache includes only WebUI scripts.
+ return false;
+ }
+ if (resource_url.SchemeIsHTTPOrHTTPS() ||
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme())) {
if (process_lock.matches_scheme(content::kChromeUIScheme) ||
process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
// It is possible for WebUI pages to include open-web content, but such
@@ -136,15 +154,17 @@ absl::optional<GURL> GetSecondaryKeyForCodeCache(const GURL& resource_url,
return absl::nullopt;
+
+ if (resource_url.SchemeIs(kChromeUIScheme) ||
+ resource_url.SchemeIs(kChromeUIUntrustedScheme)) {
+ if (process_lock.matches_scheme(kChromeUIScheme) ||
+ process_lock.matches_scheme(kChromeUIUntrustedScheme)) {
+ return true;
+ }
+ if (operation == CodeCacheHostImpl::Operation::kWrite) {
+ if (process_lock.matches_scheme(url::kHttpScheme) ||
+ process_lock.matches_scheme(url::kHttpsScheme)) {
mojo::ReportBadMessage("HTTP(S) pages cannot cache WebUI code");
}
+ if (ProcessLockURLIsCodeCacheScheme(process_lock)) {
+ mojo::ReportBadMessage(
+ "Page whose scheme are allowed by content/ embedders cannot cache "
+ "WebUI code. Did the embedder misconfigured content/?");
+ }
return false;
}
// Other schemes which might successfully load chrome or chrome-untrusted
// scripts, such as the PDF viewer, are unsupported but not considered
- // dangerous.
- return process_lock.matches_scheme(content::kChromeUIScheme) ||
- process_lock.matches_scheme(content::kChromeUIUntrustedScheme);
+ // dangerous. Similarly, the process might not be locked to a site.
+ return false;
}
- if (resource_url.SchemeIsHTTPOrHTTPS()) {
- if (process_lock.matches_scheme(content::kChromeUIScheme) ||
- process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
- // It is possible for WebUI pages to include open-web content, but such
- // usage is rare and we've decided that reasoning about security is easier
- // if the WebUI code cache includes only WebUI scripts.
- return false;
- }
- return true;
+
+ if (base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme())) {
+ return ProcessLockURLIsCodeCacheScheme(process_lock);
}
// Case 3: process_lock_url is used to enfore site-isolation in code caches.
- // Http/https/chrome schemes are safe to be used as a secondary key. Other
- // schemes could be enabled if they are known to be safe and if it is
- // required to cache code from those origins.
+ // Code cache enabled schemes (http/https/chrome/chrome-untrusted and custom
+ // schemes registered with url::AddCodeCacheScheme) are safe to be used as a
+ // secondary key. Other schemes could be enabled if they are known to be safe
+ // and if it is required to cache code from those origins.
//
// file:// URLs will have a "file:" process lock and would thus share a
// cache across all file:// URLs. That would likely be ok for security, but
// since this case is not performance sensitive we will keep things simple and
- // limit the cache to http/https/chrome/chrome-untrusted processes.
- if (process_lock.matches_scheme(url::kHttpScheme) ||
+ // limit the cache to processes of code cache enabled schemes.
+ if (ProcessLockURLIsCodeCacheScheme(process_lock) ||
+ process_lock.matches_scheme(url::kHttpScheme) ||
if (operation == CodeCacheHostImpl::Operation::kWrite) {
@@ -422,7 +446,8 @@ std::optional<GURL> CodeCacheHostImpl::GetSecondaryKeyForCodeCache(
if (process_lock.matches_scheme(url::kHttpScheme) ||
process_lock.matches_scheme(url::kHttpsScheme) ||
process_lock.matches_scheme(content::kChromeUIScheme) ||
process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
- process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
+ process_lock.matches_scheme(content::kChromeUIUntrustedScheme) ||
+ ProcessLockURLIsCodeCacheScheme(process_lock)) {
return process_lock.lock_url();
}
diff --git a/content/common/url_schemes.cc b/content/common/url_schemes.cc
index ce9644d33fe83379127b01bf9a2b1c4badc3bc7c..532b14e013b9b65ba390f09e8bb8934bb278a0d8 100644
index ce9644d33fe83379127b01bf9a2b1c4badc3bc7c..fd486d4637ae4766ed78571dee7f9cebbd809f38 100644
--- a/content/common/url_schemes.cc
+++ b/content/common/url_schemes.cc
@@ -98,6 +98,9 @@ void RegisterContentSchemes(bool should_lock_registry) {
@@ -98,6 +98,14 @@ void RegisterContentSchemes(bool should_lock_registry) {
for (auto& scheme : schemes.empty_document_schemes)
url::AddEmptyDocumentScheme(scheme.c_str());
+ for (auto& scheme : schemes.code_cache_schemes)
+ for (auto& scheme : schemes.code_cache_schemes) {
+ CHECK_NE(scheme, kChromeUIScheme);
+ CHECK_NE(scheme, kChromeUIUntrustedScheme);
+ CHECK_NE(scheme, url::kHttpScheme);
+ CHECK_NE(scheme, url::kHttpsScheme);
+ url::AddCodeCacheScheme(scheme.c_str());
+ }
+
#if BUILDFLAG(IS_ANDROID)
if (schemes.allow_non_standard_schemes_in_origins)
@@ -344,7 +415,7 @@ index 5d1484651fb8c3e03337665d3d5342ba51df3154..d4432a660d6c5a5e937dedabb7e4b71b
std::vector<std::string> extension_schemes;
// Registers a URL scheme with a predefined default custom handler.
diff --git a/url/url_util.cc b/url/url_util.cc
index 9258cfcfada47aafe6ba20c648187947fec72372..a1834e543d27d46265af0c2133acac79b6c840e2 100644
index 6f83f33c01c6ba61a180dd663f619a7a6a3cdd8b..95aad6e0c247b60874cd8907a4bb2cf63be48478 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -114,6 +114,9 @@ struct SchemeRegistry {
@@ -357,7 +428,7 @@ index 9258cfcfada47aafe6ba20c648187947fec72372..a1834e543d27d46265af0c2133acac79
// Schemes with a predefined default custom handler.
std::vector<SchemeWithHandler> predefined_handler_schemes;
@@ -659,6 +662,15 @@ const std::vector<std::string>& GetEmptyDocumentSchemes() {
@@ -658,6 +661,15 @@ const std::vector<std::string>& GetEmptyDocumentSchemes() {
return GetSchemeRegistry().empty_document_schemes;
}
@@ -374,7 +445,7 @@ index 9258cfcfada47aafe6ba20c648187947fec72372..a1834e543d27d46265af0c2133acac79
DoAddSchemeWithHandler(
new_scheme, handler,
diff --git a/url/url_util.h b/url/url_util.h
index 8c94c7a4f6d5f653d326199e5b43452f969911d4..40dcdf9d680f9d345c09426da48b37f288234244 100644
index 8c94c7a4f6d5f653d326199e5b43452f969911d4..518ea53a033233ca88b411200e008beb7bbd75ef 100644
--- a/url/url_util.h
+++ b/url/url_util.h
@@ -115,6 +115,15 @@ COMPONENT_EXPORT(URL) const std::vector<std::string>& GetCSPBypassingSchemes();
@@ -386,7 +457,7 @@ index 8c94c7a4f6d5f653d326199e5b43452f969911d4..40dcdf9d680f9d345c09426da48b37f2
+// The WebUI schemes (chrome/chrome-untrusted) do not belong to this list, as
+// they are treated as a separate cache type for security purpose.
+// The http(s) schemes do not belong to this list neither, they always have V8
+// code cache enabled and can not load scripts from schemes in this list.
+// code cache enabled.
+COMPONENT_EXPORT(URL) void AddCodeCacheScheme(const char* new_scheme);
+COMPONENT_EXPORT(URL) const std::vector<std::string>& GetCodeCacheSchemes();
+

View File

@@ -7,10 +7,10 @@ Subject: feat: allow embedders to add observers on created hunspell
This patch is used by Electron to implement spellchecker events.
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 707a8346ea5bf49e20bac5669d777a8ab247dc51..69c82dd102e7e746db68c6ab4768a40a5aeeff6e 100644
index 1018f1871490d8681f3f5769a3d7f53b8b095b30..073dbf4e3a71102ba67ad6ee34f6191207e62e7f 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -487,6 +487,8 @@ void SpellcheckService::LoadDictionaries() {
@@ -478,6 +478,8 @@ void SpellcheckService::LoadDictionaries() {
std::make_unique<SpellcheckHunspellDictionary>(
dictionary, platform_spellcheck_language, context_, this));
hunspell_dictionaries_.back()->AddObserver(this);
@@ -19,7 +19,7 @@ index 707a8346ea5bf49e20bac5669d777a8ab247dc51..69c82dd102e7e746db68c6ab4768a40a
hunspell_dictionaries_.back()->Load();
}
@@ -541,6 +543,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
@@ -532,6 +534,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
(!hunspell_dictionaries_.empty() || enable_if_uninitialized);
}

View File

@@ -183,7 +183,7 @@ index 01e62d7e8df65efb900e9cd0d34bcd8e0ed3e7da..9af6784707f125046d9a734165fc2b08
host->GetChildProcess()->BindServiceInterface(std::move(receiver));
}
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 6c67113ad9983839366d413ebe42321c0afcbf18..c82d0c73632648f0979b494d2df08bada956324c 100644
index b9ddc82c767c5641b0d8b0166fa181148aea4de7..c6f8418eeddfe8f95927afbe6e034511e3df1011 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -157,11 +157,13 @@ const ChildProcessData& UtilityProcessHost::GetData() {
@@ -227,9 +227,9 @@ index 6c67113ad9983839366d413ebe42321c0afcbf18..c82d0c73632648f0979b494d2df08bad
mojom::ChildProcess* UtilityProcessHost::GetChildProcess() {
return static_cast<ChildProcessHostImpl*>(process_->GetHost())
->child_process();
@@ -441,9 +461,22 @@ bool UtilityProcessHost::StartProcess() {
@@ -445,9 +465,22 @@ bool UtilityProcessHost::StartProcess() {
}
#endif // BUILDFLAG(IS_LINUX)
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_WIN)
+ file_data_->stdout_handle = std::move(stdout_handle_);
@@ -252,7 +252,7 @@ index 6c67113ad9983839366d413ebe42321c0afcbf18..c82d0c73632648f0979b494d2df08bad
#if BUILDFLAG(IS_WIN)
if (!preload_libraries_.empty()) {
diff --git a/content/browser/utility_process_host.h b/content/browser/utility_process_host.h
index 012069cada2220f6c1976107bc2e4ca6dcb7d7ca..a52a197eb51f8c00d7321f03ccb436ec7d009d47 100644
index 33d7e3613801085630735b49a5789d2a9bf2aed3..b0b6efc9c9acdd2aac6a9c90640f4fbc638b1761 100644
--- a/content/browser/utility_process_host.h
+++ b/content/browser/utility_process_host.h
@@ -35,6 +35,10 @@
@@ -323,7 +323,7 @@ index 012069cada2220f6c1976107bc2e4ca6dcb7d7ca..a52a197eb51f8c00d7321f03ccb436ec
// launch failed.
enum class LaunchState {
diff --git a/content/browser/utility_sandbox_delegate.cc b/content/browser/utility_sandbox_delegate.cc
index bf65aec1c2a8eb6a91d0d2815979dbedc0e4a09f..4025b4fd7950d40088aa1c1364a7e7aa16bc325e 100644
index 2f3977d62535e299ef3b5954b9d67291afae2a57..edc825c691f7b55cd38fa31a9229fdf02bb5ff24 100644
--- a/content/browser/utility_sandbox_delegate.cc
+++ b/content/browser/utility_sandbox_delegate.cc
@@ -29,13 +29,15 @@ UtilitySandboxedProcessLauncherDelegate::
@@ -627,10 +627,10 @@ index cb43aa14c9742f3788ae58c3e49b890cd532f327..6a738f7aade504f2ff3bb6647a0da8f8
#if BUILDFLAG(IS_MAC)
// Whether or not to disclaim TCC responsibility for the process, defaults to
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc
index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245ee924a57 100644
index 714422bd2d088809c6ba78ecc8344c7c65f09159..dace94e6ad3254bc4e9fe1378e46fd86f4f132a1 100644
--- a/sandbox/policy/win/sandbox_win.cc
+++ b/sandbox/policy/win/sandbox_win.cc
@@ -724,11 +724,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() {
@@ -720,11 +720,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() {
// command line flag.
ResultCode LaunchWithoutSandbox(
const base::CommandLine& cmd_line,
@@ -643,7 +643,7 @@ index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245
// Network process runs in a job even when unsandboxed. This is to ensure it
// does not outlive the browser, which could happen if there is a lot of I/O
// on process shutdown, in which case TerminateProcess can fail. See
@@ -959,7 +957,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) {
@@ -949,7 +947,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) {
ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,
@@ -652,7 +652,7 @@ index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245
SandboxDelegate* delegate,
TargetPolicy* policy) {
const base::CommandLine& launcher_process_command_line =
@@ -973,7 +971,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
@@ -963,7 +961,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
}
// Add any handles to be inherited to the policy.
@@ -661,7 +661,7 @@ index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245
policy->AddHandleToShare(handle);
if (!policy->GetConfig()->IsConfigured()) {
@@ -988,6 +986,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
@@ -978,6 +976,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
// have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS.
policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
@@ -675,7 +675,7 @@ index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245
#endif
if (!delegate->PreSpawnTarget(policy))
@@ -1000,7 +1005,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
@@ -990,7 +995,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
ResultCode SandboxWin::StartSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,
@@ -684,7 +684,7 @@ index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245
SandboxDelegate* delegate,
base::Process* process) {
const base::ElapsedTimer timer;
@@ -1008,13 +1013,13 @@ ResultCode SandboxWin::StartSandboxedProcess(
@@ -998,13 +1003,13 @@ ResultCode SandboxWin::StartSandboxedProcess(
// Avoid making a policy if we won't use it.
if (IsUnsandboxedProcess(delegate->GetSandboxType(), cmd_line,
*base::CommandLine::ForCurrentProcess())) {
@@ -701,10 +701,10 @@ index 8a49455376de22710448ee13d069a64ae9168a28..30e547e7ea7660878c00b4c4fc3f7245
return result;
diff --git a/sandbox/policy/win/sandbox_win.h b/sandbox/policy/win/sandbox_win.h
index 81698da8fef99a5a4732fea5a4d39380b1f6ce76..d0ccb176a20a472c3e8186b72718c320073d58e7 100644
index 53b719a5724a06abd45cca25aa6f0c9ffb082523..2a3ca8c86c46f0b3d1722dcd289c343fe5838440 100644
--- a/sandbox/policy/win/sandbox_win.h
+++ b/sandbox/policy/win/sandbox_win.h
@@ -52,7 +52,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
@@ -53,7 +53,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
static ResultCode StartSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,
@@ -713,7 +713,7 @@ index 81698da8fef99a5a4732fea5a4d39380b1f6ce76..d0ccb176a20a472c3e8186b72718c320
SandboxDelegate* delegate,
base::Process* process);
@@ -66,7 +66,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
@@ -67,7 +67,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
static ResultCode GeneratePolicyForSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,

View File

@@ -8,7 +8,7 @@ rendering with the viz compositor by way of a custom HostDisplayClient
and LayeredWindowUpdater.
diff --git a/components/viz/host/host_display_client.cc b/components/viz/host/host_display_client.cc
index 41fdfa8cc4de8fb3316552dc9851874e430c238e..6a51498c9ec7b35b8609a8369ae4703e1936d1ad 100644
index 7af928a9a030c0bc1efe069f0a4004adc5ae9c14..e1b04e1e2f76a3d9ba4575844e1ae49dd909ecb2 100644
--- a/components/viz/host/host_display_client.cc
+++ b/components/viz/host/host_display_client.cc
@@ -47,9 +47,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
@@ -39,10 +39,10 @@ index 41fdfa8cc4de8fb3316552dc9851874e430c238e..6a51498c9ec7b35b8609a8369ae4703e
gpu::SurfaceHandle child_window) {
NOTREACHED();
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
index a55ab928c0d9190dd42852655b175053dbb11610..e1cdec8fe6e316dc38f89400ab7844d3d6b32784 100644
index cb16487f9fc0811ef577d455098f09e3000db86a..d67c0f8bce3c6a8f7643409e07e21e789b4bd391 100644
--- a/components/viz/host/host_display_client.h
+++ b/components/viz/host/host_display_client.h
@@ -42,6 +42,9 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
@@ -39,6 +39,9 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
gfx::AcceleratedWidget widget() const { return widget_; }
#endif
@@ -52,7 +52,7 @@ index a55ab928c0d9190dd42852655b175053dbb11610..e1cdec8fe6e316dc38f89400ab7844d3
private:
// mojom::DisplayClient implementation:
#if BUILDFLAG(IS_APPLE)
@@ -50,8 +53,6 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
@@ -47,8 +50,6 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
#endif
#if BUILDFLAG(IS_WIN)
@@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
private:
const HWND hwnd_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 3e78747afba61506ca616a66b51365bf4117110c..e094d5e310745082a0562183c4b4b59da4b078d6 100644
index 27b8d9c767ca3f4dede7f79d6295ec8cc06eaffe..ebcd7d4fb8e876e3d5fd1fa1e0b6629049e664af 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -143,6 +143,8 @@ viz_component("service") {
@@ -103,7 +103,7 @@ index 3e78747afba61506ca616a66b51365bf4117110c..e094d5e310745082a0562183c4b4b59d
"display_embedder/software_output_surface.h",
"display_embedder/vsync_parameter_listener.cc",
diff --git a/components/viz/service/display_embedder/output_surface_provider.h b/components/viz/service/display_embedder/output_surface_provider.h
index 5789972c7852473c7fb3565416e9de6595c9f291..482d061f76e9c52fc7f084572d834cab9f383834 100644
index a4e6ad16fd2def9bbed7cd11ea13ba365a9f7322..20a426e6f7dff17c22dd05d75d601a560cd34283 100644
--- a/components/viz/service/display_embedder/output_surface_provider.h
+++ b/components/viz/service/display_embedder/output_surface_provider.h
@@ -38,7 +38,8 @@ class OutputSurfaceProvider {
@@ -115,9 +115,9 @@ index 5789972c7852473c7fb3565416e9de6595c9f291..482d061f76e9c52fc7f084572d834cab
+ bool offscreen) = 0;
virtual gpu::SharedImageManager* GetSharedImageManager() = 0;
};
virtual gpu::SyncPointManager* GetSyncPointManager() = 0;
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
index d97d8524820457e157b9a8aaa2090e7fde8a8225..a5f7587e7208a51ccb53b07c2ccd7ce880611215 100644
index e8e3237bb2b8f134be81441ada743ad78f147d97..a5c5360377d9d5f6e46b0ff023ca302128bfb327 100644
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
@@ -25,12 +25,14 @@
@@ -179,10 +179,10 @@ index d97d8524820457e157b9a8aaa2090e7fde8a8225..a5f7587e7208a51ccb53b07c2ccd7ce8
return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_,
display_client);
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.h b/components/viz/service/display_embedder/output_surface_provider_impl.h
index c7c58705509f46436feefb6b538b95ec9271a53f..b133976ab3c7713ee18c0df3f9d75e4c9be7ff33 100644
index d149ef23deaf591e472fcd00a7ea32b2e4052b98..6e93321d2856d40a00fa04fe03a2bb72ba650e83 100644
--- a/components/viz/service/display_embedder/output_surface_provider_impl.h
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.h
@@ -50,14 +50,16 @@ class VIZ_SERVICE_EXPORT OutputSurfaceProviderImpl
@@ -50,7 +50,8 @@ class VIZ_SERVICE_EXPORT OutputSurfaceProviderImpl
mojom::DisplayClient* display_client,
DisplayCompositorMemoryAndTaskController* gpu_dependency,
const RendererSettings& renderer_settings,
@@ -191,7 +191,8 @@ index c7c58705509f46436feefb6b538b95ec9271a53f..b133976ab3c7713ee18c0df3f9d75e4c
+ bool offscreen) override;
gpu::SharedImageManager* GetSharedImageManager() override;
gpu::SyncPointManager* GetSyncPointManager() override;
@@ -58,7 +59,8 @@ class VIZ_SERVICE_EXPORT OutputSurfaceProviderImpl
private:
std::unique_ptr<SoftwareOutputDevice> CreateSoftwareOutputDeviceForPlatform(
gpu::SurfaceHandle surface_handle,
@@ -519,10 +520,10 @@ index 796ae2688436eb07f19909641d1620dd02f10cdb..c9e0eee0b329caf46669b419b1cd10cf
waiting_on_draw_ack_ = true;
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
index 353d262c8208fad17d5a5bf2bc9f26064533efc4..e6ad55511526e6e7b1ceea51493196afcf7fb822 100644
index a5ed36808d01965336e6f812ba9c5a0d50ef854d..fa0b75dda34f3a2ea3a4d72dd62e82552a284f6d 100644
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -101,7 +101,8 @@ RootCompositorFrameSinkImpl::Create(
@@ -98,7 +98,8 @@ RootCompositorFrameSinkImpl::Create(
params->gpu_compositing, params->widget);
auto output_surface = output_surface_provider->CreateOutputSurface(
params->widget, params->gpu_compositing, display_client.get(),
@@ -533,7 +534,7 @@ index 353d262c8208fad17d5a5bf2bc9f26064533efc4..e6ad55511526e6e7b1ceea51493196af
// Creating output surface failed. The host can send a new request, possibly
// with a different compositing mode.
diff --git a/components/viz/test/test_output_surface_provider.cc b/components/viz/test/test_output_surface_provider.cc
index d4aa29c627c75d5aef50afa2a7daa257d2b7739f..79c6ce9104bf7be36fd465f409f955541fedd8c1 100644
index 7648cb06aa78891804bb0783f884b09e07597fbc..f1a73f157ca43620019b864aef35d0ad36c12353 100644
--- a/components/viz/test/test_output_surface_provider.cc
+++ b/components/viz/test/test_output_surface_provider.cc
@@ -30,7 +30,8 @@ std::unique_ptr<OutputSurface> TestOutputSurfaceProvider::CreateOutputSurface(
@@ -547,7 +548,7 @@ index d4aa29c627c75d5aef50afa2a7daa257d2b7739f..79c6ce9104bf7be36fd465f409f95554
return FakeSkiaOutputSurface::Create3d();
} else {
diff --git a/components/viz/test/test_output_surface_provider.h b/components/viz/test/test_output_surface_provider.h
index 6714331442d056d337590c0809723fc0636c9b65..d96d6dded4a7d7897591e8362a93db6630cb7af0 100644
index febb2718cb34ea4d9f411f068d8c01a89c7db888..be8bd51cb61c20ef3df8552972a0ac2f11930150 100644
--- a/components/viz/test/test_output_surface_provider.h
+++ b/components/viz/test/test_output_surface_provider.h
@@ -32,7 +32,8 @@ class TestOutputSurfaceProvider : public OutputSurfaceProvider {
@@ -558,13 +559,13 @@ index 6714331442d056d337590c0809723fc0636c9b65..d96d6dded4a7d7897591e8362a93db66
+ const DebugRendererSettings* debug_settings,
+ bool offscreen) override;
gpu::SharedImageManager* GetSharedImageManager() override;
gpu::SyncPointManager* GetSyncPointManager() override;
};
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
index da51b2b9c395df5db6915ec1ed401b29191a6d2c..77c987ad21aa4d9a7ae0fb971d7685715a999f12 100644
index d149ead2520ed05c975119b81cc7b86701e1404f..4532417a34c6b24df2cd4bb96a0e0a463959dccf 100644
--- a/content/browser/compositor/viz_process_transport_factory.cc
+++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -413,8 +413,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
@@ -408,8 +408,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
mojo::AssociatedRemote<viz::mojom::DisplayPrivate> display_private;
root_params->display_private =
display_private.BindNewEndpointAndPassReceiver();
@@ -617,10 +618,10 @@ index 2f462f0deb5fc8a637457243fb5d5849fc214d14..695869b83cefaa24af93a2e11b39de05
+ Draw(gfx.mojom.Rect damage_rect) => ();
};
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index b8098b7e777f8fcdd4d01e8b7a1d4c5b964c4a32..67738f95affa1b7998c03d10f5f62d70afcbd62a 100644
index 30f2e29532c5e781d7a329f8265193023a00b1d8..ae38020ebd9525795f53d4751b225cc30ac02d19 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -93,6 +93,7 @@ class DisplayPrivate;
@@ -90,6 +90,7 @@ class DisplayPrivate;
class ExternalBeginFrameController;
} // namespace mojom
class ContextProvider;
@@ -628,7 +629,7 @@ index b8098b7e777f8fcdd4d01e8b7a1d4c5b964c4a32..67738f95affa1b7998c03d10f5f62d70
class HostFrameSinkManager;
class LocalSurfaceId;
class RasterContextProvider;
@@ -149,6 +150,16 @@ class COMPOSITOR_EXPORT ContextFactory {
@@ -146,6 +147,16 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
};
@@ -645,7 +646,7 @@ index b8098b7e777f8fcdd4d01e8b7a1d4c5b964c4a32..67738f95affa1b7998c03d10f5f62d70
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -192,6 +203,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
@@ -189,6 +200,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@@ -655,7 +656,7 @@ index b8098b7e777f8fcdd4d01e8b7a1d4c5b964c4a32..67738f95affa1b7998c03d10f5f62d70
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -536,6 +550,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
@@ -539,6 +553,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;

View File

@@ -7,7 +7,7 @@ This allows embedders to call SetDefersLoading without reaching into Blink inter
This might be upstreamable?
diff --git a/third_party/blink/public/web/web_document_loader.h b/third_party/blink/public/web/web_document_loader.h
index 0960ab9c8361222cd4acf554e04dc3fc124d714e..524c7cf9032a249a30cc726019266ecddacac070 100644
index f9d3219990dcf4f4a829567d567072df59a70ada..ca8281faaff601bf591cf5a2b185e4ba0aa32676 100644
--- a/third_party/blink/public/web/web_document_loader.h
+++ b/third_party/blink/public/web/web_document_loader.h
@@ -38,6 +38,7 @@
@@ -28,10 +28,10 @@ index 0960ab9c8361222cd4acf554e04dc3fc124d714e..524c7cf9032a249a30cc726019266ecd
// Returns the http referrer of original request which initited this load.
diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h
index 1f85fd2cf0ecc359821d9b1a54ec6cf7a838d7cc..91ad58864a2ddb47e2f655e61e66da39fe5132a7 100644
index e1857807c20387feb4dc363685dec4c5e1db466c..5723744f4cb840d376ffafa965f7115184dcc96d 100644
--- a/third_party/blink/renderer/core/loader/document_loader.h
+++ b/third_party/blink/renderer/core/loader/document_loader.h
@@ -308,7 +308,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected<DocumentLoader>,
@@ -311,7 +311,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected<DocumentLoader>,
absl::optional<scheduler::TaskAttributionId>
soft_navigation_heuristics_task_id);

View File

@@ -90,7 +90,7 @@ index 627a3df2debbc2a66be14556641f29232820ccf7..2a6a6e23244d9e1bc1b1f63279766e61
// a cookie. If this is set to non-null, the observer passed to
// URLLoaderFactory will be ignored.
diff --git a/services/network/public/mojom/url_response_head.mojom b/services/network/public/mojom/url_response_head.mojom
index 8aff4a0142732686e937e56bdf8e61c61f87d652..7a6736c92bd2b3298fbeefb518cab2bff9a66b4a 100644
index 5803d57c1c85f219a1ee4675d1fc4bb0c5ee81d0..880d360cfd58f368eafbabd8c3abdb361dcfbc6f 100644
--- a/services/network/public/mojom/url_response_head.mojom
+++ b/services/network/public/mojom/url_response_head.mojom
@@ -12,6 +12,7 @@ import "services/network/public/mojom/encoded_body_length.mojom";
@@ -112,10 +112,10 @@ index 8aff4a0142732686e937e56bdf8e61c61f87d652..7a6736c92bd2b3298fbeefb518cab2bf
string mime_type;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 11f6e0f7132741ae9475f61ab231baf36c60b3be..2083123c0bee80188c987b7095ec9295ffd97fdb 100644
index f91b4acdf8da956909f2a51f9b2c065958f87f0c..fdf061bdf13948884dccb5c24f761bc32b82dbcd 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -684,6 +684,7 @@ URLLoader::URLLoader(
@@ -673,6 +673,7 @@ URLLoader::URLLoader(
has_user_activation_ = request.trusted_params->has_user_activation;
allow_cookies_from_browser_ =
request.trusted_params->allow_cookies_from_browser;
@@ -123,7 +123,7 @@ index 11f6e0f7132741ae9475f61ab231baf36c60b3be..2083123c0bee80188c987b7095ec9295
}
// Store any cookies passed from the browser process to later attach them to
@@ -722,7 +723,7 @@ URLLoader::URLLoader(
@@ -711,7 +712,7 @@ URLLoader::URLLoader(
&URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
}
@@ -132,7 +132,7 @@ index 11f6e0f7132741ae9475f61ab231baf36c60b3be..2083123c0bee80188c987b7095ec9295
url_request_->SetResponseHeadersCallback(base::BindRepeating(
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
}
@@ -1660,6 +1661,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
@@ -1647,6 +1648,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
}
response_ = BuildResponseHead();

View File

@@ -1,19 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: clavin <clavin@electronjs.org>
Date: Wed, 30 Aug 2023 18:15:36 -0700
Date: Mon, 11 Dec 2023 20:43:34 -0300
Subject: fix: activate background material on windows
This patch adds a condition to the HWND message handler to allow windows
with translucent background materials to become activated.
It also ensures the lParam of WM_NCACTIVATE is set to -1 so as to not repaint
the client area, which can lead to a title bar incorrectly being displayed in
frameless windows.
This patch likely can't be upstreamed as-is, as Chromium doesn't have
this use case in mind currently.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 23905a6b7f739ff3c6f391f984527ef5d2ed0bd9..ee72bad1b884677b02cc2f86ea307742e5528bad 100644
index 23905a6b7f739ff3c6f391f984527ef5d2ed0bd9..aed8894a5514fddfc8d15b8fb4ae611fa4493b6f 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -901,7 +901,7 @@ void HWNDMessageHandler::FrameTypeChanged() {
@@ -901,13 +901,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
void HWNDMessageHandler::PaintAsActiveChanged() {
if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
@@ -22,3 +26,34 @@ index 23905a6b7f739ff3c6f391f984527ef5d2ed0bd9..ee72bad1b884677b02cc2f86ea307742
(delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN)) {
return;
}
DefWindowProcWithRedrawLock(WM_NCACTIVATE, delegate_->ShouldPaintAsActive(),
- 0);
+ delegate_->HasFrame() ? 0 : -1);
}
void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
@@ -2254,17 +2254,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
if (IsVisible())
delegate_->SchedulePaint();
- // Calling DefWindowProc is only necessary if there's a system frame being
- // drawn. Otherwise it can draw an incorrect title bar and cause visual
- // corruption.
- if (!delegate_->HasFrame() ||
+ // If the window is translucent, it may have the Mica background.
+ // In that case, it's necessary to call |DefWindowProc|, but we can
+ // pass -1 in the lParam to prevent any non-client area elements from
+ // being displayed.
+ if ((!delegate_->HasFrame() && !is_translucent_) ||
delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN) {
SetMsgHandled(TRUE);
return TRUE;
}
return DefWindowProcWithRedrawLock(WM_NCACTIVATE, paint_as_active || active,
- 0);
+ delegate_->HasFrame() ? 0 : -1);
}
LRESULT HWNDMessageHandler::OnNCCalcSize(BOOL mode, LPARAM l_param) {

View File

@@ -16,7 +16,7 @@ Linux or Windows to un-fullscreen in some circumstances without this
change.
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
index ecdf2fcdde08df4fce98f3fdad99f2a430cae32d..00fb5a200f0675e23c13205a1e1cd1628e3e2818 100644
index e108057665773bcbbbc48de995b8001a700b4368..0b751ec1c1455890f12e517beb3967544bbacb9d 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
@@ -16,12 +16,16 @@
@@ -68,17 +68,17 @@ index ecdf2fcdde08df4fce98f3fdad99f2a430cae32d..00fb5a200f0675e23c13205a1e1cd162
content::WebContents* opener,
content::WebContents* popup) {
+#if 0
if (popunder_preventer_) {
DCHECK_EQ(exclusive_access_tab(), opener);
popunder_preventer_->AddPotentialPopunder(popup);
} else {
DCHECK(IsFullscreenWithinTab(opener));
if (!popunder_preventer_) {
return;
}
DCHECK_EQ(exclusive_access_tab(), opener);
popunder_preventer_->AddPotentialPopunder(popup);
+#endif
}
void FullscreenController::OnTabDeactivated(
@@ -471,18 +481,17 @@ void FullscreenController::EnterFullscreenModeInternal(
@@ -480,18 +490,17 @@ void FullscreenController::EnterFullscreenModeInternal(
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
// from manually entering fullscreen mode and also disables kiosk mode on
// desktop platforms.
@@ -102,7 +102,7 @@ index ecdf2fcdde08df4fce98f3fdad99f2a430cae32d..00fb5a200f0675e23c13205a1e1cd162
if (option == TAB) {
url = GetRequestingOrigin();
tab_fullscreen_ = true;
@@ -515,6 +524,7 @@ void FullscreenController::EnterFullscreenModeInternal(
@@ -524,6 +533,7 @@ void FullscreenController::EnterFullscreenModeInternal(
if (!extension_caused_fullscreen_.is_empty())
url = extension_caused_fullscreen_;
}
@@ -110,7 +110,7 @@ index ecdf2fcdde08df4fce98f3fdad99f2a430cae32d..00fb5a200f0675e23c13205a1e1cd162
if (option == BROWSER)
base::RecordAction(base::UserMetricsAction("ToggleFullscreen"));
@@ -535,12 +545,12 @@ void FullscreenController::ExitFullscreenModeInternal() {
@@ -544,12 +554,12 @@ void FullscreenController::ExitFullscreenModeInternal() {
toggled_into_fullscreen_ = false;
started_fullscreen_transition_ = true;

View File

@@ -23,10 +23,10 @@ Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index 9f214097ebbbc3c8a98a17990f439198054efb8e..ed6424c6beba20470de36b65e123e70e2637d0e6 100644
index bceffd4976353b4ece2959acd69ffd6d9a6f594e..89c7f7848afba03ffd78ae1c0056125019578c18 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -9994,6 +9994,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
@@ -10048,6 +10048,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
return std::make_pair(parent->GetLastCommittedOrigin(), "about_srcdoc");
}
@@ -40,7 +40,7 @@ index 9f214097ebbbc3c8a98a17990f439198054efb8e..ed6424c6beba20470de36b65e123e70e
// origin of |common_params.url| and/or |common_params.initiator_origin|.
url::Origin resolved_origin = url::Origin::Resolve(
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
index e89cc530da1bca8a53c8a1bbc1d842aeed0780dc..27bc33a5f5cf2e35036e0a68dc717cfd3c422d78 100644
index 908da65eeef8e6428538def88731c16967e05027..3d09c647bbcabe11b8ecb5b9d508a4d939e6acf4 100644
--- a/third_party/blink/renderer/core/loader/document_loader.cc
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -2125,6 +2125,10 @@ Frame* DocumentLoader::CalculateOwnerFrame() {

View File

@@ -13,10 +13,10 @@ 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 63e6e4ea24cd7e1df3963096b54573b4acfccedf..2f006d4b12f21035d5f9e712ccb2dc87bf635322 100644
index 6d44fbd54e3d5809b6136cf61c2cdc99b7df3a50..cc354c67bae5ea3c43ee4794a430da218afcd64e 100644
--- a/chrome/browser/resources/pdf/pdf_viewer.ts
+++ b/chrome/browser/resources/pdf/pdf_viewer.ts
@@ -905,7 +905,15 @@ export class PdfViewerElement extends PdfViewerBaseElement {
@@ -907,7 +907,15 @@ export class PdfViewerElement extends PdfViewerBaseElement {
dataArray = [result.dataToSave];
}
@@ -32,7 +32,7 @@ index 63e6e4ea24cd7e1df3963096b54573b4acfccedf..2f006d4b12f21035d5f9e712ccb2dc87
const fileName = this.attachments_[index].name;
chrome.fileSystem.chooseEntry(
{type: 'saveFile', suggestedName: fileName},
@@ -929,6 +937,7 @@ export class PdfViewerElement extends PdfViewerBaseElement {
@@ -931,6 +939,7 @@ export class PdfViewerElement extends PdfViewerBaseElement {
}
});
});
@@ -40,7 +40,7 @@ index 63e6e4ea24cd7e1df3963096b54573b4acfccedf..2f006d4b12f21035d5f9e712ccb2dc87
}
/**
@@ -1036,8 +1045,15 @@ export class PdfViewerElement extends PdfViewerBaseElement {
@@ -1038,8 +1047,15 @@ export class PdfViewerElement extends PdfViewerBaseElement {
fileName = fileName + '.pdf';
}
@@ -57,7 +57,7 @@ index 63e6e4ea24cd7e1df3963096b54573b4acfccedf..2f006d4b12f21035d5f9e712ccb2dc87
chrome.fileSystem.chooseEntry(
{
type: 'saveFile',
@@ -1064,6 +1080,7 @@ export class PdfViewerElement extends PdfViewerBaseElement {
@@ -1066,6 +1082,7 @@ export class PdfViewerElement extends PdfViewerBaseElement {
}
});
});

View File

@@ -12,10 +12,10 @@ invisible state of the `viz::DisplayScheduler` owned
by the `ui::Compositor`.
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 954828f9d9c6a5af3ad68026dbbddfe8bc0cb657..d9faab46d1df921bb31feb8f5e0908b090757150 100644
index 632b95912ff5c48431bfef4807b6481646a5cfd5..4a2e03f7d314c22497db700e88ae836753fe7a35 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -338,7 +338,8 @@ void Compositor::SetLayerTreeFrameSink(
@@ -339,7 +339,8 @@ void Compositor::SetLayerTreeFrameSink(
if (display_private_) {
disabled_swap_until_resize_ = false;
display_private_->Resize(size());
@@ -25,7 +25,7 @@ index 954828f9d9c6a5af3ad68026dbbddfe8bc0cb657..d9faab46d1df921bb31feb8f5e0908b0
display_private_->SetDisplayColorSpaces(display_color_spaces_);
display_private_->SetDisplayColorMatrix(
gfx::SkM44ToTransform(display_color_matrix_));
@@ -530,8 +531,11 @@ void Compositor::SetVisible(bool visible) {
@@ -531,8 +532,11 @@ void Compositor::SetVisible(bool visible) {
host_->SetVisible(visible);
// Visibility is reset when the output surface is lost, so this must also be
// updated then.
@@ -39,7 +39,7 @@ index 954828f9d9c6a5af3ad68026dbbddfe8bc0cb657..d9faab46d1df921bb31feb8f5e0908b0
}
bool Compositor::IsVisible() {
@@ -958,4 +962,13 @@ const cc::LayerTreeSettings& Compositor::GetLayerTreeSettings() const {
@@ -957,4 +961,13 @@ const cc::LayerTreeSettings& Compositor::GetLayerTreeSettings() const {
return host_->GetSettings();
}
@@ -54,21 +54,21 @@ index 954828f9d9c6a5af3ad68026dbbddfe8bc0cb657..d9faab46d1df921bb31feb8f5e0908b0
+
} // namespace ui
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 67738f95affa1b7998c03d10f5f62d70afcbd62a..499758acdd77058c6e3e0e798777e547e9c9a393 100644
index ae38020ebd9525795f53d4751b225cc30ac02d19..2f8fe962b9219b70e5a9f35f4b59f163aa07564d 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -522,6 +522,10 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
return host_->saved_events_metrics_count_for_testing();
}
@@ -514,6 +514,10 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
const cc::LayerTreeSettings& GetLayerTreeSettings() const;
+ // Sets |background_throttling_| responsible for suspending drawing
+ // and switching frames.
+ void SetBackgroundThrottling(bool background_throttling_enabled);
+
private:
friend class base::RefCounted<Compositor>;
friend class TotalAnimationThroughputReporter;
@@ -628,6 +632,12 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
size_t saved_events_metrics_count_for_testing() const {
return host_->saved_events_metrics_count_for_testing();
}
@@ -631,6 +635,12 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
// See go/report-ux-metrics-at-painting for details.
bool animation_started_ = false;

View File

@@ -6,10 +6,10 @@ Subject: fix: export zlib symbols
This patch sets ZLIB_DLL so that we properly export zlib symbols.
diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn
index 8ed0807a994b1e0e63ef356de91592c71efc143e..235a4715cb355538fd6008f9de07c4f318b57d7c 100644
index 46627bca7eb158cae381a791067a6b7185534370..2bb92a3b382c28d5cf320e43fe7f4f760c7757b4 100644
--- a/third_party/zlib/BUILD.gn
+++ b/third_party/zlib/BUILD.gn
@@ -321,6 +321,10 @@ component("zlib") {
@@ -322,6 +322,10 @@ component("zlib") {
defines = []
deps = []

View File

@@ -1,279 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ryan Manuel <ryanm@cypress.io>
Date: Fri, 1 Dec 2023 16:40:02 -0600
Subject: fix font flooding in dev tools
Added in this CL: https://chromium-review.googlesource.com/c/chromium/src/+/5033885
This patch resolves an issue that has been fixed in chromium involving font requests being sent multiple times to DevTools for a single request.
This patch can be removed when chromium reaches version 121.0.6157.0.
diff --git a/AUTHORS b/AUTHORS
index a31f741d472830ec17291e3fad935902e042bca0..0f710af9690e54e2509a9a3abff020322047dbe0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1151,6 +1151,7 @@ Rulong Chen <rulong.crl@alibaba-inc.com>
Russell Davis <russell.davis@gmail.com>
Ryan Ackley <ryanackley@gmail.com>
Ryan Gonzalez <rymg19@gmail.com>
+Ryan Manuel <rfmanuel@gmail.com>
Ryan Norton <rnorton10@gmail.com>
Ryan Sleevi <ryan-chromium-dev@sleevi.com>
Ryan Yoakum <ryoakum@skobalt.com>
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
index 619ccba17514b22ab9def18715047f2cefcde7a2..e0ac0cd89fc5c39cbb001b68c99392d80aff3c51 100644
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -2010,6 +2010,14 @@ BASE_FEATURE(kUACHOverrideBlank,
"UACHOverrideBlank",
base::FEATURE_DISABLED_BY_DEFAULT);
+// If enabled, the body of `EmulateLoadStartedForInspector` is executed only
+// once per Resource per ResourceFetcher, and thus duplicated network load
+// entries in DevTools caused by `EmulateLoadStartedForInspector` are removed.
+// https://crbug.com/1502591
+BASE_FEATURE(kEmulateLoadStartedForInspectorOncePerResource,
+ "kEmulateLoadStartedForInspectorOncePerResource",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
BASE_FEATURE(kUseBlinkSchedulerTaskRunnerWithCustomDeleter,
"UseBlinkSchedulerTaskRunnerWithCustomDeleter",
base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h
index ad716edf68ec5beb50cf833af28bb1b69099af78..76917f9b8ecc9c015477f576894ceae134e8b9b8 100644
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -1348,6 +1348,9 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kTimedHTMLParserBudget);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kUACHOverrideBlank);
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(
+ kEmulateLoadStartedForInspectorOncePerResource);
+
// Kill switch for using a custom task runner in the blink scheduler that makes
// DeleteSoon/ReleaseSoon less prone to memory leaks.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
index 3d889e448fe706e69eac40e61035616b2be3f74c..d8d5b0e0379c4fc65debc4e25766997e5502191e 100644
--- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
+++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
@@ -681,6 +681,19 @@ Resource* ResourceFetcher::CachedResource(const KURL& resource_url) const {
return it->value.Get();
}
+bool ResourceFetcher::ResourceHasBeenEmulatedLoadStartedForInspector(
+ const KURL& resource_url) const {
+ if (resource_url.IsEmpty()) {
+ return false;
+ }
+ KURL url = MemoryCache::RemoveFragmentIdentifierIfNeeded(resource_url);
+ const auto it = emulated_load_started_for_inspector_resources_map_.find(url);
+ if (it == emulated_load_started_for_inspector_resources_map_.end()) {
+ return false;
+ }
+ return true;
+}
+
const HeapHashSet<Member<Resource>>
ResourceFetcher::MoveResourceStrongReferences() {
document_resource_strong_refs_total_size_ = 0;
@@ -2463,11 +2476,25 @@ void ResourceFetcher::EmulateLoadStartedForInspector(
if (CachedResource(url)) {
return;
}
+
+ if (ResourceHasBeenEmulatedLoadStartedForInspector(url)) {
+ return;
+ }
+
if (resource->ErrorOccurred()) {
// We should ideally replay the error steps, but we cannot.
return;
}
+ if (base::FeatureList::IsEnabled(
+ features::kEmulateLoadStartedForInspectorOncePerResource)) {
+ // Update the emulated load started for inspector resources map with the
+ // resource so that future emulations of the same resource won't happen.
+ String resource_url = MemoryCache::RemoveFragmentIdentifierIfNeeded(url);
+ emulated_load_started_for_inspector_resources_map_.Set(resource_url,
+ resource);
+ }
+
ResourceRequest resource_request(url);
resource_request.SetRequestContext(request_context);
resource_request.SetRequestDestination(request_destination);
@@ -2767,6 +2794,7 @@ void ResourceFetcher::Trace(Visitor* visitor) const {
visitor->Trace(loaders_);
visitor->Trace(non_blocking_loaders_);
visitor->Trace(cached_resources_map_);
+ visitor->Trace(emulated_load_started_for_inspector_resources_map_);
visitor->Trace(image_resources_);
visitor->Trace(not_loaded_image_resources_);
visitor->Trace(preloads_);
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h
index b0775b4d44bf800159d0c8ef07a2258df8674b94..af96732a045c35ab443b492bd5b34868eb1ba73e 100644
--- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h
+++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h
@@ -178,6 +178,7 @@ class PLATFORM_EXPORT ResourceFetcher
CodeCacheHost* GetCodeCacheHost();
Resource* CachedResource(const KURL&) const;
+ bool ResourceHasBeenEmulatedLoadStartedForInspector(const KURL&) const;
// Registers an callback to be called with the resource priority of the fetch
// made to the specified URL. When `new_load_only` is set to false,
@@ -564,6 +565,15 @@ class PLATFORM_EXPORT ResourceFetcher
// Weak reference to all the fetched resources.
DocumentResourceMap cached_resources_map_;
+ // When a resource is in the global memory cache but not in the
+ // cached_resources_map_ and it is referenced (e.g. when the StyleEngine
+ // processes a @font-face rule), the resource will be emulated via
+ // `EmulateLoadStartedForInspector` so that it shows up in DevTools.
+ // In order to ensure that this only occurs once per resource, we keep
+ // a weak reference to all emulated resources and only emulate resources
+ // that have not been previously emulated.
+ DocumentResourceMap emulated_load_started_for_inspector_resources_map_;
+
// document_resource_strong_refs_ keeps strong references for fonts, images,
// scripts and stylesheets within their freshness lifetime.
HeapHashSet<Member<Resource>> document_resource_strong_refs_;
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc
index d1947b5070cd537b29fdf4cb1a9e6780e803111f..6f8ef7af61abd84519543ee7628fb1e88ab9b5de 100644
--- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc
+++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher_test.cc
@@ -161,6 +161,8 @@ class ResourceFetcherTest : public testing::Test {
return request_;
}
+ void ClearLastRequest() { request_ = absl::nullopt; }
+
private:
absl::optional<PartialResourceRequest> request_;
};
@@ -1627,4 +1629,123 @@ TEST_F(ResourceFetcherTest, StrongReferenceThreshold) {
ASSERT_FALSE(perform_fetch.Run(KURL("http://127.0.0.1:8000/baz.png")));
}
+TEST_F(ResourceFetcherTest,
+ EmulateLoadStartedForInspectorOncePerResourceDisabled) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndDisableFeature(
+ features::kEmulateLoadStartedForInspectorOncePerResource);
+ auto* observer = MakeGarbageCollected<TestResourceLoadObserver>();
+
+ // Set up the initial fetcher and mark the resource as cached.
+ auto* fetcher = CreateFetcher();
+ KURL url("http://127.0.0.1:8000/foo.woff2");
+ RegisterMockedURLLoad(url);
+ FetchParameters fetch_params =
+ FetchParameters::CreateForTest(ResourceRequest(url));
+ Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr);
+ resource->SetStatus(ResourceStatus::kCached);
+
+ ASSERT_NE(fetcher->CachedResource(url), nullptr);
+ ASSERT_FALSE(fetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+
+ // Set up the second fetcher.
+ auto* otherContextFetcher = CreateFetcher();
+ otherContextFetcher->SetResourceLoadObserver(observer);
+
+ // Ensure that the url is initially not marked as cached or
+ // emulated and the observer's last request is empty.
+ ASSERT_EQ(otherContextFetcher->CachedResource(url), nullptr);
+ ASSERT_FALSE(
+ otherContextFetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+ ASSERT_EQ(observer->GetLastRequest(), absl::nullopt);
+
+ otherContextFetcher->EmulateLoadStartedForInspector(
+ resource, url, mojom::blink::RequestContextType::FONT,
+ network::mojom::RequestDestination::kFont,
+ fetch_initiator_type_names::kCSS);
+
+ // After the first emulation, ensure that the url is not cached,
+ // is not marked as emulated and the observer's last
+ // request is not empty with the feature disabled.
+ ASSERT_EQ(otherContextFetcher->CachedResource(url), nullptr);
+ ASSERT_FALSE(
+ otherContextFetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+ ASSERT_NE(observer->GetLastRequest(), absl::nullopt);
+
+ // Clear out the last request to start fresh
+ observer->ClearLastRequest();
+
+ otherContextFetcher->EmulateLoadStartedForInspector(
+ resource, url, mojom::blink::RequestContextType::FONT,
+ network::mojom::RequestDestination::kFont,
+ fetch_initiator_type_names::kCSS);
+
+ // After the second emulation, ensure that the url is not cached,
+ // the resource is not marked as emulated, and the observer's last
+ // request is not empty with the feature disabled. This means that
+ // the observer was notified with this emulation.
+ ASSERT_EQ(otherContextFetcher->CachedResource(url), nullptr);
+ ASSERT_FALSE(
+ otherContextFetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+ ASSERT_NE(observer->GetLastRequest(), absl::nullopt);
+}
+
+TEST_F(ResourceFetcherTest,
+ EmulateLoadStartedForInspectorOncePerResourceEnabled) {
+ auto* observer = MakeGarbageCollected<TestResourceLoadObserver>();
+
+ // Set up the initial fetcher and mark the resource as cached.
+ auto* fetcher = CreateFetcher();
+ KURL url("http://127.0.0.1:8000/foo.woff2");
+ RegisterMockedURLLoad(url);
+ FetchParameters fetch_params =
+ FetchParameters::CreateForTest(ResourceRequest(url));
+ Resource* resource = MockResource::Fetch(fetch_params, fetcher, nullptr);
+ resource->SetStatus(ResourceStatus::kCached);
+
+ ASSERT_NE(fetcher->CachedResource(url), nullptr);
+ ASSERT_FALSE(fetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+
+ // Set up the second fetcher.
+ auto* otherContextFetcher = CreateFetcher();
+ otherContextFetcher->SetResourceLoadObserver(observer);
+
+ // Ensure that the url is initially not cached, not marked as emulated,
+ // and the observer's last request is empty.
+ ASSERT_EQ(otherContextFetcher->CachedResource(url), nullptr);
+ ASSERT_FALSE(
+ otherContextFetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+ ASSERT_EQ(observer->GetLastRequest(), absl::nullopt);
+
+ otherContextFetcher->EmulateLoadStartedForInspector(
+ resource, url, mojom::blink::RequestContextType::FONT,
+ network::mojom::RequestDestination::kFont,
+ fetch_initiator_type_names::kCSS);
+
+ // After the first emulation, ensure that the url is not cached,
+ // marked as emulated, and the observer's last request is not empty with
+ // the feature enabled.
+ ASSERT_EQ(otherContextFetcher->CachedResource(url), nullptr);
+ ASSERT_TRUE(
+ otherContextFetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+ ASSERT_NE(observer->GetLastRequest(), absl::nullopt);
+
+ // Clear out the last request to start fresh
+ observer->ClearLastRequest();
+
+ otherContextFetcher->EmulateLoadStartedForInspector(
+ resource, url, mojom::blink::RequestContextType::FONT,
+ network::mojom::RequestDestination::kFont,
+ fetch_initiator_type_names::kCSS);
+
+ // After the first emulation, ensure that the url is not cached,
+ // marked as emulated, and the observer's last request is empty with
+ // the feature enabled. This means that the observer was not
+ // notified with this emulation.
+ ASSERT_EQ(otherContextFetcher->CachedResource(url), nullptr);
+ ASSERT_TRUE(
+ otherContextFetcher->ResourceHasBeenEmulatedLoadStartedForInspector(url));
+ ASSERT_EQ(observer->GetLastRequest(), absl::nullopt);
+}
+
} // namespace blink

View File

@@ -59,11 +59,11 @@ index f96af14cb915c8ab92b314ac15b6dffcdd6ec607..2556abe433493251ebd48d4aeddaa6d4
// true if register successfully, or false if 1) the specificied |accelerator|
// has been registered by another caller or other native applications, or
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
index fd95c8c5b62a447542e38bf69acc86303be8fd9a..e50d17d9ce7c8c844f4a8409ca0eef67e7c4003d 100644
index aa21320061131a051f1393e2a71181fd49d1d938..6be700f632e9f8732bee726b8c4c3d39787fca60 100644
--- a/content/browser/media/media_keys_listener_manager_impl.cc
+++ b/content/browser/media/media_keys_listener_manager_impl.cc
@@ -56,7 +56,11 @@ bool MediaKeysListenerManagerImpl::StartWatchingMediaKey(
CanActiveMediaSessionControllerReceiveEvents();
@@ -86,7 +86,11 @@ bool MediaKeysListenerManagerImpl::StartWatchingMediaKey(
CanActiveMediaSessionControllerReceiveEvents();
// Tell the underlying MediaKeysListener to listen for the key.
- if (should_start_watching && media_keys_listener_ &&
@@ -75,18 +75,11 @@ index fd95c8c5b62a447542e38bf69acc86303be8fd9a..e50d17d9ce7c8c844f4a8409ca0eef67
!media_keys_listener_->StartWatchingMediaKey(key_code)) {
return false;
}
@@ -258,6 +262,7 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
#endif
if (system_media_controls_) {
+ // This is required for proper functioning of MediaMetadata.
system_media_controls_->AddObserver(this);
system_media_controls_notifier_ =
std::make_unique<SystemMediaControlsNotifier>(
@@ -270,6 +275,19 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
@@ -320,6 +324,20 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
this, ui::MediaKeysListener::Scope::kGlobal);
DCHECK(media_keys_listener_);
}
+
+#if BUILDFLAG(IS_MAC)
+ // Chromium's implementation of SystemMediaControls falls
+ // down into MPRemoteCommandCenter, which makes it such that an app will not

View File

@@ -9,21 +9,20 @@ to support content settings UI. The support pulls in chrome content settings
and UI code which are not valid in the scope of Electron.
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc
index d26d27fa9e960972aafd5b05b4e90146ce29c333..5b67c748ec06432201f4f23ed4f915212c058fa3 100644
index 297e37c11cc69025843b225a4ba8ae096e304915..6244f27cacbddeed4881463d07a2279083173a5b 100644
--- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc
+++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc
@@ -21,9 +21,11 @@
@@ -21,8 +21,10 @@
#include "ui/gfx/geometry/size.h"
#if !BUILDFLAG(IS_ANDROID)
#include "base/task/sequenced_task_runner.h"
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.h"
#include "chrome/browser/picture_in_picture/auto_pip_setting_helper.h"
#include "media/base/media_switches.h"
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "media/base/media_switches.h"
#include "third_party/blink/public/common/features.h"
#include "ui/views/view.h"
#endif // !BUILDFLAG(IS_ANDROID)
@@ -38,7 +40,7 @@ constexpr gfx::Size kMinWindowSize(240, 52);
// not apply to video Picture-in-Picture windows.
constexpr double kMaxWindowSizeRatio = 0.8;
@@ -79,7 +78,7 @@ index d26d27fa9e960972aafd5b05b4e90146ce29c333..5b67c748ec06432201f4f23ed4f91521
// It would be nice to create this in `EnterPictureInPicture*`, but detecting
// auto-pip while pip is in the process of opening doesn't work.
//
@@ -440,13 +445,17 @@ PictureInPictureWindowManager::GetOverlayView(
@@ -440,6 +445,8 @@ PictureInPictureWindowManager::GetOverlayView(
}
return overlay_view;
@@ -87,27 +86,25 @@ index d26d27fa9e960972aafd5b05b4e90146ce29c333..5b67c748ec06432201f4f23ed4f91521
+ return nullptr;
}
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
PictureInPictureOcclusionTracker*
PictureInPictureWindowManager::GetOcclusionTracker() {
CreateOcclusionTrackerIfNecessary();
return occlusion_tracker_.get();
}
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -450,6 +457,7 @@ PictureInPictureWindowManager::GetOcclusionTracker() {
#endif // !BUILDFLAG(IS_ANDROID)
std::vector<url::Origin>
@@ -459,7 +468,7 @@ PictureInPictureWindowManager::GetActiveSessionOrigins() {
return active_origins;
}
-#if !BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
#if !BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
void PictureInPictureWindowManager::CreateAutoPipSettingHelperIfNeeded() {
// Because we have to defer creating this until after the tab helper finds out
// about pip, we don't care if there's already a helper. Just use it.
@@ -479,6 +487,7 @@ void PictureInPictureWindowManager::CreateAutoPipSettingHelperIfNeeded() {
web_contents,
base::BindOnce(&PictureInPictureWindowManager::ExitPictureInPictureSoon));
}
+#endif
void PictureInPictureWindowManager::CreateOcclusionTrackerIfNecessary() {
if (occlusion_tracker_) {
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
index e94b3ebe6fe7c7d432d25aa100ed9ee525704c64..2fcbb8d7ddcd59ba365e010c7e7bb80e3df41dfe 100644
index 5b3deb74d3e1cceebfd86a8f4bacf81a10967ade..8ca4f8d8fd6353177ae203e3c4c0810a11640b7c 100644
--- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
+++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
@@ -11,6 +11,7 @@
@@ -116,20 +113,19 @@ index e94b3ebe6fe7c7d432d25aa100ed9ee525704c64..2fcbb8d7ddcd59ba365e010c7e7bb80e
#include "base/observer_list_types.h"
+#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/picture_in_picture/auto_pip_setting_overlay_view.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -30,8 +31,10 @@ class Display;
#include "third_party/blink/public/mojom/picture_in_picture_window_options/picture_in_picture_window_options.mojom.h"
@@ -32,7 +33,9 @@ class Display;
} // namespace display
#if !BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
class AutoPipSettingHelper;
class PictureInPictureOcclusionTracker;
+#endif
class PictureInPictureOcclusionTracker;
namespace views {
class View;
@@ -177,7 +180,7 @@ class PictureInPictureWindowManager {
@@ -179,10 +182,11 @@ class PictureInPictureWindowManager {
const gfx::Rect& browser_view_overridden_bounds,
views::View* anchor_view,
views::BubbleBorder::Arrow arrow);
@@ -138,32 +134,46 @@ index e94b3ebe6fe7c7d432d25aa100ed9ee525704c64..2fcbb8d7ddcd59ba365e010c7e7bb80e
AutoPipSettingHelper* get_setting_helper_for_testing() {
return auto_pip_setting_helper_.get();
}
@@ -186,6 +189,7 @@ class PictureInPictureWindowManager {
// when a widget has been occluded by a video or document picture-in-picture
// window.
PictureInPictureOcclusionTracker* GetOcclusionTracker();
+#endif
#endif
// Get the origins for initiators of active Picture-in-Picture sessions.
@@ -243,7 +247,7 @@ class PictureInPictureWindowManager {
// helper class for callbacks, to avoid re-entrant calls during pip set-up.
// Returns the PictureInPictureOcclusionTracker, which can inform observers
// when a widget has been occluded by a video or document picture-in-picture
@@ -238,8 +242,10 @@ class PictureInPictureWindowManager {
static void ExitPictureInPictureSoon();
-#if !BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
#if !BUILDFLAG(IS_ANDROID)
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Create the settings helper if this is auto-pip and we don't have one.
void CreateAutoPipSettingHelperIfNeeded();
+#endif
@@ -262,9 +266,11 @@ class PictureInPictureWindowManager {
// Creates the `occlusion_tracker_` if it does not already exist and should
// exist.
@@ -256,7 +262,9 @@ class PictureInPictureWindowManager {
#if !BUILDFLAG(IS_ANDROID)
std::unique_ptr<DocumentWebContentsObserver> document_web_contents_observer_;
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
std::unique_ptr<AutoPipSettingHelper> auto_pip_setting_helper_;
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
std::unique_ptr<PictureInPictureOcclusionTracker> occlusion_tracker_;
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif //! BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
index 9c878b85a1ac1e163d46d77ddc5e6ab0fafb52c4..60f241c2d3234446b514860377209920691098c5 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -309,11 +309,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
}
#endif // BUILDFLAG(IS_WIN)
raw_ptr<content::PictureInPictureWindowController, DanglingUntriaged>
+#if 0
PictureInPictureOcclusionTracker* tracker =
PictureInPictureWindowManager::GetInstance()->GetOcclusionTracker();
if (tracker) {
tracker->OnPictureInPictureWidgetOpened(overlay_window.get());
}
+#endif
return overlay_window;
}

View File

@@ -15,10 +15,10 @@ node does not change in this case.
chromium-bug: https://crbug.com/1369605
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
index f5f30d5696bdd2b8b5948b18b3f7959f9078cc72..660dc5f60bad28ce345827767fc508711ea06d31 100644
index c4312c899d5293eeb59d679dfa81a8f005f30940..906b47e935bdc3d37cf8313e5938bf79da335517 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -1046,6 +1046,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties(
@@ -1039,6 +1039,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties(
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
}
@@ -32,10 +32,10 @@ index f5f30d5696bdd2b8b5948b18b3f7959f9078cc72..660dc5f60bad28ce345827767fc50871
if (!text_input_manager_)
return ui::TEXT_INPUT_TYPE_NONE;
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h
index 1dfd9c071a41482e0d35257b28522e5b37702f25..41a09e9470dfa5797c69d02fc9b4f5e608a43d94 100644
index e340087e3ab2f07937ed6e6bd8e0ec8aa2a76d48..2b29e246b2f6ecf5d7605abfa36028642a7850c0 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.h
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -184,6 +184,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
@@ -181,6 +181,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
void DisableAutoResize(const gfx::Size& new_size) override;
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) override;
@@ -45,10 +45,10 @@ index 1dfd9c071a41482e0d35257b28522e5b37702f25..41a09e9470dfa5797c69d02fc9b4f5e6
// RenderFrameMetadataProvider::Observer implementation.
void OnRenderFrameMetadataChangedBeforeActivation(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 46e399e99018aa900a78fe35278bbd28bb2b188d..3ee40379364997d07ddfe678a473635ed6422daa 100644
index b12ee61f31aa591011e575772546e5149dc697fc..8e28f573e42f855643fed5ac621671877383ae2a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8656,7 +8656,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -8654,7 +8654,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View File

@@ -7,10 +7,10 @@ This tweaks Chrome's Accessibility support at chrome://accessibility
to make it usable from Electron by removing Profile references.
diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc
index 2c8687d0df72572b8c628519b370d21d5390df56..1c9e6711a43f2630f4b264dfdc5404b0e5e2f1e2 100644
index 3414ca5314a171a34138d87a7e927be767f1e8f6..d3103ea10cb80f318e296cd911048665643749f9 100644
--- a/chrome/browser/accessibility/accessibility_ui.cc
+++ b/chrome/browser/accessibility/accessibility_ui.cc
@@ -21,7 +21,10 @@
@@ -22,7 +22,10 @@
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -21,7 +21,7 @@ index 2c8687d0df72572b8c628519b370d21d5390df56..1c9e6711a43f2630f4b264dfdc5404b0
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/accessibility_resources.h"
@@ -31,6 +34,7 @@
@@ -32,6 +35,7 @@
#include "content/public/browser/ax_event_notification_details.h"
#include "content/public/browser/ax_inspect_factory.h"
#include "content/public/browser/browser_accessibility_state.h"

View File

@@ -6,29 +6,26 @@ Subject: fix: remove profiles from spellcheck_service
Electron doesn't support profiles.
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 69c82dd102e7e746db68c6ab4768a40a5aeeff6e..7c37977249d465767c4fea5818c510f6b23571b1 100644
index 073dbf4e3a71102ba67ad6ee34f6191207e62e7f..b4cfc512955204e1c64cb2276793cd4d950472f6 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -21,7 +21,6 @@
@@ -21,8 +21,10 @@
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
-#include "chrome/browser/profiles/profile.h"
+#if 0
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profiles_state.h"
+#endif
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h"
#include "components/language/core/browser/pref_names.h"
@@ -67,6 +66,7 @@ SpellcheckService::SpellCheckerBinder& GetSpellCheckerBinderOverride() {
@@ -67,7 +69,10 @@ SpellcheckService::SpellCheckerBinder& GetSpellCheckerBinderOverride() {
// Only record spelling-configuration metrics for profiles in which the user
// can configure spelling.
bool RecordSpellingConfigurationMetrics(content::BrowserContext* context) {
+#if 0
Profile* profile = Profile::FromBrowserContext(context);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// ChromeOS creates various unusual profiles (login, lock screen...) which
@@ -77,6 +77,8 @@ bool RecordSpellingConfigurationMetrics(content::BrowserContext* context) {
}
#endif
return profile->IsRegularProfile();
return profiles::IsRegularUserProfile(Profile::FromBrowserContext(context));
+#endif
+ return true;
}

View File

@@ -11,10 +11,10 @@ This patch should be upstreamed as a conditional revert of the logic in desktop
vs mobile runtimes. i.e. restore the old logic only on desktop platforms
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 749ee4641462aec1142f75de9f0459d7e7cf322f..4dcee366b8bd43add1f7e1dbedaf73403dd944cd 100644
index e424b3d9f19f58668a5cbef14a949454a61f6c24..118afb87445c029c4beeea349b252f6b77e4aa8d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2205,9 +2205,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
@@ -2215,9 +2215,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
// The resize message (which may not happen immediately) will carry with it
// the screen info as well as the new size (if the screen has changed scale

View File

@@ -8,10 +8,10 @@ v8::Value instead of base::Value.
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=1323953
diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
index be2d57fd66c08912fe4bfc69f5bbc837e5d3bddd..2a66be13541dcb547362922e614c9a50d686d822 100644
index b62b74eedc1e6ec62894566be806e301c1ff0a87..b8c4e8bb7fc9b1708192363115ed6cd86ba09775 100644
--- a/extensions/renderer/script_injection.cc
+++ b/extensions/renderer/script_injection.cc
@@ -270,6 +270,7 @@ void ScriptInjection::InjectJs(std::set<std::string>* executing_scripts,
@@ -272,6 +272,7 @@ void ScriptInjection::InjectJs(std::set<std::string>* executing_scripts,
blink::mojom::LoadEventBlockingOption::kBlock,
base::BindOnce(&ScriptInjection::OnJsInjectionCompleted,
weak_ptr_factory_.GetWeakPtr()),
@@ -64,10 +64,10 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 3d564401f00f9b65ea232470602d5215caf0d94f..2a6026cb3f71e798da8222cab7be7fe7b6b3a437 100644
index 3964559a7caf7657a134d8a69d1587084e0ecfbb..8cd79df2968ca7e98761b5aa604fb0228cbeaa8d 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -2899,6 +2899,7 @@ void LocalFrame::RequestExecuteScript(
@@ -2912,6 +2912,7 @@ void LocalFrame::RequestExecuteScript(
mojom::blink::EvaluationTiming evaluation_timing,
mojom::blink::LoadEventBlockingOption blocking_option,
WebScriptExecutionCallback callback,
@@ -75,7 +75,7 @@ index 3d564401f00f9b65ea232470602d5215caf0d94f..2a6026cb3f71e798da8222cab7be7fe7
BackForwardCacheAware back_forward_cache_aware,
mojom::blink::WantResultOption want_result_option,
mojom::blink::PromiseResultOption promise_behavior) {
@@ -2932,7 +2933,7 @@ void LocalFrame::RequestExecuteScript(
@@ -2945,7 +2946,7 @@ void LocalFrame::RequestExecuteScript(
PausableScriptExecutor::CreateAndRun(
script_state, std::move(script_sources), execute_script_policy,
user_gesture, evaluation_timing, blocking_option, want_result_option,
@@ -85,10 +85,10 @@ index 3d564401f00f9b65ea232470602d5215caf0d94f..2a6026cb3f71e798da8222cab7be7fe7
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
index 42d153ab9f693aa9be7a87c0e558df3590ea98a9..c20c2efee3281b1d6924c7235f00aff947dd2368 100644
index bc6f0807960ac1d450e334f10f2c3d35cde319a4..eb5ec8620c583e8850ea40deca9d19b08a144323 100644
--- a/third_party/blink/renderer/core/frame/local_frame.h
+++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -815,6 +815,7 @@ class CORE_EXPORT LocalFrame final
@@ -821,6 +821,7 @@ class CORE_EXPORT LocalFrame final
mojom::blink::EvaluationTiming,
mojom::blink::LoadEventBlockingOption,
WebScriptExecutionCallback,
@@ -97,10 +97,10 @@ index 42d153ab9f693aa9be7a87c0e558df3590ea98a9..c20c2efee3281b1d6924c7235f00aff9
mojom::blink::WantResultOption,
mojom::blink::PromiseResultOption);
diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
index 7cc07e1a9f8a447f39e58810bbc7a2eeb93f686c..b11ffdbc5ab80d3fa0facac6cfc2b7fed879cb60 100644
index b7c195a1ffa5d74b80b76b3d9aef2f7597ec4a66..8806ba181d3bd76f9f9aa90401690a5f5a5406c7 100644
--- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
@@ -943,6 +943,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
@@ -967,6 +967,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
std::move(callback).Run(value ? std::move(*value) : base::Value());
},
std::move(callback)),
@@ -204,10 +204,10 @@ index fa65331f40b90d812b71a489fd560e9359152d2b..390714d631dc88ef92d59ef9618a5706
const mojom::blink::UserActivationOption user_activation_option_;
const mojom::blink::LoadEventBlockingOption blocking_option_;
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 763d84fabe055b8dc002807ab9f0c9134f6b57f8..3748c4760ec620674ab3816ee65bb0bda1a287b4 100644
index 3fb4db1c30008420ec2c16e95aedac7ee57689e7..20bc251e545627ac87de9bfa825e0b4d503fbe79 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -1123,14 +1123,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
@@ -1125,14 +1125,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
mojom::blink::EvaluationTiming evaluation_timing,
mojom::blink::LoadEventBlockingOption blocking_option,
WebScriptExecutionCallback callback,

View File

@@ -6,7 +6,7 @@ Subject: fix: select the first menu item when opened via keyboard
This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed.
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 896190761b3b2d89eed135730f2bc23191f4a396..d15d5ac6f352a946d3bb6770dc66a8745ceb413e 100644
index 683a91b47b02d31a67f2aa33bc011277f3477460..84781c4e14a35e2c477c923c0921f7a96bf77b88 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -566,6 +566,7 @@ void MenuController::Run(Widget* parent,

View File

@@ -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 78881666121746d0004fa1e4028ce1901a35e6aa..db137d66c5eb6efd55c4449e1c28c2e0a3a88332 100644
index ee5750669e83a5b089a322733d8e9ee600a81f3f..d5f2d5bb7593cade974d9f38e9950a428be9fb3a 100644
--- a/content/browser/renderer_host/render_frame_host_manager.cc
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -4215,6 +4215,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -4223,6 +4223,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->ResetStateForSiteInstanceChange();
}
@@ -20,10 +20,10 @@ index 78881666121746d0004fa1e4028ce1901a35e6aa..db137d66c5eb6efd55c4449e1c28c2e0
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index ac85bc0cc8a5bc557636fb1203c2e408dba0df1b..2434484e046afa804ad640503f16ee44e8ebb3f2 100644
index 83aa3dd465cb02a3b15852764c00746c205b5b0f..6af3ad96c8cf8a46dc1464b9647d8ec2d3136571 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -318,6 +318,11 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -320,6 +320,11 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual ~ContentBrowserClient() = default;

View File

@@ -38,10 +38,10 @@ index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7
// Returns whether `Initialize` has already been invoked in the process.
// Initialization is a one-way operation (i.e., this method cannot return
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index ef9d6bc8230e1690fb64ec7aef3cf929a79b33a6..7cd74afcf678b90314120ee252decc381f90271a 100644
index 28b52d6f9a94e63aae4adbe43455e0d2553c77a2..af5eb8ae2efd2544889250537f0014d318aaa2ab 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -444,7 +444,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
@@ -447,7 +447,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
const std::string js_command_line_flags,
@@ -51,7 +51,7 @@ index ef9d6bc8230e1690fb64ec7aef3cf929a79b33a6..7cd74afcf678b90314120ee252decc38
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
@@ -454,7 +455,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
@@ -457,7 +458,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
// See https://crbug.com/v8/11043
SetFlags(mode, js_command_line_flags);

View File

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 0184b925d480611a76f6567bb65846a8b92ac038..80b0415092e5218635cee9e28b8d9511bd1dd4b1 100644
index da65719b0f34fd9acf5f607e30f76cd662326244..5fbce05ab09835a6dd2d2daa49e8a83e162e26d6 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1259,6 +1259,11 @@
@@ -1287,6 +1287,11 @@
"includes": [8440],
},

View File

@@ -8,7 +8,7 @@ require a largeish patch to get working, so just redirect it to our
implementation instead.
diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
index 4841d1169ad1d538310dc3258061bb7afceb6d70..7480468e2b4a1d1e7fbd9a67e4305fb7fe860b2c 100644
index 45dacba191fb6551388c2fb0aa24d0ef8ef7402a..cb94a7c18dd52f0856c75840b34dbba0a201b89f 100644
--- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
+++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
@@ -11,8 +11,8 @@

View File

@@ -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 cfe0750ef85145832e889609a3d0d19585be43b8..257ebf81b659531337a991de0b95907b68879dd8 100755
index 4e01d9d33165d392c1107afdb9e6f5cbb93f5f15..c66e54efd0f6980370649c5fa5dfb99928495f6b 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -307,6 +307,8 @@ def GetDefaultHostOs():

View File

@@ -9,10 +9,10 @@ at rutime. It would be best if eventually all usages of this property were
replaced with clean ozone native implementations.
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
index 348cf4c57ac478b6bd7fa34e526205314d6970bc..1e753b492b9ea186265d88d4dd589cc98b649e35 100644
index 62382a2fb818f42cbf64cd1d18b96f4333df67fd..84cdeb49946871161d321abe8fab5bae63a16e3a 100644
--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -192,6 +192,7 @@ class OzonePlatformX11 : public OzonePlatform,
@@ -193,6 +193,7 @@ class OzonePlatformX11 : public OzonePlatform,
base::MessagePumpType::UI;
properties->supports_vulkan_swap_chain = true;
properties->skia_can_fall_back_to_x11 = true;
@@ -21,7 +21,7 @@ index 348cf4c57ac478b6bd7fa34e526205314d6970bc..1e753b492b9ea186265d88d4dd589cc9
properties->supports_global_application_menus = true;
properties->app_modal_dialogs_use_event_blocker = true;
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
index 78b46426f3ea3e4d8b928a6da8bc0930bf6f86e7..a41f8da4b669faef796a6e39853dba7f9d423d2a 100644
index 29ff7bf5229de4fc71d48bbacb99cf6721032a4f..59c0e7c009328a0f43ea1e6da1527e0cba023f37 100644
--- a/ui/ozone/public/ozone_platform.h
+++ b/ui/ozone/public/ozone_platform.h
@@ -124,6 +124,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {

View File

@@ -35,10 +35,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to
system priority.
diff --git a/base/BUILD.gn b/base/BUILD.gn
index bc93caca1744eb97d9d26569f8829b09af80eed6..21ff9b849e2311c797dd862d583907577022e6a0 100644
index e54d9ff43f3ab09e007fea77344482f9884ce404..3d395e8feeeb2f6d0fc460b19235dfdbae00437a 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1031,6 +1031,7 @@ component("base") {
@@ -1032,6 +1032,7 @@ component("base") {
"//build/config/compiler:prevent_unsafe_narrowing",
"//build/config/compiler:wexit_time_destructors",
"//build/config/compiler:wglobal_constructors",
@@ -370,10 +370,10 @@ index 053b8a2182778b469941116eab3acd5fd6fd8099..d085258d5970b37215fe0d5591e6c030
// Beware: This view was briefly removed (in favor of a bare CALayer) in
// https://crrev.com/c/1236675. The ordering of unassociated layers relative
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 24ef0dfe8918c926b189762608397c3e557366b6..3e78747afba61506ca616a66b51365bf4117110c 100644
index 12f99e2640142c922944d7101633a4e75baa4a92..27b8d9c767ca3f4dede7f79d6295ec8cc06eaffe 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -333,6 +333,7 @@ viz_component("service") {
@@ -335,6 +335,7 @@ viz_component("service") {
"frame_sinks/external_begin_frame_source_mac.h",
]
}
@@ -381,7 +381,7 @@ index 24ef0dfe8918c926b189762608397c3e557366b6..3e78747afba61506ca616a66b51365bf
}
if (is_android || use_ozone) {
@@ -592,6 +593,7 @@ viz_source_set("unit_tests") {
@@ -594,6 +595,7 @@ viz_source_set("unit_tests") {
"display_embedder/software_output_device_mac_unittest.mm",
]
frameworks = [ "IOSurface.framework" ]
@@ -405,10 +405,10 @@ index 76be676717e62c429319338c6115be89f2dfa424..18a5fd3c87b08c95d668b70c9b8f7a76
void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 47afd2553bf76b5b185a4be131196d90cf9cad44..d6f9998890d7a83a8fb221691aa2f1e761461d52 100644
index 14a52ca1254d4b583b44c20336cce1637b91f88c..618b9a6d680a2bfaf26ad3c7303a95081ccdb75b 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -2019,15 +2019,21 @@ - (NSAccessibilityRole)accessibilityRole {
@@ -2020,15 +2020,21 @@ - (NSAccessibilityRole)accessibilityRole {
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
@@ -431,7 +431,7 @@ index 47afd2553bf76b5b185a4be131196d90cf9cad44..d6f9998890d7a83a8fb221691aa2f1e7
return kAttributes;
}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index a29d5b66e6daba7ba29bb82a9869760539ee52ad..eac8896de7ed9a40036942405d4a53981e2a4947 100644
index 531f2f8f15cb0d052621bc6a4f0a4c3afcb89d19..2cd7d5894206c6fc322918a79562d942984f3e1f 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -53,6 +53,7 @@ source_set("browser") {
@@ -489,10 +489,10 @@ index 5a6706495ed2a8f1cd781da9bde8572318bf6897..afd4d1f728a7f056e49b2ecb006c5a05
return false;
}
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 066c1a8fa873558d90e7eeb84fcc7746c2a695c3..d7024510d39870ec57d51f9f0c6ef7da71cf02f5 100644
index 04033ad13703e6e2a96ac3eec298c778c52512a1..24eb6f80dd31c55af90153dccd3b450edeb1bcb0 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -50,7 +50,9 @@ class ScopedPasswordInputEnabler;
@@ -49,7 +49,9 @@ class ScopedPasswordInputEnabler;
@protocol RenderWidgetHostViewMacDelegate;
@@ -502,7 +502,7 @@ index 066c1a8fa873558d90e7eeb84fcc7746c2a695c3..d7024510d39870ec57d51f9f0c6ef7da
@class RenderWidgetHostViewCocoa;
@class CursorAccessibilityScaleFactorObserver;
@@ -677,9 +679,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
@@ -674,9 +676,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// EnsureSurfaceSynchronizedForWebTest().
uint32_t latest_capture_sequence_number_ = 0u;
@@ -515,7 +515,7 @@ index 066c1a8fa873558d90e7eeb84fcc7746c2a695c3..d7024510d39870ec57d51f9f0c6ef7da
// Used to force the NSApplication's focused accessibility element to be the
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 404d89f78981c5d63380edfce78ccdff8a7f6037..893cfb4908ab73a3aedca25d056d1ddfc64d3cea 100644
index 0f1bc6f3804309f513cbc700cc10e8b173a68dc0..fae7865cda633ae96df60b2d8d6beb1384031969 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -272,8 +272,10 @@
@@ -529,7 +529,7 @@ index 404d89f78981c5d63380edfce78ccdff8a7f6037..893cfb4908ab73a3aedca25d056d1ddf
// Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling
// pointers. `ns_view_` gets reinitialized later in this method.
@@ -1645,8 +1647,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -1644,8 +1646,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
gfx::NativeViewAccessible
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
@@ -540,7 +540,7 @@ index 404d89f78981c5d63380edfce78ccdff8a7f6037..893cfb4908ab73a3aedca25d056d1ddf
return [GetInProcessNSView() window];
}
@@ -1691,9 +1695,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -1690,9 +1694,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
}
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
@@ -552,7 +552,7 @@ index 404d89f78981c5d63380edfce78ccdff8a7f6037..893cfb4908ab73a3aedca25d056d1ddf
}
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
@@ -2200,12 +2206,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -2199,12 +2205,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
const std::vector<uint8_t>& window_token) {
@@ -568,10 +568,10 @@ index 404d89f78981c5d63380edfce78ccdff8a7f6037..893cfb4908ab73a3aedca25d056d1ddf
///////////////////////////////////////////////////////////////////////////////
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index 308133639fdb5bd7d0de6becc9aabd202532808a..07952e35e3c161f6ddf8d849af0e4c2760ff0dbc 100644
index f1dbc483ec57d2a1cc409b9d82448879f84ffeae..1c85063d6df14dafa5a4334046e1eadaf314443b 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -187,6 +187,7 @@ source_set("common") {
@@ -220,6 +220,7 @@ source_set("common") {
"//content:content_implementation",
"//build/config:precompiled_headers",
]
@@ -660,10 +660,10 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019
} // namespace content
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 3ed642ab9c89b16f0b2fce98e37c7ee5398bb714..aeb4193486338441397983e8f24a29b2b3ad7b4d 100644
index a19857ade673092db3741f1e8f385d418246b580..d523a23793e4f28112af6500eb6ea1043b83516d 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -476,6 +476,7 @@ static_library("test_support") {
@@ -474,6 +474,7 @@ static_library("test_support") {
configs += [
"//build/config:precompiled_headers",
"//v8:external_startup_data",
@@ -671,7 +671,7 @@ index 3ed642ab9c89b16f0b2fce98e37c7ee5398bb714..aeb4193486338441397983e8f24a29b2
]
public_deps = [
@@ -1051,6 +1052,7 @@ static_library("browsertest_support") {
@@ -1047,6 +1048,7 @@ static_library("browsertest_support") {
}
configs += [ "//v8:external_startup_data" ]
@@ -679,7 +679,7 @@ index 3ed642ab9c89b16f0b2fce98e37c7ee5398bb714..aeb4193486338441397983e8f24a29b2
}
mojom("content_test_mojo_bindings") {
@@ -1674,6 +1676,7 @@ test("content_browsertests") {
@@ -1666,6 +1668,7 @@ test("content_browsertests") {
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
configs += [ "//build/config:precompiled_headers" ]
@@ -687,7 +687,7 @@ index 3ed642ab9c89b16f0b2fce98e37c7ee5398bb714..aeb4193486338441397983e8f24a29b2
public_deps = [
":test_interfaces",
@@ -2910,6 +2913,7 @@ test("content_unittests") {
@@ -2906,6 +2909,7 @@ test("content_unittests") {
}
configs += [ "//build/config:precompiled_headers" ]
@@ -721,7 +721,7 @@ index 6a662873b042a50f052e88bc849e3ef623963961..8b429cb2a5d6cd4555d7d56d3b072b05
if (is_mac) {
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 37ce08d9c11de4e53dbf9a9db2e74f1b12adafcf..bb9433fcb49d40adbe9ef8fdddfde49fc2809a78 100644
index 3033b23a07041d375d5733bad1901f9a61bdf3b6..9dd6cb1aa49d03c167d1a92100d4ba5f08f93abe 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -37,6 +37,7 @@
@@ -748,10 +748,10 @@ index 37ce08d9c11de4e53dbf9a9db2e74f1b12adafcf..bb9433fcb49d40adbe9ef8fdddfde49f
power_state_function_(
base::BindRepeating(IOBluetoothPreferenceSetControllerPowerState)),
+#endif
classic_discovery_manager_(
BluetoothDiscoveryManagerMac::CreateClassic(this)),
device_paired_status_callback_(
@@ -244,8 +248,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) {
base::BindRepeating(&IsDeviceSystemPaired)) {
}
@@ -242,8 +246,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) {
}
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {
@@ -765,10 +765,10 @@ index 37ce08d9c11de4e53dbf9a9db2e74f1b12adafcf..bb9433fcb49d40adbe9ef8fdddfde49f
base::WeakPtr<BluetoothLowEnergyAdapterApple>
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn
index c5d13533a86ee23a270821bfe52349957e0bf296..1091e9f11bea18ff792c703b89348ac1e152cdc7 100644
index e321b406a8375986b41d64342919bb0e8c5e58eb..8081d53adab80a6fccfdb4cd6f608c3bf7112c47 100644
--- a/gpu/ipc/service/BUILD.gn
+++ b/gpu/ipc/service/BUILD.gn
@@ -132,6 +132,7 @@ component("service") {
@@ -133,6 +133,7 @@ component("service") {
"QuartzCore.framework",
]
defines += [ "GL_SILENCE_DEPRECATION" ]
@@ -802,10 +802,10 @@ index f8d4dc33b5687122420af314d597679d16126e00..e187d08374b74314fa817ebb0ba7f28f
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 de22000247bd00a98518ac41375087e822a0fe64..16a2ec92e50dcf65fd1ab27712c050cbe2eac06e 100644
index 1f4f64ad8f5d37dfdd6e51e97ce2fb743abfcd90..9531c528b84b9d7a0b59c3abb1a21fafad7c1ec4 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -61,12 +61,16 @@
@@ -67,12 +67,16 @@
} // namespace
ImageTransportSurfaceOverlayMacEGL::ImageTransportSurfaceOverlayMacEGL()
@@ -823,7 +823,7 @@ index de22000247bd00a98518ac41375087e822a0fe64..16a2ec92e50dcf65fd1ab27712c050cb
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
use_remote_layer_api_, !av_disabled_at_command_line);
@@ -87,6 +91,10 @@
@@ -93,6 +97,10 @@
#endif
ca_context_.layer = ca_layer_tree_coordinator_->GetCALayerForDisplay();
}
@@ -834,7 +834,7 @@ index de22000247bd00a98518ac41375087e822a0fe64..16a2ec92e50dcf65fd1ab27712c050cb
}
ImageTransportSurfaceOverlayMacEGL::~ImageTransportSurfaceOverlayMacEGL() {
@@ -210,9 +218,13 @@
@@ -221,9 +229,13 @@
TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD,
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
"width", pixel_size_.width());
@@ -849,10 +849,10 @@ index de22000247bd00a98518ac41375087e822a0fe64..16a2ec92e50dcf65fd1ab27712c050cb
ca_layer_tree_coordinator_->GetIOSurfaceForDisplay();
if (io_surface) {
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index c07f39acf8a733780b325b17d19718346136712d..c174e10763e8753257c7ebed6eee1fb6df818559 100644
index 6ab4e755d5d7a82685424118c21ded35924c611c..65022e5613c275883b6578662492a9f761ee7294 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -206,6 +206,7 @@ source_set("audio") {
@@ -209,6 +209,7 @@ source_set("audio") {
"CoreMedia.framework",
]
weak_frameworks = [ "ScreenCaptureKit.framework" ] # macOS 13.0
@@ -861,10 +861,10 @@ index c07f39acf8a733780b325b17d19718346136712d..c174e10763e8753257c7ebed6eee1fb6
if (is_ios) {
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index 55e890125085e81f5dcf3a3c963f95359b496234..3cd4a2f5c30622684aa407a9a6dbbe7d6d680c6f 100644
index cb1fda282600555b57b3e135434ceaaeed863a6e..c26ec863c15f9dbe441b05ea74349f19cbcaccec 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -30,19 +30,23 @@
@@ -31,19 +31,23 @@
namespace {
extern "C" {
@@ -889,10 +889,10 @@ index 55e890125085e81f5dcf3a3c963f95359b496234..3cd4a2f5c30622684aa407a9a6dbbe7d
} // namespace
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index b3e06372457f57a8c835a790691d8f492baecdec..b27691313cb15d663c903d05cdef20e44270c690 100644
index 7f079995d4161796b7208348c43c39a2569b0fc1..1d8fc87f2c420bb809f4925eaa3902ca89453c13 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -991,7 +991,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
@@ -970,7 +970,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
void AudioManagerMac::InitializeOnAudioThread() {
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
@@ -1278,7 +1278,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..dc30306f2c5d20503399fc3a8860773a
} // namespace sandbox
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
index de2ed80fd14737a47d6e32718ec30f540a3fb2a4..451bdd3782c63f7a71896bb2deb0a52fc80b96ef 100644
index c1974a6726285a5311727f026f62f90c1187130f..f050022227720283135e2c3d85c5992f193d7e1e 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -312,6 +312,7 @@ component("core") {
@@ -1290,7 +1290,7 @@ index de2ed80fd14737a47d6e32718ec30f540a3fb2a4..451bdd3782c63f7a71896bb2deb0a52f
public_deps = [
":core_generated",
diff --git a/third_party/blink/renderer/core/editing/build.gni b/third_party/blink/renderer/core/editing/build.gni
index 38c03341d4bbb65477f481bfa7a199007d7af893..63f84ce1b7041cc1223f3d256140582623196b5a 100644
index 16bc33b36fa860214a6b4647d69939080df1b556..3c170e36fbeaddee2790f79039d81c0ef958572f 100644
--- a/third_party/blink/renderer/core/editing/build.gni
+++ b/third_party/blink/renderer/core/editing/build.gni
@@ -354,10 +354,14 @@ blink_core_sources_editing = [
@@ -1345,10 +1345,10 @@ index dcf493d62990018040a3f84b6f875af737bd2214..6ffffe8b3946e0427aead8be19878c53
void DisplayCALayerTree::GotIOSurfaceFrame(
diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn
index 4e23c38763184840a393589b3f55dcabb0db8121..e4ad30d0d7acecdca3a22fe05935a3406d784a95 100644
index 1fa9aeacd09eea1c90742f62528da0e71bc5bd34..8c25910bb27a2ed24feef30c7d6bcbd21fa59e82 100644
--- a/ui/accessibility/platform/BUILD.gn
+++ b/ui/accessibility/platform/BUILD.gn
@@ -251,6 +251,7 @@ component("platform") {
@@ -253,6 +253,7 @@ component("platform") {
weak_frameworks = [
"Accessibility.framework", # macOS 11
]
@@ -1377,7 +1377,7 @@ index c737a2ca1afb44083aef33c6aa4518bea68d1aba..879f1357b5129849c5a1aa1731cf7697
// Accessible object
if (AXElementWrapper::IsValidElement(value)) {
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index 070c243b505d8e51c27f97d7aacee22452ec24a9..3fb3fc86862abd4565a3e9f5107a784d3f449e8f 100644
index cec02efe6a5d1e40e5141151fb0f75f9b8bc88b5..a048095f800eece7cede1ee528093d2721902e8f 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -359,6 +359,7 @@ component("base") {
@@ -1477,10 +1477,10 @@ index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666
} // namespace
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
index 301e8792b1259e7f7c4eb8e75a09a32f0d60e91f..36da16f203b14e872fb8153e8fc10c3f6725280d 100644
index 4711b70e178cf0707b8d7cb93270d9bb026508b7..595013d063046051c973831fc40ce1cefea64ff8 100644
--- a/ui/display/BUILD.gn
+++ b/ui/display/BUILD.gn
@@ -68,6 +68,10 @@ component("display") {
@@ -69,6 +69,10 @@ component("display") {
"mac/display_link_mac.h",
"mac/screen_mac.mm",
]
@@ -1514,7 +1514,7 @@ index a771c1c03fd1afe3a5e563b4421721a5ddc2eb93..a6cbdfcbeff30508d921d4637aac543d
// Query the display's refresh rate.
{
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index df601fcc40b4b8ca131a4f5a3ced5897075aa0f7..9d2edc62d95f04b6f1b3cd667940b1cb2dc728c3 100644
index 3702eefa91a9dd22752b3d06d531885928a4d7a6..a78fd474d63d709a703f9c530c687305ddebcea0 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -204,6 +204,7 @@ component("gfx") {
@@ -1556,10 +1556,10 @@ index b28640bb4d89ba9508d4086c9e5ca9ed4a9a7023..15cb883b91f624c1f23f4458dbf8d147
// enough.
return PlatformFontMac::SystemFontType::kGeneral;
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 3a43af5407ba963f81b63fc5b1640253d9159edd..2f209280cc6e3c52c93a74ccc4d1fa6894a026af 100644
index b9d7fa0a32d7487d93918d87f0903fa663271d1f..5dbda740b1dd7c119ad9b0d2ce70050a2db735c7 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -697,6 +697,7 @@ component("views") {
@@ -701,6 +701,7 @@ component("views") {
"IOSurface.framework",
"QuartzCore.framework",
]
@@ -1567,7 +1567,7 @@ index 3a43af5407ba963f81b63fc5b1640253d9159edd..2f209280cc6e3c52c93a74ccc4d1fa68
}
if (is_win) {
@@ -1125,6 +1126,8 @@ source_set("test_support") {
@@ -1132,6 +1133,8 @@ source_set("test_support") {
"//testing/gtest",
]
@@ -1604,7 +1604,7 @@ index f37c02488e6ba943ebf9b880a04bcfef9afc9d97..b10ed25b5cdf5eb2f314ed72226f71c8
// Used to force the NSApplication's focused accessibility element to be the
// views::Views accessibility tree when the NSView for this is focused.
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index efbbc2fcaa96bfe717ab41269d273acddadb4bac..61421ddad4f76667c1e0b5775e4f26284357f64b 100644
index 71b2c9084e597ef0fff68c42450ac81931da364a..3d2964abd903bbdba5ca07591231a72d859abaae 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -345,7 +345,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,

View File

@@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement
session.setCertificateVerifyCallback.
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index c974e83029579e58d1f62db6f45981b0530f3edc..b3ef314dfe19a92ebb11ae34405b37c4424efe9a 100644
index ae6fef767b000bafcbcaa8637f14813e970fe416..f176d1a7086305a9f06a6dca3c4fc428cdf73d0c 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -146,6 +146,11 @@
@@ -147,6 +147,11 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
@@ -20,9 +20,9 @@ index c974e83029579e58d1f62db6f45981b0530f3edc..b3ef314dfe19a92ebb11ae34405b37c4
+#include "net/cert/multi_threaded_cert_verifier.h"
+
#if BUILDFLAG(IS_CT_SUPPORTED)
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
@@ -461,6 +466,99 @@ bool GetFullDataFilePath(
// gn check does not account for BUILDFLAG(). So, for iOS builds, it will
// complain about a missing dependency on the target exposing this header. Add a
@@ -427,6 +432,99 @@ bool GetFullDataFilePath(
} // namespace
@@ -122,7 +122,7 @@ index c974e83029579e58d1f62db6f45981b0530f3edc..b3ef314dfe19a92ebb11ae34405b37c4
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::NetworkContextHttpAuthPreferences::
@@ -834,6 +932,13 @@ void NetworkContext::SetClient(
@@ -800,6 +898,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -136,7 +136,7 @@ index c974e83029579e58d1f62db6f45981b0530f3edc..b3ef314dfe19a92ebb11ae34405b37c4
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -2455,6 +2560,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -2357,6 +2462,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
std::move(cert_verifier));
cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_.get());
#endif // BUILDFLAG(IS_CHROMEOS)
@@ -147,7 +147,7 @@ index c974e83029579e58d1f62db6f45981b0530f3edc..b3ef314dfe19a92ebb11ae34405b37c4
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
diff --git a/services/network/network_context.h b/services/network/network_context.h
index dca9e11a22794150e472478156146af1495dec38..21f2966b086b029561bbed1bb37b87f2d79f5407 100644
index b6ed916515c4c517a84e3a5791de98869b619dbb..fceb8d8a2daae235380fca7a163be001d0c19aa3 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -114,6 +114,7 @@ class URLMatcher;
@@ -167,7 +167,7 @@ index dca9e11a22794150e472478156146af1495dec38..21f2966b086b029561bbed1bb37b87f2
void ResetURLLoaderFactories() override;
void GetViaObliviousHttp(
mojom::ObliviousHttpRequestPtr request,
@@ -902,6 +905,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -894,6 +897,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::vector<base::OnceClosure> dismount_closures_;
#endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
@@ -177,7 +177,7 @@ index dca9e11a22794150e472478156146af1495dec38..21f2966b086b029561bbed1bb37b87f2
std::unique_ptr<HostResolver> internal_host_resolver_;
// Map values set to non-null only if that HostResolver has its own private
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 93c755060193dc84f9dbe1c600a1926c61e35afd..46520ea94b20d59acc0bd0158cea4b3e289e0cee 100644
index cfbd006fedddd94f645e484ece83a6a39383067b..a9212c8c51ce96c4313dfc8f955be737f5917079 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -310,6 +310,16 @@ struct SocketBrokerRemotes {
@@ -208,7 +208,7 @@ index 93c755060193dc84f9dbe1c600a1926c61e35afd..46520ea94b20d59acc0bd0158cea4b3e
CreateURLLoaderFactory(pending_receiver<URLLoaderFactory> url_loader_factory,
URLLoaderFactoryParams params);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 97ae929ffd214f917b1de6da83b4501add89aa05..94c01006242cdf73b66faa1503701f2e1aca2057 100644
index 3900cd0343d29f7d4d03a9d634639d0c37ecfb18..7bf8209052544647721535a331825286fee478dc 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -62,6 +62,8 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -79,10 +79,10 @@ index e7cc73f375ada7ee8715d331c3d372e0f59a0cdf..c0a142bea4a9a30c10dbb30c72fedce9
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
index 00965c253f28bd3947255b2ab77bf3a0bb71f14a..e04a7eef94990dfb0e2fca2e116352fe80965303 100644
index 15525538284b202acdcd3bacdd2b55db16cf6cb7..454e0307bd374a443d3e2f2dbb4ffa330d22d04f 100644
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
@@ -136,7 +136,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
@@ -130,7 +130,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
notification_context_.get(), &browser_context_,
embedded_worker_helper_->context_wrapper(), &render_process_host_,
@@ -113,18 +113,18 @@ index 18cca28edc35dadd4eb9173558d1764b1bf85dd5..4cda3b7f2db6be365e4edb9456e1f722
}
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
index 9c9e590aab71d5b66cdd2c9a0cfc5f2d34443e84..c461c131d93d592487e319893d531bf4bdf14e39 100644
index 1dc5478b8d0787a1cc82dc9fcb0227fed3f583c2..9a76f675ccdd4b173afa65aa05b733d456f30cff 100644
--- a/content/browser/notifications/platform_notification_context_impl.h
+++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -45,6 +45,7 @@ struct NotificationDatabaseData;
class PlatformNotificationServiceProxy;
@@ -46,6 +46,7 @@ class PlatformNotificationServiceProxy;
class RenderProcessHost;
class ServiceWorkerContextWrapper;
class WeakDocumentPtr;
+class RenderFrameHost;
// Implementation of the Web Notification storage context. The public methods
// defined in this interface must only be called on the UI thread.
@@ -78,6 +79,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
@@ -79,6 +80,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
// service is created by a dedicated worker, or is `nullptr` otherwise.
void CreateService(
RenderProcessHost* render_process_host,
@@ -133,7 +133,7 @@ index 9c9e590aab71d5b66cdd2c9a0cfc5f2d34443e84..c461c131d93d592487e319893d531bf4
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 67b608870e591d6a6fcfe1f4883ddb19c3210131..bc0044eee2bd351f5c5ada89cd4b859a79dce619 100644
index 0ef4f3f740102cfefdb8e2a87be0044fd88746d0..412887e0002a5bc65be1f5ecbed9e991972d373a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2035,7 +2035,7 @@ void RenderProcessHostImpl::CreateNotificationService(

View File

@@ -40,12 +40,12 @@ index af0616d9ca466d146f3c41887857dd4720ebafbf..c088db193f5bd4b88aa42a3803571d2b
ui::ImageModel::FromVectorIcon(*icon, kColorPipWindowForeground,
kCloseButtonIconSize));
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
index dd918e0ddeb8f7d9eaa12e348e522bb18704d9df..5fac36739b1cbfc48e7c523457d1e930908d7705 100644
index 19b3ac41fae0e18412f21f9efba5a656f536e7f8..9c878b85a1ac1e163d46d77ddc5e6ab0fafb52c4 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -16,9 +16,11 @@
#include "base/timer/timer.h"
@@ -17,9 +17,11 @@
#include "build/build_config.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
+#if 0
#include "chrome/browser/profiles/profile.h"
@@ -55,7 +55,7 @@ index dd918e0ddeb8f7d9eaa12e348e522bb18704d9df..5fac36739b1cbfc48e7c523457d1e930
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h"
#include "chrome/browser/ui/views/overlay/close_image_button.h"
@@ -57,7 +59,7 @@
@@ -58,7 +60,7 @@
#include "ui/aura/window.h"
#endif
@@ -64,7 +64,7 @@ index dd918e0ddeb8f7d9eaa12e348e522bb18704d9df..5fac36739b1cbfc48e7c523457d1e930
#include "chrome/browser/shell_integration_win.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
@@ -286,7 +288,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
@@ -287,7 +289,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
overlay_window->Init(std::move(params));
overlay_window->OnRootViewReady();

View File

@@ -8,10 +8,10 @@ needed in chromium but our autofill implementation uses them. This patch can be
our autofill implementation to work like Chromium's.
diff --git a/ui/color/color_id.h b/ui/color/color_id.h
index 9b1d812d296062fd9889070021d62c4a7f801a39..bc894a2b60329d0b93c1e62ae40b1ca523fed6d8 100644
index 854dd08d60100c3312cb48ee458e430c4c492cdc..663ad0b38cf0cb9705810cf4db2e7cbe382c24b1 100644
--- a/ui/color/color_id.h
+++ b/ui/color/color_id.h
@@ -404,6 +404,10 @@
@@ -409,6 +409,10 @@
E_CPONLY(kColorRadioButtonForegroundUnchecked) \
E_CPONLY(kColorRadioButtonForegroundDisabled) \
E_CPONLY(kColorRadioButtonForegroundChecked) \
@@ -22,7 +22,7 @@ index 9b1d812d296062fd9889070021d62c4a7f801a39..bc894a2b60329d0b93c1e62ae40b1ca5
E_CPONLY(kColorSegmentedButtonBorder) \
E_CPONLY(kColorSegmentedButtonFocus) \
E_CPONLY(kColorSegmentedButtonForegroundChecked) \
@@ -508,6 +512,7 @@
@@ -513,6 +517,7 @@
E_CPONLY(kColorTreeNodeForeground) \
E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \
E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \
@@ -61,10 +61,10 @@ index 1bef8b4a80d2d244f469a0ca9bee9b8d67bb8767..3e911e5931301a279b6608d5cb1451cc
? SkColorSetRGB(0x99, 0xC8, 0xFF)
: SkColorSetRGB(0x00, 0x75, 0xFF)};
diff --git a/ui/color/win/native_color_mixers_win.cc b/ui/color/win/native_color_mixers_win.cc
index f3a29c3c7393a26a7da72c4b412a98f126059a3f..9508cfc93c4980ef503a0ebb0cc87b3853dcc707 100644
index 67f326e6a38da9f6a429158f6d24d042e50e9d37..c2ede107efedef386d93e9dc8cfb520565a85796 100644
--- a/ui/color/win/native_color_mixers_win.cc
+++ b/ui/color/win/native_color_mixers_win.cc
@@ -200,6 +200,10 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -176,6 +176,10 @@ void AddNativeUiColorMixer(ColorProvider* provider,
SetAlpha(kColorNotificationInputForeground, gfx::kGoogleGreyAlpha700);
mixer[kColorSliderTrack] = AlphaBlend(
kColorNativeHighlight, kColorNativeWindow, gfx::kGoogleGreyAlpha400);
@@ -73,9 +73,9 @@ index f3a29c3c7393a26a7da72c4b412a98f126059a3f..9508cfc93c4980ef503a0ebb0cc87b38
+ mixer[kColorResultsTableDimmedText] = AlphaBlend(
+ kColorNativeWindowText, kColorNativeWindow, gfx::kGoogleGreyAlpha600);
CompleteControlsForcedColorsDefinition(mixer);
@@ -210,6 +214,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
// Window Background
mixer[kColorBubbleFooterBackground] = {kColorNativeWindow};
@@ -184,6 +188,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
mixer[kColorFrameInactive] = {kColorNativeWindow};
mixer[kColorPrimaryBackground] = {kColorNativeWindow};
mixer[kColorTooltipBackground] = {kColorNativeWindow};
@@ -83,7 +83,7 @@ index f3a29c3c7393a26a7da72c4b412a98f126059a3f..9508cfc93c4980ef503a0ebb0cc87b38
// Window Text
mixer[kColorAlertLowSeverity] = {kColorNativeWindowText};
@@ -223,6 +228,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -197,6 +202,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
mixer[kColorTableGroupingIndicator] = {kColorNativeWindowText};
mixer[kColorThrobber] = {kColorNativeWindowText};
mixer[kColorTooltipForeground] = {kColorNativeWindowText};
@@ -91,7 +91,7 @@ index f3a29c3c7393a26a7da72c4b412a98f126059a3f..9508cfc93c4980ef503a0ebb0cc87b38
// Hyperlinks
mixer[kColorLinkForegroundDefault] = {kColorNativeHotlight};
@@ -265,6 +271,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -239,6 +245,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
mixer[kColorTextfieldForeground] = {kColorNativeBtnText};
mixer[kColorTextfieldForegroundPlaceholder] = {kColorNativeBtnText};
mixer[kColorTextfieldForegroundDisabled] = {kColorNativeBtnText};

View File

@@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/BUILD.gn b/BUILD.gn
index ba45f6080fee259da75db69b38ceb92c19489247..a36be0efdaf928fc2ca59a7d9417e0e3f3a2e9be 100644
index cc7a8dd70c6353dda6a07a1cd1c9d4d9b8967171..c5032786f8187163001a83e636854c7a9c743126 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -966,7 +966,6 @@ if (is_win) {
@@ -34,10 +34,10 @@ index ba45f6080fee259da75db69b38ceb92c19489247..a36be0efdaf928fc2ca59a7d9417e0e3
}
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e59b8e529 100644
index c60e2083bf70d2310bec57646df797856aa7d2dd..dabf6536a0dd67635a551a4d8aaed981bdaca4de 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -92,6 +92,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
@@ -95,6 +95,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
return base::FeatureList::IsEnabled(features::kPrintWithReducedRasterization);
}
@@ -45,7 +45,7 @@ index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e
PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
// TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely
// because `web_contents` was null. As a result, this section has many more
@@ -106,6 +107,7 @@ content::WebContents* GetWebContents(content::GlobalRenderFrameHostId rfh_id) {
@@ -109,6 +110,7 @@ content::WebContents* GetWebContents(content::GlobalRenderFrameHostId rfh_id) {
auto* rfh = content::RenderFrameHost::FromID(rfh_id);
return rfh ? content::WebContents::FromRenderFrameHost(rfh) : nullptr;
}
@@ -53,7 +53,7 @@ index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e
#endif // BUILDFLAG(IS_WIN)
@@ -146,10 +148,8 @@ void PrintJob::Initialize(std::unique_ptr<PrinterQuery> query,
@@ -149,10 +151,8 @@ void PrintJob::Initialize(std::unique_ptr<PrinterQuery> query,
#if BUILDFLAG(IS_WIN)
pdf_page_mapping_ = PageNumber::GetPages(settings->ranges(), page_count);
@@ -66,7 +66,7 @@ index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e
#endif
auto new_doc = base::MakeRefCounted<PrintedDocument>(std::move(settings),
@@ -386,8 +386,10 @@ void PrintJob::StartPdfToEmfConversion(
@@ -403,8 +403,10 @@ void PrintJob::StartPdfToEmfConversion(
const PrintSettings& settings = document()->settings();
@@ -78,7 +78,7 @@ index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e
using RenderMode = PdfRenderSettings::Mode;
RenderMode mode = print_with_reduced_rasterization
@@ -479,8 +481,10 @@ void PrintJob::StartPdfToPostScriptConversion(
@@ -496,8 +498,10 @@ void PrintJob::StartPdfToPostScriptConversion(
if (ps_level2) {
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
} else {
@@ -91,7 +91,7 @@ index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
}
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4e38d940e 100644
index f033faa6f451074adfb58d4430e9465999f803bb..84b604a103666dec5cdca9921bebdc8f09d5d571 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -22,7 +22,9 @@
@@ -149,32 +149,24 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
std::move(callback).Run(nullptr);
return;
}
@@ -119,7 +139,8 @@ void OnDidScriptedPrint(
@@ -114,11 +134,15 @@ void OnDidGetDefaultPrintSettings(
void OnDidScriptedPrint(
scoped_refptr<PrintQueriesQueue> queue,
std::unique_ptr<PrinterQuery> printer_query,
- mojom::PrintManagerHost::ScriptedPrintCallback callback) {
+ mojom::PrintManagerHost::ScriptedPrintCallback callback,
+ base::OnceCallback<void()> cancel_job) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (printer_query->last_status() != mojom::ResultCode::kSuccess ||
!printer_query->settings().dpi()) {
- std::move(callback).Run(nullptr);
+ bool canceled = printer_query->last_status() == mojom::ResultCode::kCanceled;
+ std::move(callback).Run(nullptr, canceled);
+ if (printer_query->last_status() == mojom::ResultCode::kCanceled) {
+ std::move(cancel_job).Run();
+ }
std::move(callback).Run(nullptr);
return;
}
@@ -129,12 +150,12 @@ void OnDidScriptedPrint(
params->params.get());
params->params->document_cookie = printer_query->cookie();
if (!PrintMsgPrintParamsIsValid(*params->params)) {
- std::move(callback).Run(nullptr);
+ std::move(callback).Run(nullptr, false);
return;
}
params->pages = printer_query->settings().ranges();
- std::move(callback).Run(std::move(params));
+ std::move(callback).Run(std::move(params), false);
queue->QueuePrinterQuery(std::move(printer_query));
}
@@ -184,9 +205,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
@@ -171,9 +195,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
@@ -187,7 +179,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -209,12 +232,20 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() {
@@ -197,12 +223,17 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() {
}
#endif // BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -200,16 +192,14 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return false;
}
+#if 0
CompletePrintNow(rfh);
+#endif
- GetPrintRenderFrame(rfh)->PrintRequestedPages();
+ callback_ = std::move(callback);
+
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(silent, std::move(settings));
return true;
}
@@ -339,12 +370,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea(
for (auto& observer : GetTestObservers()) {
observer.OnPrintNow(rfh);
@@ -331,12 +362,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea(
}
PRINTER_LOG(EVENT) << "Paper printable area updated for vendor id "
<< print_settings->requested_media().vendor_id;
@@ -224,7 +214,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
base::Value::Dict job_settings,
std::unique_ptr<PrintSettings> print_settings,
UpdatePrintSettingsCallback callback) {
@@ -352,7 +384,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
@@ -344,7 +376,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
settings->pages = GetPageRangesFromJobSettings(job_settings);
settings->params = mojom::PrintParams::New();
RenderParamsFromPrintSettings(*print_settings, settings->params.get());
@@ -234,7 +224,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
if (!PrintMsgPrintParamsIsValid(*settings->params)) {
mojom::PrinterType printer_type = static_cast<mojom::PrinterType>(
*job_settings.FindInt(kSettingPrinterType));
@@ -364,6 +397,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
@@ -356,6 +389,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
return;
}
@@ -245,35 +235,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
set_cookie(settings->params->document_cookie);
std::move(callback).Run(std::move(settings));
}
@@ -502,7 +539,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
void PrintViewManagerBase::ScriptedPrintReply(
ScriptedPrintCallback callback,
int process_id,
- mojom::PrintPagesParamsPtr params) {
+ mojom::PrintPagesParamsPtr params,
+ bool canceled) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if BUILDFLAG(ENABLE_OOP_PRINTING)
@@ -517,12 +555,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
return;
}
+ if (canceled)
+ UserInitCanceled();
+
if (params) {
set_cookie(params->params->document_cookie);
- std::move(callback).Run(std::move(params));
+ std::move(callback).Run(std::move(params), canceled);
} else {
set_cookie(PrintSettings::NewInvalidCookie());
- std::move(callback).Run(nullptr);
+ std::move(callback).Run(nullptr, false);
}
}
@@ -650,10 +691,12 @@ void PrintViewManagerBase::DidPrintDocument(
@@ -642,10 +679,12 @@ void PrintViewManagerBase::DidPrintDocument(
void PrintViewManagerBase::GetDefaultPrintSettings(
GetDefaultPrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -286,7 +248,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (ShouldPrintJobOop() &&
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
@@ -705,10 +748,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -697,10 +736,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -299,7 +261,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
absl::optional<int> printer_type_value =
job_settings.FindInt(kSettingPrinterType);
@@ -719,6 +764,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -711,6 +752,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
mojom::PrinterType printer_type =
static_cast<mojom::PrinterType>(*printer_type_value);
@@ -307,7 +269,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
if (printer_type != mojom::PrinterType::kExtension &&
printer_type != mojom::PrinterType::kPdf &&
printer_type != mojom::PrinterType::kLocal) {
@@ -738,6 +784,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -730,6 +772,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
if (value > 0)
job_settings.Set(kSettingRasterizePdfDpi, value);
}
@@ -315,7 +277,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
std::unique_ptr<PrintSettings> print_settings =
PrintSettingsFromJobSettings(job_settings);
@@ -757,7 +804,21 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -749,7 +792,21 @@ void PrintViewManagerBase::UpdatePrintSettings(
}
}
@@ -338,7 +300,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
// TODO(crbug.com/1424368): Remove this if the printable areas can be made
// fully available from `PrintBackend::GetPrinterSemanticCapsAndDefaults()`
// for in-browser queries.
@@ -779,8 +840,6 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -771,8 +828,6 @@ void PrintViewManagerBase::UpdatePrintSettings(
}
#endif
@@ -347,7 +309,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
void PrintViewManagerBase::SetAccessibilityTree(
@@ -796,7 +855,7 @@ void PrintViewManagerBase::SetAccessibilityTree(
@@ -788,7 +843,7 @@ void PrintViewManagerBase::SetAccessibilityTree(
void PrintViewManagerBase::IsPrintingEnabled(
IsPrintingEnabledCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -356,23 +318,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -812,13 +871,13 @@ 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);
- std::move(callback).Run(nullptr);
+ std::move(callback).Run(nullptr, false);
return;
}
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (ShouldPrintJobOop() && !query_with_ui_client_id_.has_value()) {
// Renderer process has requested settings outside of the expected setup.
- std::move(callback).Run(nullptr);
+ std::move(callback).Run(nullptr, false);
return;
}
#endif
@@ -860,6 +919,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -839,6 +894,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
PrintManager::PrintingFailed(cookie, reason);
@@ -380,7 +326,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
// `PrintingFailed()` can occur because asynchronous compositing results
// don't complete until after a print job has already failed and been
// destroyed. In such cases the error notification to the user will
@@ -869,7 +929,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -848,7 +904,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
print_job_->document()->cookie() == cookie) {
ShowPrintErrorDialogForGenericError();
}
@@ -389,7 +335,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
ReleasePrinterQuery();
}
@@ -881,15 +941,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) {
@@ -860,15 +916,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) {
test_observers_.RemoveObserver(&observer);
}
@@ -414,7 +360,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
void PrintViewManagerBase::RenderFrameDeleted(
@@ -941,7 +1010,12 @@ void PrintViewManagerBase::OnJobDone() {
@@ -920,7 +985,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.
@@ -428,7 +374,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
ReleasePrintJob();
}
@@ -950,9 +1024,10 @@ void PrintViewManagerBase::OnCanceling() {
@@ -929,9 +999,10 @@ void PrintViewManagerBase::OnCanceling() {
}
void PrintViewManagerBase::OnFailed() {
@@ -440,7 +386,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
TerminatePrintJob(true);
}
@@ -962,7 +1037,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
@@ -941,7 +1012,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
// Is the document already complete?
if (print_job_->document() && print_job_->document()->IsComplete()) {
@@ -449,7 +395,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
}
@@ -1015,7 +1090,10 @@ bool PrintViewManagerBase::SetupNewPrintJob(
@@ -994,7 +1065,10 @@ bool PrintViewManagerBase::SetupNewPrintJob(
// Disconnect the current `print_job_`.
auto weak_this = weak_ptr_factory_.GetWeakPtr();
@@ -461,7 +407,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
if (!weak_this)
return false;
@@ -1035,7 +1113,7 @@ bool PrintViewManagerBase::SetupNewPrintJob(
@@ -1014,7 +1088,7 @@ bool PrintViewManagerBase::SetupNewPrintJob(
#endif
print_job_->AddObserver(*this);
@@ -470,7 +416,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
}
@@ -1103,6 +1181,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1082,6 +1156,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
}
#endif
@@ -482,7 +428,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
if (!print_job_)
return;
@@ -1110,7 +1193,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1089,7 +1168,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
// printing_rfh_ should only ever point to a RenderFrameHost with a live
// RenderFrame.
DCHECK(rfh->IsRenderFrameLive());
@@ -491,7 +437,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
print_job_->RemoveObserver(*this);
@@ -1152,7 +1235,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -1131,7 +1210,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@@ -500,26 +446,26 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
if (!cookie) {
@@ -1298,7 +1381,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
@@ -1285,6 +1364,8 @@ void PrintViewManagerBase::CompleteScriptedPrint(
auto callback_wrapper = base::BindOnce(
&PrintViewManagerBase::ScriptedPrintReply, weak_ptr_factory_.GetWeakPtr(),
std::move(callback), render_process_host->GetID());
+ auto cancel_job_wrapper = base::BindOnce(
+ &PrintViewManagerBase::UserInitCanceled, weak_ptr_factory_.GetWeakPtr());
#if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
DisableThirdPartyBlocking();
#endif
@@ -1299,7 +1380,7 @@ void PrintViewManagerBase::CompleteScriptedPrint(
params->expected_pages_count, params->has_selection, params->margin_type,
params->is_scripted, !render_process_host->IsPdf(),
base::BindOnce(&OnDidScriptedPrint, queue_, std::move(printer_query),
- std::move(callback_wrapper)));
+ std::move(callback_wrapper), std::move(cancel_job_wrapper)));
}
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
- GetPrintRenderFrame(rfh)->PrintRequestedPages();
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(/*silent=*/true, /*job_settings=*/base::Value::Dict());
for (auto& observer : GetTestObservers()) {
observer.OnPrintNow(rfh);
@@ -1348,7 +1431,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
set_analyzing_content(/*analyzing=*/false);
if (!allowed || !printing_rfh_ || IsCrashed() ||
!printing_rfh_->IsRenderFrameLive()) {
- std::move(callback).Run(nullptr);
+ std::move(callback).Run(nullptr, false);
return;
}
CompleteScriptedPrint(printing_rfh_, std::move(params), std::move(callback));
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index ae2339d1ab82bd7cfa971ed03a188cfc26d6e1c0..186414ee72c6b431b87b02623abd4d1903de812b 100644
index f137fc60162622a37c2e4896f521fa3da9dac68e..f7a15e6189736bd86474be3b86a080fdf8b78984 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -44,6 +44,8 @@ namespace printing {
@@ -569,7 +515,7 @@ index ae2339d1ab82bd7cfa971ed03a188cfc26d6e1c0..186414ee72c6b431b87b02623abd4d19
protected:
explicit PrintViewManagerBase(content::WebContents* web_contents);
@@ -281,6 +296,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -263,6 +278,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
bool success);
#endif
void CompleteUpdatePrintSettings(
@@ -577,17 +523,7 @@ index ae2339d1ab82bd7cfa971ed03a188cfc26d6e1c0..186414ee72c6b431b87b02623abd4d19
base::Value::Dict job_settings,
std::unique_ptr<PrintSettings> print_settings,
UpdatePrintSettingsCallback callback);
@@ -310,7 +326,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Runs `callback` with `params` to reply to ScriptedPrint().
void ScriptedPrintReply(ScriptedPrintCallback callback,
int process_id,
- mojom::PrintPagesParamsPtr params);
+ mojom::PrintPagesParamsPtr params,
+ bool canceled);
// 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
@@ -391,8 +408,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -357,8 +373,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;
@@ -601,7 +537,7 @@ index ae2339d1ab82bd7cfa971ed03a188cfc26d6e1c0..186414ee72c6b431b87b02623abd4d19
// Indication that the job is getting canceled.
bool canceling_job_ = false;
diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc
index 257a5f6ae37d3ddf8840d5be7c131e690e46797b..7fcb30352b3fddc993b169c1fc8780ff8e9cfe59 100644
index 75fb743f95c375420f07b0cd93b2a13bf83b33f6..e60f5f4ca226c7575082fe31e7209ccaa10616d4 100644
--- a/chrome/browser/printing/printer_query.cc
+++ b/chrome/browser/printing/printer_query.cc
@@ -355,17 +355,19 @@ void PrinterQuery::UpdatePrintSettings(base::Value::Dict new_settings,
@@ -629,7 +565,7 @@ index 257a5f6ae37d3ddf8840d5be7c131e690e46797b..7fcb30352b3fddc993b169c1fc8780ff
#if BUILDFLAG(IS_CHROMEOS)
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 e83cf407beebcec5ccf7eaa991f43d4d3713833b..5e770a6a840b48e07ff056fe038aad54e526429e 100644
index ac54519f611f719470c4b7a139a58f489884ede2..89055b6df74389560b6c5884a511897a36425b7b 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(
@@ -642,7 +578,7 @@ index e83cf407beebcec5ccf7eaa991f43d4d3713833b..5e770a6a840b48e07ff056fe038aad54
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 32403bb077dcbbffe6a3a862feff619e980c5f93..af773c93ab969a5dc483cc63384851ff62cf51ec 100644
index 1e8f7bedaf679ee19788bf181b33e5d574d1f863..8be77b57580621bf659a6a2a63a2be94a2301c70 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 {
@@ -680,7 +616,7 @@ index ca71560874a0189068dd11fbc039f5673bf6bd96..a8551d95e64da2afbc1685b2df8f1fc3
mojom::PrintFailureReason reason) override;
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
index c08df976b94d14d2ea87ea928793201e52813fe9..d1460c2e23c7b52ddc695edff658483fb969d132 100644
index 4ecdb28904fac480cf102fffdff24ae008ac88cf..e8150c95fafd83d7e2fe1f472a35acec3ca6e391 100644
--- a/components/printing/common/print.mojom
+++ b/components/printing/common/print.mojom
@@ -302,7 +302,7 @@ union PrintWithParamsResult {
@@ -692,20 +628,18 @@ index c08df976b94d14d2ea87ea928793201e52813fe9..d1460c2e23c7b52ddc695edff658483f
// Requests the frame to be printed with specified parameters. This is used
// to programmatically produce PDF by request from the browser (e.g. over
@@ -396,7 +396,10 @@ interface PrintManagerHost {
// UI to the user to select the final print settings. If the user cancels or
// an error occurs, return null.
@@ -391,6 +391,9 @@ interface PrintManagerHost {
[Sync]
- ScriptedPrint(ScriptedPrintParams params) => (PrintPagesParams? settings);
+ ScriptedPrint(ScriptedPrintParams params) => (PrintPagesParams? settings, bool canceled);
+
ScriptedPrint(ScriptedPrintParams params) => (PrintPagesParams? settings);
+ // Tells the browser that there are invalid printer settings.
+ ShowInvalidPrinterSettingsError();
+
// Tells the browser printing failed.
PrintingFailed(int32 cookie, PrintFailureReason reason);
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d4715329861 100644
index 38922e7df71f92153d1f563a6fa63c33434d5188..4f41db41b4ab0bdfbfed959f5b7acd1aee32b341 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -47,6 +47,7 @@
@@ -716,7 +650,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
#include "printing/units.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
@@ -1217,14 +1218,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1228,14 +1229,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
}
print_in_progress_ = true;
@@ -733,7 +667,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
if (!weak_this) {
return;
}
@@ -1255,7 +1256,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1266,7 +1267,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@@ -742,7 +676,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -1270,7 +1271,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1281,7 +1282,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// plugin node and print that instead.
auto plugin = delegate_->GetPdfElement(frame);
@@ -751,7 +685,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
if (render_frame_gone_) {
return;
@@ -1359,7 +1360,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1370,7 +1371,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
@@ -761,7 +695,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
if (render_frame_gone_) {
return;
}
@@ -1422,6 +1424,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
@@ -1433,6 +1435,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -770,7 +704,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
print_preview_context_.OnPrintPreview();
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2046,7 +2050,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2009,7 +2013,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
}
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@@ -780,7 +714,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
// Check if `this` is still valid.
if (!weak_this) {
return;
@@ -2062,17 +2067,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2025,17 +2030,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -803,7 +737,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
DidFinishPrinting(PrintingResult::kFailPrintInit);
return;
}
@@ -2093,8 +2100,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2056,8 +2063,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
auto self = weak_ptr_factory_.GetWeakPtr();
@@ -820,7 +754,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
// Check if `this` is still valid.
if (!self)
return;
@@ -2337,25 +2351,33 @@ void PrintRenderFrameHelper::IPCProcessed() {
@@ -2310,25 +2324,33 @@ void PrintRenderFrameHelper::IPCProcessed() {
}
bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
@@ -860,20 +794,11 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
return true;
}
@@ -2462,7 +2484,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
std::move(params),
base::BindOnce(
[](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
- mojom::PrintPagesParamsPtr input) {
+ mojom::PrintPagesParamsPtr input, bool canceled) {
*output = std::move(input);
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 c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c88e534ae3 100644
index 3cf735c0bf3ba4ed4a871f4608f43cf9767de62f..fccabc0c51ba2fc1ccd8646d30da782fdd5904a8 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -248,7 +248,7 @@ class PrintRenderFrameHelper
@@ -245,7 +245,7 @@ class PrintRenderFrameHelper
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
// printing::mojom::PrintRenderFrame:
@@ -882,7 +807,7 @@ index c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c8
void PrintWithParams(mojom::PrintPagesParamsPtr params,
PrintWithParamsCallback callback) override;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -318,7 +318,9 @@ class PrintRenderFrameHelper
@@ -312,7 +312,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -893,7 +818,7 @@ index c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c8
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -328,7 +330,8 @@ class PrintRenderFrameHelper
@@ -322,7 +324,8 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
bool InitPrintSettings(blink::WebLocalFrame* frame,
@@ -904,10 +829,10 @@ index c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c8
// Calculate number of pages in source document.
uint32_t CalculateNumberOfPages(blink::WebLocalFrame* frame,
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index eac8896de7ed9a40036942405d4a53981e2a4947..c4fe5254ea2f73f1181745dff7d5ba40f9fc618a 100644
index 2cd7d5894206c6fc322918a79562d942984f3e1f..2a7cfcd58812bdf2dcede44a9ba37bd8446407fe 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2992,8 +2992,9 @@ source_set("browser") {
@@ -2981,8 +2981,9 @@ source_set("browser") {
"//ppapi/shared_impl",
]

View File

@@ -30,10 +30,10 @@ index c4255d8dfc2e3c4f1f32506e4e9edbb90a74340a..142398a8adafc94e6724ee750b612a66
// 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 b7a3f5643ced5013c38197f654bd616ffe0f73de..749ee4641462aec1142f75de9f0459d7e7cf322f 100644
index 4b9f416e501a1c5af64e9e716a0ce47cfc32af1c..e424b3d9f19f58668a5cbef14a949454a61f6c24 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2131,6 +2131,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
@@ -2141,6 +2141,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
if (view_) {
view_->UpdateCursor(cursor);
}
@@ -44,10 +44,10 @@ index b7a3f5643ced5013c38197f654bd616ffe0f73de..749ee4641462aec1142f75de9f0459d7
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6f19be9694e46213636f6555e12b8679a48cb867..7ec03754ef46ed72886994c0eab7ce2596ee5fb4 100644
index 213cfa19ecd8f831107e1e6cff5c38480f3715a7..b057b66c99a7f91b40b803f51e9b1c225e4bba4a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5091,6 +5091,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -5102,6 +5102,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}
@@ -60,10 +60,10 @@ index 6f19be9694e46213636f6555e12b8679a48cb867..7ec03754ef46ed72886994c0eab7ce25
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 b77cb08104cd538c4ac27556b339cd786d5c9f93..4e71c0ec5d0fc050fa909e0ddd04c724e63bc3fd 100644
index 10b3b8db55fd51ada493d4287980634949167908..02c2bc699474ed7608ba420d2195b528de4c8934 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -1010,6 +1010,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
@@ -1007,6 +1007,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void SendScreenRects() override;
void SendActiveState(bool active) override;
TextInputManager* GetTextInputManager() override;
@@ -72,7 +72,7 @@ index b77cb08104cd538c4ac27556b339cd786d5c9f93..4e71c0ec5d0fc050fa909e0ddd04c724
RenderWidgetHostImpl* render_widget_host) override;
bool IsShowingContextMenuOnPage() const override;
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index 108267d4dbddf7159936817a5e69f5d333dc1ce2..c85f434444d9734e9ea0bb13c447cc1e5fa464fa 100644
index a3b5e3b1ad2dfc01ac500ac5cd02b33c3b866437..b8ca4c6aabe1a872fdcf7cf2ede2193ab1793f39 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -32,6 +32,7 @@

View File

@@ -7,10 +7,10 @@ Subject: refactor: expose HostImportModuleDynamically and
This is so that Electron can blend Blink's and Node's implementations of these isolate handlers.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index c011498909e3c90618ab6a985b6cea102a1a1bc1..2a45d1c2bfa7d625f37bb7fa985a1a7fd936091f 100644
index 99df9217e06a302f1280162293241d5d8b67b9b2..9597f5bb6cdbc26d07752ba196307c4abe65c9cb 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -613,7 +613,9 @@ bool JavaScriptCompileHintsMagicEnabledCallback(
@@ -624,7 +624,9 @@ bool JavaScriptCompileHintsMagicEnabledCallback(
execution_context);
}
@@ -21,7 +21,7 @@ index c011498909e3c90618ab6a985b6cea102a1a1bc1..2a45d1c2bfa7d625f37bb7fa985a1a7f
v8::Local<v8::Context> context,
v8::Local<v8::Data> v8_host_defined_options,
v8::Local<v8::Value> v8_referrer_resource_url,
@@ -691,7 +693,7 @@ v8::MaybeLocal<v8::Promise> HostImportModuleDynamically(
@@ -702,7 +704,7 @@ v8::MaybeLocal<v8::Promise> HostImportModuleDynamically(
}
// https://html.spec.whatwg.org/C/#hostgetimportmetaproperties
@@ -30,7 +30,7 @@ index c011498909e3c90618ab6a985b6cea102a1a1bc1..2a45d1c2bfa7d625f37bb7fa985a1a7f
v8::Local<v8::Module> module,
v8::Local<v8::Object> meta) {
ScriptState* script_state = ScriptState::From(context);
@@ -734,9 +736,6 @@ std::ostream& operator<<(std::ostream& os, const PrintV8OOM& oom_details) {
@@ -745,9 +747,6 @@ std::ostream& operator<<(std::ostream& os, const PrintV8OOM& oom_details) {
return os;
}
@@ -40,7 +40,7 @@ index c011498909e3c90618ab6a985b6cea102a1a1bc1..2a45d1c2bfa7d625f37bb7fa985a1a7f
void V8Initializer::InitializeV8Common(v8::Isolate* isolate) {
// Set up garbage collection before setting up anything else as V8 may trigger
// GCs during Blink setup.
@@ -758,9 +757,9 @@ void V8Initializer::InitializeV8Common(v8::Isolate* isolate) {
@@ -769,9 +768,9 @@ void V8Initializer::InitializeV8Common(v8::Isolate* isolate) {
SharedArrayBufferConstructorEnabledCallback);
isolate->SetJavaScriptCompileHintsMagicEnabledCallback(
JavaScriptCompileHintsMagicEnabledCallback);

View File

@@ -12,10 +12,10 @@ should be removed as soon as those have been updated. Patching because
every instance is a FTBFS that prevents testing any one instance's fix.
diff --git a/base/functional/callback_helpers.h b/base/functional/callback_helpers.h
index be0f7af257d42401bdf44a57d0bcdd7697605807..83e26366fd9487f6eab3b522888713fc0778f707 100644
index 3f532c9dfdbda4fcc7514f92b6d4b07e570a963a..34235aab0bc0ee7369170e6714fe7ede9ff739c5 100644
--- a/base/functional/callback_helpers.h
+++ b/base/functional/callback_helpers.h
@@ -111,6 +111,22 @@ RepeatingCallback<void(Args...)> ForwardRepeatingCallbacks(
@@ -100,6 +100,22 @@ RepeatingCallback<void(Args...)> ForwardRepeatingCallbacks(
std::move(v));
}

View File

@@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch
... something to do with OSR? and maybe <webview> as well? terrifying.
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 84105424b86828c2cdeacbba1ad9d7171a01b85c..937201a9248ea7ad10805d39f58f94b0f654c1e4 100644
index cfacbb911e5fd2cce13598cf4c2697e9d0c73038..114203c9fc5ff1ab82c80f478049ee47dd661bcf 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -697,6 +697,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableForIOv2For(
@@ -695,6 +695,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableForIOv2For(
return false;
}
@@ -24,13 +24,13 @@ index 84105424b86828c2cdeacbba1ad9d7171a01b85c..937201a9248ea7ad10805d39f58f94b0
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 7c84c4deec00d8373506c9519373b7c13aa98702..4e673059dfbbce80f5b48db60813e1f65fbd5fcd 100644
index 67cb5cf0b9749f8488e307a4e0bd5ea3a0213db0..38b18aec9e3425f24e57cd71bb02093322acdd88 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -24,9 +24,12 @@
#include "components/viz/common/surfaces/surface_id.h"
@@ -25,9 +25,12 @@
#include "components/viz/host/hit_test/hit_test_query.h"
#include "content/browser/renderer_host/display_feature.h"
#include "content/browser/renderer_host/input/input_router_impl.h"
+#include "content/browser/renderer_host/visible_time_request_trigger.h"
+#include "content/browser/web_contents/web_contents_view.h"
#include "content/common/content_export.h"
@@ -61,7 +61,7 @@ index 7c84c4deec00d8373506c9519373b7c13aa98702..4e673059dfbbce80f5b48db60813e1f6
class WebContentsAccessibility;
class DelegatedFrameHost;
@@ -157,6 +162,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
@@ -158,6 +163,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
const gfx::Rect& keyboard_rect) override {}
bool IsHTMLFormPopup() const override;
@@ -71,7 +71,7 @@ index 7c84c4deec00d8373506c9519373b7c13aa98702..4e673059dfbbce80f5b48db60813e1f6
// This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews.
gfx::PointF TransformPointToRootCoordSpaceF(
@@ -334,6 +342,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
@@ -332,6 +340,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
const ui::LatencyInfo& latency);

View File

@@ -8,10 +8,10 @@ respond to the first mouse click in their window, which is desirable for some
kinds of utility windows. Similarly for `disableAutoHideCursor`.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 81f705328efd2de0957c1ef309e20c421e0959eb..47afd2553bf76b5b185a4be131196d90cf9cad44 100644
index fbe3b0e6acd82a286061bf8ab3547b22fa603e05..14a52ca1254d4b583b44c20336cce1637b91f88c 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -158,6 +158,15 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -159,6 +159,15 @@ void ExtractUnderlines(NSAttributedString* string,
} // namespace
@@ -27,7 +27,7 @@ index 81f705328efd2de0957c1ef309e20c421e0959eb..47afd2553bf76b5b185a4be131196d90
// RenderWidgetHostViewCocoa ---------------------------------------------------
// Private methods:
@@ -746,6 +755,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
@@ -747,6 +756,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
}
- (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
@@ -37,7 +37,7 @@ index 81f705328efd2de0957c1ef309e20c421e0959eb..47afd2553bf76b5b185a4be131196d90
return [self acceptsMouseEventsWhenInactive];
}
@@ -830,6 +842,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
@@ -831,6 +843,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
// its parent view.
BOOL hitSelf = NO;
while (view) {
@@ -48,7 +48,7 @@ index 81f705328efd2de0957c1ef309e20c421e0959eb..47afd2553bf76b5b185a4be131196d90
if (view == self)
hitSelf = YES;
if ([view isKindOfClass:[self class]] && ![view isEqual:self] &&
@@ -1159,6 +1175,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
@@ -1160,6 +1176,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
eventType == NSEventTypeKeyDown &&
!(modifierFlags & NSEventModifierFlagCommand);

View File

@@ -52,10 +52,10 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index bd9f47f640e00e3cd688e026b6e8f4ebc84832aa..cc22e9c43562086396509548a4fe7e2f0ae22f80 100644
index e7fd49020f3fcf55980d4f2a4df38c73aaf32929..4b4545013d6de396a660b234ded3f16f8bb0e983 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1605,7 +1605,7 @@ if (is_chrome_branded && !is_android) {
@@ -1602,7 +1602,7 @@ if (is_chrome_branded && !is_android) {
}
}
@@ -64,7 +64,7 @@ index bd9f47f640e00e3cd688e026b6e8f4ebc84832aa..cc22e9c43562086396509548a4fe7e2f
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1634,6 +1634,12 @@ if (!is_android) {
@@ -1641,6 +1641,12 @@ if (!is_android) {
}
}

View File

@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
Patch to make scrollBounce option work.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 0d36a1adafaea4ec67a422746c48cde5916cd147..18b78811247cb10640f91379a3fdb78e1cb27698 100644
index c4251ab6da2535d9fd2062c5553e7f9178887a63..6ace03b7f021605f8686882732870341995e86ed 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1295,7 +1295,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
@@ -1219,7 +1219,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
}
bool RenderThreadImpl::IsElasticOverscrollEnabled() {

View File

@@ -22,7 +22,7 @@ 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 bc0044eee2bd351f5c5ada89cd4b859a79dce619..8e7cca5026c165c06687210b3206eac21e70e89c 100644
index 412887e0002a5bc65be1f5ecbed9e991972d373a..82b4a00f9c66627ef897c717a0f2e93ac0f13e08 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1712,9 +1712,15 @@ bool RenderProcessHostImpl::Init() {

View File

@@ -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 b141cfe3cc2e6e6563af03249bf5ec849e26d819..a1cc958e16162eee9686c73c207effe4880d50c7 100644
index 62cc6bca4793447c35b6ab435b461e57c2c59f4f..d9bb02a43b48d731d7e85537f255bc7ba1b128c9 100644
--- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
+++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
@@ -10,6 +10,7 @@
@@ -17,7 +17,7 @@ index b141cfe3cc2e6e6563af03249bf5ec849e26d819..a1cc958e16162eee9686c73c207effe4
#if BUILDFLAG(IS_WIN)
#include "sandbox/policy/win/sandbox_win.h"
@@ -58,6 +59,9 @@ bool PpapiPluginSandboxedProcessLauncherDelegate::AllowWindowsFontsDir() {
@@ -56,6 +57,9 @@ bool PpapiPluginSandboxedProcessLauncherDelegate::AllowWindowsFontsDir() {
ZygoteCommunication* PpapiPluginSandboxedProcessLauncherDelegate::GetZygote() {
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();

View File

@@ -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 2f6f997eede33373a3b7ef43885cde5cc5c1d8a0..c7f6211a680244a9f3c617b9a87125e305f37319 100644
index 81c2ea6d3266068593388211043c670bbdffe006..0170f7609c30f3e3b858af77703e95d1c1722738 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3443,6 +3443,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -3450,6 +3450,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
params.main_frame_name, GetOpener(), primary_main_frame_policy,
base::UnguessableToken::Create());
@@ -26,7 +26,7 @@ index 2f6f997eede33373a3b7ef43885cde5cc5c1d8a0..c7f6211a680244a9f3c617b9a87125e3
std::unique_ptr<WebContentsViewDelegate> delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -3453,6 +3460,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -3460,6 +3467,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
view_ = CreateWebContentsView(this, std::move(delegate),
&render_view_host_delegate_view_);
}
@@ -35,10 +35,10 @@ index 2f6f997eede33373a3b7ef43885cde5cc5c1d8a0..c7f6211a680244a9f3c617b9a87125e3
CHECK(view_.get());
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 13135b61fb0893e376ca4c55d8ed97eabd222698..c59d9b2f57b96038b2bd34ae1fa6ff2e21807897 100644
index 668d0802d8d9f9b5a9c6ae274e01d38babbaf9cb..bb05f50ab594a6ff599b407ad35ce03e47e0e4f1 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -98,10 +98,13 @@ class BrowserContext;
@@ -99,10 +99,13 @@ class BrowserContext;
class BrowserPluginGuestDelegate;
class RenderFrameHost;
class RenderViewHost;
@@ -52,7 +52,7 @@ index 13135b61fb0893e376ca4c55d8ed97eabd222698..c59d9b2f57b96038b2bd34ae1fa6ff2e
class WebUI;
struct DropData;
struct MHTMLGenerationParams;
@@ -244,6 +247,10 @@ class WebContents : public PageNavigator,
@@ -249,6 +252,10 @@ class WebContents : public PageNavigator,
network::mojom::WebSandboxFlags starting_sandbox_flags =
network::mojom::WebSandboxFlags::kNone;

View File

@@ -15,10 +15,10 @@ 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 6b2c1207d3e226c095b84edf10e468d554b6ae1a..3181ca160963caf1ac9a3d9e8783ec8c66069b97 100644
index 429f9e77be832297448bdcd020b7878d3c07703f..976d957ddec2a3490fb20e302c49a1a08477d92a 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7384,6 +7384,17 @@ void RenderFrameHostImpl::EnterFullscreen(
@@ -7451,6 +7451,17 @@ void RenderFrameHostImpl::EnterFullscreen(
}
}
@@ -37,10 +37,10 @@ index 6b2c1207d3e226c095b84edf10e468d554b6ae1a..3181ca160963caf1ac9a3d9e8783ec8c
if (had_fullscreen_token && !GetView()->HasFocus())
GetView()->Focus();
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c7f6211a680244a9f3c617b9a87125e305f37319..46e399e99018aa900a78fe35278bbd28bb2b188d 100644
index 0170f7609c30f3e3b858af77703e95d1c1722738..b12ee61f31aa591011e575772546e5149dc697fc 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3697,21 +3697,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
@@ -3704,21 +3704,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
const NativeWebKeyboardEvent& event) {
OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
"WebContentsImpl::PreHandleKeyboardEvent");
@@ -78,7 +78,7 @@ index c7f6211a680244a9f3c617b9a87125e305f37319..46e399e99018aa900a78fe35278bbd28
}
bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
@@ -3847,7 +3851,7 @@ void WebContentsImpl::EnterFullscreenMode(
@@ -3854,7 +3858,7 @@ void WebContentsImpl::EnterFullscreenMode(
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
DCHECK(requesting_frame->IsActive());

View File

@@ -26,10 +26,10 @@ index 72f72e2c6627d1f7159796f9151e697b04af66b1..4dfabec61229f50faba64d5c14255e5a
// 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 7c277c6de6d58fb8547bc3ca46d40a1d054d36ec..aa0894e74cc46c45f0f3a378958454cca4ad5820 100644
index 05576278ae00e27ab406551a02dc863e09f48ca3..635fbecee26f2a75b319193f680e29da0f10f6ec 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -793,6 +793,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
@@ -838,6 +838,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
}
@@ -43,10 +43,10 @@ index 7c277c6de6d58fb8547bc3ca46d40a1d054d36ec..aa0894e74cc46c45f0f3a378958454cc
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 617f10ab8f2a33fc88b6f5051246b9996390950c..9642781599a93cd24299096d62d44a79c712167c 100644
index 9ff612df767dedab32338141a92b86adbb017526..0111d9e6c1004b0be7ac2fa88bedcb882adf9485 100644
--- a/content/renderer/renderer_blink_platform_impl.h
+++ b/content/renderer/renderer_blink_platform_impl.h
@@ -174,6 +174,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -185,6 +185,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 617f10ab8f2a33fc88b6f5051246b9996390950c..9642781599a93cd24299096d62d44a79
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 b6f60be5b437b8b6761a94acb74117eb90d64b0d..a72dca432d3732aabf7a0d783c77537e5954a660 100644
index 7d91ca09f54e463b1ed2b2239800f9592045dfea..5f1d08715b1a46c0833dc817855125181abd1797 100644
--- a/third_party/blink/public/platform/platform.h
+++ b/third_party/blink/public/platform/platform.h
@@ -625,6 +625,7 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -634,6 +634,7 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
@@ -67,10 +67,10 @@ index b6f60be5b437b8b6761a94acb74117eb90d64b0d..a72dca432d3732aabf7a0d783c77537e
const WebSecurityOrigin& script_origin) {
return false;
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
index 1073865e634bb5a435ec638a4abc14462e4b16cb..33408c339c21704c433377ed3c7462c7f4b0b8f3 100644
index 6fddd04d08d0dc7203acf74ca889bcccd314e2e0..4f0511fdd38eb1ae1ca4e6850429a3cc75ce3701 100644
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
@@ -754,6 +754,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
@@ -753,6 +753,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
}
pause_handle_.reset();

View File

@@ -35,10 +35,10 @@ index 4dfabec61229f50faba64d5c14255e5a726bf8f2..b91c37ed1dfccf2189cd17d61d2623c1
// 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 aa0894e74cc46c45f0f3a378958454cca4ad5820..a1cb9020998c204c401d80af59268ea5e7b8d00e 100644
index 635fbecee26f2a75b319193f680e29da0f10f6ec..b82a9ec9f2328559789ca5757c2cc7143cf9e927 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -805,6 +805,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
@@ -850,6 +850,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
worker);
}
@@ -52,10 +52,10 @@ index aa0894e74cc46c45f0f3a378958454cca4ad5820..a1cb9020998c204c401d80af59268ea5
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 9642781599a93cd24299096d62d44a79c712167c..0fcee3b49a4830ac5cd640065849804c2fbd4525 100644
index 0111d9e6c1004b0be7ac2fa88bedcb882adf9485..cd1e10f66847f071bcc5f02645f8c4ca0de7bd78 100644
--- a/content/renderer/renderer_blink_platform_impl.h
+++ b/content/renderer/renderer_blink_platform_impl.h
@@ -174,6 +174,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -185,6 +185,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 9642781599a93cd24299096d62d44a79c712167c..0fcee3b49a4830ac5cd640065849804c
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 a72dca432d3732aabf7a0d783c77537e5954a660..78c890f8366a5253cd9fe2c1f270aa5793b9b15e 100644
index 5f1d08715b1a46c0833dc817855125181abd1797..47fcc7fb0811a634983c8d063ee1724c5ccb7b26 100644
--- a/third_party/blink/public/platform/platform.h
+++ b/third_party/blink/public/platform/platform.h
@@ -625,6 +625,8 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -634,6 +634,8 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

View File

@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
patching legacy devtools code.
diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
index adcae579ad62562712b869129dc06cd36164de77..993d61bc734778303054bf34707432d4b8d848ed 100644
index 35371ef12b4d3286a9457c2c412bb9bb854095a5..27f65fae65acdeb6e8b8b5f3d6f326aeb05b5c24 100644
--- a/front_end/entrypoints/main/MainImpl.ts
+++ b/front_end/entrypoints/main/MainImpl.ts
@@ -768,6 +768,8 @@ export class MainImpl {
@@ -726,6 +726,8 @@ export class MainImpl {
globalThis.Main = globalThis.Main || {};
// @ts-ignore Exported for Tests.js
globalThis.Main.Main = MainImpl;

View File

@@ -48,3 +48,5 @@ fix_missing_include_for_node_extern.patch
feat_optionally_prevent_calling_v8_enablewebassemblytraphandler.patch
build_only_create_cppgc_heap_on_non-32_bit_platforms.patch
src_fix_compatility_with_upcoming_v8_12_1_apis.patch
src_update_default_v8_platform_to_override_functions_with_location.patch
fix_capture_embedder_exceptions_before_entering_v8.patch

View File

@@ -0,0 +1,82 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Tue, 26 Dec 2023 02:10:42 +0900
Subject: fix: capture embedder exceptions before entering V8
Upstrem bug: https://github.com/nodejs/node-v8/issues/274
The patch only addresses the callsites that triggered failing DCHECKS
in the nodejs test suite. Need to be followed-up with upstream
on the broader change as there maybe other callsites.
diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc
index 69e2a389f9e1480a1a4ba37f5df5356b42f7d52d..0c29b00298b44b97f88a63aa5b89f1c201f6326a 100644
--- a/src/handle_wrap.cc
+++ b/src/handle_wrap.cc
@@ -148,6 +148,9 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
wrap->OnClose();
wrap->handle_wrap_queue_.Remove();
+ if (env->isolate()->IsExecutionTerminating())
+ return;
+
if (!wrap->persistent().IsEmpty() &&
wrap->object()->Has(env->context(), env->handle_onclose_symbol())
.FromMaybe(false)) {
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 75208c7293863e510cd3438d2c4af80cdfbfc558..5701f004ad38797ce244adb9b41cb8921bb36258 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -444,6 +444,7 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {
void ContextifyContext::PropertyGetterCallback(
Local<Name> property,
const PropertyCallbackInfo<Value>& args) {
+ Environment* env = Environment::GetCurrent(args);
ContextifyContext* ctx = ContextifyContext::Get(args);
// Still initializing
@@ -451,6 +452,8 @@ void ContextifyContext::PropertyGetterCallback(
Local<Context> context = ctx->context();
Local<Object> sandbox = ctx->sandbox();
+
+ TryCatchScope try_catch(env);
MaybeLocal<Value> maybe_rv =
sandbox->GetRealNamedProperty(context, property);
if (maybe_rv.IsEmpty()) {
@@ -460,6 +463,11 @@ void ContextifyContext::PropertyGetterCallback(
Local<Value> rv;
if (maybe_rv.ToLocal(&rv)) {
+ if (try_catch.HasCaught() &&
+ !try_catch.HasTerminated()) {
+ try_catch.ReThrow();
+ }
+
if (rv == sandbox)
rv = ctx->global_proxy();
diff --git a/src/node_messaging.cc b/src/node_messaging.cc
index f015f86ec2a12170d0515eae19ef5b6aac65a1f8..4af1353f91811f8275289eeb8c10ede6878f3c59 100644
--- a/src/node_messaging.cc
+++ b/src/node_messaging.cc
@@ -898,7 +898,7 @@ Maybe<bool> MessagePort::PostMessage(Environment* env,
const TransferList& transfer_v) {
Isolate* isolate = env->isolate();
Local<Object> obj = object(isolate);
-
+ TryCatchScope try_catch(env);
std::shared_ptr<Message> msg = std::make_shared<Message>();
// Per spec, we need to both check if transfer list has the source port, and
@@ -906,6 +906,10 @@ Maybe<bool> MessagePort::PostMessage(Environment* env,
Maybe<bool> serialization_maybe =
msg->Serialize(env, context, message_v, transfer_v, obj);
+ if (try_catch.HasCaught() &&
+ !try_catch.HasTerminated()) {
+ try_catch.ReThrow();
+ }
if (data_ == nullptr) {
return serialization_maybe;
}

View File

@@ -0,0 +1,87 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Etienne Pierre-Doray <etipdoray@gmail.com>
Date: Mon, 11 Dec 2023 04:13:38 -0500
Subject: src: update default V8 platform to override functions with location
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/4514946
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/4336198
Backported from https://github.com/nodejs/node-v8/commit/f66b996030e94a7e4874820a53475338e1df4fe3
diff --git a/src/node_platform.cc b/src/node_platform.cc
index 74ab4a3df8f09b11f0769ba1c56a8c9b0a3f22b0..dd66d17be10e704d510d74ec08dd08d6032cb605 100644
--- a/src/node_platform.cc
+++ b/src/node_platform.cc
@@ -496,17 +496,22 @@ bool PerIsolatePlatformData::FlushForegroundTasksInternal() {
return did_work;
}
-void NodePlatform::CallOnWorkerThread(std::unique_ptr<Task> task) {
+void NodePlatform::PostTaskOnWorkerThreadImpl(
+ v8::TaskPriority priority,
+ std::unique_ptr<v8::Task> task,
+ const v8::SourceLocation& location) {
worker_thread_task_runner_->PostTask(std::move(task));
}
-void NodePlatform::CallDelayedOnWorkerThread(std::unique_ptr<Task> task,
- double delay_in_seconds) {
+void NodePlatform::PostDelayedTaskOnWorkerThreadImpl(
+ v8::TaskPriority priority,
+ std::unique_ptr<v8::Task> task,
+ double delay_in_seconds,
+ const v8::SourceLocation& location) {
worker_thread_task_runner_->PostDelayedTask(std::move(task),
delay_in_seconds);
}
-
IsolatePlatformDelegate* NodePlatform::ForIsolate(Isolate* isolate) {
Mutex::ScopedLock lock(per_isolate_mutex_);
auto data = per_isolate_[isolate];
@@ -528,8 +533,10 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) {
return per_isolate->FlushForegroundTasksInternal();
}
-std::unique_ptr<v8::JobHandle> NodePlatform::CreateJob(
- v8::TaskPriority priority, std::unique_ptr<v8::JobTask> job_task) {
+std::unique_ptr<v8::JobHandle> NodePlatform::CreateJobImpl(
+ v8::TaskPriority priority,
+ std::unique_ptr<v8::JobTask> job_task,
+ const v8::SourceLocation& location) {
return v8::platform::NewDefaultJobHandle(
this, priority, std::move(job_task), NumberOfWorkerThreads());
}
diff --git a/src/node_platform.h b/src/node_platform.h
index 1062f3b1b9c386a7bde8dca366c6f008bb183ab7..77cb5e6e4f891c510cdaf7fd6175a1f00d9bc420 100644
--- a/src/node_platform.h
+++ b/src/node_platform.h
@@ -147,17 +147,23 @@ class NodePlatform : public MultiIsolatePlatform {
// v8::Platform implementation.
int NumberOfWorkerThreads() override;
- void CallOnWorkerThread(std::unique_ptr<v8::Task> task) override;
- void CallDelayedOnWorkerThread(std::unique_ptr<v8::Task> task,
- double delay_in_seconds) override;
+ void PostTaskOnWorkerThreadImpl(v8::TaskPriority priority,
+ std::unique_ptr<v8::Task> task,
+ const v8::SourceLocation& location) override;
+ void PostDelayedTaskOnWorkerThreadImpl(
+ v8::TaskPriority priority,
+ std::unique_ptr<v8::Task> task,
+ double delay_in_seconds,
+ const v8::SourceLocation& location) override;
bool IdleTasksEnabled(v8::Isolate* isolate) override;
double MonotonicallyIncreasingTime() override;
double CurrentClockTimeMillis() override;
v8::TracingController* GetTracingController() override;
bool FlushForegroundTasks(v8::Isolate* isolate) override;
- std::unique_ptr<v8::JobHandle> CreateJob(
+ std::unique_ptr<v8::JobHandle> CreateJobImpl(
v8::TaskPriority priority,
- std::unique_ptr<v8::JobTask> job_task) override;
+ std::unique_ptr<v8::JobTask> job_task,
+ const v8::SourceLocation& location) override;
void RegisterIsolate(v8::Isolate* isolate, uv_loop_t* loop) override;
void RegisterIsolate(v8::Isolate* isolate,

View File

@@ -8,10 +8,10 @@ This definition conflicts with libuv's: https://github.com/libuv/libuv/blob/bb0b
Breaks the build on 32-bit windows.
diff --git a/include/perfetto/ext/base/sys_types.h b/include/perfetto/ext/base/sys_types.h
index 999a1522f4397def080ad0056ff3f626e2f0cdbe..a3e24ae047a2185b66136184e95427e6e849194f 100644
index 49eeb11dc560ee2048ba32eeb3ae47b034c3e5b0..60ed843ac49320f8a925c3be5a2695737f866fb0 100644
--- a/include/perfetto/ext/base/sys_types.h
+++ b/include/perfetto/ext/base/sys_types.h
@@ -32,11 +32,7 @@ using uid_t = unsigned int;
@@ -33,11 +33,7 @@ using uid_t = unsigned int;
using pid_t = int;
#endif // !GCC

View File

@@ -1,4 +1,2 @@
chore_allow_customizing_microtask_policy_per_context.patch
build_expose_mksnapshot_to_embedders.patch
build_correctly_expose_public_symbols_with_v8_expose_public_symbols.patch
deps_add_v8_object_setinternalfieldfornodecore.patch

View File

@@ -1,220 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Mon, 27 Nov 2023 20:02:16 +0900
Subject: build: correctly expose public symbols with v8_expose_public_symbols
Backport: https://chromium-review.googlesource.com/c/v8/v8/+/5052302
diff --git a/BUILD.gn b/BUILD.gn
index 206f1084252a264b060239e7218331d88a858764..68633c7cad5d6c6d64eeae51bad44b6bf803c5ea 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -723,6 +723,10 @@ if (v8_enable_single_generation == true) {
assert(!v8_enable_snapshot_compression || v8_use_zlib,
"Snapshot compression requires zlib")
+if (v8_expose_public_symbols == "") {
+ v8_expose_public_symbols = v8_expose_symbols
+}
+
v8_random_seed = "314159265"
v8_toolset_for_shell = "host"
@@ -757,6 +761,8 @@ config("internal_config") {
]
if (is_component_build) {
+ defines += [ "BUILDING_V8_SHARED_PRIVATE" ]
+ } else if (v8_expose_public_symbols) {
defines += [ "BUILDING_V8_SHARED" ]
}
@@ -827,7 +833,10 @@ config("external_config") {
configs = [ ":headers_config" ]
defines = []
if (is_component_build) {
- defines += [ "USING_V8_SHARED" ]
+ defines += [
+ "USING_V8_SHARED",
+ "USING_V8_SHARED_PRIVATE",
+ ]
}
if (current_cpu == "riscv64" || current_cpu == "riscv32") {
diff --git a/gni/v8.gni b/gni/v8.gni
index b2cc02ec80d468d5fb6ae55006aa6776901fe099..a72edb4ca320b933525ccaaf7f6bbfe805d509f9 100644
--- a/gni/v8.gni
+++ b/gni/v8.gni
@@ -48,7 +48,11 @@ declare_args() {
# Enable monolithic static library for embedders.
v8_monolithic = false
- # Expose symbols for dynamic linking.
+ # Expose public symbols for native modules of Node.js and Electron. Default
+ # is false.
+ v8_expose_public_symbols = ""
+
+ # Deprecated for v8_expose_public_symbols.
v8_expose_symbols = false
# Implement tracing using Perfetto (https://perfetto.dev).
@@ -86,7 +90,8 @@ declare_args() {
# Enable runtime call stats.
# TODO(liviurau): Remove old name after Chromium config update
# https://crbug.com/1476977.
- v8_enable_runtime_call_stats = !(is_on_release_branch || v8_is_on_release_branch)
+ v8_enable_runtime_call_stats =
+ !(is_on_release_branch || v8_is_on_release_branch)
# Add fuzzilli fuzzer support.
v8_fuzzilli = false
@@ -257,8 +262,7 @@ if (v8_symbol_level != symbol_level) {
}
}
-if ((is_posix || is_fuchsia) &&
- (v8_enable_backtrace || v8_monolithic || v8_expose_symbols)) {
+if ((is_posix || is_fuchsia) && (v8_enable_backtrace || v8_monolithic)) {
v8_remove_configs += [ "//build/config/gcc:symbol_visibility_hidden" ]
v8_add_configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
diff --git a/include/v8config.h b/include/v8config.h
index f407c289b1bd984d883a9b2a8670d21ba1eba7aa..ae42abde643f44349d3aecc1ab4e207982aa0d0f 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -700,6 +700,11 @@ path. Add it with -I<path> to the command line
#define V8_CLANG_NO_SANITIZE(what)
#endif
+// Exposing private symbols requires exposing public symbols too.
+#ifdef BUILDING_V8_SHARED_PRIVATE
+#define BUILDING_V8_SHARED
+#endif
+
#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
#error Inconsistent build configuration: To build the V8 shared library \
set BUILDING_V8_SHARED, to include its headers for linking against the \
diff --git a/src/base/macros.h b/src/base/macros.h
index 56ff8736b3000644905f128fd365797424761798..8994d888b508f41f1141c9d9b2f0bbe78919fea7 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -388,9 +388,9 @@ bool is_inbounds(float_t v) {
// Setup for Windows shared library export.
#define V8_EXPORT_ENUM
-#ifdef BUILDING_V8_SHARED
+#ifdef BUILDING_V8_SHARED_PRIVATE
#define V8_EXPORT_PRIVATE __declspec(dllexport)
-#elif USING_V8_SHARED
+#elif USING_V8_SHARED_PRIVATE
#define V8_EXPORT_PRIVATE __declspec(dllimport)
#else
#define V8_EXPORT_PRIVATE
@@ -400,7 +400,7 @@ bool is_inbounds(float_t v) {
// Setup for Linux shared library export.
#if V8_HAS_ATTRIBUTE_VISIBILITY
-#ifdef BUILDING_V8_SHARED
+#ifdef BUILDING_V8_SHARED_PRIVATE
#define V8_EXPORT_PRIVATE __attribute__((visibility("default")))
#define V8_EXPORT_ENUM V8_EXPORT_PRIVATE
#else
diff --git a/src/common/ptr-compr-inl.h b/src/common/ptr-compr-inl.h
index d5a3d5a55bfa860e19765e62c1b1c77285859d85..4a9ec6f448496daa103bd996729e9db725d68a64 100644
--- a/src/common/ptr-compr-inl.h
+++ b/src/common/ptr-compr-inl.h
@@ -44,7 +44,8 @@ Address V8HeapCompressionScheme::GetPtrComprCageBaseAddress(
// static
void V8HeapCompressionScheme::InitBase(Address base) {
CHECK_EQ(base, GetPtrComprCageBaseAddress(base));
-#if defined(USING_V8_SHARED) && defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
+#if defined(USING_V8_SHARED_PRIVATE) && \
+ defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
set_base_non_inlined(base);
#else
base_ = base;
@@ -53,7 +54,8 @@ void V8HeapCompressionScheme::InitBase(Address base) {
// static
V8_CONST Address V8HeapCompressionScheme::base() {
-#if defined(USING_V8_SHARED) && defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
+#if defined(USING_V8_SHARED_PRIVATE) && \
+ defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
Address base = base_non_inlined();
#else
Address base = base_;
@@ -148,7 +150,8 @@ Address ExternalCodeCompressionScheme::GetPtrComprCageBaseAddress(
// static
void ExternalCodeCompressionScheme::InitBase(Address base) {
CHECK_EQ(base, PrepareCageBaseAddress(base));
-#if defined(USING_V8_SHARED) && defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
+#if defined(USING_V8_SHARED_PRIVATE) && \
+ defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
set_base_non_inlined(base);
#else
base_ = base;
@@ -157,7 +160,8 @@ void ExternalCodeCompressionScheme::InitBase(Address base) {
// static
V8_CONST Address ExternalCodeCompressionScheme::base() {
-#if defined(USING_V8_SHARED) && defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
+#if defined(USING_V8_SHARED_PRIVATE) && \
+ defined(V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE)
Address base = base_non_inlined();
#else
Address base = base_;
diff --git a/src/trap-handler/trap-handler.h b/src/trap-handler/trap-handler.h
index 289a755d3b119cd90b88ee9d76ea13b709fe3a80..674706220c64d63727b8bd461903abd5412fc137 100644
--- a/src/trap-handler/trap-handler.h
+++ b/src/trap-handler/trap-handler.h
@@ -58,11 +58,11 @@ namespace trap_handler {
#endif
// Setup for shared library export.
-#if defined(BUILDING_V8_SHARED) && defined(V8_OS_WIN)
+#if defined(BUILDING_V8_SHARED_PRIVATE) && defined(V8_OS_WIN)
#define TH_EXPORT_PRIVATE __declspec(dllexport)
-#elif defined(BUILDING_V8_SHARED)
+#elif defined(BUILDING_V8_SHARED_PRIVATE)
#define TH_EXPORT_PRIVATE __attribute__((visibility("default")))
-#elif defined(USING_V8_SHARED) && defined(V8_OS_WIN)
+#elif defined(USING_V8_SHARED_PRIVATE) && defined(V8_OS_WIN)
#define TH_EXPORT_PRIVATE __declspec(dllimport)
#else
#define TH_EXPORT_PRIVATE
diff --git a/src/utils/v8dll-main.cc b/src/utils/v8dll-main.cc
index 9bdd97f365a87994b2648456eb2b9759e58f1109..c153431a7321129c8b52288a65280deac6aad33b 100644
--- a/src/utils/v8dll-main.cc
+++ b/src/utils/v8dll-main.cc
@@ -5,6 +5,7 @@
// The GYP based build ends up defining USING_V8_SHARED when compiling this
// file.
#undef USING_V8_SHARED
+#undef USING_V8_SHARED_PRIVATE
#include "include/v8config.h"
#if V8_OS_WIN
diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn
index bc82c635da35c2a98162acad470d8fcc56019255..1cf84b3d8f495128d4d008823b1a7028630cb902 100644
--- a/third_party/googletest/BUILD.gn
+++ b/third_party/googletest/BUILD.gn
@@ -94,8 +94,7 @@ source_set("gtest") {
# V8-only workaround for http://crbug.com/chromium/1191946. Ensures that
# googletest is compiled with the same visibility such as the rest of V8, see
# https://source.chromium.org/chromium/chromium/src/+/master:v8/gni/v8.gni
- if ((is_posix || is_fuchsia) &&
- (v8_enable_backtrace || v8_monolithic || v8_expose_symbols)) {
+ if ((is_posix || is_fuchsia) && (v8_enable_backtrace || v8_monolithic)) {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
@@ -147,8 +146,7 @@ source_set("gmock") {
# V8-only workaround for http://crbug.com/chromium/1191946. Ensures that
# googletest is compiled with the same visibility such as the rest of V8, see
# https://source.chromium.org/chromium/chromium/src/+/master:v8/gni/v8.gni
- if ((is_posix || is_fuchsia) &&
- (v8_enable_backtrace || v8_monolithic || v8_expose_symbols)) {
+ if ((is_posix || is_fuchsia) && (v8_enable_backtrace || v8_monolithic)) {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}

View File

@@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Wed, 22 Nov 2023 17:21:29 +0900
Subject: build: expose mksnapshot to embedders
Backport: https://chromium-review.googlesource.com/c/v8/v8/+/5052522
diff --git a/BUILD.gn b/BUILD.gn
index 17a0e5dd1a693b0f461396d9dcfb9ea812885472..206f1084252a264b060239e7218331d88a858764 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -6913,8 +6913,6 @@ if (current_toolchain == v8_generator_toolchain) {
if (current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") {
- visibility = [ ":*" ] # Only targets in this file can depend on this.
-
sources = [
"src/snapshot/embedded/embedded-empty.cc",
"src/snapshot/embedded/embedded-file-writer.cc",

View File

@@ -46,10 +46,10 @@ index 6cdf53b19c7d058bb66b9fcbe745874cc48daa99..8d112008c2667db97ed5b5af3f87c40d
V8_INLINE static void* GetAlignedPointerFromInternalField(
const BasicTracedReference<Object>& object, int index) {
diff --git a/src/api/api.cc b/src/api/api.cc
index 694aec891a48337fa0387d60bcc34e05752ff2f0..a4931493e9d1a5cb0d5aded2611729f630819dc5 100644
index d75a110a0b5b639c3d01538930c984b7e2129e2a..46527ae2abecb951a0604a60ab17553794603fb2 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -6318,14 +6318,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
@@ -6292,14 +6292,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
isolate);
}

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