Compare commits

..

1 Commits

Author SHA1 Message Date
David Sanders
dcba53cdfe fix: align process.exit() behavior in main process with Node.js 2026-04-30 18:59:11 -07:00
82 changed files with 459 additions and 820 deletions

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'149.0.7817.0',
'149.0.7813.0',
'node_version':
'v24.15.0',
'nan_version':

View File

@@ -2,7 +2,7 @@ is_electron_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
node_module_version = 148
node_module_version = 146
v8_promise_internal_field_count = 1
v8_embedder_string = "-electron.0"

View File

@@ -882,7 +882,7 @@ Returns `string` - Name of the application handling the protocol, or an empty
This method returns the application name of the default handler for the protocol
(aka URI scheme) of a URL.
### `app.getApplicationInfoForProtocol(url)`
### `app.getApplicationInfoForProtocol(url)` _macOS_ _Windows_
* `url` string - a URL with the protocol name to check. Unlike the other
methods in this family, this accepts an entire URL, including `://` at a

View File

@@ -1327,7 +1327,6 @@ libcxx_headers = [
"//third_party/libc++/src/include/__ranges/single_view.h",
"//third_party/libc++/src/include/__ranges/size.h",
"//third_party/libc++/src/include/__ranges/split_view.h",
"//third_party/libc++/src/include/__ranges/stride_view.h",
"//third_party/libc++/src/include/__ranges/subrange.h",
"//third_party/libc++/src/include/__ranges/take_view.h",
"//third_party/libc++/src/include/__ranges/take_while_view.h",
@@ -1352,6 +1351,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__support/ibm/gettod_zos.h",
"//third_party/libc++/src/include/__support/ibm/locale_mgmt_zos.h",
"//third_party/libc++/src/include/__support/ibm/nanosleep.h",
"//third_party/libc++/src/include/__support/xlocale/__nop_locale_mgmt.h",
"//third_party/libc++/src/include/__support/xlocale/__posix_l_fallback.h",
"//third_party/libc++/src/include/__support/xlocale/__strtonum_fallback.h",
"//third_party/libc++/src/include/__system_error/errc.h",

View File

@@ -72,8 +72,17 @@ if (process.platform === 'win32') {
}
}
// Map process.exit to app.exit, which quits gracefully.
process.exit = app.exit as () => never;
// Map process.exit to app.exit, which quits gracefully. When called without
// an explicit code, fall back to process.exitCode like Node.js does.
process.exit = ((code: number | string | undefined | null) => {
// Refs https://github.com/nodejs/node/blob/fc192ee030ee076b948ce7d9d72cba6c101989b8/lib/internal/process/per_thread.js#L229-L252
if (code !== undefined) {
// Node.js handles any string to number conversion here for us
process.exitCode = code;
}
app.exit(process.exitCode || 0);
}) as typeof process.exit;
// Load the RPC server.
require('@electron/internal/browser/rpc-server');

View File

@@ -23,10 +23,10 @@ index 2c07b4f604cfc06d5fbfb3f0969ee37ea2f9dc85..1b8541bfa56a7e53c8396c29ea45a0b5
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index d5c655a204e5faacfcbc7a127fd95e8f227860c7..2507db2a4b8fd5763f81e7c6ca7dbbb2af919aa8 100644
index 2f86c18cac89d5b29fb21c93ab575e304dd57173..93ee72d4eccd314388d0283249bc3c784559d9b4 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4736,6 +4736,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4735,6 +4735,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -67,7 +67,7 @@ index 7d3c4b9bc955873ad67e5ab00406d884d77d3f57..222278059beb1681c1d8e2a93e33279d
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index a3f5649de4219168d5924b5a20ad84f59f16eecc..1316e7116c691030b3c764546c2f71fe61dde592 100644
index d293c49e6774de889fa9959234c82b41a4b1efe1..0787bc8a602c60e5b42933813baa6b9d923c9823 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -216,6 +216,7 @@ void LocalWindowProxy::Initialize() {

View File

@@ -23,10 +23,10 @@ index bdbcb809c4d0081aca93c4ed92912604abbf62bc..8c70713583e8a37201b6e037dae2e898
return receiver_.BindNewEndpointAndPassDedicatedRemote();
}
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index f9fc11dae7e4abce612e58bad459f26f0deb1d51..b914fafb539c1913652b80c6ecf19f25399ff663 100644
index d663fead3e1e2085a02ecbeb7a901c5d7311d55e..4f64c067c8598c3a3e36ee04467fc485039ed585 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -745,6 +745,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -753,6 +753,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -116,7 +116,7 @@ index 932658273154ef2e022358e493a8e7c00c86e732..57bbfb5cde62c9496c351c861880a189
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 0a7b21d77c115eb18c6a63c74358befc0f0ff1c1..ff29fd30758340a8a8daf7740deead59f112c259 100644
index 9b650e7079869dd074d24fd2e0f0d807af114c1f..756a6531f5db61adb5b17ce261719f29a9b6183a 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2468,6 +2468,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
@@ -130,7 +130,7 @@ index 0a7b21d77c115eb18c6a63c74358befc0f0ff1c1..ff29fd30758340a8a8daf7740deead59
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
!old_state->is_in_back_forward_cache;
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
@@ -4021,10 +4025,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -4022,10 +4026,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}

View File

@@ -15,7 +15,7 @@ Refs changes in:
This patch reverts the changes to fix associated crashes in Electron.
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
index 8244902250bdd96e4facf7aa71220f06a9c9d76a..cf65c8588444cfa26c35195873481a420baeb677 100644
index 9827a89c56141596fde57b78f9c9894f273db83e..cedb4bd8217a0ad3ab07d85421e1850bc4d910f5 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -135,14 +135,6 @@ bool Frame::Detach(FrameDetachType type) {

View File

@@ -11,10 +11,10 @@ This patch can (and should) be removed when we can prevent those symbols
from being stripped in the release build.
diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
index 674dc82a867dfabdff0bfe1787b03e36f32fc3b0..d9fce666db6993e28a5e3381dc749b77ffaabf5c 100644
index 36fe79942794239edd00e7be0d94c33892acc5cc..68e4d13e785333b3bbd906f18b164686b67d223e 100644
--- a/build/config/compiler/compiler.gni
+++ b/build/config/compiler/compiler.gni
@@ -151,7 +151,7 @@ declare_args() {
@@ -154,7 +154,7 @@ declare_args() {
# Chrome's clang. crbug.com/1033839
use_thin_lto =
is_cfi || (is_clang && is_official_build && chrome_pgo_phase != 1 &&

View File

@@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
patch.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 3497a3bec7f0f899c65593fa5a69913d54257ea2..ff97e4f0ffd4e288d98bf67a85f51f0ce86d3771 100644
index 171faeaa1c3ba08cc0cd166b492765c8204bb674..a4c8d2d33823e4825b80854db199d2f6542c3e2d 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -196,6 +196,12 @@ if (!is_android && !is_mac) {
@@ -201,6 +201,12 @@ if (!is_android && !is_mac) {
"common/crash_keys.h",
]
@@ -28,10 +28,10 @@ index 3497a3bec7f0f899c65593fa5a69913d54257ea2..ff97e4f0ffd4e288d98bf67a85f51f0c
":chrome_dll",
":chrome_exe_version",
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 3d105b718efbcd7338a8e0aeef9618b76a958a7c..42d6df56ec0f4335afb6e05e1c6b00aaa9eaafed 100644
index a824761a0bf0a3d827cc78bc644e8da877d603d3..dbf5e98c588a32265f65fa569f261129800c3375 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7793,6 +7793,10 @@ test("unit_tests") {
@@ -7761,6 +7761,10 @@ test("unit_tests") {
"//chrome/notification_helper",
]
@@ -42,7 +42,7 @@ index 3d105b718efbcd7338a8e0aeef9618b76a958a7c..42d6df56ec0f4335afb6e05e1c6b00aa
deps += [
"//chrome:other_version",
"//chrome//services/util_win:unit_tests",
@@ -8730,6 +8734,10 @@ test("unit_tests") {
@@ -8696,6 +8700,10 @@ test("unit_tests") {
"../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
]
@@ -53,7 +53,7 @@ index 3d105b718efbcd7338a8e0aeef9618b76a958a7c..42d6df56ec0f4335afb6e05e1c6b00aa
sources += [
# The importer code is not used on Android.
"../common/importer/firefox_importer_utils_unittest.cc",
@@ -8773,7 +8781,7 @@ test("unit_tests") {
@@ -8739,7 +8747,7 @@ test("unit_tests") {
# TODO(crbug.com/417513088): Maybe merge with the non-android `deps` declaration above?
deps += [
"../browser/screen_ai:screen_ai_install_state",

View File

@@ -7,7 +7,7 @@ These are variables we add to the root BUILDCONFIG so that they're available
everywhere, without having to import("//electron/.../flags.gni").
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 00d3892f3cd42661dcd696f01e009e483c45b1ea..5d53847d53ccfd6a5a860f0574d3710797732ec3 100644
index a4d71c98b0fe276ec698c67c7f51cc0371ed107c..f251e5d8eb873606193c903104adda0fc40e7446 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {

View File

@@ -7,7 +7,7 @@ Build libc++ as static library to compile and pass
nan tests
diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
index 3cde8c66bdc533e8090513f83da2964a2c149bec..8db5f3519846092c436c34213a439310e5472fbb 100644
index 62547f7df1860fdb49c3c09b9976da12743f5e24..9ac0b985a8f4175d5f0e8aefff002e0dc693fa47 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -477,6 +477,7 @@ target(libcxx_target_type, "libc++") {

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 6cef9b432850481f34489a646e833390dfa665ad..0c1d88e2bcb6d86d5a007009116c1db818d40dcd 100644
index 8b04c911b759c45b94dfb0c5c859e9ddbf012937..944bb9ee39682f4e623477f98b1c407b0c6b0d6a 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -10201,6 +10201,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -10268,6 +10268,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 6cef9b432850481f34489a646e833390dfa665ad..0c1d88e2bcb6d86d5a007009116c1db8
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 54ed4af3eb75ea7c84b340f860cde7614ef40ecc..260ec31380c64e96dc8da4e3f6359bdef1b79d52 100644
index 3dbcb361d8f41f8109ae7e544f6558fdda0997fe..86273f84bf55276c3b6ae91397332a019874c2af 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5516,6 +5516,10 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5507,6 +5507,10 @@ FrameTree* WebContentsImpl::CreateNewWindow(
create_params.initially_hidden = renderer_started_hidden;
create_params.initial_popup_url = params.target_url;
@@ -35,7 +35,7 @@ index 54ed4af3eb75ea7c84b340f860cde7614ef40ecc..260ec31380c64e96dc8da4e3f6359bde
// Even though all codepaths leading here are in response to a renderer
// trying to open a new window, if the new window ends up in a different
// browsing instance, then the RenderViewHost, RenderWidgetHost,
@@ -5570,6 +5574,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5561,6 +5565,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
// Sets the newly created WebContents WindowOpenDisposition.
new_contents_impl->original_window_open_disposition_ = params.disposition;
@@ -48,7 +48,7 @@ index 54ed4af3eb75ea7c84b340f860cde7614ef40ecc..260ec31380c64e96dc8da4e3f6359bde
// 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
@@ -5611,12 +5621,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5602,12 +5612,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -77,7 +77,7 @@ index a2566982ff81db5166e41243232e23af94dc3c05..ff5c410e78fb171963122f8a24802b7b
// 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 d33c26c24b55566527d4c4898635db058ef0cff1..282e7be8b597a16a989d1896eef227f44ea667ea 100644
index 4aed38dd5f1c1d95d04ab49dd6937114788dcb70..d98b527556464a60d9f0324410824ae1c468764a 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -858,6 +858,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -90,7 +90,7 @@ index d33c26c24b55566527d4c4898635db058ef0cff1..282e7be8b597a16a989d1896eef227f4
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 55f93308ff65f0814da14f175ddee68b0a93e48d..0a4bc1855d2c59d9993c17f5de99c81f4f0d24e5 100644
index 5ce463ef59a60feb82a608e60744d97934f8e604..972d1966d2d4c86e3258bc8d48009fbaf9086d79 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -205,6 +205,7 @@ class NetworkService;
@@ -111,7 +111,7 @@ index 55f93308ff65f0814da14f175ddee68b0a93e48d..0a4bc1855d2c59d9993c17f5de99c81f
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index afdc5b192f711ebab9ae07aecfe25460f5bb9a38..495059091b7a046b40974247464a3610e3f845af 100644
index 8f35d9844d79375a80758daee10c63083fb4460e..f40037ac4e232810d3bc814f6b744e31e7c3fc1a 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -35,6 +35,17 @@ namespace content {
@@ -133,7 +133,7 @@ index afdc5b192f711ebab9ae07aecfe25460f5bb9a38..495059091b7a046b40974247464a3610
WebContents* source,
const OpenURLParams& params,
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index a23da6cb64587f4ffc22d7d42a112dcc22a4212d..31d274e453ca1e99a9e4744d58b2ba22a0b08f40 100644
index 91ecedfc2aab50aa1aa54acdbe1b3f67041c75ce..b4602cf88acc2989b7e44543cd0e6296828f02ed 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -18,6 +18,7 @@
@@ -170,10 +170,10 @@ index a23da6cb64587f4ffc22d7d42a112dcc22a4212d..31d274e453ca1e99a9e4744d58b2ba22
// 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 d6be4532c620861d77c900ac3aa67db26dbdf6ba..d5c655a204e5faacfcbc7a127fd95e8f227860c7 100644
index c5bb0593bcb16cb275bfafd99212f53b525b6c2a..2f86c18cac89d5b29fb21c93ab575e304dd57173 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6863,6 +6863,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6855,6 +6855,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
params->started_by_ad =
GetWebFrame()->IsAdFrame() || GetWebFrame()->IsAdScriptInStack();

View File

@@ -34,10 +34,10 @@ index 1b8541bfa56a7e53c8396c29ea45a0b5af89ef81..28ffec368e5d6bc1744605e9dda7fc68
virtual void DidClearWindowObject() {}
virtual void DidChangeScrollOffset() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 2507db2a4b8fd5763f81e7c6ca7dbbb2af919aa8..0ebb92e4676ef2bf95fec531920b23077e4782c2 100644
index 93ee72d4eccd314388d0283249bc3c784559d9b4..859cea7d1d539822f21bc7ac7f391dd60c3ee249 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4742,10 +4742,11 @@ void RenderFrameImpl::DidInstallConditionalFeatures(
@@ -4741,10 +4741,11 @@ void RenderFrameImpl::DidInstallConditionalFeatures(
observer.DidInstallConditionalFeatures(context, world_id);
}
@@ -181,7 +181,7 @@ index 222278059beb1681c1d8e2a93e33279d4194227b..f68b1f841e20a78e3a109b61b11fd144
// Geometry notifications ----------------------------------------------
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index 1316e7116c691030b3c764546c2f71fe61dde592..b633db5ff53aca3d94a6a3f77348f8e6236d1f4d 100644
index 0787bc8a602c60e5b42933813baa6b9d923c9823..c4adcc6083e09e56416587fbcde10c9026e54066 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -108,11 +108,12 @@ void LocalWindowProxy::DisposeContext(Lifecycle next_status,

View File

@@ -61,10 +61,10 @@ index a389e96de45c8a380e4db23821feb396dab9bcbb..27322ef34edf3fa8bfbd20b1baddcaf3
Widget* GetWidget();
const Widget* GetWidget() const;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 7f3e2a70be5e40cf6ba19149488353fa48d551ab..826f5d17b523cac3ccc49425a330759770ac06ed 100644
index 124f32d2e25dcbed21b8fcf2d7804f61b7eb4c87..def5dcb3aad50a35e45e6fe2f21986b476f7ed35 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3289,15 +3289,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3287,15 +3287,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
}
// We must let Windows handle the caption buttons if it's drawing them, or
// they won't work.
@@ -86,7 +86,7 @@ index 7f3e2a70be5e40cf6ba19149488353fa48d551ab..826f5d17b523cac3ccc49425a3307597
return 0;
}
}
@@ -3320,6 +3324,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3318,6 +3322,7 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
// handle alt-space, or in the frame itself.
is_right_mouse_pressed_on_caption_ = false;
::ReleaseCapture();
@@ -94,7 +94,7 @@ index 7f3e2a70be5e40cf6ba19149488353fa48d551ab..826f5d17b523cac3ccc49425a3307597
// |point| is in window coordinates, but WM_NCHITTEST and TrackPopupMenu()
// expect screen coordinates.
POINT screen_point = CR_POINT_INITIALIZER_FROM_LPARAM(l_param);
@@ -3327,7 +3332,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
@@ -3325,7 +3330,17 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
w_param = static_cast<WPARAM>(::SendMessage(
hwnd(), WM_NCHITTEST, 0, MAKELPARAM(screen_point.x, screen_point.y)));
if (w_param == HTCAPTION || w_param == HTSYSMENU) {

View File

@@ -14,10 +14,10 @@ track down the source of this problem & figure out if we can fix it
by changing something in Electron.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 44b91605948b989b500b16902c3eb22437af68ce..3c5b92660ef7fea6c5c8366009f223ffd0052dad 100644
index 70878c0ca05a21299c6a0e2e08e894431b1747c1..4daac586a6f01799f2f04b9206f7f6a53bc42054 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5487,7 +5487,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5478,7 +5478,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
: IsGuest();
// While some guest types do not have a guest SiteInstance, the ones that
// don't all override WebContents creation above.

View File

@@ -80,20 +80,20 @@ index 39fa45f0a0f9076bd7ac0be6f455dd540a276512..3d0381d463eed73470b28085830f2a23
content::WebContents* source,
const content::OpenURLParams& params,
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 0af9cabf98970600a992fadab6404f162f0aa6a3..296327e4d4829070124e2b7b2d5942d01fcb8ca4 100644
index 6277b04593768d5de235b2176933cbea11613ec6..2e6715a239dd042786d8040299e48b856df80608 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2295,8 +2295,7 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
@@ -2328,7 +2328,8 @@ bool Browser::IsWebContentsCreationOverridden(
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
- const std::string& frame_name,
const std::string& frame_name,
- const GURL& target_url) {
+ const GURL& target_url,
+ const content::mojom::CreateNewWindowParams& params) {
if (actor::HasActorTaskPreventingNewWebContents(opener)) {
if (HasActorTaskPreventingNewWebContents(profile(), opener)) {
// If an ExecutionEngine is acting on the opener, prevent it from creating a
// new WebContents. We'll instead force the navigation to happen in the same
@@ -2309,7 +2308,7 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -2341,7 +2342,7 @@ bool Browser::IsWebContentsCreationOverridden(
return (window_container_type ==
content::mojom::WindowContainerType::BACKGROUND &&
ShouldCreateBackgroundContents(source_site_instance, opener_url,
@@ -103,10 +103,10 @@ index 0af9cabf98970600a992fadab6404f162f0aa6a3..296327e4d4829070124e2b7b2d5942d0
WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 05bc3f5e3cfb31d8092e35f2031a014d676c3bc9..791300d27a69a97ab4d063572c024390da41b9f5 100644
index 78075410c13cda894ea5fa62c3a881637780dfad..90e586308e12a31eb94081788ecfc1e92ba3163f 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -902,8 +902,7 @@ class Browser : public TabStripModelObserver,
@@ -903,8 +903,7 @@ class Browser : public TabStripModelObserver,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -223,10 +223,10 @@ index b969f1d97b7e3396119b579cfbe61e19ff7d2dd4..b8d6169652da28266a514938b45b39c5
content::WebContents* AddNewContents(
content::WebContents* source,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e7769a0fa1e6534e45126d14e5f2e1e120a03b86..ecec29a59aac1dd775746884f20cfc53ac64c23f 100644
index 361b34906ea017c1209899b9f0fec5e43f747f7e..adee34e64400f08dece1bef4f36ab9b93332696d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -5451,8 +5451,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -5442,8 +5442,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ &&
delegate_->IsWebContentsCreationOverridden(
opener, source_site_instance, params.window_container_type,
@@ -237,7 +237,7 @@ index e7769a0fa1e6534e45126d14e5f2e1e120a03b86..ecec29a59aac1dd775746884f20cfc53
static_cast<WebContentsImpl*>(delegate_->CreateCustomWebContents(
opener, source_site_instance, is_new_browsing_instance,
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index 495059091b7a046b40974247464a3610e3f845af..fd840b5de8945d91f218e66009f6c13f4e85e832 100644
index f40037ac4e232810d3bc814f6b744e31e7c3fc1a..95007b7a5f40da2e23053f52da79295a829d3bde 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -161,8 +161,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
@@ -251,7 +251,7 @@ index 495059091b7a046b40974247464a3610e3f845af..fd840b5de8945d91f218e66009f6c13f
}
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 31d274e453ca1e99a9e4744d58b2ba22a0b08f40..b9b59c92a0d69baed2241ca1686d490bba8e087b 100644
index b4602cf88acc2989b7e44543cd0e6296828f02ed..ceb6c66f6461b42556aaba167269811a9a363b40 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -380,8 +380,7 @@ class CONTENT_EXPORT WebContentsDelegate {

View File

@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 338a198ece025bf59d50b1bd2fbe3964036ebab5..317c893fc06a3cbaceb9add3b7657f200964b682 100644
index e121bd64a30b8ce1892f04cfae077547f7df4f42..a024d438505c11f534b2217118c327f240864c07 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -262,8 +262,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {

View File

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

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 f54e0c29f128300c56c7e0b7e18b726eff4df548..c6c936a0b57cedbb761f6e9f31cb860c3bf245ed 100644
index de47fa819ae4012d893bb561b4507a3e847c8b0b..91f5aa62f256a061199e7091069607ceafc02e0d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -828,6 +828,10 @@ void RenderWidgetHostImpl::WasHidden() {

View File

@@ -19,7 +19,7 @@ index 4c1c0c60b69f1a0ee7f98e03e6d8d2ca05645b0a..340a8d61e302c1b1ca6ad0dfb859fc9b
excluded_margin);
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index b441e5faec6f74bf7cefb435a8b9c947ba2223ba..a0204561bff578ef4e588438801e7ff5a991672d 100644
index 3a665b97b001474c65e523939909d23c8f2a465d..8dd1c0014544af50ce52cc849a739c05c961fefe 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1050,8 +1050,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,

View File

@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
} // namespace net
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index a4baa7c363c02898f97c975767de98e5910142c5..d2bcaa4bba1ebefa98b034c7e7cfbb1c56c59a84 100644
index 2cd26265e717998c690aa277ff6ca6aac7b7ad0d..78661bd270ae364b1a85035df8a7c56c42752919 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1997,6 +1997,13 @@ void NetworkContext::SetNetworkConditions(
@@ -2013,6 +2013,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,7 +51,7 @@ index a4baa7c363c02898f97c975767de98e5910142c5..d2bcaa4bba1ebefa98b034c7e7cfbb1c
// This may only be called on NetworkContexts created with the constructor
// that calls MakeURLRequestContext().
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 8fefa1f73342de4e3fba5189ba37fa8657218a4d..415c298bc79848a7aa34eb9887461b9c62f18bba 100644
index b4239d2ed5632e9c93f3b395091344164b8468cb..4e9927a5681c7276c747e1351788a44f9f3caada 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -334,6 +334,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -63,10 +63,10 @@ index 8fefa1f73342de4e3fba5189ba37fa8657218a4d..415c298bc79848a7aa34eb9887461b9c
void SetEnableReferrers(bool enable_referrers) override;
#if BUILDFLAG(IS_CT_SUPPORTED)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 6c586cc768ca8ee67617e432edfbc02a2fae97e2..23396a38d9d2a5bdd9d2eaccb4c7c3e015e452aa 100644
index a7bb27ab245729413b5624c382115a8072e764a5..cf59da2795f425ebebb6e16ff72e414c4f65c8fc 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1303,6 +1303,9 @@ interface NetworkContext {
@@ -1309,6 +1309,9 @@ interface NetworkContext {
mojo_base.mojom.UnguessableToken throttling_client_id,
array<MatchedNetworkConditions> conditions);
@@ -77,7 +77,7 @@ index 6c586cc768ca8ee67617e432edfbc02a2fae97e2..23396a38d9d2a5bdd9d2eaccb4c7c3e0
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 6b9cf7d98311a69ac613ea70ed56922cd60ed13e..60420692faec1c277dac0df6e57f616e93fd0312 100644
index 69a62289cf6a9eff3265b16ea4fdf3bee7efbc7d..8fa03b0cceee589cc00a781cb1ec2ca6edcce5b4 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -157,6 +157,7 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -15,7 +15,7 @@ Ideally we could add an embedder observer pattern here but that can be
done in future work.
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index ff29fd30758340a8a8daf7740deead59f112c259..a576b7aa63c4a77ebffd09d1dcfd6f4ed071d2c6 100644
index 756a6531f5db61adb5b17ce261719f29a9b6183a..3605673e00c0ad5b54f0a22c7e739c9bcb07f5c5 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -1848,6 +1848,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,

View File

@@ -197,7 +197,7 @@ index 55f935f38bf05586650e7a83a689347bb41a45a4..3dc3e4836238c92b4a192a410f3b7c64
if (!WriteToSocket(socket.fd(), to_send)) {
// Try to kill the other process, because it might have been dead.
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 6687bcd53ab8dca1bc7b96446fdd673ed9d1a5da..a469ebd214407114784e06b7a8687d2de5943864 100644
index f4d38a27eb3123ac4bca19de15e8b6184e5faf92..0d4cafb6d0d746d4bb7bf013c9602bd69f48b812 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -9,6 +9,7 @@

View File

@@ -10,7 +10,7 @@ Electron needs this constructor, namely for gin_helper::Constructible
objects.
diff --git a/gin/object_template_builder.cc b/gin/object_template_builder.cc
index d8b358befc28736cb4faa0d0bbbfb76036e42ed4..49ecd470ce29078418ccb490caa8cfde17a6944e 100644
index 0e4f17437ea2c687cb188e59b3b044557d6ad5fe..4c0c31a07b83506bb5f07a228ca79fb0c866d3fd 100644
--- a/gin/object_template_builder.cc
+++ b/gin/object_template_builder.cc
@@ -145,6 +145,13 @@ ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate,
@@ -28,7 +28,7 @@ index d8b358befc28736cb4faa0d0bbbfb76036e42ed4..49ecd470ce29078418ccb490caa8cfde
const ObjectTemplateBuilder& other) = default;
diff --git a/gin/object_template_builder.h b/gin/object_template_builder.h
index c633282925cb0652f5b205d6b600c3af078c4bfe..3dfe60f83bf18f2fe0ad625a4e82a8621f100efe 100644
index cf4f1ae6598fdede655d33baccda254965566ea5..a4c16dc0ec3ff16413fc2a04225a2401989a084b 100644
--- a/gin/object_template_builder.h
+++ b/gin/object_template_builder.h
@@ -48,6 +48,9 @@ class GIN_EXPORT ObjectTemplateBuilder {

View File

@@ -326,7 +326,7 @@ index 64ffc2642c003c8fb7f133ee43ba3e20d48ea543..92846d1b45c04c324014474ec6c02e71
// Although ScreenCaptureKit is available in 12.3 there were some bugs that
diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
index 2fa0432a9180603ff652b7a13106c4b2ed7b37e3..29dbd2157a16330e9aec2d66b2e3b507becb11f8 100644
index 0f6531fd1c7784867b2b4e6d72d042bee4bff579..1c7b00d6b1929b807649d7a00f963195bf3f4ea1 100644
--- a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
@@ -321,8 +321,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
@@ -354,8 +354,8 @@ index 2fa0432a9180603ff652b7a13106c4b2ed7b37e3..29dbd2157a16330e9aec2d66b2e3b507
+ media::VideoCaptureParams updated_params = params;
+ updated_params.use_native_picker = stream_type != blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE;
// All cases other than tab capture or Aura desktop/window capture.
TRACE_EVENT_INSTANT(TRACE_DISABLED_BY_DEFAULT("video_and_image_capture"),
"UsingDesktopCapturer");
TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("video_and_image_capture"),
"UsingDesktopCapturer", TRACE_EVENT_SCOPE_THREAD);
start_capture_closure = base::BindOnce(
&InProcessVideoCaptureDeviceLauncher::
DoStartDesktopCaptureOnDeviceThread,

View File

@@ -193,10 +193,10 @@ index 4c0b23afb38066f4d29ead2d5705ae2b58ddca34..b79eb508bdfc1ae08dce254cfa57ab6c
UtilityProcessHost::Start(std::move(utility_options),
diff --git a/content/browser/service_host/utility_process_host.cc b/content/browser/service_host/utility_process_host.cc
index dc561adf556b3f9548dd49aa4b2fc13207e388b4..ad6f5d92fe0f72d2ba6c173282b218c2bc6b9a55 100644
index 84eb94a0f1dd4b499ac8b58ce1e512d022ec1211..5e40db213db53dc69a11caeecdcb772190d30753 100644
--- a/content/browser/service_host/utility_process_host.cc
+++ b/content/browser/service_host/utility_process_host.cc
@@ -248,13 +248,13 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithFileToPreload(
@@ -247,13 +247,13 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithFileToPreload(
}
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
@@ -213,7 +213,7 @@ index dc561adf556b3f9548dd49aa4b2fc13207e388b4..ad6f5d92fe0f72d2ba6c173282b218c2
#if BUILDFLAG(USE_ZYGOTE)
UtilityProcessHost::Options& UtilityProcessHost::Options::WithZygoteForTesting(
@@ -264,6 +264,45 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithZygoteForTesting(
@@ -263,6 +263,45 @@ UtilityProcessHost::Options& UtilityProcessHost::Options::WithZygoteForTesting(
}
#endif // BUILDFLAG(USE_ZYGOTE)
@@ -259,7 +259,7 @@ index dc561adf556b3f9548dd49aa4b2fc13207e388b4..ad6f5d92fe0f72d2ba6c173282b218c2
UtilityProcessHost::Options&
UtilityProcessHost::Options::WithBoundReceiverOnChildProcessForTesting(
mojo::GenericPendingReceiver receiver) {
@@ -552,9 +591,30 @@ bool UtilityProcessHost::StartProcess() {
@@ -543,9 +582,30 @@ bool UtilityProcessHost::StartProcess() {
}
#endif // BUILDFLAG(ENABLE_GPU_CHANNEL_MEDIA_CAPTURE) && !BUILDFLAG(IS_WIN)
@@ -377,7 +377,7 @@ index dfdcb66d65f07f4543703396eb529a6ec02b3f4a..96c0cadf5caf5bf27f2a767c43f0f1da
// Whether or not to bind viz::mojom::Gpu to the utility process.
bool allowed_gpu_;
diff --git a/content/browser/service_host/utility_sandbox_delegate.cc b/content/browser/service_host/utility_sandbox_delegate.cc
index fd94515548e50a67cfa9956cf3fbab8c7af9fe31..5d7d752e38fbca84a45183121fcec0e60211b4c9 100644
index 47a64f9c60ef359fc0015dff566c8041e34b5405..cd17ff94f279cf32c0bf0aef6c2b53bae37f80fb 100644
--- a/content/browser/service_host/utility_sandbox_delegate.cc
+++ b/content/browser/service_host/utility_sandbox_delegate.cc
@@ -39,17 +39,19 @@ UtilitySandboxedProcessLauncherDelegate::
@@ -404,7 +404,7 @@ index fd94515548e50a67cfa9956cf3fbab8c7af9fe31..5d7d752e38fbca84a45183121fcec0e6
#if DCHECK_IS_ON()
bool supported_sandbox_type =
sandbox_type_ == sandbox::mojom::Sandbox::kNoSandbox ||
@@ -112,11 +114,28 @@ UtilitySandboxedProcessLauncherDelegate::GetSandboxType() {
@@ -111,11 +113,28 @@ UtilitySandboxedProcessLauncherDelegate::GetSandboxType() {
return sandbox_type_;
}
@@ -435,7 +435,7 @@ index fd94515548e50a67cfa9956cf3fbab8c7af9fe31..5d7d752e38fbca84a45183121fcec0e6
#if BUILDFLAG(USE_ZYGOTE)
ZygoteCommunication* UtilitySandboxedProcessLauncherDelegate::GetZygote() {
@@ -190,6 +209,15 @@ UtilitySandboxedProcessLauncherDelegate::GetProcessRequirement() {
@@ -189,6 +208,15 @@ UtilitySandboxedProcessLauncherDelegate::GetProcessRequirement() {
return std::nullopt;
}
@@ -745,7 +745,7 @@ index ea68aa0d16c46ad53b63e10027e81503610051d9..ac1ffa290b59d964931a312a911efbec
// An interface which can be implemented and used with
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc
index 1d798fecab6c7df12cddfb0a63e8985a3fafcb4d..5d0f821b7c86f7f2f3ca1212f3dc356168e647a5 100644
index 8b470b9554d23a951c98c8cba644ae1ae4246004..a30fe3e814bb688be015956a195e0e8efe5662ca 100644
--- a/sandbox/policy/win/sandbox_win.cc
+++ b/sandbox/policy/win/sandbox_win.cc
@@ -616,11 +616,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() {

View File

@@ -46,10 +46,10 @@ index 1c01e4d6699da8760e074a5825784e139ed58fd4..c678a3df0b9e5a8c9e0bd99c1aa540b2
'internal-forced-visited-'):
internal_visited_order = 0
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5
index 4e9b1fc207ad131470778efdbeaff94ed671f9f4..dc0e5baf7ca8147d306d70b4bc3371b2fc62955b 100644
index 7e78dc9d943ab3e9a77e41000e27f002ccbfdb64..fc910bf0c2720424604a4fc653e3223b54ecdb38 100644
--- a/third_party/blink/renderer/core/css/css_properties.json5
+++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -9784,6 +9784,27 @@
@@ -9787,6 +9787,27 @@
property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
},
@@ -91,7 +91,7 @@ index 19cf78803d61a33f08d023bef8799f18c52b6fe3..9f267dbb92ae6496da8f0f14e94d90ea
return a.EmptyCells() == b.EmptyCells();
case CSSPropertyID::kFill:
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
index e25ddd9f729eb365e0b5024d7a14b2c1798ca730..7b4213ec1288d80322818a13dfd4a5eb7fef68ec 100644
index dc3bf090a63c79fd59461f55d0aac99c2f8aac85..1604aa8993368dd825c473d77c4f4b6baa2c907f 100644
--- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
+++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -12380,5 +12380,36 @@ const CSSValue* InternalEmptyLineHeight::ParseSingleValue(
@@ -203,10 +203,10 @@ index 19cda703154dab9397827ab6ea66c2ca446c644d..dd5943c511886f4e39b2e7f10e67e60f
return result;
}
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index 3c04bd0f52dd35717e2ed0f0fe88f5ea41001987..c687ae1b076e2a576297a43d58da86d7331bfd21 100644
index e9b598083915794b32733fa576c5733834596854..3349bee194d7e4d6e5f3913d1f2b90ea13275166 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1676,6 +1676,8 @@ component("platform") {
@@ -1677,6 +1677,8 @@ component("platform") {
"widget/widget_base.h",
"widget/widget_base_client.h",
"windows_keyboard_codes.h",
@@ -314,7 +314,7 @@ index 398fc8badaaf1dddc3183211c9302460393da85f..b35c8261b27a2d5c5f6bd84b606925c9
auto DrawAsSinglePath = [&]() {
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index 2df2b7e2c3cf2cd3b53a9f9e6275c53142c914ff..262e538812fe35b70dc2865fc0fa006105b8844f 100644
index fed46bb94e8a5753a4309ec4ad3d17390d97e8d6..0e806f15414eb2fc60d539d6a16dcc3e8eb77442 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -215,6 +215,10 @@

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 65e6d28734051dc6ba0201b7b09a91ac733e3ff9..f8d66e68f7fdb4944a667ec10ba227fa62af7728 100644
index 65df78d7f2a311633e8512f46efa005c41930873..1978ac9a080c63f8e9aa323c7215051890c55f00 100644
--- a/components/viz/host/host_display_client.cc
+++ b/components/viz/host/host_display_client.cc
@@ -50,9 +50,9 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams(
@@ -39,7 +39,7 @@ index 65e6d28734051dc6ba0201b7b09a91ac733e3ff9..f8d66e68f7fdb4944a667ec10ba227fa
gpu::SurfaceHandle child_window) {
NOTREACHED();
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
index 8d74efb0bbc6a226db2617f42ed9e483dc3d9bef..b4ddfd69985840d586df27b911e902880a164f2a 100644
index 03410160827d5fde6478bb1b16f82b1367413183..2a1368e85b789b51f41625d1db877185ad7d7a6c 100644
--- a/components/viz/host/host_display_client.h
+++ b/components/viz/host/host_display_client.h
@@ -39,6 +39,9 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
@@ -204,7 +204,7 @@ index f49bbc5d568f0cb323a22997a949e2cae8f35d59..c0154ee828e67b197eb2ddb1abf04c0a
const raw_ptr<GpuServiceImpl> gpu_service_impl_;
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
index 48333324f9beec05573d6f63869872c336b808e3..b233fcb586957fcbe5b7b9a767d86e5cda02bc93 100644
index 982cacc1a7fb0ffe26433da6431e2f7a805c742b..5ea2fef095ffc2362181a8f1579a48cc2f7e004d 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
@@ -109,6 +109,8 @@ void SoftwareOutputDeviceMac::UpdateAndCopyBufferDamage(
@@ -216,14 +216,14 @@ index 48333324f9beec05573d6f63869872c336b808e3..b233fcb586957fcbe5b7b9a767d86e5c
// Record the previous paint buffer.
Buffer* previous_paint_buffer =
buffer_queue_.empty() ? nullptr : buffer_queue_.back().get();
@@ -198,6 +200,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
gfx::CALayerParams ca_layer_params;
@@ -199,6 +201,7 @@ void SoftwareOutputDeviceMac::EndPaint() {
ca_layer_params.is_empty = false;
ca_layer_params.scale_factor = scale_factor_;
ca_layer_params.pixel_size = pixel_size_;
+ ca_layer_params.damage = last_damage;
ca_layer_params.io_surface_mach_port.reset(
IOSurfaceCreateMachPort(current_paint_buffer_->io_surface.get()));
client_->SoftwareDeviceUpdatedCALayerParams(std::move(ca_layer_params));
client_->SoftwareDeviceUpdatedCALayerParams(ca_layer_params);
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
index 67d5ff67d74c107a867b39b306c6528425b87e05..5fd12a25c9e319e8e675955926271c9d1cd3a7ca 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.h
@@ -522,7 +522,7 @@ index 4f9e8946fa02d859e92a6896beba82721914f868..78486eaa993ee7ffd5188b31503de7dd
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 5df4863505d134260bcbf09955d5cb10eb9f74e1..96d1fc6e6f5413ac62fb9f0d9c723f7779617c6d 100644
index 0be3821000011d6a3441cb6df95b959ff6805f01..c44e21a2f917dcdbd4a4f699fbb1477d847a25d1 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
@@ -131,7 +131,8 @@ RootCompositorFrameSinkImpl::Create(
@@ -667,7 +667,7 @@ index fbe5a8e6458970652723f91a426541220b394a18..c2e748b92103c582802af9b973ebe0c3
raw_ptr<Layer> root_layer_ = nullptr;
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
index b4172df479401a0073dcb70aa9aeaba67b01b6cf..e3f99fc7f440b8a8f7913fa3a95fbaee34ca08dc 100644
index 5b5bb16199d46f16be587856650b07121a786776..241efc4bddaf2ddfb4d4092766a9d3c9732ef36e 100644
--- a/ui/gfx/ca_layer_params.h
+++ b/ui/gfx/ca_layer_params.h
@@ -7,6 +7,7 @@
@@ -678,7 +678,7 @@ index b4172df479401a0073dcb70aa9aeaba67b01b6cf..e3f99fc7f440b8a8f7913fa3a95fbaee
#include "ui/gfx/geometry/size.h"
#if BUILDFLAG(IS_APPLE)
@@ -53,6 +54,8 @@ struct COMPONENT_EXPORT(GFX) CALayerParams {
@@ -51,6 +52,8 @@ struct COMPONENT_EXPORT(GFX) CALayerParams {
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
#endif
@@ -688,21 +688,21 @@ index b4172df479401a0073dcb70aa9aeaba67b01b6cf..e3f99fc7f440b8a8f7913fa3a95fbaee
gfx::Size pixel_size;
float scale_factor = 1.f;
diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom
index 53f4f4c8074a7f946fd2c3e50a7ac94407663940..082a094dd2dd95626e2866e4d80c9f09ab6ba7f7 100644
index c380e4882d699232869c88bc65dc4d396bb95780..7d3c81b200cc9b390084a35ab5d0fc1904137144 100644
--- a/ui/gfx/mojom/ca_layer_params.mojom
+++ b/ui/gfx/mojom/ca_layer_params.mojom
@@ -30,5 +30,6 @@ struct CALayerParams {
// The geometry of the frame.
@@ -18,5 +18,6 @@ struct CALayerParams {
bool is_empty;
CALayerContent content;
gfx.mojom.Size pixel_size;
+ gfx.mojom.Rect damage;
float scale_factor;
};
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
index 1c6052e7653e0875b2954b325f9856d1871c73e3..558a0f930acc4c791cbcdf6416617dc2c44ca4f6 100644
index e1c6ed1b3a456b164945ee7eef34f9d4f0b80e07..87bff4350cdfcca97de6f66946b9cb6155e36634 100644
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
@@ -67,6 +67,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
if (!data.ReadPixelSize(&out->pixel_size))
return false;
@@ -713,10 +713,10 @@ index 1c6052e7653e0875b2954b325f9856d1871c73e3..558a0f930acc4c791cbcdf6416617dc2
return true;
}
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
index d52b720f891cecb86c4818c94e661a43fc4c88fa..cdfe28e2120b085b43c99bb3a9ea740596b775a8 100644
index b6d3f2fea1d663ee1eba82a8008afc830897534c..e06f7d3184d66d9585af39c896036c1792693ac5 100644
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
@@ -16,6 +16,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
return ca_layer_params.pixel_size;
}
@@ -724,6 +724,6 @@ index d52b720f891cecb86c4818c94e661a43fc4c88fa..cdfe28e2120b085b43c99bb3a9ea7405
+ return ca_layer_params.damage;
+ }
+
static float scale_factor(gfx::CALayerParams& ca_layer_params) {
static float scale_factor(const gfx::CALayerParams& ca_layer_params) {
return ca_layer_params.scale_factor;
}

View File

@@ -81,10 +81,10 @@ index 97a0f76571caf19e39d861bf188da9173fc2f8f6..e651e9b2f9a35265da00432cf2ffdc58
private:
const std::string service_interface_name_;
diff --git a/content/browser/service_host/utility_process_host.cc b/content/browser/service_host/utility_process_host.cc
index ad6f5d92fe0f72d2ba6c173282b218c2bc6b9a55..fb448c082f37c95a73502183f2ba83d523715c62 100644
index 5e40db213db53dc69a11caeecdcb772190d30753..69540f50890c141349a20c1b8039b10c3ee4569b 100644
--- a/content/browser/service_host/utility_process_host.cc
+++ b/content/browser/service_host/utility_process_host.cc
@@ -669,7 +669,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) {
@@ -660,7 +660,7 @@ void UtilityProcessHost::OnProcessCrashed(int exit_code) {
: Client::CrashType::kPreIpcInitialization;
}
#endif // BUILDFLAG(IS_WIN)

View File

@@ -112,7 +112,7 @@ index df038b9d2a798185d3ea49c4e705e0963262f580..c108e5b7cc32c512326a3e70d32f6313
string mime_type;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 815895447720c9383ae7788a2c45b0ffa429a028..89c324f53551ee5930edcefd412fbe6a46c9285d 100644
index aa67598684159196614cc9f68782e271e9a44c89..f46ed888a0c4467ea32efb045c81ac5025189872 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -373,6 +373,9 @@ URLLoader::URLLoader(
@@ -155,10 +155,10 @@ index 815895447720c9383ae7788a2c45b0ffa429a028..89c324f53551ee5930edcefd412fbe6a
if (expected_response_headers_for_synthetic_response &&
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
index 9814d15b056df64918d5d663f41701bb5ff2765e..f57884602a179b5c6268d63093b3abd82fdf2587 100644
index 5c04a9cc1d789b92623cd92be8cb7f94e53a7a1c..ccb3b820435eafaf47c316a3db4789ff605229f3 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -624,6 +624,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
@@ -629,6 +629,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
resource_scheduler_request_handle_;

View File

@@ -35,7 +35,7 @@ index 7ea6daec53a497bf867d799e041bf6ae7191ef7b..15940624940d5c629c40319f45c59282
execution_context->GetScheduler()
->ToFrameScheduler()
diff --git a/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc b/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc
index 3cf2c103c9460d6a5ef64b946a57f96432501670..937c824c5eb4253733c6cd78c38209e2019a79a9 100644
index 936f5ebe28caa993ed5de0f7de3613fa338e263f..961ac8091aa82128e1cfb8800a7efcb80d100a05 100644
--- a/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc
+++ b/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc
@@ -13,10 +13,12 @@

View File

@@ -20,10 +20,10 @@ This patch will be removed when the deprecated sync api support is
removed.
diff --git a/components/permissions/permission_util.cc b/components/permissions/permission_util.cc
index 7ed353d3dfe079f90c0c36e5d37219b24a0239e2..24f75cbada86669028e5e40fe7b62c01e8316121 100644
index 33019cb5255afd757167517bcbb2c3d00414f787..66e2e0f8f39994dfe33c923d62fe791d5181d207 100644
--- a/components/permissions/permission_util.cc
+++ b/components/permissions/permission_util.cc
@@ -567,7 +567,8 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingsTypeSafe(
@@ -566,7 +566,8 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingsTypeSafe(
return ContentSettingsType::LOCAL_NETWORK;
case PermissionType::LOOPBACK_NETWORK:
return ContentSettingsType::LOOPBACK_NETWORK;
@@ -130,7 +130,7 @@ index 36410ff29d9c82e59f93fbb82968064bd330dfde..6c3f994e0b184f78bd9442002bb4dfae
virtual void PassiveInsecureContentFound(const WebURL&) {}
diff --git a/third_party/blink/renderer/core/editing/commands/clipboard_commands.cc b/third_party/blink/renderer/core/editing/commands/clipboard_commands.cc
index 05d2b0b9610e0fce63baa4165cfa860aa55f7962..c7a89fe2e4ec62607cd38a1cd9a4e10918c4e183 100644
index 8fded9303e74737d82ca6d54e00807ebabf6c1ac..c0b66eb9a62f8f75e3c4de43f467ddd09d8dc2d6 100644
--- a/third_party/blink/renderer/core/editing/commands/clipboard_commands.cc
+++ b/third_party/blink/renderer/core/editing/commands/clipboard_commands.cc
@@ -123,7 +123,7 @@ bool ClipboardCommands::CanReadClipboard(LocalFrame& frame,
@@ -142,7 +142,7 @@ index 05d2b0b9610e0fce63baa4165cfa860aa55f7962..c7a89fe2e4ec62607cd38a1cd9a4e109
}
bool ClipboardCommands::CanWriteClipboard(LocalFrame& frame,
@@ -338,7 +338,7 @@ bool ClipboardCommands::PasteSupported(LocalFrame* frame) {
@@ -312,7 +312,7 @@ bool ClipboardCommands::PasteSupported(LocalFrame* frame) {
return true;
}
return frame->GetContentSettingsClient() &&

View File

@@ -23,7 +23,7 @@ additional headless changes from breaking macOS window behavior.
https://chromium-review.googlesource.com/c/chromium/src/+/7487666
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
index e7959d485b894e7407187fb660c9186cc0c044a7..a9d90fc20549c9cb35a1a67a21ef97d7b96c9e47 100644
index 0c8fea71669aed9b00b202a7a66e1720c554a3fa..4ecd395acf6d3d3dcde766eb60da81a2a4f6006f 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -241,6 +241,7 @@ @implementation NativeWidgetMacNSWindow {
@@ -67,7 +67,7 @@ index e7959d485b894e7407187fb660c9186cc0c044a7..a9d90fc20549c9cb35a1a67a21ef97d7
return _headless_info.get();
}
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
index 2fd9022f3924d5d47920efaea455b770affd79d2..25e70e294a43fe183051766d311883f920537740 100644
index 94ee727830545ff1576685722c0fd0dd215131cf..ba70aca429e33c12215dfd67d3855245855ae369 100644
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -559,7 +559,7 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
@@ -94,10 +94,10 @@ index a41254c1f31654c1326b4bf1f29237bdf44bbe5a..8ca5673a225b69b5630383ed9673653b
StateRestorationData? state_restoration_data;
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
index a7aa661f94df2a435de6727ca89b69e686b92887..16e6c4b02aca7f1c4f2e80340898262be3b23f87 100644
index 7f0bf65efac90fb0d35e46a0a8171e05b7219348..90c58f77b94a65d2caa6348eb5b6ee92ec47fe84 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -567,6 +567,7 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
@@ -566,6 +566,7 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
bool is_miniaturized_ = false;
bool is_window_key_ = false;
bool is_mouse_capture_active_ = false;
@@ -106,7 +106,7 @@ index a7aa661f94df2a435de6727ca89b69e686b92887..16e6c4b02aca7f1c4f2e80340898262b
bool is_visible_on_all_workspaces_ = false;
gfx::Rect window_bounds_before_fullscreen_;
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 5f4d37702f25d3b05299562e56e764f3e4838a6a..a251e9df5677ec0889c6e85029910d8657d356bf 100644
index a258b94a8122c74b6f98f4b88b710371291fcfe4..2bcee4b775a2a39fbbe3c070a5db608157158517 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -483,6 +483,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,

View File

@@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
BrowserWindow.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index a0204561bff578ef4e588438801e7ff5a991672d..7f3e2a70be5e40cf6ba19149488353fa48d551ab 100644
index 8dd1c0014544af50ce52cc849a739c05c961fefe..124f32d2e25dcbed21b8fcf2d7804f61b7eb4c87 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3888,17 +3888,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
@@ -3886,17 +3886,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
min_window_size = delegate_->DIPToScreenSize(min_window_size);
max_window_size = delegate_->DIPToScreenSize(max_window_size);

View File

@@ -8,7 +8,7 @@ Check for broken links by confirming the file exists before setting its utime.
This patch should be upstreamed & removed.
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index d4252ffa51409920e477f69f54efec4b46cd63c4..2623b4fef880923100724e91da4bc77b5784ba30 100755
index f570f5eca1c4302b399466fc24e125d4fd7059ef..5763e801255e09cefa7f74b8ebf8d11ec934aad5 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -201,10 +201,9 @@ def DownloadAndUnpack(url, output_dir, path_prefixes=None, is_known_zip=False):

View File

@@ -28,10 +28,10 @@ The patch should be removed in favor of either:
Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index d0abcdb3dcc4081be58d9e61966c5a2f6fde117f..579fbfdbfea74b197b07dbe79f39d3ad050b1f4f 100644
index 764142259d94c2ed32f05e3998b6be5bf651299a..4bce504ef8fbf2dda21b5c043496a22f48365a72 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -11842,6 +11842,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() {
@@ -11946,6 +11946,11 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactoryUnchecked() {
target_rph_id);
}

View File

@@ -11,7 +11,7 @@ is currently bugged on these elements. This patch fixes that.
2. Space now adds a space after accepting the replacement.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 5310b9905ad76154ff7c5f5fca48d63fe0d1136c..b78a87e2c39a08614e1bb863bf490c605f31d818 100644
index 38159d146cdf71f84611d58e2983418a1a365911..c256a5a98cd93bdcf69190ee3ae083b8a6daedc4 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -532,6 +532,13 @@ - (void)didAcceptReplacementString:(NSString*)acceptedString

View File

@@ -83,10 +83,10 @@ index 525e6f03bc7699d43dc0a2e63b4ce02fcb35e74b..c88b53e1e5c090f03d834f2dd21ad20f
PictureInPictureOcclusionTracker*
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 15b35792469aca29900025733fbcc9d62d7d1d62..1fe989a3191e491de89d654023911bd72bf6ff3f 100644
index 562ff4ad0a37279baf6392e14a46d950cd3ff8ae..e7c60d83c59a499e36a69588a10ffebcdd17e7d6 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -450,11 +450,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
@@ -449,11 +449,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
#endif // BUILDFLAG(IS_WIN)

View File

@@ -13,10 +13,10 @@ messages in the legacy window handle layer.
These conditions are regularly hit with WCO-enabled windows on Windows.
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 6b4ce6055d835139fafa8bbdd54773c6126c1af5..faf098383962a905794b86d1a17d25256fe94d4e 100644
index d2c43cece0e1620462ed12fd194d0a51969451ea..241121fa9b64a4102fd6ce8a29e0a64308701dc9 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -389,12 +389,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnKeyboardRange(UINT message,
@@ -387,12 +387,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnKeyboardRange(UINT message,
LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
WPARAM w_param,
LPARAM l_param) {
@@ -31,7 +31,7 @@ index 6b4ce6055d835139fafa8bbdd54773c6126c1af5..faf098383962a905794b86d1a17d2525
tme.hwndTrack = hwnd();
tme.dwHoverTime = 0;
TrackMouseEvent(&tme);
@@ -433,7 +433,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
@@ -431,7 +431,10 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
// the picture.
if (!msg_handled &&
(message >= WM_NCMOUSEMOVE && message <= WM_NCXBUTTONDBLCLK)) {

View File

@@ -87,10 +87,10 @@ index a4768b51dae6817c9e9a467e9b16e827e0bfebda..83c42b5062aa8193fe2f56e407abe67d
// The view with active text input state, i.e., a focused <input> element.
// It will be nullptr if no such view exists. Note that the active view
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 341b0e45af39357af676ce3c3775462e6192b857..44b91605948b989b500b16902c3eb22437af68ce 100644
index db97c490b1979916b7c32175e1f50f463a5e7722..70878c0ca05a21299c6a0e2e08e894431b1747c1 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -10478,7 +10478,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -10469,7 +10469,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

View File

@@ -18,7 +18,7 @@ or resizing, but Electron does not seem to run into that issue
for opaque frameless windows even with that block commented out.
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 826f5d17b523cac3ccc49425a330759770ac06ed..e66f269cb6aa77ae3fcff5bc106773122f5a6744 100644
index def5dcb3aad50a35e45e6fe2f21986b476f7ed35..05aabcb8b8342c671a98dbbfa9b7c14f6110b038 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1868,7 +1868,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {

View File

@@ -36,7 +36,7 @@ index 27322ef34edf3fa8bfbd20b1baddcaf3b7555618..b8d1fa863fd05ebc3ab8ac5ef8c4d813
// Overridden from DesktopWindowTreeHost:
void Init(const Widget::InitParams& params) override;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index e66f269cb6aa77ae3fcff5bc106773122f5a6744..03ed37bf6ca88e1615d876453f0b12072467b446 100644
index 05aabcb8b8342c671a98dbbfa9b7c14f6110b038..e2b682dc61e58b982fb7bc13cb03b375339d051d 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -994,13 +994,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
@@ -89,7 +89,7 @@ index e66f269cb6aa77ae3fcff5bc106773122f5a6744..03ed37bf6ca88e1615d876453f0b1207
return;
}
@@ -2457,17 +2469,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
@@ -2455,17 +2467,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
delegate_->SchedulePaint();
}

View File

@@ -11,7 +11,7 @@ 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 d6b134d37a260b578ea5cacf65c829825635c570..3a08cff7683fcd842a87e78ff132cc9da3be2038 100644
index a5c13ea50845fede85741de7a6f3b1c327698110..50edc218dc16c85c3c870c744b9c14936a0e99d2 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2173,9 +2173,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {

View File

@@ -92,10 +92,10 @@ index dffb6f5850bf0f29eb1aaa3e7d24782dea8e4bdd..70493394ff5e262f975535fc293b1d26
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 1767cf5698b0285c89e6ff35789a2d0016eebb36..b93899dce68c802daf2be7f35edce18c4aae22ab 100644
index 72a0bd2cff84fabe6d898f283d803ab03d5dc53c..ba3f447ab19ca1a2f16d406d09d11317bb25d85a 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
@@ -974,6 +974,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
@@ -978,6 +978,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
std::move(callback).Run(value ? std::move(*value) : base::Value());
},
std::move(callback)),
@@ -223,7 +223,7 @@ index dfa6cc173bd4618d851a9101d300ca2d6205537d..312fd047e4fa531735fe935df289b978
mojom::blink::WantResultOption::kWantResult, wait_for_promise);
}
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 779b90b9f5c6f96cdc1cfd4226858733d70f05c1..453afd51cf1f27d18e0f42b833f8e982ded388a9 100644
index 984ae2db198eee2241175446ab272502efdd222d..32963f9a2e3436b6794c832dfbc53b8faac6a02e 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -1129,14 +1129,15 @@ void WebLocalFrameImpl::RequestExecuteScript(

View File

@@ -6,7 +6,7 @@ Subject: fix: select the first menu item when opened via keyboard
This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed.
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 532edde92c72df424a8898594c9ec195bf7575b3..e76b39f12dca4941631a6ff97904dab1bfb6f604 100644
index 63f140c698fb1e5ba1f93c24bfe19bc3f87cec19..ea1824d09b37f6404985ffb048ce196ad5811507 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -724,6 +724,16 @@ void MenuController::Run(Widget* parent,
@@ -26,7 +26,7 @@ index 532edde92c72df424a8898594c9ec195bf7575b3..e76b39f12dca4941631a6ff97904dab1
if (button_controller) {
pressed_lock_ = button_controller->TakeLock(
false, ui::LocatedEvent::FromIfValid(event));
@@ -2529,18 +2539,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
@@ -2535,18 +2545,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
}
item->GetSubmenu()->ShowAt(params);

View File

@@ -20,7 +20,7 @@ index 9e1cfd02a369d865d24aa95d28b2597eec9dc614..63bd6220e49e933fca9258e1c01ab5c2
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 0a4bc1855d2c59d9993c17f5de99c81f4f0d24e5..5b466f6cdf75a7cd4a5356b5859143c305488464 100644
index 972d1966d2d4c86e3258bc8d48009fbaf9086d79..d5ead99c3efd2f0ca5b2252e3971c48a45c0c282 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -350,6 +350,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 0d16ddff3ee6807fa8644e8c60e714471ad0d743..69e0f3b808d402eebfb9c189b13ec99dbad02bf5 100644
index d0620514c19f330dac4e33cb19bccea063919236..b20a1b116d8d9ed046193361149cf00023c48876 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1725,6 +1725,11 @@
@@ -1717,6 +1717,11 @@
"includes": [12000],
},

View File

@@ -50,7 +50,7 @@ system font by checking if it's kCTFontPriorityAttribute is set to
system priority.
diff --git a/base/BUILD.gn b/base/BUILD.gn
index ee3e6b431434cca3917887019ab39751af14555d..e1ab1700ce6fa2a134e632bcb26ed3e54ef2e9f2 100644
index 16fd234a12b251e943e1193998ac599cfa027860..57d283b024fa1d1f225ca76c7c7bff604be493bf 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1124,6 +1124,7 @@ component("base") {
@@ -640,7 +640,7 @@ index 48f47bf3eeb8464d1c3925f0f73f62c790cac2f0..b7b2b7c1b7e99927012ce1676cc753b2
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
// can only be accomplished by overriding methods.
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
index a293573bc4740782fc1bbda8180fa6700016d77e..e7959d485b894e7407187fb660c9186cc0c044a7 100644
index 5a74b954579ca65550d5bd4e9c83712c5d516cd1..0c8fea71669aed9b00b202a7a66e1720c554a3fa 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -23,6 +23,7 @@
@@ -811,7 +811,7 @@ index a293573bc4740782fc1bbda8180fa6700016d77e..e7959d485b894e7407187fb660c9186c
- (NSWindow*)rootWindow {
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
index 07e0b72bb9807d21f6ef8597b0b6422d30f01003..2fd9022f3924d5d47920efaea455b770affd79d2 100644
index d58c5eff9f8fbca96d0912ab9a19d06974fd8016..94ee727830545ff1576685722c0fd0dd215131cf 100644
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -42,6 +42,7 @@
@@ -940,7 +940,7 @@ index 010c713090e5038dc90db131c8f621422d30c03b..20c35e887a0496ee609c077e3b0494bd
void ForwardKeyboardEvent(const input::NativeWebKeyboardEvent& key_event,
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 989b11c5b67343fbb03bb849e1b3febd6167a00e..5310b9905ad76154ff7c5f5fca48d63fe0d1136c 100644
index 664e12c07204feeb5be16581fe51e8adc4b898dd..38159d146cdf71f84611d58e2983418a1a365911 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -33,6 +33,7 @@
@@ -951,7 +951,7 @@ index 989b11c5b67343fbb03bb849e1b3febd6167a00e..5310b9905ad76154ff7c5f5fca48d63f
#include "skia/ext/skia_utils_mac.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/input/input_handler.mojom.h"
@@ -2258,15 +2259,21 @@ - (NSAccessibilityRole)accessibilityRole {
@@ -2233,15 +2234,21 @@ - (NSAccessibilityRole)accessibilityRole {
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
@@ -986,7 +986,7 @@ index 65f4f7cb0162257b5223f324acdf6fcb0c295c27..908fff2acf576f925b9309e3b024c150
public_deps = [
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 2575ac6b4211b43447a39f9ce89077182ef0cf54..1bce550e07780196b7606545cac1e9ae7cf0f563 100644
index 4cecf7a28fbf85f6e4ed2290b872b5d3e8e0c008..d49abe8b6a867407ef5442a4e45efc18e75cd7ce 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -25,6 +25,7 @@
@@ -1007,7 +1007,7 @@ index 2575ac6b4211b43447a39f9ce89077182ef0cf54..1bce550e07780196b7606545cac1e9ae
@class RenderWidgetHostViewCocoa;
namespace content {
@@ -682,9 +685,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
@@ -681,9 +684,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
// EnsureSurfaceSynchronizedForWebTest().
uint32_t latest_capture_sequence_number_ = 0u;
@@ -1020,10 +1020,10 @@ index 2575ac6b4211b43447a39f9ce89077182ef0cf54..1bce550e07780196b7606545cac1e9ae
// Used to force the NSApplication's focused accessibility element to be the
// content::BrowserAccessibilityCocoa accessibility tree when the NSView for
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 4ef475fb46fb12bc9f4dd8b17ab44568084932e4..a8c01d4ac0e60fc7427191d51ab51c42d9e5f1c2 100644
index 6eab22fa2589038c402fe4bf0a54e42fda5eb1dd..6e5c03522683f1c19d4b9c9e65c1f4716b9c3f49 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -54,6 +54,7 @@
@@ -53,6 +53,7 @@
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/page_visibility_state.h"
@@ -1031,7 +1031,7 @@ index 4ef475fb46fb12bc9f4dd8b17ab44568084932e4..a8c01d4ac0e60fc7427191d51ab51c42
#include "media/base/media_switches.h"
#include "skia/ext/platform_canvas.h"
#include "skia/ext/skia_utils_mac.h"
@@ -291,8 +292,10 @@
@@ -292,8 +293,10 @@
void RenderWidgetHostViewMac::MigrateNSViewBridge(
remote_cocoa::mojom::Application* remote_cocoa_application,
uint64_t parent_ns_view_id) {
@@ -1042,7 +1042,7 @@ index 4ef475fb46fb12bc9f4dd8b17ab44568084932e4..a8c01d4ac0e60fc7427191d51ab51c42
// Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling
// pointers. `ns_view_` gets reinitialized later in this method.
@@ -1720,10 +1723,12 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -1721,10 +1724,12 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
gfx::NativeViewAccessible
RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
@@ -1055,7 +1055,7 @@ index 4ef475fb46fb12bc9f4dd8b17ab44568084932e4..a8c01d4ac0e60fc7427191d51ab51c42
return gfx::NativeViewAccessible([GetInProcessNSView() window]);
}
@@ -1775,9 +1780,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -1776,9 +1781,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
}
void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
@@ -1067,7 +1067,7 @@ index 4ef475fb46fb12bc9f4dd8b17ab44568084932e4..a8c01d4ac0e60fc7427191d51ab51c42
}
bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
@@ -2312,20 +2319,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
@@ -2308,20 +2315,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken(
GetRenderWidgetAccessibilityTokenCallback callback) {
base::ProcessId pid = getpid();
@@ -1107,10 +1107,10 @@ index 6294792999d1653b73c695ebfddda0f8a45d82c9..da6be02dcff5d956e69fa356ec6dea65
defines = []
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index a99405158fbecc5e08b334c4e40f40f51e92b2d9..f35b1a1a6c9c3a28573fee901652a55b82756cfd 100644
index f41d1a0ca0f0bfa2c817ec2571c996622ce68240..63ca31dc0d9e0daf971c7dbd85ac1c1982eeec91 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -322,6 +322,7 @@ target(link_target_type, "renderer") {
@@ -324,6 +324,7 @@ target(link_target_type, "renderer") {
"//ui/strings:auto_image_annotation_strings_grit",
"//url",
"//v8",
@@ -1308,18 +1308,18 @@ index 03a74b7d29f12be3a5d208b43beaa13f47a8e4a6..d36254ca28c1a3a4ef2b15cfbb327212
if (is_ios) {
sources += [ "image_transport_surface_ios.mm" ]
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
index 8b680a115718c94c9b8d7027594ac953daf201d7..20a973c240973f2fb2e782209e75da8799d90851 100644
index c2fd68d54df18eb544f9167870054aabbcc91623..915536753b3f3f61f370eee233c579cd14e4c19c 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
@@ -9,6 +9,7 @@
@@ -8,6 +8,7 @@
#include <vector>
#include "base/memory/weak_ptr.h"
#include "base/power_monitor/power_observer.h"
+#include "electron/mas.h"
#include "gpu/ipc/service/command_buffer_stub.h"
#include "gpu/ipc/service/image_transport_surface.h"
#include "ui/gfx/ca_layer_result.h"
@@ -28,7 +29,9 @@
@@ -27,7 +28,9 @@
#include <BrowserEngineKit/BrowserEngineKit.h>
#endif
@@ -1342,7 +1342,7 @@ index 2939a4183785608041041642ee81287d0fbd605d..89081a4d8e1dedbe8d45a824c5823601
if (is_ios) {
diff --git a/media/audio/apple/audio_low_latency_input.cc b/media/audio/apple/audio_low_latency_input.cc
index 02ddb6aedb21d85dfb7de91944198c291399063e..adb9c6165f52162b8fd84792c6b710034e263c4a 100644
index 7cd1fdaf15b847e5241144b47a47fe6c1d3907a5..004fd96906f258e193ed5acd80e2405db011e039 100644
--- a/media/audio/apple/audio_low_latency_input.cc
+++ b/media/audio/apple/audio_low_latency_input.cc
@@ -26,6 +26,7 @@
@@ -1974,7 +1974,7 @@ index 8542a74f1b0e90cd32c0220ef2e82c7763b1ee97..52c989796a2251b52615a04028fece39
// The root CALayer to display the current frame. This does not change
// over the lifetime of the object.
diff --git a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
index 00de2fe5bcc1bf45296f186d16b69ecf4215226c..9866fc255ebbe770928fcf9c3e694642b6629925 100644
index 3195cdaa3ff8310d01b37ceaedff9118cf8dbf22..4b086551497a2fcc6eef4c69f0ea5982b2ea0629 100644
--- a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
+++ b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
@@ -10,6 +10,7 @@
@@ -2002,9 +2002,9 @@ index 00de2fe5bcc1bf45296f186d16b69ecf4215226c..9866fc255ebbe770928fcf9c3e694642
CALayerTreeCoordinator::~CALayerTreeCoordinator() = default;
@@ -209,9 +212,13 @@
TRACE_EVENT_INSTANT("test_gpu", "SwapBuffers", "GLImpl",
static_cast<int>(gl::GetGLImplementation()), "width",
pixel_size_.width());
TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD,
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
"width", pixel_size_.width());
+#if !IS_MAS_BUILD()
if (allow_remote_layers_) {
params.ca_context_id = [ca_context_ contextId];
@@ -2016,7 +2016,7 @@ index 00de2fe5bcc1bf45296f186d16b69ecf4215226c..9866fc255ebbe770928fcf9c3e694642
if (io_surface) {
DCHECK(!allow_remote_layers_);
diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
index 862094f2f03a18b22bdfd5095731614fec6da795..8bb9f07b885919caceaf3bec2494375bb41d4d41 100644
index dcf493d62990018040a3f84b6f875af737bd2214..3d1c4dcc9ee0bbfdac15f40d9c74e9f342a59e39 100644
--- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm
+++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm
@@ -12,6 +12,7 @@
@@ -2027,7 +2027,7 @@ index 862094f2f03a18b22bdfd5095731614fec6da795..8bb9f07b885919caceaf3bec2494375b
#include "ui/base/cocoa/animation_utils.h"
#include "ui/base/cocoa/remote_layer_api.h"
#include "ui/gfx/geometry/dip_util.h"
@@ -120,6 +121,7 @@ - (void)setContentsChanged;
@@ -121,6 +122,7 @@ - (void)setContentsChanged;
}
void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) {
@@ -2035,7 +2035,7 @@ index 862094f2f03a18b22bdfd5095731614fec6da795..8bb9f07b885919caceaf3bec2494375b
// Early-out if the remote layer has not changed.
if (remote_layer_.contextId == ca_context_id) {
return;
@@ -149,6 +151,9 @@ - (void)setContentsChanged;
@@ -150,6 +152,9 @@ - (void)setContentsChanged;
[io_surface_layer_ removeFromSuperlayer];
io_surface_layer_ = nil;
}
@@ -2381,7 +2381,7 @@ index 1bd7242e935915d201aef63abe41a101c5b51fe9..c6ea05641c994b4bfe7f2eb839071e5a
sources += [
"test/desktop_window_tree_host_win_test_api.cc",
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
index 318bb37f5e065222104ef11c476f6bf7c2758ca1..a7aa661f94df2a435de6727ca89b69e686b92887 100644
index c087bf258c07537f589001cd1de9635823015812..7f0bf65efac90fb0d35e46a0a8171e05b7219348 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -19,6 +19,7 @@
@@ -2402,7 +2402,7 @@ index 318bb37f5e065222104ef11c476f6bf7c2758ca1..a7aa661f94df2a435de6727ca89b69e6
@class NSView;
namespace remote_cocoa {
@@ -517,10 +520,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
@@ -516,10 +519,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
remote_ns_window_remote_;
@@ -2416,7 +2416,7 @@ index 318bb37f5e065222104ef11c476f6bf7c2758ca1..a7aa661f94df2a435de6727ca89b69e6
// 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 68c472037d3e7f718e928ab8b9256877d247d66e..5f4d37702f25d3b05299562e56e764f3e4838a6a 100644
index 2914e7149f24fa903ca9861934a93e77f397e979..a258b94a8122c74b6f98f4b88b710371291fcfe4 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -22,6 +22,7 @@

View File

@@ -7,7 +7,7 @@ This adds a callback from the network service that's used to implement
session.setCertificateVerifyCallback.
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 92f7d50e82808628345f3b00d3aa3a9996d3bc84..a4baa7c363c02898f97c975767de98e5910142c5 100644
index 57155f8fe60279f1ac0c0cccf41ba4a468bf3bdb..2cd26265e717998c690aa277ff6ca6aac7b7ad0d 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -174,6 +174,11 @@
@@ -148,7 +148,7 @@ index 92f7d50e82808628345f3b00d3aa3a9996d3bc84..a4baa7c363c02898f97c975767de98e5
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -2785,6 +2902,10 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -2820,6 +2937,10 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
cert_verifier = std::make_unique<net::CachingCertVerifier>(
std::make_unique<net::CoalescingCertVerifier>(
std::move(cert_verifier)));
@@ -160,7 +160,7 @@ index 92f7d50e82808628345f3b00d3aa3a9996d3bc84..a4baa7c363c02898f97c975767de98e5
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
diff --git a/services/network/network_context.h b/services/network/network_context.h
index cecfe79a530c33972eb1ec066038cd93eee607f0..8fefa1f73342de4e3fba5189ba37fa8657218a4d 100644
index 6bdcb6fac47513e8c4c4b6d0e24c74a8baad2b37..b4239d2ed5632e9c93f3b395091344164b8468cb 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -123,6 +123,7 @@ class SimpleUrlPatternMatcher;
@@ -180,7 +180,7 @@ index cecfe79a530c33972eb1ec066038cd93eee607f0..8fefa1f73342de4e3fba5189ba37fa86
void ResetURLLoaderFactories() override;
void GetViaObliviousHttp(
mojom::ObliviousHttpRequestPtr request,
@@ -1007,6 +1010,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -1011,6 +1014,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::vector<base::OnceClosure> dismount_closures_;
#endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
@@ -190,7 +190,7 @@ index cecfe79a530c33972eb1ec066038cd93eee607f0..8fefa1f73342de4e3fba5189ba37fa86
std::unique_ptr<HostResolver> internal_host_resolver_;
std::set<std::unique_ptr<HostResolver>, base::UniquePtrComparator>
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 91fd7f0d38216b5ed33875fcf2595cb2384672ed..6c586cc768ca8ee67617e432edfbc02a2fae97e2 100644
index 20314a191f4ba858b374921230b940802aaee56a..a7bb27ab245729413b5624c382115a8072e764a5 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -331,6 +331,17 @@ struct SocketBrokerRemotes {
@@ -211,7 +211,7 @@ index 91fd7f0d38216b5ed33875fcf2595cb2384672ed..6c586cc768ca8ee67617e432edfbc02a
// Parameters for constructing a network context.
struct NetworkContextParams {
// The user agent string.
@@ -984,6 +995,9 @@ interface NetworkContext {
@@ -990,6 +1001,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);
@@ -222,7 +222,7 @@ index 91fd7f0d38216b5ed33875fcf2595cb2384672ed..6c586cc768ca8ee67617e432edfbc02a
CreateURLLoaderFactory(
pending_receiver<URLLoaderFactory> url_loader_factory,
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index d0614f3d775a21de62f5a486ab07b0875894e188..6b9cf7d98311a69ac613ea70ed56922cd60ed13e 100644
index 6bef01cbd02ba9bb665dcec76aa1eedd655ba56b..69a62289cf6a9eff3265b16ea4fdf3bee7efbc7d 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -63,6 +63,8 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -38,7 +38,7 @@ index a7a637438116a1c7846194dea4412100a45c9331..bb3877d546bfea141d3d6ebb396b88fa
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 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d62d7d1d62 100644
index 2e5fdf423033df2d669162407586088072bcc46f..562ff4ad0a37279baf6392e14a46d950cd3ff8ae 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -18,13 +18,17 @@
@@ -53,8 +53,8 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
+#if 0
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
#include "chrome/browser/ui/browser_window/public/global_browser_collection.h"
+#endif
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/back_to_tab_button.h"
@@ -87,8 +87,8 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
+#if 0
std::wstring app_user_model_id;
BrowserWindowInterface* browser =
GlobalBrowserCollection::GetInstance()->FindBrowserWithTab(
@@ -710,6 +716,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
chrome::FindBrowserWithTab(controller->GetWebContents());
@@ -709,6 +715,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
}
case ui::EventType::kMousePressed:
@@ -96,7 +96,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
// Hide the live caption dialog if it's visible and the user clicks
// outside of it.
if (live_caption_dialog_ && live_caption_dialog_->GetVisible() &&
@@ -718,6 +725,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
@@ -717,6 +724,7 @@ void VideoOverlayWindowViews::OnMouseEvent(ui::MouseEvent* event) {
SetLiveCaptionDialogVisibility(false);
return;
}
@@ -104,7 +104,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
break;
default:
@@ -753,11 +761,11 @@ bool VideoOverlayWindowViews::HideLiveCaptionDialogForGestureIfNecessary(
@@ -752,11 +760,11 @@ bool VideoOverlayWindowViews::HideLiveCaptionDialogForGestureIfNecessary(
if (event->type() != ui::EventType::kGestureTap) {
return false;
}
@@ -118,7 +118,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
if (!GetLiveCaptionDialogBounds().Contains(event->location())) {
SetLiveCaptionDialogVisibility(false);
event->SetHandled();
@@ -1244,6 +1252,7 @@ void VideoOverlayWindowViews::SetUpViews() {
@@ -1243,6 +1251,7 @@ void VideoOverlayWindowViews::SetUpViews() {
timestamp->SetBackgroundColor(SK_ColorTRANSPARENT);
timestamp->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -126,7 +126,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
auto live_status = std::make_unique<views::Label>(
l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_LIVE_STATUS_TEXT),
views::style::CONTEXT_LABEL, views::style::STYLE_CAPTION_BOLD);
@@ -1263,6 +1272,7 @@ void VideoOverlayWindowViews::SetUpViews() {
@@ -1262,6 +1271,7 @@ void VideoOverlayWindowViews::SetUpViews() {
Profile::FromBrowserContext(
controller_->GetWebContents()->GetBrowserContext()));
live_caption_dialog->SetVisible(false);
@@ -134,7 +134,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
auto toggle_microphone_button =
std::make_unique<ToggleMicrophoneButton>(base::BindRepeating(
@@ -1396,13 +1406,15 @@ void VideoOverlayWindowViews::SetUpViews() {
@@ -1395,13 +1405,15 @@ void VideoOverlayWindowViews::SetUpViews() {
timestamp_ =
playback_controls_container_view_->AddChildView(std::move(timestamp));
@@ -151,7 +151,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
toggle_camera_button_ = vc_controls_container_view_->AddChildView(
std::move(toggle_camera_button));
@@ -1686,6 +1698,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
@@ -1685,6 +1697,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
timestamp_->SetSize({max_timestamp_width, kTimestampHeight});
timestamp_->SetVisible(!is_live_);
@@ -159,7 +159,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
live_status_->SetPosition(timestamp_position);
live_status_->SetMaximumWidthSingleLine(max_timestamp_width);
live_status_->SetSize(
@@ -1693,7 +1706,6 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
@@ -1692,7 +1705,6 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
.width(),
kTimestampHeight});
live_status_->SetVisible(is_live_);
@@ -167,7 +167,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
gfx::Rect live_caption_button_bounds(
bottom_controls_bounds.right() - kBottomControlsHorizontalMargin -
kActionButtonSize.width(),
@@ -1712,7 +1724,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
@@ -1711,7 +1723,7 @@ void VideoOverlayWindowViews::OnUpdateControlsBounds() {
live_caption_dialog_->SetPosition(
{live_caption_button_bounds.right() - live_caption_dialog_->width(),
live_caption_button_bounds.y() - live_caption_dialog_->height()});
@@ -176,7 +176,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
// The play/pause button and replay/forward 10 seconds buttons should not be
// visible while dragging the progress bar or for live media.
const bool is_dragging_progress_bar =
@@ -2141,14 +2153,20 @@ gfx::Rect VideoOverlayWindowViews::GetProgressViewBounds() {
@@ -2140,14 +2152,20 @@ gfx::Rect VideoOverlayWindowViews::GetProgressViewBounds() {
}
gfx::Rect VideoOverlayWindowViews::GetLiveCaptionButtonBounds() {
@@ -197,7 +197,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
}
gfx::Rect VideoOverlayWindowViews::GetToggleMuteButtonBounds() {
@@ -2160,6 +2178,7 @@ gfx::Rect VideoOverlayWindowViews::GetToggleMuteButtonBounds() {
@@ -2159,6 +2177,7 @@ gfx::Rect VideoOverlayWindowViews::GetToggleMuteButtonBounds() {
bool VideoOverlayWindowViews::HasHighMediaEngagement(
const url::Origin& origin) const {
@@ -205,7 +205,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
MediaEngagementService* service =
MediaEngagementService::Get(Profile::FromBrowserContext(
GetController()->GetWebContents()->GetBrowserContext()));
@@ -2168,6 +2187,8 @@ bool VideoOverlayWindowViews::HasHighMediaEngagement(
@@ -2167,6 +2186,8 @@ bool VideoOverlayWindowViews::HasHighMediaEngagement(
}
return service->HasHighEngagement(origin);
@@ -214,7 +214,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
}
bool VideoOverlayWindowViews::IsTrustedForMediaPlayback() const {
@@ -2434,11 +2455,14 @@ void VideoOverlayWindowViews::UpdateTimestampLabel(base::TimeDelta current_time,
@@ -2433,11 +2454,14 @@ void VideoOverlayWindowViews::UpdateTimestampLabel(base::TimeDelta current_time,
}
void VideoOverlayWindowViews::OnLiveCaptionButtonPressed() {
@@ -229,7 +229,7 @@ index 2d97ec9d47de4d2624e3b40cdaf7c07b9d862a90..15b35792469aca29900025733fbcc9d6
if (wanted_visibility == live_caption_dialog_->GetVisible()) {
return;
}
@@ -2466,6 +2490,7 @@ void VideoOverlayWindowViews::SetLiveCaptionDialogVisibility(
@@ -2465,6 +2489,7 @@ void VideoOverlayWindowViews::SetLiveCaptionDialogVisibility(
if (toggle_mute_button_) {
toggle_mute_button_->SetEnabled(!wanted_visibility);
}

View File

@@ -165,7 +165,7 @@ index 2448abf73b097f04583aefda1fb1a67b3de67e5b..55f935f38bf05586650e7a83a689347b
int dir_mode = 0;
CHECK(base::GetPosixFilePermissions(socket_dir_.GetPath(), &dir_mode) &&
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 026f480ebe1d47af8b949d6a076a2d053022bda2..6687bcd53ab8dca1bc7b96446fdd673ed9d1a5da 100644
index 98918bf5ed23798669251bee846aea4255ee9b7c..f4d38a27eb3123ac4bca19de15e8b6184e5faf92 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -29,7 +29,9 @@

View File

@@ -30,7 +30,7 @@ index d83118cbc1e4c1ecf4ba3f4df2d730800c5cf7dd..37b9dde276f27ce6aa8c7e8e5ecb9fba
// 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 c6c936a0b57cedbb761f6e9f31cb860c3bf245ed..d6b134d37a260b578ea5cacf65c829825635c570 100644
index 91f5aa62f256a061199e7091069607ceafc02e0d..a5c13ea50845fede85741de7a6f3b1c327698110 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2076,6 +2076,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
@@ -44,10 +44,10 @@ index c6c936a0b57cedbb761f6e9f31cb860c3bf245ed..d6b134d37a260b578ea5cacf65c82982
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 260ec31380c64e96dc8da4e3f6359bdef1b79d52..e7769a0fa1e6534e45126d14e5f2e1e120a03b86 100644
index 86273f84bf55276c3b6ae91397332a019874c2af..361b34906ea017c1209899b9f0fec5e43f747f7e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -6358,6 +6358,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -6349,6 +6349,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}

View File

@@ -8,7 +8,7 @@ it in Electron and prevent drift from Chrome's blocklist. We should look for a w
to upstream this change to Chrome.
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
index 05a3746627fe63e8adc1605848039ef9742fd244..1a3db07bad2282222ff49fb4a16edb7df2a3a95c 100644
index 434db30ba5d8853147f36513049feb8b7f2e2fe1..2deaf6a1a187023febfff7398e20dea15bd18be9 100644
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc
@@ -84,11 +84,13 @@
@@ -139,7 +139,7 @@ index 05a3746627fe63e8adc1605848039ef9742fd244..1a3db07bad2282222ff49fb4a16edb7d
- // installed (sandboxed) application. It would be nice to limit a site to
- // access only _its_ corresponding natively installed application, but
- // unfortunately there's no straightforward way to do that. See
- // https://crbug.com/40095723#comment23.
- // https://crbug.com/40095723#c22.
- BlockPath::CreateRelative(base::DIR_HOME,
- FILE_PATH_LITERAL("Library/Containers"),
- BlockType::kDontBlockChildren),
@@ -270,7 +270,7 @@ index 05a3746627fe63e8adc1605848039ef9742fd244..1a3db07bad2282222ff49fb4a16edb7d
auto* provider = web_app::WebAppProvider::GetForWebApps(
Profile::FromBrowserContext(profile_));
if (provider) {
@@ -2910,7 +2698,7 @@ void ChromeFileSystemAccessPermissionContext::OnShutdown() {
@@ -2909,7 +2697,7 @@ void ChromeFileSystemAccessPermissionContext::OnShutdown() {
one_time_permissions_tracker_.Reset();
}
@@ -279,7 +279,7 @@ index 05a3746627fe63e8adc1605848039ef9742fd244..1a3db07bad2282222ff49fb4a16edb7d
void ChromeFileSystemAccessPermissionContext::OnWebAppInstalled(
const webapps::AppId& app_id) {
if (!base::FeatureList::IsEnabled(
@@ -3268,11 +3056,7 @@ bool ChromeFileSystemAccessPermissionContext::
@@ -3267,11 +3055,7 @@ bool ChromeFileSystemAccessPermissionContext::
HandleType handle_type,
UserAction user_action,
GrantType grant_type) {
@@ -292,7 +292,7 @@ index 05a3746627fe63e8adc1605848039ef9742fd244..1a3db07bad2282222ff49fb4a16edb7d
if (!base::FeatureList::IsEnabled(
features::kFileSystemAccessPersistentPermissions)) {
return false;
@@ -3323,6 +3107,7 @@ bool ChromeFileSystemAccessPermissionContext::
@@ -3322,6 +3106,7 @@ bool ChromeFileSystemAccessPermissionContext::
return false;
#endif // BUILDFLAG(IS_ANDROID)
@@ -301,7 +301,7 @@ index 05a3746627fe63e8adc1605848039ef9742fd244..1a3db07bad2282222ff49fb4a16edb7d
std::vector<FileRequestData> ChromeFileSystemAccessPermissionContext::
diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
index 4111e2c0098402e8befe192d35458b5124639713..956e285889efc1ac0547efaff03d5572a898511c 100644
index 4111e2c0098402e8befe192d35458b5124639713..dc5988381cead59b704e7ca2b7629a18738d7437 100644
--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.h
@@ -10,10 +10,13 @@
@@ -444,7 +444,7 @@ index 4111e2c0098402e8befe192d35458b5124639713..956e285889efc1ac0547efaff03d5572
+ // installed (sandboxed) application. It would be nice to limit a site to
+ // access only _its_ corresponding natively installed application, but
+ // unfortunately there's no straightforward way to do that. See
+ // https://crbug.com/40095723#comment23.
+ // https://crbug.com/40095723#c22.
+ BlockPath::CreateRelative(base::DIR_HOME,
+ FILE_PATH_LITERAL("Library/Containers"),
+ BlockType::kDontBlockChildren),

View File

@@ -7,11 +7,11 @@ Subject: refactor: expose HostImportModuleDynamically and
This is so that Electron can blend Blink's and Node's implementations of these isolate handlers.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index ea4a2faa2f60632301c084beaeeb58c3e2eaca40..f771deade22c86ca78ba281563921ebc55a065fd 100644
index 5fd388fba60b28ed833dbbffc47c285912a33809..7affef58358092094f1b3848bb75881c556dc32d 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -737,8 +737,9 @@ bool WasmCustomDescriptorsEnabledCallback(v8::Local<v8::Context> context) {
return RuntimeEnabledFeatures::WebAssemblyCustomDescriptorsV2Enabled(
return RuntimeEnabledFeatures::WebAssemblyCustomDescriptorsEnabled(
execution_context);
}
+} // namespace

View File

@@ -6,10 +6,10 @@ Subject: refactor: patch electron PermissionTypes into blink
6387077: [PermissionOptions] Generalize PermissionRequestDescription | https://chromium-review.googlesource.com/c/chromium/src/+/6387077
diff --git a/components/permissions/permission_util.cc b/components/permissions/permission_util.cc
index 24f75cbada86669028e5e40fe7b62c01e8316121..f07c7991934c8697ad73b2d7c3b86d110e0cab99 100644
index 66e2e0f8f39994dfe33c923d62fe791d5181d207..ed3af30b66d331e2af9df1bbcb496bc087568110 100644
--- a/components/permissions/permission_util.cc
+++ b/components/permissions/permission_util.cc
@@ -567,9 +567,17 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingsTypeSafe(
@@ -566,9 +566,17 @@ ContentSettingsType PermissionUtil::PermissionTypeToContentSettingsTypeSafe(
return ContentSettingsType::LOCAL_NETWORK;
case PermissionType::LOOPBACK_NETWORK:
return ContentSettingsType::LOOPBACK_NETWORK;

View File

@@ -15,10 +15,10 @@ This CL removes these filters so the unresponsive event can still be
accessed from our JS event. The filtering is moved into Electron's code.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3c5b92660ef7fea6c5c8366009f223ffd0052dad..2c5ba252480912cbfdd26df681f16619822f92a0 100644
index 4daac586a6f01799f2f04b9206f7f6a53bc42054..4c54077bf42cc2dd29d828549126eadfdf681a84 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -10630,25 +10630,13 @@ void WebContentsImpl::RendererUnresponsive(
@@ -10621,25 +10621,13 @@ void WebContentsImpl::RendererUnresponsive(
base::RepeatingClosure hang_monitor_restarter) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
"render_widget_host", render_widget_host);

View File

@@ -8,7 +8,7 @@ respond to the first mouse click in their window, which is desirable for some
kinds of utility windows. Similarly for `disableAutoHideCursor`.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index ac67f346c4662b05e63576a092efa1f1af9d83cc..989b11c5b67343fbb03bb849e1b3febd6167a00e 100644
index 75de452a5f78705a544402fb3a639344665d7ff4..664e12c07204feeb5be16581fe51e8adc4b898dd 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -179,6 +179,15 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -38,7 +38,7 @@ index ac67f346c4662b05e63576a092efa1f1af9d83cc..989b11c5b67343fbb03bb849e1b3febd
// Enable "click-through" if mouse clicks are accepted in inactive windows.
return
[self acceptsMouseEventsOption] > AcceptMouseEvents::kWhenInActiveWindow;
@@ -977,6 +990,8 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
@@ -963,6 +976,8 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
// its parent view.
BOOL hitSelf = NO;
while (view) {
@@ -47,7 +47,7 @@ index ac67f346c4662b05e63576a092efa1f1af9d83cc..989b11c5b67343fbb03bb849e1b3febd
if (view == self)
hitSelf = YES;
if ([view isKindOfClass:[self class]] && ![view isEqual:self] &&
@@ -1362,6 +1377,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
@@ -1337,6 +1352,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
eventType == NSEventTypeKeyDown &&
!(modifierFlags & NSEventModifierFlagCommand);

View File

@@ -52,10 +52,10 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index e00f78b4eb1c364028312c57629c74234265306e..3497a3bec7f0f899c65593fa5a69913d54257ea2 100644
index a2fe0be293dfe7c0633651e64da1320047d102bb..171faeaa1c3ba08cc0cd166b492765c8204bb674 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1557,7 +1557,7 @@ if (is_chrome_branded && !is_android) {
@@ -1565,7 +1565,7 @@ if (is_chrome_branded && !is_android) {
}
}
@@ -64,7 +64,7 @@ index e00f78b4eb1c364028312c57629c74234265306e..3497a3bec7f0f899c65593fa5a69913d
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1585,6 +1585,12 @@ repack("browser_tests_pak") {
@@ -1593,6 +1593,12 @@ repack("browser_tests_pak") {
deps = [ "//chrome/test/data/webui:resources" ]
}

View File

@@ -39,7 +39,7 @@ index 37b9dde276f27ce6aa8c7e8e5ecb9fba05324ca6..56df8d4d5db8b68f3a0b043096065aaf
// event before sending it to the renderer. See enum for details on return
// value.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 3a08cff7683fcd842a87e78ff132cc9da3be2038..08abfb5d32a58d50391758065b08e2ca55c89acc 100644
index 50edc218dc16c85c3c870c744b9c14936a0e99d2..92d8b68a76cfba407b3337693718121c4edf9fbf 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1572,6 +1572,10 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
@@ -54,7 +54,7 @@ index 3a08cff7683fcd842a87e78ff132cc9da3be2038..08abfb5d32a58d50391758065b08e2ca
if (mouse_event_callback.Run(mouse_event)) {
return;
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2c5ba252480912cbfdd26df681f16619822f92a0..5cdee649a7a7691a431321287edb51feb15915aa 100644
index 4c54077bf42cc2dd29d828549126eadfdf681a84..29f188d6ba176fc0c1c0c55b26c25d061510953a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4577,6 +4577,12 @@ void WebContentsImpl::RenderWidgetWasResized(
@@ -83,7 +83,7 @@ index bc8741ce88185df359c65c062b283089fc3c1785..a0c742b20989853b22f86173bab7702f
const gfx::PointF& client_pt);
void PreHandleDragExit();
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
index fd840b5de8945d91f218e66009f6c13f4e85e832..e6be991b8faa75f8276e38474cdbdb88462bdf46 100644
index 95007b7a5f40da2e23053f52da79295a829d3bde..7ec19ac77a78fd7dd1a6ddeb2f248eb8d86f16ce 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -127,6 +127,12 @@ bool WebContentsDelegate::HandleContextMenu(RenderFrameHost& render_frame_host,
@@ -100,7 +100,7 @@ index fd840b5de8945d91f218e66009f6c13f4e85e832..e6be991b8faa75f8276e38474cdbdb88
WebContents* source,
const input::NativeWebKeyboardEvent& event) {
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index b9b59c92a0d69baed2241ca1686d490bba8e087b..cbdc25cc215d8d46d2d3e7122d44ab12107409e6 100644
index ceb6c66f6461b42556aaba167269811a9a363b40..0ffc73449f86846f20225898d13c5243647aefe6 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -326,6 +326,13 @@ class CONTENT_EXPORT WebContentsDelegate {

View File

@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
Patch to make scrollBounce option work.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 55bb42094ebf3ac1a8ba0b7c552122e50372114d..47b3a36385819ebcb407e21256680d6814e598bc 100644
index 8d193858877a410e00551622c37d0e10db98bf6c..15fca2fafa11588af102cdbe03af761c383a9e21 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1150,11 +1150,11 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
@@ -1145,11 +1145,11 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
}
bool RenderThreadImpl::IsElasticOverscrollEnabledOnRoot() {

View File

@@ -9,7 +9,7 @@ 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 ecec29a59aac1dd775746884f20cfc53ac64c23f..0754fde0ee1ec5e01f199e90169e0dbae6b5b657 100644
index adee34e64400f08dece1bef4f36ab9b93332696d..bcb3d2eabc99b3206a2195239d4c8fa0793dccd4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4296,6 +4296,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,

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 0c1d88e2bcb6d86d5a007009116c1db818d40dcd..22fb6c91dac0178c4ea23463c33bb0a6dfd0a377 100644
index 944bb9ee39682f4e623477f98b1c407b0c6b0d6a..c29ece68e6fa5344e20db967b4acaf5229e9a8df 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -9245,6 +9245,17 @@ void RenderFrameHostImpl::EnterFullscreen(
@@ -9293,6 +9293,17 @@ void RenderFrameHostImpl::EnterFullscreen(
}
}
@@ -37,7 +37,7 @@ index 0c1d88e2bcb6d86d5a007009116c1db818d40dcd..22fb6c91dac0178c4ea23463c33bb0a6
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 0754fde0ee1ec5e01f199e90169e0dbae6b5b657..341b0e45af39357af676ce3c3775462e6192b857 100644
index bcb3d2eabc99b3206a2195239d4c8fa0793dccd4..db97c490b1979916b7c32175e1f50f463a5e7722 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4594,21 +4594,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(

View File

@@ -7,10 +7,10 @@ This allows us to show Chrome extension panels on pages served over
custom protocols.
diff --git a/front_end/core/root/Runtime.ts b/front_end/core/root/Runtime.ts
index ce026caefa7b483a76a28c25e90ffe698138d461..04f2fb387539b2874466ab9305355b230c511b39 100644
index 747706050ed526b7ce9fd447a4034b6a9b64db7f..f39ad77366375bd4a428f78979f1847002f6bdbb 100644
--- a/front_end/core/root/Runtime.ts
+++ b/front_end/core/root/Runtime.ts
@@ -668,6 +668,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
@@ -649,6 +649,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
* or guest mode, rather than a "normal" profile.
*/
isOffTheRecord: boolean,

View File

@@ -15,7 +15,7 @@ Rather than disabling builtins PGO entirely, warn and skip mismatched
builtins so all other builtins still benefit from PGO.
diff --git a/BUILD.gn b/BUILD.gn
index b60ba2b7d79984c9e54d3eefa66d7a636e3426c1..65e72f089a7acc8af0e686d619d5187a5f2aaf73 100644
index ebff41d33352be25a548efcbacdc97ae6494b416..0af77eb0b597022b3d8262b6eb76c0bdf38a61ce 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2825,9 +2825,11 @@ template("run_mksnapshot") {

View File

@@ -89,13 +89,6 @@ async function uploadObjectChangeStats(stats) {
unit: 'byte',
tags
},
{
metric: 'electron.build.object-total-size',
points: [{ timestamp, value: stats['total-size'] }],
type: 3, // GAUGE
unit: 'byte',
tags
},
{
metric: 'electron.build.new-object-count',
points: [{ timestamp, value: stats['new-object-count'] }],
@@ -181,10 +174,7 @@ async function main() {
const checksums = {};
for (const file of objectFiles) {
const content = await fs.readFile(resolve(outDir, file));
checksums[file] = {
size: content.byteLength,
checksum: createHash('sha256').update(content).digest('hex')
};
checksums[file] = createHash('sha256').update(content).digest('hex');
}
if (outputObjectChecksums) {
@@ -203,20 +193,13 @@ async function main() {
let newObjectCount = 0;
let changedSize = 0;
// Previously filenames mapped directly to checksum values, but now
// they map to objects containing both checksum and size. Handle both
// formats for backwards compatibility.
const getInputChecksum = (file) => {
const value = inputData.checksums[file];
return typeof value === 'string' ? value : value.checksum;
};
// Count changed files (only those present in both input and current)
for (const file of inputFiles) {
if (!(file in checksums)) continue; // Skip deleted files
if (getInputChecksum(file) !== checksums[file].checksum) {
if (inputData.checksums[file] !== checksums[file]) {
changedCount++;
changedSize += checksums[file].size;
const stat = await fs.stat(resolve(outDir, file));
changedSize += stat.size;
}
}
@@ -224,22 +207,20 @@ async function main() {
for (const file of Object.keys(checksums)) {
if (!(file in inputData.checksums)) {
newObjectCount++;
changedSize += checksums[file].size;
const stat = await fs.stat(resolve(outDir, file));
changedSize += stat.size;
}
}
const changeRate = inputFiles.length > 0 ? changedCount / inputFiles.length : 0;
const totalSize = Object.values(checksums).reduce((sum, { size }) => sum + size, 0);
console.log(`${messagePrefix}Object change rate: ${(changeRate * 100).toFixed(2)}%`);
if (newObjectCount > 0) {
console.log(`${messagePrefix}New object count: ${newObjectCount}`);
}
console.log(`${messagePrefix}Cumulative changed object sizes: ${changedSize.toLocaleString()} bytes`);
console.log(`${messagePrefix}Total object sizes: ${totalSize.toLocaleString()} bytes`);
objectChangeStats['change-rate'] = changeRate;
objectChangeStats['change-size'] = changedSize;
objectChangeStats['total-size'] = totalSize;
objectChangeStats['new-object-count'] = newObjectCount;
objectChangeStats['previous-chromium-version'] = inputData.chromiumVersion;
objectChangeStats['chromium-version'] = currentVersion;

View File

@@ -1881,9 +1881,11 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
.SetMethod(
"removeAsDefaultProtocolClient",
base::BindRepeating(&Browser::RemoveAsDefaultProtocolClient, browser))
#if !BUILDFLAG(IS_LINUX)
.SetMethod(
"getApplicationInfoForProtocol",
base::BindRepeating(&Browser::GetApplicationInfoForProtocol, browser))
#endif
.SetMethod(
"getApplicationNameForProtocol",
base::BindRepeating(&Browser::GetApplicationNameForProtocol, browser))

View File

@@ -240,10 +240,7 @@ class DesktopCapturer::ListObserver : public DesktopMediaListObserver {
ListObserver(DesktopCapturer* capturer,
DesktopMediaList* list,
bool need_thumbnails)
: capturer_{capturer},
list_{list},
list_type_{list->GetMediaListType()},
need_thumbnails_{need_thumbnails} {}
: capturer_{capturer}, list_{list}, need_thumbnails_{need_thumbnails} {}
~ListObserver() override = default;
[[nodiscard]] bool IsReady() const {
@@ -270,7 +267,7 @@ class DesktopCapturer::ListObserver : public DesktopMediaListObserver {
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE,
base::BindOnce(&DesktopCapturer::OnListReady,
capturer_->weak_ptr_factory_.GetWeakPtr(), list_type_));
capturer_->weak_ptr_factory_.GetWeakPtr(), list_.get()));
}
// DesktopMediaListObserver:
@@ -297,7 +294,6 @@ class DesktopCapturer::ListObserver : public DesktopMediaListObserver {
raw_ptr<DesktopCapturer> capturer_;
raw_ptr<DesktopMediaList> list_;
DesktopMediaList::Type list_type_;
bool need_thumbnails_ = false;
bool has_sources_ = false;
bool notified_ = false;
@@ -414,21 +410,16 @@ void DesktopCapturer::StartHandling(bool capture_window,
weak_ptr_factory_.GetWeakPtr()));
}
void DesktopCapturer::OnListReady(const DesktopMediaList::Type type) {
void DesktopCapturer::OnListReady(DesktopMediaList* list) {
if (finished_)
return;
switch (type) {
case DesktopMediaList::Type::kWindow:
if (window_capturer_)
FinalizeList(window_observer_, window_capturer_);
break;
case DesktopMediaList::Type::kScreen:
if (screen_capturer_)
FinalizeList(screen_observer_, screen_capturer_);
break;
default:
NOTREACHED();
if (list == window_capturer_.get()) {
FinalizeList(window_observer_, window_capturer_);
} else if (list == screen_capturer_.get()) {
FinalizeList(screen_observer_, screen_capturer_);
} else {
NOTREACHED();
}
}

View File

@@ -63,7 +63,7 @@ class DesktopCapturer final
void FinalizeList(std::unique_ptr<ListObserver>& observer,
std::unique_ptr<DesktopMediaList>& list);
void OnListReady(DesktopMediaList::Type type);
void OnListReady(DesktopMediaList* list);
void OnReadyTimeout();
void CollectSourcesFrom(DesktopMediaList* list);
void HandleFailure();

View File

@@ -88,8 +88,6 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "printing/buildflags/buildflags.h"
#include "services/network/public/cpp/web_sandbox_flags.h"
#include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h"
#include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "shell/browser/api/electron_api_browser_window.h"
@@ -158,7 +156,6 @@
#include "third_party/blink/public/common/page/page_zoom.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
#include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h"
@@ -1400,26 +1397,6 @@ content::WebContents* WebContents::OpenURLFromTab(
navigation_handle_callback) {
auto weak_this = GetWeakPtr();
if (params.disposition != WindowOpenDisposition::CURRENT_TAB) {
content::FrameTreeNode* initiator =
params.frame_tree_node_id ? content::FrameTreeNode::GloballyFindByID(
params.frame_tree_node_id)
: nullptr;
if (initiator && !initiator->IsMainFrame()) {
using SandboxFlags = network::mojom::WebSandboxFlags;
const SandboxFlags flags = initiator->active_sandbox_flags();
auto allow = [flags](SandboxFlags flag) {
return (flags & flag) == SandboxFlags::kNone;
};
if (!allow(SandboxFlags::kPopups)) {
if (auto* rfh = initiator->current_frame_host()) {
rfh->AddMessageToConsole(
blink::mojom::ConsoleMessageLevel::kError,
"Blocked opening a new window because the iframe is sandboxed "
"and the 'allow-popups' keyword is not set.");
}
return nullptr;
}
}
Emit("-new-window", params.url, "", params.disposition, "", params.referrer,
params.post_data);
return nullptr;

View File

@@ -161,9 +161,11 @@ class Browser : private WindowListObserver {
std::u16string GetApplicationNameForProtocol(const GURL& url);
#if !BUILDFLAG(IS_LINUX)
// get the name, icon and path for an application
v8::Local<v8::Promise> GetApplicationInfoForProtocol(v8::Isolate* isolate,
const GURL& url);
#endif
// Set/Get the badge count.
bool SetBadgeCount(std::optional<int> count);

View File

@@ -4,11 +4,6 @@
#include "shell/browser/browser.h"
#include <fcntl.h>
#include <stdlib.h>
#include <string_view>
#if BUILDFLAG(IS_LINUX)
#include <gio/gdesktopappinfo.h>
#include <gio/gio.h>
@@ -16,7 +11,6 @@
#endif
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "electron/electron_version.h"
@@ -24,18 +18,7 @@
#include "shell/browser/native_window.h"
#include "shell/browser/window_list.h"
#include "shell/common/application_info.h"
#include "shell/common/gin_converters/image_converter.h"
#include "shell/common/gin_converters/login_item_settings_converter.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/thread_restrictions.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/glib/glib_cast.h"
#include "ui/base/glib/scoped_gobject.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gtk/gtk_compat.h" // nogncheck
#include "ui/gtk/gtk_util.h" // nogncheck
#if BUILDFLAG(IS_LINUX)
#include "shell/browser/linux/unity_service.h"
@@ -67,101 +50,6 @@ bool SetDefaultWebClient(const std::string& protocol) {
return success;
}
[[nodiscard]] ScopedGObject<GAppInfo> GetAppInfoForProtocol(const GURL& url) {
const auto scheme = std::string{url.scheme()}; // gio can't use string_views
return TakeGObject(g_app_info_get_default_for_uri_scheme(scheme.c_str()));
}
[[nodiscard]] std::optional<base::FilePath> ResolveExecutablePath(
const char* const executable) {
if (executable == nullptr || *executable == '\0')
return {};
if (auto path = base::FilePath::FromUTF8Unsafe(executable); path.IsAbsolute())
return path;
gchar* const found = g_find_program_in_path(executable);
if (!found)
return {};
const auto path = base::FilePath::FromUTF8Unsafe(found);
g_free(found);
return path;
}
[[nodiscard]] gfx::Image GetApplicationIcon(GAppInfo* const app_info) {
constexpr int kIconSize = 32;
GIcon* const icon = g_app_info_get_icon(app_info);
if (!icon)
return {};
// Note: this gtk3/gtk4 + icon theme lookup + snapshot control flow
// is copied from GtkUi::GetIconForContentType(). We couldn't use it
// here because it gets its GIcon from a different place than us.
SkBitmap bitmap;
if (gtk::GtkCheckVersion(4)) {
const auto icon_paintable = gtk::Gtk4IconThemeLookupByGicon(
gtk::GetDefaultIconTheme(), icon, kIconSize, 1, GTK_TEXT_DIR_NONE,
static_cast<GtkIconLookupFlags>(0));
if (!icon_paintable)
return {};
auto* const paintable =
GlibCast<GdkPaintable>(icon_paintable.get(), gdk_paintable_get_type());
auto* const snapshot = gtk_snapshot_new();
gdk_paintable_snapshot(paintable, snapshot, kIconSize, kIconSize);
auto* const node = gtk_snapshot_free_to_node(snapshot);
GdkTexture* const texture = gtk::GetTextureFromRenderNode(node);
if (!texture) {
gsk_render_node_unref(node);
return {};
}
bitmap.allocN32Pixels(gdk_texture_get_width(texture),
gdk_texture_get_height(texture));
gdk_texture_download(texture, static_cast<guchar*>(bitmap.getAddr(0, 0)),
bitmap.rowBytes());
gsk_render_node_unref(node);
} else {
const auto icon_info = gtk::Gtk3IconThemeLookupByGiconForScale(
gtk::GetDefaultIconTheme(), icon, kIconSize, 1,
static_cast<GtkIconLookupFlags>(GTK_ICON_LOOKUP_FORCE_SIZE));
if (!icon_info)
return {};
auto* const surface =
gtk_icon_info_load_surface(icon_info.get(), nullptr, nullptr);
if (!surface)
return {};
DCHECK_EQ(cairo_surface_get_type(surface), CAIRO_SURFACE_TYPE_IMAGE);
DCHECK_EQ(cairo_image_surface_get_format(surface), CAIRO_FORMAT_ARGB32);
const SkImageInfo image_info =
SkImageInfo::Make(cairo_image_surface_get_width(surface),
cairo_image_surface_get_height(surface),
kBGRA_8888_SkColorType, kUnpremul_SkAlphaType);
if (!bitmap.installPixels(
image_info, cairo_image_surface_get_data(surface),
image_info.minRowBytes(),
[](void*, void* surface_ptr) {
cairo_surface_destroy(
reinterpret_cast<cairo_surface_t*>(surface_ptr));
},
surface)) {
return {};
}
}
gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
if (image_skia.isNull())
return {};
image_skia.MakeThreadSafe();
return gfx::Image(image_skia);
}
} // namespace
void Browser::AddRecentDocument(const base::FilePath& path) {}
@@ -207,53 +95,15 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
}
std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) {
auto app_info = GetAppInfoForProtocol(url);
const auto scheme = std::string{url.scheme()}; // gio can't use string_view
auto* app_info = g_app_info_get_default_for_uri_scheme(scheme.c_str());
if (!app_info)
return {};
const char* const name = g_app_info_get_display_name(app_info);
return base::UTF8ToUTF16(name);
}
v8::Local<v8::Promise> Browser::GetApplicationInfoForProtocol(
v8::Isolate* const isolate,
const GURL& url) {
gin_helper::Promise<gin_helper::Dictionary> promise(isolate);
const v8::Local<v8::Promise> handle = promise.GetHandle();
auto app_info = GetAppInfoForProtocol(url);
if (!app_info) {
promise.RejectWithErrorMessage(
"Unable to retrieve installation path to app");
return handle;
}
const char* const executable = g_app_info_get_executable(app_info);
const auto app_path = ResolveExecutablePath(executable);
if (!app_path) {
promise.RejectWithErrorMessage(
"Unable to retrieve installation path to app");
return handle;
}
const char* const app_display_name = g_app_info_get_display_name(app_info);
if (!app_display_name || app_display_name[0] == '\0') {
promise.RejectWithErrorMessage("Unable to retrieve display name of app");
return handle;
}
const gfx::Image app_icon = GetApplicationIcon(app_info);
if (app_icon.IsEmpty()) {
promise.RejectWithErrorMessage("Failed to get file icon.");
return handle;
}
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("name", base::UTF8ToUTF16(app_display_name));
dict.Set("path", app_path->value());
dict.Set("icon", app_icon);
promise.Resolve(dict);
return handle;
const std::u16string u16name = base::UTF8ToUTF16(name);
g_object_unref(app_info);
return u16name;
}
bool Browser::SetBadgeCount(std::optional<int> count) {

View File

@@ -299,7 +299,7 @@ RenderProcessHostPrivilege GetProcessPrivilege(
content::RenderProcessHost* process_host,
extensions::ProcessMap* process_map) {
std::optional<extensions::ExtensionId> extension_id =
process_map->GetExtensionIdForProcess(process_host->GetID());
process_map->GetExtensionIdForProcess(process_host->GetDeprecatedID());
if (!extension_id.has_value())
return RenderProcessHostPrivilege::kNormal;
@@ -772,7 +772,8 @@ void ElectronBrowserClient::SiteInstanceGotProcessAndSite(
return;
extensions::ProcessMap::Get(browser_context)
->Insert(extension->id(), site_instance->GetProcess()->GetID());
->Insert(extension->id(),
site_instance->GetProcess()->GetDeprecatedID());
}
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
}

View File

@@ -33,7 +33,7 @@
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/chrome_url_overrides_handler.h"
#include "extensions/common/manifest_handlers/devtools_page_handler.h"
#include "extensions/common/manifest_handlers/manifest_url_handlers.h"
#include "extensions/common/manifest_url_handlers.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "shell/browser/api/electron_api_web_contents.h"
#include "shell/browser/browser.h"

View File

@@ -67,7 +67,7 @@ class OffScreenHostDisplayClient : public viz::HostDisplayClient {
// viz::HostDisplayClient
#if BUILDFLAG(IS_MAC)
void OnDisplayReceivedCALayerParams(
gfx::CALayerParams ca_layer_params) override;
const gfx::CALayerParams& ca_layer_params) override;
#endif
void CreateLayeredWindowUpdater(

View File

@@ -11,8 +11,8 @@
namespace electron {
void OffScreenHostDisplayClient::OnDisplayReceivedCALayerParams(
const gfx::CALayerParams ca_layer_params) {
if (!ca_layer_params.IsEmpty()) {
const gfx::CALayerParams& ca_layer_params) {
if (!ca_layer_params.is_empty) {
base::apple::ScopedCFTypeRef<IOSurfaceRef> io_surface(
IOSurfaceLookupFromMachPort(
ca_layer_params.io_surface_mach_port.get()));

View File

@@ -19,8 +19,8 @@
#include "extensions/common/manifest_handler.h"
#include "extensions/common/manifest_handler_registry.h"
#include "extensions/common/manifest_handlers/chrome_url_overrides_handler.h"
#include "extensions/common/manifest_handlers/manifest_url_handlers.h"
#include "extensions/common/manifest_handlers/permissions_parser.h"
#include "extensions/common/manifest_url_handlers.h"
#include "extensions/common/permissions/permissions_info.h"
#include "shell/common/extensions/api/api_features.h"
#include "shell/common/extensions/api/manifest_features.h"

View File

@@ -18,12 +18,6 @@ import { promisify } from 'node:util';
import { collectStreamBody, getResponse } from './lib/net-helpers';
import { defer, ifdescribe, ifit, isWayland, listen, waitUntil } from './lib/spec-helpers';
import { closeWindow, closeAllWindows } from './lib/window-helpers';
import {
makeXdgMockDirectories,
spawnProtocolInfoWithXdgMock,
spawnProtocolNameWithXdgMock,
writeProtocolAssociation
} from './lib/xdg-helpers';
const fixturesPath = path.resolve(__dirname, 'fixtures');
@@ -1519,23 +1513,73 @@ describe('app module', () => {
});
ifdescribe(process.platform === 'linux')('on Linux with mocked XDG dirs', () => {
const fixtureApp = path.join(fixturesPath, 'api', 'protocol-name');
const desktopFileId = 'mock-browser.desktop';
const mockDisplayName = 'Mock Browser';
const mockScheme = 'mockproto';
const mockMimeType = `x-scheme-handler/${mockScheme}`;
function spawnWithXdgMock(url: string, xdgDataHome: string, xdgConfigHome: string): Promise<string> {
return new Promise((resolve, reject) => {
const child = cp.spawn(process.execPath, [fixtureApp, url], {
env: {
...process.env,
XDG_DATA_HOME: xdgDataHome,
XDG_DATA_DIRS: xdgDataHome,
XDG_CONFIG_HOME: xdgConfigHome
},
stdio: ['ignore', 'pipe', 'pipe']
});
let stdout = '';
let stderr = '';
child.stdout.on('data', (d: Buffer) => {
stdout += d;
});
child.stderr.on('data', (d: Buffer) => {
stderr += d;
});
child.on('close', (code) => {
if (code !== 0) {
reject(new Error(`Fixture exited with code ${code}: ${stderr}`));
return;
}
try {
const parsed = JSON.parse(stdout);
resolve(parsed.name);
} catch {
reject(new Error(`Failed to parse output: ${stdout}\nstderr: ${stderr}`));
}
});
child.on('error', reject);
});
}
let xdgDir: string;
let xdgDataHome: string;
let xdgConfigHome: string;
before(() => {
({ xdgDir, xdgDataHome, xdgConfigHome } = makeXdgMockDirectories('electron-xdg-name-'));
writeProtocolAssociation(
xdgDataHome,
xdgConfigHome,
desktopFileId,
mockDisplayName,
'/usr/bin/true %u',
mockMimeType
xdgDir = fs.mkdtempSync(path.join(os.tmpdir(), 'electron-xdg-'));
xdgDataHome = path.join(xdgDir, 'data');
xdgConfigHome = path.join(xdgDir, 'config');
const appsDir = path.join(xdgDataHome, 'applications');
fs.mkdirSync(appsDir, { recursive: true });
fs.mkdirSync(xdgConfigHome, { recursive: true });
fs.writeFileSync(
path.join(appsDir, desktopFileId),
[
'[Desktop Entry]',
`Name=${mockDisplayName}`,
'Exec=/usr/bin/true %u',
'Type=Application',
`MimeType=${mockMimeType};`
].join('\n')
);
fs.writeFileSync(
path.join(xdgConfigHome, 'mimeapps.list'),
['[Default Applications]', `${mockMimeType}=${desktopFileId}`].join('\n')
);
});
@@ -1544,52 +1588,18 @@ describe('app module', () => {
});
it('returns the display name for a registered protocol', async () => {
const name = await spawnProtocolNameWithXdgMock(`${mockScheme}://`, xdgDataHome, xdgConfigHome);
const name = await spawnWithXdgMock(`${mockScheme}://`, xdgDataHome, xdgConfigHome);
expect(name).to.equal(mockDisplayName);
});
it('returns an empty string for an unregistered protocol', async () => {
const name = await spawnProtocolNameWithXdgMock('unregistered-proto://', xdgDataHome, xdgConfigHome);
const name = await spawnWithXdgMock('unregistered-proto://', xdgDataHome, xdgConfigHome);
expect(name).to.equal('');
});
});
});
describe('getApplicationInfoForProtocol()', () => {
const fixtureIcon = path.join(fixturesPath, 'assets', '1x1.png');
const desktopFileId = 'mock-browser.desktop';
const mockDisplayName = 'Mock Browser';
const mockScheme = 'mockproto';
const mockMimeType = `x-scheme-handler/${mockScheme}`;
let xdgDir: string;
let xdgDataHome: string;
let xdgConfigHome: string;
let xdgBinDir: string;
before(() => {
if (process.platform !== 'linux') {
return;
}
({ xdgDir, xdgDataHome, xdgConfigHome, xdgBinDir } = makeXdgMockDirectories('electron-xdg-app-info-'));
writeProtocolAssociation(
xdgDataHome,
xdgConfigHome,
desktopFileId,
mockDisplayName,
'/usr/bin/true %u',
mockMimeType,
fixtureIcon
);
});
after(() => {
if (process.platform === 'linux') {
fs.rmSync(xdgDir, { recursive: true, force: true });
}
});
ifdescribe(process.platform !== 'linux')('getApplicationInfoForProtocol()', () => {
it('returns promise rejection for a bogus protocol', async function () {
await expect(app.getApplicationInfoForProtocol('bogus-protocol://')).to.eventually.be.rejectedWith(
'Unable to retrieve installation path to app'
@@ -1597,46 +1607,11 @@ describe('app module', () => {
});
it('returns resolved promise with appPath, displayName and icon', async function () {
if (process.platform === 'linux') {
const appInfo = await spawnProtocolInfoWithXdgMock(`${mockScheme}://`, xdgDataHome, xdgConfigHome);
expect(appInfo.name).to.equal(mockDisplayName);
expect(appInfo.path).to.equal('/usr/bin/true');
expect(appInfo.hasIcon).to.equal(true);
return;
}
const appInfo = await app.getApplicationInfoForProtocol('https://');
expect(appInfo.path).not.to.be.undefined();
expect(appInfo.name).not.to.be.undefined();
expect(appInfo.icon).not.to.be.undefined();
});
ifit(process.platform === 'linux')('resolves an executable name via PATH', async () => {
const pathLookupExecutable = 'mock-browser';
const pathLookupExecutablePath = path.join(xdgBinDir, pathLookupExecutable);
const pathLookupDisplayName = 'Mock Browser PATH';
const pathLookupScheme = 'mockproto-path';
const pathLookupMimeType = `x-scheme-handler/${pathLookupScheme}`;
fs.writeFileSync(pathLookupExecutablePath, '#!/bin/sh\nexit 0\n');
fs.chmodSync(pathLookupExecutablePath, 0o755);
writeProtocolAssociation(
xdgDataHome,
xdgConfigHome,
'mock-browser-path.desktop',
pathLookupDisplayName,
`${pathLookupExecutable} %u`,
pathLookupMimeType,
fixtureIcon
);
const appInfo = await spawnProtocolInfoWithXdgMock(`${pathLookupScheme}://`, xdgDataHome, xdgConfigHome, {
PATH: [xdgBinDir, process.env.PATH].filter(Boolean).join(':')
});
expect(appInfo.name).to.equal(pathLookupDisplayName);
expect(appInfo.path).to.equal(pathLookupExecutablePath);
expect(appInfo.hasIcon).to.equal(true);
});
});
describe('isDefaultProtocolClient()', () => {

View File

@@ -5061,76 +5061,3 @@ describe('iframe sandbox external protocols', () => {
expect(openExternalRequests).to.deep.equal(['magnet:sandbox-test']);
});
});
describe('iframe sandbox popups', () => {
let server: http.Server;
let serverUrl: string;
let w: BrowserWindow;
const childHtml = `
<script>
addEventListener('DOMContentLoaded', () => {
const a = document.createElement('a');
a.href = 'https://example.com/sandbox-bypassed';
document.body.appendChild(a);
a.dispatchEvent(new MouseEvent('click', {
ctrlKey: true, metaKey: true, bubbles: true, cancelable: true, view: window
}));
});
</script>`;
before(async () => {
server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
if (req.url === '/child') {
res.end(childHtml);
} else {
const sandbox = new URL(req.url!, serverUrl).searchParams.get('sandbox') ?? '';
res.end(`<iframe sandbox="${sandbox}" src="/child"></iframe>`);
}
});
serverUrl = (await listen(server)).url;
});
after(() => {
server.close();
});
beforeEach(() => {
w = new BrowserWindow({ show: false });
});
afterEach(() => closeAllWindows());
it('does not invoke setWindowOpenHandler from a sandboxed iframe without allow-popups', async () => {
let handlerCalls = 0;
w.webContents.setWindowOpenHandler(() => {
handlerCalls++;
return { action: 'deny' };
});
await w.loadURL(`${serverUrl}/?sandbox=${encodeURIComponent('allow-scripts')}`);
await setTimeout(200);
expect(handlerCalls).to.equal(0);
});
it('does not create a BrowserWindow from a sandboxed iframe without allow-popups (no handler installed)', async () => {
let created = false;
w.webContents.on('did-create-window', () => {
created = true;
});
await w.loadURL(`${serverUrl}/?sandbox=${encodeURIComponent('allow-scripts')}`);
await setTimeout(200);
expect(created).to.be.false();
});
it('invokes setWindowOpenHandler when allow-popups is set', async () => {
let handlerCalls = 0;
w.webContents.setWindowOpenHandler(() => {
handlerCalls++;
return { action: 'deny' };
});
await w.loadURL(`${serverUrl}/?sandbox=${encodeURIComponent('allow-scripts allow-popups')}`);
await setTimeout(200);
expect(handlerCalls).to.equal(1);
});
});

View File

@@ -1,27 +1,7 @@
const { app } = require('electron');
app.whenReady().then(async () => {
app.whenReady().then(() => {
const url = process.argv[2];
if (process.env.ELECTRON_PROTOCOL_LOOKUP_MODE === 'info') {
try {
const info = await app.getApplicationInfoForProtocol(url);
process.stdout.write(
JSON.stringify({
name: info.name,
path: info.path,
hasIcon: !info.icon.isEmpty()
})
);
} catch (error) {
process.stderr.write(`${error.message}\n`);
app.exit(1);
return;
}
app.quit();
return;
}
const name = app.getApplicationNameForProtocol(url);
process.stdout.write(JSON.stringify({ name }));
app.quit();

View File

@@ -1,138 +0,0 @@
import * as cp from 'node:child_process';
import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
const fixturesPath = path.resolve(__dirname, '..', 'fixtures');
const xdgMockFixturePath = path.join(fixturesPath, 'api', 'xdg-mock');
const protocolLookupFixturePath = path.join(fixturesPath, 'api', 'protocol-name');
const kDefaultXdgDataDirs = '/usr/local/share:/usr/share';
type ProtocolNameLookupResult = {
name: string;
};
export type ProtocolInfoLookupResult = ProtocolNameLookupResult & {
path: string;
hasIcon: boolean;
};
export function getXdgDataDirsWithFallback(xdgDataHome: string, xdgDataDirs = process.env.XDG_DATA_DIRS) {
// Match Chromium's XDG fallback when XDG_DATA_DIRS is unset.
return [xdgDataHome, xdgDataDirs || kDefaultXdgDataDirs].join(':');
}
export function makeXdgMockDirectories(prefix: string) {
const xdgDir = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
fs.cpSync(xdgMockFixturePath, xdgDir, { recursive: true });
const xdgDataHome = path.join(xdgDir, 'data');
const xdgConfigHome = path.join(xdgDir, 'config');
const xdgBinDir = path.join(xdgDir, 'bin');
fs.chmodSync(path.join(xdgBinDir, 'xdg-mime'), 0o755);
fs.chmodSync(path.join(xdgBinDir, 'xdg-settings'), 0o755);
return { xdgDir, xdgDataHome, xdgConfigHome, xdgBinDir };
}
export function writeProtocolAssociation(
xdgDataHome: string,
xdgConfigHome: string,
desktopFileId: string,
displayName: string,
execCommand: string,
mimeType: string,
iconPath?: string
) {
const appsDir = path.join(xdgDataHome, 'applications');
fs.mkdirSync(appsDir, { recursive: true });
fs.mkdirSync(xdgConfigHome, { recursive: true });
const desktopEntry = ['[Desktop Entry]', `Name=${displayName}`, `Exec=${execCommand}`];
if (iconPath) {
desktopEntry.push(`Icon=${iconPath}`);
}
desktopEntry.push('Type=Application', `MimeType=${mimeType};`);
fs.writeFileSync(path.join(appsDir, desktopFileId), desktopEntry.join('\n'));
fs.writeFileSync(
path.join(xdgConfigHome, 'mimeapps.list'),
['[Default Applications]', `${mimeType}=${desktopFileId}`].join('\n')
);
}
function spawnProtocolLookupWithXdgMock(
url: string,
xdgDataHome: string,
xdgConfigHome: string,
options: {
lookupMode?: 'info';
extraEnv?: Record<string, string | undefined>;
} = {}
): Promise<ProtocolNameLookupResult | ProtocolInfoLookupResult> {
const { lookupMode, extraEnv = {} } = options;
return new Promise((resolve, reject) => {
const env: NodeJS.ProcessEnv = {
...process.env,
...extraEnv,
XDG_DATA_HOME: xdgDataHome,
XDG_DATA_DIRS: getXdgDataDirsWithFallback(xdgDataHome),
XDG_CONFIG_HOME: xdgConfigHome
};
if (lookupMode === 'info') {
env.ELECTRON_PROTOCOL_LOOKUP_MODE = 'info';
}
const child = cp.spawn(process.execPath, [protocolLookupFixturePath, url], {
env,
stdio: ['ignore', 'pipe', 'pipe']
});
let stdout = '';
let stderr = '';
child.stdout.on('data', (data: Buffer) => {
stdout += data;
});
child.stderr.on('data', (data: Buffer) => {
stderr += data;
});
child.on('close', (code) => {
if (code !== 0) {
reject(new Error(`Fixture exited with code ${code}: ${stderr}`));
return;
}
try {
resolve(JSON.parse(stdout));
} catch {
reject(new Error(`Failed to parse output: ${stdout}\nstderr: ${stderr}`));
}
});
child.on('error', reject);
});
}
export async function spawnProtocolNameWithXdgMock(
url: string,
xdgDataHome: string,
xdgConfigHome: string,
extraEnv: Record<string, string | undefined> = {}
) {
const parsed = (await spawnProtocolLookupWithXdgMock(url, xdgDataHome, xdgConfigHome, {
extraEnv
})) as ProtocolNameLookupResult;
return parsed.name;
}
export function spawnProtocolInfoWithXdgMock(
url: string,
xdgDataHome: string,
xdgConfigHome: string,
extraEnv: Record<string, string | undefined> = {}
) {
return spawnProtocolLookupWithXdgMock(url, xdgDataHome, xdgConfigHome, {
lookupMode: 'info',
extraEnv
}) as Promise<ProtocolInfoLookupResult>;
}

View File

@@ -7,7 +7,6 @@ import { once } from 'node:events';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { EventEmitter } from 'node:stream';
import * as tty from 'node:tty';
import * as util from 'node:util';
import {
@@ -18,7 +17,14 @@ import {
spawn
} from './lib/codesign-helpers';
import { withTempDirectory } from './lib/fs-helpers';
import { getRemoteContext, ifdescribe, ifit, itremote, useRemoteContext } from './lib/spec-helpers';
import {
getRemoteContext,
ifdescribe,
ifit,
itremote,
startRemoteControlApp,
useRemoteContext
} from './lib/spec-helpers';
const mainFixturesPath = path.resolve(__dirname, 'fixtures');
@@ -587,9 +593,115 @@ describe('node feature', () => {
});
});
describe('process.exit', () => {
it('exits with exit code zero when called without an argument', async () => {
const rc = await startRemoteControlApp();
rc.remotely(() => {
setImmediate(() => process.exit());
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(0);
});
it('uses process.exitCode when called without an argument', async () => {
const rc = await startRemoteControlApp();
rc.remotely(() => {
process.exitCode = 42;
setImmediate(() => process.exit());
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(42);
});
it('overrides process.exitCode when called with an argument', async () => {
const rc = await startRemoteControlApp();
rc.remotely(() => {
process.exitCode = 42;
setImmediate(() => process.exit(11));
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(11);
});
it('can be called with a null argument', async () => {
const rc = await startRemoteControlApp();
rc.remotely(() => {
setImmediate(() => process.exit(null));
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(0);
});
it('can be called with a number argument', async () => {
const rc = await startRemoteControlApp();
rc.remotely(() => {
setImmediate(() => process.exit(7));
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(7);
});
it('throws with an invalid number argument', async () => {
const rc = await startRemoteControlApp();
let stdout = '';
rc.process.stdout!.on('data', (d) => {
stdout += d.toString();
});
rc.remotely(() => {
setImmediate(() => {
try {
process.exit(4.2);
} catch (err) {
console.log(err);
process.exit(99);
}
});
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(99);
expect(stdout).to.match(
/RangeError \[ERR_OUT_OF_RANGE\]: The value of "code" is out of range. It must be an integer./
);
});
it('can be called with a string argument', async () => {
const rc = await startRemoteControlApp();
rc.remotely(() => {
setImmediate(() => process.exit('12'));
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(12);
});
it('throws with an invalid string argument', async () => {
const rc = await startRemoteControlApp();
let stdout = '';
rc.process.stdout!.on('data', (d) => {
stdout += d.toString();
});
rc.remotely(() => {
setImmediate(() => {
try {
process.exit('invalid');
} catch (err) {
console.log(err);
process.exit(99);
}
});
}).catch(() => {});
const [code] = await once(rc.process, 'exit');
expect(code).to.equal(99);
expect(stdout).to.match(/TypeError \[ERR_INVALID_ARG_TYPE\]/);
});
});
describe('process.stdout', () => {
useRemoteContext();
it('is a real Node stream', () => {
expect((process.stdout as any)._type).to.not.be.undefined();
});
itremote('does not throw an exception when accessed', () => {
expect(() => process.stdout).to.not.throw();
});
@@ -600,34 +712,10 @@ describe('node feature', () => {
}).to.not.throw();
});
describe('isTTY', () => {
itremote("should match Node's TTY classification in the renderer", function () {
const { isatty } = require('node:tty');
expect(process.stdout.isTTY === true).to.equal(isatty(1));
});
ifdescribe(process.platform !== 'win32')('POSIX platforms', () => {
const parentStdoutIsTTY = tty.isatty(1);
itremote(
'should inherit stdout TTY classification from the browser process',
function (parentStdoutIsTTY: boolean) {
const { isatty } = require('node:tty');
expect(isatty(1)).to.equal(parentStdoutIsTTY);
},
[parentStdoutIsTTY]
);
});
ifdescribe(process.platform === 'win32')('Windows', () => {
itremote('should expose renderer stdout as a TTY', function () {
const { isatty } = require('node:tty');
expect(isatty(1)).to.be.true();
expect(process.stdout.isTTY).to.be.true();
});
// TODO: figure out why process.stdout.isTTY is true on Darwin but not Linux/Win.
ifdescribe(process.platform !== 'darwin')('isTTY', () => {
itremote('should be undefined in the renderer process', function () {
expect(process.stdout.isTTY).to.be.undefined();
});
});
});
@@ -948,12 +1036,6 @@ describe('node feature', () => {
});
});
describe('process.stdout', () => {
it('is a real Node stream', () => {
expect((process.stdout as any)._type).to.not.be.undefined();
});
});
describe('fs.readFile', () => {
it('can accept a FileHandle as the Path argument', async () => {
const filePathForHandle = path.resolve(mainFixturesPath, 'dogs-running.txt');