Compare commits

...

8 Commits

Author SHA1 Message Date
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
82 changed files with 699 additions and 1047 deletions

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'121.0.6147.0',
'121.0.6159.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",

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 | ✅ |

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

@@ -88,6 +88,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",
@@ -851,6 +852,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 +923,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 27d84a5d61f39dc039608b8a1e84bca47cb8d5d3..5a9bdc6593a9262bdcf6d9ad007f6e9388892086 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,
@@ -141,6 +141,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
virtual void DidHandleOnloadEvents() {}
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
@@ -23,10 +23,10 @@ index 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 7f9d758df761b1d7946d80900e35dec833dea48e..1443c3cbc7ad79fba2a3f42a172a97422a470170 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,
@@ -4573,6 +4573,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 05c969e5ae96170ed9cf99bba6bb52ef11f9d158..16c4e4ef47d928bb3abf8650dd8af17cee9aa3c0 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -621,6 +621,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -620,6 +620,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 bc8e5ac55bd663ecd95b7d61e899a13ae7e0c5bd..f7ca98a8b04fec36b3ccd1a75068e41787b21431 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) {}
@@ -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 98a8a2c427cc60408e1042ce6b2fcd58afa0150d..3e179d19ffd078ca85b5a6c050cc23b8c43cad30 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 13a48fefbdf9eb1845522ace6c551fb7af7807db..41915ebed1e41970d8d61785a3aa89cedeb279d2 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 1c8f50ee733b4caba9a6ee4a7fe025dfb412a47a..29e8fdcb7d34f30674ed86a0024ee5c23dbb503e 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 03015b85bdf0ef82991e2359f537ae92d5612073..be801e0a1b7797fca4c057326fae05ae5cc4c377 100755
--- a/tools/licenses/licenses.py
+++ b/tools/licenses/licenses.py
@@ -415,6 +415,31 @@ SPECIAL_CASES = {
@@ -419,6 +419,31 @@ SPECIAL_CASES = {
"License": "Apache 2.0",
"License File": ["//third_party/selenium-atoms/LICENSE.closure"],
},

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 f0603331994109f168ebd163c3fb237bf6db000a..e436857b89266589986ed08857943339b3a48b98 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

@@ -11,7 +11,7 @@ if we ever align our .pak file generation with Chrome we can remove this
patch.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index cc22e9c43562086396509548a4fe7e2f0ae22f80..705b0e067d8b702a5306334ae9d68eef2c11106d 100644
index 035a3b539c900e7d480488b0b650d565dad974e4..daa59a5e8200e29382b1aff9431bc68f4e8cbd38 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -200,11 +200,16 @@ if (!is_android && !is_mac) {
@@ -33,7 +33,7 @@ index cc22e9c43562086396509548a4fe7e2f0ae22f80..705b0e067d8b702a5306334ae9d68eef
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 8704f445741b416c7763d53440cb410bd72d0fc4..a708ee20c84ee2cb667bcae5fc493803b3f044b7 100644
index 979638c93db4f9d4fecea6d7270ac198d6642c25..0f0a969d06a13434fc35aab8ea0c2330f27639d5 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4811,7 +4811,7 @@ static_library("browser") {
@@ -46,10 +46,10 @@ index 8704f445741b416c7763d53440cb410bd72d0fc4..a708ee20c84ee2cb667bcae5fc493803
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index cd439e952c39a02d326f114acf7da18eac404692..540ef46a5d7708d0385dd57c8e68579e52fb32d8 100644
index 97e34eed359411cd829d17b809cbedf47b669356..a18aae470ee7a4c0507ffae60990d8467c0a767a 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7156,7 +7156,6 @@ test("unit_tests") {
@@ -7182,7 +7182,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index cd439e952c39a02d326f114acf7da18eac404692..540ef46a5d7708d0385dd57c8e68579e
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -7177,6 +7176,10 @@ test("unit_tests") {
@@ -7203,6 +7202,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index cd439e952c39a02d326f114acf7da18eac404692..540ef46a5d7708d0385dd57c8e68579e
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") {
@@ -8224,7 +8227,6 @@ test("unit_tests") {
}
deps += [
@@ -76,7 +76,7 @@ index cd439e952c39a02d326f114acf7da18eac404692..540ef46a5d7708d0385dd57c8e68579e
"//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") {
@@ -8316,6 +8318,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]

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 121a963b9f5384a66503244a50a1579a9ae22e03..ca96b4de6d8fc6cf0f7bfb70ba36d3dd2ea839b0 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(
@@ -8183,6 +8183,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 9e5e6c7cb2902632634ac7214f192547d24d8f96..b082f7d73d7a9bb103abeb60d7f6b359d253b435 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(
@@ -4474,6 +4474,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(
@@ -4515,12 +4521,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -66,7 +66,7 @@ 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 4e5a939bd142d76e01a98c052cc81780e1daeb5d..897bf48e6389c0f85c948b6cdbe92d2f7e8840c8 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -709,6 +709,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -79,7 +79,7 @@ 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 424166941354cf02f5cf332ea02bf3b7c601a5ef..22c14f8cca02c92a740753cabdb67490ddca0a80 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -179,6 +179,7 @@ class NetworkService;
@@ -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 71f459b4db9b6fae9b242c621c90125f8639b201..7f9d758df761b1d7946d80900e35dec833dea48e 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6559,6 +6559,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6567,6 +6567,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 5e23d2f79986dac69f65d6694ba12918b06de0d8..2d9dea818d822ff60abf29e3bfca7d39c6a35f43 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,
@@ -2197,6 +2197,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);

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 be45bbead74af95216fc355ffba6a3dce5f9943b..0b88c55f9eb0d0c7020b0dbf54afb399704a87d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -210,6 +210,7 @@ vs-chromium-project.txt
@@ -209,6 +209,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

@@ -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 9656ae2d33064319ed4a0f8a4a274007969f68e5..b024a04b4b75d16f7a3e13cce833d130a1777958 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1885,12 +1885,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -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 5226dd89cd46a7f6f4d79b8b8f47dda44b3a67f4..66034609ac9fcd339abf4d8ad5e39cb02a413fdc 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(
@@ -4380,8 +4380,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,

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

@@ -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,7 +20,7 @@ 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 85fa160062d503fcd2a3000ef263c6b85cebc12a..823ed64b3793b5c030bde100540b15a8c439ea9e 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1880,6 +1880,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -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

@@ -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,7 +6,7 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 22eccd1647c4ff48e994366527e45154d986d164..b7a3f5643ced5013c38197f654bd616ffe0f73de 100644
index a6c27fe9b7f71910e7dca828b1092955b09612e0..1c01559b53d07fbdf6a6e1e74d161bc08e9ab4fa 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() {
@@ -20,7 +20,7 @@ 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 28f81135df6547bdc713420ffd459d5e807ef5d3..c0ea6ca4e293923f3285d01fa388c58e6ed432be 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

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 230b8cc455b5381b61441eb8853d7ce9a630ce68..547c18aac790e564513ec695ab25ef5cf7c9d8ac 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

@@ -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 2f2a5b60423af1dbc425c44283cc2f2934bffa18..dbbe04b2447aa0769beca25c60d404b4f2209e43 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() {

View File

@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
We can remove this patch once it has in some shape been upstreamed.
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index ce34cced354b092b8e8cf04a8c034c9833765e71..67c1c16b028f87b04007242d60d9cf90a61731da 100644
index c78bbf02e8ce16814586e54046ea8d3ed293ec78..c431825469fafa25586ce373c288651bf16dc236 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,
@@ -26,7 +26,7 @@ index ce34cced354b092b8e8cf04a8c034c9833765e71..67c1c16b028f87b04007242d60d9cf90
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef3554808389 100644
index 14f3667521de110e6b9cd884ef9311878bb8bc8a..c88da6b43b9caefa50e8606e5a641c7c3dd6287e 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -441,6 +441,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -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 {
@@ -655,6 +672,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
bool inverted_colors_ = false;
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;

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 91ce1772691cb41c11685e5f1ab29db5ac01b58c..631070d54bd3a4362c240e914aa61cc915393a45 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -157,11 +157,13 @@ const ChildProcessData& UtilityProcessHost::GetData() {
@@ -227,7 +227,7 @@ index 6c67113ad9983839366d413ebe42321c0afcbf18..c82d0c73632648f0979b494d2df08bad
mojom::ChildProcess* UtilityProcessHost::GetChildProcess() {
return static_cast<ChildProcessHostImpl*>(process_->GetHost())
->child_process();
@@ -441,9 +461,22 @@ bool UtilityProcessHost::StartProcess() {
@@ -440,9 +460,22 @@ bool UtilityProcessHost::StartProcess() {
}
#endif // BUILDFLAG(IS_LINUX)
@@ -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,7 +627,7 @@ 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 322f0e4b0f944f220b4d700b2e508b445f1eb2c6..32566452055d66d4e7fe50c77105b679a4807440 100644
--- a/sandbox/policy/win/sandbox_win.cc
+++ b/sandbox/policy/win/sandbox_win.cc
@@ -724,11 +724,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() {
@@ -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 8ee3c35ba55091d87ac633073123d081a9f95929..206b28406f0386816588f8a5de5610b417e529ab 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,8 +559,8 @@ 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
--- a/content/browser/compositor/viz_process_transport_factory.cc
@@ -617,7 +618,7 @@ 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 d2d3757f75a6b9bc1d08cf682644599cca5ddb68..efee0ac27ca9cf4f86a2558c3a98bc6d98520f6f 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -93,6 +93,7 @@ class DisplayPrivate;
@@ -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,
@@ -543,6 +557,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;

View File

@@ -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 d6520afeb505dcb21771e8932fddf3e946604ce8..7c41878b0fcfc8fe722627a4f888a6b4a643ffb1 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) {
@@ -1649,6 +1650,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

@@ -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 74d589a117309e44c5b625f195edb6a44ee5283e..0a901c70c634a9f236b1e3fae9d0d20cdf2f3078 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -9994,6 +9994,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
@@ -10028,6 +10028,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 96f83f7afba6baa54eda98beadd350eec0a86e2a..d4f06da5914f724525722af8f9e9e9b0b08384e5 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

@@ -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 efee0ac27ca9cf4f86a2558c3a98bc6d98520f6f..b79b12cb4ba231c7b88f8d8d2a29dda68d3981cb 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();
}
@@ -518,6 +518,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();
}
@@ -635,6 +639,12 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
// See go/report-ux-metrics-at-painting for details.
bool animation_started_ = false;

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 d26d27fa9e960972aafd5b05b4e90146ce29c333..c5e43a94c6ea94ea4f02a83256bec9ba65fc7140 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,49 +86,46 @@ index d26d27fa9e960972aafd5b05b4e90146ce29c333..5b67c748ec06432201f4f23ed4f91521
+ return nullptr;
}
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
PictureInPictureOcclusionTracker*
PictureInPictureWindowManager::GetOcclusionTracker() {
CreateOcclusionTrackerIfNecessary();
return occlusion_tracker_.get();
}
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // !BUILDFLAG(IS_ANDROID)
std::vector<url::Origin>
@@ -459,7 +468,7 @@ PictureInPictureWindowManager::GetActiveSessionOrigins() {
return active_origins;
@@ -460,6 +467,7 @@ PictureInPictureWindowManager::GetActiveSessionOrigins() {
}
-#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.
@@ -489,6 +497,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 ff1ccc4bc2c5d365a53cdc85a97208f6f16b1d42..873642dc167251a9bcb932f20d3c1fb2b77d5096 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 @@
@@ -12,6 +12,7 @@
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#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"
@@ -34,7 +35,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 {
@@ -181,10 +184,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
@@ -248,8 +252,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.
@@ -266,7 +272,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,7 +15,7 @@ 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 2b5c0cb8ce6486e617ad8d4256e183d45fa71e56..bdf679f9b9fbf36aaef8efe0da4ded91034e091e 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(
@@ -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 07bca1e7dd54b579e4f1f494b00dacdb36ece4a2..dd83a4134ee50b97932ad5ad3f45c3b5525d2773 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(
@@ -8651,7 +8651,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

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 b5b82b5cbc02bd28615f6f545f9538671d7bc7df..9c520b38b972199cf686ab337626f7a6c5151418 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() {
@@ -2206,9 +2206,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 e436857b89266589986ed08857943339b3a48b98..0554d9f1d41f368952d3e491cb4f490eceb64a07 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(
@@ -2900,6 +2900,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(
@@ -2933,7 +2934,7 @@ void LocalFrame::RequestExecuteScript(
PausableScriptExecutor::CreateAndRun(
script_state, std::move(script_sources), execute_script_policy,
user_gesture, evaluation_timing, blocking_option, want_result_option,
@@ -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 e8f270637a5af69e4de4234a9535042eac526229..e21567618360f52bebbbbdb4c3fddfb695acde57 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(
@@ -944,6 +944,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
std::move(callback).Run(value ? std::move(*value) : base::Value());
},
std::move(callback)),

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,7 +20,7 @@ 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 22c14f8cca02c92a740753cabdb67490ddca0a80..8bfd07ba4ec3cd75fcf0237cf4a6ed58c2c743f3 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 {

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 a99da39f3326514467b63417f03376d7cd118ac7..2b224299dac8a13adfa4887adb150d285216ed19 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1259,6 +1259,11 @@
@@ -1263,6 +1263,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 2ede3f2af478ad6a5c9b59ef87b5f13fe5a5ca1f..25acda798c7fdb2209d59f637e619d65b63e8b41 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 fbcaf3b796fcc493df77a70be7f400a88d680ecc..f99f28c291c2ed476eb6b661ad606fdf09e4608b 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -307,6 +307,8 @@ def GetDefaultHostOs():

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 20f543c3e7a365eea5b2e359887842ec6632d7b7..e8b781467b663465b45368e633c064f56c369b0d 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1031,6 +1031,7 @@ component("base") {
@@ -1029,6 +1029,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 65a5e8f651b2cc0c80a7216b5556f2eaec8f07b0..8ee3c35ba55091d87ac633073123d081a9f95929 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -333,6 +333,7 @@ viz_component("service") {
@@ -334,6 +334,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") {
@@ -593,6 +594,7 @@ viz_source_set("unit_tests") {
"display_embedder/software_output_device_mac_unittest.mm",
]
frameworks = [ "IOSurface.framework" ]
@@ -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 b9884ca952e7fb6d4e9156b17ba9c931154dea1d..136c2b10b72e6d0db48bc4a1b36bf78bc1f75a69 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -53,6 +53,7 @@ source_set("browser") {
@@ -568,10 +568,10 @@ index 404d89f78981c5d63380edfce78ccdff8a7f6037..893cfb4908ab73a3aedca25d056d1ddf
///////////////////////////////////////////////////////////////////////////////
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index 308133639fdb5bd7d0de6becc9aabd202532808a..07952e35e3c161f6ddf8d849af0e4c2760ff0dbc 100644
index bf4e98f5962e5415bde1709104a8228809dd9a21..1aab06c1a8e443cdca07cc5acb26850813854c3d 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -187,6 +187,7 @@ source_set("common") {
@@ -217,6 +217,7 @@ source_set("common") {
"//content:content_implementation",
"//build/config:precompiled_headers",
]
@@ -660,7 +660,7 @@ index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019
} // namespace content
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 3ed642ab9c89b16f0b2fce98e37c7ee5398bb714..aeb4193486338441397983e8f24a29b2b3ad7b4d 100644
index 0de4fdcdba7dd112faed75e9e8209af18ee1032d..19469ee65a71df3b7628b04dda97b8e3f229c479 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -476,6 +476,7 @@ static_library("test_support") {
@@ -687,7 +687,7 @@ index 3ed642ab9c89b16f0b2fce98e37c7ee5398bb714..aeb4193486338441397983e8f24a29b2
public_deps = [
":test_interfaces",
@@ -2910,6 +2913,7 @@ test("content_unittests") {
@@ -2912,6 +2915,7 @@ test("content_unittests") {
}
configs += [ "//build/config:precompiled_headers" ]
@@ -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 122735b454f4a59014d43ef62eb6a3f53b41537e..e8167c3508286970a7cfafcb1b11fbc758cc9aac 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -312,6 +312,7 @@ component("core") {
@@ -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 27aa6f78a2cef0159f03dfc4d0704de72e288dd2..e5e593c1d799dab31483bcb19053d20898212e35 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 88f2c986e7688b4c2f7b94dd6bbd75a7fecc29b4..b2a194f68164d9ce72caa2bf6feb121428ba2bd4 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",
]
@@ -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 87f9bbe79b876ef5e6bd012b7a261aee51986791..5285a37944cbe256fd1937db299e69cdd39dc71e 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -697,6 +697,7 @@ component("views") {
@@ -700,6 +700,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") {
@@ -1128,6 +1129,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

@@ -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,

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

@@ -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 d3204e033dd1624d1eee001aa755217e5be55c38..30f36fdaaff9c0e6f321a2a96f151338816c6c2b 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);
@@ -75,7 +75,7 @@ index f3a29c3c7393a26a7da72c4b412a98f126059a3f..9508cfc93c4980ef503a0ebb0cc87b38
CompleteControlsForcedColorsDefinition(mixer);
@@ -210,6 +214,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -186,6 +190,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,
@@ -199,6 +204,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,
@@ -241,6 +247,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 3d036c17061db0b59a2d874395ff3ad3450ab889..479f47b162bb173440ebc145159e7c6838daf538 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -966,7 +966,6 @@ if (is_win) {
@@ -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 3ff37a308a1485f75a5c900168058e38e92ace52..aed74ff9ad02e7654e21eaea04541d661418e8eb 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -22,7 +22,9 @@
@@ -187,7 +187,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -209,12 +232,20 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() {
@@ -210,12 +233,20 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() {
}
#endif // BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -209,7 +209,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
}
@@ -339,12 +370,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea(
@@ -340,12 +371,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea(
}
PRINTER_LOG(EVENT) << "Paper printable area updated for vendor id "
<< print_settings->requested_media().vendor_id;
@@ -224,7 +224,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
base::Value::Dict job_settings,
std::unique_ptr<PrintSettings> print_settings,
UpdatePrintSettingsCallback callback) {
@@ -352,7 +384,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
@@ -353,7 +385,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
settings->pages = GetPageRangesFromJobSettings(job_settings);
settings->params = mojom::PrintParams::New();
RenderParamsFromPrintSettings(*print_settings, settings->params.get());
@@ -234,7 +234,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(
@@ -365,6 +398,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings(
return;
}
@@ -245,7 +245,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
set_cookie(settings->params->document_cookie);
std::move(callback).Run(std::move(settings));
}
@@ -502,7 +539,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
@@ -503,7 +540,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
void PrintViewManagerBase::ScriptedPrintReply(
ScriptedPrintCallback callback,
int process_id,
@@ -255,7 +255,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if BUILDFLAG(ENABLE_OOP_PRINTING)
@@ -517,12 +555,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
@@ -518,12 +556,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
return;
}
@@ -273,7 +273,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
}
@@ -650,10 +691,12 @@ void PrintViewManagerBase::DidPrintDocument(
@@ -651,10 +692,12 @@ void PrintViewManagerBase::DidPrintDocument(
void PrintViewManagerBase::GetDefaultPrintSettings(
GetDefaultPrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -286,7 +286,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (ShouldPrintJobOop() &&
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
@@ -705,10 +748,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -706,10 +749,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -299,7 +299,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
absl::optional<int> printer_type_value =
job_settings.FindInt(kSettingPrinterType);
@@ -719,6 +764,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -720,6 +765,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
mojom::PrinterType printer_type =
static_cast<mojom::PrinterType>(*printer_type_value);
@@ -307,7 +307,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(
@@ -739,6 +785,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
if (value > 0)
job_settings.Set(kSettingRasterizePdfDpi, value);
}
@@ -315,7 +315,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
std::unique_ptr<PrintSettings> print_settings =
PrintSettingsFromJobSettings(job_settings);
@@ -757,7 +804,21 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -758,7 +805,21 @@ void PrintViewManagerBase::UpdatePrintSettings(
}
}
@@ -338,7 +338,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(
@@ -780,8 +841,6 @@ void PrintViewManagerBase::UpdatePrintSettings(
}
#endif
@@ -347,7 +347,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
void PrintViewManagerBase::SetAccessibilityTree(
@@ -796,7 +855,7 @@ void PrintViewManagerBase::SetAccessibilityTree(
@@ -797,7 +856,7 @@ void PrintViewManagerBase::SetAccessibilityTree(
void PrintViewManagerBase::IsPrintingEnabled(
IsPrintingEnabledCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -356,7 +356,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -812,13 +871,13 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -813,13 +872,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);
@@ -372,7 +372,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return;
}
#endif
@@ -860,6 +919,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -861,6 +920,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
PrintManager::PrintingFailed(cookie, reason);
@@ -380,7 +380,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,
@@ -870,7 +930,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
print_job_->document()->cookie() == cookie) {
ShowPrintErrorDialogForGenericError();
}
@@ -389,7 +389,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
ReleasePrinterQuery();
}
@@ -881,15 +941,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) {
@@ -882,15 +942,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) {
test_observers_.RemoveObserver(&observer);
}
@@ -414,7 +414,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
void PrintViewManagerBase::RenderFrameDeleted(
@@ -941,7 +1010,12 @@ void PrintViewManagerBase::OnJobDone() {
@@ -942,7 +1011,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 +428,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
ReleasePrintJob();
}
@@ -950,9 +1024,10 @@ void PrintViewManagerBase::OnCanceling() {
@@ -951,9 +1025,10 @@ void PrintViewManagerBase::OnCanceling() {
}
void PrintViewManagerBase::OnFailed() {
@@ -440,7 +440,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
TerminatePrintJob(true);
}
@@ -962,7 +1037,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
@@ -963,7 +1038,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
// Is the document already complete?
if (print_job_->document() && print_job_->document()->IsComplete()) {
@@ -449,7 +449,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
}
@@ -1015,7 +1090,10 @@ bool PrintViewManagerBase::SetupNewPrintJob(
@@ -1016,7 +1091,10 @@ bool PrintViewManagerBase::SetupNewPrintJob(
// Disconnect the current `print_job_`.
auto weak_this = weak_ptr_factory_.GetWeakPtr();
@@ -461,7 +461,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
if (!weak_this)
return false;
@@ -1035,7 +1113,7 @@ bool PrintViewManagerBase::SetupNewPrintJob(
@@ -1036,7 +1114,7 @@ bool PrintViewManagerBase::SetupNewPrintJob(
#endif
print_job_->AddObserver(*this);
@@ -470,7 +470,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
}
@@ -1103,6 +1181,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1104,6 +1182,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
}
#endif
@@ -482,7 +482,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
if (!print_job_)
return;
@@ -1110,7 +1193,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1111,7 +1194,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
// printing_rfh_ should only ever point to a RenderFrameHost with a live
// RenderFrame.
DCHECK(rfh->IsRenderFrameLive());
@@ -491,7 +491,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
}
print_job_->RemoveObserver(*this);
@@ -1152,7 +1235,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -1153,7 +1236,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@@ -500,7 +500,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
return true;
if (!cookie) {
@@ -1298,7 +1381,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
@@ -1299,7 +1382,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
}
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
@@ -509,7 +509,7 @@ index 3b3d37639d6e9e31deeb0e51efb6b7cd7c3953f5..ebd28f5a523fa8c6a3dbda8274bfc4d4
for (auto& observer : GetTestObservers()) {
observer.OnPrintNow(rfh);
@@ -1348,7 +1431,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
@@ -1349,7 +1432,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
set_analyzing_content(/*analyzing=*/false);
if (!allowed || !printing_rfh_ || IsCrashed() ||
!printing_rfh_->IsRenderFrameLive()) {
@@ -705,7 +705,7 @@ index c08df976b94d14d2ea87ea928793201e52813fe9..d1460c2e23c7b52ddc695edff658483f
// 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 99fae89969b2ebc2c4439b723573cc1c74acf7d6..d77ff5ea2a1ab344d8e60d3f0c9fe53498fff780 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 +716,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) {
@@ -1243,14 +1244,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
}
print_in_progress_ = true;
@@ -733,7 +733,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
if (!weak_this) {
return;
}
@@ -1255,7 +1256,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1281,7 +1282,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@@ -742,7 +742,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -1270,7 +1271,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1296,7 +1297,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// plugin node and print that instead.
auto plugin = delegate_->GetPdfElement(frame);
@@ -751,7 +751,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
if (render_frame_gone_) {
return;
@@ -1359,7 +1360,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1385,7 +1386,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
@@ -761,7 +761,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
if (render_frame_gone_) {
return;
}
@@ -1422,6 +1424,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
@@ -1448,6 +1450,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -770,7 +770,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
print_preview_context_.OnPrintPreview();
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2046,7 +2050,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2095,7 +2099,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
}
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@@ -780,7 +780,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) {
@@ -2111,17 +2116,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -803,7 +803,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
DidFinishPrinting(PrintingResult::kFailPrintInit);
return;
}
@@ -2093,8 +2100,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2142,8 +2149,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
auto self = weak_ptr_factory_.GetWeakPtr();
@@ -820,7 +820,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
// Check if `this` is still valid.
if (!self)
return;
@@ -2337,25 +2351,33 @@ void PrintRenderFrameHelper::IPCProcessed() {
@@ -2396,25 +2410,33 @@ void PrintRenderFrameHelper::IPCProcessed() {
}
bool PrintRenderFrameHelper::InitPrintSettings(blink::WebLocalFrame* frame,
@@ -860,7 +860,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
return true;
}
@@ -2462,7 +2484,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
@@ -2521,7 +2543,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
std::move(params),
base::BindOnce(
[](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
@@ -870,7 +870,7 @@ index 51fd552071aa9f6933b8a234b3bc7b2ecac33eb5..747e0e155449c6a8994665bc93734d47
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 95e8ae2d809e8bd270d113b2a2707533aa3e92ba..3e02b8791b6f676a4bd185569fadf541aa472406 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
@@ -882,7 +882,7 @@ index c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c8
void PrintWithParams(mojom::PrintPagesParamsPtr params,
PrintWithParamsCallback callback) override;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -318,7 +318,9 @@ class PrintRenderFrameHelper
@@ -319,7 +319,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@@ -893,7 +893,7 @@ index c68b68767ac52602981278ec655d9ccfad0c30ab..df2ea4524584417d859e1a22ec8a49c8
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -328,7 +330,8 @@ class PrintRenderFrameHelper
@@ -329,7 +331,8 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
bool InitPrintSettings(blink::WebLocalFrame* frame,
@@ -904,10 +904,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 136c2b10b72e6d0db48bc4a1b36bf78bc1f75a69..f756ec11bcdb2afce6e4bcae372a921693441bad 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2992,8 +2992,9 @@ source_set("browser") {
@@ -2967,8 +2967,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 1c01559b53d07fbdf6a6e1e74d161bc08e9ab4fa..b5b82b5cbc02bd28615f6f545f9538671d7bc7df 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) {
@@ -2132,6 +2132,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 b082f7d73d7a9bb103abeb60d7f6b359d253b435..5226dd89cd46a7f6f4d79b8b8f47dda44b3a67f4 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() {
@@ -5086,6 +5086,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 98d2ce9bc917dbec283e6d1a9a95267541ef949b..2b28ed7bf27b8642abc0bd72f3c10568b0ee0ff4 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;

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 b8e0c7ceb4fb372190887e7e8e941a4c58f81791..035a3b539c900e7d480488b0b650d565dad974e4 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1605,7 +1605,7 @@ if (is_chrome_branded && !is_android) {
@@ -1601,7 +1601,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) {
@@ -1630,6 +1630,12 @@ if (!is_android) {
}
}

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 66034609ac9fcd339abf4d8ad5e39cb02a413fdc..7928f8f1f4e90ef53279bc7d387ff7baa312c889 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,
@@ -3438,6 +3438,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,
@@ -3448,6 +3455,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 80b895685a05a189dfd2bd7f6797cc788a66805c..8221538b964c9e1f85df389a32d4a448e9ab5634 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 ca96b4de6d8fc6cf0f7bfb70ba36d3dd2ea839b0..39de7a61577686d2c0d5fe8c93f8a67c066b4335 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(
@@ -7386,6 +7386,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 7928f8f1f4e90ef53279bc7d387ff7baa312c889..07bca1e7dd54b579e4f1f494b00dacdb36ece4a2 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(
@@ -3692,21 +3692,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(
@@ -3842,7 +3846,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 5790d6ed3e4d96e91ec729d4172c85eef5ed7063..71b7bfef27bf24ed2121ae897dfcc5e2eb80a3df 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -793,6 +793,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
@@ -828,6 +828,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 328a108d2bd1c545164bf62c9462c70f0ea490ff..9d6e4999004a366a61733d061d90ec69c7dd7e08 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 {
@@ -184,6 +184,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 df350be109056afa28cc7c24e851f4619772dbb2..5c7fd813ce32e0c89526f709d4b69aebc0d68ec7 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 {
@@ -630,6 +630,7 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

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 71b7bfef27bf24ed2121ae897dfcc5e2eb80a3df..de67db26e5da2cc9417f8bf437ad485d0a697b1d 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -805,6 +805,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
@@ -840,6 +840,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 9d6e4999004a366a61733d061d90ec69c7dd7e08..9190eefd9812af12a7ad93a83c55fec05cac3cae 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 {
@@ -184,6 +184,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 5c7fd813ce32e0c89526f709d4b69aebc0d68ec7..5e0f76923b23ff19880e0d5d92e650d0bf22b71c 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 {
@@ -630,6 +630,8 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

View File

@@ -1,4 +1,3 @@
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
revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.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 759fff5cbeb291b0ae4eea140b2c0554fa2cae16..9a01bf15dc8e2353a3ef1490707fa7a015a41cff 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -6318,14 +6318,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
@@ -6320,14 +6320,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
isolate);
}

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: clavin <clavin@DESKTOP-QVNUS47.fastel.com>
Date: Thu, 7 Dec 2023 16:11:40 -0500
Subject: Revert "[api] DCHECK-fail when we reenter V8 while terminating"
This reverts commit 3eed17c6a12a0f33639aa5cffb822ebe42931ec8.
This change causes Electron to crash. :(
This patch is meant to be temporary and should be removed after more
investigation and potentially a refactor.
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5075293
Xref: https://github.com/electron/electron/issues/40741
diff --git a/src/api/api-macros.h b/src/api/api-macros.h
index fa272148c4553a2cbfe2438b2770d2fe5cde9a38..08fa9f799b217eb1565d28aa4f86eb5e0001422e 100644
--- a/src/api/api-macros.h
+++ b/src/api/api-macros.h
@@ -48,7 +48,9 @@
#define ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, \
function_name, bailout_value, \
HandleScopeClass, do_callback) \
- DCHECK(!i_isolate->is_execution_terminating()); \
+ if (i_isolate->is_execution_terminating()) { \
+ return bailout_value; \
+ } \
HandleScopeClass handle_scope(i_isolate); \
CallDepthScope<do_callback> call_depth_scope(i_isolate, context); \
API_RCS_SCOPE(i_isolate, class_name, function_name); \
@@ -56,7 +58,9 @@
bool has_pending_exception = false
#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(i_isolate, T) \
- DCHECK(!i_isolate->is_execution_terminating()); \
+ if (i_isolate->is_execution_terminating()) { \
+ return MaybeLocal<T>(); \
+ } \
InternalEscapableScope handle_scope(i_isolate); \
CallDepthScope<false> call_depth_scope(i_isolate, v8::Local<v8::Context>()); \
i::VMState<v8::OTHER> __state__((i_isolate)); \

View File

@@ -31,6 +31,7 @@
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/node_bindings.h"
#include "shell/common/node_includes.h"
#include "shell/common/node_util.h"
#if BUILDFLAG(IS_WIN)
#include "chrome/child/v8_crashpad_support_win.h"
@@ -107,8 +108,12 @@ int NodeMain(int argc, char* argv[]) {
auto os_env = base::Environment::Create();
bool node_options_enabled = electron::fuses::IsNodeOptionsEnabled();
if (!node_options_enabled) {
os_env->UnSetVar("NODE_OPTIONS");
}
#if BUILDFLAG(IS_MAC)
if (node_options_enabled && os_env->HasVar("NODE_OPTIONS")) {
if (!ProcessSignatureIsSameWithCurrentApp(getppid())) {
// On macOS, it is forbidden to run sandboxed app with custom arguments
// from another app, i.e. args are discarded in following call:
// exec("Sandboxed.app", ["--custom-args-will-be-discarded"])
@@ -117,18 +122,14 @@ int NodeMain(int argc, char* argv[]) {
// exec("Electron.app", {env: {ELECTRON_RUN_AS_NODE: "1",
// NODE_OPTIONS: "--require 'bad.js'"}})
// To prevent Electron apps from being used to work around macOS security
// restrictions, when NODE_OPTIONS is passed it will be checked whether
// this process is invoked by its own app.
if (!ProcessBelongToCurrentApp(getppid())) {
LOG(ERROR) << "NODE_OPTIONS is disabled because this process is invoked "
"by other apps.";
node_options_enabled = false;
// restrictions, when the parent process is not part of the app bundle, all
// environment variables starting with NODE_ will be removed.
if (util::UnsetAllNodeEnvs()) {
LOG(ERROR) << "Node.js environment variables are disabled because this "
"process is invoked by other apps.";
}
}
#endif // BUILDFLAG(IS_MAC)
if (!node_options_enabled) {
os_env->UnSetVar("NODE_OPTIONS");
}
#if BUILDFLAG(IS_WIN)
v8_crashpad_support::SetUp();
@@ -158,7 +159,7 @@ int NodeMain(int argc, char* argv[]) {
// Initialize feature list.
auto feature_list = std::make_unique<base::FeatureList>();
feature_list->InitializeFromCommandLine("", "");
feature_list->InitFromCommandLine("", "");
base::FeatureList::SetInstance(std::move(feature_list));
// Explicitly register electron's builtin bindings.

View File

@@ -43,8 +43,8 @@
#include "ui/base/x/x11_display_util.h"
#include "ui/base/x/x11_util.h"
#include "ui/display/util/edid_parser.h" // nogncheck
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/randr.h"
#include "ui/gfx/x/x11_atom_cache.h"
#endif // defined(USE_OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_WIN)

View File

@@ -49,7 +49,7 @@ void InitializeFeatureList() {
// 'custom dictionary word list API' spec to crash.
std::string(",") + spellcheck::kWinDelaySpellcheckServiceInit.name;
#endif
base::FeatureList::InitializeInstance(enable_features, disable_features);
base::FeatureList::InitInstance(enable_features, disable_features);
}
void InitializeFieldTrials() {

View File

@@ -73,9 +73,9 @@
#include "shell/browser/ui/x/event_disabler.h"
#include "shell/browser/ui/x/x_window_utils.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/shape.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto.h"
#endif
#if defined(USE_OZONE)

View File

@@ -21,9 +21,9 @@
#include "components/viz/common/frame_sinks/delay_based_time_source.h"
#include "components/viz/common/quads/compositor_render_pass.h"
#include "content/browser/renderer_host/cursor_manager.h" // nogncheck
#include "content/browser/renderer_host/input/synthetic_gesture_target.h" // nogncheck
#include "content/browser/renderer_host/render_widget_host_delegate.h" // nogncheck
#include "content/browser/renderer_host/render_widget_host_owner_delegate.h" // nogncheck
#include "content/common/input/synthetic_gesture.h" // nogncheck
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"

View File

@@ -6,6 +6,7 @@
#include "base/stl_util.h"
#include "content/public/browser/web_contents.h"
#include "electron/fuses.h"
#include "shell/browser/electron_browser_context.h"
#include "shell/browser/net/asar/asar_url_loader_factory.h"
@@ -24,18 +25,21 @@ ProtocolRegistry::~ProtocolRegistry() = default;
void ProtocolRegistry::RegisterURLLoaderFactories(
content::ContentBrowserClient::NonNetworkURLLoaderFactoryMap* factories,
bool allow_file_access) {
auto file_factory = factories->find(url::kFileScheme);
if (file_factory != factories->end()) {
// If Chromium already allows file access then replace the url factory to
// also loading asar files.
file_factory->second = AsarURLLoaderFactory::Create();
} else if (allow_file_access) {
// Otherwise only allow file access when it is explicitly allowed.
//
// Note that Chromium may call |emplace| to create the default file factory
// after this call, it won't override our asar factory, but if asar support
// breaks in future, please check if Chromium has changed the call.
factories->emplace(url::kFileScheme, AsarURLLoaderFactory::Create());
if (electron::fuses::IsGrantFileProtocolExtraPrivilegesEnabled()) {
auto file_factory = factories->find(url::kFileScheme);
if (file_factory != factories->end()) {
// If Chromium already allows file access then replace the url factory to
// also loading asar files.
file_factory->second = AsarURLLoaderFactory::Create();
} else if (allow_file_access) {
// Otherwise only allow file access when it is explicitly allowed.
//
// Note that Chromium may call |emplace| to create the default file
// factory after this call, it won't override our asar factory, but if
// asar support breaks in future, please check if Chromium has changed the
// call.
factories->emplace(url::kFileScheme, AsarURLLoaderFactory::Create());
}
}
for (const auto& it : handlers_) {

View File

@@ -35,6 +35,10 @@ class TrayIconCocoa : public TrayIcon {
void SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) override;
gfx::Rect GetBounds() override;
base::WeakPtr<TrayIconCocoa> GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
private:
// Electron custom view for NSStatusItem.
StatusItemView* __strong status_item_view_;

View File

@@ -249,7 +249,15 @@
useDefaultAccelerator:NO];
// Hacky way to mimic design of ordinary tray menu.
[statusItem_ setMenu:[menuController menu]];
base::WeakPtr<electron::TrayIconCocoa> weak_tray_icon =
trayIcon_->GetWeakPtr();
[[statusItem_ button] performClick:self];
// /⚠️ \ Warning! Arbitrary JavaScript and who knows what else has been run
// during -performClick:. This object may have been deleted.
// We check if |trayIcon_| is still alive as it owns us and has the same
// lifetime.
if (!weak_tray_icon)
return;
[statusItem_ setMenu:[menuController_ menu]];
return;
}

View File

@@ -14,6 +14,7 @@
#include "shell/browser/ui/views/frameless_view.h"
#include "ui/base/hit_test.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/insets.h"
@@ -380,9 +381,9 @@ void ClientFrameViewLinux::UpdateButtonImages() {
state_id++) {
views::Button::ButtonState state =
static_cast<views::Button::ButtonState>(state_id);
button.button->SetImage(
state, nav_button_provider_->GetImage(
button.type, ButtonStateToNavButtonProviderState(state)));
button.button->SetImageModel(
state, ui::ImageModel::FromImageSkia(nav_button_provider_->GetImage(
button.type, ButtonStateToNavButtonProviderState(state))));
}
}
}

View File

@@ -135,12 +135,12 @@ void ElectronDesktopWindowTreeHostWin::OnNativeThemeUpdated(
bool ElectronDesktopWindowTreeHostWin::ShouldWindowContentsBeTransparent()
const {
// Window should be marked as opaque if no transparency setting has been set,
// otherwise videos rendered in the window will trigger a DirectComposition
// redraw for every frame.
// Window should be marked as opaque if no transparency setting has been
// set, otherwise animations or videos rendered in the window will trigger a
// DirectComposition redraw for every frame.
// https://github.com/electron/electron/pull/39895
return native_window_view_->GetOpacity() < 1.0 ||
native_window_view_->transparent();
native_window_view_->IsTranslucent();
}
} // namespace electron

View File

@@ -13,8 +13,8 @@
#include "dbus/object_proxy.h"
#include "shell/common/thread_restrictions.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/gfx/x/xproto.h"
namespace electron {
@@ -28,7 +28,8 @@ void SetWMSpecState(x11::Window window, bool enabled, x11::Atom state) {
void SetWindowType(x11::Window window, const std::string& type) {
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
x11::Atom window_type = x11::GetAtom(type_prefix + base::ToUpperASCII(type));
std::string window_type_str = type_prefix + base::ToUpperASCII(type);
x11::Atom window_type = x11::GetAtom(window_type_str.c_str());
auto* connection = x11::Connection::Get();
connection->SetProperty(window, x11::GetAtom("_NET_WM_WINDOW_TYPE"),
x11::Atom::ATOM, window_type);

View File

@@ -202,6 +202,7 @@ const device::mojom::UsbDeviceInfo* ElectronUsbDelegate::GetDeviceInfo(
bool ElectronUsbDelegate::HasDevicePermission(
content::BrowserContext* browser_context,
content::RenderFrameHost* frame,
const url::Origin& origin,
const device::mojom::UsbDeviceInfo& device) {
if (IsDevicePermissionAutoGranted(origin, device))

View File

@@ -57,6 +57,7 @@ class ElectronUsbDelegate : public content::UsbDelegate {
content::BrowserContext* browser_context,
const std::string& guid) override;
bool HasDevicePermission(content::BrowserContext* browser_context,
content::RenderFrameHost* frame,
const url::Origin& origin,
const device::mojom::UsbDeviceInfo& device) override;
void GetDevices(

View File

@@ -57,112 +57,34 @@
"id": "Tab",
"type": "object",
"properties": {
"id": {
"type": "integer",
"minimum": -1,
"optional": true,
"description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a tab may not be assigned an ID; for example, when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to <code>chrome.tabs.TAB_ID_NONE</code> for apps and devtools windows."
},
"index": {
"type": "integer",
"minimum": -1,
"description": "The zero-based index of the tab within its window."
},
"groupId": {
"type": "integer",
"minimum": -1,
"description": "The ID of the group that the tab belongs to."
},
"windowId": {
"type": "integer",
"minimum": 0,
"description": "The ID of the window that contains the tab."
},
"openerTabId": {
"type": "integer",
"minimum": 0,
"optional": true,
"description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."
},
"selected": {
"type": "boolean",
"description": "Whether the tab is selected.",
"deprecated": "Please use $(ref:tabs.Tab.highlighted)."
},
"highlighted": {
"type": "boolean",
"description": "Whether the tab is highlighted."
},
"active": {
"type": "boolean",
"description": "Whether the tab is active in its window. Does not necessarily mean the window is focused."
},
"pinned": {
"type": "boolean",
"description": "Whether the tab is pinned."
},
"audible": {
"type": "boolean",
"optional": true,
"description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the 'speaker audio' indicator is showing."
},
"discarded": {
"type": "boolean",
"description": "Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated."
},
"autoDiscardable": {
"type": "boolean",
"description": "Whether the tab can be discarded automatically by the browser when resources are low."
},
"mutedInfo": {
"$ref": "MutedInfo",
"optional": true,
"description": "The tab's muted state and the reason for the last state change."
},
"url": {
"type": "string",
"optional": true,
"description": "The last committed URL of the main frame of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission and may be an empty string if the tab has not yet committed. See also $(ref:Tab.pendingUrl)."
},
"pendingUrl": {
"type": "string",
"optional": true,
"description": "The URL the tab is navigating to, before it has committed. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission and there is a pending navigation."
},
"title": {
"type": "string",
"optional": true,
"description": "The title of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."
},
"favIconUrl": {
"type": "string",
"optional": true,
"description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission. It may also be an empty string if the tab is loading."
},
"id": {"type": "integer", "minimum": -1, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a tab may not be assigned an ID; for example, when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to <code>chrome.tabs.TAB_ID_NONE</code> for apps and devtools windows."},
// TODO(kalman): Investigate how this is ending up as -1 (based on window type? a bug?) and whether it should be optional instead.
"index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."},
"groupId": {"type": "integer", "minimum": -1, "description": "The ID of the group that the tab belongs to."},
"windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window that contains the tab."},
"openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."},
"selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."},
"lastAccessed": {"type": "number", "optional": true, "description": "The last time the tab was accessed as the number of milliseconds since epoch."},
"highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."},
"active": {"type": "boolean", "description": "Whether the tab is active in its window. Does not necessarily mean the window is focused."},
"pinned": {"type": "boolean", "description": "Whether the tab is pinned."},
"audible": {"type": "boolean", "optional": true, "description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the 'speaker audio' indicator is showing."},
"discarded": {"type": "boolean", "description": "Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated."},
"autoDiscardable": {"type": "boolean", "description": "Whether the tab can be discarded automatically by the browser when resources are low."},
"mutedInfo": {"$ref": "MutedInfo", "optional": true, "description": "The tab's muted state and the reason for the last state change."},
"url": {"type": "string", "optional": true, "description": "The last committed URL of the main frame of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission and may be an empty string if the tab has not yet committed. See also $(ref:Tab.pendingUrl)."},
"pendingUrl": {"type": "string", "optional": true, "description": "The URL the tab is navigating to, before it has committed. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission and there is a pending navigation."},
"title": {"type": "string", "optional": true, "description": "The title of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."},
"favIconUrl": {"type": "string", "optional": true, "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission. It may also be an empty string if the tab is loading."},
"status": {
"type": "string",
"$ref": "TabStatus",
"optional": true,
"description": "Either <em>loading</em> or <em>complete</em>."
"description": "The tab's loading status."
},
"incognito": {
"type": "boolean",
"description": "Whether the tab is in an incognito window."
},
"width": {
"type": "integer",
"optional": true,
"description": "The width of the tab in pixels."
},
"height": {
"type": "integer",
"optional": true,
"description": "The height of the tab in pixels."
},
"sessionId": {
"type": "string",
"optional": true,
"description": "The session ID used to uniquely identify a tab obtained from the $(ref:sessions) API."
}
"incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."},
"width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."},
"height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."},
"sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a tab obtained from the $(ref:sessions) API."}
}
},
{
@@ -1086,4 +1008,4 @@
}
]
}
]
]

View File

@@ -69,80 +69,39 @@ namespace {
namespace gin {
static constexpr auto MenuSourceTypes =
base::MakeFixedFlatMap<base::StringPiece, ui::MenuSourceType>({
{"adjustSelection", ui::MENU_SOURCE_ADJUST_SELECTION},
{"adjustSelectionReset", ui::MENU_SOURCE_ADJUST_SELECTION_RESET},
{"keyboard", ui::MENU_SOURCE_KEYBOARD},
{"longPress", ui::MENU_SOURCE_LONG_PRESS},
{"longTap", ui::MENU_SOURCE_LONG_TAP},
{"mouse", ui::MENU_SOURCE_MOUSE},
{"none", ui::MENU_SOURCE_NONE},
{"stylus", ui::MENU_SOURCE_STYLUS},
{"touch", ui::MENU_SOURCE_TOUCH},
{"touchHandle", ui::MENU_SOURCE_TOUCH_HANDLE},
{"touchMenu", ui::MENU_SOURCE_TOUCH_EDIT_MENU},
});
// let us know when upstream changes & we need to update MenuSourceTypes
static_assert(std::size(MenuSourceTypes) == ui::MENU_SOURCE_TYPE_LAST + 1U);
// static
v8::Local<v8::Value> Converter<ui::MenuSourceType>::ToV8(
v8::Isolate* isolate,
const ui::MenuSourceType& in) {
switch (in) {
case ui::MENU_SOURCE_MOUSE:
return StringToV8(isolate, "mouse");
case ui::MENU_SOURCE_KEYBOARD:
return StringToV8(isolate, "keyboard");
case ui::MENU_SOURCE_TOUCH:
return StringToV8(isolate, "touch");
case ui::MENU_SOURCE_TOUCH_EDIT_MENU:
return StringToV8(isolate, "touchMenu");
case ui::MENU_SOURCE_LONG_PRESS:
return StringToV8(isolate, "longPress");
case ui::MENU_SOURCE_LONG_TAP:
return StringToV8(isolate, "longTap");
case ui::MENU_SOURCE_TOUCH_HANDLE:
return StringToV8(isolate, "touchHandle");
case ui::MENU_SOURCE_STYLUS:
return StringToV8(isolate, "stylus");
case ui::MENU_SOURCE_ADJUST_SELECTION:
return StringToV8(isolate, "adjustSelection");
case ui::MENU_SOURCE_ADJUST_SELECTION_RESET:
return StringToV8(isolate, "adjustSelectionReset");
case ui::MENU_SOURCE_NONE:
return StringToV8(isolate, "none");
}
for (auto const& [key, val] : MenuSourceTypes)
if (in == val)
return StringToV8(isolate, key);
return {};
}
// static
bool Converter<ui::MenuSourceType>::FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
ui::MenuSourceType* out) {
std::string type;
if (!ConvertFromV8(isolate, val, &type))
return false;
if (type == "mouse") {
*out = ui::MENU_SOURCE_MOUSE;
return true;
} else if (type == "keyboard") {
*out = ui::MENU_SOURCE_KEYBOARD;
return true;
} else if (type == "touch") {
*out = ui::MENU_SOURCE_TOUCH;
return true;
} else if (type == "touchMenu") {
*out = ui::MENU_SOURCE_TOUCH_EDIT_MENU;
return true;
} else if (type == "longPress") {
*out = ui::MENU_SOURCE_LONG_PRESS;
return true;
} else if (type == "longTap") {
*out = ui::MENU_SOURCE_LONG_TAP;
return true;
} else if (type == "touchHandle") {
*out = ui::MENU_SOURCE_TOUCH_HANDLE;
return true;
} else if (type == "stylus") {
*out = ui::MENU_SOURCE_STYLUS;
return true;
} else if (type == "adjustSelection") {
*out = ui::MENU_SOURCE_ADJUST_SELECTION;
return true;
} else if (type == "adjustSelectionReset") {
*out = ui::MENU_SOURCE_ADJUST_SELECTION_RESET;
return true;
} else if (type == "none") {
*out = ui::MENU_SOURCE_NONE;
return true;
}
return false;
return FromV8WithLookup(isolate, val, MenuSourceTypes, out);
}
// static

View File

@@ -5,15 +5,60 @@
#include "shell/common/mac/codesign_util.h"
#include "base/apple/foundation_util.h"
#include "base/apple/osstatus_logging.h"
#include "base/apple/scoped_cftyperef.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
namespace electron {
bool ProcessBelongToCurrentApp(pid_t pid) {
absl::optional<bool> IsUnsignedOrAdHocSigned(SecCodeRef code) {
base::apple::ScopedCFTypeRef<SecStaticCodeRef> static_code;
OSStatus status = SecCodeCopyStaticCode(code, kSecCSDefaultFlags,
static_code.InitializeInto());
if (status == errSecCSUnsigned) {
return true;
}
if (status != errSecSuccess) {
OSSTATUS_LOG(ERROR, status) << "SecCodeCopyStaticCode";
return absl::optional<bool>();
}
// Copy the signing info from the SecStaticCodeRef.
base::apple::ScopedCFTypeRef<CFDictionaryRef> signing_info;
status =
SecCodeCopySigningInformation(static_code.get(), kSecCSSigningInformation,
signing_info.InitializeInto());
if (status != errSecSuccess) {
OSSTATUS_LOG(ERROR, status) << "SecCodeCopySigningInformation";
return absl::optional<bool>();
}
// Look up the code signing flags. If the flags are absent treat this as
// unsigned. This decision is consistent with the StaticCode source:
// https://github.com/apple-oss-distributions/Security/blob/Security-60157.40.30.0.1/OSX/libsecurity_codesigning/lib/StaticCode.cpp#L2270
CFNumberRef signing_info_flags =
base::apple::GetValueFromDictionary<CFNumberRef>(signing_info.get(),
kSecCodeInfoFlags);
if (!signing_info_flags) {
return true;
}
// Using a long long to extract the value from the CFNumberRef to be
// consistent with how it was packed by Security.framework.
// https://github.com/apple-oss-distributions/Security/blob/Security-60157.40.30.0.1/OSX/libsecurity_utilities/lib/cfutilities.h#L262
long long flags;
if (!CFNumberGetValue(signing_info_flags, kCFNumberLongLongType, &flags)) {
LOG(ERROR) << "CFNumberGetValue";
return absl::optional<bool>();
}
if (static_cast<uint32_t>(flags) & kSecCodeSignatureAdhoc) {
return true;
}
return false;
}
bool ProcessSignatureIsSameWithCurrentApp(pid_t pid) {
// Get and check the code signature of current app.
base::apple::ScopedCFTypeRef<SecCodeRef> self_code;
OSStatus status =
@@ -22,6 +67,15 @@ bool ProcessBelongToCurrentApp(pid_t pid) {
OSSTATUS_LOG(ERROR, status) << "SecCodeCopyGuestWithAttributes";
return false;
}
absl::optional<bool> not_signed = IsUnsignedOrAdHocSigned(self_code.get());
if (!not_signed.has_value()) {
// Error happened.
return false;
}
if (not_signed.value()) {
// Current app is not signed.
return true;
}
// Get the code signature of process.
base::apple::ScopedCFTypeRef<CFNumberRef> process_cf(
CFNumberCreate(nullptr, kCFNumberIntType, &pid));
@@ -46,9 +100,14 @@ bool ProcessBelongToCurrentApp(pid_t pid) {
OSSTATUS_LOG(ERROR, status) << "SecCodeCopyDesignatedRequirement";
return false;
}
DCHECK(self_requirement.get());
// Check whether the process meets the signature requirement of current app.
status = SecCodeCheckValidity(process_code.get(), kSecCSDefaultFlags,
self_requirement.get());
if (status != errSecSuccess && status != errSecCSReqFailed) {
OSSTATUS_LOG(ERROR, status) << "SecCodeCheckValidity";
return false;
}
return status == errSecSuccess;
}

View File

@@ -10,9 +10,14 @@
namespace electron {
// Given a pid, check if the process belongs to current app by comparing its
// code signature with current app.
bool ProcessBelongToCurrentApp(pid_t pid);
// Given a pid, return true if the process has the same code signature with
// with current app.
// This API returns true if current app is not signed or ad-hoc signed, because
// checking code signature is meaningless in this case, and failing the
// signature check would break some features with unsigned binary (for example,
// process.send stops working in processes created by child_process.fork, due
// to the NODE_CHANNEL_ID env getting removed).
bool ProcessSignatureIsSameWithCurrentApp(pid_t pid);
} // namespace electron

View File

@@ -7,6 +7,7 @@
#include <vector>
#include "build/build_config.h"
#include "v8/include/v8.h"
namespace node {
@@ -26,6 +27,12 @@ v8::MaybeLocal<v8::Value> CompileAndCall(
std::vector<v8::Local<v8::String>>* parameters,
std::vector<v8::Local<v8::Value>>* arguments);
#if BUILDFLAG(IS_MAC)
// Unset all environment variables that start with NODE_. Return false if there
// is no node env at all.
bool UnsetAllNodeEnvs();
#endif
} // namespace electron::util
#endif // ELECTRON_SHELL_COMMON_NODE_UTIL_H_

View File

@@ -0,0 +1,23 @@
// Copyright (c) 2023 Microsoft, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/common/node_util.h"
#include <Foundation/Foundation.h>
namespace electron::util {
bool UnsetAllNodeEnvs() {
bool has_unset = false;
for (NSString* env in NSProcessInfo.processInfo.environment) {
if (![env hasPrefix:@"NODE_"])
continue;
const char* name = [[env componentsSeparatedByString:@"="][0] UTF8String];
unsetenv(name);
has_unset = true;
}
return has_unset;
}
} // namespace electron::util

View File

@@ -391,8 +391,8 @@ v8::MaybeLocal<v8::Value> PassValueToOtherContext(
blink::WebElement::FromV8Value(destination_context->GetIsolate(), value);
if (!elem.IsNull()) {
v8::Context::Scope destination_context_scope(destination_context);
return v8::MaybeLocal<v8::Value>(elem.ToV8Value(
destination_context->Global(), destination_context->GetIsolate()));
return v8::MaybeLocal<v8::Value>(
elem.ToV8Value(destination_context->GetIsolate()));
}
// Custom logic to "clone" Blob references

View File

@@ -2,11 +2,14 @@ const { execFileSync } = require('node:child_process');
const path = require('node:path');
const fixtures = path.resolve(__dirname, '..');
const failJs = path.join(fixtures, 'module', 'fail.js');
const env = {
ELECTRON_RUN_AS_NODE: 'true',
// Process will exit with 1 if NODE_OPTIONS is accepted.
NODE_OPTIONS: `--require "${path.join(fixtures, 'module', 'fail.js')}"`
NODE_OPTIONS: `--require "${failJs}"`,
// Try bypassing the check with NODE_REPL_EXTERNAL_MODULE.
NODE_REPL_EXTERNAL_MODULE: failJs
};
// Provide a lower cased NODE_OPTIONS in case some code ignores case sensitivity
// when reading NODE_OPTIONS.

View File

@@ -1,4 +1,7 @@
const { app } = require('electron');
// eslint-disable-next-line camelcase
const electron_1 = require('electron');
// eslint-disable-next-line camelcase
const { app } = electron_1;
const http = require('node:http');
const v8 = require('node:v8');
// eslint-disable-next-line camelcase,@typescript-eslint/no-unused-vars

28
spec/fuses-spec.ts Normal file
View File

@@ -0,0 +1,28 @@
import { expect } from 'chai';
import { startRemoteControlApp } from './lib/spec-helpers';
import { once } from 'node:events';
import { spawn } from 'node:child_process';
import { BrowserWindow } from 'electron';
import path = require('node:path');
describe('fuses', () => {
it('can be enabled by command-line argument during testing', async () => {
const child0 = spawn(process.execPath, ['-v'], { env: { NODE_OPTIONS: '-e 0' } });
const [code0] = await once(child0, 'exit');
// Should exit with 9 because -e is not allowed in NODE_OPTIONS
expect(code0).to.equal(9);
const child1 = spawn(process.execPath, ['--set-fuse-node_options=0', '-v'], { env: { NODE_OPTIONS: '-e 0' } });
const [code1] = await once(child1, 'exit');
// Should print the version and exit with 0
expect(code1).to.equal(0);
});
it('disables fetching file:// URLs when grant_file_protocol_extra_privileges is 0', async () => {
const rc = await startRemoteControlApp(['--set-fuse-grant_file_protocol_extra_privileges=0']);
await expect(rc.remotely(async (fixture: string) => {
const bw = new BrowserWindow({ show: false });
await bw.loadFile(fixture);
return await bw.webContents.executeJavaScript("ajax('file:///etc/passwd')");
}, path.join(__dirname, 'fixtures', 'pages', 'fetch.html'))).to.eventually.be.rejectedWith('Failed to fetch');
});
});

View File

@@ -673,7 +673,7 @@ describe('node feature', () => {
});
const script = path.join(fixtures, 'api', 'fork-with-node-options.js');
const nodeOptionsWarning = 'NODE_OPTIONS is disabled because this process is invoked by other apps';
const nodeOptionsWarning = 'Node.js environment variables are disabled because this process is invoked by other apps';
it('is disabled when invoked by other apps in ELECTRON_RUN_AS_NODE mode', async () => {
await withTempDirectory(async (dir) => {