diff options
Diffstat (limited to 'devel/electron35')
25 files changed, 892 insertions, 44 deletions
diff --git a/devel/electron35/Makefile b/devel/electron35/Makefile index 9f74b17be003..053d88c03818 100644 --- a/devel/electron35/Makefile +++ b/devel/electron35/Makefile @@ -223,7 +223,7 @@ SNDIO_VARS_OFF= GN_ARGS+=use_sndio=false # See ${WRKSRC}/electron/DEPS for CHROMIUM_VER CHROMIUM_VER= 134.0.6998.205 # See ${WRKSRC}/electron/DEPS for NODE_VER -NODE_VER= 22.14.0 +NODE_VER= 22.15.0 # See ${WRKSRC}/electron/DEPS for NAN_VER NAN_VER= e14bdcd1f72d62bca1d541b66da43130384ec213 # See ${WRKSRC}/electron/DEPS for SQUIRREL_MAC_VER diff --git a/devel/electron35/Makefile.version b/devel/electron35/Makefile.version index adea8a03d784..3ad9406cbbc9 100644 --- a/devel/electron35/Makefile.version +++ b/devel/electron35/Makefile.version @@ -1,2 +1,2 @@ -ELECTRON_VER= 35.3.0 +ELECTRON_VER= 35.4.0 ELECTRON_VER_MAJOR= ${ELECTRON_VER:C/\..*//} diff --git a/devel/electron35/distinfo b/devel/electron35/distinfo index 0c73074fd4dc..8f325f983d00 100644 --- a/devel/electron35/distinfo +++ b/devel/electron35/distinfo @@ -1,4 +1,4 @@ -TIMESTAMP = 1746917507 +TIMESTAMP = 1747311508 SHA256 (electron/chromium-134.0.6998.205.tar.xz.0) = 2de727120892e92fa40fed6c76104ed66dace4fe66ae3be0e055c51b913009e8 SIZE (electron/chromium-134.0.6998.205.tar.xz.0) = 2000000000 SHA256 (electron/chromium-134.0.6998.205.tar.xz.1) = 58024b9e01977a769576b4c2b3056c9d894a2c13b4f0729f0b8060b3984243c9 @@ -7,12 +7,12 @@ SHA256 (electron/chromium-134.0.6998.205.tar.xz.2) = 9631efe75d07b1f36799506e59b SIZE (electron/chromium-134.0.6998.205.tar.xz.2) = 171552128 SHA256 (electron/pulseaudio-16.1.tar.gz) = 027266c62f2a84422ac45fa721a649508f0f1628fb1fd9242315ac54ce2d7c92 SIZE (electron/pulseaudio-16.1.tar.gz) = 2763111 -SHA256 (electron/electron-yarn-cache-35.3.0.tar.xz) = 74a26f89b93b0b1756c6ff7e961b278235f109dab500a252c60f4d4a82637e7f -SIZE (electron/electron-yarn-cache-35.3.0.tar.xz) = 29892244 -SHA256 (electron/electron-electron-v35.3.0_GH0.tar.gz) = d00d5368fb2783592eb1beb39281bf147f35da9c921fc5a21d884803a6a9b770 -SIZE (electron/electron-electron-v35.3.0_GH0.tar.gz) = 14762701 -SHA256 (electron/nodejs-node-v22.14.0_GH0.tar.gz) = ca1a2b5c0c7bc8343ccf1b4b6347a3cab093ed7ac642397189a15098105809c3 -SIZE (electron/nodejs-node-v22.14.0_GH0.tar.gz) = 121559746 +SHA256 (electron/electron-yarn-cache-35.4.0.tar.xz) = 74a26f89b93b0b1756c6ff7e961b278235f109dab500a252c60f4d4a82637e7f +SIZE (electron/electron-yarn-cache-35.4.0.tar.xz) = 29892244 +SHA256 (electron/electron-electron-v35.4.0_GH0.tar.gz) = 746f6d1c5fa917313e32cb3dcba5d5011c523fd6bb55319edb3df979715c82f2 +SIZE (electron/electron-electron-v35.4.0_GH0.tar.gz) = 14768269 +SHA256 (electron/nodejs-node-v22.15.0_GH0.tar.gz) = 4f2515e143ffd73f069916ecc5daf503e7a05166c0ae4f1c1f8afdc8ab2f8a82 +SIZE (electron/nodejs-node-v22.15.0_GH0.tar.gz) = 122833296 SHA256 (electron/nodejs-nan-e14bdcd1f72d62bca1d541b66da43130384ec213_GH0.tar.gz) = 02edf8d5b3fef9af94d8a1355da60564a57e7f2c99cb422bce042400607ed2eb SIZE (electron/nodejs-nan-e14bdcd1f72d62bca1d541b66da43130384ec213_GH0.tar.gz) = 180646 SHA256 (electron/Squirrel-Squirrel.Mac-0e5d146ba13101a1302d59ea6e6e0b3cace4ae38_GH0.tar.gz) = f4ebb40a8d85dbb7ef02aa0571b2f8e22182c6d73b6992484a53c90047779d01 diff --git a/devel/electron35/files/patch-build_rust_allocator_BUILD.gn b/devel/electron35/files/patch-build_rust_allocator_BUILD.gn new file mode 100644 index 000000000000..cb1633140dcc --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_BUILD.gn @@ -0,0 +1,109 @@ +--- build/rust/allocator/BUILD.gn.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/BUILD.gn +@@ -0,0 +1,106 @@ ++# Copyright 2025 The Chromium Authors ++# Use of this source code is governed by a BSD-style license that can be ++# found in the LICENSE file. ++ ++import("//build/buildflag_header.gni") ++import("//build/config/rust.gni") ++import("//build/rust/rust_static_library.gni") ++ ++rust_allocator_uses_partition_alloc = false ++if (build_with_chromium) { ++ import("//base/allocator/partition_allocator/partition_alloc.gni") ++ rust_allocator_uses_partition_alloc = use_partition_alloc_as_malloc ++} ++ ++# In ASAN builds, PartitionAlloc-Everywhere is disabled, meaning malloc() and ++# friends in C++ do not go to PartitionAlloc. So we also don't point the Rust ++# allocation functions at PartitionAlloc. Generally, this means we just direct ++# them to the Standard Library's allocator. ++# ++# However, on Windows the Standard Library uses HeapAlloc() and Windows ASAN ++# does *not* hook that method, so ASAN does not get to hear about allocations ++# made in Rust. To resolve this, we redirect allocation to _aligned_malloc ++# which Windows ASAN *does* hook. ++# ++# Note that there is a runtime option to make ASAN hook HeapAlloc() but ++# enabling it breaks Win32 APIs like CreateProcess: ++# https://crbug.com/368070343#comment29 ++rust_allocator_uses_aligned_malloc = false ++if (!rust_allocator_uses_partition_alloc && is_win && is_asan) { ++ rust_allocator_uses_aligned_malloc = true ++} ++ ++rust_allocator_uses_allocator_impls_h = ++ rust_allocator_uses_partition_alloc || rust_allocator_uses_aligned_malloc ++ ++buildflag_header("buildflags") { ++ header = "buildflags.h" ++ flags = [ ++ "RUST_ALLOCATOR_USES_PARTITION_ALLOC=$rust_allocator_uses_partition_alloc", ++ "RUST_ALLOCATOR_USES_ALIGNED_MALLOC=$rust_allocator_uses_aligned_malloc", ++ ] ++ visibility = [ ":*" ] ++} ++ ++if (toolchain_has_rust) { ++ # All targets which depend on Rust code but are not linked by rustc must ++ # depend on this. Usually, this dependency will come from the rust_target() GN ++ # template. However, cargo_crate() does *not* include this dependency so any ++ # C++ targets which directly depend on a cargo_crate() must depend on this. ++ rust_static_library("allocator") { ++ sources = [ "lib.rs" ] ++ crate_root = "lib.rs" ++ cxx_bindings = [ "lib.rs" ] ++ ++ deps = [ ":alloc_error_handler_impl" ] ++ if (rust_allocator_uses_allocator_impls_h) { ++ deps += [ ":allocator_impls" ] ++ } ++ ++ no_chromium_prelude = true ++ no_allocator_crate = true ++ allow_unsafe = true ++ ++ rustflags = [] ++ if (rust_allocator_uses_allocator_impls_h) { ++ rustflags += [ "--cfg=rust_allocator_uses_allocator_impls_h" ] ++ cxx_bindings += [ "allocator_impls_ffi.rs" ] ++ sources += [ "allocator_impls_ffi.rs" ] ++ } ++ ++ # TODO(https://crbug.com/410596442): Stop using unstable features here. ++ configs -= [ "//build/config/compiler:disallow_unstable_features" ] ++ } ++ ++ if (rust_allocator_uses_allocator_impls_h) { ++ static_library("allocator_impls") { ++ public_deps = [] ++ if (rust_allocator_uses_partition_alloc) { ++ public_deps += ++ [ "//base/allocator/partition_allocator:partition_alloc" ] ++ } ++ ++ sources = [ ++ "allocator_impls.cc", ++ "allocator_impls.h", ++ ] ++ deps = [ ":buildflags" ] ++ visibility = [ ":*" ] ++ } ++ } ++ ++ static_library("alloc_error_handler_impl") { ++ sources = [ ++ # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been ++ # copied from `//base`. ++ # TODO(crbug.com/40279749): Avoid duplication / reuse code. ++ "alias.cc", ++ "alias.h", ++ "alloc_error_handler_impl.cc", ++ "alloc_error_handler_impl.h", ++ "compiler_specific.h", ++ "immediate_crash.h", ++ ] ++ visibility = [ ":*" ] ++ } ++} diff --git a/devel/electron35/files/patch-build_rust_allocator_DEPS b/devel/electron35/files/patch-build_rust_allocator_DEPS new file mode 100644 index 000000000000..74bb2d6c2421 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_DEPS @@ -0,0 +1,12 @@ +--- build/rust/allocator/DEPS.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/DEPS +@@ -0,0 +1,9 @@ ++include_rules = [ ++ "-base", ++] ++ ++specific_include_rules = { ++ "allocator_impls.cc" : [ ++ "+partition_alloc" ++ ] ++} diff --git a/devel/electron35/files/patch-build_rust_allocator_alias.cc b/devel/electron35/files/patch-build_rust_allocator_alias.cc new file mode 100644 index 000000000000..5280641f27e1 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_alias.cc @@ -0,0 +1,25 @@ +--- build/rust/allocator/alias.cc.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/alias.cc +@@ -0,0 +1,22 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// This file has been copied from //base/debug/alias.cc ( additionally the APIs ++// were moved into the `build_rust_std` namespace). ++// ++// TODO(crbug.com/40279749): Avoid code duplication / reuse code. ++ ++#include "build/rust/allocator/alias.h" ++ ++#include "build/rust/allocator/compiler_specific.h" ++ ++namespace build_rust_std { ++namespace debug { ++ ++// This file/function should be excluded from LTO/LTCG to ensure that the ++// compiler can't see this function's implementation when compiling calls to it. ++NOINLINE void Alias(const void* var) {} ++ ++} // namespace debug ++} // namespace build_rust_std diff --git a/devel/electron35/files/patch-build_rust_allocator_alias.h b/devel/electron35/files/patch-build_rust_allocator_alias.h new file mode 100644 index 000000000000..6530c6ae8779 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_alias.h @@ -0,0 +1,40 @@ +--- build/rust/allocator/alias.h.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/alias.h +@@ -0,0 +1,37 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// This file has been copied from //base/debug/alias.h (and then trimmed to just ++// the APIs / macros needed by //build/rust/std; additionally the APIs were ++// moved into the `build_rust_std` namespace). ++// ++// TODO(crbug.com/40279749): Avoid code duplication / reuse code. ++ ++#ifndef BUILD_RUST_ALLOCATOR_ALIAS_H_ ++#define BUILD_RUST_ALLOCATOR_ALIAS_H_ ++ ++#include <stddef.h> ++ ++namespace build_rust_std { ++namespace debug { ++ ++// Make the optimizer think that |var| is aliased. This can be used to prevent a ++// local variable from being optimized out (which is something that ++// `NO_CODE_FOLDING` macro definition below depends on). See ++// //base/debug/alias.h for more details. ++void Alias(const void* var); ++ ++} // namespace debug ++ ++} // namespace build_rust_std ++ ++// Prevent code folding (where a linker identifies functions that are ++// bit-identical and overlays them, which saves space but it leads to confusing ++// call stacks because multiple symbols are at the same address). See ++// //base/debug/alias.h for more details. ++#define NO_CODE_FOLDING() \ ++ const int line_number = __LINE__; \ ++ build_rust_std::debug::Alias(&line_number) ++ ++#endif // BUILD_RUST_ALLOCATOR_ALIAS_H_ diff --git a/devel/electron35/files/patch-build_rust_allocator_alloc__error__handler__impl.cc b/devel/electron35/files/patch-build_rust_allocator_alloc__error__handler__impl.cc new file mode 100644 index 000000000000..048c267abefa --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_alloc__error__handler__impl.cc @@ -0,0 +1,20 @@ +--- build/rust/allocator/alloc_error_handler_impl.cc.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/alloc_error_handler_impl.cc +@@ -0,0 +1,17 @@ ++// Copyright 2025 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "build/rust/allocator/alloc_error_handler_impl.h" ++ ++#include "build/rust/allocator/alias.h" ++#include "build/rust/allocator/immediate_crash.h" ++ ++namespace rust_allocator_internal { ++ ++void alloc_error_handler_impl() { ++ NO_CODE_FOLDING(); ++ IMMEDIATE_CRASH(); ++} ++ ++} // namespace rust_allocator_internal diff --git a/devel/electron35/files/patch-build_rust_allocator_alloc__error__handler__impl.h b/devel/electron35/files/patch-build_rust_allocator_alloc__error__handler__impl.h new file mode 100644 index 000000000000..887ea602b027 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_alloc__error__handler__impl.h @@ -0,0 +1,24 @@ +--- build/rust/allocator/alloc_error_handler_impl.h.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/alloc_error_handler_impl.h +@@ -0,0 +1,21 @@ ++// Copyright 2025 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef BUILD_RUST_ALLOCATOR_ALLOC_ERROR_HANDLER_IMPL_H_ ++#define BUILD_RUST_ALLOCATOR_ALLOC_ERROR_HANDLER_IMPL_H_ ++ ++// This header exposes to Rust a C++ implementation of quickly crashing after an ++// allocation error. (The API below is called from `__rust_alloc_error_handler` ++// in `lib.rs`.) ++// ++// TODO(lukasza): Investigate if we can delete this `.h` / `.cc` and just call ++// `std::process::abort()` (or something else?) directly from `.rs`. The main ++// open question is how much we care about `NO_CODE_FOLDING`. ++namespace rust_allocator_internal { ++ ++void alloc_error_handler_impl(); ++ ++} // namespace rust_allocator_internal ++ ++#endif // BUILD_RUST_ALLOCATOR_ALLOC_ERROR_HANDLER_IMPL_H_ diff --git a/devel/electron35/files/patch-build_rust_allocator_allocator__impls.cc b/devel/electron35/files/patch-build_rust_allocator_allocator__impls.cc new file mode 100644 index 000000000000..94e04d7b966a --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_allocator__impls.cc @@ -0,0 +1,108 @@ +--- build/rust/allocator/allocator_impls.cc.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/allocator_impls.cc +@@ -0,0 +1,105 @@ ++// Copyright 2021 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "build/rust/allocator/allocator_impls.h" ++ ++#ifdef UNSAFE_BUFFERS_BUILD ++// TODO(crbug.com/390223051): Remove C-library calls to fix the errors. ++#pragma allow_unsafe_libc_calls ++#endif ++ ++#include <cstddef> ++#include <cstring> ++ ++#include "build/build_config.h" ++#include "build/rust/allocator/buildflags.h" ++ ++#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) ++#include "partition_alloc/partition_alloc_constants.h" // nogncheck ++#include "partition_alloc/shim/allocator_shim.h" // nogncheck ++#elif BUILDFLAG(RUST_ALLOCATOR_USES_ALIGNED_MALLOC) ++#include <cstdlib> ++#endif ++ ++namespace rust_allocator_internal { ++ ++unsigned char* alloc(size_t size, size_t align) { ++#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) ++ // PartitionAlloc will crash if given an alignment larger than this. ++ if (align > partition_alloc::internal::kMaxSupportedAlignment) { ++ return nullptr; ++ } ++ ++ // We use unchecked allocation paths in PartitionAlloc rather than going ++ // through its shims in `malloc()` etc so that we can support fallible ++ // allocation paths such as Vec::try_reserve without crashing on allocation ++ // failure. ++ if (align <= alignof(std::max_align_t)) { ++ return static_cast<unsigned char*>(allocator_shim::UncheckedAlloc(size)); ++ } else { ++ return static_cast<unsigned char*>( ++ allocator_shim::UncheckedAlignedAlloc(size, align)); ++ } ++#elif BUILDFLAG(RUST_ALLOCATOR_USES_ALIGNED_MALLOC) ++ return static_cast<unsigned char*>(_aligned_malloc(size, align)); ++#else ++#error This configuration is not supported. ++#endif ++} ++ ++void dealloc(unsigned char* p, size_t size, size_t align) { ++#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) ++ if (align <= alignof(std::max_align_t)) { ++ allocator_shim::UncheckedFree(p); ++ } else { ++ allocator_shim::UncheckedAlignedFree(p); ++ } ++#elif BUILDFLAG(RUST_ALLOCATOR_USES_ALIGNED_MALLOC) ++ return _aligned_free(p); ++#else ++#error This configuration is not supported. ++#endif ++} ++ ++unsigned char* realloc(unsigned char* p, ++ size_t old_size, ++ size_t align, ++ size_t new_size) { ++#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) ++ // We use unchecked allocation paths in PartitionAlloc rather than going ++ // through its shims in `malloc()` etc so that we can support fallible ++ // allocation paths such as Vec::try_reserve without crashing on allocation ++ // failure. ++ if (align <= alignof(std::max_align_t)) { ++ return static_cast<unsigned char*>( ++ allocator_shim::UncheckedRealloc(p, new_size)); ++ } else { ++ return static_cast<unsigned char*>( ++ allocator_shim::UncheckedAlignedRealloc(p, new_size, align)); ++ } ++#elif BUILDFLAG(RUST_ALLOCATOR_USES_ALIGNED_MALLOC) ++ return static_cast<unsigned char*>(_aligned_realloc(p, new_size, align)); ++#else ++#error This configuration is not supported. ++#endif ++} ++ ++unsigned char* alloc_zeroed(size_t size, size_t align) { ++#if BUILDFLAG(RUST_ALLOCATOR_USES_PARTITION_ALLOC) || \ ++ BUILDFLAG(RUST_ALLOCATOR_USES_ALIGNED_MALLOC) ++ // TODO(danakj): When RUST_ALLOCATOR_USES_PARTITION_ALLOC is true, it's ++ // possible that a partition_alloc::UncheckedAllocZeroed() call would perform ++ // better than partition_alloc::UncheckedAlloc() + memset. But there is no ++ // such API today. See b/342251590. ++ unsigned char* p = alloc(size, align); ++ if (p) { ++ memset(p, 0, size); ++ } ++ return p; ++#else ++#error This configuration is not supported. ++#endif ++} ++ ++} // namespace rust_allocator_internal diff --git a/devel/electron35/files/patch-build_rust_allocator_allocator__impls.h b/devel/electron35/files/patch-build_rust_allocator_allocator__impls.h new file mode 100644 index 000000000000..9249cdc938d2 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_allocator__impls.h @@ -0,0 +1,27 @@ +--- build/rust/allocator/allocator_impls.h.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/allocator_impls.h +@@ -0,0 +1,24 @@ ++// Copyright 2025 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_ ++#define BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_ ++ ++#include <cstddef> ++ ++// This header exposes a C++ allocator (e.g. PartitionAlloc) to Rust. ++// The APIs below are called from `impl GlobalAlloc` in `lib.rs`. ++namespace rust_allocator_internal { ++ ++unsigned char* alloc(size_t size, size_t align); ++void dealloc(unsigned char* p, size_t size, size_t align); ++unsigned char* realloc(unsigned char* p, ++ size_t old_size, ++ size_t align, ++ size_t new_size); ++unsigned char* alloc_zeroed(size_t size, size_t align); ++ ++} // namespace rust_allocator_internal ++ ++#endif // BUILD_RUST_ALLOCATOR_ALLOCATOR_IMPLS_H_ diff --git a/devel/electron35/files/patch-build_rust_allocator_allocator__impls__ffi.rs b/devel/electron35/files/patch-build_rust_allocator_allocator__impls__ffi.rs new file mode 100644 index 000000000000..8f0baf1576ce --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_allocator__impls__ffi.rs @@ -0,0 +1,22 @@ +--- build/rust/allocator/allocator_impls_ffi.rs.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/allocator_impls_ffi.rs +@@ -0,0 +1,19 @@ ++// Copyright 2025 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++//! FFI for `allocator_impls.h` is in a separate `.rs` file/module to ++//! better support conditional compilation (these functions are only ++//! used under `#[cfg(rust_allocator_uses_allocator_impls_h)]`. ++ ++#[cxx::bridge(namespace = "rust_allocator_internal")] ++pub mod ffi { ++ extern "C++" { ++ include!("build/rust/allocator/allocator_impls.h"); ++ ++ unsafe fn alloc(size: usize, align: usize) -> *mut u8; ++ unsafe fn dealloc(p: *mut u8, size: usize, align: usize); ++ unsafe fn realloc(p: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8; ++ unsafe fn alloc_zeroed(size: usize, align: usize) -> *mut u8; ++ } ++} diff --git a/devel/electron35/files/patch-build_rust_allocator_compiler__specific.h b/devel/electron35/files/patch-build_rust_allocator_compiler__specific.h new file mode 100644 index 000000000000..7feb0c739d79 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_compiler__specific.h @@ -0,0 +1,41 @@ +--- build/rust/allocator/compiler_specific.h.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/compiler_specific.h +@@ -0,0 +1,38 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// This file has been copied from //base/compiler_specific.h (and then ++// significantly trimmed to just the APIs / macros needed by //build/rust/std). ++// ++// TODO(crbug.com/40279749): Avoid code duplication / reuse code. ++ ++#ifndef BUILD_RUST_ALLOCATOR_COMPILER_SPECIFIC_H_ ++#define BUILD_RUST_ALLOCATOR_COMPILER_SPECIFIC_H_ ++ ++#include "build/build_config.h" ++ ++#if defined(COMPILER_MSVC) && !defined(__clang__) ++#error "Only clang-cl is supported on Windows, see https://crbug.com/988071" ++#endif ++ ++#if defined(__has_attribute) ++#define HAS_ATTRIBUTE(x) __has_attribute(x) ++#else ++#define HAS_ATTRIBUTE(x) 0 ++#endif ++ ++// Annotate a function indicating it should not be inlined. ++// Use like: ++// NOINLINE void DoStuff() { ... } ++#if defined(__clang__) && HAS_ATTRIBUTE(noinline) ++#define NOINLINE [[clang::noinline]] ++#elif defined(COMPILER_GCC) && HAS_ATTRIBUTE(noinline) ++#define NOINLINE __attribute__((noinline)) ++#elif defined(COMPILER_MSVC) ++#define NOINLINE __declspec(noinline) ++#else ++#define NOINLINE ++#endif ++ ++#endif // BUILD_RUST_ALLOCATOR_COMPILER_SPECIFIC_H_ diff --git a/devel/electron35/files/patch-build_rust_allocator_immediate__crash.h b/devel/electron35/files/patch-build_rust_allocator_immediate__crash.h new file mode 100644 index 000000000000..7ab0f9d9c34c --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_immediate__crash.h @@ -0,0 +1,174 @@ +--- build/rust/allocator/immediate_crash.h.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/immediate_crash.h +@@ -0,0 +1,171 @@ ++// Copyright 2021 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// This file has been copied from //base/immediate_crash.h. ++// TODO(crbug.com/40279749): Avoid code duplication / reuse code. ++ ++#ifndef BUILD_RUST_ALLOCATOR_IMMEDIATE_CRASH_H_ ++#define BUILD_RUST_ALLOCATOR_IMMEDIATE_CRASH_H_ ++ ++#include "build/build_config.h" ++ ++// Crashes in the fastest possible way with no attempt at logging. ++// There are several constraints; see http://crbug.com/664209 for more context. ++// ++// - TRAP_SEQUENCE_() must be fatal. It should not be possible to ignore the ++// resulting exception or simply hit 'continue' to skip over it in a debugger. ++// - Different instances of TRAP_SEQUENCE_() must not be folded together, to ++// ensure crash reports are debuggable. Unlike __builtin_trap(), asm volatile ++// blocks will not be folded together. ++// Note: TRAP_SEQUENCE_() previously required an instruction with a unique ++// nonce since unlike clang, GCC folds together identical asm volatile ++// blocks. ++// - TRAP_SEQUENCE_() must produce a signal that is distinct from an invalid ++// memory access. ++// - TRAP_SEQUENCE_() must be treated as a set of noreturn instructions. ++// __builtin_unreachable() is used to provide that hint here. clang also uses ++// this as a heuristic to pack the instructions in the function epilogue to ++// improve code density. ++// ++// Additional properties that are nice to have: ++// - TRAP_SEQUENCE_() should be as compact as possible. ++// - The first instruction of TRAP_SEQUENCE_() should not change, to avoid ++// shifting crash reporting clusters. As a consequence of this, explicit ++// assembly is preferred over intrinsics. ++// Note: this last bullet point may no longer be true, and may be removed in ++// the future. ++ ++// Note: TRAP_SEQUENCE Is currently split into two macro helpers due to the fact ++// that clang emits an actual instruction for __builtin_unreachable() on certain ++// platforms (see https://crbug.com/958675). In addition, the int3/bkpt/brk will ++// be removed in followups, so splitting it up like this now makes it easy to ++// land the followups. ++ ++#if defined(COMPILER_GCC) ++ ++#if BUILDFLAG(IS_NACL) ++ ++// Crash report accuracy is not guaranteed on NaCl. ++#define TRAP_SEQUENCE1_() __builtin_trap() ++#define TRAP_SEQUENCE2_() asm volatile("") ++ ++#elif defined(ARCH_CPU_X86_FAMILY) ++ ++// TODO(crbug.com/40625592): In theory, it should be possible to use just ++// int3. However, there are a number of crashes with SIGILL as the exception ++// code, so it seems likely that there's a signal handler that allows execution ++// to continue after SIGTRAP. ++#define TRAP_SEQUENCE1_() asm volatile("int3") ++ ++#if BUILDFLAG(IS_APPLE) ++// Intentionally empty: __builtin_unreachable() is always part of the sequence ++// (see IMMEDIATE_CRASH below) and already emits a ud2 on Mac. ++#define TRAP_SEQUENCE2_() asm volatile("") ++#else ++#define TRAP_SEQUENCE2_() asm volatile("ud2") ++#endif // BUILDFLAG(IS_APPLE) ++ ++#elif defined(ARCH_CPU_ARMEL) ++ ++// bkpt will generate a SIGBUS when running on armv7 and a SIGTRAP when running ++// as a 32 bit userspace app on arm64. There doesn't seem to be any way to ++// cause a SIGTRAP from userspace without using a syscall (which would be a ++// problem for sandboxing). ++// TODO(crbug.com/40625592): Remove bkpt from this sequence. ++#define TRAP_SEQUENCE1_() asm volatile("bkpt #0") ++#define TRAP_SEQUENCE2_() asm volatile("udf #0") ++ ++#elif defined(ARCH_CPU_ARM64) ++ ++// This will always generate a SIGTRAP on arm64. ++// TODO(crbug.com/40625592): Remove brk from this sequence. ++#define TRAP_SEQUENCE1_() asm volatile("brk #0") ++#define TRAP_SEQUENCE2_() asm volatile("hlt #0") ++ ++#else ++ ++// Crash report accuracy will not be guaranteed on other architectures, but at ++// least this will crash as expected. ++#define TRAP_SEQUENCE1_() __builtin_trap() ++#define TRAP_SEQUENCE2_() asm volatile("") ++ ++#endif // ARCH_CPU_* ++ ++#elif defined(COMPILER_MSVC) ++ ++#if !defined(__clang__) ++ ++// MSVC x64 doesn't support inline asm, so use the MSVC intrinsic. ++#define TRAP_SEQUENCE1_() __debugbreak() ++#define TRAP_SEQUENCE2_() ++ ++#elif defined(ARCH_CPU_ARM64) ++ ++// Windows ARM64 uses "BRK #F000" as its breakpoint instruction, and ++// __debugbreak() generates that in both VC++ and clang. ++#define TRAP_SEQUENCE1_() __debugbreak() ++// Intentionally empty: __builtin_unreachable() is always part of the sequence ++// (see IMMEDIATE_CRASH below) and already emits a ud2 on Win64, ++// https://crbug.com/958373 ++#define TRAP_SEQUENCE2_() __asm volatile("") ++ ++#else ++ ++#define TRAP_SEQUENCE1_() asm volatile("int3") ++#define TRAP_SEQUENCE2_() asm volatile("ud2") ++ ++#endif // __clang__ ++ ++#else ++ ++#error No supported trap sequence! ++ ++#endif // COMPILER_GCC ++ ++#define TRAP_SEQUENCE_() \ ++ do { \ ++ TRAP_SEQUENCE1_(); \ ++ TRAP_SEQUENCE2_(); \ ++ } while (false) ++ ++// CHECK() and the trap sequence can be invoked from a constexpr function. ++// This could make compilation fail on GCC, as it forbids directly using inline ++// asm inside a constexpr function. However, it allows calling a lambda ++// expression including the same asm. ++// The side effect is that the top of the stacktrace will not point to the ++// calling function, but to this anonymous lambda. This is still useful as the ++// full name of the lambda will typically include the name of the function that ++// calls CHECK() and the debugger will still break at the right line of code. ++#if !defined(COMPILER_GCC) || defined(__clang__) ++ ++#define WRAPPED_TRAP_SEQUENCE_() TRAP_SEQUENCE_() ++ ++#else ++ ++#define WRAPPED_TRAP_SEQUENCE_() \ ++ do { \ ++ [] { TRAP_SEQUENCE_(); }(); \ ++ } while (false) ++ ++#endif // !defined(COMPILER_GCC) || defined(__clang__) ++ ++#if defined(__clang__) || defined(COMPILER_GCC) ++ ++// __builtin_unreachable() hints to the compiler that this is noreturn and can ++// be packed in the function epilogue. ++#define IMMEDIATE_CRASH() \ ++ ({ \ ++ WRAPPED_TRAP_SEQUENCE_(); \ ++ __builtin_unreachable(); \ ++ }) ++ ++#else ++ ++// This is supporting non-chromium user of logging.h to build with MSVC, like ++// pdfium. On MSVC there is no __builtin_unreachable(). ++#define IMMEDIATE_CRASH() WRAPPED_TRAP_SEQUENCE_() ++ ++#endif // defined(__clang__) || defined(COMPILER_GCC) ++ ++#endif // BUILD_RUST_ALLOCATOR_IMMEDIATE_CRASH_H_ diff --git a/devel/electron35/files/patch-build_rust_allocator_lib.rs b/devel/electron35/files/patch-build_rust_allocator_lib.rs new file mode 100644 index 000000000000..89fddf278294 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_allocator_lib.rs @@ -0,0 +1,122 @@ +--- build/rust/allocator/lib.rs.orig 2025-05-20 09:16:26 UTC ++++ build/rust/allocator/lib.rs +@@ -0,0 +1,119 @@ ++// Copyright 2025 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++//! Define the allocator that Rust code in Chrome should use. ++//! ++//! Any final artifact that depends on this crate, even transitively, will use ++//! the allocator defined here. ++//! ++//! List of known issues: ++//! ++//! 1. We'd like to use PartitionAlloc on Windows, but the stdlib uses Windows ++//! heap functions directly that PartitionAlloc can not intercept. ++//! 2. We'd like `Vec::try_reserve` to fail at runtime on Linux instead of ++//! crashing in malloc() where PartitionAlloc replaces that function. ++ ++// Required to apply weak linkage to symbols. ++// ++// TODO(https://crbug.com/410596442): Stop using unstable features here. ++// https://github.com/rust-lang/rust/issues/29603 tracks stabilization of the `linkage` feature. ++#![feature(linkage)] ++// Required to apply `#[rustc_std_internal_symbol]` to our alloc error handler ++// so the name is correctly mangled as rustc expects. ++// ++// TODO(https://crbug.com/410596442): Stop using internal features here. ++#![allow(internal_features)] ++#![feature(rustc_attrs)] ++ ++// This module is in a separate source file to avoid having to teach `cxxbridge` ++// about conditional compilation. ++#[cfg(rust_allocator_uses_allocator_impls_h)] ++mod allocator_impls_ffi; ++ ++/// Module that provides `#[global_allocator]` / `GlobalAlloc` interface for ++/// using an allocator from C++. ++#[cfg(rust_allocator_uses_allocator_impls_h)] ++mod cpp_allocator { ++ use super::allocator_impls_ffi::ffi; ++ use std::alloc::{GlobalAlloc, Layout}; ++ ++ struct Allocator; ++ ++ unsafe impl GlobalAlloc for Allocator { ++ unsafe fn alloc(&self, layout: Layout) -> *mut u8 { ++ unsafe { ffi::alloc(layout.size(), layout.align()) } ++ } ++ ++ unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { ++ unsafe { ++ ffi::dealloc(ptr, layout.size(), layout.align()); ++ } ++ } ++ ++ unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { ++ unsafe { ffi::alloc_zeroed(layout.size(), layout.align()) } ++ } ++ ++ unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { ++ unsafe { ffi::realloc(ptr, layout.size(), layout.align(), new_size) } ++ } ++ } ++ ++ #[global_allocator] ++ static GLOBAL: Allocator = Allocator; ++} ++ ++/// Module that provides `#[global_allocator]` / `GlobalAlloc` interface for ++/// using the default Rust allocator. ++#[cfg(not(rust_allocator_uses_allocator_impls_h))] ++mod rust_allocator { ++ #[global_allocator] ++ static GLOBAL: std::alloc::System = std::alloc::System; ++} ++ ++/// Module that provides global symbols that are needed both by `cpp_allocator` ++/// and `rust_allocator`. ++/// ++/// When `rustc` drives linking, then it will define the symbols below. But ++/// Chromium only uses `rustc` to link Rust-only executables (e.g. `build.rs` ++/// scripts) and otherwise uses a non-Rust linker. This is why we have to ++/// manually define a few symbols below. We define those symbols ++/// as "weak" symbols, so that Rust-provided symbols "win" in case where Rust ++/// actually does drive the linking. This hack works (not only for Chromium, ++/// but also for google3 and other projects), but isn't officially supported by ++/// `rustc`. ++/// ++/// TODO(https://crbug.com/410596442): Stop using internal features here. ++mod both_allocators { ++ /// As part of rustc's contract for using `#[global_allocator]` without ++ /// rustc-generated shims we must define this symbol, since we are opting in ++ /// to unstable functionality. See https://github.com/rust-lang/rust/issues/123015 ++ #[no_mangle] ++ #[linkage = "weak"] ++ static __rust_no_alloc_shim_is_unstable: u8 = 0; ++ ++ // Mangle the symbol name as rustc expects. ++ #[rustc_std_internal_symbol] ++ #[allow(non_upper_case_globals)] ++ #[linkage = "weak"] ++ static __rust_alloc_error_handler_should_panic: u8 = 0; ++ ++ // Mangle the symbol name as rustc expects. ++ #[rustc_std_internal_symbol] ++ #[allow(non_upper_case_globals)] ++ #[linkage = "weak"] ++ fn __rust_alloc_error_handler(_size: usize, _align: usize) { ++ // TODO(lukasza): Investigate if we can just call `std::process::abort()` here. ++ // (Not really _needed_, but it could simplify code a little bit.) ++ unsafe { ffi::alloc_error_handler_impl() } ++ } ++ ++ #[cxx::bridge(namespace = "rust_allocator_internal")] ++ mod ffi { ++ extern "C++" { ++ include!("build/rust/allocator/alloc_error_handler_impl.h"); ++ unsafe fn alloc_error_handler_impl(); ++ } ++ } ++} diff --git a/devel/electron35/files/patch-build_rust_cargo__crate.gni b/devel/electron35/files/patch-build_rust_cargo__crate.gni new file mode 100644 index 000000000000..8b1b8e5144e9 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_cargo__crate.gni @@ -0,0 +1,25 @@ +--- build/rust/cargo_crate.gni.orig 2025-04-14 21:12:04 UTC ++++ build/rust/cargo_crate.gni +@@ -267,6 +267,12 @@ template("cargo_crate") { + # Don't import the `chromium` crate into third-party code. + no_chromium_prelude = true + ++ # Don't depend on the chrome-specific #[global_allocator] crate from ++ # third-party code. This avoids some dependency cycle issues. The allocator ++ # crate will still be used if it exists anywhere in the dependency graph for ++ # a given linked artifact. ++ no_allocator_crate = true ++ + rustc_metadata = _rustc_metadata + + # TODO(crbug.com/40259764): don't default to true. This requires changes to +@@ -504,6 +510,9 @@ template("cargo_crate") { + + # Don't import the `chromium` crate into third-party code. + no_chromium_prelude = true ++ ++ # Build scripts do not need to link to chrome's allocator. ++ no_allocator_crate = true + + # The ${_build_script_name}_output target looks for the exe in this + # location. Due to how the Windows component build works, this has to diff --git a/devel/electron35/files/patch-build_rust_rust__macro.gni b/devel/electron35/files/patch-build_rust_rust__macro.gni new file mode 100644 index 000000000000..0dafc3819aa1 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_rust__macro.gni @@ -0,0 +1,12 @@ +--- build/rust/rust_macro.gni.orig 2025-05-20 09:16:26 UTC ++++ build/rust/rust_macro.gni +@@ -16,6 +16,9 @@ template("rust_macro") { + forward_variables_from(invoker, TESTONLY_AND_VISIBILITY) + proc_macro_configs = invoker.configs + target_type = "rust_proc_macro" ++ ++ # Macros are loaded by rustc and shouldn't use chrome's allocation routines. ++ no_allocator_crate = true + } + } + diff --git a/devel/electron35/files/patch-build_rust_rust__target.gni b/devel/electron35/files/patch-build_rust_rust__target.gni new file mode 100644 index 000000000000..f4ad6f04fc45 --- /dev/null +++ b/devel/electron35/files/patch-build_rust_rust__target.gni @@ -0,0 +1,13 @@ +--- build/rust/rust_target.gni.orig 2025-05-20 09:16:26 UTC ++++ build/rust/rust_target.gni +@@ -339,6 +339,10 @@ template("rust_target") { + _rust_deps += [ "//build/rust/std" ] + } + ++ if (!defined(invoker.no_allocator_crate) || !invoker.no_allocator_crate) { ++ _rust_deps += [ "//build/rust/allocator" ] ++ } ++ + if (_build_unit_tests) { + _unit_test_target = "${_target_name}_unittests" + if (defined(invoker.unit_test_target)) { diff --git a/devel/electron35/files/patch-build_rust_std_BUILD.gn b/devel/electron35/files/patch-build_rust_std_BUILD.gn index 0a5335d58d48..c6c2801bd47d 100644 --- a/devel/electron35/files/patch-build_rust_std_BUILD.gn +++ b/devel/electron35/files/patch-build_rust_std_BUILD.gn @@ -1,6 +1,58 @@ ---- build/rust/std/BUILD.gn.orig 2025-04-05 13:54:50 UTC +--- build/rust/std/BUILD.gn.orig 2025-05-20 09:16:26 UTC +++ build/rust/std/BUILD.gn -@@ -89,13 +89,20 @@ if (toolchain_has_rust) { +@@ -15,51 +15,12 @@ + # allocator functions to PartitionAlloc when `use_partition_alloc_as_malloc` is + # true, so that Rust and C++ use the same allocator backend. + +-import("//build/buildflag_header.gni") + import("//build/config/compiler/compiler.gni") + import("//build/config/coverage/coverage.gni") + import("//build/config/rust.gni") + import("//build/config/sanitizers/sanitizers.gni") + +-rust_allocator_uses_partition_alloc = false +-if (build_with_chromium) { +- import("//base/allocator/partition_allocator/partition_alloc.gni") +- rust_allocator_uses_partition_alloc = use_partition_alloc_as_malloc +-} +- +-buildflag_header("buildflags") { +- header = "buildflags.h" +- flags = [ +- "RUST_ALLOCATOR_USES_PARTITION_ALLOC=$rust_allocator_uses_partition_alloc", +- ] +- visibility = [ ":*" ] +-} +- + if (toolchain_has_rust) { +- # If clang performs the link step, we need to provide the allocator symbols +- # that are normally injected by rustc during linking. +- # +- # We also "happen to" use this to redirect allocations to PartitionAlloc, +- # though that would be better done through a #[global_allocator] crate (see +- # above). +- source_set("remap_alloc") { +- public_deps = [] +- if (rust_allocator_uses_partition_alloc) { +- public_deps += [ "//base/allocator/partition_allocator:partition_alloc" ] +- } +- deps = [ ":buildflags" ] +- sources = [ +- # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been +- # copied from `//base`. +- # TODO(crbug.com/40279749): Avoid duplication / reuse code. +- "alias.cc", +- "alias.h", +- "compiler_specific.h", +- "immediate_crash.h", +- "remap_alloc.cc", +- ] +- } +- + # List of Rust stdlib rlibs which are present in the official Rust toolchain + # we are using from the Android team. This is usually a version or two behind + # nightly. Generally this matches the toolchain we build ourselves, but if +@@ -89,13 +50,20 @@ if (toolchain_has_rust) { # These are no longer present in the Windows toolchain. stdlib_files += [ "addr2line", @@ -22,7 +74,7 @@ } if (toolchain_for_rust_host_build_tools) { -@@ -115,7 +122,6 @@ if (toolchain_has_rust) { +@@ -115,7 +83,6 @@ if (toolchain_has_rust) { # don't need to pass to the C++ linker because they're used for specialized # purposes. skip_stdlib_files = [ @@ -30,3 +82,25 @@ "rustc_std_workspace_alloc", "rustc_std_workspace_core", "rustc_std_workspace_std", +@@ -269,8 +236,6 @@ if (toolchain_has_rust) { + foreach(libname, stdlib_files + skip_stdlib_files) { + deps += [ "rules:$libname" ] + } +- +- public_deps = [ ":remap_alloc" ] + } + } else { + action("find_stdlib") { +@@ -396,12 +361,6 @@ if (toolchain_has_rust) { + ":stdlib_public_dependent_libs", + ] + deps = [ ":prebuilt_rustc_copy_to_sysroot" ] +- +- # The host builds tools toolchain supports Rust only and does not use +- # the allocator remapping to point it to PartitionAlloc. +- if (!toolchain_for_rust_host_build_tools) { +- deps += [ ":remap_alloc" ] +- } + } + } + } diff --git a/devel/electron35/files/patch-electron_shell_browser_native__window__views.cc b/devel/electron35/files/patch-electron_shell_browser_native__window__views.cc index c0d887591946..c5d4c6cf8088 100644 --- a/devel/electron35/files/patch-electron_shell_browser_native__window__views.cc +++ b/devel/electron35/files/patch-electron_shell_browser_native__window__views.cc @@ -1,6 +1,6 @@ ---- electron/shell/browser/native_window_views.cc.orig 2025-05-06 23:52:46 UTC +--- electron/shell/browser/native_window_views.cc.orig 2025-05-13 12:56:52 UTC +++ electron/shell/browser/native_window_views.cc -@@ -50,7 +50,7 @@ +@@ -51,7 +51,7 @@ #include "ui/wm/core/shadow_types.h" #include "ui/wm/core/window_util.h" @@ -9,7 +9,7 @@ #include "base/strings/string_util.h" #include "shell/browser/browser.h" #include "shell/browser/linux/unity_service.h" -@@ -295,7 +295,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: +@@ -296,7 +296,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: params.parent = parent->GetNativeWindow(); params.native_widget = new ElectronDesktopNativeWidgetAura(this); @@ -18,7 +18,7 @@ std::string name = Browser::Get()->GetName(); // Set WM_WINDOW_ROLE. params.wm_role_name = "browser-window"; -@@ -321,7 +321,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: +@@ -322,7 +322,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: std::string window_type; options.Get(options::kType, &window_type); @@ -27,7 +27,7 @@ // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. bool use_dark_theme = false; if (options.Get(options::kDarkTheme, &use_dark_theme) && use_dark_theme) { -@@ -430,7 +430,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: +@@ -431,7 +431,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper: if (window) window->AddPreTargetHandler(this); @@ -36,7 +36,7 @@ // On linux after the widget is initialized we might have to force set the // bounds if the bounds are smaller than the current display SetBounds(gfx::Rect(GetPosition(), bounds.size()), false); -@@ -466,7 +466,7 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool us +@@ -467,7 +467,7 @@ void NativeWindowViews::SetGTKDarkThemeEnabled(bool us } void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) { @@ -45,7 +45,7 @@ if (IsX11()) { const std::string color = use_dark_theme ? "dark" : "light"; auto* connection = x11::Connection::Get(); -@@ -528,7 +528,7 @@ void NativeWindowViews::Show() { +@@ -529,7 +529,7 @@ void NativeWindowViews::Show() { NotifyWindowShow(); @@ -54,7 +54,7 @@ if (global_menu_bar_) global_menu_bar_->OnWindowMapped(); -@@ -544,7 +544,7 @@ void NativeWindowViews::ShowInactive() { +@@ -545,7 +545,7 @@ void NativeWindowViews::ShowInactive() { NotifyWindowShow(); @@ -63,7 +63,7 @@ if (global_menu_bar_) global_menu_bar_->OnWindowMapped(); -@@ -563,7 +563,7 @@ void NativeWindowViews::Hide() { +@@ -564,7 +564,7 @@ void NativeWindowViews::Hide() { NotifyWindowHide(); @@ -72,7 +72,7 @@ if (global_menu_bar_) global_menu_bar_->OnWindowUnmapped(); #endif -@@ -594,7 +594,7 @@ bool NativeWindowViews::IsEnabled() const { +@@ -595,7 +595,7 @@ bool NativeWindowViews::IsEnabled() const { bool NativeWindowViews::IsEnabled() const { #if BUILDFLAG(IS_WIN) return ::IsWindowEnabled(GetAcceleratedWidget()); @@ -81,7 +81,7 @@ if (IsX11()) return !event_disabler_.get(); NOTIMPLEMENTED(); -@@ -844,7 +844,7 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bou +@@ -845,7 +845,7 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bou } #endif @@ -90,7 +90,7 @@ // On Linux and Windows the minimum and maximum size should be updated with // window size when window is not resizable. if (!resizable_) { -@@ -1102,7 +1102,7 @@ bool NativeWindowViews::IsClosable() const { +@@ -1103,7 +1103,7 @@ bool NativeWindowViews::IsClosable() const { return false; } return !(info.fState & MFS_DISABLED); @@ -99,7 +99,7 @@ return true; #endif } -@@ -1142,7 +1142,7 @@ void NativeWindowViews::Center() { +@@ -1143,7 +1143,7 @@ void NativeWindowViews::Center() { // for now to avoid breaking API contract, but should consider the long // term plan for this aligning with upstream. void NativeWindowViews::Center() { @@ -108,7 +108,7 @@ auto display = display::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeWindow()); gfx::Rect window_bounds_in_screen = display.work_area(); -@@ -1365,7 +1365,7 @@ void NativeWindowViews::SetMenu(ElectronMenuModel* men +@@ -1367,7 +1367,7 @@ void NativeWindowViews::SetMenu(ElectronMenuModel* men } void NativeWindowViews::SetMenu(ElectronMenuModel* menu_model) { @@ -117,7 +117,7 @@ // Remove global menu bar. if (global_menu_bar_ && menu_model == nullptr) { global_menu_bar_.reset(); -@@ -1420,7 +1420,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* +@@ -1422,7 +1422,7 @@ void NativeWindowViews::SetParentWindow(NativeWindow* void NativeWindowViews::SetParentWindow(NativeWindow* parent) { NativeWindow::SetParentWindow(parent); @@ -126,7 +126,7 @@ if (IsX11()) { auto* connection = x11::Connection::Get(); connection->SetProperty( -@@ -1466,7 +1466,7 @@ void NativeWindowViews::SetProgressBar(double progress +@@ -1468,7 +1468,7 @@ void NativeWindowViews::SetProgressBar(double progress NativeWindow::ProgressState state) { #if BUILDFLAG(IS_WIN) taskbar_host_.SetProgressBar(GetAcceleratedWidget(), progress, state); @@ -135,7 +135,7 @@ if (unity::IsRunning()) { unity::SetProgressFraction(progress); } -@@ -1544,7 +1544,7 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() con +@@ -1546,7 +1546,7 @@ bool NativeWindowViews::IsVisibleOnAllWorkspaces() con if (const auto* view_native_widget = widget()->native_widget_private()) return view_native_widget->IsVisibleOnAllWorkspaces(); @@ -144,7 +144,7 @@ if (IsX11()) { // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to // determine whether the current window is visible on all workspaces. -@@ -1567,7 +1567,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopM +@@ -1569,7 +1569,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopM #if BUILDFLAG(IS_WIN) window_handle = reinterpret_cast<content::DesktopMediaID::Id>(accelerated_widget); @@ -153,7 +153,7 @@ window_handle = static_cast<uint32_t>(accelerated_widget); #endif aura::WindowTreeHost* const host = -@@ -1665,7 +1665,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HIC +@@ -1667,7 +1667,7 @@ void NativeWindowViews::SetIcon(HICON window_icon, HIC SendMessage(hwnd, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(app_icon_.get())); } @@ -162,7 +162,7 @@ void NativeWindowViews::SetIcon(const gfx::ImageSkia& icon) { auto* tree_host = views::DesktopWindowTreeHostLinux::GetHostForWidget( GetAcceleratedWidget()); -@@ -1761,7 +1761,7 @@ bool NativeWindowViews::CanMinimize() const { +@@ -1763,7 +1763,7 @@ bool NativeWindowViews::CanMinimize() const { bool NativeWindowViews::CanMinimize() const { #if BUILDFLAG(IS_WIN) return minimizable_; @@ -171,7 +171,7 @@ return true; #endif } -@@ -1817,7 +1817,7 @@ void NativeWindowViews::HandleKeyboardEvent( +@@ -1819,7 +1819,7 @@ void NativeWindowViews::HandleKeyboardEvent( if (widget_destroyed_) return; @@ -180,7 +180,7 @@ if (event.windows_key_code == ui::VKEY_BROWSER_BACK) NotifyWindowExecuteAppCommand(kBrowserBackward); else if (event.windows_key_code == ui::VKEY_BROWSER_FORWARD) -@@ -1836,7 +1836,7 @@ void NativeWindowViews::OnMouseEvent(ui::MouseEvent* e +@@ -1838,7 +1838,7 @@ void NativeWindowViews::OnMouseEvent(ui::MouseEvent* e // Alt+Click should not toggle menu bar. root_view_.ResetAltState(); diff --git a/devel/electron35/files/patch-electron_spec_api-browser-window-spec.ts b/devel/electron35/files/patch-electron_spec_api-browser-window-spec.ts index 35a58fabd5cf..5de2e6e8c6d7 100644 --- a/devel/electron35/files/patch-electron_spec_api-browser-window-spec.ts +++ b/devel/electron35/files/patch-electron_spec_api-browser-window-spec.ts @@ -1,4 +1,4 @@ ---- electron/spec/api-browser-window-spec.ts.orig 2025-05-06 23:52:46 UTC +--- electron/spec/api-browser-window-spec.ts.orig 2025-05-13 12:56:52 UTC +++ electron/spec/api-browser-window-spec.ts @@ -69,7 +69,7 @@ describe('BrowserWindow module', () => { }).not.to.throw(); @@ -162,7 +162,7 @@ const w = new BrowserWindow({ show: false }); expect(w.resizable).to.be.true('resizable'); -@@ -5429,7 +5429,7 @@ describe('BrowserWindow module', () => { +@@ -5480,7 +5480,7 @@ describe('BrowserWindow module', () => { }); }); diff --git a/devel/electron35/files/patch-ui_gfx_x_atom__cache.cc b/devel/electron35/files/patch-ui_gfx_x_atom__cache.cc index 63790e9c9a27..4e8b2af8ab90 100644 --- a/devel/electron35/files/patch-ui_gfx_x_atom__cache.cc +++ b/devel/electron35/files/patch-ui_gfx_x_atom__cache.cc @@ -1,6 +1,6 @@ ---- ui/gfx/x/atom_cache.cc.orig 2025-01-27 17:37:37 UTC +--- ui/gfx/x/atom_cache.cc.orig 2025-05-15 12:22:59 UTC +++ ui/gfx/x/atom_cache.cc -@@ -155,6 +155,7 @@ constexpr auto kAtomsToCache = std::to_array<const cha +@@ -156,6 +156,7 @@ constexpr auto kAtomsToCache = std::to_array<const cha "application/octet-stream", "application/vnd.chromium.test", "chromium/filename", diff --git a/devel/electron35/files/patch-ui_ozone_platform_x11_x11__window.cc b/devel/electron35/files/patch-ui_ozone_platform_x11_x11__window.cc index 9899581d8db2..d0d4846780cb 100644 --- a/devel/electron35/files/patch-ui_ozone_platform_x11_x11__window.cc +++ b/devel/electron35/files/patch-ui_ozone_platform_x11_x11__window.cc @@ -1,6 +1,6 @@ ---- ui/ozone/platform/x11/x11_window.cc.orig 2025-01-27 17:37:37 UTC +--- ui/ozone/platform/x11/x11_window.cc.orig 2025-05-15 12:22:59 UTC +++ ui/ozone/platform/x11/x11_window.cc -@@ -1502,7 +1502,7 @@ void X11Window::OnXWindowStateChanged() { +@@ -1509,7 +1509,7 @@ void X11Window::OnXWindowStateChanged() { WindowTiledEdges tiled_state = GetTiledState(); if (tiled_state != tiled_state_) { tiled_state_ = tiled_state; diff --git a/devel/electron35/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc b/devel/electron35/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc index 69891b8bc56a..2b89e9b60d12 100644 --- a/devel/electron35/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc +++ b/devel/electron35/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__platform.cc @@ -1,4 +1,4 @@ ---- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc.orig 2025-03-24 20:50:14 UTC +--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc.orig 2025-05-15 12:22:59 UTC +++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc @@ -50,7 +50,7 @@ #include "ui/wm/core/window_util.h" @@ -18,7 +18,7 @@ std::make_unique<DesktopDragDropClientOzoneLinux>(window(), drag_handler); #else std::make_unique<DesktopDragDropClientOzone>(window(), drag_handler); -@@ -1174,7 +1174,7 @@ bool DesktopWindowTreeHostPlatform::RotateFocusForWidg +@@ -1179,7 +1179,7 @@ bool DesktopWindowTreeHostPlatform::RotateFocusForWidg // DesktopWindowTreeHost: // Linux subclasses this host and adds some Linux specific bits. diff --git a/devel/electron35/files/patch-ui_views_widget_widget.cc b/devel/electron35/files/patch-ui_views_widget_widget.cc index bda30113f082..a7ef80a3b525 100644 --- a/devel/electron35/files/patch-ui_views_widget_widget.cc +++ b/devel/electron35/files/patch-ui_views_widget_widget.cc @@ -1,4 +1,4 @@ ---- ui/views/widget/widget.cc.orig 2025-03-24 20:50:14 UTC +--- ui/views/widget/widget.cc.orig 2025-05-15 12:22:59 UTC +++ ui/views/widget/widget.cc @@ -63,7 +63,7 @@ #include "ui/views/window/custom_frame_view.h" @@ -9,7 +9,7 @@ #include "ui/linux/linux_ui.h" #endif -@@ -2444,7 +2444,7 @@ const ui::NativeTheme* Widget::GetNativeTheme() const +@@ -2450,7 +2450,7 @@ const ui::NativeTheme* Widget::GetNativeTheme() const return parent_->GetNativeTheme(); } |