From 33a99791ccfbb94d5049b0a40b6d45b49521c6bde173092f7f0426cfc99c6cc0 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 13 Jun 2024 10:51:02 +0000 Subject: [PATCH 01/80] Accepting request 1180391 from home:dziobian:gulgul-ultron:19 - Do not build //components/sync (remove-sync.patch) - Add backported ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch to fix segfault due to type confusion (bsc#1223366 gh#electron/electron#41839) - Re-enable custom malloc now that the crash is fixed - Use system vulkan headers wherever system spirv is used - Drop Fedora 38 support * drop v8-icu73-alt_calendar.patch * drop v8-icu73-simple-case-folding.patch OBS-URL: https://build.opensuse.org/request/show/1180391 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=153 --- ...inux-OnWindowTiledStateChanged-crash.patch | 40 +++ nodejs-electron.changes | 13 + nodejs-electron.spec | 29 +- remove-sync.patch | 279 ++++++++++++++++++ v8-icu73-alt_calendar.patch | 164 ---------- v8-icu73-simple-case-folding.patch | 194 ------------ 6 files changed, 337 insertions(+), 382 deletions(-) create mode 100644 ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch create mode 100644 remove-sync.patch delete mode 100644 v8-icu73-alt_calendar.patch delete mode 100644 v8-icu73-simple-case-folding.patch diff --git a/ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch b/ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch new file mode 100644 index 0000000..b06b5c3 --- /dev/null +++ b/ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch @@ -0,0 +1,40 @@ +From e9eda8f8456c98e3c3a438bfd2ff41d90f59a8ec Mon Sep 17 00:00:00 2001 +From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> +Date: Tue, 14 May 2024 21:26:51 +0000 +Subject: [PATCH] Fix cast in ElectronDesktopWindowTreeHostLinux + +The frame view of the widget is an `ClientFrameViewLinux` instance only +when both `frame` and `client_frame` booleans are set to `true`. +Otherwise it is an instance of a different class and thus casting to +`ClientFrameViewLinux` is incorrect and leads to crashes. + +Fix: #41839 + +Co-authored-by: Fedor Indutny +--- + .../ui/electron_desktop_window_tree_host_linux.cc | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/shell/browser/ui/electron_desktop_window_tree_host_linux.cc b/shell/browser/ui/electron_desktop_window_tree_host_linux.cc +index cfc87f6fb7efd..17936ba352a1c 100644 +--- a/electron/shell/browser/ui/electron_desktop_window_tree_host_linux.cc ++++ b/electron/shell/browser/ui/electron_desktop_window_tree_host_linux.cc +@@ -71,9 +71,15 @@ void ElectronDesktopWindowTreeHostLinux::OnWindowStateChanged( + + void ElectronDesktopWindowTreeHostLinux::OnWindowTiledStateChanged( + ui::WindowTiledEdges new_tiled_edges) { +- static_cast( +- native_window_view_->widget()->non_client_view()->frame_view()) +- ->set_tiled_edges(new_tiled_edges); ++ // CreateNonClientFrameView creates `ClientFrameViewLinux` only when both ++ // frame and client_frame booleans are set, otherwise it is a different type ++ // of view. ++ if (native_window_view_->has_frame() && ++ native_window_view_->has_client_frame()) { ++ static_cast( ++ native_window_view_->widget()->non_client_view()->frame_view()) ++ ->set_tiled_edges(new_tiled_edges); ++ } + UpdateFrameHints(); + } + diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 11c2d1c..f575062 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jun 12 14:54:32 UTC 2024 - Bruno Pitrus + +- Do not build //compunents/sync (remove-sync.patch) +- Add backported ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch + to fix segfault due to type confusion (bsc#1223366 gh#electron/electron#41839) +- Re-enable custom malloc now that the crash is fixed +- Use system vulkan headers wherever system spirv is used +- Drop Fedora 38 support + * drop v8-icu73-alt_calendar.patch + * drop v8-icu73-simple-case-folding.patch + + ------------------------------------------------------------------- Wed May 29 20:19:39 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 65cfa2c..5ebc8a2 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -96,11 +96,6 @@ BuildArch: i686 %bcond_with system_minizip %endif -%if 0%{?suse_version} || 0%{?fedora} >= 39 -%bcond_without icu_73 -%else -%bcond_with icu_73 -%endif %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora} %bcond_without system_aom @@ -234,9 +229,6 @@ Source402: Cr122-ffmpeg-new-channel-layout.patch # and against harfbuzz 4 Source415: harfbuzz-replace-chromium-scoped-type.patch Source416: harfbuzz-replace-HbScopedPointer.patch -# and icu 71 -Source417: v8-icu73-alt_calendar.patch -Source418: v8-icu73-simple-case-folding.patch # and wayland 1.31 Source450: wayland-proto-31-cursor-shape.patch @@ -281,6 +273,7 @@ Patch586: aom-vpx-no-thread-wrapper.patch Patch587: remove-openscreen.patch Patch588: remove-password-manager-and-policy.patch Patch589: remove-puffin.patch +Patch590: remove-sync.patch @@ -388,6 +381,7 @@ Patch3149: boringssl-internal-addc-cxx.patch Patch3150: InternalAllocator-too-many-initializers.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch Patch3152: fake_ssl_socket_client-Wlto-type-mismatch.patch +Patch3153: ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -531,12 +525,7 @@ BuildRequires: pkgconfig(harfbuzz) >= 3 %if %{with harfbuzz_5} BuildRequires: pkgconfig(harfbuzz) >= 5 %endif -BuildRequires: pkgconfig(icu-i18n) >= 71 -%if %{with icu_73} BuildRequires: pkgconfig(icu-i18n) >= 73 -%else -BuildRequires: pkgconfig(icu-i18n) >= 71 -%endif BuildRequires: pkgconfig(jsoncpp) %if 0%{?fedora} Recommends: (ffmpeg-libs%{_isa} or libavcodec-freeworld%{_isa}) @@ -621,6 +610,7 @@ BuildRequires: spirv-headers BuildRequires: spirv-headers-devel %endif BuildRequires: pkgconfig(SPIRV-Tools) >= 2022.2 +BuildRequires: vulkan-headers >= 1.3 %endif %if %{with link_vulkan} BuildRequires: pkgconfig(vulkan) >= 1.3 @@ -760,10 +750,6 @@ patch -R -p1 < %SOURCE415 patch -R -p1 < %SOURCE416 %endif -%if %{without icu_73} -patch -R -p1 < %SOURCE417 -patch -R -p1 < %SOURCE418 -%endif %if %{without wayland_32} patch -R -p1 < %SOURCE450 @@ -912,7 +898,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=2 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" @@ -1005,8 +991,7 @@ gn_system_libraries+=( re2 ) find third_party/swiftshader/third_party/SPIRV-Headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete find third_party/swiftshader/third_party/SPIRV-Tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete -find third_party/vulkan-deps/spirv-headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete -find third_party/vulkan-deps/spirv-tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete +find third_party/vulkan-deps/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete gn_system_libraries+=( swiftshader-SPIRV-Headers @@ -1262,10 +1247,6 @@ myconf_gn+=" is_component_build=false" myconf_gn+=" use_sysroot=false" myconf_gn+=" fatal_linker_warnings=false" -#disable malloc interposer - bsc#1223366 -myconf_gn+=' use_allocator_shim=false' -myconf_gn+=' enable_backup_ref_ptr_support=false' -myconf_gn+=" use_partition_alloc=true" myconf_gn+=" disable_fieldtrial_testing_config=true" diff --git a/remove-sync.patch b/remove-sync.patch new file mode 100644 index 0000000..ec09f84 --- /dev/null +++ b/remove-sync.patch @@ -0,0 +1,279 @@ +Inspired by: +* https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=8a9d741f4c4cf8170d5c50a336d51fe5d1b16ce8 +* https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=6a11e9169f5889883bf63a3522d0c3f8f23552b0 + +--- src/components/search_engines/BUILD.gn.orig ++++ src/components/search_engines/BUILD.gn +@@ -66,7 +66,6 @@ static_library("search_engines") { + "//components/google/core/common", + "//components/keyed_service/core", + "//components/prefs", +- "//components/sync", + "//components/webdata/common", + "//third_party/metrics_proto", + ] +--- src/electron/BUILD.gn.orig ++++ src/electron/BUILD.gn +@@ -1204,6 +1204,8 @@ if (is_mac) { + "//electron/buildflags", + "//ui/strings", + ] ++ ++ assert_no_deps = [ "//components/sync/*" ] + + data = [] + data_deps = [] +--- src/electron/chromium_src/BUILD.gn.orig ++++ src/electron/chromium_src/BUILD.gn +@@ -493,7 +493,6 @@ source_set("chrome_spellchecker") { + "//base:base_static", + "//components/language/core/browser", + "//components/spellcheck:buildflags", +- "//components/sync", + ] + + public_deps += [ "//chrome/common:constants" ] +--- src/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc.orig ++++ src/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc +@@ -27,10 +27,6 @@ + #include "chrome/common/chrome_constants.h" + #include "components/spellcheck/browser/spellcheck_host_metrics.h" + #include "components/spellcheck/common/spellcheck_common.h" +-#include "components/sync/model/sync_change.h" +-#include "components/sync/model/sync_change_processor.h" +-#include "components/sync/protocol/dictionary_specifics.pb.h" +-#include "components/sync/protocol/entity_specifics.pb.h" + #include "content/public/browser/browser_task_traits.h" + #include "content/public/browser/browser_thread.h" + +@@ -256,7 +252,6 @@ bool SpellcheckCustomDictionary::AddWord + int result = dictionary_change->Sanitize(GetWords()); + Apply(*dictionary_change); + Notify(*dictionary_change); +- Sync(*dictionary_change); + Save(std::move(dictionary_change)); + return result == VALID_CHANGE; + } +@@ -268,7 +263,6 @@ bool SpellcheckCustomDictionary::RemoveW + int result = dictionary_change->Sanitize(GetWords()); + Apply(*dictionary_change); + Notify(*dictionary_change); +- Sync(*dictionary_change); + Save(std::move(dictionary_change)); + return result == VALID_CHANGE; + } +@@ -302,10 +296,12 @@ bool SpellcheckCustomDictionary::IsLoade + return is_loaded_; + } + ++#if 0 + bool SpellcheckCustomDictionary::IsSyncing() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + return !!sync_processor_.get(); + } ++#endif + + void SpellcheckCustomDictionary::Load() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +@@ -317,6 +313,7 @@ void SpellcheckCustomDictionary::Load() + weak_ptr_factory_.GetWeakPtr())); + } + ++#if 0 + void SpellcheckCustomDictionary::WaitUntilReadyToSync(base::OnceClosure done) { + DCHECK(!wait_until_ready_to_sync_cb_); + if (is_loaded_) +@@ -414,6 +411,7 @@ SpellcheckCustomDictionary::ProcessSyncC + base::WeakPtr SpellcheckCustomDictionary::AsWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); + } ++#endif + + SpellcheckCustomDictionary::LoadFileResult::LoadFileResult() + : is_valid_file(false) {} +@@ -460,7 +458,6 @@ void SpellcheckCustomDictionary::OnLoade + dictionary_change.AddWords(result->words); + dictionary_change.Sanitize(GetWords()); + Apply(dictionary_change); +- Sync(dictionary_change); + is_loaded_ = true; + if (wait_until_ready_to_sync_cb_) + std::move(wait_until_ready_to_sync_cb_).Run(); +@@ -507,6 +504,7 @@ void SpellcheckCustomDictionary::Save( + std::move(dictionary_change), custom_dictionary_path_)); + } + ++#if 0 + std::optional SpellcheckCustomDictionary::Sync( + const Change& dictionary_change) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +@@ -558,6 +556,7 @@ std::optional Spellc + + return std::nullopt; + } ++#endif + + void SpellcheckCustomDictionary::Notify(const Change& dictionary_change) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +--- src/chrome/browser/spellchecker/spellcheck_custom_dictionary.h.orig ++++ src/chrome/browser/spellchecker/spellcheck_custom_dictionary.h +@@ -17,9 +17,6 @@ + #include "base/observer_list.h" + #include "base/task/sequenced_task_runner.h" + #include "components/spellcheck/browser/spellcheck_dictionary.h" +-#include "components/sync/model/model_error.h" +-#include "components/sync/model/sync_data.h" +-#include "components/sync/model/syncable_service.h" + + namespace base { + class Location; +@@ -38,8 +35,7 @@ class SyncChangeProcessor; + // foo + // checksum_v1 = ec3df4034567e59e119fcf87f2d9bad4 + // +-class SpellcheckCustomDictionary final : public SpellcheckDictionary, +- public syncer::SyncableService { ++class SpellcheckCustomDictionary final : public SpellcheckDictionary { + public: + // A change to the dictionary. + class Change { +@@ -162,11 +158,11 @@ class SpellcheckCustomDictionary final : + bool IsLoaded(); + + // Returns true if the dictionary is being synced. Otherwise returns false. +- bool IsSyncing(); + + // Overridden from SpellcheckDictionary: + void Load() override; + ++#if 0 + // Overridden from syncer::SyncableService: + void WaitUntilReadyToSync(base::OnceClosure done) override; + std::optional MergeDataAndStartSyncing( +@@ -179,6 +175,7 @@ class SpellcheckCustomDictionary final : + const base::Location& from_here, + const syncer::SyncChangeList& change_list) override; + base::WeakPtr AsWeakPtr() override; ++#endif + + private: + friend class DictionarySyncIntegrationTestHelper; +@@ -217,7 +214,6 @@ class SpellcheckCustomDictionary final : + // Notifies the sync service of the |dictionary_change|. Syncs up to the + // maximum syncable words on the server. Disables syncing of this dictionary + // if the server contains the maximum number of syncable words. +- std::optional Sync(const Change& dictionary_change); + + // Notifies observers of the dictionary change if the dictionary has been + // changed. +@@ -236,7 +232,6 @@ class SpellcheckCustomDictionary final : + base::ObserverList::Unchecked observers_; + + // Used to send local changes to the sync infrastructure. +- std::unique_ptr sync_processor_; + + // True if the dictionary has been loaded. Otherwise false. + bool is_loaded_; +--- src/device/fido/BUILD.gn.orig ++++ src/device/fido/BUILD.gn +@@ -148,20 +148,6 @@ component("fido") { + "device_operation.h", + "device_response_converter.cc", + "device_response_converter.h", +- "enclave/constants.cc", +- "enclave/constants.h", +- "enclave/enclave_authenticator.cc", +- "enclave/enclave_authenticator.h", +- "enclave/enclave_discovery.cc", +- "enclave/enclave_discovery.h", +- "enclave/enclave_protocol_utils.cc", +- "enclave/enclave_protocol_utils.h", +- "enclave/enclave_websocket_client.cc", +- "enclave/enclave_websocket_client.h", +- "enclave/transact.cc", +- "enclave/transact.h", +- "enclave/types.cc", +- "enclave/types.h", + "fido_authenticator.cc", + "fido_authenticator.h", + "fido_device.cc", +@@ -229,7 +215,6 @@ component("fido") { + ] + + deps += [ +- "//components/sync/protocol:protocol", + "//services/device/public/cpp/hid", + "//services/device/public/cpp/usb", + "//services/device/public/mojom", +--- src/device/fido/fido_discovery_factory.cc.orig ++++ src/device/fido/fido_discovery_factory.cc +@@ -37,7 +37,7 @@ + #include "device/fido/cros/discovery.h" + #endif // BUILDFLAG(IS_CHROMEOS) + +-#if !BUILDFLAG(IS_CHROMEOS) ++#if 0 + #include "device/fido/enclave/enclave_discovery.h" + #endif + +@@ -108,7 +108,7 @@ std::vector + callback) { + enclave_passkey_creation_callback_ = callback; + } ++#endif + + void FidoDiscoveryFactory::set_enclave_ui_request_stream( + std::unique_ptr>& discoveries) { + if (!base::FeatureList::IsEnabled(kWebAuthnEnclaveAuthenticator) || +--- src/device/fido/fido_discovery_factory.h.orig ++++ src/device/fido/fido_discovery_factory.h +@@ -15,7 +15,6 @@ + #include "base/memory/raw_ptr.h" + #include "build/build_config.h" + #include "build/chromeos_buildflags.h" +-#include "components/sync/protocol/webauthn_credential_specifics.pb.h" + #include "device/fido/cable/cable_discovery_data.h" + #include "device/fido/cable/v2_constants.h" + #include "device/fido/ctap_get_assertion_request.h" +@@ -99,9 +98,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) Fido + + // Provides a callback that will be called when a passkey is created with + // the enclave authenticator in order to save the new passkey to sync data. +- void set_enclave_passkey_creation_callback( +- base::RepeatingCallback +- callback); + + void set_enclave_ui_request_stream( + std::unique_ptr hid_ignore_list_; +- base::RepeatingCallback +- enclave_passkey_creation_callback_; + std::unique_ptr>> + enclave_ui_request_stream_; diff --git a/v8-icu73-alt_calendar.patch b/v8-icu73-alt_calendar.patch deleted file mode 100644 index 7d12e24..0000000 --- a/v8-icu73-alt_calendar.patch +++ /dev/null @@ -1,164 +0,0 @@ -From d9715adf895e9acfbaf17ae05b18f2b2467ca322 Mon Sep 17 00:00:00 2001 -From: Frank Tang -Date: Tue, 20 Jun 2023 15:12:47 -0700 -Subject: [PATCH] [Intl] rm alt_calendar hack post ICU 73-1 - -Also need to bump up the required ICU version. - -Bug: v8:14086 -Change-Id: I52a53fcd201f3272aa712123fc00c54d0b762d53 -Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4628805 -Reviewed-by: Shu-yu Guo -Commit-Queue: Frank Tang -Cr-Commit-Position: refs/heads/main@{#88431} ---- - src/objects/intl-objects.h | 2 +- - src/objects/js-date-time-format-inl.h | 2 -- - src/objects/js-date-time-format.cc | 30 +++++++-------------------- - src/objects/js-date-time-format.h | 2 -- - src/objects/js-date-time-format.tq | 8 ------- - 5 files changed, 8 insertions(+), 36 deletions(-) - -diff --git a/src/objects/intl-objects.h b/src/objects/intl-objects.h -index 4339673d566..b628cf686f3 100644 ---- a/v8/src/objects/intl-objects.h -+++ b/v8/src/objects/intl-objects.h -@@ -21,7 +21,7 @@ - #include "unicode/locid.h" - #include "unicode/uversion.h" - --#define V8_MINIMUM_ICU_VERSION 71 -+#define V8_MINIMUM_ICU_VERSION 73 - - namespace U_ICU_NAMESPACE { - class BreakIterator; -diff --git a/src/objects/js-date-time-format-inl.h b/src/objects/js-date-time-format-inl.h -index 8c93a8eeb63..fefe081f8f5 100644 ---- a/v8/src/objects/js-date-time-format-inl.h -+++ b/v8/src/objects/js-date-time-format-inl.h -@@ -28,8 +28,6 @@ ACCESSORS(JSDateTimeFormat, icu_simple_date_format, - Tagged>, - kIcuDateIntervalFormatOffset) - --BOOL_ACCESSORS(JSDateTimeFormat, flags, alt_calendar, AltCalendarBit::kShift) -- - inline void JSDateTimeFormat::set_hour_cycle(HourCycle hour_cycle) { - int hints = flags(); - hints = HourCycleBits::update(hints, hour_cycle); -diff --git a/src/objects/js-date-time-format.cc b/src/objects/js-date-time-format.cc -index 62d6fdcb935..6aae75c8de8 100644 ---- a/v8/src/objects/js-date-time-format.cc -+++ b/v8/src/objects/js-date-time-format.cc -@@ -530,8 +530,7 @@ Handle JSDateTimeFormat::TimeZoneId(Isolate* isolate, - - namespace { - Handle GetCalendar(Isolate* isolate, -- const icu::SimpleDateFormat& simple_date_format, -- bool is_alt_calendar = false) { -+ const icu::SimpleDateFormat& simple_date_format) { - // getType() returns legacy calendar type name instead of LDML/BCP47 calendar - // key values. intl.js maps them to BCP47 values for key "ca". - // TODO(jshin): Consider doing it here, instead. -@@ -542,17 +541,9 @@ Handle GetCalendar(Isolate* isolate, - // and - // http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml - if (calendar_str == "gregorian") { -- if (is_alt_calendar) { -- calendar_str = "iso8601"; -- } else { -- calendar_str = "gregory"; -- } -+ calendar_str = "gregory"; - } else if (calendar_str == "ethiopic-amete-alem") { - calendar_str = "ethioaa"; -- } else if (calendar_str == "islamic") { -- if (is_alt_calendar) { -- calendar_str = "islamic-rgsa"; -- } - } - return isolate->factory()->NewStringFromAsciiChecked(calendar_str.c_str()); - } -@@ -567,8 +558,7 @@ Handle GetTimeZone(Isolate* isolate, - Handle JSDateTimeFormat::Calendar( - Isolate* isolate, Handle date_time_format) { - return GetCalendar(isolate, -- *(date_time_format->icu_simple_date_format()->raw()), -- date_time_format->alt_calendar()); -+ *(date_time_format->icu_simple_date_format()->raw())); - } - - Handle JSDateTimeFormat::TimeZone( -@@ -2328,9 +2318,6 @@ MaybeHandle JSDateTimeFormat::New( - icu_locale.setUnicodeKeywordValue("ca", calendar_str.get(), status); - DCHECK(U_SUCCESS(status)); - } -- bool alt_calendar = -- strstr(icu_locale.getName(), "calendar=iso8601") != nullptr || -- strstr(icu_locale.getName(), "calendar=islamic-rgsa") != nullptr; - - if (numbering_system_str != nullptr && - Intl::IsValidNumberingSystem(numbering_system_str.get())) { -@@ -2640,7 +2627,6 @@ MaybeHandle JSDateTimeFormat::New( - date_time_format->set_time_style(time_style); - } - date_time_format->set_hour_cycle(dateTimeFormatHourCycle); -- date_time_format->set_alt_calendar(alt_calendar); - date_time_format->set_locale(*locale_str); - date_time_format->set_icu_locale(*managed_locale); - date_time_format->set_icu_simple_date_format(*managed_format); -@@ -2742,10 +2728,8 @@ MaybeHandle FormatToPartsWithTemporalSupport( - DateTimeValueRecord x_record; - MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE( - isolate, x_record, -- HandleDateTimeValue( -- isolate, *format, -- GetCalendar(isolate, *format, date_time_format->alt_calendar()), x, -- method_name), -+ HandleDateTimeValue(isolate, *format, GetCalendar(isolate, *format), x, -+ method_name), - Handle()); - - return FormatMillisecondsByKindToArray(isolate, *format, x_record.kind, -@@ -3070,8 +3054,8 @@ MaybeHandle FormatRangeCommonWithTemporalSupport( - // 6. Let x be ? HandleDateTimeValue(dateTimeFormat, x). - icu::SimpleDateFormat* icu_simple_date_format = - date_time_format->icu_simple_date_format()->raw(); -- Handle date_time_format_calendar = GetCalendar( -- isolate, *icu_simple_date_format, date_time_format->alt_calendar()); -+ Handle date_time_format_calendar = -+ GetCalendar(isolate, *icu_simple_date_format); - DateTimeValueRecord x_record; - MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE( - isolate, x_record, -diff --git a/src/objects/js-date-time-format.h b/src/objects/js-date-time-format.h -index cdf87c2268a..ceebcc5e8f9 100644 ---- a/v8/src/objects/js-date-time-format.h -+++ b/v8/src/objects/js-date-time-format.h -@@ -150,8 +150,6 @@ class JSDateTimeFormat - DECL_ACCESSORS(icu_simple_date_format, Managed) - DECL_ACCESSORS(icu_date_interval_format, Managed) - -- DECL_BOOLEAN_ACCESSORS(alt_calendar) -- - DECL_PRINTER(JSDateTimeFormat) - - TQ_OBJECT_CONSTRUCTORS(JSDateTimeFormat) -diff --git a/src/objects/js-date-time-format.tq b/src/objects/js-date-time-format.tq -index ef0584e7901..6fab20c71d1 100644 ---- a/v8/src/objects/js-date-time-format.tq -+++ b/v8/src/objects/js-date-time-format.tq -@@ -10,14 +10,6 @@ bitfield struct JSDateTimeFormatFlags extends uint31 { - hour_cycle: HourCycle: 3 bit; - date_style: DateTimeStyle: 3 bit; - time_style: DateTimeStyle: 3 bit; -- // ICU report the same type "gregorian" for both "gregorian" calendar and -- // "iso8601" calendar and the same type "islamic" for both "islamic" and -- // "islamic-rgsa" calendar. We use the alt_calendar bit to distinguish between -- // them. When the type is "gregorian" and the alt_calendar bit is set, it is -- // "iso8601", otherwise the true "gregorian" calendar. While the type is -- // "islamic" and the alt_calendar bit is set, it is "islamic-rgsa" calendar, -- // otherwise "islamic" calendar. -- alt_calendar: bool: 1bit; - } - - extern class JSDateTimeFormat extends JSObject { diff --git a/v8-icu73-simple-case-folding.patch b/v8-icu73-simple-case-folding.patch deleted file mode 100644 index e9de641..0000000 --- a/v8-icu73-simple-case-folding.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 572b80f2e906a826a499c4c5561b90b97a687f0e Mon Sep 17 00:00:00 2001 -From: pthier -Date: Tue, 18 Jul 2023 16:27:28 +0200 -Subject: [PATCH] [regexp] Remove special handling for simple case folding - -ICU 73 introduced creating closures using simple case folding. -We can directly use this method instead of our own special handling where simple case folding (required by JS spec) differs from full case -folding (the previously only supported mode in ICU). - -Bug: v8:13377 -Change-Id: I42bbcc37fe5c1f33a1d6c36f0d4ceb18a67a9b43 -Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4694009 -Commit-Queue: Patrick Thier -Reviewed-by: Jakob Linke -Cr-Commit-Position: refs/heads/main@{#89024} ---- - src/regexp/gen-regexp-special-case.cc | 48 --------------------------- - src/regexp/regexp-ast.h | 6 ---- - src/regexp/regexp-compiler-tonode.cc | 24 +------------- - src/regexp/regexp-parser.cc | 2 +- - src/regexp/special-case.h | 10 ------ - 5 files changed, 2 insertions(+), 88 deletions(-) - -diff --git a/src/regexp/gen-regexp-special-case.cc b/src/regexp/gen-regexp-special-case.cc -index 55618f11783..86f6b212c93 100644 ---- a/v8/src/regexp/gen-regexp-special-case.cc -+++ b/v8/src/regexp/gen-regexp-special-case.cc -@@ -9,7 +9,6 @@ - - #include "src/base/strings.h" - #include "src/regexp/special-case.h" --#include "unicode/usetiter.h" - - namespace v8 { - namespace internal { -@@ -127,52 +126,6 @@ void PrintSpecial(std::ofstream& out) { - PrintSet(out, "SpecialAddSet", special_add); - } - --void PrintUnicodeSpecial(std::ofstream& out) { -- icu::UnicodeSet non_simple_folding; -- icu::UnicodeSet current; -- UErrorCode status = U_ZERO_ERROR; -- // Look at all characters except white spaces. -- icu::UnicodeSet interestingCP(u"[^[:White_Space:]]", status); -- CHECK_EQ(status, U_ZERO_ERROR); -- icu::UnicodeSetIterator iter(interestingCP); -- while (iter.next()) { -- UChar32 c = iter.getCodepoint(); -- current.set(c, c); -- current.closeOver(USET_CASE_INSENSITIVE).removeAllStrings(); -- CHECK(!current.isBogus()); -- // Remove characters from the closeover that have a simple case folding. -- icu::UnicodeSet toRemove; -- icu::UnicodeSetIterator closeOverIter(current); -- while (closeOverIter.next()) { -- UChar32 closeOverChar = closeOverIter.getCodepoint(); -- UChar32 closeOverSCF = u_foldCase(closeOverChar, U_FOLD_CASE_DEFAULT); -- if (closeOverChar != closeOverSCF) { -- toRemove.add(closeOverChar); -- } -- } -- CHECK(!toRemove.isBogus()); -- current.removeAll(toRemove); -- -- // The current character and its simple case folding are also always OK. -- UChar32 scf = u_foldCase(c, U_FOLD_CASE_DEFAULT); -- current.remove(c); -- current.remove(scf); -- -- // If there are any characters remaining, they were added due to full case -- // foldings and shouldn't match the current charcter according to the spec. -- if (!current.isEmpty()) { -- // Ensure that the character doesn't have a simple case folding. -- // Otherwise the current approach of simply removing the character from -- // the set before calling closeOver won't work. -- CHECK_EQ(c, scf); -- non_simple_folding.add(c); -- } -- } -- CHECK(!non_simple_folding.isBogus()); -- -- PrintSet(out, "UnicodeNonSimpleCloseOverSet", non_simple_folding); --} -- - void WriteHeader(const char* header_filename) { - std::ofstream out(header_filename); - out << std::hex << std::setfill('0') << std::setw(4); -@@ -193,7 +146,6 @@ void WriteHeader(const char* header_filename) { - << "namespace internal {\n\n"; - - PrintSpecial(out); -- PrintUnicodeSpecial(out); - - out << "\n" - << "} // namespace internal\n" -diff --git a/src/regexp/regexp-ast.h b/src/regexp/regexp-ast.h -index e7453ad3f8f..8e3bb12fce2 100644 ---- a/v8/src/regexp/regexp-ast.h -+++ b/v8/src/regexp/regexp-ast.h -@@ -134,12 +134,6 @@ class CharacterRange { - static void AddUnicodeCaseEquivalents(ZoneList* ranges, - Zone* zone); - --#ifdef V8_INTL_SUPPORT -- // Creates the closeOver of the given UnicodeSet, removing all -- // characters/strings that can't be derived via simple case folding. -- static void UnicodeSimpleCloseOver(icu::UnicodeSet& set); --#endif // V8_INTL_SUPPORT -- - bool Contains(base::uc32 i) const { return from_ <= i && i <= to_; } - base::uc32 from() const { return from_; } - base::uc32 to() const { return to_; } -diff --git a/src/regexp/regexp-compiler-tonode.cc b/src/regexp/regexp-compiler-tonode.cc -index 5ff16ee71d2..9c83e2332e8 100644 ---- a/v8/src/regexp/regexp-compiler-tonode.cc -+++ b/v8/src/regexp/regexp-compiler-tonode.cc -@@ -423,27 +423,6 @@ RegExpNode* UnanchoredAdvance(RegExpCompiler* compiler, - - } // namespace - --#ifdef V8_INTL_SUPPORT --// static --void CharacterRange::UnicodeSimpleCloseOver(icu::UnicodeSet& set) { -- // Remove characters for which closeOver() adds full-case-folding equivalents -- // because we should work only with simple case folding mappings. -- icu::UnicodeSet non_simple = icu::UnicodeSet(set); -- non_simple.retainAll(RegExpCaseFolding::UnicodeNonSimpleCloseOverSet()); -- set.removeAll(non_simple); -- -- set.closeOver(USET_CASE_INSENSITIVE); -- // Full case folding maps single characters to multiple characters. -- // Those are represented as strings in the set. Remove them so that -- // we end up with only simple and common case mappings. -- set.removeAllStrings(); -- -- // Add characters that have non-simple case foldings again (they match -- // themselves). -- set.addAll(non_simple); --} --#endif // V8_INTL_SUPPORT -- - // static - void CharacterRange::AddUnicodeCaseEquivalents(ZoneList* ranges, - Zone* zone) { -@@ -465,8 +444,7 @@ void CharacterRange::AddUnicodeCaseEquivalents(ZoneList* ranges, - } - // Clear the ranges list without freeing the backing store. - ranges->Rewind(0); -- -- UnicodeSimpleCloseOver(set); -+ set.closeOver(USET_SIMPLE_CASE_INSENSITIVE); - for (int i = 0; i < set.getRangeCount(); i++) { - ranges->Add(Range(set.getRangeStart(i), set.getRangeEnd(i)), zone); - } -diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc -index 76ca02bf240..730dfb9da86 100644 ---- a/v8/src/regexp/regexp-parser.cc -+++ b/v8/src/regexp/regexp-parser.cc -@@ -1897,7 +1897,7 @@ bool LookupPropertyValueName(UProperty property, - ExtractStringsFromUnicodeSet(set, result_strings, flags, zone); - } - const bool needs_case_folding = IsUnicodeSets(flags) && IsIgnoreCase(flags); -- if (needs_case_folding) CharacterRange::UnicodeSimpleCloseOver(set); -+ if (needs_case_folding) set.closeOver(USET_SIMPLE_CASE_INSENSITIVE); - set.removeAllStrings(); - if (negate) set.complement(); - for (int i = 0; i < set.getRangeCount(); i++) { -diff --git a/src/regexp/special-case.h b/src/regexp/special-case.h -index c80b94e976a..753c9231ede 100644 ---- a/v8/src/regexp/special-case.h -+++ b/v8/src/regexp/special-case.h -@@ -71,21 +71,11 @@ namespace internal { - // another character. Characters that match no other characters in - // their equivalence class are added to IgnoreSet. Characters that - // match at least one other character are added to SpecialAddSet. --// --// For unicode ignoreCase ("iu" and "iv"), --// UnicodeSet::closeOver(USET_CASE_INSENSITIVE) adds all characters that are in --// the same equivalence class. This includes characaters that are in the same --// equivalence class using full case folding. According to the spec, only --// simple case folding shall be considered. We therefore create --// UnicodeNonSimpleCloseOverSet containing all characters for which --// UnicodeSet::closeOver adds characters that are not simple case folds. This --// set should be used similar to IgnoreSet described above. - - class RegExpCaseFolding final : public AllStatic { - public: - static const icu::UnicodeSet& IgnoreSet(); - static const icu::UnicodeSet& SpecialAddSet(); -- static const icu::UnicodeSet& UnicodeNonSimpleCloseOverSet(); - - // This implements ECMAScript 2020 21.2.2.8.2 (Runtime Semantics: - // Canonicalize) step 3, which is used to determine whether -- 2.51.1 From 5968bbfa9c863bbb0fb04ff397af5a639af7dbe1a682c44366cca80ce0f6f7b8 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 13 Jun 2024 10:55:08 +0000 Subject: [PATCH 02/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=154 --- nodejs-electron.changes | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index f575062..c919f42 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Wed Jun 12 14:54:32 UTC 2024 - Bruno Pitrus -- Do not build //compunents/sync (remove-sync.patch) +- Do not build //components/sync (remove-sync.patch) - Add backported ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch to fix segfault due to type confusion (bsc#1223366 gh#electron/electron#41839) - Re-enable custom malloc now that the crash is fixed @@ -10,7 +10,6 @@ Wed Jun 12 14:54:32 UTC 2024 - Bruno Pitrus * drop v8-icu73-alt_calendar.patch * drop v8-icu73-simple-case-folding.patch - ------------------------------------------------------------------- Wed May 29 20:19:39 UTC 2024 - Bruno Pitrus -- 2.51.1 From bce97ac4544789e3091db524af1b5f1a3f9a4a88a8ba5a5cc8fcaa7d4091e0f6 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 13 Jun 2024 17:20:33 +0000 Subject: [PATCH 03/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=155 --- remove-sync.patch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/remove-sync.patch b/remove-sync.patch index ec09f84..f8fb342 100644 --- a/remove-sync.patch +++ b/remove-sync.patch @@ -1,3 +1,7 @@ +Do not build //components/sync with its massive protos. +It's unused in Electron (it's only there to support Google profile login) and dropping it saves about 1~2 MB binary size. + + Inspired by: * https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=8a9d741f4c4cf8170d5c50a336d51fe5d1b16ce8 * https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=6a11e9169f5889883bf63a3522d0c3f8f23552b0 -- 2.51.1 From b6d1cb6c105cc268a7e5b13caa4b6c04db269d8a95811b041132077d8912b653 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 13 Jun 2024 17:21:12 +0000 Subject: [PATCH 04/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=156 --- nodejs-electron.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index c919f42..99c13b2 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Wed Jun 12 14:54:32 UTC 2024 - Bruno Pitrus -- Do not build //components/sync (remove-sync.patch) +- Do not build //components/sync to reduce linker load and binary size (remove-sync.patch) - Add backported ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch to fix segfault due to type confusion (bsc#1223366 gh#electron/electron#41839) - Re-enable custom malloc now that the crash is fixed -- 2.51.1 From 5877211055805ca9f4e0d1173f8a6322dc9206f21f00be24d7abcba196075f88 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 29 Jun 2024 08:08:03 +0000 Subject: [PATCH 05/80] Accepting request 1183968 from home:dziobian:gulgul-ultron:19 - New upstream release 29.4.3 * Fixed an issue where navigator.usb.getDevices() could crash in some circumstances. * Fixed an issue where bad flags passed via --js-flags could cause a crash. * Fixed an issue where control could fail to return properly after saving a dialog using showOpenDialogSync on Linux. * Fixed an issue where some calls to WebUSB methods could crash. * Fixed potentially incorrect exit code in UtilityProcess. * Fixed support for multiple folder/file selection in //shell_dialogs portal implementation. * Security fixes for CVE-2024-5499 CVE-2024-5493 CVE-2024-5496 (bsc#1225690) * Security fixes for CVE-2024-5158 CVE-2024-5157 CVE-2024-5159 (bsc#1224818) * Security fixes for CVE-2024-6100 CVE-2024-6101 (bsc#1226504) - Correct .desktop file name to match the CHROME_DESKTOP environment variable. OBS-URL: https://build.opensuse.org/request/show/1183968 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=157 --- electron.desktop => Electron.desktop | 1 + electron-29.4.2.tar.zst | 3 --- electron-29.4.3.tar.zst | 3 +++ nodejs-electron.changes | 15 +++++++++++++++ nodejs-electron.spec | 8 ++++---- 5 files changed, 23 insertions(+), 7 deletions(-) rename electron.desktop => Electron.desktop (85%) delete mode 100644 electron-29.4.2.tar.zst create mode 100644 electron-29.4.3.tar.zst diff --git a/electron.desktop b/Electron.desktop similarity index 85% rename from electron.desktop rename to Electron.desktop index d95c629..bc41f16 100644 --- a/electron.desktop +++ b/Electron.desktop @@ -6,3 +6,4 @@ Exec=electron %u Categories=Development;GTK; NoDisplay=true StartupNotify=true +StartupWMClass=electron diff --git a/electron-29.4.2.tar.zst b/electron-29.4.2.tar.zst deleted file mode 100644 index 69f8795..0000000 --- a/electron-29.4.2.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:56fe6478254038ecc1060de6ca3cb1c5db3882b1c298d85b98b24974fb99cfeb -size 572715929 diff --git a/electron-29.4.3.tar.zst b/electron-29.4.3.tar.zst new file mode 100644 index 0000000..3a4dcaa --- /dev/null +++ b/electron-29.4.3.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f98d6f6f8f513591eb22f8afbc191b496059ce2c56b957fc50e769d6fbb0c84 +size 573606884 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 99c13b2..541a704 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri Jun 28 16:56:51 UTC 2024 - Bruno Pitrus + +- New upstream release 29.4.3 + * Fixed an issue where navigator.usb.getDevices() could crash in some circumstances. + * Fixed an issue where bad flags passed via --js-flags could cause a crash. + * Fixed an issue where control could fail to return properly after saving a dialog using showOpenDialogSync on Linux. + * Fixed an issue where some calls to WebUSB methods could crash. + * Fixed potentially incorrect exit code in UtilityProcess. + * Fixed support for multiple folder/file selection in //shell_dialogs portal implementation. + * Security fixes for CVE-2024-5499 CVE-2024-5493 CVE-2024-5496 (bsc#1225690) + * Security fixes for CVE-2024-5158 CVE-2024-5157 CVE-2024-5159 (bsc#1224818) + * Security fixes for CVE-2024-6100 CVE-2024-6101 (bsc#1226504) +- Correct .desktop file name to match the CHROME_DESKTOP environment variable. + ------------------------------------------------------------------- Wed Jun 12 14:54:32 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 5ebc8a2..e97a501 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -209,7 +209,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 29.4.2 +Version: 29.4.3 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -219,7 +219,7 @@ URL: https://github.com/electron/electron Source0: %{mod_name}-%{tag_version}.tar.zst Source1: create_tarball.sh Source10: electron-launcher.sh -Source11: electron.desktop +Source11: Electron.desktop # Reverse upstream changes to be able to build against ffmpeg-4 @@ -898,7 +898,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=4 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" @@ -1459,7 +1459,7 @@ ln -srv third_party -t out/Release %files %license electron/LICENSE out/Release/LICENSES.chromium.html %{_bindir}/electron -%{_datadir}/applications/electron.desktop +%{_datadir}/applications/Electron.desktop %{_datadir}/icons/hicolor/16x16/apps/electron.png %{_datadir}/icons/hicolor/32x32/apps/electron.png %{_datadir}/icons/hicolor/48x48/apps/electron.png -- 2.51.1 From b1444fb58759dd0ffc496d340d30d43509b19361dd29c7801d4e1d3848812bdc Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 4 Jul 2024 04:31:28 +0000 Subject: [PATCH 06/80] Accepting request 1185255 from home:dziobian:gulgul-ultron:19 - Fix use after free in content::RenderFrameHostImpl::RemoveDocumentService (bsc#1227307) * RenderFrameHostImpl-use-after-free.patch: correct second instance of the same bug - ix86, aarch64: pass --jitless in %electron_rebuild macro to work around crashes on OBS and unblock downstream packages OBS-URL: https://build.opensuse.org/request/show/1185255 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=158 --- RenderFrameHostImpl-use-after-free.patch | 15 +++++++++++++-- nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 8 +++++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/RenderFrameHostImpl-use-after-free.patch b/RenderFrameHostImpl-use-after-free.patch index d1cf3a2..3a6a658 100644 --- a/RenderFrameHostImpl-use-after-free.patch +++ b/RenderFrameHostImpl-use-after-free.patch @@ -1,6 +1,6 @@ --- src/content/browser/renderer_host/render_frame_host_impl.cc.orig 2023-02-08 21:38:09.974003318 +0100 +++ src/content/browser/renderer_host/render_frame_host_impl.cc 2023-02-13 14:13:50.217792624 +0100 -@@ -5,6 +5,7 @@ +@@ -8,6 +8,7 @@ #include #include #include @@ -8,7 +8,7 @@ #include #include #include -@@ -1876,7 +1877,12 @@ +@@ -1818,7 +1819,12 @@ RenderFrameHostImpl::~RenderFrameHostImp // `DocumentService` and `RenderFrameHostUserData` subclasses are still valid // when their destructors run. document_associated_data_->RemoveAllServices(); @@ -22,3 +22,14 @@ // If this was the last active frame in the SiteInstanceGroup, the // DecrementActiveFrameCount call will trigger the deletion of the +@@ -13254,7 +13260,9 @@ bool RenderFrameHostImpl::DidCommitNavig + // RenderFrameHost commits before the navigation commits. This happens + // when the current RenderFrameHost crashes before navigating to a new + // URL. +- document_associated_data_.emplace(*this, ++ // bsc#1227307 — same root cause as above ++ document_associated_data_->~DocumentAssociatedData(); ++ new(&document_associated_data_) std::optional(std::in_place, *this, + navigation_request->GetDocumentToken()); + } else { + // Cross-RenderFrameHost navigations that commit into a speculative diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 541a704..26ab0d4 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jul 4 04:27:14 UTC 2024 - Bruno Pitrus + +- Fix use after free in content::RenderFrameHostImpl::RemoveDocumentService (bsc#1227307) + * RenderFrameHostImpl-use-after-free.patch: correct second instance of the same bug +- ix86, aarch64: pass --jitless in %electron_rebuild macro to work around crashes on OBS and unblock downstream packages + ------------------------------------------------------------------- Fri Jun 28 16:56:51 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index e97a501..9058081 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -55,8 +55,10 @@ BuildArch: i686 #(all the widgets use Gtk unconditionally — not sure which of the changed codepaths are used in Electron) %bcond_with qt - - +%ifarch aarch64 %ix86 +#work around npm rebuild crashes on OBS +%global jitless NODE_OPTIONS=--jitless +%endif %ifarch aarch64 riscv64 #Video acceleration API to support. Useful for e.g. signal messenger. @@ -1409,7 +1411,7 @@ cp /dev/stdin %{buildroot}%{_rpmconfigdir}/macros.d/macros.electron <<"EOF" # Build native modules against Electron. This should be done as the first step in ‰build. You must set CFLAGS/LDFLAGS previously. # You can call it multiple times in different directories and pass more parameters to it (seen in vscode) -%%electron_rebuild PATH="%{_libexecdir}/electron-node:$PATH" npm rebuild --verbose --foreground-scripts --nodedir=%{_includedir}/electron +%%electron_rebuild %{?jitless} PATH="%{_libexecdir}/electron-node:$PATH" npm rebuild --verbose --foreground-scripts --nodedir=%{_includedir}/electron # Sanity check that native modules load. You must include this in ‰check if the package includes native modules (possibly in addition to actual test suites) # These do, in order: -- 2.51.1 From 44d4a158cc9cfb54a530498d3187d01926b26eeb2648ec6bb85335216fe96a87 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 12 Jul 2024 10:45:39 +0000 Subject: [PATCH 07/80] Accepting request 1187058 from home:dziobian:gulgul-ultron:19 - New upstream release 30.2.0 * Node 20.15.0 * Enabled the Windows Control Overlay API on Linux. * Expose systemPreferences to utilityProcess. * Fixed a focus issue when calling BrowserWindow.setTopBrowserView. * Fixed an issue where fetch-dependent interfaces could be missing in Web Workers with nodeIntegrationInWorker enabled. * Fixed an issue where control could fail to return properly after saving a dialog using showOpenDialogSync on Linux. * Fixes an issue where the user-specified default path did not work in some circumstances when using Linux dialogs. * Fixes potentially incorrect exit code in UtilityProcess. * (Leap 15.5) Fix heap buffer overflow in libaom (CVE-2024-5493 bsc#1225690) * Security fixes for V8: CVE-2024-6100, CVE-2024-6101 (bsc#1226504) * Fix use after free in Swiftshader (CVE-2024-6291 bsc#1226933) - Update to 30.1.2 XXXFIXMEXXX * ABI break: NODE_MODULE_VERSION is now 123 * Chromium 124.0.6367.243 * Node 20.14.0 * V8 12.4 * Added WebContentsView and BaseWindow, replacing the now-deprecated BrowserView APIs. * cross-origin iframes now use Permission Policy to access features * Removed: The --disable-color-correct-rendering switch * The inputFieldType property in the context-menu params has been removed * Removed: process.getIOCounters() * see https://www.electronjs.org/blog/electron-30-0 and https://github.com/electron/electron/releases/tag/v30.0.0 for more - Fedora: use bundled simdutf as the system version is too old - Drop no longer needed patches * chromium-122-avoid-SFINAE-TypeConverter.patch * chromium-122-BookmarkNode-missing-operator.patch * chromium-98-EnumTable-crash.patch * chromium-gcc11.patch * CVE-2024-30260-undici-clear-proxy-authorization.patch * CVE-2024-30261-undici-fetch-integrity.patch * ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch * grid_sizing_tree-Wchanges-meaning.patch * hit_test_request-missing-optional.patch * InternalAllocator-too-many-initializers.patch * material_color_utilities-tones-missing-round.patch * nested-nested-nested-nested-nested-nested-regex-patterns.patch * perfetto-numeric_storage-double_t.patch * plus_address_types-missing-optional.patch * race_network_request_write_buffer_manager-missing-optional.patch * resolution_monitor-missing-bitset.patch * script_promise_resolver-explicit-specialization.patch * search_engine_choice_service-missing-optional.patch * text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch * v8-instance-type-inl-constexpr-used-before-its-definition.patch - Drop no longer needed -Wno-error=narrowing from CXXFLAGS - Add patches to fix build * chromium-124-shims.patch * enable_stack_trace_line_numbers-symbol_level.patch * angle-FramebufferVk-powf.patch * licenses.py-FileNotFoundError.patch * span_reader-missing-optional.patch * bitset-missing-uint8_t-memcpy.patch * temporal_scalability_id_extractor-missing-bitset.patch * gpu_adapter_info-missing-optional.patch * first_party_sets_handler_database_helper-missing-optional.patch * async_iterable-forwarding.patch * preview_cancel_reason-missing-string.patch * script_streamer-atomic-include.patch - Add -Wno-packed-not-aligned -Wno-address to CXXFLAGS to suppress build logspam - Add libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch to build with old libaom - Add backported DesktopNativeWidgetAura-HandleActivationChanged-crash.patch - Revert upstream changes which introduce a use-after-free bug causing crashes (bsc#1224178 deb#1067886) * bad-font-gc0000.patch * bad-font-gc000.patch * bad-font-gc00.patch * bad-font-gc0.patch * bad-font-gc11.patch * bad-font-gc1.patch * bad-font-gc2.patch * bad-font-gc3.patch OBS-URL: https://build.opensuse.org/request/show/1187058 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=159 --- ...260-undici-clear-proxy-authorization.patch | 25 - CVE-2024-30261-undici-fetch-integrity.patch | 136 - ...etAura-HandleActivationChanged-crash.patch | 33 + ...inux-OnWindowTiledStateChanged-crash.patch | 40 - InternalAllocator-too-many-initializers.patch | 55 - angle-FramebufferVk-powf.patch | 39 + aom-vpx-no-thread-wrapper.patch | 14 +- async_iterable-forwarding.patch | 98 + bad-font-gc0.patch | 250 ++ bad-font-gc00.patch | 159 + bad-font-gc000.patch | 107 + bad-font-gc0000.patch | 425 ++ bad-font-gc1.patch | 258 ++ bad-font-gc11.patch | 411 ++ bad-font-gc2.patch | 3715 +++++++++++++++++ bad-font-gc3.patch | 38 + base-system-nspr.patch | 2 +- bitset-missing-uint8_t-memcpy.patch | 46 + brotli-remove-shared-dictionary.patch | 6 +- build-without-extensions.patch | 12 +- chromium-102-compiler.patch | 59 +- ...um-122-BookmarkNode-missing-operator.patch | 32 - chromium-122-avoid-SFINAE-TypeConverter.patch | 80 - chromium-124-shims.patch | 215 + chromium-98-EnumTable-crash.patch | 76 - chromium-gcc11.patch | 37 - chromium-remove-bundled-roboto-font.patch | 2 +- crashpad-use-system-abseil.patch | 6 +- create_tarball.sh | 2 +- disable-catapult.patch | 2 +- disable-webspeech.patch | 4 +- electron-16-std-vector-non-const.patch | 13 +- electron-29.4.3.tar.zst | 3 - electron-30.2.0.tar.zst | 3 + ...tack_trace_line_numbers-symbol_level.patch | 25 + ...ler_database_helper-missing-optional.patch | 31 + gpu_adapter_info-missing-optional.patch | 32 + grid_sizing_tree-Wchanges-meaning.patch | 37 - harfbuzz-replace-chromium-scoped-type.patch | 9 - hit_test_request-missing-optional.patch | 29 - ...7-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch | 13 + licenses.py-FileNotFoundError.patch | 33 + ..._color_utilities-tones-missing-round.patch | 10 - ...-nested-nested-nested-regex-patterns.patch | 44 - node-compiler.patch | 89 +- nodejs-electron.changes | 80 + nodejs-electron.spec | 87 +- perfetto-numeric_storage-double_t.patch | 14 - plus_address_types-missing-optional.patch | 31 - preview_cancel_reason-missing-string.patch | 11 + ...rite_buffer_manager-missing-optional.patch | 32 - remove-dawn.patch | 10 +- remove-password-manager-and-policy.patch | 6 +- remove-puffin.patch | 22 +- remove-rust.patch | 130 +- resolution_monitor-missing-bitset.patch | 32 - ...ise_resolver-explicit-specialization.patch | 115 - script_streamer-atomic-include.patch | 39 + ...gine_choice_service-missing-optional.patch | 32 - skia-system-vulkan-headers.patch | 4 +- span_reader-missing-optional.patch | 32 + system-pydeps.patch | 2 +- ...lability_id_extractor-missing-bitset.patch | 32 + ...BreakClassTable-should-be-consistent.patch | 148 - ...constexpr-used-before-its-definition.patch | 45 - wayland-proto-31-cursor-shape.patch | 265 +- 66 files changed, 6366 insertions(+), 1558 deletions(-) delete mode 100644 CVE-2024-30260-undici-clear-proxy-authorization.patch delete mode 100644 CVE-2024-30261-undici-fetch-integrity.patch create mode 100644 DesktopNativeWidgetAura-HandleActivationChanged-crash.patch delete mode 100644 ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch delete mode 100644 InternalAllocator-too-many-initializers.patch create mode 100644 angle-FramebufferVk-powf.patch create mode 100644 async_iterable-forwarding.patch create mode 100644 bad-font-gc0.patch create mode 100644 bad-font-gc00.patch create mode 100644 bad-font-gc000.patch create mode 100644 bad-font-gc0000.patch create mode 100644 bad-font-gc1.patch create mode 100644 bad-font-gc11.patch create mode 100644 bad-font-gc2.patch create mode 100644 bad-font-gc3.patch create mode 100644 bitset-missing-uint8_t-memcpy.patch delete mode 100644 chromium-122-BookmarkNode-missing-operator.patch delete mode 100644 chromium-122-avoid-SFINAE-TypeConverter.patch create mode 100644 chromium-124-shims.patch delete mode 100644 chromium-98-EnumTable-crash.patch delete mode 100644 chromium-gcc11.patch delete mode 100644 electron-29.4.3.tar.zst create mode 100644 electron-30.2.0.tar.zst create mode 100644 enable_stack_trace_line_numbers-symbol_level.patch create mode 100644 first_party_sets_handler_database_helper-missing-optional.patch create mode 100644 gpu_adapter_info-missing-optional.patch delete mode 100644 grid_sizing_tree-Wchanges-meaning.patch delete mode 100644 hit_test_request-missing-optional.patch create mode 100644 libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch create mode 100644 licenses.py-FileNotFoundError.patch delete mode 100644 material_color_utilities-tones-missing-round.patch delete mode 100644 nested-nested-nested-nested-nested-nested-regex-patterns.patch delete mode 100644 perfetto-numeric_storage-double_t.patch delete mode 100644 plus_address_types-missing-optional.patch create mode 100644 preview_cancel_reason-missing-string.patch delete mode 100644 race_network_request_write_buffer_manager-missing-optional.patch delete mode 100644 resolution_monitor-missing-bitset.patch delete mode 100644 script_promise_resolver-explicit-specialization.patch create mode 100644 script_streamer-atomic-include.patch delete mode 100644 search_engine_choice_service-missing-optional.patch create mode 100644 span_reader-missing-optional.patch create mode 100644 temporal_scalability_id_extractor-missing-bitset.patch delete mode 100644 text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch delete mode 100644 v8-instance-type-inl-constexpr-used-before-its-definition.patch diff --git a/CVE-2024-30260-undici-clear-proxy-authorization.patch b/CVE-2024-30260-undici-clear-proxy-authorization.patch deleted file mode 100644 index a626702..0000000 --- a/CVE-2024-30260-undici-clear-proxy-authorization.patch +++ /dev/null @@ -1,25 +0,0 @@ -Manual backport of https://github.com/nodejs/undici/commit/6805746680d27a5369d7fb67bc05f95a28247d75 - ---- src/third_party/electron_node/deps/undici/src/lib/handler/RedirectHandler.js.old 2024-04-04 09:55:39.696980900 +0000 -+++ src/third_party/electron_node/deps/undici/src/lib/handler/RedirectHandler.js 2024-04-09 16:52:37.888616200 +0000 -@@ -188,7 +188,8 @@ function shouldRemoveHeader (header, rem - (header.length === 4 && header.toString().toLowerCase() === 'host') || - (removeContent && header.toString().toLowerCase().indexOf('content-') === 0) || - (unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') || -- (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') -+ (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie') || -+ (unknownOrigin && header.length === 19 && header.toString().toLowerCase() === 'proxy-authorization') - ) - } - ---- src/third_party/electron_node/deps/undici/undici.js.old 2024-04-04 10:02:38.059765300 +0000 -+++ src/third_party/electron_node/deps/undici/undici.js 2024-04-09 16:51:15.754041100 +0000 -@@ -7902,7 +7902,7 @@ var require_RedirectHandler = __commonJS - } - __name(parseLocation, "parseLocation"); - function shouldRemoveHeader(header, removeContent, unknownOrigin) { -- return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie"; -+ return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie" || unknownOrigin && header.length === 19 && header.toString().toLowerCase() === "proxy-authorization" - } - __name(shouldRemoveHeader, "shouldRemoveHeader"); - function cleanRequestHeaders(headers, removeContent, unknownOrigin) { diff --git a/CVE-2024-30261-undici-fetch-integrity.patch b/CVE-2024-30261-undici-fetch-integrity.patch deleted file mode 100644 index f26faa2..0000000 --- a/CVE-2024-30261-undici-fetch-integrity.patch +++ /dev/null @@ -1,136 +0,0 @@ -Port https://github.com/nodejs/undici/commit/d542b8c to apply to amalgamated undici code in nodejs (the original copy in deps/undici/src is not used and i'm not bothering with patching it) - -These chunks were manually cherry-picked from upstream nodejs commit https://github.com/nodejs/node/commit/60d24938 to match the undici changes. - - ---- a/third_party/electron_node/deps/undici/undici.js -+++ b/third_party/electron_node/deps/undici/undici.js -@@ -992,9 +992,12 @@ var require_util2 = __commonJS({ - var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util(); - var assert = require("assert"); - var { isUint8Array } = require("util/types"); -+ var supportedHashes = []; - var crypto; - try { - crypto = require("crypto"); -+ const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; -+ supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); - } catch { - } - function responseURL(response) { -@@ -1277,46 +1280,38 @@ var require_util2 = __commonJS({ - if (parsedMetadata.length === 0) { - return true; - } -- const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)); -- const strongest = list[0].algo; -- const metadata = list.filter((item) => item.algo === strongest); -+ const strongest = getStrongestMetadata(parsedMetadata); -+ const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); - for (const item of metadata) { - const algorithm = item.algo; -- let expectedValue = item.hash; -- if (expectedValue.endsWith("==")) { -- expectedValue = expectedValue.slice(0, -2); -- } -+ const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); -- if (actualValue.endsWith("==")) { -- actualValue = actualValue.slice(0, -2); -- } -- if (actualValue === expectedValue) { -- return true; -- } -- let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest("base64url"); -- if (actualBase64URL.endsWith("==")) { -- actualBase64URL = actualBase64URL.slice(0, -2); -+ if (actualValue[actualValue.length - 1] === "=") { -+ if (actualValue[actualValue.length - 2] === "=") { -+ actualValue = actualValue.slice(0, -2); -+ } else { -+ actualValue = actualValue.slice(0, -1); -+ } - } -- if (actualBase64URL === expectedValue) { -+ if (compareBase64Mixed(actualValue, expectedValue)) { - return true; - } - } - return false; - } - __name(bytesMatch, "bytesMatch"); -- var parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i; -+ var parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; - function parseMetadata(metadata) { - const result = []; - let empty = true; -- const supportedHashes = crypto.getHashes(); - for (const token of metadata.split(" ")) { - empty = false; - const parsedToken = parseHashWithOptions.exec(token); -- if (parsedToken === null || parsedToken.groups === void 0) { -+ if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) { - continue; - } -- const algorithm = parsedToken.groups.algo; -- if (supportedHashes.includes(algorithm.toLowerCase())) { -+ const algorithm = parsedToken.groups.algo.toLowerCase(); -+ if (supportedHashes.includes(algorithm)) { - result.push(parsedToken.groups); - } - } -@@ -1326,6 +1321,54 @@ var require_util2 = __commonJS({ - return result; - } - __name(parseMetadata, "parseMetadata"); -+ function getStrongestMetadata(metadataList) { -+ let algorithm = metadataList[0].algo; -+ if (algorithm[3] === "5") { -+ return algorithm; -+ } -+ for (let i = 1; i < metadataList.length; ++i) { -+ const metadata = metadataList[i]; -+ if (metadata.algo[3] === "5") { -+ algorithm = "sha512"; -+ break; -+ } else if (algorithm[3] === "3") { -+ continue; -+ } else if (metadata.algo[3] === "3") { -+ algorithm = "sha384"; -+ } -+ } -+ return algorithm; -+ } -+ __name(getStrongestMetadata, "getStrongestMetadata"); -+ function filterMetadataListByAlgorithm(metadataList, algorithm) { -+ if (metadataList.length === 1) { -+ return metadataList; -+ } -+ let pos = 0; -+ for (let i = 0; i < metadataList.length; ++i) { -+ if (metadataList[i].algo === algorithm) { -+ metadataList[pos++] = metadataList[i]; -+ } -+ } -+ metadataList.length = pos; -+ return metadataList; -+ } -+ __name(filterMetadataListByAlgorithm, "filterMetadataListByAlgorithm"); -+ function compareBase64Mixed(actualValue, expectedValue) { -+ if (actualValue.length !== expectedValue.length) { -+ return false; -+ } -+ for (let i = 0; i < actualValue.length; ++i) { -+ if (actualValue[i] !== expectedValue[i]) { -+ if (actualValue[i] === "+" && expectedValue[i] === "-" || actualValue[i] === "/" && expectedValue[i] === "_") { -+ continue; -+ } -+ return false; -+ } -+ } -+ return true; -+ } -+ __name(compareBase64Mixed, "compareBase64Mixed"); - function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) { - } - __name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL"); diff --git a/DesktopNativeWidgetAura-HandleActivationChanged-crash.patch b/DesktopNativeWidgetAura-HandleActivationChanged-crash.patch new file mode 100644 index 0000000..e1250ee --- /dev/null +++ b/DesktopNativeWidgetAura-HandleActivationChanged-crash.patch @@ -0,0 +1,33 @@ +From f9819bb70b413c8310cd209c75cc555495e28564 Mon Sep 17 00:00:00 2001 +From: Allen Bauer +Date: Fri, 31 May 2024 15:55:13 +0000 +Subject: [PATCH] Harden DesktopNativeWidgetAura against a destroyed Widget. + +Under CLIENT_OWNS_WIDGET ownership mode, it is possible for the Widget to have already been destroyed. This hardens the NativeWidget to handle this case without crashing. + +Bug: 40242079, 40232479 +Change-Id: I455e1690b49ff50e4eac3b9a085d9f15ccb6adec +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5585758 +Code-Coverage: findit-for-me@appspot.gserviceaccount.com +Reviewed-by: Thomas Anderson +Commit-Queue: Allen Bauer +Cr-Commit-Position: refs/heads/main@{#1308668} +--- + ui/views/widget/desktop_aura/desktop_native_widget_aura.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +index 9ae19505357c6b..1974865e8c8a8f 100644 +--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ++++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +@@ -431,8 +431,8 @@ DesktopNativeWidgetAura::tooltip_controller() { + } + + void DesktopNativeWidgetAura::HandleActivationChanged(bool active) { +- DCHECK(native_widget_delegate_); +- if (!native_widget_delegate_->ShouldHandleNativeWidgetActivationChanged( ++ if (!native_widget_delegate_ || ++ !native_widget_delegate_->ShouldHandleNativeWidgetActivationChanged( + active)) { + return; + } diff --git a/ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch b/ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch deleted file mode 100644 index b06b5c3..0000000 --- a/ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch +++ /dev/null @@ -1,40 +0,0 @@ -From e9eda8f8456c98e3c3a438bfd2ff41d90f59a8ec Mon Sep 17 00:00:00 2001 -From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> -Date: Tue, 14 May 2024 21:26:51 +0000 -Subject: [PATCH] Fix cast in ElectronDesktopWindowTreeHostLinux - -The frame view of the widget is an `ClientFrameViewLinux` instance only -when both `frame` and `client_frame` booleans are set to `true`. -Otherwise it is an instance of a different class and thus casting to -`ClientFrameViewLinux` is incorrect and leads to crashes. - -Fix: #41839 - -Co-authored-by: Fedor Indutny ---- - .../ui/electron_desktop_window_tree_host_linux.cc | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/shell/browser/ui/electron_desktop_window_tree_host_linux.cc b/shell/browser/ui/electron_desktop_window_tree_host_linux.cc -index cfc87f6fb7efd..17936ba352a1c 100644 ---- a/electron/shell/browser/ui/electron_desktop_window_tree_host_linux.cc -+++ b/electron/shell/browser/ui/electron_desktop_window_tree_host_linux.cc -@@ -71,9 +71,15 @@ void ElectronDesktopWindowTreeHostLinux::OnWindowStateChanged( - - void ElectronDesktopWindowTreeHostLinux::OnWindowTiledStateChanged( - ui::WindowTiledEdges new_tiled_edges) { -- static_cast( -- native_window_view_->widget()->non_client_view()->frame_view()) -- ->set_tiled_edges(new_tiled_edges); -+ // CreateNonClientFrameView creates `ClientFrameViewLinux` only when both -+ // frame and client_frame booleans are set, otherwise it is a different type -+ // of view. -+ if (native_window_view_->has_frame() && -+ native_window_view_->has_client_frame()) { -+ static_cast( -+ native_window_view_->widget()->non_client_view()->frame_view()) -+ ->set_tiled_edges(new_tiled_edges); -+ } - UpdateFrameHints(); - } - diff --git a/InternalAllocator-too-many-initializers.patch b/InternalAllocator-too-many-initializers.patch deleted file mode 100644 index 2893ad3..0000000 --- a/InternalAllocator-too-many-initializers.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ee6e6d3e45af1f7210e144a17f14fb21a7e86588 Mon Sep 17 00:00:00 2001 -From: mikt -Date: Tue, 30 Jan 2024 03:09:24 +0000 -Subject: [PATCH] [PA] Fix InternalAllocator for GCC builds - -Internal Allocator has a few missing member functions, that are required -as a part of named requirement Allocator. -https://en.cppreference.com/w/cpp/named_req/Allocator - -It broke builds on GCC, so adding these to fix. -https://crrev.com/c/5196856/comments/0c4bbfd9_6433016b - -Change-Id: Ifce5f3e47c94c7bb1e298ac4cd7d0d1e4c6de59c -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5231905 -Commit-Queue: Mikihito Matsuura -Reviewed-by: Kalvin Lee -Reviewed-by: Takashi Sakamoto -Cr-Commit-Position: refs/heads/main@{#1253709} ---- - .../internal_allocator_forward.h | 21 +++++++++++++++---- - 1 file changed, 17 insertions(+), 4 deletions(-) - -diff --git a/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h b/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h -index 45fec29f8cc93..b31a145ff6e99 100644 ---- a/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h -+++ b/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h -@@ -27,11 +27,24 @@ PartitionRoot& InternalAllocatorRoot(); - template - class InternalAllocator { - public: -- // Member types required by allocator completeness requirements. - using value_type = T; -- using size_type = std::size_t; -- using difference_type = std::ptrdiff_t; -- using propagate_on_container_move_assignment = std::true_type; -+ using is_always_equal = std::true_type; -+ -+ InternalAllocator() = default; -+ -+ template -+ InternalAllocator(const InternalAllocator&) {} // NOLINT -+ -+ template -+ InternalAllocator& operator=(const InternalAllocator&) { -+ return *this; -+ } -+ -+ template -+ bool operator==(const InternalAllocator&) { -+ // InternalAllocator can free allocations made by InternalAllocator. -+ return true; -+ } - - value_type* allocate(std::size_t count); - diff --git a/angle-FramebufferVk-powf.patch b/angle-FramebufferVk-powf.patch new file mode 100644 index 0000000..7d1c0db --- /dev/null +++ b/angle-FramebufferVk-powf.patch @@ -0,0 +1,39 @@ +From 2f934a47e9709cac9ce04d312b7aa496948bced6 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Mon, 18 Mar 2024 12:53:27 +0100 +Subject: [PATCH] libstdc++: replace std::powf with std:pow + +libstdc++ before GCC 14 does not provide std::powf. So replace the +call with std::pow, that provides an overload for floats. + +For reference of the bug tracking the missing methods in libstdc++: +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700 + +Bug: chromium:41455655 +Change-Id: Idfb53fe3c71f4dc0198cf6ba3e26c07895f65bc6 +Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5379670 +Commit-Queue: Shahbaz Youssefi +Reviewed-by: Shahbaz Youssefi +--- + src/libANGLE/renderer/vulkan/FramebufferVk.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp +index 98831436adb..e88339521e6 100644 +--- a/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp ++++ b/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp +@@ -1726,10 +1726,10 @@ angle::Result FramebufferVk::generateFragmentShadingRateWithCPU( + for (uint32_t point = 0; point < activeFocalPoints.size(); point++) + { + float density = +- 1.0f / std::max(std::powf(activeFocalPoints[point].focalX - px, 2) * +- std::powf(activeFocalPoints[point].gainX, 2) + +- std::powf(activeFocalPoints[point].focalY - py, 2) * +- std::powf(activeFocalPoints[point].gainY, 2) - ++ 1.0f / std::max(std::pow(activeFocalPoints[point].focalX - px, 2.0f) * ++ std::pow(activeFocalPoints[point].gainX, 2.0f) + ++ std::pow(activeFocalPoints[point].focalY - py, 2.0f) * ++ std::pow(activeFocalPoints[point].gainY, 2.0f) - + activeFocalPoints[point].foveaArea, + 1.0f); + diff --git a/aom-vpx-no-thread-wrapper.patch b/aom-vpx-no-thread-wrapper.patch index 3d5c583..b8f594e 100644 --- a/aom-vpx-no-thread-wrapper.patch +++ b/aom-vpx-no-thread-wrapper.patch @@ -2,7 +2,7 @@ Remove this code which is disabled (media/base/media_switches.cc) and depends on --- src/media/base/libaom_thread_wrapper.cc.old 2024-04-02 09:53:17.097624400 +0000 +++ src/media/base/libaom_thread_wrapper.cc 2024-04-08 17:15:53.578155000 +0000 -@@ -5,16 +5,8 @@ +@@ -5,17 +5,8 @@ #include "base/logging.h" #include "media/base/codec_worker_impl.h" #include "media/base/libvpx_thread_wrapper.h" @@ -13,15 +13,16 @@ Remove this code which is disabled (media/base/media_switches.cc) and depends on -void InitLibAomThreadWrapper() { - const AVxWorkerInterface interface = - CodecWorkerImpl::GetCodecWorkerInterface(); +- AVxWorkerStatus, AVX_WORKER_STATUS_NOT_OK, +- AVX_WORKER_STATUS_OK, +- AVX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface(); - CHECK(aom_set_worker_interface(&interface)); -} } // namespace media --- src/media/base/libvpx_thread_wrapper.cc.old 2024-04-02 09:53:17.097624400 +0000 +++ src/media/base/libvpx_thread_wrapper.cc 2024-04-08 17:15:46.565471400 +0000 -@@ -5,17 +5,8 @@ +@@ -5,18 +5,8 @@ #include "media/base/libvpx_thread_wrapper.h" #include "media/base/codec_worker_impl.h" @@ -32,8 +33,9 @@ Remove this code which is disabled (media/base/media_switches.cc) and depends on -void InitLibVpxThreadWrapper() { - const VPxWorkerInterface interface = - CodecWorkerImpl::GetCodecWorkerInterface(); +- VPxWorkerStatus, VPX_WORKER_STATUS_NOT_OK, +- VPX_WORKER_STATUS_OK, +- VPX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface(); - - CHECK(vpx_set_worker_interface(&interface)); -} diff --git a/async_iterable-forwarding.patch b/async_iterable-forwarding.patch new file mode 100644 index 0000000..128755a --- /dev/null +++ b/async_iterable-forwarding.patch @@ -0,0 +1,98 @@ +From e4d212302ed2e71c224ae67bdaf2a2816be34f21 Mon Sep 17 00:00:00 2001 +From: Mattias Buelens +Date: Tue, 26 Mar 2024 19:25:54 +0000 +Subject: [PATCH] streams: Fix gcc compatibility for + ReadableStream::valuesForBinding() + +The perfect forwarding technique we used turned out to be incompatible +with gcc. Revert to something simpler. + +Bug: 40612900 +Change-Id: I45f3588354fe96159c7f84d969ac222a935b1c1a +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5372645 +Reviewed-by: Adam Rice +Reviewed-by: Yuki Shiino +Commit-Queue: Adam Rice +Cr-Commit-Position: refs/heads/main@{#1278534} +--- + .../bindings/core/v8/async_iterable.h | 32 +++++++++---------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/third_party/blink/renderer/bindings/core/v8/async_iterable.h b/third_party/blink/renderer/bindings/core/v8/async_iterable.h +index 115ee5303414c..8a0d085b8174e 100644 +--- a/third_party/blink/renderer/bindings/core/v8/async_iterable.h ++++ b/third_party/blink/renderer/bindings/core/v8/async_iterable.h +@@ -200,42 +200,42 @@ class PairAsyncIterable { + PairAsyncIterable(const PairAsyncIterable&) = delete; + PairAsyncIterable& operator=(const PairAsyncIterable&) = delete; + ++ template + AsyncIteratorType* keysForBinding( + ScriptState* script_state, +- std::convertible_to auto&&... args, +- ExceptionState& exception_state) { ++ ArgsAndExceptionState&&... args_and_exception_state) { + const auto kind = IterationSource::Kind::kKey; + IterationSource* source = CreateIterationSource( +- script_state, kind, std::forward(args)..., +- exception_state); ++ script_state, kind, ++ std::forward(args_and_exception_state)...); + if (!source) { + return nullptr; + } + return MakeGarbageCollected(source); + } + ++ template + AsyncIteratorType* valuesForBinding( + ScriptState* script_state, +- std::convertible_to auto&&... args, +- ExceptionState& exception_state) { ++ ArgsAndExceptionState&&... args_and_exception_state) { + const auto kind = IterationSource::Kind::kValue; + IterationSource* source = CreateIterationSource( +- script_state, kind, std::forward(args)..., +- exception_state); ++ script_state, kind, ++ std::forward(args_and_exception_state)...); + if (!source) { + return nullptr; + } + return MakeGarbageCollected(source); + } + ++ template + AsyncIteratorType* entriesForBinding( + ScriptState* script_state, +- std::convertible_to auto&&... args, +- ExceptionState& exception_state) { ++ ArgsAndExceptionState&&... args_and_exception_state) { + const auto kind = IterationSource::Kind::kKeyValue; + IterationSource* source = CreateIterationSource( +- script_state, kind, std::forward(args)..., +- exception_state); ++ script_state, kind, ++ std::forward(args_and_exception_state)...); + if (!source) { + return nullptr; + } +@@ -274,14 +274,14 @@ class ValueAsyncIterable { + ValueAsyncIterable(const ValueAsyncIterable&) = delete; + ValueAsyncIterable& operator=(const ValueAsyncIterable&) = delete; + ++ template + AsyncIteratorType* valuesForBinding( + ScriptState* script_state, +- std::convertible_to auto&&... args, +- ExceptionState& exception_state) { ++ ArgsAndExceptionState&&... args_and_exception_state) { + const auto kind = IterationSource::Kind::kValue; + IterationSource* source = CreateIterationSource( +- script_state, kind, std::forward(args)..., +- exception_state); ++ script_state, kind, ++ std::forward(args_and_exception_state)...); + if (!source) { + return nullptr; + } diff --git a/bad-font-gc0.patch b/bad-font-gc0.patch new file mode 100644 index 0000000..e140e68 --- /dev/null +++ b/bad-font-gc0.patch @@ -0,0 +1,250 @@ +Revert the following commit: + +commit 886c849ee96e3026d28d7615cdd5af9628a2e5c8 +Author: Ian Kilpatrick +Date: Tue Feb 20 18:18:04 2024 +0000 + + [gc] Make UnicodeRangeSet gc'd. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: I7f0003b7ff7c464d4ee36442bcff8c63da79b20c + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302778 + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1262789} + +--- a/third_party/blink/renderer/core/css/css_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_font_face.cc +@@ -291,7 +291,6 @@ bool CSSFontFace::UpdatePeriod() { + void CSSFontFace::Trace(Visitor* visitor) const { + visitor->Trace(segmented_font_faces_); + visitor->Trace(sources_); +- visitor->Trace(ranges_); + visitor->Trace(font_face_); + } + +--- a/third_party/blink/renderer/core/css/css_font_face.h ++++ b/third_party/blink/renderer/core/css/css_font_face.h +@@ -47,8 +47,8 @@ class SimpleFontData; + + class CORE_EXPORT CSSFontFace final : public GarbageCollected { + public: +- CSSFontFace(FontFace* font_face, HeapVector&& ranges) +- : ranges_(MakeGarbageCollected(std::move(ranges))), ++ CSSFontFace(FontFace* font_face, Vector& ranges) ++ : ranges_(base::AdoptRef(new UnicodeRangeSet(ranges))), + font_face_(font_face) { + DCHECK(font_face_); + } +@@ -61,7 +61,7 @@ class CORE_EXPORT CSSFontFace final : pu + } + FontFace* GetFontFace() const { return font_face_.Get(); } + +- const UnicodeRangeSet* Ranges() { return ranges_.Get(); } ++ scoped_refptr Ranges() { return ranges_; } + + void AddSegmentedFontFace(CSSSegmentedFontFace*); + void RemoveSegmentedFontFace(CSSSegmentedFontFace*); +@@ -98,9 +98,9 @@ class CORE_EXPORT CSSFontFace final : pu + private: + void SetLoadStatus(FontFace::LoadStatusType); + ++ scoped_refptr ranges_; + HeapHashSet> segmented_font_faces_; + HeapDeque> sources_; +- Member ranges_; + Member font_face_; + }; + +--- a/third_party/blink/renderer/core/css/font_face.cc ++++ b/third_party/blink/renderer/core/css/font_face.cc +@@ -90,7 +90,7 @@ const CSSValue* ParseCSSValue(const Exec + + CSSFontFace* CreateCSSFontFace(FontFace* font_face, + const CSSValue* unicode_range) { +- HeapVector ranges; ++ Vector ranges; + if (const auto* range_list = To(unicode_range)) { + unsigned num_ranges = range_list->length(); + for (unsigned i = 0; i < num_ranges; i++) { +@@ -100,7 +100,7 @@ CSSFontFace* CreateCSSFontFace(FontFace* + } + } + +- return MakeGarbageCollected(font_face, std::move(ranges)); ++ return MakeGarbageCollected(font_face, ranges); + } + + const CSSValue* ConvertFontMetricOverrideValue(const CSSValue* parsed_value) { +--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h +@@ -39,18 +39,16 @@ class SimpleFontData; + class PLATFORM_EXPORT FontDataForRangeSet + : public GarbageCollected { + public: +- explicit FontDataForRangeSet(const SimpleFontData* font_data = nullptr, +- const UnicodeRangeSet* range_set = nullptr) +- : font_data_(font_data), range_set_(range_set) {} ++ explicit FontDataForRangeSet( ++ const SimpleFontData* font_data = nullptr, ++ scoped_refptr range_set = nullptr) ++ : font_data_(font_data), range_set_(std::move(range_set)) {} + + FontDataForRangeSet(const FontDataForRangeSet& other); + + virtual ~FontDataForRangeSet() = default; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(font_data_); +- visitor->Trace(range_set_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } + + bool Contains(UChar32 test_char) const { + return !range_set_ || range_set_->Contains(test_char); +@@ -58,7 +56,7 @@ class PLATFORM_EXPORT FontDataForRangeSe + bool IsEntireRange() const { + return !range_set_ || range_set_->IsEntireRange(); + } +- const UnicodeRangeSet* Ranges() const { return range_set_.Get(); } ++ UnicodeRangeSet* Ranges() const { return range_set_.get(); } + bool HasFontData() const { return font_data_; } + const SimpleFontData* FontData() const { return font_data_.Get(); } + +@@ -74,7 +72,7 @@ class PLATFORM_EXPORT FontDataForRangeSe + + protected: + Member font_data_; +- Member range_set_; ++ scoped_refptr range_set_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -508,10 +508,10 @@ const OpenTypeVerticalData& HarfBuzzFace + return *harfbuzz_font_data_->VerticalData(); + } + +-hb_font_t* HarfBuzzFace::GetScaledFont(const UnicodeRangeSet* range_set, ++hb_font_t* HarfBuzzFace::GetScaledFont(scoped_refptr range_set, + VerticalLayoutCallbacks vertical_layout, + float specified_size) const { +- harfbuzz_font_data_->range_set_ = range_set; ++ harfbuzz_font_data_->range_set_ = std::move(range_set); + harfbuzz_font_data_->UpdateFallbackMetricsAndScale(*platform_data_, + vertical_layout); + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -66,7 +66,7 @@ class HarfBuzzFace final : public Garbag + // Passing in specified_size in order to control selecting the right value + // from the trak table. If not set, the size of the internal FontPlatformData + // object will be used. +- hb_font_t* GetScaledFont(const UnicodeRangeSet*, ++ hb_font_t* GetScaledFont(scoped_refptr, + VerticalLayoutCallbacks, + float specified_size) const; + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +@@ -32,7 +32,7 @@ struct HarfBuzzFontData final : public G + HarfBuzzFontData(const HarfBuzzFontData&) = delete; + HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; + +- void Trace(Visitor* visitor) const { visitor->Trace(range_set_); } ++ void Trace(Visitor*) const {} + + // The vertical origin and vertical advance functions in HarfBuzzFace require + // the ascent and height metrics as fallback in case no specific vertical +@@ -98,7 +98,7 @@ struct HarfBuzzFontData final : public G + SpaceGlyphInOpenTypeTables::kUnknown; + + scoped_refptr vertical_data_; +- Member range_set_; ++ scoped_refptr range_set_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc +@@ -289,7 +289,7 @@ void RoundHarfBuzzBufferPositions(hb_buf + inline bool ShapeRange(hb_buffer_t* buffer, + const FontFeatures& font_features, + const SimpleFontData* current_font, +- const UnicodeRangeSet* current_font_range_set, ++ scoped_refptr current_font_range_set, + UScriptCode current_run_script, + hb_direction_t direction, + hb_language_t language, +@@ -325,7 +325,7 @@ inline bool ShapeRange(hb_buffer_t* buff + hb_buffer_set_direction(buffer, direction); + + hb_font_t* hb_font = +- face->GetScaledFont(current_font_range_set, ++ face->GetScaledFont(std::move(current_font_range_set), + HB_DIRECTION_IS_VERTICAL(direction) + ? HarfBuzzFace::kPrepareForVerticalLayout + : HarfBuzzFace::kNoVerticalLayout, +--- a/third_party/blink/renderer/platform/fonts/unicode_range_set.cc ++++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.cc +@@ -31,8 +31,8 @@ + + namespace blink { + +-UnicodeRangeSet::UnicodeRangeSet(HeapVector&& ranges) +- : ranges_(std::move(ranges)) { ++UnicodeRangeSet::UnicodeRangeSet(const Vector& ranges) ++ : ranges_(ranges) { + if (ranges_.empty()) + return; + +--- a/third_party/blink/renderer/platform/fonts/unicode_range_set.h ++++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.h +@@ -26,12 +26,13 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_ + +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" ++#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/text/character_names.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" ++#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" ++#include "third_party/blink/renderer/platform/wtf/vector.h" + + namespace blink { + +@@ -55,14 +56,13 @@ struct PLATFORM_EXPORT UnicodeRange fina + UChar32 to_; + }; + +-class PLATFORM_EXPORT UnicodeRangeSet +- : public GarbageCollected { ++class PLATFORM_EXPORT UnicodeRangeSet : public RefCounted { ++ USING_FAST_MALLOC(UnicodeRangeSet); ++ + public: +- explicit UnicodeRangeSet(HeapVector&&); ++ explicit UnicodeRangeSet(const Vector&); + UnicodeRangeSet() = default; + +- void Trace(Visitor* visitor) const { visitor->Trace(ranges_); } +- + bool Contains(UChar32) const; + bool IntersectsWith(const String&) const; + bool IsEntireRange() const { return ranges_.empty(); } +@@ -71,8 +71,7 @@ class PLATFORM_EXPORT UnicodeRangeSet + bool operator==(const UnicodeRangeSet& other) const; + + private: +- HeapVector +- ranges_; // If empty, represents the whole code space. ++ Vector ranges_; // If empty, represents the whole code space. + }; + + } // namespace blink diff --git a/bad-font-gc00.patch b/bad-font-gc00.patch new file mode 100644 index 0000000..01c905a --- /dev/null +++ b/bad-font-gc00.patch @@ -0,0 +1,159 @@ +Revert the following commit: + +commit 59daae50fc3c47f7a8dbcc828446fdaa9f8c12c4 +Author: Ian Kilpatrick +Date: Tue Feb 20 18:35:11 2024 +0000 + + [gc] Make OpenTypeVerticalData gc'd. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: Id93c85a7beb710944e07cff614cff2409c818436 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302893 + Commit-Queue: Ian Kilpatrick + Reviewed-by: Dominik Röttsches + Cr-Commit-Position: refs/heads/main@{#1262805} + +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc +@@ -308,6 +308,11 @@ SkFont FontPlatformData::CreateSkFont(co + } + #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_IOS) + ++scoped_refptr FontPlatformData::CreateVerticalData() ++ const { ++ return OpenTypeVerticalData::CreateUnscaled(typeface_); ++} ++ + IdentifiableToken FontPlatformData::ComputeTypefaceDigest() const { + DCHECK(typeface_); + int table_count = typeface_->countTables(); +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h +@@ -59,6 +59,7 @@ typedef const struct __CTFont* CTFontRef + namespace blink { + + class HarfBuzzFace; ++class OpenTypeVerticalData; + + class PLATFORM_EXPORT FontPlatformData + : public GarbageCollected { +@@ -137,6 +138,8 @@ class PLATFORM_EXPORT FontPlatformData + + SkFont CreateSkFont(const FontDescription* = nullptr) const; + ++ scoped_refptr CreateVerticalData() const; ++ + // Computes a digest from the typeface. The digest only depends on the + // underlying font itself, and does not vary by the style (size, weight, + // italics, etc). This is aimed at discovering the fingerprinting information +--- a/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h ++++ b/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h +@@ -27,10 +27,10 @@ + + #include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/glyph.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/hash_map.h" ++#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + #include "third_party/blink/renderer/platform/wtf/vector.h" + #include "third_party/skia/include/core/SkRefCnt.h" + #include "third_party/skia/include/core/SkTypeface.h" +@@ -40,11 +40,14 @@ class SkFont; + namespace blink { + + class PLATFORM_EXPORT OpenTypeVerticalData +- : public GarbageCollected { +- public: +- explicit OpenTypeVerticalData(sk_sp); ++ : public RefCounted { ++ USING_FAST_MALLOC(OpenTypeVerticalData); + +- void Trace(Visitor*) const {} ++ public: ++ static scoped_refptr CreateUnscaled( ++ sk_sp typeface) { ++ return base::AdoptRef(new OpenTypeVerticalData(typeface)); ++ } + + void SetScaleAndFallbackMetrics(float size_per_unit, + float ascent, +@@ -60,6 +63,8 @@ class PLATFORM_EXPORT OpenTypeVerticalDa + float* out_xy_array) const; + + private: ++ explicit OpenTypeVerticalData(sk_sp); ++ + void LoadMetrics(sk_sp); + bool HasVORG() const { return !vert_origin_y_.empty(); } + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -167,7 +167,8 @@ static hb_bool_t HarfBuzzGetGlyphVertica + void* user_data) { + HarfBuzzFontData* hb_font_data = + reinterpret_cast(font_data); +- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); ++ scoped_refptr vertical_data = ++ hb_font_data->VerticalData(); + if (!vertical_data) + return false; + +@@ -186,7 +187,8 @@ static hb_position_t HarfBuzzGetGlyphVer + void* user_data) { + HarfBuzzFontData* hb_font_data = + reinterpret_cast(font_data); +- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); ++ scoped_refptr vertical_data = ++ hb_font_data->VerticalData(); + if (!vertical_data) { + return SkiaScalarToHarfBuzzPosition(hb_font_data->height_fallback_); + } +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +@@ -32,10 +32,7 @@ struct HarfBuzzFontData final : public G + HarfBuzzFontData(const HarfBuzzFontData&) = delete; + HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(vertical_data_); +- visitor->Trace(range_set_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(range_set_); } + + // The vertical origin and vertical advance functions in HarfBuzzFace require + // the ascent and height metrics as fallback in case no specific vertical +@@ -70,18 +67,18 @@ struct HarfBuzzFontData final : public G + } + } + +- OpenTypeVerticalData* VerticalData() { ++ scoped_refptr VerticalData() { + if (!vertical_data_) { + DCHECK_NE(ascent_fallback_, kInvalidFallbackMetricsValue); + DCHECK_NE(height_fallback_, kInvalidFallbackMetricsValue); + DCHECK_NE(size_per_unit_, kInvalidFallbackMetricsValue); + + vertical_data_ = +- MakeGarbageCollected(font_.refTypeface()); ++ OpenTypeVerticalData::CreateUnscaled(font_.refTypeface()); + } + vertical_data_->SetScaleAndFallbackMetrics(size_per_unit_, ascent_fallback_, + height_fallback_); +- return vertical_data_.Get(); ++ return vertical_data_; + } + + const hb::unique_ptr unscaled_font_; +@@ -100,7 +97,7 @@ struct HarfBuzzFontData final : public G + SpaceGlyphInOpenTypeTables space_in_gsub_ = + SpaceGlyphInOpenTypeTables::kUnknown; + +- Member vertical_data_; ++ scoped_refptr vertical_data_; + Member range_set_; + }; + diff --git a/bad-font-gc000.patch b/bad-font-gc000.patch new file mode 100644 index 0000000..b2df4eb --- /dev/null +++ b/bad-font-gc000.patch @@ -0,0 +1,107 @@ +Revert the following commit: + +commit 5ffa0446f51e34d06dc0539810a8a5d35ec9e3fc +Author: Ian Kilpatrick +Date: Thu Feb 22 17:08:22 2024 +0000 + + [fonts][perf] Explicitly leak SimpleFontDatas via a LRU cache. + + This adds a strong LRU cache to FontDataCache to retain the most + recently used fonts. + + This covers the case where a large amount of DOM is destroyed, and + previously we'd release all the font related objects if the GC kicked + in. + + Speedometer3 appears to peak at ~75 objects in the cache. + + Results for different cache sizes: + + Cache size: 64 | 32 | 16 + Speedometer3: +0.9% | +0.5% | +0% + + Bug: 41490008 + Change-Id: I131b6a79f246e61e13a7d44dddbc1f9e625ed44a + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314842 + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1264027} + +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc +@@ -36,15 +36,6 @@ + + namespace blink { + +-namespace { +- +-// The maximum number of strong references to retain via the LRU. +-// This explicitly leaks fonts (and related objects) unless under extreme +-// memory pressure where it will be cleared. DO NOT increase unnecessarily. +-const wtf_size_t kMaxSize = 64; +- +-} // namespace +- + const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, + bool subpixel_ascent_descent) { + if (!platform_data) +@@ -64,16 +55,7 @@ const SimpleFontData* FontDataCache::Get + add_result.stored_value->value = MakeGarbageCollected( + platform_data, nullptr, subpixel_ascent_descent); + } +- +- const SimpleFontData* result = add_result.stored_value->value; +- +- // Update our LRU to keep a strong reference to `result`. +- strong_reference_lru_.PrependOrMoveToFirst(result); +- while (strong_reference_lru_.size() > kMaxSize) { +- strong_reference_lru_.pop_back(); +- } +- +- return result; ++ return add_result.stored_value->value; + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h +@@ -34,7 +34,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" + + namespace blink { + +@@ -59,29 +58,17 @@ class FontDataCache final { + FontDataCache(const FontDataCache&) = delete; + FontDataCache& operator=(const FontDataCache&) = delete; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(cache_); +- visitor->Trace(strong_reference_lru_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(cache_); } + + const SimpleFontData* Get(const FontPlatformData*, + bool subpixel_ascent_descent = false); +- void Clear() { +- cache_.clear(); +- strong_reference_lru_.clear(); +- } ++ void Clear() { cache_.clear(); } + + private: + HeapHashMap, + WeakMember, + FontDataCacheKeyHashTraits> + cache_; +- +- // The above `cache_` is weak, meaning its entries will potentially be +- // cleared if no other references exist. +- // This LRU keeps a small (limited) number of strong references alive so they +- // won't be cleared in the above cache for performance reasons. +- HeapLinkedHashSet> strong_reference_lru_; + }; + + } // namespace blink diff --git a/bad-font-gc0000.patch b/bad-font-gc0000.patch new file mode 100644 index 0000000..1ef302e --- /dev/null +++ b/bad-font-gc0000.patch @@ -0,0 +1,425 @@ +Revert the following commit: + + +commit cc6c0b2a9e1dbc96f3ebed713dc71960a29dc4f1 +Author: Ian Kilpatrick +Date: Tue Mar 5 20:27:13 2024 +0000 + + Reland "[gc] Make FontFamily immutable." + + This reverts commit 748ed11510ec5bb09cc8b92f67f1f62964f023fa. + + Reason for revert: Previous patch which caused MSAN issue was reapplied. + + Original change's description: + > Revert "[gc] Make FontFamily immutable." + > + > This reverts commit ca3d3085d8b01fc74623d639c615fc57842cd26d. + > + > Reason for revert: crrev.com/c/5328767 is the reason for failure on some tests on MSAN. Please see crbug.com/327969288 for more details. + > + > Original change's description: + > > [gc] Make FontFamily immutable. + > > + > > Previously we'd build up font-family lists front to back, but would + > > need to mutate them to do so. Instead just build them backwards. + > > + > > This removes a bunch of problematic APIs (like AppendFamily - which + > > doesn't append), and simplifies the code. + > > + > > This will help avoid atomic write barriers once converted to oilpan. + > > + > > Bug: 41490008 + > > Change-Id: Icfcec2d0a1716585cf42985616c02b42b6647943 + > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322929 + > > Commit-Queue: Ian Kilpatrick + > > Reviewed-by: Dominik Röttsches + > > Cr-Commit-Position: refs/heads/main@{#1267168} + > + > Bug: 41490008, 327969288 + > Change-Id: Ic69a5707d00cc98b97dcae3f4b8207b452ce5cbd + > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5333950 + > Bot-Commit: Rubber Stamper + > Commit-Queue: Taiyo Mizuhashi + > Owners-Override: Taiyo Mizuhashi + > Cr-Commit-Position: refs/heads/main@{#1267674} + + Bug: 41490008, 327969288 + Change-Id: If1d395e324b0be15488ef5410e9bcdb219bb19c6 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344844 + Commit-Queue: Ian Kilpatrick + Bot-Commit: Rubber Stamper + Cr-Commit-Position: refs/heads/main@{#1268654} + +--- a/third_party/blink/renderer/core/css/css_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_font_face.cc +@@ -216,8 +216,9 @@ bool CSSFontFace::MaybeLoadFont(const Fo + + void CSSFontFace::Load() { + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(font_face_->family(), FontFamily::Type::kFamilyName)); ++ FontFamily font_family; ++ font_family.SetFamily(font_face_->family(), FontFamily::Type::kFamilyName); ++ font_description.SetFamily(font_family); + Load(font_description); + } + +--- a/third_party/blink/renderer/core/css/font_face_set_document.cc ++++ b/third_party/blink/renderer/core/css/font_face_set_document.cc +@@ -195,10 +195,13 @@ bool FontFaceSetDocument::ResolveFontSty + ComputedStyleBuilder builder = + GetDocument()->GetStyleResolver().CreateComputedStyleBuilder(); + +- FontDescription default_font_description; +- default_font_description.SetFamily(FontFamily( ++ FontFamily font_family; ++ font_family.SetFamily( + FontFaceSet::DefaultFontFamily(), +- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); ++ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); ++ ++ FontDescription default_font_description; ++ default_font_description.SetFamily(font_family); + default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); + default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize); + +--- a/third_party/blink/renderer/core/css/font_face_set_worker.cc ++++ b/third_party/blink/renderer/core/css/font_face_set_worker.cc +@@ -84,10 +84,13 @@ bool FontFaceSetWorker::ResolveFontStyle + return false; + } + +- FontDescription default_font_description; +- default_font_description.SetFamily(FontFamily( ++ FontFamily font_family; ++ font_family.SetFamily( + FontFaceSet::DefaultFontFamily(), +- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); ++ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); ++ ++ FontDescription default_font_description; ++ default_font_description.SetFamily(font_family); + default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); + default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize); + +--- a/third_party/blink/renderer/core/css/resolver/font_builder.cc ++++ b/third_party/blink/renderer/core/css/resolver/font_builder.cc +@@ -54,9 +54,11 @@ void FontBuilder::DidChangeWritingMode() + } + + FontFamily FontBuilder::StandardFontFamily() const { ++ FontFamily family; + const AtomicString& standard_font_family = StandardFontFamilyName(); +- return FontFamily(standard_font_family, +- FontFamily::InferredTypeFor(standard_font_family)); ++ family.SetFamily(standard_font_family, ++ FontFamily::InferredTypeFor(standard_font_family)); ++ return family; + } + + AtomicString FontBuilder::StandardFontFamilyName() const { +--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc ++++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc +@@ -379,8 +379,8 @@ FontDescription::FamilyDescription Style + + if (const auto* system_font = + DynamicTo(value)) { +- desc.family = FontFamily(system_font->ResolveFontFamily(), +- FontFamily::Type::kFamilyName); ++ desc.family.SetFamily(system_font->ResolveFontFamily(), ++ FontFamily::Type::kFamilyName); + return desc; + } + +@@ -410,8 +410,10 @@ FontDescription::FamilyDescription Style + // Take the previous value and wrap it in a `SharedFontFamily` adding to + // the linked list. + if (has_value) { +- next = +- SharedFontFamily::Create(family_name, family_type, std::move(next)); ++ scoped_refptr shared = SharedFontFamily::Create(); ++ shared->SetFamily(family_name, family_type); ++ shared->AppendFamily(next); ++ next = shared; + } + family_name = next_family_name; + family_type = is_generic ? FontFamily::Type::kGenericFamily +@@ -442,7 +444,8 @@ FontDescription::FamilyDescription Style + } + #endif + +- desc.family = FontFamily(family_name, family_type, std::move(next)); ++ desc.family.SetFamily(family_name, family_type); ++ desc.family.AppendFamily(next); + return desc; + } + +--- a/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc ++++ b/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc +@@ -29,9 +29,11 @@ const int defaultFontSize = 10; + + const ComputedStyle* CreateDefaultFontStyle(const Document& document) { + const AtomicString& default_font_family = font_family_names::kSansSerif; ++ FontFamily font_family; ++ font_family.SetFamily(default_font_family, ++ FontFamily::InferredTypeFor(default_font_family)); + FontDescription default_font_description; +- default_font_description.SetFamily(FontFamily( +- default_font_family, FontFamily::InferredTypeFor(default_font_family))); ++ default_font_description.SetFamily(font_family); + default_font_description.SetSpecifiedSize(defaultFontSize); + default_font_description.SetComputedSize(defaultFontSize); + ComputedStyleBuilder builder = +--- a/third_party/blink/renderer/core/page/drag_image.cc ++++ b/third_party/blink/renderer/core/page/drag_image.cc +@@ -127,9 +127,11 @@ static Font DeriveDragLabelFont(int size + const AtomicString& family = + LayoutThemeFontProvider::SystemFontFamily(CSSValueID::kNone); + ++ FontFamily font_family; ++ font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); ++ + FontDescription description; +- description.SetFamily( +- FontFamily(family, FontFamily::InferredTypeFor(family))); ++ description.SetFamily(font_family); + description.SetWeight(font_weight); + description.SetSpecifiedSize(size); + description.SetComputedSize(size); +--- a/third_party/blink/renderer/core/paint/embedded_object_painter.cc ++++ b/third_party/blink/renderer/core/paint/embedded_object_painter.cc +@@ -32,9 +32,11 @@ static Font ReplacementTextFont(const Do + const float size = LayoutThemeFontProvider::SystemFontSize( + CSSValueID::kWebkitSmallControl, document); + ++ FontFamily font_family; ++ font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); ++ + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(family, FontFamily::InferredTypeFor(family))); ++ font_description.SetFamily(font_family); + font_description.SetWeight(kBoldWeightValue); + font_description.SetSpecifiedSize(size); + font_description.SetComputedSize(size); +--- a/third_party/blink/renderer/platform/exported/web_font_description.cc ++++ b/third_party/blink/renderer/platform/exported/web_font_description.cc +@@ -49,10 +49,13 @@ WebFontDescription::WebFontDescription(c + } + + WebFontDescription::operator FontDescription() const { ++ FontFamily font_family; ++ font_family.SetFamily(family, family_is_generic ++ ? FontFamily::Type::kGenericFamily ++ : FontFamily::Type::kFamilyName); ++ + FontDescription desc; +- desc.SetFamily(FontFamily(family, family_is_generic +- ? FontFamily::Type::kGenericFamily +- : FontFamily::Type::kFamilyName)); ++ desc.SetFamily(font_family); + desc.SetGenericFamily( + static_cast(generic_family)); + desc.SetSpecifiedSize(size); +--- a/third_party/blink/renderer/platform/fonts/font_description.h ++++ b/third_party/blink/renderer/platform/fonts/font_description.h +@@ -195,6 +195,7 @@ class PLATFORM_EXPORT FontDescription { + FamilyDescription GetFamilyDescription() const { + return FamilyDescription(GenericFamily(), Family()); + } ++ FontFamily& FirstFamily() { return family_list_; } + const FontFamily& FirstFamily() const { return family_list_; } + Size GetSize() const { + return Size(KeywordSize(), SpecifiedSize(), IsAbsoluteSize()); +@@ -450,6 +451,10 @@ class PLATFORM_EXPORT FontDescription { + return fields_.subpixel_ascent_descent_; + } + ++ void SetHashCategory(HashCategory category) { ++ fields_.hash_category_ = category; ++ } ++ + HashCategory GetHashCategory() const { + return static_cast(fields_.hash_category_); + } +--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc +@@ -178,8 +178,9 @@ const FontData* FontFallbackList::GetFon + + if (font_selector_) { + // Try the user's preferred standard font. +- FontFamily font_family(font_family_names::kWebkitStandard, +- FontFamily::Type::kGenericFamily); ++ FontFamily font_family; ++ font_family.SetFamily(font_family_names::kWebkitStandard, ++ FontFamily::Type::kGenericFamily); + if (const FontData* data = + font_selector_->GetFontData(font_description, font_family)) { + return data; +--- a/third_party/blink/renderer/platform/fonts/font_family.cc ++++ b/third_party/blink/renderer/platform/fonts/font_family.cc +@@ -49,6 +49,20 @@ bool operator==(const FontFamily& a, con + return true; + } + ++wtf_size_t FontFamily::CountNames() const { ++ wtf_size_t count = 0; ++ for (const FontFamily* font_family = this; font_family; ++ font_family = font_family->Next()) ++ ++count; ++ return count; ++} ++ ++void FontFamily::AppendFamily(AtomicString family_name, Type family_type) { ++ scoped_refptr appended_family = SharedFontFamily::Create(); ++ appended_family->SetFamily(family_name, family_type); ++ AppendFamily(appended_family); ++} ++ + String FontFamily::ToString() const { + StringBuilder builder; + builder.Append(family_name_); +--- a/third_party/blink/renderer/platform/fonts/font_family.h ++++ b/third_party/blink/renderer/platform/fonts/font_family.h +@@ -39,18 +39,16 @@ class PLATFORM_EXPORT FontFamily { + DISALLOW_NEW(); + + public: +- // https://drafts.csswg.org/css-fonts/#font-family-prop +- enum class Type : uint8_t { kFamilyName, kGenericFamily }; +- +- FontFamily(const AtomicString& family_name, +- Type family_type, +- scoped_refptr next = nullptr) +- : family_name_(family_name), +- next_(std::move(next)), +- family_type_(family_type) {} + FontFamily() = default; + ~FontFamily(); + ++ // https://drafts.csswg.org/css-fonts/#font-family-prop ++ enum class Type : uint8_t { kFamilyName, kGenericFamily }; ++ ++ void SetFamily(const AtomicString& family_name, Type family_type) { ++ family_name_ = family_name; ++ family_type_ = family_type; ++ } + // Return this font family's name. Note that it is never quoted nor escaped. + // For web-exposed serialization, please rely instead on the functions + // ComputedStyleUtils::ValueForFontFamily(const FontFamily&) and +@@ -59,8 +57,13 @@ class PLATFORM_EXPORT FontFamily { + const AtomicString& FamilyName() const { return family_name_; } + bool FamilyIsGeneric() const { return family_type_ == Type::kGenericFamily; } + ++ // Returns number of linked `FontFamily` including `this`, so return value is ++ // greater than or equal to 1. When `Next()` is `nullptr`, return value is 1. ++ wtf_size_t CountNames() const; + const FontFamily* Next() const; + ++ void AppendFamily(scoped_refptr); ++ void AppendFamily(AtomicString family_name, Type family_type); + scoped_refptr ReleaseNext(); + + bool IsPrewarmed() const { return is_prewarmed_; } +@@ -93,19 +96,12 @@ class PLATFORM_EXPORT SharedFontFamily : + SharedFontFamily(const SharedFontFamily&) = delete; + SharedFontFamily& operator=(const SharedFontFamily&) = delete; + +- static scoped_refptr Create( +- const AtomicString& family_name, +- Type family_type, +- scoped_refptr next = nullptr) { +- return base::AdoptRef( +- new SharedFontFamily(family_name, family_type, std::move(next))); ++ static scoped_refptr Create() { ++ return base::AdoptRef(new SharedFontFamily); + } + + private: +- SharedFontFamily(const AtomicString& family_name, +- Type family_type, +- scoped_refptr next) +- : FontFamily(family_name, family_type, std::move(next)) {} ++ SharedFontFamily() = default; + }; + + PLATFORM_EXPORT bool operator==(const FontFamily&, const FontFamily&); +@@ -125,6 +121,10 @@ inline const FontFamily* FontFamily::Nex + return next_.get(); + } + ++inline void FontFamily::AppendFamily(scoped_refptr family) { ++ next_ = std::move(family); ++} ++ + inline scoped_refptr FontFamily::ReleaseNext() { + return std::move(next_); + } +--- a/third_party/blink/renderer/platform/graphics/placeholder_image.cc ++++ b/third_party/blink/renderer/platform/graphics/placeholder_image.cc +@@ -85,18 +85,23 @@ void DrawCenteredIcon(cc::PaintCanvas* c + } + + FontDescription CreatePlaceholderFontDescription(float scale_factor) { +- scoped_refptr arial = SharedFontFamily::Create( +- font_family_names::kArial, FontFamily::Type::kFamilyName); +- scoped_refptr helvetica = SharedFontFamily::Create( +- font_family_names::kHelvetica, FontFamily::Type::kFamilyName, arial); +- scoped_refptr helvetica_neue = +- SharedFontFamily::Create(font_family_names::kHelveticaNeue, +- FontFamily::Type::kFamilyName, helvetica); +- FontFamily roboto(font_family_names::kRoboto, FontFamily::Type::kFamilyName, +- helvetica_neue); +- + FontDescription description; +- description.SetFamily(roboto); ++ description.FirstFamily().SetFamily(font_family_names::kRoboto, ++ FontFamily::Type::kFamilyName); ++ ++ scoped_refptr helvetica_neue = SharedFontFamily::Create(); ++ helvetica_neue->SetFamily(font_family_names::kHelveticaNeue, ++ FontFamily::Type::kFamilyName); ++ scoped_refptr helvetica = SharedFontFamily::Create(); ++ helvetica->SetFamily(font_family_names::kHelvetica, ++ FontFamily::Type::kFamilyName); ++ scoped_refptr arial = SharedFontFamily::Create(); ++ arial->SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName); ++ ++ helvetica->AppendFamily(std::move(arial)); ++ helvetica_neue->AppendFamily(std::move(helvetica)); ++ description.FirstFamily().AppendFamily(std::move(helvetica_neue)); ++ + description.SetGenericFamily(FontDescription::kSansSerifFamily); + description.SetComputedSize(scale_factor * kFontSize); + description.SetWeight(FontSelectionValue(500)); +--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc ++++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc +@@ -127,9 +127,11 @@ Font CreateTestFont(const AtomicString& + size_t data_size, + float size, + const FontDescription::VariantLigatures* ligatures) { ++ FontFamily family; ++ family.SetFamily(family_name, FontFamily::Type::kFamilyName); ++ + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(family_name, FontFamily::Type::kFamilyName)); ++ font_description.SetFamily(family); + font_description.SetSpecifiedSize(size); + font_description.SetComputedSize(size); + if (ligatures) +@@ -143,9 +145,11 @@ Font CreateTestFont(const AtomicString& + float size, + const FontDescription::VariantLigatures* ligatures, + void (*init_font_description)(FontDescription*)) { ++ FontFamily family; ++ family.SetFamily(family_name, FontFamily::Type::kFamilyName); ++ + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(family_name, FontFamily::Type::kFamilyName)); ++ font_description.SetFamily(family); + font_description.SetSpecifiedSize(size); + font_description.SetComputedSize(size); + if (ligatures) diff --git a/bad-font-gc1.patch b/bad-font-gc1.patch new file mode 100644 index 0000000..eedd777 --- /dev/null +++ b/bad-font-gc1.patch @@ -0,0 +1,258 @@ +This is a revert of the commit below. While it doesn't strictly fix any +bugs, it's needed to support bad-font-gc2.patch building. + +commit 9a8fc2e22363c954af239c06798bf85a9c928295 +Author: Ian Kilpatrick +Date: Wed Feb 14 19:35:11 2024 +0000 + + [gc] Make FontCustomPlatformData gc'd. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: I6364bf4c5b5dce9f99d8e2d7e1f84537c5493c33 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5293060 + Commit-Queue: Ian Kilpatrick + Reviewed-by: Dominik Röttsches + Cr-Commit-Position: refs/heads/main@{#1260637} + +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc +@@ -27,16 +27,13 @@ BinaryDataFontFaceSource::BinaryDataFont + return; + } + probe::FontsUpdated(context, font_face, String(), +- custom_platform_data_.Get()); ++ custom_platform_data_.get()); + } + +-void BinaryDataFontFaceSource::Trace(Visitor* visitor) const { +- visitor->Trace(custom_platform_data_); +- CSSFontFaceSource::Trace(visitor); +-} ++BinaryDataFontFaceSource::~BinaryDataFontFaceSource() = default; + + bool BinaryDataFontFaceSource::IsValid() const { +- return custom_platform_data_; ++ return custom_platform_data_.get(); + } + + SimpleFontData* BinaryDataFontFaceSource::CreateFontData( +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h +@@ -16,14 +16,14 @@ class FontCustomPlatformData; + class BinaryDataFontFaceSource final : public CSSFontFaceSource { + public: + BinaryDataFontFaceSource(CSSFontFace*, SharedBuffer*, String&); +- void Trace(Visitor*) const override; ++ ~BinaryDataFontFaceSource() override; + bool IsValid() const override; + + private: + SimpleFontData* CreateFontData(const FontDescription&, + const FontSelectionCapabilities&) override; + +- Member custom_platform_data_; ++ scoped_refptr custom_platform_data_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/core/css/remote_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc +@@ -262,7 +262,7 @@ void RemoteFontFaceSource::NotifyFinishe + FontInvalidationReason::kFontFaceLoaded); + if (custom_font_data_) { + probe::FontsUpdated(execution_context, face_->GetFontFace(), +- resource->Url().GetString(), custom_font_data_.Get()); ++ resource->Url().GetString(), custom_font_data_.get()); + } + } + } +@@ -456,7 +456,6 @@ void RemoteFontFaceSource::BeginLoadIfNe + void RemoteFontFaceSource::Trace(Visitor* visitor) const { + visitor->Trace(face_); + visitor->Trace(font_selector_); +- visitor->Trace(custom_font_data_); + CSSFontFaceSource::Trace(visitor); + FontResourceClient::Trace(visitor); + } +--- a/third_party/blink/renderer/core/css/remote_font_face_source.h ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.h +@@ -43,7 +43,7 @@ class RemoteFontFaceSource final : publi + bool IsPendingDataUrl() const override; + + const FontCustomPlatformData* GetCustomPlaftormData() const override { +- return custom_font_data_.Get(); ++ return custom_font_data_.get(); + } + + void BeginLoadIfNeeded() override; +@@ -157,7 +157,7 @@ class RemoteFontFaceSource final : publi + Member font_selector_; + + // |nullptr| if font is not loaded or failed to decode. +- Member custom_font_data_; ++ scoped_refptr custom_font_data_; + // |nullptr| if font is not loaded or failed to decode. + String url_; + +--- a/third_party/blink/renderer/core/loader/resource/font_resource.cc ++++ b/third_party/blink/renderer/core/loader/resource/font_resource.cc +@@ -112,7 +112,7 @@ void FontResource::StartLoadLimitTimersI + kFontLoadWaitLong); + } + +-const FontCustomPlatformData* FontResource::GetCustomFontData() { ++scoped_refptr FontResource::GetCustomFontData() { + if (!font_data_ && !ErrorOccurred() && !IsLoading()) { + if (Data()) { + auto decode_start_time = base::TimeTicks::Now(); +@@ -225,7 +225,6 @@ void FontResource::AddClearDataObserver( + } + + void FontResource::Trace(Visitor* visitor) const { +- visitor->Trace(font_data_); + visitor->Trace(clear_data_observers_); + Resource::Trace(visitor); + } +--- a/third_party/blink/renderer/core/loader/resource/font_resource.h ++++ b/third_party/blink/renderer/core/loader/resource/font_resource.h +@@ -72,7 +72,7 @@ class CORE_EXPORT FontResource final : p + + String OtsParsingMessage() const { return ots_parsing_message_; } + +- const FontCustomPlatformData* GetCustomFontData(); ++ scoped_refptr GetCustomFontData(); + + // Returns true if the loading priority of the remote font resource can be + // lowered. The loading priority of the font can be lowered only if the +@@ -112,7 +112,7 @@ class CORE_EXPORT FontResource final : p + kMaxValue = kLongLimitExceeded, + }; + +- Member font_data_; ++ scoped_refptr font_data_; + String ots_parsing_message_; + LoadLimitState load_limit_state_; + bool cors_failed_; +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc +@@ -115,7 +115,7 @@ const FontPlatformData* FontCustomPlatfo + const ResolvedFontFeatures& resolved_font_features, + FontOrientation orientation, + const FontVariationSettings* variation_settings, +- const FontPalette* palette) const { ++ const FontPalette* palette) { + DCHECK(base_typeface_); + + sk_sp return_typeface = base_typeface_; +@@ -304,7 +304,7 @@ String FontCustomPlatformData::FamilyNam + localized_string.fString.size()); + } + +-FontCustomPlatformData* FontCustomPlatformData::Create( ++scoped_refptr FontCustomPlatformData::Create( + SharedBuffer* buffer, + String& ots_parse_message) { + DCHECK(buffer); +@@ -321,8 +321,8 @@ FontCustomPlatformData* FontCustomPlatfo + if (v8::Isolate* isolate = v8::Isolate::TryGetCurrent()) { + isolate->AdjustAmountOfExternalAllocatedMemory(data_size); + } +- return MakeGarbageCollected(std::move(typeface), +- data_size); ++ return base::AdoptRef( ++ new FontCustomPlatformData(std::move(typeface), data_size)); + } + + bool FontCustomPlatformData::MayBeIconFont() const { +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h +@@ -39,7 +39,6 @@ + #include "third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.h" + #include "third_party/blink/renderer/platform/fonts/resolved_font_features.h" + #include "third_party/blink/renderer/platform/fonts/text_rendering_mode.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" +@@ -55,17 +54,16 @@ class FontPlatformData; + class FontVariationSettings; + + class PLATFORM_EXPORT FontCustomPlatformData +- : public GarbageCollected { ++ : public RefCounted { ++ USING_FAST_MALLOC(FontCustomPlatformData); ++ + public: +- static FontCustomPlatformData* Create(SharedBuffer*, +- String& ots_parse_message); +- FontCustomPlatformData(sk_sp, size_t data_size); ++ static scoped_refptr Create(SharedBuffer*, ++ String& ots_parse_message); + FontCustomPlatformData(const FontCustomPlatformData&) = delete; + FontCustomPlatformData& operator=(const FontCustomPlatformData&) = delete; + ~FontCustomPlatformData(); + +- void Trace(Visitor*) const {} +- + // The size argument should come from EffectiveFontSize() and + // adjusted_specified_size should come from AdjustedSpecifiedSize() of + // FontDescription. The latter is needed for correctly applying +@@ -82,7 +80,7 @@ class PLATFORM_EXPORT FontCustomPlatform + const ResolvedFontFeatures& resolved_font_features, + FontOrientation = FontOrientation::kHorizontal, + const FontVariationSettings* = nullptr, +- const FontPalette* = nullptr) const; ++ const FontPalette* = nullptr); + + String FamilyNameForInspector() const; + +@@ -93,6 +91,7 @@ class PLATFORM_EXPORT FontCustomPlatform + bool MayBeIconFont() const; + + private: ++ FontCustomPlatformData(sk_sp, size_t data_size); + sk_sp base_typeface_; + size_t data_size_; + +--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc ++++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc +@@ -29,7 +29,7 @@ class TestFontSelector : public FontSele + static TestFontSelector* Create(const uint8_t* data, size_t size) { + scoped_refptr font_buffer = SharedBuffer::Create(data, size); + String ots_parse_message; +- FontCustomPlatformData* font_custom_platform_data = ++ scoped_refptr font_custom_platform_data = + FontCustomPlatformData::Create(font_buffer.get(), ots_parse_message); + if (!font_custom_platform_data) + return nullptr; +@@ -37,17 +37,12 @@ class TestFontSelector : public FontSele + std::move(font_custom_platform_data)); + } + +- TestFontSelector(FontCustomPlatformData* custom_platform_data) +- : custom_platform_data_(custom_platform_data) { ++ TestFontSelector(scoped_refptr custom_platform_data) ++ : custom_platform_data_(std::move(custom_platform_data)) { + DCHECK(custom_platform_data_); + } + ~TestFontSelector() override = default; + +- void Trace(Visitor* visitor) const override { +- visitor->Trace(custom_platform_data_); +- FontSelector::Trace(visitor); +- } +- + FontData* GetFontData(const FontDescription& font_description, + const FontFamily&) override { + FontSelectionCapabilities normal_capabilities( +@@ -117,7 +112,7 @@ class TestFontSelector : public FontSele + } + + private: +- Member custom_platform_data_; ++ scoped_refptr custom_platform_data_; + }; + + } // namespace diff --git a/bad-font-gc11.patch b/bad-font-gc11.patch new file mode 100644 index 0000000..f75d623 --- /dev/null +++ b/bad-font-gc11.patch @@ -0,0 +1,411 @@ +Revert the following commit: + +commit 2eefeabb12fb7e92f2508116a5ed959c57659be1 +Author: Ian Kilpatrick +Date: Tue Feb 20 17:40:39 2024 +0000 + + [gc] Make HarfBuzzFontData & friends gc'd. + + Previously we had a HbFontCacheEntry which was used to hold onto the + HarfBuzzFontData, and a hb_font_t. + + HarfBuzzFontData is used for holding data specific for various + harfbuzz callbacks, but we can also hold onto the hb_font_t there. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: Icaa7ad3b2f75e9807b88014a9a15406cb76eb52e + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302175 + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1262752} + +--- a/third_party/blink/renderer/platform/fonts/font_global_context.cc ++++ b/third_party/blink/renderer/platform/fonts/font_global_context.cc +@@ -8,6 +8,7 @@ + #include "third_party/blink/renderer/platform/fonts/font_cache.h" + #include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h" + #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h" ++#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" + #include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h" + #include "third_party/blink/renderer/platform/wtf/thread_specific.h" + +@@ -50,6 +51,15 @@ FontUniqueNameLookup* FontGlobalContext: + return Get().font_unique_name_lookup_.get(); + } + ++HarfBuzzFontCache& FontGlobalContext::GetHarfBuzzFontCache() { ++ std::unique_ptr& global_context_harfbuzz_font_cache = ++ Get().harfbuzz_font_cache_; ++ if (!global_context_harfbuzz_font_cache) { ++ global_context_harfbuzz_font_cache = std::make_unique(); ++ } ++ return *global_context_harfbuzz_font_cache; ++} ++ + IdentifiableToken FontGlobalContext::GetOrComputeTypefaceDigest( + const FontPlatformData& source) { + SkTypeface* typeface = source.Typeface(); +--- a/third_party/blink/renderer/platform/fonts/font_global_context.h ++++ b/third_party/blink/renderer/platform/fonts/font_global_context.h +@@ -9,7 +9,6 @@ + #include "base/types/pass_key.h" + #include "third_party/blink/public/common/privacy_budget/identifiable_token.h" + #include "third_party/blink/renderer/platform/fonts/font_cache.h" +-#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/text/layout_locale.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +@@ -34,19 +33,14 @@ class PLATFORM_EXPORT FontGlobalContext + static FontGlobalContext& Get(); + static FontGlobalContext* TryGet(); + +- void Trace(Visitor* visitor) const { +- visitor->Trace(font_cache_); +- visitor->Trace(harfbuzz_font_cache_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(font_cache_); } + + FontGlobalContext(const FontGlobalContext&) = delete; + FontGlobalContext& operator=(const FontGlobalContext&) = delete; + + static inline FontCache& GetFontCache() { return Get().font_cache_; } + +- static HarfBuzzFontCache& GetHarfBuzzFontCache() { +- return Get().harfbuzz_font_cache_; +- } ++ static HarfBuzzFontCache& GetHarfBuzzFontCache(); + + static FontUniqueNameLookup* GetFontUniqueNameLookup(); + +@@ -62,7 +56,7 @@ class PLATFORM_EXPORT FontGlobalContext + + private: + FontCache font_cache_; +- HarfBuzzFontCache harfbuzz_font_cache_; ++ std::unique_ptr harfbuzz_font_cache_; + std::unique_ptr font_unique_name_lookup_; + base::HashingLRUCache typeface_digest_cache_; + base::HashingLRUCache +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -64,14 +64,20 @@ namespace blink { + + HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, + uint64_t unique_id) +- : platform_data_(platform_data), +- harfbuzz_font_data_(FontGlobalContext::GetHarfBuzzFontCache().GetOrCreate( +- unique_id, +- platform_data)) {} ++ : platform_data_(platform_data), unique_id_(unique_id) { ++ HbFontCacheEntry* const cache_entry = ++ FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, ++ platform_data); ++ unscaled_font_ = cache_entry->HbFont(); ++ harfbuzz_font_data_ = cache_entry->HbFontData(); ++} ++ ++HarfBuzzFace::~HarfBuzzFace() { ++ FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); ++} + + void HarfBuzzFace::Trace(Visitor* visitor) const { + visitor->Trace(platform_data_); +- visitor->Trace(harfbuzz_font_data_); + } + + static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font, +@@ -234,17 +240,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + + hb::unique_ptr glyphs(hb_set_create()); + +- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get(); +- + // Check whether computing is needed and compute for gpos/gsub. + if (features & kKerning && + harfbuzz_font_data_->space_in_gpos_ == + HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { +- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) { ++ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space)) + return false; +- } + // Compute for gpos. +- hb_face_t* face = hb_font_get_face(unscaled_font); ++ hb_face_t* face = hb_font_get_face(unscaled_font_); + DCHECK(face); + harfbuzz_font_data_->space_in_gpos_ = + hb_ot_layout_has_positioning(face) && +@@ -258,11 +261,10 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + if (features & kLigatures && + harfbuzz_font_data_->space_in_gsub_ == + HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { +- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) { ++ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space)) + return false; +- } + // Compute for gpos. +- hb_face_t* face = hb_font_get_face(unscaled_font); ++ hb_face_t* face = hb_font_get_face(unscaled_font_); + DCHECK(face); + harfbuzz_font_data_->space_in_gsub_ = + hb_ot_layout_has_substitution(face) && +@@ -280,14 +282,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + } + + unsigned HarfBuzzFace::UnitsPerEmFromHeadTable() { +- hb_face_t* face = hb_font_get_face(harfbuzz_font_data_->unscaled_font_.get()); ++ hb_face_t* face = hb_font_get_face(unscaled_font_); + return hb_face_get_upem(face); + } + + Glyph HarfBuzzFace::HbGlyphForCharacter(UChar32 character) { + hb_codepoint_t glyph = 0; +- HarfBuzzGetNominalGlyph(harfbuzz_font_data_->unscaled_font_.get(), +- harfbuzz_font_data_, character, &glyph, nullptr); ++ HarfBuzzGetNominalGlyph(unscaled_font_, harfbuzz_font_data_, character, ++ &glyph, nullptr); + return glyph; + } + +@@ -444,10 +446,9 @@ static hb::unique_ptr CreateF + return face; + } + +-namespace { +- +-HarfBuzzFontData* CreateHarfBuzzFontData(hb_face_t* face, +- SkTypeface* typeface) { ++static scoped_refptr CreateHbFontCacheEntry( ++ hb_face_t* face, ++ SkTypeface* typeface) { + hb::unique_ptr ot_font(hb_font_create(face)); + hb_ot_font_set_funcs(ot_font.get()); + +@@ -466,26 +467,25 @@ HarfBuzzFontData* CreateHarfBuzzFontData + // Creating a sub font means that non-available functions + // are found from the parent. + hb_font_t* const unscaled_font = hb_font_create_sub_font(ot_font.get()); +- HarfBuzzFontData* data = +- MakeGarbageCollected(unscaled_font); ++ scoped_refptr cache_entry = ++ HbFontCacheEntry::Create(unscaled_font); + hb_font_set_funcs(unscaled_font, +- HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), data, +- nullptr); +- return data; ++ HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), ++ cache_entry->HbFontData(), nullptr); ++ return cache_entry; + } + +-} // namespace +- +-HarfBuzzFontData* HarfBuzzFontCache::GetOrCreate( ++HbFontCacheEntry* HarfBuzzFontCache::RefOrNew( + uint64_t unique_id, + const FontPlatformData* platform_data) { + const auto& result = font_map_.insert(unique_id, nullptr); + if (result.is_new_entry) { + hb::unique_ptr face = CreateFace(platform_data); + result.stored_value->value = +- CreateHarfBuzzFontData(face.get(), platform_data->Typeface()); ++ CreateHbFontCacheEntry(face.get(), platform_data->Typeface()); + } +- return result.stored_value->value.Get(); ++ result.stored_value->value->AddRef(); ++ return result.stored_value->value.get(); + } + + static_assert( +@@ -516,18 +516,17 @@ hb_font_t* HarfBuzzFace::GetScaledFont(s + vertical_layout); + + int scale = SkiaScalarToHarfBuzzPosition(platform_data_->size()); +- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get(); +- hb_font_set_scale(unscaled_font, scale, scale); ++ hb_font_set_scale(unscaled_font_, scale, scale); + // See contended discussion in https://github.com/harfbuzz/harfbuzz/pull/1484 + // Setting ptem here is critical for HarfBuzz to know where to lookup spacing + // offset in the AAT trak table, the unit pt in ptem here means "CoreText" + // points. After discussion on the pull request and with Apple developers, the + // meaning of HarfBuzz' hb_font_set_ptem API was changed to expect the + // equivalent of CSS pixels here. +- hb_font_set_ptem(unscaled_font, specified_size > 0 ? specified_size +- : platform_data_->size()); ++ hb_font_set_ptem(unscaled_font_, specified_size > 0 ? specified_size ++ : platform_data_->size()); + +- return unscaled_font; ++ return unscaled_font_; + } + + hb_font_t* HarfBuzzFace::GetScaledFont() const { +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -55,6 +55,7 @@ class HarfBuzzFace final : public Garbag + HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); + HarfBuzzFace(const HarfBuzzFace&) = delete; + HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; ++ ~HarfBuzzFace(); + + void Trace(Visitor*) const; + +@@ -90,7 +91,11 @@ class HarfBuzzFace final : public Garbag + void PrepareHarfBuzzFontData(); + + Member platform_data_; +- Member harfbuzz_font_data_; ++ const uint64_t unique_id_; ++ // TODO(crbug.com/1489080): When briefly given MiraclePtr protection, ++ // these members were both found dangling. ++ hb_font_t* unscaled_font_; ++ HarfBuzzFontData* harfbuzz_font_data_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc +@@ -8,8 +8,38 @@ + + namespace blink { + +-void HarfBuzzFontCache::Trace(Visitor* visitor) const { +- visitor->Trace(font_map_); ++HbFontCacheEntry::HbFontCacheEntry(hb_font_t* font) ++ : hb_font_(hb::unique_ptr(font)), ++ hb_font_data_(std::make_unique()) {} ++ ++HbFontCacheEntry::~HbFontCacheEntry() = default; ++ ++scoped_refptr HbFontCacheEntry::Create(hb_font_t* hb_font) { ++ DCHECK(hb_font); ++ return base::AdoptRef(new HbFontCacheEntry(hb_font)); ++} ++ ++HarfBuzzFontCache::HarfBuzzFontCache() = default; ++HarfBuzzFontCache::~HarfBuzzFontCache() = default; ++ ++// See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()| ++// implementation. ++ ++void HarfBuzzFontCache::Remove(uint64_t unique_id) { ++ auto it = font_map_.find(unique_id); ++ // TODO(https://crbug.com/1417160): In tests such as FontObjectThreadedTest ++ // that test taking down FontGlobalContext an object may not be found due to ++ // existing issues with refcounting of font objects at thread destruction ++ // time. ++ if (it == font_map_.end()) { ++ return; ++ } ++ DCHECK(!it.Get()->value->HasOneRef()); ++ it.Get()->value->Release(); ++ if (!it.Get()->value->HasOneRef()) { ++ return; ++ } ++ font_map_.erase(it); + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h +@@ -6,9 +6,12 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_CACHE_H_ + + #include "third_party/blink/renderer/platform/fonts/font_metrics.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" ++#include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" ++ ++#include ++#include ++ ++#include + + namespace blink { + +@@ -22,21 +25,39 @@ struct HarfBuzzFontData; + // FIXME, crbug.com/609099: We should fix the FontCache to only keep one + // FontPlatformData object independent of size, then consider using this here. + +-class HarfBuzzFontCache final { +- DISALLOW_NEW(); ++class HbFontCacheEntry : public RefCounted { ++ USING_FAST_MALLOC(HbFontCacheEntry); ++ ++ public: ++ static scoped_refptr Create(hb_font_t* hb_font); ++ ++ hb_font_t* HbFont() { return hb_font_.get(); } ++ HarfBuzzFontData* HbFontData() { return hb_font_data_.get(); } ++ ++ ~HbFontCacheEntry(); + ++ private: ++ explicit HbFontCacheEntry(hb_font_t* font); ++ ++ hb::unique_ptr hb_font_; ++ std::unique_ptr hb_font_data_; ++}; ++ ++class HarfBuzzFontCache final { + public: +- void Trace(Visitor* visitor) const; +- // See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()| +- // implementation. +- HarfBuzzFontData* GetOrCreate(uint64_t unique_id, +- const FontPlatformData* platform_data); ++ HarfBuzzFontCache(); ++ ~HarfBuzzFontCache(); ++ ++ HbFontCacheEntry* RefOrNew(uint64_t unique_id, ++ const FontPlatformData* platform_data); ++ void Remove(uint64_t unique_id); + + private: +- HeapHashMap, +- IntWithZeroKeyHashTraits> +- font_map_; ++ using HbFontDataMap = HashMap, ++ IntWithZeroKeyHashTraits>; ++ ++ HbFontDataMap font_map_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +@@ -22,18 +22,15 @@ const unsigned kInvalidFallbackMetricsVa + // The HarfBuzzFontData struct carries user-pointer data for + // |hb_font_t| callback functions/operations. It contains metrics and OpenType + // layout information related to a font scaled to a particular size. +-struct HarfBuzzFontData final : public GarbageCollected { ++struct HarfBuzzFontData final { ++ USING_FAST_MALLOC(HarfBuzzFontData); ++ + public: +- explicit HarfBuzzFontData(hb_font_t* unscaled_font) +- : unscaled_font_(hb::unique_ptr(unscaled_font)), +- vertical_data_(nullptr), +- range_set_(nullptr) {} ++ HarfBuzzFontData() : vertical_data_(nullptr), range_set_(nullptr) {} + + HarfBuzzFontData(const HarfBuzzFontData&) = delete; + HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; + +- void Trace(Visitor*) const {} +- + // The vertical origin and vertical advance functions in HarfBuzzFace require + // the ascent and height metrics as fallback in case no specific vertical + // layout information is found from the font. +@@ -81,7 +78,6 @@ struct HarfBuzzFontData final : public G + return vertical_data_; + } + +- const hb::unique_ptr unscaled_font_; + SkFont font_; + + // Capture these scaled fallback metrics from FontPlatformData so that a diff --git a/bad-font-gc2.patch b/bad-font-gc2.patch new file mode 100644 index 0000000..3c64b03 --- /dev/null +++ b/bad-font-gc2.patch @@ -0,0 +1,3715 @@ +Chromium 123 was buggy, with tabs regularly hanging/crashing. The culprit +was the GC cleaning up font cache stuff, and deadlocking in a FontCacheKey +destructor: + +Thread 54 (Thread 0x7fffc55fe6c0 (LWP 413811) "Chrome_InProcRe"): +#0 0x00007ffff6720719 in syscall () from /lib/x86_64-linux-gnu/libc.so.6 +#1 0x000055555c1752d9 in partition_alloc::internal::SpinningMutex::LockSlow() () +#2 0x000055555c185529 in allocator_shim::internal::PartitionFree(allocator_shim::AllocatorDispatch const*, void*, void*) () +#3 0x000055555f7db46b in blink::FontCacheKey::~FontCacheKey() () +#4 0x000055555f7db6f4 in WTF::WeakProcessingHashTableHelper<(WTF::WeakHandlingFlag)1, blink::FontCacheKey, WTF::KeyValuePair >, WTF::KeyValuePairExtractor, WTF::HashMapValueTraits, WTF::HashTraits > >, WTF::HashTraits, blink::HeapAllocator>::Process(cppgc::LivenessBroker const&, void const*) () +#5 0x0000555559544bef in cppgc::internal::MarkerBase::ProcessWeakness() () +#6 0x000055555954487e in cppgc::internal::MarkerBase::LeaveAtomicPause() () +#7 0x0000555558e8115a in v8::internal::CppHeap::FinishMarkingAndStartSweeping() () +#8 0x0000555558ebcdc0 in v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) () +#9 0x0000555558ecfe14 in v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_0::operator()() const () +#10 0x0000555558ecfb65 in void heap::base::Stack::SetMarkerAndCallbackImpl(heap::base::Stack*, void*, void const*) () +--Type for more, q to quit, c to continue without paging-- +#11 0x000055555955216b in PushAllRegistersAndIterateStack () +#12 0x0000555558eb8c19 in v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) () +#13 0x0000555558eba3eb in v8::internal::Heap::FinalizeIncrementalMarkingAtomically(v8::internal::GarbageCollectionReason) () +#14 0x0000555558ed20db in v8::internal::IncrementalMarkingJob::Task::RunInternal() () +#15 0x000055555c0c49d6 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) () +#16 0x000055555c0daf88 in base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) () +#17 0x000055555c0c49d6 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) () +#18 0x000055555c0dd8f9 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) () +#19 0x000055555c0dd3bf in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () +#20 0x000055555c0ddd75 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () +#21 0x000055555c07eb4f in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) () +#22 0x000055555c0de110 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) () +#23 0x000055555c0a4c26 in base::RunLoop::Run(base::Location const&) () +#24 0x000055555c100155 in base::Thread::Run(base::RunLoop*) () +#25 0x000055555c100342 in base::Thread::ThreadMain() () + + +The commit below modified font stuff to go from using scoped_refptrs to +getting cleaned up via GC. Reverting it fixes chromium's behavior for us. +It would be good to get a proper fix for this, but reverting this will +have to do for now. + + +commit bff9ec6754f7bf97c61d84663ee2ccc5055e9eb3 +Author: Ian Kilpatrick +Date: Tue Feb 13 19:15:19 2024 +0000 + + [gc] Make SimpleFontData & FontPlatformData & friends gc'd. + + The largest change is making the associated caches for these objects + weak collections instead of relying on the relatively complex purging + logic. + + https://variable-lizards.glitch.me/ appears not to leak. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: Iba581842459cf31f7f4fe60d83665f393a7d06a3 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262982 + Reviewed-by: Caleb Raitto + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1259965} + +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc +@@ -36,10 +36,10 @@ bool BinaryDataFontFaceSource::IsValid() + return custom_platform_data_.get(); + } + +-SimpleFontData* BinaryDataFontFaceSource::CreateFontData( ++scoped_refptr BinaryDataFontFaceSource::CreateFontData( + const FontDescription& font_description, + const FontSelectionCapabilities& font_selection_capabilities) { +- return MakeGarbageCollected( ++ return SimpleFontData::Create( + custom_platform_data_->GetFontPlatformData( + font_description.EffectiveFontSize(), + font_description.AdjustedSpecifiedSize(), +@@ -56,7 +56,7 @@ SimpleFontData* BinaryDataFontFaceSource + : ResolvedFontFeatures(), + font_description.Orientation(), font_description.VariationSettings(), + font_description.GetFontPalette()), +- MakeGarbageCollected()); ++ CustomFontData::Create()); + } + + } // namespace blink +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h +@@ -20,8 +20,9 @@ class BinaryDataFontFaceSource final : p + bool IsValid() const override; + + private: +- SimpleFontData* CreateFontData(const FontDescription&, +- const FontSelectionCapabilities&) override; ++ scoped_refptr CreateFontData( ++ const FontDescription&, ++ const FontSelectionCapabilities&) override; + + scoped_refptr custom_platform_data_; + }; +--- a/third_party/blink/renderer/core/css/css_custom_font_data.h ++++ b/third_party/blink/renderer/core/css/css_custom_font_data.h +@@ -31,18 +31,13 @@ class CSSCustomFontData final : public C + public: + enum FallbackVisibility { kInvisibleFallback, kVisibleFallback }; + +- CSSCustomFontData(CSSFontFaceSource* source, FallbackVisibility visibility) +- : font_face_source_(source), fallback_visibility_(visibility) { +- if (source) { +- is_loading_ = source->IsLoading(); +- } ++ static scoped_refptr Create( ++ CSSFontFaceSource* source, ++ FallbackVisibility visibility) { ++ return base::AdoptRef(new CSSCustomFontData(source, visibility)); + } +- ~CSSCustomFontData() override = default; + +- void Trace(Visitor* visitor) const override { +- visitor->Trace(font_face_source_); +- CustomFontData::Trace(visitor); +- } ++ ~CSSCustomFontData() override = default; + + bool ShouldSkipDrawing() const override { + if (font_face_source_) { +@@ -66,7 +61,16 @@ class CSSCustomFontData final : public C + } + + private: +- Member font_face_source_; ++ CSSCustomFontData(CSSFontFaceSource* source, FallbackVisibility visibility) ++ : font_face_source_(source), fallback_visibility_(visibility) { ++ if (source) { ++ is_loading_ = source->IsLoading(); ++ } ++ } ++ ++ // TODO(Oilpan): consider moving (Custom)FontFace hierarchy to the heap, ++ // thereby making this reference a Member<>. ++ WeakPersistent font_face_source_; + FallbackVisibility fallback_visibility_; + mutable bool is_loading_ = false; + }; +--- a/third_party/blink/renderer/core/css/css_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_font_face.cc +@@ -114,7 +114,7 @@ bool CSSFontFace::FallbackVisibilityChan + return true; + } + +-const SimpleFontData* CSSFontFace::GetFontData( ++scoped_refptr CSSFontFace::GetFontData( + const FontDescription& font_description) { + if (!IsValid()) { + return nullptr; +@@ -140,7 +140,7 @@ const SimpleFontData* CSSFontFace::GetFo + return nullptr; + } + +- if (const SimpleFontData* result = ++ if (scoped_refptr result = + source->GetFontData(size_adjusted_description, + font_face_->GetFontSelectionCapabilities())) { + // The font data here is created using the primary font's description. +@@ -149,7 +149,7 @@ const SimpleFontData* CSSFontFace::GetFo + if (size_adjusted_description.HasSizeAdjust()) { + if (auto adjusted_size = + FontSizeFunctions::MetricsMultiplierAdjustedFontSize( +- result, size_adjusted_description)) { ++ result.get(), size_adjusted_description)) { + size_adjusted_description.SetAdjustedSize(adjusted_size.value()); + result = + source->GetFontData(size_adjusted_description, +--- a/third_party/blink/renderer/core/css/css_font_face.h ++++ b/third_party/blink/renderer/core/css/css_font_face.h +@@ -76,7 +76,7 @@ class CORE_EXPORT CSSFontFace final : pu + bool FontLoaded(CSSFontFaceSource*); + bool FallbackVisibilityChanged(RemoteFontFaceSource*); + +- const SimpleFontData* GetFontData(const FontDescription&); ++ scoped_refptr GetFontData(const FontDescription&); + + FontFace::LoadStatusType LoadStatus() const { + return font_face_->LoadStatus(); +--- a/third_party/blink/renderer/core/css/css_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/css_font_face_source.cc +@@ -31,11 +31,22 @@ + #include "third_party/blink/renderer/platform/fonts/font_face_creation_params.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + ++namespace { ++// An excessive amount of SimpleFontData objects is generated from ++// CSSFontFaceSource if a lot of varying FontDescriptions point to a web ++// font. These FontDescriptions can vary in size, font-feature-settings or ++// font-variation settings. Well known cases are animations of font-variation ++// settings, compare crbug.com/778352. For a start, let's reduce this number to ++// 1024, which is still a large number and should have enough steps for font ++// animations from the same font face source, but avoids unbounded growth. ++const size_t kMaxCachedFontData = 1024; ++} // namespace ++ + namespace blink { + + CSSFontFaceSource::~CSSFontFaceSource() = default; + +-const SimpleFontData* CSSFontFaceSource::GetFontData( ++scoped_refptr CSSFontFaceSource::GetFontData( + const FontDescription& font_description, + const FontSelectionCapabilities& font_selection_capabilities) { + // If the font hasn't loaded or an error occurred, then we've got nothing. +@@ -53,12 +64,52 @@ const SimpleFontData* CSSFontFaceSource: + FontCacheKey key = + font_description.CacheKey(FontFaceCreationParams(), is_unique_match); + +- auto result = font_data_table_.insert(key, nullptr); +- if (result.is_new_entry) { +- result.stored_value->value = +- CreateFontData(font_description, font_selection_capabilities); ++ // Get or create the font data. Take care to avoid dangling references into ++ // font_data_table_, because it is modified below during pruning. ++ scoped_refptr font_data; ++ { ++ auto* it = font_data_table_.insert(key, nullptr).stored_value; ++ if (!it->value) { ++ it->value = CreateFontData(font_description, font_selection_capabilities); ++ } ++ font_data = it->value; ++ } ++ ++ font_cache_key_age.PrependOrMoveToFirst(key); ++ PruneOldestIfNeeded(); ++ ++ DCHECK_LE(font_data_table_.size(), kMaxCachedFontData); ++ // No release, because fontData is a reference to a RefPtr that is held in the ++ // font_data_table_. ++ return font_data; ++} ++ ++void CSSFontFaceSource::PruneOldestIfNeeded() { ++ if (font_cache_key_age.size() > kMaxCachedFontData) { ++ DCHECK_EQ(font_cache_key_age.size() - 1, kMaxCachedFontData); ++ const FontCacheKey& key = font_cache_key_age.back(); ++ auto font_data_entry = font_data_table_.Take(key); ++ font_cache_key_age.pop_back(); ++ DCHECK_EQ(font_cache_key_age.size(), kMaxCachedFontData); ++ if (font_data_entry && font_data_entry->GetCustomFontData()) { ++ font_data_entry->GetCustomFontData()->ClearFontFaceSource(); ++ } ++ } ++} ++ ++void CSSFontFaceSource::PruneTable() { ++ if (font_data_table_.empty()) { ++ return; ++ } ++ ++ for (const auto& item : font_data_table_) { ++ SimpleFontData* font_data = item.value.get(); ++ if (font_data && font_data->GetCustomFontData()) { ++ font_data->GetCustomFontData()->ClearFontFaceSource(); ++ } + } +- return result.stored_value->value.Get(); ++ font_cache_key_age.clear(); ++ font_data_table_.clear(); + } + + } // namespace blink +--- a/third_party/blink/renderer/core/css/css_font_face_source.h ++++ b/third_party/blink/renderer/core/css/css_font_face_source.h +@@ -30,9 +30,7 @@ + #include "third_party/blink/renderer/core/css/font_display.h" + #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" + #include "third_party/blink/renderer/platform/fonts/font_selection_types.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/hash_map.h" + #include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" +@@ -71,8 +69,8 @@ class CORE_EXPORT CSSFontFaceSource + return nullptr; + } + +- const SimpleFontData* GetFontData(const FontDescription&, +- const FontSelectionCapabilities&); ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontSelectionCapabilities&); + + // TODO(https://crbug.com/947461): IsLocalFontAvailable must not have a + // FontDescription argument. +@@ -93,29 +91,28 @@ class CORE_EXPORT CSSFontFaceSource + virtual bool HadBlankText() { return false; } + virtual void PaintRequested() {} + +- virtual void Trace(Visitor* visitor) const { +- visitor->Trace(font_data_table_); +- } ++ virtual void Trace(Visitor* visitor) const {} + + protected: + CSSFontFaceSource() = default; +- virtual const SimpleFontData* CreateFontData( ++ virtual scoped_refptr CreateFontData( + const FontDescription&, + const FontSelectionCapabilities&) = 0; +- +- void ClearTable() { font_data_table_.clear(); } ++ void PruneTable(); + + // Report the font lookup for metrics collection. Only used for local font + // face sources currently. + virtual void ReportFontLookup(const FontDescription& font_description, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + bool is_loading_fallback = false) {} + + private: +- using FontDataTable = +- HeapHashMap>; ++ void PruneOldestIfNeeded(); ++ using FontDataTable = HashMap>; ++ using FontCacheKeyAgeList = LinkedHashSet; + + FontDataTable font_data_table_; ++ FontCacheKeyAgeList font_cache_key_age; + }; + + } // namespace blink +--- a/third_party/blink/renderer/core/css/css_font_selector.cc ++++ b/third_party/blink/renderer/core/css/css_font_selector.cc +@@ -162,7 +162,7 @@ void CSSFontSelector::FontCacheInvalidat + DispatchInvalidationCallbacks(FontInvalidationReason::kGeneralInvalidation); + } + +-const FontData* CSSFontSelector::GetFontData( ++scoped_refptr CSSFontSelector::GetFontData( + const FontDescription& font_description, + const FontFamily& font_family) { + const auto& family_name = font_family.FamilyName(); +@@ -252,13 +252,13 @@ const FontData* CSSFontSelector::GetFont + family_name, request_description.GetScript(), + request_description.GenericFamily(), settings_family_name); + +- const SimpleFontData* font_data = ++ scoped_refptr font_data = + FontCache::Get().GetFontData(request_description, settings_family_name); + if (font_data && request_description.HasSizeAdjust()) { + DCHECK(RuntimeEnabledFeatures::CSSFontSizeAdjustEnabled()); + if (auto adjusted_size = + FontSizeFunctions::MetricsMultiplierAdjustedFontSize( +- font_data, request_description)) { ++ font_data.get(), request_description)) { + FontDescription size_adjusted_description(request_description); + size_adjusted_description.SetAdjustedSize(adjusted_size.value()); + font_data = FontCache::Get().GetFontData(size_adjusted_description, +--- a/third_party/blink/renderer/core/css/css_font_selector.h ++++ b/third_party/blink/renderer/core/css/css_font_selector.h +@@ -49,8 +49,8 @@ class CORE_EXPORT CSSFontSelector : publ + + unsigned Version() const override { return font_face_cache_->Version(); } + +- const FontData* GetFontData(const FontDescription&, +- const FontFamily&) override; ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) override; + + void FontFaceInvalidated(FontInvalidationReason) override; + +--- a/third_party/blink/renderer/core/css/css_font_selector_base.cc ++++ b/third_party/blink/renderer/core/css/css_font_selector_base.cc +@@ -87,21 +87,21 @@ void CSSFontSelectorBase::ReportFailedLo + void CSSFontSelectorBase::ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ scoped_refptr resulting_font_data) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportFontLookupByUniqueOrFamilyName( +- name, font_description, resulting_font_data); ++ name, font_description, resulting_font_data.get()); + } + } + + void CSSFontSelectorBase::ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportFontLookupByUniqueNameOnly( +- name, font_description, resulting_font_data, is_loading_fallback); ++ name, font_description, resulting_font_data.get(), is_loading_fallback); + } + } + +@@ -109,20 +109,20 @@ void CSSFontSelectorBase::ReportFontLook + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ scoped_refptr resulting_font_data) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportFontLookupByFallbackCharacter( + fallback_character, fallback_priority, font_description, +- resulting_font_data); ++ resulting_font_data.get()); + } + } + + void CSSFontSelectorBase::ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ scoped_refptr resulting_font_data) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportLastResortFallbackFontLookup( +- font_description, resulting_font_data); ++ font_description, resulting_font_data.get()); + } + } + +--- a/third_party/blink/renderer/core/css/css_font_selector_base.h ++++ b/third_party/blink/renderer/core/css/css_font_selector_base.h +@@ -46,23 +46,23 @@ class CORE_EXPORT CSSFontSelectorBase : + void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override; ++ scoped_refptr resulting_font_data) override; + + void ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback = false) override; + + void ReportFontLookupByFallbackCharacter( + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override; ++ scoped_refptr resulting_font_data) override; + + void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override; ++ scoped_refptr resulting_font_data) override; + + void ReportFontFamilyLookupByGenericFamily( + const AtomicString& generic_font_family_name, +--- a/third_party/blink/renderer/core/css/css_segmented_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_segmented_font_face.cc +@@ -38,16 +38,42 @@ + #include "third_party/blink/renderer/platform/fonts/segmented_font_data.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + ++// See comment below in CSSSegmentedFontFace::GetFontData - the cache from ++// CSSSegmentedFontFace (which represents a group of @font-face declarations ++// with identical FontSelectionCapabilities but differing by unicode-range) to ++// FontData/SegmentedFontData, (i.e. the actual font blobs that can be used for ++// shaping and painting retrieved from a CSSFontFaceSource) is usually small ++// (less than a dozen, up to tens) for non-animation-cases, but grows fast to ++// thousands when animating variable font parameters. Set a limit until we start ++// dropping cache entries in animation scenarios. ++static constexpr size_t kFontDataTableMaxSize = 250; ++ + namespace blink { + ++// static ++CSSSegmentedFontFace* CSSSegmentedFontFace::Create( ++ FontSelectionCapabilities capabilities) { ++ return MakeGarbageCollected(capabilities); ++} ++ + CSSSegmentedFontFace::CSSSegmentedFontFace( + FontSelectionCapabilities font_selection_capabilities) + : font_selection_capabilities_(font_selection_capabilities), ++ font_data_table_(kFontDataTableMaxSize), + font_faces_(MakeGarbageCollected()), + approximate_character_count_(0) {} + + CSSSegmentedFontFace::~CSSSegmentedFontFace() = default; + ++void CSSSegmentedFontFace::PruneTable() { ++ // Make sure the glyph page tree prunes out all uses of this custom font. ++ if (!font_data_table_.size()) { ++ return; ++ } ++ ++ font_data_table_.Clear(); ++} ++ + bool CSSSegmentedFontFace::IsValid() const { + // Valid if at least one font face is valid. + return font_faces_->ForEachUntilTrue( +@@ -57,12 +83,12 @@ bool CSSSegmentedFontFace::IsValid() con + } + + void CSSSegmentedFontFace::FontFaceInvalidated() { +- font_data_table_.clear(); ++ PruneTable(); + } + + void CSSSegmentedFontFace::AddFontFace(FontFace* font_face, + bool css_connected) { +- font_data_table_.clear(); ++ PruneTable(); + font_face->CssFontFace()->AddSegmentedFontFace(this); + font_faces_->Insert(font_face, css_connected); + } +@@ -72,11 +98,11 @@ void CSSSegmentedFontFace::RemoveFontFac + return; + } + +- font_data_table_.clear(); ++ PruneTable(); + font_face->CssFontFace()->RemoveSegmentedFontFace(this); + } + +-const FontData* CSSSegmentedFontFace::GetFontData( ++scoped_refptr CSSSegmentedFontFace::GetFontData( + const FontDescription& font_description) { + if (!IsValid()) { + return nullptr; +@@ -98,16 +124,16 @@ const FontData* CSSSegmentedFontFace::Ge + // usually only a small number of FontData/SegmentedFontData instances created + // per CSSSegmentedFontFace. Whereas in variable font animations, this number + // grows rapidly. +- auto it = font_data_table_.find(key); ++ auto it = font_data_table_.Get(key); + if (it != font_data_table_.end()) { +- const SegmentedFontData* cached_font_data = it->value.Get(); ++ scoped_refptr cached_font_data = it->second; + if (cached_font_data && cached_font_data->NumFaces()) { + return cached_font_data; + } + } + +- SegmentedFontData* created_font_data = +- MakeGarbageCollected(); ++ scoped_refptr created_font_data = ++ SegmentedFontData::Create(); + + FontDescription requested_font_description(font_description); + const FontSelectionRequest& font_selection_request = +@@ -126,16 +152,26 @@ const FontData* CSSSegmentedFontFace::Ge + if (!font_face->CssFontFace()->IsValid()) { + return; + } +- if (const SimpleFontData* face_font_data = ++ if (scoped_refptr face_font_data = + font_face->CssFontFace()->GetFontData(requested_font_description)) { + DCHECK(!face_font_data->IsSegmented()); +- created_font_data->AppendFace(MakeGarbageCollected( +- std::move(face_font_data), font_face->CssFontFace()->Ranges())); ++ if (face_font_data->IsCustomFont()) { ++ created_font_data->AppendFace(base::AdoptRef(new FontDataForRangeSet( ++ std::move(face_font_data), font_face->CssFontFace()->Ranges()))); ++ } else { ++ created_font_data->AppendFace( ++ base::AdoptRef(new FontDataForRangeSetFromCache( ++ std::move(face_font_data), ++ font_face->CssFontFace()->Ranges()))); ++ } + } + }); + + if (created_font_data->NumFaces()) { +- font_data_table_.insert(std::move(key), created_font_data); ++ scoped_refptr put_to_cache(created_font_data); ++ font_data_table_.Put(std::move(key), std::move(put_to_cache)); ++ // No release, we have a reference to an object in the cache which should ++ // retain the ref count it has. + return created_font_data; + } + +@@ -186,7 +222,6 @@ void CSSSegmentedFontFace::Match(const S + } + + void CSSSegmentedFontFace::Trace(Visitor* visitor) const { +- visitor->Trace(font_data_table_); + visitor->Trace(font_faces_); + } + +--- a/third_party/blink/renderer/core/css/css_segmented_font_face.h ++++ b/third_party/blink/renderer/core/css/css_segmented_font_face.h +@@ -32,7 +32,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" + #include "third_party/blink/renderer/platform/fonts/font_selection_types.h" + #include "third_party/blink/renderer/platform/fonts/segmented_font_data.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +@@ -84,6 +83,8 @@ class FontFaceList : public GarbageColle + class CSSSegmentedFontFace final + : public GarbageCollected { + public: ++ static CSSSegmentedFontFace* Create(FontSelectionCapabilities); ++ + explicit CSSSegmentedFontFace(FontSelectionCapabilities); + ~CSSSegmentedFontFace(); + +@@ -99,7 +100,7 @@ class CSSSegmentedFontFace final + void RemoveFontFace(FontFace*); + bool IsEmpty() const { return font_faces_->IsEmpty(); } + +- const FontData* GetFontData(const FontDescription&); ++ scoped_refptr GetFontData(const FontDescription&); + + bool CheckFont(UChar32) const; + void Match(const String&, HeapVector>*) const; +@@ -112,11 +113,12 @@ class CSSSegmentedFontFace final + void Trace(Visitor*) const; + + private: ++ void PruneTable(); + bool IsValid() const; + + FontSelectionCapabilities font_selection_capabilities_; + +- HeapHashMap> ++ base::HashingLRUCache> + font_data_table_; + + // All non-CSS-connected FontFaces are stored after the CSS-connected ones. +--- a/third_party/blink/renderer/core/css/font_face_cache.cc ++++ b/third_party/blink/renderer/core/css/font_face_cache.cc +@@ -85,8 +85,8 @@ void FontFaceCache::CapabilitiesSet::Add + const auto result = + map_.insert(font_face->GetFontSelectionCapabilities(), nullptr); + if (result.is_new_entry) { +- result.stored_value->value = MakeGarbageCollected( +- font_face->GetFontSelectionCapabilities()); ++ result.stored_value->value = ++ CSSSegmentedFontFace::Create(font_face->GetFontSelectionCapabilities()); + } + + result.stored_value->value->AddFontFace(font_face, css_connected); +--- a/third_party/blink/renderer/core/css/local_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/local_font_face_source.cc +@@ -52,22 +52,23 @@ bool LocalFontFaceSource::IsLocalFontAva + return font_available; + } + +-const SimpleFontData* LocalFontFaceSource::CreateLoadingFallbackFontData( ++scoped_refptr ++LocalFontFaceSource::CreateLoadingFallbackFontData( + const FontDescription& font_description) { + FontCachePurgePreventer font_cache_purge_preventer; +- const SimpleFontData* temporary_font = +- FontCache::Get().GetLastResortFallbackFont(font_description); ++ scoped_refptr temporary_font = ++ FontCache::Get().GetLastResortFallbackFont(font_description, ++ kDoNotRetain); + if (!temporary_font) { + NOTREACHED(); + return nullptr; + } +- CSSCustomFontData* css_font_data = MakeGarbageCollected( +- this, CSSCustomFontData::kVisibleFallback); +- return MakeGarbageCollected(&temporary_font->PlatformData(), +- css_font_data); ++ scoped_refptr css_font_data = ++ CSSCustomFontData::Create(this, CSSCustomFontData::kVisibleFallback); ++ return SimpleFontData::Create(temporary_font->PlatformData(), css_font_data); + } + +-const SimpleFontData* LocalFontFaceSource::CreateFontData( ++scoped_refptr LocalFontFaceSource::CreateFontData( + const FontDescription& font_description, + const FontSelectionCapabilities&) { + if (!IsValid()) { +@@ -84,9 +85,9 @@ const SimpleFontData* LocalFontFaceSourc + } + + if (IsValid() && IsLoading()) { +- const SimpleFontData* fallback_font_data = ++ scoped_refptr fallback_font_data = + CreateLoadingFallbackFontData(font_description); +- ReportFontLookup(font_description, fallback_font_data, ++ ReportFontLookup(font_description, fallback_font_data.get(), + true /* is_loading_fallback */); + return fallback_font_data; + } +@@ -110,10 +111,10 @@ const SimpleFontData* LocalFontFaceSourc + #endif + // TODO(https://crbug.com/1302264): Enable passing down of font-palette + // information here (font_description.GetFontPalette()). +- const SimpleFontData* font_data = FontCache::Get().GetFontData( ++ scoped_refptr font_data = FontCache::Get().GetFontData( + unstyled_description, font_name_, AlternateFontName::kLocalUniqueFace); +- histograms_.Record(font_data); +- ReportFontLookup(unstyled_description, font_data); ++ histograms_.Record(font_data.get()); ++ ReportFontLookup(unstyled_description, font_data.get()); + return font_data; + } + +@@ -132,7 +133,7 @@ void LocalFontFaceSource::BeginLoadIfNee + } + + void LocalFontFaceSource::NotifyFontUniqueNameLookupReady() { +- ClearTable(); ++ PruneTable(); + + if (face_->FontLoaded(this)) { + font_selector_->FontFaceInvalidated( +@@ -168,7 +169,7 @@ void LocalFontFaceSource::Trace(Visitor* + + void LocalFontFaceSource::ReportFontLookup( + const FontDescription& font_description, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + bool is_loading_fallback) { + font_selector_->ReportFontLookupByUniqueNameOnly( + font_name_, font_description, font_data, is_loading_fallback); +--- a/third_party/blink/renderer/core/css/local_font_face_source.h ++++ b/third_party/blink/renderer/core/css/local_font_face_source.h +@@ -48,15 +48,16 @@ class LocalFontFaceSource final : public + void NotifyFontUniqueNameLookupReady(); + + protected: +- const SimpleFontData* CreateLoadingFallbackFontData(const FontDescription&); ++ scoped_refptr CreateLoadingFallbackFontData( ++ const FontDescription&); + + private: +- const SimpleFontData* CreateFontData( ++ scoped_refptr CreateFontData( + const FontDescription&, + const FontSelectionCapabilities&) override; + + void ReportFontLookup(const FontDescription& font_description, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + bool is_loading_fallback = false) override; + + class LocalFontHistograms { +--- a/third_party/blink/renderer/core/css/offscreen_font_selector.cc ++++ b/third_party/blink/renderer/core/css/offscreen_font_selector.cc +@@ -39,7 +39,7 @@ void OffscreenFontSelector::RegisterForI + void OffscreenFontSelector::UnregisterForInvalidationCallbacks( + FontSelectorClient* client) {} + +-const FontData* OffscreenFontSelector::GetFontData( ++scoped_refptr OffscreenFontSelector::GetFontData( + const FontDescription& font_description, + const FontFamily& font_family) { + const auto& family_name = font_family.FamilyName(); +@@ -60,11 +60,11 @@ const FontData* OffscreenFontSelector::G + family_name, font_description.GetScript(), + font_description.GenericFamily(), settings_family_name); + +- const auto* font_data = ++ auto font_data = + FontCache::Get().GetFontData(font_description, settings_family_name); + + ReportFontLookupByUniqueOrFamilyName(settings_family_name, font_description, +- font_data); ++ font_data.get()); + + return font_data; + } +--- a/third_party/blink/renderer/core/css/offscreen_font_selector.h ++++ b/third_party/blink/renderer/core/css/offscreen_font_selector.h +@@ -26,8 +26,8 @@ class CORE_EXPORT OffscreenFontSelector + + unsigned Version() const override { return 1; } + +- const FontData* GetFontData(const FontDescription&, +- const FontFamily&) override; ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) override; + + void RegisterForInvalidationCallbacks(FontSelectorClient*) override; + void UnregisterForInvalidationCallbacks(FontSelectorClient*) override; +--- a/third_party/blink/renderer/core/css/remote_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc +@@ -240,7 +240,8 @@ void RemoteFontFaceSource::NotifyFinishe + } + + ClearResource(); +- ClearTable(); ++ ++ PruneTable(); + + if (GetDocument()) { + if (!GetDocument()->RenderingHasBegun()) { +@@ -305,7 +306,7 @@ bool RemoteFontFaceSource::UpdatePeriod( + // Invalidate the font if its fallback visibility has changed. + if (IsLoading() && period_ != new_period && + (period_ == kBlockPeriod || new_period == kBlockPeriod)) { +- ClearTable(); ++ PruneTable(); + if (face_->FallbackVisibilityChanged(this)) { + font_selector_->FontFaceInvalidated( + FontInvalidationReason::kGeneralInvalidation); +@@ -349,7 +350,7 @@ bool RemoteFontFaceSource::IsLowPriority + return is_intervention_triggered_; + } + +-const SimpleFontData* RemoteFontFaceSource::CreateFontData( ++scoped_refptr RemoteFontFaceSource::CreateFontData( + const FontDescription& font_description, + const FontSelectionCapabilities& font_selection_capabilities) { + if (period_ == kFailurePeriod || !IsValid()) { +@@ -362,7 +363,7 @@ const SimpleFontData* RemoteFontFaceSour + + histograms_.RecordFallbackTime(); + +- return MakeGarbageCollected( ++ return SimpleFontData::Create( + custom_font_data_->GetFontPlatformData( + font_description.EffectiveFontSize(), + font_description.AdjustedSpecifiedSize(), +@@ -379,24 +380,25 @@ const SimpleFontData* RemoteFontFaceSour + : ResolvedFontFeatures(), + font_description.Orientation(), font_description.VariationSettings(), + font_description.GetFontPalette()), +- MakeGarbageCollected()); ++ CustomFontData::Create()); + } + +-const SimpleFontData* RemoteFontFaceSource::CreateLoadingFallbackFontData( ++scoped_refptr ++RemoteFontFaceSource::CreateLoadingFallbackFontData( + const FontDescription& font_description) { + // This temporary font is not retained and should not be returned. + FontCachePurgePreventer font_cache_purge_preventer; +- const SimpleFontData* temporary_font = +- FontCache::Get().GetLastResortFallbackFont(font_description); ++ scoped_refptr temporary_font = ++ FontCache::Get().GetLastResortFallbackFont(font_description, ++ kDoNotRetain); + if (!temporary_font) { + DUMP_WILL_BE_NOTREACHED_NORETURN(); + return nullptr; + } +- CSSCustomFontData* css_font_data = MakeGarbageCollected( ++ scoped_refptr css_font_data = CSSCustomFontData::Create( + this, period_ == kBlockPeriod ? CSSCustomFontData::kInvisibleFallback + : CSSCustomFontData::kVisibleFallback); +- return MakeGarbageCollected(&temporary_font->PlatformData(), +- css_font_data); ++ return SimpleFontData::Create(temporary_font->PlatformData(), css_font_data); + } + + void RemoteFontFaceSource::BeginLoadIfNeeded() { +--- a/third_party/blink/renderer/core/css/remote_font_face_source.h ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.h +@@ -66,10 +66,11 @@ class RemoteFontFaceSource final : publi + void Trace(Visitor*) const override; + + protected: +- const SimpleFontData* CreateFontData( ++ scoped_refptr CreateFontData( + const FontDescription&, + const FontSelectionCapabilities&) override; +- const SimpleFontData* CreateLoadingFallbackFontData(const FontDescription&); ++ scoped_refptr CreateLoadingFallbackFontData( ++ const FontDescription&); + + private: + // Periods of the Font Display Timeline. +--- a/third_party/blink/renderer/core/frame/font_matching_metrics.cc ++++ b/third_party/blink/renderer/core/frame/font_matching_metrics.cc +@@ -127,7 +127,7 @@ void FontMatchingMetrics::ReportLocalFon + } + + void FontMatchingMetrics::InsertFontHashIntoMap(IdentifiableTokenKey input_key, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + TokenToTokenHashMap& hash_map) { + DCHECK(IdentifiabilityStudyShouldSampleFonts()); + if (hash_map.Contains(input_key)) { +@@ -160,7 +160,7 @@ FontMatchingMetrics::GetTokenBuilderWith + void FontMatchingMetrics::ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ SimpleFontData* resulting_font_data) { + Dactyloscoper::TraceFontLookup( + execution_context_, name, font_description, + Dactyloscoper::FontLookupType::kUniqueOrFamilyName); +@@ -184,7 +184,7 @@ void FontMatchingMetrics::ReportFontLook + void FontMatchingMetrics::ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ SimpleFontData* resulting_font_data, + bool is_loading_fallback) { + // We ignore lookups that result in loading fallbacks for now as they should + // only be temporary. +@@ -217,7 +217,7 @@ void FontMatchingMetrics::ReportFontLook + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ SimpleFontData* resulting_font_data) { + if (!IdentifiabilityStudySettings::Get()->ShouldSampleType( + IdentifiableSurface::Type::kLocalFontLookupByFallbackCharacter)) { + return; +@@ -236,7 +236,7 @@ void FontMatchingMetrics::ReportFontLook + + void FontMatchingMetrics::ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ SimpleFontData* resulting_font_data) { + if (!IdentifiabilityStudySettings::Get()->ShouldSampleType( + IdentifiableSurface::Type::kLocalFontLookupAsLastResort)) { + return; +@@ -361,8 +361,7 @@ void FontMatchingMetrics::PublishAllMetr + PublishEmojiGlyphMetrics(); + } + +-int64_t FontMatchingMetrics::GetHashForFontData( +- const SimpleFontData* font_data) { ++int64_t FontMatchingMetrics::GetHashForFontData(SimpleFontData* font_data) { + return font_data ? FontGlobalContext::Get() + .GetOrComputeTypefaceDigest(font_data->PlatformData()) + .ToUkmMetricValue() +@@ -370,7 +369,7 @@ int64_t FontMatchingMetrics::GetHashForF + } + + IdentifiableToken FontMatchingMetrics::GetPostScriptNameTokenForFontData( +- const SimpleFontData* font_data) { ++ SimpleFontData* font_data) { + DCHECK(font_data); + return FontGlobalContext::Get().GetOrComputePostScriptNameDigest( + font_data->PlatformData()); +--- a/third_party/blink/renderer/core/frame/font_matching_metrics.h ++++ b/third_party/blink/renderer/core/frame/font_matching_metrics.h +@@ -100,16 +100,15 @@ class FontMatchingMetrics { + void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data); ++ SimpleFontData* resulting_font_data); + + // Reports a local font was looked up by a name and font description. This + // only includes lookups where the name is allowed to match PostScript names + // and full font names, but not family names. +- void ReportFontLookupByUniqueNameOnly( +- const AtomicString& name, +- const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, +- bool is_loading_fallback = false); ++ void ReportFontLookupByUniqueNameOnly(const AtomicString& name, ++ const FontDescription& font_description, ++ SimpleFontData* resulting_font_data, ++ bool is_loading_fallback = false); + + // Reports a font was looked up by a fallback character, fallback priority, + // and a font description. +@@ -117,12 +116,12 @@ class FontMatchingMetrics { + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data); ++ SimpleFontData* resulting_font_data); + + // Reports a last-resort fallback font was looked up by a font description. + void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data); ++ SimpleFontData* resulting_font_data); + + // Reports a generic font family name was matched according to the script and + // the user's preferences to a font family name. +@@ -171,7 +170,7 @@ class FontMatchingMetrics { + // nullptr, then the typeface digest will also be saved with its PostScript + // name in |font_load_postscript_name_|. + void InsertFontHashIntoMap(IdentifiableTokenKey input_key, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + TokenToTokenHashMap& hash_map); + + // Reports a local font's existence was looked up by a name, but its actual +@@ -194,14 +193,14 @@ class FontMatchingMetrics { + + // Get a hash that uniquely represents the font data. Returns 0 if |font_data| + // is nullptr. +- int64_t GetHashForFontData(const SimpleFontData* font_data); ++ int64_t GetHashForFontData(SimpleFontData* font_data); + + void Initialize(); + + // Get a token that uniquely represents the typeface's PostScript name. May + // represent the empty string if no PostScript name was found. + IdentifiableToken GetPostScriptNameTokenForFontData( +- const SimpleFontData* font_data); ++ SimpleFontData* font_data); + + TokenToTokenHashMap font_lookups_by_unique_or_family_name_; + TokenToTokenHashMap font_lookups_by_unique_name_only_; +--- a/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc ++++ b/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc +@@ -132,8 +132,8 @@ class PopupMenuCSSFontSelector : public + + // We don't override willUseFontData() for now because the old PopupListBox + // only worked with fonts loaded when opening the popup. +- const FontData* GetFontData(const FontDescription&, +- const FontFamily&) override; ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) override; + + void Trace(Visitor*) const override; + +@@ -152,7 +152,7 @@ PopupMenuCSSFontSelector::PopupMenuCSSFo + + PopupMenuCSSFontSelector::~PopupMenuCSSFontSelector() = default; + +-const FontData* PopupMenuCSSFontSelector::GetFontData( ++scoped_refptr PopupMenuCSSFontSelector::GetFontData( + const FontDescription& description, + const FontFamily& font_family) { + return owner_font_selector_->GetFontData(description, font_family); +--- a/third_party/blink/renderer/core/inspector/inspector_css_agent.cc ++++ b/third_party/blink/renderer/core/inspector/inspector_css_agent.cc +@@ -122,7 +122,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_custom_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/text/text_run.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +@@ -200,10 +199,10 @@ HeapVector> FilterD + } + + void CollectPlatformFontsFromRunFontDataList( +- const HeapVector& run_font_data_list, ++ const Vector& run_font_data_list, + HashMap, std::pair>* font_stats) { + for (const auto& run_font_data : run_font_data_list) { +- const auto* simple_font_data = run_font_data.font_data_.Get(); ++ const auto* simple_font_data = run_font_data.font_data_; + String family_name = simple_font_data->PlatformData().FontFamilyName(); + if (family_name.IsNull()) + family_name = ""; +@@ -1733,8 +1732,7 @@ void InspectorCSSAgent::CollectPlatformF + if (!shape_result) { + continue; + } +- HeapVector run_font_data_list; +- ClearCollectionScope clear_scope(&run_font_data_list); ++ Vector run_font_data_list; + shape_result->GetRunFontData(&run_font_data_list); + CollectPlatformFontsFromRunFontDataList(run_font_data_list, font_stats); + } +--- a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc ++++ b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc +@@ -19,7 +19,6 @@ + #include "third_party/blink/renderer/core/style/computed_style.h" + #include "third_party/blink/renderer/core/svg/svg_length_functions.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + + namespace blink { + +@@ -169,8 +168,7 @@ void InlineBoxState::EnsureTextMetrics(c + + void InlineBoxState::AccumulateUsedFonts(const ShapeResultView* shape_result) { + const auto baseline_type = style->GetFontBaseline(); +- HeapHashSet> fallback_fonts; +- ClearCollectionScope clear_scope(&fallback_fonts); ++ HashSet fallback_fonts; + shape_result->FallbackFonts(&fallback_fonts); + for (const SimpleFontData* const fallback_font : fallback_fonts) { + FontHeight fallback_metrics = +--- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc ++++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc +@@ -12,7 +12,6 @@ + #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" + #include "third_party/blink/renderer/core/layout/physical_box_fragment.h" + #include "third_party/blink/renderer/platform/fonts/font_height.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + + namespace blink { + +@@ -33,10 +32,11 @@ std::tuple Adjus + primary_font_data->GetFontMetrics().FixedAscent(font_baseline); + const LayoutUnit primary_descent = line_height - primary_ascent; + ++ DCHECK(IsMainThread()); ++ DEFINE_STATIC_LOCAL(Vector, run_fonts, ()); ++ DCHECK_EQ(run_fonts.size(), 0u); + // We don't use ShapeResultView::FallbackFonts() because we can't know if the + // primary font is actually used with FallbackFonts(). +- HeapVector run_fonts; +- ClearCollectionScope clear_scope(&run_fonts); + shape_view.GetRunFontData(&run_fonts); + const LayoutUnit kNoDiff = LayoutUnit::Max(); + LayoutUnit over_diff = kNoDiff; +@@ -60,6 +60,7 @@ std::tuple Adjus + over_diff = std::min(over_diff, current_over_diff); + under_diff = std::min(under_diff, current_under_diff); + } ++ run_fonts.resize(0); + if (over_diff == kNoDiff) + over_diff = LayoutUnit(); + if (under_diff == kNoDiff) +--- a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc ++++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc +@@ -16,7 +16,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + + namespace blink { + +@@ -36,8 +35,7 @@ void GetFontsUsedByFragment(const Physic + shape_result_view->PrimaryFont()->PlatformData().FontFamilyName(); + if (!font_family.empty()) + result.font_names.insert(font_family); +- HeapHashSet> fallback_font_data; +- ClearCollectionScope clear_scope(&fallback_font_data); ++ HashSet fallback_font_data; + shape_result_view->FallbackFonts(&fallback_font_data); + for (const SimpleFontData* font_data : fallback_font_data) { + result.font_names.insert(font_data->PlatformData().FontFamilyName()); +--- a/third_party/blink/renderer/modules/font_access/font_metadata.cc ++++ b/third_party/blink/renderer/modules/font_access/font_metadata.cc +@@ -77,7 +77,7 @@ void FontMetadata::BlobImpl(ScriptPromis + SetUpFontUniqueLookupIfNecessary(); + + FontDescription description; +- const SimpleFontData* font_data = ++ scoped_refptr font_data = + FontCache::Get().GetFontData(description, AtomicString(postscriptName), + AlternateFontName::kLocalUniqueFace); + if (!font_data) { +--- a/third_party/blink/renderer/platform/BUILD.gn ++++ b/third_party/blink/renderer/platform/BUILD.gn +@@ -621,6 +621,7 @@ component("platform") { + "fonts/font_cache_memory_dump_provider.h", + "fonts/font_custom_platform_data.cc", + "fonts/font_custom_platform_data.h", ++ "fonts/font_data.cc", + "fonts/font_data.h", + "fonts/font_data_cache.cc", + "fonts/font_data_cache.h", +--- a/third_party/blink/renderer/platform/fonts/android/font_cache_android.cc ++++ b/third_party/blink/renderer/platform/fonts/android/font_cache_android.cc +@@ -127,7 +127,7 @@ sk_sp FontCache::CreateLocal + return nullptr; + } + +-const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( ++scoped_refptr FontCache::PlatformFallbackFontForCharacter( + const FontDescription& font_description, + UChar32 c, + const SimpleFontData*, +@@ -158,7 +158,7 @@ const SimpleFontData* FontCache::Platfor + if (fallback_priority == FontFallbackPriority::kEmojiEmoji && + base::FeatureList::IsEnabled(features::kGMSCoreEmoji)) { + auto skia_fallback_is_noto_color_emoji = [&]() { +- const FontPlatformData* skia_fallback_result = GetFontPlatformData( ++ FontPlatformData* skia_fallback_result = GetFontPlatformData( + font_description, FontFaceCreationParams(family_name)); + + // Determining the PostScript name is required as Skia on Android gives +@@ -175,14 +175,15 @@ const SimpleFontData* FontCache::Platfor + }; + + if (family_name.empty() || skia_fallback_is_noto_color_emoji()) { +- const FontPlatformData* emoji_gms_core_font = GetFontPlatformData( ++ FontPlatformData* emoji_gms_core_font = GetFontPlatformData( + font_description, + FontFaceCreationParams(AtomicString(kNotoColorEmojiCompat))); + if (emoji_gms_core_font) { + SkTypeface* probe_coverage_typeface = emoji_gms_core_font->Typeface(); + if (probe_coverage_typeface && + probe_coverage_typeface->unicharToGlyph(c)) { +- return FontDataFromFontPlatformData(emoji_gms_core_font); ++ return FontDataFromFontPlatformData(emoji_gms_core_font, ++ kDoNotRetain); + } + } + } +@@ -192,10 +193,12 @@ const SimpleFontData* FontCache::Platfor + // font was not found or an OEM emoji font was not to be overridden. + + if (family_name.empty()) +- return GetLastResortFallbackFont(font_description); ++ return GetLastResortFallbackFont(font_description, kDoNotRetain); + +- return FontDataFromFontPlatformData(GetFontPlatformData( +- font_description, FontFaceCreationParams(family_name))); ++ return FontDataFromFontPlatformData( ++ GetFontPlatformData(font_description, ++ FontFaceCreationParams(family_name)), ++ kDoNotRetain); + } + + // static +--- a/third_party/blink/renderer/platform/fonts/custom_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h +@@ -22,8 +22,8 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_CUSTOM_FONT_DATA_H_ + + #include "base/memory/scoped_refptr.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" ++#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" + + namespace blink { + +@@ -34,17 +34,22 @@ namespace blink { + // * `BinaryDataFontFaceSource` as loaded font resource + // * `LocalFontFaceSource` as derived class `CSSCustomFontData` + // * `RemoteFontFaceSource` as derived class `CSSCustomFontData` +-class PLATFORM_EXPORT CustomFontData : public GarbageCollected { ++class PLATFORM_EXPORT CustomFontData : public RefCounted { + public: +- CustomFontData() = default; ++ static scoped_refptr Create() { ++ return base::AdoptRef(new CustomFontData()); ++ } ++ + virtual ~CustomFontData() = default; +- virtual void Trace(Visitor*) const {} + + virtual void BeginLoadIfNeeded() const {} + virtual bool IsLoading() const { return false; } + virtual bool IsLoadingFallback() const { return false; } + virtual bool ShouldSkipDrawing() const { return false; } + virtual bool IsPendingDataUrl() const { return false; } ++ ++ protected: ++ CustomFontData() = default; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_cache.cc +@@ -87,7 +87,10 @@ FontCache& FontCache::Get() { + return FontGlobalContext::GetFontCache(); + } + +-FontCache::FontCache() : font_manager_(sk_ref_sp(static_font_manager_)) { ++FontCache::FontCache() ++ : font_manager_(sk_ref_sp(static_font_manager_)), ++ font_platform_data_cache_(FontPlatformDataCache::Create()), ++ font_data_cache_(FontDataCache::Create()) { + #if BUILDFLAG(IS_WIN) + if (!font_manager_ || should_use_test_font_mgr) { + // This code path is only for unit tests. This SkFontMgr does not work in +@@ -113,14 +116,12 @@ FontCache::~FontCache() = default; + + void FontCache::Trace(Visitor* visitor) const { + visitor->Trace(font_cache_clients_); +- visitor->Trace(font_platform_data_cache_); +- visitor->Trace(fallback_list_shaper_cache_); +- visitor->Trace(font_data_cache_); + visitor->Trace(font_fallback_map_); ++ visitor->Trace(fallback_list_shaper_cache_); + } + + #if !BUILDFLAG(IS_MAC) +-const FontPlatformData* FontCache::SystemFontPlatformData( ++FontPlatformData* FontCache::SystemFontPlatformData( + const FontDescription& font_description) { + const AtomicString& family = FontCache::SystemFontFamily(); + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \ +@@ -135,7 +136,7 @@ const FontPlatformData* FontCache::Syste + } + #endif + +-const FontPlatformData* FontCache::GetFontPlatformData( ++FontPlatformData* FontCache::GetFontPlatformData( + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, + AlternateFontName alternate_font_name) { +@@ -153,7 +154,7 @@ const FontPlatformData* FontCache::GetFo + } + #endif + +- return font_platform_data_cache_.GetOrCreateFontPlatformData( ++ return font_platform_data_cache_->GetOrCreateFontPlatformData( + this, font_description, creation_params, alternate_font_name); + } + +@@ -175,26 +176,34 @@ void FontCache::AcceptLanguagesChanged(c + Get().InvalidateShapeCache(); + } + +-const SimpleFontData* FontCache::GetFontData( ++scoped_refptr FontCache::GetFontData( + const FontDescription& font_description, + const AtomicString& family, +- AlternateFontName altername_font_name) { +- if (const FontPlatformData* platform_data = GetFontPlatformData( ++ AlternateFontName altername_font_name, ++ ShouldRetain should_retain) { ++ if (FontPlatformData* platform_data = GetFontPlatformData( + font_description, + FontFaceCreationParams( + AdjustFamilyNameToAvoidUnsupportedFonts(family)), + altername_font_name)) { + return FontDataFromFontPlatformData( +- platform_data, font_description.SubpixelAscentDescent()); ++ platform_data, should_retain, font_description.SubpixelAscentDescent()); + } + + return nullptr; + } + +-const SimpleFontData* FontCache::FontDataFromFontPlatformData( ++scoped_refptr FontCache::FontDataFromFontPlatformData( + const FontPlatformData* platform_data, ++ ShouldRetain should_retain, + bool subpixel_ascent_descent) { +- return font_data_cache_.Get(platform_data, subpixel_ascent_descent); ++#if DCHECK_IS_ON() ++ if (should_retain == kDoNotRetain) ++ DCHECK(purge_prevent_count_); ++#endif ++ ++ return font_data_cache_->Get(platform_data, should_retain, ++ subpixel_ascent_descent); + } + + bool FontCache::IsPlatformFamilyMatchAvailable( +@@ -223,7 +232,15 @@ String FontCache::FirstAvailableOrFirst( + gfx::FontList::FirstAvailableOrFirst(families.Utf8().c_str())); + } + +-const SimpleFontData* FontCache::FallbackFontForCharacter( ++SimpleFontData* FontCache::GetNonRetainedLastResortFallbackFont( ++ const FontDescription& font_description) { ++ auto font = GetLastResortFallbackFont(font_description, kDoNotRetain); ++ if (font) ++ font->AddRef(); ++ return font.get(); ++} ++ ++scoped_refptr FontCache::FallbackFontForCharacter( + const FontDescription& description, + UChar32 lookup_char, + const SimpleFontData* font_data_to_substitute, +@@ -240,12 +257,21 @@ const SimpleFontData* FontCache::Fallbac + Character::IsNonCharacter(lookup_char)) + return nullptr; + base::ElapsedTimer timer; +- const SimpleFontData* result = PlatformFallbackFontForCharacter( ++ scoped_refptr result = PlatformFallbackFontForCharacter( + description, lookup_char, font_data_to_substitute, fallback_priority); + FontPerformance::AddSystemFallbackFontTime(timer.Elapsed()); + return result; + } + ++void FontCache::ReleaseFontData(const SimpleFontData* font_data) { ++ font_data_cache_->Release(font_data); ++} ++ ++void FontCache::PurgePlatformFontDataCache() { ++ TRACE_EVENT0("fonts,ui", "FontCache::PurgePlatformFontDataCache"); ++ font_platform_data_cache_->Purge(*font_data_cache_); ++} ++ + void FontCache::PurgeFallbackListShaperCache() { + TRACE_EVENT0("fonts,ui", "FontCache::PurgeFallbackListShaperCache"); + for (auto& shape_cache : fallback_list_shaper_cache_.Values()) { +@@ -257,13 +283,17 @@ void FontCache::InvalidateShapeCache() { + PurgeFallbackListShaperCache(); + } + +-void FontCache::Purge() { ++void FontCache::Purge(PurgeSeverity purge_severity) { + // Ideally we should never be forcing the purge while the + // FontCachePurgePreventer is in scope, but we call purge() at any timing + // via MemoryPressureListenerRegistry. + if (purge_prevent_count_) + return; + ++ if (!font_data_cache_->Purge(purge_severity)) ++ return; ++ ++ PurgePlatformFontDataCache(); + PurgeFallbackListShaperCache(); + } + +@@ -279,15 +309,14 @@ uint16_t FontCache::Generation() { + + void FontCache::Invalidate() { + TRACE_EVENT0("fonts,ui", "FontCache::Invalidate"); +- font_platform_data_cache_.Clear(); +- font_data_cache_.Clear(); ++ font_platform_data_cache_->Clear(); + generation_++; + + for (const auto& client : font_cache_clients_) { + client->FontCacheInvalidated(); + } + +- Purge(); ++ Purge(kForcePurge); + } + + void FontCache::CrashWithFontInfo(const FontDescription* font_description) { +@@ -320,6 +349,16 @@ void FontCache::CrashWithFontInfo(const + CHECK(false); + } + ++void FontCache::DumpFontPlatformDataCache( ++ base::trace_event::ProcessMemoryDump* memory_dump) { ++ DCHECK(IsMainThread()); ++ base::trace_event::MemoryAllocatorDump* dump = ++ memory_dump->CreateAllocatorDump("font_caches/font_platform_data_cache"); ++ dump->AddScalar("size", "bytes", font_platform_data_cache_->ByteSize()); ++ memory_dump->AddSuballocation(dump->guid(), ++ WTF::Partitions::kAllocatedObjectPoolName); ++} ++ + void FontCache::DumpShapeResultCache( + base::trace_event::ProcessMemoryDump* memory_dump) { + DCHECK(IsMainThread()); +--- a/third_party/blink/renderer/platform/fonts/font_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_cache.h +@@ -36,13 +36,13 @@ + #include + + #include "base/gtest_prod_util.h" ++#include "base/memory/scoped_refptr.h" + #include "build/build_config.h" + #include "third_party/blink/renderer/platform/fonts/fallback_list_composite_key.h" + #include "third_party/blink/renderer/platform/fonts/font_cache_client.h" + #include "third_party/blink/renderer/platform/fonts/font_data_cache.h" + #include "third_party/blink/renderer/platform/fonts/font_face_creation_params.h" + #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" +-#include "third_party/blink/renderer/platform/fonts/font_platform_data_cache.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_cache.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" + #include "third_party/blink/renderer/platform/platform_export.h" +@@ -75,6 +75,7 @@ class FontFaceCreationParams; + class FontFallbackMap; + class FontGlobalContext; + class FontPlatformData; ++class FontPlatformDataCache; + class SimpleFontData; + class WebFontPrewarmer; + +@@ -106,7 +107,9 @@ class PLATFORM_EXPORT FontCache final { + + void Trace(Visitor*) const; + +- const SimpleFontData* FallbackFontForCharacter( ++ void ReleaseFontData(const SimpleFontData*); ++ ++ scoped_refptr FallbackFontForCharacter( + const FontDescription&, + UChar32, + const SimpleFontData* font_data_to_substitute, +@@ -115,11 +118,14 @@ class PLATFORM_EXPORT FontCache final { + // Also implemented by the platform. + void PlatformInit(); + +- const SimpleFontData* GetFontData( ++ scoped_refptr GetFontData( + const FontDescription&, + const AtomicString&, +- AlternateFontName = AlternateFontName::kAllowAlternate); +- const SimpleFontData* GetLastResortFallbackFont(const FontDescription&); ++ AlternateFontName = AlternateFontName::kAllowAlternate, ++ ShouldRetain = kRetain); ++ scoped_refptr GetLastResortFallbackFont(const FontDescription&, ++ ShouldRetain = kRetain); ++ SimpleFontData* GetNonRetainedLastResortFallbackFont(const FontDescription&); + + // Should be used in determining whether family names listed in font-family: + // ... are available locally. Only returns true if family name matches. +@@ -212,12 +218,12 @@ class PLATFORM_EXPORT FontCache final { + return *status_font_family_name_; + } + +- const SimpleFontData* GetFallbackFamilyNameFromHardcodedChoices( ++ scoped_refptr GetFallbackFamilyNameFromHardcodedChoices( + const FontDescription&, + UChar32 codepoint, + FontFallbackPriority fallback_priority); + +- const SimpleFontData* GetDWriteFallbackFamily( ++ scoped_refptr GetDWriteFallbackFamily( + const FontDescription&, + UChar32 codepoint, + FontFallbackPriority fallback_priority); +@@ -245,8 +251,9 @@ class PLATFORM_EXPORT FontCache final { + gfx::FallbackFontData*); + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + +- const SimpleFontData* FontDataFromFontPlatformData( ++ scoped_refptr FontDataFromFontPlatformData( + const FontPlatformData*, ++ ShouldRetain = kRetain, + bool subpixel_ascent_descent = false); + + void InvalidateShapeCache(); +@@ -254,6 +261,7 @@ class PLATFORM_EXPORT FontCache final { + static void CrashWithFontInfo(const FontDescription*); + + // Memory reporting ++ void DumpFontPlatformDataCache(base::trace_event::ProcessMemoryDump*); + void DumpShapeResultCache(base::trace_event::ProcessMemoryDump*); + + FontFallbackMap& GetFontFallbackMap(); +@@ -268,7 +276,7 @@ class PLATFORM_EXPORT FontCache final { + // elements. + using Bcp47Vector = WTF::Vector; + +- const SimpleFontData* PlatformFallbackFontForCharacter( ++ scoped_refptr PlatformFallbackFontForCharacter( + const FontDescription&, + UChar32, + const SimpleFontData* font_data_to_substitute, +@@ -283,26 +291,26 @@ class PLATFORM_EXPORT FontCache final { + friend class FontGlobalContext; + FontCache(); + +- void Purge(); ++ void Purge(PurgeSeverity = kPurgeIfNeeded); + + void DisablePurging() { purge_prevent_count_++; } + void EnablePurging() { + DCHECK(purge_prevent_count_); + if (!--purge_prevent_count_) +- Purge(); ++ Purge(kPurgeIfNeeded); + } + + // FIXME: This method should eventually be removed. +- const FontPlatformData* GetFontPlatformData( ++ FontPlatformData* GetFontPlatformData( + const FontDescription&, + const FontFaceCreationParams&, + AlternateFontName = AlternateFontName::kAllowAlternate); + #if !BUILDFLAG(IS_MAC) +- const FontPlatformData* SystemFontPlatformData(const FontDescription&); ++ FontPlatformData* SystemFontPlatformData(const FontDescription&); + #endif // !BUILDFLAG(IS_MAC) + + // These methods are implemented by each platform. +- const FontPlatformData* CreateFontPlatformData( ++ std::unique_ptr CreateFontPlatformData( + const FontDescription&, + const FontFaceCreationParams&, + float font_size, +@@ -321,8 +329,9 @@ class PLATFORM_EXPORT FontCache final { + #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) + +- const SimpleFontData* FallbackOnStandardFontStyle(const FontDescription&, +- UChar32); ++ scoped_refptr FallbackOnStandardFontStyle( ++ const FontDescription&, ++ UChar32); + + // Don't purge if this count is > 0; + int purge_prevent_count_ = 0; +@@ -356,16 +365,17 @@ class PLATFORM_EXPORT FontCache final { + uint16_t generation_ = 0; + bool platform_init_ = false; + HeapHashSet> font_cache_clients_; +- FontPlatformDataCache font_platform_data_cache_; ++ std::unique_ptr font_platform_data_cache_; + HeapHashMap, + FallbackListCompositeKeyTraits> + fallback_list_shaper_cache_; + +- FontDataCache font_data_cache_; ++ std::unique_ptr font_data_cache_; + + Member font_fallback_map_; + ++ void PurgePlatformFontDataCache(); + void PurgeFallbackListShaperCache(); + + friend class SimpleFontData; // For fontDataFromFontPlatformData +--- a/third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.cc ++++ b/third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.cc +@@ -21,6 +21,7 @@ bool FontCacheMemoryDumpProvider::OnMemo + DCHECK(IsMainThread()); + if (auto* context = FontGlobalContext::TryGet()) { + FontCache& cache = context->GetFontCache(); ++ cache.DumpFontPlatformDataCache(memory_dump); + cache.DumpShapeResultCache(memory_dump); + } + return true; +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc +@@ -103,7 +103,7 @@ FontCustomPlatformData::~FontCustomPlatf + } + } + +-const FontPlatformData* FontCustomPlatformData::GetFontPlatformData( ++FontPlatformData FontCustomPlatformData::GetFontPlatformData( + float size, + float adjusted_specified_size, + bool bold, +@@ -276,11 +276,10 @@ const FontPlatformData* FontCustomPlatfo + return_typeface = palette_typeface; + } + } +- return MakeGarbageCollected( +- std::move(return_typeface), std::string(), size, +- synthetic_bold && !base_typeface_->isBold(), +- synthetic_italic && !base_typeface_->isItalic(), text_rendering, +- resolved_font_features, orientation); ++ return FontPlatformData(std::move(return_typeface), std::string(), size, ++ synthetic_bold && !base_typeface_->isBold(), ++ synthetic_italic && !base_typeface_->isItalic(), ++ text_rendering, resolved_font_features, orientation); + } + + Vector FontCustomPlatformData::GetVariationAxes() const { +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h +@@ -68,7 +68,7 @@ class PLATFORM_EXPORT FontCustomPlatform + // adjusted_specified_size should come from AdjustedSpecifiedSize() of + // FontDescription. The latter is needed for correctly applying + // font-optical-sizing: auto; independent of zoom level. +- const FontPlatformData* GetFontPlatformData( ++ FontPlatformData GetFontPlatformData( + float size, + float adjusted_specified_size, + bool bold, +--- /dev/null ++++ b/third_party/blink/renderer/platform/fonts/font_data.cc +@@ -0,0 +1,32 @@ ++/* ++ * Copyright (C) 2008 Apple Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY ++ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "third_party/blink/renderer/platform/fonts/font_data.h" ++ ++namespace blink { ++ ++FontData::~FontData() = default; ++ ++} // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_data.h +@@ -27,24 +27,23 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_H_ + + #include "base/memory/scoped_refptr.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" ++#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" + + namespace blink { + + class SimpleFontData; + +-class PLATFORM_EXPORT FontData : public GarbageCollected { ++class PLATFORM_EXPORT FontData : public RefCounted { + public: + FontData() = default; + FontData(const FontData&) = delete; + FontData& operator=(const FontData&) = delete; +- virtual ~FontData() = default; + +- virtual void Trace(Visitor*) const {} ++ virtual ~FontData(); + + virtual const SimpleFontData* FontDataForCharacter(UChar32) const = 0; + virtual bool IsCustomFont() const = 0; +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc +@@ -36,8 +36,23 @@ + + namespace blink { + +-const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, +- bool subpixel_ascent_descent) { ++#if !BUILDFLAG(IS_ANDROID) ++const unsigned kCMaxInactiveFontData = 250; ++const unsigned kCTargetInactiveFontData = 200; ++#else ++const unsigned kCMaxInactiveFontData = 225; ++const unsigned kCTargetInactiveFontData = 200; ++#endif ++ ++// static ++std::unique_ptr FontDataCache::Create() { ++ return std::make_unique(); ++} ++ ++scoped_refptr FontDataCache::Get( ++ const FontPlatformData* platform_data, ++ ShouldRetain should_retain, ++ bool subpixel_ascent_descent) { + if (!platform_data) + return nullptr; + +@@ -50,12 +65,98 @@ const SimpleFontData* FontDataCache::Get + return nullptr; + } + +- auto add_result = cache_.insert(platform_data, nullptr); +- if (add_result.is_new_entry) { +- add_result.stored_value->value = MakeGarbageCollected( +- platform_data, nullptr, subpixel_ascent_descent); ++ Cache::iterator result = cache_.find(platform_data); ++ if (result == cache_.end()) { ++ std::pair, unsigned> new_value( ++ SimpleFontData::Create(*platform_data, nullptr, ++ subpixel_ascent_descent), ++ should_retain == kRetain ? 1 : 0); ++ // The new SimpleFontData takes a copy of the incoming FontPlatformData ++ // object. The incoming key may be temporary. So, for cache storage, take ++ // the address of the newly created FontPlatformData that is copied an owned ++ // by SimpleFontData. ++ cache_.Set(&new_value.first->PlatformData(), new_value); ++ if (should_retain == kDoNotRetain) ++ inactive_font_data_.insert(new_value.first); ++ return std::move(new_value.first); ++ } ++ ++ if (!result.Get()->value.second) { ++ DCHECK(inactive_font_data_.Contains(result.Get()->value.first)); ++ inactive_font_data_.erase(result.Get()->value.first); ++ } ++ ++ if (should_retain == kRetain) { ++ result.Get()->value.second++; ++ } else if (!result.Get()->value.second) { ++ // If shouldRetain is DoNotRetain and count is 0, we want to remove the ++ // fontData from m_inactiveFontData (above) and re-add here to update LRU ++ // position. ++ inactive_font_data_.insert(result.Get()->value.first); ++ } ++ ++ return result.Get()->value.first; ++} ++ ++bool FontDataCache::Contains(const FontPlatformData* font_platform_data) const { ++ return cache_.Contains(font_platform_data); ++} ++ ++void FontDataCache::Release(const SimpleFontData* font_data) { ++ DCHECK(!font_data->IsCustomFont()); ++ ++ Cache::iterator it = cache_.find(&(font_data->PlatformData())); ++ if (it == cache_.end()) ++ return; ++ ++ DCHECK(it->value.second); ++ if (!--it->value.second) ++ inactive_font_data_.insert(it->value.first); ++} ++ ++bool FontDataCache::Purge(PurgeSeverity purge_severity) { ++ if (purge_severity == kForcePurge) ++ return PurgeLeastRecentlyUsed(INT_MAX); ++ ++ if (inactive_font_data_.size() > kCMaxInactiveFontData) ++ return PurgeLeastRecentlyUsed(inactive_font_data_.size() - ++ kCTargetInactiveFontData); ++ ++ return false; ++} ++ ++bool FontDataCache::PurgeLeastRecentlyUsed(int count) { ++ // Guard against reentry when e.g. a deleted FontData releases its small caps ++ // FontData. ++ if (is_purging_) ++ return false; ++ ++ base::AutoReset is_purging_auto_reset(&is_purging_, true); ++ ++ Vector, 20> font_data_to_delete; ++ auto end = inactive_font_data_.end(); ++ auto it = inactive_font_data_.begin(); ++ for (int i = 0; i < count && it != end; ++it, ++i) { ++ const scoped_refptr& font_data = *it; ++ cache_.erase(&(font_data->PlatformData())); ++ // We should not delete SimpleFontData here because deletion can modify ++ // m_inactiveFontData. See http://trac.webkit.org/changeset/44011 ++ font_data_to_delete.push_back(font_data); ++ } ++ ++ if (it == end) { ++ // Removed everything ++ inactive_font_data_.clear(); ++ } else { ++ for (int i = 0; i < count; ++i) ++ inactive_font_data_.erase(inactive_font_data_.begin()); + } +- return add_result.stored_value->value; ++ ++ bool did_work = font_data_to_delete.size(); ++ ++ font_data_to_delete.clear(); ++ ++ return did_work; + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h +@@ -33,10 +33,14 @@ + + #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" ++#include "third_party/blink/renderer/platform/wtf/hash_map.h" ++#include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" + + namespace blink { + ++enum ShouldRetain { kRetain, kDoNotRetain }; ++enum PurgeSeverity { kPurgeIfNeeded, kForcePurge }; ++ + struct FontDataCacheKeyHashTraits : GenericHashTraits { + STATIC_ONLY(FontDataCacheKeyHashTraits); + static unsigned GetHash(const FontPlatformData* platform_data) { +@@ -51,24 +55,36 @@ struct FontDataCacheKeyHashTraits : Gene + }; + + class FontDataCache final { +- DISALLOW_NEW(); ++ USING_FAST_MALLOC(FontDataCache); + + public: ++ static std::unique_ptr Create(); ++ + FontDataCache() = default; + FontDataCache(const FontDataCache&) = delete; + FontDataCache& operator=(const FontDataCache&) = delete; + +- void Trace(Visitor* visitor) const { visitor->Trace(cache_); } +- +- const SimpleFontData* Get(const FontPlatformData*, +- bool subpixel_ascent_descent = false); +- void Clear() { cache_.clear(); } ++ scoped_refptr Get(const FontPlatformData*, ++ ShouldRetain = kRetain, ++ bool subpixel_ascent_descent = false); ++ bool Contains(const FontPlatformData*) const; ++ void Release(const SimpleFontData*); ++ ++ // Purges items in FontDataCache according to provided severity. ++ // Returns true if any removal of cache items actually occurred. ++ bool Purge(PurgeSeverity); + + private: +- HeapHashMap, +- WeakMember, +- FontDataCacheKeyHashTraits> +- cache_; ++ bool PurgeLeastRecentlyUsed(int count); ++ ++ typedef HashMap, unsigned>, ++ FontDataCacheKeyHashTraits> ++ Cache; ++ ++ Cache cache_; ++ LinkedHashSet> inactive_font_data_; ++ bool is_purging_ = false; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.cc ++++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.cc +@@ -13,4 +13,10 @@ FontDataForRangeSet::FontDataForRangeSet + range_set_ = other.range_set_; + } + ++FontDataForRangeSetFromCache::~FontDataForRangeSetFromCache() { ++ if (font_data_ && !font_data_->IsCustomFont()) { ++ FontCache::Get().ReleaseFontData(font_data_.get()); ++ } ++} ++ + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h +@@ -37,19 +37,17 @@ namespace blink { + class SimpleFontData; + + class PLATFORM_EXPORT FontDataForRangeSet +- : public GarbageCollected { ++ : public RefCounted { + public: + explicit FontDataForRangeSet( +- const SimpleFontData* font_data = nullptr, ++ scoped_refptr font_data = nullptr, + scoped_refptr range_set = nullptr) +- : font_data_(font_data), range_set_(std::move(range_set)) {} ++ : font_data_(std::move(font_data)), range_set_(std::move(range_set)) {} + + FontDataForRangeSet(const FontDataForRangeSet& other); + + virtual ~FontDataForRangeSet() = default; + +- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } +- + bool Contains(UChar32 test_char) const { + return !range_set_ || range_set_->Contains(test_char); + } +@@ -57,8 +55,8 @@ class PLATFORM_EXPORT FontDataForRangeSe + return !range_set_ || range_set_->IsEntireRange(); + } + UnicodeRangeSet* Ranges() const { return range_set_.get(); } +- bool HasFontData() const { return font_data_; } +- const SimpleFontData* FontData() const { return font_data_.Get(); } ++ bool HasFontData() const { return font_data_.get(); } ++ const SimpleFontData* FontData() const { return font_data_.get(); } + + // TODO(xiaochengh): |FontData::IsLoadingFallback()| returns true if the + // FontData is a pending custom font. We should rename it for better clarity. +@@ -71,10 +69,20 @@ class PLATFORM_EXPORT FontDataForRangeSe + } + + protected: +- Member font_data_; ++ scoped_refptr font_data_; + scoped_refptr range_set_; + }; + ++class PLATFORM_EXPORT FontDataForRangeSetFromCache ++ : public FontDataForRangeSet { ++ public: ++ explicit FontDataForRangeSetFromCache( ++ scoped_refptr font_data, ++ scoped_refptr range_set = nullptr) ++ : FontDataForRangeSet(std::move(font_data), std::move(range_set)) {} ++ ~FontDataForRangeSetFromCache() override; ++}; ++ + } // namespace blink + + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_FOR_RANGE_SET_H_ +--- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc +@@ -60,8 +60,8 @@ void FontFallbackIterator::WillUseRange( + selector->WillUseRange(font_description_, family, range_set); + } + +-FontDataForRangeSet* FontFallbackIterator::UniqueOrNext( +- FontDataForRangeSet* candidate, ++scoped_refptr FontFallbackIterator::UniqueOrNext( ++ scoped_refptr candidate, + const Vector& hint_list) { + if (!candidate->HasFontData()) + return Next(hint_list); +@@ -104,18 +104,18 @@ bool FontFallbackIterator::NeedsHintList + return font_data->IsSegmented(); + } + +-FontDataForRangeSet* FontFallbackIterator::Next( ++scoped_refptr FontFallbackIterator::Next( + const Vector& hint_list) { + if (fallback_stage_ == kOutOfLuck) +- return MakeGarbageCollected(); ++ return base::AdoptRef(new FontDataForRangeSet()); + + if (fallback_stage_ == kFallbackPriorityFonts) { + // Only try one fallback priority font, + // then proceed to regular system fallback. + fallback_stage_ = kSystemFonts; +- FontDataForRangeSet* fallback_priority_font_range = +- MakeGarbageCollected( +- FallbackPriorityFont(hint_list[0])); ++ scoped_refptr fallback_priority_font_range = ++ base::AdoptRef( ++ new FontDataForRangeSet(FallbackPriorityFont(hint_list[0]))); + if (fallback_priority_font_range->HasFontData()) + return UniqueOrNext(std::move(fallback_priority_font_range), hint_list); + return Next(hint_list); +@@ -123,11 +123,11 @@ FontDataForRangeSet* FontFallbackIterato + + if (fallback_stage_ == kSystemFonts) { + // We've reached pref + system fallback. +- const SimpleFontData* system_font = UniqueSystemFontForHintList(hint_list); ++ scoped_refptr system_font = UniqueSystemFontForHintList(hint_list); + if (system_font) { + // Fallback fonts are not retained in the FontDataCache. +- return UniqueOrNext( +- MakeGarbageCollected(system_font), hint_list); ++ return UniqueOrNext(base::AdoptRef(new FontDataForRangeSet(system_font)), ++ hint_list); + } + + // If we don't have options from the system fallback anymore or had +@@ -137,16 +137,18 @@ FontDataForRangeSet* FontFallbackIterato + // LastResort font, not just Times or Arial. + FontCache& font_cache = FontCache::Get(); + fallback_stage_ = kFirstCandidateForNotdefGlyph; +- const SimpleFontData* last_resort = +- font_cache.GetLastResortFallbackFont(font_description_); ++ scoped_refptr last_resort = ++ font_cache.GetLastResortFallbackFont(font_description_).get(); + + if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { +- font_selector->ReportLastResortFallbackFontLookup(font_description_, +- last_resort); ++ font_selector->ReportLastResortFallbackFontLookup( ++ font_description_, ++ last_resort.get()); + } + +- return UniqueOrNext(MakeGarbageCollected(last_resort), +- hint_list); ++ return UniqueOrNext( ++ base::AdoptRef(new FontDataForRangeSetFromCache(last_resort)), ++ hint_list); + } + + if (fallback_stage_ == kFirstCandidateForNotdefGlyph) { +@@ -177,13 +179,13 @@ FontDataForRangeSet* FontFallbackIterato + // Skip forward to the next font family for the next call to next(). + current_font_data_index_++; + if (!font_data->IsLoading()) { +- SimpleFontData* non_segmented = ++ scoped_refptr non_segmented = + const_cast(To(font_data)); + // The fontData object that we have here is tracked in m_fontList of + // FontFallbackList and gets released in the font cache when the + // FontFallbackList is destroyed. + return UniqueOrNext( +- MakeGarbageCollected(non_segmented), hint_list); ++ base::AdoptRef(new FontDataForRangeSet(non_segmented)), hint_list); + } + return Next(hint_list); + } +@@ -197,7 +199,7 @@ FontDataForRangeSet* FontFallbackIterato + } + + DCHECK_LT(segmented_face_index_, segmented->NumFaces()); +- FontDataForRangeSet* current_segmented_face = ++ scoped_refptr current_segmented_face = + segmented->FaceAt(segmented_face_index_); + segmented_face_index_++; + +@@ -208,7 +210,7 @@ FontDataForRangeSet* FontFallbackIterato + current_font_data_index_++; + } + +- if (RangeSetContributesForHint(hint_list, current_segmented_face)) { ++ if (RangeSetContributesForHint(hint_list, current_segmented_face.get())) { + const SimpleFontData* current_segmented_face_font_data = + current_segmented_face->FontData(); + if (const CustomFontData* current_segmented_face_custom_font_data = +@@ -222,15 +224,17 @@ FontDataForRangeSet* FontFallbackIterato + return Next(hint_list); + } + +-const SimpleFontData* FontFallbackIterator::FallbackPriorityFont(UChar32 hint) { +- const SimpleFontData* font_data = FontCache::Get().FallbackFontForCharacter( +- font_description_, hint, +- font_fallback_list_->PrimarySimpleFontData(font_description_), +- font_fallback_priority_); ++scoped_refptr FontFallbackIterator::FallbackPriorityFont( ++ UChar32 hint) { ++ scoped_refptr font_data = ++ FontCache::Get().FallbackFontForCharacter( ++ font_description_, hint, ++ font_fallback_list_->PrimarySimpleFontData(font_description_), ++ font_fallback_priority_); + + if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { + font_selector->ReportFontLookupByFallbackCharacter( +- hint, font_fallback_priority_, font_description_, font_data); ++ hint, font_fallback_priority_, font_description_, font_data.get()); + } + return font_data; + } +@@ -255,7 +259,7 @@ static inline unsigned ChooseHintIndex(c + return 0; + } + +-const SimpleFontData* FontFallbackIterator::UniqueSystemFontForHintList( ++scoped_refptr FontFallbackIterator::UniqueSystemFontForHintList( + const Vector& hint_list) { + // When we're asked for a fallback for the same characters again, we give up + // because the shaper must have previously tried shaping with the font +@@ -270,13 +274,13 @@ const SimpleFontData* FontFallbackIterat + return nullptr; + previously_asked_for_hint_.insert(hint); + +- const SimpleFontData* font_data = font_cache.FallbackFontForCharacter( ++ scoped_refptr font_data = font_cache.FallbackFontForCharacter( + font_description_, hint, + font_fallback_list_->PrimarySimpleFontData(font_description_)); + + if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { + font_selector->ReportFontLookupByFallbackCharacter( +- hint, FontFallbackPriority::kText, font_description_, font_data); ++ hint, FontFallbackPriority::kText, font_description_, font_data.get()); + } + return font_data; + } +--- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.h ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.h +@@ -5,13 +5,14 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_FALLBACK_ITERATOR_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_FALLBACK_ITERATOR_H_ + ++#include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/font_data_for_range_set.h" + #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/hash_set.h" + #include "third_party/blink/renderer/platform/wtf/ref_counted.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" ++#include "third_party/blink/renderer/platform/wtf/vector.h" + + namespace blink { + +@@ -42,7 +43,7 @@ class FontFallbackIterator { + // Some system fallback APIs (Windows, Android) require a character, or a + // portion of the string to be passed. On Mac and Linux, we get a list of + // fonts without passing in characters. +- FontDataForRangeSet* Next(const Vector& hint_list); ++ scoped_refptr Next(const Vector& hint_list); + + private: + bool RangeSetContributesForHint(const Vector& hint_list, +@@ -50,11 +51,12 @@ class FontFallbackIterator { + bool AlreadyLoadingRangeForHintChar(UChar32 hint_char); + void WillUseRange(const AtomicString& family, const FontDataForRangeSet&); + +- FontDataForRangeSet* UniqueOrNext(FontDataForRangeSet* candidate, +- const Vector& hint_list); ++ scoped_refptr UniqueOrNext( ++ scoped_refptr candidate, ++ const Vector& hint_list); + +- const SimpleFontData* FallbackPriorityFont(UChar32 hint); +- const SimpleFontData* UniqueSystemFontForHintList( ++ scoped_refptr FallbackPriorityFont(UChar32 hint); ++ scoped_refptr UniqueSystemFontForHintList( + const Vector& hint_list); + + const FontDescription& font_description_; +@@ -82,8 +84,8 @@ class FontFallbackIterator { + // candidate to be used for rendering the .notdef glyph, and set HasNext() to + // false. + HashSet unique_font_data_for_range_sets_returned_; +- FontDataForRangeSet* first_candidate_ = nullptr; +- HeapVector> tracked_loading_range_sets_; ++ scoped_refptr first_candidate_; ++ Vector> tracked_loading_range_sets_; + FontFallbackPriority font_fallback_priority_; + }; + +--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc +@@ -52,9 +52,17 @@ FontFallbackList::FontFallbackList(FontS + is_invalid_(false), + nullify_primary_font_data_for_test_(false) {} + ++FontFallbackList::~FontFallbackList() { ++ unsigned num_fonts = font_list_.size(); ++ for (unsigned i = 0; i < num_fonts; ++i) { ++ if (!font_list_[i]->IsCustomFont()) { ++ DCHECK(!font_list_[i]->IsSegmented()); ++ FontCache::Get().ReleaseFontData(To(font_list_[i].get())); ++ } ++ } ++} ++ + void FontFallbackList::Trace(Visitor* visitor) const { +- visitor->Trace(font_list_); +- visitor->Trace(cached_primary_simple_font_data_); + visitor->Trace(font_selector_); + visitor->Trace(ng_shape_cache_); + visitor->Trace(shape_cache_); +@@ -98,8 +106,8 @@ const SimpleFontData* FontFallbackList:: + return font_data->FontDataForCharacter(kSpaceCharacter); + + FontCache& font_cache = FontCache::Get(); +- const SimpleFontData* last_resort_fallback = +- font_cache.GetLastResortFallbackFont(font_description); ++ SimpleFontData* last_resort_fallback = ++ font_cache.GetLastResortFallbackFont(font_description).get(); + DCHECK(last_resort_fallback); + return last_resort_fallback; + } +@@ -137,7 +145,7 @@ const SimpleFontData* FontFallbackList:: + } + } + +-const FontData* FontFallbackList::GetFontData( ++scoped_refptr FontFallbackList::GetFontData( + const FontDescription& font_description) { + const FontFamily* curr_family = &font_description.Family(); + for (int i = 0; curr_family && i < family_index_; i++) +@@ -148,7 +156,7 @@ const FontData* FontFallbackList::GetFon + if (!font_selector_) { + // Don't query system fonts for empty font family name. + if (!curr_family->FamilyName().empty()) { +- if (auto* result = FontCache::Get().GetFontData( ++ if (auto result = FontCache::Get().GetFontData( + font_description, curr_family->FamilyName())) { + return result; + } +@@ -156,7 +164,7 @@ const FontData* FontFallbackList::GetFon + continue; + } + +- const FontData* result = ++ scoped_refptr result = + font_selector_->GetFontData(font_description, *curr_family); + // Don't query system fonts for empty font family name. + if (!result && !curr_family->FamilyName().empty()) { +@@ -164,7 +172,7 @@ const FontData* FontFallbackList::GetFon + curr_family->FamilyName()); + font_selector_->ReportFontLookupByUniqueOrFamilyName( + curr_family->FamilyName(), font_description, +- DynamicTo(result)); ++ DynamicTo(result.get())); + } + if (result) { + font_selector_->ReportSuccessfulFontFamilyMatch( +@@ -181,18 +189,18 @@ const FontData* FontFallbackList::GetFon + FontFamily font_family; + font_family.SetFamily(font_family_names::kWebkitStandard, + FontFamily::Type::kGenericFamily); +- if (const FontData* data = ++ if (scoped_refptr data = + font_selector_->GetFontData(font_description, font_family)) { + return data; + } + } + + // Still no result. Hand back our last resort fallback font. +- auto* last_resort = ++ auto last_resort = + FontCache::Get().GetLastResortFallbackFont(font_description); + if (font_selector_) { + font_selector_->ReportLastResortFallbackFontLookup(font_description, +- last_resort); ++ last_resort.get()); + } + return last_resort; + } +@@ -202,7 +210,7 @@ const FontData* FontFallbackList::FontDa + unsigned realized_font_index) { + // This fallback font is already in our list. + if (realized_font_index < font_list_.size()) +- return font_list_[realized_font_index].Get(); ++ return font_list_[realized_font_index].get(); + + // Make sure we're not passing in some crazy value here. + DCHECK_EQ(realized_font_index, font_list_.size()); +@@ -216,7 +224,7 @@ const FontData* FontFallbackList::FontDa + // the same spot in the list twice. GetFontData will adjust our + // |family_index_| as it scans for the right font to make. + DCHECK_EQ(FontCache::Get().Generation(), generation_); +- const FontData* result = GetFontData(font_description); ++ scoped_refptr result = GetFontData(font_description); + if (result) { + font_list_.push_back(result); + if (result->IsLoadingFallback()) +@@ -224,7 +232,7 @@ const FontData* FontFallbackList::FontDa + if (result->IsCustomFont()) + has_custom_font_ = true; + } +- return result; ++ return result.get(); + } + + bool FontFallbackList::ComputeCanShapeWordByWord( +--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.h ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.h +@@ -49,6 +49,7 @@ class PLATFORM_EXPORT FontFallbackList + + FontFallbackList(const FontFallbackList&) = delete; + FontFallbackList& operator=(const FontFallbackList&) = delete; ++ ~FontFallbackList(); + + void Trace(Visitor*) const; + +@@ -116,7 +117,7 @@ class PLATFORM_EXPORT FontFallbackList + bool HasCustomFont() const { return has_custom_font_; } + + private: +- const FontData* GetFontData(const FontDescription&); ++ scoped_refptr GetFontData(const FontDescription&); + + const SimpleFontData* DeterminePrimarySimpleFontData(const FontDescription&); + const SimpleFontData* DeterminePrimarySimpleFontDataCore( +@@ -124,8 +125,8 @@ class PLATFORM_EXPORT FontFallbackList + + bool ComputeCanShapeWordByWord(const FontDescription&); + +- HeapVector, 1> font_list_; +- Member cached_primary_simple_font_data_ = nullptr; ++ Vector, 1> font_list_; ++ const SimpleFontData* cached_primary_simple_font_data_ = nullptr; + const Member font_selector_; + int family_index_ = 0; + const uint16_t generation_; +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc +@@ -158,10 +158,6 @@ FontPlatformData::FontPlatformData(sk_sp + + FontPlatformData::~FontPlatformData() = default; + +-void FontPlatformData::Trace(Visitor* visitor) const { +- visitor->Trace(harfbuzz_face_); +-} +- + #if BUILDFLAG(IS_MAC) + CTFontRef FontPlatformData::CtFont() const { + return SkTypeface_GetCTFontRef(typeface_.get()); +@@ -213,10 +209,11 @@ SkTypeface* FontPlatformData::Typeface() + + HarfBuzzFace* FontPlatformData::GetHarfBuzzFace() const { + if (!harfbuzz_face_) { +- harfbuzz_face_ = MakeGarbageCollected(this, UniqueID()); ++ harfbuzz_face_ = ++ HarfBuzzFace::Create(const_cast(this), UniqueID()); + } + +- return harfbuzz_face_.Get(); ++ return harfbuzz_face_.get(); + } + + bool FontPlatformData::HasSpaceInLigaturesOrKerning( +@@ -246,7 +243,7 @@ unsigned FontPlatformData::GetHash() con + } + + #if !BUILDFLAG(IS_MAC) +-bool FontPlatformData::FontContainsCharacter(UChar32 character) const { ++bool FontPlatformData::FontContainsCharacter(UChar32 character) { + return CreateSkFont().unicharToGlyph(character); + } + #endif +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h +@@ -39,8 +39,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_orientation.h" + #include "third_party/blink/renderer/platform/fonts/resolved_font_features.h" + #include "third_party/blink/renderer/platform/fonts/small_caps_iterator.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" +@@ -61,8 +59,9 @@ namespace blink { + class HarfBuzzFace; + class OpenTypeVerticalData; + +-class PLATFORM_EXPORT FontPlatformData +- : public GarbageCollected { ++class PLATFORM_EXPORT FontPlatformData { ++ USING_FAST_MALLOC(FontPlatformData); ++ + public: + // Used for deleted values in the font cache's hash tables. The hash table + // will create us with this structure, and it will compare other values +@@ -83,8 +82,6 @@ class PLATFORM_EXPORT FontPlatformData + FontOrientation = FontOrientation::kHorizontal); + ~FontPlatformData(); + +- void Trace(Visitor*) const; +- + #if BUILDFLAG(IS_MAC) + // Returns nullptr for FreeType backed SkTypefaces, compare + // FontCustomPlatformData, which are used for variable fonts on Mac OS +@@ -129,7 +126,7 @@ class PLATFORM_EXPORT FontPlatformData + + bool IsHashTableDeletedValue() const { return is_hash_table_deleted_value_; } + #if !BUILDFLAG(IS_MAC) +- bool FontContainsCharacter(UChar32 character) const; ++ bool FontContainsCharacter(UChar32 character); + #endif + + #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_MAC) +@@ -185,7 +182,7 @@ class PLATFORM_EXPORT FontPlatformData + WebFontRenderStyle style_; + #endif + +- mutable Member harfbuzz_face_; ++ mutable scoped_refptr harfbuzz_face_; + bool is_hash_table_deleted_value_ = false; + }; + +--- a/third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc +@@ -38,13 +38,20 @@ + + namespace blink { + ++// static ++std::unique_ptr FontPlatformDataCache::Create() { ++ return std::make_unique(); ++} ++ + FontPlatformDataCache::FontPlatformDataCache() + : font_size_limit_(std::nextafter( + (static_cast(std::numeric_limits::max()) - 2.f) / + static_cast(blink::FontCacheKey::PrecisionMultiplier()), + 0.f)) {} + +-const FontPlatformData* FontPlatformDataCache::GetOrCreateFontPlatformData( ++FontPlatformDataCache::~FontPlatformDataCache() = default; ++ ++FontPlatformData* FontPlatformDataCache::GetOrCreateFontPlatformData( + FontCache* font_cache, + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, +@@ -60,13 +67,15 @@ const FontPlatformData* FontPlatformData + + auto it = map_.find(key); + if (it != map_.end()) { +- return it->value.Get(); ++ return it->value.get(); + } + +- if (const FontPlatformData* result = font_cache->CreateFontPlatformData( +- font_description, creation_params, size, alternate_font_name)) { +- map_.insert(key, result); +- return result; ++ if (std::unique_ptr result = ++ font_cache->CreateFontPlatformData(font_description, creation_params, ++ size, alternate_font_name)) { ++ FontPlatformData* result_ptr = result.get(); ++ map_.insert(key, std::move(result)); ++ return result_ptr; + } + + if (alternate_font_name != AlternateFontName::kAllowAlternate || +@@ -82,16 +91,35 @@ const FontPlatformData* FontPlatformData + return nullptr; + + FontFaceCreationParams create_by_alternate_family(alternate_name); +- if (const FontPlatformData* result = GetOrCreateFontPlatformData( ++ if (FontPlatformData* result = GetOrCreateFontPlatformData( + font_cache, font_description, create_by_alternate_family, + AlternateFontName::kNoAlternate)) { + // Cache the platform_data under the old name. + // "accessibility/font-changed.html" reaches here. +- map_.insert(key, result); ++ map_.insert(key, std::make_unique(*result)); + return result; + } + + return nullptr; + } + ++size_t FontPlatformDataCache::ByteSize() const { ++ return map_.size() * sizeof(std::unique_ptr); ++} ++ ++void FontPlatformDataCache::Clear() { ++ map_.clear(); ++} ++ ++void FontPlatformDataCache::Purge(const FontDataCache& font_data_cache) { ++ Vector keys_to_remove; ++ keys_to_remove.ReserveInitialCapacity(map_.size()); ++ for (auto& entry : map_) { ++ if (entry.value && !font_data_cache.Contains(entry.value.get())) { ++ keys_to_remove.push_back(entry.key); ++ } ++ } ++ map_.RemoveAll(keys_to_remove); ++} ++ + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_platform_data_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data_cache.h +@@ -31,13 +31,13 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_PLATFORM_DATA_CACHE_H_ + + #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" ++#include "third_party/blink/renderer/platform/wtf/hash_map.h" + + namespace blink { + + enum class AlternateFontName; + class FontCache; ++class FontDataCache; + class FontDescription; + class FontFaceCreationParams; + class FontPlatformData; +@@ -45,23 +45,30 @@ class FontPlatformData; + // `FontPlatformDataCache` is the shared cache mapping from `FontDescription` + // to `FontPlatformData`. + class FontPlatformDataCache final { +- DISALLOW_NEW(); +- + public: ++ static std::unique_ptr Create(); ++ + FontPlatformDataCache(); ++ ~FontPlatformDataCache(); ++ ++ FontPlatformDataCache(const FontPlatformDataCache&) = delete; ++ FontPlatformDataCache(FontPlatformDataCache&&) = delete; + +- void Trace(Visitor* visitor) const { visitor->Trace(map_); } ++ FontPlatformDataCache operator=(const FontPlatformDataCache&) = delete; ++ FontPlatformDataCache operator=(FontPlatformDataCache&&) = delete; + +- const FontPlatformData* GetOrCreateFontPlatformData( ++ FontPlatformData* GetOrCreateFontPlatformData( + FontCache* font_cache, + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, + AlternateFontName alternate_font_name); + +- void Clear() { map_.clear(); } ++ size_t ByteSize() const; ++ void Clear(); ++ void Purge(const FontDataCache& font_data_cache); + + private: +- HeapHashMap> map_; ++ HashMap> map_; + + // A maximum float value to which we limit incoming font sizes. This is the + // smallest float so that multiplying it by +--- a/third_party/blink/renderer/platform/fonts/font_selector.h ++++ b/third_party/blink/renderer/platform/fonts/font_selector.h +@@ -53,8 +53,8 @@ class UseCounter; + class PLATFORM_EXPORT FontSelector : public FontCacheClient { + public: + ~FontSelector() override = default; +- virtual const FontData* GetFontData(const FontDescription&, +- const FontFamily&) = 0; ++ virtual scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) = 0; + + // TODO(crbug.com/542629): The String variant of this method should be + // replaced with a better approach, now that we only have complex text. +@@ -92,7 +92,7 @@ class PLATFORM_EXPORT FontSelector : pub + virtual void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) = 0; ++ scoped_refptr resulting_font_data) = 0; + + // Called whenever a page attempts to find a local font based on a name. This + // only includes lookups where the name is allowed to match PostScript names +@@ -100,7 +100,7 @@ class PLATFORM_EXPORT FontSelector : pub + virtual void ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback = false) = 0; + + // Called whenever a page attempts to find a local font based on a fallback +@@ -109,12 +109,12 @@ class PLATFORM_EXPORT FontSelector : pub + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) = 0; ++ scoped_refptr resulting_font_data) = 0; + + // Called whenever a page attempts to find a last-resort font. + virtual void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) = 0; ++ scoped_refptr resulting_font_data) = 0; + + virtual void ReportNotDefGlyph() const = 0; + +--- a/third_party/blink/renderer/platform/fonts/fuchsia/font_cache_fuchsia.cc ++++ b/third_party/blink/renderer/platform/fonts/fuchsia/font_cache_fuchsia.cc +@@ -45,7 +45,7 @@ void FontCache::SetSystemFontFamily(cons + MutableSystemFontFamily() = family_name; + } + +-const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( ++scoped_refptr FontCache::PlatformFallbackFontForCharacter( + const FontDescription& font_description, + UChar32 character, + const SimpleFontData* font_data_to_substitute, +@@ -67,12 +67,12 @@ const SimpleFontData* FontCache::Platfor + !typeface->isItalic() && + font_description.SyntheticItalicAllowed(); + +- const auto* font_data = MakeGarbageCollected( ++ auto font_data = std::make_unique( + std::move(typeface), std::string(), font_description.EffectiveFontSize(), + synthetic_bold, synthetic_italic, font_description.TextRendering(), + ResolvedFontFeatures(), font_description.Orientation()); + +- return FontDataFromFontPlatformData(font_data); ++ return FontDataFromFontPlatformData(font_data.get(), kDoNotRetain); + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc ++++ b/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc +@@ -62,7 +62,7 @@ bool FontCache::GetFontForCharacter(UCha + } + } + +-const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( ++scoped_refptr FontCache::PlatformFallbackFontForCharacter( + const FontDescription& font_description, + UChar32 c, + const SimpleFontData*, +@@ -77,9 +77,11 @@ const SimpleFontData* FontCache::Platfor + AtomicString family_name = GetFamilyNameForCharacter( + font_manager_.get(), c, font_description, nullptr, fallback_priority); + if (family_name.empty()) +- return GetLastResortFallbackFont(font_description); +- return FontDataFromFontPlatformData(GetFontPlatformData( +- font_description, FontFaceCreationParams(family_name))); ++ return GetLastResortFallbackFont(font_description, kDoNotRetain); ++ return FontDataFromFontPlatformData( ++ GetFontPlatformData(font_description, ++ FontFaceCreationParams(family_name)), ++ kDoNotRetain); + } + + if (fallback_priority == FontFallbackPriority::kEmojiEmoji) { +@@ -94,7 +96,7 @@ const SimpleFontData* FontCache::Platfor + if (fallback_priority != FontFallbackPriority::kEmojiEmoji && + (font_description.Style() == kItalicSlopeValue || + font_description.Weight() >= kBoldThreshold)) { +- const SimpleFontData* font_data = ++ scoped_refptr font_data = + FallbackOnStandardFontStyle(font_description, c); + if (font_data) + return font_data; +@@ -137,16 +139,16 @@ const SimpleFontData* FontCache::Platfor + description.SetStyle(kNormalSlopeValue); + } + +- const FontPlatformData* substitute_platform_data = ++ FontPlatformData* substitute_platform_data = + GetFontPlatformData(description, creation_params); + if (!substitute_platform_data) + return nullptr; + +- FontPlatformData* platform_data = +- MakeGarbageCollected(*substitute_platform_data); ++ std::unique_ptr platform_data( ++ new FontPlatformData(*substitute_platform_data)); + platform_data->SetSyntheticBold(should_set_synthetic_bold); + platform_data->SetSyntheticItalic(should_set_synthetic_italic); +- return FontDataFromFontPlatformData(platform_data); ++ return FontDataFromFontPlatformData(platform_data.get(), kDoNotRetain); + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/segmented_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/segmented_font_data.h +@@ -28,7 +28,6 @@ + + #include "third_party/blink/renderer/platform/fonts/font_data.h" + #include "third_party/blink/renderer/platform/fonts/font_data_for_range_set.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/casting.h" + +@@ -38,21 +37,20 @@ class SimpleFontData; + + class PLATFORM_EXPORT SegmentedFontData : public FontData { + public: +- SegmentedFontData() = default; +- +- void Trace(Visitor* visitor) const override { +- visitor->Trace(faces_); +- FontData::Trace(visitor); ++ static scoped_refptr Create() { ++ return base::AdoptRef(new SegmentedFontData); + } + +- void AppendFace(FontDataForRangeSet* font_data_for_range_set) { ++ void AppendFace(scoped_refptr font_data_for_range_set) { + faces_.push_back(std::move(font_data_for_range_set)); + } + unsigned NumFaces() const { return faces_.size(); } +- FontDataForRangeSet* FaceAt(unsigned i) const { return faces_[i].Get(); } ++ scoped_refptr FaceAt(unsigned i) const { return faces_[i]; } + bool ContainsCharacter(UChar32) const; + + private: ++ SegmentedFontData() = default; ++ + const SimpleFontData* FontDataForCharacter(UChar32) const override; + + bool IsCustomFont() const override; +@@ -61,7 +59,7 @@ class PLATFORM_EXPORT SegmentedFontData + bool IsSegmented() const override; + bool ShouldSkipDrawing() const override; + +- HeapVector, 1> faces_; ++ Vector, 1> faces_; + }; + + template <> +--- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc +@@ -127,7 +127,7 @@ Vector CachingWordShaper::Indivi + total_width); + } + +-HeapVector CachingWordShaper::GetRunFontData( ++Vector CachingWordShaper::GetRunFontData( + const TextRun& run) const { + ShapeResultBuffer buffer; + ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer); +--- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h +@@ -26,6 +26,7 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_CACHING_WORD_SHAPER_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_CACHING_WORD_SHAPER_H_ + ++#include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h" + #include "third_party/blink/renderer/platform/text/text_run.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +@@ -59,7 +60,7 @@ class PLATFORM_EXPORT CachingWordShaper + CharacterRange GetCharacterRange(const TextRun&, unsigned from, unsigned to); + Vector IndividualCharacterAdvances(const TextRun&); + +- HeapVector GetRunFontData(const TextRun&) const; ++ Vector GetRunFontData(const TextRun&) const; + + GlyphData EmphasisMarkGlyphData(const TextRun&) const; + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -62,8 +62,7 @@ + + namespace blink { + +-HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, +- uint64_t unique_id) ++HarfBuzzFace::HarfBuzzFace(FontPlatformData* platform_data, uint64_t unique_id) + : platform_data_(platform_data), unique_id_(unique_id) { + HbFontCacheEntry* const cache_entry = + FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, +@@ -76,10 +75,6 @@ HarfBuzzFace::~HarfBuzzFace() { + FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); + } + +-void HarfBuzzFace::Trace(Visitor* visitor) const { +- visitor->Trace(platform_data_); +-} +- + static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font, + void* font_data, + hb_codepoint_t unicode, +@@ -426,8 +421,7 @@ static hb_blob_t* HarfBuzzSkiaGetTable(h + } + + // TODO(yosin): We should move |CreateFace()| to "harfbuzz_font_cache.cc". +-static hb::unique_ptr CreateFace( +- const FontPlatformData* platform_data) { ++static hb::unique_ptr CreateFace(FontPlatformData* platform_data) { + hb::unique_ptr face; + + sk_sp typeface = sk_ref_sp(platform_data->Typeface()); +@@ -475,9 +469,8 @@ static scoped_refptr C + return cache_entry; + } + +-HbFontCacheEntry* HarfBuzzFontCache::RefOrNew( +- uint64_t unique_id, +- const FontPlatformData* platform_data) { ++HbFontCacheEntry* HarfBuzzFontCache::RefOrNew(uint64_t unique_id, ++ FontPlatformData* platform_data) { + const auto& result = font_map_.insert(unique_id, nullptr); + if (result.is_new_entry) { + hb::unique_ptr face = CreateFace(platform_data); +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -34,9 +34,8 @@ + #include "third_party/blink/renderer/platform/fonts/glyph.h" + #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" + #include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" ++#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + #include "third_party/blink/renderer/platform/wtf/text/character_names.h" + + #include +@@ -50,15 +49,19 @@ struct HarfBuzzFontData; + + // |HarfBuzzFace| is a thread specific data associated to |FontPlatformData|, + // hold by |HarfBuzzFontCache|. +-class HarfBuzzFace final : public GarbageCollected { ++class HarfBuzzFace final : public RefCounted { ++ USING_FAST_MALLOC(HarfBuzzFace); ++ + public: +- HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); ++ static scoped_refptr Create(FontPlatformData* platform_data, ++ uint64_t unique_id) { ++ return base::AdoptRef(new HarfBuzzFace(platform_data, unique_id)); ++ } ++ + HarfBuzzFace(const HarfBuzzFace&) = delete; + HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; + ~HarfBuzzFace(); + +- void Trace(Visitor*) const; +- + enum VerticalLayoutCallbacks { kPrepareForVerticalLayout, kNoVerticalLayout }; + + // In order to support the restricting effect of unicode-range optionally a +@@ -87,10 +90,11 @@ class HarfBuzzFace final : public Garbag + static void Init(); + + private: ++ HarfBuzzFace(FontPlatformData* platform_data, uint64_t); + + void PrepareHarfBuzzFontData(); + +- Member platform_data_; ++ FontPlatformData* const platform_data_; + const uint64_t unique_id_; + // TODO(crbug.com/1489080): When briefly given MiraclePtr protection, + // these members were both found dangling. +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h +@@ -49,7 +49,7 @@ class HarfBuzzFontCache final { + ~HarfBuzzFontCache(); + + HbFontCacheEntry* RefOrNew(uint64_t unique_id, +- const FontPlatformData* platform_data); ++ FontPlatformData* platform_data); + void Remove(uint64_t unique_id); + + private: +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc +@@ -784,7 +784,7 @@ void HarfBuzzShaper::ShapeSegment( + fallback_chars_hint.ReserveInitialCapacity(range_data->end - + range_data->start); + } +- FontDataForRangeSet* current_font_data_for_range_set = nullptr; ++ scoped_refptr current_font_data_for_range_set; + while (!range_data->reshape_queue.empty()) { + ReshapeQueueItem current_queue_item = range_data->reshape_queue.TakeFirst(); + +@@ -847,7 +847,7 @@ void HarfBuzzShaper::ShapeSegment( + if (needs_caps_handling) { + case_map_intend = caps_support.NeedsCaseChange(small_caps_behavior); + if (caps_support.NeedsSyntheticFont(small_caps_behavior)) +- adjusted_font = font_data->SmallCapsFontData(font_description); ++ adjusted_font = font_data->SmallCapsFontData(font_description).get(); + } + + CaseMappingHarfBuzzBufferFiller( +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc +@@ -79,10 +79,9 @@ ASSERT_SIZE(ShapeResult::RunInfo, SameSi + + struct SameSizeAsShapeResult { + float width; +- UntracedMember deprecated_ink_bounds_; +- Vector runs_; +- Vector character_position_; +- UntracedMember primary_font_; ++ UntracedMember member; ++ Vector vectors[2]; ++ void *pointer; + unsigned start_index_; + unsigned num_characters_; + unsigned bitfields : 32; +@@ -396,7 +395,7 @@ void ShapeResult::RunInfo::CharacterInde + } + } + +-ShapeResult::ShapeResult(const SimpleFontData* font_data, ++ShapeResult::ShapeResult(scoped_refptr font_data, + unsigned start_index, + unsigned num_characters, + TextDirection direction) +@@ -436,7 +435,6 @@ void ShapeResult::Trace(Visitor* visitor + visitor->Trace(deprecated_ink_bounds_); + visitor->Trace(runs_); + visitor->Trace(character_position_); +- visitor->Trace(primary_font_); + } + + size_t ShapeResult::ByteSize() const { +@@ -736,10 +734,10 @@ bool ShapeResult::HasFallbackFonts(const + return false; + } + +-void ShapeResult::GetRunFontData(HeapVector* font_data) const { ++void ShapeResult::GetRunFontData(Vector* font_data) const { + for (const auto& run : runs_) { + font_data->push_back( +- RunFontData({run->font_data_.Get(), run->glyph_data_.size()})); ++ RunFontData({run->font_data_.get(), run->glyph_data_.size()})); + } + } + +@@ -754,7 +752,7 @@ float ShapeResult::ForEachGlyphImpl(floa + for (const auto& glyph_data : run.glyph_data_) { + glyph_callback(context, run.start_index_ + glyph_data.character_index, + glyph_data.glyph, *glyph_offsets, total_advance, +- is_horizontal, run.canvas_rotation_, run.font_data_.Get()); ++ is_horizontal, run.canvas_rotation_, run.font_data_.get()); + total_advance += glyph_data.advance; + ++glyph_offsets; + } +@@ -789,7 +787,7 @@ float ShapeResult::ForEachGlyphImpl(floa + auto total_advance = initial_advance; + unsigned run_start = run.start_index_ + index_offset; + bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run.direction_); +- const SimpleFontData* font_data = run.font_data_.Get(); ++ const SimpleFontData* font_data = run.font_data_.get(); + + if (run.IsLtr()) { // Left-to-right + for (const auto& glyph_data : run.glyph_data_) { +@@ -1679,7 +1677,7 @@ unsigned ShapeResult::CopyRangeInternal( + ShapeResult* ShapeResult::SubRange(unsigned start_offset, + unsigned end_offset) const { + ShapeResult* sub_range = +- MakeGarbageCollected(primary_font_.Get(), 0, 0, Direction()); ++ MakeGarbageCollected(primary_font_.get(), 0, 0, Direction()); + CopyRange(start_offset, end_offset, sub_range); + return sub_range; + } +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.h +@@ -139,7 +139,7 @@ typedef void (*GraphemeClusterCallback)( + + class PLATFORM_EXPORT ShapeResult : public GarbageCollected { + public: +- ShapeResult(const SimpleFontData*, ++ ShapeResult(scoped_refptr, + unsigned start_index, + unsigned num_characters, + TextDirection); +@@ -152,7 +152,7 @@ class PLATFORM_EXPORT ShapeResult : publ + void Trace(Visitor*) const; + + static ShapeResult* CreateEmpty(const ShapeResult& other) { +- return MakeGarbageCollected(other.primary_font_.Get(), 0, 0, ++ return MakeGarbageCollected(other.primary_font_, 0, 0, + other.Direction()); + } + static const ShapeResult* CreateForTabulationCharacters( +@@ -184,7 +184,7 @@ class PLATFORM_EXPORT ShapeResult : publ + LayoutUnit SnappedWidth() const { return LayoutUnit::FromFloatCeil(width_); } + unsigned NumCharacters() const { return num_characters_; } + unsigned NumGlyphs() const { return num_glyphs_; } +- const SimpleFontData* PrimaryFont() const { return primary_font_.Get(); } ++ const SimpleFontData* PrimaryFont() const { return primary_font_.get(); } + bool HasFallbackFonts(const SimpleFontData* primary_font) const; + + // TODO(eae): Remove start_x and return value once ShapeResultBuffer has been +@@ -350,12 +350,10 @@ class PLATFORM_EXPORT ShapeResult : publ + + // Computes the list of fonts along with the number of glyphs for each font. + struct RunFontData { +- DISALLOW_NEW(); +- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } +- Member font_data_; ++ SimpleFontData* font_data_; + wtf_size_t glyph_count_; + }; +- void GetRunFontData(HeapVector* font_data) const; ++ void GetRunFontData(Vector* font_data) const; + + // Iterates over, and calls the specified callback function, for all the + // glyphs. Also tracks (and returns) a seeded total advance. +@@ -515,7 +513,7 @@ class PLATFORM_EXPORT ShapeResult : publ + // index to x-position and O(log n) time, using binary search, from + // x-position to character index. + mutable HeapVector character_position_; +- Member primary_font_; ++ scoped_refptr primary_font_; + + unsigned start_index_; + unsigned num_characters_; +@@ -570,6 +568,5 @@ PLATFORM_EXPORT std::ostream& operator<< + } // namespace blink + + WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::ShapeRange) +-WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::RunFontData) + + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_H_ +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc +@@ -249,8 +249,8 @@ int ShapeResultBuffer::OffsetForPosition + return total_offset; + } + +-HeapVector ShapeResultBuffer::GetRunFontData() const { +- HeapVector font_data; ++Vector ShapeResultBuffer::GetRunFontData() const { ++ Vector font_data; + for (const auto& result : results_) + result->GetRunFontData(&font_data); + return font_data; +@@ -264,9 +264,10 @@ GlyphData ShapeResultBuffer::EmphasisMar + if (run->glyph_data_.IsEmpty()) + continue; + +- return GlyphData(run->glyph_data_[0].glyph, +- run->font_data_->EmphasisMarkFontData(font_description), +- run->CanvasRotation()); ++ return GlyphData( ++ run->glyph_data_[0].glyph, ++ run->font_data_->EmphasisMarkFontData(font_description).get(), ++ run->CanvasRotation()); + } + } + +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h +@@ -5,6 +5,7 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_BUFFER_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_BUFFER_H_ + ++#include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/platform_export.h" +@@ -47,7 +48,7 @@ class PLATFORM_EXPORT ShapeResultBuffer + TextDirection, + float total_width) const; + +- HeapVector GetRunFontData() const; ++ Vector GetRunFontData() const; + + GlyphData EmphasisMarkGlyphData(const FontDescription&) const; + +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h +@@ -79,7 +79,7 @@ struct ShapeResult::RunInfo final + direction_(other.direction_), + canvas_rotation_(other.canvas_rotation_) {} + +- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } ++ void Trace(Visitor*) const {} + + unsigned NumGlyphs() const { return glyph_data_.size(); } + bool IsLtr() const { return HB_DIRECTION_IS_FORWARD(direction_); } +@@ -130,7 +130,7 @@ struct ShapeResult::RunInfo final + return nullptr; + + auto* run = MakeGarbageCollected( +- font_data_.Get(), direction_, canvas_rotation_, script_, ++ font_data_.get(), direction_, canvas_rotation_, script_, + start_index_ + start, number_of_glyphs, number_of_characters); + + run->glyph_data_.CopyFromRange(glyphs); +@@ -154,7 +154,7 @@ struct ShapeResult::RunInfo final + return nullptr; + DCHECK_LT(start_index_, other.start_index_); + auto* run = MakeGarbageCollected( +- font_data_.Get(), direction_, canvas_rotation_, script_, start_index_, ++ font_data_.get(), direction_, canvas_rotation_, script_, start_index_, + glyph_data_.size() + other.glyph_data_.size(), + num_characters_ + other.num_characters_); + // Note: We populate |graphemes_| on demand, e.g. hit testing. +@@ -374,7 +374,7 @@ struct ShapeResult::RunInfo final + } + + GlyphDataCollection glyph_data_; +- Member font_data_; ++ scoped_refptr font_data_; + + // graphemes_[i] is the number of graphemes up to (and including) the ith + // character in the run. +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.cc +@@ -54,7 +54,7 @@ float ShapeResultTestInfo::AdvanceForTes + + SimpleFontData* ShapeResultTestInfo::FontDataForTesting( + unsigned run_index) const { +- return runs_[run_index]->font_data_.Get(); ++ return runs_[run_index]->font_data_.get(); + } + + Vector ShapeResultTestInfo::CharacterIndexesForTesting() const { +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc +@@ -28,9 +28,7 @@ ShapeResultView::RunInfoPart::RunInfoPar + start_index_(start_index), + offset_(offset), + num_characters_(num_characters), +- width_(width) { +- static_assert(std::is_trivially_destructible::value, ""); +-} ++ width_(width) {} + + void ShapeResultView::RunInfoPart::Trace(Visitor* visitor) const { + visitor->Trace(run_); +@@ -74,10 +72,7 @@ unsigned ShapeResultView::CharacterIndex + // |InitData| provides values of const member variables of |ShapeResultView| + // for constructor. + struct ShapeResultView::InitData { +- STACK_ALLOCATED(); +- +- public: +- const SimpleFontData* primary_font = nullptr; ++ scoped_refptr primary_font; + unsigned start_index = 0; + unsigned char_index_offset = 0; + TextDirection direction = TextDirection::kLtr; +@@ -188,7 +183,7 @@ ShapeResult* ShapeResultView::CreateShap + new_result->runs_.ReserveInitialCapacity(parts_.size()); + for (const auto& part : RunsOrParts()) { + auto* new_run = MakeGarbageCollected( +- part.run_->font_data_.Get(), part.run_->direction_, ++ part.run_->font_data_.get(), part.run_->direction_, + part.run_->canvas_rotation_, part.run_->script_, part.start_index_, + part.NumGlyphs(), part.num_characters_); + new_run->glyph_data_.CopyFromRange(part.range_); +@@ -364,21 +359,21 @@ unsigned ShapeResultView::PreviousSafeTo + } + + void ShapeResultView::GetRunFontData( +- HeapVector* font_data) const { ++ Vector* font_data) const { + for (const auto& part : RunsOrParts()) { + font_data->push_back(ShapeResult::RunFontData( +- {part.run_->font_data_.Get(), ++ {part.run_->font_data_.get(), + static_cast(part.end() - part.begin())})); + } + } + + void ShapeResultView::FallbackFonts( +- HeapHashSet>* fallback) const { ++ HashSet* fallback) const { + DCHECK(fallback); + DCHECK(primary_font_); + for (const auto& part : RunsOrParts()) { + if (part.run_->font_data_ && part.run_->font_data_ != primary_font_) { +- fallback->insert(part.run_->font_data_.Get()); ++ fallback->insert(part.run_->font_data_.get()); + } + } + } +@@ -392,7 +387,7 @@ float ShapeResultView::ForEachGlyphImpl( + const auto& run = part.run_; + auto total_advance = initial_advance; + bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run->direction_); +- const SimpleFontData* font_data = run->font_data_.Get(); ++ const SimpleFontData* font_data = run->font_data_.get(); + const unsigned character_index_offset_for_glyph_data = + CharacterIndexOffsetForGlyphData(part); + for (const auto& glyph_data : part) { +@@ -435,7 +430,7 @@ float ShapeResultView::ForEachGlyphImpl( + auto total_advance = initial_advance; + const auto& run = part.run_; + bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run->direction_); +- const SimpleFontData* font_data = run->font_data_.Get(); ++ const SimpleFontData* font_data = run->font_data_.get(); + const unsigned character_index_offset_for_glyph_data = + CharacterIndexOffsetForGlyphData(part); + if (run->IsLtr()) { // Left-to-right +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h +@@ -10,7 +10,6 @@ + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + #include "third_party/blink/renderer/platform/geometry/layout_unit.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/text/text_direction.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" +@@ -111,10 +110,7 @@ class PLATFORM_EXPORT ShapeResultView fi + ShapeResultView& operator=(const ShapeResultView&) = delete; + ~ShapeResultView() = default; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(parts_); +- visitor->Trace(primary_font_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(parts_); } + + ShapeResult* CreateShapeResult() const; + +@@ -130,7 +126,7 @@ class PLATFORM_EXPORT ShapeResultView fi + bool IsLtr() const { return blink::IsLtr(Direction()); } + bool IsRtl() const { return blink::IsRtl(Direction()); } + bool HasVerticalOffsets() const { return has_vertical_offsets_; } +- void FallbackFonts(HeapHashSet>* fallback) const; ++ void FallbackFonts(HashSet* fallback) const; + + unsigned PreviousSafeToBreakOffset(unsigned index) const; + +@@ -155,8 +151,10 @@ class PLATFORM_EXPORT ShapeResultView fi + // bounds. + gfx::RectF ComputeInkBounds() const; + +- const SimpleFontData* PrimaryFont() const { return primary_font_.Get(); } +- void GetRunFontData(HeapVector*) const; ++ scoped_refptr PrimaryFont() const { ++ return primary_font_; ++ } ++ void GetRunFontData(Vector*) const; + + void ExpandRangeToIncludePartialGlyphs(unsigned* from, unsigned* to) const; + +@@ -288,8 +286,7 @@ class PLATFORM_EXPORT ShapeResultView fi + + unsigned StartIndexOffsetForRun() const { return char_index_offset_; } + +- HeapVector parts_; +- Member const primary_font_; ++ scoped_refptr const primary_font_; + + const unsigned start_index_; + +@@ -311,6 +308,8 @@ class PLATFORM_EXPORT ShapeResultView fi + // with ShapeResult::SubRange + const unsigned char_index_offset_; + ++ HeapVector parts_; ++ + private: + friend class ShapeResult; + +--- a/third_party/blink/renderer/platform/fonts/simple_font_data.cc ++++ b/third_party/blink/renderer/platform/fonts/simple_font_data.cc +@@ -76,14 +76,14 @@ constexpr int32_t kFontObjectsMemoryCons + constexpr int32_t kFontObjectsMemoryConsumption = 2128; + #endif + +-SimpleFontData::SimpleFontData(const FontPlatformData* platform_data, +- const CustomFontData* custom_data, ++SimpleFontData::SimpleFontData(const FontPlatformData& platform_data, ++ scoped_refptr custom_data, + bool subpixel_ascent_descent, + const FontMetricsOverride& metrics_override) + : platform_data_(platform_data), +- font_(platform_data->size() ? platform_data->CreateSkFont() ++ font_(platform_data_.size() ? platform_data.CreateSkFont() + : skia::DefaultFont()), +- custom_font_data_(custom_data) { ++ custom_font_data_(std::move(custom_data)) { + // Every time new SimpleFontData instance is created, Skia will ask + // FreeType to get the metrics for glyphs by invoking + // af_face_globals_get_metrics. There FT will allocate style_metrics_size +@@ -111,7 +111,7 @@ SimpleFontData::~SimpleFontData() { + + void SimpleFontData::PlatformInit(bool subpixel_ascent_descent, + const FontMetricsOverride& metrics_override) { +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) { + font_metrics_.Reset(); + avg_char_width_ = 0; + max_char_width_ = 0; +@@ -126,7 +126,7 @@ void SimpleFontData::PlatformInit(bool s + float descent; + + FontMetrics::AscentDescentWithHacks( +- ascent, descent, *platform_data_, font_, subpixel_ascent_descent, ++ ascent, descent, platform_data_, font_, subpixel_ascent_descent, + metrics_override.ascent_override, metrics_override.descent_override); + + font_metrics_.SetAscent(ascent); +@@ -164,7 +164,7 @@ void SimpleFontData::PlatformInit(bool s + + float line_gap; + if (metrics_override.line_gap_override) { +- line_gap = *metrics_override.line_gap_override * platform_data_->size(); ++ line_gap = *metrics_override.line_gap_override * platform_data_.size(); + } else { + line_gap = SkScalarToFloat(metrics.fLeading); + } +@@ -261,39 +261,45 @@ bool SimpleFontData::IsSegmented() const + return false; + } + +-SimpleFontData* SimpleFontData::SmallCapsFontData( ++scoped_refptr SimpleFontData::SmallCapsFontData( + const FontDescription& font_description) const { +- if (!small_caps_) { +- small_caps_ = ++ if (!derived_font_data_) ++ derived_font_data_ = std::make_unique(); ++ if (!derived_font_data_->small_caps) { ++ derived_font_data_->small_caps = + CreateScaledFontData(font_description, kSmallCapsFontSizeMultiplier); + } +- return small_caps_; ++ ++ return derived_font_data_->small_caps; + } + +-SimpleFontData* SimpleFontData::EmphasisMarkFontData( ++scoped_refptr SimpleFontData::EmphasisMarkFontData( + const FontDescription& font_description) const { +- if (!emphasis_mark_) { +- emphasis_mark_ = ++ if (!derived_font_data_) ++ derived_font_data_ = std::make_unique(); ++ if (!derived_font_data_->emphasis_mark) { ++ derived_font_data_->emphasis_mark = + CreateScaledFontData(font_description, kEmphasisMarkFontSizeMultiplier); + } +- return emphasis_mark_; ++ ++ return derived_font_data_->emphasis_mark; + } + +-SimpleFontData* SimpleFontData::CreateScaledFontData( ++scoped_refptr SimpleFontData::CreateScaledFontData( + const FontDescription& font_description, + float scale_factor) const { + const float scaled_size = + lroundf(font_description.ComputedSize() * scale_factor); +- return MakeGarbageCollected( +- MakeGarbageCollected(*platform_data_, scaled_size), +- IsCustomFont() ? MakeGarbageCollected() : nullptr); ++ return SimpleFontData::Create( ++ FontPlatformData(platform_data_, scaled_size), ++ IsCustomFont() ? CustomFontData::Create() : nullptr); + } + +-SimpleFontData* SimpleFontData::MetricsOverriddenFontData( ++scoped_refptr SimpleFontData::MetricsOverriddenFontData( + const FontMetricsOverride& metrics_override) const { +- return MakeGarbageCollected( +- platform_data_, custom_font_data_, false /* subpixel_ascent_descent */, +- metrics_override); ++ return base::AdoptRef(new SimpleFontData(platform_data_, custom_font_data_, ++ false /* subpixel_ascent_descent */, ++ metrics_override)); + } + + // Internal leadings can be distributed to ascent and descent. +@@ -346,7 +352,7 @@ static std::pair TypoA + + void SimpleFontData::ComputeNormalizedTypoAscentAndDescent() const { + // Compute em height metrics from OS/2 sTypoAscender and sTypoDescender. +- SkTypeface* typeface = platform_data_->Typeface(); ++ SkTypeface* typeface = platform_data_.Typeface(); + auto [typo_ascender, typo_descender] = TypoAscenderAndDescender(typeface); + if (typo_ascender > 0 && + TrySetNormalizedTypoAscentAndDescent(typo_ascender, typo_descender)) { +@@ -433,7 +439,7 @@ const std::optional& SimpleFontDa + } + + // Compute vertical advance if the orientation is `kVerticalUpright`. +- const HarfBuzzFace* hb_face = platform_data_->GetHarfBuzzFace(); ++ const HarfBuzzFace* hb_face = platform_data_.GetHarfBuzzFace(); + const OpenTypeVerticalData& vertical_data = hb_face->VerticalData(); + ideographic_inline_size_ = vertical_data.AdvanceHeight(cjk_water_glyph); + }); +@@ -461,9 +467,8 @@ const HanKerning::FontData& SimpleFontDa + } + + gfx::RectF SimpleFontData::PlatformBoundsForGlyph(Glyph glyph) const { +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) + return gfx::RectF(); +- } + + static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); + +@@ -476,18 +481,16 @@ void SimpleFontData::BoundsForGlyphs(con + Vector* bounds) const { + DCHECK_EQ(glyphs.size(), bounds->size()); + +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) + return; +- } + + DCHECK_EQ(bounds->size(), glyphs.size()); + SkFontGetBoundsForGlyphs(font_, glyphs, bounds->data()); + } + + float SimpleFontData::WidthForGlyph(Glyph glyph) const { +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) + return 0; +- } + + static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); + +--- a/third_party/blink/renderer/platform/fonts/simple_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/simple_font_data.h +@@ -40,7 +40,6 @@ + #include "third_party/blink/renderer/platform/fonts/glyph.h" + #include "third_party/blink/renderer/platform/fonts/shaping/han_kerning.h" + #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/casting.h" + #include "third_party/blink/renderer/platform/wtf/text/string_hash.h" +@@ -75,18 +74,12 @@ class FontDescription; + class PLATFORM_EXPORT SimpleFontData final : public FontData { + public: + // Used to create platform fonts. +- SimpleFontData( +- const FontPlatformData*, +- const CustomFontData* custom_data = nullptr, +- bool subpixel_ascent_descent = false, +- const FontMetricsOverride& metrics_override = FontMetricsOverride()); +- +- void Trace(Visitor* visitor) const override { +- visitor->Trace(platform_data_); +- visitor->Trace(small_caps_); +- visitor->Trace(emphasis_mark_); +- visitor->Trace(custom_font_data_); +- FontData::Trace(visitor); ++ static scoped_refptr Create( ++ const FontPlatformData& platform_data, ++ scoped_refptr custom_data = nullptr, ++ bool subpixel_ascent_descent = false) { ++ return base::AdoptRef(new SimpleFontData( ++ platform_data, std::move(custom_data), subpixel_ascent_descent)); + } + + SimpleFontData(const SimpleFontData&) = delete; +@@ -95,11 +88,13 @@ class PLATFORM_EXPORT SimpleFontData fin + SimpleFontData& operator=(const SimpleFontData&) = delete; + SimpleFontData& operator=(const SimpleFontData&&) = delete; + +- const FontPlatformData& PlatformData() const { return *platform_data_; } ++ const FontPlatformData& PlatformData() const { return platform_data_; } + +- SimpleFontData* SmallCapsFontData(const FontDescription&) const; +- SimpleFontData* EmphasisMarkFontData(const FontDescription&) const; +- SimpleFontData* MetricsOverriddenFontData(const FontMetricsOverride&) const; ++ scoped_refptr SmallCapsFontData(const FontDescription&) const; ++ scoped_refptr EmphasisMarkFontData( ++ const FontDescription&) const; ++ scoped_refptr MetricsOverriddenFontData( ++ const FontMetricsOverride&) const; + + FontMetrics& GetFontMetrics() { return font_metrics_; } + const FontMetrics& GetFontMetrics() const { return font_metrics_; } +@@ -154,7 +149,7 @@ class PLATFORM_EXPORT SimpleFontData fin + + Glyph GlyphForCharacter(UChar32) const; + +- bool IsCustomFont() const override { return custom_font_data_; } ++ bool IsCustomFont() const override { return custom_font_data_.get(); } + bool IsLoading() const override { + return custom_font_data_ ? custom_font_data_->IsLoading() : false; + } +@@ -169,16 +164,20 @@ class PLATFORM_EXPORT SimpleFontData fin + return custom_font_data_ && custom_font_data_->ShouldSkipDrawing(); + } + +- const CustomFontData* GetCustomFontData() const { +- return custom_font_data_.Get(); +- } ++ CustomFontData* GetCustomFontData() const { return custom_font_data_.get(); } + + private: ++ SimpleFontData( ++ const FontPlatformData&, ++ scoped_refptr custom_data, ++ bool subpixel_ascent_descent = false, ++ const FontMetricsOverride& metrics_override = FontMetricsOverride()); ++ + void PlatformInit(bool subpixel_ascent_descent, const FontMetricsOverride&); + void PlatformGlyphInit(); + +- SimpleFontData* CreateScaledFontData(const FontDescription&, +- float scale_factor) const; ++ scoped_refptr CreateScaledFontData(const FontDescription&, ++ float scale_factor) const; + + void ComputeNormalizedTypoAscentAndDescent() const; + bool TrySetNormalizedTypoAscentAndDescent(float ascent, float descent) const; +@@ -187,17 +186,30 @@ class PLATFORM_EXPORT SimpleFontData fin + float max_char_width_ = -1; + float avg_char_width_ = -1; + +- Member platform_data_; ++ const FontPlatformData platform_data_; + const SkFont font_; + + Glyph space_glyph_ = 0; + float space_width_ = 0; + Glyph zero_glyph_ = 0; + +- mutable Member small_caps_; +- mutable Member emphasis_mark_; ++ struct DerivedFontData final { ++ USING_FAST_MALLOC(DerivedFontData); ++ ++ public: ++ DerivedFontData() = default; ++ DerivedFontData(const DerivedFontData&) = delete; ++ DerivedFontData(DerivedFontData&&) = delete; ++ DerivedFontData& operator=(const DerivedFontData&) = delete; ++ DerivedFontData& operator=(DerivedFontData&&) = delete; ++ ++ scoped_refptr small_caps; ++ scoped_refptr emphasis_mark; ++ }; ++ ++ mutable std::unique_ptr derived_font_data_; + +- Member custom_font_data_; ++ const scoped_refptr custom_font_data_; + + mutable std::once_flag ideographic_inline_size_once_; + mutable std::once_flag ideographic_advance_width_once_; +--- a/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc ++++ b/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc +@@ -94,7 +94,7 @@ AtomicString FontCache::GetFamilyNameFor + + void FontCache::PlatformInit() {} + +-const SimpleFontData* FontCache::FallbackOnStandardFontStyle( ++scoped_refptr FontCache::FallbackOnStandardFontStyle( + const FontDescription& font_description, + UChar32 character) { + FontDescription substitute_description(font_description); +@@ -103,26 +103,27 @@ const SimpleFontData* FontCache::Fallbac + + FontFaceCreationParams creation_params( + substitute_description.Family().FamilyName()); +- const FontPlatformData* substitute_platform_data = ++ FontPlatformData* substitute_platform_data = + GetFontPlatformData(substitute_description, creation_params); + if (substitute_platform_data && + substitute_platform_data->FontContainsCharacter(character)) { +- FontPlatformData* platform_data = +- MakeGarbageCollected(*substitute_platform_data); +- platform_data->SetSyntheticBold(font_description.Weight() >= +- kBoldThreshold && +- font_description.SyntheticBoldAllowed()); +- platform_data->SetSyntheticItalic( +- font_description.Style() == kItalicSlopeValue && +- font_description.SyntheticItalicAllowed()); +- return FontDataFromFontPlatformData(platform_data); ++ FontPlatformData platform_data = ++ FontPlatformData(*substitute_platform_data); ++ platform_data.SetSyntheticBold(font_description.Weight() >= ++ kBoldThreshold && ++ font_description.SyntheticBoldAllowed()); ++ platform_data.SetSyntheticItalic(font_description.Style() == ++ kItalicSlopeValue && ++ font_description.SyntheticItalicAllowed()); ++ return FontDataFromFontPlatformData(&platform_data, kDoNotRetain); + } + + return nullptr; + } + +-const SimpleFontData* FontCache::GetLastResortFallbackFont( +- const FontDescription& description) { ++scoped_refptr FontCache::GetLastResortFallbackFont( ++ const FontDescription& description, ++ ShouldRetain should_retain) { + const FontFaceCreationParams fallback_creation_params( + GetFallbackFontFamily(description)); + const FontPlatformData* font_platform_data = GetFontPlatformData( +@@ -195,7 +196,7 @@ const SimpleFontData* FontCache::GetLast + #endif + + DCHECK(font_platform_data); +- return FontDataFromFontPlatformData(font_platform_data); ++ return FontDataFromFontPlatformData(font_platform_data, should_retain); + } + + sk_sp FontCache::CreateTypeface( +@@ -238,7 +239,7 @@ sk_sp FontCache::CreateTypef + } + + #if !BUILDFLAG(IS_WIN) +-const FontPlatformData* FontCache::CreateFontPlatformData( ++std::unique_ptr FontCache::CreateFontPlatformData( + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, + float font_size, +@@ -293,10 +294,11 @@ const FontPlatformData* FontCache::Creat + ->GetResolvedFontFeatures() + : ResolvedFontFeatures(); + +- FontPlatformData* font_platform_data = MakeGarbageCollected( +- typeface, name, font_size, synthetic_bold, synthetic_italic, +- font_description.TextRendering(), resolved_font_features, +- font_description.Orientation()); ++ std::unique_ptr font_platform_data = ++ std::make_unique( ++ typeface, name, font_size, synthetic_bold, synthetic_italic, ++ font_description.TextRendering(), resolved_font_features, ++ font_description.Orientation()); + + font_platform_data->SetAvoidEmbeddedBitmaps( + BitmapGlyphsBlockList::ShouldAvoidEmbeddedBitmapsForTypeface(*typeface)); +--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc ++++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc +@@ -43,26 +43,23 @@ class TestFontSelector : public FontSele + } + ~TestFontSelector() override = default; + +- FontData* GetFontData(const FontDescription& font_description, +- const FontFamily&) override { ++ scoped_refptr GetFontData(const FontDescription& font_description, ++ const FontFamily&) override { + FontSelectionCapabilities normal_capabilities( + {kNormalWidthValue, kNormalWidthValue}, + {kNormalSlopeValue, kNormalSlopeValue}, + {kNormalWeightValue, kNormalWeightValue}); +- const FontPlatformData* platform_data = +- custom_platform_data_->GetFontPlatformData( +- font_description.EffectiveFontSize(), +- font_description.AdjustedSpecifiedSize(), +- font_description.IsSyntheticBold() && +- font_description.SyntheticBoldAllowed(), +- font_description.IsSyntheticItalic() && +- font_description.SyntheticItalicAllowed(), +- font_description.GetFontSelectionRequest(), normal_capabilities, +- font_description.FontOpticalSizing(), +- font_description.TextRendering(), {}, +- font_description.Orientation()); +- return MakeGarbageCollected( +- platform_data, MakeGarbageCollected()); ++ FontPlatformData platform_data = custom_platform_data_->GetFontPlatformData( ++ font_description.EffectiveFontSize(), ++ font_description.AdjustedSpecifiedSize(), ++ font_description.IsSyntheticBold() && ++ font_description.SyntheticBoldAllowed(), ++ font_description.IsSyntheticItalic() && ++ font_description.SyntheticItalicAllowed(), ++ font_description.GetFontSelectionRequest(), normal_capabilities, ++ font_description.FontOpticalSizing(), font_description.TextRendering(), ++ {}, font_description.Orientation()); ++ return SimpleFontData::Create(platform_data, CustomFontData::Create()); + } + + void WillUseFontData(const FontDescription&, +@@ -83,20 +80,20 @@ class TestFontSelector : public FontSele + void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override {} ++ scoped_refptr resulting_font_data) override {} + void ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback = false) override {} + void ReportFontLookupByFallbackCharacter( + UChar32 hint, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override {} ++ scoped_refptr resulting_font_data) override {} + void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override {} ++ scoped_refptr resulting_font_data) override {} + void ReportNotDefGlyph() const override {} + void ReportEmojiSegmentGlyphCoverage(unsigned, unsigned) override {} + ExecutionContext* GetExecutionContext() const override { return nullptr; } +--- a/tools/privacy_budget/font_indexer/font_indexer.cc ++++ b/tools/privacy_budget/font_indexer/font_indexer.cc +@@ -116,7 +116,7 @@ void FontIndexer::FontListHasLoaded(base + bool FontIndexer::DoesFontHaveDigest(WTF::AtomicString name, + blink::FontDescription font_description, + int64_t digest) { +- const blink::SimpleFontData* font_data = ++ scoped_refptr font_data = + font_cache_->GetFontData(font_description, name); + DCHECK(font_data); + return blink::FontGlobalContext::Get() +@@ -170,7 +170,7 @@ void FontIndexer::PrintAllFontsWithName( + // exists and for later comparison. + int64_t default_font_digest; + { +- const blink::SimpleFontData* font_data = ++ scoped_refptr font_data = + font_cache_->GetFontData(blink::FontDescription(), name); + default_font_digest = + font_data ? blink::FontGlobalContext::Get() +@@ -231,7 +231,7 @@ void FontIndexer::PrintAllFontsWithName( + for (auto slope_pair : slopes) { + font_description.SetStyle(slope_pair.first); + +- if (const blink::SimpleFontData* font_data = ++ if (scoped_refptr font_data = + font_cache_->GetFontData(font_description, name)) { + uint64_t typeface_digest = + blink::FontGlobalContext::Get() diff --git a/bad-font-gc3.patch b/bad-font-gc3.patch new file mode 100644 index 0000000..f6726ae --- /dev/null +++ b/bad-font-gc3.patch @@ -0,0 +1,38 @@ +Revert the following commit (to support bad-font-gc2.patch): + +commit d4806d20fda56e9bac259fddf10b7439ce749add +Author: Hao Liu +Date: Mon Mar 18 22:56:31 2024 +0000 + + Cleanup leftover non-used custom_font_data methods + + This is to clean up non-used custom_font_data methods. Their usage has + been deleted in a previous CL. + https://chromium-review.googlesource.com/c/chromium/src/+/5262982/29/third_party/blink/renderer/core/css/css_font_face_source.cc#b95 + + Change-Id: I90c3ae794a6caf71526c81a56795e95c23cc3fb5 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368244 + Reviewed-by: Ian Kilpatrick + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1274525} + +--- a/third_party/blink/renderer/core/css/css_custom_font_data.h ++++ b/third_party/blink/renderer/core/css/css_custom_font_data.h +@@ -55,6 +55,7 @@ class CSSCustomFontData final : public C + + bool IsLoading() const override { return is_loading_; } + bool IsLoadingFallback() const override { return true; } ++ void ClearFontFaceSource() override { font_face_source_ = nullptr; } + + bool IsPendingDataUrl() const override { + return font_face_source_ && font_face_source_->IsPendingDataUrl(); +--- a/third_party/blink/renderer/platform/fonts/custom_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h +@@ -46,6 +46,7 @@ class PLATFORM_EXPORT CustomFontData : p + virtual bool IsLoading() const { return false; } + virtual bool IsLoadingFallback() const { return false; } + virtual bool ShouldSkipDrawing() const { return false; } ++ virtual void ClearFontFaceSource() {} + virtual bool IsPendingDataUrl() const { return false; } + + protected: diff --git a/base-system-nspr.patch b/base-system-nspr.patch index 743dfd4..51c0f7b 100644 --- a/base-system-nspr.patch +++ b/base-system-nspr.patch @@ -8,7 +8,7 @@ +#include #include "base/time/time_override.h" #include "build/build_config.h" - #include "third_party/abseil-cpp/absl/types/optional.h" + --- a/base/BUILD.gn 2022-06-30 13:13:20.315537859 +0200 +++ b/base/BUILD.gn 2022-06-30 13:25:39.947410797 +0200 @@ -1,3 +1,8 @@ diff --git a/bitset-missing-uint8_t-memcpy.patch b/bitset-missing-uint8_t-memcpy.patch new file mode 100644 index 0000000..fc3a3a8 --- /dev/null +++ b/bitset-missing-uint8_t-memcpy.patch @@ -0,0 +1,46 @@ +From df291ec5472fa14e828633378b8c97a8c7a2e7de Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 20 Mar 2024 12:38:04 +0000 +Subject: [PATCH] IWYU: missing includes in ukm::BitSet +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Usage of uint8_t and std::memcpy require includes. + +Bug: 41455655 +Change-Id: Ib96b3c3595660fc05d37d61ba9ec36add18eba57 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5370063 +Commit-Queue: José Dapena Paz +Reviewed-by: Cait Phillips +Cr-Commit-Position: refs/heads/main@{#1275509} +--- + components/ukm/bitset.cc | 2 ++ + components/ukm/bitset.h | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/components/ukm/bitset.cc b/components/ukm/bitset.cc +index 0c4faff95ed29..da83c35aa5c58 100644 +--- a/components/ukm/bitset.cc ++++ b/components/ukm/bitset.cc +@@ -4,6 +4,8 @@ + + #include "components/ukm/bitset.h" + ++#include ++ + #include "base/check_op.h" + + namespace ukm { +diff --git a/components/ukm/bitset.h b/components/ukm/bitset.h +index 9b1f88c844ef6..005ce6e329db2 100644 +--- a/components/ukm/bitset.h ++++ b/components/ukm/bitset.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_UKM_BITSET_H_ + #define COMPONENTS_UKM_BITSET_H_ + ++#include + #include + #include + diff --git a/brotli-remove-shared-dictionary.patch b/brotli-remove-shared-dictionary.patch index 5d1cdf8..3747469 100644 --- a/brotli-remove-shared-dictionary.patch +++ b/brotli-remove-shared-dictionary.patch @@ -64,7 +64,7 @@ This feature does not build with brotli < 1.1 "CompressionDictionaryTransportBackend", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); - const base::FeatureParam::Option - kCompressionDictionaryTransportBackendVersionOptions[] = { - {CompressionDictionaryTransportBackendVersion::kV1, "v1"}, + + // When both this feature and the kCompressionDictionaryTransportBackend feature + // are enabled, the following will happen: diff --git a/build-without-extensions.patch b/build-without-extensions.patch index 75bbb6a..91346db 100644 --- a/build-without-extensions.patch +++ b/build-without-extensions.patch @@ -8,16 +8,14 @@ This is not upstreamable as the problem is due to Electron changes to chromium, --- src/extensions/browser/guest_view/web_view/web_view_guest.cc.old 2023-09-28 10:14:03.660044621 +0200 +++ src/extensions/browser/guest_view/web_view/web_view_guest.cc 2023-09-29 08:05:41.827245244 +0200 -@@ -285,9 +285,6 @@ std::string WebViewGuest::GetPartitionID +@@ -285,7 +285,6 @@ std::string WebViewGuest::GetPartitionID } // static -const char WebViewGuest::Type[] = "webview"; -- --// static - int WebViewGuest::GetOrGenerateRulesRegistryID(int embedder_process_id, - int webview_instance_id) { - bool is_web_view = embedder_process_id && webview_instance_id; + const guest_view::GuestViewHistogramValue WebViewGuest::HistogramValue = + guest_view::GuestViewHistogramValue::kWebView; + --- src/extensions/browser/guest_view/web_view/web_view_guest.h.old 2023-09-28 10:14:03.660044621 +0200 +++ src/extensions/browser/guest_view/web_view/web_view_guest.h 2023-09-29 08:06:13.200529820 +0200 @@ -49,7 +49,7 @@ class WebViewGuest : public guest_view:: @@ -26,6 +24,6 @@ This is not upstreamable as the problem is due to Electron changes to chromium, - static const char Type[]; + constexpr static const char Type[] = "webview"; + static const guest_view::GuestViewHistogramValue HistogramValue; // Returns the WebView partition ID associated with the render process - // represented by |render_process_host|, if any. Otherwise, an empty string is diff --git a/chromium-102-compiler.patch b/chromium-102-compiler.patch index 232e310..11a0570 100644 --- a/chromium-102-compiler.patch +++ b/chromium-102-compiler.patch @@ -4,6 +4,7 @@ SUSE: Disable the following: and global CFLAGS go at the end of the commandline * Submodel options (-march and friends). Upstream notoriously forces SSE3 despite the code not requiring it. * note that cpu options for ARM are currently left in, as they do not seem to do harm and V8 needs to know the exact target anyway +* libstdc++ assertions. Enabling them or not should in general be the distro's decision. Electron does not run untrusted code (unlike browsers) and as such does not really benefit from security paranoia. * Debuginfo format. Upstream seems to force something that is not recognized by rpmbuild. * per-target debuginfo level is left in as it is still useful (-g2 everywhere does not work) * Emitting code for the PIC model. It is needed in case of shared libraries, but results in a larger executable (and Electron is already enormous) @@ -24,7 +25,7 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index d40843b..b92f03b 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -274,9 +274,7 @@ +@@ -322,9 +322,7 @@ config("compiler") { configs += [ # See the definitions below. @@ -34,7 +35,7 @@ index d40843b..b92f03b 100644 ":compiler_codegen", ":compiler_deterministic", ] -@@ -305,7 +303,12 @@ +@@ -353,7 +351,12 @@ config("compiler") { if (!is_win) { # Common POSIX compiler flags setup. # -------------------------------- @@ -48,7 +49,7 @@ index d40843b..b92f03b 100644 # Stack protection. ShadowCallStack and Stack protector address the same # problems. Therefore, we only enable one or the other. Clang advertises SCS as -@@ -432,10 +435,6 @@ +@@ -494,10 +497,6 @@ config("compiler") { # Linux/Android/Fuchsia common flags setup. # --------------------------------- if (is_linux || is_chromeos || is_android || is_fuchsia) { @@ -59,7 +60,7 @@ index d40843b..b92f03b 100644 if (!is_clang) { # Use pipes for communicating between sub-processes. Faster. -@@ -527,55 +527,6 @@ +@@ -590,55 +589,6 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } @@ -115,7 +116,19 @@ index d40843b..b92f03b 100644 # C11/C++11 compiler flags setup. # --------------------------- if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) || -@@ -862,7 +837,8 @@ +@@ -1070,11 +1020,6 @@ config("compiler") { + defines += [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ] + } + +- # Enable libstdc++ hardening lightweight assertions. Those have a low +- # performance penalty but are considered a bare minimum for security. +- if (use_safe_libstdcxx) { +- defines += [ "_GLIBCXX_ASSERTIONS=1" ] +- } + } + + # The BUILDCONFIG file sets this config on targets by default, which means when +@@ -1140,7 +1085,8 @@ config("thinlto_optimize_max") { # without using everything that "compiler" brings in. Options that # tweak code generation for a particular CPU do not belong here! # See "compiler_codegen", below. @@ -125,7 +138,7 @@ index d40843b..b92f03b 100644 cflags = [] ldflags = [] defines = [] -@@ -1227,46 +1203,6 @@ +@@ -1523,46 +1469,6 @@ config("compiler_deterministic") { } } @@ -172,7 +185,7 @@ index d40843b..b92f03b 100644 # Tells the compiler not to use absolute paths when passing the default # paths to the tools it invokes. We don't want this because we don't # really need it and it can mess up the goma cache entries. -@@ -1400,7 +1337,8 @@ +@@ -1739,7 +1645,8 @@ config("treat_warnings_as_errors") { # Collects all warning flags that are used by default. This is used as a # subconfig of both chromium_code and no_chromium_code. This way these # flags are guaranteed to appear on the compile command line after -Wall. @@ -182,20 +195,20 @@ index d40843b..b92f03b 100644 cflags = [] cflags_c = [] cflags_cc = [] -@@ -1597,11 +1535,7 @@ +@@ -1983,11 +1890,7 @@ config("chromium_code") { defines = [ "_HAS_NODISCARD" ] } } else { - cflags = [ "-Wall" ] -+ cflags = [] - if (is_clang) { - # Enable extra warnings for chromium_code when we control the compiler. - cflags += [ "-Wextra" ] - } ++ cflags = [] # In Chromium code, we define __STDC_foo_MACROS in order to get the # C99 macros on Mac and Linux. -@@ -1618,24 +1552,6 @@ +@@ -1996,24 +1899,6 @@ config("chromium_code") { "__STDC_FORMAT_MACROS", ] @@ -220,7 +233,7 @@ index d40843b..b92f03b 100644 if (is_apple) { cflags_objc = [ "-Wimplicit-retain-self" ] cflags_objcc = [ "-Wimplicit-retain-self" ] -@@ -1841,7 +1841,6 @@ +@@ -2159,7 +2044,6 @@ config("no_rtti") { config("export_dynamic") { # TODO(crbug.com/1052397): Revisit after target_os flip is completed. if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) { @@ -228,7 +241,7 @@ index d40843b..b92f03b 100644 } } -@@ -1887,7 +1811,8 @@ +@@ -2247,7 +2131,8 @@ config("wexit_time_destructors") { # gcc 4.9 and earlier had no way of suppressing this warning without # suppressing the rest of them. Here we centralize the identification of # the gcc 4.9 toolchains. @@ -238,7 +251,7 @@ index d40843b..b92f03b 100644 cflags = [] if (is_clang) { cflags += [ "-Wno-incompatible-pointer-types" ] -@@ -1990,7 +1915,8 @@ +@@ -2362,7 +2247,8 @@ if (is_win) { common_optimize_on_cflags += [ "-fno-math-errno" ] } @@ -248,7 +261,7 @@ index d40843b..b92f03b 100644 if (!is_win) { if (enable_frame_pointers) { cflags = [ "-fno-omit-frame-pointer" ] -@@ -2017,7 +1943,8 @@ +@@ -2389,7 +2275,8 @@ config("default_stack_frames") { } # Default "optimization on" config. @@ -256,9 +269,9 @@ index d40843b..b92f03b 100644 +config("optimize") { } +config("xoptimize") { if (is_win) { - if (chrome_pgo_phase != 2) { - # Favor size over speed, /O1 must be before the common flags. -@@ -2055,7 +1982,8 @@ + cflags = [ "/O2" ] + common_optimize_on_cflags + +@@ -2430,7 +2317,8 @@ config("optimize") { } # Turn off optimizations. @@ -268,7 +281,7 @@ index d40843b..b92f03b 100644 if (is_win) { cflags = [ "/Od", # Disable optimization. -@@ -2095,7 +2023,8 @@ +@@ -2470,7 +2358,8 @@ config("no_optimize") { # Turns up the optimization level. On Windows, this implies whole program # optimization and link-time code generation which is very expensive and should # be used sparingly. @@ -278,7 +291,7 @@ index d40843b..b92f03b 100644 if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2128,7 +2057,8 @@ +@@ -2503,7 +2392,8 @@ config("optimize_max") { # # TODO(crbug.com/621335) - rework how all of these configs are related # so that we don't need this disclaimer. @@ -288,7 +301,7 @@ index d40843b..b92f03b 100644 if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2154,7 +2084,8 @@ +@@ -2529,7 +2419,8 @@ config("optimize_speed") { } } @@ -298,7 +311,7 @@ index d40843b..b92f03b 100644 cflags = [ "-O1" ] + common_optimize_on_cflags rustflags = [ "-Copt-level=1" ] ldflags = common_optimize_on_ldflags -@@ -2273,7 +2204,8 @@ +@@ -2662,7 +2553,8 @@ config("win_pdbaltpath") { } # Full symbols. @@ -308,7 +321,7 @@ index d40843b..b92f03b 100644 rustflags = [] if (is_win) { if (is_clang) { -@@ -2398,7 +2330,8 @@ +@@ -2811,7 +2703,8 @@ config("symbols") { # Minimal symbols. # This config guarantees to hold symbol for stack trace which are shown to user # when crash happens in unittests running on buildbot. @@ -318,7 +331,7 @@ index d40843b..b92f03b 100644 rustflags = [] if (is_win) { # Functions, files, and line tables only. -@@ -2470,7 +2403,8 @@ +@@ -2896,7 +2789,8 @@ config("minimal_symbols") { # This configuration contains function names only. That is, the compiler is # told to not generate debug information and the linker then just puts function # names in the final debug information. diff --git a/chromium-122-BookmarkNode-missing-operator.patch b/chromium-122-BookmarkNode-missing-operator.patch deleted file mode 100644 index 5f7cbdf..0000000 --- a/chromium-122-BookmarkNode-missing-operator.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 04866680f4f9a8475ae3795ad6ed59649ba478d7 -Author: Jose Dapena Paz -Date: Tue Jan 23 12:04:05 2024 +0000 - - libstdc++: fix static assertion in NodeUuidEquality - - libstdc++ equality checks in static assertion that it is possible to - compare for equality base::Uuid to BookmarkNode*. This was a missing - operator in NodeUuidEquality that this changeset adds. - - Bug: 957519 - Change-Id: Icc9809cb43d321f0b3e3394ef27ab55672aec5e7 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227686 - Reviewed-by: Mikel Astiz - Commit-Queue: José Dapena Paz - Cr-Commit-Position: refs/heads/main@{#1250753} - -diff --git a/components/bookmarks/browser/uuid_index.h b/components/bookmarks/browser/uuid_index.h -index 77cb1a1a54dd9..639d6fefcd831 100644 ---- a/components/bookmarks/browser/uuid_index.h -+++ b/components/bookmarks/browser/uuid_index.h -@@ -23,6 +23,10 @@ class NodeUuidEquality { - bool operator()(const BookmarkNode* n1, const base::Uuid& uuid2) const { - return n1->uuid() == uuid2; - } -+ -+ bool operator()(const base::Uuid& uuid1, const BookmarkNode* n2) const { -+ return uuid1 == n2->uuid(); -+ } - }; - - // Used to hash BookmarkNode instances by UUID. diff --git a/chromium-122-avoid-SFINAE-TypeConverter.patch b/chromium-122-avoid-SFINAE-TypeConverter.patch deleted file mode 100644 index a747117..0000000 --- a/chromium-122-avoid-SFINAE-TypeConverter.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/base/types/to_address.h.new b/base/types/to_address.h.new -new file mode 100644 -index 0000000..ac71b01 ---- /dev/null -+++ b/base/types/to_address.h -@@ -0,0 +1,40 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#ifndef BASE_TYPES_TO_ADDRESS_H_ -+#define BASE_TYPES_TO_ADDRESS_H_ -+ -+#include -+#include -+ -+// SFINAE-compatible wrapper for `std::to_address()`. -+// -+// The standard does not require `std::to_address()` to be SFINAE-compatible -+// when code attempts instantiation with non-pointer-like types, and libstdc++'s -+// implementation hard errors. For the sake of templated code that wants simple, -+// unified handling, Chromium instead uses this wrapper, which provides that -+// guarantee. This allows code to use "`to_address()` would be valid here" as a -+// constraint to detect pointer-like types. -+namespace base { -+ -+// Note that calling `std::to_address()` with a function pointer renders the -+// program ill-formed. -+template -+ requires(!std::is_function_v) -+constexpr T* to_address(T* p) noexcept { -+ return p; -+} -+ -+// These constraints cover the cases where `std::to_address()`'s fancy pointer -+// overload is well-specified. -+template -+ requires requires(const P& p) { std::pointer_traits

::to_address(p); } || -+ requires(const P& p) { p.operator->(); } -+constexpr auto to_address(const P& p) noexcept { -+ return std::to_address(p); -+} -+ -+} // namespace base -+ -+#endif // BASE_TYPES_TO_ADDRESS_H_ -diff --git a/mojo/public/cpp/bindings/type_converter.h b/mojo/public/cpp/bindings/type_converter.h.new -index 2eddbb0..317245f 100644 ---- a/mojo/public/cpp/bindings/type_converter.h -+++ b/mojo/public/cpp/bindings/type_converter.h -@@ -11,6 +11,8 @@ - #include - #include - -+#include "base/types/to_address.h" -+ - namespace mojo { - - // NOTE: When possible, please consider using StructTraits / UnionTraits / -@@ -99,16 +99,16 @@ - - template - requires requires(const U& obj) { -- not std::is_pointer_v; -- { mojo::ConvertTo(std::to_address(obj)) } -> std::same_as; -+ !std::is_pointer_v; -+ { mojo::ConvertTo(base::to_address(obj)) } -> std::same_as; - } - inline T ConvertTo(const U& obj) { -- return mojo::ConvertTo(std::to_address(obj)); -+ return mojo::ConvertTo(base::to_address(obj)); - } - - template - requires requires(const U& obj) { -- not std::is_pointer_v; -+ !std::is_pointer_v; - TypeConverter::Convert(obj); - } - inline T ConvertTo(const U& obj) { diff --git a/chromium-124-shims.patch b/chromium-124-shims.patch new file mode 100644 index 0000000..8cd637b --- /dev/null +++ b/chromium-124-shims.patch @@ -0,0 +1,215 @@ +diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_flags.gn src/build/linux/unbundle/absl_flags.gn +--- src/build/linux/unbundle.orig/absl_flags.gn ++++ src/build/linux/unbundle/absl_flags.gn +@@ -5,14 +5,36 @@ pkg_config("system_absl_flags") { + packages = [ "absl_flags" ] + } + ++pkg_config("absl_flags_config") { ++ packages = [ "absl_flags_config" ] ++} ++ + pkg_config("system_absl_flags_parse") { + packages = [ "absl_flags_parse" ] + } + ++pkg_config("system_absl_flags_reflection") { ++ packages = [ "absl_flags_reflection" ] ++} ++ + pkg_config("system_absl_flags_usage") { + packages = [ "absl_flags_usage" ] + } + ++shim_headers("flags_config_shim") { ++ root_path = "." ++ prefix = "absl/flags/" ++ headers = [ ++ "config.h", ++ "usage_config.h", ++ ] ++} ++ ++source_set("config") { ++ deps = [ ":flags_config_shim" ] ++ public_configs = [ ":absl_flags_config" ] ++} ++ + shim_headers("flag_shim") { + root_path = "." + prefix = "absl/flags/" +@@ -38,6 +60,20 @@ source_set("parse") { + public_configs = [ ":system_absl_flags_parse" ] + } + ++shim_headers("flags_reflection_shim") { ++ root_path = "." ++ prefix = "absl/flags/" ++ headers = [ ++ "internal/registry.h", ++ "reflection.h", ++ ] ++} ++ ++source_set("reflection") { ++ deps = [ ":flags_reflection_shim" ] ++ public_configs = [ ":system_absl_flags_reflection" ] ++} ++ + shim_headers("usage_shim") { + root_path = "." + prefix = "absl/flags/" +diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_log.gn src/build/linux/unbundle/absl_log.gn +--- src/build/linux/unbundle.orig/absl_log.gn ++++ src/build/linux/unbundle/absl_log.gn +@@ -13,9 +13,22 @@ pkg_config("system_absl_die_if_null") { + packages = [ "absl_die_if_null" ] + } + ++pkg_config("system_absl_check") { ++ packages = [ "absl_check" ] ++} ++ + pkg_config("system_absl_log") { + packages = [ "absl_log" ] + } ++ ++pkg_config("system_absl_log_globals") { ++ packages = [ "absl_log_globals" ] ++} ++ ++pkg_config("system_absl_log_initialize") { ++ packages = [ "absl_log_initialize" ] ++} ++ + shim_headers("absl_check_shim") { + root_path = "." + prefix = "absl/log/" +@@ -49,6 +62,39 @@ source_set("die_if_null") { + public_configs = [ ":system_absl_die_if_null" ] + } + ++shim_headers("check_shim") { ++ root_path = "." ++ prefix = "absl/log/" ++ headers = [ "check.h" ] ++} ++ ++source_set("check") { ++ deps = [ ":check_shim" ] ++ public_configs = [ ":system_absl_check" ] ++} ++ ++shim_headers("globals_shim") { ++ root_path = "." ++ prefix = "absl/log/" ++ headers = [ "globals.h" ] ++} ++ ++source_set("globals") { ++ deps = [ ":globals_shim" ] ++ public_configs = [ ":system_absl_log_globals" ] ++} ++ ++shim_headers("initialize_shim") { ++ root_path = "." ++ prefix = "absl/log/" ++ headers = [ "initialize.h" ] ++} ++ ++source_set("initialize") { ++ deps = [ ":initialize_shim" ] ++ public_configs = [ ":system_absl_log_initialize" ] ++} ++ + shim_headers("log_shim") { + root_path = "." + prefix = "absl/log/" +diff '--color=auto' -urp src/build/linux/unbundle.orig/libwebp.gn src/build/linux/unbundle/libwebp.gn +--- src/build/linux/unbundle.orig/libwebp.gn ++++ src/build/linux/unbundle/libwebp.gn +@@ -33,3 +33,7 @@ source_set("libwebp_webp") { + group("libwebp") { + deps = [ ":libwebp_webp" ] + } ++ ++source_set("libwebp_sharpyuv") { ++ # Unused in Chromium. Empty to enable building with old webp which does not have sharpyuv ++} +diff '--color=auto' -urp src/build/linux/unbundle.orig/re2.gn src/build/linux/unbundle/re2.gn +--- src/build/linux/unbundle.orig/re2.gn ++++ src/build/linux/unbundle/re2.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/c++/c++.gni") ++import("//build/config/linux/pkg_config.gni") + import("//build/shim_headers.gni") + + assert(!use_custom_libcxx, +@@ -10,6 +11,10 @@ assert(!use_custom_libcxx, + "use_custom_libcxx=true because the library's interface relies on " + + "libstdc++'s std::string and std::vector.") + ++pkg_config("re2_config") { ++ packages = [ "re2" ] ++} ++ + shim_headers("re2_shim") { + root_path = "src" + headers = [ +@@ -23,5 +28,5 @@ shim_headers("re2_shim") { + + source_set("re2") { + deps = [ ":re2_shim" ] +- libs = [ "re2" ] ++ public_configs = [ ":re2_config" ] + } +--- src/build/linux/unbundle/absl_container.gn.orig ++++ src/build/linux/unbundle/absl_container.gn +@@ -117,6 +117,8 @@ source_set("flat_hash_map_test") { + } + source_set("flat_hash_set_test") { + } ++source_set("hash_function_defaults_test") { ++} + source_set("inlined_vector_test") { + } + source_set("node_slot_policy_test") { +--- src/build/linux/unbundle/replace_gn_files.py.orig ++++ src/build/linux/unbundle/replace_gn_files.py +@@ -80,6 +80,7 @@ REPLACEMENTS = { + 'vulkan_memory_allocator' : 'third_party/vulkan_memory_allocator/BUILD.gn', + 'woff2': 'third_party/woff2/BUILD.gn', + 'zlib': 'third_party/zlib/BUILD.gn', ++ 'zstd': 'third_party/zstd/BUILD.gn', + } + + +--- /dev/null ++++ src/build/linux/unbundle/zstd.gn +@@ -0,0 +1,24 @@ ++import("//build/config/linux/pkg_config.gni") ++import("//build/shim_headers.gni") ++ ++pkg_config("system_zstd") { ++ packages = [ "libzstd" ] ++} ++ ++shim_headers("zstd_shim") { ++ root_path = "src/lib" ++ headers = [ ++ "zstd.h", ++ "zstd_errors.h", ++ ] ++} ++ ++source_set("decompress") { ++ deps = [ ":zstd_shim" ] ++ public_configs = [ ":system_zstd" ] ++} ++ ++source_set("headers") { ++ deps = [ ":zstd_shim" ] ++ public_configs = [ ":system_zstd" ] ++} diff --git a/chromium-98-EnumTable-crash.patch b/chromium-98-EnumTable-crash.patch deleted file mode 100644 index 9c377b7..0000000 --- a/chromium-98-EnumTable-crash.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h -index 842553a..89de703 100644 ---- a/components/media_router/common/providers/cast/channel/enum_table.h -+++ b/components/media_router/common/providers/cast/channel/enum_table.h -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - - #include "base/check_op.h" - #include "base/notreached.h" -@@ -187,7 +188,6 @@ class - inline constexpr GenericEnumTableEntry(int32_t value); - inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); - -- GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; - GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; - - private: -@@ -253,7 +253,6 @@ class EnumTable { - constexpr Entry(E value, base::StringPiece str) - : GenericEnumTableEntry(static_cast(value), str) {} - -- Entry(const Entry&) = delete; - Entry& operator=(const Entry&) = delete; - }; - -@@ -312,15 +311,14 @@ class EnumTable { - if (is_sorted_) { - const std::size_t index = static_cast(value); - if (ANALYZER_ASSUME_TRUE(index < data_.size())) { -- const auto& entry = data_.begin()[index]; -+ const auto& entry = data_[index]; - if (ANALYZER_ASSUME_TRUE(entry.has_str())) - return entry.str(); - } - return absl::nullopt; - } - return GenericEnumTableEntry::FindByValue( -- reinterpret_cast(data_.begin()), -- data_.size(), static_cast(value)); -+ &data_[0], data_.size(), static_cast(value)); - } - - // This overload of GetString is designed for cases where the argument is a -@@ -348,8 +346,7 @@ class EnumTable { - // enum value directly. - absl::optional GetEnum(base::StringPiece str) const { - auto* entry = GenericEnumTableEntry::FindByString( -- reinterpret_cast(data_.begin()), -- data_.size(), str); -+ &data_[0], data_.size(), str); - return entry ? static_cast(entry->value) : absl::optional(); - } - -@@ -364,7 +361,7 @@ class EnumTable { - // Align the data on a cache line boundary. - alignas(64) - #endif -- std::initializer_list data_; -+ const std::vector data_; - bool is_sorted_; - - constexpr EnumTable(std::initializer_list data, bool is_sorted) -@@ -376,8 +373,8 @@ class EnumTable { - - for (std::size_t i = 0; i < data.size(); i++) { - for (std::size_t j = i + 1; j < data.size(); j++) { -- const Entry& ei = data.begin()[i]; -- const Entry& ej = data.begin()[j]; -+ const Entry& ei = data[i]; -+ const Entry& ej = data[j]; - DCHECK(ei.value != ej.value) - << "Found duplicate enum values at indices " << i << " and " << j; - DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) diff --git a/chromium-gcc11.patch b/chromium-gcc11.patch deleted file mode 100644 index 0711ead..0000000 --- a/chromium-gcc11.patch +++ /dev/null @@ -1,37 +0,0 @@ -Index: electron-17.1.0/third_party/perfetto/src/trace_processor/db/column.cc -=================================================================== ---- electron-17.1.0.orig/third_party/perfetto/src/trace_processor/db/column.cc 2022-03-07 17:28:24.814737660 +0100 -+++ electron-17.1.0/third_party/perfetto/src/trace_processor/db/column.cc 2022-03-09 08:25:10.346569313 +0100 -@@ -14,6 +14,7 @@ - * See the License for the specific language governing permissions and - * limitations under the License. - */ -+#include - #include "src/trace_processor/db/column.h" - - #include "perfetto/base/logging.h" -Index: electron-17.1.0/ui/gtk/gtk_key_bindings_handler.cc -=================================================================== ---- electron-17.1.0.orig/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc 2022-03-07 17:20:31.788817015 +0100 -+++ electron-17.1.0/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc 2022-03-09 08:25:10.346569313 +0100 -@@ -2,6 +2,7 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include - #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" - - #include "base/observer_list.h" -Index: electron-17.1.0/components/bookmarks/browser/base_bookmark_model_observer.cc -=================================================================== ---- electron-17.1.0.orig/components/bookmarks/browser/base_bookmark_model_observer.cc 2022-03-07 17:20:33.308823187 +0100 -+++ electron-17.1.0/components/bookmarks/browser/base_bookmark_model_observer.cc 2022-03-09 08:25:10.346569313 +0100 -@@ -2,6 +2,8 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include -+ - #include "components/bookmarks/browser/base_bookmark_model_observer.h" - - namespace bookmarks { diff --git a/chromium-remove-bundled-roboto-font.patch b/chromium-remove-bundled-roboto-font.patch index 5e32653..90335e6 100644 --- a/chromium-remove-bundled-roboto-font.patch +++ b/chromium-remove-bundled-roboto-font.patch @@ -20,7 +20,7 @@ This font is already available in opensuse and can be installed systemwide - } public_deps = [ - "cr_elements:build_grdp", + "cr_components/commerce:build_grdp", 'roboto.css' -> 'roboto.css.new' --- a/ui/webui/resources/css/roboto.css 2022-06-15 15:58:23.846426661 +0200 +++ b/ui/webui/resources/css/roboto.css 2022-06-21 15:53:08.931243442 +0200 diff --git a/crashpad-use-system-abseil.patch b/crashpad-use-system-abseil.patch index 65b08b1..807c334 100644 --- a/crashpad-use-system-abseil.patch +++ b/crashpad-use-system-abseil.patch @@ -1,13 +1,11 @@ --- a/components/crash/core/app/crashpad.cc +++ b/components/crash/core/app/crashpad.cc -@@ -28,8 +28,8 @@ +@@ -28,7 +28,7 @@ #include "build/chromeos_buildflags.h" #include "components/crash/core/app/crash_reporter_client.h" #include "components/crash/core/common/crash_key.h" -#include "third_party/abseil-cpp/absl/base/internal/raw_logging.h" --#include "third_party/abseil-cpp/absl/types/optional.h" +#include -+#include #include "third_party/crashpad/crashpad/client/annotation.h" #include "third_party/crashpad/crashpad/client/annotation_list.h" #include "third_party/crashpad/crashpad/client/crash_report_database.h" @@ -20,4 +18,4 @@ +#endif namespace crash_reporter { - namespace { + #if BUILDFLAG(IS_IOS) diff --git a/create_tarball.sh b/create_tarball.sh index 50be806..ab669fc 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -214,7 +214,6 @@ keeplibs=( third_party/devtools-frontend/src/front_end/third_party #various javascript code compiled into chrome, see README.md third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs - third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n # javascript third_party/devtools-frontend/src/third_party/i18n #javascript third_party/devtools-frontend/src/third_party/typescript #Chromium added code third_party/distributed_point_functions #not in any distro @@ -223,6 +222,7 @@ keeplibs=( third_party/electron_node #Integral part of electron third_party/emoji-segmenter #not available as a shared library third_party/fdlibm #derived code, not vendored dep + third_party/fp16 #Fedora 41 has it (but an old version?) Not in openSUSE. Header-only library thus we're not debundling it rn. third_party/hunspell #heavily forked version third_party/inspector_protocol #integral part of chrome third_party/ipcz #not in any distro diff --git a/disable-catapult.patch b/disable-catapult.patch index 1137a48..2595e28 100644 --- a/disable-catapult.patch +++ b/disable-catapult.patch @@ -181,7 +181,7 @@ author: Michael Gilbert deps += [ "//chrome/browser/resources:component_extension_resources", @@ -199,7 +197,6 @@ template("chrome_extra_paks") { - "//chrome/browser/resources:dev_ui_paks", + "//chrome/browser/resources/lens/overlay:resources", "//chrome/browser/resources/search_engine_choice:resources", "//content/browser/devtools:devtools_resources", - "//content/browser/tracing:resources", diff --git a/disable-webspeech.patch b/disable-webspeech.patch index ef38f33..5dccda4 100644 --- a/disable-webspeech.patch +++ b/disable-webspeech.patch @@ -38,7 +38,7 @@ index 19b45dc1268..67dcd7752d0 100644 "speech/speech_synthesis_impl.cc", "speech/speech_synthesis_impl.h", "speech/tts_controller_impl.cc", -@@ -2956,17 +2951,6 @@ source_set("browser") { +@@ -2956,19 +2951,6 @@ source_set("browser") { "service_worker/service_worker_usb_delegate_observer.cc", "service_worker/service_worker_usb_delegate_observer.h", @@ -49,6 +49,8 @@ index 19b45dc1268..67dcd7752d0 100644 - "speech/endpointer/energy_endpointer.h", - "speech/endpointer/energy_endpointer_params.cc", - "speech/endpointer/energy_endpointer_params.h", +- "speech/network_speech_recognition_engine_impl.cc", +- "speech/network_speech_recognition_engine_impl.h", - "speech/speech_recognition_engine.cc", - "speech/speech_recognition_engine.h", - "speech/speech_recognizer_impl.cc", diff --git a/electron-16-std-vector-non-const.patch b/electron-16-std-vector-non-const.patch index 2bf0163..8abbf2f 100644 --- a/electron-16-std-vector-non-const.patch +++ b/electron-16-std-vector-non-const.patch @@ -4,13 +4,14 @@ Index: electron-17.1.0/chrome/browser/process_singleton.h +++ electron-17.1.0/chrome/browser/process_singleton.h 2022-03-09 08:29:01.682773127 +0100 @@ -102,7 +102,7 @@ class ProcessSingleton { using NotificationCallback = - base::RepeatingCallback additional_data)>; + const std::vector additional_data)>; #if BUILDFLAG(IS_WIN) ProcessSingleton(const std::string& program_name, + Index: electron-17.1.0/chrome/browser/process_singleton_posix.cc =================================================================== --- electron-17.1.0.orig/chrome/browser/process_singleton_posix.cc 2022-03-07 17:39:06.993345117 +0100 @@ -88,20 +89,20 @@ Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.cc +++ electron-17.1.0/electron/shell/browser/api/electron_api_app.cc 2022-03-09 08:29:01.682773127 +0100 @@ -517,10 +517,10 @@ bool NotificationCallbackWrapper( const base::RepeatingCallback< - void(const base::CommandLine& command_line, + void(base::CommandLine command_line, const base::FilePath& current_directory, - const std::vector additional_data)>& callback, + const std::vector additional_data)>& callback, - const base::CommandLine& cmd, + base::CommandLine cmd, const base::FilePath& cwd, - const std::vector additional_data) { + const std::vector additional_data) { // Make sure the callback is called after app gets ready. if (Browser::Get()->is_ready()) { - callback.Run(cmd, cwd, std::move(additional_data)); + callback.Run(std::move(cmd), cwd, std::move(additional_data)); @@ -1081,7 +1081,7 @@ std::string App::GetLocaleCountryCode() - void App::OnSecondInstance(const base::CommandLine& cmd, + void App::OnSecondInstance(base::CommandLine cmd, const base::FilePath& cwd, - const std::vector additional_data) { + const std::vector additional_data) { @@ -114,7 +115,7 @@ Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.h +++ electron-17.1.0/electron/shell/browser/api/electron_api_app.h 2022-03-09 08:29:01.682773127 +0100 @@ -194,7 +194,7 @@ class App : public ElectronBrowserClient std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const; - void OnSecondInstance(const base::CommandLine& cmd, + void OnSecondInstance(base::CommandLine cmd, const base::FilePath& cwd, - const std::vector additional_data); + const std::vector additional_data); diff --git a/electron-29.4.3.tar.zst b/electron-29.4.3.tar.zst deleted file mode 100644 index 3a4dcaa..0000000 --- a/electron-29.4.3.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f98d6f6f8f513591eb22f8afbc191b496059ce2c56b957fc50e769d6fbb0c84 -size 573606884 diff --git a/electron-30.2.0.tar.zst b/electron-30.2.0.tar.zst new file mode 100644 index 0000000..6d7a9f4 --- /dev/null +++ b/electron-30.2.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e78d7110ace88fd42ca0f0a89875ea5a24d53f7cea3cde7671c83e6863e5d3af +size 587543819 diff --git a/enable_stack_trace_line_numbers-symbol_level.patch b/enable_stack_trace_line_numbers-symbol_level.patch new file mode 100644 index 0000000..93bca3e --- /dev/null +++ b/enable_stack_trace_line_numbers-symbol_level.patch @@ -0,0 +1,25 @@ +Reducing symbol_level is a kludge and should have no effect on generated code. + +--- src/base/BUILD.gn.orig ++++ src/base/BUILD.gn +@@ -2531,11 +2531,6 @@ buildflag_header("debugging_buildflags") + enable_commandline_sequence_checks = + (is_debug || dcheck_always_on) && !is_android + +- if (enable_stack_trace_line_numbers) { +- assert( +- symbol_level > 0, +- "symbol_level must be set to greater than 0 for source line numbers.") +- } + + flags = [ + "DCHECK_IS_CONFIGURABLE=$dcheck_is_configurable", +--- src/build/config/logging.gni.orig ++++ src/build/config/logging.gni +@@ -11,5 +11,5 @@ declare_args() { + enable_log_error_not_reached = + is_chromeos_ash && !(is_debug || dcheck_always_on) + +- enable_stack_trace_line_numbers = symbol_level > 0 ++ enable_stack_trace_line_numbers = true + } diff --git a/first_party_sets_handler_database_helper-missing-optional.patch b/first_party_sets_handler_database_helper-missing-optional.patch new file mode 100644 index 0000000..a2d494b --- /dev/null +++ b/first_party_sets_handler_database_helper-missing-optional.patch @@ -0,0 +1,31 @@ +From 072b9f3bc340020325cf3dd7bff1991cd22de171 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 19 Mar 2024 16:27:55 +0000 +Subject: [PATCH] IWYU: missing include for std::optional usage in + first_party_sets_handler_database_helper.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: Ia644d2e6baa904190d162575dd16264e66ea227e +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377063 +Reviewed-by: Chris Fredrickson +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1274977} +--- + .../first_party_sets/first_party_sets_handler_database_helper.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/content/browser/first_party_sets/first_party_sets_handler_database_helper.h b/content/browser/first_party_sets/first_party_sets_handler_database_helper.h +index a12af718abda0..92afb98d64ea4 100644 +--- a/content/browser/first_party_sets/first_party_sets_handler_database_helper.h ++++ b/content/browser/first_party_sets/first_party_sets_handler_database_helper.h +@@ -6,6 +6,7 @@ + #define CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_HANDLER_DATABASE_HELPER_H_ + + #include ++#include + #include + #include + #include diff --git a/gpu_adapter_info-missing-optional.patch b/gpu_adapter_info-missing-optional.patch new file mode 100644 index 0000000..e79a07e --- /dev/null +++ b/gpu_adapter_info-missing-optional.patch @@ -0,0 +1,32 @@ +From 15e24abc1646ad9984923234a041cd0c3b8b1607 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 19 Mar 2024 16:21:06 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::optional in + gpu_adapter_info.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: I42d6c9f99ea7718fa87267ebcf3368d0f46f5053 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374260 +Commit-Queue: José Dapena Paz +Reviewed-by: Austin Eng +Cr-Commit-Position: refs/heads/main@{#1274974} +--- + third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h b/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h +index 70b15d5c055aa..2084afbe6e877 100644 +--- a/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h ++++ b/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h +@@ -5,6 +5,8 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_ADAPTER_INFO_H_ + #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_ADAPTER_INFO_H_ + ++#include ++ + #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" diff --git a/grid_sizing_tree-Wchanges-meaning.patch b/grid_sizing_tree-Wchanges-meaning.patch deleted file mode 100644 index 0a87dc1..0000000 --- a/grid_sizing_tree-Wchanges-meaning.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 05a74771fed5491740588ec7b39ba64a7b710013 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 1 Feb 2024 17:34:38 +0000 -Subject: [PATCH] GCC: avoid clash between getter and type in - grid_sizing_tree.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Rename GridSubsizingTree::GridItems getter to GetGridItems to avoid -type clash. - -Bug: 819294 -Change-Id: I4112929d9f85dc4573002b429cc982d50085d3c9 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5224147 -Reviewed-by: Xianzhu Wang -Commit-Queue: Xianzhu Wang -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1255116} ---- - .../core/layout/grid/grid_layout_algorithm.cc | 13 +++++++------ - .../renderer/core/layout/grid/grid_sizing_tree.h | 2 +- - 2 files changed, 8 insertions(+), 7 deletions(-) - -diff --git a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h -index 45d55e2b36da4..2148ea9ea0657 100644 ---- a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h -+++ b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h -@@ -188,7 +188,7 @@ class GridSizingSubtree - /* subtree_root */ grid_tree_->LookupSubgridIndex(subgrid_data)); - } - -- GridItems& GridItems() const { -+ ::blink::GridItems& GridItems() const { - DCHECK(grid_tree_); - return grid_tree_->At(subtree_root_).grid_items; - } diff --git a/harfbuzz-replace-chromium-scoped-type.patch b/harfbuzz-replace-chromium-scoped-type.patch index f26d938..4d3692b 100644 --- a/harfbuzz-replace-chromium-scoped-type.patch +++ b/harfbuzz-replace-chromium-scoped-type.patch @@ -439,15 +439,6 @@ index caf5d49..0d4b6f9 100644 #include "base/check_op.h" #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" #include "third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h" -@@ -81,7 +83,7 @@ - return vertical_data_; - } - -- HbScoped unscaled_font_; -+ hb::unique_ptr unscaled_font_; - SkFont font_; - - // Capture these scaled fallback metrics from FontPlatformData so that a diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn index 522e164d..4b64e1b 100644 --- a/third_party/harfbuzz-ng/BUILD.gn diff --git a/hit_test_request-missing-optional.patch b/hit_test_request-missing-optional.patch deleted file mode 100644 index 50425ac..0000000 --- a/hit_test_request-missing-optional.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3a75d7f8dc3a08a38dd893031f8996b91a00764b Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 23 Jan 2024 17:55:15 +0000 -Subject: [PATCH] IWYU: usage of std::optional in hit_test_request.h requires - include - -Bug: 957519 -Change-Id: I1ec32af603720d13bfa4e22e20142459802284b4 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227329 -Reviewed-by: Ian Kilpatrick -Commit-Queue: Ian Kilpatrick -Cr-Commit-Position: refs/heads/main@{#1250917} ---- - third_party/blink/renderer/core/layout/hit_test_request.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/renderer/core/layout/hit_test_request.h b/third_party/blink/renderer/core/layout/hit_test_request.h -index c33144dc975b6..38968126fe520 100644 ---- a/third_party/blink/renderer/core/layout/hit_test_request.h -+++ b/third_party/blink/renderer/core/layout/hit_test_request.h -@@ -23,6 +23,8 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_HIT_TEST_REQUEST_H_ - #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_HIT_TEST_REQUEST_H_ - -+#include -+ - #include "base/functional/callback.h" - #include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/heap/member.h" diff --git a/libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch b/libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch new file mode 100644 index 0000000..981577f --- /dev/null +++ b/libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch @@ -0,0 +1,13 @@ +--- src/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc.orig 2024-05-29 12:13:50.205359130 +0200 ++++ src/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc 2024-05-29 23:55:59.239008160 +0200 +@@ -311,8 +311,10 @@ int LibaomAv1Encoder::InitEncode(const V + + if (codec_settings->mode == VideoCodecMode::kRealtimeVideo && + encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) { ++#ifdef AOM_CTRL_AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, + max_consec_frame_drop_); ++#endif + } + + if (cfg_.g_threads == 8) { diff --git a/licenses.py-FileNotFoundError.patch b/licenses.py-FileNotFoundError.patch new file mode 100644 index 0000000..fbb8a64 --- /dev/null +++ b/licenses.py-FileNotFoundError.patch @@ -0,0 +1,33 @@ +[154/40125] python3 ../../tools/licenses/licenses.py --target-os=linux --depfile gen/components/resources/about_credits.d credits gen/components/resources/about_credits.html +FAILED: gen/components/resources/about_credits.html +python3 ../../tools/licenses/licenses.py --target-os=linux --depfile gen/components/resources/about_credits.d credits gen/components/resources/about_credits.html +Traceback (most recent call last): + File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1445, in + sys.exit(main()) + ^^^^^^ + File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1428, in main + if not GenerateCredits( + ^^^^^^^^^^^^^^^^ + File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1069, in GenerateCredits + directory_metadata, _ = ParseDir(path, + ^^^^^^^^^^^^^^ + File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 670, in ParseDir + if not os.listdir(os.path.join(root, path)): + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/src/third_party/angle/src/common/third_party/xxhash' + + +--- src/tools/licenses/licenses.py.orig 2024-05-29 12:20:01.514877976 +0200 ++++ src/tools/licenses/licenses.py 2024-05-29 22:54:04.691863557 +0200 +@@ -667,7 +667,10 @@ def ParseDir(path, + return [], [] + + # gclient creates empty directories for conditionally downloaded submodules. +- if not os.listdir(os.path.join(root, path)): ++ try: ++ if not os.listdir(os.path.join(root, path)): ++ return [], [] ++ except FileNotFoundError: #This gets thrown if directory is missing instead of empty. + return [], [] + + # Get the metadata values, from diff --git a/material_color_utilities-tones-missing-round.patch b/material_color_utilities-tones-missing-round.patch deleted file mode 100644 index 9c08f27..0000000 --- a/material_color_utilities-tones-missing-round.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/third_party/material_color_utilities/src/cpp/palettes/tones.cc.old 2023-10-11 11:30:46.080385500 +0200 -+++ src/third_party/material_color_utilities/src/cpp/palettes/tones.cc 2023-10-11 21:04:10.234128500 +0200 -@@ -16,6 +16,7 @@ - - #include "cpp/palettes/tones.h" - -+#include - #include "cpp/cam/cam.h" - #include "cpp/cam/hct.h" - diff --git a/nested-nested-nested-nested-nested-nested-regex-patterns.patch b/nested-nested-nested-nested-nested-nested-regex-patterns.patch deleted file mode 100644 index 162ab9a..0000000 --- a/nested-nested-nested-nested-nested-nested-regex-patterns.patch +++ /dev/null @@ -1,44 +0,0 @@ -description: fix build error when building with clang & GNU libstdc++ -author: Stephan Hartmann - -Apparently this doesn't happen with the embedded clang, but we get this: - -In file included from ../../components/autofill/core/browser/form_parsing/regex_patterns.cc:5: -In file included from ../../components/autofill/core/browser/form_parsing/regex_patterns.h:8: -In file included from ../../base/containers/span.h:10: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/algorithm:74: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/pstl/glue_algorithm_defs.h:13: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/functional:54: -In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/tuple:39: -/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/array:268:52: fatal error: instantiating fold expression with 303 arguments exceeded expression nesting limit of 256 - -> array && ...), _Tp>, - ~~~~~~~~~~~~~~~~~~~~~~~~^~~~ -gen/components/autofill/core/browser/form_parsing/regex_patterns_inl.h:77:22: note: while substituting deduced template arguments into function template '' [with _Tp = autofill::MatchingPattern, _Up = + +- New upstream release 30.2.0 + * Node 20.15.0 + * Enabled the Windows Control Overlay API on Linux. + * Expose systemPreferences to utilityProcess. + * Fixed a focus issue when calling BrowserWindow.setTopBrowserView. + * Fixed an issue where fetch-dependent interfaces could be missing in Web Workers with nodeIntegrationInWorker enabled. + * Fixed an issue where control could fail to return properly after saving a dialog using showOpenDialogSync on Linux. + * Fixes an issue where the user-specified default path did not work in some circumstances when using Linux dialogs. + * Fixes potentially incorrect exit code in UtilityProcess. + * (Leap 15.5) Fix heap buffer overflow in libaom (CVE-2024-5493 bsc#1225690) + * Security fixes for V8: CVE-2024-6100, CVE-2024-6101 (bsc#1226504) + * Fix use after free in Swiftshader (CVE-2024-6291 bsc#1226933) + +------------------------------------------------------------------- +Tue Jul 9 10:04:38 UTC 2024 - Bruno Pitrus + +- Update to 30.1.2 XXXFIXMEXXX + * ABI break: NODE_MODULE_VERSION is now 123 + * Chromium 124.0.6367.243 + * Node 20.14.0 + * V8 12.4 + * Added WebContentsView and BaseWindow, replacing the now-deprecated BrowserView APIs. + * cross-origin iframes now use Permission Policy to access features + * Removed: The --disable-color-correct-rendering switch + * The inputFieldType property in the context-menu params has been removed + * Removed: process.getIOCounters() + * see https://www.electronjs.org/blog/electron-30-0 and https://github.com/electron/electron/releases/tag/v30.0.0 for more +- Fedora: use bundled simdutf as the system version is too old +- Drop no longer needed patches + * chromium-122-avoid-SFINAE-TypeConverter.patch + * chromium-122-BookmarkNode-missing-operator.patch + * chromium-98-EnumTable-crash.patch + * chromium-gcc11.patch + * CVE-2024-30260-undici-clear-proxy-authorization.patch + * CVE-2024-30261-undici-fetch-integrity.patch + * ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch + * grid_sizing_tree-Wchanges-meaning.patch + * hit_test_request-missing-optional.patch + * InternalAllocator-too-many-initializers.patch + * material_color_utilities-tones-missing-round.patch + * nested-nested-nested-nested-nested-nested-regex-patterns.patch + * perfetto-numeric_storage-double_t.patch + * plus_address_types-missing-optional.patch + * race_network_request_write_buffer_manager-missing-optional.patch + * resolution_monitor-missing-bitset.patch + * script_promise_resolver-explicit-specialization.patch + * search_engine_choice_service-missing-optional.patch + * text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch + * v8-instance-type-inl-constexpr-used-before-its-definition.patch +- Drop no longer needed -Wno-error=narrowing from CXXFLAGS +- Add patches to fix build + * chromium-124-shims.patch + * enable_stack_trace_line_numbers-symbol_level.patch + * angle-FramebufferVk-powf.patch + * licenses.py-FileNotFoundError.patch + * span_reader-missing-optional.patch + * bitset-missing-uint8_t-memcpy.patch + * temporal_scalability_id_extractor-missing-bitset.patch + * gpu_adapter_info-missing-optional.patch + * first_party_sets_handler_database_helper-missing-optional.patch + * async_iterable-forwarding.patch + * preview_cancel_reason-missing-string.patch + * script_streamer-atomic-include.patch +- Add -Wno-packed-not-aligned -Wno-address to CXXFLAGS to suppress build logspam +- Add libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch to build with old libaom +- Add backported DesktopNativeWidgetAura-HandleActivationChanged-crash.patch +- Revert upstream changes which introduce a use-after-free bug causing crashes (bsc#1224178 deb#1067886) + * bad-font-gc0000.patch + * bad-font-gc000.patch + * bad-font-gc00.patch + * bad-font-gc0.patch + * bad-font-gc11.patch + * bad-font-gc1.patch + * bad-font-gc2.patch + * bad-font-gc3.patch + + ------------------------------------------------------------------- Thu Jul 4 04:27:14 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 9058081..7371520 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -22,7 +22,7 @@ %define mod_name electron # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json -%define abi_version 121 +%define abi_version 123 # Do not provide libEGL.so, etc… %define __provides_exclude ^lib.*\\.so.*$ @@ -141,11 +141,9 @@ BuildArch: i686 %if 0%{?fedora} %bcond_without system_llhttp %bcond_without system_histogram -%bcond_without system_simdutf %else %bcond_with system_llhttp %bcond_with system_histogram -%bcond_with system_simdutf %endif @@ -155,6 +153,9 @@ BuildArch: i686 %bcond_with system_vma %endif +# requires `run_convert_utf8_to_latin1_with_errors` +%bcond_with system_simdutf + #requires `imageSequenceTrackPresent` and `enableParsingGainMapMetadata` both of which are only in post-1.0.0 nightlies %bcond_with system_avif @@ -211,7 +212,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 29.4.3 +Version: 30.2.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -256,6 +257,7 @@ Patch80: icon.patch Patch82: node-compiler.patch Patch84: aarch64-Xclang.patch Patch85: devtools-frontend-compress_files-oom.patch +Patch86: enable_stack_trace_line_numbers-symbol_level.patch # PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors, @@ -307,10 +309,10 @@ Patch1078: system-simdutf.patch Patch1079: system-libm.patch Patch1080: system-yuv.patch Patch1081: chromium-122-abseil-shims.patch +Patch1082: chromium-124-shims.patch # PATCHES to fix interaction with third-party software -Patch2004: chromium-gcc11.patch Patch2010: chromium-93-ffmpeg-4.4.patch #Since ffmpeg 5, there is no longer first_dts member in AVFormat. Chromium upstream (and Tumbleweed) patches ffmpeg to add a av_stream_get_first_dts function. @@ -346,44 +348,45 @@ Source2047: bundled-minizip.patch Patch2047: bundled-minizip.patch %endif Patch2048: absl2023-encapsulated_web_transport-StrCat.patch +Patch2049: libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch +# bsc#1224178 deb#1067886 +Patch2050: bad-font-gc0000.patch +Patch2051: bad-font-gc000.patch +Patch2052: bad-font-gc00.patch +Patch2053: bad-font-gc0.patch +Patch2054: bad-font-gc11.patch +Patch2055: bad-font-gc1.patch +Patch2056: bad-font-gc2.patch +Patch2057: bad-font-gc3.patch # PATCHES that should be submitted upstream verbatim or near-verbatim -Patch3016: chromium-98-EnumTable-crash.patch # Fix blink nodestructor Patch3023: electron-13-blink-gcc-ambiguous-nodestructor.patch Patch3027: electron-16-freetype-visibility-list.patch Patch3028: electron-16-third_party-symbolize-missing-include.patch # From https://git.droidware.info/wchen342/ungoogled-chromium-fedora Patch3033: chromium-94.0.4606.71-InkDropHost-crash.patch -# https://salsa.debian.org/chromium-team/chromium/-/blob/456851fc808b2a5b5c762921699994e957645917/debian/patches/upstream/nested-nested-nested-nested-nested-nested-regex-patterns.patch -Patch3064: nested-nested-nested-nested-nested-nested-regex-patterns.patch Patch3080: compact_enc_det_generated_tables-Wnarrowing.patch Patch3096: remove-date-reproducible-builds.patch -Patch3118: material_color_utilities-tones-missing-round.patch -Patch3126: perfetto-numeric_storage-double_t.patch -Patch3129: text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch -Patch3132: v8-instance-type-inl-constexpr-used-before-its-definition.patch Patch3133: swiftshader-llvm18-LLVMReactor-getInt8PtrTy.patch Patch3134: swiftshader-llvm18-LLVMJIT-Host.patch Patch3135: swiftshader-llvm18-LLVMJIT-CodeGenOptLevel.patch -Patch3136: CVE-2024-30260-undici-clear-proxy-authorization.patch -Patch3137: CVE-2024-30261-undici-fetch-integrity.patch Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch -Patch3139: chromium-122-avoid-SFINAE-TypeConverter.patch -Patch3140: plus_address_types-missing-optional.patch -Patch3141: chromium-122-BookmarkNode-missing-operator.patch -Patch3142: search_engine_choice_service-missing-optional.patch -Patch3143: race_network_request_write_buffer_manager-missing-optional.patch Patch3144: mt21_util-flax-vector-conversions.patch -Patch3145: script_promise_resolver-explicit-specialization.patch -Patch3146: hit_test_request-missing-optional.patch -Patch3147: grid_sizing_tree-Wchanges-meaning.patch -Patch3148: resolution_monitor-missing-bitset.patch Patch3149: boringssl-internal-addc-cxx.patch -Patch3150: InternalAllocator-too-many-initializers.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch Patch3152: fake_ssl_socket_client-Wlto-type-mismatch.patch -Patch3153: ElectronDesktopWindowTreeHostLinux-OnWindowTiledStateChanged-crash.patch +Patch3153: angle-FramebufferVk-powf.patch +Patch3154: licenses.py-FileNotFoundError.patch +Patch3155: span_reader-missing-optional.patch +Patch3156: bitset-missing-uint8_t-memcpy.patch +Patch3157: temporal_scalability_id_extractor-missing-bitset.patch +Patch3158: gpu_adapter_info-missing-optional.patch +Patch3159: first_party_sets_handler_database_helper-missing-optional.patch +Patch3160: async_iterable-forwarding.patch +Patch3161: preview_cancel_reason-missing-string.patch +Patch3162: script_streamer-atomic-include.patch +Patch3163: DesktopNativeWidgetAura-HandleActivationChanged-crash.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -456,7 +459,7 @@ BuildRequires: (python3-setuptools if python3 >= 3.12) %endif BuildRequires: python%{PYVER}-six %if %{with system_simdutf} -BuildRequires: simdutf-devel >= 3 +BuildRequires: simdutf-devel >= 3.2.17 %endif BuildRequires: snappy-devel %if 0%{?suse_version} @@ -521,7 +524,7 @@ BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(glproto) -BuildRequires: pkgconfig(gtest) +BuildRequires: pkgconfig(gtest) >= 1.12 BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(harfbuzz) >= 3 %if %{with harfbuzz_5} @@ -584,6 +587,7 @@ BuildRequires: pkgconfig(libxxhash) # needs I410ToI420 BuildRequires: pkgconfig(libyuv) >= 1855 %endif +BuildRequires: pkgconfig(libzstd) %if %{with system_minizip} %if 0%{?fedora} BuildRequires: minizip-compat-devel @@ -839,19 +843,16 @@ export CFLAGS="${CXXFLAGS}" # multiple times throughout the codebase (including generated code). It is not possible to redefine the macro to __builtin_unreachable, # as it has an astonishing syntax, behaving like an ostream (in debug builds it is supposed to trap and print an error message) export CXXFLAGS="${CXXFLAGS} -Wno-error=return-type" -# [ 8947s] gen/third_party/blink/renderer/bindings/modules/v8/v8_gpu_sampler_descriptor.h:212:39: error: narrowing conversion of '4294967295' from 'unsigned int' to 'float' [-Wnarrowing] -# [ 8947s] 212 | float member_lod_max_clamp_{0xffffffff}; -# I have no idea where this code is generated, and it is not something that needs a critical fix. -# Remove this once upstream issues a proper patch. -export CXXFLAGS="${CXXFLAGS} -Wno-error=narrowing" # A bunch of memcpy'ing of JSObject in V8 runs us into “Logfile got too big, killed job.” export CXXFLAGS="${CXXFLAGS} -Wno-class-memaccess" +# Warning spam from generated mojom code again makes the log too big +export CXXFLAGS="${CXXFLAGS} -Wno-packed-not-aligned -Wno-address" # REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" -%ifnarch x86_64 %x86_64 +%ifarch %ix86 %arm aarch64 export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %endif @@ -900,7 +901,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=4 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=3 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" @@ -935,6 +936,7 @@ gn_system_libraries=( snappy woff2 zlib + zstd ) %if %{with system_abseil} @@ -1137,7 +1139,6 @@ myconf_gn+=' content_enable_legacy_ipc=true' #do not build webextensions support myconf_gn+=' enable_electron_extensions=false' -myconf_gn+=' enable_extensions_legacy_ipc=false' # The option below get overriden by whatever is in CFLAGS/CXXFLAGS, so they affect only C++ code. # symbol_level=2 is full debug @@ -1145,7 +1146,12 @@ myconf_gn+=' enable_extensions_legacy_ipc=false' # symbol_level=0 no debuginfo (only function names in private symbols) # blink (HTML engine) and v8 (js engine) are template-heavy, trying to compile them with full debug leads to linker errors due to inherent limitations of the DWARF format. %ifnarch %ix86 %arm aarch64 +%if 0%{?fedora} +# [10675s] lto1: internal compiler error: in build_abbrev_table, at dwarf2out.cc:9244 +myconf_gn+=' symbol_level=1' +%else myconf_gn+=' symbol_level=2' +%endif myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' %endif @@ -1163,6 +1169,9 @@ myconf_gn+=' blink_symbol_level=0' myconf_gn+=' v8_symbol_level=0' %endif +#symbol_level should not affect generated code. +myconf_gn+=' enable_stack_trace_line_numbers=true' + # do not build some chrome features not used by electron # (some of these only go to buildflag_headers and are dead code rn, but disabling them preemptively as long as they're visible) @@ -1178,6 +1187,7 @@ myconf_gn+=" enable_captive_portal_detection=false" myconf_gn+=" enable_browser_speech_service=false" myconf_gn+=" enable_speech_service=false" myconf_gn+=" enable_screen_ai_service=false" +myconf_gn+=' enable_screen_ai_browsertests=false' myconf_gn+=" include_transport_security_state_preload_list=false" myconf_gn+=" enable_web_speech=false" myconf_gn+=" chrome_wide_echo_cancellation_supported=false" @@ -1203,9 +1213,11 @@ myconf_gn+=' enable_compose=false' myconf_gn+=' enterprise_cloud_content_analysis=false' myconf_gn+=' enterprise_local_content_analysis=false' myconf_gn+=' enterprise_data_controls=false' -myconf_gn+=' enterprise_client_certificates=false' myconf_gn+=' enterprise_watermark=false' myconf_gn+=' enterprise_content_analysis=false' +myconf_gn+=' enable_video_effects=false' +myconf_gn+=' use_fake_screen_ai=true' +myconf_gn+=' webnn_use_tflite=false' #FIXME: possibly enable this when skia gets built with rust code by default. @@ -1213,9 +1225,6 @@ myconf_gn+=' enterprise_content_analysis=false' myconf_gn+=' enable_rust=false' myconf_gn+=' enable_chromium_prelude=false' -#See net/base/features.cc. It's not enabled yet. -#FIXME: enable this and add shims to build with system zstd when it's enabled -myconf_gn+=' disable_zstd_filter=true' myconf_gn+=' chrome_certificate_policies_supported=false' myconf_gn+=' use_kerberos=false' diff --git a/perfetto-numeric_storage-double_t.patch b/perfetto-numeric_storage-double_t.patch deleted file mode 100644 index 9e04f8b..0000000 --- a/perfetto-numeric_storage-double_t.patch +++ /dev/null @@ -1,14 +0,0 @@ -Fix inconsistent type alias use -On linux ix86, `double_t` evaluates to `long double`. This contradicts the `double` expected below. - ---- src/third_party/perfetto/src/trace_processor/db/column/numeric_storage.cc.old 2023-10-13 11:25:09.719946900 +0200 -+++ src/third_party/perfetto/src/trace_processor/db/column/numeric_storage.cc 2023-10-14 23:54:10.728423000 +0200 -@@ -39,7 +39,7 @@ namespace trace_processor { - namespace column { - namespace { - --using NumericValue = std::variant; -+using NumericValue = std::variant; - - // Using the fact that binary operators in std are operators() of classes, we - // can wrap those classes in variants and use them for std::visit in diff --git a/plus_address_types-missing-optional.patch b/plus_address_types-missing-optional.patch deleted file mode 100644 index 1a36beb..0000000 --- a/plus_address_types-missing-optional.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8d253767f895b45053c39ea99a8f02bbe7071d3a Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Mon, 19 Feb 2024 19:00:26 +0000 -Subject: [PATCH] IWYU: usage of std::optional in plus_address_types.h requires - include -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: Ibfda146f5bf7485ad31828f1dc22eb39b57f83b5 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5306779 -Reviewed-by: Jan Keitel -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1262436} ---- - components/plus_addresses/plus_address_types.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/components/plus_addresses/plus_address_types.h b/components/plus_addresses/plus_address_types.h -index 7a7eaa2a818a9..77569d345011a 100644 ---- a/components/plus_addresses/plus_address_types.h -+++ b/components/plus_addresses/plus_address_types.h -@@ -5,6 +5,7 @@ - #ifndef COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_ - #define COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_ - -+#include - #include - #include - diff --git a/preview_cancel_reason-missing-string.patch b/preview_cancel_reason-missing-string.patch new file mode 100644 index 0000000..c2d3402 --- /dev/null +++ b/preview_cancel_reason-missing-string.patch @@ -0,0 +1,11 @@ +--- src/content/public/browser/preview_cancel_reason.h.orig 2024-05-30 22:55:47.180621500 +0000 ++++ src/content/public/browser/preview_cancel_reason.h 2024-05-31 07:46:06.285116500 +0000 +@@ -5,6 +5,8 @@ + #ifndef CONTENT_PUBLIC_BROWSER_PREVIEW_CANCEL_REASON_H_ + #define CONTENT_PUBLIC_BROWSER_PREVIEW_CANCEL_REASON_H_ + ++#include ++ + #include "content/common/content_export.h" + #include "third_party/abseil-cpp/absl/types/variant.h" + diff --git a/race_network_request_write_buffer_manager-missing-optional.patch b/race_network_request_write_buffer_manager-missing-optional.patch deleted file mode 100644 index 3fd424e..0000000 --- a/race_network_request_write_buffer_manager-missing-optional.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 5b2d53797e5580cbfea00d732fe25a97c7048b5b Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 24 Jan 2024 06:46:33 +0000 -Subject: [PATCH] IWYU: missing include for std::optional usage in - race_network_request_write_buffer_manager.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 957519 -Change-Id: Id3a6c3cc3c1273208bde43b70a2bd298695f7cc4 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5223947 -Reviewed-by: Shunya Shishido -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1251264} ---- - .../service_worker/race_network_request_write_buffer_manager.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/content/common/service_worker/race_network_request_write_buffer_manager.h b/content/common/service_worker/race_network_request_write_buffer_manager.h -index 0e7f17417dbd9..ad9ea1348a977 100644 ---- a/content/common/service_worker/race_network_request_write_buffer_manager.h -+++ b/content/common/service_worker/race_network_request_write_buffer_manager.h -@@ -5,6 +5,8 @@ - #ifndef CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_WRITE_BUFFER_MANAGER_H_ - #define CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_WRITE_BUFFER_MANAGER_H_ - -+#include -+ - #include "base/containers/span.h" - #include "content/common/content_export.h" - #include "mojo/public/cpp/system/data_pipe.h" diff --git a/remove-dawn.patch b/remove-dawn.patch index cdd49ce..b82636e 100644 --- a/remove-dawn.patch +++ b/remove-dawn.patch @@ -9,9 +9,9 @@ Remove this unused component which brings a huge dependency on //third_party/daw - "//services/on_device_model:on_device_model_service", - "//services/on_device_model/public/cpp", - "//services/on_device_model/public/mojom", + "//services/screen_ai/buildflags", "//services/service_manager/public/cpp", "//services/service_manager/public/mojom", - "//services/shape_detection:lib", --- src/content/utility/services.cc.orig +++ src/content/utility/services.cc @@ -31,7 +31,6 @@ @@ -23,8 +23,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw #include "services/tracing/tracing_service.h" #include "services/video_capture/public/mojom/video_capture_service.mojom.h" @@ -327,13 +326,6 @@ auto RunVideoCapture( - return service; } + #endif -auto RunOnDeviceModel( - mojo::PendingReceiver @@ -37,8 +37,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw auto RunXrDeviceService( mojo::PendingReceiver receiver) { @@ -408,9 +400,6 @@ void RegisterMainThreadServices(mojo::Se - services.Add(RunTracing); - services.Add(RunVideoCapture); + services.Add(RunVideoEffects); + #endif - if (optimization_guide::features::CanLaunchOnDeviceModelService()) { - services.Add(RunOnDeviceModel); @@ -53,9 +53,9 @@ Remove this unused component which brings a huge dependency on //third_party/daw #include "sandbox/policy/sandbox.h" #include "sandbox/policy/sandbox_type.h" -#include "services/on_device_model/on_device_model_service.h" + #include "services/screen_ai/buildflags/buildflags.h" #include "services/tracing/public/cpp/trace_startup.h" #include "third_party/icu/source/common/unicode/unistr.h" - #include "third_party/icu/source/i18n/unicode/timezone.h" @@ -202,10 +201,6 @@ int UtilityMain(MainFunctionParams param ? base::MessagePumpType::UI : base::MessagePumpType::DEFAULT; diff --git a/remove-password-manager-and-policy.patch b/remove-password-manager-and-policy.patch index 4101dbe..6562bc3 100644 --- a/remove-password-manager-and-policy.patch +++ b/remove-password-manager-and-policy.patch @@ -181,7 +181,7 @@ cgit v1.2.3 } --- src/components/search_engines/BUILD.gn.old +++ src/components/search_engines/BUILD.gn -@@ -15,47 +15,25 @@ static_library("search_engines") { +@@ -15,45 +15,23 @@ static_library("search_engines") { "choice_made_location.h", "default_search_manager.cc", "default_search_manager.h", @@ -199,8 +199,6 @@ cgit v1.2.3 - "search_engine_choice_utils.cc", - "search_engine_choice_utils.h", "search_engines_pref_names.h", - "search_engines_switches.cc", - "search_engines_switches.h", - "search_host_to_urls_map.cc", - "search_host_to_urls_map.h", "search_terms_data.cc", @@ -262,7 +260,7 @@ cgit v1.2.3 ] } -- if (is_linux || is_win || is_mac || is_chromeos_ash) { +- if (is_linux || is_win || is_mac || is_chromeos) { + if (false) { sources += [ "site_search_policy_handler.cc", diff --git a/remove-puffin.patch b/remove-puffin.patch index 4b98ad5..5900342 100644 --- a/remove-puffin.patch +++ b/remove-puffin.patch @@ -18,14 +18,16 @@ "//components/content_settings/core/common", "//components/crash/core/common", "//components/device_signals/core/common:features", ---- src/components/services/screen_ai/BUILD.gn.old -+++ src/components/services/screen_ai/BUILD.gn -@@ -41,8 +41,6 @@ if (is_linux || is_chromeos) { +--- src/content/utility/BUILD.gn.orig ++++ src/content/utility/BUILD.gn +@@ -144,10 +144,6 @@ source_set("utility") { + } + } - deps = [ - "//base", -- "//components/component_updater", -- "//components/services/screen_ai/public/cpp:utilities", - "//sandbox/linux:sandbox_services", - "//ui/accessibility:ax_base", - ] +- if (is_linux || is_chromeos) { +- deps += [ "//services/screen_ai:screen_ai_sandbox_hook" ] +- } +- + if (enable_accessibility_service) { + deps += [ "//services/accessibility:lib" ] + } diff --git a/remove-rust.patch b/remove-rust.patch index 5c3b126..44b08e9 100644 --- a/remove-rust.patch +++ b/remove-rust.patch @@ -10,43 +10,93 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser:unit_tests", "//components/reading_list/core:unit_tests", "//components/reporting/client:unit_tests", ---- src/chrome/test/BUILD.gn.orig 2024-03-27 16:37:20.829583999 +0100 -+++ src/chrome/test/BUILD.gn 2024-03-28 23:15:36.696977127 +0100 -@@ -1765,8 +1765,6 @@ if (!is_android && !is_fuchsia) { - "//chrome/common/privacy_budget:test_support", - "//chrome/renderer", - "//chrome/renderer/companion/visual_query:browser_tests", -- "//chrome/services/qrcode_generator/public/cpp", -- "//chrome/services/qrcode_generator/public/mojom", - "//chrome/services/removable_storage_writer:lib", - "//chrome/test/data/webui:resources_grit", - "//chrome/test/data/webui/mojo:mojo_bindings", -@@ -6818,7 +6816,6 @@ if (!is_fuchsia) { - "//chrome/common/themes:unit_tests", - "//chrome/renderer/companion/visual_query:unit_tests", - "//chrome/services/file_util:unit_tests", -- "//chrome/services/qrcode_generator/public/cpp", - "//components/account_id", - "//components/assist_ranker/proto", - "//components/autofill/content/browser:test_support", ---- src/chrome/services/qrcode_generator/BUILD.gn.orig 2024-03-27 16:30:07.952978653 +0100 -+++ src/chrome/services/qrcode_generator/BUILD.gn 2024-03-28 23:20:47.829864401 +0100 -@@ -15,8 +15,6 @@ source_set("qrcode_generator") { - deps = [ - "//base", - "//chrome:strings", -- "//components/qr_code_generator", -- "//components/qr_code_generator:qr_code_generator_features", - "//components/vector_icons", - "//mojo/public/cpp/bindings", - "//net", ---- src/chrome/services/qrcode_generator/public/cpp/BUILD.gn.orig 2024-03-27 16:30:07.952978653 +0100 -+++ src/chrome/services/qrcode_generator/public/cpp/BUILD.gn 2024-03-28 23:22:28.019734555 +0100 -@@ -15,7 +15,6 @@ source_set("cpp") { - "//chrome:strings", - "//chrome/services/qrcode_generator", - "//chrome/services/qrcode_generator/public/mojom", -- "//components/qr_code_generator:qr_code_generator_features", - "//content/public/browser", - "//skia", - ] +--- src/chrome/browser/BUILD.gn.orig ++++ src/chrome/browser/BUILD.gn +@@ -1972,7 +1972,6 @@ static_library("browser") { + "//chrome/browser/profiling_host", + + # TODO(crbug.com/1335199): break this dep when favicon is in its own target +- "//chrome/browser/share", + "//chrome/browser/ui", + "//chrome/browser/storage_access_api", + "//chrome/browser/top_level_storage_access_api:permissions", +@@ -2106,7 +2105,6 @@ static_library("browser") { + "//chrome/browser/safe_browsing:advanced_protection", + "//chrome/browser/safe_browsing:metrics_collector", + "//chrome/browser/safe_browsing:verdict_cache_manager_factory", +- "//chrome/browser/share", + "//chrome/browser/sharing:buildflags", + "//chrome/browser/sharing/proto", + "//chrome/browser/signin:identity_manager_provider", +@@ -4598,7 +4596,6 @@ static_library("browser") { + "//chrome/browser/policy:path_parser", + "//chrome/browser/profile_resetter:profile_reset_report_proto", + "//chrome/browser/resources:component_extension_resources", +- "//chrome/browser/share/proto:proto", + "//chrome/browser/smart_card", + "//chrome/browser/support_tool:support_tool_proto", + "//chrome/browser/ui/actions:actions_headers", +@@ -8407,7 +8404,6 @@ static_library("test_support") { + "//build:chromeos_buildflags", + "//chrome/app/theme:theme_resources", + "//chrome/browser/policy/messaging_layer/proto:crd_event_proto", +- "//chrome/browser/share:share", + "//chrome/common", + "//chrome/common/notifications", + "//chrome/common/safe_browsing:proto", +--- src/chrome/browser/ui/BUILD.gn.orig ++++ src/chrome/browser/ui/BUILD.gn +@@ -451,7 +451,6 @@ static_library("ui") { + "//chrome/browser/resources:dev_ui_resources", + "//chrome/browser/resources:resources", + "//chrome/browser/safe_browsing", +- "//chrome/browser/share", + "//chrome/browser/storage_access_api", + "//chrome/browser/ui/side_panel:side_panel_enums", + "//chrome/browser/ui/webui/location_internals:mojo_bindings", +@@ -591,7 +590,6 @@ static_library("ui") { + "//components/privacy_sandbox:tracking_protection_settings", + "//components/profile_metrics", + "//components/proxy_config", +- "//components/qr_code_generator:bitmap_generator", + "//components/query_parser", + "//components/reading_list/core", + "//components/reading_list/features:flags", +--- src/chrome/test/BUILD.gn.orig ++++ src/chrome/test/BUILD.gn +@@ -1923,7 +1923,6 @@ if (!is_android) { + "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", + "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", + "//components/proxy_config", +- "//components/qr_code_generator:bitmap_generator", + "//components/reading_list/core", + "//components/reading_list/features:flags", + "//components/resources", +@@ -6774,7 +6773,6 @@ test("unit_tests") { + "//chrome/browser/safe_browsing:metrics_collector", + "//chrome/browser/safe_browsing:verdict_cache_manager_factory", + "//chrome/browser/segmentation_platform:test_utils", +- "//chrome/browser/share", + "//chrome/browser/sharing/proto", + "//chrome/browser/storage_access_api", + "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto", +@@ -6927,7 +6925,6 @@ test("unit_tests") { + "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", + "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", + "//components/proxy_config", +- "//components/qr_code_generator:bitmap_generator", + "//components/query_parser", + "//components/query_tiles:unit_tests", + "//components/reading_list/core", +@@ -8360,11 +8357,6 @@ test("unit_tests") { + + data += [ "//ash/components/arc/test/data/icons/" ] + +- data_deps += [ +- # enclave_manager_unittest.cc runs this binary as part of its testing +- # process. +- "//third_party/cloud_authenticator/test/local_service:cloud_authenticator_test_service", +- ] + + if (include_js2gtest_tests && is_chromeos_ash) { + data += js2gtest_js_libraries diff --git a/resolution_monitor-missing-bitset.patch b/resolution_monitor-missing-bitset.patch deleted file mode 100644 index 4c25f25..0000000 --- a/resolution_monitor-missing-bitset.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 214859e3567ea9def85305e4f021a5d407e1ccfe Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 23 Jan 2024 10:56:36 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::bitset in - resolution_monitor.cc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 957519 -Change-Id: Ia538bbca63105397963632d2a145886e256efeb6 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190545 -Commit-Queue: José Dapena Paz -Reviewed-by: Henrik Boström -Cr-Commit-Position: refs/heads/main@{#1250732} ---- - .../renderer/platform/peerconnection/resolution_monitor.cc | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc b/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc -index 5d6a6495045c4..33135a1b22473 100644 ---- a/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc -+++ b/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc -@@ -4,6 +4,8 @@ - - #include "third_party/blink/renderer/platform/peerconnection/resolution_monitor.h" - -+#include -+ - #include "base/containers/span.h" - #include "base/logging.h" - #include "base/memory/ptr_util.h" diff --git a/script_promise_resolver-explicit-specialization.patch b/script_promise_resolver-explicit-specialization.patch deleted file mode 100644 index 98827bf..0000000 --- a/script_promise_resolver-explicit-specialization.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 8b293359cafbc741e7742de824b98fbf87a51b51 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 8 Feb 2024 09:32:57 +0000 -Subject: [PATCH] Do not use templates for ScriptPromiseResolver::ToV8 - implementation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The usage of templates for reusing the internal implementation of ToV8 -is not making the code simpler. So, inline the implementations. - -This also fixes a GCC build issue because it was implemented with -template specializations declared in the class scope, and that is -hitting the GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282 - -Bug: 819294 -Change-Id: I51f5a9e0a6e80ac707b630f270179c29fd84b059 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5223626 -Commit-Queue: José Dapena Paz -Reviewed-by: Yuki Shiino -Cr-Commit-Position: refs/heads/main@{#1257835} ---- - .../core/v8/script_promise_resolver.h | 60 +++++-------------- - 1 file changed, 14 insertions(+), 46 deletions(-) - -diff --git a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h -index 93cecd06c2814..ae0081b735a67 100644 ---- a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h -+++ b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h -@@ -316,70 +316,38 @@ class CORE_EXPORT ScriptPromiseResolver - return V8String(isolate, value); - } - -- template -- static v8::Local ToV8SignedIntegerInternal(int64_t value, -- v8::Isolate*); -- -- template <> -- v8::Local ToV8SignedIntegerInternal<4>(int64_t value, -- v8::Isolate* isolate) { -- return v8::Integer::New(isolate, static_cast(value)); -- } -- -- template <> -- v8::Local ToV8SignedIntegerInternal<8>(int64_t value, -- v8::Isolate* isolate) { -- int32_t value_in32_bit = static_cast(value); -- if (value_in32_bit == value) { -- return v8::Integer::New(isolate, value_in32_bit); -- } -- // V8 doesn't have a 64-bit integer implementation. -- return v8::Number::New(isolate, value); -- } -- -- template -- static v8::Local ToV8UnsignedIntegerInternal(uint64_t value, -- v8::Isolate*); -- -- template <> -- v8::Local ToV8UnsignedIntegerInternal<4>(uint64_t value, -- v8::Isolate* isolate) { -- return v8::Integer::NewFromUnsigned(isolate, static_cast(value)); -- } -- -- template <> -- v8::Local ToV8UnsignedIntegerInternal<8>(uint64_t value, -- v8::Isolate* isolate) { -- uint32_t value_in32_bit = static_cast(value); -- if (value_in32_bit == value) { -- return v8::Integer::NewFromUnsigned(isolate, value_in32_bit); -- } -- // V8 doesn't have a 64-bit integer implementation. -- return v8::Number::New(isolate, value); -- } -- - static v8::Local ToV8(int32_t value, - v8::Local creation_context, - v8::Isolate* isolate) { -- return ToV8SignedIntegerInternal(value, isolate); -+ return v8::Integer::New(isolate, value); - } - - static v8::Local ToV8(int64_t value, - v8::Local creation_context, - v8::Isolate* isolate) { -- return ToV8SignedIntegerInternal(value, isolate); -+ int32_t value_in32_bit = static_cast(value); -+ if (value_in32_bit == value) { -+ return v8::Integer::New(isolate, value_in32_bit); -+ } -+ // V8 doesn't have a 64-bit integer implementation. -+ return v8::Number::New(isolate, value); - } - - static v8::Local ToV8(uint32_t value, - v8::Local creation_context, - v8::Isolate* isolate) { -- return ToV8UnsignedIntegerInternal(value, isolate); -+ return v8::Integer::NewFromUnsigned(isolate, value); - } - - static v8::Local ToV8(uint64_t value, - v8::Local creation_context, - v8::Isolate* isolate) { -- return ToV8UnsignedIntegerInternal(value, isolate); -+ uint32_t value_in32_bit = static_cast(value); -+ if (value_in32_bit == value) { -+ return v8::Integer::NewFromUnsigned(isolate, value_in32_bit); -+ } -+ // V8 doesn't have a 64-bit integer implementation. -+ return v8::Number::New(isolate, value); - } - - static v8::Local ToV8(bool value, diff --git a/script_streamer-atomic-include.patch b/script_streamer-atomic-include.patch new file mode 100644 index 0000000..f56f5fb --- /dev/null +++ b/script_streamer-atomic-include.patch @@ -0,0 +1,39 @@ +From 8be4d17beb71c29118c3337268f3e7b3930a657f Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 26 Mar 2024 10:06:31 +0000 +Subject: [PATCH] IWYU: use regular atomic include instead of hardcoding libc++ + path +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: I2f2076d533b9732d1f7ff8aea5dc027547f62347 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5373879 +Commit-Queue: José Dapena Paz +Reviewed-by: Marja Hölttä +Cr-Commit-Position: refs/heads/main@{#1278213} +--- + third_party/blink/renderer/bindings/core/v8/script_streamer.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc +index f00f7cef4cc26..90f1ce6db12f3 100644 +--- a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc ++++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc +@@ -4,6 +4,7 @@ + + #include "third_party/blink/renderer/bindings/core/v8/script_streamer.h" + ++#include + #include + #include + +@@ -60,7 +61,6 @@ + #include "third_party/blink/renderer/platform/wtf/shared_buffer.h" + #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" + #include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h" +-#include "third_party/libc++/src/include/__atomic/atomic.h" + + namespace blink { + namespace { diff --git a/search_engine_choice_service-missing-optional.patch b/search_engine_choice_service-missing-optional.patch deleted file mode 100644 index 7692640..0000000 --- a/search_engine_choice_service-missing-optional.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4b48bc4dd6ce9c56d254e552a33a7b7c2d6fc226 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 1 Feb 2024 17:01:51 +0000 -Subject: [PATCH] IWYU: usage of std::optional in - search_engine_choice_service.h requires include -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 957519 -Change-Id: If89767ae4cd261081efda97cde6a296209b68782 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5259337 -Reviewed-by: Colin Blundell -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1255105} ---- - .../search_engine_choice/search_engine_choice_service.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/components/search_engines/search_engine_choice/search_engine_choice_service.h b/components/search_engines/search_engine_choice/search_engine_choice_service.h -index b84ea7ec5fc08..c9dcce4b7c833 100644 ---- a/components/search_engines/search_engine_choice/search_engine_choice_service.h -+++ b/components/search_engines/search_engine_choice/search_engine_choice_service.h -@@ -5,6 +5,8 @@ - #ifndef COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_SERVICE_H_ - #define COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_SERVICE_H_ - -+#include -+ - #include "base/memory/raw_ref.h" - #include "base/memory/weak_ptr.h" - #include "components/country_codes/country_codes.h" diff --git a/skia-system-vulkan-headers.patch b/skia-system-vulkan-headers.patch index 3b830ae..914fc0f 100644 --- a/skia-system-vulkan-headers.patch +++ b/skia-system-vulkan-headers.patch @@ -5,7 +5,7 @@ Unbundle only Skia's vulkan headers. ANGLE needs the bleeding-edge ones in vulka @@ -11,7 +11,7 @@ // IWYU pragma: begin_exports - #if SKIA_IMPLEMENTATION || !defined(SK_VULKAN) + #if (SKIA_IMPLEMENTATION || !defined(SK_VULKAN)) && !defined(SK_USE_EXTERNAL_VULKAN_HEADERS) -#include "include/third_party/vulkan/vulkan/vulkan_core.h" +#include #else @@ -14,7 +14,7 @@ Unbundle only Skia's vulkan headers. ANGLE needs the bleeding-edge ones in vulka @@ -21,7 +21,7 @@ #ifdef SK_BUILD_FOR_ANDROID // This is needed to get android extensions for external memory - #if SKIA_IMPLEMENTATION || !defined(SK_VULKAN) + #if (SKIA_IMPLEMENTATION || !defined(SK_VULKAN)) && !defined(SK_USE_EXTERNAL_VULKAN_HEADERS) -#include "include/third_party/vulkan/vulkan/vulkan_android.h" +#include #else diff --git a/span_reader-missing-optional.patch b/span_reader-missing-optional.patch new file mode 100644 index 0000000..21102c9 --- /dev/null +++ b/span_reader-missing-optional.patch @@ -0,0 +1,32 @@ +From b3330cb62d7be253a5b99e40b88e2290c329ac08 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 19 Mar 2024 19:05:35 +0000 +Subject: [PATCH] IWYU: missing include for std::optional usage in + span_reader.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: I13cc54ea91d4b02b170213e471c01fd5fc28394c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374258 +Reviewed-by: Daniel Cheng +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1275094} +--- + base/containers/span_reader.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/base/containers/span_reader.h b/base/containers/span_reader.h +index 6b67b436bd9c1..3f323fd57a550 100644 +--- a/base/containers/span_reader.h ++++ b/base/containers/span_reader.h +@@ -5,6 +5,8 @@ + #ifndef BASE_CONTAINERS_SPAN_READER_H_ + #define BASE_CONTAINERS_SPAN_READER_H_ + ++#include ++ + #include "base/containers/span.h" + #include "base/numerics/safe_conversions.h" + diff --git a/system-pydeps.patch b/system-pydeps.patch index a680916..b7fdabc 100644 --- a/system-pydeps.patch +++ b/system-pydeps.patch @@ -130,7 +130,7 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. --- a/mojo/public/tools/bindings/mojom.gni +++ b/mojo/public/tools/bindings/mojom.gni @@ -699,7 +699,7 @@ - allow_remote = true + remote_worker = "large" custom_processor = "mojom_parser" script = mojom_parser_script - inputs = mojom_parser_sources + ply_sources + [ build_metadata_filename ] diff --git a/temporal_scalability_id_extractor-missing-bitset.patch b/temporal_scalability_id_extractor-missing-bitset.patch new file mode 100644 index 0000000..0503756 --- /dev/null +++ b/temporal_scalability_id_extractor-missing-bitset.patch @@ -0,0 +1,32 @@ +From 59843523390481e52d3a397687a09a7582c44114 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Tue, 19 Mar 2024 17:06:46 +0000 +Subject: [PATCH] IWYU: missing include for std::bitset usage in + temporal_scalability_id_extractor.cc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: Id0b573b23137011a82fd2a85160eae4099a96467 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374259 +Commit-Queue: José Dapena Paz +Reviewed-by: Dan Sanders +Cr-Commit-Position: refs/heads/main@{#1275008} +--- + media/filters/temporal_scalability_id_extractor.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/media/filters/temporal_scalability_id_extractor.cc b/media/filters/temporal_scalability_id_extractor.cc +index 8d27b8b3b7a8c..67dc762b6de0c 100644 +--- a/media/filters/temporal_scalability_id_extractor.cc ++++ b/media/filters/temporal_scalability_id_extractor.cc +@@ -4,6 +4,8 @@ + + #include "media/filters/temporal_scalability_id_extractor.h" + ++#include ++ + namespace media { + + TemporalScalabilityIdExtractor::TemporalScalabilityIdExtractor(VideoCodec codec, diff --git a/text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch b/text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch deleted file mode 100644 index 5ffe3dc..0000000 --- a/text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch +++ /dev/null @@ -1,148 +0,0 @@ -From f62990fb134b7e610502b6804945debaa51960a5 Mon Sep 17 00:00:00 2001 -From: Koji Ishii -Date: Fri, 9 Feb 2024 18:47:02 +0000 -Subject: [PATCH] Support ICU 74 in `LazyTextBreakIterator` - -This patch extends the `kBreakAllLineBreakClassTable` table -for 5 new LineBreak classes in ICU 74. - -They are for Brahmic scripts, which "line breaks can occur at -the boundaries of any orthographic syllable"[1]. The -`break-all` has no additional break opportunities that all -entries are `0`. - -This patch also adds `0` for 3 classes added in ICU 58[2], -instead of doing so in code, to make future additions -possible. - -[1] https://unicode.org/reports/tr14/#BreakOpportunities -[2] https://chromiumcodereview.appspot.com/2440923002 - -Bug: 324419151 -Change-Id: I8002edb927280f63b5b668b09076cc71feaeac3e -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5279337 -Auto-Submit: Koji Ishii -Commit-Queue: Ian Kilpatrick -Reviewed-by: Ian Kilpatrick -Cr-Commit-Position: refs/heads/main@{#1258643} ---- - .../platform/text/text_break_iterator.cc | 98 ++++++++++--------- - 1 file changed, 53 insertions(+), 45 deletions(-) - -diff --git a/third_party/blink/renderer/platform/text/text_break_iterator.cc b/third_party/blink/renderer/platform/text/text_break_iterator.cc -index 703dc2399075469..38ab94a0a460b5c 100644 ---- a/third_party/blink/renderer/platform/text/text_break_iterator.cc -+++ b/third_party/blink/renderer/platform/text/text_break_iterator.cc -@@ -161,11 +161,7 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar - }; - // clang-format on - --#if U_ICU_VERSION_MAJOR_NUM >= 58 --#define BA_LB_COUNT (U_LB_COUNT - 3) --#else - #define BA_LB_COUNT U_LB_COUNT --#endif - // Line breaking table for CSS word-break: break-all. This table differs from - // asciiLineBreakTable in: - // - Indices are Line Breaking Classes defined in UAX#14 Unicode Line Breaking -@@ -174,47 +170,59 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar - // normal line break, not "prohibit break." - // clang-format off - static const unsigned char kBreakAllLineBreakClassTable[][BA_LB_COUNT / 8 + 1] = { -- // XX AI AL B2 BA BB BK CB CL CM CR EX GL HY ID IN IS LF NS NU OP PO PR QU SA SG SP SY ZW NL WJ H2 H3 JL JT JV CP CJ HL RI -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // XX -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // AI -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // AL -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // B2 -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // BA -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BB -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BK -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CB -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // CL -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CM -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CR -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // EX -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // GL -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // HY -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ID -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // IN -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // IS -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // LF -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NS -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // NU -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // OP -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // PO -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // PR -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // QU -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // SA -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SG -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SP -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // SY -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ZW -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NL -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // WJ -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H2 -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H3 -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JL -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JT -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JV -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // CP -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CJ -- { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0) }, // HL -- { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // RI -+ // XX AI AL B2 BA BB BK CB CL CM CR EX GL HY ID IN IS LF NS NU OP PO PR QU SA SG SP SY ZW NL WJ H2 H3 JL JT JV CP CJ HL RI EB EM ZWJ AK AP AS VF VI -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // XX -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AI -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AL -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // B2 -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BA -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BB -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // BK -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CB -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CL -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CM -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CR -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // EX -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // GL -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // HY -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ID -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // IN -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // IS -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // LF -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NS -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NU -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // OP -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 1, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // PO -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // PR -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // QU -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SA -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SG -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SP -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // SY -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ZW -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // NL -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // WJ -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H2 -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // H3 -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JL -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JT -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // JV -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 0, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CP -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // CJ -+ { B(0, 1, 1, 0, 1, 0, 0, 0), B(0, 0, 0, 0, 0, 1, 0, 0), B(0, 0, 0, 1, 1, 0, 1, 0), B(1, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 1, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // HL -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // RI -+ // Added in ICU 58. -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // EB -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // EM -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // ZWJ -+#if U_ICU_VERSION_MAJOR_NUM >= 74 -+ // Added in ICU 74. https://icu.unicode.org/download/74 -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AK -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AP -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // AS -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // VF -+ { B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0) }, // VI -+#endif // U_ICU_VERSION_MAJOR_NUM >= 74 - }; - // clang-format on - diff --git a/v8-instance-type-inl-constexpr-used-before-its-definition.patch b/v8-instance-type-inl-constexpr-used-before-its-definition.patch deleted file mode 100644 index f482f0f..0000000 --- a/v8-instance-type-inl-constexpr-used-before-its-definition.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- src/v8/src/objects/instance-type-inl.h.orig 2024-02-21 13:34:15.959879700 +0000 -+++ src/v8/src/objects/instance-type-inl.h 2024-02-25 13:47:34.748156000 +0000 -@@ -71,7 +71,9 @@ constexpr bool kHasUniqueMapOfInstanceTy - - template - constexpr RootIndex kUniqueMapOfInstanceType = -- UniqueMapOfInstanceType(type).value_or(RootIndex::kRootListLength); -+ kHasUniqueMapOfInstanceType? -+ *UniqueMapOfInstanceType(type): -+ RootIndex::kRootListLength; - - // Manually curated list of instance type ranges which are associated with a - // unique range of map addresses on the read only heap. Both ranges are -@@ -129,14 +131,17 @@ UniqueMapRangeOfInstanceTypeRange(Instan - return {}; - } - -+constexpr inline TaggedAddressRange NULL_ADDRESS_RANGE{kNullAddress, kNullAddress}; -+ - template - constexpr bool kHasUniqueMapRangeOfInstanceTypeRange = - UniqueMapRangeOfInstanceTypeRange(first, last).has_value(); - - template - constexpr TaggedAddressRange kUniqueMapRangeOfInstanceTypeRange = -- UniqueMapRangeOfInstanceTypeRange(first, last) -- .value_or(TaggedAddressRange(kNullAddress, kNullAddress)); -+ kHasUniqueMapRangeOfInstanceTypeRange? -+ *UniqueMapRangeOfInstanceTypeRange(first, last): -+ NULL_ADDRESS_RANGE; - - inline constexpr base::Optional - UniqueMapRangeOfInstanceType(InstanceType type) { -@@ -149,8 +154,9 @@ constexpr bool kHasUniqueMapRangeOfInsta - - template - constexpr TaggedAddressRange kUniqueMapRangeOfInstanceType = -- UniqueMapRangeOfInstanceType(type).value_or( -- TaggedAddressRange(kNullAddress, kNullAddress)); -+ kHasUniqueMapRangeOfInstanceType? -+ *UniqueMapRangeOfInstanceType(type): -+ NULL_ADDRESS_RANGE; - - inline bool MayHaveMapCheckFastCase(InstanceType type) { - if (UniqueMapOfInstanceType(type)) return true; diff --git a/wayland-proto-31-cursor-shape.patch b/wayland-proto-31-cursor-shape.patch index 1ec03f4..572f887 100644 --- a/wayland-proto-31-cursor-shape.patch +++ b/wayland-proto-31-cursor-shape.patch @@ -378,265 +378,6 @@ index 31e61aff6010b..419801f0257a3 100644 void SetZcrCursorShapes(std::unique_ptr obj) { impl_->zcr_cursor_shapes_ = std::move(obj); } -diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc b/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc -new file mode 100644 -index 0000000000000..e9b6f0c678c03 ---- /dev/null -+++ b/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc -@@ -0,0 +1,194 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h" -+ -+#include -+ -+#include "base/check.h" -+#include "third_party/abseil-cpp/absl/types/optional.h" -+#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" -+#include "ui/gfx/native_widget_types.h" -+#include "ui/ozone/platform/wayland/host/wayland_connection.h" -+#include "ui/ozone/platform/wayland/host/wayland_pointer.h" -+#include "ui/ozone/platform/wayland/host/wayland_seat.h" -+ -+namespace ui { -+ -+namespace { -+constexpr uint32_t kMinVersion = 1; -+} -+ -+using mojom::CursorType; -+ -+// static -+constexpr char WaylandCursorShape::kInterfaceName[]; -+ -+// static -+void WaylandCursorShape::Instantiate(WaylandConnection* connection, -+ wl_registry* registry, -+ uint32_t name, -+ const std::string& interface, -+ uint32_t version) { -+ CHECK_EQ(interface, kInterfaceName) << "Expected \"" << kInterfaceName -+ << "\" but got \"" << interface << "\""; -+ -+ if (connection->cursor_shape_ || -+ !wl::CanBind(interface, version, kMinVersion, kMinVersion)) { -+ return; -+ } -+ -+ auto cursor_shape_manager = -+ wl::Bind(registry, name, kMinVersion); -+ if (!cursor_shape_manager) { -+ LOG(ERROR) << "Failed to bind wp_cursor_shape_manager_v1"; -+ return; -+ } -+ connection->cursor_shape_ = std::make_unique( -+ cursor_shape_manager.release(), connection); -+} -+ -+WaylandCursorShape::WaylandCursorShape(wp_cursor_shape_manager_v1* cursor_shape, -+ WaylandConnection* connection) -+ : wp_cursor_shape_manager_v1_(cursor_shape), connection_(connection) { -+ // |wp_cursor_shape_manager_v1_| and |connection_| may be null in tests. -+} -+ -+WaylandCursorShape::~WaylandCursorShape() = default; -+ -+wp_cursor_shape_device_v1* WaylandCursorShape::GetShapeDevice() { -+ DCHECK(connection_->seat()->pointer()); -+ -+ if (!wp_cursor_shape_device_v1_.get()) { -+ wl_pointer* pointer = connection_->seat()->pointer()->wl_object(); -+ wp_cursor_shape_device_v1_.reset(wp_cursor_shape_manager_v1_get_pointer( -+ wp_cursor_shape_manager_v1_.get(), pointer)); -+ } -+ DCHECK(wp_cursor_shape_device_v1_); -+ return wp_cursor_shape_device_v1_.get(); -+} -+ -+// static -+absl::optional WaylandCursorShape::ShapeFromType(CursorType type) { -+ switch (type) { -+ case CursorType::kNull: -+ // kNull is an alias for kPointer. Fall through. -+ case CursorType::kPointer: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT; -+ case CursorType::kCross: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR; -+ case CursorType::kHand: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER; -+ case CursorType::kIBeam: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT; -+ case CursorType::kWait: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT; -+ case CursorType::kHelp: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP; -+ case CursorType::kEastResize: -+ case CursorType::kEastPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE; -+ case CursorType::kNorthResize: -+ case CursorType::kNorthPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE; -+ case CursorType::kNorthEastResize: -+ case CursorType::kNorthEastPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE; -+ case CursorType::kNorthWestResize: -+ case CursorType::kNorthWestPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE; -+ case CursorType::kSouthResize: -+ case CursorType::kSouthPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE; -+ case CursorType::kSouthEastResize: -+ case CursorType::kSouthEastPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE; -+ case CursorType::kSouthWestResize: -+ case CursorType::kSouthWestPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE; -+ case CursorType::kWestResize: -+ case CursorType::kWestPanning: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE; -+ case CursorType::kNorthSouthResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE; -+ case CursorType::kEastWestResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE; -+ case CursorType::kNorthEastSouthWestResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE; -+ case CursorType::kNorthWestSouthEastResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE; -+ case CursorType::kColumnResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE; -+ case CursorType::kRowResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE; -+ case CursorType::kMove: -+ // Returning `MOVE` is the correct thing here, but Blink does not make a -+ // distinction between move and all-scroll. Other platforms use a cursor -+ // more consistent with all-scroll, so use that. -+ case CursorType::kMiddlePanning: -+ case CursorType::kMiddlePanningVertical: -+ case CursorType::kMiddlePanningHorizontal: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL; -+ case CursorType::kVerticalText: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_VERTICAL_TEXT; -+ case CursorType::kCell: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CELL; -+ case CursorType::kContextMenu: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CONTEXT_MENU; -+ case CursorType::kAlias: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALIAS; -+ case CursorType::kProgress: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS; -+ case CursorType::kNoDrop: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP; -+ case CursorType::kCopy: -+ case CursorType::kDndCopy: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COPY; -+ case CursorType::kNone: -+ // To be cleared through wl_pointer.set_cursor. -+ return absl::nullopt; -+ case CursorType::kNotAllowed: -+ case CursorType::kNorthSouthNoResize: -+ case CursorType::kEastWestNoResize: -+ case CursorType::kNorthEastSouthWestNoResize: -+ case CursorType::kNorthWestSouthEastNoResize: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED; -+ case CursorType::kZoomIn: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_IN; -+ case CursorType::kZoomOut: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_OUT; -+ case CursorType::kGrab: -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB; -+ case CursorType::kGrabbing: -+ case CursorType::kDndNone: -+ case CursorType::kDndMove: -+ case CursorType::kDndLink: -+ // For drag-and-drop, the compositor knows the drag type and can use it to -+ // additionally decorate the cursor. -+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING; -+ case CursorType::kCustom: -+ // "Custom" means a bitmap cursor, which cannot use the shape API. -+ return absl::nullopt; -+ } -+} -+ -+void WaylandCursorShape::SetCursorShape(uint32_t shape) { -+ DCHECK(connection_->seat()); -+ -+ // Nothing to do if there is no pointer (mouse) connected. -+ if (!connection_->seat()->pointer()) { -+ return; -+ } -+ -+ auto pointer_enter_serial = -+ connection_->serial_tracker().GetSerial(wl::SerialType::kMouseEnter); -+ if (!pointer_enter_serial) { -+ VLOG(1) << "Failed to set cursor shape: no mouse enter serial found."; -+ return; -+ } -+ wp_cursor_shape_device_v1_set_shape(GetShapeDevice(), -+ pointer_enter_serial->value, shape); -+} -+ -+} // namespace ui -diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_shape.h b/ui/ozone/platform/wayland/host/wayland_cursor_shape.h -new file mode 100644 -index 0000000000000..9bb2fab21a539 ---- /dev/null -+++ b/ui/ozone/platform/wayland/host/wayland_cursor_shape.h -@@ -0,0 +1,53 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_ -+ -+#include "base/memory/raw_ptr.h" -+#include "third_party/abseil-cpp/absl/types/optional.h" -+#include "ui/base/cursor/mojom/cursor_type.mojom-forward.h" -+#include "ui/ozone/platform/wayland/common/wayland_object.h" -+ -+namespace ui { -+ -+class WaylandConnection; -+ -+// Wraps the cursor_shape interface for Wayland server-side cursor support. -+class WaylandCursorShape -+ : public wl::GlobalObjectRegistrar { -+ public: -+ static constexpr char kInterfaceName[] = "wp_cursor_shape_manager_v1"; -+ -+ static void Instantiate(WaylandConnection* connection, -+ wl_registry* registry, -+ uint32_t name, -+ const std::string& interface, -+ uint32_t version); -+ -+ WaylandCursorShape(wp_cursor_shape_manager_v1* cursor_shape, -+ WaylandConnection* connection); -+ WaylandCursorShape(const WaylandCursorShape&) = delete; -+ WaylandCursorShape& operator=(const WaylandCursorShape&) = delete; -+ virtual ~WaylandCursorShape(); -+ -+ // Returns the cursor shape value for a cursor |type|, or nullopt if the -+ // type isn't supported by Wayland's cursor shape API. -+ static absl::optional ShapeFromType(mojom::CursorType type); -+ -+ // Calls wp_cursor_shape_device_v1_set_shape(). See interface description -+ // for values for |shape|. Virtual for testing. -+ virtual void SetCursorShape(uint32_t shape); -+ -+ private: -+ wp_cursor_shape_device_v1* GetShapeDevice(); -+ -+ const wl::Object wp_cursor_shape_manager_v1_; -+ wl::Object wp_cursor_shape_device_v1_; -+ const raw_ptr connection_; -+}; -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_ diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc index 68f87776ef4f0..f5c36964ad36d 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.cc @@ -653,10 +394,10 @@ index 68f87776ef4f0..f5c36964ad36d 100644 base::IsValueInRangeForNumericType( cursor->cursor_image_scale_factor())); -- absl::optional shape = -+ absl::optional shape = +- std::optional shape = ++ std::optional shape = + WaylandCursorShape::ShapeFromType(cursor->type()); -+ absl::optional zcr_shape = ++ std::optional zcr_shape = WaylandZcrCursorShapes::ShapeFromType(cursor->type()); // Round cursor scale factor to ceil as wl_surface.set_buffer_scale accepts -- 2.51.1 From 405cf5702bb42cd43517cc7cf31fbf84df731e5bcb3200d1f7af9e64848bd73c Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 12 Jul 2024 11:37:44 +0000 Subject: [PATCH 08/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=160 --- nodejs-electron.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 5b09ca7..5bd2c97 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -17,7 +17,7 @@ Fri Jul 12 10:28:06 UTC 2024 - Bruno Pitrus ------------------------------------------------------------------- Tue Jul 9 10:04:38 UTC 2024 - Bruno Pitrus -- Update to 30.1.2 XXXFIXMEXXX +- Update to 30.1.2 * ABI break: NODE_MODULE_VERSION is now 123 * Chromium 124.0.6367.243 * Node 20.14.0 -- 2.51.1 From 67a4c041b28ae3cbd421464a8e323f1bceff832e880080cd9cc1b0032af110c2 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 14 Jul 2024 09:01:13 +0000 Subject: [PATCH 09/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=161 --- nodejs-electron.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 7371520..26f7a97 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -856,6 +856,12 @@ export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %endif +%ifarch aarch64 +%if 0%{?fedora} >= 40 +export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g0 /g' -e 's/-g$/-g0/g')" +%endif +%endif + #The chromium build process passes lots of .o files directly to the linker instead of using static libraries, #and relies on the linker eliminating unused sections. #Re-add these parameters from build/config/compiler/BUILD.gn. -- 2.51.1 From 76781c432ad2cc7141650301d037dec0197ff33c5178024aa7d24911872aebaf Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 20 Jul 2024 10:06:30 +0000 Subject: [PATCH 10/80] Accepting request 1188790 from home:dziobian:gulgul-ultron:19 - New upstream release 30.3.0 * Node 20.15.1 * Added DownloadItem.getCurrentBytesPerSecond(), DownloadItem.getPercentComplete(), DownloadItem.getEndTime(). * Fixed a potential crash when using off screen rendering. * fix crash when resolving proxy with session.resolveProxy api OBS-URL: https://build.opensuse.org/request/show/1188790 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=162 --- create_tarball.sh | 1 + electron-30.2.0.tar.zst | 3 - electron-30.3.0.tar.zst | 3 + nodejs-electron.changes | 9 ++ nodejs-electron.spec | 278 +++++++++++++++++++++------------------- 5 files changed, 160 insertions(+), 134 deletions(-) delete mode 100644 electron-30.2.0.tar.zst create mode 100644 electron-30.3.0.tar.zst diff --git a/create_tarball.sh b/create_tarball.sh index ab669fc..74bf688 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -327,6 +327,7 @@ rm -rf third_party/electron_node/deps/{googletest/{include,src},icu-small} #292M find third_party/electron_node/deps/brotli -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/cares -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +find third_party/electron_node/deps/ngtcp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete rm -rvf third_party/electron_node/deps/v8/tools diff --git a/electron-30.2.0.tar.zst b/electron-30.2.0.tar.zst deleted file mode 100644 index 6d7a9f4..0000000 --- a/electron-30.2.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e78d7110ace88fd42ca0f0a89875ea5a24d53f7cea3cde7671c83e6863e5d3af -size 587543819 diff --git a/electron-30.3.0.tar.zst b/electron-30.3.0.tar.zst new file mode 100644 index 0000000..091eefb --- /dev/null +++ b/electron-30.3.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f7e49bdcb4893d4871952bde24f2b65ed386828d4096e211a72933d0343f06e +size 586560481 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 5bd2c97..38a0fb7 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Jul 20 10:02:27 UTC 2024 - Bruno Pitrus + +- New upstream release 30.3.0 + * Node 20.15.1 + * Added DownloadItem.getCurrentBytesPerSecond(), DownloadItem.getPercentComplete(), DownloadItem.getEndTime(). + * Fixed a potential crash when using off screen rendering. + * fix crash when resolving proxy with session.resolveProxy api + ------------------------------------------------------------------- Fri Jul 12 10:28:06 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 26f7a97..244a3c3 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -78,18 +78,26 @@ BuildArch: i686 -%ifnarch %ix86 %arm - +%ifnarch %ix86 %arm aarch64 %if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}) %bcond_without lto %else %bcond_with lto %endif +%endif -%else +%ifarch %ix86 %arm %bcond_with lto %endif +%ifarch aarch64 +%if 0%{?fedora} >= 40 +%bcond_with lto +%else +%bcond_without lto +%endif +%endif + %if 0%{?suse_version} || 0%{?fedora} < 40 @@ -212,7 +220,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 30.2.0 +Version: 30.3.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -787,133 +795,7 @@ ln -sf %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ tools/generate_shim_headers/generate_shim_headers.py - -%build -pushd electron/shell/browser/resources/win -[ $(identify electron.ico | wc -l) = 4 ] #Sanity check -convert electron.ico -strip extracted.png -identify extracted-0.png | grep -F 16x16 -identify extracted-1.png | grep -F 32x32 -identify extracted-2.png | grep -F 48x48 -identify extracted-3.png | grep -F 256x256 -popd - - -# GN sets lto on its own and we need just ldflag options, not cflags -%define _lto_cflags %{nil} - -# Make sure python is python3 -install -d -m 0755 python3-path -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} -ln -sf %{_bindir}/python3 "$(pwd)/python3-path/python" -%else -ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python" -ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python3" -%endif -export PATH="$(pwd)/python3-path:${PATH}" - -#HACK: Those packages on Leap are available only in python3.6 versions. -%if 0%{?suse_version} && 0%{?suse_version} < 1550 -install -d -m 0755 python3-site -cp -pr %{python3_sitelib}/{json5,mako} -t "$(pwd)/python3-site" -export PYTHONPATH="$(pwd)/python3-site" -%endif - -#some Fedora ports still try to build with LTO -ARCH_FLAGS=$(echo "%optflags"|sed 's/-f[^ ]*lto[^ ]*//g' ) - -#Work around an upstream ODR issue. -#Remove this once https://bugs.chromium.org/p/chromium/issues/detail?id=1375049 gets fixed. -ARCH_FLAGS="$ARCH_FLAGS -DIS_SERIAL_ENABLED_PLATFORM" - - - - -%if 0%{?fedora} -# Fix base/allocator/allocator_shim.cc:408:2: error: #error This code cannot be -# used when exceptions are turned on. -ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')" -%endif - -# for wayland -export CXXFLAGS="${ARCH_FLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon" -export CFLAGS="${CXXFLAGS}" - -# Google has a bad coding style, using a macro `NOTREACHED()` that is not properly detected by GCC -# multiple times throughout the codebase (including generated code). It is not possible to redefine the macro to __builtin_unreachable, -# as it has an astonishing syntax, behaving like an ostream (in debug builds it is supposed to trap and print an error message) -export CXXFLAGS="${CXXFLAGS} -Wno-error=return-type" - -# A bunch of memcpy'ing of JSObject in V8 runs us into “Logfile got too big, killed job.” -export CXXFLAGS="${CXXFLAGS} -Wno-class-memaccess" -# Warning spam from generated mojom code again makes the log too big -export CXXFLAGS="${CXXFLAGS} -Wno-packed-not-aligned -Wno-address" - -# REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch -export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" - -%ifarch %ix86 %arm aarch64 -export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" -%endif - -%ifarch aarch64 -%if 0%{?fedora} >= 40 -export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g0 /g' -e 's/-g$/-g0/g')" -%endif -%endif - -#The chromium build process passes lots of .o files directly to the linker instead of using static libraries, -#and relies on the linker eliminating unused sections. -#Re-add these parameters from build/config/compiler/BUILD.gn. -export LDFLAGS="%{?build_ldflags} -Wl,-O2 -Wl,--gc-sections " - - - -%ifarch %ix86 %arm -#try to reduce memory - -export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" -%endif #ifarch ix86 arm - - -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} -export CC=gcc -export CXX=g++ -export AR=gcc-ar -export NM=gcc-nm -export RANLIB=gcc-ranlib -%else -export CC=gcc-13 -export CXX=g++-13 -export AR=gcc-ar-13 -export NM=gcc-nm-13 -export RANLIB=gcc-ranlib-13 -%endif - - - -# do not eat all memory -%ifarch %ix86 %arm -%limit_build -m 1200 -%else -%limit_build -m 4000 -%endif - -%ifarch aarch64 -#These settings make it use much more memory leading to OOM during linking -unset MALLOC_CHECK_ -unset MALLOC_PERTURB_ -%endif - -%if %{with lto} -%ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=3 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" -%else -# x64 is fine with the the default settings (the machines have 30GB+ ram) -export LDFLAGS="$LDFLAGS -flto=auto" -%endif -%endif - +# Remove bundled libraries gn_system_libraries=( brotli crc32c @@ -1046,6 +928,134 @@ find third_party/electron_node/deps/histogram -type f ! -name "*.gn" -a ! -name find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete %endif + +%build +pushd electron/shell/browser/resources/win +[ $(identify electron.ico | wc -l) = 4 ] #Sanity check +convert electron.ico -strip extracted.png +identify extracted-0.png | grep -F 16x16 +identify extracted-1.png | grep -F 32x32 +identify extracted-2.png | grep -F 48x48 +identify extracted-3.png | grep -F 256x256 +popd + + +# GN sets lto on its own and we need just ldflag options, not cflags +%define _lto_cflags %{nil} + +# Make sure python is python3 +install -d -m 0755 python3-path +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} +ln -sf %{_bindir}/python3 "$(pwd)/python3-path/python" +%else +ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python" +ln -sf %{_bindir}/python3.11 "$(pwd)/python3-path/python3" +%endif +export PATH="$(pwd)/python3-path:${PATH}" + +#HACK: Those packages on Leap are available only in python3.6 versions. +%if 0%{?suse_version} && 0%{?suse_version} < 1550 +install -d -m 0755 python3-site +cp -pr %{python3_sitelib}/{json5,mako} -t "$(pwd)/python3-site" +export PYTHONPATH="$(pwd)/python3-site" +%endif + +#some Fedora ports still try to build with LTO +ARCH_FLAGS=$(echo "%optflags"|sed 's/-f[^ ]*lto[^ ]*//g' ) + +#Work around an upstream ODR issue. +#Remove this once https://bugs.chromium.org/p/chromium/issues/detail?id=1375049 gets fixed. +ARCH_FLAGS="$ARCH_FLAGS -DIS_SERIAL_ENABLED_PLATFORM" + + + + +%if 0%{?fedora} +# Fix base/allocator/allocator_shim.cc:408:2: error: #error This code cannot be +# used when exceptions are turned on. +ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')" +%endif + +# for wayland +export CXXFLAGS="${ARCH_FLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon" +export CFLAGS="${CXXFLAGS}" + +# Google has a bad coding style, using a macro `NOTREACHED()` that is not properly detected by GCC +# multiple times throughout the codebase (including generated code). It is not possible to redefine the macro to __builtin_unreachable, +# as it has an astonishing syntax, behaving like an ostream (in debug builds it is supposed to trap and print an error message) +export CXXFLAGS="${CXXFLAGS} -Wno-error=return-type" + +# A bunch of memcpy'ing of JSObject in V8 runs us into “Logfile got too big, killed job.” +export CXXFLAGS="${CXXFLAGS} -Wno-class-memaccess" +# Warning spam from generated mojom code again makes the log too big +export CXXFLAGS="${CXXFLAGS} -Wno-packed-not-aligned -Wno-address" + +# REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch +export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" + +%ifarch %ix86 %arm +export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" +%endif + +%ifarch aarch64 +%if %{with lto} +export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" +%endif +%endif + + +#The chromium build process passes lots of .o files directly to the linker instead of using static libraries, +#and relies on the linker eliminating unused sections. +#Re-add these parameters from build/config/compiler/BUILD.gn. +export LDFLAGS="%{?build_ldflags} -Wl,-O2 -Wl,--gc-sections " + + + +%ifarch %ix86 %arm +#try to reduce memory + +export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" +%endif #ifarch ix86 arm + + +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} +export CC=gcc +export CXX=g++ +export AR=gcc-ar +export NM=gcc-nm +export RANLIB=gcc-ranlib +%else +export CC=gcc-13 +export CXX=g++-13 +export AR=gcc-ar-13 +export NM=gcc-nm-13 +export RANLIB=gcc-ranlib-13 +%endif + + + +# do not eat all memory +%ifarch %ix86 %arm +%limit_build -m 1200 +%else +%limit_build -m 4000 +%endif + +%ifarch aarch64 +#These settings make it use much more memory leading to OOM during linking +unset MALLOC_CHECK_ +unset MALLOC_PERTURB_ +%endif + +%if %{with lto} +%ifarch aarch64 +export LDFLAGS="$LDFLAGS -flto=3 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +%else +# x64 is fine with the the default settings (the machines have 30GB+ ram) +export LDFLAGS="$LDFLAGS -flto=auto" +%endif +%endif + # Create the configuration for GN # Available options: out/Release/gn args --list out/Release/ myconf_gn="" @@ -1168,11 +1178,17 @@ myconf_gn+=" blink_symbol_level=0" myconf_gn+=" v8_symbol_level=0" %endif %ifarch aarch64 +%if %{with lto} # linker OOM, sorry. # we still seem to get some debug generated during linking when LTO is enabled myconf_gn+=' symbol_level=0' myconf_gn+=' blink_symbol_level=0' myconf_gn+=' v8_symbol_level=0' +%else +myconf_gn+=' symbol_level=2' +myconf_gn+=' blink_symbol_level=1' +myconf_gn+=' v8_symbol_level=1' +%endif %endif #symbol_level should not affect generated code. -- 2.51.1 From 5c391a2c5970e55c16ee1332d1c8189ea789971dd49df242b64e10f0cf3970fa Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 20 Jul 2024 12:14:23 +0000 Subject: [PATCH 11/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=163 --- nodejs-electron.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 38a0fb7..9147b0f 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -6,6 +6,7 @@ Sat Jul 20 10:02:27 UTC 2024 - Bruno Pitrus * Added DownloadItem.getCurrentBytesPerSecond(), DownloadItem.getPercentComplete(), DownloadItem.getEndTime(). * Fixed a potential crash when using off screen rendering. * fix crash when resolving proxy with session.resolveProxy api +- aarch64 Fedora 40: disable LTO due to linker oom failing build ------------------------------------------------------------------- Fri Jul 12 10:28:06 UTC 2024 - Bruno Pitrus -- 2.51.1 From e74c4d2a93044efbdf852433c52fb2b7cbeb470aa9d386fbffbdfb9222d9298a Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 14 Aug 2024 22:08:54 +0000 Subject: [PATCH 12/80] Accepting request 1194024 from home:dziobian:gulgul-ultron:19 - Fix ftbfs with ffmpeg 7.x * add backported ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch * do not revert audio_file_reader-ffmpeg-AVFrame-duration.patch when building against ffmpeg 6+ OBS-URL: https://build.opensuse.org/request/show/1194024 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=164 --- ...fmpeg_video_decoder-reordered_opaque.patch | 119 ++++++++++++++++++ nodejs-electron.changes | 7 ++ nodejs-electron.spec | 30 ++--- 3 files changed, 138 insertions(+), 18 deletions(-) create mode 100644 ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch diff --git a/ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch b/ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch new file mode 100644 index 0000000..201db0d --- /dev/null +++ b/ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch @@ -0,0 +1,119 @@ +From 62274859104bd828373ae406aa9309e610449ac5 Mon Sep 17 00:00:00 2001 +From: Ted Meyer +Date: Fri, 22 Mar 2024 19:56:55 +0000 +Subject: [PATCH] Replace deprecated use of AVCodecContext::reordered_opaque + +We can use the AV_CODEC_FLAG_COPY_OPAQUE flag on the codec context +now to trigger timestamp propagation. + +Bug: 330573128 +Change-Id: I6bc57241a35ab5283742aad8d42acb4dc5e85858 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5384308 +Commit-Queue: Ted (Chromium) Meyer +Reviewed-by: Dan Sanders +Cr-Commit-Position: refs/heads/main@{#1277051} +--- + media/filters/ffmpeg_video_decoder.cc | 17 +++++++++++++---- + media/filters/ffmpeg_video_decoder.h | 16 ++++++++++++++++ + 2 files changed, 29 insertions(+), 4 deletions(-) + +diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc +index bd75477feeabb7..8a658a58caac5b 100644 +--- a/media/filters/ffmpeg_video_decoder.cc ++++ b/media/filters/ffmpeg_video_decoder.cc +@@ -134,7 +134,7 @@ bool FFmpegVideoDecoder::IsCodecSupported(VideoCodec codec) { + } + + FFmpegVideoDecoder::FFmpegVideoDecoder(MediaLog* media_log) +- : media_log_(media_log) { ++ : media_log_(media_log), timestamp_map_(128) { + DVLOG(1) << __func__; + DETACH_FROM_SEQUENCE(sequence_checker_); + } +@@ -213,10 +213,6 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context, + frame->linesize[plane] = layout->planes()[plane].stride; + } + +- // This seems unsafe, given threaded decoding. However, `reordered_opaque` is +- // also going away upstream, so we need a whole new mechanism either way. +- frame->reordered_opaque = codec_context->reordered_opaque; +- + // This will be freed by `ReleaseVideoBufferImpl`. + auto* opaque = new OpaqueData(fb_priv, frame_pool_, data, allocation_size, + std::move(*layout)); +@@ -363,8 +363,10 @@ bool FFmpegVideoDecoder::FFmpegDecode(const DecoderBuffer& buffer) { + DCHECK(packet->data); + DCHECK_GT(packet->size, 0); + +- // Let FFmpeg handle presentation timestamp reordering. +- codec_context_->reordered_opaque = buffer.timestamp().InMicroseconds(); ++ const int64_t timestamp = buffer.timestamp().InMicroseconds(); ++ const TimestampId timestamp_id = timestamp_id_generator_.GenerateNextId(); ++ timestamp_map_.Put(std::make_pair(timestamp_id, timestamp)); ++ packet->opaque = reinterpret_cast(timestamp_id.GetUnsafeValue()); + } + FFmpegDecodingLoop::DecodeStatus decode_status = decoding_loop_->DecodePacket( + packet, base::BindRepeating(&FFmpegVideoDecoder::OnNewFrame, +@@ -423,7 +425,12 @@ bool FFmpegVideoDecoder::OnNewFrame(AVFrame* frame) { + } + gfx::Size natural_size = aspect_ratio.GetNaturalSize(visible_rect); + +- const auto pts = base::Microseconds(frame->reordered_opaque); ++ const auto ts_id = TimestampId(reinterpret_cast(frame->opaque)); ++ const auto ts_lookup = timestamp_map_.Get(ts_id); ++ if (ts_lookup == timestamp_map_.end()) { ++ return false; ++ } ++ const auto pts = base::Microseconds(std::get<1>(*ts_lookup)); + auto video_frame = VideoFrame::WrapExternalDataWithLayout( + opaque->layout, visible_rect, natural_size, opaque->data, opaque->size, + pts); +@@ -498,8 +505,10 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, + codec_context_->thread_count = GetFFmpegVideoDecoderThreadCount(config); + codec_context_->thread_type = + FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME); ++ + codec_context_->opaque = this; + codec_context_->get_buffer2 = GetVideoBufferImpl; ++ codec_context_->flags |= AV_CODEC_FLAG_COPY_OPAQUE; + + if (base::FeatureList::IsEnabled(kFFmpegAllowLists)) { + // Note: FFmpeg will try to free this string, so we must duplicate it. +diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h +index d02cb89c3ddf7c..0a2de1c623ffff 100644 +--- a/media/filters/ffmpeg_video_decoder.h ++++ b/media/filters/ffmpeg_video_decoder.h +@@ -7,10 +7,12 @@ + + #include + ++#include "base/containers/lru_cache.h" + #include "base/functional/callback.h" + #include "base/memory/raw_ptr.h" + #include "base/memory/scoped_refptr.h" + #include "base/sequence_checker.h" ++#include "base/types/id_type.h" + #include "media/base/frame_buffer_pool.h" + #include "media/base/supported_video_decoder_config.h" + #include "media/base/video_decoder.h" +@@ -87,6 +89,20 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { + // FFmpeg structures owned by this object. + std::unique_ptr codec_context_; + ++ // The gist here is that timestamps need to be 64 bits to store microsecond ++ // precision. A 32 bit integer would overflow at ~35 minutes at this level of ++ // precision. We can't cast the timestamp to the void ptr object used by the ++ // opaque field in ffmpeg then, because it would lose data on a 32 bit build. ++ // However, we don't actually have 2^31 timestamped frames in a single ++ // playback, so it's fine to use the 32 bit value as a key in a map which ++ // contains the actual timestamps. Additionally, we've in the past set 128 ++ // outstanding frames for re-ordering as a limit for cross-thread decoding ++ // tasks, so we'll do that here too with the LRU cache. ++ using TimestampId = base::IdType; ++ ++ TimestampId::Generator timestamp_id_generator_; ++ base::LRUCache timestamp_map_; ++ + VideoDecoderConfig config_; + + scoped_refptr frame_pool_; diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 9147b0f..610eb72 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 13 20:28:37 UTC 2024 - Bruno Pitrus + +- Fix ftbfs with ffmpeg 7.x + * add backported ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch + * do not revert audio_file_reader-ffmpeg-AVFrame-duration.patch when building against ffmpeg 6+ + ------------------------------------------------------------------- Sat Jul 20 10:02:27 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 244a3c3..d46cab5 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -129,17 +129,11 @@ BuildArch: i686 %endif %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} -%bcond_without ffmpeg_5 %bcond_without system_vpx -%else -%bcond_with ffmpeg_5 -%bcond_with system_vpx -%endif - -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 39 %bcond_without bro_11 %bcond_without ffmpeg_6 %else +%bcond_with system_vpx %bcond_with bro_11 %bcond_with ffmpeg_6 %endif @@ -395,6 +389,7 @@ Patch3160: async_iterable-forwarding.patch Patch3161: preview_cancel_reason-missing-string.patch Patch3162: script_streamer-atomic-include.patch Patch3163: DesktopNativeWidgetAura-HandleActivationChanged-crash.patch +Patch3164: ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -545,11 +540,8 @@ Recommends: (ffmpeg-libs%{_isa} or libavcodec-freeworld%{_isa}) %endif %if %{with ffmpeg_6} BuildRequires: pkgconfig(libavcodec) >= 60 -%endif -%if %{with ffmpeg_5} -BuildRequires: pkgconfig(libavcodec) >= 59 -BuildRequires: pkgconfig(libavformat) >= 59 -BuildRequires: pkgconfig(libavutil) >= 57 +BuildRequires: pkgconfig(libavformat) >= 60 +BuildRequires: pkgconfig(libavutil) >= 58 %if 0%{?fedora} #requires av_stream_get_first_dts, see rhbz#2240127 BuildRequires: libavformat-free-devel >= %AVFORMAT_VER @@ -747,14 +739,13 @@ test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = patch -R -p1 < %PATCH1076 %endif -%if %{without ffmpeg_6} -patch -R -p1 < %SOURCE402 -%endif -%if %{with ffmpeg_5} +%if %{with ffmpeg_6} patch -R -p1 < %PATCH2012 %else +patch -R -p1 < %SOURCE402 patch -R -p1 < %SOURCE400 +patch -R -p1 < %SOURCE401 %endif @@ -770,8 +761,7 @@ patch -R -p1 < %SOURCE450 %endif -# This one depends on an ffmpeg nightly, reverting unconditionally. -patch -R -p1 < %SOURCE401 + # Link system wayland-protocols-devel into where chrome expects them mkdir -p third_party/wayland/src @@ -1056,6 +1046,10 @@ export LDFLAGS="$LDFLAGS -flto=auto" %endif %endif +# Ccache is truncated to 5GB which is not enough for Electron, leading to slower rebuilds +export CCACHE_COMPRESS=1 +ccache -o max_size=0 || true + # Create the configuration for GN # Available options: out/Release/gn args --list out/Release/ myconf_gn="" -- 2.51.1 From 4c6f6790da26efe7f43aa48d98e7f64ccb0132fd7091562fe381f828357394c0 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 18 Aug 2024 12:09:05 +0000 Subject: [PATCH 13/80] Accepting request 1194545 from home:dziobian:gulgul-ultron:19 revert on leap OBS-URL: https://build.opensuse.org/request/show/1194545 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=165 --- nodejs-electron.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index d46cab5..8e84ad6 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -743,6 +743,7 @@ patch -R -p1 < %PATCH1076 %if %{with ffmpeg_6} patch -R -p1 < %PATCH2012 %else +patch -R -p1 < %PATCH3164 patch -R -p1 < %SOURCE402 patch -R -p1 < %SOURCE400 patch -R -p1 < %SOURCE401 -- 2.51.1 From d6040e6e9217006dee12fd376ba3bce565ad0f6cbda335d1aefcba37bc465696 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 19 Aug 2024 08:58:03 +0000 Subject: [PATCH 14/80] Accepting request 1194664 from home:ithod:signal - New upstream release 30.4.0 * Added a new property prefersReducedTransparency to nativeTheme, which indicates whether the user has chosen to reduce OS-level transparency via system accessibility settings. * Aligned failure pathway in File System Access API with upstream when attempting to open a file or directory in a blocked path. * Fixed an issue where navigator.serial.getPorts() incorrectly returned an empty array in some cases. * Fixed an issue where the File System Access API did not remember the user's last picked directory as expected. * Fixed the resource leak when using Node.js readable streams as the response body for a custom protocol handler. * Resolved an issue where desktopCapturer.getSources never fulfilled its promise in some cases. * Security fixes for CVE-2024-6989 CVE-2024-6991 (bsc#1228942) * Security fixes for CVE-2024-6776 CVE-2024-6778 CVE-2024-6777 CVE-2024-6773 CVE-2024-6774 CVE-2024-6772 CVE-2024-6775 CVE-2024-6779 (bsc#1227979) OBS-URL: https://build.opensuse.org/request/show/1194664 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=166 --- electron-30.3.0.tar.zst | 3 --- electron-30.4.0.tar.zst | 3 +++ nodejs-electron.changes | 13 +++++++++++++ nodejs-electron.spec | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) delete mode 100644 electron-30.3.0.tar.zst create mode 100644 electron-30.4.0.tar.zst diff --git a/electron-30.3.0.tar.zst b/electron-30.3.0.tar.zst deleted file mode 100644 index 091eefb..0000000 --- a/electron-30.3.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7f7e49bdcb4893d4871952bde24f2b65ed386828d4096e211a72933d0343f06e -size 586560481 diff --git a/electron-30.4.0.tar.zst b/electron-30.4.0.tar.zst new file mode 100644 index 0000000..b009a30 --- /dev/null +++ b/electron-30.4.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba3666e3a877784714ae41bb53e1d9eecaa29e3a6c13999ead81f26c47487083 +size 588501104 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 610eb72..42868c4 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sun Aug 18 07:39:42 UTC 2024 - thod_@gmx.de + +- New upstream release 30.4.0 + * Added a new property prefersReducedTransparency to nativeTheme, which indicates whether the user has chosen to reduce OS-level transparency via system accessibility settings. + * Aligned failure pathway in File System Access API with upstream when attempting to open a file or directory in a blocked path. + * Fixed an issue where navigator.serial.getPorts() incorrectly returned an empty array in some cases. + * Fixed an issue where the File System Access API did not remember the user's last picked directory as expected. + * Fixed the resource leak when using Node.js readable streams as the response body for a custom protocol handler. + * Resolved an issue where desktopCapturer.getSources never fulfilled its promise in some cases. + * Security fixes for CVE-2024-6989 CVE-2024-6991 (bsc#1228942) + * Security fixes for CVE-2024-6776 CVE-2024-6778 CVE-2024-6777 CVE-2024-6773 CVE-2024-6774 CVE-2024-6772 CVE-2024-6775 CVE-2024-6779 (bsc#1227979) + ------------------------------------------------------------------- Tue Aug 13 20:28:37 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 8e84ad6..481db1f 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -214,7 +214,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 30.3.0 +Version: 30.4.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From f3f182f88f7c4b7cccfd5ed89c1b53771d5f67933e542828366b0708cfc08c59 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 31 Aug 2024 09:02:17 +0000 Subject: [PATCH 15/80] Accepting request 1198000 from home:dziobian:gulgul-ultron:19 - Fedora 40+, TW: add v8-strict-aliasing.patch to work around GCC14 miscompile - aarch64: remove -jitless from electron_rebuild macro, seems not needed anymore OBS-URL: https://build.opensuse.org/request/show/1198000 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=167 --- nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 18 +++++++++++++++-- v8-strict-aliasing.patch | 42 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 v8-strict-aliasing.patch diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 42868c4..7ecdf03 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Aug 31 09:00:18 UTC 2024 - Bruno Pitrus + +- Fedora 40+, TW: add v8-strict-aliasing.patch to work around GCC14 miscompile +- aarch64: remove -jitless from electron_rebuild macro, seems not needed anymore + ------------------------------------------------------------------- Sun Aug 18 07:39:42 UTC 2024 - thod_@gmx.de diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 481db1f..0c9291c 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -55,7 +55,7 @@ BuildArch: i686 #(all the widgets use Gtk unconditionally — not sure which of the changed codepaths are used in Electron) %bcond_with qt -%ifarch aarch64 %ix86 +%ifarch %ix86 #work around npm rebuild crashes on OBS %global jitless NODE_OPTIONS=--jitless %endif @@ -138,6 +138,11 @@ BuildArch: i686 %bcond_with ffmpeg_6 %endif +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 40 +%bcond_without gcc14 +%else +%bcond_with gcc14 +%endif %if 0%{?fedora} @@ -360,6 +365,12 @@ Patch2054: bad-font-gc11.patch Patch2055: bad-font-gc1.patch Patch2056: bad-font-gc2.patch Patch2057: bad-font-gc3.patch +#Work around gcc14 overly aggressive optimizer. Interestingly applying this patch produces a *different* crash on gcc13 + LTO. +%if %{with gcc14} +Patch2058: v8-strict-aliasing.patch +%else +Source2058: v8-strict-aliasing.patch +%endif # PATCHES that should be submitted upstream verbatim or near-verbatim # Fix blink nodestructor @@ -644,6 +655,9 @@ BuildRequires: gcc-c++ >= 13 BuildRequires: gcc13-PIE BuildRequires: gcc13-c++ %endif +%if %{with gcc14} +BuildRequires: gcc-c++ >= 14 +%endif %if %{with pipewire} BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: pkgconfig(libspa-0.2) @@ -1040,7 +1054,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=3 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=2 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" diff --git a/v8-strict-aliasing.patch b/v8-strict-aliasing.patch new file mode 100644 index 0000000..ab1e021 --- /dev/null +++ b/v8-strict-aliasing.patch @@ -0,0 +1,42 @@ +Work around numerous type confusion bugs in V8 due to GCC14 being much more aggressive about misoptimizing them + +Example crash (relibly happens during building electron inside mksnapshot): + +#0 v8::internal::compiler::CFGBuilder::CollectSuccessorBlocks () at ../../v8/src/compiler/scheduler.cc:435 +#1 v8::internal::compiler::CFGBuilder::ConnectCall () at ../../v8/src/compiler/scheduler.cc:451 +#2 v8::internal::compiler::CFGBuilder::ConnectBlocks () at ../../v8/src/compiler/scheduler.cc:402 +#3 v8::internal::compiler::CFGBuilder::ConnectBlocks (this=0x55b3d1fc26a8, node=0x55b3d1fb6508) at ../../v8/src/compiler/scheduler.cc:365 +#4 0x000055b3d0b6b05f in v8::internal::compiler::CFGBuilder::Run () at ../../v8/src/compiler/scheduler.cc:268 +#5 v8::internal::compiler::Scheduler::BuildCFG (this=0x7ffd856fb860) at ../../v8/src/compiler/scheduler.cc:633 +#6 0x000055b3d0b6f692 in v8::internal::compiler::Scheduler::ComputeSchedule (zone=0x55b3d1fa4100, graph=0x1070, flags=..., tick_counter=0x7ffd856fbfa0, profile_data=0x0) at ../../v8/src/compiler/scheduler.cc:64 +#7 0x000055b3d0b3f3fb in v8::internal::compiler::ComputeSchedulePhase::Run () at ../../v8/src/compiler/pipeline.cc:1805 +#8 v8::internal::compiler::PipelineImpl::Run () at ../../v8/src/compiler/pipeline.cc:775 +#9 v8::internal::compiler::PipelineImpl::ComputeScheduledGraph (this=0x7ffd856fc3b0) at ../../v8/src/compiler/pipeline.cc:3869 +#10 0x000055b3d0b4b8e6 in v8::internal::compiler::Pipeline::GenerateCodeForCodeStub (isolate=0x55b3d1ac7700 , call_descriptor=0x55b3d1fb6b48, + graph=0x7ffd856fbd30, jsgraph=0x7ffd856fbc88, source_positions=0x7ffd856fc090, kind=2, debug_name=0x55b3d1752b49 "V8.TFCSAOptimization", builtin=13, options=..., profile_data=0x0) at ../../v8/src/compiler/pipeline.cc:2951 +#11 0x000055b3d0a003a9 in v8::internal::compiler::CodeAssembler::GenerateCode (state=0x7ffd856fd180, options=..., profile_data=0x0) at ../../v8/src/compiler/code-assembler.cc:175 +#12 0x000055b3d0d8703d in BuildWithCodeStubAssemblerCS (isolate=0x55b3d1f19000, builtin=13, generator=0x0, interface_descriptor=3, name=0x7ffd856fd120 "\001") at ../../v8/src/builtins/setup-builtins-internal.cc:213 +#13 0x000055b3d0d87440 in v8::internal::SetupIsolateDelegate::SetupBuiltinsInternal (isolate=0x55b3d1f19000) at ../../v8/src/builtins/setup-builtins-internal.cc:373 +#14 0x000055b3d1726a05 in v8::internal::SetupIsolateDelegate::SetupBuiltins () at ../../v8/src/init/setup-isolate-full.cc:29 +#15 v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [clone .isra.0] () at ../../v8/src/execution/isolate.cc:4857 +#16 0x000055b3d0503632 in v8::internal::Isolate::InitWithoutSnapshot () at ../../v8/src/execution/isolate.cc:4366 +#17 v8::internal::SnapshotCreatorImpl::InitInternal (this=0x55b3d1f2d660, blob=0x0) at ../../v8/src/snapshot/snapshot.cc:868 +#18 0x000055b3d009c347 in v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl () at ../../v8/src/snapshot/snapshot.cc:929 +#19 v8::SnapshotCreator::SnapshotCreator () at ../../v8/src/api/api.cc:557 +#20 main (argc=-777226496, argc@entry=14, argv=0x55b3d1fb6b48, argv@entry=0x7ffd85718da8) at ../../v8/src/snapshot/mksnapshot.cc:293 +#21 0x00007f26f162a340 in __libc_start_call_main (main=main@entry=0x55b3d009b0c0 , argc=argc@entry=14, argv=argv@entry=0x7ffd85718da8) at ../sysdeps/nptl/libc_start_call_main.h:58 +#22 0x00007f26f162a409 in __libc_start_main_impl (main=0x55b3d009b0c0 , argc=14, argv=0x7ffd85718da8, init=, fini=, rtld_fini=, stack_end=0x7ffd85718d98) + at ../csu/libc-start.c:360 +#23 0x000055b3d009df75 in _start () at ../sysdeps/x86_64/start.S:115 + + +--- src/v8/BUILD.gn.old ++++ src/v8/BUILD.gn +@@ -775,6 +775,7 @@ config("internal_config") { + libs = [ "atomic" ] + } + } ++ cflags = ["-fno-strict-aliasing"] + } + + # Should be applied to all targets that write trace events. -- 2.51.1 From 1cfe13bbc4aa5738ad439b92a2549512353a4e400581c57a2b23b6dd11dee7e9 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 5 Sep 2024 05:02:09 +0000 Subject: [PATCH 16/80] Accepting request 1198859 from home:dziobian:gulgul-ultron:19 - v8-strict-aliasing.patch: only use -fno-ipa-strict-aliasing, it's sufficient - aarch64 Tumbleweed: disable LTO and use mold linker due to OOM - change vendor string in process.versions to match what VSCode expects OBS-URL: https://build.opensuse.org/request/show/1198859 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=168 --- nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 26 ++++++++++++++++++++++++-- v8-strict-aliasing.patch | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 7ecdf03..31d28ee 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Sep 5 04:59:15 UTC 2024 - Bruno Pitrus + +- v8-strict-aliasing.patch: only use -fno-ipa-strict-aliasing, it's sufficient +- aarch64 Tumbleweed: disable LTO and use mold linker due to OOM +- change vendor string in process.versions to match what VSCode expects + ------------------------------------------------------------------- Sat Aug 31 09:00:18 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0c9291c..8d6be4d 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -91,13 +91,23 @@ BuildArch: i686 %endif %ifarch aarch64 -%if 0%{?fedora} >= 40 +%if 0%{?suse_version} || 0%{?fedora} >= 40 %bcond_with lto %else %bcond_without lto %endif %endif +%ifarch aarch64 +%if 0%{?suse_version} +%bcond_without mold +%else +%bcond_with mold +%endif +%else +%bcond_with mold +%endif + %if 0%{?suse_version} || 0%{?fedora} < 40 @@ -443,6 +453,9 @@ BuildRequires: llhttp-devel >= 8 BuildRequires: llvm-devel >= 16 %endif BuildRequires: memory-constraints +%if %{with mold} +BuildRequires: mold +%endif %ifarch %ix86 x86_64 %x86_64 %if %{without system_aom} || %{without system_vpx} BuildRequires: nasm @@ -1014,6 +1027,9 @@ export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" #Re-add these parameters from build/config/compiler/BUILD.gn. export LDFLAGS="%{?build_ldflags} -Wl,-O2 -Wl,--gc-sections " +# mold does not respect it otherwise +export LDFLAGS="$LDFLAGS -Wl,--as-needed" + %ifarch %ix86 %arm @@ -1061,6 +1077,10 @@ export LDFLAGS="$LDFLAGS -flto=auto" %endif %endif +%if %{with mold} +export LDFLAGS="$LDFLAGS -fuse-ld=mold" +%endif + # Ccache is truncated to 5GB which is not enough for Electron, leading to slower rebuilds export CCACHE_COMPRESS=1 ccache -o max_size=0 || true @@ -1069,7 +1089,9 @@ ccache -o max_size=0 || true # Available options: out/Release/gn args --list out/Release/ myconf_gn="" myconf_gn+=' override_electron_version="%{tag_version}"' -myconf_gn+=' electron_vendor_version="suse:Electron for openSUSE"' +# The only known consumer of process.versions. is VSCode: +# https://github.com/microsoft/vscode/blob/main/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts +myconf_gn+=' electron_vendor_version="microsoft-build:Electron for openSUSE"' myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" myconf_gn+=" use_custom_libcxx=false" diff --git a/v8-strict-aliasing.patch b/v8-strict-aliasing.patch index ab1e021..58b4de8 100644 --- a/v8-strict-aliasing.patch +++ b/v8-strict-aliasing.patch @@ -36,7 +36,7 @@ Example crash (relibly happens during building electron inside mksnapshot): libs = [ "atomic" ] } } -+ cflags = ["-fno-strict-aliasing"] ++ cflags = ["-fno-ipa-strict-aliasing"] } # Should be applied to all targets that write trace events. -- 2.51.1 From 91a0c6682e03b928d7d13f338473b8c0fd276a16a4785a9a907cef5a198c3872 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 6 Sep 2024 11:21:23 +0000 Subject: [PATCH 17/80] Accepting request 1199170 from home:dziobian:gulgul-ultron:19 - New upstream release 30.5.0 * Node 20.16.0 OBS-URL: https://build.opensuse.org/request/show/1199170 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=169 --- electron-30.4.0.tar.zst | 3 --- electron-30.5.0.tar.zst | 3 +++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 electron-30.4.0.tar.zst create mode 100644 electron-30.5.0.tar.zst diff --git a/electron-30.4.0.tar.zst b/electron-30.4.0.tar.zst deleted file mode 100644 index b009a30..0000000 --- a/electron-30.4.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba3666e3a877784714ae41bb53e1d9eecaa29e3a6c13999ead81f26c47487083 -size 588501104 diff --git a/electron-30.5.0.tar.zst b/electron-30.5.0.tar.zst new file mode 100644 index 0000000..ed7b84a --- /dev/null +++ b/electron-30.5.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85fa505a8c6b0d13e0af3dc2932a99bc556d0172fc1ef73d8fc2f40c80356270 +size 588034335 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 31d28ee..d7de02f 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 6 06:16:32 UTC 2024 - Bruno Pitrus + +- New upstream release 30.5.0 + * Node 20.16.0 + ------------------------------------------------------------------- Thu Sep 5 04:59:15 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 8d6be4d..b5d605a 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -229,7 +229,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 30.4.0 +Version: 30.5.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 9d755bfb6d94f3959d9fe0ddc04e7f999a5a9c0b11688f4b1a57bdc4d8cacb6c Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 14 Sep 2024 08:17:25 +0000 Subject: [PATCH 18/80] Accepting request 1200983 from home:dziobian:gulgul-ultron:19 - New upstream release 30.5.1 * Disable XDG portals when an old version is installed since it leads to defaultPath not working in open file dialog. * Restored Chromium default Content-Disposition header parsing. - x86_64, ix86: enable GDB support. Run Electron with --js-flags=--gdbjit_full to see JS stack traces in debugger. - Remove more bundled libraries from tarball. OBS-URL: https://build.opensuse.org/request/show/1200983 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=170 --- create_tarball.sh | 4 +++- electron-30.5.0.tar.zst | 3 --- electron-30.5.1.tar.zst | 3 +++ nodejs-electron.changes | 9 +++++++++ nodejs-electron.spec | 13 +++++++++++-- 5 files changed, 26 insertions(+), 6 deletions(-) delete mode 100644 electron-30.5.0.tar.zst create mode 100644 electron-30.5.1.tar.zst diff --git a/create_tarball.sh b/create_tarball.sh index 74bf688..76d713f 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -323,7 +323,9 @@ if [ $? -ne 0 ]; then cleanup_and_exit 1 fi # Now remove additional bundled/duplicate libraries in node/deps -rm -rf third_party/electron_node/deps/{googletest/{include,src},icu-small} #292MB and vendored +rm -rf third_party/electron_node/deps/{googletest/{include,src},icu-small,corepack} #292MB and vendored +#rm -rf third_party/electron_node/tools/gyp 15.6 has too old gyp, not unbundling for now. +rm -rf third_party/electron_node/tools/inspector_protocol/jinja2 find third_party/electron_node/deps/brotli -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/cares -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete diff --git a/electron-30.5.0.tar.zst b/electron-30.5.0.tar.zst deleted file mode 100644 index ed7b84a..0000000 --- a/electron-30.5.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:85fa505a8c6b0d13e0af3dc2932a99bc556d0172fc1ef73d8fc2f40c80356270 -size 588034335 diff --git a/electron-30.5.1.tar.zst b/electron-30.5.1.tar.zst new file mode 100644 index 0000000..e129823 --- /dev/null +++ b/electron-30.5.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f63fac2464ee585707d9fccdfb7e6392a05ea5b823a8386f322cfc6ebed6d78d +size 587969424 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index d7de02f..b45438d 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Sep 14 08:13:25 UTC 2024 - Bruno Pitrus + +- New upstream release 30.5.1 + * Disable XDG portals when an old version is installed since it leads to defaultPath not working in open file dialog. + * Restored Chromium default Content-Disposition header parsing. +- x86_64, ix86: enable GDB support. Run Electron with --js-flags=--gdbjit_full to see JS stack traces in debugger. +- Remove more bundled libraries from tarball. + ------------------------------------------------------------------- Fri Sep 6 06:16:32 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index b5d605a..517d139 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -76,7 +76,11 @@ BuildArch: i686 %bcond_with v4l2 %bcond_with vaapi - +%ifarch %arm aarch64 riscv64 +%bcond_with gdbjit +%else +%bcond_without gdbjit +%endif %ifnarch %ix86 %arm aarch64 %if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}) @@ -229,7 +233,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 30.5.0 +Version: 30.5.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -1366,6 +1370,11 @@ myconf_gn+=" gcc_lto=true" # endif with lto %endif +%if %{with gdbjit} +#Enable GDB protocol (--js-flags=--gdbjit_full). It's disabled by default in Chromium but very useful for Node/Electron +myconf_gn+=' v8_enable_gdbjit=true' +%endif + %if %{with pipewire} myconf_gn+=" rtc_use_pipewire=true rtc_link_pipewire=true" -- 2.51.1 From f9784f925809c726f7bf8f467286f78bb78cabccc7ba3fa836c8fad015a99bd4 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 16 Sep 2024 18:02:24 +0000 Subject: [PATCH 19/80] Accepting request 1201463 from home:dziobian:gulgul-ultron:19 - Update to 31.6.0 * ABI break: NODE_MODULE_VERSION is now 125 * Chromium 126.0.6478.234 * Node 20.17.0 * V8 12.6 * Breaking change: Remove WebSQL support * Breaking change: nativeImage.toDataURL will preserve PNG colorspace * Added options parameter to Session.clearData API. * Extended webContents.setWindowOpenHandler to support manual creation of BrowserWindow. * clearData method added to Session * Extended WebContentsView to accept pre-existing webContents object. * see https://www.electronjs.org/blog/electron-31-0 and https://github.com/electron/electron/releases/tag/v31.0.0 for more - Drop no longer needed patches * electron-13-fix-use-thin-lto.patch * remove-openscreen.patch * system-yuv.patch * chromium-122-abseil-shims.patch * electron-16-std-vector-non-const.patch * fake_ssl_socket_client-Wlto-type-mismatch.patch * angle-FramebufferVk-powf.patch * span_reader-missing-optional.patch * bitset-missing-uint8_t-memcpy.patch * temporal_scalability_id_extractor-missing-bitset.patch * gpu_adapter_info-missing-optional.patch * first_party_sets_handler_database_helper-missing-optional.patch * async_iterable-forwarding.patch * script_streamer-atomic-include.patch - Add patches to fix build * fix-build-without-safebrowsing.patch * fix-build-without-supervised-users.patch * Cr126-abseil-shims.patch * absl-base-dynamic_annotations.patch * webp-no-sharpyuv.patch * http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch * angle-State-constexpr.patch * color_provider-incomplete-ColorProviderInternal.patch * run_segmenter-missing-optional.patch * page_popup_controller-missing-optional.patch * native_css_paint_definition-expected-unqualified-id.patch * text_decoder-missing-optional.patch * real_time_reporting_bindings-forward-declaration.patch * blink-platform-INSIDE_BLINK-Wodr.patch * quiche-QuicIntervalDeque-no-match-for-operator-mm.patch * ConsumeRadii-linker-error.patch - Conditionally revert upstreamed ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch on old ffmpeg - Revert upstream changes to build with system abseil (quiche-absl-HexStringToBytes.patch) - Refresh bad-font-gc patches from Debian - aarch64: disable LTO also on Fedora 39 due to OOM OBS-URL: https://build.opensuse.org/request/show/1201463 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=171 --- ConsumeRadii-linker-error.patch | 15 + Cr122-ffmpeg-new-channel-layout.patch | 4 +- Cr126-abseil-shims.patch | 65 +++ RenderFrameHostImpl-use-after-free.patch | 2 +- absl-base-dynamic_annotations.patch | 27 ++ angle-FramebufferVk-powf.patch | 39 -- angle-State-constexpr.patch | 134 ++++++ angle-system-xxhash.patch | 2 +- async_iterable-forwarding.patch | 98 ----- bad-font-gc00.patch | 10 +- bad-font-gc11.patch | 73 ++-- bad-font-gc2.patch | 156 +++---- bitset-missing-uint8_t-memcpy.patch | 46 -- blink-platform-INSIDE_BLINK-Wodr.patch | 45 ++ brotli-remove-shared-dictionary.patch | 14 +- chromium-102-compiler.patch | 66 +-- chromium-122-abseil-shims.patch | 408 ------------------ chromium-124-shims.patch | 17 +- chromium-93-ffmpeg-4.4.patch | 2 +- ...der-incomplete-ColorProviderInternal.patch | 44 ++ create_tarball.sh | 3 +- disable-catapult.patch | 6 +- disable-webspeech.patch | 15 +- electron-13-fix-use-thin-lto.patch | 18 - electron-30.5.1.tar.zst | 3 - electron-31.6.0.tar.zst | 3 + ...ssl_socket_client-Wlto-type-mismatch.patch | 20 - ffmpeg-new-channel-layout.patch | 27 -- ...ler_database_helper-missing-optional.patch | 31 -- fix-build-without-safebrowsing.patch | 31 ++ fix-build-without-supervised-users.patch | 60 +++ gpu_adapter_info-missing-optional.patch | 32 -- harfbuzz-replace-chromium-scoped-type.patch | 11 +- ...anism-could-not-convert-to-base-span.patch | 36 ++ ...t_definition-expected-unqualified-id.patch | 37 ++ nodejs-electron.changes | 52 +++ nodejs-electron.spec | 63 +-- page_popup_controller-missing-optional.patch | 42 ++ partition_alloc-no-lto.patch | 107 +++-- ...tervalDeque-no-match-for-operator-mm.patch | 67 +++ quiche-absl-HexStringToBytes.patch | 125 ++++++ ...porting_bindings-forward-declaration.patch | 37 ++ remove-dawn.patch | 29 +- remove-openscreen.patch | 10 - remove-password-manager-and-policy.patch | 111 ++++- remove-rust.patch | 62 ++- remove-sync.patch | 125 +++--- run_segmenter-missing-optional.patch | 34 ++ script_streamer-atomic-include.patch | 39 -- span_reader-missing-optional.patch | 32 -- system-six.patch | 2 +- system-yuv.patch | 18 - ...lability_id_extractor-missing-bitset.patch | 32 -- text_decoder-missing-optional.patch | 28 ++ wayland-proto-31-cursor-shape.patch | 115 ----- webp-no-sharpyuv.patch | 23 + 56 files changed, 1398 insertions(+), 1355 deletions(-) create mode 100644 ConsumeRadii-linker-error.patch create mode 100644 Cr126-abseil-shims.patch create mode 100644 absl-base-dynamic_annotations.patch delete mode 100644 angle-FramebufferVk-powf.patch create mode 100644 angle-State-constexpr.patch delete mode 100644 async_iterable-forwarding.patch delete mode 100644 bitset-missing-uint8_t-memcpy.patch create mode 100644 blink-platform-INSIDE_BLINK-Wodr.patch delete mode 100644 chromium-122-abseil-shims.patch create mode 100644 color_provider-incomplete-ColorProviderInternal.patch delete mode 100644 electron-13-fix-use-thin-lto.patch delete mode 100644 electron-30.5.1.tar.zst create mode 100644 electron-31.6.0.tar.zst delete mode 100644 fake_ssl_socket_client-Wlto-type-mismatch.patch delete mode 100644 first_party_sets_handler_database_helper-missing-optional.patch create mode 100644 fix-build-without-safebrowsing.patch create mode 100644 fix-build-without-supervised-users.patch delete mode 100644 gpu_adapter_info-missing-optional.patch create mode 100644 http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch create mode 100644 native_css_paint_definition-expected-unqualified-id.patch create mode 100644 page_popup_controller-missing-optional.patch create mode 100644 quiche-QuicIntervalDeque-no-match-for-operator-mm.patch create mode 100644 quiche-absl-HexStringToBytes.patch create mode 100644 real_time_reporting_bindings-forward-declaration.patch delete mode 100644 remove-openscreen.patch create mode 100644 run_segmenter-missing-optional.patch delete mode 100644 script_streamer-atomic-include.patch delete mode 100644 span_reader-missing-optional.patch delete mode 100644 system-yuv.patch delete mode 100644 temporal_scalability_id_extractor-missing-bitset.patch create mode 100644 text_decoder-missing-optional.patch create mode 100644 webp-no-sharpyuv.patch diff --git a/ConsumeRadii-linker-error.patch b/ConsumeRadii-linker-error.patch new file mode 100644 index 0000000..73f4b14 --- /dev/null +++ b/ConsumeRadii-linker-error.patch @@ -0,0 +1,15 @@ +--- src/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc.orig ++++ src/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc +@@ -7654,6 +7654,12 @@ template bool ConsumeRadii(CSSValue* hor + const CSSParserContext& context, + bool use_legacy_parsing); + ++template bool ConsumeRadii(CSSValue* horizontal_radii[4], ++ CSSValue* vertical_radii[4], ++ CSSParserTokenRange& stream, ++ const CSSParserContext& context, ++ bool use_legacy_parsing); ++ + template + requires std::is_same_v || + std::is_same_v diff --git a/Cr122-ffmpeg-new-channel-layout.patch b/Cr122-ffmpeg-new-channel-layout.patch index da6bebf..4b450d6 100644 --- a/Cr122-ffmpeg-new-channel-layout.patch +++ b/Cr122-ffmpeg-new-channel-layout.patch @@ -178,7 +178,7 @@ index 3c97e4a6cf4c7..a55e4ab51d5b3 100644 - smpte_st_2086.luminance_min = av_q2d(mdcv->min_luminance); - } - -- // TODO(https://crbug.com/1446302): Consider rejecting metadata that +- // TODO(crbug.com/40268540): Consider rejecting metadata that - // does not specify all values. - if (mdcv->has_primaries || mdcv->has_luminance) { - hdr_metadata.smpte_st_2086 = smpte_st_2086; @@ -221,7 +221,7 @@ index 3c97e4a6cf4c7..a55e4ab51d5b3 100644 + smpte_st_2086.luminance_min = av_q2d(mdcv->min_luminance); + } + -+ // TODO(https://crbug.com/1446302): Consider rejecting metadata that ++ // TODO(crbug.com/40268540): Consider rejecting metadata that + // does not specify all values. + if (mdcv->has_primaries || mdcv->has_luminance) { + hdr_metadata.smpte_st_2086 = smpte_st_2086; diff --git a/Cr126-abseil-shims.patch b/Cr126-abseil-shims.patch new file mode 100644 index 0000000..4f3c0d2 --- /dev/null +++ b/Cr126-abseil-shims.patch @@ -0,0 +1,65 @@ +From b90d7410221d30c40a0d5ac1ff0041667fd8db0e Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Wed, 26 Jun 2024 00:56:57 +0000 +Subject: [PATCH] unbundle: update absl shims + +Change-Id: I6fca3a8fd333c027fe48d8871073c79e7d8c3cd6 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5657110 +Reviewed-by: Lei Zhang +Reviewed-by: Thomas Anderson +Commit-Queue: Thomas Anderson +Cr-Commit-Position: refs/heads/main@{#1319524} +--- + build/linux/unbundle/absl_debugging.gn | 2 ++ + build/linux/unbundle/absl_random.gn | 5 +++++ + build/linux/unbundle/absl_status.gn | 2 ++ + build/linux/unbundle/absl_types.gn | 2 ++ + 4 files changed, 11 insertions(+) + +diff --git a/build/linux/unbundle/absl_debugging.gn b/build/linux/unbundle/absl_debugging.gn +index 5fbd34abbc96ae..b59a45b0913116 100644 +--- a/build/linux/unbundle/absl_debugging.gn ++++ b/build/linux/unbundle/absl_debugging.gn +@@ -46,5 +46,7 @@ source_set("symbolize") { + public_configs = [ ":system_absl_symbolize" ] + } + ++source_set("demangle_rust_test") { ++} + source_set("stacktrace_test") { + } +diff --git a/build/linux/unbundle/absl_random.gn b/build/linux/unbundle/absl_random.gn +index 7bb70241ad1f8d..eae95345e491d1 100644 +--- a/build/linux/unbundle/absl_random.gn ++++ b/build/linux/unbundle/absl_random.gn +@@ -57,3 +57,8 @@ source_set("random") { + deps = [ ":random_shim" ] + public_configs = [ ":system_absl_random_random" ] + } ++ ++group("distributions_test") { ++} ++group("mock_distributions_test") { ++} +diff --git a/build/linux/unbundle/absl_status.gn b/build/linux/unbundle/absl_status.gn +index 5f1e73a6d4d133..1905485814986e 100644 +--- a/build/linux/unbundle/absl_status.gn ++++ b/build/linux/unbundle/absl_status.gn +@@ -38,3 +38,5 @@ source_set("status_test") { + } + source_set("statusor_test") { + } ++source_set("status_matchers_test") { ++} +diff --git a/build/linux/unbundle/absl_types.gn b/build/linux/unbundle/absl_types.gn +index 4bb77f1b631cbd..8d2b1314558f2c 100644 +--- a/build/linux/unbundle/absl_types.gn ++++ b/build/linux/unbundle/absl_types.gn +@@ -93,5 +93,7 @@ source_set("variant") { + + source_set("optional_test") { + } ++source_set("span_test") { ++} + source_set("variant_test") { + } diff --git a/RenderFrameHostImpl-use-after-free.patch b/RenderFrameHostImpl-use-after-free.patch index 3a6a658..03679fb 100644 --- a/RenderFrameHostImpl-use-after-free.patch +++ b/RenderFrameHostImpl-use-after-free.patch @@ -6,8 +6,8 @@ #include +#include #include + #include #include - #include @@ -1818,7 +1819,12 @@ RenderFrameHostImpl::~RenderFrameHostImp // `DocumentService` and `RenderFrameHostUserData` subclasses are still valid // when their destructors run. diff --git a/absl-base-dynamic_annotations.patch b/absl-base-dynamic_annotations.patch new file mode 100644 index 0000000..3473afd --- /dev/null +++ b/absl-base-dynamic_annotations.patch @@ -0,0 +1,27 @@ +From 91a8dd6bff0c3965ab324b5c2a3c19c0a2931831 Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Sat, 29 Jun 2024 00:26:40 +0000 +Subject: [PATCH] unbundle: add missing absl_base header + +Change-Id: Ie4edda0ec8661437652b2c4c324ac82137bfcfed +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5659519 +Reviewed-by: Thomas Anderson +Reviewed-by: Lei Zhang +Commit-Queue: Thomas Anderson +Cr-Commit-Position: refs/heads/main@{#1321266} +--- + build/linux/unbundle/absl_base.gn | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/build/linux/unbundle/absl_base.gn b/build/linux/unbundle/absl_base.gn +index 7da86e46147bdd..b5ce0863e6fde7 100644 +--- a/build/linux/unbundle/absl_base.gn ++++ b/build/linux/unbundle/absl_base.gn +@@ -27,6 +27,7 @@ shim_headers("base_shim") { + headers = [ + "call_once.h", + "casts.h", ++ "dynamic_annotations.h", + ] + } + diff --git a/angle-FramebufferVk-powf.patch b/angle-FramebufferVk-powf.patch deleted file mode 100644 index 7d1c0db..0000000 --- a/angle-FramebufferVk-powf.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 2f934a47e9709cac9ce04d312b7aa496948bced6 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Mon, 18 Mar 2024 12:53:27 +0100 -Subject: [PATCH] libstdc++: replace std::powf with std:pow - -libstdc++ before GCC 14 does not provide std::powf. So replace the -call with std::pow, that provides an overload for floats. - -For reference of the bug tracking the missing methods in libstdc++: -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700 - -Bug: chromium:41455655 -Change-Id: Idfb53fe3c71f4dc0198cf6ba3e26c07895f65bc6 -Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5379670 -Commit-Queue: Shahbaz Youssefi -Reviewed-by: Shahbaz Youssefi ---- - src/libANGLE/renderer/vulkan/FramebufferVk.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp -index 98831436adb..e88339521e6 100644 ---- a/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp -+++ b/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp -@@ -1726,10 +1726,10 @@ angle::Result FramebufferVk::generateFragmentShadingRateWithCPU( - for (uint32_t point = 0; point < activeFocalPoints.size(); point++) - { - float density = -- 1.0f / std::max(std::powf(activeFocalPoints[point].focalX - px, 2) * -- std::powf(activeFocalPoints[point].gainX, 2) + -- std::powf(activeFocalPoints[point].focalY - py, 2) * -- std::powf(activeFocalPoints[point].gainY, 2) - -+ 1.0f / std::max(std::pow(activeFocalPoints[point].focalX - px, 2.0f) * -+ std::pow(activeFocalPoints[point].gainX, 2.0f) + -+ std::pow(activeFocalPoints[point].focalY - py, 2.0f) * -+ std::pow(activeFocalPoints[point].gainY, 2.0f) - - activeFocalPoints[point].foveaArea, - 1.0f); - diff --git a/angle-State-constexpr.patch b/angle-State-constexpr.patch new file mode 100644 index 0000000..210d679 --- /dev/null +++ b/angle-State-constexpr.patch @@ -0,0 +1,134 @@ +From 0508fc9b920b001115f80790e4942ff69d3f5de1 Mon Sep 17 00:00:00 2001 +From: Roman Lavrov +Date: Tue, 23 Apr 2024 15:32:52 -0400 +Subject: [PATCH] Reland "Cleanup: replace DirtyObjectType check with constexpr + generator" + +Avoid using lambdas with member function pointers which caused issues +on MSVC C++17. + +This is a reland of commit 89caa0e1d99e45f3d6f355f6e14c147f8de3e0e5 + +Original change's description: +> Cleanup: replace DirtyObjectType check with constexpr generator +> +> Static assert was meant to avoid kDirtyObjectHandlers getting out of +> sync, but it doesn't achieve that goal as it's just comparing values +> with ints which is confusing. +> +> Replacing with constexpr generated std::array. C++20 allows to easily +> validate that all values are set by _not_ default-initializing +> `handlers`. C++17 makes it trickier, addeded static_assert on an +> additional static constexpr bool (silly but I can't find a more concise +> way) +> +> Bug: angleproject:8666 +> Bug: b/335295728 +> Change-Id: Idf9bbd087d09d5ba253a7587ce0503cae3fcf3a7 +> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5478231 +> Reviewed-by: Shahbaz Youssefi +> Commit-Queue: Roman Lavrov + +Bug: angleproject:8666 +Bug: b/335295728 +Change-Id: I62e66b700512e072ef10cc57a17e8837a534c0d5 +Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5589285 +Commit-Queue: Roman Lavrov +Reviewed-by: Shahbaz Youssefi +--- + src/libANGLE/State.cpp | 2 -- + src/libANGLE/State.h | 67 +++++++++++++++++++++++++----------------- + 2 files changed, 40 insertions(+), 29 deletions(-) + +diff --git a/src/libANGLE/State.h b/src/libANGLE/State.h +index b2aa6749060..38a219f489d 100644 +--- src/third_party/angle/src/libANGLE/State.h.orig 2024-07-24 12:51:20.205804675 +0200 ++++ src/third_party/angle/src/libANGLE/State.h 2024-07-26 14:11:54.188991370 +0200 +@@ -1447,41 +1447,46 @@ class State : angle::NonCopyable + angle::Result syncProgramPipelineObject(const Context *context, Command command); + + using DirtyObjectHandler = angle::Result (State::*)(const Context *context, Command command); ++ using DirtyObjectHandlerArray = std::array; + +- static constexpr std::array kDirtyObjectHandlers = +- []() { +- // Work around C++'s lack of array element support in designated initializers +- std::array handlers{}; +- +- handlers[state::DIRTY_OBJECT_ACTIVE_TEXTURES] = &State::syncActiveTextures; +- handlers[state::DIRTY_OBJECT_TEXTURES_INIT] = &State::syncTexturesInit; +- handlers[state::DIRTY_OBJECT_IMAGES_INIT] = &State::syncImagesInit; +- handlers[state::DIRTY_OBJECT_READ_ATTACHMENTS] = &State::syncReadAttachments; +- handlers[state::DIRTY_OBJECT_DRAW_ATTACHMENTS] = &State::syncDrawAttachments; +- handlers[state::DIRTY_OBJECT_READ_FRAMEBUFFER] = &State::syncReadFramebuffer; +- handlers[state::DIRTY_OBJECT_DRAW_FRAMEBUFFER] = &State::syncDrawFramebuffer; +- handlers[state::DIRTY_OBJECT_VERTEX_ARRAY] = &State::syncVertexArray; +- handlers[state::DIRTY_OBJECT_TEXTURES] = &State::syncTextures; +- handlers[state::DIRTY_OBJECT_IMAGES] = &State::syncImages; +- handlers[state::DIRTY_OBJECT_SAMPLERS] = &State::syncSamplers; +- handlers[state::DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT] = +- &State::syncProgramPipelineObject; +- +- return handlers; +- }(); +- +- static_assert( +- []() { +- for (auto handler : kDirtyObjectHandlers) ++ static constexpr DirtyObjectHandlerArray MakeDirtyObjectHandlers() ++ { ++ // Work around C++'s lack of array element support in designated initializers ++ // This function cannot be a lambda due to MSVC C++17 limitations b/330910097#comment5 ++ DirtyObjectHandlerArray handlers{}; ++ ++ handlers[state::DIRTY_OBJECT_ACTIVE_TEXTURES] = &State::syncActiveTextures; ++ handlers[state::DIRTY_OBJECT_TEXTURES_INIT] = &State::syncTexturesInit; ++ handlers[state::DIRTY_OBJECT_IMAGES_INIT] = &State::syncImagesInit; ++ handlers[state::DIRTY_OBJECT_READ_ATTACHMENTS] = &State::syncReadAttachments; ++ handlers[state::DIRTY_OBJECT_DRAW_ATTACHMENTS] = &State::syncDrawAttachments; ++ handlers[state::DIRTY_OBJECT_READ_FRAMEBUFFER] = &State::syncReadFramebuffer; ++ handlers[state::DIRTY_OBJECT_DRAW_FRAMEBUFFER] = &State::syncDrawFramebuffer; ++ handlers[state::DIRTY_OBJECT_VERTEX_ARRAY] = &State::syncVertexArray; ++ handlers[state::DIRTY_OBJECT_TEXTURES] = &State::syncTextures; ++ handlers[state::DIRTY_OBJECT_IMAGES] = &State::syncImages; ++ handlers[state::DIRTY_OBJECT_SAMPLERS] = &State::syncSamplers; ++ handlers[state::DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT] = &State::syncProgramPipelineObject; ++ ++ // If a handler is missing, reset everything for ease of static_assert ++ for (auto handler : handlers) ++ { ++ if (handler == nullptr) + { +- if (handler == nullptr) +- { +- return false; +- } ++ return DirtyObjectHandlerArray(); + } +- return true; +- }(), +- "kDirtyObjectHandlers missing a handler"); ++ } ++ ++ return handlers; ++ } ++ ++ angle::Result dirtyObjectHandler(size_t dirtyObject, const Context *context, Command command) ++ { ++ static constexpr DirtyObjectHandlerArray handlers = MakeDirtyObjectHandlers(); ++ static_assert(handlers[0] != nullptr, "MakeDirtyObjectHandlers missing a handler"); ++ ++ return (this->*handlers[dirtyObject])(context, command); ++ } + + // Robust init must happen before Framebuffer init for the Vulkan back-end. + static_assert(state::DIRTY_OBJECT_ACTIVE_TEXTURES < state::DIRTY_OBJECT_TEXTURES_INIT, +@@ -1606,7 +1611,7 @@ ANGLE_INLINE angle::Result State::syncDi + + for (size_t dirtyObject : dirtyObjects) + { +- ANGLE_TRY((this->*kDirtyObjectHandlers[dirtyObject])(context, command)); ++ ANGLE_TRY(dirtyObjectHandler(dirtyObject, context, command)); + } + + mDirtyObjects &= ~dirtyObjects; diff --git a/angle-system-xxhash.patch b/angle-system-xxhash.patch index 1fea676..17bda4b 100644 --- a/angle-system-xxhash.patch +++ b/angle-system-xxhash.patch @@ -11,8 +11,8 @@ "src/common/base", - "src/common/third_party/xxhash", ] + libs = [] if (is_android) { - libs = [ "log" ] @@ -431,18 +432,12 @@ } } diff --git a/async_iterable-forwarding.patch b/async_iterable-forwarding.patch deleted file mode 100644 index 128755a..0000000 --- a/async_iterable-forwarding.patch +++ /dev/null @@ -1,98 +0,0 @@ -From e4d212302ed2e71c224ae67bdaf2a2816be34f21 Mon Sep 17 00:00:00 2001 -From: Mattias Buelens -Date: Tue, 26 Mar 2024 19:25:54 +0000 -Subject: [PATCH] streams: Fix gcc compatibility for - ReadableStream::valuesForBinding() - -The perfect forwarding technique we used turned out to be incompatible -with gcc. Revert to something simpler. - -Bug: 40612900 -Change-Id: I45f3588354fe96159c7f84d969ac222a935b1c1a -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5372645 -Reviewed-by: Adam Rice -Reviewed-by: Yuki Shiino -Commit-Queue: Adam Rice -Cr-Commit-Position: refs/heads/main@{#1278534} ---- - .../bindings/core/v8/async_iterable.h | 32 +++++++++---------- - 1 file changed, 16 insertions(+), 16 deletions(-) - -diff --git a/third_party/blink/renderer/bindings/core/v8/async_iterable.h b/third_party/blink/renderer/bindings/core/v8/async_iterable.h -index 115ee5303414c..8a0d085b8174e 100644 ---- a/third_party/blink/renderer/bindings/core/v8/async_iterable.h -+++ b/third_party/blink/renderer/bindings/core/v8/async_iterable.h -@@ -200,42 +200,42 @@ class PairAsyncIterable { - PairAsyncIterable(const PairAsyncIterable&) = delete; - PairAsyncIterable& operator=(const PairAsyncIterable&) = delete; - -+ template - AsyncIteratorType* keysForBinding( - ScriptState* script_state, -- std::convertible_to auto&&... args, -- ExceptionState& exception_state) { -+ ArgsAndExceptionState&&... args_and_exception_state) { - const auto kind = IterationSource::Kind::kKey; - IterationSource* source = CreateIterationSource( -- script_state, kind, std::forward(args)..., -- exception_state); -+ script_state, kind, -+ std::forward(args_and_exception_state)...); - if (!source) { - return nullptr; - } - return MakeGarbageCollected(source); - } - -+ template - AsyncIteratorType* valuesForBinding( - ScriptState* script_state, -- std::convertible_to auto&&... args, -- ExceptionState& exception_state) { -+ ArgsAndExceptionState&&... args_and_exception_state) { - const auto kind = IterationSource::Kind::kValue; - IterationSource* source = CreateIterationSource( -- script_state, kind, std::forward(args)..., -- exception_state); -+ script_state, kind, -+ std::forward(args_and_exception_state)...); - if (!source) { - return nullptr; - } - return MakeGarbageCollected(source); - } - -+ template - AsyncIteratorType* entriesForBinding( - ScriptState* script_state, -- std::convertible_to auto&&... args, -- ExceptionState& exception_state) { -+ ArgsAndExceptionState&&... args_and_exception_state) { - const auto kind = IterationSource::Kind::kKeyValue; - IterationSource* source = CreateIterationSource( -- script_state, kind, std::forward(args)..., -- exception_state); -+ script_state, kind, -+ std::forward(args_and_exception_state)...); - if (!source) { - return nullptr; - } -@@ -274,14 +274,14 @@ class ValueAsyncIterable { - ValueAsyncIterable(const ValueAsyncIterable&) = delete; - ValueAsyncIterable& operator=(const ValueAsyncIterable&) = delete; - -+ template - AsyncIteratorType* valuesForBinding( - ScriptState* script_state, -- std::convertible_to auto&&... args, -- ExceptionState& exception_state) { -+ ArgsAndExceptionState&&... args_and_exception_state) { - const auto kind = IterationSource::Kind::kValue; - IterationSource* source = CreateIterationSource( -- script_state, kind, std::forward(args)..., -- exception_state); -+ script_state, kind, -+ std::forward(args_and_exception_state)...); - if (!source) { - return nullptr; - } diff --git a/bad-font-gc00.patch b/bad-font-gc00.patch index 01c905a..f6a96eb 100644 --- a/bad-font-gc00.patch +++ b/bad-font-gc00.patch @@ -92,17 +92,17 @@ Date: Tue Feb 20 18:35:11 2024 +0000 --- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -167,7 +167,8 @@ static hb_bool_t HarfBuzzGetGlyphVertica +@@ -202,7 +202,8 @@ void* user_data) { HarfBuzzFontData* hb_font_data = reinterpret_cast(font_data); - OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); + scoped_refptr vertical_data = -+ hb_font_data->VerticalData(); - if (!vertical_data) ++ hb_font_data->VerticalData(); + if (!vertical_data) { return false; - -@@ -186,7 +187,8 @@ static hb_position_t HarfBuzzGetGlyphVer + } +@@ -223,7 +223,8 @@ static hb_position_t HarfBuzzGetGlyphVer void* user_data) { HarfBuzzFontData* hb_font_data = reinterpret_cast(font_data); diff --git a/bad-font-gc11.patch b/bad-font-gc11.patch index f75d623..2611918 100644 --- a/bad-font-gc11.patch +++ b/bad-font-gc11.patch @@ -21,8 +21,10 @@ Date: Tue Feb 20 17:40:39 2024 +0000 Commit-Queue: Ian Kilpatrick Cr-Commit-Position: refs/heads/main@{#1262752} ---- a/third_party/blink/renderer/platform/fonts/font_global_context.cc -+++ b/third_party/blink/renderer/platform/fonts/font_global_context.cc +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.cc +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/font_global_context.cc ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.cc @@ -8,6 +8,7 @@ #include "third_party/blink/renderer/platform/fonts/font_cache.h" #include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h" @@ -47,8 +49,10 @@ Date: Tue Feb 20 17:40:39 2024 +0000 IdentifiableToken FontGlobalContext::GetOrComputeTypefaceDigest( const FontPlatformData& source) { SkTypeface* typeface = source.Typeface(); ---- a/third_party/blink/renderer/platform/fonts/font_global_context.h -+++ b/third_party/blink/renderer/platform/fonts/font_global_context.h +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.h +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/font_global_context.h ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.h @@ -9,7 +9,6 @@ #include "base/types/pass_key.h" #include "third_party/blink/public/common/privacy_budget/identifiable_token.h" @@ -88,9 +92,11 @@ Date: Tue Feb 20 17:40:39 2024 +0000 std::unique_ptr font_unique_name_lookup_; base::HashingLRUCache typeface_digest_cache_; base::HashingLRUCache ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -64,14 +64,20 @@ namespace blink { +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -67,14 +67,20 @@ namespace blink { HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, uint64_t unique_id) @@ -115,8 +121,8 @@ Date: Tue Feb 20 17:40:39 2024 +0000 - visitor->Trace(harfbuzz_font_data_); } - static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font, -@@ -234,17 +240,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + bool& GetIgnoreVariationSelectors() { +@@ -287,17 +293,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr hb::unique_ptr glyphs(hb_set_create()); @@ -136,7 +142,7 @@ Date: Tue Feb 20 17:40:39 2024 +0000 DCHECK(face); harfbuzz_font_data_->space_in_gpos_ = hb_ot_layout_has_positioning(face) && -@@ -258,11 +261,10 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr +@@ -311,11 +314,10 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr if (features & kLigatures && harfbuzz_font_data_->space_in_gsub_ == HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { @@ -150,7 +156,7 @@ Date: Tue Feb 20 17:40:39 2024 +0000 DCHECK(face); harfbuzz_font_data_->space_in_gsub_ = hb_ot_layout_has_substitution(face) && -@@ -280,14 +282,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr +@@ -333,14 +335,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr } unsigned HarfBuzzFace::UnitsPerEmFromHeadTable() { @@ -168,7 +174,16 @@ Date: Tue Feb 20 17:40:39 2024 +0000 return glyph; } -@@ -444,10 +446,9 @@ static hb::unique_ptr CreateF +@@ -349,7 +351,7 @@ hb_codepoint_t HarfBuzzFace::HarfBuzzGet + UChar32 variation_selector) { + DCHECK(RuntimeEnabledFeatures::FontVariationSequencesEnabled()); + hb_codepoint_t glyph = 0; +- HarfBuzzGetGlyph(harfbuzz_font_data_->unscaled_font_.get(), ++ HarfBuzzGetGlyph(unscaled_font_, + harfbuzz_font_data_, character, variation_selector, &glyph, + nullptr); + return glyph; +@@ -511,10 +513,9 @@ static hb::unique_ptr CreateF return face; } @@ -182,7 +197,7 @@ Date: Tue Feb 20 17:40:39 2024 +0000 hb::unique_ptr ot_font(hb_font_create(face)); hb_ot_font_set_funcs(ot_font.get()); -@@ -466,26 +467,25 @@ HarfBuzzFontData* CreateHarfBuzzFontData +@@ -533,26 +534,25 @@ HarfBuzzFontData* CreateHarfBuzzFontData // Creating a sub font means that non-available functions // are found from the parent. hb_font_t* const unscaled_font = hb_font_create_sub_font(ot_font.get()); @@ -218,7 +233,7 @@ Date: Tue Feb 20 17:40:39 2024 +0000 } static_assert( -@@ -516,18 +516,17 @@ hb_font_t* HarfBuzzFace::GetScaledFont(s +@@ -583,18 +583,17 @@ hb_font_t* HarfBuzzFace::GetScaledFont(s vertical_layout); int scale = SkiaScalarToHarfBuzzPosition(platform_data_->size()); @@ -241,9 +256,11 @@ Date: Tue Feb 20 17:40:39 2024 +0000 } hb_font_t* HarfBuzzFace::GetScaledFont() const { ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -@@ -55,6 +55,7 @@ class HarfBuzzFace final : public Garbag +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -58,6 +58,7 @@ class PLATFORM_EXPORT HarfBuzzFace final HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); HarfBuzzFace(const HarfBuzzFace&) = delete; HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; @@ -251,7 +268,7 @@ Date: Tue Feb 20 17:40:39 2024 +0000 void Trace(Visitor*) const; -@@ -90,7 +91,11 @@ class HarfBuzzFace final : public Garbag +@@ -100,7 +101,11 @@ class PLATFORM_EXPORT HarfBuzzFace final void PrepareHarfBuzzFontData(); Member platform_data_; @@ -263,9 +280,11 @@ Date: Tue Feb 20 17:40:39 2024 +0000 + HarfBuzzFontData* harfbuzz_font_data_; }; - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc + inline constexpr hb_codepoint_t kUnmatchedVSGlyphId = +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc @@ -8,8 +8,38 @@ namespace blink { @@ -307,8 +326,10 @@ Date: Tue Feb 20 17:40:39 2024 +0000 } } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h @@ -6,9 +6,12 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_CACHE_H_ @@ -376,8 +397,10 @@ Date: Tue Feb 20 17:40:39 2024 +0000 }; } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +=================================================================== +--- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h @@ -22,18 +22,15 @@ const unsigned kInvalidFallbackMetricsVa // The HarfBuzzFontData struct carries user-pointer data for // |hb_font_t| callback functions/operations. It contains metrics and OpenType diff --git a/bad-font-gc2.patch b/bad-font-gc2.patch index 3c64b03..3c92583 100644 --- a/bad-font-gc2.patch +++ b/bad-font-gc2.patch @@ -1061,7 +1061,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 namespace blink { -@@ -169,8 +168,7 @@ void InlineBoxState::EnsureTextMetrics(c +@@ -174,8 +173,7 @@ void InlineBoxState::EnsureTextMetrics(c void InlineBoxState::AccumulateUsedFonts(const ShapeResultView* shape_result) { const auto baseline_type = style->GetFontBaseline(); @@ -1073,7 +1073,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 FontHeight fallback_metrics = --- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc +++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc -@@ -12,7 +12,6 @@ +@@ -17,7 +17,6 @@ #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" #include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/fonts/font_height.h" @@ -1081,7 +1081,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 namespace blink { -@@ -33,10 +32,11 @@ std::tuple Adjus +@@ -38,10 +37,11 @@ std::tuple Adjus primary_font_data->GetFontMetrics().FixedAscent(font_baseline); const LayoutUnit primary_descent = line_height - primary_ascent; @@ -1095,7 +1095,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 shape_view.GetRunFontData(&run_fonts); const LayoutUnit kNoDiff = LayoutUnit::Max(); LayoutUnit over_diff = kNoDiff; -@@ -60,6 +60,7 @@ std::tuple Adjus +@@ -65,6 +65,7 @@ std::tuple Adjus over_diff = std::min(over_diff, current_over_diff); under_diff = std::min(under_diff, current_under_diff); } @@ -1103,6 +1103,16 @@ Date: Tue Feb 13 19:15:19 2024 +0000 if (over_diff == kNoDiff) over_diff = LayoutUnit(); if (under_diff == kNoDiff) +@@ -85,8 +86,7 @@ FontHeight ComputeEmHeight(const Logical + FontHeight result_height; + // We don't use ShapeResultView::FallbackFonts() because we can't know if + // the primary font is actually used with FallbackFonts(). +- HeapVector run_fonts; +- ClearCollectionScope clear_scope(&run_fonts); ++ Vector run_fonts; + shape_result_view->GetRunFontData(&run_fonts); + for (const auto& run_font : run_fonts) { + const SimpleFontData* font_data = run_font.font_data_; --- a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc +++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc @@ -16,7 +16,6 @@ @@ -1125,7 +1135,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 result.font_names.insert(font_data->PlatformData().FontFamilyName()); --- a/third_party/blink/renderer/modules/font_access/font_metadata.cc +++ b/third_party/blink/renderer/modules/font_access/font_metadata.cc -@@ -77,7 +77,7 @@ void FontMetadata::BlobImpl(ScriptPromis +@@ -75,7 +75,7 @@ void FontMetadata::BlobImpl(ScriptPromis SetUpFontUniqueLookupIfNecessary(); FontDescription description; @@ -1136,7 +1146,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 if (!font_data) { --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -621,6 +621,7 @@ component("platform") { +@@ -634,6 +634,7 @@ component("platform") { "fonts/font_cache_memory_dump_provider.h", "fonts/font_custom_platform_data.cc", "fonts/font_custom_platform_data.h", @@ -1964,7 +1974,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_FOR_RANGE_SET_H_ --- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc +++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc -@@ -60,8 +60,8 @@ void FontFallbackIterator::WillUseRange( +@@ -73,8 +73,8 @@ void FontFallbackIterator::WillUseRange( selector->WillUseRange(font_description_, family, range_set); } @@ -1972,16 +1982,15 @@ Date: Tue Feb 13 19:15:19 2024 +0000 - FontDataForRangeSet* candidate, +scoped_refptr FontFallbackIterator::UniqueOrNext( + scoped_refptr candidate, - const Vector& hint_list) { + const HintCharList& hint_list) { if (!candidate->HasFontData()) return Next(hint_list); -@@ -104,18 +104,18 @@ bool FontFallbackIterator::NeedsHintList +@@ -117,17 +117,17 @@ bool FontFallbackIterator::NeedsHintList return font_data->IsSegmented(); } --FontDataForRangeSet* FontFallbackIterator::Next( -+scoped_refptr FontFallbackIterator::Next( - const Vector& hint_list) { +-FontDataForRangeSet* FontFallbackIterator::Next(const HintCharList& hint_list) { ++scoped_refptr FontFallbackIterator::Next(const HintCharList& hint_list) { if (fallback_stage_ == kOutOfLuck) - return MakeGarbageCollected(); + return base::AdoptRef(new FontDataForRangeSet()); @@ -1999,7 +2008,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 if (fallback_priority_font_range->HasFontData()) return UniqueOrNext(std::move(fallback_priority_font_range), hint_list); return Next(hint_list); -@@ -123,11 +123,11 @@ FontDataForRangeSet* FontFallbackIterato +@@ -135,11 +135,11 @@ FontDataForRangeSet* FontFallbackIterato if (fallback_stage_ == kSystemFonts) { // We've reached pref + system fallback. @@ -2014,7 +2023,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } // If we don't have options from the system fallback anymore or had -@@ -137,16 +137,18 @@ FontDataForRangeSet* FontFallbackIterato +@@ -149,16 +149,18 @@ FontDataForRangeSet* FontFallbackIterato // LastResort font, not just Times or Arial. FontCache& font_cache = FontCache::Get(); fallback_stage_ = kFirstCandidateForNotdefGlyph; @@ -2039,7 +2048,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } if (fallback_stage_ == kFirstCandidateForNotdefGlyph) { -@@ -177,13 +179,13 @@ FontDataForRangeSet* FontFallbackIterato +@@ -189,13 +191,13 @@ FontDataForRangeSet* FontFallbackIterato // Skip forward to the next font family for the next call to next(). current_font_data_index_++; if (!font_data->IsLoading()) { @@ -2055,7 +2064,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } return Next(hint_list); } -@@ -197,7 +199,7 @@ FontDataForRangeSet* FontFallbackIterato +@@ -209,7 +211,7 @@ FontDataForRangeSet* FontFallbackIterato } DCHECK_LT(segmented_face_index_, segmented->NumFaces()); @@ -2064,7 +2073,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 segmented->FaceAt(segmented_face_index_); segmented_face_index_++; -@@ -208,7 +210,7 @@ FontDataForRangeSet* FontFallbackIterato +@@ -220,7 +222,7 @@ FontDataForRangeSet* FontFallbackIterato current_font_data_index_++; } @@ -2073,7 +2082,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 const SimpleFontData* current_segmented_face_font_data = current_segmented_face->FontData(); if (const CustomFontData* current_segmented_face_custom_font_data = -@@ -222,15 +224,17 @@ FontDataForRangeSet* FontFallbackIterato +@@ -234,15 +236,17 @@ FontDataForRangeSet* FontFallbackIterato return Next(hint_list); } @@ -2097,16 +2106,16 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } return font_data; } -@@ -255,7 +259,7 @@ static inline unsigned ChooseHintIndex(c +@@ -268,7 +272,7 @@ static inline unsigned ChooseHintIndex( return 0; } -const SimpleFontData* FontFallbackIterator::UniqueSystemFontForHintList( +scoped_refptr FontFallbackIterator::UniqueSystemFontForHintList( - const Vector& hint_list) { + const HintCharList& hint_list) { // When we're asked for a fallback for the same characters again, we give up // because the shaper must have previously tried shaping with the font -@@ -270,13 +274,13 @@ const SimpleFontData* FontFallbackIterat +@@ -283,13 +287,13 @@ const SimpleFontData* FontFallbackIterat return nullptr; previously_asked_for_hint_.insert(hint); @@ -2140,33 +2149,33 @@ Date: Tue Feb 13 19:15:19 2024 +0000 namespace blink { -@@ -42,7 +43,7 @@ class FontFallbackIterator { +@@ -49,7 +50,7 @@ class PLATFORM_EXPORT FontFallbackIterat // Some system fallback APIs (Windows, Android) require a character, or a // portion of the string to be passed. On Mac and Linux, we get a list of // fonts without passing in characters. -- FontDataForRangeSet* Next(const Vector& hint_list); -+ scoped_refptr Next(const Vector& hint_list); +- FontDataForRangeSet* Next(const HintCharList& hint_list); ++ scoped_refptr Next(const HintCharList& hint_list); - private: - bool RangeSetContributesForHint(const Vector& hint_list, -@@ -50,11 +51,12 @@ class FontFallbackIterator { + void Reset(); + +@@ -59,11 +60,12 @@ class PLATFORM_EXPORT FontFallbackIterat bool AlreadyLoadingRangeForHintChar(UChar32 hint_char); void WillUseRange(const AtomicString& family, const FontDataForRangeSet&); - FontDataForRangeSet* UniqueOrNext(FontDataForRangeSet* candidate, -- const Vector& hint_list); +- const HintCharList& hint_list); + scoped_refptr UniqueOrNext( + scoped_refptr candidate, -+ const Vector& hint_list); ++ const HintCharList& hint_list); - const SimpleFontData* FallbackPriorityFont(UChar32 hint); - const SimpleFontData* UniqueSystemFontForHintList( + scoped_refptr FallbackPriorityFont(UChar32 hint); + scoped_refptr UniqueSystemFontForHintList( - const Vector& hint_list); + const HintCharList& hint_list); const FontDescription& font_description_; -@@ -82,8 +84,8 @@ class FontFallbackIterator { +@@ -91,8 +93,8 @@ class PLATFORM_EXPORT FontFallbackIterat // candidate to be used for rendering the .notdef glyph, and set HasNext() to // false. HashSet unique_font_data_for_range_sets_returned_; @@ -2327,7 +2336,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 const uint16_t generation_; --- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc +++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc -@@ -158,10 +158,6 @@ FontPlatformData::FontPlatformData(sk_sp +@@ -159,10 +159,6 @@ FontPlatformData::FontPlatformData(sk_sp FontPlatformData::~FontPlatformData() = default; @@ -2338,7 +2347,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 #if BUILDFLAG(IS_MAC) CTFontRef FontPlatformData::CtFont() const { return SkTypeface_GetCTFontRef(typeface_.get()); -@@ -213,10 +209,11 @@ SkTypeface* FontPlatformData::Typeface() +@@ -214,10 +210,11 @@ SkTypeface* FontPlatformData::Typeface() HarfBuzzFace* FontPlatformData::GetHarfBuzzFace() const { if (!harfbuzz_face_) { @@ -2352,7 +2361,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } bool FontPlatformData::HasSpaceInLigaturesOrKerning( -@@ -246,7 +243,7 @@ unsigned FontPlatformData::GetHash() con +@@ -247,7 +244,7 @@ unsigned FontPlatformData::GetHash() con } #if !BUILDFLAG(IS_MAC) @@ -2393,7 +2402,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 #if BUILDFLAG(IS_MAC) // Returns nullptr for FreeType backed SkTypefaces, compare // FontCustomPlatformData, which are used for variable fonts on Mac OS -@@ -129,7 +126,7 @@ class PLATFORM_EXPORT FontPlatformData +@@ -130,7 +127,7 @@ class PLATFORM_EXPORT FontPlatformData bool IsHashTableDeletedValue() const { return is_hash_table_deleted_value_; } #if !BUILDFLAG(IS_MAC) @@ -2402,7 +2411,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 #endif #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_MAC) -@@ -185,7 +182,7 @@ class PLATFORM_EXPORT FontPlatformData +@@ -186,7 +183,7 @@ class PLATFORM_EXPORT FontPlatformData WebFontRenderStyle style_; #endif @@ -2756,7 +2765,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 --- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -62,8 +62,7 @@ +@@ -65,8 +65,7 @@ namespace blink { @@ -2766,18 +2775,17 @@ Date: Tue Feb 13 19:15:19 2024 +0000 : platform_data_(platform_data), unique_id_(unique_id) { HbFontCacheEntry* const cache_entry = FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, -@@ -76,10 +75,6 @@ HarfBuzzFace::~HarfBuzzFace() { +@@ -79,9 +78,6 @@ HarfBuzzFace::~HarfBuzzFace() { FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); } -void HarfBuzzFace::Trace(Visitor* visitor) const { - visitor->Trace(platform_data_); -} -- - static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font, - void* font_data, - hb_codepoint_t unicode, -@@ -426,8 +421,7 @@ static hb_blob_t* HarfBuzzSkiaGetTable(h + + bool& GetIgnoreVariationSelectors() { + DEFINE_THREAD_SAFE_STATIC_LOCAL(WTF::ThreadSpecific, +@@ -486,8 +482,7 @@ static hb_blob_t* HarfBuzzSkiaGetTable(h } // TODO(yosin): We should move |CreateFace()| to "harfbuzz_font_cache.cc". @@ -2787,7 +2795,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 hb::unique_ptr face; sk_sp typeface = sk_ref_sp(platform_data->Typeface()); -@@ -475,9 +469,8 @@ static scoped_refptr C +@@ -535,9 +530,8 @@ static scoped_refptr C return cache_entry; } @@ -2801,25 +2809,27 @@ Date: Tue Feb 13 19:15:19 2024 +0000 hb::unique_ptr face = CreateFace(platform_data); --- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -@@ -34,9 +34,8 @@ +@@ -34,11 +34,10 @@ #include "third_party/blink/renderer/platform/fonts/glyph.h" #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" #include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" -#include "third_party/blink/renderer/platform/heap/garbage_collected.h" -#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +#include "third_party/blink/renderer/platform/wtf/ref_counted.h" #include "third_party/blink/renderer/platform/wtf/text/character_names.h" #include -@@ -50,15 +49,19 @@ struct HarfBuzzFontData; +@@ -52,16 +51,18 @@ struct HarfBuzzFontData; // |HarfBuzzFace| is a thread specific data associated to |FontPlatformData|, // hold by |HarfBuzzFontCache|. --class HarfBuzzFace final : public GarbageCollected { -+class HarfBuzzFace final : public RefCounted { +-class PLATFORM_EXPORT HarfBuzzFace final +- : public GarbageCollected { ++class PLATFORM_EXPORT HarfBuzzFace final : public RefCounted { + USING_FAST_MALLOC(HarfBuzzFace); -+ public: - HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); + static scoped_refptr Create(FontPlatformData* platform_data, @@ -2836,8 +2846,8 @@ Date: Tue Feb 13 19:15:19 2024 +0000 enum VerticalLayoutCallbacks { kPrepareForVerticalLayout, kNoVerticalLayout }; // In order to support the restricting effect of unicode-range optionally a -@@ -87,10 +90,11 @@ class HarfBuzzFace final : public Garbag - static void Init(); +@@ -97,10 +98,11 @@ class PLATFORM_EXPORT HarfBuzzFace final + static void SetIgnoreVariationSelectors(bool value); private: + HarfBuzzFace(FontPlatformData* platform_data, uint64_t); @@ -2862,24 +2872,24 @@ Date: Tue Feb 13 19:15:19 2024 +0000 private: --- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -@@ -784,7 +784,7 @@ void HarfBuzzShaper::ShapeSegment( +@@ -853,7 +853,7 @@ void HarfBuzzShaper::ShapeSegment( fallback_chars_hint.ReserveInitialCapacity(range_data->end - range_data->start); } - FontDataForRangeSet* current_font_data_for_range_set = nullptr; + scoped_refptr current_font_data_for_range_set; + FallbackFontStage fallback_stage = kIntermediate; while (!range_data->reshape_queue.empty()) { ReshapeQueueItem current_queue_item = range_data->reshape_queue.TakeFirst(); - -@@ -847,7 +847,7 @@ void HarfBuzzShaper::ShapeSegment( +@@ -934,7 +934,7 @@ void HarfBuzzShaper::ShapeSegment( if (needs_caps_handling) { case_map_intend = caps_support.NeedsCaseChange(small_caps_behavior); - if (caps_support.NeedsSyntheticFont(small_caps_behavior)) + if (caps_support.NeedsSyntheticFont(small_caps_behavior)) { - adjusted_font = font_data->SmallCapsFontData(font_description); + adjusted_font = font_data->SmallCapsFontData(font_description).get(); + } } - CaseMappingHarfBuzzBufferFiller( --- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc @@ -79,10 +79,9 @@ ASSERT_SIZE(ShapeResult::RunInfo, SameSi @@ -2905,7 +2915,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 unsigned start_index, unsigned num_characters, TextDirection direction) -@@ -436,7 +435,6 @@ void ShapeResult::Trace(Visitor* visitor +@@ -432,7 +431,6 @@ void ShapeResult::Trace(Visitor* visitor visitor->Trace(deprecated_ink_bounds_); visitor->Trace(runs_); visitor->Trace(character_position_); @@ -2913,7 +2923,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } size_t ShapeResult::ByteSize() const { -@@ -736,10 +734,10 @@ bool ShapeResult::HasFallbackFonts(const +@@ -732,10 +730,10 @@ bool ShapeResult::HasFallbackFonts(const return false; } @@ -2926,7 +2936,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } } -@@ -754,7 +752,7 @@ float ShapeResult::ForEachGlyphImpl(floa +@@ -750,7 +748,7 @@ float ShapeResult::ForEachGlyphImpl(floa for (const auto& glyph_data : run.glyph_data_) { glyph_callback(context, run.start_index_ + glyph_data.character_index, glyph_data.glyph, *glyph_offsets, total_advance, @@ -2935,7 +2945,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 total_advance += glyph_data.advance; ++glyph_offsets; } -@@ -789,7 +787,7 @@ float ShapeResult::ForEachGlyphImpl(floa +@@ -785,7 +783,7 @@ float ShapeResult::ForEachGlyphImpl(floa auto total_advance = initial_advance; unsigned run_start = run.start_index_ + index_offset; bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run.direction_); @@ -2944,7 +2954,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 if (run.IsLtr()) { // Left-to-right for (const auto& glyph_data : run.glyph_data_) { -@@ -1679,7 +1677,7 @@ unsigned ShapeResult::CopyRangeInternal( +@@ -1738,7 +1736,7 @@ unsigned ShapeResult::CopyRangeInternal( ShapeResult* ShapeResult::SubRange(unsigned start_offset, unsigned end_offset) const { ShapeResult* sub_range = @@ -2955,7 +2965,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } --- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.h +++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.h -@@ -139,7 +139,7 @@ typedef void (*GraphemeClusterCallback)( +@@ -136,7 +136,7 @@ typedef void (*GraphemeClusterCallback)( class PLATFORM_EXPORT ShapeResult : public GarbageCollected { public: @@ -2964,7 +2974,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 unsigned start_index, unsigned num_characters, TextDirection); -@@ -152,7 +152,7 @@ class PLATFORM_EXPORT ShapeResult : publ +@@ -149,7 +149,7 @@ class PLATFORM_EXPORT ShapeResult : publ void Trace(Visitor*) const; static ShapeResult* CreateEmpty(const ShapeResult& other) { @@ -2973,7 +2983,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 other.Direction()); } static const ShapeResult* CreateForTabulationCharacters( -@@ -184,7 +184,7 @@ class PLATFORM_EXPORT ShapeResult : publ +@@ -181,7 +181,7 @@ class PLATFORM_EXPORT ShapeResult : publ LayoutUnit SnappedWidth() const { return LayoutUnit::FromFloatCeil(width_); } unsigned NumCharacters() const { return num_characters_; } unsigned NumGlyphs() const { return num_glyphs_; } @@ -2982,7 +2992,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 bool HasFallbackFonts(const SimpleFontData* primary_font) const; // TODO(eae): Remove start_x and return value once ShapeResultBuffer has been -@@ -350,12 +350,10 @@ class PLATFORM_EXPORT ShapeResult : publ +@@ -352,12 +352,10 @@ class PLATFORM_EXPORT ShapeResult : publ // Computes the list of fonts along with the number of glyphs for each font. struct RunFontData { @@ -2997,16 +3007,16 @@ Date: Tue Feb 13 19:15:19 2024 +0000 // Iterates over, and calls the specified callback function, for all the // glyphs. Also tracks (and returns) a seeded total advance. -@@ -515,7 +513,7 @@ class PLATFORM_EXPORT ShapeResult : publ +@@ -517,7 +515,7 @@ class PLATFORM_EXPORT ShapeResult : publ // index to x-position and O(log n) time, using binary search, from // x-position to character index. mutable HeapVector character_position_; - Member primary_font_; + scoped_refptr primary_font_; - unsigned start_index_; - unsigned num_characters_; -@@ -570,6 +568,5 @@ PLATFORM_EXPORT std::ostream& operator<< + unsigned start_index_ = 0; + unsigned num_characters_ = 0; +@@ -572,6 +570,5 @@ PLATFORM_EXPORT std::ostream& operator<< } // namespace blink WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::ShapeRange) @@ -3359,7 +3369,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 } // Internal leadings can be distributed to ascent and descent. -@@ -346,7 +352,7 @@ static std::pair TypoA +@@ -347,7 +353,7 @@ static std::pair TypoA void SimpleFontData::ComputeNormalizedTypoAscentAndDescent() const { // Compute em height metrics from OS/2 sTypoAscender and sTypoDescender. @@ -3368,7 +3378,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 auto [typo_ascender, typo_descender] = TypoAscenderAndDescender(typeface); if (typo_ascender > 0 && TrySetNormalizedTypoAscentAndDescent(typo_ascender, typo_descender)) { -@@ -433,7 +439,7 @@ const std::optional& SimpleFontDa +@@ -434,7 +440,7 @@ const std::optional& SimpleFontDa } // Compute vertical advance if the orientation is `kVerticalUpright`. @@ -3377,7 +3387,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 const OpenTypeVerticalData& vertical_data = hb_face->VerticalData(); ideographic_inline_size_ = vertical_data.AdvanceHeight(cjk_water_glyph); }); -@@ -461,9 +467,8 @@ const HanKerning::FontData& SimpleFontDa +@@ -462,9 +468,8 @@ const HanKerning::FontData& SimpleFontDa } gfx::RectF SimpleFontData::PlatformBoundsForGlyph(Glyph glyph) const { @@ -3388,7 +3398,7 @@ Date: Tue Feb 13 19:15:19 2024 +0000 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); -@@ -476,18 +481,16 @@ void SimpleFontData::BoundsForGlyphs(con +@@ -477,18 +482,16 @@ void SimpleFontData::BoundsForGlyphs(con Vector* bounds) const { DCHECK_EQ(glyphs.size(), bounds->size()); diff --git a/bitset-missing-uint8_t-memcpy.patch b/bitset-missing-uint8_t-memcpy.patch deleted file mode 100644 index fc3a3a8..0000000 --- a/bitset-missing-uint8_t-memcpy.patch +++ /dev/null @@ -1,46 +0,0 @@ -From df291ec5472fa14e828633378b8c97a8c7a2e7de Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 20 Mar 2024 12:38:04 +0000 -Subject: [PATCH] IWYU: missing includes in ukm::BitSet -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Usage of uint8_t and std::memcpy require includes. - -Bug: 41455655 -Change-Id: Ib96b3c3595660fc05d37d61ba9ec36add18eba57 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5370063 -Commit-Queue: José Dapena Paz -Reviewed-by: Cait Phillips -Cr-Commit-Position: refs/heads/main@{#1275509} ---- - components/ukm/bitset.cc | 2 ++ - components/ukm/bitset.h | 1 + - 2 files changed, 3 insertions(+) - -diff --git a/components/ukm/bitset.cc b/components/ukm/bitset.cc -index 0c4faff95ed29..da83c35aa5c58 100644 ---- a/components/ukm/bitset.cc -+++ b/components/ukm/bitset.cc -@@ -4,6 +4,8 @@ - - #include "components/ukm/bitset.h" - -+#include -+ - #include "base/check_op.h" - - namespace ukm { -diff --git a/components/ukm/bitset.h b/components/ukm/bitset.h -index 9b1f88c844ef6..005ce6e329db2 100644 ---- a/components/ukm/bitset.h -+++ b/components/ukm/bitset.h -@@ -5,6 +5,7 @@ - #ifndef COMPONENTS_UKM_BITSET_H_ - #define COMPONENTS_UKM_BITSET_H_ - -+#include - #include - #include - diff --git a/blink-platform-INSIDE_BLINK-Wodr.patch b/blink-platform-INSIDE_BLINK-Wodr.patch new file mode 100644 index 0000000..0d3ec9e --- /dev/null +++ b/blink-platform-INSIDE_BLINK-Wodr.patch @@ -0,0 +1,45 @@ +--- src/third_party/blink/public/platform/web_crypto_algorithm.h.orig 2024-07-24 12:50:54.735798500 +0200 ++++ src/third_party/blink/public/platform/web_crypto_algorithm.h 2024-08-04 16:11:13.938867200 +0200 +@@ -74,18 +74,14 @@ enum WebCryptoAlgorithmId { + kWebCryptoAlgorithmIdPbkdf2, + kWebCryptoAlgorithmIdEd25519, + kWebCryptoAlgorithmIdX25519, +-#if INSIDE_BLINK + kWebCryptoAlgorithmIdLast = kWebCryptoAlgorithmIdX25519, +-#endif + }; + + enum WebCryptoNamedCurve { + kWebCryptoNamedCurveP256, + kWebCryptoNamedCurveP384, + kWebCryptoNamedCurveP521, +-#if INSIDE_BLINK + kWebCryptoNamedCurveLast = kWebCryptoNamedCurveP521, +-#endif + }; + + enum WebCryptoAlgorithmParamsType { +@@ -153,11 +149,9 @@ class WebCryptoAlgorithmPrivate; + // methods on it (other than destruction, assignment, or IsNull()). + class BLINK_PLATFORM_EXPORT WebCryptoAlgorithm { + public: +-#if INSIDE_BLINK + WebCryptoAlgorithm() = default; + WebCryptoAlgorithm(WebCryptoAlgorithmId, + std::unique_ptr); +-#endif + + static WebCryptoAlgorithm CreateNull(); + static WebCryptoAlgorithm AdoptParamsAndCreate(WebCryptoAlgorithmId, +--- src/third_party/blink/public/platform/web_crypto_key.h.orig 2024-07-24 12:50:54.735798500 +0200 ++++ src/third_party/blink/public/platform/web_crypto_key.h 2024-08-04 16:11:34.638017900 +0200 +@@ -51,9 +51,7 @@ enum WebCryptoKeyUsage { + kWebCryptoKeyUsageWrapKey = 1 << 5, + kWebCryptoKeyUsageUnwrapKey = 1 << 6, + kWebCryptoKeyUsageDeriveBits = 1 << 7, +-#if INSIDE_BLINK + kEndOfWebCryptoKeyUsage, +-#endif + }; + + // A bitfield of WebCryptoKeyUsage diff --git a/brotli-remove-shared-dictionary.patch b/brotli-remove-shared-dictionary.patch index 3747469..95f85e0 100644 --- a/brotli-remove-shared-dictionary.patch +++ b/brotli-remove-shared-dictionary.patch @@ -2,9 +2,9 @@ Partially revert https://github.com/chromium/chromium/commit/c1dc375391403442935 and disable dependent code. This removes `brs` from Accept-Encoding list. This feature does not build with brotli < 1.1 ---- src/net/filter/brotli_source_stream.cc.orig 2023-10-12 17:25:42.094020700 +0200 -+++ src/net/filter/brotli_source_stream.cc 2023-10-12 22:43:53.790708700 +0200 -@@ -13,7 +11,6 @@ +--- src/net/filter/brotli_source_stream.cc.orig 2024-07-24 12:50:53.542464800 +0200 ++++ src/net/filter/brotli_source_stream.cc 2024-08-04 21:07:52.674333900 +0200 +@@ -12,7 +12,6 @@ #include "base/metrics/histogram_macros.h" #include "net/base/io_buffer.h" #include "third_party/brotli/include/brotli/decode.h" @@ -12,7 +12,7 @@ This feature does not build with brotli < 1.1 namespace net { -@@ -25,21 +22,11 @@ const char kBrotli[] = "BROTLI"; +@@ -24,21 +23,11 @@ const char kBrotli[] = "BROTLI"; // Brotli format specification: http://www.ietf.org/id/draft-alakuijala-brotli. class BrotliSourceStream : public FilterSourceStream { public: @@ -36,17 +36,17 @@ This feature does not build with brotli < 1.1 } BrotliSourceStream(const BrotliSourceStream&) = delete; -@@ -176,9 +163,6 @@ class BrotliSourceStream : public Filter +@@ -174,9 +163,6 @@ class BrotliSourceStream : public Filter free(&array[-1]); } - const scoped_refptr dictionary_; - const size_t dictionary_size_; - - raw_ptr brotli_state_; + raw_ptr brotli_state_; DecodingStatus decoding_status_ = DecodingStatus::DECODING_IN_PROGRESS; -@@ -200,8 +184,7 @@ std::unique_ptr Crea +@@ -198,8 +184,7 @@ std::unique_ptr Crea std::unique_ptr previous, scoped_refptr dictionary, size_t dictionary_size) { diff --git a/chromium-102-compiler.patch b/chromium-102-compiler.patch index 11a0570..b11a9b0 100644 --- a/chromium-102-compiler.patch +++ b/chromium-102-compiler.patch @@ -25,7 +25,7 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index d40843b..b92f03b 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -322,9 +322,7 @@ config("compiler") { +@@ -305,9 +305,7 @@ config("compiler") { configs += [ # See the definitions below. @@ -35,7 +35,7 @@ index d40843b..b92f03b 100644 ":compiler_codegen", ":compiler_deterministic", ] -@@ -353,7 +351,12 @@ config("compiler") { +@@ -337,7 +335,12 @@ config("compiler") { if (!is_win) { # Common POSIX compiler flags setup. # -------------------------------- @@ -49,7 +49,7 @@ index d40843b..b92f03b 100644 # Stack protection. ShadowCallStack and Stack protector address the same # problems. Therefore, we only enable one or the other. Clang advertises SCS as -@@ -494,10 +497,6 @@ config("compiler") { +@@ -478,10 +481,6 @@ config("compiler") { # Linux/Android/Fuchsia common flags setup. # --------------------------------- if (is_linux || is_chromeos || is_android || is_fuchsia) { @@ -60,7 +60,7 @@ index d40843b..b92f03b 100644 if (!is_clang) { # Use pipes for communicating between sub-processes. Faster. -@@ -590,55 +589,6 @@ config("compiler") { +@@ -545,55 +544,6 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } @@ -87,9 +87,9 @@ index d40843b..b92f03b 100644 - } - } - -- # TODO(crbug.com/1488374): This causes binary size growth and potentially +- # TODO(crbug.com/40283598): This causes binary size growth and potentially - # other problems. -- # TODO(crbug.com/1491036): This isn't supported by Cronet's mainline llvm version. +- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version. - if (default_toolchain != "//build/toolchain/cros:target" && - !llvm_android_mainline) { - cflags += [ @@ -105,7 +105,7 @@ index d40843b..b92f03b 100644 - } - } - -- # TODO(crbug.com/1235145): Investigate why/if this should be needed. +- # TODO(crbug.com/40192287): Investigate why/if this should be needed. - if (is_win) { - cflags += [ "/clang:-ffp-contract=off" ] - } else { @@ -116,7 +116,7 @@ index d40843b..b92f03b 100644 # C11/C++11 compiler flags setup. # --------------------------- if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) || -@@ -1070,11 +1020,6 @@ config("compiler") { +@@ -1063,11 +1013,6 @@ config("compiler") { defines += [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ] } @@ -128,7 +128,7 @@ index d40843b..b92f03b 100644 } # The BUILDCONFIG file sets this config on targets by default, which means when -@@ -1140,7 +1085,8 @@ config("thinlto_optimize_max") { +@@ -1133,7 +1078,8 @@ config("thinlto_optimize_max") { # without using everything that "compiler" brings in. Options that # tweak code generation for a particular CPU do not belong here! # See "compiler_codegen", below. @@ -138,7 +138,7 @@ index d40843b..b92f03b 100644 cflags = [] ldflags = [] defines = [] -@@ -1523,46 +1469,6 @@ config("compiler_deterministic") { +@@ -1516,46 +1462,6 @@ config("compiler_deterministic") { } } @@ -184,8 +184,8 @@ index d40843b..b92f03b 100644 - # Tells the compiler not to use absolute paths when passing the default # paths to the tools it invokes. We don't want this because we don't - # really need it and it can mess up the goma cache entries. -@@ -1739,7 +1645,8 @@ config("treat_warnings_as_errors") { + # really need it and it can mess up the RBE cache entries. +@@ -1732,7 +1638,8 @@ config("treat_warnings_as_errors") { # Collects all warning flags that are used by default. This is used as a # subconfig of both chromium_code and no_chromium_code. This way these # flags are guaranteed to appear on the compile command line after -Wall. @@ -195,7 +195,7 @@ index d40843b..b92f03b 100644 cflags = [] cflags_c = [] cflags_cc = [] -@@ -1983,11 +1890,7 @@ config("chromium_code") { +@@ -1982,11 +1889,7 @@ config("chromium_code") { defines = [ "_HAS_NODISCARD" ] } } else { @@ -208,7 +208,7 @@ index d40843b..b92f03b 100644 # In Chromium code, we define __STDC_foo_MACROS in order to get the # C99 macros on Mac and Linux. -@@ -1996,24 +1899,6 @@ config("chromium_code") { +@@ -1995,24 +1898,6 @@ config("chromium_code") { "__STDC_FORMAT_MACROS", ] @@ -233,15 +233,15 @@ index d40843b..b92f03b 100644 if (is_apple) { cflags_objc = [ "-Wimplicit-retain-self" ] cflags_objcc = [ "-Wimplicit-retain-self" ] -@@ -2159,7 +2044,6 @@ config("no_rtti") { +@@ -2158,7 +2043,6 @@ config("no_rtti") { config("export_dynamic") { - # TODO(crbug.com/1052397): Revisit after target_os flip is completed. + # TODO(crbug.com/40118868): Revisit after target_os flip is completed. if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) { - ldflags = [ "-rdynamic" ] } } -@@ -2247,7 +2131,8 @@ config("wexit_time_destructors") { +@@ -2246,7 +2130,8 @@ config("wexit_time_destructors") { # gcc 4.9 and earlier had no way of suppressing this warning without # suppressing the rest of them. Here we centralize the identification of # the gcc 4.9 toolchains. @@ -251,7 +251,7 @@ index d40843b..b92f03b 100644 cflags = [] if (is_clang) { cflags += [ "-Wno-incompatible-pointer-types" ] -@@ -2362,7 +2247,8 @@ if (is_win) { +@@ -2364,7 +2249,8 @@ if (is_win) { common_optimize_on_cflags += [ "-fno-math-errno" ] } @@ -261,17 +261,17 @@ index d40843b..b92f03b 100644 if (!is_win) { if (enable_frame_pointers) { cflags = [ "-fno-omit-frame-pointer" ] -@@ -2389,7 +2275,8 @@ config("default_stack_frames") { - } - - # Default "optimization on" config. +@@ -2405,7 +2291,8 @@ config("default_stack_frames") { + # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000 + # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000 + # [2]: https://crrev.com/c/5447532 -config("optimize") { +config("optimize") { } +config("xoptimize") { if (is_win) { cflags = [ "/O2" ] + common_optimize_on_cflags -@@ -2430,7 +2317,8 @@ config("optimize") { +@@ -2446,7 +2333,8 @@ config("optimize") { } # Turn off optimizations. @@ -281,19 +281,19 @@ index d40843b..b92f03b 100644 if (is_win) { cflags = [ "/Od", # Disable optimization. -@@ -2470,7 +2358,8 @@ config("no_optimize") { - # Turns up the optimization level. On Windows, this implies whole program - # optimization and link-time code generation which is very expensive and should - # be used sparingly. +@@ -2486,7 +2374,8 @@ config("no_optimize") { + # Turns up the optimization level. Used to explicitly enable -O2 instead of + # -Os for select targets on platforms that use optimize_for_size. No-op + # elsewhere. -config("optimize_max") { +config("optimize_max") { } +config("xoptimize_max") { if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2503,7 +2392,8 @@ config("optimize_max") { +@@ -2519,7 +2408,8 @@ config("optimize_max") { # - # TODO(crbug.com/621335) - rework how all of these configs are related + # TODO(crbug.com/41259697) - rework how all of these configs are related # so that we don't need this disclaimer. -config("optimize_speed") { +config("optimize_speed") { } @@ -301,7 +301,7 @@ index d40843b..b92f03b 100644 if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2529,7 +2419,8 @@ config("optimize_speed") { +@@ -2548,7 +2438,8 @@ config("optimize_speed") { } } @@ -311,7 +311,7 @@ index d40843b..b92f03b 100644 cflags = [ "-O1" ] + common_optimize_on_cflags rustflags = [ "-Copt-level=1" ] ldflags = common_optimize_on_ldflags -@@ -2662,7 +2553,8 @@ config("win_pdbaltpath") { +@@ -2681,7 +2572,8 @@ config("win_pdbaltpath") { } # Full symbols. @@ -321,7 +321,7 @@ index d40843b..b92f03b 100644 rustflags = [] if (is_win) { if (is_clang) { -@@ -2811,7 +2703,8 @@ config("symbols") { +@@ -2831,7 +2723,8 @@ config("symbols") { # Minimal symbols. # This config guarantees to hold symbol for stack trace which are shown to user # when crash happens in unittests running on buildbot. @@ -331,7 +331,7 @@ index d40843b..b92f03b 100644 rustflags = [] if (is_win) { # Functions, files, and line tables only. -@@ -2896,7 +2789,8 @@ config("minimal_symbols") { +@@ -2916,7 +2809,8 @@ config("minimal_symbols") { # This configuration contains function names only. That is, the compiler is # told to not generate debug information and the linker then just puts function # names in the final debug information. diff --git a/chromium-122-abseil-shims.patch b/chromium-122-abseil-shims.patch deleted file mode 100644 index 832b222..0000000 --- a/chromium-122-abseil-shims.patch +++ /dev/null @@ -1,408 +0,0 @@ -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_base.gn src/build/linux/unbundle/absl_base.gn ---- src/build/linux/unbundle.old/absl_base.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_base.gn 2024-04-07 17:46:37.658214100 +0000 -@@ -13,6 +13,14 @@ pkg_config("system_absl_core_headers") { - packages = [ "absl_core_headers" ] - } - -+pkg_config("system_absl_nullability") { -+ packages = [ "absl_nullability" ] -+} -+ -+pkg_config("system_absl_prefetch") { -+ packages = [ "absl_prefetch" ] -+} -+ - shim_headers("base_shim") { - root_path = "." - prefix = "absl/base/" -@@ -60,8 +68,41 @@ source_set("core_headers") { - public_configs = [ ":system_absl_core_headers" ] - } - --source_set("config_test") { -+shim_headers("nullability_shim") { -+ root_path = "." -+ prefix = "absl/base/" -+ headers = [ -+ "nullability.h", -+ ] -+} -+ -+source_set("nullability") { -+ deps = [ ":nullability_shim" ] -+ public_configs = [ ":system_absl_nullability" ] - } - -+shim_headers("prefetch_shim") { -+ root_path = "." -+ prefix = "absl/base/" -+ headers = [ -+ "prefetch.h", -+ ] -+} -+ -+source_set("prefetch") { -+ deps = [ ":prefetch_shim" ] -+ public_configs = [ ":system_absl_prefetch" ] -+} -+ -+source_set("no_destructor") { -+ # Dummy — unavailable with abseil 202308 aand chromium 122 does not use it -+} -+ -+source_set("config_test") { -+} -+source_set("no_destructor_test") { -+} -+source_set("nullability_test") { -+} - source_set("prefetch_test") { - } -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_container.gn src/build/linux/unbundle/absl_container.gn ---- src/build/linux/unbundle.old/absl_container.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_container.gn 2024-04-07 17:12:25.979311400 +0000 -@@ -111,9 +111,19 @@ source_set("node_hash_set") { - - source_set("common_policy_traits_test") { - } -+source_set("fixed_array_test") { -+} -+source_set("flat_hash_map_test") { -+} -+source_set("flat_hash_set_test") { -+} - source_set("inlined_vector_test") { - } - source_set("node_slot_policy_test") { - } -+source_set("raw_hash_set_allocator_test") { -+} -+source_set("raw_hash_set_test") { -+} - source_set("sample_element_size_test") { - } -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_crc.gn src/build/linux/unbundle/absl_crc.gn ---- src/build/linux/unbundle.old/absl_crc.gn 1970-01-01 00:00:00.000000000 +0000 -+++ src/build/linux/unbundle/absl_crc.gn 2024-04-07 17:29:23.349823700 +0000 -@@ -0,0 +1,4 @@ -+source_set("crc32c_test") {} -+source_set("crc_cord_state_test") {} -+source_set("crc_memcpy_test") {} -+source_set("non_temporal_memcpy_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_debugging.gn src/build/linux/unbundle/absl_debugging.gn ---- src/build/linux/unbundle.old/absl_debugging.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_debugging.gn 2024-04-07 17:12:54.682550100 +0000 -@@ -45,3 +45,6 @@ source_set("symbolize") { - deps = [ ":symbolize_shim" ] - public_configs = [ ":system_absl_symbolize" ] - } -+ -+source_set("stacktrace_test") { -+} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_flags.gn src/build/linux/unbundle/absl_flags.gn ---- src/build/linux/unbundle.old/absl_flags.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_flags.gn 2024-04-07 17:14:21.789944600 +0000 -@@ -48,3 +48,5 @@ source_set("usage") { - deps = [ ":usage_shim" ] - public_configs = [ ":system_absl_flags_usage" ] - } -+ -+source_set("flag_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_functional.gn src/build/linux/unbundle/absl_functional.gn ---- src/build/linux/unbundle.old/absl_functional.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_functional.gn 2024-04-07 17:14:18.081948700 +0000 -@@ -46,4 +46,10 @@ source_set("function_ref") { - public_configs = [ ":system_absl_function_ref" ] - } - -+source_set("overload") { -+ # Dummy — unavailable with abseil 202308 aand chromium 122 does not use it -+} -+ - source_set("any_invocable_test") {} -+source_set("function_ref_test") {} -+source_set("overload_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_hash.gn src/build/linux/unbundle/absl_hash.gn ---- src/build/linux/unbundle.old/absl_hash.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_hash.gn 2024-04-07 17:19:44.496916100 +0000 -@@ -16,6 +16,8 @@ source_set("hash") { - public_configs = [ ":system_absl_hash" ] - } - -+source_set("hash_instantiated_test") { -+} - source_set("hash_test") { - } - source_set("low_level_hash_test") { -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_log.gn src/build/linux/unbundle/absl_log.gn ---- src/build/linux/unbundle.old/absl_log.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_log.gn 2024-04-07 17:45:56.568886800 +0000 -@@ -1,3 +1,67 @@ -+import("//build/config/linux/pkg_config.gni") -+import("//build/shim_headers.gni") -+ -+pkg_config("system_absl_absl_check") { -+ packages = [ "absl_absl_check" ] -+} -+ -+pkg_config("system_absl_absl_log") { -+ packages = [ "absl_absl_log" ] -+} -+ -+pkg_config("system_absl_die_if_null") { -+ packages = [ "absl_die_if_null" ] -+} -+ -+pkg_config("system_absl_log") { -+ packages = [ "absl_log" ] -+} -+shim_headers("absl_check_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "absl_check.h" ] -+} -+ -+source_set("absl_check") { -+ deps = [ ":absl_check_shim" ] -+ public_configs = [ ":system_absl_absl_check" ] -+} -+ -+shim_headers("absl_log_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "absl_log.h" ] -+} -+ -+source_set("absl_log") { -+ deps = [ ":absl_log_shim" ] -+ public_configs = [ ":system_absl_absl_log" ] -+} -+ -+shim_headers("die_if_null_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "die_if_null.h" ] -+} -+ -+source_set("die_if_null") { -+ deps = [ ":die_if_null_shim" ] -+ public_configs = [ ":system_absl_die_if_null" ] -+} -+ -+shim_headers("log_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "log.h" ] -+} -+ -+source_set("log") { -+ deps = [ ":log_shim" ] -+ public_configs = [ ":system_absl_log" ] -+} -+ -+source_set("absl_check_test") {} -+source_set("absl_log_basic_test") {} - source_set("basic_log_test") {} - source_set("check_test") {} - source_set("die_if_null_test") {} -@@ -11,3 +75,4 @@ source_set("log_sink_test") {} - source_set("log_streamer_test") {} - source_set("scoped_mock_log_test") {} - source_set("stripping_test") {} -+source_set("vlog_is_on_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_log_internal.gn src/build/linux/unbundle/absl_log_internal.gn ---- src/build/linux/unbundle.old/absl_log_internal.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_log_internal.gn 2024-04-07 17:19:34.195045600 +0000 -@@ -1 +1,2 @@ -+source_set("fnmatch_test") {} - source_set("stderr_log_sink_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_numeric.gn src/build/linux/unbundle/absl_numeric.gn ---- src/build/linux/unbundle.old/absl_numeric.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_numeric.gn 2024-04-07 17:20:05.380981000 +0000 -@@ -30,3 +30,5 @@ source_set("int128") { - deps = [ ":int128_shim" ] - public_configs = [ ":system_absl_int128" ] - } -+ -+source_set("int128_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_random.gn src/build/linux/unbundle/absl_random.gn ---- src/build/linux/unbundle.old/absl_random.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_random.gn 2024-04-07 17:36:36.041139000 +0000 -@@ -1,6 +1,48 @@ - import("//build/config/linux/pkg_config.gni") - import("//build/shim_headers.gni") - -+pkg_config("system_absl_random_bit_gen_ref") { -+ packages = [ "absl_random_bit_gen_ref" ] -+} -+ -+shim_headers("bit_gen_ref_shim") { -+ root_path = "." -+ prefix = "absl/random/" -+ headers = [ "bit_gen_ref.h" ] -+} -+ -+source_set("bit_gen_ref") { -+ deps = [ ":bit_gen_ref_shim" ] -+ public_configs = [ ":system_absl_random_bit_gen_ref" ] -+} -+ -+pkg_config("system_absl_random_distributions") { -+ packages = [ "absl_random_distributions" ] -+} -+ -+shim_headers("distributions_shim") { -+ root_path = "." -+ prefix = "absl/random/" -+ headers = [ -+ "bernoulli_distribution.h", -+ "beta_distribution.h", -+ "discrete_distribution.h", -+ "distributions.h", -+ "exponential_distribution.h", -+ "gaussian_distribution.h", -+ "log_uniform_int_distribution.h", -+ "poisson_distribution.h", -+ "uniform_int_distribution.h", -+ "uniform_real_distribution.h", -+ "zipf_distribution.h", -+ ] -+} -+ -+source_set("distributions") { -+ deps = [ ":distributions_shim" ] -+ public_configs = [ ":system_absl_random_distributions" ] -+} -+ - pkg_config("system_absl_random_random") { - packages = [ "absl_random_random" ] - } -@@ -15,3 +57,4 @@ source_set("random") { - deps = [ ":random_shim" ] - public_configs = [ ":system_absl_random_random" ] - } -+ -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_status.gn src/build/linux/unbundle/absl_status.gn ---- src/build/linux/unbundle.old/absl_status.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_status.gn 2024-04-07 17:20:21.398873800 +0000 -@@ -34,5 +34,7 @@ source_set("statusor") { - public_configs = [ ":system_absl_statusor" ] - } - -+source_set("status_test") { -+} - source_set("statusor_test") { - } -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_strings.gn src/build/linux/unbundle/absl_strings.gn ---- src/build/linux/unbundle.old/absl_strings.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_strings.gn 2024-04-07 17:52:10.775957800 +0000 -@@ -9,6 +9,10 @@ pkg_config("system_absl_strings") { - packages = [ "absl_strings" ] - } - -+pkg_config("system_absl_string_view") { -+ packages = [ "absl_string_view" ] -+} -+ - pkg_config("system_absl_str_format") { - packages = [ "absl_str_format" ] - } -@@ -59,8 +63,27 @@ source_set("str_format") { - public_configs = [ ":system_absl_str_format" ] - } - -+shim_headers("string_view_shim") { -+ root_path = "." -+ prefix = "absl/strings/" -+ headers = [ "string_view.h" ] -+} -+ -+source_set("string_view") { -+ deps = [ ":string_view_shim" ] -+ public_configs = [ ":system_absl_string_view" ] -+} -+ -+source_set("has_ostream_operator") { -+ # Dummy — unavailable with abseil 202308 aand chromium 122 does not use it -+} -+ - source_set("ascii_test") { - } -+source_set("char_formatting_test") { -+} -+source_set("charset_test") { -+} - source_set("cord_buffer_test") { - } - source_set("cord_data_edge_test") { -@@ -85,8 +108,30 @@ source_set("cordz_update_scope_test") { - } - source_set("cordz_update_tracker_test") { - } -+source_set("damerau_levenshtein_distance_test") { -+} -+source_set("has_absl_stringify_test") { -+} -+source_set("has_ostream_operator_test") { -+} - source_set("match_test") { - } -+source_set("str_format_arg_test") { -+} -+source_set("str_format_bind_test") { -+} -+source_set("str_format_checker_test") { -+} -+source_set("str_format_convert_test") { -+} -+source_set("str_format_extension_test") { -+} -+source_set("str_format_output_test") { -+} -+source_set("str_format_parser_test") { -+} -+source_set("str_format_test") { -+} - source_set("str_replace_test") { - } - source_set("string_view_test") { -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_synchronization.gn src/build/linux/unbundle/absl_synchronization.gn ---- src/build/linux/unbundle.old/absl_synchronization.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_synchronization.gn 2024-04-07 17:26:28.412783500 +0000 -@@ -20,3 +20,6 @@ source_set("synchronization") { - deps = [ ":synchronization_shim" ] - public_configs = [ ":system_absl_synchronization" ] - } -+ -+source_set("kernel_timeout_internal_test") {} -+source_set("waiter_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_time.gn src/build/linux/unbundle/absl_time.gn ---- src/build/linux/unbundle.old/absl_time.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_time.gn 2024-04-07 17:26:42.305628700 +0000 -@@ -19,3 +19,5 @@ source_set("time") { - deps = [ ":time_shim" ] - public_configs = [ ":system_absl_time" ] - } -+ -+source_set("time_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_utility.gn src/build/linux/unbundle/absl_utility.gn ---- src/build/linux/unbundle.old/absl_utility.gn 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/absl_utility.gn 2024-04-07 17:26:54.834405600 +0000 -@@ -15,3 +15,5 @@ source_set("utility") { - deps = [ ":utility_shim" ] - public_configs = [ ":system_absl_utility" ] - } -+ -+source_set("if_constexpr_test") {} -diff '--color=auto' -uprN src/build/linux/unbundle.old/replace_gn_files.py src/build/linux/unbundle/replace_gn_files.py ---- src/build/linux/unbundle.old/replace_gn_files.py 2024-04-02 09:53:10.734295000 +0000 -+++ src/build/linux/unbundle/replace_gn_files.py 2024-04-07 17:29:53.274515100 +0000 -@@ -20,6 +20,7 @@ REPLACEMENTS = { - 'absl_base': 'third_party/abseil-cpp/absl/base/BUILD.gn', - 'absl_cleanup': 'third_party/abseil-cpp/absl/cleanup/BUILD.gn', - 'absl_container': 'third_party/abseil-cpp/absl/container/BUILD.gn', -+ 'absl_crc': 'third_party/abseil-cpp/absl/crc/BUILD.gn', - 'absl_debugging': 'third_party/abseil-cpp/absl/debugging/BUILD.gn', - 'absl_flags': 'third_party/abseil-cpp/absl/flags/BUILD.gn', - 'absl_functional': 'third_party/abseil-cpp/absl/functional/BUILD.gn', diff --git a/chromium-124-shims.patch b/chromium-124-shims.patch index 8cd637b..3f11198 100644 --- a/chromium-124-shims.patch +++ b/chromium-124-shims.patch @@ -125,17 +125,6 @@ diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_log.gn src/build/lin shim_headers("log_shim") { root_path = "." prefix = "absl/log/" -diff '--color=auto' -urp src/build/linux/unbundle.orig/libwebp.gn src/build/linux/unbundle/libwebp.gn ---- src/build/linux/unbundle.orig/libwebp.gn -+++ src/build/linux/unbundle/libwebp.gn -@@ -33,3 +33,7 @@ source_set("libwebp_webp") { - group("libwebp") { - deps = [ ":libwebp_webp" ] - } -+ -+source_set("libwebp_sharpyuv") { -+ # Unused in Chromium. Empty to enable building with old webp which does not have sharpyuv -+} diff '--color=auto' -urp src/build/linux/unbundle.orig/re2.gn src/build/linux/unbundle/re2.gn --- src/build/linux/unbundle.orig/re2.gn +++ src/build/linux/unbundle/re2.gn @@ -188,7 +177,7 @@ diff '--color=auto' -urp src/build/linux/unbundle.orig/re2.gn src/build/linux/un --- /dev/null +++ src/build/linux/unbundle/zstd.gn -@@ -0,0 +1,24 @@ +@@ -0,0 +1,28 @@ +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") + @@ -204,6 +193,10 @@ diff '--color=auto' -urp src/build/linux/unbundle.orig/re2.gn src/build/linux/un + ] +} + ++source_set("compress") { ++ deps = [ ":zstd_shim" ] ++ public_configs = [ ":system_zstd" ] ++} +source_set("decompress") { + deps = [ ":zstd_shim" ] + public_configs = [ ":system_zstd" ] diff --git a/chromium-93-ffmpeg-4.4.patch b/chromium-93-ffmpeg-4.4.patch index 3ff625c..9abb104 100644 --- a/chromium-93-ffmpeg-4.4.patch +++ b/chromium-93-ffmpeg-4.4.patch @@ -54,7 +54,7 @@ Index: chromium-118.0.5993.18/media/filters/ffmpeg_demuxer.cc packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); @@ -461,7 +465,11 @@ void FFmpegDemuxerStream::EnqueuePacket( - packet->size - data_offset); + side_data + side_data_size); } +#if LIBAVUTIL_VERSION_MAJOR < 57 diff --git a/color_provider-incomplete-ColorProviderInternal.patch b/color_provider-incomplete-ColorProviderInternal.patch new file mode 100644 index 0000000..416ee4f --- /dev/null +++ b/color_provider-incomplete-ColorProviderInternal.patch @@ -0,0 +1,44 @@ +From ef8e6beaebcfc3e143b249ba76c177fbabd3b4ea Mon Sep 17 00:00:00 2001 +From: Yichen +Date: Thu, 23 May 2024 23:44:41 +0000 +Subject: [PATCH] ui: fix gcc/libstdc++ build break + +Bug: 340815321 +Change-Id: Ibf443f9f16dfff164e1f4d49a58582fb7a6aca1d +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5565320 +Reviewed-by: Xiyuan Xia +Commit-Queue: Yichen Zhou +Cr-Commit-Position: refs/heads/main@{#1305426} +--- + ui/color/color_provider.cc | 3 ++- + ui/color/color_provider.h | 3 +-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ui/color/color_provider.cc b/ui/color/color_provider.cc +index 1597715de1f63c..3e0ffed9f4d4c4 100644 +--- a/ui/color/color_provider.cc ++++ b/ui/color/color_provider.cc +@@ -118,7 +118,8 @@ class ColorProvider::ColorProviderInternal { + //////////////////////////////////////////////////////////////////////////////// + // ColorProvider: + +-ColorProvider::ColorProvider() = default; ++ColorProvider::ColorProvider() ++ : internal_(std::make_unique()) {} + + ColorProvider::ColorProvider(ColorProvider&&) = default; + +diff --git a/ui/color/color_provider.h b/ui/color/color_provider.h +index 50fff33ae6ab6d..6ac6ed6938cf24 100644 +--- a/ui/color/color_provider.h ++++ b/ui/color/color_provider.h +@@ -65,8 +65,7 @@ class COMPONENT_EXPORT(COLOR) ColorProvider { + // bind to it. + class ColorProviderInternal; + +- std::unique_ptr internal_ = +- std::make_unique(); ++ std::unique_ptr internal_; + }; + + } // namespace ui diff --git a/create_tarball.sh b/create_tarball.sh index 76d713f..3a7f58f 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -166,7 +166,6 @@ echo ">>>>>> Remove bundled libs" keeplibs=( base/third_party/cityhash #Derived code, not vendored dependency. base/third_party/cityhash_v103 #Derived code, not vendored dep - base/third_party/dynamic_annotations #Derived code, not vendored dependency. base/third_party/icu #Derived code, not vendored dependency. base/third_party/superfasthash #Not a shared library. base/third_party/symbolize #Derived code, not vendored dependency. @@ -336,6 +335,8 @@ rm -rvf third_party/electron_node/deps/v8/tools ln -srv v8/tools -t third_party/electron_node/deps/v8/ find third_party/electron_node/deps/zlib -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +# vendored system headers +rm -rf build/linux/debian*sysroot #Some more chonkers rm -rf components/test/data #21MB diff --git a/disable-catapult.patch b/disable-catapult.patch index 2595e28..0188bd6 100644 --- a/disable-catapult.patch +++ b/disable-catapult.patch @@ -166,9 +166,9 @@ author: Michael Gilbert "//components/vector_icons", "//components/webauthn/json", - "//content/browser/tracing:resources", + "//media/mojo/mojom:speech_recognition", + "//ui/base", ] - } - --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni @@ -190,8 +190,6 @@ template("chrome_extra_paks") { @@ -181,7 +181,7 @@ author: Michael Gilbert deps += [ "//chrome/browser/resources:component_extension_resources", @@ -199,7 +197,6 @@ template("chrome_extra_paks") { - "//chrome/browser/resources/lens/overlay:resources", + "//chrome/browser/resources/lens/overlay/search_bubble:resources", "//chrome/browser/resources/search_engine_choice:resources", "//content/browser/devtools:devtools_resources", - "//content/browser/tracing:resources", diff --git a/disable-webspeech.patch b/disable-webspeech.patch index 5dccda4..f74b154 100644 --- a/disable-webspeech.patch +++ b/disable-webspeech.patch @@ -26,7 +26,7 @@ diff --git a/chromium/content/browser/BUILD.gn b/chromium/content/browser/BUILD. index 19b45dc1268..67dcd7752d0 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -1909,11 +1909,6 @@ source_set("browser") { +@@ -1909,13 +1909,6 @@ source_set("browser") { "sms/user_consent_handler.h", "sms/webotp_service.cc", "sms/webotp_service.h", @@ -34,6 +34,8 @@ index 19b45dc1268..67dcd7752d0 100644 - "speech/speech_recognition_dispatcher_host.h", - "speech/speech_recognition_manager_impl.cc", - "speech/speech_recognition_manager_impl.h", +- "speech/speech_recognition_session.cc", +- "speech/speech_recognition_session.h", - "speech/speech_recognizer.h", "speech/speech_synthesis_impl.cc", "speech/speech_synthesis_impl.h", @@ -58,14 +60,17 @@ index 19b45dc1268..67dcd7752d0 100644 "tracing/tracing_ui.cc", "tracing/tracing_ui.h", -@@ -2995,7 +2975,6 @@ source_set("browser") { - ] - - deps += [ +@@ -2995,10 +2975,8 @@ source_set("browser") { + "//components/soda:constants", + "//components/soda:soda", + "//components/soda:utils", - "//components/speech:speech", "//components/vector_icons", "//components/webauthn/json", +- "//media/mojo/mojom:speech_recognition", + "//ui/base", ] + } @@ -3108,6 +3083,37 @@ source_set("browser") { deps += [ "//ui/compositor" ] } diff --git a/electron-13-fix-use-thin-lto.patch b/electron-13-fix-use-thin-lto.patch deleted file mode 100644 index f721cfd..0000000 --- a/electron-13-fix-use-thin-lto.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: electron-17.1.0/build/config/compiler/compiler.gni -=================================================================== ---- electron-17.1.0.orig/build/config/compiler/compiler.gni 2022-03-09 08:27:56.719840060 +0100 -+++ electron-17.1.0/build/config/compiler/compiler.gni 2022-03-09 13:07:58.709063960 +0100 -@@ -71,12 +71,7 @@ declare_args() { - # Disabled in iOS cronet builds since build step cronet_static_complete - # wants to build a .a file consumable by external clients, and they won't - # have the same LLVM revisions as us, making bitcode useless to them. -- use_thin_lto = -- is_cfi || (is_clang && is_official_build && chrome_pgo_phase != 1 && -- (is_linux || is_win || is_mac || -- (is_ios && use_lld && !is_cronet_build) || -- (is_android && target_os != "chromeos") || -- (is_chromeos && is_chromeos_device))) -+ use_thin_lto = false - - # If true, use Goma for ThinLTO code generation where applicable. - use_goma_thin_lto = false diff --git a/electron-30.5.1.tar.zst b/electron-30.5.1.tar.zst deleted file mode 100644 index e129823..0000000 --- a/electron-30.5.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f63fac2464ee585707d9fccdfb7e6392a05ea5b823a8386f322cfc6ebed6d78d -size 587969424 diff --git a/electron-31.6.0.tar.zst b/electron-31.6.0.tar.zst new file mode 100644 index 0000000..7ea29fb --- /dev/null +++ b/electron-31.6.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e188fe49c43ec91c53261b38212c042951c2d2e246dd24cc3c8725f46609e35 +size 603436922 diff --git a/fake_ssl_socket_client-Wlto-type-mismatch.patch b/fake_ssl_socket_client-Wlto-type-mismatch.patch deleted file mode 100644 index 55b0bbb..0000000 --- a/fake_ssl_socket_client-Wlto-type-mismatch.patch +++ /dev/null @@ -1,20 +0,0 @@ -Correct ODR violation due to ambiguous name. - -When this header is compiled by itself, `scoped_refptr` refers to the type declared in `base/memory/scoped_refptr.h`. -When `third_party/webrtc/api/scoped_refptr.h` is included before, the name changes to refer to `::webrtc::scoped_refptr` instead, -leading to mismatch across translation units. This is detected and reported by GCC. - ---- src/components/webrtc/fake_ssl_client_socket.h.old -+++ src/components/webrtc/fake_ssl_client_socket.h - -@@ -111,8 +111,8 @@ class FakeSSLClientSocket : public net:: - // The callback passed to Connect(). - net::CompletionOnceCallback user_connect_callback_; - -- scoped_refptr write_buf_; -- scoped_refptr read_buf_; -+ ::scoped_refptr write_buf_; -+ ::scoped_refptr read_buf_; - }; - - } // namespace webrtc diff --git a/ffmpeg-new-channel-layout.patch b/ffmpeg-new-channel-layout.patch index 1a84446..70d59f5 100644 --- a/ffmpeg-new-channel-layout.patch +++ b/ffmpeg-new-channel-layout.patch @@ -176,33 +176,6 @@ index 5f257bdfaa6..e1be5aa9a5b 100644 if (frame->sample_rate != sample_rate_ || channels != channels_ || frame->format != av_sample_format_) { DLOG(ERROR) << "Unsupported midstream configuration change!" -diff --git a/media/filters/audio_file_reader_unittest.cc b/media/filters/audio_file_reader_unittest.cc -index 2aba7927a31..1f45a50cace 100644 ---- a/media/filters/audio_file_reader_unittest.cc -+++ b/media/filters/audio_file_reader_unittest.cc -@@ -121,11 +121,11 @@ class AudioFileReaderTest : public testing::Test { - EXPECT_FALSE(reader_->Open()); - } - -- void RunTestFailingDecode(const char* fn) { -+ void RunTestFailingDecode(const char* fn, int expect_read = 0) { - Initialize(fn); - EXPECT_TRUE(reader_->Open()); - std::vector> decoded_audio_packets; -- EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0); -+ EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read); - } - - void RunTestPartialDecode(const char* fn) { -@@ -219,7 +219,7 @@ TEST_F(AudioFileReaderTest, AAC_ADTS) { - } - - TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) { -- RunTestFailingDecode("midstream_config_change.mp3"); -+ RunTestFailingDecode("midstream_config_change.mp3", 42624); - } - #endif - diff --git a/media/filters/audio_video_metadata_extractor.cc b/media/filters/audio_video_metadata_extractor.cc index 185819eb936..69ff508c221 100644 --- a/media/filters/audio_video_metadata_extractor.cc diff --git a/first_party_sets_handler_database_helper-missing-optional.patch b/first_party_sets_handler_database_helper-missing-optional.patch deleted file mode 100644 index a2d494b..0000000 --- a/first_party_sets_handler_database_helper-missing-optional.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 072b9f3bc340020325cf3dd7bff1991cd22de171 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 19 Mar 2024 16:27:55 +0000 -Subject: [PATCH] IWYU: missing include for std::optional usage in - first_party_sets_handler_database_helper.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: Ia644d2e6baa904190d162575dd16264e66ea227e -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377063 -Reviewed-by: Chris Fredrickson -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1274977} ---- - .../first_party_sets/first_party_sets_handler_database_helper.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/content/browser/first_party_sets/first_party_sets_handler_database_helper.h b/content/browser/first_party_sets/first_party_sets_handler_database_helper.h -index a12af718abda0..92afb98d64ea4 100644 ---- a/content/browser/first_party_sets/first_party_sets_handler_database_helper.h -+++ b/content/browser/first_party_sets/first_party_sets_handler_database_helper.h -@@ -6,6 +6,7 @@ - #define CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_HANDLER_DATABASE_HELPER_H_ - - #include -+#include - #include - #include - #include diff --git a/fix-build-without-safebrowsing.patch b/fix-build-without-safebrowsing.patch new file mode 100644 index 0000000..5a7a932 --- /dev/null +++ b/fix-build-without-safebrowsing.patch @@ -0,0 +1,31 @@ +--- src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc.orig 2024-07-24 13:00:13.565994500 +0200 ++++ src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc 2024-08-03 23:06:56.231653700 +0200 +@@ -19,7 +19,6 @@ + #include "chrome/browser/browser_process.h" + #include "chrome/browser/history/history_service_factory.h" + #include "chrome/browser/profiles/profile.h" +-#include "chrome/browser/safe_browsing/safe_browsing_service.h" + #if 0 + #include "chrome/browser/ui/blocked_content/popunder_preventer.h" + #endif +@@ -116,20 +115,6 @@ void RecordWebsiteStateAtApiRequest(hist + void CheckUrlForAllowlistAndRecordMetric( + const GURL& url, + history::HistoryLastVisitResult result) { +- if (!g_browser_process->safe_browsing_service() || +- !g_browser_process->safe_browsing_service()->database_manager()) { +- RecordWebsiteStateAtApiRequest(result, std::nullopt); +- return; +- } +- g_browser_process->safe_browsing_service() +- ->database_manager() +- ->CheckUrlForHighConfidenceAllowlist( +- url, "RT" /*realtime*/, +- base::BindOnce( +- [](history::HistoryLastVisitResult result, bool on_allowlist) { +- RecordWebsiteStateAtApiRequest(result, on_allowlist); +- }, +- result)); + } + + } // namespace diff --git a/fix-build-without-supervised-users.patch b/fix-build-without-supervised-users.patch new file mode 100644 index 0000000..d4f886f --- /dev/null +++ b/fix-build-without-supervised-users.patch @@ -0,0 +1,60 @@ +--- src/chrome/test/BUILD.gn.orig 2024-09-12 13:54:44.642624995 +0200 ++++ src/chrome/test/BUILD.gn 2024-09-12 15:25:29.792388388 +0200 +@@ -56,7 +56,6 @@ import("//v8/gni/v8.gni") + + assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") + assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") +-assert(enable_supervised_users) + + if (is_android) { + import("//build/config/android/rules.gni") +--- src/chrome/common/BUILD.gn.orig 2024-09-12 13:46:51.785984196 +0200 ++++ src/chrome/common/BUILD.gn 2024-09-12 15:27:58.398867501 +0200 +@@ -22,7 +22,6 @@ import("//testing/libfuzzer/fuzzer_test. + import("//third_party/widevine/cdm/widevine.gni") + import("//tools/grit/grit_rule.gni") + +-assert(enable_supervised_users) + assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + + fuzzer_test("ini_parser_fuzzer") { +--- src/chrome/renderer/BUILD.gn.orig 2024-09-12 13:46:51.849317526 +0200 ++++ src/chrome/renderer/BUILD.gn 2024-09-12 15:29:17.915843739 +0200 +@@ -18,7 +18,6 @@ import("//testing/libfuzzer/fuzzer_test. + import("//third_party/widevine/cdm/widevine.gni") + import("//tools/grit/grit_rule.gni") + +-assert(enable_supervised_users) + + grit("resources") { + source = "resources/renderer_resources.grd" +--- src/chrome/browser/BUILD.gn.orig 2024-09-12 13:54:44.639291662 +0200 ++++ src/chrome/browser/BUILD.gn 2024-09-12 15:30:42.759505691 +0200 +@@ -45,7 +45,6 @@ import("//third_party/widevine/cdm/widev + import("//tools/grit/grit_rule.gni") + import("//ui/base/ui_features.gni") + +-assert(enable_supervised_users) + + # //build/config/android/rules.gni imports //tools/grit/grit_rule.gni, which + # produces a conflict for the "grit" template so we have to only include one. +--- src/chrome/browser/ui/BUILD.gn.orig 2024-09-12 13:46:51.212650894 +0200 ++++ src/chrome/browser/ui/BUILD.gn 2024-09-12 15:32:36.489733448 +0200 +@@ -32,7 +32,6 @@ import("//third_party/protobuf/proto_lib + import("//ui/base/ui_features.gni") + import("//ui/views/features.gni") + +-assert(enable_supervised_users) + assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + + generate_histograms_variants_allowlist("webui_name_variants") { +--- src/chrome/browser/extensions/BUILD.gn.orig 2024-09-12 13:46:50.369317607 +0200 ++++ src/chrome/browser/extensions/BUILD.gn 2024-09-12 15:33:39.046452725 +0200 +@@ -20,7 +20,6 @@ import("//testing/libfuzzer/fuzzer_test. + import("//third_party/protobuf/proto_library.gni") + + assert(enable_extensions) +-assert(enable_supervised_users) + assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") + + static_library("extensions") { diff --git a/gpu_adapter_info-missing-optional.patch b/gpu_adapter_info-missing-optional.patch deleted file mode 100644 index e79a07e..0000000 --- a/gpu_adapter_info-missing-optional.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 15e24abc1646ad9984923234a041cd0c3b8b1607 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 19 Mar 2024 16:21:06 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::optional in - gpu_adapter_info.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: I42d6c9f99ea7718fa87267ebcf3368d0f46f5053 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374260 -Commit-Queue: José Dapena Paz -Reviewed-by: Austin Eng -Cr-Commit-Position: refs/heads/main@{#1274974} ---- - third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h b/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h -index 70b15d5c055aa..2084afbe6e877 100644 ---- a/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h -+++ b/third_party/blink/renderer/modules/webgpu/gpu_adapter_info.h -@@ -5,6 +5,8 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_ADAPTER_INFO_H_ - #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_ADAPTER_INFO_H_ - -+#include -+ - #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" - #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" diff --git a/harfbuzz-replace-chromium-scoped-type.patch b/harfbuzz-replace-chromium-scoped-type.patch index 4d3692b..dbbb9c2 100644 --- a/harfbuzz-replace-chromium-scoped-type.patch +++ b/harfbuzz-replace-chromium-scoped-type.patch @@ -110,13 +110,14 @@ diff --git a/third_party/blink/renderer/platform/fonts/opentype/font_format_chec index 7c7057b..d43668f1 100644 --- a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc +++ b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc -@@ -7,10 +7,10 @@ - // Include HarfBuzz to have a cross-platform way to retrieve table tags without +@@ -7,11 +7,11 @@ // having to rely on the platform being able to instantiate this font format. #include + +#include - #include "base/sys_byteorder.h" + #include "base/containers/span.h" + #include "base/numerics/byte_conversions.h" #include "third_party/blink/renderer/platform/wtf/vector.h" -#include "third_party/harfbuzz-ng/utils/hb_scoped.h" #include "third_party/skia/include/core/SkTypeface.h" @@ -254,9 +255,9 @@ index b4bb5a3..b6ee0a8f 100644 // clang-format on @@ -52,7 +53,6 @@ - #include "third_party/blink/renderer/platform/wtf/hash_map.h" - #include "third_party/blink/renderer/platform/wtf/math_extras.h" #include "third_party/blink/renderer/platform/wtf/text/character_names.h" + #include "third_party/blink/renderer/platform/wtf/thread_specific.h" + #include "third_party/blink/renderer/platform/wtf/wtf.h" -#include "third_party/harfbuzz-ng/utils/hb_scoped.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPath.h" diff --git a/http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch b/http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch new file mode 100644 index 0000000..9a9997b --- /dev/null +++ b/http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch @@ -0,0 +1,36 @@ +From d8985805ba3c963d9aabbd2c77d15dbd8d7290c5 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 15 May 2024 18:46:03 +0000 +Subject: [PATCH] GCC: explicitly use base::span constructor in + HttpAuthNtlmMechanism +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +base::span requires explicit construction for several of the +constructors. Theoretically the constructor used here should not +require that but GCC complains. + +Bug: 40565911 +Change-Id: I452f31ee0862c3e986e15207f89baa043b016da8 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5540995 +Reviewed-by: Maks Orlovich +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1301466} +--- + net/http/http_auth_ntlm_mechanism.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/http/http_auth_ntlm_mechanism.cc b/net/http/http_auth_ntlm_mechanism.cc +index ddab00151cda9c..0b103303df56f7 100644 +--- a/net/http/http_auth_ntlm_mechanism.cc ++++ b/net/http/http_auth_ntlm_mechanism.cc +@@ -149,7 +149,7 @@ int HttpAuthNtlmMechanism::GenerateAuthToken( + return ERR_UNEXPECTED; + + uint8_t client_challenge[8]; +- g_generate_random_proc(client_challenge); ++ g_generate_random_proc(base::span(client_challenge)); + + auto next_token = ntlm_client_.GenerateAuthenticateMessage( + domain, user, credentials->password(), hostname, channel_bindings, spn, diff --git a/native_css_paint_definition-expected-unqualified-id.patch b/native_css_paint_definition-expected-unqualified-id.patch new file mode 100644 index 0000000..41337c6 --- /dev/null +++ b/native_css_paint_definition-expected-unqualified-id.patch @@ -0,0 +1,37 @@ +From bf5355ac24399cd37a7d210b1ce9586d70829ed5 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Fri, 17 May 2024 09:39:14 +0000 +Subject: [PATCH] GCC: do not add template parameter in constructor of + BaseKeyframe +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC rejects adding redundantly the template parameter in the +constructor. + +Bug: 40565911 +Change-Id: Ie827f1dba5488893cb76e0e52e9c26866dff701c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539114 +Reviewed-by: Jean-Philippe Gravel +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1302481} +--- + .../csspaint/nativepaint/native_css_paint_definition.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h b/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h +index 34d37ea466c632..24a676543895ac 100644 +--- a/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h ++++ b/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h +@@ -51,9 +51,7 @@ class MODULES_EXPORT NativeCssPaintDefinition : public NativePaintDefinition { + + template + struct TypedKeyframe : public BaseKeyframe { +- TypedKeyframe(double offset, +- std::unique_ptr& tf, +- T v) ++ TypedKeyframe(double offset, std::unique_ptr& tf, T v) + : BaseKeyframe(offset, tf), value(v) {} + T value; + }; diff --git a/nodejs-electron.changes b/nodejs-electron.changes index b45438d..db99685 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,55 @@ +------------------------------------------------------------------- +Mon Sep 16 17:40:09 UTC 2024 - Bruno Pitrus + +- Update to 31.6.0 + * ABI break: NODE_MODULE_VERSION is now 125 + * Chromium 126.0.6478.234 + * Node 20.17.0 + * V8 12.6 + * Breaking change: Remove WebSQL support + * Breaking change: nativeImage.toDataURL will preserve PNG colorspace + * Added options parameter to Session.clearData API. + * Extended webContents.setWindowOpenHandler to support manual creation of BrowserWindow. + * clearData method added to Session + * Extended WebContentsView to accept pre-existing webContents object. + * see https://www.electronjs.org/blog/electron-31-0 and https://github.com/electron/electron/releases/tag/v31.0.0 for more +- Drop no longer needed patches + * electron-13-fix-use-thin-lto.patch + * remove-openscreen.patch + * system-yuv.patch + * chromium-122-abseil-shims.patch + * electron-16-std-vector-non-const.patch + * fake_ssl_socket_client-Wlto-type-mismatch.patch + * angle-FramebufferVk-powf.patch + * span_reader-missing-optional.patch + * bitset-missing-uint8_t-memcpy.patch + * temporal_scalability_id_extractor-missing-bitset.patch + * gpu_adapter_info-missing-optional.patch + * first_party_sets_handler_database_helper-missing-optional.patch + * async_iterable-forwarding.patch + * script_streamer-atomic-include.patch +- Add patches to fix build + * fix-build-without-safebrowsing.patch + * fix-build-without-supervised-users.patch + * Cr126-abseil-shims.patch + * absl-base-dynamic_annotations.patch + * webp-no-sharpyuv.patch + * http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch + * angle-State-constexpr.patch + * color_provider-incomplete-ColorProviderInternal.patch + * run_segmenter-missing-optional.patch + * page_popup_controller-missing-optional.patch + * native_css_paint_definition-expected-unqualified-id.patch + * text_decoder-missing-optional.patch + * real_time_reporting_bindings-forward-declaration.patch + * blink-platform-INSIDE_BLINK-Wodr.patch + * quiche-QuicIntervalDeque-no-match-for-operator-mm.patch + * ConsumeRadii-linker-error.patch +- Conditionally revert upstreamed ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch on old ffmpeg +- Revert upstream changes to build with system abseil (quiche-absl-HexStringToBytes.patch) +- Refresh bad-font-gc patches from Debian +- aarch64: disable LTO also on Fedora 39 due to OOM + ------------------------------------------------------------------- Sat Sep 14 08:13:25 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 517d139..0b8a4f6 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -22,7 +22,7 @@ %define mod_name electron # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json -%define abi_version 123 +%define abi_version 125 # Do not provide libEGL.so, etc… %define __provides_exclude ^lib.*\\.so.*$ @@ -95,11 +95,7 @@ BuildArch: i686 %endif %ifarch aarch64 -%if 0%{?suse_version} || 0%{?fedora} >= 40 %bcond_with lto -%else -%bcond_without lto -%endif %endif %ifarch aarch64 @@ -233,7 +229,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 30.5.1 +Version: 31.6.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -250,11 +246,15 @@ Source11: Electron.desktop Source400: ffmpeg-new-channel-layout.patch Source401: audio_file_reader-ffmpeg-AVFrame-duration.patch Source402: Cr122-ffmpeg-new-channel-layout.patch +Source403: ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch # and against harfbuzz 4 Source415: harfbuzz-replace-chromium-scoped-type.patch Source416: harfbuzz-replace-HbScopedPointer.patch # and wayland 1.31 Source450: wayland-proto-31-cursor-shape.patch +# and abseil 2401 +Source460: quiche-absl-HexStringToBytes.patch + # PATCHES for openSUSE-specific things (compiler flags, paths, etc.) @@ -263,8 +263,6 @@ Patch1: fpic.patch Patch2: common.gypi-compiler.patch Patch3: gcc-enable-lto.patch Patch7: chromium-91-java-only-allowed-in-android-builds.patch -# Always disable use_thin_lto which is an lld feature -Patch21: electron-13-fix-use-thin-lto.patch # Fix common.gypi to include /usr/include/electron Patch25: electron-16-system-node-headers.patch # https://sources.debian.org/patches/chromium/102.0.5005.115-1/debianization/support-i386.patch/ @@ -295,10 +293,11 @@ Patch581: disable-tests.patch Patch583: remove-rust.patch Patch585: remove-dawn.patch Patch586: aom-vpx-no-thread-wrapper.patch -Patch587: remove-openscreen.patch Patch588: remove-password-manager-and-policy.patch Patch589: remove-puffin.patch Patch590: remove-sync.patch +Patch591: fix-build-without-safebrowsing.patch +Patch592: fix-build-without-supervised-users.patch @@ -328,9 +327,10 @@ Patch1076: crashpad-use-system-abseil.patch Patch1077: system-wayland.patch Patch1078: system-simdutf.patch Patch1079: system-libm.patch -Patch1080: system-yuv.patch -Patch1081: chromium-122-abseil-shims.patch Patch1082: chromium-124-shims.patch +Patch1083: Cr126-abseil-shims.patch +Patch1084: absl-base-dynamic_annotations.patch +Patch1085: webp-no-sharpyuv.patch # PATCHES to fix interaction with third-party software @@ -348,7 +348,7 @@ Patch2012: chromium-94-ffmpeg-roll.patch # See https://reviews.llvm.org/D92800 Patch2022: electron-13-fix-base-check-nomerge.patch # Fix electron patched code -Patch2024: electron-16-std-vector-non-const.patch +#Patch2024: electron-16-std-vector-non-const.patch Patch2029: electron-16-webpack-fix-openssl-3.patch Patch2031: partition_alloc-no-lto.patch Patch2032: seccomp_bpf-no-lto.patch @@ -402,19 +402,20 @@ Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCa Patch3144: mt21_util-flax-vector-conversions.patch Patch3149: boringssl-internal-addc-cxx.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch -Patch3152: fake_ssl_socket_client-Wlto-type-mismatch.patch -Patch3153: angle-FramebufferVk-powf.patch Patch3154: licenses.py-FileNotFoundError.patch -Patch3155: span_reader-missing-optional.patch -Patch3156: bitset-missing-uint8_t-memcpy.patch -Patch3157: temporal_scalability_id_extractor-missing-bitset.patch -Patch3158: gpu_adapter_info-missing-optional.patch -Patch3159: first_party_sets_handler_database_helper-missing-optional.patch -Patch3160: async_iterable-forwarding.patch Patch3161: preview_cancel_reason-missing-string.patch -Patch3162: script_streamer-atomic-include.patch Patch3163: DesktopNativeWidgetAura-HandleActivationChanged-crash.patch -Patch3164: ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch +Patch3165: http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch +Patch3166: angle-State-constexpr.patch +Patch3167: color_provider-incomplete-ColorProviderInternal.patch +Patch3168: run_segmenter-missing-optional.patch +Patch3169: page_popup_controller-missing-optional.patch +Patch3170: native_css_paint_definition-expected-unqualified-id.patch +Patch3171: text_decoder-missing-optional.patch +Patch3172: real_time_reporting_bindings-forward-declaration.patch +Patch3173: blink-platform-INSIDE_BLINK-Wodr.patch +Patch3174: quiche-QuicIntervalDeque-no-match-for-operator-mm.patch +Patch3175: ConsumeRadii-linker-error.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -762,7 +763,6 @@ providing better integration with desktop environments such as KDE. - # Sanity check if macro corresponds to the actual ABI test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = %abi_version @@ -774,7 +774,7 @@ patch -R -p1 < %PATCH1076 %if %{with ffmpeg_6} patch -R -p1 < %PATCH2012 %else -patch -R -p1 < %PATCH3164 +patch -R -p1 < %SOURCE403 patch -R -p1 < %SOURCE402 patch -R -p1 < %SOURCE400 patch -R -p1 < %SOURCE401 @@ -795,6 +795,9 @@ patch -R -p1 < %SOURCE450 +# This one depends on an abseil nightly, reverting unconditionally. +patch -R -p1 < %SOURCE460 + # Link system wayland-protocols-devel into where chrome expects them mkdir -p third_party/wayland/src mkdir -p third_party/wayland-protocols/kde/src @@ -1039,7 +1042,7 @@ export LDFLAGS="$LDFLAGS -Wl,--as-needed" %ifarch %ix86 %arm #try to reduce memory -export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory" +export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif #ifarch ix86 arm @@ -1174,9 +1177,7 @@ myconf_gn+=" enable_pdf=false" myconf_gn+=" enable_pdf_viewer=false" myconf_gn+=" enable_print_preview=false" myconf_gn+=" enable_printing=false" -myconf_gn+=" enable_basic_printing=false" myconf_gn+=' use_cups=false' -myconf_gn+=' enable_print_content_analysis=false' #we don't build PDF support, so disabling the below: #myconf_gn+=" use_system_lcms2=true" #myconf_gn+=" use_system_libopenjpeg2=true" @@ -1269,21 +1270,23 @@ myconf_gn+=' enable_supervised_users=false' myconf_gn+=' enable_compose=false' myconf_gn+=' enterprise_cloud_content_analysis=false' myconf_gn+=' enterprise_local_content_analysis=false' -myconf_gn+=' enterprise_data_controls=false' myconf_gn+=' enterprise_watermark=false' -myconf_gn+=' enterprise_content_analysis=false' +myconf_gn+=' enterprise_content_analysis=true' myconf_gn+=' enable_video_effects=false' myconf_gn+=' use_fake_screen_ai=true' myconf_gn+=' webnn_use_tflite=false' +myconf_gn+=' structured_metrics_enabled=false' +myconf_gn+=' structured_metrics_debug_enabled=false' #FIXME: possibly enable this when skia gets built with rust code by default. #Need to patch in optflags and possibly FFI LTO hacks (see signal-desktop package for how it's done) myconf_gn+=' enable_rust=false' myconf_gn+=' enable_chromium_prelude=false' - +myconf_gn+=' enable_cxx=false' myconf_gn+=' chrome_certificate_policies_supported=false' +myconf_gn+=' chrome_root_store_cert_management_ui=false' myconf_gn+=' use_kerberos=false' myconf_gn+=' disable_histogram_support=true' diff --git a/page_popup_controller-missing-optional.patch b/page_popup_controller-missing-optional.patch new file mode 100644 index 0000000..eb528d7 --- /dev/null +++ b/page_popup_controller-missing-optional.patch @@ -0,0 +1,42 @@ +From f3fce92b27296068b4c304321b53bd1c7c4beb61 Mon Sep 17 00:00:00 2001 +From: "lauren n. liberda" +Date: Tue, 28 May 2024 17:54:26 +0000 +Subject: [PATCH] iwyu: missing in page_popup_controller.h + +Bug: 41455655 +Change-Id: I6483b9ec9d3c4acc08fb2bce8cac409c32a06dc4 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5569043 +Reviewed-by: Lei Zhang +Commit-Queue: Lei Zhang +Reviewed-by: Khushal Sagar +Cr-Commit-Position: refs/heads/main@{#1306871} +--- + AUTHORS | 1 + + third_party/blink/renderer/core/page/page_popup_controller.h | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/AUTHORS b/AUTHORS +index eba1dc976d8fa0..715e108aca1c3d 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -818,6 +818,7 @@ Lalit Chandivade + Lam Lu + Laszlo Gombos + Laszlo Radanyi ++lauren n. liberda + Lauren Yeun Kim + Lauri Oherd + Lavar Askew +diff --git a/third_party/blink/renderer/core/page/page_popup_controller.h b/third_party/blink/renderer/core/page/page_popup_controller.h +index 5da38d0b9ab26f..c4e8e865fa96d3 100644 +--- a/third_party/blink/renderer/core/page/page_popup_controller.h ++++ b/third_party/blink/renderer/core/page/page_popup_controller.h +@@ -31,6 +31,8 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PAGE_POPUP_CONTROLLER_H_ + #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PAGE_POPUP_CONTROLLER_H_ + ++#include ++ + #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" diff --git a/partition_alloc-no-lto.patch b/partition_alloc-no-lto.patch index 3a0b6e5..4ad227d 100644 --- a/partition_alloc-no-lto.patch +++ b/partition_alloc-no-lto.patch @@ -1,73 +1,70 @@ Compile files which declare functions in inline assembly without LTO due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57703 ---- src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.old 2022-10-01 13:53:03.367797474 +0200 -+++ src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn 2022-10-05 14:23:53.999860356 +0200 -@@ -90,6 +90,33 @@ if (!is_debug || partition_alloc_optimiz - _add_configs += [ "//build/config/compiler:no_optimize" ] +--- src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.orig 2024-07-24 12:50:43.409128966 +0200 ++++ src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn 2024-07-26 13:37:20.891041131 +0200 +@@ -107,6 +107,31 @@ source_set("build_config") { + ] } -+if (use_starscan) { -+ static_library("partition_alloc_asm") { -+ if (gcc_lto) { -+ configs -= [ "//build/config/compiler:gcc_lto" ] -+ } -+ if (current_cpu == "x64") { -+ assert(pcscan_stack_supported) -+ sources = [ "starscan/stack/asm/x64/push_registers_asm.cc" ] -+ } else if (current_cpu == "x86") { -+ assert(pcscan_stack_supported) -+ sources = [ "starscan/stack/asm/x86/push_registers_asm.cc" ] -+ } else if (current_cpu == "arm") { -+ assert(pcscan_stack_supported) -+ sources = [ "starscan/stack/asm/arm/push_registers_asm.cc" ] -+ } else if (current_cpu == "arm64") { -+ assert(pcscan_stack_supported) -+ sources = [ "starscan/stack/asm/arm64/push_registers_asm.cc" ] -+ } else if (current_cpu == "riscv64") { -+ assert(pcscan_stack_supported) -+ sources = [ "starscan/stack/asm/riscv64/push_registers_asm.cc" ] -+ } else { -+ assert(!pcscan_stack_supported) -+ # To support a trampoline for another arch, please refer to v8/src/heap/base. -+ } -+ } ++static_library("allocator_core_asm") { ++ if (gcc_lto) { ++ configs -= [ "//build/config/compiler:gcc_lto" ] ++ } ++ if (current_cpu == "x64") { ++ assert(stack_scan_supported) ++ sources = [ "stack/asm/x64/push_registers_asm.cc" ] ++ } else if (current_cpu == "x86") { ++ assert(stack_scan_supported) ++ sources = [ "stack/asm/x86/push_registers_asm.cc" ] ++ } else if (current_cpu == "arm") { ++ assert(stack_scan_supported) ++ sources = [ "stack/asm/arm/push_registers_asm.cc" ] ++ } else if (current_cpu == "arm64") { ++ assert(stack_scan_supported) ++ sources = [ "stack/asm/arm64/push_registers_asm.cc" ] ++ } else if (current_cpu == "riscv64") { ++ assert(stack_scan_supported) ++ sources = [ "stack/asm/riscv64/push_registers_asm.cc" ] ++ } else { ++ # To support a trampoline for another arch, please refer to v8/src/heap/base. ++ assert(!stack_scan_supported) ++ } +} + component("raw_ptr") { # `gn check` is unhappy with most `#includes` when PA isn't # actually built. -@@ -497,25 +524,10 @@ if (is_clang_or_gcc) { +@@ -522,24 +547,9 @@ if (is_clang_or_gcc) { # The Android NDK supports PR_MTE_* macros as of NDK r23. defines += [ "HAS_PR_MTE_MACROS" ] } +- if (current_cpu == "x64") { +- assert(stack_scan_supported) +- sources += [ "stack/asm/x64/push_registers_asm.cc" ] +- } else if (current_cpu == "x86") { +- assert(stack_scan_supported) +- sources += [ "stack/asm/x86/push_registers_asm.cc" ] +- } else if (current_cpu == "arm") { +- assert(stack_scan_supported) +- sources += [ "stack/asm/arm/push_registers_asm.cc" ] +- } else if (current_cpu == "arm64") { +- assert(stack_scan_supported) +- sources += [ "stack/asm/arm64/push_registers_asm.cc" ] +- } else if (current_cpu == "riscv64") { +- assert(stack_scan_supported) +- sources += [ "stack/asm/riscv64/push_registers_asm.cc" ] +- } else { +- # To support a trampoline for another arch, please refer to v8/src/heap/base. +- assert(!stack_scan_supported) + deps = [ ":allocator_base" ] - if (use_starscan) { -- if (current_cpu == "x64") { -- assert(pcscan_stack_supported) -- sources += [ "starscan/stack/asm/x64/push_registers_asm.cc" ] -- } else if (current_cpu == "x86") { -- assert(pcscan_stack_supported) -- sources += [ "starscan/stack/asm/x86/push_registers_asm.cc" ] -- } else if (current_cpu == "arm") { -- assert(pcscan_stack_supported) -- sources += [ "starscan/stack/asm/arm/push_registers_asm.cc" ] -- } else if (current_cpu == "arm64") { -- assert(pcscan_stack_supported) -- sources += [ "starscan/stack/asm/arm64/push_registers_asm.cc" ] -- } else if (current_cpu == "riscv64") { -- assert(pcscan_stack_supported) -- sources += [ "starscan/stack/asm/riscv64/push_registers_asm.cc" ] -- } else { -- # To support a trampoline for another arch, please refer to v8/src/heap/base. -- assert(!pcscan_stack_supported) -+ if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm" || current_cpu == "arm64" || current_cpu == "riscv64") { -+ deps += [ ":partition_alloc_asm" ] - } ++ if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm" || current_cpu == "arm64" || current_cpu == "riscv64") { ++ deps += [ ":allocator_core_asm" ] } - if (use_freelist_pool_offsets) { -@@ -536,7 +548,6 @@ if (is_clang_or_gcc) { + + # TODO(crbug.com/40274683): once we evaluate pool offset freelists, +@@ -563,7 +573,6 @@ if (is_clang_or_gcc) { ":memory_tagging", - "//build/config/compiler:wexit_time_destructors", + ":wexit_time_destructors", ] - deps = [ ":allocator_base" ] public_configs = [] diff --git a/quiche-QuicIntervalDeque-no-match-for-operator-mm.patch b/quiche-QuicIntervalDeque-no-match-for-operator-mm.patch new file mode 100644 index 0000000..a3d7f4c --- /dev/null +++ b/quiche-QuicIntervalDeque-no-match-for-operator-mm.patch @@ -0,0 +1,67 @@ +From d3bc5ffc929b0895ae9e16774069a04ae6fe3c58 Mon Sep 17 00:00:00 2001 +From: bnc +Date: Mon, 13 May 2024 12:28:35 -0700 +Subject: [PATCH] Add some QuicIntervalDeque::Iterator methods. + +GCC requires operator-=() and operator--() to be defined for std::advance for +random access iterators. + +Also, `QUICHE_DCHECK_LE(0u, index_)` is always true as `index_` is unsigned, +causing a warning that is promoted to an error in some environments. This CL +verifies that the addition does not result in underflow before the it is +performed, not after. + +PiperOrigin-RevId: 633296228 +--- + quiche/quic/core/quic_interval_deque.h | 19 +++++++++-- + quiche/quic/core/quic_interval_deque_test.cc | 33 ++++++++++++++++++++ + 2 files changed, 50 insertions(+), 2 deletions(-) + +diff --git a/quiche/quic/core/quic_interval_deque.h b/quiche/quic/core/quic_interval_deque.h +index db7b2b0ac..1c6cd71a5 100644 +--- a/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h ++++ b/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h +@@ -158,7 +158,7 @@ class QUICHE_NO_EXPORT QuicIntervalDeque { + Iterator(std::size_t index, QuicIntervalDeque* deque) + : index_(index), deque_(deque) {} + // Only the ++ operator attempts to update the cached index. Other operators +- // are used by |lower_bound| to binary search and are thus private. ++ // are used by |lower_bound| to binary search. + Iterator& operator++() { + // Don't increment when we are at the end. + const std::size_t container_size = deque_->container_.size(); +@@ -186,6 +186,19 @@ class QUICHE_NO_EXPORT QuicIntervalDeque { + ++(*this); + return copy; + } ++ Iterator& operator--() { ++ if (index_ == 0) { ++ QUIC_BUG(quic_bug_10862_4) << "Iterator out of bounds."; ++ return *this; ++ } ++ index_--; ++ return *this; ++ } ++ Iterator operator--(int) { ++ Iterator copy = *this; ++ --(*this); ++ return copy; ++ } + reference operator*() { return deque_->container_[index_]; } + reference operator*() const { return deque_->container_[index_]; } + pointer operator->() { return &deque_->container_[index_]; } +@@ -194,11 +207,13 @@ class QUICHE_NO_EXPORT QuicIntervalDeque { + } + bool operator!=(const Iterator& rhs) const { return !(*this == rhs); } + Iterator& operator+=(difference_type amount) { ++ // `amount` might be negative, check for underflow. ++ QUICHE_DCHECK_GE(static_cast(index_), -amount); + index_ += amount; +- QUICHE_DCHECK_LE(0u, index_); + QUICHE_DCHECK_LT(index_, deque_->Size()); + return *this; + } ++ Iterator& operator-=(difference_type amount) { return operator+=(-amount); } + difference_type operator-(const Iterator& rhs) const { + return static_cast(index_) - + static_cast(rhs.index_); diff --git a/quiche-absl-HexStringToBytes.patch b/quiche-absl-HexStringToBytes.patch new file mode 100644 index 0000000..fdb8c4e --- /dev/null +++ b/quiche-absl-HexStringToBytes.patch @@ -0,0 +1,125 @@ +From a484a561d3d36beca0d4dc9f5d4a2c083be03e1f Mon Sep 17 00:00:00 2001 +From: awillia +Date: Tue, 19 Mar 2024 17:22:54 -0700 +Subject: [PATCH] Replace deprecated version of absl::HexStringToBytes in test + programs and remaining quic/ tests + +Replaces the deprecated version of absl::HexStringToBytes that returns std::string with the version that returns bool and populates a passed in std::string. This CL isn't expected to change the behavior of any code used in production. + +This allows the Chrome build of QUICHE to build without the `-Wno-deprecated-declarations` clang flag. + +PiperOrigin-RevId: 617342915 +--- + .../web_transport_fingerprint_proof_verifier.cc | 12 ++++++++++-- + quiche/quic/masque/masque_client_bin.cc | 7 ++++++- + quiche/quic/masque/masque_server_backend.cc | 5 ++++- + quiche/quic/tools/crypto_message_printer_bin.cc | 6 +++++- + quiche/quic/tools/quic_packet_printer_bin.cc | 6 +++++- + quiche/quic/tools/quic_toy_client.cc | 17 +++++++++-------- + 6 files changed, 39 insertions(+), 14 deletions(-) + +diff --git a/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc b/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc +index 167e4efc4..fc8cffd40 100644 +--- a/net/third_party/quiche/src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc ++++ b/net/third_party/quiche/src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc +@@ -6,6 +6,8 @@ + + #include + #include ++#include ++#include + + #include "absl/strings/escaping.h" + #include "absl/strings/match.h" +@@ -18,6 +20,7 @@ + #include "quiche/quic/core/quic_types.h" + #include "quiche/quic/core/quic_utils.h" + #include "quiche/quic/platform/api/quic_bug_tracker.h" ++#include "quiche/quic/platform/api/quic_logging.h" + #include "quiche/common/quiche_text_utils.h" + + namespace quic { +@@ -83,8 +86,13 @@ bool WebTransportFingerprintProofVerifier::AddFingerprint( + + std::string normalized = + absl::StrReplaceAll(fingerprint.fingerprint, {{":", ""}}); +- hashes_.push_back(WebTransportHash{fingerprint.algorithm, +- absl::HexStringToBytes(normalized)}); ++ std::string normalized_bytes; ++ if (!absl::HexStringToBytes(normalized, &normalized_bytes)) { ++ QUIC_DLOG(WARNING) << "Fingerprint hexadecimal is invalid"; ++ return false; ++ } ++ hashes_.push_back( ++ WebTransportHash{fingerprint.algorithm, std::move(normalized_bytes)}); + return true; + } + +diff --git a/quiche/quic/masque/masque_client_bin.cc b/quiche/quic/masque/masque_client_bin.cc +index eefd002dc..06e6ed2b7 100644 +--- a/net/third_party/quiche/src/quiche/quic/masque/masque_client_bin.cc ++++ b/net/third_party/quiche/src/quiche/quic/masque/masque_client_bin.cc +@@ -281,7 +281,12 @@ int RunMasqueClient(int argc, char* argv[]) { + QUIC_LOG(ERROR) << "Signature authentication key ID cannot be empty"; + return 1; + } +- private_key_seed = absl::HexStringToBytes(signature_auth_param_split[1]); ++ if (!absl::HexStringToBytes(signature_auth_param_split[1], ++ &private_key_seed)) { ++ QUIC_LOG(ERROR) << "Signature authentication key hex value is invalid"; ++ return 1; ++ } ++ + if (private_key_seed.size() != kEd25519Rfc8032PrivateKeySize) { + QUIC_LOG(ERROR) + << "Invalid signature authentication private key length " +diff --git a/quiche/quic/masque/masque_server_backend.cc b/quiche/quic/masque/masque_server_backend.cc +index f4ff2e0ed..66ca13c96 100644 +--- a/net/third_party/quiche/src/quiche/quic/masque/masque_server_backend.cc ++++ b/net/third_party/quiche/src/quiche/quic/masque/masque_server_backend.cc +@@ -193,7 +193,10 @@ void MasqueServerBackend::SetSignatureAuth(absl::string_view signature_auth) { + quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&kv[1]); + SignatureAuthCredential credential; + credential.key_id = std::string(kv[0]); +- std::string public_key = absl::HexStringToBytes(kv[1]); ++ std::string public_key; ++ if (!absl::HexStringToBytes(kv[1], &public_key)) { ++ QUIC_LOG(FATAL) << "Invalid signature auth public key hex " << kv[1]; ++ } + if (public_key.size() != sizeof(credential.public_key)) { + QUIC_LOG(FATAL) << "Invalid signature auth public key length " + << public_key.size(); +diff --git a/quiche/quic/tools/crypto_message_printer_bin.cc b/quiche/quic/tools/crypto_message_printer_bin.cc +index eb7393d54..82850d94a 100644 +--- a/net/third_party/quiche/src/quiche/quic/tools/crypto_message_printer_bin.cc ++++ b/net/third_party/quiche/src/quiche/quic/tools/crypto_message_printer_bin.cc +@@ -48,7 +48,11 @@ int main(int argc, char* argv[]) { + quic::CryptoFramer framer; + framer.set_visitor(&printer); + framer.set_process_truncated_messages(true); +- std::string input = absl::HexStringToBytes(messages[0]); ++ std::string input; ++ if (!absl::HexStringToBytes(messages[0], &input)) { ++ cerr << "Invalid hex string provided" << endl; ++ return 1; ++ } + if (!framer.ProcessInput(input)) { + return 1; + } +diff --git a/quiche/quic/tools/quic_packet_printer_bin.cc b/quiche/quic/tools/quic_packet_printer_bin.cc +index 5ed77010a..314cc20ea 100644 +--- a/net/third_party/quiche/src/quiche/quic/tools/quic_packet_printer_bin.cc ++++ b/net/third_party/quiche/src/quiche/quic/tools/quic_packet_printer_bin.cc +@@ -270,7 +270,11 @@ int main(int argc, char* argv[]) { + quiche::QuichePrintCommandLineFlagHelp(usage); + return 1; + } +- std::string hex = absl::HexStringToBytes(args[1]); ++ std::string hex; ++ if (!absl::HexStringToBytes(args[1], &hex)) { ++ std::cerr << "Invalid hex string" << std::endl; ++ return 1; ++ } + quic::ParsedQuicVersionVector versions = quic::AllSupportedVersions(); + // Fake a time since we're not actually generating acks. + quic::QuicTime start(quic::QuicTime::Zero()); diff --git a/real_time_reporting_bindings-forward-declaration.patch b/real_time_reporting_bindings-forward-declaration.patch new file mode 100644 index 0000000..0d4a6e6 --- /dev/null +++ b/real_time_reporting_bindings-forward-declaration.patch @@ -0,0 +1,37 @@ +From fb3678b0d1084b49c5ca795200131a7c0ac01ffe Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 15 May 2024 13:59:56 +0000 +Subject: [PATCH] libstdc++: real time reporting bindings vector requires full + declaration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +libstdc++ implementation of std::vector requires the full declaration +of the type and not a forward declaration. This breaks compilation of +RealTimeReportingBindings, as it has an std::vector of +RealTimeReportingContributionPtr. + +Bug: 41455655 +Change-Id: I9ee70fbb58af36f4cfc43a5d4b1e99799f4c760c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5541055 +Reviewed-by: Russ Hamilton +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1301266} +--- + content/services/auction_worklet/real_time_reporting_bindings.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/content/services/auction_worklet/real_time_reporting_bindings.h b/content/services/auction_worklet/real_time_reporting_bindings.h +index c755d5cab041ec..da4d05e96f788c 100644 +--- a/content/services/auction_worklet/real_time_reporting_bindings.h ++++ b/content/services/auction_worklet/real_time_reporting_bindings.h +@@ -12,7 +12,7 @@ + #include "content/common/content_export.h" + #include "content/services/auction_worklet/auction_v8_helper.h" + #include "content/services/auction_worklet/context_recycler.h" +-#include "content/services/auction_worklet/public/mojom/real_time_reporting.mojom-forward.h" ++#include "content/services/auction_worklet/public/mojom/real_time_reporting.mojom.h" + #include "v8/include/v8-forward.h" + + namespace auction_worklet { diff --git a/remove-dawn.patch b/remove-dawn.patch index b82636e..d8a4707 100644 --- a/remove-dawn.patch +++ b/remove-dawn.patch @@ -46,8 +46,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw #if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS) services.Add(RunShapeDetectionService); ---- src/content/utility/utility_main.cc.old 2024-04-02 09:53:16.050958400 +0000 -+++ src/content/utility/utility_main.cc 2024-04-07 17:41:04.823696600 +0000 +--- src/content/utility/utility_main.cc.orig 2024-07-24 12:50:51.439131000 +0200 ++++ src/content/utility/utility_main.cc 2024-08-03 00:11:18.255682100 +0200 @@ -32,7 +32,6 @@ #include "sandbox/policy/mojom/sandbox.mojom.h" #include "sandbox/policy/sandbox.h" @@ -56,18 +56,17 @@ Remove this unused component which brings a huge dependency on //third_party/daw #include "services/screen_ai/buildflags/buildflags.h" #include "services/tracing/public/cpp/trace_startup.h" #include "third_party/icu/source/common/unicode/unistr.h" -@@ -202,10 +201,6 @@ int UtilityMain(MainFunctionParams param - ? base::MessagePumpType::UI - : base::MessagePumpType::DEFAULT; +@@ -246,9 +245,6 @@ int UtilityMain(MainFunctionParams param + } + } -- if (parameters.command_line->GetSwitchValueASCII(switches::kUtilitySubType) == -- on_device_model::mojom::OnDeviceModelService::Name_) { +- if (utility_sub_type == on_device_model::mojom::OnDeviceModelService::Name_) { - CHECK(on_device_model::OnDeviceModelService::PreSandboxInit()); - } - #if BUILDFLAG(IS_MAC) - auto sandbox_type = -@@ -283,11 +278,6 @@ int UtilityMain(MainFunctionParams param + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + // Thread type delegate of the process should be registered before first +@@ -283,11 +279,6 @@ int UtilityMain(MainFunctionParams param case sandbox::mojom::Sandbox::kAudio: pre_sandbox_hook = base::BindOnce(&audio::AudioPreSandboxHook); break; @@ -79,3 +78,13 @@ Remove this unused component which brings a huge dependency on //third_party/daw case sandbox::mojom::Sandbox::kSpeechRecognition: pre_sandbox_hook = base::BindOnce(&speech::SpeechRecognitionPreSandboxHook); +@@ -437,9 +428,6 @@ int UtilityMain(MainFunctionParams param + + run_loop.Run(); + +- if (utility_sub_type == on_device_model::mojom::OnDeviceModelService::Name_) { +- CHECK(on_device_model::OnDeviceModelService::Shutdown()); +- } + + #if defined(LEAK_SANITIZER) + // Invoke LeakSanitizer before shutting down the utility thread, to avoid diff --git a/remove-openscreen.patch b/remove-openscreen.patch deleted file mode 100644 index c3174f0..0000000 --- a/remove-openscreen.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/chrome/common/BUILD.gn.old -+++ src/chrome/common/BUILD.gn -@@ -350,7 +350,6 @@ static_library("common_lib") { - "//extensions/common:core_api_provider", - "//extensions/common/api", - "//extensions/strings", -- "//media/cast:net", - "//services/device/public/cpp/usb", - ] - } diff --git a/remove-password-manager-and-policy.patch b/remove-password-manager-and-policy.patch index 6562bc3..f1300f5 100644 --- a/remove-password-manager-and-policy.patch +++ b/remove-password-manager-and-policy.patch @@ -22,9 +22,9 @@ index c957a691efc..408fb837d80 100644 --- a/components/embedder_support/user_agent_utils.cc +++ b/components/embedder_support/user_agent_utils.cc @@ -446,12 +446,14 @@ blink::UserAgentMetadata GetUserAgentMetadata(const PrefService* pref_service, - blink::UserAgentMetadata metadata; - bool enable_updated_grease_by_policy = true; + // TODO(crbug.com/40838057): Remove this after M126 which deprecates the + // policy. +#if 0 if (pref_service) { if (pref_service->HasPrefPath( @@ -78,13 +78,14 @@ cgit v1.2.3 if (build_with_tflite_lib) { --- src/components/embedder_support/BUILD.gn.old +++ src/components/embedder_support/BUILD.gn -@@ -24,11 +24,8 @@ static_library("browser_util") { +@@ -24,12 +24,8 @@ static_library("browser_util") { deps = [ ":embedder_support", "//build:branding_buildflags", - "//components/background_sync", - "//components/content_settings/browser", "//components/content_settings/core/browser", +- "//components/content_settings/core/browser:cookie_settings", "//components/permissions", - "//components/policy/core/common", "//components/prefs", @@ -92,15 +93,17 @@ cgit v1.2.3 "//content/public/browser", --- src/components/permissions/BUILD.gn.old +++ src/components/permissions/BUILD.gn -@@ -109,8 +109,6 @@ source_set("permissions") { +@@ -109,10 +109,7 @@ source_set("permissions") { deps = [ "//base", "//build:chromeos_buildflags", - "//components/back_forward_cache", - "//components/content_settings/browser", "//components/content_settings/core/browser", +- "//components/content_settings/core/browser:cookie_settings", "//components/favicon/core:core", "//components/keyed_service/content", + "//components/permissions/prediction_service", --- src/components/proxy_config/BUILD.gn.old +++ src/components/proxy_config/BUILD.gn @@ -23,9 +23,6 @@ component("proxy_config") { @@ -122,26 +125,35 @@ cgit v1.2.3 sources += [ "proxy_policy_handler.cc", "proxy_policy_handler.h", ---- src/components/content_settings/core/browser/BUILD.gn.old +--- src/components/content_settings/core/browser/BUILD.gn.orig +++ src/components/content_settings/core/browser/BUILD.gn -@@ -70,7 +70,7 @@ static_library("browser") { +@@ -69,7 +69,7 @@ static_library("browser") { "//url", ] +- if (!is_ios) { ++ if (false) { + sources += [ + "insecure_private_network_policy_handler.cc", + "insecure_private_network_policy_handler.h", +@@ -78,8 +78,6 @@ static_library("browser") { + + if (use_blink) { + deps += [ +- "//components/policy:generated", +- "//components/policy/core/browser", + "//components/privacy_sandbox:privacy_sandbox_prefs", + ] + } +@@ -93,7 +91,7 @@ source_set("cookie_settings") { + "cookie_settings.h", + ] + - if (!is_ios) { + if (false) { sources += [ "cookie_settings_policy_handler.cc", "cookie_settings_policy_handler.h", -@@ -82,8 +82,6 @@ static_library("browser") { - if (use_blink) { - deps += [ - "//components/permissions:permissions_common", -- "//components/policy:generated", -- "//components/policy/core/browser", - "//components/privacy_sandbox:privacy_sandbox_prefs", - ] - } --- src/electron/chromium_src/BUILD.gn.orig +++ src/electron/chromium_src/BUILD.gn @@ -466,7 +466,7 @@ source_set("chrome_spellchecker") { @@ -179,7 +191,7 @@ cgit v1.2.3 "//device/vr/buildflags", ] } ---- src/components/search_engines/BUILD.gn.old +--- src/components/search_engines/BUILD.gn.orig +++ src/components/search_engines/BUILD.gn @@ -15,45 +15,23 @@ static_library("search_engines") { "choice_made_location.h", @@ -196,8 +208,8 @@ cgit v1.2.3 "keyword_web_data_service.h", - "search_engine_choice/search_engine_choice_service.cc", - "search_engine_choice/search_engine_choice_service.h", -- "search_engine_choice_utils.cc", -- "search_engine_choice_utils.h", +- "search_engine_choice/search_engine_choice_utils.cc", +- "search_engine_choice/search_engine_choice_utils.h", "search_engines_pref_names.h", - "search_host_to_urls_map.cc", - "search_host_to_urls_map.h", @@ -227,7 +239,7 @@ cgit v1.2.3 ] public_deps = [ -@@ -69,20 +47,14 @@ static_library("search_engines") { +@@ -68,21 +46,14 @@ static_library("search_engines") { "//components/sync", "//components/webdata/common", "//third_party/metrics_proto", @@ -240,6 +252,7 @@ cgit v1.2.3 "//components/database_utils", - "//components/infobars/core", - "//components/lens:lens", +- "//components/lens/proto/server:proto", "//components/omnibox/common", - "//components/policy:generated", - "//components/policy/core/browser", @@ -248,7 +261,7 @@ cgit v1.2.3 "//components/signin/public/base", "//components/strings", "//components/url_formatter", -@@ -94,7 +66,6 @@ static_library("search_engines") { +@@ -94,7 +65,6 @@ static_library("search_engines") { "//services/network/public/mojom", "//sql", "//third_party/metrics_proto", @@ -256,7 +269,16 @@ cgit v1.2.3 "//ui/base", "//ui/gfx", "//ui/gfx/geometry", -@@ -120,7 +91,7 @@ static_library("search_engines") { +@@ -112,7 +82,7 @@ static_library("search_engines") { + deps += [ "//components/search_engines/android:jni_headers" ] + } + +- if (!is_android) { ++ if (false) { + sources += [ "search_engine_choice/generated_marketing_snippets.cc" ] + deps += [ + ":generate_search_engine_icons", +@@ -121,7 +91,7 @@ static_library("search_engines") { ] } @@ -278,3 +300,50 @@ cgit v1.2.3 ] deps = [ +--- src/extensions/common/BUILD.gn.orig ++++ src/extensions/common/BUILD.gn +@@ -301,8 +301,6 @@ static_library("common") { + "extension_set.cc", + "extension_set.h", + "extension_updater_uma.h", +- "extension_urls.cc", +- "extension_urls.h", + "extension_utility_types.h", + "extensions_client.cc", + "extensions_client.h", +@@ -498,8 +496,6 @@ static_library("common") { + "//components/crash/core/common", + "//components/crx_file", + "//components/nacl/common:buildflags", +- "//components/safe_browsing/core/common", +- "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils", + "//components/url_formatter", + "//components/url_matcher", + "//components/version_info", +--- src/components/password_manager/core/browser/password_manager_switches.cc.orig 2024-07-24 12:50:49.362463800 +0200 ++++ src/components/password_manager/core/browser/password_manager_switches.cc 2024-08-04 16:04:17.829459300 +0200 +@@ -10,11 +10,9 @@ namespace password_manager { + // Specifies which encryption storage backend to use. Possible values are + // kwallet, kwallet5, kwallet6, gnome-libsecret, basic. + // Any other value will lead to Chrome detecting the best backend automatically. +-const char kPasswordStore[] = "password-store"; + + // Enables the feature of allowing the user to disable the backend via a + // setting. +-const char kEnableEncryptionSelection[] = "enable-encryption-selection"; + #endif // BUILDFLAG(IS_LINUX) + + } // namespace password_manager +--- src/components/password_manager/core/browser/password_manager_switches.h.orig 2024-07-24 12:50:49.362463800 +0200 ++++ src/components/password_manager/core/browser/password_manager_switches.h 2024-08-04 16:03:48.687376900 +0200 +@@ -11,8 +11,8 @@ + namespace password_manager { + + #if BUILDFLAG(IS_LINUX) +-extern const char kPasswordStore[]; +-extern const char kEnableEncryptionSelection[]; ++inline constexpr const char kPasswordStore[] = "password-store"; ++inline constexpr const char kEnableEncryptionSelection[] = "enable-encryption-selection"; + #endif + + } // namespace password_manager diff --git a/remove-rust.patch b/remove-rust.patch index 44b08e9..9c13100 100644 --- a/remove-rust.patch +++ b/remove-rust.patch @@ -15,7 +15,7 @@ Remove this dead code which brings a dependency on rustc @@ -1972,7 +1972,6 @@ static_library("browser") { "//chrome/browser/profiling_host", - # TODO(crbug.com/1335199): break this dep when favicon is in its own target + # TODO(crbug.com/40228447): break this dep when favicon is in its own target - "//chrome/browser/share", "//chrome/browser/ui", "//chrome/browser/storage_access_api", @@ -35,7 +35,7 @@ Remove this dead code which brings a dependency on rustc - "//chrome/browser/share/proto:proto", "//chrome/browser/smart_card", "//chrome/browser/support_tool:support_tool_proto", - "//chrome/browser/ui/actions:actions_headers", + "//chrome/browser/themes", @@ -8407,7 +8404,6 @@ static_library("test_support") { "//build:chromeos_buildflags", "//chrome/app/theme:theme_resources", @@ -52,8 +52,8 @@ Remove this dead code which brings a dependency on rustc "//chrome/browser/safe_browsing", - "//chrome/browser/share", "//chrome/browser/storage_access_api", + "//chrome/browser/themes", "//chrome/browser/ui/side_panel:side_panel_enums", - "//chrome/browser/ui/webui/location_internals:mojo_bindings", @@ -591,7 +590,6 @@ static_library("ui") { "//components/privacy_sandbox:tracking_protection_settings", "//components/profile_metrics", @@ -62,9 +62,20 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser", "//components/reading_list/core", "//components/reading_list/features:flags", +--- src/build/rust/rust_target.gni.orig ++++ src/build/rust/rust_target.gni +@@ -7,7 +7,7 @@ import("//build/rust/rust_unit_test.gni" + + # The //build directory is re-used for non-Chromium products. We do not support + # cxx bindings in such contexts, because //third_party may be missing. +-if (build_with_chromium) { ++if (false) { + import("//third_party/rust/cxx/chromium_integration/rust_cxx.gni") + } + --- src/chrome/test/BUILD.gn.orig +++ src/chrome/test/BUILD.gn -@@ -1923,7 +1923,6 @@ if (!is_android) { +@@ -1942,7 +1942,6 @@ if (!is_android) { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", "//components/proxy_config", @@ -72,15 +83,23 @@ Remove this dead code which brings a dependency on rustc "//components/reading_list/core", "//components/reading_list/features:flags", "//components/resources", -@@ -6774,7 +6773,6 @@ test("unit_tests") { +@@ -5593,7 +5592,6 @@ if (!is_android) { + if (!is_chromeos) { + sources += [ "../browser/webauthn/enclave_authenticator_browsertest.cc" ] + deps += [ +- "//chrome/browser/webauthn:test_support", + "//components/os_crypt/sync:test_support", + ] + } +@@ -6867,7 +6865,6 @@ test("unit_tests") { "//chrome/browser/safe_browsing:metrics_collector", "//chrome/browser/safe_browsing:verdict_cache_manager_factory", "//chrome/browser/segmentation_platform:test_utils", - "//chrome/browser/share", "//chrome/browser/sharing/proto", "//chrome/browser/storage_access_api", - "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto", -@@ -6927,7 +6925,6 @@ test("unit_tests") { + "//chrome/browser/supervised_user:test_support", +@@ -7028,7 +7025,6 @@ test("unit_tests") { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", "//components/proxy_config", @@ -88,15 +107,20 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser", "//components/query_tiles:unit_tests", "//components/reading_list/core", -@@ -8360,11 +8357,6 @@ test("unit_tests") { - - data += [ "//ash/components/arc/test/data/icons/" ] - -- data_deps += [ -- # enclave_manager_unittest.cc runs this binary as part of its testing -- # process. -- "//third_party/cloud_authenticator/test/local_service:cloud_authenticator_test_service", -- ] - - if (include_js2gtest_tests && is_chromeos_ash) { - data += js2gtest_js_libraries +@@ -7193,7 +7189,6 @@ test("unit_tests") { + "//third_party/metrics_proto", + "//third_party/microsoft_webauthn", + "//third_party/re2", +- "//third_party/rust/fend_core/v1/wrapper:unit_tests", + "//third_party/webrtc_overrides:webrtc_component", + "//third_party/widevine/cdm:headers", + "//third_party/zlib/google:compression_utils", +@@ -8443,8 +8438,6 @@ test("unit_tests") { + "//chrome/browser/ui/webui/side_panel/performance_controls:mojo_bindings", + "//chrome/browser/ui/webui/side_panel/user_notes:mojo_bindings", + "//chrome/browser/web_applications:web_applications_test_support", +- "//chrome/browser/webauthn:test_support", +- "//chrome/browser/webauthn/proto", + "//chrome/common/accessibility:mojo_bindings", + "//components/app_constants", + "//components/color", diff --git a/remove-sync.patch b/remove-sync.patch index f8fb342..2e03ebd 100644 --- a/remove-sync.patch +++ b/remove-sync.patch @@ -180,38 +180,51 @@ Inspired by: bool is_loaded_; --- src/device/fido/BUILD.gn.orig +++ src/device/fido/BUILD.gn -@@ -148,20 +148,6 @@ component("fido") { - "device_operation.h", - "device_response_converter.cc", - "device_response_converter.h", -- "enclave/constants.cc", -- "enclave/constants.h", -- "enclave/enclave_authenticator.cc", -- "enclave/enclave_authenticator.h", -- "enclave/enclave_discovery.cc", -- "enclave/enclave_discovery.h", -- "enclave/enclave_protocol_utils.cc", -- "enclave/enclave_protocol_utils.h", -- "enclave/enclave_websocket_client.cc", -- "enclave/enclave_websocket_client.h", -- "enclave/transact.cc", -- "enclave/transact.h", -- "enclave/types.cc", -- "enclave/types.h", - "fido_authenticator.cc", - "fido_authenticator.h", - "fido_device.cc", -@@ -229,7 +215,6 @@ component("fido") { - ] +@@ -163,33 +163,6 @@ component("fido") { + "device_operation.h", + "device_response_converter.cc", + "device_response_converter.h", +- "enclave/constants.cc", +- "enclave/constants.h", +- "enclave/enclave_authenticator.cc", +- "enclave/enclave_authenticator.h", +- "enclave/enclave_discovery.cc", +- "enclave/enclave_discovery.h", +- "enclave/enclave_protocol_utils.cc", +- "enclave/enclave_protocol_utils.h", +- "enclave/enclave_websocket_client.cc", +- "enclave/enclave_websocket_client.h", +- "enclave/metrics.cc", +- "enclave/metrics.h", +- "enclave/transact.cc", +- "enclave/transact.h", +- "enclave/types.cc", +- "enclave/types.h", +- "enclave/verify/claim.cc", +- "enclave/verify/claim.h", +- "enclave/verify/endorsement.cc", +- "enclave/verify/endorsement.h", +- "enclave/verify/hash.cc", +- "enclave/verify/hash.h", +- "enclave/verify/rekor.cc", +- "enclave/verify/rekor.h", +- "enclave/verify/utils.cc", +- "enclave/verify/utils.h", +- "enclave/verify/verify.h", + "fido_authenticator.cc", + "fido_authenticator.h", + "fido_device.cc", +@@ -256,7 +229,6 @@ component("fido") { + ] - deps += [ -- "//components/sync/protocol:protocol", - "//services/device/public/cpp/hid", - "//services/device/public/cpp/usb", - "//services/device/public/mojom", + deps += [ +- "//components/sync/protocol:protocol", + "//services/device/public/cpp/hid", + "//services/device/public/cpp/usb", + "//services/device/public/mojom", --- src/device/fido/fido_discovery_factory.cc.orig +++ src/device/fido/fido_discovery_factory.cc -@@ -37,7 +37,7 @@ +@@ -38,7 +38,7 @@ #include "device/fido/cros/discovery.h" #endif // BUILDFLAG(IS_CHROMEOS) @@ -220,38 +233,15 @@ Inspired by: #include "device/fido/enclave/enclave_discovery.h" #endif -@@ -108,7 +108,7 @@ std::vector> + FidoDiscoveryFactory::MaybeCreateEnclaveDiscovery() { +-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) +#if 0 - void FidoDiscoveryFactory::set_enclave_passkey_creation_callback( - base::RepeatingCallback - callback) { - enclave_passkey_creation_callback_ = callback; - } -+#endif - - void FidoDiscoveryFactory::set_enclave_ui_request_stream( - std::unique_ptr>& discoveries) { if (!base::FeatureList::IsEnabled(kWebAuthnEnclaveAuthenticator) || + !enclave_ui_request_stream_ || !network_context_factory_) { + return std::nullopt; --- src/device/fido/fido_discovery_factory.h.orig +++ src/device/fido/fido_discovery_factory.h @@ -15,7 +15,6 @@ @@ -262,22 +252,3 @@ Inspired by: #include "device/fido/cable/cable_discovery_data.h" #include "device/fido/cable/v2_constants.h" #include "device/fido/ctap_get_assertion_request.h" -@@ -99,9 +98,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) Fido - - // Provides a callback that will be called when a passkey is created with - // the enclave authenticator in order to save the new passkey to sync data. -- void set_enclave_passkey_creation_callback( -- base::RepeatingCallback -- callback); - - void set_enclave_ui_request_stream( - std::unique_ptr hid_ignore_list_; -- base::RepeatingCallback -- enclave_passkey_creation_callback_; - std::unique_ptr>> - enclave_ui_request_stream_; diff --git a/run_segmenter-missing-optional.patch b/run_segmenter-missing-optional.patch new file mode 100644 index 0000000..e458902 --- /dev/null +++ b/run_segmenter-missing-optional.patch @@ -0,0 +1,34 @@ +From 42fc562599d784a8a646703ce3b7c158ce1a8466 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 15 May 2024 14:01:03 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::optional in + run_segmenter.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: If28c13730926447b1d362ecfe08ae0bc44112876 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539811 +Commit-Queue: José Dapena Paz +Reviewed-by: Florin Malita +Cr-Commit-Position: refs/heads/main@{#1301267} +--- + .../blink/renderer/platform/fonts/shaping/run_segmenter.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h b/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h +index 406c4070e91489..116f17dae944a7 100644 +--- a/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h +@@ -6,7 +6,10 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_RUN_SEGMENTER_H_ + + #include ++ + #include ++#include ++ + #include "third_party/blink/renderer/platform/fonts/font_orientation.h" + #include "third_party/blink/renderer/platform/fonts/orientation_iterator.h" + #include "third_party/blink/renderer/platform/fonts/script_run_iterator.h" diff --git a/script_streamer-atomic-include.patch b/script_streamer-atomic-include.patch deleted file mode 100644 index f56f5fb..0000000 --- a/script_streamer-atomic-include.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 8be4d17beb71c29118c3337268f3e7b3930a657f Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 26 Mar 2024 10:06:31 +0000 -Subject: [PATCH] IWYU: use regular atomic include instead of hardcoding libc++ - path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: I2f2076d533b9732d1f7ff8aea5dc027547f62347 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5373879 -Commit-Queue: José Dapena Paz -Reviewed-by: Marja Hölttä -Cr-Commit-Position: refs/heads/main@{#1278213} ---- - third_party/blink/renderer/bindings/core/v8/script_streamer.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc -index f00f7cef4cc26..90f1ce6db12f3 100644 ---- a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc -+++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc -@@ -4,6 +4,7 @@ - - #include "third_party/blink/renderer/bindings/core/v8/script_streamer.h" - -+#include - #include - #include - -@@ -60,7 +61,6 @@ - #include "third_party/blink/renderer/platform/wtf/shared_buffer.h" - #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" - #include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h" --#include "third_party/libc++/src/include/__atomic/atomic.h" - - namespace blink { - namespace { diff --git a/span_reader-missing-optional.patch b/span_reader-missing-optional.patch deleted file mode 100644 index 21102c9..0000000 --- a/span_reader-missing-optional.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b3330cb62d7be253a5b99e40b88e2290c329ac08 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 19 Mar 2024 19:05:35 +0000 -Subject: [PATCH] IWYU: missing include for std::optional usage in - span_reader.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: I13cc54ea91d4b02b170213e471c01fd5fc28394c -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374258 -Reviewed-by: Daniel Cheng -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1275094} ---- - base/containers/span_reader.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/base/containers/span_reader.h b/base/containers/span_reader.h -index 6b67b436bd9c1..3f323fd57a550 100644 ---- a/base/containers/span_reader.h -+++ b/base/containers/span_reader.h -@@ -5,6 +5,8 @@ - #ifndef BASE_CONTAINERS_SPAN_READER_H_ - #define BASE_CONTAINERS_SPAN_READER_H_ - -+#include -+ - #include "base/containers/span.h" - #include "base/numerics/safe_conversions.h" - diff --git a/system-six.patch b/system-six.patch index 8f5a589..a099e7b 100644 --- a/system-six.patch +++ b/system-six.patch @@ -8,7 +8,7 @@ The `-w` parameter to gen_share_targets_proto.py and several other scripts remov @@ -156,7 +156,8 @@ def Run(self): parser = optparse.OptionParser() - # TODO(crbug.com/614082): Remove this once the bug is fixed. + # TODO(crbug.com/41255210): Remove this once the bug is fixed. - parser.add_option('-w', '--wrap', action="store_true", default=False, + parser.add_option('-w', '--fake-option', action="store_true", default=False) + parser.add_option('--wrap', action="store_true", default=False, diff --git a/system-yuv.patch b/system-yuv.patch deleted file mode 100644 index d087e73..0000000 --- a/system-yuv.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- src/build/linux/unbundle/libyuv.gn.orig -+++ src/build/linux/unbundle/libyuv.gn -@@ -1,7 +1,7 @@ - import("//build/config/linux/pkg_config.gni") - import("//build/shim_headers.gni") - --pkg_config("system_yuv") { -+pkg_config("libyuv_config") { - packages = [ "libyuv" ] - } - -@@ -33,5 +33,5 @@ shim_headers("libyuv_shim") { - - source_set("libyuv") { - deps = [ ":libyuv_shim" ] -- public_configs = [ ":system_yuv" ] -+ public_configs = [ ":libyuv_config" ] - } diff --git a/temporal_scalability_id_extractor-missing-bitset.patch b/temporal_scalability_id_extractor-missing-bitset.patch deleted file mode 100644 index 0503756..0000000 --- a/temporal_scalability_id_extractor-missing-bitset.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 59843523390481e52d3a397687a09a7582c44114 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Tue, 19 Mar 2024 17:06:46 +0000 -Subject: [PATCH] IWYU: missing include for std::bitset usage in - temporal_scalability_id_extractor.cc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: Id0b573b23137011a82fd2a85160eae4099a96467 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5374259 -Commit-Queue: José Dapena Paz -Reviewed-by: Dan Sanders -Cr-Commit-Position: refs/heads/main@{#1275008} ---- - media/filters/temporal_scalability_id_extractor.cc | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/media/filters/temporal_scalability_id_extractor.cc b/media/filters/temporal_scalability_id_extractor.cc -index 8d27b8b3b7a8c..67dc762b6de0c 100644 ---- a/media/filters/temporal_scalability_id_extractor.cc -+++ b/media/filters/temporal_scalability_id_extractor.cc -@@ -4,6 +4,8 @@ - - #include "media/filters/temporal_scalability_id_extractor.h" - -+#include -+ - namespace media { - - TemporalScalabilityIdExtractor::TemporalScalabilityIdExtractor(VideoCodec codec, diff --git a/text_decoder-missing-optional.patch b/text_decoder-missing-optional.patch new file mode 100644 index 0000000..7ac48b0 --- /dev/null +++ b/text_decoder-missing-optional.patch @@ -0,0 +1,28 @@ +From d852bf71654ae63d5e8e6624652584a9adf1df6f Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Wed, 15 May 2024 17:35:08 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::optional in + text_decoder.h + +Bug: 41455655 +Change-Id: I8902831e823760d455ca274bfe45b44be9e947f5 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5541275 +Reviewed-by: Joshua Bell +Commit-Queue: Joshua Bell +Cr-Commit-Position: refs/heads/main@{#1301397} +--- + third_party/blink/renderer/modules/encoding/text_decoder.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/third_party/blink/renderer/modules/encoding/text_decoder.h b/third_party/blink/renderer/modules/encoding/text_decoder.h +index 02452acb7306b6..9a947aab21b255 100644 +--- a/third_party/blink/renderer/modules/encoding/text_decoder.h ++++ b/third_party/blink/renderer/modules/encoding/text_decoder.h +@@ -32,6 +32,7 @@ + #define THIRD_PARTY_BLINK_RENDERER_MODULES_ENCODING_TEXT_DECODER_H_ + + #include ++#include + + #include "third_party/blink/renderer/bindings/core/v8/v8_typedefs.h" + #include "third_party/blink/renderer/bindings/modules/v8/v8_text_decode_options.h" diff --git a/wayland-proto-31-cursor-shape.patch b/wayland-proto-31-cursor-shape.patch index 572f887..abd3c8a 100644 --- a/wayland-proto-31-cursor-shape.patch +++ b/wayland-proto-31-cursor-shape.patch @@ -431,121 +431,6 @@ index 68f87776ef4f0..f5c36964ad36d 100644 // Translate physical pixels to DIPs. gfx::Point hotspot_in_dips = gfx::ScaleToRoundedPoint( cursor->hotspot(), 1.0f / cursor->cursor_image_scale_factor()); -diff --git a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc -index 49dcdfed360fe..7a1640bc6f045 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc -@@ -11,6 +11,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -51,6 +52,7 @@ - #include "ui/ozone/platform/wayland/common/wayland_util.h" - #include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h" - #include "ui/ozone/platform/wayland/host/wayland_connection_test_api.h" -+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h" - #include "ui/ozone/platform/wayland/host/wayland_event_source.h" - #include "ui/ozone/platform/wayland/host/wayland_output.h" - #include "ui/ozone/platform/wayland/host/wayland_output_manager.h" -@@ -146,6 +148,16 @@ wl::ScopedWlArray MakeStateArray(const std::vector states) { - return wl::ScopedWlArray(states); - } - -+class MockCursorShape : public WaylandCursorShape { -+ public: -+ MockCursorShape() : WaylandCursorShape(nullptr, nullptr) {} -+ MockCursorShape(const MockCursorShape&) = delete; -+ MockCursorShape& operator=(const MockCursorShape&) = delete; -+ ~MockCursorShape() override = default; -+ -+ MOCK_METHOD(void, SetCursorShape, (uint32_t), (override)); -+}; -+ - class MockZcrCursorShapes : public WaylandZcrCursorShapes { - public: - MockZcrCursorShapes() : WaylandZcrCursorShapes(nullptr, nullptr) {} -@@ -264,6 +276,14 @@ class WaylandWindowTest : public WaylandTest { - hit_tests->push_back(static_cast(HTTOPRIGHT)); - } - -+ MockCursorShape* InstallMockCursorShape() { -+ auto zcr_cursor_shapes = std::make_unique(); -+ MockCursorShape* mock_cursor_shapes = zcr_cursor_shapes.get(); -+ WaylandConnectionTestApi test_api(connection_.get()); -+ test_api.SetCursorShape(std::move(zcr_cursor_shapes)); -+ return mock_cursor_shapes; -+ } -+ - MockZcrCursorShapes* InstallMockZcrCursorShapes() { - auto zcr_cursor_shapes = std::make_unique(); - MockZcrCursorShapes* mock_cursor_shapes = zcr_cursor_shapes.get(); -@@ -1692,6 +1712,62 @@ TEST_P(WaylandWindowTest, CanDispatchMouseEventFocus) { - EXPECT_TRUE(window_->CanDispatchEvent(&test_mouse_event_)); - } - -+TEST_P(WaylandWindowTest, SetCursorUsesCursorShapeForCommonTypes) { -+ SetPointerFocusedWindow(window_.get()); -+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape(); -+ -+ // Verify some commonly-used cursors. -+ EXPECT_CALL(*mock_cursor_shape, -+ SetCursorShape(WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT)); -+ auto pointer_cursor = AsPlatformCursor( -+ base::MakeRefCounted(mojom::CursorType::kPointer)); -+ window_->SetCursor(pointer_cursor.get()); -+ -+ EXPECT_CALL(*mock_cursor_shape, -+ SetCursorShape(WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER)); -+ auto hand_cursor = AsPlatformCursor( -+ base::MakeRefCounted(mojom::CursorType::kHand)); -+ window_->SetCursor(hand_cursor.get()); -+ -+ EXPECT_CALL(*mock_cursor_shape, -+ SetCursorShape(WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT)); -+ auto ibeam_cursor = AsPlatformCursor( -+ base::MakeRefCounted(mojom::CursorType::kIBeam)); -+ window_->SetCursor(ibeam_cursor.get()); -+} -+ -+TEST_P(WaylandWindowTest, SetCursorCallsCursorShapeOncePerCursor) { -+ SetPointerFocusedWindow(window_.get()); -+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape(); -+ auto hand_cursor = AsPlatformCursor( -+ base::MakeRefCounted(mojom::CursorType::kHand)); -+ // Setting the same cursor twice on the client only calls the server once. -+ EXPECT_CALL(*mock_cursor_shape, SetCursorShape(_)).Times(1); -+ window_->SetCursor(hand_cursor.get()); -+ window_->SetCursor(hand_cursor.get()); -+} -+ -+TEST_P(WaylandWindowTest, SetCursorDoesNotUseCursorShapeForNoneCursor) { -+ SetPointerFocusedWindow(window_.get()); -+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape(); -+ EXPECT_CALL(*mock_cursor_shape, SetCursorShape(_)).Times(0); -+ auto none_cursor = AsPlatformCursor( -+ base::MakeRefCounted(mojom::CursorType::kNone)); -+ window_->SetCursor(none_cursor.get()); -+} -+ -+TEST_P(WaylandWindowTest, SetCursorDoesNotUseCursorShapeForCustomCursors) { -+ SetPointerFocusedWindow(window_.get()); -+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape(); -+ -+ // Custom cursors require bitmaps, so they do not use server-side cursors. -+ EXPECT_CALL(*mock_cursor_shape, SetCursorShape(_)).Times(0); -+ auto custom_cursor = AsPlatformCursor( -+ base::MakeRefCounted(mojom::CursorType::kCustom, SkBitmap(), -+ gfx::Point(), kDefaultCursorScale)); -+ window_->SetCursor(custom_cursor.get()); -+} -+ - TEST_P(WaylandWindowTest, SetCursorUsesZcrCursorShapesForCommonTypes) { - SetPointerFocusedWindow(window_.get()); - MockZcrCursorShapes* mock_cursor_shapes = InstallMockZcrCursorShapes(); diff --git a/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc b/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc index 9e3243dceea20..297c48e614087 100644 --- a/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc diff --git a/webp-no-sharpyuv.patch b/webp-no-sharpyuv.patch new file mode 100644 index 0000000..54b91ea --- /dev/null +++ b/webp-no-sharpyuv.patch @@ -0,0 +1,23 @@ +Electron does not actually use sharpyuv. This enables buillding it on Leap which has old webp + +--- src/build/linux/unbundle/libwebp.gn.orig 2024-07-24 12:50:43.685795800 +0200 ++++ src/build/linux/unbundle/libwebp.gn 2024-08-04 21:34:09.357750400 +0200 +@@ -13,10 +13,6 @@ pkg_config("system_libwebp") { + ] + } + +-pkg_config("system_libsharpyuv") { +- packages = [ "libsharpyuv" ] +-} +- + shim_headers("libwebp_shim") { + root_path = "src/src" + headers = [ +@@ -44,7 +40,6 @@ source_set("libwebp_webp") { + + source_set("libwebp_sharpyuv") { + deps = [ ":libsharpyuv_shim" ] +- public_configs = [ ":system_libsharpyuv" ] + } + + group("libwebp") { -- 2.51.1 From 04565962abcefd03150c5603393de43503fe89a2a0e58b092b7ff903aae26d63 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 16 Sep 2024 18:31:36 +0000 Subject: [PATCH 20/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=172 --- electron-16-std-vector-non-const.patch | 124 ------------------------- 1 file changed, 124 deletions(-) delete mode 100644 electron-16-std-vector-non-const.patch diff --git a/electron-16-std-vector-non-const.patch b/electron-16-std-vector-non-const.patch deleted file mode 100644 index 8abbf2f..0000000 --- a/electron-16-std-vector-non-const.patch +++ /dev/null @@ -1,124 +0,0 @@ -Index: electron-17.1.0/chrome/browser/process_singleton.h -=================================================================== ---- electron-17.1.0.orig/chrome/browser/process_singleton.h 2022-03-07 17:39:06.993345117 +0100 -+++ electron-17.1.0/chrome/browser/process_singleton.h 2022-03-09 08:29:01.682773127 +0100 -@@ -102,7 +102,7 @@ class ProcessSingleton { - using NotificationCallback = - base::RepeatingCallback additional_data)>; -+ const std::vector additional_data)>; - - #if BUILDFLAG(IS_WIN) - ProcessSingleton(const std::string& program_name, - -Index: electron-17.1.0/chrome/browser/process_singleton_posix.cc -=================================================================== ---- electron-17.1.0.orig/chrome/browser/process_singleton_posix.cc 2022-03-07 17:39:06.993345117 +0100 -+++ electron-17.1.0/chrome/browser/process_singleton_posix.cc 2022-03-09 08:29:01.682773127 +0100 -@@ -627,7 +627,7 @@ class ProcessSingleton::LinuxWatcher - // |reader| is for sending back ACK message. - void HandleMessage(const std::string& current_dir, - const std::vector& argv, -- const std::vector additional_data, -+ const std::vector additional_data, - SocketReader* reader); - - // Called when the ProcessSingleton that owns this class is about to be -@@ -684,7 +684,7 @@ void ProcessSingleton::LinuxWatcher::Sta - void ProcessSingleton::LinuxWatcher::HandleMessage( - const std::string& current_dir, - const std::vector& argv, -- const std::vector additional_data, -+ const std::vector additional_data, - SocketReader* reader) { - DCHECK(ui_task_runner_->BelongsToCurrentThread()); - DCHECK(reader); -@@ -774,7 +774,7 @@ void ProcessSingleton::LinuxWatcher::Soc - base::StringToSizeT(tokens[0], &num_args); - std::vector command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args); - -- std::vector additional_data; -+ std::vector additional_data; - if (tokens.size() >= 3 + num_args) { - size_t additional_data_size; - base::StringToSizeT(tokens[1 + num_args], &additional_data_size); -@@ -783,7 +783,7 @@ void ProcessSingleton::LinuxWatcher::Soc - std::string(1, kTokenDelimiter)); - const uint8_t* additional_data_bits = - reinterpret_cast(remaining_args.c_str()); -- additional_data = std::vector( -+ additional_data = std::vector( - additional_data_bits, additional_data_bits + additional_data_size); - } - -Index: electron-17.1.0/chrome/browser/process_singleton_win.cc -=================================================================== ---- electron-17.1.0.orig/chrome/browser/process_singleton_win.cc 2022-03-07 17:39:06.993345117 +0100 -+++ electron-17.1.0/chrome/browser/process_singleton_win.cc 2022-03-09 08:29:01.682773127 +0100 -@@ -81,7 +81,7 @@ BOOL CALLBACK BrowserWindowEnumeration(H - bool ParseCommandLine(const COPYDATASTRUCT* cds, - base::CommandLine* parsed_command_line, - base::FilePath* current_directory, -- std::vector* parsed_additional_data) { -+ std::vector* parsed_additional_data) { - // We should have enough room for the shortest command (min_message_size) - // and also be a multiple of wchar_t bytes. The shortest command - // possible is L"START\0\0" (empty command line, current directory, -@@ -163,7 +163,7 @@ bool ParseCommandLine(const COPYDATASTRU - msg.substr(fourth_null + 1, fifth_null - fourth_null); - const uint8_t* additional_data_bytes = - reinterpret_cast(additional_data.c_str()); -- *parsed_additional_data = std::vector(additional_data_bytes, -+ *parsed_additional_data = std::vector(additional_data_bytes, - additional_data_bytes + additional_data_length); - - return true; -@@ -187,7 +187,7 @@ bool ProcessLaunchNotification( - - base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM); - base::FilePath current_directory; -- std::vector additional_data; -+ std::vector additional_data; - if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory, &additional_data)) { - *result = TRUE; - return true; -Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.cc -=================================================================== ---- electron-17.1.0.orig/electron/shell/browser/api/electron_api_app.cc 2022-03-07 16:07:24.343397858 +0100 -+++ electron-17.1.0/electron/shell/browser/api/electron_api_app.cc 2022-03-09 08:29:01.682773127 +0100 -@@ -517,10 +517,10 @@ bool NotificationCallbackWrapper( - const base::RepeatingCallback< - void(base::CommandLine command_line, - const base::FilePath& current_directory, -- const std::vector additional_data)>& callback, -+ const std::vector additional_data)>& callback, - base::CommandLine cmd, - const base::FilePath& cwd, -- const std::vector additional_data) { -+ const std::vector additional_data) { - // Make sure the callback is called after app gets ready. - if (Browser::Get()->is_ready()) { - callback.Run(std::move(cmd), cwd, std::move(additional_data)); -@@ -1081,7 +1081,7 @@ std::string App::GetLocaleCountryCode() - - void App::OnSecondInstance(base::CommandLine cmd, - const base::FilePath& cwd, -- const std::vector additional_data) { -+ const std::vector additional_data) { - v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); - v8::HandleScope handle_scope(isolate); - v8::Local data_value = -Index: electron-17.1.0/electron/shell/browser/api/electron_api_app.h -=================================================================== ---- electron-17.1.0.orig/electron/shell/browser/api/electron_api_app.h 2022-03-07 16:07:24.343397858 +0100 -+++ electron-17.1.0/electron/shell/browser/api/electron_api_app.h 2022-03-09 08:29:01.682773127 +0100 -@@ -194,7 +194,7 @@ class App : public ElectronBrowserClient - std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const; - void OnSecondInstance(base::CommandLine cmd, - const base::FilePath& cwd, -- const std::vector additional_data); -+ const std::vector additional_data); - bool HasSingleInstanceLock() const; - bool RequestSingleInstanceLock(gin::Arguments* args); - void ReleaseSingleInstanceLock(); -- 2.51.1 From 04cc6e12bc7f391ea2c2dc8862d3cb2b552655c41180e5aa71274b89aa9fb773 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 11 Oct 2024 04:46:50 +0000 Subject: [PATCH 21/80] Accepting request 1207030 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.0 * Node 20.18.0 * Fixed a crash when calling focus on a WebView's webContents. * Fixed a potential issue accessing a child window document when overriding browserWindow creation via setWindowOpenHandler. * Fixed an issue when dragging to resize when using Window Controls Overlay on Linux. * Fixed an issue where an exception could be thrown on BrowserView after its owner BrowserWindow was closed. * Fixed an issue where clicking the eyedropper icon did nothing instead of opening an eyedropper for color selection as expected. * Ensured that the sender-id hint is set when creating desktop notifications on DBus. - Drop no longer needed electron-16-webpack-fix-openssl-3.patch - Print a message to stderr so that support logs shared by end users are clearly distinguished from upstream builds. OBS-URL: https://build.opensuse.org/request/show/1207030 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=173 --- electron-16-webpack-fix-openssl-3.patch | 17 ----------------- electron-31.6.0.tar.zst | 3 --- electron-31.7.0.tar.zst | 3 +++ electron-launcher.sh | 4 ++++ nodejs-electron.changes | 14 ++++++++++++++ nodejs-electron.spec | 5 +---- 6 files changed, 22 insertions(+), 24 deletions(-) delete mode 100644 electron-16-webpack-fix-openssl-3.patch delete mode 100644 electron-31.6.0.tar.zst create mode 100644 electron-31.7.0.tar.zst diff --git a/electron-16-webpack-fix-openssl-3.patch b/electron-16-webpack-fix-openssl-3.patch deleted file mode 100644 index c985d0b..0000000 --- a/electron-16-webpack-fix-openssl-3.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: electron-16.0.9/electron/build/webpack/webpack.config.base.js -=================================================================== ---- electron-16.0.9.orig/electron/build/webpack/webpack.config.base.js 2022-02-16 16:41:24.767092075 +0100 -+++ electron-16.0.9/electron/build/webpack/webpack.config.base.js 2022-02-17 11:10:51.379512377 +0100 -@@ -1,5 +1,12 @@ - const fs = require('node:fs'); - const path = require('node:path'); -+ -+// HACK: OpenSSL 3 does not support md4 any more, but webpack hardcodes it all -+// over the place: https://github.com/webpack/webpack/issues/13572 -+const crypto = require("crypto"); -+const crypto_orig_createHash = crypto.createHash; -+crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm); -+ - const webpack = require('webpack'); - const TerserPlugin = require('terser-webpack-plugin'); - const WrapperPlugin = require('wrapper-webpack-plugin'); diff --git a/electron-31.6.0.tar.zst b/electron-31.6.0.tar.zst deleted file mode 100644 index 7ea29fb..0000000 --- a/electron-31.6.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6e188fe49c43ec91c53261b38212c042951c2d2e246dd24cc3c8725f46609e35 -size 603436922 diff --git a/electron-31.7.0.tar.zst b/electron-31.7.0.tar.zst new file mode 100644 index 0000000..21a85f2 --- /dev/null +++ b/electron-31.7.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11f379ba8f79b40a01ce275b80f0fe7ea3f6e442eb24b7c5dad228f294bf92fd +size 603711246 diff --git a/electron-launcher.sh b/electron-launcher.sh index 16c5fcf..9a3562f 100644 --- a/electron-launcher.sh +++ b/electron-launcher.sh @@ -1,5 +1,9 @@ #!/bin/bash +>&2 echo 'This build of Electron is provided by openSUSE and contains various modifications.' +>&2 echo 'Please report problems at https://bugzilla.opensuse.org/enter_bug.cgi?classification=openSUSE and not to upstream bug trackers.' + + set -euo pipefail name=electron diff --git a/nodejs-electron.changes b/nodejs-electron.changes index db99685..3925b2a 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Fri Oct 11 04:37:30 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.0 + * Node 20.18.0 + * Fixed a crash when calling focus on a WebView's webContents. + * Fixed a potential issue accessing a child window document when overriding browserWindow creation via setWindowOpenHandler. + * Fixed an issue when dragging to resize when using Window Controls Overlay on Linux. + * Fixed an issue where an exception could be thrown on BrowserView after its owner BrowserWindow was closed. + * Fixed an issue where clicking the eyedropper icon did nothing instead of opening an eyedropper for color selection as expected. + * Ensured that the sender-id hint is set when creating desktop notifications on DBus. +- Drop no longer needed electron-16-webpack-fix-openssl-3.patch +- Print a message to stderr so that support logs shared by end users are clearly distinguished from upstream builds. + ------------------------------------------------------------------- Mon Sep 16 17:40:09 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0b8a4f6..0649242 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -229,7 +229,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.6.0 +Version: 31.7.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -347,9 +347,6 @@ Patch2012: chromium-94-ffmpeg-roll.patch # 'nomerge' attribute cannot be applied to a declaration # See https://reviews.llvm.org/D92800 Patch2022: electron-13-fix-base-check-nomerge.patch -# Fix electron patched code -#Patch2024: electron-16-std-vector-non-const.patch -Patch2029: electron-16-webpack-fix-openssl-3.patch Patch2031: partition_alloc-no-lto.patch Patch2032: seccomp_bpf-no-lto.patch Patch2034: swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch -- 2.51.1 From 5311143648b6729f612617ec6b03c71198f423ddcc4a289840caf3679e9b491f Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 18 Oct 2024 05:35:25 +0000 Subject: [PATCH 22/80] Accepting request 1208761 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.1 * Fixed an issue where the exit event could be emitted twice from the utilityProcess. #44267 * v8: security fixes for CVE-2024-9602 and CVE-2024-9603 (bsc#1231420) OBS-URL: https://build.opensuse.org/request/show/1208761 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=174 --- electron-31.7.0.tar.zst | 3 --- electron-31.7.1.tar.zst | 3 +++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 6 +++++- 4 files changed, 15 insertions(+), 4 deletions(-) delete mode 100644 electron-31.7.0.tar.zst create mode 100644 electron-31.7.1.tar.zst diff --git a/electron-31.7.0.tar.zst b/electron-31.7.0.tar.zst deleted file mode 100644 index 21a85f2..0000000 --- a/electron-31.7.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:11f379ba8f79b40a01ce275b80f0fe7ea3f6e442eb24b7c5dad228f294bf92fd -size 603711246 diff --git a/electron-31.7.1.tar.zst b/electron-31.7.1.tar.zst new file mode 100644 index 0000000..99b13c8 --- /dev/null +++ b/electron-31.7.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0afd353d5cab3ef8fb7ae759c15a5a68024edeb6c1684969d89bbf2cf774565 +size 604107245 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 3925b2a..2a088fa 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 18 05:11:51 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.1 + * Fixed an issue where the exit event could be emitted twice from the utilityProcess. #44267 + * v8: security fixes for CVE-2024-9602 and CVE-2024-9603 (bsc#1231420) + ------------------------------------------------------------------- Fri Oct 11 04:37:30 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0649242..2f87749 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -229,7 +229,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.0 +Version: 31.7.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -1218,7 +1218,11 @@ myconf_gn+=' symbol_level=0' myconf_gn+=' blink_symbol_level=0' myconf_gn+=' v8_symbol_level=0' %else +%if 0%{?fedora} == 39 +myconf_gn+=' symbol_level=1' +%else myconf_gn+=' symbol_level=2' +%endif myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' %endif -- 2.51.1 From 9fd135c6e252e6b89703c6200d06e632dfda47aaf96a36fda682f2e94b1534eb Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 25 Oct 2024 04:44:39 +0000 Subject: [PATCH 23/80] Accepting request 1218154 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.2 * Fixed calling setAlwaysOnTop on a hidden window which is then shown with showInactive on Linux under X11. * v8: security fixes for CVE-2024-9121 CVE-2024-9122 CVE-2024-7970 * security fixes for CVE-2024-7025 CVE-2024-9369 (bsc#1231232) * security fixes for CVE-2024-7965 CVE-2024-7966 CVE-2024-7967 (bsc#1229591) * security fixes for CVE-2024-8198 CVE-2024-8193 CVE-2024-7969 (bsc#1229897) * fix use after free in WebAudio (CVE-2024-8362 bsc#1230108) * fix heap buffer overflow in Skia (CVE-2024-8636 bsc#1230391) * fix integer overflow in Skia (CVE-2024-9123) OBS-URL: https://build.opensuse.org/request/show/1218154 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=175 --- create_tarball.sh | 4 ++-- electron-31.7.1.tar.zst | 3 --- electron-31.7.2.tar.zst | 3 +++ nodejs-electron.changes | 13 +++++++++++++ nodejs-electron.spec | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) delete mode 100644 electron-31.7.1.tar.zst create mode 100644 electron-31.7.2.tar.zst diff --git a/create_tarball.sh b/create_tarball.sh index 3a7f58f..9979d22 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -295,8 +295,8 @@ keeplibs=( third_party/webrtc/common_audio/third_party/ooura #derived code, not vendored dep third_party/webrtc/common_audio/third_party/spl_sqrt_floor #derived code, not vendored dep third_party/webrtc/modules/third_party/fft #derived code, not vendored dep - third_party/webrtc/modules/third_party/g711 #derived code, not vendored dep - third_party/webrtc/modules/third_party/g722 #derived code, not vendored dep + third_party/webrtc/modules/third_party/g711 #Fork. Original is from spandsp. Might be debundled if upstream ever accepts WebRTC's patches. + third_party/webrtc/modules/third_party/g722 #Fork. Original is from spandsp. third_party/webrtc/rtc_base/third_party/base64 #derived code, not vendored dep third_party/webrtc/rtc_base/third_party/sigslot #derived code, not vendored dep third_party/webrtc_overrides #Integral part of chrome diff --git a/electron-31.7.1.tar.zst b/electron-31.7.1.tar.zst deleted file mode 100644 index 99b13c8..0000000 --- a/electron-31.7.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0afd353d5cab3ef8fb7ae759c15a5a68024edeb6c1684969d89bbf2cf774565 -size 604107245 diff --git a/electron-31.7.2.tar.zst b/electron-31.7.2.tar.zst new file mode 100644 index 0000000..3e0e318 --- /dev/null +++ b/electron-31.7.2.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55246cda85d073ed5a5ef10600bc1db99f4e181ec84733f84a9db6eb8d8cc128 +size 604038083 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 2a088fa..afc2ff3 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Oct 25 03:23:53 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.2 + * Fixed calling setAlwaysOnTop on a hidden window which is then shown with showInactive on Linux under X11. + * v8: security fixes for CVE-2024-9121 CVE-2024-9122 CVE-2024-7970 + * security fixes for CVE-2024-7025 CVE-2024-9369 (bsc#1231232) + * security fixes for CVE-2024-7965 CVE-2024-7966 CVE-2024-7967 (bsc#1229591) + * security fixes for CVE-2024-8198 CVE-2024-8193 CVE-2024-7969 (bsc#1229897) + * fix use after free in WebAudio (CVE-2024-8362 bsc#1230108) + * fix heap buffer overflow in Skia (CVE-2024-8636 bsc#1230391) + * fix integer overflow in Skia (CVE-2024-9123) + ------------------------------------------------------------------- Fri Oct 18 05:11:51 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 2f87749..df75cc9 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -229,7 +229,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.1 +Version: 31.7.2 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 34326a73f1018c0d50b2f3f8f38ee966d0515de66e6ac3dd04b95c65c0229e0f Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Tue, 29 Oct 2024 11:55:04 +0000 Subject: [PATCH 24/80] Accepting request 1219017 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.3 * Fixed crash when network process terminates while a net log is running. OBS-URL: https://build.opensuse.org/request/show/1219017 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=176 --- electron-31.7.2.tar.zst | 3 --- electron-31.7.3.tar.zst | 3 +++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 electron-31.7.2.tar.zst create mode 100644 electron-31.7.3.tar.zst diff --git a/electron-31.7.2.tar.zst b/electron-31.7.2.tar.zst deleted file mode 100644 index 3e0e318..0000000 --- a/electron-31.7.2.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:55246cda85d073ed5a5ef10600bc1db99f4e181ec84733f84a9db6eb8d8cc128 -size 604038083 diff --git a/electron-31.7.3.tar.zst b/electron-31.7.3.tar.zst new file mode 100644 index 0000000..85f1c69 --- /dev/null +++ b/electron-31.7.3.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90618d2ea677a9acc22731ebcf56c88f95e39756834d1e0132c1203f54c54e60 +size 603725259 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index afc2ff3..82ca034 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 29 10:01:13 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.3 + * Fixed crash when network process terminates while a net log is running. + ------------------------------------------------------------------- Fri Oct 25 03:23:53 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index df75cc9..dc18157 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -229,7 +229,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.2 +Version: 31.7.3 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 2f89641587ccf42de599adb175357987f0e5dcb496f4724d137c9b51e0640901 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 10 Nov 2024 09:41:57 +0000 Subject: [PATCH 25/80] Accepting request 1223156 from home:dziobian:gulgul-ultron:19 - Fix build on Fedora 41+: * zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch * swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch * swiftshader-llvm19-LLVMReactor-incomplete-Module.patch * build with system minizip, yuv, simdutf, re2 OBS-URL: https://build.opensuse.org/request/show/1223156 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=177 --- nodejs-electron.changes | 9 ++++++ nodejs-electron.spec | 31 ++++++++++--------- ...er-llvm19-LLVMJIT-getHostCPUFeatures.patch | 16 ++++++++++ ...llvm19-LLVMReactor-incomplete-Module.patch | 10 ++++++ ...-missing-uLong-Z_DEFAULT_COMPRESSION.patch | 12 +++++++ 5 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch create mode 100644 swiftshader-llvm19-LLVMReactor-incomplete-Module.patch create mode 100644 zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 82ca034..39aeecd 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Nov 10 09:28:49 UTC 2024 - Bruno Pitrus + +- Fix build on Fedora 41+: + * zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch + * swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch + * swiftshader-llvm19-LLVMReactor-incomplete-Module.patch + * build with system minizip, yuv, simdutf, re2 + ------------------------------------------------------------------- Tue Oct 29 10:01:13 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index dc18157..e0de978 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -17,8 +17,6 @@ # -# https://fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck -%undefine _auto_set_build_flags %define mod_name electron # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json @@ -27,9 +25,6 @@ # Do not provide libEGL.so, etc… %define __provides_exclude ^lib.*\\.so.*$ -# Double DWZ memory limits -%define _dwz_low_mem_die_limit 20000000 -%define _dwz_max_die_limit 100000000 #x86 requires SSE2 @@ -110,7 +105,7 @@ BuildArch: i686 -%if 0%{?suse_version} || 0%{?fedora} < 40 +%if 0%{?suse_version} || 0%{?fedora} < 40 || 0%{?fedora} >= 41 %bcond_without system_minizip %else %bcond_with system_minizip @@ -132,7 +127,7 @@ BuildArch: i686 %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora} >= 41 %bcond_without system_yuv %else %bcond_with system_yuv @@ -171,8 +166,11 @@ BuildArch: i686 %endif # requires `run_convert_utf8_to_latin1_with_errors` +%if 0%{?fedora} >= 41 +%bcond_without system_simdutf +%else %bcond_with system_simdutf - +%endif #requires `imageSequenceTrackPresent` and `enableParsingGainMapMetadata` both of which are only in post-1.0.0 nightlies %bcond_with system_avif @@ -184,7 +182,7 @@ BuildArch: i686 %bcond_with system_abseil %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 41 #re2-11 has abseil as a public dependency. If you use system re2 you must use system abseil. %bcond_without system_re2 %else @@ -331,6 +329,7 @@ Patch1082: chromium-124-shims.patch Patch1083: Cr126-abseil-shims.patch Patch1084: absl-base-dynamic_annotations.patch Patch1085: webp-no-sharpyuv.patch +Patch1086: zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch # PATCHES to fix interaction with third-party software @@ -413,6 +412,8 @@ Patch3172: real_time_reporting_bindings-forward-declaration.patch Patch3173: blink-platform-INSIDE_BLINK-Wodr.patch Patch3174: quiche-QuicIntervalDeque-no-match-for-operator-mm.patch Patch3175: ConsumeRadii-linker-error.patch +Patch3176: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch +Patch3177: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -572,10 +573,6 @@ BuildRequires: pkgconfig(libavutil) >= 58 #requires av_stream_get_first_dts, see rhbz#2240127 BuildRequires: libavformat-free-devel >= %AVFORMAT_VER Requires: (ffmpeg-libs%{_isa} >= %RPMFUSION_VER or libavformat-free%{_isa} >= %AVFORMAT_VER) -# have choice for libvpl.so.2()(64bit) needed by libavcodec-free: libvpl oneVPL -%ifarch x86_64 %x86_64 -BuildRequires: oneVPL -%endif %endif %else BuildRequires: pkgconfig(libavcodec) @@ -610,9 +607,13 @@ BuildRequires: pkgconfig(libxml-2.0) >= 2.9.5 BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(libxxhash) %if %{with system_yuv} +%if 0%{?suse_version} # needs I410ToI420 BuildRequires: pkgconfig(libyuv) >= 1855 %endif +# Fedora does not provide meaningful versioning, sorry +BuildRequires: pkgconfig(libyuv) +%endif BuildRequires: pkgconfig(libzstd) %if %{with system_minizip} %if 0%{?fedora} @@ -1011,6 +1012,8 @@ export CXXFLAGS="${CXXFLAGS} -Wno-error=return-type" export CXXFLAGS="${CXXFLAGS} -Wno-class-memaccess" # Warning spam from generated mojom code again makes the log too big export CXXFLAGS="${CXXFLAGS} -Wno-packed-not-aligned -Wno-address" +# warning spam in third_party/blink/renderer/bindings/modules/v8 +export CXXFLAGS="${CXXFLAGS} -Wno-template-id-cdtor -Wno-non-virtual-dtor" # REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" @@ -1435,7 +1438,7 @@ desktop-file-install --dir %{buildroot}%{_datadir}/applications/ %{SOURCE11} pushd out/Release install -pm 0644 version -t %{buildroot}%{_libdir}/electron/ -gn desc . //electron:electron_app runtime_deps | grep -v ^gen/ | sort | uniq | xargs -t cp -l -v --parents -t %{buildroot}%{_libdir}/electron/ -- +gn desc . //electron:electron_app runtime_deps | grep -v ^gen/ | sort | uniq | xargs -t cp -a -v --parents -t %{buildroot}%{_libdir}/electron/ -- popd diff --git a/swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch b/swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch new file mode 100644 index 0000000..357baca --- /dev/null +++ b/swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch @@ -0,0 +1,16 @@ +--- src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp.orig 2024-10-29 10:12:16.688190300 +0100 ++++ src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 2024-11-06 19:02:57.381872200 +0100 +@@ -221,8 +221,13 @@ JITGlobals *JITGlobals::get() + + // Retrieve host CPU name and sub-target features and add them to builder. + // Relocation model, code model and codegen opt level are kept to default values. ++#if LLVM_VERSION_MAJOR >= 19 ++ llvm::StringMap cpuFeatures= llvm::sys::getHostCPUFeatures(); ++ bool ok = true; ++#else + llvm::StringMap cpuFeatures; + bool ok = llvm::sys::getHostCPUFeatures(cpuFeatures); ++#endif + + #if defined(__i386__) || defined(__x86_64__) || \ + (defined(__linux__) && (defined(__arm__) || defined(__aarch64__))) diff --git a/swiftshader-llvm19-LLVMReactor-incomplete-Module.patch b/swiftshader-llvm19-LLVMReactor-incomplete-Module.patch new file mode 100644 index 0000000..8eda96a --- /dev/null +++ b/swiftshader-llvm19-LLVMReactor-incomplete-Module.patch @@ -0,0 +1,10 @@ +--- src/third_party/swiftshader/src/Reactor/LLVMReactor.cpp.orig 2024-10-29 10:12:16.688190300 +0100 ++++ src/third_party/swiftshader/src/Reactor/LLVMReactor.cpp 2024-11-06 19:06:12.194548700 +0100 +@@ -25,6 +25,7 @@ + + #include "llvm/IR/Intrinsics.h" + #include "llvm/IR/IntrinsicsX86.h" ++#include "llvm/IR/Module.h" + #include "llvm/Support/Alignment.h" + #include "llvm/Support/Error.h" + #include "llvm/Support/ManagedStatic.h" diff --git a/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch b/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch new file mode 100644 index 0000000..d36a78c --- /dev/null +++ b/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch @@ -0,0 +1,12 @@ +--- src/third_party/zlib/google/zip_internal.cc.orig 2024-10-29 10:10:50.788206000 +0100 ++++ src/third_party/zlib/google/zip_internal.cc 2024-11-07 22:19:00.748569000 +0100 +@@ -9,6 +9,9 @@ + + #include + ++#include ++#include ++ + #include "base/containers/fixed_flat_set.h" + #include "base/files/file_path.h" + #include "base/logging.h" -- 2.51.1 From aa1cf652f7a527073dec09ced4c5f6bafa2ea5608effb05c4024058d4933b033 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 13 Nov 2024 15:05:12 +0000 Subject: [PATCH 26/80] Accepting request 1223980 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.4 * Fixed segfault when moving WebContentsView between BrowserWindows * Fix type confusion in v8 (CVE-2024-10231 bsc#1232060) - Fedora 40+ build with system ada url (system-ada-url.patch) OBS-URL: https://build.opensuse.org/request/show/1223980 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=178 --- electron-31.7.3.tar.zst | 3 --- electron-31.7.4.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 19 ++++++++++++++++++- system-ada-url.patch | 30 ++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 4 deletions(-) delete mode 100644 electron-31.7.3.tar.zst create mode 100644 electron-31.7.4.tar.zst create mode 100644 system-ada-url.patch diff --git a/electron-31.7.3.tar.zst b/electron-31.7.3.tar.zst deleted file mode 100644 index 85f1c69..0000000 --- a/electron-31.7.3.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:90618d2ea677a9acc22731ebcf56c88f95e39756834d1e0132c1203f54c54e60 -size 603725259 diff --git a/electron-31.7.4.tar.zst b/electron-31.7.4.tar.zst new file mode 100644 index 0000000..44485be --- /dev/null +++ b/electron-31.7.4.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:012fb4d7fb93125e29bf0633f1dfe0b8fe152d2a8df559addc737968cd45ebbf +size 603389316 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 39aeecd..526f855 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Nov 12 22:49:39 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.4 + * Fixed segfault when moving WebContentsView between BrowserWindows + * Fix type confusion in v8 (CVE-2024-10231 bsc#1232060) +- Fedora 40+ build with system ada url (system-ada-url.patch) + ------------------------------------------------------------------- Sun Nov 10 09:28:49 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index e0de978..0645cb5 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -165,6 +165,12 @@ BuildArch: i686 %bcond_with system_vma %endif +%if 0%{?fedora} >= 40 +%bcond_without system_ada +%else +%bcond_with system_ada +%endif + # requires `run_convert_utf8_to_latin1_with_errors` %if 0%{?fedora} >= 41 %bcond_without system_simdutf @@ -227,7 +233,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.3 +Version: 31.7.4 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -330,6 +336,7 @@ Patch1083: Cr126-abseil-shims.patch Patch1084: absl-base-dynamic_annotations.patch Patch1085: webp-no-sharpyuv.patch Patch1086: zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch +Patch1087: system-ada-url.patch # PATCHES to fix interaction with third-party software @@ -442,6 +449,9 @@ BuildRequires: ImageMagick %if 0%{?fedora} BuildRequires: libatomic %endif +%if %{with system_ada} +BuildRequires: cmake(ada) +%endif %if %{with system_aom} # requires AV1E_SET_QUANTIZER_ONE_PASS BuildRequires: libaom-devel >= 3.7~ @@ -939,6 +949,10 @@ build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_librarie find third_party/angle/src/third_party/volk -type f ! -name "*.gn" -a ! -name "*.gni" -delete %endif +%if %{with system_ada} +find third_party/electron_node/deps/ada -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +%endif + %if %{with system_llhttp} find third_party/electron_node/deps/llhttp -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete %endif @@ -1360,6 +1374,9 @@ myconf_gn+=" use_system_harfbuzz=true" myconf_gn+=" use_system_freetype=true" myconf_gn+=" use_system_cares=true" myconf_gn+=" use_system_nghttp2=true" +%if %{with system_ada} +myconf_gn+=' use_system_ada=true' +%endif %if %{with system_llhttp} myconf_gn+=" use_system_llhttp=true" %endif diff --git a/system-ada-url.patch b/system-ada-url.patch new file mode 100644 index 0000000..14ed615 --- /dev/null +++ b/system-ada-url.patch @@ -0,0 +1,30 @@ +--- src/third_party/electron_node/BUILD.gn.orig 2024-11-12 22:51:23.369659000 +0100 ++++ src/third_party/electron_node/BUILD.gn 2024-11-12 23:46:45.817651900 +0100 +@@ -40,6 +40,7 @@ declare_args() { + node_release_urlbase = "" + + # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries. ++ use_system_ada = false + use_system_cares = false + use_system_nghttp2 = false + use_system_llhttp = false +@@ -260,7 +261,6 @@ component("node_lib") { + deps = [ + ":node_js2c_exec", + "deps/googletest:gtest", +- "deps/ada", + "deps/base64", + "deps/simdutf", + "deps/uvwasi", +@@ -291,6 +291,11 @@ component("node_lib") { + "deps/postject" + ] + libs = [] ++ if (use_system_ada) { ++ libs += [ "ada" ] ++ } else { ++ deps += [ "deps/ada" ] ++ } + if (use_system_llhttp) { + libs += [ "llhttp" ] + } else { -- 2.51.1 From 8c25c9691d1455dcbd0f95a549a8a190c82d4220b3b823b84b321ef0d0020f20 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 17 Nov 2024 09:22:54 +0000 Subject: [PATCH 27/80] Accepting request 1224639 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.5 * Fixed an issue where WebContentsViews were being improperly removed. * Fixed an issue where the windows control overlay was unexpectedly visible in fullscreen. * Fix use after free in Serial (CVE-2024-10827 bsc#1232843) OBS-URL: https://build.opensuse.org/request/show/1224639 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=179 --- electron-31.7.4.tar.zst | 3 --- electron-31.7.5.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 electron-31.7.4.tar.zst create mode 100644 electron-31.7.5.tar.zst diff --git a/electron-31.7.4.tar.zst b/electron-31.7.4.tar.zst deleted file mode 100644 index 44485be..0000000 --- a/electron-31.7.4.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:012fb4d7fb93125e29bf0633f1dfe0b8fe152d2a8df559addc737968cd45ebbf -size 603389316 diff --git a/electron-31.7.5.tar.zst b/electron-31.7.5.tar.zst new file mode 100644 index 0000000..5b95c9f --- /dev/null +++ b/electron-31.7.5.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1aedd2bdbf6a9832fee9557e9ce0e29e442f3cb3400e83da544572c80b48ad97 +size 603507753 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 526f855..f78425a 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Nov 17 08:04:39 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.5 + * Fixed an issue where WebContentsViews were being improperly removed. + * Fixed an issue where the windows control overlay was unexpectedly visible in fullscreen. + * Fix use after free in Serial (CVE-2024-10827 bsc#1232843) + ------------------------------------------------------------------- Tue Nov 12 22:49:39 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0645cb5..20ac708 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -233,7 +233,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.4 +Version: 31.7.5 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 2c5d3b4c57016d6d6e26ccf7471ee1ff513dbd1c03082135490226f87fcdf0c7 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 27 Nov 2024 09:56:12 +0000 Subject: [PATCH 28/80] Accepting request 1226850 from home:dziobian:gulgul-ultron:19 - Fix ffmpeg refusing to play opus audio files (disable-FFmpegAllowLists.patch) OBS-URL: https://build.opensuse.org/request/show/1226850 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=180 --- disable-FFmpegAllowLists.patch | 12 ++++++++++++ nodejs-electron.changes | 5 +++++ nodejs-electron.spec | 3 +++ 3 files changed, 20 insertions(+) create mode 100644 disable-FFmpegAllowLists.patch diff --git a/disable-FFmpegAllowLists.patch b/disable-FFmpegAllowLists.patch new file mode 100644 index 0000000..cf28a81 --- /dev/null +++ b/disable-FFmpegAllowLists.patch @@ -0,0 +1,12 @@ +diff -up chromium-125.0.6422.41/media/base/media_switches.cc.disable-FFmpegAllowLists chromium-125.0.6422.41/media/base/media_switches.cc +--- chromium-125.0.6422.41/media/base/media_switches.cc.disable-FFmpegAllowLists 2024-05-12 21:28:43.694027396 +0200 ++++ chromium-125.0.6422.41/media/base/media_switches.cc 2024-05-12 21:32:48.155063623 +0200 +@@ -1753,7 +1753,7 @@ BASE_FEATURE(kUseWindowBoundsForPip, + // Enables FFmpeg allow lists for supported codecs / containers. + BASE_FEATURE(kFFmpegAllowLists, + "FFmpegAllowLists", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + #if BUILDFLAG(IS_WIN) + // Enables audio offload when supported by endpoints. diff --git a/nodejs-electron.changes b/nodejs-electron.changes index f78425a..5dbb652 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 26 14:11:01 UTC 2024 - Bruno Pitrus + +- Fix ffmpeg refusing to play opus audio files (disable-FFmpegAllowLists.patch) + ------------------------------------------------------------------- Sun Nov 17 08:04:39 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 20ac708..730e6f9 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -388,6 +388,9 @@ Patch2058: v8-strict-aliasing.patch %else Source2058: v8-strict-aliasing.patch %endif +#Fix opus audio not working (eg. Element voice messages) +Patch2059: disable-FFmpegAllowLists.patch + # PATCHES that should be submitted upstream verbatim or near-verbatim # Fix blink nodestructor -- 2.51.1 From 8c83bca41323c4867038017f1fcc436f2ece16ac78d2fbefa4fbabceb45882d6 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 28 Nov 2024 05:42:29 +0000 Subject: [PATCH 29/80] Accepting request 1227018 from home:dziobian:gulgul-ultron:19 - New upstream release 31.7.6 * no user-visible changes - Leap: build with gcc 14 - Drop Fedora 39 support OBS-URL: https://build.opensuse.org/request/show/1227018 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=181 --- electron-31.7.5.tar.zst | 3 --- electron-31.7.6.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++ nodejs-electron.spec | 60 ++++++++++++++--------------------------- 4 files changed, 31 insertions(+), 43 deletions(-) delete mode 100644 electron-31.7.5.tar.zst create mode 100644 electron-31.7.6.tar.zst diff --git a/electron-31.7.5.tar.zst b/electron-31.7.5.tar.zst deleted file mode 100644 index 5b95c9f..0000000 --- a/electron-31.7.5.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1aedd2bdbf6a9832fee9557e9ce0e29e442f3cb3400e83da544572c80b48ad97 -size 603507753 diff --git a/electron-31.7.6.tar.zst b/electron-31.7.6.tar.zst new file mode 100644 index 0000000..fa79f9c --- /dev/null +++ b/electron-31.7.6.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f4e50a8786181d6f0f246150f6c99cc988bea00c7978ae44c4c019fdf4add8b +size 604163877 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 5dbb652..3e17455 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Nov 27 20:33:48 UTC 2024 - Bruno Pitrus + +- New upstream release 31.7.6 + * no user-visible changes +- Leap: build with gcc 14 +- Drop Fedora 39 support + ------------------------------------------------------------------- Tue Nov 26 14:11:01 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 730e6f9..a235210 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -105,7 +105,7 @@ BuildArch: i686 -%if 0%{?suse_version} || 0%{?fedora} < 40 || 0%{?fedora} >= 41 +%if 0%{?suse_version} || 0%{?fedora} >= 41 %bcond_without system_minizip %else %bcond_with system_minizip @@ -143,11 +143,7 @@ BuildArch: i686 %bcond_with ffmpeg_6 %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 40 -%bcond_without gcc14 -%else -%bcond_with gcc14 -%endif + %if 0%{?fedora} @@ -159,18 +155,15 @@ BuildArch: i686 %endif -%if 0%{?fedora} >= 39 +%if 0%{?fedora} %bcond_without system_vma -%else -%bcond_with system_vma -%endif - -%if 0%{?fedora} >= 40 %bcond_without system_ada %else +%bcond_with system_vma %bcond_with system_ada %endif + # requires `run_convert_utf8_to_latin1_with_errors` %if 0%{?fedora} >= 41 %bcond_without system_simdutf @@ -182,7 +175,7 @@ BuildArch: i686 %bcond_with system_avif # Some chromium code assumes absl::string_view is a typedef for std::string_view. This is not true on GCC7 systems such as Leap. -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 39 +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_abseil %else %bcond_with system_abseil @@ -201,14 +194,11 @@ BuildArch: i686 %define PYVER 311 %endif -%if 0%{?fedora} >= 40 +%if 0%{?fedora} %define AVFORMAT_VER 6.0.1 %define RPMFUSION_VER 6.1-3 %endif -%if 0%{?fedora} >= 38 && 0%{?fedora} < 40 -%define AVFORMAT_VER 6.0.1 -%define RPMFUSION_VER 6.0.1-2 -%endif + %if 0%{?suse_version} @@ -233,7 +223,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.5 +Version: 31.7.6 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -382,12 +372,8 @@ Patch2054: bad-font-gc11.patch Patch2055: bad-font-gc1.patch Patch2056: bad-font-gc2.patch Patch2057: bad-font-gc3.patch -#Work around gcc14 overly aggressive optimizer. Interestingly applying this patch produces a *different* crash on gcc13 + LTO. -%if %{with gcc14} +#Work around gcc14 overly aggressive optimizer. Patch2058: v8-strict-aliasing.patch -%else -Source2058: v8-strict-aliasing.patch -%endif #Fix opus audio not working (eg. Element voice messages) Patch2059: disable-FFmpegAllowLists.patch @@ -678,15 +664,13 @@ BuildRequires: libjpeg-turbo-devel BuildRequires: pkgconfig(vpx) >= 1.13~ %endif %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} -BuildRequires: gcc >= 13 -BuildRequires: gcc-c++ >= 13 -%else -BuildRequires: gcc13-PIE -BuildRequires: gcc13-c++ -%endif -%if %{with gcc14} +BuildRequires: gcc >= 14 BuildRequires: gcc-c++ >= 14 +%else +BuildRequires: gcc14-PIE +BuildRequires: gcc14-c++ %endif + %if %{with pipewire} BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: pkgconfig(libspa-0.2) @@ -1070,11 +1054,11 @@ export AR=gcc-ar export NM=gcc-nm export RANLIB=gcc-ranlib %else -export CC=gcc-13 -export CXX=g++-13 -export AR=gcc-ar-13 -export NM=gcc-nm-13 -export RANLIB=gcc-ranlib-13 +export CC=gcc-14 +export CXX=g++-14 +export AR=gcc-ar-14 +export NM=gcc-nm-14 +export RANLIB=gcc-ranlib-14 %endif @@ -1238,11 +1222,7 @@ myconf_gn+=' symbol_level=0' myconf_gn+=' blink_symbol_level=0' myconf_gn+=' v8_symbol_level=0' %else -%if 0%{?fedora} == 39 -myconf_gn+=' symbol_level=1' -%else myconf_gn+=' symbol_level=2' -%endif myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' %endif -- 2.51.1 From faa6640daaafe3d52c8a8332a69552911a8af9cff6d61ed36fe90b5cf15faa1c Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 12 Jan 2025 20:37:55 +0000 Subject: [PATCH 30/80] Accepting request 1237196 from home:dziobian:gulgul-ultron:19 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update to 33.3.1 * Drop 32-bit support * chromium 130.0.6723.170 * node 20.18.0 * v8 13.0 * Behavior Changed: frame properties may retrieve detached WebFrameMain instances or none at all * Behavior Changed: webContents property on login on app * Added a handler, app.setClientCertRequestPasswordHandler(handler), to help unlock cryptographic devices when a PIN is needed. * Added View.setBorderRadius(radius) for customizing the border radius of views—with compatibility for WebContentsView. * Extended navigationHistory API with 2 new functions for better history management. #42014 * see https://github.com/electron/electron/releases/tag/v33.0.0 and https://www.electronjs.org/blog/electron-33-0 for more - Disable aarch64 builds due to OBS hardware limits. Sorry. - Drop Leap 15.5 support - Drop no longer needed patches * absl-base-dynamic_annotations.patch * angle-State-constexpr.patch * chromium-124-shims.patch * color_provider-incomplete-ColorProviderInternal.patch * ConsumeRadii-linker-error.patch * Cr126-abseil-shims.patch * crashpad-use-system-abseil.patch * DesktopNativeWidgetAura-HandleActivationChanged-crash.patch * harfbuzz-replace-chromium-scoped-type.patch * harfbuzz-replace-HbScopedPointer.patch * http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch * licenses.py-FileNotFoundError.patch * native_css_paint_definition-expected-unqualified-id.patch * page_popup_controller-missing-optional.patch * partition_alloc-no-lto.patch * preview_cancel_reason-missing-string.patch * quiche-QuicIntervalDeque-no-match-for-operator-mm.patch * real_time_reporting_bindings-forward-declaration.patch * run_segmenter-missing-optional.patch * skia-system-vulkan-headers.patch * system-zlib.patch * text_decoder-missing-optional.patch * wayland-proto-31-cursor-shape.patch - Drop libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch and replace it with more fine-grained reverts: * aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch * aom3.10-AV1E_SET_AUTO_TILES.patch * webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch * webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch - Drop the following revert: * bad-font-gc0000.patch * bad-font-gc000.patch * bad-font-gc00.patch * bad-font-gc0.patch * bad-font-gc11.patch * bad-font-gc1.patch * bad-font-gc2.patch * bad-font-gc3.patch - Add bsc1224178-font-gc.patch for a proper fix for bsc#1224178 deb#1067886 - Add backported or forwardable patches to fix build errors: * account_id-missing-optional.patch * css_attr_value_tainting-missing-once_flag.patch * electron_usb_delegate-incomplete-UsbDeviceInfo.patch * exception_context-missing-variant.patch * fix-build-without-service-discovery.patch * ip_protection_data_types-missing-optional.patch * skia_image_decoder_base-missing-stack.patch * vtt_scanner-missing-variant.patch * wayland_connection-Wchanges-meaning.patch - Add patches to fix build errors due to our changes: * build-without-speech-service.patch * chromium-123-qrcode.patch * chromium-125-cloud_authenticator.patch * chromium-127-crabby.patch * chromium-129-disable-H.264-video-parser-during-demuxing.patch * chromium-130-fontations.patch * cr130-abseil-remove-unused-deps.patch * cr130-absl-base.patch * delete-old-language-detection-which-uses-tflite.patch * fix-build-without-screen-ai.patch * private_aggregation_host-uint128.patch * remove-libphonenumber.patch * system-absl_algorithm.patch * wayland_version.patch - 15.6: use bundled vulkan and spirv headers - 15.6: revert upstream changes to build with old wayland * wayland-protocol-toplevel-icon.patch * wayland-protocol-toplevel-icon-2.patch * wayland-protocol-toplevel-drag.patch - Use bundled yuv everywhere due to system version being too old OBS-URL: https://build.opensuse.org/request/show/1237196 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=182 --- ConsumeRadii-linker-error.patch | 15 - Cr126-abseil-shims.patch | 65 - ...etAura-HandleActivationChanged-crash.patch | 33 - RenderFrameHostImpl-use-after-free.patch | 10 +- _constraints | 14 +- absl-base-dynamic_annotations.patch | 27 - account_id-missing-optional.patch | 33 + angle-State-constexpr.patch | 134 - aom3.10-AV1E_SET_AUTO_TILES.patch | 44 + ...V1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch | 66 + bad-font-gc0.patch | 250 -- bad-font-gc00.patch | 159 - bad-font-gc000.patch | 107 - bad-font-gc0000.patch | 425 -- bad-font-gc1.patch | 258 -- bad-font-gc11.patch | 434 -- bad-font-gc2.patch | 3725 ----------------- bad-font-gc3.patch | 38 - base-system-nspr.patch | 16 +- bsc1224178-font-gc.patch | 422 ++ build-without-speech-service.patch | 10 + chromium-102-compiler.patch | 155 +- chromium-123-qrcode.patch | 68 + chromium-124-shims.patch | 208 - chromium-125-cloud_authenticator.patch | 9 + chromium-127-cargo_crate.patch | 12 + chromium-127-crabby.patch | 49 + ...e-H.264-video-parser-during-demuxing.patch | 32 + chromium-130-fontations.patch | 93 + chromium-vaapi.patch | 26 +- ...der-incomplete-ColorProviderInternal.patch | 44 - common.gypi-compiler.patch | 10 +- cr130-abseil-remove-unused-deps.patch | 49 + cr130-absl-base.patch | 99 + crashpad-use-system-abseil.patch | 21 - create_tarball.sh | 30 +- ...ttr_value_tainting-missing-once_flag.patch | 32 + ...language-detection-which-uses-tflite.patch | 176 + disable-catapult.patch | 10 +- disable-devtools-tests.patch | 8 +- disable-webspeech.patch | 66 +- do-not-build-libvulkan.so.patch | 9 +- electron-31.7.6.tar.zst | 3 - electron-33.3.1.tar.zst | 3 + ...sb_delegate-incomplete-UsbDeviceInfo.patch | 63 + ...tack_trace_line_numbers-symbol_level.patch | 20 +- exception_context-missing-variant.patch | 32 + fix-build-without-safebrowsing.patch | 10 +- fix-build-without-screen-ai.patch | 100 + fix-build-without-service-discovery.patch | 10 + fix-build-without-supervised-users.patch | 20 +- fpic.patch | 12 - harfbuzz-replace-HbScopedPointer.patch | 93 - harfbuzz-replace-chromium-scoped-type.patch | 532 --- ...anism-could-not-convert-to-base-span.patch | 36 - ...otection_data_types-missing-optional.patch | 32 + ...7-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch | 13 - licenses.py-FileNotFoundError.patch | 33 - ...t_definition-expected-unqualified-id.patch | 37 - nodejs-electron.changes | 88 + nodejs-electron.spec | 265 +- page_popup_controller-missing-optional.patch | 42 - partition_alloc-no-lto.patch | 72 - preview_cancel_reason-missing-string.patch | 11 - private_aggregation_host-uint128.patch | 42 + ...tervalDeque-no-match-for-operator-mm.patch | 67 - quiche-absl-HexStringToBytes.patch | 25 +- ...porting_bindings-forward-declaration.patch | 37 - remove-date-reproducible-builds.patch | 37 +- remove-dawn.patch | 25 +- remove-libphonenumber.patch | 22 + remove-password-manager-and-policy.patch | 58 +- remove-puffin.patch | 13 - remove-rust.patch | 109 +- remove-sync.patch | 64 +- run_segmenter-missing-optional.patch | 34 - skia-system-vulkan-headers.patch | 22 - skia_image_decoder_base-missing-stack.patch | 28 + system-absl_algorithm.patch | 27 + system-pydeps.patch | 36 +- system-wayland.patch | 81 +- system-zlib.patch | 32 - text_decoder-missing-optional.patch | 28 - vtt_scanner-missing-variant.patch | 39 + wayland-proto-31-cursor-shape.patch | 446 -- wayland-protocol-toplevel-drag.patch | 434 ++ wayland-protocol-toplevel-icon-2.patch | 545 +++ wayland-protocol-toplevel-icon.patch | 335 ++ wayland_connection-Wchanges-meaning.patch | 61 + wayland_version.patch | 9 + ...AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch | 36 + ...8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch | 250 ++ ...-missing-uLong-Z_DEFAULT_COMPRESSION.patch | 8 +- 93 files changed, 3787 insertions(+), 8181 deletions(-) delete mode 100644 ConsumeRadii-linker-error.patch delete mode 100644 Cr126-abseil-shims.patch delete mode 100644 DesktopNativeWidgetAura-HandleActivationChanged-crash.patch delete mode 100644 absl-base-dynamic_annotations.patch create mode 100644 account_id-missing-optional.patch delete mode 100644 angle-State-constexpr.patch create mode 100644 aom3.10-AV1E_SET_AUTO_TILES.patch create mode 100644 aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch delete mode 100644 bad-font-gc0.patch delete mode 100644 bad-font-gc00.patch delete mode 100644 bad-font-gc000.patch delete mode 100644 bad-font-gc0000.patch delete mode 100644 bad-font-gc1.patch delete mode 100644 bad-font-gc11.patch delete mode 100644 bad-font-gc2.patch delete mode 100644 bad-font-gc3.patch create mode 100644 bsc1224178-font-gc.patch create mode 100644 build-without-speech-service.patch create mode 100644 chromium-123-qrcode.patch delete mode 100644 chromium-124-shims.patch create mode 100644 chromium-125-cloud_authenticator.patch create mode 100644 chromium-127-cargo_crate.patch create mode 100644 chromium-127-crabby.patch create mode 100644 chromium-129-disable-H.264-video-parser-during-demuxing.patch create mode 100644 chromium-130-fontations.patch delete mode 100644 color_provider-incomplete-ColorProviderInternal.patch create mode 100644 cr130-abseil-remove-unused-deps.patch create mode 100644 cr130-absl-base.patch delete mode 100644 crashpad-use-system-abseil.patch create mode 100644 css_attr_value_tainting-missing-once_flag.patch create mode 100644 delete-old-language-detection-which-uses-tflite.patch delete mode 100644 electron-31.7.6.tar.zst create mode 100644 electron-33.3.1.tar.zst create mode 100644 electron_usb_delegate-incomplete-UsbDeviceInfo.patch create mode 100644 exception_context-missing-variant.patch create mode 100644 fix-build-without-screen-ai.patch create mode 100644 fix-build-without-service-discovery.patch delete mode 100644 harfbuzz-replace-HbScopedPointer.patch delete mode 100644 harfbuzz-replace-chromium-scoped-type.patch delete mode 100644 http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch create mode 100644 ip_protection_data_types-missing-optional.patch delete mode 100644 libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch delete mode 100644 licenses.py-FileNotFoundError.patch delete mode 100644 native_css_paint_definition-expected-unqualified-id.patch delete mode 100644 page_popup_controller-missing-optional.patch delete mode 100644 partition_alloc-no-lto.patch delete mode 100644 preview_cancel_reason-missing-string.patch create mode 100644 private_aggregation_host-uint128.patch delete mode 100644 quiche-QuicIntervalDeque-no-match-for-operator-mm.patch delete mode 100644 real_time_reporting_bindings-forward-declaration.patch create mode 100644 remove-libphonenumber.patch delete mode 100644 run_segmenter-missing-optional.patch delete mode 100644 skia-system-vulkan-headers.patch create mode 100644 skia_image_decoder_base-missing-stack.patch create mode 100644 system-absl_algorithm.patch delete mode 100644 system-zlib.patch delete mode 100644 text_decoder-missing-optional.patch create mode 100644 vtt_scanner-missing-variant.patch delete mode 100644 wayland-proto-31-cursor-shape.patch create mode 100644 wayland-protocol-toplevel-drag.patch create mode 100644 wayland-protocol-toplevel-icon-2.patch create mode 100644 wayland-protocol-toplevel-icon.patch create mode 100644 wayland_connection-Wchanges-meaning.patch create mode 100644 wayland_version.patch create mode 100644 webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch create mode 100644 webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch diff --git a/ConsumeRadii-linker-error.patch b/ConsumeRadii-linker-error.patch deleted file mode 100644 index 73f4b14..0000000 --- a/ConsumeRadii-linker-error.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- src/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc.orig -+++ src/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc -@@ -7654,6 +7654,12 @@ template bool ConsumeRadii(CSSValue* hor - const CSSParserContext& context, - bool use_legacy_parsing); - -+template bool ConsumeRadii(CSSValue* horizontal_radii[4], -+ CSSValue* vertical_radii[4], -+ CSSParserTokenRange& stream, -+ const CSSParserContext& context, -+ bool use_legacy_parsing); -+ - template - requires std::is_same_v || - std::is_same_v diff --git a/Cr126-abseil-shims.patch b/Cr126-abseil-shims.patch deleted file mode 100644 index 4f3c0d2..0000000 --- a/Cr126-abseil-shims.patch +++ /dev/null @@ -1,65 +0,0 @@ -From b90d7410221d30c40a0d5ac1ff0041667fd8db0e Mon Sep 17 00:00:00 2001 -From: "lauren n. liberda" -Date: Wed, 26 Jun 2024 00:56:57 +0000 -Subject: [PATCH] unbundle: update absl shims - -Change-Id: I6fca3a8fd333c027fe48d8871073c79e7d8c3cd6 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5657110 -Reviewed-by: Lei Zhang -Reviewed-by: Thomas Anderson -Commit-Queue: Thomas Anderson -Cr-Commit-Position: refs/heads/main@{#1319524} ---- - build/linux/unbundle/absl_debugging.gn | 2 ++ - build/linux/unbundle/absl_random.gn | 5 +++++ - build/linux/unbundle/absl_status.gn | 2 ++ - build/linux/unbundle/absl_types.gn | 2 ++ - 4 files changed, 11 insertions(+) - -diff --git a/build/linux/unbundle/absl_debugging.gn b/build/linux/unbundle/absl_debugging.gn -index 5fbd34abbc96ae..b59a45b0913116 100644 ---- a/build/linux/unbundle/absl_debugging.gn -+++ b/build/linux/unbundle/absl_debugging.gn -@@ -46,5 +46,7 @@ source_set("symbolize") { - public_configs = [ ":system_absl_symbolize" ] - } - -+source_set("demangle_rust_test") { -+} - source_set("stacktrace_test") { - } -diff --git a/build/linux/unbundle/absl_random.gn b/build/linux/unbundle/absl_random.gn -index 7bb70241ad1f8d..eae95345e491d1 100644 ---- a/build/linux/unbundle/absl_random.gn -+++ b/build/linux/unbundle/absl_random.gn -@@ -57,3 +57,8 @@ source_set("random") { - deps = [ ":random_shim" ] - public_configs = [ ":system_absl_random_random" ] - } -+ -+group("distributions_test") { -+} -+group("mock_distributions_test") { -+} -diff --git a/build/linux/unbundle/absl_status.gn b/build/linux/unbundle/absl_status.gn -index 5f1e73a6d4d133..1905485814986e 100644 ---- a/build/linux/unbundle/absl_status.gn -+++ b/build/linux/unbundle/absl_status.gn -@@ -38,3 +38,5 @@ source_set("status_test") { - } - source_set("statusor_test") { - } -+source_set("status_matchers_test") { -+} -diff --git a/build/linux/unbundle/absl_types.gn b/build/linux/unbundle/absl_types.gn -index 4bb77f1b631cbd..8d2b1314558f2c 100644 ---- a/build/linux/unbundle/absl_types.gn -+++ b/build/linux/unbundle/absl_types.gn -@@ -93,5 +93,7 @@ source_set("variant") { - - source_set("optional_test") { - } -+source_set("span_test") { -+} - source_set("variant_test") { - } diff --git a/DesktopNativeWidgetAura-HandleActivationChanged-crash.patch b/DesktopNativeWidgetAura-HandleActivationChanged-crash.patch deleted file mode 100644 index e1250ee..0000000 --- a/DesktopNativeWidgetAura-HandleActivationChanged-crash.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f9819bb70b413c8310cd209c75cc555495e28564 Mon Sep 17 00:00:00 2001 -From: Allen Bauer -Date: Fri, 31 May 2024 15:55:13 +0000 -Subject: [PATCH] Harden DesktopNativeWidgetAura against a destroyed Widget. - -Under CLIENT_OWNS_WIDGET ownership mode, it is possible for the Widget to have already been destroyed. This hardens the NativeWidget to handle this case without crashing. - -Bug: 40242079, 40232479 -Change-Id: I455e1690b49ff50e4eac3b9a085d9f15ccb6adec -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5585758 -Code-Coverage: findit-for-me@appspot.gserviceaccount.com -Reviewed-by: Thomas Anderson -Commit-Queue: Allen Bauer -Cr-Commit-Position: refs/heads/main@{#1308668} ---- - ui/views/widget/desktop_aura/desktop_native_widget_aura.cc | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc -index 9ae19505357c6b..1974865e8c8a8f 100644 ---- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc -+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc -@@ -431,8 +431,8 @@ DesktopNativeWidgetAura::tooltip_controller() { - } - - void DesktopNativeWidgetAura::HandleActivationChanged(bool active) { -- DCHECK(native_widget_delegate_); -- if (!native_widget_delegate_->ShouldHandleNativeWidgetActivationChanged( -+ if (!native_widget_delegate_ || -+ !native_widget_delegate_->ShouldHandleNativeWidgetActivationChanged( - active)) { - return; - } diff --git a/RenderFrameHostImpl-use-after-free.patch b/RenderFrameHostImpl-use-after-free.patch index 03679fb..008e520 100644 --- a/RenderFrameHostImpl-use-after-free.patch +++ b/RenderFrameHostImpl-use-after-free.patch @@ -1,5 +1,5 @@ ---- src/content/browser/renderer_host/render_frame_host_impl.cc.orig 2023-02-08 21:38:09.974003318 +0100 -+++ src/content/browser/renderer_host/render_frame_host_impl.cc 2023-02-13 14:13:50.217792624 +0100 +--- src/content/browser/renderer_host/render_frame_host_impl.cc.orig 2024-12-08 18:45:24.018025513 +0100 ++++ src/content/browser/renderer_host/render_frame_host_impl.cc 2024-12-20 14:29:00.900380913 +0100 @@ -8,6 +8,7 @@ #include #include @@ -8,10 +8,10 @@ #include #include #include -@@ -1818,7 +1819,12 @@ RenderFrameHostImpl::~RenderFrameHostImp +@@ -2276,7 +2277,12 @@ RenderFrameHostImpl::~RenderFrameHostImp + // completes. Among other things, this ensures that any `SafeRef`s from // `DocumentService` and `RenderFrameHostUserData` subclasses are still valid // when their destructors run. - document_associated_data_->RemoveAllServices(); - document_associated_data_.reset(); + // HACK: Using .reset() here works on MSVC and LLVM libc++ because the std::optional + // is still valid while the destructor runs. This does not work on GNU libstdc++ @@ -22,7 +22,7 @@ // If this was the last active frame in the SiteInstanceGroup, the // DecrementActiveFrameCount call will trigger the deletion of the -@@ -13254,7 +13260,9 @@ bool RenderFrameHostImpl::DidCommitNavig +@@ -14482,7 +14488,9 @@ bool RenderFrameHostImpl::DidCommitNavig // RenderFrameHost commits before the navigation commits. This happens // when the current RenderFrameHost crashes before navigating to a new // URL. diff --git a/_constraints b/_constraints index 7f55cc1..c8fa6a9 100644 --- a/_constraints +++ b/_constraints @@ -15,7 +15,7 @@ - 24 + 30 @@ -31,16 +31,4 @@ 8 - - - aarch64 - armv7l - armv6l - - - - asimdrdm - - - diff --git a/absl-base-dynamic_annotations.patch b/absl-base-dynamic_annotations.patch deleted file mode 100644 index 3473afd..0000000 --- a/absl-base-dynamic_annotations.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 91a8dd6bff0c3965ab324b5c2a3c19c0a2931831 Mon Sep 17 00:00:00 2001 -From: "lauren n. liberda" -Date: Sat, 29 Jun 2024 00:26:40 +0000 -Subject: [PATCH] unbundle: add missing absl_base header - -Change-Id: Ie4edda0ec8661437652b2c4c324ac82137bfcfed -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5659519 -Reviewed-by: Thomas Anderson -Reviewed-by: Lei Zhang -Commit-Queue: Thomas Anderson -Cr-Commit-Position: refs/heads/main@{#1321266} ---- - build/linux/unbundle/absl_base.gn | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/build/linux/unbundle/absl_base.gn b/build/linux/unbundle/absl_base.gn -index 7da86e46147bdd..b5ce0863e6fde7 100644 ---- a/build/linux/unbundle/absl_base.gn -+++ b/build/linux/unbundle/absl_base.gn -@@ -27,6 +27,7 @@ shim_headers("base_shim") { - headers = [ - "call_once.h", - "casts.h", -+ "dynamic_annotations.h", - ] - } - diff --git a/account_id-missing-optional.patch b/account_id-missing-optional.patch new file mode 100644 index 0000000..7d02078 --- /dev/null +++ b/account_id-missing-optional.patch @@ -0,0 +1,33 @@ +From dc9db222b929f5da415216134b77d7f3bf141813 Mon Sep 17 00:00:00 2001 +From: Ivan Murashov +Date: Wed, 18 Sep 2024 19:25:42 +0000 +Subject: [PATCH] IWYU: Add missing include for std::optional usage in + account_id.h + +In the CL https://crrev.com/c/5834683 used std::optional in the +components/account_id/account_id.h, but corresponding include +was missed. Added missing include for std::optional usage. + +Bug: 41455655 +Change-Id: Ifea71ffb41a8c83051ce95763d9cb836488ca86f +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872821 +Commit-Queue: Ivan Murashov +Reviewed-by: Hidehiko Abe +Reviewed-by: Xiyuan Xia +Cr-Commit-Position: refs/heads/main@{#1357262} +--- + components/account_id/account_id.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/components/account_id/account_id.h b/components/account_id/account_id.h +index 9804f179139063..e03b974cb481ba 100644 +--- a/components/account_id/account_id.h ++++ b/components/account_id/account_id.h +@@ -8,6 +8,7 @@ + #include + + #include ++#include + #include + #include + #include diff --git a/angle-State-constexpr.patch b/angle-State-constexpr.patch deleted file mode 100644 index 210d679..0000000 --- a/angle-State-constexpr.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 0508fc9b920b001115f80790e4942ff69d3f5de1 Mon Sep 17 00:00:00 2001 -From: Roman Lavrov -Date: Tue, 23 Apr 2024 15:32:52 -0400 -Subject: [PATCH] Reland "Cleanup: replace DirtyObjectType check with constexpr - generator" - -Avoid using lambdas with member function pointers which caused issues -on MSVC C++17. - -This is a reland of commit 89caa0e1d99e45f3d6f355f6e14c147f8de3e0e5 - -Original change's description: -> Cleanup: replace DirtyObjectType check with constexpr generator -> -> Static assert was meant to avoid kDirtyObjectHandlers getting out of -> sync, but it doesn't achieve that goal as it's just comparing values -> with ints which is confusing. -> -> Replacing with constexpr generated std::array. C++20 allows to easily -> validate that all values are set by _not_ default-initializing -> `handlers`. C++17 makes it trickier, addeded static_assert on an -> additional static constexpr bool (silly but I can't find a more concise -> way) -> -> Bug: angleproject:8666 -> Bug: b/335295728 -> Change-Id: Idf9bbd087d09d5ba253a7587ce0503cae3fcf3a7 -> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5478231 -> Reviewed-by: Shahbaz Youssefi -> Commit-Queue: Roman Lavrov - -Bug: angleproject:8666 -Bug: b/335295728 -Change-Id: I62e66b700512e072ef10cc57a17e8837a534c0d5 -Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5589285 -Commit-Queue: Roman Lavrov -Reviewed-by: Shahbaz Youssefi ---- - src/libANGLE/State.cpp | 2 -- - src/libANGLE/State.h | 67 +++++++++++++++++++++++++----------------- - 2 files changed, 40 insertions(+), 29 deletions(-) - -diff --git a/src/libANGLE/State.h b/src/libANGLE/State.h -index b2aa6749060..38a219f489d 100644 ---- src/third_party/angle/src/libANGLE/State.h.orig 2024-07-24 12:51:20.205804675 +0200 -+++ src/third_party/angle/src/libANGLE/State.h 2024-07-26 14:11:54.188991370 +0200 -@@ -1447,41 +1447,46 @@ class State : angle::NonCopyable - angle::Result syncProgramPipelineObject(const Context *context, Command command); - - using DirtyObjectHandler = angle::Result (State::*)(const Context *context, Command command); -+ using DirtyObjectHandlerArray = std::array; - -- static constexpr std::array kDirtyObjectHandlers = -- []() { -- // Work around C++'s lack of array element support in designated initializers -- std::array handlers{}; -- -- handlers[state::DIRTY_OBJECT_ACTIVE_TEXTURES] = &State::syncActiveTextures; -- handlers[state::DIRTY_OBJECT_TEXTURES_INIT] = &State::syncTexturesInit; -- handlers[state::DIRTY_OBJECT_IMAGES_INIT] = &State::syncImagesInit; -- handlers[state::DIRTY_OBJECT_READ_ATTACHMENTS] = &State::syncReadAttachments; -- handlers[state::DIRTY_OBJECT_DRAW_ATTACHMENTS] = &State::syncDrawAttachments; -- handlers[state::DIRTY_OBJECT_READ_FRAMEBUFFER] = &State::syncReadFramebuffer; -- handlers[state::DIRTY_OBJECT_DRAW_FRAMEBUFFER] = &State::syncDrawFramebuffer; -- handlers[state::DIRTY_OBJECT_VERTEX_ARRAY] = &State::syncVertexArray; -- handlers[state::DIRTY_OBJECT_TEXTURES] = &State::syncTextures; -- handlers[state::DIRTY_OBJECT_IMAGES] = &State::syncImages; -- handlers[state::DIRTY_OBJECT_SAMPLERS] = &State::syncSamplers; -- handlers[state::DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT] = -- &State::syncProgramPipelineObject; -- -- return handlers; -- }(); -- -- static_assert( -- []() { -- for (auto handler : kDirtyObjectHandlers) -+ static constexpr DirtyObjectHandlerArray MakeDirtyObjectHandlers() -+ { -+ // Work around C++'s lack of array element support in designated initializers -+ // This function cannot be a lambda due to MSVC C++17 limitations b/330910097#comment5 -+ DirtyObjectHandlerArray handlers{}; -+ -+ handlers[state::DIRTY_OBJECT_ACTIVE_TEXTURES] = &State::syncActiveTextures; -+ handlers[state::DIRTY_OBJECT_TEXTURES_INIT] = &State::syncTexturesInit; -+ handlers[state::DIRTY_OBJECT_IMAGES_INIT] = &State::syncImagesInit; -+ handlers[state::DIRTY_OBJECT_READ_ATTACHMENTS] = &State::syncReadAttachments; -+ handlers[state::DIRTY_OBJECT_DRAW_ATTACHMENTS] = &State::syncDrawAttachments; -+ handlers[state::DIRTY_OBJECT_READ_FRAMEBUFFER] = &State::syncReadFramebuffer; -+ handlers[state::DIRTY_OBJECT_DRAW_FRAMEBUFFER] = &State::syncDrawFramebuffer; -+ handlers[state::DIRTY_OBJECT_VERTEX_ARRAY] = &State::syncVertexArray; -+ handlers[state::DIRTY_OBJECT_TEXTURES] = &State::syncTextures; -+ handlers[state::DIRTY_OBJECT_IMAGES] = &State::syncImages; -+ handlers[state::DIRTY_OBJECT_SAMPLERS] = &State::syncSamplers; -+ handlers[state::DIRTY_OBJECT_PROGRAM_PIPELINE_OBJECT] = &State::syncProgramPipelineObject; -+ -+ // If a handler is missing, reset everything for ease of static_assert -+ for (auto handler : handlers) -+ { -+ if (handler == nullptr) - { -- if (handler == nullptr) -- { -- return false; -- } -+ return DirtyObjectHandlerArray(); - } -- return true; -- }(), -- "kDirtyObjectHandlers missing a handler"); -+ } -+ -+ return handlers; -+ } -+ -+ angle::Result dirtyObjectHandler(size_t dirtyObject, const Context *context, Command command) -+ { -+ static constexpr DirtyObjectHandlerArray handlers = MakeDirtyObjectHandlers(); -+ static_assert(handlers[0] != nullptr, "MakeDirtyObjectHandlers missing a handler"); -+ -+ return (this->*handlers[dirtyObject])(context, command); -+ } - - // Robust init must happen before Framebuffer init for the Vulkan back-end. - static_assert(state::DIRTY_OBJECT_ACTIVE_TEXTURES < state::DIRTY_OBJECT_TEXTURES_INIT, -@@ -1606,7 +1611,7 @@ ANGLE_INLINE angle::Result State::syncDi - - for (size_t dirtyObject : dirtyObjects) - { -- ANGLE_TRY((this->*kDirtyObjectHandlers[dirtyObject])(context, command)); -+ ANGLE_TRY(dirtyObjectHandler(dirtyObject, context, command)); - } - - mDirtyObjects &= ~dirtyObjects; diff --git a/aom3.10-AV1E_SET_AUTO_TILES.patch b/aom3.10-AV1E_SET_AUTO_TILES.patch new file mode 100644 index 0000000..c56daf4 --- /dev/null +++ b/aom3.10-AV1E_SET_AUTO_TILES.patch @@ -0,0 +1,44 @@ +From 0b4b5b0ae81dca83d3d602e905732e2c82bd340d Mon Sep 17 00:00:00 2001 +From: Sergey Silkin +Date: Fri, 30 Aug 2024 13:37:32 +0200 +Subject: [PATCH] Use AV1E_SET_AUTO_TILES + +Delegate control over number of times to encoder using AV1E_SET_AUTO_TILES that was added in https://aomedia-review.googlesource.com/c/aom/+/191102. + +Bug: webrtc:351644568 +Change-Id: I87ed11734e907c7f6c6508ac7389c84ececf5b21 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361140 +Commit-Queue: Sergey Silkin +Reviewed-by: Marco Paniconi +Cr-Commit-Position: refs/heads/main@{#42903} +--- + .../codecs/av1/libaom_av1_encoder.cc | 16 +--------------- + 1 file changed, 1 insertion(+), 15 deletions(-) + +diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +index db9238477d..c06792207e 100644 +--- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc ++++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +@@ -307,21 +307,7 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0); + } + +- if (cfg_.g_threads == 8) { +- // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2() +- // based. +- // Use 4 tile columns x 2 tile rows for 8 threads. +- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_ROWS, 1); +- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, 2); +- } else if (cfg_.g_threads == 4) { +- // Use 2 tile columns x 2 tile rows for 4 threads. +- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_ROWS, 1); +- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, 1); +- } else { +- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, +- static_cast(log2(cfg_.g_threads))); +- } +- ++ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_AUTO_TILES, 1); + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ROW_MT, 1); + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_OBMC, 0); + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_NOISE_SENSITIVITY, 0); diff --git a/aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch b/aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch new file mode 100644 index 0000000..c2bb1d7 --- /dev/null +++ b/aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch @@ -0,0 +1,66 @@ +From 84273f56d92953f15269cdb1d95d1851f83a8fe9 Mon Sep 17 00:00:00 2001 +From: Sergey Silkin +Date: Fri, 30 Aug 2024 12:32:52 +0200 +Subject: [PATCH] Specify max number of consecutive drops using time units + +AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR was added in https://aomedia-review.googlesource.com/c/aom/+/192402. It allows to configure max number of consecutive frame drops using time units. Use it instead of AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR. + +Bug: webrtc:351644568 +Change-Id: I73265d5258d681926eb5b65e32c2a61b26c310ba +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360842 +Commit-Queue: Sergey Silkin +Reviewed-by: Marco Paniconi +Cr-Commit-Position: refs/heads/main@{#42995} +--- + .../codecs/av1/libaom_av1_encoder.cc | 24 ++++--------------- + 1 file changed, 5 insertions(+), 19 deletions(-) + +diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +index 6b71874c3f..262cb9d36b 100644 +--- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc ++++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +@@ -166,14 +166,6 @@ int32_t VerifyCodecSettings(const VideoCodec& codec_settings) { + return WEBRTC_VIDEO_CODEC_OK; + } + +-int GetMaxConsecDrops(double framerate_fps) { +- // Consecutive frame drops result in a video freeze. We want to minimize the +- // max number of consecutive drops and, at the same time, keep the value high +- // enough to let encoder drain the buffer at overshoot. +- constexpr double kMaxFreezeSeconds = 0.25; +- return std::ceil(kMaxFreezeSeconds * framerate_fps); +-} +- + LibaomAv1Encoder::LibaomAv1Encoder(const Environment& env, + LibaomAv1EncoderSettings settings) + : inited_(false), +@@ -339,6 +331,11 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_TX64, 0); + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_REFERENCE_FRAMES, 3); + ++ if (adaptive_max_consec_drops_) { ++ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR, ++ 250); ++ } ++ + return WEBRTC_VIDEO_CODEC_OK; + } + +@@ -815,17 +812,6 @@ void LibaomAv1Encoder::SetRates(const RateControlParameters& parameters) { + SetEncoderControlParameters(AV1E_SET_SVC_PARAMS, &*svc_params_); + } + +- if (adaptive_max_consec_drops_ && +- (!rates_configured_ || framerate_fps_ != parameters.framerate_fps)) { +- int max_consec_drops = GetMaxConsecDrops(parameters.framerate_fps); +- if (!SetEncoderControlParameters(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, +- max_consec_drops)) { +- RTC_LOG(LS_WARNING) +- << "Failed to set AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR to " +- << max_consec_drops; +- } +- } +- + framerate_fps_ = parameters.framerate_fps; + + rates_configured_ = true; diff --git a/bad-font-gc0.patch b/bad-font-gc0.patch deleted file mode 100644 index e140e68..0000000 --- a/bad-font-gc0.patch +++ /dev/null @@ -1,250 +0,0 @@ -Revert the following commit: - -commit 886c849ee96e3026d28d7615cdd5af9628a2e5c8 -Author: Ian Kilpatrick -Date: Tue Feb 20 18:18:04 2024 +0000 - - [gc] Make UnicodeRangeSet gc'd. - - There should be no user-visible behaviour change. - - Bug: 41490008 - Change-Id: I7f0003b7ff7c464d4ee36442bcff8c63da79b20c - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302778 - Reviewed-by: Dominik Röttsches - Commit-Queue: Ian Kilpatrick - Cr-Commit-Position: refs/heads/main@{#1262789} - ---- a/third_party/blink/renderer/core/css/css_font_face.cc -+++ b/third_party/blink/renderer/core/css/css_font_face.cc -@@ -291,7 +291,6 @@ bool CSSFontFace::UpdatePeriod() { - void CSSFontFace::Trace(Visitor* visitor) const { - visitor->Trace(segmented_font_faces_); - visitor->Trace(sources_); -- visitor->Trace(ranges_); - visitor->Trace(font_face_); - } - ---- a/third_party/blink/renderer/core/css/css_font_face.h -+++ b/third_party/blink/renderer/core/css/css_font_face.h -@@ -47,8 +47,8 @@ class SimpleFontData; - - class CORE_EXPORT CSSFontFace final : public GarbageCollected { - public: -- CSSFontFace(FontFace* font_face, HeapVector&& ranges) -- : ranges_(MakeGarbageCollected(std::move(ranges))), -+ CSSFontFace(FontFace* font_face, Vector& ranges) -+ : ranges_(base::AdoptRef(new UnicodeRangeSet(ranges))), - font_face_(font_face) { - DCHECK(font_face_); - } -@@ -61,7 +61,7 @@ class CORE_EXPORT CSSFontFace final : pu - } - FontFace* GetFontFace() const { return font_face_.Get(); } - -- const UnicodeRangeSet* Ranges() { return ranges_.Get(); } -+ scoped_refptr Ranges() { return ranges_; } - - void AddSegmentedFontFace(CSSSegmentedFontFace*); - void RemoveSegmentedFontFace(CSSSegmentedFontFace*); -@@ -98,9 +98,9 @@ class CORE_EXPORT CSSFontFace final : pu - private: - void SetLoadStatus(FontFace::LoadStatusType); - -+ scoped_refptr ranges_; - HeapHashSet> segmented_font_faces_; - HeapDeque> sources_; -- Member ranges_; - Member font_face_; - }; - ---- a/third_party/blink/renderer/core/css/font_face.cc -+++ b/third_party/blink/renderer/core/css/font_face.cc -@@ -90,7 +90,7 @@ const CSSValue* ParseCSSValue(const Exec - - CSSFontFace* CreateCSSFontFace(FontFace* font_face, - const CSSValue* unicode_range) { -- HeapVector ranges; -+ Vector ranges; - if (const auto* range_list = To(unicode_range)) { - unsigned num_ranges = range_list->length(); - for (unsigned i = 0; i < num_ranges; i++) { -@@ -100,7 +100,7 @@ CSSFontFace* CreateCSSFontFace(FontFace* - } - } - -- return MakeGarbageCollected(font_face, std::move(ranges)); -+ return MakeGarbageCollected(font_face, ranges); - } - - const CSSValue* ConvertFontMetricOverrideValue(const CSSValue* parsed_value) { ---- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h -+++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h -@@ -39,18 +39,16 @@ class SimpleFontData; - class PLATFORM_EXPORT FontDataForRangeSet - : public GarbageCollected { - public: -- explicit FontDataForRangeSet(const SimpleFontData* font_data = nullptr, -- const UnicodeRangeSet* range_set = nullptr) -- : font_data_(font_data), range_set_(range_set) {} -+ explicit FontDataForRangeSet( -+ const SimpleFontData* font_data = nullptr, -+ scoped_refptr range_set = nullptr) -+ : font_data_(font_data), range_set_(std::move(range_set)) {} - - FontDataForRangeSet(const FontDataForRangeSet& other); - - virtual ~FontDataForRangeSet() = default; - -- void Trace(Visitor* visitor) const { -- visitor->Trace(font_data_); -- visitor->Trace(range_set_); -- } -+ void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } - - bool Contains(UChar32 test_char) const { - return !range_set_ || range_set_->Contains(test_char); -@@ -58,7 +56,7 @@ class PLATFORM_EXPORT FontDataForRangeSe - bool IsEntireRange() const { - return !range_set_ || range_set_->IsEntireRange(); - } -- const UnicodeRangeSet* Ranges() const { return range_set_.Get(); } -+ UnicodeRangeSet* Ranges() const { return range_set_.get(); } - bool HasFontData() const { return font_data_; } - const SimpleFontData* FontData() const { return font_data_.Get(); } - -@@ -74,7 +72,7 @@ class PLATFORM_EXPORT FontDataForRangeSe - - protected: - Member font_data_; -- Member range_set_; -+ scoped_refptr range_set_; - }; - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -508,10 +508,10 @@ const OpenTypeVerticalData& HarfBuzzFace - return *harfbuzz_font_data_->VerticalData(); - } - --hb_font_t* HarfBuzzFace::GetScaledFont(const UnicodeRangeSet* range_set, -+hb_font_t* HarfBuzzFace::GetScaledFont(scoped_refptr range_set, - VerticalLayoutCallbacks vertical_layout, - float specified_size) const { -- harfbuzz_font_data_->range_set_ = range_set; -+ harfbuzz_font_data_->range_set_ = std::move(range_set); - harfbuzz_font_data_->UpdateFallbackMetricsAndScale(*platform_data_, - vertical_layout); - ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -@@ -66,7 +66,7 @@ class HarfBuzzFace final : public Garbag - // Passing in specified_size in order to control selecting the right value - // from the trak table. If not set, the size of the internal FontPlatformData - // object will be used. -- hb_font_t* GetScaledFont(const UnicodeRangeSet*, -+ hb_font_t* GetScaledFont(scoped_refptr, - VerticalLayoutCallbacks, - float specified_size) const; - ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -@@ -32,7 +32,7 @@ struct HarfBuzzFontData final : public G - HarfBuzzFontData(const HarfBuzzFontData&) = delete; - HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; - -- void Trace(Visitor* visitor) const { visitor->Trace(range_set_); } -+ void Trace(Visitor*) const {} - - // The vertical origin and vertical advance functions in HarfBuzzFace require - // the ascent and height metrics as fallback in case no specific vertical -@@ -98,7 +98,7 @@ struct HarfBuzzFontData final : public G - SpaceGlyphInOpenTypeTables::kUnknown; - - scoped_refptr vertical_data_; -- Member range_set_; -+ scoped_refptr range_set_; - }; - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -@@ -289,7 +289,7 @@ void RoundHarfBuzzBufferPositions(hb_buf - inline bool ShapeRange(hb_buffer_t* buffer, - const FontFeatures& font_features, - const SimpleFontData* current_font, -- const UnicodeRangeSet* current_font_range_set, -+ scoped_refptr current_font_range_set, - UScriptCode current_run_script, - hb_direction_t direction, - hb_language_t language, -@@ -325,7 +325,7 @@ inline bool ShapeRange(hb_buffer_t* buff - hb_buffer_set_direction(buffer, direction); - - hb_font_t* hb_font = -- face->GetScaledFont(current_font_range_set, -+ face->GetScaledFont(std::move(current_font_range_set), - HB_DIRECTION_IS_VERTICAL(direction) - ? HarfBuzzFace::kPrepareForVerticalLayout - : HarfBuzzFace::kNoVerticalLayout, ---- a/third_party/blink/renderer/platform/fonts/unicode_range_set.cc -+++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.cc -@@ -31,8 +31,8 @@ - - namespace blink { - --UnicodeRangeSet::UnicodeRangeSet(HeapVector&& ranges) -- : ranges_(std::move(ranges)) { -+UnicodeRangeSet::UnicodeRangeSet(const Vector& ranges) -+ : ranges_(ranges) { - if (ranges_.empty()) - return; - ---- a/third_party/blink/renderer/platform/fonts/unicode_range_set.h -+++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.h -@@ -26,12 +26,13 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_ - --#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/platform_export.h" -+#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/text/character_names.h" - #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" - #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" -+#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" -+#include "third_party/blink/renderer/platform/wtf/vector.h" - - namespace blink { - -@@ -55,14 +56,13 @@ struct PLATFORM_EXPORT UnicodeRange fina - UChar32 to_; - }; - --class PLATFORM_EXPORT UnicodeRangeSet -- : public GarbageCollected { -+class PLATFORM_EXPORT UnicodeRangeSet : public RefCounted { -+ USING_FAST_MALLOC(UnicodeRangeSet); -+ - public: -- explicit UnicodeRangeSet(HeapVector&&); -+ explicit UnicodeRangeSet(const Vector&); - UnicodeRangeSet() = default; - -- void Trace(Visitor* visitor) const { visitor->Trace(ranges_); } -- - bool Contains(UChar32) const; - bool IntersectsWith(const String&) const; - bool IsEntireRange() const { return ranges_.empty(); } -@@ -71,8 +71,7 @@ class PLATFORM_EXPORT UnicodeRangeSet - bool operator==(const UnicodeRangeSet& other) const; - - private: -- HeapVector -- ranges_; // If empty, represents the whole code space. -+ Vector ranges_; // If empty, represents the whole code space. - }; - - } // namespace blink diff --git a/bad-font-gc00.patch b/bad-font-gc00.patch deleted file mode 100644 index f6a96eb..0000000 --- a/bad-font-gc00.patch +++ /dev/null @@ -1,159 +0,0 @@ -Revert the following commit: - -commit 59daae50fc3c47f7a8dbcc828446fdaa9f8c12c4 -Author: Ian Kilpatrick -Date: Tue Feb 20 18:35:11 2024 +0000 - - [gc] Make OpenTypeVerticalData gc'd. - - There should be no user-visible behaviour change. - - Bug: 41490008 - Change-Id: Id93c85a7beb710944e07cff614cff2409c818436 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302893 - Commit-Queue: Ian Kilpatrick - Reviewed-by: Dominik Röttsches - Cr-Commit-Position: refs/heads/main@{#1262805} - ---- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc -+++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc -@@ -308,6 +308,11 @@ SkFont FontPlatformData::CreateSkFont(co - } - #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_IOS) - -+scoped_refptr FontPlatformData::CreateVerticalData() -+ const { -+ return OpenTypeVerticalData::CreateUnscaled(typeface_); -+} -+ - IdentifiableToken FontPlatformData::ComputeTypefaceDigest() const { - DCHECK(typeface_); - int table_count = typeface_->countTables(); ---- a/third_party/blink/renderer/platform/fonts/font_platform_data.h -+++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h -@@ -59,6 +59,7 @@ typedef const struct __CTFont* CTFontRef - namespace blink { - - class HarfBuzzFace; -+class OpenTypeVerticalData; - - class PLATFORM_EXPORT FontPlatformData - : public GarbageCollected { -@@ -137,6 +138,8 @@ class PLATFORM_EXPORT FontPlatformData - - SkFont CreateSkFont(const FontDescription* = nullptr) const; - -+ scoped_refptr CreateVerticalData() const; -+ - // Computes a digest from the typeface. The digest only depends on the - // underlying font itself, and does not vary by the style (size, weight, - // italics, etc). This is aimed at discovering the fingerprinting information ---- a/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h -+++ b/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h -@@ -27,10 +27,10 @@ - - #include "base/memory/scoped_refptr.h" - #include "third_party/blink/renderer/platform/fonts/glyph.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/hash_map.h" -+#include "third_party/blink/renderer/platform/wtf/ref_counted.h" - #include "third_party/blink/renderer/platform/wtf/vector.h" - #include "third_party/skia/include/core/SkRefCnt.h" - #include "third_party/skia/include/core/SkTypeface.h" -@@ -40,11 +40,14 @@ class SkFont; - namespace blink { - - class PLATFORM_EXPORT OpenTypeVerticalData -- : public GarbageCollected { -- public: -- explicit OpenTypeVerticalData(sk_sp); -+ : public RefCounted { -+ USING_FAST_MALLOC(OpenTypeVerticalData); - -- void Trace(Visitor*) const {} -+ public: -+ static scoped_refptr CreateUnscaled( -+ sk_sp typeface) { -+ return base::AdoptRef(new OpenTypeVerticalData(typeface)); -+ } - - void SetScaleAndFallbackMetrics(float size_per_unit, - float ascent, -@@ -60,6 +63,8 @@ class PLATFORM_EXPORT OpenTypeVerticalDa - float* out_xy_array) const; - - private: -+ explicit OpenTypeVerticalData(sk_sp); -+ - void LoadMetrics(sk_sp); - bool HasVORG() const { return !vert_origin_y_.empty(); } - ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -202,7 +202,8 @@ - void* user_data) { - HarfBuzzFontData* hb_font_data = - reinterpret_cast(font_data); -- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); -+ scoped_refptr vertical_data = -+ hb_font_data->VerticalData(); - if (!vertical_data) { - return false; - } -@@ -223,7 +223,8 @@ static hb_position_t HarfBuzzGetGlyphVer - void* user_data) { - HarfBuzzFontData* hb_font_data = - reinterpret_cast(font_data); -- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); -+ scoped_refptr vertical_data = -+ hb_font_data->VerticalData(); - if (!vertical_data) { - return SkiaScalarToHarfBuzzPosition(hb_font_data->height_fallback_); - } ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -@@ -32,10 +32,7 @@ struct HarfBuzzFontData final : public G - HarfBuzzFontData(const HarfBuzzFontData&) = delete; - HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; - -- void Trace(Visitor* visitor) const { -- visitor->Trace(vertical_data_); -- visitor->Trace(range_set_); -- } -+ void Trace(Visitor* visitor) const { visitor->Trace(range_set_); } - - // The vertical origin and vertical advance functions in HarfBuzzFace require - // the ascent and height metrics as fallback in case no specific vertical -@@ -70,18 +67,18 @@ struct HarfBuzzFontData final : public G - } - } - -- OpenTypeVerticalData* VerticalData() { -+ scoped_refptr VerticalData() { - if (!vertical_data_) { - DCHECK_NE(ascent_fallback_, kInvalidFallbackMetricsValue); - DCHECK_NE(height_fallback_, kInvalidFallbackMetricsValue); - DCHECK_NE(size_per_unit_, kInvalidFallbackMetricsValue); - - vertical_data_ = -- MakeGarbageCollected(font_.refTypeface()); -+ OpenTypeVerticalData::CreateUnscaled(font_.refTypeface()); - } - vertical_data_->SetScaleAndFallbackMetrics(size_per_unit_, ascent_fallback_, - height_fallback_); -- return vertical_data_.Get(); -+ return vertical_data_; - } - - const hb::unique_ptr unscaled_font_; -@@ -100,7 +97,7 @@ struct HarfBuzzFontData final : public G - SpaceGlyphInOpenTypeTables space_in_gsub_ = - SpaceGlyphInOpenTypeTables::kUnknown; - -- Member vertical_data_; -+ scoped_refptr vertical_data_; - Member range_set_; - }; - diff --git a/bad-font-gc000.patch b/bad-font-gc000.patch deleted file mode 100644 index b2df4eb..0000000 --- a/bad-font-gc000.patch +++ /dev/null @@ -1,107 +0,0 @@ -Revert the following commit: - -commit 5ffa0446f51e34d06dc0539810a8a5d35ec9e3fc -Author: Ian Kilpatrick -Date: Thu Feb 22 17:08:22 2024 +0000 - - [fonts][perf] Explicitly leak SimpleFontDatas via a LRU cache. - - This adds a strong LRU cache to FontDataCache to retain the most - recently used fonts. - - This covers the case where a large amount of DOM is destroyed, and - previously we'd release all the font related objects if the GC kicked - in. - - Speedometer3 appears to peak at ~75 objects in the cache. - - Results for different cache sizes: - - Cache size: 64 | 32 | 16 - Speedometer3: +0.9% | +0.5% | +0% - - Bug: 41490008 - Change-Id: I131b6a79f246e61e13a7d44dddbc1f9e625ed44a - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314842 - Reviewed-by: Dominik Röttsches - Commit-Queue: Ian Kilpatrick - Cr-Commit-Position: refs/heads/main@{#1264027} - ---- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc -+++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc -@@ -36,15 +36,6 @@ - - namespace blink { - --namespace { -- --// The maximum number of strong references to retain via the LRU. --// This explicitly leaks fonts (and related objects) unless under extreme --// memory pressure where it will be cleared. DO NOT increase unnecessarily. --const wtf_size_t kMaxSize = 64; -- --} // namespace -- - const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, - bool subpixel_ascent_descent) { - if (!platform_data) -@@ -64,16 +55,7 @@ const SimpleFontData* FontDataCache::Get - add_result.stored_value->value = MakeGarbageCollected( - platform_data, nullptr, subpixel_ascent_descent); - } -- -- const SimpleFontData* result = add_result.stored_value->value; -- -- // Update our LRU to keep a strong reference to `result`. -- strong_reference_lru_.PrependOrMoveToFirst(result); -- while (strong_reference_lru_.size() > kMaxSize) { -- strong_reference_lru_.pop_back(); -- } -- -- return result; -+ return add_result.stored_value->value; - } - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_data_cache.h -+++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h -@@ -34,7 +34,6 @@ - #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" - #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" - - namespace blink { - -@@ -59,29 +58,17 @@ class FontDataCache final { - FontDataCache(const FontDataCache&) = delete; - FontDataCache& operator=(const FontDataCache&) = delete; - -- void Trace(Visitor* visitor) const { -- visitor->Trace(cache_); -- visitor->Trace(strong_reference_lru_); -- } -+ void Trace(Visitor* visitor) const { visitor->Trace(cache_); } - - const SimpleFontData* Get(const FontPlatformData*, - bool subpixel_ascent_descent = false); -- void Clear() { -- cache_.clear(); -- strong_reference_lru_.clear(); -- } -+ void Clear() { cache_.clear(); } - - private: - HeapHashMap, - WeakMember, - FontDataCacheKeyHashTraits> - cache_; -- -- // The above `cache_` is weak, meaning its entries will potentially be -- // cleared if no other references exist. -- // This LRU keeps a small (limited) number of strong references alive so they -- // won't be cleared in the above cache for performance reasons. -- HeapLinkedHashSet> strong_reference_lru_; - }; - - } // namespace blink diff --git a/bad-font-gc0000.patch b/bad-font-gc0000.patch deleted file mode 100644 index 1ef302e..0000000 --- a/bad-font-gc0000.patch +++ /dev/null @@ -1,425 +0,0 @@ -Revert the following commit: - - -commit cc6c0b2a9e1dbc96f3ebed713dc71960a29dc4f1 -Author: Ian Kilpatrick -Date: Tue Mar 5 20:27:13 2024 +0000 - - Reland "[gc] Make FontFamily immutable." - - This reverts commit 748ed11510ec5bb09cc8b92f67f1f62964f023fa. - - Reason for revert: Previous patch which caused MSAN issue was reapplied. - - Original change's description: - > Revert "[gc] Make FontFamily immutable." - > - > This reverts commit ca3d3085d8b01fc74623d639c615fc57842cd26d. - > - > Reason for revert: crrev.com/c/5328767 is the reason for failure on some tests on MSAN. Please see crbug.com/327969288 for more details. - > - > Original change's description: - > > [gc] Make FontFamily immutable. - > > - > > Previously we'd build up font-family lists front to back, but would - > > need to mutate them to do so. Instead just build them backwards. - > > - > > This removes a bunch of problematic APIs (like AppendFamily - which - > > doesn't append), and simplifies the code. - > > - > > This will help avoid atomic write barriers once converted to oilpan. - > > - > > Bug: 41490008 - > > Change-Id: Icfcec2d0a1716585cf42985616c02b42b6647943 - > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322929 - > > Commit-Queue: Ian Kilpatrick - > > Reviewed-by: Dominik Röttsches - > > Cr-Commit-Position: refs/heads/main@{#1267168} - > - > Bug: 41490008, 327969288 - > Change-Id: Ic69a5707d00cc98b97dcae3f4b8207b452ce5cbd - > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5333950 - > Bot-Commit: Rubber Stamper - > Commit-Queue: Taiyo Mizuhashi - > Owners-Override: Taiyo Mizuhashi - > Cr-Commit-Position: refs/heads/main@{#1267674} - - Bug: 41490008, 327969288 - Change-Id: If1d395e324b0be15488ef5410e9bcdb219bb19c6 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344844 - Commit-Queue: Ian Kilpatrick - Bot-Commit: Rubber Stamper - Cr-Commit-Position: refs/heads/main@{#1268654} - ---- a/third_party/blink/renderer/core/css/css_font_face.cc -+++ b/third_party/blink/renderer/core/css/css_font_face.cc -@@ -216,8 +216,9 @@ bool CSSFontFace::MaybeLoadFont(const Fo - - void CSSFontFace::Load() { - FontDescription font_description; -- font_description.SetFamily( -- FontFamily(font_face_->family(), FontFamily::Type::kFamilyName)); -+ FontFamily font_family; -+ font_family.SetFamily(font_face_->family(), FontFamily::Type::kFamilyName); -+ font_description.SetFamily(font_family); - Load(font_description); - } - ---- a/third_party/blink/renderer/core/css/font_face_set_document.cc -+++ b/third_party/blink/renderer/core/css/font_face_set_document.cc -@@ -195,10 +195,13 @@ bool FontFaceSetDocument::ResolveFontSty - ComputedStyleBuilder builder = - GetDocument()->GetStyleResolver().CreateComputedStyleBuilder(); - -- FontDescription default_font_description; -- default_font_description.SetFamily(FontFamily( -+ FontFamily font_family; -+ font_family.SetFamily( - FontFaceSet::DefaultFontFamily(), -- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); -+ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); -+ -+ FontDescription default_font_description; -+ default_font_description.SetFamily(font_family); - default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); - default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize); - ---- a/third_party/blink/renderer/core/css/font_face_set_worker.cc -+++ b/third_party/blink/renderer/core/css/font_face_set_worker.cc -@@ -84,10 +84,13 @@ bool FontFaceSetWorker::ResolveFontStyle - return false; - } - -- FontDescription default_font_description; -- default_font_description.SetFamily(FontFamily( -+ FontFamily font_family; -+ font_family.SetFamily( - FontFaceSet::DefaultFontFamily(), -- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); -+ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); -+ -+ FontDescription default_font_description; -+ default_font_description.SetFamily(font_family); - default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); - default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize); - ---- a/third_party/blink/renderer/core/css/resolver/font_builder.cc -+++ b/third_party/blink/renderer/core/css/resolver/font_builder.cc -@@ -54,9 +54,11 @@ void FontBuilder::DidChangeWritingMode() - } - - FontFamily FontBuilder::StandardFontFamily() const { -+ FontFamily family; - const AtomicString& standard_font_family = StandardFontFamilyName(); -- return FontFamily(standard_font_family, -- FontFamily::InferredTypeFor(standard_font_family)); -+ family.SetFamily(standard_font_family, -+ FontFamily::InferredTypeFor(standard_font_family)); -+ return family; - } - - AtomicString FontBuilder::StandardFontFamilyName() const { ---- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc -+++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc -@@ -379,8 +379,8 @@ FontDescription::FamilyDescription Style - - if (const auto* system_font = - DynamicTo(value)) { -- desc.family = FontFamily(system_font->ResolveFontFamily(), -- FontFamily::Type::kFamilyName); -+ desc.family.SetFamily(system_font->ResolveFontFamily(), -+ FontFamily::Type::kFamilyName); - return desc; - } - -@@ -410,8 +410,10 @@ FontDescription::FamilyDescription Style - // Take the previous value and wrap it in a `SharedFontFamily` adding to - // the linked list. - if (has_value) { -- next = -- SharedFontFamily::Create(family_name, family_type, std::move(next)); -+ scoped_refptr shared = SharedFontFamily::Create(); -+ shared->SetFamily(family_name, family_type); -+ shared->AppendFamily(next); -+ next = shared; - } - family_name = next_family_name; - family_type = is_generic ? FontFamily::Type::kGenericFamily -@@ -442,7 +444,8 @@ FontDescription::FamilyDescription Style - } - #endif - -- desc.family = FontFamily(family_name, family_type, std::move(next)); -+ desc.family.SetFamily(family_name, family_type); -+ desc.family.AppendFamily(next); - return desc; - } - ---- a/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc -+++ b/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc -@@ -29,9 +29,11 @@ const int defaultFontSize = 10; - - const ComputedStyle* CreateDefaultFontStyle(const Document& document) { - const AtomicString& default_font_family = font_family_names::kSansSerif; -+ FontFamily font_family; -+ font_family.SetFamily(default_font_family, -+ FontFamily::InferredTypeFor(default_font_family)); - FontDescription default_font_description; -- default_font_description.SetFamily(FontFamily( -- default_font_family, FontFamily::InferredTypeFor(default_font_family))); -+ default_font_description.SetFamily(font_family); - default_font_description.SetSpecifiedSize(defaultFontSize); - default_font_description.SetComputedSize(defaultFontSize); - ComputedStyleBuilder builder = ---- a/third_party/blink/renderer/core/page/drag_image.cc -+++ b/third_party/blink/renderer/core/page/drag_image.cc -@@ -127,9 +127,11 @@ static Font DeriveDragLabelFont(int size - const AtomicString& family = - LayoutThemeFontProvider::SystemFontFamily(CSSValueID::kNone); - -+ FontFamily font_family; -+ font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); -+ - FontDescription description; -- description.SetFamily( -- FontFamily(family, FontFamily::InferredTypeFor(family))); -+ description.SetFamily(font_family); - description.SetWeight(font_weight); - description.SetSpecifiedSize(size); - description.SetComputedSize(size); ---- a/third_party/blink/renderer/core/paint/embedded_object_painter.cc -+++ b/third_party/blink/renderer/core/paint/embedded_object_painter.cc -@@ -32,9 +32,11 @@ static Font ReplacementTextFont(const Do - const float size = LayoutThemeFontProvider::SystemFontSize( - CSSValueID::kWebkitSmallControl, document); - -+ FontFamily font_family; -+ font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); -+ - FontDescription font_description; -- font_description.SetFamily( -- FontFamily(family, FontFamily::InferredTypeFor(family))); -+ font_description.SetFamily(font_family); - font_description.SetWeight(kBoldWeightValue); - font_description.SetSpecifiedSize(size); - font_description.SetComputedSize(size); ---- a/third_party/blink/renderer/platform/exported/web_font_description.cc -+++ b/third_party/blink/renderer/platform/exported/web_font_description.cc -@@ -49,10 +49,13 @@ WebFontDescription::WebFontDescription(c - } - - WebFontDescription::operator FontDescription() const { -+ FontFamily font_family; -+ font_family.SetFamily(family, family_is_generic -+ ? FontFamily::Type::kGenericFamily -+ : FontFamily::Type::kFamilyName); -+ - FontDescription desc; -- desc.SetFamily(FontFamily(family, family_is_generic -- ? FontFamily::Type::kGenericFamily -- : FontFamily::Type::kFamilyName)); -+ desc.SetFamily(font_family); - desc.SetGenericFamily( - static_cast(generic_family)); - desc.SetSpecifiedSize(size); ---- a/third_party/blink/renderer/platform/fonts/font_description.h -+++ b/third_party/blink/renderer/platform/fonts/font_description.h -@@ -195,6 +195,7 @@ class PLATFORM_EXPORT FontDescription { - FamilyDescription GetFamilyDescription() const { - return FamilyDescription(GenericFamily(), Family()); - } -+ FontFamily& FirstFamily() { return family_list_; } - const FontFamily& FirstFamily() const { return family_list_; } - Size GetSize() const { - return Size(KeywordSize(), SpecifiedSize(), IsAbsoluteSize()); -@@ -450,6 +451,10 @@ class PLATFORM_EXPORT FontDescription { - return fields_.subpixel_ascent_descent_; - } - -+ void SetHashCategory(HashCategory category) { -+ fields_.hash_category_ = category; -+ } -+ - HashCategory GetHashCategory() const { - return static_cast(fields_.hash_category_); - } ---- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc -+++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc -@@ -178,8 +178,9 @@ const FontData* FontFallbackList::GetFon - - if (font_selector_) { - // Try the user's preferred standard font. -- FontFamily font_family(font_family_names::kWebkitStandard, -- FontFamily::Type::kGenericFamily); -+ FontFamily font_family; -+ font_family.SetFamily(font_family_names::kWebkitStandard, -+ FontFamily::Type::kGenericFamily); - if (const FontData* data = - font_selector_->GetFontData(font_description, font_family)) { - return data; ---- a/third_party/blink/renderer/platform/fonts/font_family.cc -+++ b/third_party/blink/renderer/platform/fonts/font_family.cc -@@ -49,6 +49,20 @@ bool operator==(const FontFamily& a, con - return true; - } - -+wtf_size_t FontFamily::CountNames() const { -+ wtf_size_t count = 0; -+ for (const FontFamily* font_family = this; font_family; -+ font_family = font_family->Next()) -+ ++count; -+ return count; -+} -+ -+void FontFamily::AppendFamily(AtomicString family_name, Type family_type) { -+ scoped_refptr appended_family = SharedFontFamily::Create(); -+ appended_family->SetFamily(family_name, family_type); -+ AppendFamily(appended_family); -+} -+ - String FontFamily::ToString() const { - StringBuilder builder; - builder.Append(family_name_); ---- a/third_party/blink/renderer/platform/fonts/font_family.h -+++ b/third_party/blink/renderer/platform/fonts/font_family.h -@@ -39,18 +39,16 @@ class PLATFORM_EXPORT FontFamily { - DISALLOW_NEW(); - - public: -- // https://drafts.csswg.org/css-fonts/#font-family-prop -- enum class Type : uint8_t { kFamilyName, kGenericFamily }; -- -- FontFamily(const AtomicString& family_name, -- Type family_type, -- scoped_refptr next = nullptr) -- : family_name_(family_name), -- next_(std::move(next)), -- family_type_(family_type) {} - FontFamily() = default; - ~FontFamily(); - -+ // https://drafts.csswg.org/css-fonts/#font-family-prop -+ enum class Type : uint8_t { kFamilyName, kGenericFamily }; -+ -+ void SetFamily(const AtomicString& family_name, Type family_type) { -+ family_name_ = family_name; -+ family_type_ = family_type; -+ } - // Return this font family's name. Note that it is never quoted nor escaped. - // For web-exposed serialization, please rely instead on the functions - // ComputedStyleUtils::ValueForFontFamily(const FontFamily&) and -@@ -59,8 +57,13 @@ class PLATFORM_EXPORT FontFamily { - const AtomicString& FamilyName() const { return family_name_; } - bool FamilyIsGeneric() const { return family_type_ == Type::kGenericFamily; } - -+ // Returns number of linked `FontFamily` including `this`, so return value is -+ // greater than or equal to 1. When `Next()` is `nullptr`, return value is 1. -+ wtf_size_t CountNames() const; - const FontFamily* Next() const; - -+ void AppendFamily(scoped_refptr); -+ void AppendFamily(AtomicString family_name, Type family_type); - scoped_refptr ReleaseNext(); - - bool IsPrewarmed() const { return is_prewarmed_; } -@@ -93,19 +96,12 @@ class PLATFORM_EXPORT SharedFontFamily : - SharedFontFamily(const SharedFontFamily&) = delete; - SharedFontFamily& operator=(const SharedFontFamily&) = delete; - -- static scoped_refptr Create( -- const AtomicString& family_name, -- Type family_type, -- scoped_refptr next = nullptr) { -- return base::AdoptRef( -- new SharedFontFamily(family_name, family_type, std::move(next))); -+ static scoped_refptr Create() { -+ return base::AdoptRef(new SharedFontFamily); - } - - private: -- SharedFontFamily(const AtomicString& family_name, -- Type family_type, -- scoped_refptr next) -- : FontFamily(family_name, family_type, std::move(next)) {} -+ SharedFontFamily() = default; - }; - - PLATFORM_EXPORT bool operator==(const FontFamily&, const FontFamily&); -@@ -125,6 +121,10 @@ inline const FontFamily* FontFamily::Nex - return next_.get(); - } - -+inline void FontFamily::AppendFamily(scoped_refptr family) { -+ next_ = std::move(family); -+} -+ - inline scoped_refptr FontFamily::ReleaseNext() { - return std::move(next_); - } ---- a/third_party/blink/renderer/platform/graphics/placeholder_image.cc -+++ b/third_party/blink/renderer/platform/graphics/placeholder_image.cc -@@ -85,18 +85,23 @@ void DrawCenteredIcon(cc::PaintCanvas* c - } - - FontDescription CreatePlaceholderFontDescription(float scale_factor) { -- scoped_refptr arial = SharedFontFamily::Create( -- font_family_names::kArial, FontFamily::Type::kFamilyName); -- scoped_refptr helvetica = SharedFontFamily::Create( -- font_family_names::kHelvetica, FontFamily::Type::kFamilyName, arial); -- scoped_refptr helvetica_neue = -- SharedFontFamily::Create(font_family_names::kHelveticaNeue, -- FontFamily::Type::kFamilyName, helvetica); -- FontFamily roboto(font_family_names::kRoboto, FontFamily::Type::kFamilyName, -- helvetica_neue); -- - FontDescription description; -- description.SetFamily(roboto); -+ description.FirstFamily().SetFamily(font_family_names::kRoboto, -+ FontFamily::Type::kFamilyName); -+ -+ scoped_refptr helvetica_neue = SharedFontFamily::Create(); -+ helvetica_neue->SetFamily(font_family_names::kHelveticaNeue, -+ FontFamily::Type::kFamilyName); -+ scoped_refptr helvetica = SharedFontFamily::Create(); -+ helvetica->SetFamily(font_family_names::kHelvetica, -+ FontFamily::Type::kFamilyName); -+ scoped_refptr arial = SharedFontFamily::Create(); -+ arial->SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName); -+ -+ helvetica->AppendFamily(std::move(arial)); -+ helvetica_neue->AppendFamily(std::move(helvetica)); -+ description.FirstFamily().AppendFamily(std::move(helvetica_neue)); -+ - description.SetGenericFamily(FontDescription::kSansSerifFamily); - description.SetComputedSize(scale_factor * kFontSize); - description.SetWeight(FontSelectionValue(500)); ---- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc -+++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc -@@ -127,9 +127,11 @@ Font CreateTestFont(const AtomicString& - size_t data_size, - float size, - const FontDescription::VariantLigatures* ligatures) { -+ FontFamily family; -+ family.SetFamily(family_name, FontFamily::Type::kFamilyName); -+ - FontDescription font_description; -- font_description.SetFamily( -- FontFamily(family_name, FontFamily::Type::kFamilyName)); -+ font_description.SetFamily(family); - font_description.SetSpecifiedSize(size); - font_description.SetComputedSize(size); - if (ligatures) -@@ -143,9 +145,11 @@ Font CreateTestFont(const AtomicString& - float size, - const FontDescription::VariantLigatures* ligatures, - void (*init_font_description)(FontDescription*)) { -+ FontFamily family; -+ family.SetFamily(family_name, FontFamily::Type::kFamilyName); -+ - FontDescription font_description; -- font_description.SetFamily( -- FontFamily(family_name, FontFamily::Type::kFamilyName)); -+ font_description.SetFamily(family); - font_description.SetSpecifiedSize(size); - font_description.SetComputedSize(size); - if (ligatures) diff --git a/bad-font-gc1.patch b/bad-font-gc1.patch deleted file mode 100644 index eedd777..0000000 --- a/bad-font-gc1.patch +++ /dev/null @@ -1,258 +0,0 @@ -This is a revert of the commit below. While it doesn't strictly fix any -bugs, it's needed to support bad-font-gc2.patch building. - -commit 9a8fc2e22363c954af239c06798bf85a9c928295 -Author: Ian Kilpatrick -Date: Wed Feb 14 19:35:11 2024 +0000 - - [gc] Make FontCustomPlatformData gc'd. - - There should be no user-visible behaviour change. - - Bug: 41490008 - Change-Id: I6364bf4c5b5dce9f99d8e2d7e1f84537c5493c33 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5293060 - Commit-Queue: Ian Kilpatrick - Reviewed-by: Dominik Röttsches - Cr-Commit-Position: refs/heads/main@{#1260637} - ---- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc -+++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc -@@ -27,16 +27,13 @@ BinaryDataFontFaceSource::BinaryDataFont - return; - } - probe::FontsUpdated(context, font_face, String(), -- custom_platform_data_.Get()); -+ custom_platform_data_.get()); - } - --void BinaryDataFontFaceSource::Trace(Visitor* visitor) const { -- visitor->Trace(custom_platform_data_); -- CSSFontFaceSource::Trace(visitor); --} -+BinaryDataFontFaceSource::~BinaryDataFontFaceSource() = default; - - bool BinaryDataFontFaceSource::IsValid() const { -- return custom_platform_data_; -+ return custom_platform_data_.get(); - } - - SimpleFontData* BinaryDataFontFaceSource::CreateFontData( ---- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h -+++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h -@@ -16,14 +16,14 @@ class FontCustomPlatformData; - class BinaryDataFontFaceSource final : public CSSFontFaceSource { - public: - BinaryDataFontFaceSource(CSSFontFace*, SharedBuffer*, String&); -- void Trace(Visitor*) const override; -+ ~BinaryDataFontFaceSource() override; - bool IsValid() const override; - - private: - SimpleFontData* CreateFontData(const FontDescription&, - const FontSelectionCapabilities&) override; - -- Member custom_platform_data_; -+ scoped_refptr custom_platform_data_; - }; - - } // namespace blink ---- a/third_party/blink/renderer/core/css/remote_font_face_source.cc -+++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc -@@ -262,7 +262,7 @@ void RemoteFontFaceSource::NotifyFinishe - FontInvalidationReason::kFontFaceLoaded); - if (custom_font_data_) { - probe::FontsUpdated(execution_context, face_->GetFontFace(), -- resource->Url().GetString(), custom_font_data_.Get()); -+ resource->Url().GetString(), custom_font_data_.get()); - } - } - } -@@ -456,7 +456,6 @@ void RemoteFontFaceSource::BeginLoadIfNe - void RemoteFontFaceSource::Trace(Visitor* visitor) const { - visitor->Trace(face_); - visitor->Trace(font_selector_); -- visitor->Trace(custom_font_data_); - CSSFontFaceSource::Trace(visitor); - FontResourceClient::Trace(visitor); - } ---- a/third_party/blink/renderer/core/css/remote_font_face_source.h -+++ b/third_party/blink/renderer/core/css/remote_font_face_source.h -@@ -43,7 +43,7 @@ class RemoteFontFaceSource final : publi - bool IsPendingDataUrl() const override; - - const FontCustomPlatformData* GetCustomPlaftormData() const override { -- return custom_font_data_.Get(); -+ return custom_font_data_.get(); - } - - void BeginLoadIfNeeded() override; -@@ -157,7 +157,7 @@ class RemoteFontFaceSource final : publi - Member font_selector_; - - // |nullptr| if font is not loaded or failed to decode. -- Member custom_font_data_; -+ scoped_refptr custom_font_data_; - // |nullptr| if font is not loaded or failed to decode. - String url_; - ---- a/third_party/blink/renderer/core/loader/resource/font_resource.cc -+++ b/third_party/blink/renderer/core/loader/resource/font_resource.cc -@@ -112,7 +112,7 @@ void FontResource::StartLoadLimitTimersI - kFontLoadWaitLong); - } - --const FontCustomPlatformData* FontResource::GetCustomFontData() { -+scoped_refptr FontResource::GetCustomFontData() { - if (!font_data_ && !ErrorOccurred() && !IsLoading()) { - if (Data()) { - auto decode_start_time = base::TimeTicks::Now(); -@@ -225,7 +225,6 @@ void FontResource::AddClearDataObserver( - } - - void FontResource::Trace(Visitor* visitor) const { -- visitor->Trace(font_data_); - visitor->Trace(clear_data_observers_); - Resource::Trace(visitor); - } ---- a/third_party/blink/renderer/core/loader/resource/font_resource.h -+++ b/third_party/blink/renderer/core/loader/resource/font_resource.h -@@ -72,7 +72,7 @@ class CORE_EXPORT FontResource final : p - - String OtsParsingMessage() const { return ots_parsing_message_; } - -- const FontCustomPlatformData* GetCustomFontData(); -+ scoped_refptr GetCustomFontData(); - - // Returns true if the loading priority of the remote font resource can be - // lowered. The loading priority of the font can be lowered only if the -@@ -112,7 +112,7 @@ class CORE_EXPORT FontResource final : p - kMaxValue = kLongLimitExceeded, - }; - -- Member font_data_; -+ scoped_refptr font_data_; - String ots_parsing_message_; - LoadLimitState load_limit_state_; - bool cors_failed_; ---- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc -+++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc -@@ -115,7 +115,7 @@ const FontPlatformData* FontCustomPlatfo - const ResolvedFontFeatures& resolved_font_features, - FontOrientation orientation, - const FontVariationSettings* variation_settings, -- const FontPalette* palette) const { -+ const FontPalette* palette) { - DCHECK(base_typeface_); - - sk_sp return_typeface = base_typeface_; -@@ -304,7 +304,7 @@ String FontCustomPlatformData::FamilyNam - localized_string.fString.size()); - } - --FontCustomPlatformData* FontCustomPlatformData::Create( -+scoped_refptr FontCustomPlatformData::Create( - SharedBuffer* buffer, - String& ots_parse_message) { - DCHECK(buffer); -@@ -321,8 +321,8 @@ FontCustomPlatformData* FontCustomPlatfo - if (v8::Isolate* isolate = v8::Isolate::TryGetCurrent()) { - isolate->AdjustAmountOfExternalAllocatedMemory(data_size); - } -- return MakeGarbageCollected(std::move(typeface), -- data_size); -+ return base::AdoptRef( -+ new FontCustomPlatformData(std::move(typeface), data_size)); - } - - bool FontCustomPlatformData::MayBeIconFont() const { ---- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h -+++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h -@@ -39,7 +39,6 @@ - #include "third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.h" - #include "third_party/blink/renderer/platform/fonts/resolved_font_features.h" - #include "third_party/blink/renderer/platform/fonts/text_rendering_mode.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/forward.h" -@@ -55,17 +54,16 @@ class FontPlatformData; - class FontVariationSettings; - - class PLATFORM_EXPORT FontCustomPlatformData -- : public GarbageCollected { -+ : public RefCounted { -+ USING_FAST_MALLOC(FontCustomPlatformData); -+ - public: -- static FontCustomPlatformData* Create(SharedBuffer*, -- String& ots_parse_message); -- FontCustomPlatformData(sk_sp, size_t data_size); -+ static scoped_refptr Create(SharedBuffer*, -+ String& ots_parse_message); - FontCustomPlatformData(const FontCustomPlatformData&) = delete; - FontCustomPlatformData& operator=(const FontCustomPlatformData&) = delete; - ~FontCustomPlatformData(); - -- void Trace(Visitor*) const {} -- - // The size argument should come from EffectiveFontSize() and - // adjusted_specified_size should come from AdjustedSpecifiedSize() of - // FontDescription. The latter is needed for correctly applying -@@ -82,7 +80,7 @@ class PLATFORM_EXPORT FontCustomPlatform - const ResolvedFontFeatures& resolved_font_features, - FontOrientation = FontOrientation::kHorizontal, - const FontVariationSettings* = nullptr, -- const FontPalette* = nullptr) const; -+ const FontPalette* = nullptr); - - String FamilyNameForInspector() const; - -@@ -93,6 +91,7 @@ class PLATFORM_EXPORT FontCustomPlatform - bool MayBeIconFont() const; - - private: -+ FontCustomPlatformData(sk_sp, size_t data_size); - sk_sp base_typeface_; - size_t data_size_; - ---- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc -+++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc -@@ -29,7 +29,7 @@ class TestFontSelector : public FontSele - static TestFontSelector* Create(const uint8_t* data, size_t size) { - scoped_refptr font_buffer = SharedBuffer::Create(data, size); - String ots_parse_message; -- FontCustomPlatformData* font_custom_platform_data = -+ scoped_refptr font_custom_platform_data = - FontCustomPlatformData::Create(font_buffer.get(), ots_parse_message); - if (!font_custom_platform_data) - return nullptr; -@@ -37,17 +37,12 @@ class TestFontSelector : public FontSele - std::move(font_custom_platform_data)); - } - -- TestFontSelector(FontCustomPlatformData* custom_platform_data) -- : custom_platform_data_(custom_platform_data) { -+ TestFontSelector(scoped_refptr custom_platform_data) -+ : custom_platform_data_(std::move(custom_platform_data)) { - DCHECK(custom_platform_data_); - } - ~TestFontSelector() override = default; - -- void Trace(Visitor* visitor) const override { -- visitor->Trace(custom_platform_data_); -- FontSelector::Trace(visitor); -- } -- - FontData* GetFontData(const FontDescription& font_description, - const FontFamily&) override { - FontSelectionCapabilities normal_capabilities( -@@ -117,7 +112,7 @@ class TestFontSelector : public FontSele - } - - private: -- Member custom_platform_data_; -+ scoped_refptr custom_platform_data_; - }; - - } // namespace diff --git a/bad-font-gc11.patch b/bad-font-gc11.patch deleted file mode 100644 index 2611918..0000000 --- a/bad-font-gc11.patch +++ /dev/null @@ -1,434 +0,0 @@ -Revert the following commit: - -commit 2eefeabb12fb7e92f2508116a5ed959c57659be1 -Author: Ian Kilpatrick -Date: Tue Feb 20 17:40:39 2024 +0000 - - [gc] Make HarfBuzzFontData & friends gc'd. - - Previously we had a HbFontCacheEntry which was used to hold onto the - HarfBuzzFontData, and a hb_font_t. - - HarfBuzzFontData is used for holding data specific for various - harfbuzz callbacks, but we can also hold onto the hb_font_t there. - - There should be no user-visible behaviour change. - - Bug: 41490008 - Change-Id: Icaa7ad3b2f75e9807b88014a9a15406cb76eb52e - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302175 - Reviewed-by: Dominik Röttsches - Commit-Queue: Ian Kilpatrick - Cr-Commit-Position: refs/heads/main@{#1262752} - -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.cc -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/font_global_context.cc -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.cc -@@ -8,6 +8,7 @@ - #include "third_party/blink/renderer/platform/fonts/font_cache.h" - #include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h" - #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h" -+#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" - #include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h" - #include "third_party/blink/renderer/platform/wtf/thread_specific.h" - -@@ -50,6 +51,15 @@ FontUniqueNameLookup* FontGlobalContext: - return Get().font_unique_name_lookup_.get(); - } - -+HarfBuzzFontCache& FontGlobalContext::GetHarfBuzzFontCache() { -+ std::unique_ptr& global_context_harfbuzz_font_cache = -+ Get().harfbuzz_font_cache_; -+ if (!global_context_harfbuzz_font_cache) { -+ global_context_harfbuzz_font_cache = std::make_unique(); -+ } -+ return *global_context_harfbuzz_font_cache; -+} -+ - IdentifiableToken FontGlobalContext::GetOrComputeTypefaceDigest( - const FontPlatformData& source) { - SkTypeface* typeface = source.Typeface(); -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.h -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/font_global_context.h -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/font_global_context.h -@@ -9,7 +9,6 @@ - #include "base/types/pass_key.h" - #include "third_party/blink/public/common/privacy_budget/identifiable_token.h" - #include "third_party/blink/renderer/platform/fonts/font_cache.h" --#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/text/layout_locale.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -@@ -34,19 +33,14 @@ class PLATFORM_EXPORT FontGlobalContext - static FontGlobalContext& Get(); - static FontGlobalContext* TryGet(); - -- void Trace(Visitor* visitor) const { -- visitor->Trace(font_cache_); -- visitor->Trace(harfbuzz_font_cache_); -- } -+ void Trace(Visitor* visitor) const { visitor->Trace(font_cache_); } - - FontGlobalContext(const FontGlobalContext&) = delete; - FontGlobalContext& operator=(const FontGlobalContext&) = delete; - - static inline FontCache& GetFontCache() { return Get().font_cache_; } - -- static HarfBuzzFontCache& GetHarfBuzzFontCache() { -- return Get().harfbuzz_font_cache_; -- } -+ static HarfBuzzFontCache& GetHarfBuzzFontCache(); - - static FontUniqueNameLookup* GetFontUniqueNameLookup(); - -@@ -62,7 +56,7 @@ class PLATFORM_EXPORT FontGlobalContext - - private: - FontCache font_cache_; -- HarfBuzzFontCache harfbuzz_font_cache_; -+ std::unique_ptr harfbuzz_font_cache_; - std::unique_ptr font_unique_name_lookup_; - base::HashingLRUCache typeface_digest_cache_; - base::HashingLRUCache -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -67,14 +67,20 @@ namespace blink { - - HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, - uint64_t unique_id) -- : platform_data_(platform_data), -- harfbuzz_font_data_(FontGlobalContext::GetHarfBuzzFontCache().GetOrCreate( -- unique_id, -- platform_data)) {} -+ : platform_data_(platform_data), unique_id_(unique_id) { -+ HbFontCacheEntry* const cache_entry = -+ FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, -+ platform_data); -+ unscaled_font_ = cache_entry->HbFont(); -+ harfbuzz_font_data_ = cache_entry->HbFontData(); -+} -+ -+HarfBuzzFace::~HarfBuzzFace() { -+ FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); -+} - - void HarfBuzzFace::Trace(Visitor* visitor) const { - visitor->Trace(platform_data_); -- visitor->Trace(harfbuzz_font_data_); - } - - bool& GetIgnoreVariationSelectors() { -@@ -287,17 +293,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr - - hb::unique_ptr glyphs(hb_set_create()); - -- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get(); -- - // Check whether computing is needed and compute for gpos/gsub. - if (features & kKerning && - harfbuzz_font_data_->space_in_gpos_ == - HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { -- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) { -+ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space)) - return false; -- } - // Compute for gpos. -- hb_face_t* face = hb_font_get_face(unscaled_font); -+ hb_face_t* face = hb_font_get_face(unscaled_font_); - DCHECK(face); - harfbuzz_font_data_->space_in_gpos_ = - hb_ot_layout_has_positioning(face) && -@@ -311,11 +314,10 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr - if (features & kLigatures && - harfbuzz_font_data_->space_in_gsub_ == - HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { -- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) { -+ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space)) - return false; -- } - // Compute for gpos. -- hb_face_t* face = hb_font_get_face(unscaled_font); -+ hb_face_t* face = hb_font_get_face(unscaled_font_); - DCHECK(face); - harfbuzz_font_data_->space_in_gsub_ = - hb_ot_layout_has_substitution(face) && -@@ -333,14 +335,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr - } - - unsigned HarfBuzzFace::UnitsPerEmFromHeadTable() { -- hb_face_t* face = hb_font_get_face(harfbuzz_font_data_->unscaled_font_.get()); -+ hb_face_t* face = hb_font_get_face(unscaled_font_); - return hb_face_get_upem(face); - } - - Glyph HarfBuzzFace::HbGlyphForCharacter(UChar32 character) { - hb_codepoint_t glyph = 0; -- HarfBuzzGetNominalGlyph(harfbuzz_font_data_->unscaled_font_.get(), -- harfbuzz_font_data_, character, &glyph, nullptr); -+ HarfBuzzGetNominalGlyph(unscaled_font_, harfbuzz_font_data_, character, -+ &glyph, nullptr); - return glyph; - } - -@@ -349,7 +351,7 @@ hb_codepoint_t HarfBuzzFace::HarfBuzzGet - UChar32 variation_selector) { - DCHECK(RuntimeEnabledFeatures::FontVariationSequencesEnabled()); - hb_codepoint_t glyph = 0; -- HarfBuzzGetGlyph(harfbuzz_font_data_->unscaled_font_.get(), -+ HarfBuzzGetGlyph(unscaled_font_, - harfbuzz_font_data_, character, variation_selector, &glyph, - nullptr); - return glyph; -@@ -511,10 +513,9 @@ static hb::unique_ptr CreateF - return face; - } - --namespace { -- --HarfBuzzFontData* CreateHarfBuzzFontData(hb_face_t* face, -- SkTypeface* typeface) { -+static scoped_refptr CreateHbFontCacheEntry( -+ hb_face_t* face, -+ SkTypeface* typeface) { - hb::unique_ptr ot_font(hb_font_create(face)); - hb_ot_font_set_funcs(ot_font.get()); - -@@ -533,26 +534,25 @@ HarfBuzzFontData* CreateHarfBuzzFontData - // Creating a sub font means that non-available functions - // are found from the parent. - hb_font_t* const unscaled_font = hb_font_create_sub_font(ot_font.get()); -- HarfBuzzFontData* data = -- MakeGarbageCollected(unscaled_font); -+ scoped_refptr cache_entry = -+ HbFontCacheEntry::Create(unscaled_font); - hb_font_set_funcs(unscaled_font, -- HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), data, -- nullptr); -- return data; -+ HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), -+ cache_entry->HbFontData(), nullptr); -+ return cache_entry; - } - --} // namespace -- --HarfBuzzFontData* HarfBuzzFontCache::GetOrCreate( -+HbFontCacheEntry* HarfBuzzFontCache::RefOrNew( - uint64_t unique_id, - const FontPlatformData* platform_data) { - const auto& result = font_map_.insert(unique_id, nullptr); - if (result.is_new_entry) { - hb::unique_ptr face = CreateFace(platform_data); - result.stored_value->value = -- CreateHarfBuzzFontData(face.get(), platform_data->Typeface()); -+ CreateHbFontCacheEntry(face.get(), platform_data->Typeface()); - } -- return result.stored_value->value.Get(); -+ result.stored_value->value->AddRef(); -+ return result.stored_value->value.get(); - } - - static_assert( -@@ -583,18 +583,17 @@ hb_font_t* HarfBuzzFace::GetScaledFont(s - vertical_layout); - - int scale = SkiaScalarToHarfBuzzPosition(platform_data_->size()); -- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get(); -- hb_font_set_scale(unscaled_font, scale, scale); -+ hb_font_set_scale(unscaled_font_, scale, scale); - // See contended discussion in https://github.com/harfbuzz/harfbuzz/pull/1484 - // Setting ptem here is critical for HarfBuzz to know where to lookup spacing - // offset in the AAT trak table, the unit pt in ptem here means "CoreText" - // points. After discussion on the pull request and with Apple developers, the - // meaning of HarfBuzz' hb_font_set_ptem API was changed to expect the - // equivalent of CSS pixels here. -- hb_font_set_ptem(unscaled_font, specified_size > 0 ? specified_size -- : platform_data_->size()); -+ hb_font_set_ptem(unscaled_font_, specified_size > 0 ? specified_size -+ : platform_data_->size()); - -- return unscaled_font; -+ return unscaled_font_; - } - - hb_font_t* HarfBuzzFace::GetScaledFont() const { -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -@@ -58,6 +58,7 @@ class PLATFORM_EXPORT HarfBuzzFace final - HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); - HarfBuzzFace(const HarfBuzzFace&) = delete; - HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; -+ ~HarfBuzzFace(); - - void Trace(Visitor*) const; - -@@ -100,7 +101,11 @@ class PLATFORM_EXPORT HarfBuzzFace final - void PrepareHarfBuzzFontData(); - - Member platform_data_; -- Member harfbuzz_font_data_; -+ const uint64_t unique_id_; -+ // TODO(crbug.com/1489080): When briefly given MiraclePtr protection, -+ // these members were both found dangling. -+ hb_font_t* unscaled_font_; -+ HarfBuzzFontData* harfbuzz_font_data_; - }; - - inline constexpr hb_codepoint_t kUnmatchedVSGlyphId = -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -@@ -8,8 +8,38 @@ - - namespace blink { - --void HarfBuzzFontCache::Trace(Visitor* visitor) const { -- visitor->Trace(font_map_); -+HbFontCacheEntry::HbFontCacheEntry(hb_font_t* font) -+ : hb_font_(hb::unique_ptr(font)), -+ hb_font_data_(std::make_unique()) {} -+ -+HbFontCacheEntry::~HbFontCacheEntry() = default; -+ -+scoped_refptr HbFontCacheEntry::Create(hb_font_t* hb_font) { -+ DCHECK(hb_font); -+ return base::AdoptRef(new HbFontCacheEntry(hb_font)); -+} -+ -+HarfBuzzFontCache::HarfBuzzFontCache() = default; -+HarfBuzzFontCache::~HarfBuzzFontCache() = default; -+ -+// See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()| -+// implementation. -+ -+void HarfBuzzFontCache::Remove(uint64_t unique_id) { -+ auto it = font_map_.find(unique_id); -+ // TODO(https://crbug.com/1417160): In tests such as FontObjectThreadedTest -+ // that test taking down FontGlobalContext an object may not be found due to -+ // existing issues with refcounting of font objects at thread destruction -+ // time. -+ if (it == font_map_.end()) { -+ return; -+ } -+ DCHECK(!it.Get()->value->HasOneRef()); -+ it.Get()->value->Release(); -+ if (!it.Get()->value->HasOneRef()) { -+ return; -+ } -+ font_map_.erase(it); - } - - } // namespace blink -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -@@ -6,9 +6,12 @@ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_CACHE_H_ - - #include "third_party/blink/renderer/platform/fonts/font_metrics.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" --#include "third_party/blink/renderer/platform/heap/member.h" -+#include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" -+ -+#include -+#include -+ -+#include - - namespace blink { - -@@ -22,21 +25,39 @@ struct HarfBuzzFontData; - // FIXME, crbug.com/609099: We should fix the FontCache to only keep one - // FontPlatformData object independent of size, then consider using this here. - --class HarfBuzzFontCache final { -- DISALLOW_NEW(); -+class HbFontCacheEntry : public RefCounted { -+ USING_FAST_MALLOC(HbFontCacheEntry); -+ -+ public: -+ static scoped_refptr Create(hb_font_t* hb_font); -+ -+ hb_font_t* HbFont() { return hb_font_.get(); } -+ HarfBuzzFontData* HbFontData() { return hb_font_data_.get(); } -+ -+ ~HbFontCacheEntry(); - -+ private: -+ explicit HbFontCacheEntry(hb_font_t* font); -+ -+ hb::unique_ptr hb_font_; -+ std::unique_ptr hb_font_data_; -+}; -+ -+class HarfBuzzFontCache final { - public: -- void Trace(Visitor* visitor) const; -- // See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()| -- // implementation. -- HarfBuzzFontData* GetOrCreate(uint64_t unique_id, -- const FontPlatformData* platform_data); -+ HarfBuzzFontCache(); -+ ~HarfBuzzFontCache(); -+ -+ HbFontCacheEntry* RefOrNew(uint64_t unique_id, -+ const FontPlatformData* platform_data); -+ void Remove(uint64_t unique_id); - - private: -- HeapHashMap, -- IntWithZeroKeyHashTraits> -- font_map_; -+ using HbFontDataMap = HashMap, -+ IntWithZeroKeyHashTraits>; -+ -+ HbFontDataMap font_map_; - }; - - } // namespace blink -Index: chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -=================================================================== ---- chromium-126.0.6478.8.orig/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -+++ chromium-126.0.6478.8/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -@@ -22,18 +22,15 @@ const unsigned kInvalidFallbackMetricsVa - // The HarfBuzzFontData struct carries user-pointer data for - // |hb_font_t| callback functions/operations. It contains metrics and OpenType - // layout information related to a font scaled to a particular size. --struct HarfBuzzFontData final : public GarbageCollected { -+struct HarfBuzzFontData final { -+ USING_FAST_MALLOC(HarfBuzzFontData); -+ - public: -- explicit HarfBuzzFontData(hb_font_t* unscaled_font) -- : unscaled_font_(hb::unique_ptr(unscaled_font)), -- vertical_data_(nullptr), -- range_set_(nullptr) {} -+ HarfBuzzFontData() : vertical_data_(nullptr), range_set_(nullptr) {} - - HarfBuzzFontData(const HarfBuzzFontData&) = delete; - HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; - -- void Trace(Visitor*) const {} -- - // The vertical origin and vertical advance functions in HarfBuzzFace require - // the ascent and height metrics as fallback in case no specific vertical - // layout information is found from the font. -@@ -81,7 +78,6 @@ struct HarfBuzzFontData final : public G - return vertical_data_; - } - -- const hb::unique_ptr unscaled_font_; - SkFont font_; - - // Capture these scaled fallback metrics from FontPlatformData so that a diff --git a/bad-font-gc2.patch b/bad-font-gc2.patch deleted file mode 100644 index 3c92583..0000000 --- a/bad-font-gc2.patch +++ /dev/null @@ -1,3725 +0,0 @@ -Chromium 123 was buggy, with tabs regularly hanging/crashing. The culprit -was the GC cleaning up font cache stuff, and deadlocking in a FontCacheKey -destructor: - -Thread 54 (Thread 0x7fffc55fe6c0 (LWP 413811) "Chrome_InProcRe"): -#0 0x00007ffff6720719 in syscall () from /lib/x86_64-linux-gnu/libc.so.6 -#1 0x000055555c1752d9 in partition_alloc::internal::SpinningMutex::LockSlow() () -#2 0x000055555c185529 in allocator_shim::internal::PartitionFree(allocator_shim::AllocatorDispatch const*, void*, void*) () -#3 0x000055555f7db46b in blink::FontCacheKey::~FontCacheKey() () -#4 0x000055555f7db6f4 in WTF::WeakProcessingHashTableHelper<(WTF::WeakHandlingFlag)1, blink::FontCacheKey, WTF::KeyValuePair >, WTF::KeyValuePairExtractor, WTF::HashMapValueTraits, WTF::HashTraits > >, WTF::HashTraits, blink::HeapAllocator>::Process(cppgc::LivenessBroker const&, void const*) () -#5 0x0000555559544bef in cppgc::internal::MarkerBase::ProcessWeakness() () -#6 0x000055555954487e in cppgc::internal::MarkerBase::LeaveAtomicPause() () -#7 0x0000555558e8115a in v8::internal::CppHeap::FinishMarkingAndStartSweeping() () -#8 0x0000555558ebcdc0 in v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) () -#9 0x0000555558ecfe14 in v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_0::operator()() const () -#10 0x0000555558ecfb65 in void heap::base::Stack::SetMarkerAndCallbackImpl(heap::base::Stack*, void*, void const*) () ---Type for more, q to quit, c to continue without paging-- -#11 0x000055555955216b in PushAllRegistersAndIterateStack () -#12 0x0000555558eb8c19 in v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) () -#13 0x0000555558eba3eb in v8::internal::Heap::FinalizeIncrementalMarkingAtomically(v8::internal::GarbageCollectionReason) () -#14 0x0000555558ed20db in v8::internal::IncrementalMarkingJob::Task::RunInternal() () -#15 0x000055555c0c49d6 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) () -#16 0x000055555c0daf88 in base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) () -#17 0x000055555c0c49d6 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) () -#18 0x000055555c0dd8f9 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) () -#19 0x000055555c0dd3bf in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () -#20 0x000055555c0ddd75 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () -#21 0x000055555c07eb4f in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) () -#22 0x000055555c0de110 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) () -#23 0x000055555c0a4c26 in base::RunLoop::Run(base::Location const&) () -#24 0x000055555c100155 in base::Thread::Run(base::RunLoop*) () -#25 0x000055555c100342 in base::Thread::ThreadMain() () - - -The commit below modified font stuff to go from using scoped_refptrs to -getting cleaned up via GC. Reverting it fixes chromium's behavior for us. -It would be good to get a proper fix for this, but reverting this will -have to do for now. - - -commit bff9ec6754f7bf97c61d84663ee2ccc5055e9eb3 -Author: Ian Kilpatrick -Date: Tue Feb 13 19:15:19 2024 +0000 - - [gc] Make SimpleFontData & FontPlatformData & friends gc'd. - - The largest change is making the associated caches for these objects - weak collections instead of relying on the relatively complex purging - logic. - - https://variable-lizards.glitch.me/ appears not to leak. - - There should be no user-visible behaviour change. - - Bug: 41490008 - Change-Id: Iba581842459cf31f7f4fe60d83665f393a7d06a3 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262982 - Reviewed-by: Caleb Raitto - Reviewed-by: Dominik Röttsches - Commit-Queue: Ian Kilpatrick - Cr-Commit-Position: refs/heads/main@{#1259965} - ---- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc -+++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc -@@ -36,10 +36,10 @@ bool BinaryDataFontFaceSource::IsValid() - return custom_platform_data_.get(); - } - --SimpleFontData* BinaryDataFontFaceSource::CreateFontData( -+scoped_refptr BinaryDataFontFaceSource::CreateFontData( - const FontDescription& font_description, - const FontSelectionCapabilities& font_selection_capabilities) { -- return MakeGarbageCollected( -+ return SimpleFontData::Create( - custom_platform_data_->GetFontPlatformData( - font_description.EffectiveFontSize(), - font_description.AdjustedSpecifiedSize(), -@@ -56,7 +56,7 @@ SimpleFontData* BinaryDataFontFaceSource - : ResolvedFontFeatures(), - font_description.Orientation(), font_description.VariationSettings(), - font_description.GetFontPalette()), -- MakeGarbageCollected()); -+ CustomFontData::Create()); - } - - } // namespace blink ---- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h -+++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h -@@ -20,8 +20,9 @@ class BinaryDataFontFaceSource final : p - bool IsValid() const override; - - private: -- SimpleFontData* CreateFontData(const FontDescription&, -- const FontSelectionCapabilities&) override; -+ scoped_refptr CreateFontData( -+ const FontDescription&, -+ const FontSelectionCapabilities&) override; - - scoped_refptr custom_platform_data_; - }; ---- a/third_party/blink/renderer/core/css/css_custom_font_data.h -+++ b/third_party/blink/renderer/core/css/css_custom_font_data.h -@@ -31,18 +31,13 @@ class CSSCustomFontData final : public C - public: - enum FallbackVisibility { kInvisibleFallback, kVisibleFallback }; - -- CSSCustomFontData(CSSFontFaceSource* source, FallbackVisibility visibility) -- : font_face_source_(source), fallback_visibility_(visibility) { -- if (source) { -- is_loading_ = source->IsLoading(); -- } -+ static scoped_refptr Create( -+ CSSFontFaceSource* source, -+ FallbackVisibility visibility) { -+ return base::AdoptRef(new CSSCustomFontData(source, visibility)); - } -- ~CSSCustomFontData() override = default; - -- void Trace(Visitor* visitor) const override { -- visitor->Trace(font_face_source_); -- CustomFontData::Trace(visitor); -- } -+ ~CSSCustomFontData() override = default; - - bool ShouldSkipDrawing() const override { - if (font_face_source_) { -@@ -66,7 +61,16 @@ class CSSCustomFontData final : public C - } - - private: -- Member font_face_source_; -+ CSSCustomFontData(CSSFontFaceSource* source, FallbackVisibility visibility) -+ : font_face_source_(source), fallback_visibility_(visibility) { -+ if (source) { -+ is_loading_ = source->IsLoading(); -+ } -+ } -+ -+ // TODO(Oilpan): consider moving (Custom)FontFace hierarchy to the heap, -+ // thereby making this reference a Member<>. -+ WeakPersistent font_face_source_; - FallbackVisibility fallback_visibility_; - mutable bool is_loading_ = false; - }; ---- a/third_party/blink/renderer/core/css/css_font_face.cc -+++ b/third_party/blink/renderer/core/css/css_font_face.cc -@@ -114,7 +114,7 @@ bool CSSFontFace::FallbackVisibilityChan - return true; - } - --const SimpleFontData* CSSFontFace::GetFontData( -+scoped_refptr CSSFontFace::GetFontData( - const FontDescription& font_description) { - if (!IsValid()) { - return nullptr; -@@ -140,7 +140,7 @@ const SimpleFontData* CSSFontFace::GetFo - return nullptr; - } - -- if (const SimpleFontData* result = -+ if (scoped_refptr result = - source->GetFontData(size_adjusted_description, - font_face_->GetFontSelectionCapabilities())) { - // The font data here is created using the primary font's description. -@@ -149,7 +149,7 @@ const SimpleFontData* CSSFontFace::GetFo - if (size_adjusted_description.HasSizeAdjust()) { - if (auto adjusted_size = - FontSizeFunctions::MetricsMultiplierAdjustedFontSize( -- result, size_adjusted_description)) { -+ result.get(), size_adjusted_description)) { - size_adjusted_description.SetAdjustedSize(adjusted_size.value()); - result = - source->GetFontData(size_adjusted_description, ---- a/third_party/blink/renderer/core/css/css_font_face.h -+++ b/third_party/blink/renderer/core/css/css_font_face.h -@@ -76,7 +76,7 @@ class CORE_EXPORT CSSFontFace final : pu - bool FontLoaded(CSSFontFaceSource*); - bool FallbackVisibilityChanged(RemoteFontFaceSource*); - -- const SimpleFontData* GetFontData(const FontDescription&); -+ scoped_refptr GetFontData(const FontDescription&); - - FontFace::LoadStatusType LoadStatus() const { - return font_face_->LoadStatus(); ---- a/third_party/blink/renderer/core/css/css_font_face_source.cc -+++ b/third_party/blink/renderer/core/css/css_font_face_source.cc -@@ -31,11 +31,22 @@ - #include "third_party/blink/renderer/platform/fonts/font_face_creation_params.h" - #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" - -+namespace { -+// An excessive amount of SimpleFontData objects is generated from -+// CSSFontFaceSource if a lot of varying FontDescriptions point to a web -+// font. These FontDescriptions can vary in size, font-feature-settings or -+// font-variation settings. Well known cases are animations of font-variation -+// settings, compare crbug.com/778352. For a start, let's reduce this number to -+// 1024, which is still a large number and should have enough steps for font -+// animations from the same font face source, but avoids unbounded growth. -+const size_t kMaxCachedFontData = 1024; -+} // namespace -+ - namespace blink { - - CSSFontFaceSource::~CSSFontFaceSource() = default; - --const SimpleFontData* CSSFontFaceSource::GetFontData( -+scoped_refptr CSSFontFaceSource::GetFontData( - const FontDescription& font_description, - const FontSelectionCapabilities& font_selection_capabilities) { - // If the font hasn't loaded or an error occurred, then we've got nothing. -@@ -53,12 +64,52 @@ const SimpleFontData* CSSFontFaceSource: - FontCacheKey key = - font_description.CacheKey(FontFaceCreationParams(), is_unique_match); - -- auto result = font_data_table_.insert(key, nullptr); -- if (result.is_new_entry) { -- result.stored_value->value = -- CreateFontData(font_description, font_selection_capabilities); -+ // Get or create the font data. Take care to avoid dangling references into -+ // font_data_table_, because it is modified below during pruning. -+ scoped_refptr font_data; -+ { -+ auto* it = font_data_table_.insert(key, nullptr).stored_value; -+ if (!it->value) { -+ it->value = CreateFontData(font_description, font_selection_capabilities); -+ } -+ font_data = it->value; -+ } -+ -+ font_cache_key_age.PrependOrMoveToFirst(key); -+ PruneOldestIfNeeded(); -+ -+ DCHECK_LE(font_data_table_.size(), kMaxCachedFontData); -+ // No release, because fontData is a reference to a RefPtr that is held in the -+ // font_data_table_. -+ return font_data; -+} -+ -+void CSSFontFaceSource::PruneOldestIfNeeded() { -+ if (font_cache_key_age.size() > kMaxCachedFontData) { -+ DCHECK_EQ(font_cache_key_age.size() - 1, kMaxCachedFontData); -+ const FontCacheKey& key = font_cache_key_age.back(); -+ auto font_data_entry = font_data_table_.Take(key); -+ font_cache_key_age.pop_back(); -+ DCHECK_EQ(font_cache_key_age.size(), kMaxCachedFontData); -+ if (font_data_entry && font_data_entry->GetCustomFontData()) { -+ font_data_entry->GetCustomFontData()->ClearFontFaceSource(); -+ } -+ } -+} -+ -+void CSSFontFaceSource::PruneTable() { -+ if (font_data_table_.empty()) { -+ return; -+ } -+ -+ for (const auto& item : font_data_table_) { -+ SimpleFontData* font_data = item.value.get(); -+ if (font_data && font_data->GetCustomFontData()) { -+ font_data->GetCustomFontData()->ClearFontFaceSource(); -+ } - } -- return result.stored_value->value.Get(); -+ font_cache_key_age.clear(); -+ font_data_table_.clear(); - } - - } // namespace blink ---- a/third_party/blink/renderer/core/css/css_font_face_source.h -+++ b/third_party/blink/renderer/core/css/css_font_face_source.h -@@ -30,9 +30,7 @@ - #include "third_party/blink/renderer/core/css/font_display.h" - #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" - #include "third_party/blink/renderer/platform/fonts/font_selection_types.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" - #include "third_party/blink/renderer/platform/heap/garbage_collected.h" --#include "third_party/blink/renderer/platform/heap/member.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/hash_map.h" - #include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" -@@ -71,8 +69,8 @@ class CORE_EXPORT CSSFontFaceSource - return nullptr; - } - -- const SimpleFontData* GetFontData(const FontDescription&, -- const FontSelectionCapabilities&); -+ scoped_refptr GetFontData(const FontDescription&, -+ const FontSelectionCapabilities&); - - // TODO(https://crbug.com/947461): IsLocalFontAvailable must not have a - // FontDescription argument. -@@ -93,29 +91,28 @@ class CORE_EXPORT CSSFontFaceSource - virtual bool HadBlankText() { return false; } - virtual void PaintRequested() {} - -- virtual void Trace(Visitor* visitor) const { -- visitor->Trace(font_data_table_); -- } -+ virtual void Trace(Visitor* visitor) const {} - - protected: - CSSFontFaceSource() = default; -- virtual const SimpleFontData* CreateFontData( -+ virtual scoped_refptr CreateFontData( - const FontDescription&, - const FontSelectionCapabilities&) = 0; -- -- void ClearTable() { font_data_table_.clear(); } -+ void PruneTable(); - - // Report the font lookup for metrics collection. Only used for local font - // face sources currently. - virtual void ReportFontLookup(const FontDescription& font_description, -- const SimpleFontData* font_data, -+ SimpleFontData* font_data, - bool is_loading_fallback = false) {} - - private: -- using FontDataTable = -- HeapHashMap>; -+ void PruneOldestIfNeeded(); -+ using FontDataTable = HashMap>; -+ using FontCacheKeyAgeList = LinkedHashSet; - - FontDataTable font_data_table_; -+ FontCacheKeyAgeList font_cache_key_age; - }; - - } // namespace blink ---- a/third_party/blink/renderer/core/css/css_font_selector.cc -+++ b/third_party/blink/renderer/core/css/css_font_selector.cc -@@ -162,7 +162,7 @@ void CSSFontSelector::FontCacheInvalidat - DispatchInvalidationCallbacks(FontInvalidationReason::kGeneralInvalidation); - } - --const FontData* CSSFontSelector::GetFontData( -+scoped_refptr CSSFontSelector::GetFontData( - const FontDescription& font_description, - const FontFamily& font_family) { - const auto& family_name = font_family.FamilyName(); -@@ -252,13 +252,13 @@ const FontData* CSSFontSelector::GetFont - family_name, request_description.GetScript(), - request_description.GenericFamily(), settings_family_name); - -- const SimpleFontData* font_data = -+ scoped_refptr font_data = - FontCache::Get().GetFontData(request_description, settings_family_name); - if (font_data && request_description.HasSizeAdjust()) { - DCHECK(RuntimeEnabledFeatures::CSSFontSizeAdjustEnabled()); - if (auto adjusted_size = - FontSizeFunctions::MetricsMultiplierAdjustedFontSize( -- font_data, request_description)) { -+ font_data.get(), request_description)) { - FontDescription size_adjusted_description(request_description); - size_adjusted_description.SetAdjustedSize(adjusted_size.value()); - font_data = FontCache::Get().GetFontData(size_adjusted_description, ---- a/third_party/blink/renderer/core/css/css_font_selector.h -+++ b/third_party/blink/renderer/core/css/css_font_selector.h -@@ -49,8 +49,8 @@ class CORE_EXPORT CSSFontSelector : publ - - unsigned Version() const override { return font_face_cache_->Version(); } - -- const FontData* GetFontData(const FontDescription&, -- const FontFamily&) override; -+ scoped_refptr GetFontData(const FontDescription&, -+ const FontFamily&) override; - - void FontFaceInvalidated(FontInvalidationReason) override; - ---- a/third_party/blink/renderer/core/css/css_font_selector_base.cc -+++ b/third_party/blink/renderer/core/css/css_font_selector_base.cc -@@ -87,21 +87,21 @@ void CSSFontSelectorBase::ReportFailedLo - void CSSFontSelectorBase::ReportFontLookupByUniqueOrFamilyName( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) { -+ scoped_refptr resulting_font_data) { - if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { - font_matching_metrics->ReportFontLookupByUniqueOrFamilyName( -- name, font_description, resulting_font_data); -+ name, font_description, resulting_font_data.get()); - } - } - - void CSSFontSelectorBase::ReportFontLookupByUniqueNameOnly( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data, -+ scoped_refptr resulting_font_data, - bool is_loading_fallback) { - if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { - font_matching_metrics->ReportFontLookupByUniqueNameOnly( -- name, font_description, resulting_font_data, is_loading_fallback); -+ name, font_description, resulting_font_data.get(), is_loading_fallback); - } - } - -@@ -109,20 +109,20 @@ void CSSFontSelectorBase::ReportFontLook - UChar32 fallback_character, - FontFallbackPriority fallback_priority, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) { -+ scoped_refptr resulting_font_data) { - if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { - font_matching_metrics->ReportFontLookupByFallbackCharacter( - fallback_character, fallback_priority, font_description, -- resulting_font_data); -+ resulting_font_data.get()); - } - } - - void CSSFontSelectorBase::ReportLastResortFallbackFontLookup( - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) { -+ scoped_refptr resulting_font_data) { - if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { - font_matching_metrics->ReportLastResortFallbackFontLookup( -- font_description, resulting_font_data); -+ font_description, resulting_font_data.get()); - } - } - ---- a/third_party/blink/renderer/core/css/css_font_selector_base.h -+++ b/third_party/blink/renderer/core/css/css_font_selector_base.h -@@ -46,23 +46,23 @@ class CORE_EXPORT CSSFontSelectorBase : - void ReportFontLookupByUniqueOrFamilyName( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) override; -+ scoped_refptr resulting_font_data) override; - - void ReportFontLookupByUniqueNameOnly( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data, -+ scoped_refptr resulting_font_data, - bool is_loading_fallback = false) override; - - void ReportFontLookupByFallbackCharacter( - UChar32 fallback_character, - FontFallbackPriority fallback_priority, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) override; -+ scoped_refptr resulting_font_data) override; - - void ReportLastResortFallbackFontLookup( - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) override; -+ scoped_refptr resulting_font_data) override; - - void ReportFontFamilyLookupByGenericFamily( - const AtomicString& generic_font_family_name, ---- a/third_party/blink/renderer/core/css/css_segmented_font_face.cc -+++ b/third_party/blink/renderer/core/css/css_segmented_font_face.cc -@@ -38,16 +38,42 @@ - #include "third_party/blink/renderer/platform/fonts/segmented_font_data.h" - #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" - -+// See comment below in CSSSegmentedFontFace::GetFontData - the cache from -+// CSSSegmentedFontFace (which represents a group of @font-face declarations -+// with identical FontSelectionCapabilities but differing by unicode-range) to -+// FontData/SegmentedFontData, (i.e. the actual font blobs that can be used for -+// shaping and painting retrieved from a CSSFontFaceSource) is usually small -+// (less than a dozen, up to tens) for non-animation-cases, but grows fast to -+// thousands when animating variable font parameters. Set a limit until we start -+// dropping cache entries in animation scenarios. -+static constexpr size_t kFontDataTableMaxSize = 250; -+ - namespace blink { - -+// static -+CSSSegmentedFontFace* CSSSegmentedFontFace::Create( -+ FontSelectionCapabilities capabilities) { -+ return MakeGarbageCollected(capabilities); -+} -+ - CSSSegmentedFontFace::CSSSegmentedFontFace( - FontSelectionCapabilities font_selection_capabilities) - : font_selection_capabilities_(font_selection_capabilities), -+ font_data_table_(kFontDataTableMaxSize), - font_faces_(MakeGarbageCollected()), - approximate_character_count_(0) {} - - CSSSegmentedFontFace::~CSSSegmentedFontFace() = default; - -+void CSSSegmentedFontFace::PruneTable() { -+ // Make sure the glyph page tree prunes out all uses of this custom font. -+ if (!font_data_table_.size()) { -+ return; -+ } -+ -+ font_data_table_.Clear(); -+} -+ - bool CSSSegmentedFontFace::IsValid() const { - // Valid if at least one font face is valid. - return font_faces_->ForEachUntilTrue( -@@ -57,12 +83,12 @@ bool CSSSegmentedFontFace::IsValid() con - } - - void CSSSegmentedFontFace::FontFaceInvalidated() { -- font_data_table_.clear(); -+ PruneTable(); - } - - void CSSSegmentedFontFace::AddFontFace(FontFace* font_face, - bool css_connected) { -- font_data_table_.clear(); -+ PruneTable(); - font_face->CssFontFace()->AddSegmentedFontFace(this); - font_faces_->Insert(font_face, css_connected); - } -@@ -72,11 +98,11 @@ void CSSSegmentedFontFace::RemoveFontFac - return; - } - -- font_data_table_.clear(); -+ PruneTable(); - font_face->CssFontFace()->RemoveSegmentedFontFace(this); - } - --const FontData* CSSSegmentedFontFace::GetFontData( -+scoped_refptr CSSSegmentedFontFace::GetFontData( - const FontDescription& font_description) { - if (!IsValid()) { - return nullptr; -@@ -98,16 +124,16 @@ const FontData* CSSSegmentedFontFace::Ge - // usually only a small number of FontData/SegmentedFontData instances created - // per CSSSegmentedFontFace. Whereas in variable font animations, this number - // grows rapidly. -- auto it = font_data_table_.find(key); -+ auto it = font_data_table_.Get(key); - if (it != font_data_table_.end()) { -- const SegmentedFontData* cached_font_data = it->value.Get(); -+ scoped_refptr cached_font_data = it->second; - if (cached_font_data && cached_font_data->NumFaces()) { - return cached_font_data; - } - } - -- SegmentedFontData* created_font_data = -- MakeGarbageCollected(); -+ scoped_refptr created_font_data = -+ SegmentedFontData::Create(); - - FontDescription requested_font_description(font_description); - const FontSelectionRequest& font_selection_request = -@@ -126,16 +152,26 @@ const FontData* CSSSegmentedFontFace::Ge - if (!font_face->CssFontFace()->IsValid()) { - return; - } -- if (const SimpleFontData* face_font_data = -+ if (scoped_refptr face_font_data = - font_face->CssFontFace()->GetFontData(requested_font_description)) { - DCHECK(!face_font_data->IsSegmented()); -- created_font_data->AppendFace(MakeGarbageCollected( -- std::move(face_font_data), font_face->CssFontFace()->Ranges())); -+ if (face_font_data->IsCustomFont()) { -+ created_font_data->AppendFace(base::AdoptRef(new FontDataForRangeSet( -+ std::move(face_font_data), font_face->CssFontFace()->Ranges()))); -+ } else { -+ created_font_data->AppendFace( -+ base::AdoptRef(new FontDataForRangeSetFromCache( -+ std::move(face_font_data), -+ font_face->CssFontFace()->Ranges()))); -+ } - } - }); - - if (created_font_data->NumFaces()) { -- font_data_table_.insert(std::move(key), created_font_data); -+ scoped_refptr put_to_cache(created_font_data); -+ font_data_table_.Put(std::move(key), std::move(put_to_cache)); -+ // No release, we have a reference to an object in the cache which should -+ // retain the ref count it has. - return created_font_data; - } - -@@ -186,7 +222,6 @@ void CSSSegmentedFontFace::Match(const S - } - - void CSSSegmentedFontFace::Trace(Visitor* visitor) const { -- visitor->Trace(font_data_table_); - visitor->Trace(font_faces_); - } - ---- a/third_party/blink/renderer/core/css/css_segmented_font_face.h -+++ b/third_party/blink/renderer/core/css/css_segmented_font_face.h -@@ -32,7 +32,6 @@ - #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" - #include "third_party/blink/renderer/platform/fonts/font_selection_types.h" - #include "third_party/blink/renderer/platform/fonts/segmented_font_data.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" - #include "third_party/blink/renderer/platform/heap/garbage_collected.h" -@@ -84,6 +83,8 @@ class FontFaceList : public GarbageColle - class CSSSegmentedFontFace final - : public GarbageCollected { - public: -+ static CSSSegmentedFontFace* Create(FontSelectionCapabilities); -+ - explicit CSSSegmentedFontFace(FontSelectionCapabilities); - ~CSSSegmentedFontFace(); - -@@ -99,7 +100,7 @@ class CSSSegmentedFontFace final - void RemoveFontFace(FontFace*); - bool IsEmpty() const { return font_faces_->IsEmpty(); } - -- const FontData* GetFontData(const FontDescription&); -+ scoped_refptr GetFontData(const FontDescription&); - - bool CheckFont(UChar32) const; - void Match(const String&, HeapVector>*) const; -@@ -112,11 +113,12 @@ class CSSSegmentedFontFace final - void Trace(Visitor*) const; - - private: -+ void PruneTable(); - bool IsValid() const; - - FontSelectionCapabilities font_selection_capabilities_; - -- HeapHashMap> -+ base::HashingLRUCache> - font_data_table_; - - // All non-CSS-connected FontFaces are stored after the CSS-connected ones. ---- a/third_party/blink/renderer/core/css/font_face_cache.cc -+++ b/third_party/blink/renderer/core/css/font_face_cache.cc -@@ -85,8 +85,8 @@ void FontFaceCache::CapabilitiesSet::Add - const auto result = - map_.insert(font_face->GetFontSelectionCapabilities(), nullptr); - if (result.is_new_entry) { -- result.stored_value->value = MakeGarbageCollected( -- font_face->GetFontSelectionCapabilities()); -+ result.stored_value->value = -+ CSSSegmentedFontFace::Create(font_face->GetFontSelectionCapabilities()); - } - - result.stored_value->value->AddFontFace(font_face, css_connected); ---- a/third_party/blink/renderer/core/css/local_font_face_source.cc -+++ b/third_party/blink/renderer/core/css/local_font_face_source.cc -@@ -52,22 +52,23 @@ bool LocalFontFaceSource::IsLocalFontAva - return font_available; - } - --const SimpleFontData* LocalFontFaceSource::CreateLoadingFallbackFontData( -+scoped_refptr -+LocalFontFaceSource::CreateLoadingFallbackFontData( - const FontDescription& font_description) { - FontCachePurgePreventer font_cache_purge_preventer; -- const SimpleFontData* temporary_font = -- FontCache::Get().GetLastResortFallbackFont(font_description); -+ scoped_refptr temporary_font = -+ FontCache::Get().GetLastResortFallbackFont(font_description, -+ kDoNotRetain); - if (!temporary_font) { - NOTREACHED(); - return nullptr; - } -- CSSCustomFontData* css_font_data = MakeGarbageCollected( -- this, CSSCustomFontData::kVisibleFallback); -- return MakeGarbageCollected(&temporary_font->PlatformData(), -- css_font_data); -+ scoped_refptr css_font_data = -+ CSSCustomFontData::Create(this, CSSCustomFontData::kVisibleFallback); -+ return SimpleFontData::Create(temporary_font->PlatformData(), css_font_data); - } - --const SimpleFontData* LocalFontFaceSource::CreateFontData( -+scoped_refptr LocalFontFaceSource::CreateFontData( - const FontDescription& font_description, - const FontSelectionCapabilities&) { - if (!IsValid()) { -@@ -84,9 +85,9 @@ const SimpleFontData* LocalFontFaceSourc - } - - if (IsValid() && IsLoading()) { -- const SimpleFontData* fallback_font_data = -+ scoped_refptr fallback_font_data = - CreateLoadingFallbackFontData(font_description); -- ReportFontLookup(font_description, fallback_font_data, -+ ReportFontLookup(font_description, fallback_font_data.get(), - true /* is_loading_fallback */); - return fallback_font_data; - } -@@ -110,10 +111,10 @@ const SimpleFontData* LocalFontFaceSourc - #endif - // TODO(https://crbug.com/1302264): Enable passing down of font-palette - // information here (font_description.GetFontPalette()). -- const SimpleFontData* font_data = FontCache::Get().GetFontData( -+ scoped_refptr font_data = FontCache::Get().GetFontData( - unstyled_description, font_name_, AlternateFontName::kLocalUniqueFace); -- histograms_.Record(font_data); -- ReportFontLookup(unstyled_description, font_data); -+ histograms_.Record(font_data.get()); -+ ReportFontLookup(unstyled_description, font_data.get()); - return font_data; - } - -@@ -132,7 +133,7 @@ void LocalFontFaceSource::BeginLoadIfNee - } - - void LocalFontFaceSource::NotifyFontUniqueNameLookupReady() { -- ClearTable(); -+ PruneTable(); - - if (face_->FontLoaded(this)) { - font_selector_->FontFaceInvalidated( -@@ -168,7 +169,7 @@ void LocalFontFaceSource::Trace(Visitor* - - void LocalFontFaceSource::ReportFontLookup( - const FontDescription& font_description, -- const SimpleFontData* font_data, -+ SimpleFontData* font_data, - bool is_loading_fallback) { - font_selector_->ReportFontLookupByUniqueNameOnly( - font_name_, font_description, font_data, is_loading_fallback); ---- a/third_party/blink/renderer/core/css/local_font_face_source.h -+++ b/third_party/blink/renderer/core/css/local_font_face_source.h -@@ -48,15 +48,16 @@ class LocalFontFaceSource final : public - void NotifyFontUniqueNameLookupReady(); - - protected: -- const SimpleFontData* CreateLoadingFallbackFontData(const FontDescription&); -+ scoped_refptr CreateLoadingFallbackFontData( -+ const FontDescription&); - - private: -- const SimpleFontData* CreateFontData( -+ scoped_refptr CreateFontData( - const FontDescription&, - const FontSelectionCapabilities&) override; - - void ReportFontLookup(const FontDescription& font_description, -- const SimpleFontData* font_data, -+ SimpleFontData* font_data, - bool is_loading_fallback = false) override; - - class LocalFontHistograms { ---- a/third_party/blink/renderer/core/css/offscreen_font_selector.cc -+++ b/third_party/blink/renderer/core/css/offscreen_font_selector.cc -@@ -39,7 +39,7 @@ void OffscreenFontSelector::RegisterForI - void OffscreenFontSelector::UnregisterForInvalidationCallbacks( - FontSelectorClient* client) {} - --const FontData* OffscreenFontSelector::GetFontData( -+scoped_refptr OffscreenFontSelector::GetFontData( - const FontDescription& font_description, - const FontFamily& font_family) { - const auto& family_name = font_family.FamilyName(); -@@ -60,11 +60,11 @@ const FontData* OffscreenFontSelector::G - family_name, font_description.GetScript(), - font_description.GenericFamily(), settings_family_name); - -- const auto* font_data = -+ auto font_data = - FontCache::Get().GetFontData(font_description, settings_family_name); - - ReportFontLookupByUniqueOrFamilyName(settings_family_name, font_description, -- font_data); -+ font_data.get()); - - return font_data; - } ---- a/third_party/blink/renderer/core/css/offscreen_font_selector.h -+++ b/third_party/blink/renderer/core/css/offscreen_font_selector.h -@@ -26,8 +26,8 @@ class CORE_EXPORT OffscreenFontSelector - - unsigned Version() const override { return 1; } - -- const FontData* GetFontData(const FontDescription&, -- const FontFamily&) override; -+ scoped_refptr GetFontData(const FontDescription&, -+ const FontFamily&) override; - - void RegisterForInvalidationCallbacks(FontSelectorClient*) override; - void UnregisterForInvalidationCallbacks(FontSelectorClient*) override; ---- a/third_party/blink/renderer/core/css/remote_font_face_source.cc -+++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc -@@ -240,7 +240,8 @@ void RemoteFontFaceSource::NotifyFinishe - } - - ClearResource(); -- ClearTable(); -+ -+ PruneTable(); - - if (GetDocument()) { - if (!GetDocument()->RenderingHasBegun()) { -@@ -305,7 +306,7 @@ bool RemoteFontFaceSource::UpdatePeriod( - // Invalidate the font if its fallback visibility has changed. - if (IsLoading() && period_ != new_period && - (period_ == kBlockPeriod || new_period == kBlockPeriod)) { -- ClearTable(); -+ PruneTable(); - if (face_->FallbackVisibilityChanged(this)) { - font_selector_->FontFaceInvalidated( - FontInvalidationReason::kGeneralInvalidation); -@@ -349,7 +350,7 @@ bool RemoteFontFaceSource::IsLowPriority - return is_intervention_triggered_; - } - --const SimpleFontData* RemoteFontFaceSource::CreateFontData( -+scoped_refptr RemoteFontFaceSource::CreateFontData( - const FontDescription& font_description, - const FontSelectionCapabilities& font_selection_capabilities) { - if (period_ == kFailurePeriod || !IsValid()) { -@@ -362,7 +363,7 @@ const SimpleFontData* RemoteFontFaceSour - - histograms_.RecordFallbackTime(); - -- return MakeGarbageCollected( -+ return SimpleFontData::Create( - custom_font_data_->GetFontPlatformData( - font_description.EffectiveFontSize(), - font_description.AdjustedSpecifiedSize(), -@@ -379,24 +380,25 @@ const SimpleFontData* RemoteFontFaceSour - : ResolvedFontFeatures(), - font_description.Orientation(), font_description.VariationSettings(), - font_description.GetFontPalette()), -- MakeGarbageCollected()); -+ CustomFontData::Create()); - } - --const SimpleFontData* RemoteFontFaceSource::CreateLoadingFallbackFontData( -+scoped_refptr -+RemoteFontFaceSource::CreateLoadingFallbackFontData( - const FontDescription& font_description) { - // This temporary font is not retained and should not be returned. - FontCachePurgePreventer font_cache_purge_preventer; -- const SimpleFontData* temporary_font = -- FontCache::Get().GetLastResortFallbackFont(font_description); -+ scoped_refptr temporary_font = -+ FontCache::Get().GetLastResortFallbackFont(font_description, -+ kDoNotRetain); - if (!temporary_font) { - DUMP_WILL_BE_NOTREACHED_NORETURN(); - return nullptr; - } -- CSSCustomFontData* css_font_data = MakeGarbageCollected( -+ scoped_refptr css_font_data = CSSCustomFontData::Create( - this, period_ == kBlockPeriod ? CSSCustomFontData::kInvisibleFallback - : CSSCustomFontData::kVisibleFallback); -- return MakeGarbageCollected(&temporary_font->PlatformData(), -- css_font_data); -+ return SimpleFontData::Create(temporary_font->PlatformData(), css_font_data); - } - - void RemoteFontFaceSource::BeginLoadIfNeeded() { ---- a/third_party/blink/renderer/core/css/remote_font_face_source.h -+++ b/third_party/blink/renderer/core/css/remote_font_face_source.h -@@ -66,10 +66,11 @@ class RemoteFontFaceSource final : publi - void Trace(Visitor*) const override; - - protected: -- const SimpleFontData* CreateFontData( -+ scoped_refptr CreateFontData( - const FontDescription&, - const FontSelectionCapabilities&) override; -- const SimpleFontData* CreateLoadingFallbackFontData(const FontDescription&); -+ scoped_refptr CreateLoadingFallbackFontData( -+ const FontDescription&); - - private: - // Periods of the Font Display Timeline. ---- a/third_party/blink/renderer/core/frame/font_matching_metrics.cc -+++ b/third_party/blink/renderer/core/frame/font_matching_metrics.cc -@@ -127,7 +127,7 @@ void FontMatchingMetrics::ReportLocalFon - } - - void FontMatchingMetrics::InsertFontHashIntoMap(IdentifiableTokenKey input_key, -- const SimpleFontData* font_data, -+ SimpleFontData* font_data, - TokenToTokenHashMap& hash_map) { - DCHECK(IdentifiabilityStudyShouldSampleFonts()); - if (hash_map.Contains(input_key)) { -@@ -160,7 +160,7 @@ FontMatchingMetrics::GetTokenBuilderWith - void FontMatchingMetrics::ReportFontLookupByUniqueOrFamilyName( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) { -+ SimpleFontData* resulting_font_data) { - Dactyloscoper::TraceFontLookup( - execution_context_, name, font_description, - Dactyloscoper::FontLookupType::kUniqueOrFamilyName); -@@ -184,7 +184,7 @@ void FontMatchingMetrics::ReportFontLook - void FontMatchingMetrics::ReportFontLookupByUniqueNameOnly( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data, -+ SimpleFontData* resulting_font_data, - bool is_loading_fallback) { - // We ignore lookups that result in loading fallbacks for now as they should - // only be temporary. -@@ -217,7 +217,7 @@ void FontMatchingMetrics::ReportFontLook - UChar32 fallback_character, - FontFallbackPriority fallback_priority, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) { -+ SimpleFontData* resulting_font_data) { - if (!IdentifiabilityStudySettings::Get()->ShouldSampleType( - IdentifiableSurface::Type::kLocalFontLookupByFallbackCharacter)) { - return; -@@ -236,7 +236,7 @@ void FontMatchingMetrics::ReportFontLook - - void FontMatchingMetrics::ReportLastResortFallbackFontLookup( - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) { -+ SimpleFontData* resulting_font_data) { - if (!IdentifiabilityStudySettings::Get()->ShouldSampleType( - IdentifiableSurface::Type::kLocalFontLookupAsLastResort)) { - return; -@@ -361,8 +361,7 @@ void FontMatchingMetrics::PublishAllMetr - PublishEmojiGlyphMetrics(); - } - --int64_t FontMatchingMetrics::GetHashForFontData( -- const SimpleFontData* font_data) { -+int64_t FontMatchingMetrics::GetHashForFontData(SimpleFontData* font_data) { - return font_data ? FontGlobalContext::Get() - .GetOrComputeTypefaceDigest(font_data->PlatformData()) - .ToUkmMetricValue() -@@ -370,7 +369,7 @@ int64_t FontMatchingMetrics::GetHashForF - } - - IdentifiableToken FontMatchingMetrics::GetPostScriptNameTokenForFontData( -- const SimpleFontData* font_data) { -+ SimpleFontData* font_data) { - DCHECK(font_data); - return FontGlobalContext::Get().GetOrComputePostScriptNameDigest( - font_data->PlatformData()); ---- a/third_party/blink/renderer/core/frame/font_matching_metrics.h -+++ b/third_party/blink/renderer/core/frame/font_matching_metrics.h -@@ -100,16 +100,15 @@ class FontMatchingMetrics { - void ReportFontLookupByUniqueOrFamilyName( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data); -+ SimpleFontData* resulting_font_data); - - // Reports a local font was looked up by a name and font description. This - // only includes lookups where the name is allowed to match PostScript names - // and full font names, but not family names. -- void ReportFontLookupByUniqueNameOnly( -- const AtomicString& name, -- const FontDescription& font_description, -- const SimpleFontData* resulting_font_data, -- bool is_loading_fallback = false); -+ void ReportFontLookupByUniqueNameOnly(const AtomicString& name, -+ const FontDescription& font_description, -+ SimpleFontData* resulting_font_data, -+ bool is_loading_fallback = false); - - // Reports a font was looked up by a fallback character, fallback priority, - // and a font description. -@@ -117,12 +116,12 @@ class FontMatchingMetrics { - UChar32 fallback_character, - FontFallbackPriority fallback_priority, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data); -+ SimpleFontData* resulting_font_data); - - // Reports a last-resort fallback font was looked up by a font description. - void ReportLastResortFallbackFontLookup( - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data); -+ SimpleFontData* resulting_font_data); - - // Reports a generic font family name was matched according to the script and - // the user's preferences to a font family name. -@@ -171,7 +170,7 @@ class FontMatchingMetrics { - // nullptr, then the typeface digest will also be saved with its PostScript - // name in |font_load_postscript_name_|. - void InsertFontHashIntoMap(IdentifiableTokenKey input_key, -- const SimpleFontData* font_data, -+ SimpleFontData* font_data, - TokenToTokenHashMap& hash_map); - - // Reports a local font's existence was looked up by a name, but its actual -@@ -194,14 +193,14 @@ class FontMatchingMetrics { - - // Get a hash that uniquely represents the font data. Returns 0 if |font_data| - // is nullptr. -- int64_t GetHashForFontData(const SimpleFontData* font_data); -+ int64_t GetHashForFontData(SimpleFontData* font_data); - - void Initialize(); - - // Get a token that uniquely represents the typeface's PostScript name. May - // represent the empty string if no PostScript name was found. - IdentifiableToken GetPostScriptNameTokenForFontData( -- const SimpleFontData* font_data); -+ SimpleFontData* font_data); - - TokenToTokenHashMap font_lookups_by_unique_or_family_name_; - TokenToTokenHashMap font_lookups_by_unique_name_only_; ---- a/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc -+++ b/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc -@@ -132,8 +132,8 @@ class PopupMenuCSSFontSelector : public - - // We don't override willUseFontData() for now because the old PopupListBox - // only worked with fonts loaded when opening the popup. -- const FontData* GetFontData(const FontDescription&, -- const FontFamily&) override; -+ scoped_refptr GetFontData(const FontDescription&, -+ const FontFamily&) override; - - void Trace(Visitor*) const override; - -@@ -152,7 +152,7 @@ PopupMenuCSSFontSelector::PopupMenuCSSFo - - PopupMenuCSSFontSelector::~PopupMenuCSSFontSelector() = default; - --const FontData* PopupMenuCSSFontSelector::GetFontData( -+scoped_refptr PopupMenuCSSFontSelector::GetFontData( - const FontDescription& description, - const FontFamily& font_family) { - return owner_font_selector_->GetFontData(description, font_family); ---- a/third_party/blink/renderer/core/inspector/inspector_css_agent.cc -+++ b/third_party/blink/renderer/core/inspector/inspector_css_agent.cc -@@ -122,7 +122,6 @@ - #include "third_party/blink/renderer/platform/fonts/font_custom_platform_data.h" - #include "third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h" - #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" --#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" - #include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/text/text_run.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -@@ -200,10 +199,10 @@ HeapVector> FilterD - } - - void CollectPlatformFontsFromRunFontDataList( -- const HeapVector& run_font_data_list, -+ const Vector& run_font_data_list, - HashMap, std::pair>* font_stats) { - for (const auto& run_font_data : run_font_data_list) { -- const auto* simple_font_data = run_font_data.font_data_.Get(); -+ const auto* simple_font_data = run_font_data.font_data_; - String family_name = simple_font_data->PlatformData().FontFamilyName(); - if (family_name.IsNull()) - family_name = ""; -@@ -1733,8 +1732,7 @@ void InspectorCSSAgent::CollectPlatformF - if (!shape_result) { - continue; - } -- HeapVector run_font_data_list; -- ClearCollectionScope clear_scope(&run_font_data_list); -+ Vector run_font_data_list; - shape_result->GetRunFontData(&run_font_data_list); - CollectPlatformFontsFromRunFontDataList(run_font_data_list, font_stats); - } ---- a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc -+++ b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc -@@ -19,7 +19,6 @@ - #include "third_party/blink/renderer/core/style/computed_style.h" - #include "third_party/blink/renderer/core/svg/svg_length_functions.h" - #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" --#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" - - namespace blink { - -@@ -174,8 +173,7 @@ void InlineBoxState::EnsureTextMetrics(c - - void InlineBoxState::AccumulateUsedFonts(const ShapeResultView* shape_result) { - const auto baseline_type = style->GetFontBaseline(); -- HeapHashSet> fallback_fonts; -- ClearCollectionScope clear_scope(&fallback_fonts); -+ HashSet fallback_fonts; - shape_result->FallbackFonts(&fallback_fonts); - for (const SimpleFontData* const fallback_font : fallback_fonts) { - FontHeight fallback_metrics = ---- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc -+++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc -@@ -17,7 +17,6 @@ - #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" - #include "third_party/blink/renderer/core/layout/physical_box_fragment.h" - #include "third_party/blink/renderer/platform/fonts/font_height.h" --#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" - - namespace blink { - -@@ -38,10 +37,11 @@ std::tuple Adjus - primary_font_data->GetFontMetrics().FixedAscent(font_baseline); - const LayoutUnit primary_descent = line_height - primary_ascent; - -+ DCHECK(IsMainThread()); -+ DEFINE_STATIC_LOCAL(Vector, run_fonts, ()); -+ DCHECK_EQ(run_fonts.size(), 0u); - // We don't use ShapeResultView::FallbackFonts() because we can't know if the - // primary font is actually used with FallbackFonts(). -- HeapVector run_fonts; -- ClearCollectionScope clear_scope(&run_fonts); - shape_view.GetRunFontData(&run_fonts); - const LayoutUnit kNoDiff = LayoutUnit::Max(); - LayoutUnit over_diff = kNoDiff; -@@ -65,6 +65,7 @@ std::tuple Adjus - over_diff = std::min(over_diff, current_over_diff); - under_diff = std::min(under_diff, current_under_diff); - } -+ run_fonts.resize(0); - if (over_diff == kNoDiff) - over_diff = LayoutUnit(); - if (under_diff == kNoDiff) -@@ -85,8 +86,7 @@ FontHeight ComputeEmHeight(const Logical - FontHeight result_height; - // We don't use ShapeResultView::FallbackFonts() because we can't know if - // the primary font is actually used with FallbackFonts(). -- HeapVector run_fonts; -- ClearCollectionScope clear_scope(&run_fonts); -+ Vector run_fonts; - shape_result_view->GetRunFontData(&run_fonts); - for (const auto& run_font : run_fonts) { - const SimpleFontData* font_data = run_font.font_data_; ---- a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc -+++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc -@@ -16,7 +16,6 @@ - #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" - #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" - #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" --#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" - - namespace blink { - -@@ -36,8 +35,7 @@ void GetFontsUsedByFragment(const Physic - shape_result_view->PrimaryFont()->PlatformData().FontFamilyName(); - if (!font_family.empty()) - result.font_names.insert(font_family); -- HeapHashSet> fallback_font_data; -- ClearCollectionScope clear_scope(&fallback_font_data); -+ HashSet fallback_font_data; - shape_result_view->FallbackFonts(&fallback_font_data); - for (const SimpleFontData* font_data : fallback_font_data) { - result.font_names.insert(font_data->PlatformData().FontFamilyName()); ---- a/third_party/blink/renderer/modules/font_access/font_metadata.cc -+++ b/third_party/blink/renderer/modules/font_access/font_metadata.cc -@@ -75,7 +75,7 @@ void FontMetadata::BlobImpl(ScriptPromis - SetUpFontUniqueLookupIfNecessary(); - - FontDescription description; -- const SimpleFontData* font_data = -+ scoped_refptr font_data = - FontCache::Get().GetFontData(description, AtomicString(postscriptName), - AlternateFontName::kLocalUniqueFace); - if (!font_data) { ---- a/third_party/blink/renderer/platform/BUILD.gn -+++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -634,6 +634,7 @@ component("platform") { - "fonts/font_cache_memory_dump_provider.h", - "fonts/font_custom_platform_data.cc", - "fonts/font_custom_platform_data.h", -+ "fonts/font_data.cc", - "fonts/font_data.h", - "fonts/font_data_cache.cc", - "fonts/font_data_cache.h", ---- a/third_party/blink/renderer/platform/fonts/android/font_cache_android.cc -+++ b/third_party/blink/renderer/platform/fonts/android/font_cache_android.cc -@@ -127,7 +127,7 @@ sk_sp FontCache::CreateLocal - return nullptr; - } - --const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( -+scoped_refptr FontCache::PlatformFallbackFontForCharacter( - const FontDescription& font_description, - UChar32 c, - const SimpleFontData*, -@@ -158,7 +158,7 @@ const SimpleFontData* FontCache::Platfor - if (fallback_priority == FontFallbackPriority::kEmojiEmoji && - base::FeatureList::IsEnabled(features::kGMSCoreEmoji)) { - auto skia_fallback_is_noto_color_emoji = [&]() { -- const FontPlatformData* skia_fallback_result = GetFontPlatformData( -+ FontPlatformData* skia_fallback_result = GetFontPlatformData( - font_description, FontFaceCreationParams(family_name)); - - // Determining the PostScript name is required as Skia on Android gives -@@ -175,14 +175,15 @@ const SimpleFontData* FontCache::Platfor - }; - - if (family_name.empty() || skia_fallback_is_noto_color_emoji()) { -- const FontPlatformData* emoji_gms_core_font = GetFontPlatformData( -+ FontPlatformData* emoji_gms_core_font = GetFontPlatformData( - font_description, - FontFaceCreationParams(AtomicString(kNotoColorEmojiCompat))); - if (emoji_gms_core_font) { - SkTypeface* probe_coverage_typeface = emoji_gms_core_font->Typeface(); - if (probe_coverage_typeface && - probe_coverage_typeface->unicharToGlyph(c)) { -- return FontDataFromFontPlatformData(emoji_gms_core_font); -+ return FontDataFromFontPlatformData(emoji_gms_core_font, -+ kDoNotRetain); - } - } - } -@@ -192,10 +193,12 @@ const SimpleFontData* FontCache::Platfor - // font was not found or an OEM emoji font was not to be overridden. - - if (family_name.empty()) -- return GetLastResortFallbackFont(font_description); -+ return GetLastResortFallbackFont(font_description, kDoNotRetain); - -- return FontDataFromFontPlatformData(GetFontPlatformData( -- font_description, FontFaceCreationParams(family_name))); -+ return FontDataFromFontPlatformData( -+ GetFontPlatformData(font_description, -+ FontFaceCreationParams(family_name)), -+ kDoNotRetain); - } - - // static ---- a/third_party/blink/renderer/platform/fonts/custom_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h -@@ -22,8 +22,8 @@ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_CUSTOM_FONT_DATA_H_ - - #include "base/memory/scoped_refptr.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/platform_export.h" -+#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" - - namespace blink { - -@@ -34,17 +34,22 @@ namespace blink { - // * `BinaryDataFontFaceSource` as loaded font resource - // * `LocalFontFaceSource` as derived class `CSSCustomFontData` - // * `RemoteFontFaceSource` as derived class `CSSCustomFontData` --class PLATFORM_EXPORT CustomFontData : public GarbageCollected { -+class PLATFORM_EXPORT CustomFontData : public RefCounted { - public: -- CustomFontData() = default; -+ static scoped_refptr Create() { -+ return base::AdoptRef(new CustomFontData()); -+ } -+ - virtual ~CustomFontData() = default; -- virtual void Trace(Visitor*) const {} - - virtual void BeginLoadIfNeeded() const {} - virtual bool IsLoading() const { return false; } - virtual bool IsLoadingFallback() const { return false; } - virtual bool ShouldSkipDrawing() const { return false; } - virtual bool IsPendingDataUrl() const { return false; } -+ -+ protected: -+ CustomFontData() = default; - }; - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_cache.cc -+++ b/third_party/blink/renderer/platform/fonts/font_cache.cc -@@ -87,7 +87,10 @@ FontCache& FontCache::Get() { - return FontGlobalContext::GetFontCache(); - } - --FontCache::FontCache() : font_manager_(sk_ref_sp(static_font_manager_)) { -+FontCache::FontCache() -+ : font_manager_(sk_ref_sp(static_font_manager_)), -+ font_platform_data_cache_(FontPlatformDataCache::Create()), -+ font_data_cache_(FontDataCache::Create()) { - #if BUILDFLAG(IS_WIN) - if (!font_manager_ || should_use_test_font_mgr) { - // This code path is only for unit tests. This SkFontMgr does not work in -@@ -113,14 +116,12 @@ FontCache::~FontCache() = default; - - void FontCache::Trace(Visitor* visitor) const { - visitor->Trace(font_cache_clients_); -- visitor->Trace(font_platform_data_cache_); -- visitor->Trace(fallback_list_shaper_cache_); -- visitor->Trace(font_data_cache_); - visitor->Trace(font_fallback_map_); -+ visitor->Trace(fallback_list_shaper_cache_); - } - - #if !BUILDFLAG(IS_MAC) --const FontPlatformData* FontCache::SystemFontPlatformData( -+FontPlatformData* FontCache::SystemFontPlatformData( - const FontDescription& font_description) { - const AtomicString& family = FontCache::SystemFontFamily(); - #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \ -@@ -135,7 +136,7 @@ const FontPlatformData* FontCache::Syste - } - #endif - --const FontPlatformData* FontCache::GetFontPlatformData( -+FontPlatformData* FontCache::GetFontPlatformData( - const FontDescription& font_description, - const FontFaceCreationParams& creation_params, - AlternateFontName alternate_font_name) { -@@ -153,7 +154,7 @@ const FontPlatformData* FontCache::GetFo - } - #endif - -- return font_platform_data_cache_.GetOrCreateFontPlatformData( -+ return font_platform_data_cache_->GetOrCreateFontPlatformData( - this, font_description, creation_params, alternate_font_name); - } - -@@ -175,26 +176,34 @@ void FontCache::AcceptLanguagesChanged(c - Get().InvalidateShapeCache(); - } - --const SimpleFontData* FontCache::GetFontData( -+scoped_refptr FontCache::GetFontData( - const FontDescription& font_description, - const AtomicString& family, -- AlternateFontName altername_font_name) { -- if (const FontPlatformData* platform_data = GetFontPlatformData( -+ AlternateFontName altername_font_name, -+ ShouldRetain should_retain) { -+ if (FontPlatformData* platform_data = GetFontPlatformData( - font_description, - FontFaceCreationParams( - AdjustFamilyNameToAvoidUnsupportedFonts(family)), - altername_font_name)) { - return FontDataFromFontPlatformData( -- platform_data, font_description.SubpixelAscentDescent()); -+ platform_data, should_retain, font_description.SubpixelAscentDescent()); - } - - return nullptr; - } - --const SimpleFontData* FontCache::FontDataFromFontPlatformData( -+scoped_refptr FontCache::FontDataFromFontPlatformData( - const FontPlatformData* platform_data, -+ ShouldRetain should_retain, - bool subpixel_ascent_descent) { -- return font_data_cache_.Get(platform_data, subpixel_ascent_descent); -+#if DCHECK_IS_ON() -+ if (should_retain == kDoNotRetain) -+ DCHECK(purge_prevent_count_); -+#endif -+ -+ return font_data_cache_->Get(platform_data, should_retain, -+ subpixel_ascent_descent); - } - - bool FontCache::IsPlatformFamilyMatchAvailable( -@@ -223,7 +232,15 @@ String FontCache::FirstAvailableOrFirst( - gfx::FontList::FirstAvailableOrFirst(families.Utf8().c_str())); - } - --const SimpleFontData* FontCache::FallbackFontForCharacter( -+SimpleFontData* FontCache::GetNonRetainedLastResortFallbackFont( -+ const FontDescription& font_description) { -+ auto font = GetLastResortFallbackFont(font_description, kDoNotRetain); -+ if (font) -+ font->AddRef(); -+ return font.get(); -+} -+ -+scoped_refptr FontCache::FallbackFontForCharacter( - const FontDescription& description, - UChar32 lookup_char, - const SimpleFontData* font_data_to_substitute, -@@ -240,12 +257,21 @@ const SimpleFontData* FontCache::Fallbac - Character::IsNonCharacter(lookup_char)) - return nullptr; - base::ElapsedTimer timer; -- const SimpleFontData* result = PlatformFallbackFontForCharacter( -+ scoped_refptr result = PlatformFallbackFontForCharacter( - description, lookup_char, font_data_to_substitute, fallback_priority); - FontPerformance::AddSystemFallbackFontTime(timer.Elapsed()); - return result; - } - -+void FontCache::ReleaseFontData(const SimpleFontData* font_data) { -+ font_data_cache_->Release(font_data); -+} -+ -+void FontCache::PurgePlatformFontDataCache() { -+ TRACE_EVENT0("fonts,ui", "FontCache::PurgePlatformFontDataCache"); -+ font_platform_data_cache_->Purge(*font_data_cache_); -+} -+ - void FontCache::PurgeFallbackListShaperCache() { - TRACE_EVENT0("fonts,ui", "FontCache::PurgeFallbackListShaperCache"); - for (auto& shape_cache : fallback_list_shaper_cache_.Values()) { -@@ -257,13 +283,17 @@ void FontCache::InvalidateShapeCache() { - PurgeFallbackListShaperCache(); - } - --void FontCache::Purge() { -+void FontCache::Purge(PurgeSeverity purge_severity) { - // Ideally we should never be forcing the purge while the - // FontCachePurgePreventer is in scope, but we call purge() at any timing - // via MemoryPressureListenerRegistry. - if (purge_prevent_count_) - return; - -+ if (!font_data_cache_->Purge(purge_severity)) -+ return; -+ -+ PurgePlatformFontDataCache(); - PurgeFallbackListShaperCache(); - } - -@@ -279,15 +309,14 @@ uint16_t FontCache::Generation() { - - void FontCache::Invalidate() { - TRACE_EVENT0("fonts,ui", "FontCache::Invalidate"); -- font_platform_data_cache_.Clear(); -- font_data_cache_.Clear(); -+ font_platform_data_cache_->Clear(); - generation_++; - - for (const auto& client : font_cache_clients_) { - client->FontCacheInvalidated(); - } - -- Purge(); -+ Purge(kForcePurge); - } - - void FontCache::CrashWithFontInfo(const FontDescription* font_description) { -@@ -320,6 +349,16 @@ void FontCache::CrashWithFontInfo(const - CHECK(false); - } - -+void FontCache::DumpFontPlatformDataCache( -+ base::trace_event::ProcessMemoryDump* memory_dump) { -+ DCHECK(IsMainThread()); -+ base::trace_event::MemoryAllocatorDump* dump = -+ memory_dump->CreateAllocatorDump("font_caches/font_platform_data_cache"); -+ dump->AddScalar("size", "bytes", font_platform_data_cache_->ByteSize()); -+ memory_dump->AddSuballocation(dump->guid(), -+ WTF::Partitions::kAllocatedObjectPoolName); -+} -+ - void FontCache::DumpShapeResultCache( - base::trace_event::ProcessMemoryDump* memory_dump) { - DCHECK(IsMainThread()); ---- a/third_party/blink/renderer/platform/fonts/font_cache.h -+++ b/third_party/blink/renderer/platform/fonts/font_cache.h -@@ -36,13 +36,13 @@ - #include - - #include "base/gtest_prod_util.h" -+#include "base/memory/scoped_refptr.h" - #include "build/build_config.h" - #include "third_party/blink/renderer/platform/fonts/fallback_list_composite_key.h" - #include "third_party/blink/renderer/platform/fonts/font_cache_client.h" - #include "third_party/blink/renderer/platform/fonts/font_data_cache.h" - #include "third_party/blink/renderer/platform/fonts/font_face_creation_params.h" - #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" --#include "third_party/blink/renderer/platform/fonts/font_platform_data_cache.h" - #include "third_party/blink/renderer/platform/fonts/shaping/shape_cache.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" - #include "third_party/blink/renderer/platform/platform_export.h" -@@ -75,6 +75,7 @@ class FontFaceCreationParams; - class FontFallbackMap; - class FontGlobalContext; - class FontPlatformData; -+class FontPlatformDataCache; - class SimpleFontData; - class WebFontPrewarmer; - -@@ -106,7 +107,9 @@ class PLATFORM_EXPORT FontCache final { - - void Trace(Visitor*) const; - -- const SimpleFontData* FallbackFontForCharacter( -+ void ReleaseFontData(const SimpleFontData*); -+ -+ scoped_refptr FallbackFontForCharacter( - const FontDescription&, - UChar32, - const SimpleFontData* font_data_to_substitute, -@@ -115,11 +118,14 @@ class PLATFORM_EXPORT FontCache final { - // Also implemented by the platform. - void PlatformInit(); - -- const SimpleFontData* GetFontData( -+ scoped_refptr GetFontData( - const FontDescription&, - const AtomicString&, -- AlternateFontName = AlternateFontName::kAllowAlternate); -- const SimpleFontData* GetLastResortFallbackFont(const FontDescription&); -+ AlternateFontName = AlternateFontName::kAllowAlternate, -+ ShouldRetain = kRetain); -+ scoped_refptr GetLastResortFallbackFont(const FontDescription&, -+ ShouldRetain = kRetain); -+ SimpleFontData* GetNonRetainedLastResortFallbackFont(const FontDescription&); - - // Should be used in determining whether family names listed in font-family: - // ... are available locally. Only returns true if family name matches. -@@ -212,12 +218,12 @@ class PLATFORM_EXPORT FontCache final { - return *status_font_family_name_; - } - -- const SimpleFontData* GetFallbackFamilyNameFromHardcodedChoices( -+ scoped_refptr GetFallbackFamilyNameFromHardcodedChoices( - const FontDescription&, - UChar32 codepoint, - FontFallbackPriority fallback_priority); - -- const SimpleFontData* GetDWriteFallbackFamily( -+ scoped_refptr GetDWriteFallbackFamily( - const FontDescription&, - UChar32 codepoint, - FontFallbackPriority fallback_priority); -@@ -245,8 +251,9 @@ class PLATFORM_EXPORT FontCache final { - gfx::FallbackFontData*); - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - -- const SimpleFontData* FontDataFromFontPlatformData( -+ scoped_refptr FontDataFromFontPlatformData( - const FontPlatformData*, -+ ShouldRetain = kRetain, - bool subpixel_ascent_descent = false); - - void InvalidateShapeCache(); -@@ -254,6 +261,7 @@ class PLATFORM_EXPORT FontCache final { - static void CrashWithFontInfo(const FontDescription*); - - // Memory reporting -+ void DumpFontPlatformDataCache(base::trace_event::ProcessMemoryDump*); - void DumpShapeResultCache(base::trace_event::ProcessMemoryDump*); - - FontFallbackMap& GetFontFallbackMap(); -@@ -268,7 +276,7 @@ class PLATFORM_EXPORT FontCache final { - // elements. - using Bcp47Vector = WTF::Vector; - -- const SimpleFontData* PlatformFallbackFontForCharacter( -+ scoped_refptr PlatformFallbackFontForCharacter( - const FontDescription&, - UChar32, - const SimpleFontData* font_data_to_substitute, -@@ -283,26 +291,26 @@ class PLATFORM_EXPORT FontCache final { - friend class FontGlobalContext; - FontCache(); - -- void Purge(); -+ void Purge(PurgeSeverity = kPurgeIfNeeded); - - void DisablePurging() { purge_prevent_count_++; } - void EnablePurging() { - DCHECK(purge_prevent_count_); - if (!--purge_prevent_count_) -- Purge(); -+ Purge(kPurgeIfNeeded); - } - - // FIXME: This method should eventually be removed. -- const FontPlatformData* GetFontPlatformData( -+ FontPlatformData* GetFontPlatformData( - const FontDescription&, - const FontFaceCreationParams&, - AlternateFontName = AlternateFontName::kAllowAlternate); - #if !BUILDFLAG(IS_MAC) -- const FontPlatformData* SystemFontPlatformData(const FontDescription&); -+ FontPlatformData* SystemFontPlatformData(const FontDescription&); - #endif // !BUILDFLAG(IS_MAC) - - // These methods are implemented by each platform. -- const FontPlatformData* CreateFontPlatformData( -+ std::unique_ptr CreateFontPlatformData( - const FontDescription&, - const FontFaceCreationParams&, - float font_size, -@@ -321,8 +329,9 @@ class PLATFORM_EXPORT FontCache final { - #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || - // BUILDFLAG(IS_CHROMEOS) - -- const SimpleFontData* FallbackOnStandardFontStyle(const FontDescription&, -- UChar32); -+ scoped_refptr FallbackOnStandardFontStyle( -+ const FontDescription&, -+ UChar32); - - // Don't purge if this count is > 0; - int purge_prevent_count_ = 0; -@@ -356,16 +365,17 @@ class PLATFORM_EXPORT FontCache final { - uint16_t generation_ = 0; - bool platform_init_ = false; - HeapHashSet> font_cache_clients_; -- FontPlatformDataCache font_platform_data_cache_; -+ std::unique_ptr font_platform_data_cache_; - HeapHashMap, - FallbackListCompositeKeyTraits> - fallback_list_shaper_cache_; - -- FontDataCache font_data_cache_; -+ std::unique_ptr font_data_cache_; - - Member font_fallback_map_; - -+ void PurgePlatformFontDataCache(); - void PurgeFallbackListShaperCache(); - - friend class SimpleFontData; // For fontDataFromFontPlatformData ---- a/third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.cc -+++ b/third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.cc -@@ -21,6 +21,7 @@ bool FontCacheMemoryDumpProvider::OnMemo - DCHECK(IsMainThread()); - if (auto* context = FontGlobalContext::TryGet()) { - FontCache& cache = context->GetFontCache(); -+ cache.DumpFontPlatformDataCache(memory_dump); - cache.DumpShapeResultCache(memory_dump); - } - return true; ---- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc -+++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc -@@ -103,7 +103,7 @@ FontCustomPlatformData::~FontCustomPlatf - } - } - --const FontPlatformData* FontCustomPlatformData::GetFontPlatformData( -+FontPlatformData FontCustomPlatformData::GetFontPlatformData( - float size, - float adjusted_specified_size, - bool bold, -@@ -276,11 +276,10 @@ const FontPlatformData* FontCustomPlatfo - return_typeface = palette_typeface; - } - } -- return MakeGarbageCollected( -- std::move(return_typeface), std::string(), size, -- synthetic_bold && !base_typeface_->isBold(), -- synthetic_italic && !base_typeface_->isItalic(), text_rendering, -- resolved_font_features, orientation); -+ return FontPlatformData(std::move(return_typeface), std::string(), size, -+ synthetic_bold && !base_typeface_->isBold(), -+ synthetic_italic && !base_typeface_->isItalic(), -+ text_rendering, resolved_font_features, orientation); - } - - Vector FontCustomPlatformData::GetVariationAxes() const { ---- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h -+++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h -@@ -68,7 +68,7 @@ class PLATFORM_EXPORT FontCustomPlatform - // adjusted_specified_size should come from AdjustedSpecifiedSize() of - // FontDescription. The latter is needed for correctly applying - // font-optical-sizing: auto; independent of zoom level. -- const FontPlatformData* GetFontPlatformData( -+ FontPlatformData GetFontPlatformData( - float size, - float adjusted_specified_size, - bool bold, ---- /dev/null -+++ b/third_party/blink/renderer/platform/fonts/font_data.cc -@@ -0,0 +1,32 @@ -+/* -+ * Copyright (C) 2008 Apple Inc. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include "third_party/blink/renderer/platform/fonts/font_data.h" -+ -+namespace blink { -+ -+FontData::~FontData() = default; -+ -+} // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_data.h -+++ b/third_party/blink/renderer/platform/fonts/font_data.h -@@ -27,24 +27,23 @@ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_H_ - - #include "base/memory/scoped_refptr.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/forward.h" - #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" -+#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" - - namespace blink { - - class SimpleFontData; - --class PLATFORM_EXPORT FontData : public GarbageCollected { -+class PLATFORM_EXPORT FontData : public RefCounted { - public: - FontData() = default; - FontData(const FontData&) = delete; - FontData& operator=(const FontData&) = delete; -- virtual ~FontData() = default; - -- virtual void Trace(Visitor*) const {} -+ virtual ~FontData(); - - virtual const SimpleFontData* FontDataForCharacter(UChar32) const = 0; - virtual bool IsCustomFont() const = 0; ---- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc -+++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc -@@ -36,8 +36,23 @@ - - namespace blink { - --const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, -- bool subpixel_ascent_descent) { -+#if !BUILDFLAG(IS_ANDROID) -+const unsigned kCMaxInactiveFontData = 250; -+const unsigned kCTargetInactiveFontData = 200; -+#else -+const unsigned kCMaxInactiveFontData = 225; -+const unsigned kCTargetInactiveFontData = 200; -+#endif -+ -+// static -+std::unique_ptr FontDataCache::Create() { -+ return std::make_unique(); -+} -+ -+scoped_refptr FontDataCache::Get( -+ const FontPlatformData* platform_data, -+ ShouldRetain should_retain, -+ bool subpixel_ascent_descent) { - if (!platform_data) - return nullptr; - -@@ -50,12 +65,98 @@ const SimpleFontData* FontDataCache::Get - return nullptr; - } - -- auto add_result = cache_.insert(platform_data, nullptr); -- if (add_result.is_new_entry) { -- add_result.stored_value->value = MakeGarbageCollected( -- platform_data, nullptr, subpixel_ascent_descent); -+ Cache::iterator result = cache_.find(platform_data); -+ if (result == cache_.end()) { -+ std::pair, unsigned> new_value( -+ SimpleFontData::Create(*platform_data, nullptr, -+ subpixel_ascent_descent), -+ should_retain == kRetain ? 1 : 0); -+ // The new SimpleFontData takes a copy of the incoming FontPlatformData -+ // object. The incoming key may be temporary. So, for cache storage, take -+ // the address of the newly created FontPlatformData that is copied an owned -+ // by SimpleFontData. -+ cache_.Set(&new_value.first->PlatformData(), new_value); -+ if (should_retain == kDoNotRetain) -+ inactive_font_data_.insert(new_value.first); -+ return std::move(new_value.first); -+ } -+ -+ if (!result.Get()->value.second) { -+ DCHECK(inactive_font_data_.Contains(result.Get()->value.first)); -+ inactive_font_data_.erase(result.Get()->value.first); -+ } -+ -+ if (should_retain == kRetain) { -+ result.Get()->value.second++; -+ } else if (!result.Get()->value.second) { -+ // If shouldRetain is DoNotRetain and count is 0, we want to remove the -+ // fontData from m_inactiveFontData (above) and re-add here to update LRU -+ // position. -+ inactive_font_data_.insert(result.Get()->value.first); -+ } -+ -+ return result.Get()->value.first; -+} -+ -+bool FontDataCache::Contains(const FontPlatformData* font_platform_data) const { -+ return cache_.Contains(font_platform_data); -+} -+ -+void FontDataCache::Release(const SimpleFontData* font_data) { -+ DCHECK(!font_data->IsCustomFont()); -+ -+ Cache::iterator it = cache_.find(&(font_data->PlatformData())); -+ if (it == cache_.end()) -+ return; -+ -+ DCHECK(it->value.second); -+ if (!--it->value.second) -+ inactive_font_data_.insert(it->value.first); -+} -+ -+bool FontDataCache::Purge(PurgeSeverity purge_severity) { -+ if (purge_severity == kForcePurge) -+ return PurgeLeastRecentlyUsed(INT_MAX); -+ -+ if (inactive_font_data_.size() > kCMaxInactiveFontData) -+ return PurgeLeastRecentlyUsed(inactive_font_data_.size() - -+ kCTargetInactiveFontData); -+ -+ return false; -+} -+ -+bool FontDataCache::PurgeLeastRecentlyUsed(int count) { -+ // Guard against reentry when e.g. a deleted FontData releases its small caps -+ // FontData. -+ if (is_purging_) -+ return false; -+ -+ base::AutoReset is_purging_auto_reset(&is_purging_, true); -+ -+ Vector, 20> font_data_to_delete; -+ auto end = inactive_font_data_.end(); -+ auto it = inactive_font_data_.begin(); -+ for (int i = 0; i < count && it != end; ++it, ++i) { -+ const scoped_refptr& font_data = *it; -+ cache_.erase(&(font_data->PlatformData())); -+ // We should not delete SimpleFontData here because deletion can modify -+ // m_inactiveFontData. See http://trac.webkit.org/changeset/44011 -+ font_data_to_delete.push_back(font_data); -+ } -+ -+ if (it == end) { -+ // Removed everything -+ inactive_font_data_.clear(); -+ } else { -+ for (int i = 0; i < count; ++i) -+ inactive_font_data_.erase(inactive_font_data_.begin()); - } -- return add_result.stored_value->value; -+ -+ bool did_work = font_data_to_delete.size(); -+ -+ font_data_to_delete.clear(); -+ -+ return did_work; - } - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_data_cache.h -+++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h -@@ -33,10 +33,14 @@ - - #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" - #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" -+#include "third_party/blink/renderer/platform/wtf/hash_map.h" -+#include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" - - namespace blink { - -+enum ShouldRetain { kRetain, kDoNotRetain }; -+enum PurgeSeverity { kPurgeIfNeeded, kForcePurge }; -+ - struct FontDataCacheKeyHashTraits : GenericHashTraits { - STATIC_ONLY(FontDataCacheKeyHashTraits); - static unsigned GetHash(const FontPlatformData* platform_data) { -@@ -51,24 +55,36 @@ struct FontDataCacheKeyHashTraits : Gene - }; - - class FontDataCache final { -- DISALLOW_NEW(); -+ USING_FAST_MALLOC(FontDataCache); - - public: -+ static std::unique_ptr Create(); -+ - FontDataCache() = default; - FontDataCache(const FontDataCache&) = delete; - FontDataCache& operator=(const FontDataCache&) = delete; - -- void Trace(Visitor* visitor) const { visitor->Trace(cache_); } -- -- const SimpleFontData* Get(const FontPlatformData*, -- bool subpixel_ascent_descent = false); -- void Clear() { cache_.clear(); } -+ scoped_refptr Get(const FontPlatformData*, -+ ShouldRetain = kRetain, -+ bool subpixel_ascent_descent = false); -+ bool Contains(const FontPlatformData*) const; -+ void Release(const SimpleFontData*); -+ -+ // Purges items in FontDataCache according to provided severity. -+ // Returns true if any removal of cache items actually occurred. -+ bool Purge(PurgeSeverity); - - private: -- HeapHashMap, -- WeakMember, -- FontDataCacheKeyHashTraits> -- cache_; -+ bool PurgeLeastRecentlyUsed(int count); -+ -+ typedef HashMap, unsigned>, -+ FontDataCacheKeyHashTraits> -+ Cache; -+ -+ Cache cache_; -+ LinkedHashSet> inactive_font_data_; -+ bool is_purging_ = false; - }; - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.cc -+++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.cc -@@ -13,4 +13,10 @@ FontDataForRangeSet::FontDataForRangeSet - range_set_ = other.range_set_; - } - -+FontDataForRangeSetFromCache::~FontDataForRangeSetFromCache() { -+ if (font_data_ && !font_data_->IsCustomFont()) { -+ FontCache::Get().ReleaseFontData(font_data_.get()); -+ } -+} -+ - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h -+++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h -@@ -37,19 +37,17 @@ namespace blink { - class SimpleFontData; - - class PLATFORM_EXPORT FontDataForRangeSet -- : public GarbageCollected { -+ : public RefCounted { - public: - explicit FontDataForRangeSet( -- const SimpleFontData* font_data = nullptr, -+ scoped_refptr font_data = nullptr, - scoped_refptr range_set = nullptr) -- : font_data_(font_data), range_set_(std::move(range_set)) {} -+ : font_data_(std::move(font_data)), range_set_(std::move(range_set)) {} - - FontDataForRangeSet(const FontDataForRangeSet& other); - - virtual ~FontDataForRangeSet() = default; - -- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } -- - bool Contains(UChar32 test_char) const { - return !range_set_ || range_set_->Contains(test_char); - } -@@ -57,8 +55,8 @@ class PLATFORM_EXPORT FontDataForRangeSe - return !range_set_ || range_set_->IsEntireRange(); - } - UnicodeRangeSet* Ranges() const { return range_set_.get(); } -- bool HasFontData() const { return font_data_; } -- const SimpleFontData* FontData() const { return font_data_.Get(); } -+ bool HasFontData() const { return font_data_.get(); } -+ const SimpleFontData* FontData() const { return font_data_.get(); } - - // TODO(xiaochengh): |FontData::IsLoadingFallback()| returns true if the - // FontData is a pending custom font. We should rename it for better clarity. -@@ -71,10 +69,20 @@ class PLATFORM_EXPORT FontDataForRangeSe - } - - protected: -- Member font_data_; -+ scoped_refptr font_data_; - scoped_refptr range_set_; - }; - -+class PLATFORM_EXPORT FontDataForRangeSetFromCache -+ : public FontDataForRangeSet { -+ public: -+ explicit FontDataForRangeSetFromCache( -+ scoped_refptr font_data, -+ scoped_refptr range_set = nullptr) -+ : FontDataForRangeSet(std::move(font_data), std::move(range_set)) {} -+ ~FontDataForRangeSetFromCache() override; -+}; -+ - } // namespace blink - - #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_FOR_RANGE_SET_H_ ---- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc -+++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc -@@ -73,8 +73,8 @@ void FontFallbackIterator::WillUseRange( - selector->WillUseRange(font_description_, family, range_set); - } - --FontDataForRangeSet* FontFallbackIterator::UniqueOrNext( -- FontDataForRangeSet* candidate, -+scoped_refptr FontFallbackIterator::UniqueOrNext( -+ scoped_refptr candidate, - const HintCharList& hint_list) { - if (!candidate->HasFontData()) - return Next(hint_list); -@@ -117,17 +117,17 @@ bool FontFallbackIterator::NeedsHintList - return font_data->IsSegmented(); - } - --FontDataForRangeSet* FontFallbackIterator::Next(const HintCharList& hint_list) { -+scoped_refptr FontFallbackIterator::Next(const HintCharList& hint_list) { - if (fallback_stage_ == kOutOfLuck) -- return MakeGarbageCollected(); -+ return base::AdoptRef(new FontDataForRangeSet()); - - if (fallback_stage_ == kFallbackPriorityFonts) { - // Only try one fallback priority font, - // then proceed to regular system fallback. - fallback_stage_ = kSystemFonts; -- FontDataForRangeSet* fallback_priority_font_range = -- MakeGarbageCollected( -- FallbackPriorityFont(hint_list[0])); -+ scoped_refptr fallback_priority_font_range = -+ base::AdoptRef( -+ new FontDataForRangeSet(FallbackPriorityFont(hint_list[0]))); - if (fallback_priority_font_range->HasFontData()) - return UniqueOrNext(std::move(fallback_priority_font_range), hint_list); - return Next(hint_list); -@@ -135,11 +135,11 @@ FontDataForRangeSet* FontFallbackIterato - - if (fallback_stage_ == kSystemFonts) { - // We've reached pref + system fallback. -- const SimpleFontData* system_font = UniqueSystemFontForHintList(hint_list); -+ scoped_refptr system_font = UniqueSystemFontForHintList(hint_list); - if (system_font) { - // Fallback fonts are not retained in the FontDataCache. -- return UniqueOrNext( -- MakeGarbageCollected(system_font), hint_list); -+ return UniqueOrNext(base::AdoptRef(new FontDataForRangeSet(system_font)), -+ hint_list); - } - - // If we don't have options from the system fallback anymore or had -@@ -149,16 +149,18 @@ FontDataForRangeSet* FontFallbackIterato - // LastResort font, not just Times or Arial. - FontCache& font_cache = FontCache::Get(); - fallback_stage_ = kFirstCandidateForNotdefGlyph; -- const SimpleFontData* last_resort = -- font_cache.GetLastResortFallbackFont(font_description_); -+ scoped_refptr last_resort = -+ font_cache.GetLastResortFallbackFont(font_description_).get(); - - if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { -- font_selector->ReportLastResortFallbackFontLookup(font_description_, -- last_resort); -+ font_selector->ReportLastResortFallbackFontLookup( -+ font_description_, -+ last_resort.get()); - } - -- return UniqueOrNext(MakeGarbageCollected(last_resort), -- hint_list); -+ return UniqueOrNext( -+ base::AdoptRef(new FontDataForRangeSetFromCache(last_resort)), -+ hint_list); - } - - if (fallback_stage_ == kFirstCandidateForNotdefGlyph) { -@@ -189,13 +191,13 @@ FontDataForRangeSet* FontFallbackIterato - // Skip forward to the next font family for the next call to next(). - current_font_data_index_++; - if (!font_data->IsLoading()) { -- SimpleFontData* non_segmented = -+ scoped_refptr non_segmented = - const_cast(To(font_data)); - // The fontData object that we have here is tracked in m_fontList of - // FontFallbackList and gets released in the font cache when the - // FontFallbackList is destroyed. - return UniqueOrNext( -- MakeGarbageCollected(non_segmented), hint_list); -+ base::AdoptRef(new FontDataForRangeSet(non_segmented)), hint_list); - } - return Next(hint_list); - } -@@ -209,7 +211,7 @@ FontDataForRangeSet* FontFallbackIterato - } - - DCHECK_LT(segmented_face_index_, segmented->NumFaces()); -- FontDataForRangeSet* current_segmented_face = -+ scoped_refptr current_segmented_face = - segmented->FaceAt(segmented_face_index_); - segmented_face_index_++; - -@@ -220,7 +222,7 @@ FontDataForRangeSet* FontFallbackIterato - current_font_data_index_++; - } - -- if (RangeSetContributesForHint(hint_list, current_segmented_face)) { -+ if (RangeSetContributesForHint(hint_list, current_segmented_face.get())) { - const SimpleFontData* current_segmented_face_font_data = - current_segmented_face->FontData(); - if (const CustomFontData* current_segmented_face_custom_font_data = -@@ -234,15 +236,17 @@ FontDataForRangeSet* FontFallbackIterato - return Next(hint_list); - } - --const SimpleFontData* FontFallbackIterator::FallbackPriorityFont(UChar32 hint) { -- const SimpleFontData* font_data = FontCache::Get().FallbackFontForCharacter( -- font_description_, hint, -- font_fallback_list_->PrimarySimpleFontData(font_description_), -- font_fallback_priority_); -+scoped_refptr FontFallbackIterator::FallbackPriorityFont( -+ UChar32 hint) { -+ scoped_refptr font_data = -+ FontCache::Get().FallbackFontForCharacter( -+ font_description_, hint, -+ font_fallback_list_->PrimarySimpleFontData(font_description_), -+ font_fallback_priority_); - - if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { - font_selector->ReportFontLookupByFallbackCharacter( -- hint, font_fallback_priority_, font_description_, font_data); -+ hint, font_fallback_priority_, font_description_, font_data.get()); - } - return font_data; - } -@@ -268,7 +272,7 @@ static inline unsigned ChooseHintIndex( - return 0; - } - --const SimpleFontData* FontFallbackIterator::UniqueSystemFontForHintList( -+scoped_refptr FontFallbackIterator::UniqueSystemFontForHintList( - const HintCharList& hint_list) { - // When we're asked for a fallback for the same characters again, we give up - // because the shaper must have previously tried shaping with the font -@@ -283,13 +287,13 @@ const SimpleFontData* FontFallbackIterat - return nullptr; - previously_asked_for_hint_.insert(hint); - -- const SimpleFontData* font_data = font_cache.FallbackFontForCharacter( -+ scoped_refptr font_data = font_cache.FallbackFontForCharacter( - font_description_, hint, - font_fallback_list_->PrimarySimpleFontData(font_description_)); - - if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { - font_selector->ReportFontLookupByFallbackCharacter( -- hint, FontFallbackPriority::kText, font_description_, font_data); -+ hint, FontFallbackPriority::kText, font_description_, font_data.get()); - } - return font_data; - } ---- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.h -+++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.h -@@ -5,13 +5,14 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_FALLBACK_ITERATOR_H_ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_FALLBACK_ITERATOR_H_ - -+#include "base/memory/scoped_refptr.h" - #include "third_party/blink/renderer/platform/fonts/font_data_for_range_set.h" - #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/hash_set.h" - #include "third_party/blink/renderer/platform/wtf/ref_counted.h" - #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" -+#include "third_party/blink/renderer/platform/wtf/vector.h" - - namespace blink { - -@@ -49,7 +50,7 @@ class PLATFORM_EXPORT FontFallbackIterat - // Some system fallback APIs (Windows, Android) require a character, or a - // portion of the string to be passed. On Mac and Linux, we get a list of - // fonts without passing in characters. -- FontDataForRangeSet* Next(const HintCharList& hint_list); -+ scoped_refptr Next(const HintCharList& hint_list); - - void Reset(); - -@@ -59,11 +60,12 @@ class PLATFORM_EXPORT FontFallbackIterat - bool AlreadyLoadingRangeForHintChar(UChar32 hint_char); - void WillUseRange(const AtomicString& family, const FontDataForRangeSet&); - -- FontDataForRangeSet* UniqueOrNext(FontDataForRangeSet* candidate, -- const HintCharList& hint_list); -+ scoped_refptr UniqueOrNext( -+ scoped_refptr candidate, -+ const HintCharList& hint_list); - -- const SimpleFontData* FallbackPriorityFont(UChar32 hint); -- const SimpleFontData* UniqueSystemFontForHintList( -+ scoped_refptr FallbackPriorityFont(UChar32 hint); -+ scoped_refptr UniqueSystemFontForHintList( - const HintCharList& hint_list); - - const FontDescription& font_description_; -@@ -91,8 +93,8 @@ class PLATFORM_EXPORT FontFallbackIterat - // candidate to be used for rendering the .notdef glyph, and set HasNext() to - // false. - HashSet unique_font_data_for_range_sets_returned_; -- FontDataForRangeSet* first_candidate_ = nullptr; -- HeapVector> tracked_loading_range_sets_; -+ scoped_refptr first_candidate_; -+ Vector> tracked_loading_range_sets_; - FontFallbackPriority font_fallback_priority_; - }; - ---- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc -+++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc -@@ -52,9 +52,17 @@ FontFallbackList::FontFallbackList(FontS - is_invalid_(false), - nullify_primary_font_data_for_test_(false) {} - -+FontFallbackList::~FontFallbackList() { -+ unsigned num_fonts = font_list_.size(); -+ for (unsigned i = 0; i < num_fonts; ++i) { -+ if (!font_list_[i]->IsCustomFont()) { -+ DCHECK(!font_list_[i]->IsSegmented()); -+ FontCache::Get().ReleaseFontData(To(font_list_[i].get())); -+ } -+ } -+} -+ - void FontFallbackList::Trace(Visitor* visitor) const { -- visitor->Trace(font_list_); -- visitor->Trace(cached_primary_simple_font_data_); - visitor->Trace(font_selector_); - visitor->Trace(ng_shape_cache_); - visitor->Trace(shape_cache_); -@@ -98,8 +106,8 @@ const SimpleFontData* FontFallbackList:: - return font_data->FontDataForCharacter(kSpaceCharacter); - - FontCache& font_cache = FontCache::Get(); -- const SimpleFontData* last_resort_fallback = -- font_cache.GetLastResortFallbackFont(font_description); -+ SimpleFontData* last_resort_fallback = -+ font_cache.GetLastResortFallbackFont(font_description).get(); - DCHECK(last_resort_fallback); - return last_resort_fallback; - } -@@ -137,7 +145,7 @@ const SimpleFontData* FontFallbackList:: - } - } - --const FontData* FontFallbackList::GetFontData( -+scoped_refptr FontFallbackList::GetFontData( - const FontDescription& font_description) { - const FontFamily* curr_family = &font_description.Family(); - for (int i = 0; curr_family && i < family_index_; i++) -@@ -148,7 +156,7 @@ const FontData* FontFallbackList::GetFon - if (!font_selector_) { - // Don't query system fonts for empty font family name. - if (!curr_family->FamilyName().empty()) { -- if (auto* result = FontCache::Get().GetFontData( -+ if (auto result = FontCache::Get().GetFontData( - font_description, curr_family->FamilyName())) { - return result; - } -@@ -156,7 +164,7 @@ const FontData* FontFallbackList::GetFon - continue; - } - -- const FontData* result = -+ scoped_refptr result = - font_selector_->GetFontData(font_description, *curr_family); - // Don't query system fonts for empty font family name. - if (!result && !curr_family->FamilyName().empty()) { -@@ -164,7 +172,7 @@ const FontData* FontFallbackList::GetFon - curr_family->FamilyName()); - font_selector_->ReportFontLookupByUniqueOrFamilyName( - curr_family->FamilyName(), font_description, -- DynamicTo(result)); -+ DynamicTo(result.get())); - } - if (result) { - font_selector_->ReportSuccessfulFontFamilyMatch( -@@ -181,18 +189,18 @@ const FontData* FontFallbackList::GetFon - FontFamily font_family; - font_family.SetFamily(font_family_names::kWebkitStandard, - FontFamily::Type::kGenericFamily); -- if (const FontData* data = -+ if (scoped_refptr data = - font_selector_->GetFontData(font_description, font_family)) { - return data; - } - } - - // Still no result. Hand back our last resort fallback font. -- auto* last_resort = -+ auto last_resort = - FontCache::Get().GetLastResortFallbackFont(font_description); - if (font_selector_) { - font_selector_->ReportLastResortFallbackFontLookup(font_description, -- last_resort); -+ last_resort.get()); - } - return last_resort; - } -@@ -202,7 +210,7 @@ const FontData* FontFallbackList::FontDa - unsigned realized_font_index) { - // This fallback font is already in our list. - if (realized_font_index < font_list_.size()) -- return font_list_[realized_font_index].Get(); -+ return font_list_[realized_font_index].get(); - - // Make sure we're not passing in some crazy value here. - DCHECK_EQ(realized_font_index, font_list_.size()); -@@ -216,7 +224,7 @@ const FontData* FontFallbackList::FontDa - // the same spot in the list twice. GetFontData will adjust our - // |family_index_| as it scans for the right font to make. - DCHECK_EQ(FontCache::Get().Generation(), generation_); -- const FontData* result = GetFontData(font_description); -+ scoped_refptr result = GetFontData(font_description); - if (result) { - font_list_.push_back(result); - if (result->IsLoadingFallback()) -@@ -224,7 +232,7 @@ const FontData* FontFallbackList::FontDa - if (result->IsCustomFont()) - has_custom_font_ = true; - } -- return result; -+ return result.get(); - } - - bool FontFallbackList::ComputeCanShapeWordByWord( ---- a/third_party/blink/renderer/platform/fonts/font_fallback_list.h -+++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.h -@@ -49,6 +49,7 @@ class PLATFORM_EXPORT FontFallbackList - - FontFallbackList(const FontFallbackList&) = delete; - FontFallbackList& operator=(const FontFallbackList&) = delete; -+ ~FontFallbackList(); - - void Trace(Visitor*) const; - -@@ -116,7 +117,7 @@ class PLATFORM_EXPORT FontFallbackList - bool HasCustomFont() const { return has_custom_font_; } - - private: -- const FontData* GetFontData(const FontDescription&); -+ scoped_refptr GetFontData(const FontDescription&); - - const SimpleFontData* DeterminePrimarySimpleFontData(const FontDescription&); - const SimpleFontData* DeterminePrimarySimpleFontDataCore( -@@ -124,8 +125,8 @@ class PLATFORM_EXPORT FontFallbackList - - bool ComputeCanShapeWordByWord(const FontDescription&); - -- HeapVector, 1> font_list_; -- Member cached_primary_simple_font_data_ = nullptr; -+ Vector, 1> font_list_; -+ const SimpleFontData* cached_primary_simple_font_data_ = nullptr; - const Member font_selector_; - int family_index_ = 0; - const uint16_t generation_; ---- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc -+++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc -@@ -159,10 +159,6 @@ FontPlatformData::FontPlatformData(sk_sp - - FontPlatformData::~FontPlatformData() = default; - --void FontPlatformData::Trace(Visitor* visitor) const { -- visitor->Trace(harfbuzz_face_); --} -- - #if BUILDFLAG(IS_MAC) - CTFontRef FontPlatformData::CtFont() const { - return SkTypeface_GetCTFontRef(typeface_.get()); -@@ -214,10 +210,11 @@ SkTypeface* FontPlatformData::Typeface() - - HarfBuzzFace* FontPlatformData::GetHarfBuzzFace() const { - if (!harfbuzz_face_) { -- harfbuzz_face_ = MakeGarbageCollected(this, UniqueID()); -+ harfbuzz_face_ = -+ HarfBuzzFace::Create(const_cast(this), UniqueID()); - } - -- return harfbuzz_face_.Get(); -+ return harfbuzz_face_.get(); - } - - bool FontPlatformData::HasSpaceInLigaturesOrKerning( -@@ -247,7 +244,7 @@ unsigned FontPlatformData::GetHash() con - } - - #if !BUILDFLAG(IS_MAC) --bool FontPlatformData::FontContainsCharacter(UChar32 character) const { -+bool FontPlatformData::FontContainsCharacter(UChar32 character) { - return CreateSkFont().unicharToGlyph(character); - } - #endif ---- a/third_party/blink/renderer/platform/fonts/font_platform_data.h -+++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h -@@ -39,8 +39,6 @@ - #include "third_party/blink/renderer/platform/fonts/font_orientation.h" - #include "third_party/blink/renderer/platform/fonts/resolved_font_features.h" - #include "third_party/blink/renderer/platform/fonts/small_caps_iterator.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" --#include "third_party/blink/renderer/platform/heap/member.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/forward.h" -@@ -61,8 +59,9 @@ namespace blink { - class HarfBuzzFace; - class OpenTypeVerticalData; - --class PLATFORM_EXPORT FontPlatformData -- : public GarbageCollected { -+class PLATFORM_EXPORT FontPlatformData { -+ USING_FAST_MALLOC(FontPlatformData); -+ - public: - // Used for deleted values in the font cache's hash tables. The hash table - // will create us with this structure, and it will compare other values -@@ -83,8 +82,6 @@ class PLATFORM_EXPORT FontPlatformData - FontOrientation = FontOrientation::kHorizontal); - ~FontPlatformData(); - -- void Trace(Visitor*) const; -- - #if BUILDFLAG(IS_MAC) - // Returns nullptr for FreeType backed SkTypefaces, compare - // FontCustomPlatformData, which are used for variable fonts on Mac OS -@@ -130,7 +127,7 @@ class PLATFORM_EXPORT FontPlatformData - - bool IsHashTableDeletedValue() const { return is_hash_table_deleted_value_; } - #if !BUILDFLAG(IS_MAC) -- bool FontContainsCharacter(UChar32 character) const; -+ bool FontContainsCharacter(UChar32 character); - #endif - - #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_MAC) -@@ -186,7 +183,7 @@ class PLATFORM_EXPORT FontPlatformData - WebFontRenderStyle style_; - #endif - -- mutable Member harfbuzz_face_; -+ mutable scoped_refptr harfbuzz_face_; - bool is_hash_table_deleted_value_ = false; - }; - ---- a/third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc -+++ b/third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc -@@ -38,13 +38,20 @@ - - namespace blink { - -+// static -+std::unique_ptr FontPlatformDataCache::Create() { -+ return std::make_unique(); -+} -+ - FontPlatformDataCache::FontPlatformDataCache() - : font_size_limit_(std::nextafter( - (static_cast(std::numeric_limits::max()) - 2.f) / - static_cast(blink::FontCacheKey::PrecisionMultiplier()), - 0.f)) {} - --const FontPlatformData* FontPlatformDataCache::GetOrCreateFontPlatformData( -+FontPlatformDataCache::~FontPlatformDataCache() = default; -+ -+FontPlatformData* FontPlatformDataCache::GetOrCreateFontPlatformData( - FontCache* font_cache, - const FontDescription& font_description, - const FontFaceCreationParams& creation_params, -@@ -60,13 +67,15 @@ const FontPlatformData* FontPlatformData - - auto it = map_.find(key); - if (it != map_.end()) { -- return it->value.Get(); -+ return it->value.get(); - } - -- if (const FontPlatformData* result = font_cache->CreateFontPlatformData( -- font_description, creation_params, size, alternate_font_name)) { -- map_.insert(key, result); -- return result; -+ if (std::unique_ptr result = -+ font_cache->CreateFontPlatformData(font_description, creation_params, -+ size, alternate_font_name)) { -+ FontPlatformData* result_ptr = result.get(); -+ map_.insert(key, std::move(result)); -+ return result_ptr; - } - - if (alternate_font_name != AlternateFontName::kAllowAlternate || -@@ -82,16 +91,35 @@ const FontPlatformData* FontPlatformData - return nullptr; - - FontFaceCreationParams create_by_alternate_family(alternate_name); -- if (const FontPlatformData* result = GetOrCreateFontPlatformData( -+ if (FontPlatformData* result = GetOrCreateFontPlatformData( - font_cache, font_description, create_by_alternate_family, - AlternateFontName::kNoAlternate)) { - // Cache the platform_data under the old name. - // "accessibility/font-changed.html" reaches here. -- map_.insert(key, result); -+ map_.insert(key, std::make_unique(*result)); - return result; - } - - return nullptr; - } - -+size_t FontPlatformDataCache::ByteSize() const { -+ return map_.size() * sizeof(std::unique_ptr); -+} -+ -+void FontPlatformDataCache::Clear() { -+ map_.clear(); -+} -+ -+void FontPlatformDataCache::Purge(const FontDataCache& font_data_cache) { -+ Vector keys_to_remove; -+ keys_to_remove.ReserveInitialCapacity(map_.size()); -+ for (auto& entry : map_) { -+ if (entry.value && !font_data_cache.Contains(entry.value.get())) { -+ keys_to_remove.push_back(entry.key); -+ } -+ } -+ map_.RemoveAll(keys_to_remove); -+} -+ - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/font_platform_data_cache.h -+++ b/third_party/blink/renderer/platform/fonts/font_platform_data_cache.h -@@ -31,13 +31,13 @@ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_PLATFORM_DATA_CACHE_H_ - - #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" -+#include "third_party/blink/renderer/platform/wtf/hash_map.h" - - namespace blink { - - enum class AlternateFontName; - class FontCache; -+class FontDataCache; - class FontDescription; - class FontFaceCreationParams; - class FontPlatformData; -@@ -45,23 +45,30 @@ class FontPlatformData; - // `FontPlatformDataCache` is the shared cache mapping from `FontDescription` - // to `FontPlatformData`. - class FontPlatformDataCache final { -- DISALLOW_NEW(); -- - public: -+ static std::unique_ptr Create(); -+ - FontPlatformDataCache(); -+ ~FontPlatformDataCache(); -+ -+ FontPlatformDataCache(const FontPlatformDataCache&) = delete; -+ FontPlatformDataCache(FontPlatformDataCache&&) = delete; - -- void Trace(Visitor* visitor) const { visitor->Trace(map_); } -+ FontPlatformDataCache operator=(const FontPlatformDataCache&) = delete; -+ FontPlatformDataCache operator=(FontPlatformDataCache&&) = delete; - -- const FontPlatformData* GetOrCreateFontPlatformData( -+ FontPlatformData* GetOrCreateFontPlatformData( - FontCache* font_cache, - const FontDescription& font_description, - const FontFaceCreationParams& creation_params, - AlternateFontName alternate_font_name); - -- void Clear() { map_.clear(); } -+ size_t ByteSize() const; -+ void Clear(); -+ void Purge(const FontDataCache& font_data_cache); - - private: -- HeapHashMap> map_; -+ HashMap> map_; - - // A maximum float value to which we limit incoming font sizes. This is the - // smallest float so that multiplying it by ---- a/third_party/blink/renderer/platform/fonts/font_selector.h -+++ b/third_party/blink/renderer/platform/fonts/font_selector.h -@@ -53,8 +53,8 @@ class UseCounter; - class PLATFORM_EXPORT FontSelector : public FontCacheClient { - public: - ~FontSelector() override = default; -- virtual const FontData* GetFontData(const FontDescription&, -- const FontFamily&) = 0; -+ virtual scoped_refptr GetFontData(const FontDescription&, -+ const FontFamily&) = 0; - - // TODO(crbug.com/542629): The String variant of this method should be - // replaced with a better approach, now that we only have complex text. -@@ -92,7 +92,7 @@ class PLATFORM_EXPORT FontSelector : pub - virtual void ReportFontLookupByUniqueOrFamilyName( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) = 0; -+ scoped_refptr resulting_font_data) = 0; - - // Called whenever a page attempts to find a local font based on a name. This - // only includes lookups where the name is allowed to match PostScript names -@@ -100,7 +100,7 @@ class PLATFORM_EXPORT FontSelector : pub - virtual void ReportFontLookupByUniqueNameOnly( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data, -+ scoped_refptr resulting_font_data, - bool is_loading_fallback = false) = 0; - - // Called whenever a page attempts to find a local font based on a fallback -@@ -109,12 +109,12 @@ class PLATFORM_EXPORT FontSelector : pub - UChar32 fallback_character, - FontFallbackPriority fallback_priority, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) = 0; -+ scoped_refptr resulting_font_data) = 0; - - // Called whenever a page attempts to find a last-resort font. - virtual void ReportLastResortFallbackFontLookup( - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) = 0; -+ scoped_refptr resulting_font_data) = 0; - - virtual void ReportNotDefGlyph() const = 0; - ---- a/third_party/blink/renderer/platform/fonts/fuchsia/font_cache_fuchsia.cc -+++ b/third_party/blink/renderer/platform/fonts/fuchsia/font_cache_fuchsia.cc -@@ -45,7 +45,7 @@ void FontCache::SetSystemFontFamily(cons - MutableSystemFontFamily() = family_name; - } - --const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( -+scoped_refptr FontCache::PlatformFallbackFontForCharacter( - const FontDescription& font_description, - UChar32 character, - const SimpleFontData* font_data_to_substitute, -@@ -67,12 +67,12 @@ const SimpleFontData* FontCache::Platfor - !typeface->isItalic() && - font_description.SyntheticItalicAllowed(); - -- const auto* font_data = MakeGarbageCollected( -+ auto font_data = std::make_unique( - std::move(typeface), std::string(), font_description.EffectiveFontSize(), - synthetic_bold, synthetic_italic, font_description.TextRendering(), - ResolvedFontFeatures(), font_description.Orientation()); - -- return FontDataFromFontPlatformData(font_data); -+ return FontDataFromFontPlatformData(font_data.get(), kDoNotRetain); - } - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc -+++ b/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc -@@ -62,7 +62,7 @@ bool FontCache::GetFontForCharacter(UCha - } - } - --const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( -+scoped_refptr FontCache::PlatformFallbackFontForCharacter( - const FontDescription& font_description, - UChar32 c, - const SimpleFontData*, -@@ -77,9 +77,11 @@ const SimpleFontData* FontCache::Platfor - AtomicString family_name = GetFamilyNameForCharacter( - font_manager_.get(), c, font_description, nullptr, fallback_priority); - if (family_name.empty()) -- return GetLastResortFallbackFont(font_description); -- return FontDataFromFontPlatformData(GetFontPlatformData( -- font_description, FontFaceCreationParams(family_name))); -+ return GetLastResortFallbackFont(font_description, kDoNotRetain); -+ return FontDataFromFontPlatformData( -+ GetFontPlatformData(font_description, -+ FontFaceCreationParams(family_name)), -+ kDoNotRetain); - } - - if (fallback_priority == FontFallbackPriority::kEmojiEmoji) { -@@ -94,7 +96,7 @@ const SimpleFontData* FontCache::Platfor - if (fallback_priority != FontFallbackPriority::kEmojiEmoji && - (font_description.Style() == kItalicSlopeValue || - font_description.Weight() >= kBoldThreshold)) { -- const SimpleFontData* font_data = -+ scoped_refptr font_data = - FallbackOnStandardFontStyle(font_description, c); - if (font_data) - return font_data; -@@ -137,16 +139,16 @@ const SimpleFontData* FontCache::Platfor - description.SetStyle(kNormalSlopeValue); - } - -- const FontPlatformData* substitute_platform_data = -+ FontPlatformData* substitute_platform_data = - GetFontPlatformData(description, creation_params); - if (!substitute_platform_data) - return nullptr; - -- FontPlatformData* platform_data = -- MakeGarbageCollected(*substitute_platform_data); -+ std::unique_ptr platform_data( -+ new FontPlatformData(*substitute_platform_data)); - platform_data->SetSyntheticBold(should_set_synthetic_bold); - platform_data->SetSyntheticItalic(should_set_synthetic_italic); -- return FontDataFromFontPlatformData(platform_data); -+ return FontDataFromFontPlatformData(platform_data.get(), kDoNotRetain); - } - - } // namespace blink ---- a/third_party/blink/renderer/platform/fonts/segmented_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/segmented_font_data.h -@@ -28,7 +28,6 @@ - - #include "third_party/blink/renderer/platform/fonts/font_data.h" - #include "third_party/blink/renderer/platform/fonts/font_data_for_range_set.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/wtf/casting.h" - -@@ -38,21 +37,20 @@ class SimpleFontData; - - class PLATFORM_EXPORT SegmentedFontData : public FontData { - public: -- SegmentedFontData() = default; -- -- void Trace(Visitor* visitor) const override { -- visitor->Trace(faces_); -- FontData::Trace(visitor); -+ static scoped_refptr Create() { -+ return base::AdoptRef(new SegmentedFontData); - } - -- void AppendFace(FontDataForRangeSet* font_data_for_range_set) { -+ void AppendFace(scoped_refptr font_data_for_range_set) { - faces_.push_back(std::move(font_data_for_range_set)); - } - unsigned NumFaces() const { return faces_.size(); } -- FontDataForRangeSet* FaceAt(unsigned i) const { return faces_[i].Get(); } -+ scoped_refptr FaceAt(unsigned i) const { return faces_[i]; } - bool ContainsCharacter(UChar32) const; - - private: -+ SegmentedFontData() = default; -+ - const SimpleFontData* FontDataForCharacter(UChar32) const override; - - bool IsCustomFont() const override; -@@ -61,7 +59,7 @@ class PLATFORM_EXPORT SegmentedFontData - bool IsSegmented() const override; - bool ShouldSkipDrawing() const override; - -- HeapVector, 1> faces_; -+ Vector, 1> faces_; - }; - - template <> ---- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc -@@ -127,7 +127,7 @@ Vector CachingWordShaper::Indivi - total_width); - } - --HeapVector CachingWordShaper::GetRunFontData( -+Vector CachingWordShaper::GetRunFontData( - const TextRun& run) const { - ShapeResultBuffer buffer; - ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer); ---- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h -@@ -26,6 +26,7 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_CACHING_WORD_SHAPER_H_ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_CACHING_WORD_SHAPER_H_ - -+#include "base/memory/scoped_refptr.h" - #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h" - #include "third_party/blink/renderer/platform/text/text_run.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -@@ -59,7 +60,7 @@ class PLATFORM_EXPORT CachingWordShaper - CharacterRange GetCharacterRange(const TextRun&, unsigned from, unsigned to); - Vector IndividualCharacterAdvances(const TextRun&); - -- HeapVector GetRunFontData(const TextRun&) const; -+ Vector GetRunFontData(const TextRun&) const; - - GlyphData EmphasisMarkGlyphData(const TextRun&) const; - ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -65,8 +65,7 @@ - - namespace blink { - --HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, -- uint64_t unique_id) -+HarfBuzzFace::HarfBuzzFace(FontPlatformData* platform_data, uint64_t unique_id) - : platform_data_(platform_data), unique_id_(unique_id) { - HbFontCacheEntry* const cache_entry = - FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, -@@ -79,9 +78,6 @@ HarfBuzzFace::~HarfBuzzFace() { - FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); - } - --void HarfBuzzFace::Trace(Visitor* visitor) const { -- visitor->Trace(platform_data_); --} - - bool& GetIgnoreVariationSelectors() { - DEFINE_THREAD_SAFE_STATIC_LOCAL(WTF::ThreadSpecific, -@@ -486,8 +482,7 @@ static hb_blob_t* HarfBuzzSkiaGetTable(h - } - - // TODO(yosin): We should move |CreateFace()| to "harfbuzz_font_cache.cc". --static hb::unique_ptr CreateFace( -- const FontPlatformData* platform_data) { -+static hb::unique_ptr CreateFace(FontPlatformData* platform_data) { - hb::unique_ptr face; - - sk_sp typeface = sk_ref_sp(platform_data->Typeface()); -@@ -535,9 +530,8 @@ static scoped_refptr C - return cache_entry; - } - --HbFontCacheEntry* HarfBuzzFontCache::RefOrNew( -- uint64_t unique_id, -- const FontPlatformData* platform_data) { -+HbFontCacheEntry* HarfBuzzFontCache::RefOrNew(uint64_t unique_id, -+ FontPlatformData* platform_data) { - const auto& result = font_map_.insert(unique_id, nullptr); - if (result.is_new_entry) { - hb::unique_ptr face = CreateFace(platform_data); ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -@@ -34,11 +34,10 @@ - #include "third_party/blink/renderer/platform/fonts/glyph.h" - #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" - #include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" --#include "third_party/blink/renderer/platform/heap/garbage_collected.h" --#include "third_party/blink/renderer/platform/heap/member.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/runtime_enabled_features.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -+#include "third_party/blink/renderer/platform/wtf/ref_counted.h" - #include "third_party/blink/renderer/platform/wtf/text/character_names.h" - - #include -@@ -52,16 +51,18 @@ struct HarfBuzzFontData; - - // |HarfBuzzFace| is a thread specific data associated to |FontPlatformData|, - // hold by |HarfBuzzFontCache|. --class PLATFORM_EXPORT HarfBuzzFace final -- : public GarbageCollected { -+class PLATFORM_EXPORT HarfBuzzFace final : public RefCounted { -+ USING_FAST_MALLOC(HarfBuzzFace); - public: -- HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); -+ static scoped_refptr Create(FontPlatformData* platform_data, -+ uint64_t unique_id) { -+ return base::AdoptRef(new HarfBuzzFace(platform_data, unique_id)); -+ } -+ - HarfBuzzFace(const HarfBuzzFace&) = delete; - HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; - ~HarfBuzzFace(); - -- void Trace(Visitor*) const; -- - enum VerticalLayoutCallbacks { kPrepareForVerticalLayout, kNoVerticalLayout }; - - // In order to support the restricting effect of unicode-range optionally a -@@ -97,10 +98,11 @@ class PLATFORM_EXPORT HarfBuzzFace final - static void SetIgnoreVariationSelectors(bool value); - - private: -+ HarfBuzzFace(FontPlatformData* platform_data, uint64_t); - - void PrepareHarfBuzzFontData(); - -- Member platform_data_; -+ FontPlatformData* const platform_data_; - const uint64_t unique_id_; - // TODO(crbug.com/1489080): When briefly given MiraclePtr protection, - // these members were both found dangling. ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -@@ -49,7 +49,7 @@ class HarfBuzzFontCache final { - ~HarfBuzzFontCache(); - - HbFontCacheEntry* RefOrNew(uint64_t unique_id, -- const FontPlatformData* platform_data); -+ FontPlatformData* platform_data); - void Remove(uint64_t unique_id); - - private: ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -@@ -853,7 +853,7 @@ void HarfBuzzShaper::ShapeSegment( - fallback_chars_hint.ReserveInitialCapacity(range_data->end - - range_data->start); - } -- FontDataForRangeSet* current_font_data_for_range_set = nullptr; -+ scoped_refptr current_font_data_for_range_set; - FallbackFontStage fallback_stage = kIntermediate; - while (!range_data->reshape_queue.empty()) { - ReshapeQueueItem current_queue_item = range_data->reshape_queue.TakeFirst(); -@@ -934,7 +934,7 @@ void HarfBuzzShaper::ShapeSegment( - if (needs_caps_handling) { - case_map_intend = caps_support.NeedsCaseChange(small_caps_behavior); - if (caps_support.NeedsSyntheticFont(small_caps_behavior)) { -- adjusted_font = font_data->SmallCapsFontData(font_description); -+ adjusted_font = font_data->SmallCapsFontData(font_description).get(); - } - } - ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc -@@ -79,10 +79,9 @@ ASSERT_SIZE(ShapeResult::RunInfo, SameSi - - struct SameSizeAsShapeResult { - float width; -- UntracedMember deprecated_ink_bounds_; -- Vector runs_; -- Vector character_position_; -- UntracedMember primary_font_; -+ UntracedMember member; -+ Vector vectors[2]; -+ void *pointer; - unsigned start_index_; - unsigned num_characters_; - unsigned bitfields : 32; -@@ -396,7 +395,7 @@ void ShapeResult::RunInfo::CharacterInde - } - } - --ShapeResult::ShapeResult(const SimpleFontData* font_data, -+ShapeResult::ShapeResult(scoped_refptr font_data, - unsigned start_index, - unsigned num_characters, - TextDirection direction) -@@ -432,7 +431,6 @@ void ShapeResult::Trace(Visitor* visitor - visitor->Trace(deprecated_ink_bounds_); - visitor->Trace(runs_); - visitor->Trace(character_position_); -- visitor->Trace(primary_font_); - } - - size_t ShapeResult::ByteSize() const { -@@ -732,10 +730,10 @@ bool ShapeResult::HasFallbackFonts(const - return false; - } - --void ShapeResult::GetRunFontData(HeapVector* font_data) const { -+void ShapeResult::GetRunFontData(Vector* font_data) const { - for (const auto& run : runs_) { - font_data->push_back( -- RunFontData({run->font_data_.Get(), run->glyph_data_.size()})); -+ RunFontData({run->font_data_.get(), run->glyph_data_.size()})); - } - } - -@@ -750,7 +748,7 @@ float ShapeResult::ForEachGlyphImpl(floa - for (const auto& glyph_data : run.glyph_data_) { - glyph_callback(context, run.start_index_ + glyph_data.character_index, - glyph_data.glyph, *glyph_offsets, total_advance, -- is_horizontal, run.canvas_rotation_, run.font_data_.Get()); -+ is_horizontal, run.canvas_rotation_, run.font_data_.get()); - total_advance += glyph_data.advance; - ++glyph_offsets; - } -@@ -785,7 +783,7 @@ float ShapeResult::ForEachGlyphImpl(floa - auto total_advance = initial_advance; - unsigned run_start = run.start_index_ + index_offset; - bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run.direction_); -- const SimpleFontData* font_data = run.font_data_.Get(); -+ const SimpleFontData* font_data = run.font_data_.get(); - - if (run.IsLtr()) { // Left-to-right - for (const auto& glyph_data : run.glyph_data_) { -@@ -1738,7 +1736,7 @@ unsigned ShapeResult::CopyRangeInternal( - ShapeResult* ShapeResult::SubRange(unsigned start_offset, - unsigned end_offset) const { - ShapeResult* sub_range = -- MakeGarbageCollected(primary_font_.Get(), 0, 0, Direction()); -+ MakeGarbageCollected(primary_font_.get(), 0, 0, Direction()); - CopyRange(start_offset, end_offset, sub_range); - return sub_range; - } ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.h -@@ -136,7 +136,7 @@ typedef void (*GraphemeClusterCallback)( - - class PLATFORM_EXPORT ShapeResult : public GarbageCollected { - public: -- ShapeResult(const SimpleFontData*, -+ ShapeResult(scoped_refptr, - unsigned start_index, - unsigned num_characters, - TextDirection); -@@ -149,7 +149,7 @@ class PLATFORM_EXPORT ShapeResult : publ - void Trace(Visitor*) const; - - static ShapeResult* CreateEmpty(const ShapeResult& other) { -- return MakeGarbageCollected(other.primary_font_.Get(), 0, 0, -+ return MakeGarbageCollected(other.primary_font_, 0, 0, - other.Direction()); - } - static const ShapeResult* CreateForTabulationCharacters( -@@ -181,7 +181,7 @@ class PLATFORM_EXPORT ShapeResult : publ - LayoutUnit SnappedWidth() const { return LayoutUnit::FromFloatCeil(width_); } - unsigned NumCharacters() const { return num_characters_; } - unsigned NumGlyphs() const { return num_glyphs_; } -- const SimpleFontData* PrimaryFont() const { return primary_font_.Get(); } -+ const SimpleFontData* PrimaryFont() const { return primary_font_.get(); } - bool HasFallbackFonts(const SimpleFontData* primary_font) const; - - // TODO(eae): Remove start_x and return value once ShapeResultBuffer has been -@@ -352,12 +352,10 @@ class PLATFORM_EXPORT ShapeResult : publ - - // Computes the list of fonts along with the number of glyphs for each font. - struct RunFontData { -- DISALLOW_NEW(); -- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } -- Member font_data_; -+ SimpleFontData* font_data_; - wtf_size_t glyph_count_; - }; -- void GetRunFontData(HeapVector* font_data) const; -+ void GetRunFontData(Vector* font_data) const; - - // Iterates over, and calls the specified callback function, for all the - // glyphs. Also tracks (and returns) a seeded total advance. -@@ -517,7 +515,7 @@ class PLATFORM_EXPORT ShapeResult : publ - // index to x-position and O(log n) time, using binary search, from - // x-position to character index. - mutable HeapVector character_position_; -- Member primary_font_; -+ scoped_refptr primary_font_; - - unsigned start_index_ = 0; - unsigned num_characters_ = 0; -@@ -572,6 +570,5 @@ PLATFORM_EXPORT std::ostream& operator<< - } // namespace blink - - WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::ShapeRange) --WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::RunFontData) - - #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_H_ ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc -@@ -249,8 +249,8 @@ int ShapeResultBuffer::OffsetForPosition - return total_offset; - } - --HeapVector ShapeResultBuffer::GetRunFontData() const { -- HeapVector font_data; -+Vector ShapeResultBuffer::GetRunFontData() const { -+ Vector font_data; - for (const auto& result : results_) - result->GetRunFontData(&font_data); - return font_data; -@@ -264,9 +264,10 @@ GlyphData ShapeResultBuffer::EmphasisMar - if (run->glyph_data_.IsEmpty()) - continue; - -- return GlyphData(run->glyph_data_[0].glyph, -- run->font_data_->EmphasisMarkFontData(font_description), -- run->CanvasRotation()); -+ return GlyphData( -+ run->glyph_data_[0].glyph, -+ run->font_data_->EmphasisMarkFontData(font_description).get(), -+ run->CanvasRotation()); - } - } - ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h -@@ -5,6 +5,7 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_BUFFER_H_ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_BUFFER_H_ - -+#include "base/memory/scoped_refptr.h" - #include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" - #include "third_party/blink/renderer/platform/platform_export.h" -@@ -47,7 +48,7 @@ class PLATFORM_EXPORT ShapeResultBuffer - TextDirection, - float total_width) const; - -- HeapVector GetRunFontData() const; -+ Vector GetRunFontData() const; - - GlyphData EmphasisMarkGlyphData(const FontDescription&) const; - ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h -@@ -79,7 +79,7 @@ struct ShapeResult::RunInfo final - direction_(other.direction_), - canvas_rotation_(other.canvas_rotation_) {} - -- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } -+ void Trace(Visitor*) const {} - - unsigned NumGlyphs() const { return glyph_data_.size(); } - bool IsLtr() const { return HB_DIRECTION_IS_FORWARD(direction_); } -@@ -130,7 +130,7 @@ struct ShapeResult::RunInfo final - return nullptr; - - auto* run = MakeGarbageCollected( -- font_data_.Get(), direction_, canvas_rotation_, script_, -+ font_data_.get(), direction_, canvas_rotation_, script_, - start_index_ + start, number_of_glyphs, number_of_characters); - - run->glyph_data_.CopyFromRange(glyphs); -@@ -154,7 +154,7 @@ struct ShapeResult::RunInfo final - return nullptr; - DCHECK_LT(start_index_, other.start_index_); - auto* run = MakeGarbageCollected( -- font_data_.Get(), direction_, canvas_rotation_, script_, start_index_, -+ font_data_.get(), direction_, canvas_rotation_, script_, start_index_, - glyph_data_.size() + other.glyph_data_.size(), - num_characters_ + other.num_characters_); - // Note: We populate |graphemes_| on demand, e.g. hit testing. -@@ -374,7 +374,7 @@ struct ShapeResult::RunInfo final - } - - GlyphDataCollection glyph_data_; -- Member font_data_; -+ scoped_refptr font_data_; - - // graphemes_[i] is the number of graphemes up to (and including) the ith - // character in the run. ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.cc -@@ -54,7 +54,7 @@ float ShapeResultTestInfo::AdvanceForTes - - SimpleFontData* ShapeResultTestInfo::FontDataForTesting( - unsigned run_index) const { -- return runs_[run_index]->font_data_.Get(); -+ return runs_[run_index]->font_data_.get(); - } - - Vector ShapeResultTestInfo::CharacterIndexesForTesting() const { ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc -@@ -28,9 +28,7 @@ ShapeResultView::RunInfoPart::RunInfoPar - start_index_(start_index), - offset_(offset), - num_characters_(num_characters), -- width_(width) { -- static_assert(std::is_trivially_destructible::value, ""); --} -+ width_(width) {} - - void ShapeResultView::RunInfoPart::Trace(Visitor* visitor) const { - visitor->Trace(run_); -@@ -74,10 +72,7 @@ unsigned ShapeResultView::CharacterIndex - // |InitData| provides values of const member variables of |ShapeResultView| - // for constructor. - struct ShapeResultView::InitData { -- STACK_ALLOCATED(); -- -- public: -- const SimpleFontData* primary_font = nullptr; -+ scoped_refptr primary_font; - unsigned start_index = 0; - unsigned char_index_offset = 0; - TextDirection direction = TextDirection::kLtr; -@@ -188,7 +183,7 @@ ShapeResult* ShapeResultView::CreateShap - new_result->runs_.ReserveInitialCapacity(parts_.size()); - for (const auto& part : RunsOrParts()) { - auto* new_run = MakeGarbageCollected( -- part.run_->font_data_.Get(), part.run_->direction_, -+ part.run_->font_data_.get(), part.run_->direction_, - part.run_->canvas_rotation_, part.run_->script_, part.start_index_, - part.NumGlyphs(), part.num_characters_); - new_run->glyph_data_.CopyFromRange(part.range_); -@@ -364,21 +359,21 @@ unsigned ShapeResultView::PreviousSafeTo - } - - void ShapeResultView::GetRunFontData( -- HeapVector* font_data) const { -+ Vector* font_data) const { - for (const auto& part : RunsOrParts()) { - font_data->push_back(ShapeResult::RunFontData( -- {part.run_->font_data_.Get(), -+ {part.run_->font_data_.get(), - static_cast(part.end() - part.begin())})); - } - } - - void ShapeResultView::FallbackFonts( -- HeapHashSet>* fallback) const { -+ HashSet* fallback) const { - DCHECK(fallback); - DCHECK(primary_font_); - for (const auto& part : RunsOrParts()) { - if (part.run_->font_data_ && part.run_->font_data_ != primary_font_) { -- fallback->insert(part.run_->font_data_.Get()); -+ fallback->insert(part.run_->font_data_.get()); - } - } - } -@@ -392,7 +387,7 @@ float ShapeResultView::ForEachGlyphImpl( - const auto& run = part.run_; - auto total_advance = initial_advance; - bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run->direction_); -- const SimpleFontData* font_data = run->font_data_.Get(); -+ const SimpleFontData* font_data = run->font_data_.get(); - const unsigned character_index_offset_for_glyph_data = - CharacterIndexOffsetForGlyphData(part); - for (const auto& glyph_data : part) { -@@ -435,7 +430,7 @@ float ShapeResultView::ForEachGlyphImpl( - auto total_advance = initial_advance; - const auto& run = part.run_; - bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run->direction_); -- const SimpleFontData* font_data = run->font_data_.Get(); -+ const SimpleFontData* font_data = run->font_data_.get(); - const unsigned character_index_offset_for_glyph_data = - CharacterIndexOffsetForGlyphData(part); - if (run->IsLtr()) { // Left-to-right ---- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h -@@ -10,7 +10,6 @@ - #include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h" - #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" - #include "third_party/blink/renderer/platform/geometry/layout_unit.h" --#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/text/text_direction.h" - #include "third_party/blink/renderer/platform/wtf/forward.h" -@@ -111,10 +110,7 @@ class PLATFORM_EXPORT ShapeResultView fi - ShapeResultView& operator=(const ShapeResultView&) = delete; - ~ShapeResultView() = default; - -- void Trace(Visitor* visitor) const { -- visitor->Trace(parts_); -- visitor->Trace(primary_font_); -- } -+ void Trace(Visitor* visitor) const { visitor->Trace(parts_); } - - ShapeResult* CreateShapeResult() const; - -@@ -130,7 +126,7 @@ class PLATFORM_EXPORT ShapeResultView fi - bool IsLtr() const { return blink::IsLtr(Direction()); } - bool IsRtl() const { return blink::IsRtl(Direction()); } - bool HasVerticalOffsets() const { return has_vertical_offsets_; } -- void FallbackFonts(HeapHashSet>* fallback) const; -+ void FallbackFonts(HashSet* fallback) const; - - unsigned PreviousSafeToBreakOffset(unsigned index) const; - -@@ -155,8 +151,10 @@ class PLATFORM_EXPORT ShapeResultView fi - // bounds. - gfx::RectF ComputeInkBounds() const; - -- const SimpleFontData* PrimaryFont() const { return primary_font_.Get(); } -- void GetRunFontData(HeapVector*) const; -+ scoped_refptr PrimaryFont() const { -+ return primary_font_; -+ } -+ void GetRunFontData(Vector*) const; - - void ExpandRangeToIncludePartialGlyphs(unsigned* from, unsigned* to) const; - -@@ -288,8 +286,7 @@ class PLATFORM_EXPORT ShapeResultView fi - - unsigned StartIndexOffsetForRun() const { return char_index_offset_; } - -- HeapVector parts_; -- Member const primary_font_; -+ scoped_refptr const primary_font_; - - const unsigned start_index_; - -@@ -311,6 +308,8 @@ class PLATFORM_EXPORT ShapeResultView fi - // with ShapeResult::SubRange - const unsigned char_index_offset_; - -+ HeapVector parts_; -+ - private: - friend class ShapeResult; - ---- a/third_party/blink/renderer/platform/fonts/simple_font_data.cc -+++ b/third_party/blink/renderer/platform/fonts/simple_font_data.cc -@@ -76,14 +76,14 @@ constexpr int32_t kFontObjectsMemoryCons - constexpr int32_t kFontObjectsMemoryConsumption = 2128; - #endif - --SimpleFontData::SimpleFontData(const FontPlatformData* platform_data, -- const CustomFontData* custom_data, -+SimpleFontData::SimpleFontData(const FontPlatformData& platform_data, -+ scoped_refptr custom_data, - bool subpixel_ascent_descent, - const FontMetricsOverride& metrics_override) - : platform_data_(platform_data), -- font_(platform_data->size() ? platform_data->CreateSkFont() -+ font_(platform_data_.size() ? platform_data.CreateSkFont() - : skia::DefaultFont()), -- custom_font_data_(custom_data) { -+ custom_font_data_(std::move(custom_data)) { - // Every time new SimpleFontData instance is created, Skia will ask - // FreeType to get the metrics for glyphs by invoking - // af_face_globals_get_metrics. There FT will allocate style_metrics_size -@@ -111,7 +111,7 @@ SimpleFontData::~SimpleFontData() { - - void SimpleFontData::PlatformInit(bool subpixel_ascent_descent, - const FontMetricsOverride& metrics_override) { -- if (!platform_data_->size()) { -+ if (!platform_data_.size()) { - font_metrics_.Reset(); - avg_char_width_ = 0; - max_char_width_ = 0; -@@ -126,7 +126,7 @@ void SimpleFontData::PlatformInit(bool s - float descent; - - FontMetrics::AscentDescentWithHacks( -- ascent, descent, *platform_data_, font_, subpixel_ascent_descent, -+ ascent, descent, platform_data_, font_, subpixel_ascent_descent, - metrics_override.ascent_override, metrics_override.descent_override); - - font_metrics_.SetAscent(ascent); -@@ -164,7 +164,7 @@ void SimpleFontData::PlatformInit(bool s - - float line_gap; - if (metrics_override.line_gap_override) { -- line_gap = *metrics_override.line_gap_override * platform_data_->size(); -+ line_gap = *metrics_override.line_gap_override * platform_data_.size(); - } else { - line_gap = SkScalarToFloat(metrics.fLeading); - } -@@ -261,39 +261,45 @@ bool SimpleFontData::IsSegmented() const - return false; - } - --SimpleFontData* SimpleFontData::SmallCapsFontData( -+scoped_refptr SimpleFontData::SmallCapsFontData( - const FontDescription& font_description) const { -- if (!small_caps_) { -- small_caps_ = -+ if (!derived_font_data_) -+ derived_font_data_ = std::make_unique(); -+ if (!derived_font_data_->small_caps) { -+ derived_font_data_->small_caps = - CreateScaledFontData(font_description, kSmallCapsFontSizeMultiplier); - } -- return small_caps_; -+ -+ return derived_font_data_->small_caps; - } - --SimpleFontData* SimpleFontData::EmphasisMarkFontData( -+scoped_refptr SimpleFontData::EmphasisMarkFontData( - const FontDescription& font_description) const { -- if (!emphasis_mark_) { -- emphasis_mark_ = -+ if (!derived_font_data_) -+ derived_font_data_ = std::make_unique(); -+ if (!derived_font_data_->emphasis_mark) { -+ derived_font_data_->emphasis_mark = - CreateScaledFontData(font_description, kEmphasisMarkFontSizeMultiplier); - } -- return emphasis_mark_; -+ -+ return derived_font_data_->emphasis_mark; - } - --SimpleFontData* SimpleFontData::CreateScaledFontData( -+scoped_refptr SimpleFontData::CreateScaledFontData( - const FontDescription& font_description, - float scale_factor) const { - const float scaled_size = - lroundf(font_description.ComputedSize() * scale_factor); -- return MakeGarbageCollected( -- MakeGarbageCollected(*platform_data_, scaled_size), -- IsCustomFont() ? MakeGarbageCollected() : nullptr); -+ return SimpleFontData::Create( -+ FontPlatformData(platform_data_, scaled_size), -+ IsCustomFont() ? CustomFontData::Create() : nullptr); - } - --SimpleFontData* SimpleFontData::MetricsOverriddenFontData( -+scoped_refptr SimpleFontData::MetricsOverriddenFontData( - const FontMetricsOverride& metrics_override) const { -- return MakeGarbageCollected( -- platform_data_, custom_font_data_, false /* subpixel_ascent_descent */, -- metrics_override); -+ return base::AdoptRef(new SimpleFontData(platform_data_, custom_font_data_, -+ false /* subpixel_ascent_descent */, -+ metrics_override)); - } - - // Internal leadings can be distributed to ascent and descent. -@@ -347,7 +353,7 @@ static std::pair TypoA - - void SimpleFontData::ComputeNormalizedTypoAscentAndDescent() const { - // Compute em height metrics from OS/2 sTypoAscender and sTypoDescender. -- SkTypeface* typeface = platform_data_->Typeface(); -+ SkTypeface* typeface = platform_data_.Typeface(); - auto [typo_ascender, typo_descender] = TypoAscenderAndDescender(typeface); - if (typo_ascender > 0 && - TrySetNormalizedTypoAscentAndDescent(typo_ascender, typo_descender)) { -@@ -434,7 +440,7 @@ const std::optional& SimpleFontDa - } - - // Compute vertical advance if the orientation is `kVerticalUpright`. -- const HarfBuzzFace* hb_face = platform_data_->GetHarfBuzzFace(); -+ const HarfBuzzFace* hb_face = platform_data_.GetHarfBuzzFace(); - const OpenTypeVerticalData& vertical_data = hb_face->VerticalData(); - ideographic_inline_size_ = vertical_data.AdvanceHeight(cjk_water_glyph); - }); -@@ -462,9 +468,8 @@ const HanKerning::FontData& SimpleFontDa - } - - gfx::RectF SimpleFontData::PlatformBoundsForGlyph(Glyph glyph) const { -- if (!platform_data_->size()) { -+ if (!platform_data_.size()) - return gfx::RectF(); -- } - - static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); - -@@ -477,18 +482,16 @@ void SimpleFontData::BoundsForGlyphs(con - Vector* bounds) const { - DCHECK_EQ(glyphs.size(), bounds->size()); - -- if (!platform_data_->size()) { -+ if (!platform_data_.size()) - return; -- } - - DCHECK_EQ(bounds->size(), glyphs.size()); - SkFontGetBoundsForGlyphs(font_, glyphs, bounds->data()); - } - - float SimpleFontData::WidthForGlyph(Glyph glyph) const { -- if (!platform_data_->size()) { -+ if (!platform_data_.size()) - return 0; -- } - - static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); - ---- a/third_party/blink/renderer/platform/fonts/simple_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/simple_font_data.h -@@ -40,7 +40,6 @@ - #include "third_party/blink/renderer/platform/fonts/glyph.h" - #include "third_party/blink/renderer/platform/fonts/shaping/han_kerning.h" - #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" --#include "third_party/blink/renderer/platform/heap/member.h" - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/blink/renderer/platform/wtf/casting.h" - #include "third_party/blink/renderer/platform/wtf/text/string_hash.h" -@@ -75,18 +74,12 @@ class FontDescription; - class PLATFORM_EXPORT SimpleFontData final : public FontData { - public: - // Used to create platform fonts. -- SimpleFontData( -- const FontPlatformData*, -- const CustomFontData* custom_data = nullptr, -- bool subpixel_ascent_descent = false, -- const FontMetricsOverride& metrics_override = FontMetricsOverride()); -- -- void Trace(Visitor* visitor) const override { -- visitor->Trace(platform_data_); -- visitor->Trace(small_caps_); -- visitor->Trace(emphasis_mark_); -- visitor->Trace(custom_font_data_); -- FontData::Trace(visitor); -+ static scoped_refptr Create( -+ const FontPlatformData& platform_data, -+ scoped_refptr custom_data = nullptr, -+ bool subpixel_ascent_descent = false) { -+ return base::AdoptRef(new SimpleFontData( -+ platform_data, std::move(custom_data), subpixel_ascent_descent)); - } - - SimpleFontData(const SimpleFontData&) = delete; -@@ -95,11 +88,13 @@ class PLATFORM_EXPORT SimpleFontData fin - SimpleFontData& operator=(const SimpleFontData&) = delete; - SimpleFontData& operator=(const SimpleFontData&&) = delete; - -- const FontPlatformData& PlatformData() const { return *platform_data_; } -+ const FontPlatformData& PlatformData() const { return platform_data_; } - -- SimpleFontData* SmallCapsFontData(const FontDescription&) const; -- SimpleFontData* EmphasisMarkFontData(const FontDescription&) const; -- SimpleFontData* MetricsOverriddenFontData(const FontMetricsOverride&) const; -+ scoped_refptr SmallCapsFontData(const FontDescription&) const; -+ scoped_refptr EmphasisMarkFontData( -+ const FontDescription&) const; -+ scoped_refptr MetricsOverriddenFontData( -+ const FontMetricsOverride&) const; - - FontMetrics& GetFontMetrics() { return font_metrics_; } - const FontMetrics& GetFontMetrics() const { return font_metrics_; } -@@ -154,7 +149,7 @@ class PLATFORM_EXPORT SimpleFontData fin - - Glyph GlyphForCharacter(UChar32) const; - -- bool IsCustomFont() const override { return custom_font_data_; } -+ bool IsCustomFont() const override { return custom_font_data_.get(); } - bool IsLoading() const override { - return custom_font_data_ ? custom_font_data_->IsLoading() : false; - } -@@ -169,16 +164,20 @@ class PLATFORM_EXPORT SimpleFontData fin - return custom_font_data_ && custom_font_data_->ShouldSkipDrawing(); - } - -- const CustomFontData* GetCustomFontData() const { -- return custom_font_data_.Get(); -- } -+ CustomFontData* GetCustomFontData() const { return custom_font_data_.get(); } - - private: -+ SimpleFontData( -+ const FontPlatformData&, -+ scoped_refptr custom_data, -+ bool subpixel_ascent_descent = false, -+ const FontMetricsOverride& metrics_override = FontMetricsOverride()); -+ - void PlatformInit(bool subpixel_ascent_descent, const FontMetricsOverride&); - void PlatformGlyphInit(); - -- SimpleFontData* CreateScaledFontData(const FontDescription&, -- float scale_factor) const; -+ scoped_refptr CreateScaledFontData(const FontDescription&, -+ float scale_factor) const; - - void ComputeNormalizedTypoAscentAndDescent() const; - bool TrySetNormalizedTypoAscentAndDescent(float ascent, float descent) const; -@@ -187,17 +186,30 @@ class PLATFORM_EXPORT SimpleFontData fin - float max_char_width_ = -1; - float avg_char_width_ = -1; - -- Member platform_data_; -+ const FontPlatformData platform_data_; - const SkFont font_; - - Glyph space_glyph_ = 0; - float space_width_ = 0; - Glyph zero_glyph_ = 0; - -- mutable Member small_caps_; -- mutable Member emphasis_mark_; -+ struct DerivedFontData final { -+ USING_FAST_MALLOC(DerivedFontData); -+ -+ public: -+ DerivedFontData() = default; -+ DerivedFontData(const DerivedFontData&) = delete; -+ DerivedFontData(DerivedFontData&&) = delete; -+ DerivedFontData& operator=(const DerivedFontData&) = delete; -+ DerivedFontData& operator=(DerivedFontData&&) = delete; -+ -+ scoped_refptr small_caps; -+ scoped_refptr emphasis_mark; -+ }; -+ -+ mutable std::unique_ptr derived_font_data_; - -- Member custom_font_data_; -+ const scoped_refptr custom_font_data_; - - mutable std::once_flag ideographic_inline_size_once_; - mutable std::once_flag ideographic_advance_width_once_; ---- a/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc -+++ b/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc -@@ -94,7 +94,7 @@ AtomicString FontCache::GetFamilyNameFor - - void FontCache::PlatformInit() {} - --const SimpleFontData* FontCache::FallbackOnStandardFontStyle( -+scoped_refptr FontCache::FallbackOnStandardFontStyle( - const FontDescription& font_description, - UChar32 character) { - FontDescription substitute_description(font_description); -@@ -103,26 +103,27 @@ const SimpleFontData* FontCache::Fallbac - - FontFaceCreationParams creation_params( - substitute_description.Family().FamilyName()); -- const FontPlatformData* substitute_platform_data = -+ FontPlatformData* substitute_platform_data = - GetFontPlatformData(substitute_description, creation_params); - if (substitute_platform_data && - substitute_platform_data->FontContainsCharacter(character)) { -- FontPlatformData* platform_data = -- MakeGarbageCollected(*substitute_platform_data); -- platform_data->SetSyntheticBold(font_description.Weight() >= -- kBoldThreshold && -- font_description.SyntheticBoldAllowed()); -- platform_data->SetSyntheticItalic( -- font_description.Style() == kItalicSlopeValue && -- font_description.SyntheticItalicAllowed()); -- return FontDataFromFontPlatformData(platform_data); -+ FontPlatformData platform_data = -+ FontPlatformData(*substitute_platform_data); -+ platform_data.SetSyntheticBold(font_description.Weight() >= -+ kBoldThreshold && -+ font_description.SyntheticBoldAllowed()); -+ platform_data.SetSyntheticItalic(font_description.Style() == -+ kItalicSlopeValue && -+ font_description.SyntheticItalicAllowed()); -+ return FontDataFromFontPlatformData(&platform_data, kDoNotRetain); - } - - return nullptr; - } - --const SimpleFontData* FontCache::GetLastResortFallbackFont( -- const FontDescription& description) { -+scoped_refptr FontCache::GetLastResortFallbackFont( -+ const FontDescription& description, -+ ShouldRetain should_retain) { - const FontFaceCreationParams fallback_creation_params( - GetFallbackFontFamily(description)); - const FontPlatformData* font_platform_data = GetFontPlatformData( -@@ -195,7 +196,7 @@ const SimpleFontData* FontCache::GetLast - #endif - - DCHECK(font_platform_data); -- return FontDataFromFontPlatformData(font_platform_data); -+ return FontDataFromFontPlatformData(font_platform_data, should_retain); - } - - sk_sp FontCache::CreateTypeface( -@@ -238,7 +239,7 @@ sk_sp FontCache::CreateTypef - } - - #if !BUILDFLAG(IS_WIN) --const FontPlatformData* FontCache::CreateFontPlatformData( -+std::unique_ptr FontCache::CreateFontPlatformData( - const FontDescription& font_description, - const FontFaceCreationParams& creation_params, - float font_size, -@@ -293,10 +294,11 @@ const FontPlatformData* FontCache::Creat - ->GetResolvedFontFeatures() - : ResolvedFontFeatures(); - -- FontPlatformData* font_platform_data = MakeGarbageCollected( -- typeface, name, font_size, synthetic_bold, synthetic_italic, -- font_description.TextRendering(), resolved_font_features, -- font_description.Orientation()); -+ std::unique_ptr font_platform_data = -+ std::make_unique( -+ typeface, name, font_size, synthetic_bold, synthetic_italic, -+ font_description.TextRendering(), resolved_font_features, -+ font_description.Orientation()); - - font_platform_data->SetAvoidEmbeddedBitmaps( - BitmapGlyphsBlockList::ShouldAvoidEmbeddedBitmapsForTypeface(*typeface)); ---- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc -+++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc -@@ -43,26 +43,23 @@ class TestFontSelector : public FontSele - } - ~TestFontSelector() override = default; - -- FontData* GetFontData(const FontDescription& font_description, -- const FontFamily&) override { -+ scoped_refptr GetFontData(const FontDescription& font_description, -+ const FontFamily&) override { - FontSelectionCapabilities normal_capabilities( - {kNormalWidthValue, kNormalWidthValue}, - {kNormalSlopeValue, kNormalSlopeValue}, - {kNormalWeightValue, kNormalWeightValue}); -- const FontPlatformData* platform_data = -- custom_platform_data_->GetFontPlatformData( -- font_description.EffectiveFontSize(), -- font_description.AdjustedSpecifiedSize(), -- font_description.IsSyntheticBold() && -- font_description.SyntheticBoldAllowed(), -- font_description.IsSyntheticItalic() && -- font_description.SyntheticItalicAllowed(), -- font_description.GetFontSelectionRequest(), normal_capabilities, -- font_description.FontOpticalSizing(), -- font_description.TextRendering(), {}, -- font_description.Orientation()); -- return MakeGarbageCollected( -- platform_data, MakeGarbageCollected()); -+ FontPlatformData platform_data = custom_platform_data_->GetFontPlatformData( -+ font_description.EffectiveFontSize(), -+ font_description.AdjustedSpecifiedSize(), -+ font_description.IsSyntheticBold() && -+ font_description.SyntheticBoldAllowed(), -+ font_description.IsSyntheticItalic() && -+ font_description.SyntheticItalicAllowed(), -+ font_description.GetFontSelectionRequest(), normal_capabilities, -+ font_description.FontOpticalSizing(), font_description.TextRendering(), -+ {}, font_description.Orientation()); -+ return SimpleFontData::Create(platform_data, CustomFontData::Create()); - } - - void WillUseFontData(const FontDescription&, -@@ -83,20 +80,20 @@ class TestFontSelector : public FontSele - void ReportFontLookupByUniqueOrFamilyName( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) override {} -+ scoped_refptr resulting_font_data) override {} - void ReportFontLookupByUniqueNameOnly( - const AtomicString& name, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data, -+ scoped_refptr resulting_font_data, - bool is_loading_fallback = false) override {} - void ReportFontLookupByFallbackCharacter( - UChar32 hint, - FontFallbackPriority fallback_priority, - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) override {} -+ scoped_refptr resulting_font_data) override {} - void ReportLastResortFallbackFontLookup( - const FontDescription& font_description, -- const SimpleFontData* resulting_font_data) override {} -+ scoped_refptr resulting_font_data) override {} - void ReportNotDefGlyph() const override {} - void ReportEmojiSegmentGlyphCoverage(unsigned, unsigned) override {} - ExecutionContext* GetExecutionContext() const override { return nullptr; } ---- a/tools/privacy_budget/font_indexer/font_indexer.cc -+++ b/tools/privacy_budget/font_indexer/font_indexer.cc -@@ -116,7 +116,7 @@ void FontIndexer::FontListHasLoaded(base - bool FontIndexer::DoesFontHaveDigest(WTF::AtomicString name, - blink::FontDescription font_description, - int64_t digest) { -- const blink::SimpleFontData* font_data = -+ scoped_refptr font_data = - font_cache_->GetFontData(font_description, name); - DCHECK(font_data); - return blink::FontGlobalContext::Get() -@@ -170,7 +170,7 @@ void FontIndexer::PrintAllFontsWithName( - // exists and for later comparison. - int64_t default_font_digest; - { -- const blink::SimpleFontData* font_data = -+ scoped_refptr font_data = - font_cache_->GetFontData(blink::FontDescription(), name); - default_font_digest = - font_data ? blink::FontGlobalContext::Get() -@@ -231,7 +231,7 @@ void FontIndexer::PrintAllFontsWithName( - for (auto slope_pair : slopes) { - font_description.SetStyle(slope_pair.first); - -- if (const blink::SimpleFontData* font_data = -+ if (scoped_refptr font_data = - font_cache_->GetFontData(font_description, name)) { - uint64_t typeface_digest = - blink::FontGlobalContext::Get() diff --git a/bad-font-gc3.patch b/bad-font-gc3.patch deleted file mode 100644 index f6726ae..0000000 --- a/bad-font-gc3.patch +++ /dev/null @@ -1,38 +0,0 @@ -Revert the following commit (to support bad-font-gc2.patch): - -commit d4806d20fda56e9bac259fddf10b7439ce749add -Author: Hao Liu -Date: Mon Mar 18 22:56:31 2024 +0000 - - Cleanup leftover non-used custom_font_data methods - - This is to clean up non-used custom_font_data methods. Their usage has - been deleted in a previous CL. - https://chromium-review.googlesource.com/c/chromium/src/+/5262982/29/third_party/blink/renderer/core/css/css_font_face_source.cc#b95 - - Change-Id: I90c3ae794a6caf71526c81a56795e95c23cc3fb5 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368244 - Reviewed-by: Ian Kilpatrick - Commit-Queue: Ian Kilpatrick - Cr-Commit-Position: refs/heads/main@{#1274525} - ---- a/third_party/blink/renderer/core/css/css_custom_font_data.h -+++ b/third_party/blink/renderer/core/css/css_custom_font_data.h -@@ -55,6 +55,7 @@ class CSSCustomFontData final : public C - - bool IsLoading() const override { return is_loading_; } - bool IsLoadingFallback() const override { return true; } -+ void ClearFontFaceSource() override { font_face_source_ = nullptr; } - - bool IsPendingDataUrl() const override { - return font_face_source_ && font_face_source_->IsPendingDataUrl(); ---- a/third_party/blink/renderer/platform/fonts/custom_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h -@@ -46,6 +46,7 @@ class PLATFORM_EXPORT CustomFontData : p - virtual bool IsLoading() const { return false; } - virtual bool IsLoadingFallback() const { return false; } - virtual bool ShouldSkipDrawing() const { return false; } -+ virtual void ClearFontFaceSource() {} - virtual bool IsPendingDataUrl() const { return false; } - - protected: diff --git a/base-system-nspr.patch b/base-system-nspr.patch index 51c0f7b..e5d54c8 100644 --- a/base-system-nspr.patch +++ b/base-system-nspr.patch @@ -9,8 +9,8 @@ #include "base/time/time_override.h" #include "build/build_config.h" ---- a/base/BUILD.gn 2022-06-30 13:13:20.315537859 +0200 -+++ b/base/BUILD.gn 2022-06-30 13:25:39.947410797 +0200 +--- src/base/BUILD.gn.orig 2024-12-08 18:43:52.881356091 +0100 ++++ src/base/BUILD.gn 2024-12-18 13:19:11.049201868 +0100 @@ -1,3 +1,8 @@ +import("//build/config/linux/pkg_config.gni") + @@ -20,16 +20,16 @@ # Copyright 2013 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -@@ -826,8 +831,6 @@ - "third_party/cityhash_v103/src/city_v103.cc", - "third_party/cityhash_v103/src/city_v103.h", - "third_party/icu/icu_utf.h", +@@ -809,8 +814,6 @@ component("base") { + "task/updateable_sequenced_task_runner.h", + "test/scoped_logging_settings.h", + "test/spin_wait.h", - "third_party/nspr/prtime.cc", - "third_party/nspr/prtime.h", - "third_party/superfasthash/superfasthash.c", "thread_annotations.h", "threading/hang_watcher.cc", -@@ -1414,6 +1417,7 @@ + "threading/hang_watcher.h", +@@ -1028,6 +1031,7 @@ component("base") { "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", "//electron/build/config:mas_build", diff --git a/bsc1224178-font-gc.patch b/bsc1224178-font-gc.patch new file mode 100644 index 0000000..7bd1b1a --- /dev/null +++ b/bsc1224178-font-gc.patch @@ -0,0 +1,422 @@ +Example stack trace for this crash: +#0 0x000055f451cdf761 in partition_alloc::PartitionRoot::FreeNoHooksImmediate(void*, partition_alloc::internal::SlotSpanMetadata<(partition_alloc::internal::MetadataKind)1>*, unsigned long)::{lambda()#1}::operator()() const (__closure=, + __closure=) at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1531 +#1 partition_alloc::PartitionRoot::FreeNoHooksImmediate (this=, object=, slot_span=, slot_start=, this=, object=, slot_span=, slot_start=) + at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1531 +#2 partition_alloc::PartitionRoot::FreeInline<(partition_alloc::internal::FreeFlags)2> (this=, object=, this=, object=) at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1513 +#3 partition_alloc::PartitionRoot::FreeInlineInUnknownRoot<(partition_alloc::internal::FreeFlags)2> (object=0x316400f16770) at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1432 +#4 allocator_shim::internal::PartitionFreeInternal<(partition_alloc::internal::FreeFlags)2> (object=0x316400f16770, context=0x0) at ../../base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc:407 +#5 allocator_shim::internal::PartitionFree (object=0x316400f16770, context=0x0) at ../../base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc:411 +#6 0x000055f44ef26567 in std::__cxx11::basic_string, std::allocator >::_M_assign (this=0x316401a361c8, __str="/usr/share/fonts/truetype/NimbusSans-Regular.otf") at /usr/include/c++/14/bits/basic_string.tcc:289 +#7 0x000055f4563f3d34 in std::__cxx11::basic_string, std::allocator >::assign (this=, __str=...) at /usr/include/c++/14/bits/basic_string.h:1619 +#8 std::__cxx11::basic_string, std::allocator >::operator= (this=, __str=...) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:141021183 +#9 blink::FontFaceCreationParams::operator= () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:141021183 +#10 blink::FontCacheKey::operator=(blink::FontCacheKey const&) [clone .isra.0] () at ../../third_party/blink/renderer/platform/fonts/font_cache_key.h:55 +#11 0x000055f4564c44d9 in WTF::HashMapTranslator, WTF::HashMapValueTraits, WTF::HashTraits > > >::Store >, blink::FontCacheKey&, blink::FontPlatformData const*&> () at ../../third_party/blink/renderer/platform/wtf/hash_map.h:340 +#12 WTF::HashTable >, WTF::KeyValuePairExtractor, WTF::HashMapValueTraits, WTF::HashTraits > >, WTF::HashTraits, blink::HeapAllocator>::insert, WTF::HashMapValueTraits, WTF::HashTraits > > >, blink::FontCacheKey&, blink::FontPlatformData const*&>(blink::FontCacheKey&, blink::FontPlatformData const*&) [clone .isra.0] () at ../../third_party/blink/renderer/platform/wtf/hash_table.h:1291 +#13 0x000055f4543111b1 in WTF::HashMap, WTF::HashTraits, WTF::HashTraits >, blink::HeapAllocator>::InlineAdd () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:141870345 +#14 WTF::HashMap, WTF::HashTraits, WTF::HashTraits >, blink::HeapAllocator>::insert () at ../../third_party/blink/renderer/platform/wtf/hash_map.h:475 +#15 blink::FontPlatformDataCache::GetOrCreateFontPlatformData (this=this@entry=0x316400141880, font_cache=font_cache@entry=0x316400141850, font_description=..., creation_params=..., alternate_font_name=alternate_font_name@entry=0) + at ../../third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc:68 +#16 0x000055f454311a0a in blink::FontCache::GetFontPlatformData (this=0x316400141850, font_description=..., creation_params=..., alternate_font_name=0) at ../../third_party/blink/renderer/platform/fonts/font_cache.cc:164 +#17 0x000055f4564bbc7d in blink::FontCache::PlatformFallbackFontForCharacter () at ../../third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc:143 +#18 0x000055f4564bcc2b in blink::FontCache::FallbackFontForCharacter(blink::FontDescription const&, int, blink::SimpleFontData const*, blink::FontFallbackPriority) [clone .isra.0] () at ../../third_party/blink/renderer/platform/fonts/font_cache.cc:251 +#19 0x000055f45443653f in blink::FontFallbackIterator::UniqueSystemFontForHintList () at ../../third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc:303 +#20 blink::FontFallbackIterator::Next (this=0x7ffefa904bf0, hint_list=...) at ../../third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc:152 +#21 0x000055f45431a4b6 in blink::HarfBuzzShaper::ShapeSegment (this=, range_data=, segment=..., result=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158192637 +#22 0x000055f453953f86 in blink::HarfBuzzShaper::Shape () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:145662151 +#23 Reshape (this=0x7ffefa9050d0, start_item=..., font=..., start_offset=, end_offset=end_offset@entry=43) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:145662155 +#24 0x000055f4539542f0 in ShapeWithoutCache (this=this@entry=0x7ffefa9050d0, start_item=..., font=..., end_offset=end_offset@entry=43) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:145662155 +#25 0x000055f4539b5ab9 in operator() () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:147940603 +#26 Shape () at ../../third_party/blink/renderer/core/layout/inline/inline_node.cc:177 +#27 blink::InlineNode::ShapeText (this=this@entry=0x7ffefa9057a8, data=data@entry=0x316403e7e958, previous_text=previous_text@entry=0x0, previous_items=previous_items@entry=0x0, override_font=override_font@entry=0x0) + at ../../third_party/blink/renderer/core/layout/inline/inline_node.cc:1512 +#28 0x000055f4539b9692 in blink::InlineNode::ShapeTextIncludingFirstLine () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:147941159 +#29 blink::InlineNode::PrepareLayout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:145662744 +#30 blink::InlineNode::PrepareLayoutIfNeeded (this=) at ../../third_party/blink/renderer/core/layout/inline/inline_node.cc:598 +#31 0x000055f45400a06d in blink::InlineNode::EnsureData () at ../../third_party/blink/renderer/core/layout/inline/inline_node.cc:978 +#32 blink::InlineNode::IsBlockLevel () at ../../third_party/blink/renderer/core/layout/inline/inline_node.h:102 +#33 blink::BlockNode::FirstChild (this=this@entry=0x7ffefa905860) at ../../third_party/blink/renderer/core/layout/block_node.cc:1121 +#34 0x000055f45400a200 in blink::BlockNode::IsInlineFormattingContextRoot (this=0x7ffefa905860, first_child_out=0x7ffefa905830) at ../../third_party/blink/renderer/core/layout/block_node.cc:1466 +#35 0x000055f45423975b in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa905860) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:546 +#36 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#37 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#38 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#39 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#40 0x000055f454237e4f in LayoutBlockChild () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324341 +#41 LayoutInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:129 +#42 LayoutInflow () at gen/third_party/blink/public/mojom/frame/frame.mojom.cc:44270740 +#43 blink::BlockLayoutAlgorithm::HandleInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:2139 +#44 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa9063b0, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:993 +#45 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa9063b0) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#46 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#47 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#48 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#49 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#50 0x000055f4562235f2 in blink::FlexLayoutAlgorithm::PlaceFlexItems(blink::HeapVector*, blink::HeapVector, 0u>*, bool) [clone .constprop.0] () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1253 +#51 0x000055f45402e6c6 in blink::FlexLayoutAlgorithm::LayoutInternal () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1043 +#52 blink::FlexLayoutAlgorithm::Layout (this=this@entry=0x7ffefa9070e0) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883768 +#53 0x000055f454032076 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#54 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#55 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#56 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#57 0x000055f4562235f2 in blink::FlexLayoutAlgorithm::PlaceFlexItems(blink::HeapVector*, blink::HeapVector, 0u>*, bool) [clone .constprop.0] () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1253 +#58 0x000055f45402e6c6 in blink::FlexLayoutAlgorithm::LayoutInternal () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1043 +#59 blink::FlexLayoutAlgorithm::Layout (this=this@entry=0x7ffefa9081a0) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883768 +#60 0x000055f454032076 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#61 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#62 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#63 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#64 0x000055f4562235f2 in blink::FlexLayoutAlgorithm::PlaceFlexItems(blink::HeapVector*, blink::HeapVector, 0u>*, bool) [clone .constprop.0] () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1253 +#65 0x000055f45402e6c6 in blink::FlexLayoutAlgorithm::LayoutInternal () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1043 +#66 blink::FlexLayoutAlgorithm::Layout (this=this@entry=0x7ffefa909260) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883768 +#67 0x000055f454032076 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#68 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#69 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#70 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#71 0x000055f454230b9a in LayoutBlockChild () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:114 +#72 blink::BlockLayoutAlgorithm::LayoutNewFormattingContext (this=this@entry=0x7ffefa90a330, child=..., child_break_token=child_break_token@entry=0x0, child_data=..., origin_offset=..., abort_if_cleared=false, out_child_bfc_offset=0x7ffefa90a19c, + out_resolved_margins=0x7ffefa90a1d0) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:1953 +#73 0x000055f454237063 in blink::BlockLayoutAlgorithm::HandleNewFormattingContext () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324366 +#74 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90a330, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:988 +#75 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90a330) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#76 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#77 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#78 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#79 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#80 0x000055f4540d6105 in blink::OutOfFlowLayoutPart::GenerateFragment () at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:2546 +#81 blink::OutOfFlowLayoutPart::Layout (this=this@entry=0x7ffefa90b1b0, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) + at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917333 +#82 0x000055f4540e5174 in blink::OutOfFlowLayoutPart::LayoutOOFNode (this=this@entry=0x7ffefa90b1b0, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, + is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917453 +#83 0x000055f4540e5b85 in blink::OutOfFlowLayoutPart::LayoutCandidates (this=this@entry=0x7ffefa90b1b0, candidates=candidates@entry=0x7ffefa90b110) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:1111 +#84 0x000055f4540f2b9e in blink::OutOfFlowLayoutPart::Run (this=0x7ffefa90b1b0) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:523 +#85 0x000055f45423444d in blink::BoxFragmentBuilder::HandleOofsAndSpecialDescendants (this=this@entry=0x7ffefa90b550) at ../../third_party/blink/renderer/core/layout/box_fragment_builder.cc:547 +#86 0x000055f4542367d0 in blink::BlockLayoutAlgorithm::FinishLayout () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:1357 +#87 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90b540, inline_child_layout_context=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:156517574 +#88 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90b540) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#89 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#90 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#91 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#92 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#93 0x000055f454230b9a in LayoutBlockChild () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:114 +#94 blink::BlockLayoutAlgorithm::LayoutNewFormattingContext (this=this@entry=0x7ffefa90c280, child=..., child_break_token=child_break_token@entry=0x0, child_data=..., origin_offset=..., abort_if_cleared=false, out_child_bfc_offset=0x7ffefa90c0ec, + out_resolved_margins=0x7ffefa90c120) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:1953 +#95 0x000055f454237063 in blink::BlockLayoutAlgorithm::HandleNewFormattingContext () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324366 +#96 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90c280, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:988 +#97 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90c280) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#98 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#99 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#100 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#101 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#102 0x000055f454230b9a in LayoutBlockChild () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:114 +#103 blink::BlockLayoutAlgorithm::LayoutNewFormattingContext (this=this@entry=0x7ffefa90cfc0, child=..., child_break_token=child_break_token@entry=0x0, child_data=..., origin_offset=..., abort_if_cleared=false, out_child_bfc_offset=0x7ffefa90ce2c, + out_resolved_margins=0x7ffefa90ce60) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:1953 +#104 0x000055f454237063 in blink::BlockLayoutAlgorithm::HandleNewFormattingContext () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324366 +#105 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90cfc0, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:988 +#106 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90cfc0) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#107 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#108 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#109 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#110 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#111 0x000055f454237e4f in LayoutBlockChild () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324341 +#112 LayoutInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:129 +#113 LayoutInflow () at gen/third_party/blink/public/mojom/frame/frame.mojom.cc:44270740 +#114 blink::BlockLayoutAlgorithm::HandleInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:2139 +#115 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90db10, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:993 +#116 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90db10) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#117 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#118 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#119 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#120 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#121 0x000055f454237e4f in LayoutBlockChild () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324341 +#122 LayoutInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:129 +#123 LayoutInflow () at gen/third_party/blink/public/mojom/frame/frame.mojom.cc:44270740 +#124 blink::BlockLayoutAlgorithm::HandleInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:2139 +#125 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90e660, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:993 +#126 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90e660) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#127 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#128 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#129 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#130 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#131 0x000055f454237e4f in LayoutBlockChild () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324341 +#132 LayoutInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:129 +#133 LayoutInflow () at gen/third_party/blink/public/mojom/frame/frame.mojom.cc:44270740 +#134 blink::BlockLayoutAlgorithm::HandleInflow () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:2139 +#135 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90f1b0, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:993 +#136 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa90f1b0) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#137 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#138 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#139 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#140 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#141 0x000055f4562235f2 in blink::FlexLayoutAlgorithm::PlaceFlexItems(blink::HeapVector*, blink::HeapVector, 0u>*, bool) [clone .constprop.0] () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1253 +#142 0x000055f45402e6c6 in blink::FlexLayoutAlgorithm::LayoutInternal () at ../../third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc:1043 +#143 blink::FlexLayoutAlgorithm::Layout (this=this@entry=0x7ffefa90fee0) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883768 +#144 0x000055f454032076 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#145 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#146 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#147 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#148 0x000055f454230b9a in LayoutBlockChild () at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:114 +#149 blink::BlockLayoutAlgorithm::LayoutNewFormattingContext (this=this@entry=0x7ffefa910fb0, child=..., child_break_token=child_break_token@entry=0x0, child_data=..., origin_offset=..., abort_if_cleared=false, out_child_bfc_offset=0x7ffefa910e1c, + out_resolved_margins=0x7ffefa910e50) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:1953 +#150 0x000055f454237063 in blink::BlockLayoutAlgorithm::HandleNewFormattingContext () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:142324366 +#151 blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa910fb0, inline_child_layout_context=) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:988 +#152 0x000055f4542397a2 in blink::BlockLayoutAlgorithm::Layout (this=0x7ffefa910fb0) at ../../third_party/blink/renderer/core/layout/block_layout_algorithm.cc:549 +#153 0x000055f45400cb43 in operator() () at ../../third_party/blink/renderer/core/layout/block_node.cc:214 +#154 CreateAlgorithmAndRun >(const blink::LayoutAlgorithmParams &, const struct {...} &) (params=..., callback=...) + at ../../third_party/blink/renderer/core/layout/block_node.cc:120 +#155 0x000055f45401ae3e in LayoutWithAlgorithm () at ../../third_party/blink/renderer/core/layout/block_node.cc:212 +#156 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/layout/block_node.cc:523 +#157 0x000055f4540d6105 in blink::OutOfFlowLayoutPart::GenerateFragment () at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:2546 +#158 blink::OutOfFlowLayoutPart::Layout (this=this@entry=0x7ffefa911e30, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) + at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917333 +#159 0x000055f4540e5174 in blink::OutOfFlowLayoutPart::LayoutOOFNode (this=this@entry=0x7ffefa911e30, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, + is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917453 +#160 0x000055f4540e5b85 in blink::OutOfFlowLayoutPart::LayoutCandidates (this=this@entry=0x7ffefa911e30, candidates=candidates@entry=0x7ffefa911d90) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:1111 +#161 0x000055f4540f2b9e in blink::OutOfFlowLayoutPart::Run (this=0x7ffefa911e30) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:523 +#162 0x000055f45423444d in blink::BoxFragmentBuilder::HandleOofsAndSpecialDescendants (this=0x7ffefa9121e0) at ../../third_party/blink/renderer/core/layout/box_fragment_builder.cc:547 +#163 0x000055f4540f3540 in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:302 +#164 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#165 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#166 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#167 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#168 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#169 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#170 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#171 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#172 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#173 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#174 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#175 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#176 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#177 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#178 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#179 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#180 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#181 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#182 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#183 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#184 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#185 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#186 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#187 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#188 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#189 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#190 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#191 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#192 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#193 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#194 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#195 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#196 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#197 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#198 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#199 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#200 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#201 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#202 0x000055f4540d6105 in blink::OutOfFlowLayoutPart::GenerateFragment () at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:2546 +#203 blink::OutOfFlowLayoutPart::Layout (this=this@entry=0x7ffefa9154f0, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) + at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917333 +#204 0x000055f4540e5174 in blink::OutOfFlowLayoutPart::LayoutOOFNode (this=this@entry=0x7ffefa9154f0, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, + is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917453 +#205 0x000055f4540e5b85 in blink::OutOfFlowLayoutPart::LayoutCandidates (this=this@entry=0x7ffefa9154f0, candidates=candidates@entry=0x7ffefa915450) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:1111 +#206 0x000055f4540f2b9e in blink::OutOfFlowLayoutPart::Run (this=0x7ffefa9154f0) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:523 +#207 0x000055f45423444d in blink::BoxFragmentBuilder::HandleOofsAndSpecialDescendants (this=0x7ffefa9158a0) at ../../third_party/blink/renderer/core/layout/box_fragment_builder.cc:547 +#208 0x000055f4540f3540 in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:302 +#209 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#210 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#211 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#212 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#213 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#214 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#215 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#216 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#217 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#218 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#219 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#220 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#221 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#222 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#223 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#224 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#225 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#226 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#227 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#228 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#229 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#230 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#231 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#232 0x000055f4540d6105 in blink::OutOfFlowLayoutPart::GenerateFragment () at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:2546 +#233 blink::OutOfFlowLayoutPart::Layout (this=this@entry=0x7ffefa9179b0, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) + at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917333 +#234 0x000055f4540e5174 in blink::OutOfFlowLayoutPart::LayoutOOFNode (this=this@entry=0x7ffefa9179b0, oof_node_to_layout=..., fragmentainer_constraint_space=fragmentainer_constraint_space@entry=0x0, + is_last_fragmentainer_so_far=is_last_fragmentainer_so_far@entry=false) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:158917453 +#235 0x000055f4540e5b85 in blink::OutOfFlowLayoutPart::LayoutCandidates (this=this@entry=0x7ffefa9179b0, candidates=candidates@entry=0x7ffefa917910) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:1111 +#236 0x000055f4540f2b9e in blink::OutOfFlowLayoutPart::Run (this=0x7ffefa9179b0) at ../../third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc:523 +#237 0x000055f45423444d in blink::BoxFragmentBuilder::HandleOofsAndSpecialDescendants (this=0x7ffefa917d60) at ../../third_party/blink/renderer/core/layout/box_fragment_builder.cc:547 +#238 0x000055f4540f3540 in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:302 +#239 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#240 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#241 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#242 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#243 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#244 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#245 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#246 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#247 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#248 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#249 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#250 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#251 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#252 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#253 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#254 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#255 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#256 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#257 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#258 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#259 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#260 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#261 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#262 0x000055f4540f303c in blink::BlockNode::SimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:653 +#263 blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/layout/simplified_layout_algorithm.cc:237 +#264 0x000055f45401a28a in blink::SimplifiedLayoutAlgorithm::Layout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:157234584 +#265 blink::BlockNode::RunSimplifiedLayout () at ../../third_party/blink/renderer/core/layout/block_node.cc:1705 +#266 blink::BlockNode::Layout (this=, constraint_space=..., break_token=, early_break=, column_spanner_path=) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:146883682 +#267 0x000055f4537e965e in blink::LayoutBox::LayoutSubtreeRoot () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:143013582 +#268 blink::LayoutBox::LayoutSubtreeRoot () at gen/third_party/blink/renderer/core/html_names.cc:85762220 +#269 blink::LocalFrameView::LayoutFromRootObject () at ../../third_party/blink/renderer/core/frame/local_frame_view.cc:666 +#270 blink::LocalFrameView::LayoutFromRootObject () at gen/third_party/blink/renderer/core/html_names.cc:85758991 +#271 blink::LocalFrameView::PerformLayout (this=this@entry=0x316400158c00) at ../../third_party/blink/renderer/core/frame/local_frame_view.cc:761 +#272 0x000055f4537eb0bb in blink::LocalFrameView::UpdateLayout () at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:143013984 +#273 blink::LocalFrameView::UpdateStyleAndLayoutInternal (this=this@entry=0x316400158c00) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:143013762 +#274 0x000055f4537ecb9b in blink::LocalFrameView::UpdateStyleAndLayout (this=0x316400158c00) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:143671655 +#275 0x000055f4544b9cd2 in blink::Document::UpdateStyleAndLayout (this=0x3164001e2530, reason=26) at ../../third_party/blink/renderer/core/dom/document.cc:2784 +#276 0x000055f455fc4492 in blink::FrameSelection::ComputeAbsoluteBounds(gfx::Rect&, gfx::Rect&) const [clone .constprop.0] () at ../../third_party/blink/renderer/core/editing/frame_selection.cc:656 +#277 0x000055f453827206 in blink::WebFrameWidgetImpl::CalculateSelectionBounds (this=this@entry=0x316400156138, anchor_root_frame=..., focus_root_frame=..., bounding_box_in_root_frame=bounding_box_in_root_frame@entry=0x7ffefa91a820) + at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:132558908 +#278 0x000055f4538296b2 in blink::WebFrameWidgetImpl::GetSelectionBoundsInWindow (this=0x316400156138, focus=0x4140017b980, anchor=0x4140017b990, bounding_box=0x4140017b9a0, focus_dir=0x7ffefa91a8d0, anchor_dir=0x7ffefa91a8c8, is_anchor_first=0x7ffefa91a8c7) + at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:78747162 +#279 0x000055f454433e25 in blink::WidgetBase::UpdateSelectionBounds (this=this@entry=0x4140017b800) at ../../third_party/blink/renderer/platform/widget/widget_base.cc:1468 +#280 0x000055f454433f8f in blink::WidgetBase::WillBeginMainFrame (this=0x4140017b800) at ../../third_party/blink/renderer/platform/widget/widget_base.cc:967 +#281 0x000055f4529a093c in cc::LayerTreeHost::WillBeginMainFrame (this=0x414000ed500) at ../../cc/trees/layer_tree_host.cc:354 +#282 0x000055f452a2f399 in cc::ProxyMain::BeginMainFrame (this=, begin_main_frame_state=std::unique_ptr = {...}) at ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:1002 +#283 0x000055f452a8b781 in base::internal::DecayedFunctorTraits >), base::WeakPtr&&, std::unique_ptr >&&>::Invoke >), base::WeakPtr const&, std::unique_ptr > > (method=, receiver_ptr=...) at /usr/include/c++/14/bits/unique_ptr.h:191 +#284 base::internal::InvokeHelper >), base::WeakPtr&&, std::unique_ptr >&&>, void, 0ul, 1ul>::MakeItSo >), std::tuple, std::unique_ptr > >>(void (cc::ProxyMain::*&&)(std::unique_ptr >), std::tuple, std::unique_ptr > >&&) ( + functor=@0x41400589d30: (void (cc::ProxyMain::*)(cc::ProxyMain * const, std::unique_ptr >)) 0x55f452a2ef80 >)>, bound=...) at ../../base/functional/bind_internal.h:954 +#285 base::internal::Invoker >), base::WeakPtr&&, std::unique_ptr >&&>, base::internal::BindState >), base::WeakPtr, std::unique_ptr > >, void ()>::RunImpl >), std::tuple, std::unique_ptr > >, 0ul, 1ul>(void (cc::ProxyMain::*&&)(std::unique_ptr >), std::tuple, std::unique_ptr > >&&, std::integer_sequence) ( + functor=@0x41400589d30: (void (cc::ProxyMain::*)(cc::ProxyMain * const, std::unique_ptr >)) 0x55f452a2ef80 >)>, bound=...) at ../../base/functional/bind_internal.h:1067 +#286 base::internal::Invoker >), base::WeakPtr&&, std::unique_ptr >&&>, base::internal::BindState >), base::WeakPtr, std::unique_ptr > >, void ()>::RunOnce(base::internal::BindStateBase*) (base=0x41400589d10) at ../../base/functional/bind_internal.h:980 +#287 0x000055f4565b518d in base::OnceCallback::Run() && (this=0x41400018678) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:200122192 +#288 base::TaskAnnotator::RunTaskImpl(base::PendingTask&) [clone .isra.0] (pending_task=..., this=) at ../../base/task/common/task_annotator.cc:203 +#289 0x000055f451ca3130 in base::TaskAnnotator::RunTask > (this=0x4140004c200, event_name=..., pending_task=...) + at ../../base/task/common/task_annotator.h:90 +#290 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl (this=, continuation_lazy_now=0x7ffefa91af40) at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:470 +#291 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork (this=) at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:332 +#292 0x000055f451ca5027 in base::MessagePumpDefault::Run (this=0x414000040c0, delegate=0x4140004c0f8) at ../../base/message_loop/message_pump_default.cc:40 +#293 0x000055f451ca14e9 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (this=0x4140004c000, application_tasks_allowed=true, timeout=...) at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:640 +#294 0x000055f451ca18b2 in base::RunLoop::Run (this=0x7ffefa91b550, location=...) at ../../base/run_loop.cc:134 +#295 base::RunLoop::Run (this=, location=...) at ../../base/run_loop.cc:106 +#296 0x000055f4535391b5 in content::RendererMain (parameters=...) at ../../content/renderer/renderer_main.cc:361 +#297 0x000055f44f2d48af in content::RunZygote (delegate=delegate@entry=0x7ffefa91c040) at /usr/include/c++/14/bits/unique_ptr.h:191 +#298 0x000055f44f2d8b18 in content::RunOtherNamedProcessTypeMain (process_type="zygote", main_function_params=..., delegate=0x7ffefa91c040) at ../../content/app/content_main_runner_impl.cc:807 +#299 content::ContentMainRunnerImpl::Run (this=) at ../../content/app/content_main_runner_impl.cc:1167 +#300 0x000055f44eeb846c in content::RunContentProcess (params=..., content_main_runner=0x4100006d880) at ../../content/app/content_main.cc:354 +#301 content::ContentMain (params=...) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:166189489 +#302 main (argc=argc@entry=2, argv=argv@entry=0x7ffefa91c5d8) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:166189474 +#303 0x00007ffa48c2a2ae in __libc_start_call_main (main=main@entry=0x55f44eeb80a0 , argc=argc@entry=2, argv=argv@entry=0x7ffefa91c5d8) at ../sysdeps/nptl/libc_start_call_main.h:58 +#304 0x00007ffa48c2a379 in __libc_start_main_impl (main=0x55f44eeb80a0 , argc=2, argv=0x7ffefa91c5d8, init=, fini=, rtld_fini=, stack_end=0x7ffefa91c5c8) at ../csu/libc-start.c:360 +#305 0x000055f44eee5b45 in _start () at ../sysdeps/x86_64/start.S:115 + +From 3c55b5cb524b2f304a623bd0ddd8321f8fa2e37e Mon Sep 17 00:00:00 2001 +From: Martin Negyokru +Date: Thu, 19 Sep 2024 16:55:22 +0200 +Subject: Fix UAF in FontCache + +Fixes a rare crash related to font caching. +Upstream issue: https://issues.chromium.org/issues/342778288 +Its been only fixed for ASAN builds for some reason. + +This change backports the fix: https://crrev.com/c/5629253 +and extends the ASAN guards with IS_QTWEBENGINE. + +Change-Id: I0fb7348ef97882fed199d1432b3a2543804e8de5 +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/592190 +Reviewed-by: Peter Varga +--- + .../renderer/platform/fonts/font_face_creation_params.h | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/chromium/third_party/blink/renderer/platform/fonts/font_face_creation_params.h b/chromium/third_party/blink/renderer/platform/fonts/font_face_creation_params.h +index 8f0aa2f1c14..9d4c07637fc 100644 +--- a/third_party/blink/renderer/platform/fonts/font_face_creation_params.h ++++ b/third_party/blink/renderer/platform/fonts/font_face_creation_params.h +@@ -38,6 +38,8 @@ + #include "third_party/blink/renderer/platform/wtf/text/case_folding_hash.h" + #include "third_party/blink/renderer/platform/wtf/text/string_hasher.h" + ++#include ++ + namespace blink { + + enum FontFaceCreationType { +@@ -79,7 +81,7 @@ class FontFaceCreationParams { + } + const std::string& Filename() const { + DCHECK_EQ(creation_type_, kCreateFontByFciIdAndTtcIndex); +-#if defined(ADDRESS_SANITIZER) ++#if 1 + DCHECK(filename_.has_value()); + return *filename_; + #else +@@ -126,7 +128,7 @@ class FontFaceCreationParams { + AtomicString family_; + + void SetFilename(std::string& filename) { +-#if defined(ADDRESS_SANITIZER) ++#if 1 + *filename_ = filename; + #else + filename_ = filename; +@@ -134,7 +136,7 @@ class FontFaceCreationParams { + } + + bool FilenameEqual(const FontFaceCreationParams& other) const { +-#if defined(ADDRESS_SANITIZER) ++#if 1 + if (!filename_.has_value() || !other.filename_.has_value()) { + return filename_.has_value() == other.filename_.has_value(); + } +@@ -145,14 +147,14 @@ class FontFaceCreationParams { + } + + bool HasFilename() const { +-#if defined(ADDRESS_SANITIZER) ++#if 1 + return filename_.has_value(); + #else + return true; + #endif + } + +-#if defined(ADDRESS_SANITIZER) ++#if 1 + // We put the `std::string` behind an optional as ASAN counter checks require + // that we properly call constructors and destructors for all strings. This is + // not the case when `FontFaceCreationParams` is used in `WTF::HashMap` as key +-- +cgit v1.2.3 + diff --git a/build-without-speech-service.patch b/build-without-speech-service.patch new file mode 100644 index 0000000..3e27f84 --- /dev/null +++ b/build-without-speech-service.patch @@ -0,0 +1,10 @@ +--- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 ++++ src/chrome/test/BUILD.gn 2025-01-01 21:35:00.776064485 +0100 +@@ -8317,7 +8317,6 @@ test("unit_tests") { + "//chrome/browser/ui/zoom:unit_tests", + "//chrome/browser/web_applications:web_applications_test_support", + "//chrome/common/accessibility:mojo_bindings", +- "//chrome/services/speech:unit_tests", + "//components/app_constants", + "//components/color", + "//components/commerce/core:account_checker_test_support", diff --git a/chromium-102-compiler.patch b/chromium-102-compiler.patch index b11a9b0..6996d3b 100644 --- a/chromium-102-compiler.patch +++ b/chromium-102-compiler.patch @@ -21,11 +21,9 @@ Subject: [PATCH] Disable various compiler configs build/config/compiler/BUILD.gn | 114 +++++---------------------------- 1 file changed, 17 insertions(+), 97 deletions(-) -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index d40843b..b92f03b 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -305,9 +305,7 @@ config("compiler") { +--- src/build/config/compiler/BUILD.gn.orig 2024-12-08 18:34:51.744673228 +0100 ++++ src/build/config/compiler/BUILD.gn 2024-12-18 11:06:05.334038035 +0100 +@@ -310,9 +310,7 @@ config("compiler") { configs += [ # See the definitions below. @@ -35,7 +33,7 @@ index d40843b..b92f03b 100644 ":compiler_codegen", ":compiler_deterministic", ] -@@ -337,7 +335,12 @@ config("compiler") { +@@ -342,7 +340,12 @@ config("compiler") { if (!is_win) { # Common POSIX compiler flags setup. # -------------------------------- @@ -49,7 +47,7 @@ index d40843b..b92f03b 100644 # Stack protection. ShadowCallStack and Stack protector address the same # problems. Therefore, we only enable one or the other. Clang advertises SCS as -@@ -478,10 +481,6 @@ config("compiler") { +@@ -487,10 +490,6 @@ config("compiler") { # Linux/Android/Fuchsia common flags setup. # --------------------------------- if (is_linux || is_chromeos || is_android || is_fuchsia) { @@ -60,64 +58,8 @@ index d40843b..b92f03b 100644 if (!is_clang) { # Use pipes for communicating between sub-processes. Faster. -@@ -545,55 +544,6 @@ config("compiler") { - ldflags += [ "-Wl,-z,keep-text-section-prefix" ] - } - -- if (is_clang && !is_nacl && current_os != "zos") { -- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] -- if (save_reproducers_on_lld_crash && use_lld) { -- ldflags += [ -- "-fcrash-diagnostics=all", -- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir, -- ] -- } -- -- # TODO(hans): Remove this once Clang generates better optimized debug info -- # by default. https://crbug.com/765793 -- cflags += [ -- "-mllvm", -- "-instcombine-lower-dbg-declare=0", -- ] -- if (!is_debug && use_thin_lto && is_a_target_toolchain) { -- if (is_win) { -- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ] -- } else { -- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ] -- } -- } -- -- # TODO(crbug.com/40283598): This causes binary size growth and potentially -- # other problems. -- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version. -- if (default_toolchain != "//build/toolchain/cros:target" && -- !llvm_android_mainline) { -- cflags += [ -- "-mllvm", -- "-split-threshold-for-reg-with-hint=0", -- ] -- if (use_thin_lto && is_a_target_toolchain) { -- if (is_win) { -- ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ] -- } else { -- ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ] -- } -- } -- } -- -- # TODO(crbug.com/40192287): Investigate why/if this should be needed. -- if (is_win) { -- cflags += [ "/clang:-ffp-contract=off" ] -- } else { -- cflags += [ "-ffp-contract=off" ] -- } -- } -- - # C11/C++11 compiler flags setup. - # --------------------------- - if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) || -@@ -1063,11 +1013,6 @@ config("compiler") { - defines += [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ] +@@ -1107,11 +1106,6 @@ config("libcxx_hardening") { + defines = [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ] } - # Enable libstdc++ hardening lightweight assertions. Those have a low @@ -128,7 +70,7 @@ index d40843b..b92f03b 100644 } # The BUILDCONFIG file sets this config on targets by default, which means when -@@ -1133,7 +1078,8 @@ config("thinlto_optimize_max") { +@@ -1177,7 +1171,8 @@ config("thinlto_optimize_max") { # without using everything that "compiler" brings in. Options that # tweak code generation for a particular CPU do not belong here! # See "compiler_codegen", below. @@ -138,54 +80,7 @@ index d40843b..b92f03b 100644 cflags = [] ldflags = [] defines = [] -@@ -1516,46 +1462,6 @@ config("compiler_deterministic") { - } - } - -- # Makes builds independent of absolute file path. -- if (is_clang && strip_absolute_paths_from_debug_symbols) { -- # If debug option is given, clang includes $cwd in debug info by default. -- # For such build, this flag generates reproducible obj files even we use -- # different build directory like "out/feature_a" and "out/feature_b" if -- # we build same files with same compile flag. -- # Other paths are already given in relative, no need to normalize them. -- if (is_nacl) { -- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. -- cflags += [ -- "-Xclang", -- "-fdebug-compilation-dir", -- "-Xclang", -- ".", -- ] -- } else { -- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= -- # and -fcoverage-compilation-dir=. -- cflags += [ "-ffile-compilation-dir=." ] -- swiftflags += [ "-file-compilation-dir=." ] -- } -- if (!is_win) { -- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) -- asmflags = [ "-Wa,-fdebug-compilation-dir,." ] -- } -- -- if (is_win && use_lld) { -- if (symbol_level == 2 || (is_clang && using_sanitizer)) { -- # Absolutize source file paths for PDB. Pass the real build directory -- # if the pdb contains source-level debug information and if linker -- # reproducibility is not critical. -- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ] -- } else { -- # Use a fake fixed base directory for paths in the pdb to make the pdb -- # output fully deterministic and independent of the build directory. -- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ] -- } -- } -- } -- - # Tells the compiler not to use absolute paths when passing the default - # paths to the tools it invokes. We don't want this because we don't - # really need it and it can mess up the RBE cache entries. -@@ -1732,7 +1638,8 @@ config("treat_warnings_as_errors") { +@@ -1811,7 +1806,8 @@ config("treat_warnings_as_errors") { # Collects all warning flags that are used by default. This is used as a # subconfig of both chromium_code and no_chromium_code. This way these # flags are guaranteed to appear on the compile command line after -Wall. @@ -195,7 +90,7 @@ index d40843b..b92f03b 100644 cflags = [] cflags_c = [] cflags_cc = [] -@@ -1982,11 +1889,7 @@ config("chromium_code") { +@@ -2064,11 +2060,7 @@ config("chromium_code") { defines = [ "_HAS_NODISCARD" ] } } else { @@ -208,7 +103,7 @@ index d40843b..b92f03b 100644 # In Chromium code, we define __STDC_foo_MACROS in order to get the # C99 macros on Mac and Linux. -@@ -1995,24 +1898,6 @@ config("chromium_code") { +@@ -2077,24 +2069,6 @@ config("chromium_code") { "__STDC_FORMAT_MACROS", ] @@ -233,7 +128,7 @@ index d40843b..b92f03b 100644 if (is_apple) { cflags_objc = [ "-Wimplicit-retain-self" ] cflags_objcc = [ "-Wimplicit-retain-self" ] -@@ -2158,7 +2043,6 @@ config("no_rtti") { +@@ -2245,7 +2219,6 @@ config("no_rtti") { config("export_dynamic") { # TODO(crbug.com/40118868): Revisit after target_os flip is completed. if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) { @@ -241,7 +136,7 @@ index d40843b..b92f03b 100644 } } -@@ -2246,7 +2130,8 @@ config("wexit_time_destructors") { +@@ -2333,7 +2306,8 @@ config("wexit_time_destructors") { # gcc 4.9 and earlier had no way of suppressing this warning without # suppressing the rest of them. Here we centralize the identification of # the gcc 4.9 toolchains. @@ -251,7 +146,7 @@ index d40843b..b92f03b 100644 cflags = [] if (is_clang) { cflags += [ "-Wno-incompatible-pointer-types" ] -@@ -2364,7 +2249,8 @@ if (is_win) { +@@ -2451,7 +2425,8 @@ if (is_win) { common_optimize_on_cflags += [ "-fno-math-errno" ] } @@ -261,7 +156,7 @@ index d40843b..b92f03b 100644 if (!is_win) { if (enable_frame_pointers) { cflags = [ "-fno-omit-frame-pointer" ] -@@ -2405,7 +2291,8 @@ config("default_stack_frames") { +@@ -2492,7 +2467,8 @@ config("default_stack_frames") { # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000 # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000 # [2]: https://crrev.com/c/5447532 @@ -269,9 +164,9 @@ index d40843b..b92f03b 100644 +config("optimize") { } +config("xoptimize") { if (is_win) { - cflags = [ "/O2" ] + common_optimize_on_cflags - -@@ -2446,7 +2333,8 @@ config("optimize") { + # clang-cl's /O2 corresponds to clang's -O3, and really want -O2 for + # consistency with the other platforms. +@@ -2541,7 +2517,8 @@ config("optimize") { } # Turn off optimizations. @@ -281,7 +176,7 @@ index d40843b..b92f03b 100644 if (is_win) { cflags = [ "/Od", # Disable optimization. -@@ -2486,7 +2374,8 @@ config("no_optimize") { +@@ -2581,7 +2558,8 @@ config("no_optimize") { # Turns up the optimization level. Used to explicitly enable -O2 instead of # -Os for select targets on platforms that use optimize_for_size. No-op # elsewhere. @@ -291,7 +186,7 @@ index d40843b..b92f03b 100644 if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2519,7 +2408,8 @@ config("optimize_max") { +@@ -2614,7 +2592,8 @@ config("optimize_max") { # # TODO(crbug.com/41259697) - rework how all of these configs are related # so that we don't need this disclaimer. @@ -301,7 +196,7 @@ index d40843b..b92f03b 100644 if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2548,7 +2438,8 @@ config("optimize_speed") { +@@ -2643,7 +2622,8 @@ config("optimize_speed") { } } @@ -311,7 +206,7 @@ index d40843b..b92f03b 100644 cflags = [ "-O1" ] + common_optimize_on_cflags rustflags = [ "-Copt-level=1" ] ldflags = common_optimize_on_ldflags -@@ -2681,7 +2572,8 @@ config("win_pdbaltpath") { +@@ -2774,7 +2754,8 @@ config("win_pdbaltpath") { } # Full symbols. @@ -319,9 +214,9 @@ index d40843b..b92f03b 100644 +config("symbols") { cflags = ["-g2"] } +config("xsymbols") { rustflags = [] + configs = [] if (is_win) { - if (is_clang) { -@@ -2831,7 +2723,8 @@ config("symbols") { +@@ -2936,7 +2917,8 @@ config("symbols") { # Minimal symbols. # This config guarantees to hold symbol for stack trace which are shown to user # when crash happens in unittests running on buildbot. @@ -331,7 +226,7 @@ index d40843b..b92f03b 100644 rustflags = [] if (is_win) { # Functions, files, and line tables only. -@@ -2916,7 +2809,8 @@ config("minimal_symbols") { +@@ -3021,7 +3003,8 @@ config("minimal_symbols") { # This configuration contains function names only. That is, the compiler is # told to not generate debug information and the linker then just puts function # names in the final debug information. diff --git a/chromium-123-qrcode.patch b/chromium-123-qrcode.patch new file mode 100644 index 0000000..2e0228a --- /dev/null +++ b/chromium-123-qrcode.patch @@ -0,0 +1,68 @@ +--- a/components/qr_code_generator/BUILD.gn ++++ b/components/qr_code_generator/BUILD.gn +@@ -38,24 +38,11 @@ + "qr_code_generator.h", + ] + deps = [ +- ":qr_code_generator_ffi_glue", + "//base", + ] + public_deps = [ + ":error", + "//base", +- ] +-} +- +-rust_static_library("qr_code_generator_ffi_glue") { +- allow_unsafe = true # Needed for FFI that underpins the `cxx` crate. +- crate_root = "qr_code_generator_ffi_glue.rs" +- sources = [ "qr_code_generator_ffi_glue.rs" ] +- cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ] +- visibility = [ ":qr_code_generator" ] +- deps = [ +- ":error", +- "//third_party/rust/qr_code/v2:lib", + ] + } + +--- a/components/qr_code_generator/qr_code_generator.cc ++++ b/components/qr_code_generator/qr_code_generator.cc +@@ -8,9 +8,7 @@ + #include + + #include "base/check_op.h" +-#include "base/containers/span_rust.h" + #include "base/numerics/safe_conversions.h" +-#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h" + + namespace qr_code_generator { + +@@ -22,27 +20,7 @@ + base::expected GenerateCode( + base::span in, + std::optional min_version) { +- rust::Slice rs_in = base::SpanToRustSlice(in); +- +- // `min_version` might come from a fuzzer and therefore we use a lenient +- // `saturated_cast` instead of a `checked_cast`. +- int16_t rs_min_version = +- base::saturated_cast(min_version.value_or(0)); +- +- std::vector result_pixels; +- size_t result_width = 0; +- Error result_error = Error::kUnknownError; +- bool result_is_success = generate_qr_code_using_rust( +- rs_in, rs_min_version, result_pixels, result_width, result_error); +- +- if (!result_is_success) { +- return base::unexpected(result_error); +- } +- GeneratedCode code; +- code.data = std::move(result_pixels); +- code.qr_size = base::checked_cast(result_width); +- CHECK_EQ(code.data.size(), static_cast(code.qr_size * code.qr_size)); +- return code; ++ return base::unexpected(Error::kUnknownError); + } + + } // namespace qr_code_generator diff --git a/chromium-124-shims.patch b/chromium-124-shims.patch deleted file mode 100644 index 3f11198..0000000 --- a/chromium-124-shims.patch +++ /dev/null @@ -1,208 +0,0 @@ -diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_flags.gn src/build/linux/unbundle/absl_flags.gn ---- src/build/linux/unbundle.orig/absl_flags.gn -+++ src/build/linux/unbundle/absl_flags.gn -@@ -5,14 +5,36 @@ pkg_config("system_absl_flags") { - packages = [ "absl_flags" ] - } - -+pkg_config("absl_flags_config") { -+ packages = [ "absl_flags_config" ] -+} -+ - pkg_config("system_absl_flags_parse") { - packages = [ "absl_flags_parse" ] - } - -+pkg_config("system_absl_flags_reflection") { -+ packages = [ "absl_flags_reflection" ] -+} -+ - pkg_config("system_absl_flags_usage") { - packages = [ "absl_flags_usage" ] - } - -+shim_headers("flags_config_shim") { -+ root_path = "." -+ prefix = "absl/flags/" -+ headers = [ -+ "config.h", -+ "usage_config.h", -+ ] -+} -+ -+source_set("config") { -+ deps = [ ":flags_config_shim" ] -+ public_configs = [ ":absl_flags_config" ] -+} -+ - shim_headers("flag_shim") { - root_path = "." - prefix = "absl/flags/" -@@ -38,6 +60,20 @@ source_set("parse") { - public_configs = [ ":system_absl_flags_parse" ] - } - -+shim_headers("flags_reflection_shim") { -+ root_path = "." -+ prefix = "absl/flags/" -+ headers = [ -+ "internal/registry.h", -+ "reflection.h", -+ ] -+} -+ -+source_set("reflection") { -+ deps = [ ":flags_reflection_shim" ] -+ public_configs = [ ":system_absl_flags_reflection" ] -+} -+ - shim_headers("usage_shim") { - root_path = "." - prefix = "absl/flags/" -diff '--color=auto' -urp src/build/linux/unbundle.orig/absl_log.gn src/build/linux/unbundle/absl_log.gn ---- src/build/linux/unbundle.orig/absl_log.gn -+++ src/build/linux/unbundle/absl_log.gn -@@ -13,9 +13,22 @@ pkg_config("system_absl_die_if_null") { - packages = [ "absl_die_if_null" ] - } - -+pkg_config("system_absl_check") { -+ packages = [ "absl_check" ] -+} -+ - pkg_config("system_absl_log") { - packages = [ "absl_log" ] - } -+ -+pkg_config("system_absl_log_globals") { -+ packages = [ "absl_log_globals" ] -+} -+ -+pkg_config("system_absl_log_initialize") { -+ packages = [ "absl_log_initialize" ] -+} -+ - shim_headers("absl_check_shim") { - root_path = "." - prefix = "absl/log/" -@@ -49,6 +62,39 @@ source_set("die_if_null") { - public_configs = [ ":system_absl_die_if_null" ] - } - -+shim_headers("check_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "check.h" ] -+} -+ -+source_set("check") { -+ deps = [ ":check_shim" ] -+ public_configs = [ ":system_absl_check" ] -+} -+ -+shim_headers("globals_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "globals.h" ] -+} -+ -+source_set("globals") { -+ deps = [ ":globals_shim" ] -+ public_configs = [ ":system_absl_log_globals" ] -+} -+ -+shim_headers("initialize_shim") { -+ root_path = "." -+ prefix = "absl/log/" -+ headers = [ "initialize.h" ] -+} -+ -+source_set("initialize") { -+ deps = [ ":initialize_shim" ] -+ public_configs = [ ":system_absl_log_initialize" ] -+} -+ - shim_headers("log_shim") { - root_path = "." - prefix = "absl/log/" -diff '--color=auto' -urp src/build/linux/unbundle.orig/re2.gn src/build/linux/unbundle/re2.gn ---- src/build/linux/unbundle.orig/re2.gn -+++ src/build/linux/unbundle/re2.gn -@@ -3,6 +3,7 @@ - # found in the LICENSE file. - - import("//build/config/c++/c++.gni") -+import("//build/config/linux/pkg_config.gni") - import("//build/shim_headers.gni") - - assert(!use_custom_libcxx, -@@ -10,6 +11,10 @@ assert(!use_custom_libcxx, - "use_custom_libcxx=true because the library's interface relies on " + - "libstdc++'s std::string and std::vector.") - -+pkg_config("re2_config") { -+ packages = [ "re2" ] -+} -+ - shim_headers("re2_shim") { - root_path = "src" - headers = [ -@@ -23,5 +28,5 @@ shim_headers("re2_shim") { - - source_set("re2") { - deps = [ ":re2_shim" ] -- libs = [ "re2" ] -+ public_configs = [ ":re2_config" ] - } ---- src/build/linux/unbundle/absl_container.gn.orig -+++ src/build/linux/unbundle/absl_container.gn -@@ -117,6 +117,8 @@ source_set("flat_hash_map_test") { - } - source_set("flat_hash_set_test") { - } -+source_set("hash_function_defaults_test") { -+} - source_set("inlined_vector_test") { - } - source_set("node_slot_policy_test") { ---- src/build/linux/unbundle/replace_gn_files.py.orig -+++ src/build/linux/unbundle/replace_gn_files.py -@@ -80,6 +80,7 @@ REPLACEMENTS = { - 'vulkan_memory_allocator' : 'third_party/vulkan_memory_allocator/BUILD.gn', - 'woff2': 'third_party/woff2/BUILD.gn', - 'zlib': 'third_party/zlib/BUILD.gn', -+ 'zstd': 'third_party/zstd/BUILD.gn', - } - - ---- /dev/null -+++ src/build/linux/unbundle/zstd.gn -@@ -0,0 +1,28 @@ -+import("//build/config/linux/pkg_config.gni") -+import("//build/shim_headers.gni") -+ -+pkg_config("system_zstd") { -+ packages = [ "libzstd" ] -+} -+ -+shim_headers("zstd_shim") { -+ root_path = "src/lib" -+ headers = [ -+ "zstd.h", -+ "zstd_errors.h", -+ ] -+} -+ -+source_set("compress") { -+ deps = [ ":zstd_shim" ] -+ public_configs = [ ":system_zstd" ] -+} -+source_set("decompress") { -+ deps = [ ":zstd_shim" ] -+ public_configs = [ ":system_zstd" ] -+} -+ -+source_set("headers") { -+ deps = [ ":zstd_shim" ] -+ public_configs = [ ":system_zstd" ] -+} diff --git a/chromium-125-cloud_authenticator.patch b/chromium-125-cloud_authenticator.patch new file mode 100644 index 0000000..5cd467f --- /dev/null +++ b/chromium-125-cloud_authenticator.patch @@ -0,0 +1,9 @@ +--- a/chrome/browser/webauthn/BUILD.gn ++++ b/chrome/browser/webauthn/BUILD.gn +@@ -26,6 +26,5 @@ + "//url", + ] + +- data_deps = [ "//third_party/cloud_authenticator/test/local_service:cloud_authenticator_test_service" ] + } + } diff --git a/chromium-127-cargo_crate.patch b/chromium-127-cargo_crate.patch new file mode 100644 index 0000000..b2298b2 --- /dev/null +++ b/chromium-127-cargo_crate.patch @@ -0,0 +1,12 @@ +--- a/build/rust/cargo_crate.gni ++++ b/build/rust/cargo_crate.gni +@@ -5,6 +5,8 @@ + import("//build/rust/rust_executable.gni") + import("//build/rust/rust_macro.gni") + import("//build/rust/rust_static_library.gni") ++ ++rust_sysroot="" + + # This template allows for building Cargo crates within gn. + # + diff --git a/chromium-127-crabby.patch b/chromium-127-crabby.patch new file mode 100644 index 0000000..9883b31 --- /dev/null +++ b/chromium-127-crabby.patch @@ -0,0 +1,49 @@ +--- a/third_party/blink/renderer/platform/image-decoders/BUILD.gn ++++ b/third_party/blink/renderer/platform/image-decoders/BUILD.gn +@@ -74,12 +74,9 @@ + sources += [ + "avif/avif_image_decoder.cc", + "avif/avif_image_decoder.h", +- "avif/crabbyavif_image_decoder.cc", +- "avif/crabbyavif_image_decoder.h", + ] + + deps += [ +- "//third_party/crabbyavif", + "//third_party/libavif", + "//third_party/libavifinfo", + ] +--- a/third_party/blink/renderer/platform/image-decoders/image_decoder.cc ++++ b/third_party/blink/renderer/platform/image-decoders/image_decoder.cc +@@ -47,7 +47,6 @@ + + #if BUILDFLAG(ENABLE_AV1_DECODER) + #include "third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.h" +-#include "third_party/blink/renderer/platform/image-decoders/avif/crabbyavif_image_decoder.h" + #endif + + namespace blink { +@@ -192,9 +191,7 @@ + return "image/bmp"; + } + #if BUILDFLAG(ENABLE_AV1_DECODER) +- if (base::FeatureList::IsEnabled(blink::features::kCrabbyAvif) +- ? CrabbyAVIFImageDecoder::MatchesAVIFSignature(fast_reader) +- : AVIFImageDecoder::MatchesAVIFSignature(fast_reader)) { ++ if (AVIFImageDecoder::MatchesAVIFSignature(fast_reader)) { + return "image/avif"; + } + #endif +@@ -300,11 +300,7 @@ + max_decoded_bytes); + #if BUILDFLAG(ENABLE_AV1_DECODER) + } else if (mime_type == "image/avif") { +- if (base::FeatureList::IsEnabled(blink::features::kCrabbyAvif)) { +- decoder = std::make_unique( +- alpha_option, high_bit_depth_decoding_option, color_behavior, +- max_decoded_bytes, animation_option); +- } else { ++ if (true) { + decoder = std::make_unique( + alpha_option, high_bit_depth_decoding_option, color_behavior, + max_decoded_bytes, animation_option); diff --git a/chromium-129-disable-H.264-video-parser-during-demuxing.patch b/chromium-129-disable-H.264-video-parser-during-demuxing.patch new file mode 100644 index 0000000..b4398bb --- /dev/null +++ b/chromium-129-disable-H.264-video-parser-during-demuxing.patch @@ -0,0 +1,32 @@ +diff -up chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc.me chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc +--- chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc.me 2024-09-15 22:12:33.945186323 +0200 ++++ chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc 2024-09-16 10:53:13.334970539 +0200 +@@ -17,14 +17,11 @@ + + namespace media { + +-// Kill switches in case things explode. Remove after M132. ++// Kill switch in case things explode. Remove after M132. + // TODO(crbug.com/355485812): Re-enable this flag. + BASE_FEATURE(kAllowOnlyAudioCodecsDuringDemuxing, + "AllowOnlyAudioCodecsDuringDemuxing", + base::FEATURE_ENABLED_BY_DEFAULT); +-BASE_FEATURE(kForbidH264ParsingDuringDemuxing, +- "ForbidH264ParsingDuringDemuxing", +- base::FEATURE_ENABLED_BY_DEFAULT); + + // Internal buffer size used by AVIO for reading. + // TODO(dalecurtis): Experiment with this buffer size and measure impact on +@@ -118,12 +115,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol + // Enable fast, but inaccurate seeks for MP3. + format_context_->flags |= AVFMT_FLAG_FAST_SEEK; + +- // We don't allow H.264 parsing during demuxing since we have our own parser +- // and the ffmpeg one increases memory usage unnecessarily. +- if (base::FeatureList::IsEnabled(kForbidH264ParsingDuringDemuxing)) { +- format_context_->flags |= AVFMT_FLAG_NOH264PARSE; +- } +- + // Ensures format parsing errors will bail out. From an audit on 11/2017, all + // instances were real failures. Solves bugs like http://crbug.com/710791. + format_context_->error_recognition |= AV_EF_EXPLODE; diff --git a/chromium-130-fontations.patch b/chromium-130-fontations.patch new file mode 100644 index 0000000..7805bed --- /dev/null +++ b/chromium-130-fontations.patch @@ -0,0 +1,93 @@ +--- a/skia/BUILD.gn ++++ b/skia/BUILD.gn +@@ -8,7 +8,6 @@ + import("//build/config/freetype/freetype.gni") + import("//build/config/rust.gni") + import("//build/config/sanitizers/sanitizers.gni") +-import("//build/rust/rust_static_library.gni") + import("//gpu/vulkan/features.gni") + import("//testing/test.gni") + import("//third_party/skia/gn/shared_sources.gni") +@@ -47,27 +46,6 @@ + ] + } + +-source_set("path_bridge") { +- sources = skia_fontations_path_bridge_sources +-} +- +-rust_static_library("bridge_rust_side") { +- allow_unsafe = true +- crate_root = skia_fontations_bridge_root +- sources = skia_fontations_bridge_sources +- cxx_bindings = skia_fontations_bridge_sources +- deps = [ +- ":path_bridge", +- "//third_party/rust/font_types/v0_7:lib", +- "//third_party/rust/read_fonts/v0_22:lib", +- "//third_party/rust/skrifa/v0_22:lib", +- ] +- configs -= [ "//build/config/compiler:chromium_code" ] +- configs += [ +- ":skia_config", +- "//build/config/compiler:no_chromium_code", +- ] +-} + + # External-facing config for dependent code. + config("skia_config") { +@@ -394,15 +373,9 @@ + # See SK_TYPEFACE_FACTORY_FREETYPE + sources += skia_ports_freetype_sources + sources += skia_ports_fontmgr_custom_sources +- sources += skia_ports_typeface_fontations_sources + sources += skia_ports_fontmgr_empty_sources + public += skia_ports_fontmgr_empty_public + +- # Fontations Rust/C++ bridge interfaces. +- deps += [ +- ":bridge_rust_side", +- ":path_bridge", +- ] + } + + if (is_win) { +--- a/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc ++++ b/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc +@@ -12,7 +12,6 @@ + #include "third_party/blink/renderer/platform/fonts/opentype/font_format_check.h" + #include "third_party/skia/include/core/SkStream.h" + #include "third_party/skia/include/core/SkTypeface.h" +-#include "third_party/skia/include/ports/SkTypeface_fontations.h" + + #if BUILDFLAG(IS_WIN) + #include "third_party/blink/renderer/platform/fonts/win/dwrite_font_format_support.h" +@@ -54,7 +53,7 @@ + } + + sk_sp MakeTypefaceDefaultFontMgr(sk_sp data) { +-#if !(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)) ++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)) + if (RuntimeEnabledFeatures::FontationsFontBackendEnabled()) { + std::unique_ptr stream(new SkMemoryStream(data)); + return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); +@@ -82,10 +81,6 @@ + } + #endif + +-sk_sp MakeTypefaceFontations(sk_sp data) { +- std::unique_ptr stream(new SkMemoryStream(data)); +- return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); +-} + + sk_sp MakeVariationsTypeface( + sk_sp data, +@@ -187,7 +182,6 @@ + const FontFormatCheck format_check(data); + const FontInstantiator instantiator = { + MakeTypefaceDefaultFontMgr, +- MakeTypefaceFontations, + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) + MakeTypefaceFallback, + #endif + diff --git a/chromium-vaapi.patch b/chromium-vaapi.patch index cdacde4..4cb7b10 100644 --- a/chromium-vaapi.patch +++ b/chromium-vaapi.patch @@ -18,11 +18,9 @@ Index: electron-17.1.0/chrome/browser/about_flags.cc {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)}, -Index: electron-17.1.0/chrome/browser/flag_descriptions.cc -=================================================================== ---- electron-17.1.0.orig/chrome/browser/flag_descriptions.cc 2022-03-07 17:20:30.960813654 +0100 -+++ electron-17.1.0/chrome/browser/flag_descriptions.cc 2022-03-09 08:25:19.662417046 +0100 -@@ -4031,12 +4031,24 @@ const char kUseAngleGL[] = "OpenGL"; +--- src/chrome/browser/flag_descriptions.cc.orig 2024-12-08 18:34:53.268006605 +0100 ++++ src/chrome/browser/flag_descriptions.cc 2025-01-01 20:24:47.007188847 +0100 +@@ -5838,12 +5838,24 @@ const char kUseAngleGL[] = "OpenGL"; #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -44,14 +42,12 @@ Index: electron-17.1.0/chrome/browser/flag_descriptions.cc + +#if BUILDFLAG(IS_CHROMEOS_ASH) + - const char kAdaptiveChargingForTestingName[] = - "Show adaptive charging notifications for testing"; - const char kAdaptiveChargingForTestingDescription[] = -Index: electron-17.1.0/chrome/browser/flag_descriptions.h -=================================================================== ---- electron-17.1.0.orig/chrome/browser/flag_descriptions.h 2022-03-07 17:20:30.960813654 +0100 -+++ electron-17.1.0/chrome/browser/flag_descriptions.h 2022-03-09 08:25:19.666416981 +0100 -@@ -2305,9 +2305,21 @@ extern const char kUseAngleGL[]; + const char kAccessibilityFilterKeysName[] = "Filter keys"; + const char kAccessibilityFilterKeysDescription[] = + "Enables settings to filter key presses in various ways, such as slow keys " +--- src/chrome/browser/flag_descriptions.h.orig 2024-12-08 18:34:53.268006605 +0100 ++++ src/chrome/browser/flag_descriptions.h 2025-01-01 20:26:07.993071516 +0100 +@@ -3375,9 +3375,21 @@ extern const char kUseAngleGL[]; #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -70,6 +66,6 @@ Index: electron-17.1.0/chrome/browser/flag_descriptions.h + +// Chrome OS ------------------------------------------------------------------ + - extern const char kAdaptiveChargingName[]; - extern const char kAdaptiveChargingDescription[]; + extern const char kAccessibilityFilterKeysName[]; + extern const char kAccessibilityFilterKeysDescription[]; diff --git a/color_provider-incomplete-ColorProviderInternal.patch b/color_provider-incomplete-ColorProviderInternal.patch deleted file mode 100644 index 416ee4f..0000000 --- a/color_provider-incomplete-ColorProviderInternal.patch +++ /dev/null @@ -1,44 +0,0 @@ -From ef8e6beaebcfc3e143b249ba76c177fbabd3b4ea Mon Sep 17 00:00:00 2001 -From: Yichen -Date: Thu, 23 May 2024 23:44:41 +0000 -Subject: [PATCH] ui: fix gcc/libstdc++ build break - -Bug: 340815321 -Change-Id: Ibf443f9f16dfff164e1f4d49a58582fb7a6aca1d -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5565320 -Reviewed-by: Xiyuan Xia -Commit-Queue: Yichen Zhou -Cr-Commit-Position: refs/heads/main@{#1305426} ---- - ui/color/color_provider.cc | 3 ++- - ui/color/color_provider.h | 3 +-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/ui/color/color_provider.cc b/ui/color/color_provider.cc -index 1597715de1f63c..3e0ffed9f4d4c4 100644 ---- a/ui/color/color_provider.cc -+++ b/ui/color/color_provider.cc -@@ -118,7 +118,8 @@ class ColorProvider::ColorProviderInternal { - //////////////////////////////////////////////////////////////////////////////// - // ColorProvider: - --ColorProvider::ColorProvider() = default; -+ColorProvider::ColorProvider() -+ : internal_(std::make_unique()) {} - - ColorProvider::ColorProvider(ColorProvider&&) = default; - -diff --git a/ui/color/color_provider.h b/ui/color/color_provider.h -index 50fff33ae6ab6d..6ac6ed6938cf24 100644 ---- a/ui/color/color_provider.h -+++ b/ui/color/color_provider.h -@@ -65,8 +65,7 @@ class COMPONENT_EXPORT(COLOR) ColorProvider { - // bind to it. - class ColorProviderInternal; - -- std::unique_ptr internal_ = -- std::make_unique(); -+ std::unique_ptr internal_; - }; - - } // namespace ui diff --git a/common.gypi-compiler.patch b/common.gypi-compiler.patch index aed8805..93c376a 100644 --- a/common.gypi-compiler.patch +++ b/common.gypi-compiler.patch @@ -1,6 +1,6 @@ ---- src/third_party/electron_node/common.gypi.orig 2024-05-09 09:30:23.202414200 +0000 -+++ src/third_party/electron_node/common.gypi 2024-05-10 17:53:01.801592000 +0000 -@@ -428,10 +428,15 @@ +--- src/third_party/electron_node/common.gypi.orig 2024-12-08 18:45:44.261359453 +0100 ++++ src/third_party/electron_node/common.gypi 2024-12-18 11:12:53.414653184 +0100 +@@ -487,10 +487,15 @@ 'ldflags': [ '-pthread' ], }], [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { @@ -11,14 +11,14 @@ + # `-fvisibility=hidden` is something we're adding to fix downstream overzealous exports. + # The electron headers annotate their visibility correctly, but many third-party code does not which leads to bloated builds. + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-fpic', '-fno-semantic-interposition', '-fvisibility=hidden' ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ], + 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++20' ], 'defines': [ '__STDC_FORMAT_MACROS' ], - 'ldflags': [ '-rdynamic' ], + #'ldflags': [ '-rdynamic' ], this is totally bogus — we are building a plugin, not a plugin host 'target_conditions': [ # The 1990s toolchain on SmartOS can't handle thin archives. ['_type=="static_library" and OS=="solaris"', { -@@ -608,29 +613,7 @@ +@@ -670,29 +675,7 @@ '-Wl,--export-dynamic', ], }], diff --git a/cr130-abseil-remove-unused-deps.patch b/cr130-abseil-remove-unused-deps.patch new file mode 100644 index 0000000..15bc602 --- /dev/null +++ b/cr130-abseil-remove-unused-deps.patch @@ -0,0 +1,49 @@ +--- src/third_party/abseil-cpp/BUILD.gn.orig 2024-12-08 18:35:00.641340155 +0100 ++++ src/third_party/abseil-cpp/BUILD.gn 2025-01-01 21:58:32.559624434 +0100 +@@ -84,13 +83,9 @@ group("absl_component_deps") { + "//third_party/abseil-cpp/absl/hash", + "//third_party/abseil-cpp/absl/log:absl_check", + "//third_party/abseil-cpp/absl/log:absl_log", +- "//third_party/abseil-cpp/absl/log:absl_vlog_is_on", + "//third_party/abseil-cpp/absl/log:die_if_null", + "//third_party/abseil-cpp/absl/log:globals", + "//third_party/abseil-cpp/absl/log:initialize", +- "//third_party/abseil-cpp/absl/log:log_entry", +- "//third_party/abseil-cpp/absl/log:log_sink", +- "//third_party/abseil-cpp/absl/log:log_sink_registry", + "//third_party/abseil-cpp/absl/memory", + "//third_party/abseil-cpp/absl/meta:type_traits", + "//third_party/abseil-cpp/absl/numeric:bits", +@@ -305,8 +288,6 @@ if (absl_build_tests) { + "absl/container:flat_hash_set_test", + "absl/container:hash_function_defaults_test", + "absl/container:inlined_vector_test", +- "absl/container:node_hash_map_test", +- "absl/container:node_hash_set_test", + "absl/container:node_slot_policy_test", + "absl/container:raw_hash_set_allocator_test", + "absl/container:raw_hash_set_test", +@@ -315,11 +296,8 @@ if (absl_build_tests) { + "absl/crc:crc_cord_state_test", + "absl/crc:crc_memcpy_test", + "absl/crc:non_temporal_memcpy_test", +- "absl/debugging:bounded_utf8_length_sequence_test", +- "absl/debugging:decode_rust_punycode_test", + "absl/debugging:demangle_rust_test", + "absl/debugging:stacktrace_test", +- "absl/debugging:utf8_for_code_point_test", + "absl/flags:flag_test", + "absl/functional:any_invocable_test", + "absl/functional:function_ref_test", +@@ -382,11 +360,7 @@ if (absl_build_tests) { + "absl/strings:str_format_test", + "absl/strings:str_replace_test", + "absl/strings:string_view_test", +- "absl/synchronization:barrier_test", +- "absl/synchronization:graphcycles_test", + "absl/synchronization:kernel_timeout_internal_test", +- "absl/synchronization:mutex_test", +- "absl/synchronization:per_thread_sem_test", + "absl/synchronization:waiter_test", + "absl/time:time_test", + "absl/types:optional_test", diff --git a/cr130-absl-base.patch b/cr130-absl-base.patch new file mode 100644 index 0000000..ce4f984 --- /dev/null +++ b/cr130-absl-base.patch @@ -0,0 +1,99 @@ +--- src/build/linux/unbundle/absl_base.gn.orig 2025-01-02 10:33:14.819582911 +0100 ++++ src/build/linux/unbundle/absl_base.gn 2025-01-02 12:14:46.875133605 +0100 +@@ -13,6 +13,14 @@ pkg_config("system_absl_core_headers") { + packages = [ "absl_core_headers" ] + } + ++pkg_config("system_absl_dynamic_annotations") { ++ packages = [ "absl_dynamic_annotations" ] ++} ++ ++pkg_config("system_absl_log_severity") { ++ packages = [ "absl_log_severity" ] ++} ++ + pkg_config("system_absl_nullability") { + packages = [ "absl_nullability" ] + } +@@ -21,13 +29,16 @@ pkg_config("system_absl_prefetch") { + packages = [ "absl_prefetch" ] + } + ++pkg_config("system_absl_raw_logging_internal") { ++ packages = [ "absl_raw_logging_internal" ] ++} ++ + shim_headers("base_shim") { + root_path = "." + prefix = "absl/base/" + headers = [ + "call_once.h", + "casts.h", +- "dynamic_annotations.h", + ] + } + +@@ -69,6 +80,28 @@ source_set("core_headers") { + public_configs = [ ":system_absl_core_headers" ] + } + ++shim_headers("dynamic_annotations_shim") { ++ root_path = "." ++ prefix = "absl/base/" ++ headers = [ "dynamic_annotations.h" ] ++} ++ ++source_set("dynamic_annotations") { ++ deps = [ ":dynamic_annotations_shim" ] ++ public_configs = [ ":system_absl_dynamic_annotations" ] ++} ++ ++shim_headers("log_severity_shim") { ++ root_path = "." ++ prefix = "absl/base/" ++ headers = [ "log_severity.h" ] ++} ++ ++source_set("log_severity") { ++ deps = [ ":log_severity_shim" ] ++ public_configs = [ ":system_absl_log_severity" ] ++} ++ + shim_headers("nullability_shim") { + root_path = "." + prefix = "absl/base/" +@@ -91,6 +124,17 @@ source_set("prefetch") { + public_configs = [ ":system_absl_prefetch" ] + } + ++shim_headers("raw_logging_internal_shim") { ++ root_path = "." ++ prefix = "absl/base/" ++ headers = [ "internal/raw_logging.h" ] ++} ++ ++source_set("raw_logging_internal") { ++ deps = [ ":raw_logging_internal_shim" ] ++ public_configs = [ ":system_absl_raw_logging_internal" ] ++} ++ + source_set("no_destructor") { + # Dummy — unavailable with abseil 202308 and chromium 122 does not use it + } +@@ -99,7 +143,15 @@ source_set("config_test") { + } + source_set("no_destructor_test") { + } ++source_set("nullability_default_nonnull_test") { ++} + source_set("nullability_test") { + } ++source_set("poison_test") { ++} + source_set("prefetch_test") { + } ++source_set("tracing_internal_strong_test") { ++} ++source_set("tracing_internal_weak_test") { ++} +\ Brak znaku nowej linii na końcu pliku diff --git a/crashpad-use-system-abseil.patch b/crashpad-use-system-abseil.patch deleted file mode 100644 index 807c334..0000000 --- a/crashpad-use-system-abseil.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/components/crash/core/app/crashpad.cc -+++ b/components/crash/core/app/crashpad.cc -@@ -28,7 +28,7 @@ - #include "build/chromeos_buildflags.h" - #include "components/crash/core/app/crash_reporter_client.h" - #include "components/crash/core/common/crash_key.h" --#include "third_party/abseil-cpp/absl/base/internal/raw_logging.h" -+#include - #include "third_party/crashpad/crashpad/client/annotation.h" - #include "third_party/crashpad/crashpad/client/annotation_list.h" - #include "third_party/crashpad/crashpad/client/crash_report_database.h" -@@ -49,6 +49,9 @@ - #include "components/crash/core/app/crash_export_thunks.h" - #endif - -+#if ABSL_LTS_RELEASE_VERSION < 20230000 -+#define raw_log_internal raw_logging_internal -+#endif - namespace crash_reporter { - - #if BUILDFLAG(IS_IOS) diff --git a/create_tarball.sh b/create_tarball.sh index 9979d22..98714b7 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -139,12 +139,20 @@ python3 src/tools/download_optimization_profile.py \ # Needed to get typescript compiler echo ">>>>>> Download and unpack webui-node-modules tarball for third_party/node" python3 src/third_party/depot_tools/download_from_google_storage.py \ - --no_resume --extract --no_auth --bucket chromium-nodejs \ + --no_resume --no_auth --bucket chromium-nodejs \ -s src/third_party/node/node_modules.tar.gz.sha1 if [ $? -ne 0 ]; then echo "ERROR: download_from_google_storage failed" cleanup_and_exit 1 fi +mkdir -pv src/third_party/node/node_modules +pushd src/third_party/node/node_modules +tar -xvvf ../node_modules.tar.gz +if [ $? -ne 0 ]; then + echo "ERROR: tar extract failed" + cleanup_and_exit 1 +fi +popd # we don't need the orig tarball rm -v src/third_party/node/node_modules.tar.gz @@ -169,7 +177,6 @@ keeplibs=( base/third_party/icu #Derived code, not vendored dependency. base/third_party/superfasthash #Not a shared library. base/third_party/symbolize #Derived code, not vendored dependency. - base/third_party/valgrind #Copy of a private header. base/third_party/xdg_user_dirs #Derived code, not vendored dependency. chrome/third_party/mozilla_security_manager #Derived code, not vendored dependency. net/third_party/mozilla_security_manager #Derived code, not vendored dependency. @@ -179,7 +186,6 @@ keeplibs=( third_party/abseil-cpp #Leap and fc36 too old. third_party/angle # ANGLE is an integral part of chrome and is not available as a shared library. third_party/angle/src/third_party/ceval #not in any distro - third_party/angle/src/third_party/volk #replacement vulkan loader. Drop it when Leap has new enough libvulkan third_party/blink #Integral part of chrome third_party/boringssl #Factory has an ancient version, but upstream seems to have gave up on making it a shared library third_party/boringssl/src/third_party/fiat #Not in any distro @@ -212,14 +218,15 @@ keeplibs=( third_party/devtools-frontend #Javascript code, integral part of chrome third_party/devtools-frontend/src/front_end/third_party #various javascript code compiled into chrome, see README.md third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt + third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/parsel-js third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs third_party/devtools-frontend/src/third_party/i18n #javascript - third_party/devtools-frontend/src/third_party/typescript #Chromium added code third_party/distributed_point_functions #not in any distro third_party/dom_distiller_js #javascript #third_party/eigen3 #Used only by tflite which is not used in electron third_party/electron_node #Integral part of electron third_party/emoji-segmenter #not available as a shared library + third_party/fast_float #Header-only library thus we're not debundling it rn. third_party/fdlibm #derived code, not vendored dep third_party/fp16 #Fedora 41 has it (but an old version?) Not in openSUSE. Header-only library thus we're not debundling it rn. third_party/hunspell #heavily forked version @@ -228,16 +235,10 @@ keeplibs=( third_party/jstemplate #javascript third_party/khronos #Modified to add ANGLE definitions third_party/leveldatabase #use of private headers - third_party/libaom #15.5 is too old - third_party/libaom/source/libaom/third_party/fastfeat - third_party/libaom/source/libaom/third_party/SVT-AV1 - third_party/libaom/source/libaom/third_party/vector - third_party/libaom/source/libaom/third_party/x86inc third_party/libavif #bleeding-edge nightly. try unbundling again when 1.1 gets released third_party/libgav1 #Usage of private headers (ObuFrameHeader from utils/types.h) third_party/libsrtp #Needs to be built against boringssl, not openssl third_party/libsync #not yet in any distro - third_party/libudev #Headers for a optional delay-loaded dependency third_party/liburlpattern #Derived code, not vendored dep. third_party/libva_protected_content #ChromeOS header not available separately. needed for build. third_party/libvpx #15.5/FC37 too old @@ -268,27 +269,26 @@ keeplibs=( #third_party/pdfium/third_party/skia_shared #Skia is not available as a shared library yet. third_party/perfetto #Seems not to be available as a shared library, despite the presence of a `debian` directory. third_party/perfetto/protos/third_party/chromium #derived code, not vendored dep + third_party/perfetto/protos/third_party/simpleperf #not available in any distro third_party/pffft #not in any distro, also heavily patched third_party/polymer #javascript third_party/protobuf #Heavily forked. Apparently was officially unbundlable back in the GYP days, and may be again in the future. + third_party/rapidhash #Fork third_party/re2 # fedora too old third_party/rnnoise #use of private headers third_party/skia #integral part of chrome third_party/speech-dispatcher #Headers for a delay-loaded optional dependency + third_party/spirv-headers third_party/sqlite #heavily forked version third_party/swiftshader #not available as a shared library third_party/swiftshader/third_party/astc-encoder #not in rawhide or factory. Debian has it (astc-encoder) third_party/swiftshader/third_party/llvm-subzero #heavily forked version of libLLVM for use in subzero third_party/swiftshader/third_party/marl #not on any distro - third_party/swiftshader/third_party/SPIRV-Headers #Leap too old - third_party/swiftshader/third_party/SPIRV-Tools #Leap too old third_party/swiftshader/third_party/subzero #integral part of swiftshader #third_party/tflite #Not used by electron, but chrome needs it. #third_party/tflite/src/third_party/eigen3 #third_party/tflite/src/third_party/fft2d - third_party/vulkan-deps/spirv-headers #15.5 too old - third_party/vulkan-deps/spirv-tools #15.5 too old - third_party/vulkan-deps/vulkan-headers #15.5 too old. CONSIDER UNBUNDLING when all distros have new enough vulkan sdk + third_party/vulkan-headers #15.6 too old third_party/vulkan_memory_allocator #not in Factory third_party/webgpu-cts #Javascript code. Needed even if you're building chrome without webgpu third_party/webrtc #Integral part of chrome diff --git a/css_attr_value_tainting-missing-once_flag.patch b/css_attr_value_tainting-missing-once_flag.patch new file mode 100644 index 0000000..fd27169 --- /dev/null +++ b/css_attr_value_tainting-missing-once_flag.patch @@ -0,0 +1,32 @@ +From c502d310d8cb91f1c1098a7287e75114023e57f0 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Thu, 19 Sep 2024 10:55:23 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::once_flag in + css_attr_value_tainting.cc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: I8a8d486c1ee3b2a162accb41faaadaaa0664595f +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872634 +Reviewed-by: Steinar H Gunderson +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1357539} +--- + third_party/blink/renderer/core/css/css_attr_value_tainting.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/third_party/blink/renderer/core/css/css_attr_value_tainting.cc b/third_party/blink/renderer/core/css/css_attr_value_tainting.cc +index 42525e92307f8b..a44ffc15be2335 100644 +--- a/third_party/blink/renderer/core/css/css_attr_value_tainting.cc ++++ b/third_party/blink/renderer/core/css/css_attr_value_tainting.cc +@@ -4,6 +4,8 @@ + + #include "third_party/blink/renderer/core/css/css_attr_value_tainting.h" + ++#include ++ + #include "base/containers/span.h" + #include "base/unguessable_token.h" + #include "third_party/blink/renderer/core/css/parser/css_parser_token_stream.h" diff --git a/delete-old-language-detection-which-uses-tflite.patch b/delete-old-language-detection-which-uses-tflite.patch new file mode 100644 index 0000000..b5b5214 --- /dev/null +++ b/delete-old-language-detection-which-uses-tflite.patch @@ -0,0 +1,176 @@ +From 12e89eee78a2dea41591fedc7937ca83e68c9168 Mon Sep 17 00:00:00 2001 +From: Fergal Daly +Date: Tue, 17 Dec 2024 22:06:08 -0800 +Subject: [PATCH] Delete the old language detection API. + +Bug: 349927087 +Change-Id: I41458da3cf03e78ec9c25fe3fddea343c3e982d6 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054825 +Reviewed-by: Jiacheng Guo +Commit-Queue: Fergal Daly +Cr-Commit-Position: refs/heads/main@{#1397739} +--- + .../bindings/generated_in_modules.gni | 2 - + .../renderer/bindings/idl_in_modules.gni | 1 - + .../ai_language_detector.idl | 5 ++ + .../modules/on_device_translation/BUILD.gn | 2 - + .../language_detector.cc | 52 ---------------- + .../on_device_translation/language_detector.h | 41 ------------- + .../language_detector.idl | 23 -------- + .../on_device_translation/translation.cc | 59 ------------------- + .../on_device_translation/translation.h | 7 --- + .../on_device_translation/translation.idl | 16 ----- + .../canDetect.tentative.window.js | 9 --- + .../detect-en.tentative.window.js | 14 ----- + 12 files changed, 5 insertions(+), 226 deletions(-) + delete mode 100644 third_party/blink/renderer/modules/on_device_translation/language_detector.cc + delete mode 100644 third_party/blink/renderer/modules/on_device_translation/language_detector.h + delete mode 100644 third_party/blink/renderer/modules/on_device_translation/language_detector.idl + delete mode 100644 third_party/blink/web_tests/external/wpt/ai/language_detection/canDetect.tentative.window.js + delete mode 100644 third_party/blink/web_tests/external/wpt/ai/language_detection/detect-en.tentative.window.js + +diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni +index 05b8fe33432374..0fa149cc2101ac 100644 +--- a/third_party/blink/renderer/bindings/generated_in_modules.gni ++++ b/third_party/blink/renderer/bindings/generated_in_modules.gni +@@ -2827,8 +2825,6 @@ generated_interface_sources_in_modules = [ + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.h", +diff --git a/third_party/blink/renderer/modules/on_device_translation/BUILD.gn b/third_party/blink/renderer/modules/on_device_translation/BUILD.gn +index 21470f0869cfda..21772fce07cc5e 100644 +--- a/third_party/blink/renderer/modules/on_device_translation/BUILD.gn ++++ b/third_party/blink/renderer/modules/on_device_translation/BUILD.gn +@@ -8,8 +8,6 @@ blink_modules_sources("on_device_translation") { + sources = [ + "dom_translation.cc", + "dom_translation.h", +- "language_detector.cc", +- "language_detector.h", + "language_translator.cc", + "language_translator.h", + "translation.cc", +diff --git a/third_party/blink/renderer/modules/on_device_translation/translation.h b/third_party/blink/renderer/modules/on_device_translation/translation.h +index 0a0f54be56787a..e19db842628997 100644 +--- a/third_party/blink/renderer/modules/on_device_translation/translation.h ++++ b/third_party/blink/renderer/modules/on_device_translation/translation.h +@@ -18,7 +18,6 @@ + #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" + + namespace blink { +-class LanguageDetector; + class LanguageTranslator; + class V8TranslationAvailability; + +@@ -43,12 +42,6 @@ class Translation final : public ScriptWrappable, + ScriptState* script_state, + TranslationLanguageOptions* options, + ExceptionState& exception_state); +- ScriptPromise canDetect( +- ScriptState* script_state, +- ExceptionState& exception_state); +- ScriptPromise createDetector( +- ScriptState* script_state, +- ExceptionState& exception_state); + + private: + HeapMojoRemote& +diff --git a/third_party/blink/renderer/modules/on_device_translation/translation.idl b/third_party/blink/renderer/modules/on_device_translation/translation.idl +index a27472ece123df..b9c74c41d4c406 100644 +--- a/third_party/blink/renderer/modules/on_device_translation/translation.idl ++++ b/third_party/blink/renderer/modules/on_device_translation/translation.idl +@@ -31,20 +31,4 @@ interface Translation { + Promise createTranslator( + TranslationLanguageOptions options + ); +- [ +- RuntimeEnabled=LanguageDetectionAPI, +- Exposed=Window, +- Measure, +- CallWith=ScriptState, +- RaisesException +- ] +- Promise canDetect(); +- [ +- RuntimeEnabled=LanguageDetectionAPI, +- Exposed=Window, +- Measure, +- CallWith=ScriptState, +- RaisesException +- ] +- Promise createDetector(); + }; +--- src/third_party/blink/renderer/modules/on_device_translation/language_detector.idl.orig 2025-01-02 22:23:59.384885429 +0100 ++++ src/third_party/blink/renderer/modules/on_device_translation/language_detector.idl 2025-01-03 22:57:39.104809606 +0100 +@@ -8,16 +8,3 @@ dictionary LanguageDetectionResult { + DOMString? detectedLanguage; + double confidence; + }; +- +-[ +- RuntimeEnabled=LanguageDetectionAPI, +- Exposed=Window +-] +-interface LanguageDetector { +- [ +- Measure, +- CallWith=ScriptState, +- RaisesException +- ] +- Promise> detect(DOMString input); +-}; +--- src/third_party/blink/renderer/modules/on_device_translation/translation.cc.orig 2025-01-02 22:23:59.384885429 +0100 ++++ src/third_party/blink/renderer/modules/on_device_translation/translation.cc 2025-01-03 23:11:15.414694080 +0100 +@@ -10,7 +10,6 @@ + #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" + #include "third_party/blink/renderer/bindings/modules/v8/v8_translation_language_options.h" + #include "third_party/blink/renderer/core/execution_context/execution_context.h" +-#include "third_party/blink/renderer/modules/on_device_translation/language_detector.h" + #include "third_party/blink/renderer/modules/on_device_translation/language_translator.h" + #include "third_party/blink/renderer/platform/bindings/exception_state.h" + #include "third_party/blink/renderer/platform/bindings/script_state.h" +@@ -116,39 +115,4 @@ ScriptPromise Transl + return promise; + } + +-ScriptPromise Translation::canDetect( +- ScriptState* script_state, +- ExceptionState& exception_state) { +- if (!script_state->ContextIsValid()) { +- exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, +- "The execution context is not valid."); +- return ScriptPromise(); +- } +- +- auto* resolver = +- MakeGarbageCollected>( +- script_state); +- auto promise = resolver->Promise(); +- +- resolver->Resolve( +- V8TranslationAvailability(V8TranslationAvailability::Enum::kReadily)); +- +- return promise; +-} +- +-ScriptPromise Translation::createDetector( +- ScriptState* script_state, +- ExceptionState& exception_state) { +- if (!script_state->ContextIsValid()) { +- exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, +- "The execution context is not valid."); +- return ScriptPromise(); +- } +- +- auto* resolver = +- MakeGarbageCollected>( +- script_state); +- resolver->Resolve(MakeGarbageCollected()); +- return resolver->Promise(); +-} + } // namespace blink diff --git a/disable-catapult.patch b/disable-catapult.patch index 0188bd6..56eba04 100644 --- a/disable-catapult.patch +++ b/disable-catapult.patch @@ -169,9 +169,9 @@ author: Michael Gilbert "//media/mojo/mojom:speech_recognition", "//ui/base", ] ---- a/chrome/chrome_paks.gni -+++ b/chrome/chrome_paks.gni -@@ -190,8 +190,6 @@ template("chrome_extra_paks") { +--- src/chrome/chrome_paks.gni.orig 2024-12-08 18:34:54.604673311 +0100 ++++ src/chrome/chrome_paks.gni 2024-12-18 12:15:07.247395616 +0100 +@@ -202,8 +202,6 @@ template("chrome_extra_paks") { "$root_gen_dir/chrome/webui_gallery_resources.pak", "$root_gen_dir/chrome/whats_new_resources.pak", "$root_gen_dir/content/browser/devtools/devtools_resources.pak", @@ -180,8 +180,8 @@ author: Michael Gilbert ] deps += [ "//chrome/browser/resources:component_extension_resources", -@@ -199,7 +197,6 @@ template("chrome_extra_paks") { - "//chrome/browser/resources/lens/overlay/search_bubble:resources", +@@ -215,7 +213,6 @@ template("chrome_extra_paks") { + "//chrome/browser/resources/lens/shared:resources", "//chrome/browser/resources/search_engine_choice:resources", "//content/browser/devtools:devtools_resources", - "//content/browser/tracing:resources", diff --git a/disable-devtools-tests.patch b/disable-devtools-tests.patch index 8c7f84c..cd79eb7 100644 --- a/disable-devtools-tests.patch +++ b/disable-devtools-tests.patch @@ -1,8 +1,8 @@ ---- a/third_party/devtools-frontend/src/BUILD.gn -+++ b/third_party/devtools-frontend/src/BUILD.gn -@@ -13,7 +13,6 @@ import("./third_party/blink/public/publi - +--- src/third_party/devtools-frontend/src/BUILD.gn.orig 2024-12-08 18:36:42.531343187 +0100 ++++ src/third_party/devtools-frontend/src/BUILD.gn 2024-12-18 12:29:53.036757634 +0100 +@@ -16,7 +16,6 @@ import("./third_party/blink/public/publi devtools_frontend_resources_deps = [ + ":favicon", "front_end", - "test", ] diff --git a/disable-webspeech.patch b/disable-webspeech.patch index f74b154..06f4b00 100644 --- a/disable-webspeech.patch +++ b/disable-webspeech.patch @@ -22,11 +22,9 @@ Reviewed-by: Allan Sandfeld Jensen chromium/media/media_options.gni | 2 + 7 files changed, 52 insertions(+), 27 deletions(-) -diff --git a/chromium/content/browser/BUILD.gn b/chromium/content/browser/BUILD.gn -index 19b45dc1268..67dcd7752d0 100644 ---- a/content/browser/BUILD.gn -+++ b/content/browser/BUILD.gn -@@ -1909,13 +1909,6 @@ source_set("browser") { +--- src/content/browser/BUILD.gn.orig 2024-12-08 18:44:00.234689649 +0100 ++++ src/content/browser/BUILD.gn 2024-12-18 12:20:19.753578327 +0100 +@@ -2134,13 +2134,6 @@ source_set("browser") { "sms/user_consent_handler.h", "sms/webotp_service.cc", "sms/webotp_service.h", @@ -40,17 +38,11 @@ index 19b45dc1268..67dcd7752d0 100644 "speech/speech_synthesis_impl.cc", "speech/speech_synthesis_impl.h", "speech/tts_controller_impl.cc", -@@ -2956,19 +2951,6 @@ source_set("browser") { +@@ -3340,13 +3333,6 @@ source_set("browser") { "service_worker/service_worker_usb_delegate_observer.cc", "service_worker/service_worker_usb_delegate_observer.h", - # Most speech code is non-Android. -- "speech/endpointer/endpointer.cc", -- "speech/endpointer/endpointer.h", -- "speech/endpointer/energy_endpointer.cc", -- "speech/endpointer/energy_endpointer.h", -- "speech/endpointer/energy_endpointer_params.cc", -- "speech/endpointer/energy_endpointer_params.h", - "speech/network_speech_recognition_engine_impl.cc", - "speech/network_speech_recognition_engine_impl.h", - "speech/speech_recognition_engine.cc", @@ -60,7 +52,7 @@ index 19b45dc1268..67dcd7752d0 100644 "tracing/tracing_ui.cc", "tracing/tracing_ui.h", -@@ -2995,10 +2975,8 @@ source_set("browser") { +@@ -3397,10 +3383,8 @@ source_set("browser") { "//components/soda:constants", "//components/soda:soda", "//components/soda:utils", @@ -71,7 +63,7 @@ index 19b45dc1268..67dcd7752d0 100644 "//ui/base", ] } -@@ -3108,6 +3083,37 @@ source_set("browser") { +@@ -3471,6 +3455,37 @@ source_set("browser") { deps += [ "//ui/compositor" ] } @@ -109,31 +101,29 @@ index 19b45dc1268..67dcd7752d0 100644 if ((is_linux || is_chromeos) && use_dbus) { deps += [ "//dbus" ] } -diff --git a/chromium/content/browser/browser_interface_binders.cc b/chromium/content/browser/browser_interface_binders.cc -index c5a6f0aea88..71d9bf41a71 100644 ---- a/content/browser/browser_interface_binders.cc -+++ b/content/browser/browser_interface_binders.cc -@@ -50,7 +50,9 @@ - #include "content/browser/renderer_host/render_frame_host_impl.h" +--- src/content/browser/browser_interface_binders.cc.orig 2024-12-08 18:34:57.541340064 +0100 ++++ src/content/browser/browser_interface_binders.cc 2024-12-18 12:22:33.827251622 +0100 +@@ -59,7 +59,9 @@ #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/service_worker/service_worker_host.h" + #include "content/browser/shared_storage/shared_storage_worklet_host.h" +#if BUILDFLAG(ENABLE_WEB_SPEECH) #include "content/browser/speech/speech_recognition_dispatcher_host.h" +#endif #include "content/browser/storage_access/storage_access_handle.h" #include "content/browser/tracing/trace_report/trace_report.mojom.h" #include "content/browser/tracing/trace_report/trace_report_internals_ui.h" -@@ -144,7 +146,9 @@ - #include "third_party/blink/public/mojom/sensor/web_sensor_provider.mojom.h" - #include "third_party/blink/public/mojom/sms/webotp_service.mojom.h" - #include "third_party/blink/public/mojom/speculation_rules/speculation_rules.mojom.h" +@@ -98,7 +100,9 @@ + #include "media/mojo/mojom/media_metrics_provider.mojom.h" + #include "media/mojo/mojom/media_player.mojom.h" + #include "media/mojo/mojom/remoting.mojom.h" +#if BUILDFLAG(ENABLE_WEB_SPEECH) - #include "third_party/blink/public/mojom/speech/speech_recognizer.mojom.h" + #include "media/mojo/mojom/speech_recognizer.mojom.h" +#endif - #include "third_party/blink/public/mojom/speech/speech_synthesis.mojom.h" - #include "third_party/blink/public/mojom/storage_access/storage_access_handle.mojom.h" - #include "third_party/blink/public/mojom/usb/web_usb_service.mojom.h" -@@ -168,7 +172,9 @@ + #include "media/mojo/mojom/video_decode_perf_history.mojom.h" + #include "media/mojo/mojom/video_encoder_metrics_provider.mojom.h" + #include "media/mojo/mojom/webrtc_video_perf.mojom.h" +@@ -203,7 +207,9 @@ #else // BUILDFLAG(IS_ANDROID) #include "content/browser/direct_sockets/direct_sockets_service_impl.h" #include "media/mojo/mojom/renderer_extensions.mojom.h" @@ -143,12 +133,12 @@ index c5a6f0aea88..71d9bf41a71 100644 #include "third_party/blink/public/mojom/hid/hid.mojom.h" #include "third_party/blink/public/mojom/installedapp/installed_app_provider.mojom.h" #include "third_party/blink/public/mojom/serial/serial.mojom.h" -@@ -830,10 +836,12 @@ void PopulateFrameBinders(RenderFrameHostImpl* host, mojo::BinderMap* map) { +@@ -860,10 +866,12 @@ void PopulateFrameBinders(RenderFrameHos map->Add( base::BindRepeating(&BindSharedWorkerConnector, base::Unretained(host))); +#if BUILDFLAG(ENABLE_WEB_SPEECH) - map->Add( + map->Add( base::BindRepeating(&SpeechRecognitionDispatcherHost::Create, host->GetProcess()->GetID(), host->GetRoutingID()), GetIOThreadTaskRunner({})); @@ -156,7 +146,7 @@ index c5a6f0aea88..71d9bf41a71 100644 map->Add(base::BindRepeating( &RenderFrameHostImpl::GetSpeechSynthesis, base::Unretained(host))); -@@ -1099,6 +1107,7 @@ void PopulateBinderMapWithContext( +@@ -1163,6 +1171,7 @@ void PopulateBinderMapWithContext( #if !BUILDFLAG(IS_ANDROID) map->Add( base::BindRepeating(&DirectSocketsServiceImpl::CreateForFrame)); @@ -164,7 +154,7 @@ index c5a6f0aea88..71d9bf41a71 100644 map->Add(base::BindRepeating( &EmptyBinderForFrame)); map->Add( -@@ -1110,6 +1119,7 @@ void PopulateBinderMapWithContext( +@@ -1174,6 +1183,7 @@ void PopulateBinderMapWithContext( map->Add(base::BindRepeating( &EmptyBinderForFrame)); #endif @@ -273,9 +263,9 @@ index 5667cac61f3..48ea95a99a6 100644 cgit v1.2.1 ---- src/components/speech/BUILD.gn.old 2023-05-13 15:23:05.850506351 +0200 -+++ src/components/speech/BUILD.gn 2023-05-14 14:39:12.182694489 +0200 -@@ -4,12 +4,6 @@ +--- src/components/speech/BUILD.gn.orig 2024-12-08 18:34:57.021340049 +0100 ++++ src/components/speech/BUILD.gn 2024-12-18 12:18:14.187490208 +0100 +@@ -6,12 +6,6 @@ import("//build/config/features.gni") source_set("speech") { sources = [ @@ -288,11 +278,11 @@ cgit v1.2.1 "downstream_loader.cc", "downstream_loader.h", "downstream_loader_client.h", -@@ -24,7 +18,6 @@ +@@ -27,7 +21,6 @@ source_set("speech") { "//mojo/public/cpp/system", "//services/network/public/cpp", "//services/network/public/mojom", - "//third_party/flac", ] - } + if (!is_android) { diff --git a/do-not-build-libvulkan.so.patch b/do-not-build-libvulkan.so.patch index 16f994c..dfb9f5c 100644 --- a/do-not-build-libvulkan.so.patch +++ b/do-not-build-libvulkan.so.patch @@ -13,10 +13,10 @@ Do not try to build a private copy of a DLL which is already available on every binary = "$root_out_dir/libvulkan.so.1" if (current_cpu == "x86") { ---- a/third_party/vulkan-deps/vulkan-loader/src/BUILD.gn -+++ b/third_party/vulkan-deps/vulkan-loader/src/BUILD.gn -@@ -99,7 +99,18 @@ - library_type = "static_library" +--- src/third_party/vulkan-loader/src/BUILD.gn.orig 2024-12-08 18:37:20.394677662 +0100 ++++ src/third_party/vulkan-loader/src/BUILD.gn 2024-12-18 13:15:54.021404544 +0100 +@@ -144,7 +144,18 @@ if (!is_android) { + } } - target(library_type, "libvulkan") { @@ -35,4 +35,3 @@ Do not try to build a private copy of a DLL which is already available on every sources = [ "loader/adapters.h", "loader/allocation.c", - diff --git a/electron-31.7.6.tar.zst b/electron-31.7.6.tar.zst deleted file mode 100644 index fa79f9c..0000000 --- a/electron-31.7.6.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f4e50a8786181d6f0f246150f6c99cc988bea00c7978ae44c4c019fdf4add8b -size 604163877 diff --git a/electron-33.3.1.tar.zst b/electron-33.3.1.tar.zst new file mode 100644 index 0000000..0c5906c --- /dev/null +++ b/electron-33.3.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8e988db1b85ffee080e397cca60b4dd66758a1eb681ca1bf014d5401a3541f3 +size 687262785 diff --git a/electron_usb_delegate-incomplete-UsbDeviceInfo.patch b/electron_usb_delegate-incomplete-UsbDeviceInfo.patch new file mode 100644 index 0000000..42bd8ca --- /dev/null +++ b/electron_usb_delegate-incomplete-UsbDeviceInfo.patch @@ -0,0 +1,63 @@ +In file included from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h:13, + from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:50, + from ../../base/memory/raw_ptr.h:11, + from ../../base/memory/weak_ptr.h:82, + from ../../electron/shell/browser/usb/electron_usb_delegate.h:14, + from ../../electron/shell/browser/usb/electron_usb_delegate.cc:5: +../../base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h:279:3: warning: multi-line comment [-Wcomment] + 279 | // \ + | ^ +../../base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h:281:3: warning: multi-line comment [-Wcomment] + 281 | // \ + | ^ +In file included from /usr/include/c++/14/memory:78, + from ../../electron/shell/browser/usb/electron_usb_delegate.h:8: +/usr/include/c++/14/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = device::mojom::UsbDeviceInfo]’: +/usr/include/c++/14/bits/unique_ptr.h:399:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = device::mojom::UsbDeviceInfo; _Dp = std::default_delete]’ + 399 | get_deleter()(std::move(__ptr)); + | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ +../../mojo/public/cpp/bindings/struct_ptr.h:48:3: required from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = mojo::StructPtr]’ + 48 | ~StructPtr() = default; + | ^ +/usr/include/c++/14/bits/stl_construct.h:149:22: required from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = mojo::StructPtr]’ + 149 | std::destroy_at(__pointer); + | ~~~~~~~~~~~~~~~^~~~~~~~~~~ +/usr/include/c++/14/bits/stl_construct.h:163:19: required from ‘static constexpr void std::_Destroy_aux< >::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = mojo::StructPtr*; bool = false]’ + 163 | std::_Destroy(std::__addressof(*__first)); + | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/usr/include/c++/14/bits/stl_construct.h:193:44: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = mojo::StructPtr*]’ + 193 | return std::_Destroy_aux::__destroy(__first, __last); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ +/usr/include/c++/14/bits/alloc_traits.h:981:20: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = mojo::StructPtr*; _Tp = mojo::StructPtr]’ + 981 | std::_Destroy(__first, __last); + | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ +/usr/include/c++/14/bits/stl_vector.h:735:15: required from ‘constexpr std::vector<_Tp, _Alloc>::~vector() [with _Tp = mojo::StructPtr; _Alloc = std::allocator >]’ + 735 | std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, + | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 736 | _M_get_Tp_allocator()); + | ~~~~~~~~~~~~~~~~~~~~~~ +../../electron/shell/browser/usb/electron_usb_delegate.cc:231:74: required from here + 231 | std::move(callback).Run(std::vector()); + | ^ +/usr/include/c++/14/bits/unique_ptr.h:91:23: error: invalid application of ‘sizeof’ to incomplete type ‘device::mojom::UsbDeviceInfo’ + 91 | static_assert(sizeof(_Tp)>0, + | ^~~~~~~~~~~ + +--- src/electron/shell/browser/usb/electron_usb_delegate.cc.orig 2025-01-02 22:20:04.494886103 +0100 ++++ src/electron/shell/browser/usb/electron_usb_delegate.cc 2025-01-03 23:05:03.664747897 +0100 +@@ -13,6 +13,7 @@ + #include "content/public/browser/render_frame_host.h" + #include "content/public/browser/web_contents.h" + #include "electron/buildflags/buildflags.h" ++#include "services/device/public/mojom/usb_device.mojom.h" + #include "services/device/public/mojom/usb_enumeration_options.mojom.h" + #include "shell/browser/electron_browser_context.h" + #include "shell/browser/electron_permission_manager.h" +@@ -28,7 +29,6 @@ + #include "extensions/browser/guest_view/web_view/web_view_guest.h" + #include "extensions/common/constants.h" + #include "extensions/common/extension.h" +-#include "services/device/public/mojom/usb_device.mojom.h" + #endif + + namespace { diff --git a/enable_stack_trace_line_numbers-symbol_level.patch b/enable_stack_trace_line_numbers-symbol_level.patch index 93bca3e..8e049e6 100644 --- a/enable_stack_trace_line_numbers-symbol_level.patch +++ b/enable_stack_trace_line_numbers-symbol_level.patch @@ -1,8 +1,8 @@ Reducing symbol_level is a kludge and should have no effect on generated code. ---- src/base/BUILD.gn.orig -+++ src/base/BUILD.gn -@@ -2531,11 +2531,6 @@ buildflag_header("debugging_buildflags") +--- src/base/BUILD.gn.orig 2024-12-08 18:43:52.881356091 +0100 ++++ src/base/BUILD.gn 2024-12-18 12:11:47.597615650 +0100 +@@ -2510,11 +2510,6 @@ buildflag_header("debugging_buildflags") enable_commandline_sequence_checks = (is_debug || dcheck_always_on) && !is_android @@ -11,15 +11,15 @@ Reducing symbol_level is a kludge and should have no effect on generated code. - symbol_level > 0, - "symbol_level must be set to greater than 0 for source line numbers.") - } + _enable_stack_trace_line_numbers = + !print_unsymbolized_stack_traces && enable_stack_trace_line_numbers - flags = [ - "DCHECK_IS_CONFIGURABLE=$dcheck_is_configurable", ---- src/build/config/logging.gni.orig -+++ src/build/config/logging.gni -@@ -11,5 +11,5 @@ declare_args() { - enable_log_error_not_reached = - is_chromeos_ash && !(is_debug || dcheck_always_on) +--- src/build/config/logging.gni.orig 2024-12-08 18:34:51.748006561 +0100 ++++ src/build/config/logging.gni 2024-12-18 12:12:08.104531156 +0100 +@@ -20,5 +20,5 @@ declare_args() { + # Enables the DWARF line number reader on Linux. This only has an effect if + # print_unsymbolized_stack_traces is false. - enable_stack_trace_line_numbers = symbol_level > 0 + enable_stack_trace_line_numbers = true } diff --git a/exception_context-missing-variant.patch b/exception_context-missing-variant.patch new file mode 100644 index 0000000..4c31044 --- /dev/null +++ b/exception_context-missing-variant.patch @@ -0,0 +1,32 @@ +From 47fb59539e5744467eb6f7aae52f5a169910d56c Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Thu, 19 Sep 2024 11:04:49 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::variant in + exception_context.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: I7c4a26c28481de40b22646f5a9f018235079dbca +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872753 +Commit-Queue: José Dapena Paz +Reviewed-by: Michael Lippautz +Cr-Commit-Position: refs/heads/main@{#1357540} +--- + .../blink/renderer/platform/bindings/exception_context.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/third_party/blink/renderer/platform/bindings/exception_context.h b/third_party/blink/renderer/platform/bindings/exception_context.h +index 82d20a29326432..afa27f00d03924 100644 +--- a/third_party/blink/renderer/platform/bindings/exception_context.h ++++ b/third_party/blink/renderer/platform/bindings/exception_context.h +@@ -5,6 +5,8 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_EXCEPTION_CONTEXT_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_EXCEPTION_CONTEXT_H_ + ++#include ++ + #include "base/check_op.h" + #include "base/dcheck_is_on.h" + #include "base/notreached.h" diff --git a/fix-build-without-safebrowsing.patch b/fix-build-without-safebrowsing.patch index 5a7a932..3875b64 100644 --- a/fix-build-without-safebrowsing.patch +++ b/fix-build-without-safebrowsing.patch @@ -1,6 +1,6 @@ ---- src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc.orig 2024-07-24 13:00:13.565994500 +0200 -+++ src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc 2024-08-03 23:06:56.231653700 +0200 -@@ -19,7 +19,6 @@ +--- src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc.orig 2024-12-08 18:44:40.908024234 +0100 ++++ src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc 2024-12-18 13:07:47.764725866 +0100 +@@ -20,7 +20,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/profiles/profile.h" @@ -8,7 +8,7 @@ #if 0 #include "chrome/browser/ui/blocked_content/popunder_preventer.h" #endif -@@ -116,20 +115,6 @@ void RecordWebsiteStateAtApiRequest(hist +@@ -117,20 +116,6 @@ void RecordWebsiteStateAtApiRequest(hist void CheckUrlForAllowlistAndRecordMetric( const GURL& url, history::HistoryLastVisitResult result) { @@ -20,7 +20,7 @@ - g_browser_process->safe_browsing_service() - ->database_manager() - ->CheckUrlForHighConfidenceAllowlist( -- url, "RT" /*realtime*/, +- url, - base::BindOnce( - [](history::HistoryLastVisitResult result, bool on_allowlist) { - RecordWebsiteStateAtApiRequest(result, on_allowlist); diff --git a/fix-build-without-screen-ai.patch b/fix-build-without-screen-ai.patch new file mode 100644 index 0000000..e344356 --- /dev/null +++ b/fix-build-without-screen-ai.patch @@ -0,0 +1,100 @@ +--- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 ++++ src/chrome/test/BUILD.gn 2025-01-01 20:54:36.278270275 +0100 +@@ -1959,9 +1959,6 @@ if (!is_android) { + "//chrome/browser/resource_coordinator:tab_manager_features", + "//chrome/browser/safe_browsing:advanced_protection", + "//chrome/browser/safe_browsing:verdict_cache_manager_factory", +- "//chrome/browser/screen_ai:screen_ai_install_state", +- "//chrome/browser/screen_ai:screen_ai_service_router_factory", +- "//chrome/browser/screen_ai/public:test_support", + "//chrome/browser/search", + "//chrome/browser/search_engines", + "//chrome/browser/segmentation_platform:test_utils", +@@ -2334,9 +2331,6 @@ if (!is_android) { + "//services/network/public/proto:sct_audit_report_proto", + "//services/preferences/public/cpp", + "//services/preferences/public/cpp/tracked", +- "//services/screen_ai:test_support", +- "//services/screen_ai/public/cpp:utilities", +- "//services/screen_ai/public/mojom", + "//services/service_manager/public/cpp", + "//services/strings", + "//services/test/echo/public/mojom", +@@ -8373,7 +8367,6 @@ test("unit_tests") { + "//services/device/public/cpp/bluetooth", + "//services/metrics/public/cpp:ukm_builders", + "//services/network:test_support", +- "//services/screen_ai:test_support", + "//services/video_effects/test:test_support", + "//third_party/crashpad/crashpad/util", + "//third_party/libaddressinput", +--- src/chrome/browser/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 ++++ src/chrome/browser/BUILD.gn 2025-01-01 21:05:47.125477818 +0100 +@@ -4343,9 +4343,6 @@ static_library("browser") { + "//components/webauthn/core/browser:passkey_model", + "//services/device/public/cpp/bluetooth", + "//services/device/public/cpp/hid", +- "//services/screen_ai", +- "//services/screen_ai/public/cpp:utilities", +- "//services/screen_ai/public/mojom", + "//third_party/crashpad/crashpad/client:common", + "//third_party/zxcvbn-cpp", + "//ui/views", +--- src/chrome/renderer/BUILD.gn.orig 2024-12-08 18:34:54.671339980 +0100 ++++ src/chrome/renderer/BUILD.gn 2025-01-01 21:11:57.272282026 +0100 +@@ -408,7 +408,6 @@ static_library("renderer") { + "//components/crx_file", + "//components/trusted_vault", + "//services/screen_ai/buildflags", +- "//services/screen_ai/public/mojom", + "//services/strings", + "//third_party/re2:re2", + ] +--- src/chrome/utility/BUILD.gn.orig 2024-12-08 18:34:55.478006671 +0100 ++++ src/chrome/utility/BUILD.gn 2025-01-01 21:14:46.902339035 +0100 +@@ -67,7 +67,6 @@ static_library("utility") { + "//services/network:network_service", + "//services/passage_embeddings:passage_embeddings", + "//services/passage_embeddings/public/mojom", +- "//services/screen_ai/buildflags", + "//services/service_manager/public/cpp", + "//skia", + "//sql", +@@ -145,7 +144,6 @@ static_library("utility") { + "//chrome/common/importer:interfaces", + "//components/autofill/core/common", + "//services/proxy_resolver:lib", +- "//services/screen_ai", + ] + } + +--- src/chrome/browser/screen_ai/BUILD.gn.orig 2024-12-08 18:34:53.871339956 +0100 ++++ src/chrome/browser/screen_ai/BUILD.gn 2025-01-01 21:17:11.015719404 +0100 +@@ -48,7 +48,6 @@ source_set("screen_ai_install_state") { + "//chrome/browser:browser_process", + "//components/prefs", + "//content/public/browser", +- "//services/screen_ai/public/cpp:utilities", + "//ui/accessibility:ax_base", + ] + +@@ -68,9 +67,6 @@ source_set("screen_ai_service_router_fac + "//chrome/browser/profiles:profile", + "//components/keyed_service/core", + "//content/public/browser", +- "//services/screen_ai/public/cpp:utilities", +- "//services/screen_ai/public/mojom:factory", +- "//services/screen_ai/public/mojom:mojom", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +--- src/chrome/browser/screen_ai/public/BUILD.gn.orig 2024-12-08 18:34:53.871339956 +0100 ++++ src/chrome/browser/screen_ai/public/BUILD.gn 2025-01-01 21:18:43.609082510 +0100 +@@ -12,7 +12,6 @@ source_set("optical_character_recognizer + "//chrome/browser/profiles:profile", + "//chrome/browser/screen_ai:screen_ai_service_router_factory", + "//content/public/browser", +- "//services/screen_ai/public/mojom", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/fix-build-without-service-discovery.patch b/fix-build-without-service-discovery.patch new file mode 100644 index 0000000..8c0ff9c --- /dev/null +++ b/fix-build-without-service-discovery.patch @@ -0,0 +1,10 @@ +--- src/chrome/browser/extensions/api/BUILD.gn.orig 2024-12-08 18:34:53.171339936 +0100 ++++ src/chrome/browser/extensions/api/BUILD.gn 2025-01-01 21:24:35.512530556 +0100 +@@ -34,7 +34,6 @@ group("api_implementations") { + "//chrome/browser/extensions/api/downloads_internal", + "//chrome/browser/extensions/api/experimental_ai_data", + "//chrome/browser/extensions/api/font_settings", +- "//chrome/browser/extensions/api/mdns", + "//chrome/browser/extensions/api/module", + "//chrome/browser/extensions/api/networking_private", + "//chrome/browser/extensions/api/omnibox", diff --git a/fix-build-without-supervised-users.patch b/fix-build-without-supervised-users.patch index d4f886f..7b77871 100644 --- a/fix-build-without-supervised-users.patch +++ b/fix-build-without-supervised-users.patch @@ -8,8 +8,8 @@ if (is_android) { import("//build/config/android/rules.gni") ---- src/chrome/common/BUILD.gn.orig 2024-09-12 13:46:51.785984196 +0200 -+++ src/chrome/common/BUILD.gn 2024-09-12 15:27:58.398867501 +0200 +--- src/chrome/common/BUILD.gn.orig 2024-12-08 18:34:54.604673311 +0100 ++++ src/chrome/common/BUILD.gn 2024-12-18 13:09:33.621395162 +0100 @@ -22,7 +22,6 @@ import("//testing/libfuzzer/fuzzer_test. import("//third_party/widevine/cdm/widevine.gni") import("//tools/grit/grit_rule.gni") @@ -17,7 +17,7 @@ -assert(enable_supervised_users) assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") - fuzzer_test("ini_parser_fuzzer") { + declare_args() { --- src/chrome/renderer/BUILD.gn.orig 2024-09-12 13:46:51.849317526 +0200 +++ src/chrome/renderer/BUILD.gn 2024-09-12 15:29:17.915843739 +0200 @@ -18,7 +18,6 @@ import("//testing/libfuzzer/fuzzer_test. @@ -38,18 +38,18 @@ # //build/config/android/rules.gni imports //tools/grit/grit_rule.gni, which # produces a conflict for the "grit" template so we have to only include one. ---- src/chrome/browser/ui/BUILD.gn.orig 2024-09-12 13:46:51.212650894 +0200 -+++ src/chrome/browser/ui/BUILD.gn 2024-09-12 15:32:36.489733448 +0200 -@@ -32,7 +32,6 @@ import("//third_party/protobuf/proto_lib +--- src/chrome/browser/ui/BUILD.gn.orig 2024-12-08 18:34:54.011339960 +0100 ++++ src/chrome/browser/ui/BUILD.gn 2024-12-18 13:09:34.948061857 +0100 +@@ -30,7 +30,6 @@ import("//third_party/protobuf/proto_lib import("//ui/base/ui_features.gni") import("//ui/views/features.gni") -assert(enable_supervised_users) assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") - generate_histograms_variants_allowlist("webui_name_variants") { ---- src/chrome/browser/extensions/BUILD.gn.orig 2024-09-12 13:46:50.369317607 +0200 -+++ src/chrome/browser/extensions/BUILD.gn 2024-09-12 15:33:39.046452725 +0200 + generate_allowlist_from_histograms_file("webui_name_variants") { +--- src/chrome/browser/extensions/BUILD.gn.orig 2024-12-08 18:34:53.171339936 +0100 ++++ src/chrome/browser/extensions/BUILD.gn 2024-12-18 13:09:34.948061857 +0100 @@ -20,7 +20,6 @@ import("//testing/libfuzzer/fuzzer_test. import("//third_party/protobuf/proto_library.gni") @@ -57,4 +57,4 @@ -assert(enable_supervised_users) assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") - static_library("extensions") { + source_set("extensions") { diff --git a/fpic.patch b/fpic.patch index ce84826..e14a8fb 100644 --- a/fpic.patch +++ b/fpic.patch @@ -45,18 +45,6 @@ Use -fpic for code which goes only in dlls (gives smaller code), ":spvtools_include_gen_dirs", ] -- cflags = [] -+ cflags = ["-fpic", "-fno-semantic-interposition"] -+ asmflags = ["-fpic", "-fno-semantic-interposition"] - if (is_clang) { - cflags += [ - "-Wno-implicit-fallthrough", ---- a/third_party/vulkan-deps/spirv-tools/src/BUILD.gn -+++ b/third_party/vulkan-deps/spirv-tools/src/BUILD.gn -@@ -356,7 +356,8 @@ - ":spvtools_include_gen_dirs", - ] - - cflags = [] + cflags = ["-fpic", "-fno-semantic-interposition"] + asmflags = ["-fpic", "-fno-semantic-interposition"] diff --git a/harfbuzz-replace-HbScopedPointer.patch b/harfbuzz-replace-HbScopedPointer.patch deleted file mode 100644 index a580e95..0000000 --- a/harfbuzz-replace-HbScopedPointer.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 5fcaeafcab5460ea65e4a7bdee6589002adf74d2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dominik=20R=C3=B6ttsches?= -Date: Mon, 13 Feb 2023 13:26:16 +0000 -Subject: [PATCH] Use hb::unique_ptr instead of custom HbScopedPointer -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This was an earlier local RAII implementation that we no longer need now -that HarfBuzz provides helpers for this. - -Change-Id: Idc47ce2717c75556acb03e2ccccb50ec87ed3cca -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4239980 -Reviewed-by: Munira Tursunova -Commit-Queue: Dominik Röttsches -Cr-Commit-Position: refs/heads/main@{#1104453} ---- - .../platform/fonts/shaping/harfbuzz_shaper.cc | 39 ++++--------------- - 1 file changed, 7 insertions(+), 32 deletions(-) - -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -index c165a1703395a..dc1377a90a9f7 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc -@@ -35,6 +35,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -194,33 +195,6 @@ struct ReshapeQueueItem { - : action_(action), start_index_(start), num_characters_(num) {} - }; - --template --class HarfBuzzScopedPtr { -- STACK_ALLOCATED(); -- -- public: -- typedef void (*DestroyFunction)(T*); -- -- HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy) -- : ptr_(ptr), destroy_(destroy) { -- DCHECK(destroy_); -- } -- HarfBuzzScopedPtr(const HarfBuzzScopedPtr&) = delete; -- HarfBuzzScopedPtr& operator=(const HarfBuzzScopedPtr&) = delete; -- ~HarfBuzzScopedPtr() { -- if (ptr_) -- (*destroy_)(ptr_); -- } -- -- T* Get() const{ return ptr_; } -- operator T *() const {return ptr_;} -- void Set(T* ptr) { ptr_ = ptr; } -- -- private: -- T* ptr_; -- DestroyFunction destroy_; --}; -- - // - // Represents a context while shaping a range. - // -@@ -239,7 +214,7 @@ struct RangeContext { - text_direction(direction), - start(start), - end(end), -- buffer(hb_buffer_create(), hb_buffer_destroy), -+ buffer(hb_buffer_create()), - options(options) { - DCHECK_GE(end, start); - font_features.Initialize(font->GetFontDescription()); -@@ -249,7 +224,7 @@ struct RangeContext { - const TextDirection text_direction; - const unsigned start; - const unsigned end; -- const HarfBuzzScopedPtr buffer; -+ const hb::unique_ptr buffer; - FontFeatures font_features; - Deque reshape_queue; - const ShapeOptions options; -@@ -1032,7 +1007,7 @@ void HarfBuzzShaper::GetGlyphData(const - UScriptCode script, - bool is_horizontal, - GlyphDataList& glyphs) { -- HarfBuzzScopedPtr hb_buffer(hb_buffer_create(), hb_buffer_destroy); -+ hb::unique_ptr hb_buffer(hb_buffer_create()); - hb_buffer_set_language(hb_buffer, locale.HarfbuzzLanguage()); - hb_buffer_set_script(hb_buffer, ICUScriptToHBScript(script)); - hb_buffer_set_direction(hb_buffer, diff --git a/harfbuzz-replace-chromium-scoped-type.patch b/harfbuzz-replace-chromium-scoped-type.patch deleted file mode 100644 index dbbb9c2..0000000 --- a/harfbuzz-replace-chromium-scoped-type.patch +++ /dev/null @@ -1,532 +0,0 @@ -From aa2ff2bee16776301bd840a4e18bdebdfb916822 Mon Sep 17 00:00:00 2001 -From: Munira Tursunova -Date: Tue, 04 Oct 2022 14:20:04 +0000 -Subject: [PATCH] Replacing Chromium scoped types with HarfBuzz custom types. - -Removed the Chromium side type HbScoped and move to the -HarfBuzz custom type. - -Bug: 1363228 -Change-Id: I9d390808953e2c36651533cbf5f4958beff2e14d -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3927859 -Reviewed-by: Dominik Röttsches -Reviewed-by: Rune Lillesveen -Reviewed-by: Calder Kitagawa -Commit-Queue: Munira Tursunova -Cr-Commit-Position: refs/heads/main@{#1054692} ---- - -diff --git a/components/paint_preview/common/BUILD.gn b/components/paint_preview/common/BUILD.gn -index 377dc92..c39757d 100644 ---- a/components/paint_preview/common/BUILD.gn -+++ b/components/paint_preview/common/BUILD.gn -@@ -37,7 +37,6 @@ - "//components/crash/core/common:crash_key_lib", - "//skia", - "//third_party:freetype_harfbuzz", -- "//third_party/harfbuzz-ng:hb_scoped_util", - "//ui/gfx/geometry", - "//url", - ] -diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc -index 8298861d5..147dfc3 100644 ---- a/components/paint_preview/common/subset_font.cc -+++ b/components/paint_preview/common/subset_font.cc -@@ -7,6 +7,7 @@ - // clang-format off - #include - #include -+#include - // clang-format on - - #include -@@ -17,7 +18,6 @@ - #include "base/numerics/safe_conversions.h" - #include "components/crash/core/common/crash_key.h" - #include "skia/ext/font_utils.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - #include "third_party/skia/include/core/SkFontMgr.h" - #include "third_party/skia/include/core/SkStream.h" - #include "third_party/skia/include/core/SkTypeface.h" -@@ -45,11 +45,11 @@ - } - - // Converts SkData to a hb_blob_t. --HbScoped MakeBlob(sk_sp data) { -+hb::unique_ptr MakeBlob(sk_sp data) { - if (!data || - !base::IsValueInRangeForNumericType(data->size())) -- return nullptr; -- return HbScoped( -+ return hb::unique_ptr(nullptr); -+ return hb::unique_ptr( - hb_blob_create(static_cast(data->data()), - static_cast(data->size()), - HB_MEMORY_MODE_READONLY, nullptr, nullptr)); -@@ -72,8 +72,9 @@ - family_name.c_str()); - int ttc_index = 0; - sk_sp data = StreamToData(typeface->openStream(&ttc_index)); -- HbScoped face(hb_face_create(MakeBlob(data).get(), ttc_index)); -- HbScoped input(hb_subset_input_create_or_fail()); -+ hb::unique_ptr face( -+ hb_face_create(MakeBlob(data).get(), ttc_index)); -+ hb::unique_ptr input(hb_subset_input_create_or_fail()); - if (!face || !input) { - return nullptr; - } -@@ -102,14 +103,16 @@ - hb_set_add(skip_subset, HB_TAG('G', 'S', 'U', 'B')); - hb_set_add(skip_subset, HB_TAG('G', 'P', 'O', 'S')); - -- HbScoped subset_face(hb_subset_or_fail(face.get(), input.get())); -+ hb::unique_ptr subset_face( -+ hb_subset_or_fail(face.get(), input.get())); - if (!subset_face) { - return nullptr; - } - // Store the correct collection index for the subsetted font. - const int final_ttc_index = hb_face_get_index(subset_face.get()); - -- HbScoped subset_blob(hb_face_reference_blob(subset_face.get())); -+ hb::unique_ptr subset_blob( -+ hb_face_reference_blob(subset_face.get())); - if (!subset_blob) { - return nullptr; - } -diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn -index 88cef3c..ae88e5a 100644 ---- a/third_party/blink/renderer/platform/BUILD.gn -+++ b/third_party/blink/renderer/platform/BUILD.gn -@@ -1683,7 +1683,6 @@ - "//third_party/blink/renderer/platform/wtf", - "//third_party/ced", - "//third_party/emoji-segmenter", -- "//third_party/harfbuzz-ng:hb_scoped_util", - "//third_party/icu", - "//third_party/libyuv", - "//third_party/one_euro_filter", -diff --git a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc -index 7c7057b..d43668f1 100644 ---- a/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc -+++ b/third_party/blink/renderer/platform/fonts/opentype/font_format_check.cc -@@ -7,11 +7,11 @@ - // having to rely on the platform being able to instantiate this font format. - #include - -+#include - - #include "base/containers/span.h" - #include "base/numerics/byte_conversions.h" - #include "third_party/blink/renderer/platform/wtf/vector.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - #include "third_party/skia/include/core/SkTypeface.h" - - namespace blink { -@@ -27,7 +27,8 @@ - const unsigned int kMinCOLRHeaderSize = 14; - if (table_tags.size() && table_tags.Contains(kCOLRTag) && - table_tags.Contains(HB_TAG('C', 'P', 'A', 'L'))) { -- HbScoped table_blob(hb_face_reference_table(face, kCOLRTag)); -+ hb::unique_ptr table_blob( -+ hb_face_reference_table(face, kCOLRTag)); - if (hb_blob_get_length(table_blob.get()) < kMinCOLRHeaderSize) - return FontFormatCheck::COLRVersion::kNoCOLR; - -@@ -51,11 +52,11 @@ - } // namespace - - FontFormatCheck::FontFormatCheck(sk_sp sk_data) { -- HbScoped font_blob( -+ hb::unique_ptr font_blob( - hb_blob_create(reinterpret_cast(sk_data->bytes()), - base::checked_cast(sk_data->size()), - HB_MEMORY_MODE_READONLY, nullptr, nullptr)); -- HbScoped face(hb_face_create(font_blob.get(), 0)); -+ hb::unique_ptr face(hb_face_create(font_blob.get(), 0)); - - unsigned table_count = 0; - table_count = hb_face_get_table_tags(face.get(), 0, nullptr, nullptr); -diff --git a/third_party/blink/renderer/platform/fonts/opentype/open_type_caps_support.cc b/third_party/blink/renderer/platform/fonts/opentype/open_type_caps_support.cc -index 5e6d1f2..73b984a 100644 ---- a/third_party/blink/renderer/platform/fonts/opentype/open_type_caps_support.cc -+++ b/third_party/blink/renderer/platform/fonts/opentype/open_type_caps_support.cc -@@ -5,10 +5,10 @@ - // clang-format off - #include - #include -+#include - // clang-format on - - #include "third_party/blink/renderer/platform/fonts/opentype/open_type_caps_support.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - - namespace blink { - -@@ -146,9 +146,9 @@ - hb_face_t* const hb_face = - hb_font_get_face(harfbuzz_face_->GetScaledFont()); - -- HbScoped morx_blob( -+ hb::unique_ptr morx_blob( - hb_face_reference_table(hb_face, HB_TAG('m', 'o', 'r', 'x'))); -- HbScoped mort_blob( -+ hb::unique_ptr mort_blob( - hb_face_reference_table(hb_face, HB_TAG('m', 'o', 'r', 't'))); - - // TODO(crbug.com/911149): Use hb_aat_layout_has_substitution() for -diff --git a/third_party/blink/renderer/platform/fonts/opentype/open_type_cpal_lookup.cc b/third_party/blink/renderer/platform/fonts/opentype/open_type_cpal_lookup.cc -index 86c289c..98cbd7a 100644 ---- a/third_party/blink/renderer/platform/fonts/opentype/open_type_cpal_lookup.cc -+++ b/third_party/blink/renderer/platform/fonts/opentype/open_type_cpal_lookup.cc -@@ -6,11 +6,11 @@ - - #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.h" - #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - #include "third_party/skia/include/core/SkStream.h" - - // clang-format off - #include -+#include - #include - // clang-format on - -@@ -28,7 +28,7 @@ - if (!typeface || !typeface->getTableSize(kCpalTag)) - return absl::nullopt; - -- HbScoped face(HbFaceFromSkTypeface(typeface)); -+ hb::unique_ptr face(HbFaceFromSkTypeface(typeface)); - - if (!face || !hb_ot_color_has_palettes(face.get())) - return absl::nullopt; -@@ -49,7 +49,7 @@ absl::optional OpenTypeCpalLoo - Vector OpenTypeCpalLookup::RetrieveColorRecords( - sk_sp typeface, - unsigned palette_index) { -- HbScoped face(HbFaceFromSkTypeface(typeface)); -+ hb::unique_ptr face(HbFaceFromSkTypeface(typeface)); - - if (!face) { - return Vector(); -diff --git a/third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.cc b/third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.cc -index ebab0fa8..4ecd886 100644 ---- a/third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.cc -+++ b/third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.cc -@@ -4,12 +4,12 @@ - - #include "third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.h" - --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - #include "third_party/skia/include/core/SkStream.h" - #include "third_party/skia/include/core/SkTypeface.h" - - // clang-format off - #include -+#include - #include - // clang-format on - -@@ -23,11 +23,11 @@ - return output; - sk_sp sk_data = - SkData::MakeFromStream(stream.get(), stream->getLength()); -- HbScoped blob( -+ hb::unique_ptr blob( - hb_blob_create(reinterpret_cast(sk_data->bytes()), - base::checked_cast(sk_data->size()), - HB_MEMORY_MODE_READONLY, nullptr, nullptr)); -- HbScoped face(hb_face_create(blob.get(), 0)); -+ hb::unique_ptr face(hb_face_create(blob.get(), 0)); - unsigned axes_count = hb_ot_var_get_axis_count(face.get()); - std::unique_ptr axes = - std::make_unique(axes_count); -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -index b4bb5a3..b6ee0a8f 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc -@@ -32,6 +32,7 @@ - - // clang-format off - #include -+#include - #include - // clang-format on - -@@ -52,7 +53,6 @@ - #include "third_party/blink/renderer/platform/wtf/text/character_names.h" - #include "third_party/blink/renderer/platform/wtf/thread_specific.h" - #include "third_party/blink/renderer/platform/wtf/wtf.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - #include "third_party/skia/include/core/SkPaint.h" - #include "third_party/skia/include/core/SkPath.h" - #include "third_party/skia/include/core/SkPoint.h" -@@ -203,7 +203,7 @@ - const hb_codepoint_t kInvalidCodepoint = static_cast(-1); - hb_codepoint_t space = kInvalidCodepoint; - -- HbScoped glyphs(hb_set_create()); -+ hb::unique_ptr glyphs(hb_set_create()); - - // Check whether computing is needed and compute for gpos/gsub. - if (features & kKerning && -@@ -391,8 +391,8 @@ - } - - // TODO(yosin): We should move |CreateFace()| to "harfbuzz_font_cache.cc". --static HbScoped CreateFace(FontPlatformData* platform_data) { -- HbScoped face; -+static hb::unique_ptr CreateFace(FontPlatformData* platform_data) { -+ hb::unique_ptr face; - - sk_sp typeface = sk_ref_sp(platform_data->Typeface()); - CHECK(typeface); -@@ -402,8 +402,8 @@ - - // Fallback to table copies if there is no in-memory access. - if (!face) { -- face.reset(hb_face_create_for_tables(HarfBuzzSkiaGetTable, typeface.get(), -- nullptr)); -+ face = hb::unique_ptr(hb_face_create_for_tables( -+ HarfBuzzSkiaGetTable, typeface.get(), nullptr)); - } - - DCHECK(face); -@@ -415,7 +415,7 @@ - static scoped_refptr CreateHarfBuzzFontData( - hb_face_t* face, - SkTypeface* typeface) { -- HbScoped ot_font(hb_font_create(face)); -+ hb::unique_ptr ot_font(hb_font_create(face)); - hb_ot_font_set_funcs(ot_font.get()); - - int axis_count = typeface->getVariationDesignPosition(nullptr, 0); -@@ -445,7 +445,7 @@ - FontPlatformData* platform_data) { - const auto& result = font_map_.insert(platform_data->UniqueID(), nullptr); - if (result.is_new_entry) { -- HbScoped face = CreateFace(platform_data); -+ hb::unique_ptr face = CreateFace(platform_data); - result.stored_value->value = - CreateHarfBuzzFontData(face.get(), platform_data->Typeface()); - } -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -index cbfb1c15..eb0dcb75 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h -@@ -38,9 +38,9 @@ - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - #include "third_party/blink/renderer/platform/wtf/ref_counted.h" - #include "third_party/blink/renderer/platform/wtf/text/character_names.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - - #include -+#include - - namespace blink { - -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.cc -index 4561bc9..a2d2eb1d 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.cc -@@ -16,9 +16,8 @@ - } // namespace - - namespace blink { -- --HbScoped HbFaceFromSkTypeface(sk_sp typeface) { -- HbScoped return_face(nullptr); -+hb::unique_ptr HbFaceFromSkTypeface(sk_sp typeface) { -+ hb::unique_ptr return_face(nullptr); - int ttc_index = 0; - - // Have openStream() write the ttc index of this typeface within the stream to -@@ -28,7 +27,7 @@ - if (tf_stream && tf_stream->getMemoryBase()) { - const void* tf_memory = tf_stream->getMemoryBase(); - size_t tf_size = tf_stream->getLength(); -- HbScoped face_blob(hb_blob_create( -+ hb::unique_ptr face_blob(hb_blob_create( - reinterpret_cast(tf_memory), - base::checked_cast(tf_size), HB_MEMORY_MODE_READONLY, - tf_stream.release(), DeleteTypefaceStream)); -@@ -38,7 +37,8 @@ - // See https://github.com/harfbuzz/harfbuzz/issues/248 . - unsigned int num_hb_faces = hb_face_count(face_blob.get()); - if (0 < num_hb_faces && static_cast(ttc_index) < num_hb_faces) { -- return_face.reset(hb_face_create(face_blob.get(), ttc_index)); -+ return_face = -+ hb::unique_ptr(hb_face_create(face_blob.get(), ttc_index)); - } - } - return return_face; -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.h b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.h -index 8817f06..f00d6f2 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face_from_typeface.h -@@ -8,9 +8,8 @@ - #include "third_party/blink/renderer/platform/platform_export.h" - #include "third_party/skia/include/core/SkTypeface.h" - --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" -- - #include -+#include - - namespace blink { - -@@ -25,7 +24,7 @@ - // from copying all font tables on Mac into newly allocated memory, causing a - // potentially quite large allocations (in the megabytes range). See the - // implementation of SkTypeface_Mac::onOpenStream. --PLATFORM_EXPORT HbScoped HbFaceFromSkTypeface( -+PLATFORM_EXPORT hb::unique_ptr HbFaceFromSkTypeface( - sk_sp typeface); - } // namespace blink - -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -index 763f3a3..c50910df 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc -@@ -5,12 +5,11 @@ - #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" - #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h" - #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - - namespace blink { - - HbFontCacheEntry::HbFontCacheEntry(hb_font_t* font) -- : hb_font_(HbScoped(font)), -+ : hb_font_(hb::unique_ptr(font)), - hb_font_data_(std::make_unique()) {} - - HbFontCacheEntry::~HbFontCacheEntry() = default; -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -index 1b0accf..eaedd0b 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h -@@ -7,9 +7,9 @@ - - #include "third_party/blink/renderer/platform/fonts/font_metrics.h" - #include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" --#include "third_party/harfbuzz-ng/utils/hb_scoped.h" - - #include -+#include - - #include - -@@ -39,7 +39,7 @@ class HbFontCacheEntry : public RefCount - private: - explicit HbFontCacheEntry(hb_font_t* font); - -- HbScoped hb_font_; -+ hb::unique_ptr hb_font_; - std::unique_ptr hb_font_data_; - }; - -diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -index caf5d49..0d4b6f9 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h -@@ -5,6 +5,8 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_DATA_H_ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_DATA_H_ - -+#include -+ - #include "base/check_op.h" - #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" - #include "third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h" -diff --git a/third_party/harfbuzz-ng/BUILD.gn b/third_party/harfbuzz-ng/BUILD.gn -index 522e164d..4b64e1b 100644 ---- a/third_party/harfbuzz-ng/BUILD.gn -+++ b/third_party/harfbuzz-ng/BUILD.gn -@@ -41,6 +41,7 @@ - "src/src/hb-blob.h", - "src/src/hb-buffer.h", - "src/src/hb-common.h", -+ "src/src/hb-cplusplus.hh", - "src/src/hb-deprecated.h", - "src/src/hb-face.h", - "src/src/hb-font.h", -@@ -409,11 +410,6 @@ - } - } - --source_set("hb_scoped_util") { -- sources = [ "utils/hb_scoped.h" ] -- deps = [ "//third_party:freetype_harfbuzz" ] --} -- - # Not all checkouts have a //base directory. - if (build_with_chromium) { - fuzzer_test("hb_shape_fuzzer") { -diff --git a/third_party/harfbuzz-ng/utils/hb_scoped.h b/third_party/harfbuzz-ng/utils/hb_scoped.h -deleted file mode 100644 -index 887f6b90..0000000 ---- a/third_party/harfbuzz-ng/utils/hb_scoped.h -+++ /dev/null -@@ -1,60 +0,0 @@ --// Copyright 2020 The Chromium Authors. All rights reserved. --// Use of this source code is governed by a BSD-style license that can be --// found in the LICENSE file. -- --#ifndef THIRD_PARTY_HARFBUZZ_NG_UTILS_HB_SCOPED_H_ --#define THIRD_PARTY_HARFBUZZ_NG_UTILS_HB_SCOPED_H_ -- --// clang-format off --#include --#include --// clang-format on -- --#include --#include -- --template --struct always_false : std::false_type {}; -- --template --struct HbSpecializedDeleter { -- inline void operator()(T* obj) { -- static_assert(always_false::value, -- "HbScoped is only allowed for HarfBuzz types that have a " -- "deleter specialization."); -- } --}; -- --// Defines a scoped pointer type HbScoped based on std::unique_ptr, using the --// corresponsing HarfBuzz destructors to commonly used public HarfBuzz types. --// The interface of HbScoped is the same as that of std::unique_ptr. --// --// void MyFunction() { --// HbScoped scoped_harfbuzz_blob( --// hb_blob_create(mydata, mylength)); --// --// DoSomethingWithBlob(scoped_harfbuzz_blob.get()); --// } --// --// When |scoped_harfbuzz_buffer| goes out of scope, hb_blob_destroy() is called --// for the hb_blob_t* created from hb_blob_create(). --template --using HbScoped = std::unique_ptr>; -- --#define SPECIALIZED_DELETER_FOR_HARFBUZZ_TYPE(TYPE, DESTRUCTOR) \ -- template <> \ -- struct HbSpecializedDeleter { \ -- inline void operator()(TYPE* obj) { DESTRUCTOR(obj); } \ -- }; -- --#define HB_TYPE_DESTRUCTOR_PAIRS_REPEAT(F) \ -- F(hb_blob_t, hb_blob_destroy) \ -- F(hb_buffer_t, hb_buffer_destroy) \ -- F(hb_face_t, hb_face_destroy) \ -- F(hb_font_t, hb_font_destroy) \ -- F(hb_set_t, hb_set_destroy) \ -- F(hb_subset_input_t, hb_subset_input_destroy) -- --HB_TYPE_DESTRUCTOR_PAIRS_REPEAT(SPECIALIZED_DELETER_FOR_HARFBUZZ_TYPE) -- --#endif // THIRD_PARTY_HARFBUZZ_NG_UTILS_HB_SCOPED_H_ diff --git a/http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch b/http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch deleted file mode 100644 index 9a9997b..0000000 --- a/http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch +++ /dev/null @@ -1,36 +0,0 @@ -From d8985805ba3c963d9aabbd2c77d15dbd8d7290c5 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 15 May 2024 18:46:03 +0000 -Subject: [PATCH] GCC: explicitly use base::span constructor in - HttpAuthNtlmMechanism -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -base::span requires explicit construction for several of the -constructors. Theoretically the constructor used here should not -require that but GCC complains. - -Bug: 40565911 -Change-Id: I452f31ee0862c3e986e15207f89baa043b016da8 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5540995 -Reviewed-by: Maks Orlovich -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1301466} ---- - net/http/http_auth_ntlm_mechanism.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/http/http_auth_ntlm_mechanism.cc b/net/http/http_auth_ntlm_mechanism.cc -index ddab00151cda9c..0b103303df56f7 100644 ---- a/net/http/http_auth_ntlm_mechanism.cc -+++ b/net/http/http_auth_ntlm_mechanism.cc -@@ -149,7 +149,7 @@ int HttpAuthNtlmMechanism::GenerateAuthToken( - return ERR_UNEXPECTED; - - uint8_t client_challenge[8]; -- g_generate_random_proc(client_challenge); -+ g_generate_random_proc(base::span(client_challenge)); - - auto next_token = ntlm_client_.GenerateAuthenticateMessage( - domain, user, credentials->password(), hostname, channel_bindings, spn, diff --git a/ip_protection_data_types-missing-optional.patch b/ip_protection_data_types-missing-optional.patch new file mode 100644 index 0000000..8b52ac0 --- /dev/null +++ b/ip_protection_data_types-missing-optional.patch @@ -0,0 +1,32 @@ +From 7e28832cd3320d2b603e6ef9468581e1c65c14f1 Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Thu, 19 Sep 2024 15:05:26 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::optional in + ip_protection_data_types.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug: 41455655 +Change-Id: Id26fc5bc3a4bde79c2f9a3134d18eeaab68603ad +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5873261 +Commit-Queue: José Dapena Paz +Reviewed-by: Dustin Mitchell +Cr-Commit-Position: refs/heads/main@{#1357601} +--- + components/ip_protection/common/ip_protection_data_types.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/components/ip_protection/common/ip_protection_data_types.h b/components/ip_protection/common/ip_protection_data_types.h +index 35648110915fc4..978dfac4ac74a5 100644 +--- a/components/ip_protection/common/ip_protection_data_types.h ++++ b/components/ip_protection/common/ip_protection_data_types.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_IP_PROTECTION_COMMON_IP_PROTECTION_DATA_TYPES_H_ + #define COMPONENTS_IP_PROTECTION_COMMON_IP_PROTECTION_DATA_TYPES_H_ + ++#include ++ + #include "base/time/time.h" + + namespace ip_protection { diff --git a/libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch b/libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch deleted file mode 100644 index 981577f..0000000 --- a/libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- src/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc.orig 2024-05-29 12:13:50.205359130 +0200 -+++ src/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc 2024-05-29 23:55:59.239008160 +0200 -@@ -311,8 +311,10 @@ int LibaomAv1Encoder::InitEncode(const V - - if (codec_settings->mode == VideoCodecMode::kRealtimeVideo && - encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) { -+#ifdef AOM_CTRL_AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, - max_consec_frame_drop_); -+#endif - } - - if (cfg_.g_threads == 8) { diff --git a/licenses.py-FileNotFoundError.patch b/licenses.py-FileNotFoundError.patch deleted file mode 100644 index fbb8a64..0000000 --- a/licenses.py-FileNotFoundError.patch +++ /dev/null @@ -1,33 +0,0 @@ -[154/40125] python3 ../../tools/licenses/licenses.py --target-os=linux --depfile gen/components/resources/about_credits.d credits gen/components/resources/about_credits.html -FAILED: gen/components/resources/about_credits.html -python3 ../../tools/licenses/licenses.py --target-os=linux --depfile gen/components/resources/about_credits.d credits gen/components/resources/about_credits.html -Traceback (most recent call last): - File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1445, in - sys.exit(main()) - ^^^^^^ - File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1428, in main - if not GenerateCredits( - ^^^^^^^^^^^^^^^^ - File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 1069, in GenerateCredits - directory_metadata, _ = ParseDir(path, - ^^^^^^^^^^^^^^ - File "/home/abuild/rpmbuild/BUILD/src/out/Release/../../tools/licenses/licenses.py", line 670, in ParseDir - if not os.listdir(os.path.join(root, path)): - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/src/third_party/angle/src/common/third_party/xxhash' - - ---- src/tools/licenses/licenses.py.orig 2024-05-29 12:20:01.514877976 +0200 -+++ src/tools/licenses/licenses.py 2024-05-29 22:54:04.691863557 +0200 -@@ -667,7 +667,10 @@ def ParseDir(path, - return [], [] - - # gclient creates empty directories for conditionally downloaded submodules. -- if not os.listdir(os.path.join(root, path)): -+ try: -+ if not os.listdir(os.path.join(root, path)): -+ return [], [] -+ except FileNotFoundError: #This gets thrown if directory is missing instead of empty. - return [], [] - - # Get the metadata values, from diff --git a/native_css_paint_definition-expected-unqualified-id.patch b/native_css_paint_definition-expected-unqualified-id.patch deleted file mode 100644 index 41337c6..0000000 --- a/native_css_paint_definition-expected-unqualified-id.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bf5355ac24399cd37a7d210b1ce9586d70829ed5 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Fri, 17 May 2024 09:39:14 +0000 -Subject: [PATCH] GCC: do not add template parameter in constructor of - BaseKeyframe -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -GCC rejects adding redundantly the template parameter in the -constructor. - -Bug: 40565911 -Change-Id: Ie827f1dba5488893cb76e0e52e9c26866dff701c -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539114 -Reviewed-by: Jean-Philippe Gravel -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1302481} ---- - .../csspaint/nativepaint/native_css_paint_definition.h | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h b/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h -index 34d37ea466c632..24a676543895ac 100644 ---- a/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h -+++ b/third_party/blink/renderer/modules/csspaint/nativepaint/native_css_paint_definition.h -@@ -51,9 +51,7 @@ class MODULES_EXPORT NativeCssPaintDefinition : public NativePaintDefinition { - - template - struct TypedKeyframe : public BaseKeyframe { -- TypedKeyframe(double offset, -- std::unique_ptr& tf, -- T v) -+ TypedKeyframe(double offset, std::unique_ptr& tf, T v) - : BaseKeyframe(offset, tf), value(v) {} - T value; - }; diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 3e17455..985ff58 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,91 @@ +------------------------------------------------------------------- +Sun Jan 12 12:38:29 UTC 2025 - Bruno Pitrus + +- Update to 33.3.1 + * Drop 32-bit support + * chromium 130.0.6723.170 + * node 20.18.0 + * v8 13.0 + * Behavior Changed: frame properties may retrieve detached WebFrameMain instances or none at all + * Behavior Changed: webContents property on login on app + * Added a handler, app.setClientCertRequestPasswordHandler(handler), to help unlock cryptographic devices when a PIN is needed. + * Added View.setBorderRadius(radius) for customizing the border radius of views—with compatibility for WebContentsView. + * Extended navigationHistory API with 2 new functions for better history management. #42014 + * see https://github.com/electron/electron/releases/tag/v33.0.0 and https://www.electronjs.org/blog/electron-33-0 for more +- Disable aarch64 builds due to OBS hardware limits. Sorry. +- Drop Leap 15.5 support +- Drop no longer needed patches + * absl-base-dynamic_annotations.patch + * angle-State-constexpr.patch + * chromium-124-shims.patch + * color_provider-incomplete-ColorProviderInternal.patch + * ConsumeRadii-linker-error.patch + * Cr126-abseil-shims.patch + * crashpad-use-system-abseil.patch + * DesktopNativeWidgetAura-HandleActivationChanged-crash.patch + * harfbuzz-replace-chromium-scoped-type.patch + * harfbuzz-replace-HbScopedPointer.patch + * http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch + * licenses.py-FileNotFoundError.patch + * native_css_paint_definition-expected-unqualified-id.patch + * page_popup_controller-missing-optional.patch + * partition_alloc-no-lto.patch + * preview_cancel_reason-missing-string.patch + * quiche-QuicIntervalDeque-no-match-for-operator-mm.patch + * real_time_reporting_bindings-forward-declaration.patch + * run_segmenter-missing-optional.patch + * skia-system-vulkan-headers.patch + * system-zlib.patch + * text_decoder-missing-optional.patch + * wayland-proto-31-cursor-shape.patch +- Drop libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch and replace it with more fine-grained reverts: + * aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch + * aom3.10-AV1E_SET_AUTO_TILES.patch + * webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch + * webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch +- Drop the following revert: + * bad-font-gc0000.patch + * bad-font-gc000.patch + * bad-font-gc00.patch + * bad-font-gc0.patch + * bad-font-gc11.patch + * bad-font-gc1.patch + * bad-font-gc2.patch + * bad-font-gc3.patch +- Add bsc1224178-font-gc.patch for a proper fix for bsc#1224178 deb#1067886 +- Add backported or forwardable patches to fix build errors: + * account_id-missing-optional.patch + * css_attr_value_tainting-missing-once_flag.patch + * electron_usb_delegate-incomplete-UsbDeviceInfo.patch + * exception_context-missing-variant.patch + * fix-build-without-service-discovery.patch + * ip_protection_data_types-missing-optional.patch + * skia_image_decoder_base-missing-stack.patch + * vtt_scanner-missing-variant.patch + * wayland_connection-Wchanges-meaning.patch +- Add patches to fix build errors due to our changes: + * build-without-speech-service.patch + * chromium-123-qrcode.patch + * chromium-125-cloud_authenticator.patch + * chromium-127-crabby.patch + * chromium-129-disable-H.264-video-parser-during-demuxing.patch + * chromium-130-fontations.patch + * cr130-abseil-remove-unused-deps.patch + * cr130-absl-base.patch + * delete-old-language-detection-which-uses-tflite.patch + * fix-build-without-screen-ai.patch + * private_aggregation_host-uint128.patch + * remove-libphonenumber.patch + * system-absl_algorithm.patch + * wayland_version.patch +- 15.6: use bundled vulkan and spirv headers +- 15.6: revert upstream changes to build with old wayland + * wayland-protocol-toplevel-icon.patch + * wayland-protocol-toplevel-icon-2.patch + * wayland-protocol-toplevel-drag.patch +- Use bundled yuv everywhere due to system version being too old + + ------------------------------------------------------------------- Wed Nov 27 20:33:48 UTC 2024 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index a235210..af9e3f6 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -20,20 +20,20 @@ %define mod_name electron # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json -%define abi_version 125 +%define abi_version 130 # Do not provide libEGL.so, etc… %define __provides_exclude ^lib.*\\.so.*$ -#x86 requires SSE2 -#see v8/src/codegen/ia32/assembler-ia32.cc -%ifarch %ix86 -ExclusiveArch: i586 i686 -BuildArch: i686 -%{expand:%%global optflags %(echo "%optflags") -march=pentium4 -mtune=generic} -%endif +# Since https://github.com/chromium/chromium/commit/98742ca1b98b0598b1981671abb994c1a442ba6e blink no longer builds on ix86. +#(use of _mm_cvtsi128_si64) +ExcludeArch: %ix86 + +#private_aggregation_host-uint128.patch adds a int128 which is not supported by 32-bit gcc. +#If anyone still uses these platforms, have fun with fixing it. +ExcludeArch: %arm %bcond_without pipewire @@ -50,10 +50,6 @@ BuildArch: i686 #(all the widgets use Gtk unconditionally — not sure which of the changed codepaths are used in Electron) %bcond_with qt -%ifarch %ix86 -#work around npm rebuild crashes on OBS -%global jitless NODE_OPTIONS=--jitless -%endif %ifarch aarch64 riscv64 #Video acceleration API to support. Useful for e.g. signal messenger. @@ -77,7 +73,7 @@ BuildArch: i686 %bcond_without gdbjit %endif -%ifnarch %ix86 %arm aarch64 +%ifnarch %ix86 %arm %if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}) %bcond_without lto %else @@ -90,18 +86,11 @@ BuildArch: i686 %endif %ifarch aarch64 -%bcond_with lto +#Linker overflows without LTO. +%bcond_without lto %endif -%ifarch aarch64 -%if 0%{?suse_version} -%bcond_without mold -%else %bcond_with mold -%endif -%else -%bcond_with mold -%endif @@ -112,35 +101,22 @@ BuildArch: i686 %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora} -%bcond_without system_aom -%bcond_without system_spirv -%bcond_without harfbuzz_5 -%bcond_without link_vulkan -%bcond_without wayland_32 -%else -%bcond_with system_aom -%bcond_with system_spirv -%bcond_with harfbuzz_5 -%bcond_with link_vulkan -%bcond_with wayland_32 -%endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150600 || 0%{?fedora} >= 41 -%bcond_without system_yuv -%else %bcond_with system_yuv -%endif %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_vpx %bcond_without bro_11 %bcond_without ffmpeg_6 +%bcond_without wayland_34 +%bcond_without system_vk_headers %else %bcond_with system_vpx %bcond_with bro_11 %bcond_with ffmpeg_6 +%bcond_with wayland_34 +%bcond_with system_vk_headers %endif @@ -177,8 +153,10 @@ BuildArch: i686 # Some chromium code assumes absl::string_view is a typedef for std::string_view. This is not true on GCC7 systems such as Leap. %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_abseil +%bcond_without aom_38 %else %bcond_with system_abseil +%bcond_with aom_38 %endif %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 41 @@ -223,7 +201,7 @@ BuildArch: i686 Name: nodejs-electron -Version: 31.7.6 +Version: 33.3.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -241,11 +219,15 @@ Source400: ffmpeg-new-channel-layout.patch Source401: audio_file_reader-ffmpeg-AVFrame-duration.patch Source402: Cr122-ffmpeg-new-channel-layout.patch Source403: ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch -# and against harfbuzz 4 -Source415: harfbuzz-replace-chromium-scoped-type.patch -Source416: harfbuzz-replace-HbScopedPointer.patch -# and wayland 1.31 -Source450: wayland-proto-31-cursor-shape.patch +# and against aom 3.9 +Source410: aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch +Source411: aom3.10-AV1E_SET_AUTO_TILES.patch +Source412: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch +Source413: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch +# and wayland protocol 1.32 +Source420: wayland-protocol-toplevel-icon.patch +Source421: wayland-protocol-toplevel-icon-2.patch +Source422: wayland-protocol-toplevel-drag.patch # and abseil 2401 Source460: quiche-absl-HexStringToBytes.patch @@ -271,6 +253,7 @@ Patch82: node-compiler.patch Patch84: aarch64-Xclang.patch Patch85: devtools-frontend-compress_files-oom.patch Patch86: enable_stack_trace_line_numbers-symbol_level.patch +Patch97: chromium-127-cargo_crate.patch # PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors, @@ -292,7 +275,16 @@ Patch589: remove-puffin.patch Patch590: remove-sync.patch Patch591: fix-build-without-safebrowsing.patch Patch592: fix-build-without-supervised-users.patch - +Patch593: fix-build-without-screen-ai.patch +Patch594: build-without-speech-service.patch +#patches disabling rust features from Gentoo: https://data.gpo.zugaina.org/pf4public/dev-util/electron/files/ +Patch595: chromium-123-qrcode.patch +Patch596: chromium-130-fontations.patch +Patch597: chromium-125-cloud_authenticator.patch +Patch598: chromium-127-crabby.patch +#End gentoo patches +Patch599: remove-libphonenumber.patch +Patch600: delete-old-language-detection-which-uses-tflite.patch @@ -301,8 +293,6 @@ Patch1000: do-not-build-libvulkan.so.patch Patch1017: system-libdrm.patch # http://svnweb.mageia.org/packages/updates/7/chromium-browser-stable/current/SOURCES/chromium-74-pdfium-system-libopenjpeg2.patch?view=markup Patch1038: pdfium-fix-system-libs.patch -# https://sources.debian.org/patches/chromium/102.0.5005.115-1/system/zlib.patch/ -Patch1041: system-zlib.patch Patch1045: angle-system-xxhash.patch Patch1047: cares_public_headers.patch Patch1048: chromium-remove-bundled-roboto-font.patch @@ -312,21 +302,19 @@ Patch1065: base-system-nspr.patch Patch1066: system-gtest.patch Patch1068: system-six.patch Patch1069: system-usb_ids.patch -Patch1070: skia-system-vulkan-headers.patch Patch1071: system-pydeps.patch Patch1072: node-system-icu.patch Patch1073: system-nasm.patch Patch1074: no-zlib-headers.patch -Patch1076: crashpad-use-system-abseil.patch Patch1077: system-wayland.patch Patch1078: system-simdutf.patch Patch1079: system-libm.patch -Patch1082: chromium-124-shims.patch -Patch1083: Cr126-abseil-shims.patch -Patch1084: absl-base-dynamic_annotations.patch Patch1085: webp-no-sharpyuv.patch Patch1086: zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch Patch1087: system-ada-url.patch +Patch1088: cr130-abseil-remove-unused-deps.patch +Patch1089: system-absl_algorithm.patch +Patch1090: cr130-absl-base.patch # PATCHES to fix interaction with third-party software @@ -343,7 +331,6 @@ Patch2012: chromium-94-ffmpeg-roll.patch # 'nomerge' attribute cannot be applied to a declaration # See https://reviews.llvm.org/D92800 Patch2022: electron-13-fix-base-check-nomerge.patch -Patch2031: partition_alloc-no-lto.patch Patch2032: seccomp_bpf-no-lto.patch Patch2034: swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch Patch2035: RenderFrameHostImpl-use-after-free.patch @@ -362,20 +349,14 @@ Source2047: bundled-minizip.patch Patch2047: bundled-minizip.patch %endif Patch2048: absl2023-encapsulated_web_transport-StrCat.patch -Patch2049: libaom_av1_encoder-aom37-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch -# bsc#1224178 deb#1067886 -Patch2050: bad-font-gc0000.patch -Patch2051: bad-font-gc000.patch -Patch2052: bad-font-gc00.patch -Patch2053: bad-font-gc0.patch -Patch2054: bad-font-gc11.patch -Patch2055: bad-font-gc1.patch -Patch2056: bad-font-gc2.patch -Patch2057: bad-font-gc3.patch #Work around gcc14 overly aggressive optimizer. Patch2058: v8-strict-aliasing.patch #Fix opus audio not working (eg. Element voice messages) Patch2059: disable-FFmpegAllowLists.patch +# https://src.fedoraproject.org/rpms/chromium/blob/rawhide/f/chromium-129-disable-H.264-video-parser-during-demuxing.patch +Patch2060: chromium-129-disable-H.264-video-parser-during-demuxing.patch +Patch2061: private_aggregation_host-uint128.patch +Patch2062: wayland_version.patch # PATCHES that should be submitted upstream verbatim or near-verbatim @@ -394,22 +375,19 @@ Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCa Patch3144: mt21_util-flax-vector-conversions.patch Patch3149: boringssl-internal-addc-cxx.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch -Patch3154: licenses.py-FileNotFoundError.patch -Patch3161: preview_cancel_reason-missing-string.patch -Patch3163: DesktopNativeWidgetAura-HandleActivationChanged-crash.patch -Patch3165: http_auth_ntlm_mechanism-could-not-convert-to-base-span.patch -Patch3166: angle-State-constexpr.patch -Patch3167: color_provider-incomplete-ColorProviderInternal.patch -Patch3168: run_segmenter-missing-optional.patch -Patch3169: page_popup_controller-missing-optional.patch -Patch3170: native_css_paint_definition-expected-unqualified-id.patch -Patch3171: text_decoder-missing-optional.patch -Patch3172: real_time_reporting_bindings-forward-declaration.patch Patch3173: blink-platform-INSIDE_BLINK-Wodr.patch -Patch3174: quiche-QuicIntervalDeque-no-match-for-operator-mm.patch -Patch3175: ConsumeRadii-linker-error.patch -Patch3176: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch -Patch3177: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch +Patch3174: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch +Patch3175: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch +Patch3176: fix-build-without-service-discovery.patch +Patch3177: wayland_connection-Wchanges-meaning.patch +Patch3178: ip_protection_data_types-missing-optional.patch +Patch3179: account_id-missing-optional.patch +Patch3180: skia_image_decoder_base-missing-stack.patch +Patch3181: exception_context-missing-variant.patch +Patch3182: css_attr_value_tainting-missing-once_flag.patch +Patch3183: vtt_scanner-missing-variant.patch +Patch3184: electron_usb_delegate-incomplete-UsbDeviceInfo.patch +Patch3185: bsc1224178-font-gc.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -441,10 +419,11 @@ BuildRequires: libatomic %if %{with system_ada} BuildRequires: cmake(ada) %endif -%if %{with system_aom} +%if %{with aom_38} +BuildRequires: libaom-devel >= 3.8~ +%endif # requires AV1E_SET_QUANTIZER_ONE_PASS BuildRequires: libaom-devel >= 3.7~ -%endif BuildRequires: libbsd-devel BuildRequires: libpng-devel BuildRequires: libXNVCtrl-devel @@ -459,7 +438,7 @@ BuildRequires: memory-constraints BuildRequires: mold %endif %ifarch %ix86 x86_64 %x86_64 -%if %{without system_aom} || %{without system_vpx} +%if %{without system_vpx} BuildRequires: nasm %endif %endif @@ -495,7 +474,13 @@ BuildRequires: snappy-devel BuildRequires: update-desktop-files %endif BuildRequires: util-linux -BuildRequires: vulkan-headers +%if %{with system_vk_headers} +# Actually we need also SpvFPEncoding from spirv-headers but Fedora version is non-indicative. +# Let's only specify the vulkan version because they are usually updated together. +BuildRequires: vulkan-headers >= 1.3.296 +%endif +#For skia, needed anyway +BuildRequires: vulkan-headers >= 1.3 %if %{with system_vma} BuildRequires: VulkanMemoryAllocator-devel >= 3 %endif @@ -555,10 +540,7 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(glproto) BuildRequires: pkgconfig(gtest) >= 1.12 BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: pkgconfig(harfbuzz) >= 3 -%if %{with harfbuzz_5} BuildRequires: pkgconfig(harfbuzz) >= 5 -%endif BuildRequires: pkgconfig(icu-i18n) >= 73 BuildRequires: pkgconfig(jsoncpp) %if 0%{?fedora} @@ -597,6 +579,7 @@ BuildRequires: pkgconfig(libnotify) BuildRequires: pkgconfig(libpci) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(libsecret-1) +BuildRequires: pkgconfig(libudev) %if %{with vaapi} BuildRequires: pkgconfig(libva) %endif @@ -607,8 +590,8 @@ BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(libxxhash) %if %{with system_yuv} %if 0%{?suse_version} -# needs I410ToI420 -BuildRequires: pkgconfig(libyuv) >= 1855 +# needs I010ToNV12 +BuildRequires: pkgconfig(libyuv) >= 1894 %endif # Fedora does not provide meaningful versioning, sorry BuildRequires: pkgconfig(libyuv) @@ -635,22 +618,17 @@ BuildRequires: pkgconfig(Qt6Widgets) #re2-11 has abseil as a public dependency. If you use system re2 you must use system abseil. BuildRequires: cmake(re2) >= 11 %endif -%if %{with system_spirv} %if 0%{?suse_version} BuildRequires: spirv-headers %else BuildRequires: spirv-headers-devel %endif BuildRequires: pkgconfig(SPIRV-Tools) >= 2022.2 -BuildRequires: vulkan-headers >= 1.3 -%endif -%if %{with link_vulkan} BuildRequires: pkgconfig(vulkan) >= 1.3 +%if %{with wayland_34} +BuildRequires: pkgconfig(wayland-protocols) >= 1.33 %endif -BuildRequires: pkgconfig(wayland-protocols) -%if %{with wayland_32} BuildRequires: pkgconfig(wayland-protocols) >= 1.32 -%endif BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xshmfence) BuildRequires: pkgconfig(zlib) @@ -679,14 +657,6 @@ BuildRequires: pkgconfig(libspa-0.2) Requires: hicolor-icon-theme Requires: google-roboto-fonts -# This required library is dlopened -%if %{without link_vulkan} -%ifarch %ix86 %arm -Requires: libvulkan.so.1 -%else -Requires: libvulkan.so.1()(64bit) -%endif -%endif %if %{with qt} %if 0%{?fedora} @@ -762,10 +732,28 @@ providing better integration with desktop environments such as KDE. test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = %abi_version %if %{without system_abseil} -patch -R -p1 < %PATCH1076 +#patch -R -p1 < %PATCH1076 %endif +#These ones depend on an aom nightly, reverting unconditionally +patch -R -p1 < %SOURCE411 +patch -R -p1 < %SOURCE410 + +%if %{without aom_38} +patch -R -p1 < %SOURCE412 +patch -R -p1 < %SOURCE413 +%endif + +%if %{without wayland_34} +patch -R -p1 < %PATCH3177 +patch -R -p1 < %SOURCE422 +patch -R -p1 < %SOURCE421 +patch -R -p1 < %SOURCE420 +%endif + + + %if %{with ffmpeg_6} patch -R -p1 < %PATCH2012 %else @@ -777,15 +765,8 @@ patch -R -p1 < %SOURCE401 -%if %{without harfbuzz_5} -patch -R -p1 < %SOURCE415 -patch -R -p1 < %SOURCE416 -%endif -%if %{without wayland_32} -patch -R -p1 < %SOURCE450 -%endif @@ -793,6 +774,11 @@ patch -R -p1 < %SOURCE450 # This one depends on an abseil nightly, reverting unconditionally. patch -R -p1 < %SOURCE460 +#Replace non-free rollup 4.x with rollup 3.x. This probably won't last for long and we will have to figure out how to build rollup 4 +rm -rf third_party/node/node_modules/@rollup/wasm-node/ +ln -srvT third_party/devtools-frontend/src/node_modules/rollup third_party/node/node_modules/@rollup/wasm-node + + # Link system wayland-protocols-devel into where chrome expects them mkdir -p third_party/wayland/src mkdir -p third_party/wayland-protocols/kde/src @@ -830,6 +816,7 @@ gn_system_libraries=( highway icu jsoncpp + libaom libdrm libevent libjpeg @@ -845,6 +832,9 @@ gn_system_libraries=( woff2 zlib zstd + swiftshader-SPIRV-Headers + swiftshader-SPIRV-Tools + vulkan-SPIRV-Tools ) %if %{with system_abseil} @@ -875,10 +865,6 @@ gn_system_libraries+=( %endif -%if %{with system_aom} -find third_party/libaom -type f ! -name "*.gn" -a ! -name "*.gni" -delete -gn_system_libraries+=( libaom ) -%endif %if %{with system_avif} find third_party/libavif -type f ! -name "*.gn" -a ! -name "*.gni" -delete @@ -899,19 +885,10 @@ gn_system_libraries+=( re2 ) %endif -%if %{with system_spirv} -find third_party/swiftshader/third_party/SPIRV-Headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete -find third_party/swiftshader/third_party/SPIRV-Tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete - -find third_party/vulkan-deps/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete - -gn_system_libraries+=( - swiftshader-SPIRV-Headers - swiftshader-SPIRV-Tools -#The following can only be unbundled if you don't build DAWN (WebGPU) - vulkan-SPIRV-Headers - vulkan-SPIRV-Tools -) +%if %{with system_vk_headers} +find third_party/vulkan-headers -type f ! -name "*.gn" -a ! -name "*.gni" -delete +find third_party/spirv-headers -type f ! -name "*.gn" -a ! -name "*.gni" -delete +gn_system_libraries+=( vulkan-SPIRV-Headers ) %endif %if %{with system_vma} @@ -932,9 +909,6 @@ gn_system_libraries+=( libyuv ) build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]} -%if %{with link_vulkan} -find third_party/angle/src/third_party/volk -type f ! -name "*.gn" -a ! -name "*.gni" -delete -%endif %if %{with system_ada} find third_party/electron_node/deps/ada -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete @@ -1025,7 +999,8 @@ export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %ifarch aarch64 %if %{with lto} -export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" +# Out of memory: Killed process 4016 (lto1-wpa) +export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g0 /g' -e 's/-g$/-g0/g')" %endif %endif @@ -1155,9 +1130,7 @@ myconf_gn+=" use_cups=false" # link libvulkan.so and libGLX.so instead of dlopening myconf_gn+=" angle_use_custom_libvulkan=false" -%if %{with link_vulkan} myconf_gn+=" angle_shared_libvulkan=false" -%endif myconf_gn+=" angle_link_glx=true" #Use faster flat_map instead of fallback std::unordered_map implementation in ANGLE. @@ -1175,6 +1148,7 @@ myconf_gn+=' angle_enable_swiftshader=true' # do not build PDF support myconf_gn+=" enable_pdf=false" +myconf_gn+=' enable_pdf_ink2=false' myconf_gn+=" enable_pdf_viewer=false" myconf_gn+=" enable_print_preview=false" myconf_gn+=" enable_printing=false" @@ -1203,8 +1177,12 @@ myconf_gn+=' enable_electron_extensions=false' # [10675s] lto1: internal compiler error: in build_abbrev_table, at dwarf2out.cc:9244 myconf_gn+=' symbol_level=1' %else +%if %{without lto} +myconf_gn+=' symbol_level=1' # relocation truncated to fit +%else myconf_gn+=' symbol_level=2' %endif +%endif myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' %endif @@ -1217,7 +1195,6 @@ myconf_gn+=" v8_symbol_level=0" %ifarch aarch64 %if %{with lto} # linker OOM, sorry. -# we still seem to get some debug generated during linking when LTO is enabled myconf_gn+=' symbol_level=0' myconf_gn+=' blink_symbol_level=0' myconf_gn+=' v8_symbol_level=0' @@ -1231,6 +1208,9 @@ myconf_gn+=' v8_symbol_level=1' #symbol_level should not affect generated code. myconf_gn+=' enable_stack_trace_line_numbers=true' +#This does nothing since we patch the config out, but is needed to avoid an assert +myconf_gn+=' use_debug_fission=true' + # do not build some chrome features not used by electron # (some of these only go to buildflag_headers and are dead code rn, but disabling them preemptively as long as they're visible) @@ -1239,9 +1219,7 @@ myconf_gn+=" enable_reading_list=false" myconf_gn+=" enable_reporting=false" myconf_gn+=" build_with_tflite_lib=false" myconf_gn+=" build_tflite_with_xnnpack=false" -myconf_gn+=" build_webnn_with_xnnpack=false" myconf_gn+=" safe_browsing_mode=0" -myconf_gn+=" enable_maldoca=false" myconf_gn+=" enable_captive_portal_detection=false" myconf_gn+=" enable_browser_speech_service=false" myconf_gn+=" enable_speech_service=false" @@ -1256,17 +1234,14 @@ myconf_gn+=" enable_webui_tab_strip=false" myconf_gn+=" enable_webui_certificate_viewer=false" myconf_gn+=" enable_background_contents=false" myconf_gn+=" enable_extractors=false" -myconf_gn+=" enable_feed_v2=false" myconf_gn+=" ozone_platform_headless=false" myconf_gn+=" angle_enable_gl_null=false" myconf_gn+=" enable_paint_preview=false" myconf_gn+=" use_bundled_weston=false" -myconf_gn+=" enable_component_updater=false" myconf_gn+=" enable_lens_desktop=false" myconf_gn+=' enable_bound_session_credentials=false' myconf_gn+=' enable_chrome_notifications=false' myconf_gn+=' enable_message_center=false' -myconf_gn+=' enable_system_notifications=false' myconf_gn+=' enable_supervised_users=false' myconf_gn+=' enable_compose=false' myconf_gn+=' enterprise_cloud_content_analysis=false' @@ -1278,15 +1253,16 @@ myconf_gn+=' use_fake_screen_ai=true' myconf_gn+=' webnn_use_tflite=false' myconf_gn+=' structured_metrics_enabled=false' myconf_gn+=' structured_metrics_debug_enabled=false' +myconf_gn+=' build_dawn_tests=false' +myconf_gn+=' enable_compute_pressure=false' +myconf_fn+=' enable_guest_view=false' #FIXME: possibly enable this when skia gets built with rust code by default. #Need to patch in optflags and possibly FFI LTO hacks (see signal-desktop package for how it's done) myconf_gn+=' enable_rust=false' myconf_gn+=' enable_chromium_prelude=false' -myconf_gn+=' enable_cxx=false' -myconf_gn+=' chrome_certificate_policies_supported=false' myconf_gn+=' chrome_root_store_cert_management_ui=false' myconf_gn+=' use_kerberos=false' @@ -1298,6 +1274,7 @@ myconf_gn+=' disable_histogram_support=true' myconf_gn+=" enable_remoting=false" myconf_gn+=" enable_media_remoting=false" myconf_gn+=" enable_service_discovery=false" +myconf_gn+=' enable_mdns=false' #disable some debug/tracing hooks, they increase size and we do not build chrome://tracing anyway (see disable-catapult.patch) myconf_gn+=" enable_trace_logging=false" @@ -1348,6 +1325,7 @@ myconf_gn+=" v8_use_external_startup_data=true" myconf_gn+=" use_system_zlib=true" myconf_gn+=" use_system_libjpeg=true" myconf_gn+=" use_system_libpng=true" +myconf_gn+=' use_system_libwayland=true' #we don't build PDF support, so disabling the below: #myconf_gn+=" use_system_lcms2=true" @@ -1370,7 +1348,6 @@ myconf_gn+=" use_system_histogram=true" myconf_gn+=' use_system_simdutf=true' %endif myconf_gn+=" is_clang=false" -myconf_gn+=" use_gold=false" %if %{with lto} myconf_gn+=" gcc_lto=true" @@ -1405,6 +1382,8 @@ myconf_gn+=' skia_use_dawn=false' myconf_gn+=" proprietary_codecs=true" myconf_gn+=" ffmpeg_branding=\"Chrome\"" + + # GN does not support passing cflags: # https://bugs.chromium.org/p/chromium/issues/detail?id=642016 gn gen out/Release --testonly=false --args="import(\"//electron/build/args/release.gn\") ${myconf_gn}" diff --git a/page_popup_controller-missing-optional.patch b/page_popup_controller-missing-optional.patch deleted file mode 100644 index eb528d7..0000000 --- a/page_popup_controller-missing-optional.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f3fce92b27296068b4c304321b53bd1c7c4beb61 Mon Sep 17 00:00:00 2001 -From: "lauren n. liberda" -Date: Tue, 28 May 2024 17:54:26 +0000 -Subject: [PATCH] iwyu: missing in page_popup_controller.h - -Bug: 41455655 -Change-Id: I6483b9ec9d3c4acc08fb2bce8cac409c32a06dc4 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5569043 -Reviewed-by: Lei Zhang -Commit-Queue: Lei Zhang -Reviewed-by: Khushal Sagar -Cr-Commit-Position: refs/heads/main@{#1306871} ---- - AUTHORS | 1 + - third_party/blink/renderer/core/page/page_popup_controller.h | 2 ++ - 2 files changed, 3 insertions(+) - -diff --git a/AUTHORS b/AUTHORS -index eba1dc976d8fa0..715e108aca1c3d 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -818,6 +818,7 @@ Lalit Chandivade - Lam Lu - Laszlo Gombos - Laszlo Radanyi -+lauren n. liberda - Lauren Yeun Kim - Lauri Oherd - Lavar Askew -diff --git a/third_party/blink/renderer/core/page/page_popup_controller.h b/third_party/blink/renderer/core/page/page_popup_controller.h -index 5da38d0b9ab26f..c4e8e865fa96d3 100644 ---- a/third_party/blink/renderer/core/page/page_popup_controller.h -+++ b/third_party/blink/renderer/core/page/page_popup_controller.h -@@ -31,6 +31,8 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PAGE_POPUP_CONTROLLER_H_ - #define THIRD_PARTY_BLINK_RENDERER_CORE_PAGE_PAGE_POPUP_CONTROLLER_H_ - -+#include -+ - #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" - #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" - #include "third_party/blink/renderer/platform/heap/garbage_collected.h" diff --git a/partition_alloc-no-lto.patch b/partition_alloc-no-lto.patch deleted file mode 100644 index 4ad227d..0000000 --- a/partition_alloc-no-lto.patch +++ /dev/null @@ -1,72 +0,0 @@ -Compile files which declare functions in inline assembly without LTO due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57703 - ---- src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.orig 2024-07-24 12:50:43.409128966 +0200 -+++ src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn 2024-07-26 13:37:20.891041131 +0200 -@@ -107,6 +107,31 @@ source_set("build_config") { - ] - } - -+static_library("allocator_core_asm") { -+ if (gcc_lto) { -+ configs -= [ "//build/config/compiler:gcc_lto" ] -+ } -+ if (current_cpu == "x64") { -+ assert(stack_scan_supported) -+ sources = [ "stack/asm/x64/push_registers_asm.cc" ] -+ } else if (current_cpu == "x86") { -+ assert(stack_scan_supported) -+ sources = [ "stack/asm/x86/push_registers_asm.cc" ] -+ } else if (current_cpu == "arm") { -+ assert(stack_scan_supported) -+ sources = [ "stack/asm/arm/push_registers_asm.cc" ] -+ } else if (current_cpu == "arm64") { -+ assert(stack_scan_supported) -+ sources = [ "stack/asm/arm64/push_registers_asm.cc" ] -+ } else if (current_cpu == "riscv64") { -+ assert(stack_scan_supported) -+ sources = [ "stack/asm/riscv64/push_registers_asm.cc" ] -+ } else { -+ # To support a trampoline for another arch, please refer to v8/src/heap/base. -+ assert(!stack_scan_supported) -+ } -+} -+ - component("raw_ptr") { - # `gn check` is unhappy with most `#includes` when PA isn't - # actually built. -@@ -522,24 +547,9 @@ if (is_clang_or_gcc) { - # The Android NDK supports PR_MTE_* macros as of NDK r23. - defines += [ "HAS_PR_MTE_MACROS" ] - } -- if (current_cpu == "x64") { -- assert(stack_scan_supported) -- sources += [ "stack/asm/x64/push_registers_asm.cc" ] -- } else if (current_cpu == "x86") { -- assert(stack_scan_supported) -- sources += [ "stack/asm/x86/push_registers_asm.cc" ] -- } else if (current_cpu == "arm") { -- assert(stack_scan_supported) -- sources += [ "stack/asm/arm/push_registers_asm.cc" ] -- } else if (current_cpu == "arm64") { -- assert(stack_scan_supported) -- sources += [ "stack/asm/arm64/push_registers_asm.cc" ] -- } else if (current_cpu == "riscv64") { -- assert(stack_scan_supported) -- sources += [ "stack/asm/riscv64/push_registers_asm.cc" ] -- } else { -- # To support a trampoline for another arch, please refer to v8/src/heap/base. -- assert(!stack_scan_supported) -+ deps = [ ":allocator_base" ] -+ if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm" || current_cpu == "arm64" || current_cpu == "riscv64") { -+ deps += [ ":allocator_core_asm" ] - } - - # TODO(crbug.com/40274683): once we evaluate pool offset freelists, -@@ -563,7 +573,6 @@ if (is_clang_or_gcc) { - ":memory_tagging", - ":wexit_time_destructors", - ] -- deps = [ ":allocator_base" ] - public_configs = [] - if (is_android) { - # tagging.cc requires __arm_mte_set_* functions. diff --git a/preview_cancel_reason-missing-string.patch b/preview_cancel_reason-missing-string.patch deleted file mode 100644 index c2d3402..0000000 --- a/preview_cancel_reason-missing-string.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/content/public/browser/preview_cancel_reason.h.orig 2024-05-30 22:55:47.180621500 +0000 -+++ src/content/public/browser/preview_cancel_reason.h 2024-05-31 07:46:06.285116500 +0000 -@@ -5,6 +5,8 @@ - #ifndef CONTENT_PUBLIC_BROWSER_PREVIEW_CANCEL_REASON_H_ - #define CONTENT_PUBLIC_BROWSER_PREVIEW_CANCEL_REASON_H_ - -+#include -+ - #include "content/common/content_export.h" - #include "third_party/abseil-cpp/absl/types/variant.h" - diff --git a/private_aggregation_host-uint128.patch b/private_aggregation_host-uint128.patch new file mode 100644 index 0000000..4f34619 --- /dev/null +++ b/private_aggregation_host-uint128.patch @@ -0,0 +1,42 @@ +Abseil's int128 hasd broken comparison under gcc: + +In file included from /usr/include/c++/14/string:49, + from ../../content/browser/private_aggregation/private_aggregation_host.h:11: +/usr/include/c++/14/bits/stl_function.h: In instantiation of ‘constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = content::{anonymous}::ContributionMergeKey]’: +/usr/include/c++/14/bits/stl_map.h:599:37: required from ‘std::pair, std::_Select1st >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::emplace(_Args&& ...) [with _Args = {content::{anonymous}::ContributionMergeKey, blink::mojom::AggregatableReportHistogramContribution&}; _Key = content::{anonymous}::ContributionMergeKey; _Tp = blink::mojom::AggregatableReportHistogramContribution; _Compare = std::less; _Alloc = std::allocator >; typename std::_Rb_tree<_Key, std::pair, std::_Select1st >, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other>::iterator = std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind >::other = std::allocator >; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind > = __gnu_cxx::__alloc_traits >, std::pair >::rebind >; typename _Allocator::value_type = std::pair]’ + 599 | if (__i == end() || key_comp()(__k, (*__i).first)) + | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ +../../content/browser/private_aggregation/private_aggregation_host.cc:457:37: required from here + 457 | accepted_contributions.emplace(std::move(merge_key), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ + 458 | *std::move(contribution)); + | ~~~~~~~~~~~~~~~~~~~~~~~~~ +/usr/include/c++/14/bits/stl_function.h:405:20: error: use of deleted function ‘constexpr auto content::{anonymous}::ContributionMergeKey::operator<=>(const content::{anonymous}::ContributionMergeKey&) const’ + 405 | { return __x < __y; } + | ~~~~^~~~~ +../../content/browser/private_aggregation/private_aggregation_host.cc:141:8: note: ‘constexpr auto content::{anonymous}::ContributionMergeKey::operator<=>(const content::{anonymous}::ContributionMergeKey&) const’ is implicitly deleted because the default definition would be ill-formed: + 141 | auto operator<=>(const ContributionMergeKey& a) const = default; + | ^~~~~~~~ +../../content/browser/private_aggregation/private_aggregation_host.cc:143:17: note: three-way comparison of ‘content::{anonymous}::ContributionMergeKey::bucket’ has type ‘absl::lts_20240722::strong_ordering’, not a comparison category type + 143 | absl::uint128 bucket; + | ^~~~~~ + +--- src/content/browser/private_aggregation/private_aggregation_host.cc 2025-01-02 22:23:57.594885484 +0100 ++++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/src/content/browser/private_aggregation/private_aggregation_host.cc 2025-01-03 21:33:27.795544465 +0100 +@@ -51,7 +51,6 @@ + #include "mojo/public/cpp/bindings/pending_receiver.h" + #include "mojo/public/cpp/bindings/receiver_set.h" + #include "services/network/public/cpp/is_potentially_trustworthy.h" +-#include "third_party/abseil-cpp/absl/numeric/int128.h" + #include "third_party/blink/public/common/features.h" + #include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom.h" + #include "third_party/blink/public/mojom/private_aggregation/private_aggregation_host.mojom.h" +@@ -140,7 +139,7 @@ struct ContributionMergeKey { + + auto operator<=>(const ContributionMergeKey& a) const = default; + +- absl::uint128 bucket; ++ unsigned __int128 bucket; + uint64_t filtering_id; + }; + diff --git a/quiche-QuicIntervalDeque-no-match-for-operator-mm.patch b/quiche-QuicIntervalDeque-no-match-for-operator-mm.patch deleted file mode 100644 index a3d7f4c..0000000 --- a/quiche-QuicIntervalDeque-no-match-for-operator-mm.patch +++ /dev/null @@ -1,67 +0,0 @@ -From d3bc5ffc929b0895ae9e16774069a04ae6fe3c58 Mon Sep 17 00:00:00 2001 -From: bnc -Date: Mon, 13 May 2024 12:28:35 -0700 -Subject: [PATCH] Add some QuicIntervalDeque::Iterator methods. - -GCC requires operator-=() and operator--() to be defined for std::advance for -random access iterators. - -Also, `QUICHE_DCHECK_LE(0u, index_)` is always true as `index_` is unsigned, -causing a warning that is promoted to an error in some environments. This CL -verifies that the addition does not result in underflow before the it is -performed, not after. - -PiperOrigin-RevId: 633296228 ---- - quiche/quic/core/quic_interval_deque.h | 19 +++++++++-- - quiche/quic/core/quic_interval_deque_test.cc | 33 ++++++++++++++++++++ - 2 files changed, 50 insertions(+), 2 deletions(-) - -diff --git a/quiche/quic/core/quic_interval_deque.h b/quiche/quic/core/quic_interval_deque.h -index db7b2b0ac..1c6cd71a5 100644 ---- a/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h -+++ b/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h -@@ -158,7 +158,7 @@ class QUICHE_NO_EXPORT QuicIntervalDeque { - Iterator(std::size_t index, QuicIntervalDeque* deque) - : index_(index), deque_(deque) {} - // Only the ++ operator attempts to update the cached index. Other operators -- // are used by |lower_bound| to binary search and are thus private. -+ // are used by |lower_bound| to binary search. - Iterator& operator++() { - // Don't increment when we are at the end. - const std::size_t container_size = deque_->container_.size(); -@@ -186,6 +186,19 @@ class QUICHE_NO_EXPORT QuicIntervalDeque { - ++(*this); - return copy; - } -+ Iterator& operator--() { -+ if (index_ == 0) { -+ QUIC_BUG(quic_bug_10862_4) << "Iterator out of bounds."; -+ return *this; -+ } -+ index_--; -+ return *this; -+ } -+ Iterator operator--(int) { -+ Iterator copy = *this; -+ --(*this); -+ return copy; -+ } - reference operator*() { return deque_->container_[index_]; } - reference operator*() const { return deque_->container_[index_]; } - pointer operator->() { return &deque_->container_[index_]; } -@@ -194,11 +207,13 @@ class QUICHE_NO_EXPORT QuicIntervalDeque { - } - bool operator!=(const Iterator& rhs) const { return !(*this == rhs); } - Iterator& operator+=(difference_type amount) { -+ // `amount` might be negative, check for underflow. -+ QUICHE_DCHECK_GE(static_cast(index_), -amount); - index_ += amount; -- QUICHE_DCHECK_LE(0u, index_); - QUICHE_DCHECK_LT(index_, deque_->Size()); - return *this; - } -+ Iterator& operator-=(difference_type amount) { return operator+=(-amount); } - difference_type operator-(const Iterator& rhs) const { - return static_cast(index_) - - static_cast(rhs.index_); diff --git a/quiche-absl-HexStringToBytes.patch b/quiche-absl-HexStringToBytes.patch index fdb8c4e..1bf870c 100644 --- a/quiche-absl-HexStringToBytes.patch +++ b/quiche-absl-HexStringToBytes.patch @@ -22,15 +22,6 @@ diff --git a/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc index 167e4efc4..fc8cffd40 100644 --- a/net/third_party/quiche/src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc +++ b/net/third_party/quiche/src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc -@@ -6,6 +6,8 @@ - - #include - #include -+#include -+#include - - #include "absl/strings/escaping.h" - #include "absl/strings/match.h" @@ -18,6 +20,7 @@ #include "quiche/quic/core/quic_types.h" #include "quiche/quic/core/quic_utils.h" @@ -60,34 +51,34 @@ index eefd002dc..06e6ed2b7 100644 --- a/net/third_party/quiche/src/quiche/quic/masque/masque_client_bin.cc +++ b/net/third_party/quiche/src/quiche/quic/masque/masque_client_bin.cc @@ -281,7 +281,12 @@ int RunMasqueClient(int argc, char* argv[]) { - QUIC_LOG(ERROR) << "Signature authentication key ID cannot be empty"; + QUIC_LOG(ERROR) << "Concealed authentication key ID cannot be empty"; return 1; } -- private_key_seed = absl::HexStringToBytes(signature_auth_param_split[1]); -+ if (!absl::HexStringToBytes(signature_auth_param_split[1], +- private_key_seed = absl::HexStringToBytes(concealed_auth_param_split[1]); ++ if (!absl::HexStringToBytes(concealed_auth_param_split[1], + &private_key_seed)) { -+ QUIC_LOG(ERROR) << "Signature authentication key hex value is invalid"; ++ QUIC_LOG(ERROR) << "Concealed authentication key hex value is invalid"; + return 1; + } + if (private_key_seed.size() != kEd25519Rfc8032PrivateKeySize) { QUIC_LOG(ERROR) - << "Invalid signature authentication private key length " + << "Invalid Concealed authentication private key length " diff --git a/quiche/quic/masque/masque_server_backend.cc b/quiche/quic/masque/masque_server_backend.cc index f4ff2e0ed..66ca13c96 100644 --- a/net/third_party/quiche/src/quiche/quic/masque/masque_server_backend.cc +++ b/net/third_party/quiche/src/quiche/quic/masque/masque_server_backend.cc @@ -193,7 +193,10 @@ void MasqueServerBackend::SetSignatureAuth(absl::string_view signature_auth) { quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&kv[1]); - SignatureAuthCredential credential; + ConcealedAuthCredential credential; credential.key_id = std::string(kv[0]); - std::string public_key = absl::HexStringToBytes(kv[1]); + std::string public_key; + if (!absl::HexStringToBytes(kv[1], &public_key)) { -+ QUIC_LOG(FATAL) << "Invalid signature auth public key hex " << kv[1]; ++ QUIC_LOG(FATAL) << "Invalid concealed auth public key hex " << kv[1]; + } if (public_key.size() != sizeof(credential.public_key)) { - QUIC_LOG(FATAL) << "Invalid signature auth public key length " + QUIC_LOG(FATAL) << "Invalid concealed auth public key length " << public_key.size(); diff --git a/quiche/quic/tools/crypto_message_printer_bin.cc b/quiche/quic/tools/crypto_message_printer_bin.cc index eb7393d54..82850d94a 100644 diff --git a/real_time_reporting_bindings-forward-declaration.patch b/real_time_reporting_bindings-forward-declaration.patch deleted file mode 100644 index 0d4a6e6..0000000 --- a/real_time_reporting_bindings-forward-declaration.patch +++ /dev/null @@ -1,37 +0,0 @@ -From fb3678b0d1084b49c5ca795200131a7c0ac01ffe Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 15 May 2024 13:59:56 +0000 -Subject: [PATCH] libstdc++: real time reporting bindings vector requires full - declaration -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -libstdc++ implementation of std::vector requires the full declaration -of the type and not a forward declaration. This breaks compilation of -RealTimeReportingBindings, as it has an std::vector of -RealTimeReportingContributionPtr. - -Bug: 41455655 -Change-Id: I9ee70fbb58af36f4cfc43a5d4b1e99799f4c760c -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5541055 -Reviewed-by: Russ Hamilton -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1301266} ---- - content/services/auction_worklet/real_time_reporting_bindings.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/content/services/auction_worklet/real_time_reporting_bindings.h b/content/services/auction_worklet/real_time_reporting_bindings.h -index c755d5cab041ec..da4d05e96f788c 100644 ---- a/content/services/auction_worklet/real_time_reporting_bindings.h -+++ b/content/services/auction_worklet/real_time_reporting_bindings.h -@@ -12,7 +12,7 @@ - #include "content/common/content_export.h" - #include "content/services/auction_worklet/auction_v8_helper.h" - #include "content/services/auction_worklet/context_recycler.h" --#include "content/services/auction_worklet/public/mojom/real_time_reporting.mojom-forward.h" -+#include "content/services/auction_worklet/public/mojom/real_time_reporting.mojom.h" - #include "v8/include/v8-forward.h" - - namespace auction_worklet { diff --git a/remove-date-reproducible-builds.patch b/remove-date-reproducible-builds.patch index 750c1fc..ff76370 100644 --- a/remove-date-reproducible-builds.patch +++ b/remove-date-reproducible-builds.patch @@ -1,17 +1,17 @@ ---- a/tools/json_schema_compiler/cpp_util.py -+++ b/tools/json_schema_compiler/cpp_util.py -@@ -13,9 +13,9 @@ +--- src/tools/json_schema_compiler/cpp_util.py.orig 2024-12-08 18:35:12.604673841 +0100 ++++ src/tools/json_schema_compiler/cpp_util.py 2024-12-20 14:33:48.193965844 +0100 +@@ -11,9 +11,9 @@ import os + import posixpath import re - CHROMIUM_LICENSE = ( --"""// Copyright %d The Chromium Authors -+"""// Copyright 2022 The Chromium Authors +-CHROMIUM_LICENSE = ("""// Copyright %d The Chromium Authors ++CHROMIUM_LICENSE = ("""// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be --// found in the LICENSE file.""" % datetime.now().year -+// found in the LICENSE file.""" - ) +-// found in the LICENSE file.""" % datetime.now().year) ++// found in the LICENSE file.""") GENERATED_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITION IN // %s + // by tools/json_schema_compiler. --- a/tools/json_to_struct/json_to_struct.py +++ b/tools/json_to_struct/json_to_struct.py @@ -74,7 +74,7 @@ @@ -32,9 +32,9 @@ _GenerateH(basepath, output_root, head, namespace, schema, description) _GenerateCC(basepath, output_root, head, namespace, schema, description) ---- src/tools/json_schema_compiler/feature_compiler.py.old 2022-12-02 23:49:17.031737400 +0100 -+++ src/tools/json_schema_compiler/feature_compiler.py 2023-01-04 06:47:07.764551600 +0100 -@@ -19,7 +19,7 @@ +--- src/tools/json_schema_compiler/feature_compiler.py.orig 2024-12-08 18:35:12.604673841 +0100 ++++ src/tools/json_schema_compiler/feature_compiler.py 2024-12-20 14:34:28.740897256 +0100 +@@ -17,7 +17,7 @@ import json_parse # The template for the header file of the generated FeatureProvider. HEADER_FILE_TEMPLATE = """ @@ -43,7 +43,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@@ -43,7 +43,7 @@ +@@ -41,7 +41,7 @@ void %(method_name)s(FeatureProvider* pr # The beginning of the .cc file for the generated FeatureProvider. CC_FILE_BEGIN = """ @@ -52,11 +52,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@@ -899,7 +899,6 @@ - replace('.', '_').upper()), - 'method_name': self._method_name, - 'source_files': str([ToPosixPath(f) for f in self._source_files]), -- 'year': str(datetime.now().year) +@@ -987,8 +987,6 @@ class FeatureCompiler(object): + self._method_name, + 'source_files': + str([ToPosixPath(f) for f in self._source_files]), +- 'year': +- str(datetime.now().year) }) if not os.path.exists(self._out_root): os.makedirs(self._out_root) diff --git a/remove-dawn.patch b/remove-dawn.patch index d8a4707..3c16294 100644 --- a/remove-dawn.patch +++ b/remove-dawn.patch @@ -12,9 +12,9 @@ Remove this unused component which brings a huge dependency on //third_party/daw "//services/screen_ai/buildflags", "//services/service_manager/public/cpp", "//services/service_manager/public/mojom", ---- src/content/utility/services.cc.orig -+++ src/content/utility/services.cc -@@ -31,7 +31,6 @@ +--- src/content/utility/services.cc.orig 2024-12-08 18:34:58.184673416 +0100 ++++ src/content/utility/services.cc 2024-12-18 12:44:27.424691055 +0100 +@@ -32,7 +32,6 @@ #include "services/audio/service_factory.h" #include "services/data_decoder/data_decoder_service.h" #include "services/network/network_service.h" @@ -22,21 +22,20 @@ Remove this unused component which brings a huge dependency on //third_party/daw #include "services/tracing/public/mojom/tracing_service.mojom.h" #include "services/tracing/tracing_service.h" #include "services/video_capture/public/mojom/video_capture_service.mojom.h" -@@ -327,13 +326,6 @@ auto RunVideoCapture( +@@ -371,12 +370,6 @@ auto RunVideoEffects( } #endif -auto RunOnDeviceModel( - mojo::PendingReceiver - receiver) { -- return std::make_unique( -- std::move(receiver)); +- return on_device_model::OnDeviceModelService::Create(std::move(receiver)); -} - #if BUILDFLAG(ENABLE_VR) && !BUILDFLAG(IS_ANDROID) auto RunXrDeviceService( mojo::PendingReceiver receiver) { -@@ -408,9 +400,6 @@ void RegisterMainThreadServices(mojo::Se +@@ -455,9 +448,6 @@ void RegisterMainThreadServices(mojo::Se services.Add(RunVideoEffects); #endif @@ -46,8 +45,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw #if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS) services.Add(RunShapeDetectionService); ---- src/content/utility/utility_main.cc.orig 2024-07-24 12:50:51.439131000 +0200 -+++ src/content/utility/utility_main.cc 2024-08-03 00:11:18.255682100 +0200 +--- src/content/utility/utility_main.cc.orig 2024-12-08 18:34:58.184673416 +0100 ++++ src/content/utility/utility_main.cc 2024-12-18 12:43:43.314689968 +0100 @@ -32,7 +32,6 @@ #include "sandbox/policy/mojom/sandbox.mojom.h" #include "sandbox/policy/sandbox.h" @@ -55,8 +54,8 @@ Remove this unused component which brings a huge dependency on //third_party/daw -#include "services/on_device_model/on_device_model_service.h" #include "services/screen_ai/buildflags/buildflags.h" #include "services/tracing/public/cpp/trace_startup.h" - #include "third_party/icu/source/common/unicode/unistr.h" -@@ -246,9 +245,6 @@ int UtilityMain(MainFunctionParams param + +@@ -238,9 +237,6 @@ int UtilityMain(MainFunctionParams param } } @@ -66,7 +65,7 @@ Remove this unused component which brings a huge dependency on //third_party/daw #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // Thread type delegate of the process should be registered before first -@@ -283,11 +279,6 @@ int UtilityMain(MainFunctionParams param +@@ -275,11 +271,6 @@ int UtilityMain(MainFunctionParams param case sandbox::mojom::Sandbox::kAudio: pre_sandbox_hook = base::BindOnce(&audio::AudioPreSandboxHook); break; @@ -78,7 +77,7 @@ Remove this unused component which brings a huge dependency on //third_party/daw case sandbox::mojom::Sandbox::kSpeechRecognition: pre_sandbox_hook = base::BindOnce(&speech::SpeechRecognitionPreSandboxHook); -@@ -437,9 +428,6 @@ int UtilityMain(MainFunctionParams param +@@ -440,9 +431,6 @@ int UtilityMain(MainFunctionParams param run_loop.Run(); diff --git a/remove-libphonenumber.patch b/remove-libphonenumber.patch new file mode 100644 index 0000000..75c7172 --- /dev/null +++ b/remove-libphonenumber.patch @@ -0,0 +1,22 @@ +--- src/third_party/blink/renderer/platform/BUILD.gn.orig 2025-01-02 22:23:59.424885429 +0100 ++++ src/third_party/blink/renderer/platform/BUILD.gn 2025-01-03 19:03:30.286845650 +0100 +@@ -1243,8 +1243,6 @@ component("platform") { + "keyboard_codes.h", + "language.cc", + "language.h", +- "language_detection/detect.cc", +- "language_detection/detect.h", + "link_hash.cc", + "link_hash.h", + "media/web_audio_source_provider_client.h", +@@ -1754,10 +1752,8 @@ component("platform") { + "//cc", + "//cc/ipc", + "//cc/mojo_embedder", +- "//components/language_detection/core:language_detection", + "//components/paint_preview/common", + "//components/search_engines:search_engine_utils", +- "//components/translate/core/language_detection:language_detection", + "//components/viz/client", + "//components/viz/common", + "//components/webrtc:net_address_utils", diff --git a/remove-password-manager-and-policy.patch b/remove-password-manager-and-policy.patch index f1300f5..b19124b 100644 --- a/remove-password-manager-and-policy.patch +++ b/remove-password-manager-and-policy.patch @@ -191,21 +191,21 @@ cgit v1.2.3 "//device/vr/buildflags", ] } ---- src/components/search_engines/BUILD.gn.orig -+++ src/components/search_engines/BUILD.gn -@@ -15,45 +15,23 @@ static_library("search_engines") { - "choice_made_location.h", +--- src/components/search_engines/BUILD.gn.orig 2024-12-08 18:34:56.928006713 +0100 ++++ src/components/search_engines/BUILD.gn 2024-12-18 12:48:04.888029763 +0100 +@@ -16,45 +16,23 @@ static_library("search_engines") { "default_search_manager.cc", "default_search_manager.h", -- "default_search_policy_handler.cc", -- "default_search_policy_handler.h", "eea_countries_ids.h", - "enterprise_site_search_manager.cc", - "enterprise_site_search_manager.h", +- "enterprise/default_search_policy_handler.cc", +- "enterprise/default_search_policy_handler.h", + "enterprise/enterprise_site_search_manager.cc", + "enterprise/enterprise_site_search_manager.h", - "keyword_table.cc", - "keyword_table.h", "keyword_web_data_service.cc", "keyword_web_data_service.h", + "search_engine_choice/search_engine_choice_metrics_service_accessor.h", - "search_engine_choice/search_engine_choice_service.cc", - "search_engine_choice/search_engine_choice_service.h", - "search_engine_choice/search_engine_choice_utils.cc", @@ -239,7 +239,7 @@ cgit v1.2.3 ] public_deps = [ -@@ -68,21 +46,14 @@ static_library("search_engines") { +@@ -69,7 +47,6 @@ static_library("search_engines") { "//components/sync", "//components/webdata/common", "//third_party/metrics_proto", @@ -247,12 +247,14 @@ cgit v1.2.3 ] deps = [ - "//base:i18n", +@@ -77,15 +54,9 @@ static_library("search_engines") { "//components/country_codes", + "//components/crash/core/common:crash_key", "//components/database_utils", - "//components/infobars/core", - "//components/lens:lens", - "//components/lens/proto/server:proto", + "//components/metrics", "//components/omnibox/common", - "//components/policy:generated", - "//components/policy/core/browser", @@ -261,7 +263,7 @@ cgit v1.2.3 "//components/signin/public/base", "//components/strings", "//components/url_formatter", -@@ -94,7 +65,6 @@ static_library("search_engines") { +@@ -97,7 +68,6 @@ static_library("search_engines") { "//services/network/public/mojom", "//sql", "//third_party/metrics_proto", @@ -269,8 +271,8 @@ cgit v1.2.3 "//ui/base", "//ui/gfx", "//ui/gfx/geometry", -@@ -112,7 +82,7 @@ static_library("search_engines") { - deps += [ "//components/search_engines/android:jni_headers" ] +@@ -123,7 +93,7 @@ static_library("search_engines") { + ] } - if (!is_android) { @@ -278,15 +280,15 @@ cgit v1.2.3 sources += [ "search_engine_choice/generated_marketing_snippets.cc" ] deps += [ ":generate_search_engine_icons", -@@ -121,7 +91,7 @@ static_library("search_engines") { +@@ -132,7 +102,7 @@ static_library("search_engines") { ] } - if (is_linux || is_win || is_mac || is_chromeos) { + if (false) { sources += [ - "site_search_policy_handler.cc", - "site_search_policy_handler.h", + "enterprise/site_search_policy_handler.cc", + "enterprise/site_search_policy_handler.h", --- src/components/search/BUILD.gn.old +++ src/components/search/BUILD.gn @@ -6,10 +6,6 @@ static_library("search") { @@ -320,8 +322,8 @@ cgit v1.2.3 "//components/url_formatter", "//components/url_matcher", "//components/version_info", ---- src/components/password_manager/core/browser/password_manager_switches.cc.orig 2024-07-24 12:50:49.362463800 +0200 -+++ src/components/password_manager/core/browser/password_manager_switches.cc 2024-08-04 16:04:17.829459300 +0200 +--- src/components/password_manager/core/browser/password_manager_switches.cc.orig 2024-12-08 18:34:56.591340037 +0100 ++++ src/components/password_manager/core/browser/password_manager_switches.cc 2024-12-18 12:47:00.934694855 +0100 @@ -10,11 +10,9 @@ namespace password_manager { // Specifies which encryption storage backend to use. Possible values are // kwallet, kwallet5, kwallet6, gnome-libsecret, basic. @@ -333,9 +335,9 @@ cgit v1.2.3 -const char kEnableEncryptionSelection[] = "enable-encryption-selection"; #endif // BUILDFLAG(IS_LINUX) - } // namespace password_manager ---- src/components/password_manager/core/browser/password_manager_switches.h.orig 2024-07-24 12:50:49.362463800 +0200 -+++ src/components/password_manager/core/browser/password_manager_switches.h 2024-08-04 16:03:48.687376900 +0200 + // Enables Password Sharing button in password details UI in settings when +--- src/components/password_manager/core/browser/password_manager_switches.h.orig 2024-12-08 18:34:56.591340037 +0100 ++++ src/components/password_manager/core/browser/password_manager_switches.h 2024-12-18 12:48:40.918030653 +0100 @@ -11,8 +11,8 @@ namespace password_manager { @@ -344,6 +346,16 @@ cgit v1.2.3 -extern const char kEnableEncryptionSelection[]; +inline constexpr const char kPasswordStore[] = "password-store"; +inline constexpr const char kEnableEncryptionSelection[] = "enable-encryption-selection"; - #endif + #endif // BUILDFLAG(IS_LINUX) - } // namespace password_manager + extern const char kEnableShareButtonUnbranded[]; +--- src/chrome/common/extensions/BUILD.gn.orig 2025-01-02 10:33:17.939583644 +0100 ++++ src/chrome/common/extensions/BUILD.gn 2025-01-02 11:36:57.232099250 +0100 +@@ -76,7 +76,6 @@ source_set("extensions") { + "//chrome/common/extensions/api:extensions_features", + "//components/app_constants", + "//components/device_signals/core/common:features", +- "//components/policy/core/common", + "//components/url_formatter", + "//components/version_info", + "//extensions:extensions_resources", diff --git a/remove-puffin.patch b/remove-puffin.patch index 5900342..1817cba 100644 --- a/remove-puffin.patch +++ b/remove-puffin.patch @@ -18,16 +18,3 @@ "//components/content_settings/core/common", "//components/crash/core/common", "//components/device_signals/core/common:features", ---- src/content/utility/BUILD.gn.orig -+++ src/content/utility/BUILD.gn -@@ -144,10 +144,6 @@ source_set("utility") { - } - } - -- if (is_linux || is_chromeos) { -- deps += [ "//services/screen_ai:screen_ai_sandbox_hook" ] -- } -- - if (enable_accessibility_service) { - deps += [ "//services/accessibility:lib" ] - } diff --git a/remove-rust.patch b/remove-rust.patch index 9c13100..679ae39 100644 --- a/remove-rust.patch +++ b/remove-rust.patch @@ -10,50 +10,50 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser:unit_tests", "//components/reading_list/core:unit_tests", "//components/reporting/client:unit_tests", ---- src/chrome/browser/BUILD.gn.orig -+++ src/chrome/browser/BUILD.gn -@@ -1972,7 +1972,6 @@ static_library("browser") { +--- src/chrome/browser/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 ++++ src/chrome/browser/BUILD.gn 2024-12-18 12:38:43.758015814 +0100 +@@ -1798,7 +1798,6 @@ static_library("browser") { "//chrome/browser/profiling_host", # TODO(crbug.com/40228447): break this dep when favicon is in its own target - "//chrome/browser/share", "//chrome/browser/ui", - "//chrome/browser/storage_access_api", - "//chrome/browser/top_level_storage_access_api:permissions", -@@ -2106,7 +2105,6 @@ static_library("browser") { - "//chrome/browser/safe_browsing:advanced_protection", - "//chrome/browser/safe_browsing:metrics_collector", - "//chrome/browser/safe_browsing:verdict_cache_manager_factory", + + # TODO(358041220): There is a circular_dependency of `cookie_controls:impl` module +@@ -1950,7 +1949,6 @@ static_library("browser") { + "//chrome/browser/search_engine_choice", + "//chrome/browser/search_engine_choice:impl", + "//chrome/browser/search_engines", - "//chrome/browser/share", "//chrome/browser/sharing:buildflags", - "//chrome/browser/sharing/proto", + "//chrome/browser/signin", "//chrome/browser/signin:identity_manager_provider", -@@ -4598,7 +4596,6 @@ static_library("browser") { - "//chrome/browser/policy:path_parser", +@@ -8566,7 +8564,6 @@ static_library("browser_generated_files" + "//chrome/browser/new_tab_page/modules/v2/calendar:mojo_bindings", + "//chrome/browser/new_tab_page/modules/v2/most_relevant_tab_resumption:mojo_bindings", "//chrome/browser/profile_resetter:profile_reset_report_proto", - "//chrome/browser/resources:component_extension_resources", - "//chrome/browser/share/proto:proto", - "//chrome/browser/smart_card", "//chrome/browser/support_tool:support_tool_proto", - "//chrome/browser/themes", -@@ -8407,7 +8404,6 @@ static_library("test_support") { - "//build:chromeos_buildflags", - "//chrome/app/theme:theme_resources", + "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto", + "//chrome/browser/ui:webui_name_variants", +@@ -9024,7 +9021,6 @@ static_library("test_support") { "//chrome/browser/policy/messaging_layer/proto:crd_event_proto", + "//chrome/browser/search_engine_choice", + "//chrome/browser/search_engines", - "//chrome/browser/share:share", "//chrome/common", "//chrome/common/notifications", "//chrome/common/safe_browsing:proto", ---- src/chrome/browser/ui/BUILD.gn.orig -+++ src/chrome/browser/ui/BUILD.gn -@@ -451,7 +451,6 @@ static_library("ui") { - "//chrome/browser/resources:dev_ui_resources", - "//chrome/browser/resources:resources", - "//chrome/browser/safe_browsing", +--- src/chrome/browser/ui/BUILD.gn.orig 2024-12-08 18:34:54.011339960 +0100 ++++ src/chrome/browser/ui/BUILD.gn 2024-12-18 12:39:08.101349746 +0100 +@@ -425,7 +425,6 @@ static_library("ui") { + "//chrome/browser/search_engine_choice", + "//chrome/browser/search_engine_choice:impl", + "//chrome/browser/search_engines", - "//chrome/browser/share", - "//chrome/browser/storage_access_api", - "//chrome/browser/themes", - "//chrome/browser/ui/side_panel:side_panel_enums", + "//chrome/browser/signin", + "//chrome/browser/signin:identity_manager_provider", + "//chrome/browser/signin:impl", @@ -591,7 +590,6 @@ static_library("ui") { "//components/privacy_sandbox:tracking_protection_settings", "//components/profile_metrics", @@ -62,20 +62,17 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser", "//components/reading_list/core", "//components/reading_list/features:flags", ---- src/build/rust/rust_target.gni.orig -+++ src/build/rust/rust_target.gni -@@ -7,7 +7,7 @@ import("//build/rust/rust_unit_test.gni" - - # The //build directory is re-used for non-Chromium products. We do not support - # cxx bindings in such contexts, because //third_party may be missing. --if (build_with_chromium) { -+if (false) { - import("//third_party/rust/cxx/chromium_integration/rust_cxx.gni") - } - ---- src/chrome/test/BUILD.gn.orig -+++ src/chrome/test/BUILD.gn -@@ -1942,7 +1942,6 @@ if (!is_android) { +--- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 ++++ src/chrome/test/BUILD.gn 2024-12-18 12:39:55.361350918 +0100 +@@ -2013,7 +2013,6 @@ if (!is_android) { + "//chrome/browser/web_applications:prevent_close_test_support", + "//chrome/browser/web_applications:web_applications_test_support", + "//chrome/browser/webaudio:browser_tests", +- "//chrome/browser/webauthn:test_support", + "//chrome/common:version_header", + "//chrome/common/companion/visual_query:flags", + "//chrome/common/privacy_budget:test_support", +@@ -2186,7 +2185,6 @@ if (!is_android) { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", "//components/proxy_config", @@ -83,31 +80,15 @@ Remove this dead code which brings a dependency on rustc "//components/reading_list/core", "//components/reading_list/features:flags", "//components/resources", -@@ -5593,7 +5592,6 @@ if (!is_android) { - if (!is_chromeos) { - sources += [ "../browser/webauthn/enclave_authenticator_browsertest.cc" ] - deps += [ -- "//chrome/browser/webauthn:test_support", - "//components/os_crypt/sync:test_support", - ] - } -@@ -6867,7 +6865,6 @@ test("unit_tests") { - "//chrome/browser/safe_browsing:metrics_collector", - "//chrome/browser/safe_browsing:verdict_cache_manager_factory", - "//chrome/browser/segmentation_platform:test_utils", -- "//chrome/browser/share", - "//chrome/browser/sharing/proto", - "//chrome/browser/storage_access_api", - "//chrome/browser/supervised_user:test_support", -@@ -7028,7 +7025,6 @@ test("unit_tests") { +@@ -6855,7 +6853,6 @@ test("unit_tests") { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", "//components/proxy_config", - "//components/qr_code_generator:bitmap_generator", "//components/query_parser", - "//components/query_tiles:unit_tests", "//components/reading_list/core", -@@ -7193,7 +7189,6 @@ test("unit_tests") { + "//components/reading_list/core:test_support", +@@ -7029,7 +7026,6 @@ test("unit_tests") { "//third_party/metrics_proto", "//third_party/microsoft_webauthn", "//third_party/re2", @@ -115,12 +96,12 @@ Remove this dead code which brings a dependency on rustc "//third_party/webrtc_overrides:webrtc_component", "//third_party/widevine/cdm:headers", "//third_party/zlib/google:compression_utils", -@@ -8443,8 +8438,6 @@ test("unit_tests") { - "//chrome/browser/ui/webui/side_panel/performance_controls:mojo_bindings", - "//chrome/browser/ui/webui/side_panel/user_notes:mojo_bindings", +@@ -8314,8 +8310,6 @@ test("unit_tests") { + "//chrome/browser/ui/zoom", + "//chrome/browser/ui/zoom:unit_tests", "//chrome/browser/web_applications:web_applications_test_support", - "//chrome/browser/webauthn:test_support", - "//chrome/browser/webauthn/proto", "//chrome/common/accessibility:mojo_bindings", + "//chrome/services/speech:unit_tests", "//components/app_constants", - "//components/color", diff --git a/remove-sync.patch b/remove-sync.patch index 2e03ebd..920fc15 100644 --- a/remove-sync.patch +++ b/remove-sync.patch @@ -178,9 +178,9 @@ Inspired by: // True if the dictionary has been loaded. Otherwise false. bool is_loaded_; ---- src/device/fido/BUILD.gn.orig -+++ src/device/fido/BUILD.gn -@@ -163,33 +163,6 @@ component("fido") { +--- src/device/fido/BUILD.gn.orig 2024-12-08 18:34:58.231340083 +0100 ++++ src/device/fido/BUILD.gn 2024-12-18 12:59:49.294713941 +0100 +@@ -163,36 +163,6 @@ component("fido") { "device_operation.h", "device_response_converter.cc", "device_response_converter.h", @@ -200,48 +200,54 @@ Inspired by: - "enclave/transact.h", - "enclave/types.cc", - "enclave/types.h", +- "enclave/verify/amd.cc", +- "enclave/verify/amd.h", +- "enclave/verify/attestation_report.cc", +- "enclave/verify/attestation_report.h", - "enclave/verify/claim.cc", - "enclave/verify/claim.h", - "enclave/verify/endorsement.cc", - "enclave/verify/endorsement.h", -- "enclave/verify/hash.cc", -- "enclave/verify/hash.h", - "enclave/verify/rekor.cc", - "enclave/verify/rekor.h", - "enclave/verify/utils.cc", - "enclave/verify/utils.h", -- "enclave/verify/verify.h", +- "enclave/verify/verifier.cc", +- "enclave/verify/verifier.h", "fido_authenticator.cc", "fido_authenticator.h", "fido_device.cc", -@@ -256,7 +229,6 @@ component("fido") { +@@ -257,7 +227,6 @@ component("fido") { ] deps += [ - "//components/sync/protocol:protocol", + "//device/fido/enclave/verify/proto:proto", "//services/device/public/cpp/hid", "//services/device/public/cpp/usb", - "//services/device/public/mojom", ---- src/device/fido/fido_discovery_factory.cc.orig -+++ src/device/fido/fido_discovery_factory.cc -@@ -38,7 +38,7 @@ - #include "device/fido/cros/discovery.h" - #endif // BUILDFLAG(IS_CHROMEOS) - --#if !BUILDFLAG(IS_CHROMEOS) -+#if 0 - #include "device/fido/enclave/enclave_discovery.h" - #endif - -@@ -127,7 +127,7 @@ std::vector> FidoDiscoveryFactory::MaybeCreateEnclaveDiscovery() { --#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) -+#if 0 - if (!base::FeatureList::IsEnabled(kWebAuthnEnclaveAuthenticator) || - !enclave_ui_request_stream_ || !network_context_factory_) { +- if (!base::FeatureList::IsEnabled(kWebAuthnEnclaveAuthenticator) || +- !enclave_ui_request_stream_ || !network_context_factory_) { return std::nullopt; +- } +- return std::make_unique( +- std::move(enclave_ui_request_stream_), network_context_factory_); + } + + bool FidoDiscoveryFactory::IsTestOverride() { --- src/device/fido/fido_discovery_factory.h.orig +++ src/device/fido/fido_discovery_factory.h @@ -15,7 +15,6 @@ @@ -252,3 +258,13 @@ Inspired by: #include "device/fido/cable/cable_discovery_data.h" #include "device/fido/cable/v2_constants.h" #include "device/fido/ctap_get_assertion_request.h" +--- src/components/variations/service/BUILD.gn.orig 2024-12-08 18:34:57.401340060 +0100 ++++ src/components/variations/service/BUILD.gn 2025-01-01 21:55:42.476247680 +0100 +@@ -74,7 +74,6 @@ static_library("service") { + "//components/network_time", + "//components/pref_registry", + "//components/prefs", +- "//components/sync/service", + "//components/variations", + "//components/variations/field_trial_config", + "//components/variations/proto", diff --git a/run_segmenter-missing-optional.patch b/run_segmenter-missing-optional.patch deleted file mode 100644 index e458902..0000000 --- a/run_segmenter-missing-optional.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 42fc562599d784a8a646703ce3b7c158ce1a8466 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 15 May 2024 14:01:03 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::optional in - run_segmenter.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: If28c13730926447b1d362ecfe08ae0bc44112876 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539811 -Commit-Queue: José Dapena Paz -Reviewed-by: Florin Malita -Cr-Commit-Position: refs/heads/main@{#1301267} ---- - .../blink/renderer/platform/fonts/shaping/run_segmenter.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h b/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h -index 406c4070e91489..116f17dae944a7 100644 ---- a/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h -+++ b/third_party/blink/renderer/platform/fonts/shaping/run_segmenter.h -@@ -6,7 +6,10 @@ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_RUN_SEGMENTER_H_ - - #include -+ - #include -+#include -+ - #include "third_party/blink/renderer/platform/fonts/font_orientation.h" - #include "third_party/blink/renderer/platform/fonts/orientation_iterator.h" - #include "third_party/blink/renderer/platform/fonts/script_run_iterator.h" diff --git a/skia-system-vulkan-headers.patch b/skia-system-vulkan-headers.patch deleted file mode 100644 index 914fc0f..0000000 --- a/skia-system-vulkan-headers.patch +++ /dev/null @@ -1,22 +0,0 @@ -Unbundle only Skia's vulkan headers. ANGLE needs the bleeding-edge ones in vulkan-deps - ---- a/third_party/skia/include/private/gpu/vk/SkiaVulkan.h -+++ b/third_party/skia/include/private/gpu/vk/SkiaVulkan.h -@@ -11,7 +11,7 @@ - // IWYU pragma: begin_exports - - #if (SKIA_IMPLEMENTATION || !defined(SK_VULKAN)) && !defined(SK_USE_EXTERNAL_VULKAN_HEADERS) --#include "include/third_party/vulkan/vulkan/vulkan_core.h" -+#include - #else - // For google3 builds we don't set SKIA_IMPLEMENTATION so we need to make sure that the vulkan - // headers stay up to date for our needs -@@ -21,7 +21,7 @@ - #ifdef SK_BUILD_FOR_ANDROID - // This is needed to get android extensions for external memory - #if (SKIA_IMPLEMENTATION || !defined(SK_VULKAN)) && !defined(SK_USE_EXTERNAL_VULKAN_HEADERS) --#include "include/third_party/vulkan/vulkan/vulkan_android.h" -+#include - #else - // For google3 builds we don't set SKIA_IMPLEMENTATION so we need to make sure that the vulkan - // headers stay up to date for our needs diff --git a/skia_image_decoder_base-missing-stack.patch b/skia_image_decoder_base-missing-stack.patch new file mode 100644 index 0000000..0f1a6b7 --- /dev/null +++ b/skia_image_decoder_base-missing-stack.patch @@ -0,0 +1,28 @@ +From 39583ff118920284de516d262979960e7159bcfc Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Thu, 19 Sep 2024 15:44:36 +0000 +Subject: [PATCH] IWYU: missing include for usage of std::stack in + skia_image_decoder_base.cc + +Bug: 41455655 +Change-Id: Id9c09f951dacc34d46aadc4badc6b3fd250ad38b +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872492 +Reviewed-by: Peter Kasting +Commit-Queue: Peter Kasting +Cr-Commit-Position: refs/heads/main@{#1357626} +--- + .../platform/image-decoders/skia/skia_image_decoder_base.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc b/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc +index 1d002cc258ae8b..84fd71c1e46139 100644 +--- a/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc ++++ b/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc +@@ -5,6 +5,7 @@ + #include "third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.h" + + #include ++#include + + #include "third_party/blink/renderer/platform/image-decoders/segment_stream.h" + #include "third_party/skia/include/codec/SkCodec.h" diff --git a/system-absl_algorithm.patch b/system-absl_algorithm.patch new file mode 100644 index 0000000..0e422d3 --- /dev/null +++ b/system-absl_algorithm.patch @@ -0,0 +1,27 @@ +Add absl_algorithm to shims +This library is used in chrome 130 therefore it should be now submitted upstream + +--- webrtc-5845d/build/linux/unbundle/absl_algorithm.gn.orig 2023-09-21 19:43:13.163148940 +0200 ++++ webrtc-5845d/build/linux/unbundle/absl_algorithm.gn 2023-09-21 21:24:11.594506276 +0200 +@@ -1,6 +1,21 @@ + import("//build/config/linux/pkg_config.gni") + import("//build/shim_headers.gni") + ++pkg_config("system_absl_algorithm") { ++ packages = [ "absl_algorithm" ] ++} ++ ++shim_headers("algorithm_shim") { ++ root_path = "." ++ prefix = "absl/algorithm/" ++ headers = [ "algorithm.h" ] ++} ++ ++source_set("algorithm") { ++ deps = [ ":algorithm_shim" ] ++ public_configs = [ ":system_absl_algorithm" ] ++} ++ + pkg_config("system_absl_algorithm_container") { + packages = [ "absl_algorithm_container" ] + } diff --git a/system-pydeps.patch b/system-pydeps.patch index b7fdabc..bfeaadd 100644 --- a/system-pydeps.patch +++ b/system-pydeps.patch @@ -71,17 +71,6 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. ../../build/scripts/blinkbuild/__init__.py ../../build/scripts/blinkbuild/name_style_converter.py bind_gen/__init__.py ---- a/third_party/blink/renderer/modules/sanitizer_api/builtins/generate_attribute_lists.py -+++ b/third_party/blink/renderer/modules/sanitizer_api/builtins/generate_attribute_lists.py -@@ -4,7 +4,7 @@ - # found in the LICENSE file. - """Generate list of attribute names known to this version of Chromium.""" - --from pyjson5.src import json5 -+import json5 - import optparse - import sys - --- src/third_party/blink/renderer/bindings/scripts/check_generated_file_list.pydeps.old 2022-11-30 10:28:05.822183900 +0000 +++ src/third_party/blink/renderer/bindings/scripts/check_generated_file_list.pydeps 2022-11-30 19:51:45.562760400 +0000 @@ -2,29 +2,6 @@ @@ -138,18 +127,19 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. sources = sources_list public_deps = parser_deps outputs = [] ---- src/third_party/blink/renderer/build/scripts/scripts.gni.old -+++ src/third_party/blink/renderer/build/scripts/scripts.gni -@@ -17,9 +17,6 @@ _scripts_dir = "//third_party/blink/rend - scripts_for_json5_files = [ - # jinja2/__init__.py contains version string, so sufficient as - # dependency for whole jinja2 package -- "//third_party/jinja2/__init__.py", -- "//third_party/markupsafe/__init__.py", # jinja2 dep -- "//third_party/pyjson5/src/json5/__init__.py", - "$_scripts_dir/blinkbuild/name_style_converter.py", - "$_scripts_dir/hasher.py", - "$_scripts_dir/json5_generator.py", +--- src/third_party/blink/renderer/build/scripts/scripts.gni.orig 2024-12-08 18:35:01.138006834 +0100 ++++ src/third_party/blink/renderer/build/scripts/scripts.gni 2024-12-18 13:24:36.436191575 +0100 +@@ -18,10 +18,6 @@ if (is_ios) { + _scripts_dir = "//third_party/blink/renderer/build/scripts" + + scripts_for_json5_files = jinja2_sources + [ +- "//third_party/pyjson5/src/json5/__init__.py", +- "//third_party/pyjson5/src/json5/lib.py", +- "//third_party/pyjson5/src/json5/parser.py", +- "//third_party/pyjson5/src/json5/version.py", + "$_scripts_dir/blinkbuild/name_style_converter.py", + "$_scripts_dir/json5_generator.py", + "$_scripts_dir/license.py", --- src/third_party/blink/renderer/bindings/scripts/generate_event_interface_names.pydeps.old +++ src/third_party/blink/renderer/bindings/scripts/generate_event_interface_names.pydeps @@ -2,10 +2,6 @@ diff --git a/system-wayland.patch b/system-wayland.patch index 866c199..378f3ee 100644 --- a/system-wayland.patch +++ b/system-wayland.patch @@ -1,81 +1,6 @@ ---- src/third_party/wayland/BUILD.gn.old -+++ src/third_party/wayland/BUILD.gn -@@ -45,7 +45,14 @@ - generator_type = "protocol-client" - } - -+pkg_config("system_wayland_client") { -+ packages = [ "wayland-client" ] -+} -+ - source_set("wayland_util") { -+ public_configs = [":system_wayland_client"] -+} -+source_set("xwayland_util") { - sources = [ - "src/src/wayland-private.h", - "src/src/wayland-util.c", -@@ -77,7 +84,14 @@ - public_configs = [ ":wayland_config" ] - } - --static_library("wayland_server") { -+pkg_config("system_wayland_server") { -+ packages = [ "wayland-server" ] -+} -+ -+source_set("wayland_server") { -+ public_configs = [":system_wayland_server"] -+} -+static_library("xwayland_server") { - sources = [ - "src/src/event-loop.c", - "src/src/wayland-server.c", -@@ -104,7 +118,10 @@ - public_configs = [ ":wayland_config" ] - } - --static_library("wayland_client") { -+source_set("wayland_client") { -+ public_configs = [":system_wayland_client"] -+} -+static_library("xwayland_client") { - sources = [ "src/src/wayland-client.c" ] - - deps = [ -@@ -124,7 +141,14 @@ - public_configs = [ ":wayland_config" ] - } - --static_library("wayland_egl") { -+pkg_config("system_wayland_egl") { -+ packages = [ "wayland-egl" ] -+} -+ -+source_set("wayland_egl") { -+ public_configs = [":system_wayland_egl"] -+} -+static_library("xwayland_egl") { - sources = [ - "src/egl/wayland-egl-backend.h", - "src/egl/wayland-egl-core.h", -@@ -143,7 +167,14 @@ - public_configs = [ ":wayland_config" ] - } - --static_library("wayland_cursor") { -+pkg_config("system_wayland_cursor") { -+ packages = [ "wayland-cursor" ] -+} -+ -+source_set("wayland_cursor") { -+ public_configs = [":system_wayland_cursor"] -+} -+static_library("xwayland_cursor") { - sources = [ - "src/cursor/cursor-data.h", - "src/cursor/os-compatibility.c", -@@ -173,7 +204,11 @@ +--- src/third_party/wayland/BUILD.gn.orig 2024-12-08 18:35:12.381340501 +0100 ++++ src/third_party/wayland/BUILD.gn 2024-12-18 13:29:59.426062502 +0100 +@@ -289,7 +289,11 @@ config("wayland_scanner_config") { include_dirs = [ "include/" ] } diff --git a/system-zlib.patch b/system-zlib.patch deleted file mode 100644 index a8c5069..0000000 --- a/system-zlib.patch +++ /dev/null @@ -1,32 +0,0 @@ -description: use system zlib library instead of embedded lzma in courgette -author: Michael Gilbert - ---- a/courgette/BUILD.gn -+++ b/courgette/BUILD.gn -@@ -58,7 +58,6 @@ static_library("courgette_lib") { - - deps = [ - "//base", -- "//third_party/lzma_sdk", - ] - - public_deps = [ -@@ -79,7 +78,6 @@ source_set("courgette_common") { - ] - deps = [ - "//base", -- "//third_party/lzma_sdk", - ] - } - ---- a/courgette/crc.cc -+++ b/courgette/crc.cc -@@ -7,6 +7,8 @@ - #include - #include - -+#define COURGETTE_USE_CRC_LIB -+ - #ifdef COURGETTE_USE_CRC_LIB - # include "zlib.h" - #else diff --git a/text_decoder-missing-optional.patch b/text_decoder-missing-optional.patch deleted file mode 100644 index 7ac48b0..0000000 --- a/text_decoder-missing-optional.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d852bf71654ae63d5e8e6624652584a9adf1df6f Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Wed, 15 May 2024 17:35:08 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::optional in - text_decoder.h - -Bug: 41455655 -Change-Id: I8902831e823760d455ca274bfe45b44be9e947f5 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5541275 -Reviewed-by: Joshua Bell -Commit-Queue: Joshua Bell -Cr-Commit-Position: refs/heads/main@{#1301397} ---- - third_party/blink/renderer/modules/encoding/text_decoder.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/third_party/blink/renderer/modules/encoding/text_decoder.h b/third_party/blink/renderer/modules/encoding/text_decoder.h -index 02452acb7306b6..9a947aab21b255 100644 ---- a/third_party/blink/renderer/modules/encoding/text_decoder.h -+++ b/third_party/blink/renderer/modules/encoding/text_decoder.h -@@ -32,6 +32,7 @@ - #define THIRD_PARTY_BLINK_RENDERER_MODULES_ENCODING_TEXT_DECODER_H_ - - #include -+#include - - #include "third_party/blink/renderer/bindings/core/v8/v8_typedefs.h" - #include "third_party/blink/renderer/bindings/modules/v8/v8_text_decode_options.h" diff --git a/vtt_scanner-missing-variant.patch b/vtt_scanner-missing-variant.patch new file mode 100644 index 0000000..99e34a6 --- /dev/null +++ b/vtt_scanner-missing-variant.patch @@ -0,0 +1,39 @@ +From 40c273b2c0f5f26e16e67428ceaafd8b339bb61f Mon Sep 17 00:00:00 2001 +From: Ivan Murashov +Date: Fri, 20 Sep 2024 08:03:22 +0000 +Subject: [PATCH] IWYU: Add missing include for std::variant usage in + vtt_scanner.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In the CLs https://crrev.com/c/5832540 and https://crrev.com/c/5842227 +used std::variant in the +third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h, but +corresponding include was missed. +Added missing include for std::variant usage. + +Bug: 41455655 +Change-Id: I90d07b12239f8d58e32c8011c710b6c7ea31fb5b +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872861 +Reviewed-by: Anders Hartvoll Ruud +Reviewed-by: Fredrik Söderquist +Commit-Queue: Anders Hartvoll Ruud +Cr-Commit-Position: refs/heads/main@{#1358046} +--- + third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h b/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h +index 78fc6657e38824..1b466bc9c5f8c3 100644 +--- a/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h ++++ b/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h +@@ -30,6 +30,8 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_SCANNER_H_ + #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_SCANNER_H_ + ++#include ++ + #include "base/check_op.h" + #include "third_party/blink/renderer/core/core_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" diff --git a/wayland-proto-31-cursor-shape.patch b/wayland-proto-31-cursor-shape.patch deleted file mode 100644 index abd3c8a..0000000 --- a/wayland-proto-31-cursor-shape.patch +++ /dev/null @@ -1,446 +0,0 @@ -From 653716a6838676b6cf257e0d9756eccbf509fabb Mon Sep 17 00:00:00 2001 -From: Ilya Bizyaev -Date: Fri, 19 Jan 2024 02:02:03 +0000 -Subject: [PATCH] Implement cursor-shape-v1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This CL is largely based on the existing support for the custom -zcr-cursor-shapes-v1 protocol used by Lacros. - -cursor-shape-v1 is the new upstream protocol for server-side cursor shapes -based on zcr-cursor-shapes-v1. Of compositors, it is currently -implemented in KDE's KWin (in Plasma 6.0) and Sway (not yet released). - -The enum mapping is based on -https://source.chromium.org/chromium/chromium/src/+/main:ui/base/cursor/cursor_factory.cc;l=115;drc=67d90538f11c6b232dbfd716075db52aeb34fd15 -— despite the seemingly fewer shapes in cursor-shape-v1's list, the -reduction is the same as in Chromium's own FreeDesktop cursor loading code, -so there's no downside in letting the compositor do the work for us -whenever it offers to. Since the compositor — and, by extension, the -desktop environment — are the source of truth for cursor display -settings, this simplifies complying with the user's preferences. - -Unlike Lacros, we cannot be sure at compile time that the compositor has -support for this protocol, so the cursor loading code is changed to not -give up on a shape when is has no bitmap and instead let the update -code try the server-side approach. - -Exo does not support cursor-shape-v1, so it will keep using the -zcr-cursor-shapes-v1 branch. - -I have tested this CL in a Plasma 6 RC1 session with this CSS demo: -https://www.tutorialrepublic.com/codelab.php?topic=css&file=cursor-property - -Low-Coverage-Reason: TRIVIAL_CHANGE Not tested are the enum conversion and getters/setters, which is boilerplate. -Bug: 1427111 -Cq-Include-Trybots: luci.chromium.try:linux-lacros-rel,linux-wayland-rel -Change-Id: I50567021e6fd80a641bbc906370c517efe16ffb9 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5196950 -Commit-Queue: Ilya Bizyaev -Reviewed-by: Henrique Ferreiro -Reviewed-by: Kramer Ge -Cr-Commit-Position: refs/heads/main@{#1249191} ---- - third_party/wayland-protocols/BUILD.gn | 4 + - ui/ozone/common/bitmap_cursor_factory.cc | 90 +------- - .../common/bitmap_cursor_factory_unittest.cc | 12 +- - ui/ozone/platform/wayland/BUILD.gn | 5 + - .../platform/wayland/common/wayland_object.cc | 3 + - .../platform/wayland/common/wayland_object.h | 2 + - .../wayland/host/wayland_connection.cc | 3 + - .../wayland/host/wayland_connection.h | 7 + - .../host/wayland_connection_test_api.h | 5 + - .../wayland/host/wayland_cursor_shape.cc | 194 ++++++++++++++++++ - .../wayland/host/wayland_cursor_shape.h | 53 +++++ - .../platform/wayland/host/wayland_window.cc | 18 +- - .../wayland/host/wayland_window_unittest.cc | 76 +++++++ - .../wayland/host/wayland_zcr_cursor_shapes.cc | 2 - - 14 files changed, 371 insertions(+), 103 deletions(-) - create mode 100644 ui/ozone/platform/wayland/host/wayland_cursor_shape.cc - create mode 100644 ui/ozone/platform/wayland/host/wayland_cursor_shape.h - -diff --git a/third_party/wayland-protocols/BUILD.gn b/third_party/wayland-protocols/BUILD.gn -index b0c0082769055..db15b95e41dd4 100644 ---- a/third_party/wayland-protocols/BUILD.gn -+++ b/third_party/wayland-protocols/BUILD.gn -@@ -15,6 +15,10 @@ wayland_protocol("content_type_protocol") { - sources = [ "unstable/content-type/content-type-v1.xml" ] - } - -+wayland_protocol("cursor_shape_protocol") { -+ sources = [ "src/staging/cursor-shape/cursor-shape-v1.xml" ] -+} -+ - wayland_protocol("cursor_shapes_protocol") { - sources = [ "unstable/cursor-shapes/cursor-shapes-unstable-v1.xml" ] - } -diff --git a/ui/ozone/common/bitmap_cursor_factory.cc b/ui/ozone/common/bitmap_cursor_factory.cc -index cf9bb8655a9cb..fd7274ccd28e4 100644 ---- a/ui/ozone/common/bitmap_cursor_factory.cc -+++ b/ui/ozone/common/bitmap_cursor_factory.cc -@@ -8,84 +8,11 @@ - - #include "base/check_op.h" - #include "base/memory/scoped_refptr.h" --#include "build/chromeos_buildflags.h" - #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" - #include "ui/ozone/common/bitmap_cursor.h" - - namespace ui { - --namespace { -- --#if BUILDFLAG(IS_CHROMEOS_LACROS) --// Returns true if ozone should use the default cursor for |type|, instead of --// loading and storing bitmaps for it. Used on Lacros to skip client-side bitmap --// loading for server-side cursors. --bool UseDefaultCursorForType(mojom::CursorType type) { -- using mojom::CursorType; -- switch (type) { -- case CursorType::kNull: -- case CursorType::kPointer: -- case CursorType::kCross: -- case CursorType::kHand: -- case CursorType::kIBeam: -- case CursorType::kWait: -- case CursorType::kHelp: -- case CursorType::kEastResize: -- case CursorType::kNorthResize: -- case CursorType::kNorthEastResize: -- case CursorType::kNorthWestResize: -- case CursorType::kSouthResize: -- case CursorType::kSouthEastResize: -- case CursorType::kSouthWestResize: -- case CursorType::kWestResize: -- case CursorType::kNorthSouthResize: -- case CursorType::kEastWestResize: -- case CursorType::kNorthEastSouthWestResize: -- case CursorType::kNorthWestSouthEastResize: -- case CursorType::kColumnResize: -- case CursorType::kRowResize: -- case CursorType::kMiddlePanning: -- case CursorType::kEastPanning: -- case CursorType::kNorthPanning: -- case CursorType::kNorthEastPanning: -- case CursorType::kNorthWestPanning: -- case CursorType::kSouthPanning: -- case CursorType::kSouthEastPanning: -- case CursorType::kSouthWestPanning: -- case CursorType::kWestPanning: -- case CursorType::kMove: -- case CursorType::kVerticalText: -- case CursorType::kCell: -- case CursorType::kContextMenu: -- case CursorType::kAlias: -- case CursorType::kProgress: -- case CursorType::kNoDrop: -- case CursorType::kCopy: -- case CursorType::kNotAllowed: -- case CursorType::kZoomIn: -- case CursorType::kZoomOut: -- case CursorType::kGrab: -- case CursorType::kGrabbing: -- case CursorType::kDndNone: -- case CursorType::kDndMove: -- case CursorType::kDndCopy: -- case CursorType::kDndLink: -- return true; -- case CursorType::kNone: -- case CursorType::kMiddlePanningVertical: -- case CursorType::kMiddlePanningHorizontal: -- case CursorType::kCustom: -- case CursorType::kEastWestNoResize: -- case CursorType::kNorthEastSouthWestNoResize: -- case CursorType::kNorthSouthNoResize: -- case CursorType::kNorthWestSouthEastNoResize: -- return false; -- } --} --#endif // BUILDFLAG(IS_CHROMEOS_LACROS) -- --} // namespace -- - BitmapCursorFactory::BitmapCursorFactory() = default; - - BitmapCursorFactory::~BitmapCursorFactory() = default; -@@ -93,18 +20,11 @@ BitmapCursorFactory::~BitmapCursorFactory() = default; - scoped_refptr BitmapCursorFactory::GetDefaultCursor( - mojom::CursorType type) { - if (!default_cursors_.count(type)) { -- if (type == mojom::CursorType::kNone --#if BUILDFLAG(IS_CHROMEOS_LACROS) -- || UseDefaultCursorForType(type) --#endif -- ) { -- // Lacros uses server-side cursors for most types. These cursors don't -- // need to load bitmap images on the client. -- // Similarly, the hidden cursor doesn't use any bitmap. -- default_cursors_[type] = base::MakeRefCounted(type); -- } else { -- return nullptr; -- } -+ // Return a cursor not backed by a bitmap to preserve the type information. -+ // It can still be used to request the compositor to draw a server-side -+ // cursor for the given type. -+ // kNone is handled separately and does not need a bitmap. -+ default_cursors_[type] = base::MakeRefCounted(type); - } - - return default_cursors_[type]; -diff --git a/ui/ozone/common/bitmap_cursor_factory_unittest.cc b/ui/ozone/common/bitmap_cursor_factory_unittest.cc -index 905b721d66193..6428821d90c6b 100644 ---- a/ui/ozone/common/bitmap_cursor_factory_unittest.cc -+++ b/ui/ozone/common/bitmap_cursor_factory_unittest.cc -@@ -4,7 +4,6 @@ - - #include "ui/ozone/common/bitmap_cursor_factory.h" - --#include "build/chromeos_buildflags.h" - #include "testing/gtest/include/gtest/gtest.h" - #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" - #include "ui/base/cursor/platform_cursor.h" -@@ -24,8 +23,7 @@ TEST(BitmapCursorFactoryTest, InvisibleCursor) { - CursorType::kNone); - } - --#if BUILDFLAG(IS_CHROMEOS_LACROS) --TEST(BitmapCursorFactoryTest, LacrosUsesDefaultCursorsForCommonTypes) { -+TEST(BitmapCursorFactoryTest, DefaultCursorsHaveTypeInformation) { - BitmapCursorFactory factory; - - // Verify some common cursor types. -@@ -45,12 +43,4 @@ TEST(BitmapCursorFactoryTest, LacrosUsesDefaultCursorsForCommonTypes) { - CursorType::kIBeam); - } - --TEST(BitmapCursorFactoryTest, LacrosCustomCursor) { -- BitmapCursorFactory factory; -- auto cursor = factory.GetDefaultCursor(CursorType::kCustom); -- // Custom cursors don't have a default platform cursor. -- EXPECT_EQ(cursor, nullptr); --} --#endif // BUILDFLAG(IS_CHROMEOS_LACROS) -- - } // namespace ui -diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn -index 8ebc966e1e1c3..d3dc3c736aa3c 100644 ---- a/ui/ozone/platform/wayland/BUILD.gn -+++ b/ui/ozone/platform/wayland/BUILD.gn -@@ -103,6 +103,8 @@ source_set("wayland") { - "host/wayland_cursor.h", - "host/wayland_cursor_position.cc", - "host/wayland_cursor_position.h", -+ "host/wayland_cursor_shape.cc", -+ "host/wayland_cursor_shape.h", - "host/wayland_data_device.cc", - "host/wayland_data_device.h", - "host/wayland_data_device_base.cc", -@@ -256,6 +258,7 @@ source_set("wayland") { - "//third_party/wayland:wayland_util", - "//third_party/wayland-protocols:alpha_compositing_protocol", - "//third_party/wayland-protocols:content_type_protocol", -+ "//third_party/wayland-protocols:cursor_shape_protocol", - "//third_party/wayland-protocols:cursor_shapes_protocol", - "//third_party/wayland-protocols:extended_drag", - "//third_party/wayland-protocols:fractional_scale_protocol", -@@ -274,6 +277,7 @@ source_set("wayland") { - "//third_party/wayland-protocols:relative_pointer_protocol", - "//third_party/wayland-protocols:single_pixel_buffer", - "//third_party/wayland-protocols:stylus_protocol", -+ "//third_party/wayland-protocols:tablet_protocol", - "//third_party/wayland-protocols:text_input_extension_protocol", - "//third_party/wayland-protocols:text_input_protocol", - "//third_party/wayland-protocols:touchpad_haptics_protocol", -@@ -623,6 +627,7 @@ source_set("wayland_unittests") { - "//testing/gmock", - "//testing/gtest", - "//third_party/wayland:wayland_server", -+ "//third_party/wayland-protocols:cursor_shape_protocol", - "//third_party/wayland-protocols:cursor_shapes_protocol", - "//third_party/wayland-protocols:keyboard_extension_protocol", - "//third_party/wayland-protocols:linux_dmabuf_protocol", -diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc -index bcc48aaeb186e..7f09a9f4f67dd 100644 ---- a/ui/ozone/platform/wayland/common/wayland_object.cc -+++ b/ui/ozone/platform/wayland/common/wayland_object.cc -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -228,6 +229,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_viewport) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_viewporter) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_content_type_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_content_type_manager_v1) -+IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_device_v1) -+IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_manager_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_manager_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_activation_v1) -diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h -index c84c084841ea9..436e7ff5f3910 100644 ---- a/ui/ozone/platform/wayland/common/wayland_object.h -+++ b/ui/ozone/platform/wayland/common/wayland_object.h -@@ -146,6 +146,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(wp_viewport) - DECLARE_WAYLAND_OBJECT_TRAITS(wp_viewporter) - DECLARE_WAYLAND_OBJECT_TRAITS(wp_content_type_manager_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(wp_content_type_v1) -+DECLARE_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_device_v1) -+DECLARE_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_manager_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_manager_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_activation_v1) -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc -index 5c62c0ead1497..944c9dd6904cd 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.cc -+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc -@@ -41,6 +41,7 @@ - #include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h" - #include "ui/ozone/platform/wayland/host/wayland_cursor.h" - #include "ui/ozone/platform/wayland/host/wayland_cursor_position.h" -+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h" - #include "ui/ozone/platform/wayland/host/wayland_data_device_manager.h" - #include "ui/ozone/platform/wayland/host/wayland_drm.h" - #include "ui/ozone/platform/wayland/host/wayland_event_source.h" -@@ -165,6 +166,8 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) { - RegisterGlobalObjectFactory(WaylandZcrColorManager::kInterfaceName, - &WaylandZcrColorManager::Instantiate); - } -+ RegisterGlobalObjectFactory(WaylandCursorShape::kInterfaceName, -+ &WaylandCursorShape::Instantiate); - RegisterGlobalObjectFactory(WaylandZcrCursorShapes::kInterfaceName, - &WaylandZcrCursorShapes::Instantiate); - RegisterGlobalObjectFactory(WaylandZcrTouchpadHaptics::kInterfaceName, -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h -index b0bb930a3de99..13be193482721 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection.h -@@ -62,6 +62,7 @@ class WaylandZwpPointerGestures; - class WaylandZwpRelativePointerManager; - class WaylandDataDeviceManager; - class WaylandCursorPosition; -+class WaylandCursorShape; - class WaylandWindowDragController; - class GtkPrimarySelectionDeviceManager; - class GtkShell1; -@@ -209,6 +210,10 @@ class WaylandConnection { - return zcr_color_manager_.get(); - } - -+ WaylandCursorShape* wayland_cursor_shape() const { -+ return cursor_shape_.get(); -+ } -+ - WaylandZcrCursorShapes* zcr_cursor_shapes() const { - return zcr_cursor_shapes_.get(); - } -@@ -383,6 +388,7 @@ class WaylandConnection { - friend class WaylandZwpPointerGestures; - friend class WaylandZwpRelativePointerManager; - friend class WaylandZcrColorManager; -+ friend class WaylandCursorShape; - friend class WaylandZcrCursorShapes; - friend class XdgActivation; - friend class XdgForeignWrapper; -@@ -483,6 +489,7 @@ class WaylandConnection { - std::unique_ptr zaura_output_manager_; - std::unique_ptr zaura_shell_; - std::unique_ptr zcr_color_manager_; -+ std::unique_ptr cursor_shape_; - std::unique_ptr zcr_cursor_shapes_; - std::unique_ptr zcr_touchpad_haptics_; - std::unique_ptr zwp_pointer_constraints_; -diff --git a/ui/ozone/platform/wayland/host/wayland_connection_test_api.h b/ui/ozone/platform/wayland/host/wayland_connection_test_api.h -index 31e61aff6010b..419801f0257a3 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection_test_api.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection_test_api.h -@@ -10,6 +10,7 @@ - - #include "base/memory/raw_ptr.h" - #include "ui/ozone/platform/wayland/host/wayland_connection.h" -+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h" - #include "ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.h" - - namespace ui { -@@ -22,6 +23,10 @@ class WaylandConnectionTestApi { - WaylandConnectionTestApi& operator=(const WaylandConnectionTestApi&) = delete; - ~WaylandConnectionTestApi() = default; - -+ void SetCursorShape(std::unique_ptr obj) { -+ impl_->cursor_shape_ = std::move(obj); -+ } -+ - void SetZcrCursorShapes(std::unique_ptr obj) { - impl_->zcr_cursor_shapes_ = std::move(obj); - } -diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc -index 68f87776ef4f0..f5c36964ad36d 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window.cc -@@ -41,6 +41,7 @@ - #include "ui/ozone/platform/wayland/common/wayland_overlay_config.h" - #include "ui/ozone/platform/wayland/host/dump_util.h" - #include "ui/ozone/platform/wayland/host/wayland_connection.h" -+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h" - #include "ui/ozone/platform/wayland/host/wayland_data_drag_controller.h" - #include "ui/ozone/platform/wayland/host/wayland_event_source.h" - #include "ui/ozone/platform/wayland/host/wayland_frame_manager.h" -@@ -1110,7 +1111,9 @@ void WaylandWindow::UpdateCursorShape(scoped_refptr cursor) { - base::IsValueInRangeForNumericType( - cursor->cursor_image_scale_factor())); - -- std::optional shape = -+ std::optional shape = -+ WaylandCursorShape::ShapeFromType(cursor->type()); -+ std::optional zcr_shape = - WaylandZcrCursorShapes::ShapeFromType(cursor->type()); - - // Round cursor scale factor to ceil as wl_surface.set_buffer_scale accepts -@@ -1118,20 +1121,25 @@ void WaylandWindow::UpdateCursorShape(scoped_refptr cursor) { - if (cursor->type() == CursorType::kNone) { // Hide the cursor. - connection_->SetCursorBitmap( - {}, gfx::Point(), std::ceil(cursor->cursor_image_scale_factor())); -+ } else if (connection_->wayland_cursor_shape() && shape.has_value()) { -+ // Prefer Wayland server-side cursor support, as the compositor knows better -+ // how to draw the cursor. -+ connection_->wayland_cursor_shape()->SetCursorShape(shape.value()); - } else if (cursor->platform_data()) { // Check for theme-provided cursor. - connection_->SetPlatformCursor( - reinterpret_cast(cursor->platform_data()), - std::ceil(cursor->cursor_image_scale_factor())); - } else if (connection_->zcr_cursor_shapes() && -- shape.has_value()) { // Check for Wayland server-side cursor -- // support (e.g. exo for lacros). -+ zcr_shape.has_value()) { // Check for Exo server-side cursor -+ // support. - #if BUILDFLAG(IS_CHROMEOS_LACROS) - // Lacros should not load image assets for default cursors. See - // `BitmapCursorFactory::GetDefaultCursor()`. - DCHECK(cursor->bitmaps().empty()); - #endif // BUILDFLAG(IS_CHROMEOS_LACROS) -- connection_->zcr_cursor_shapes()->SetCursorShape(shape.value()); -- } else { // Use client-side bitmap cursors as fallback. -+ connection_->zcr_cursor_shapes()->SetCursorShape(zcr_shape.value()); -+ } else if (!cursor->bitmaps() -+ .empty()) { // Use client-side bitmap cursors as fallback. - // Translate physical pixels to DIPs. - gfx::Point hotspot_in_dips = gfx::ScaleToRoundedPoint( - cursor->hotspot(), 1.0f / cursor->cursor_image_scale_factor()); -diff --git a/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc b/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc -index 9e3243dceea20..297c48e614087 100644 ---- a/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc -+++ b/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc -@@ -168,8 +168,6 @@ absl::optional WaylandZcrCursorShapes::ShapeFromType(CursorType type) { - return ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_COPY; - case CursorType::kDndLink: - return ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_LINK; -- // NOTE: If you add a new cursor shape, please also update -- // UseDefaultCursorForType() in bitmap_cursor_factory_ozone.cc. - } - } - diff --git a/wayland-protocol-toplevel-drag.patch b/wayland-protocol-toplevel-drag.patch new file mode 100644 index 0000000..e051ca4 --- /dev/null +++ b/wayland-protocol-toplevel-drag.patch @@ -0,0 +1,434 @@ +From 8f45d25c2f8f4849b66136b14734b79e2b4fe9c1 Mon Sep 17 00:00:00 2001 +From: Robert Mader +Date: Thu, 12 Sep 2024 19:11:15 +0000 +Subject: [PATCH] ozone/wayland: Add support for xdg-toplevel-drag + +Rebased and slighty updated version of https://chromium-review.googlesource.com/c/chromium/src/+/4400967 + +This implements a new protocol landed in wayland-protocols 1.34 that can +be found at +https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/xdg-toplevel-drag/xdg-toplevel-drag-v1.xml + +It is intended to be a drop-in replacement for extended-drag-unstable-v1 +with some features removed that were never implemented in Exo/Chromium. + +If both the `extended-drag` and `xdg-toplevel-drag` protocols are +supported by the compositor - i.e. in Exo - the former is kept being +used by default. The later can be enabled via the +`WaylandXdgToplevelDrag` feature. + +Original author: David Redondo + +Bug: b:315000518 +Bug: b:324170129 +Change-Id: If251ac9944ec4395f2d8630b7c4ac74ca56a662d +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5088752 +Reviewed-by: Thomas Anderson +Reviewed-by: Antonio Gomes +Commit-Queue: Nick Yamane +Reviewed-by: Nick Yamane +Cr-Commit-Position: refs/heads/main@{#1354718} +--- + AUTHORS | 1 + + ui/ozone/common/features.cc | 16 ++++ + ui/ozone/common/features.h | 1 + + ui/ozone/platform/wayland/BUILD.gn | 1 + + .../platform/wayland/common/wayland_object.cc | 3 + + .../platform/wayland/common/wayland_object.h | 2 + + .../wayland/host/wayland_connection.cc | 10 +++ + .../wayland/host/wayland_connection.h | 4 + + .../wayland/host/wayland_toplevel_window.cc | 13 +-- + .../host/wayland_window_drag_controller.cc | 85 ++++++++++++++++--- + .../host/wayland_window_drag_controller.h | 4 + + .../wayland/host/xdg_toplevel_wrapper_impl.h | 1 + + 12 files changed, 121 insertions(+), 20 deletions(-) + +diff --git a/AUTHORS b/AUTHORS +index 52d075125b8126..bd9327b5b477f2 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -337,6 +337,7 @@ David Leen + David Manouchehri + David McAllister + David Michael Barr ++David Redondo + David Sanders + David Spellman + David Valachovic +diff --git a/ui/ozone/common/features.cc b/ui/ozone/common/features.cc +index bd13d0e17f39a3..74ffde0cf5b85c 100644 +--- a/ui/ozone/common/features.cc ++++ b/ui/ozone/common/features.cc +@@ -37,6 +37,18 @@ BASE_FEATURE(kWaylandFractionalScaleV1, + #endif + ); + ++// Controls whether support for the xdg-toplevel-drag protocol should be ++// enabled. On Lacros it will then be used even if the Exo-only extended-drag ++// protocol is supported. ++BASE_FEATURE(kWaylandXdgToplevelDrag, ++ "WaylandXdgToplevelDrag", ++#if BUILDFLAG(IS_LINUX) ++ base::FEATURE_ENABLED_BY_DEFAULT ++#else ++ base::FEATURE_DISABLED_BY_DEFAULT ++#endif ++); ++ + // This debug/dev flag pretty-prints DRM modeset configuration logs for ease + // of reading. For more information, see: http://b/233006802 + BASE_FEATURE(kPrettyPrintDrmModesetConfigLogs, +@@ -62,6 +74,10 @@ bool IsWaylandFractionalScaleV1Enabled() { + return base::FeatureList::IsEnabled(kWaylandFractionalScaleV1); + } + ++bool IsWaylandXdgToplevelDragEnabled() { ++ return base::FeatureList::IsEnabled(kWaylandXdgToplevelDrag); ++} ++ + bool IsPrettyPrintDrmModesetConfigLogsEnabled() { + return base::FeatureList::IsEnabled(kPrettyPrintDrmModesetConfigLogs); + } +diff --git a/ui/ozone/common/features.h b/ui/ozone/common/features.h +index 5d4c3c42af9ca7..1f88055f8975bc 100644 +--- a/ui/ozone/common/features.h ++++ b/ui/ozone/common/features.h +@@ -18,6 +18,7 @@ BASE_DECLARE_FEATURE(kUseDynamicCursorSize); + bool IsWaylandSurfaceSubmissionInPixelCoordinatesEnabled(); + bool IsWaylandOverlayDelegationEnabled(); + bool IsWaylandFractionalScaleV1Enabled(); ++bool IsWaylandXdgToplevelDragEnabled(); + bool IsPrettyPrintDrmModesetConfigLogsEnabled(); + bool IsUseDynamicCursorSizeEnabled(); + +diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn +index 6d3ec34101498d..b87a7b5d2903f0 100644 +--- a/ui/ozone/platform/wayland/BUILD.gn ++++ b/ui/ozone/platform/wayland/BUILD.gn +@@ -294,6 +294,7 @@ source_set("wayland") { + "//third_party/wayland-protocols:xdg_foreign", + "//third_party/wayland-protocols:xdg_output_protocol", + "//third_party/wayland-protocols:xdg_shell_protocol", ++ "//third_party/wayland-protocols:xdg_toplevel_drag_protocol", + "//third_party/wayland-protocols:xdg_toplevel_icon_protocol", + "//ui/base", + "//ui/base:buildflags", +diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc +index e30367a19d7774..1534a735855dd3 100644 +--- a/ui/ozone/platform/wayland/common/wayland_object.cc ++++ b/ui/ozone/platform/wayland/common/wayland_object.cc +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + #include + + #include "base/logging.h" +@@ -257,6 +258,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_popup) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_positioner) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_surface) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel) ++IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_v1) ++IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_manager_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_wm_base) +diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h +index 38213eff64de40..b279424d14784d 100644 +--- a/ui/ozone/platform/wayland/common/wayland_object.h ++++ b/ui/ozone/platform/wayland/common/wayland_object.h +@@ -156,6 +156,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(xdg_popup) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_positioner) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_surface) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel) ++DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_v1) ++DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_manager_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_wm_base) +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc +index a1584eb682adf3..e595f500758492 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.cc ++++ b/ui/ozone/platform/wayland/host/wayland_connection.cc +@@ -91,6 +91,7 @@ constexpr uint32_t kMaxExplicitSyncVersion = 2; + constexpr uint32_t kMaxAlphaCompositingVersion = 1; + constexpr uint32_t kMaxXdgDecorationVersion = 1; + constexpr uint32_t kMaxExtendedDragVersion = 1; ++constexpr uint32_t kMaxXdgToplevelDragVersion = 1; + constexpr uint32_t kMaxXdgOutputManagerVersion = 3; + constexpr uint32_t kMaxKeyboardShortcutsInhibitManagerVersion = 1; + constexpr uint32_t kMaxStylusVersion = 2; +@@ -745,6 +746,15 @@ void WaylandConnection::HandleGlobal(wl_registry* registry, + LOG(ERROR) << "Failed to bind to zcr_extended_drag_v1 global"; + return; + } ++ } else if (!xdg_toplevel_drag_manager_v1_ && ++ strcmp(interface, "xdg_toplevel_drag_manager_v1") == 0 && ++ IsWaylandXdgToplevelDragEnabled()) { ++ xdg_toplevel_drag_manager_v1_ = wl::Bind<::xdg_toplevel_drag_manager_v1>( ++ registry, name, std::min(version, kMaxXdgToplevelDragVersion)); ++ if (!xdg_toplevel_drag_manager_v1_) { ++ LOG(ERROR) << "Failed to bind to xdg_toplevel_drag_manager_v1 global"; ++ return; ++ } + } else if (!xdg_output_manager_ && + strcmp(interface, "zxdg_output_manager_v1") == 0) { + // Responsibilities of zxdg_output_manager_v1 have been subsumed into the +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h +index b4633ad03c4508..79680db7189852 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.h ++++ b/ui/ozone/platform/wayland/host/wayland_connection.h +@@ -160,6 +160,9 @@ class WaylandConnection { + zcr_extended_drag_v1* extended_drag_v1() const { + return extended_drag_v1_.get(); + } ++ xdg_toplevel_drag_manager_v1* xdg_toplevel_drag_manager_v1() const { ++ return xdg_toplevel_drag_manager_v1_.get(); ++ } + + zxdg_output_manager_v1* xdg_output_manager_v1() const { + return xdg_output_manager_.get(); +@@ -500,6 +503,7 @@ class WaylandConnection { + linux_explicit_synchronization_; + wl::Object xdg_decoration_manager_; + wl::Object extended_drag_v1_; ++ wl::Object<::xdg_toplevel_drag_manager_v1> xdg_toplevel_drag_manager_v1_; + wl::Object xdg_output_manager_; + wl::Object fractional_scale_manager_v1_; + wl::Object toplevel_icon_manager_v1_; +diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +index 204e65c90ec374..5af9efc0d8acbf 100644 +--- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc ++++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +@@ -858,7 +858,8 @@ void WaylandToplevelWindow::HideTooltip() { + bool WaylandToplevelWindow::IsClientControlledWindowMovementSupported() const { + auto* window_drag_controller = connection()->window_drag_controller(); + DCHECK(window_drag_controller); +- return window_drag_controller->IsExtendedDragAvailable(); ++ return window_drag_controller->IsExtendedDragAvailable() || ++ window_drag_controller->IsXdgToplevelDragAvailable(); + } + + bool WaylandToplevelWindow::ShouldReleaseCaptureForDrag( +@@ -882,11 +883,11 @@ void WaylandToplevelWindow::StartWindowDraggingSessionIfNeeded( + ui::mojom::DragEventSource event_source, + bool allow_system_drag) { + DCHECK(connection()->window_drag_controller()); +- // If extended drag is not available and |allow_system_drag| is set, this is +- // no-op and WaylandDataDragController is assumed to be used instead. i.e: +- // Fallback to a simpler window drag UX based on regular system drag-and-drop. +- if (!connection()->window_drag_controller()->IsExtendedDragAvailable() && +- allow_system_drag) { ++ // If extended-drag and xdg-toplevel-drag are not available and ++ // |allow_system_drag| is set, this is no-op and WaylandDataDragController is ++ // assumed to be used instead. i.e: Fallback to a simpler window drag UX based ++ // on regular system drag-and-drop. ++ if (!IsClientControlledWindowMovementSupported() && allow_system_drag) { + return; + } + connection()->window_drag_controller()->StartDragSession(this, event_source); +diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +index 2e95a32417a4c1..6184684e308154 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc ++++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +@@ -6,6 +6,7 @@ + + #include + #include ++#include + + #include + #include +@@ -36,8 +37,10 @@ + #include "ui/gfx/geometry/point_conversions.h" + #include "ui/gfx/geometry/point_f.h" + #include "ui/gfx/geometry/vector2d.h" ++#include "ui/ozone/common/features.h" + #include "ui/ozone/platform/wayland/common/wayland_object.h" + #include "ui/ozone/platform/wayland/host/dump_util.h" ++#include "ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h" + #include "ui/ozone/platform/wayland/host/wayland_connection.h" + #include "ui/ozone/platform/wayland/host/wayland_cursor_position.h" + #include "ui/ozone/platform/wayland/host/wayland_data_device_manager.h" +@@ -51,6 +54,7 @@ + #include "ui/ozone/platform/wayland/host/wayland_surface.h" + #include "ui/ozone/platform/wayland/host/wayland_window.h" + #include "ui/ozone/platform/wayland/host/wayland_window_manager.h" ++#include "ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h" + #include "ui/platform_window/platform_window_init_properties.h" + + namespace ui { +@@ -101,6 +105,39 @@ class WaylandWindowDragController::ExtendedDragSource { + const raw_ref connection_; + }; + ++class WaylandWindowDragController::XdgToplevelDrag { ++ public: ++ XdgToplevelDrag(WaylandConnection& connection, wl_data_source* source) ++ : connection_(connection) { ++ DCHECK(connection.xdg_toplevel_drag_manager_v1()); ++ drag_.reset(xdg_toplevel_drag_manager_v1_get_xdg_toplevel_drag( ++ connection.xdg_toplevel_drag_manager_v1(), source)); ++ DCHECK(drag_); ++ } ++ ++ void SetDraggedWindow(WaylandToplevelWindow* window, ++ const gfx::Vector2d& offset) { ++ if (!window) { ++ // Detaching happens implicitly via wl_data_source.dnd_drop_performed (see ++ // OnDataSourceDropPerformed()) or when the toplevel gets unmapped. ++ return; ++ } ++ DCHECK(window->shell_toplevel() && ++ window->shell_toplevel()->AsXDGToplevelWrapper()); ++ ++ auto* toplevel = ++ window->shell_toplevel()->AsXDGToplevelWrapper()->xdg_toplevel_.get(); ++ DCHECK(toplevel); ++ ++ xdg_toplevel_drag_v1_attach(drag_.get(), toplevel, offset.x(), offset.y()); ++ connection_->Flush(); ++ } ++ ++ private: ++ wl::Object drag_; ++ const raw_ref connection_; ++}; ++ + WaylandWindowDragController::WaylandWindowDragController( + WaylandConnection* connection, + WaylandDataDeviceManager* device_manager, +@@ -165,12 +202,16 @@ bool WaylandWindowDragController::StartDragSession( + data_source_->Offer({kMimeTypeChromiumWindow}); + data_source_->SetDndActions(kDndActionWindowDrag); + +- if (IsExtendedDragAvailableInternal()) { ++ if (IsXdgToplevelDragAvailable()) { ++ xdg_toplevel_drag_ = std::make_unique( ++ *connection_, data_source_->data_source()); ++ } else if (IsExtendedDragAvailableInternal()) { + extended_drag_source_ = std::make_unique( + *connection_, data_source_->data_source()); + } else { +- LOG(ERROR) << "zcr_extended_drag_v1 extension not available! " +- << "Window/Tab dragging won't be fully functional."; ++ LOG(ERROR) ++ << "zcr_extended_drag_v1 and xdg_toplevel_drag_v1 extensions " ++ "not available! Window/Tab dragging won't be fully functional."; + } + + data_device_->StartDrag(*data_source_, *origin_window_, serial->value, +@@ -441,17 +482,24 @@ void WaylandWindowDragController::OnDataSourceFinish(WaylandDataSource* source, + data_offer_.reset(); + data_source_.reset(); + extended_drag_source_.reset(); ++ xdg_toplevel_drag_.reset(); + origin_surface_.reset(); + origin_window_ = nullptr; + has_received_enter_ = false; + +- // When extended-drag is available and the drop happens while a non-null +- // surface was being dragged (i.e: detached mode) which had pointer focus +- // before the drag session, we must reset focus to it, otherwise it would be +- // wrongly kept to the latest surface received through wl_data_device::enter +- // (see OnDragEnter function). +- // In case of touch, though, we simply reset the focus altogether. +- if (IsExtendedDragAvailableInternal() && dragged_window_) { ++ // When extended-drag or xdg-toplevel-drag is available and the drop happens ++ // while a non-null surface was being dragged (i.e: detached mode) which had ++ // pointer focus before the drag session, we must reset focus to it, otherwise ++ // it would be wrongly kept to the latest surface received through ++ // wl_data_device::enter (see OnDragEnter function). In case of touch, though, ++ // we simply reset the focus altogether. ++ // ++ // TODO(crbug.com/324170129): Move drop handling logic below into ++ // OnDataSourceDropPerformed instead, otherwise dropping outside target ++ // surfaces will results in drag cancellation when xdg-toplevel-drag is used. ++ bool is_protocol_available = ++ IsExtendedDragAvailableInternal() || IsXdgToplevelDragAvailable(); ++ if (is_protocol_available && dragged_window_) { + if (*drag_source_ == DragEventSource::kMouse) { + // TODO: check if this usage is correct. + +@@ -467,9 +515,11 @@ void WaylandWindowDragController::OnDataSourceFinish(WaylandDataSource* source, + // Transition to |kDropped| state and determine the next action to take. If + // drop happened while the move loop was running (i.e: kDetached), ask to quit + // the loop, otherwise notify session end and reset state right away. ++ is_protocol_available = ++ IsExtendedDragAvailable() || IsXdgToplevelDragAvailable(); + State state_when_dropped = std::exchange( +- state_, completed || !IsExtendedDragAvailable() ? State::kDropped +- : State::kCancelled); ++ state_, completed || !is_protocol_available ? State::kDropped ++ : State::kCancelled); + if (state_when_dropped == State::kDetached) { + VLOG(1) << "Quiting Loop : Detached"; + QuitLoop(); +@@ -673,9 +723,12 @@ void WaylandWindowDragController::SetDraggedWindow( + dragged_window_ = window; + drag_offset_ = offset; + +- // TODO(crbug.com/40598679): Fallback when extended-drag is not available. +- if (extended_drag_source_) ++ // TODO(crbug.com/40598679): Fallback when no window drag protocol available. ++ if (extended_drag_source_) { + extended_drag_source_->SetDraggedWindow(dragged_window_, drag_offset_); ++ } else if (xdg_toplevel_drag_) { ++ xdg_toplevel_drag_->SetDraggedWindow(dragged_window_, drag_offset_); ++ } + } + + bool WaylandWindowDragController::IsExtendedDragAvailable() const { +@@ -683,6 +736,10 @@ bool WaylandWindowDragController::IsExtendedDragAvailable() const { + IsExtendedDragAvailableInternal(); + } + ++bool WaylandWindowDragController::IsXdgToplevelDragAvailable() const { ++ return !!connection_->xdg_toplevel_drag_manager_v1(); ++} ++ + bool WaylandWindowDragController::IsActiveDragAndDropSession() const { + return !!data_source_; + } +diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h +index de94ea22590990..fe523b85a2b340 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h ++++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h +@@ -88,6 +88,8 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, + + // Tells if "extended drag" extension is available. + bool IsExtendedDragAvailable() const; ++ // Tells if "xdg toplevel drag" extension is available. ++ bool IsXdgToplevelDragAvailable() const; + + // Returns true if there there is currently an active drag-and-drop session. + // This is true if the `data_source_` exists (the session ends when this is +@@ -118,6 +120,7 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, + + private: + class ExtendedDragSource; ++ class XdgToplevelDrag; + + friend class WaylandWindowDragControllerTest; + FRIEND_TEST_ALL_PREFIXES(WaylandWindowDragControllerTest, +@@ -204,6 +207,7 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, + std::unique_ptr data_offer_; + + std::unique_ptr extended_drag_source_; ++ std::unique_ptr xdg_toplevel_drag_; + + // The current toplevel window being dragged, when in detached mode. + raw_ptr dragged_window_ = nullptr; +diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h +index f34cc782ffc82e..280efa771c3fe3 100644 +--- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h ++++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h +@@ -88,6 +88,7 @@ class XDGToplevelWrapperImpl : public ShellToplevelWrapper { + XDGSurfaceWrapperImpl* xdg_surface_wrapper() const; + + private: ++ friend class WaylandWindowDragController; + // xdg_toplevel_listener callbacks: + static void OnToplevelConfigure(void* data, + xdg_toplevel* toplevel, diff --git a/wayland-protocol-toplevel-icon-2.patch b/wayland-protocol-toplevel-icon-2.patch new file mode 100644 index 0000000..aedf039 --- /dev/null +++ b/wayland-protocol-toplevel-icon-2.patch @@ -0,0 +1,545 @@ +From 900160bc0e224746bd4b7c30c63433dad66b95f6 Mon Sep 17 00:00:00 2001 +From: Tom Anderson +Date: Thu, 8 Aug 2024 07:28:26 +0000 +Subject: [PATCH] [Wayland] Implement setting icons with XDG toplevel icon + +Note that this is untested since no compositors currently support +the protocol, though there is a merge request for server support in +KWin and merge requests for client support in QT, and SDL, and merged +client support in GameScope. + +Once compositor support is added, this change can be tested by +installing the Youtube PWA and verifying that the icon changes +to the Youtube logo. + + +R=nickdiego + +Change-Id: I6135d72879ecc025c26e7c65b68eb557dd72e854 +Fixed: 356424077 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5755162 +Auto-Submit: Thomas Anderson +Code-Coverage: findit-for-me@appspot.gserviceaccount.com +Reviewed-by: Maksim Sisov +Commit-Queue: Maksim Sisov +Reviewed-by: Nick Yamane +Cr-Commit-Position: refs/heads/main@{#1338910} +--- + ui/ozone/platform/wayland/BUILD.gn | 4 + + .../wayland/host/shell_toplevel_wrapper.h | 3 + + .../wayland/host/wayland_toplevel_window.cc | 14 +++ + .../wayland/host/wayland_toplevel_window.h | 2 + + .../host/xdg_toplevel_icon_unittest.cc | 47 +++++++++ + .../wayland/host/xdg_toplevel_wrapper_impl.cc | 53 ++++++++++- + .../wayland/host/xdg_toplevel_wrapper_impl.h | 1 + + .../wayland/test/mock_xdg_toplevel_icon.cc | 95 +++++++++++++++++++ + .../wayland/test/mock_xdg_toplevel_icon.h | 79 +++++++++++++++ + .../test/test_wayland_server_thread.cc | 3 + + .../wayland/test/test_wayland_server_thread.h | 6 ++ + 11 files changed, 303 insertions(+), 4 deletions(-) + create mode 100644 ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc + create mode 100644 ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc + create mode 100644 ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h + +diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn +index 4ba36222f03906..4f22bf74dd8d34 100644 +--- a/ui/ozone/platform/wayland/BUILD.gn ++++ b/ui/ozone/platform/wayland/BUILD.gn +@@ -432,6 +432,8 @@ source_set("test_support") { + "test/mock_xdg_shell.h", + "test/mock_xdg_surface.cc", + "test/mock_xdg_surface.h", ++ "test/mock_xdg_toplevel_icon.cc", ++ "test/mock_xdg_toplevel_icon.h", + "test/mock_zcr_extended_text_input.cc", + "test/mock_zcr_extended_text_input.h", + "test/mock_zwp_linux_dmabuf.cc", +@@ -576,6 +578,7 @@ source_set("test_support") { + "//third_party/wayland-protocols:xdg_activation", + "//third_party/wayland-protocols:xdg_output_protocol", + "//third_party/wayland-protocols:xdg_shell_protocol", ++ "//third_party/wayland-protocols:xdg_toplevel_icon_protocol", + "//ui/display:test_support", + "//ui/gfx/geometry:geometry", + ] +@@ -608,6 +611,7 @@ source_set("wayland_unittests") { + "host/wayland_zcr_color_manager_unittest.cc", + "host/wayland_zwp_pointer_gestures_unittest.cc", + "host/xdg_activation_unittest.cc", ++ "host/xdg_toplevel_icon_unittest.cc", + "host/zwp_text_input_wrapper_v1_unittest.cc", + "host/zwp_text_input_wrapper_v3_unittest.cc", + "mojom/wayland_overlay_config_mojom_traits_unittest.cc", +diff --git a/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h b/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h +index 735a218e6b5667..63b68902a7addd 100644 +--- a/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h ++++ b/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h +@@ -12,6 +12,7 @@ + #include "ui/platform_window/extensions/wayland_extension.h" + + namespace gfx { ++class ImageSkia; + class Rect; + class RoundedCornersF; + } +@@ -210,6 +211,8 @@ class ShellToplevelWrapper { + + virtual void AckRotateFocus(uint32_t serial, uint32_t handled) = 0; + ++ virtual void SetIcon(const gfx::ImageSkia& icon) = 0; ++ + // Casts `this` to XDGToplevelWrapperImpl, if it is of that type. + virtual XDGToplevelWrapperImpl* AsXDGToplevelWrapper(); + }; +diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +index 7ba2d52b575a21..204e65c90ec374 100644 +--- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc ++++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +@@ -363,6 +363,20 @@ void WaylandToplevelWindow::Deactivate() { + WaylandWindow::Deactivate(); + } + ++void WaylandToplevelWindow::SetWindowIcons(const gfx::ImageSkia& window_icon, ++ const gfx::ImageSkia& app_icon) { ++ if (!shell_toplevel_) { ++ return; ++ } ++ // Let the app icon take precedence over the window icon. ++ if (!app_icon.isNull()) { ++ shell_toplevel_->SetIcon(app_icon); ++ } else { ++ shell_toplevel_->SetIcon(window_icon); ++ } ++ root_surface()->Commit(/*flush=*/true); ++} ++ + void WaylandToplevelWindow::SizeConstraintsChanged() { + // Size constraints only make sense for normal windows. + if (!shell_toplevel_) +diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h +index 40e16fef05f985..3491798f4c19da 100644 +--- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h ++++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h +@@ -126,6 +126,8 @@ class WaylandToplevelWindow : public WaylandWindow, + void Restore() override; + void Activate() override; + void Deactivate() override; ++ void SetWindowIcons(const gfx::ImageSkia& window_icon, ++ const gfx::ImageSkia& app_icon) override; + void SizeConstraintsChanged() override; + // `SetZOrderLevel()` must be called on `z_order_` in + // `SetUpShellIntegration()`. +diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc b/ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc +new file mode 100644 +index 00000000000000..bd91e0641a7395 +--- /dev/null ++++ b/ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc +@@ -0,0 +1,47 @@ ++// Copyright 2024 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "ui/ozone/platform/wayland/test/wayland_test.h" ++ ++namespace ui { ++ ++using XdgToplevelIconTest = WaylandTestSimple; ++ ++TEST_F(XdgToplevelIconTest, Basic) { ++ SkBitmap bitmap; ++ bitmap.allocN32Pixels(128, 128); ++ gfx::ImageSkia icon = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); ++ window_->SetWindowIcons(gfx::ImageSkia(), icon); ++ ++ PostToServerAndWait([&](wl::TestWaylandServerThread* server) { ++ auto* const manager = server->xdg_toplevel_icon_manager_v1(); ++ ASSERT_TRUE(manager); ++ wl::XdgToplevelIconResources expected_resources = { ++ wl::XdgToplevelIconResource(gfx::Size(128, 128), 1)}; ++ EXPECT_EQ(manager->resources(), expected_resources); ++ }); ++} ++ ++TEST_F(XdgToplevelIconTest, AppIconTakesPrecedence) { ++ SkBitmap app_bitmap; ++ app_bitmap.allocN32Pixels(128, 128); ++ gfx::ImageSkia app_icon = gfx::ImageSkia::CreateFrom1xBitmap(app_bitmap); ++ ++ SkBitmap window_bitmap; ++ window_bitmap.allocN32Pixels(64, 64); ++ gfx::ImageSkia window_icon = ++ gfx::ImageSkia::CreateFrom1xBitmap(window_bitmap); ++ ++ window_->SetWindowIcons(window_icon, app_icon); ++ ++ PostToServerAndWait([&](wl::TestWaylandServerThread* server) { ++ auto* const manager = server->xdg_toplevel_icon_manager_v1(); ++ ASSERT_TRUE(manager); ++ wl::XdgToplevelIconResources expected_resources = { ++ wl::XdgToplevelIconResource(gfx::Size(128, 128), 1)}; ++ EXPECT_EQ(manager->resources(), expected_resources); ++ }); ++} ++ ++} // namespace ui +diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc +index 78a81356a5f01e..a716b337518f8c 100644 +--- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc ++++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc +@@ -6,6 +6,7 @@ + + #include + #include ++#include + + #include + +@@ -15,6 +16,7 @@ + #include "base/strings/utf_string_conversions.h" + #include "ui/base/hit_test.h" + #include "ui/base/ui_base_features.h" ++#include "ui/gfx/image/image_skia_rep_default.h" + #include "ui/ozone/common/features.h" + #include "ui/ozone/platform/wayland/common/wayland_object.h" + #include "ui/ozone/platform/wayland/common/wayland_util.h" +@@ -25,6 +27,7 @@ + #include "ui/ozone/platform/wayland/host/wayland_output_manager.h" + #include "ui/ozone/platform/wayland/host/wayland_seat.h" + #include "ui/ozone/platform/wayland/host/wayland_serial_tracker.h" ++#include "ui/ozone/platform/wayland/host/wayland_shm_buffer.h" + #include "ui/ozone/platform/wayland/host/wayland_toplevel_window.h" + #include "ui/ozone/platform/wayland/host/wayland_window.h" + #include "ui/ozone/platform/wayland/host/wayland_zaura_shell.h" +@@ -104,8 +107,9 @@ bool XDGToplevelWrapperImpl::Initialize() { + return false; + } + +- if (!xdg_surface_wrapper_) ++ if (!xdg_surface_wrapper_) { + return false; ++ } + + xdg_toplevel_.reset( + xdg_surface_get_toplevel(xdg_surface_wrapper_->xdg_surface())); +@@ -233,9 +237,10 @@ void XDGToplevelWrapperImpl::SetMinimized() { + + void XDGToplevelWrapperImpl::SurfaceMove(WaylandConnection* connection) { + DCHECK(xdg_toplevel_); +- if (auto serial = GetSerialForMoveResize(connection)) ++ if (auto serial = GetSerialForMoveResize(connection)) { + xdg_toplevel_move(xdg_toplevel_.get(), connection->seat()->wl_object(), + serial->value); ++ } + } + + void XDGToplevelWrapperImpl::SurfaceResize(WaylandConnection* connection, +@@ -261,8 +266,9 @@ void XDGToplevelWrapperImpl::SetTitle(const std::u16string& title) { + // length of the string so it would fit the message with some margin. + const size_t kMaxLengh = 4000; + auto short_title = base::UTF16ToUTF8(title); +- if (short_title.size() > kMaxLengh) ++ if (short_title.size() > kMaxLengh) { + short_title.resize(kMaxLengh); ++ } + xdg_toplevel_set_title(xdg_toplevel_.get(), short_title.c_str()); + } + +@@ -470,8 +476,9 @@ void XDGToplevelWrapperImpl::OnConfigureOcclusionState( + + void XDGToplevelWrapperImpl::SetTopLevelDecorationMode( + DecorationMode requested_mode) { +- if (!zxdg_toplevel_decoration_ || requested_mode == decoration_mode_) ++ if (!zxdg_toplevel_decoration_ || requested_mode == decoration_mode_) { + return; ++ } + + zxdg_toplevel_decoration_v1_set_mode(zxdg_toplevel_decoration_.get(), + ToInt32(requested_mode)); +@@ -769,6 +776,44 @@ void XDGToplevelWrapperImpl::AckRotateFocus(uint32_t serial, uint32_t handled) { + connection_->Flush(); + } + ++void XDGToplevelWrapperImpl::SetIcon(const gfx::ImageSkia& icon) { ++ auto* manager = connection_->toplevel_icon_manager_v1(); ++ if (!manager) { ++ return; ++ } ++ ++ if (icon.isNull()) { ++ xdg_toplevel_icon_manager_v1_set_icon(manager, xdg_toplevel_.get(), ++ nullptr); ++ return; ++ } ++ ++ std::vector> buffers; ++ auto* xdg_icon = xdg_toplevel_icon_manager_v1_create_icon(manager); ++ for (const auto& rep : icon.image_reps()) { ++ const auto& bitmap = rep.GetBitmap(); ++ gfx::Size image_size = gfx::SkISizeToSize(bitmap.dimensions()); ++ if (image_size.IsEmpty() || image_size.width() != image_size.height()) { ++ // The toplevel icon protocol requires square icons. ++ continue; ++ } ++ ++ WaylandShmBuffer buffer(connection_->buffer_factory(), image_size); ++ if (!buffer.IsValid()) { ++ LOG(ERROR) << "Failed to create SHM buffer for icon Bitmap."; ++ return; ++ } ++ ++ wl::DrawBitmap(bitmap, &buffer); ++ buffers.emplace_back(std::move(buffer), rep.scale()); ++ } ++ for (const auto& [buffer, scale] : buffers) { ++ xdg_toplevel_icon_v1_add_buffer(xdg_icon, buffer.get(), scale); ++ } ++ xdg_toplevel_icon_manager_v1_set_icon(manager, xdg_toplevel_.get(), xdg_icon); ++ xdg_toplevel_icon_v1_destroy(xdg_icon); ++} ++ + XDGToplevelWrapperImpl* XDGToplevelWrapperImpl::AsXDGToplevelWrapper() { + return this; + } +diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h +index 99db31788888b8..f34cc782ffc82e 100644 +--- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h ++++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h +@@ -81,6 +81,7 @@ class XDGToplevelWrapperImpl : public ShellToplevelWrapper { + void SetPersistable(bool persistable) const override; + void SetShape(std::unique_ptr shape_rects) override; + void AckRotateFocus(uint32_t serial, uint32_t handled) override; ++ void SetIcon(const gfx::ImageSkia& icon) override; + + XDGToplevelWrapperImpl* AsXDGToplevelWrapper() override; + +diff --git a/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc +new file mode 100644 +index 00000000000000..464884e9e1124b +--- /dev/null ++++ b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc +@@ -0,0 +1,95 @@ ++// Copyright 2024 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h" ++ ++#include ++ ++#include "base/check_op.h" ++#include "ui/ozone/platform/wayland/host/wayland_shm_buffer.h" ++#include "ui/ozone/platform/wayland/test/server_object.h" ++ ++namespace wl { ++ ++namespace { ++ ++void DestroyManager(struct wl_client* client, struct wl_resource* resource) {} ++ ++void CreateIcon(struct wl_client* client, ++ struct wl_resource* resource, ++ uint32_t id) { ++ auto* global = GetUserDataAs(resource); ++ wl_resource* icon = CreateResourceWithImpl( ++ client, &xdg_toplevel_icon_v1_interface, 1, &kMockXdgToplevelIconImpl, id, ++ global); ++ global->set_icon(GetUserDataAs(icon)); ++} ++ ++void SetIcon(struct wl_client* client, ++ struct wl_resource* resource, ++ struct wl_resource* toplevel, ++ struct wl_resource* icon) { ++ auto* manager = GetUserDataAs(resource); ++ ASSERT_TRUE(manager); ++ auto* toplevel_icon = GetUserDataAs(icon); ++ ASSERT_TRUE(toplevel_icon); ++ manager->resources() = toplevel_icon->resources(); ++} ++ ++} // namespace ++ ++const struct xdg_toplevel_icon_manager_v1_interface ++ kMockXdgToplevelIconManagerImpl = { ++ .destroy = DestroyManager, ++ .create_icon = CreateIcon, ++ .set_icon = SetIcon, ++}; ++ ++MockXdgToplevelIconManagerV1::MockXdgToplevelIconManagerV1() ++ : GlobalObject(&xdg_toplevel_icon_manager_v1_interface, ++ &kMockXdgToplevelIconManagerImpl, ++ 1) {} ++ ++MockXdgToplevelIconManagerV1::~MockXdgToplevelIconManagerV1() = default; ++ ++namespace { ++ ++void DestroyIcon(struct wl_client* client, struct wl_resource* resource) {} ++ ++void SetName(struct wl_client* client, ++ struct wl_resource* resource, ++ const char* icon_name) {} ++ ++void AddBuffer(struct wl_client* client, ++ struct wl_resource* resource, ++ struct wl_resource* buffer, ++ int32_t scale) { ++ auto* icon = GetUserDataAs(resource); ++ ASSERT_TRUE(icon); ++ wl_shm_buffer* shm_buffer = wl_shm_buffer_get(buffer); ++ ASSERT_TRUE(buffer); ++ auto width = wl_shm_buffer_get_width(shm_buffer); ++ auto height = wl_shm_buffer_get_height(shm_buffer); ++ icon->resources().emplace_back(gfx::Size(width, height), scale); ++} ++ ++} // namespace ++ ++const struct xdg_toplevel_icon_v1_interface kMockXdgToplevelIconImpl = { ++ .destroy = DestroyIcon, ++ .set_name = SetName, ++ .add_buffer = AddBuffer, ++}; ++ ++MockXdgToplevelIconV1::MockXdgToplevelIconV1( ++ wl_resource* resource, ++ MockXdgToplevelIconManagerV1* global) ++ : ServerObject(resource), global_(global) {} ++ ++MockXdgToplevelIconV1::~MockXdgToplevelIconV1() { ++ CHECK_EQ(global_->icon(), this); ++ global_->set_icon(nullptr); ++} ++ ++} // namespace wl +diff --git a/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h +new file mode 100644 +index 00000000000000..4272f362be0d18 +--- /dev/null ++++ b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h +@@ -0,0 +1,79 @@ ++// Copyright 2024 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_XDG_TOPLEVEL_ICON_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_XDG_TOPLEVEL_ICON_H_ ++ ++#include ++ ++#include ++ ++#include "base/check.h" ++#include "base/memory/raw_ptr.h" ++#include "testing/gmock/include/gmock/gmock.h" ++#include "ui/gfx/geometry/size.h" ++#include "ui/ozone/platform/wayland/test/global_object.h" ++#include "ui/ozone/platform/wayland/test/server_object.h" ++ ++namespace wl { ++ ++class MockXdgToplevelIconV1; ++ ++struct XdgToplevelIconResource { ++ gfx::Size size; ++ int32_t scale; ++ ++ bool operator==(const XdgToplevelIconResource& other) const { ++ return size == other.size && scale == other.scale; ++ } ++}; ++ ++using XdgToplevelIconResources = std::vector; ++ ++extern const struct xdg_toplevel_icon_manager_v1_interface ++ kMockXdgToplevelIconManagerImpl; ++extern const struct xdg_toplevel_icon_v1_interface kMockXdgToplevelIconImpl; ++ ++class MockXdgToplevelIconManagerV1 : public GlobalObject { ++ public: ++ MockXdgToplevelIconManagerV1(); ++ ++ MockXdgToplevelIconManagerV1(const MockXdgToplevelIconManagerV1&) = delete; ++ MockXdgToplevelIconManagerV1& operator=(const MockXdgToplevelIconManagerV1&) = ++ delete; ++ ++ ~MockXdgToplevelIconManagerV1() override; ++ ++ void set_icon(MockXdgToplevelIconV1* icon) { icon_ = icon; } ++ MockXdgToplevelIconV1* icon() { return icon_; } ++ ++ XdgToplevelIconResources& resources() { return resources_; } ++ ++ private: ++ raw_ptr icon_ = nullptr; ++ ++ XdgToplevelIconResources resources_; ++}; ++ ++class MockXdgToplevelIconV1 : public ServerObject { ++ public: ++ MockXdgToplevelIconV1(wl_resource* resource, ++ MockXdgToplevelIconManagerV1* global); ++ ++ MockXdgToplevelIconV1(const MockXdgToplevelIconV1&) = delete; ++ MockXdgToplevelIconV1& operator=(const MockXdgToplevelIconV1&) = delete; ++ ++ ~MockXdgToplevelIconV1() override; ++ ++ XdgToplevelIconResources& resources() { return resources_; } ++ ++ private: ++ raw_ptr global_ = nullptr; ++ ++ XdgToplevelIconResources resources_; ++}; ++ ++} // namespace wl ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_XDG_TOPLEVEL_ICON_H_ +diff --git a/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc b/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc +index ab6f43e4a0cdb6..c925b27eb31cb4 100644 +--- a/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc ++++ b/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc +@@ -171,6 +171,9 @@ bool TestWaylandServerThread::Start() { + if (!xdg_activation_v1_.Initialize(display_.get())) { + return false; + } ++ if (!xdg_toplevel_icon_manager_v1_.Initialize(display_.get())) { ++ return false; ++ } + + client_ = wl_client_create(display_.get(), server_fd.release()); + if (!client_) +diff --git a/ui/ozone/platform/wayland/test/test_wayland_server_thread.h b/ui/ozone/platform/wayland/test/test_wayland_server_thread.h +index d17deea735bc01..dd8f538ea23c18 100644 +--- a/ui/ozone/platform/wayland/test/test_wayland_server_thread.h ++++ b/ui/ozone/platform/wayland/test/test_wayland_server_thread.h +@@ -23,6 +23,7 @@ + #include "ui/ozone/platform/wayland/test/mock_wp_presentation.h" + #include "ui/ozone/platform/wayland/test/mock_xdg_activation_v1.h" + #include "ui/ozone/platform/wayland/test/mock_xdg_shell.h" ++#include "ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h" + #include "ui/ozone/platform/wayland/test/mock_zwp_linux_dmabuf.h" + #include "ui/ozone/platform/wayland/test/test_alpha_compositing.h" + #include "ui/ozone/platform/wayland/test/test_compositor.h" +@@ -187,6 +188,10 @@ class TestWaylandServerThread : public TestOutput::Delegate, + + MockXdgActivationV1* xdg_activation_v1() { return &xdg_activation_v1_; } + ++ MockXdgToplevelIconManagerV1* xdg_toplevel_icon_manager_v1() { ++ return &xdg_toplevel_icon_manager_v1_; ++ } ++ + void set_output_delegate(OutputDelegate* delegate) { + output_delegate_ = delegate; + } +@@ -260,6 +265,7 @@ class TestWaylandServerThread : public TestOutput::Delegate, + MockWpPresentation wp_presentation_; + TestWpPointerGestures wp_pointer_gestures_; + MockXdgActivationV1 xdg_activation_v1_; ++ MockXdgToplevelIconManagerV1 xdg_toplevel_icon_manager_v1_; + std::unique_ptr primary_selection_device_manager_; + + std::vector> globals_; diff --git a/wayland-protocol-toplevel-icon.patch b/wayland-protocol-toplevel-icon.patch new file mode 100644 index 0000000..dfb40a8 --- /dev/null +++ b/wayland-protocol-toplevel-icon.patch @@ -0,0 +1,335 @@ +From 6185a6e178fc236aad3502fbc969ddd38aabf020 Mon Sep 17 00:00:00 2001 +From: Tom Anderson +Date: Tue, 6 Aug 2024 00:27:29 +0000 +Subject: [PATCH] [Wayland] Add ToplevelIconManager + +This CL is just the boilerplate. Actual implementation to follow. + +R=nickdiego + +Change-Id: I135d5366761fcbb132405d782738d6c09f52bdd8 +Bug: 356424077 +Low-Coverage-Reason: TESTS_IN_SEPARATE_CL: This CL adds the boilerplate. Tests will be added in a followup. +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5752291 +Commit-Queue: Thomas Anderson +Auto-Submit: Thomas Anderson +Reviewed-by: Nick Yamane +Cr-Commit-Position: refs/heads/main@{#1337593} +--- + third_party/wayland-protocols/BUILD.gn | 4 ++ + ui/ozone/platform/wayland/BUILD.gn | 3 ++ + .../platform/wayland/common/wayland_object.cc | 50 ++++++++++++------- + .../platform/wayland/common/wayland_object.h | 2 + + .../wayland/host/toplevel_icon_manager.cc | 44 ++++++++++++++++ + .../wayland/host/toplevel_icon_manager.h | 29 +++++++++++ + .../wayland/host/wayland_connection.cc | 3 ++ + .../wayland/host/wayland_connection.h | 6 +++ + 8 files changed, 123 insertions(+), 18 deletions(-) + create mode 100644 ui/ozone/platform/wayland/host/toplevel_icon_manager.cc + create mode 100644 ui/ozone/platform/wayland/host/toplevel_icon_manager.h + +diff --git a/third_party/wayland-protocols/BUILD.gn b/third_party/wayland-protocols/BUILD.gn +index 67941c2c90cf5e..0bd73c2f56c380 100644 +--- a/third_party/wayland-protocols/BUILD.gn ++++ b/third_party/wayland-protocols/BUILD.gn +@@ -207,3 +207,7 @@ wayland_protocol("xdg_shell_protocol") { + wayland_protocol("xdg_toplevel_drag_protocol") { + sources = [ "src/staging/xdg-toplevel-drag/xdg-toplevel-drag-v1.xml" ] + } ++ ++wayland_protocol("xdg_toplevel_icon_protocol") { ++ sources = [ "src/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml" ] ++} +diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn +index 0264365be7c6ce..4ba36222f03906 100644 +--- a/ui/ozone/platform/wayland/BUILD.gn ++++ b/ui/ozone/platform/wayland/BUILD.gn +@@ -77,6 +77,8 @@ source_set("wayland") { + "host/single_pixel_buffer.h", + "host/surface_augmenter.cc", + "host/surface_augmenter.h", ++ "host/toplevel_icon_manager.cc", ++ "host/toplevel_icon_manager.h", + "host/wayland_bubble.cc", + "host/wayland_bubble.h", + "host/wayland_buffer_backing.cc", +@@ -291,6 +293,7 @@ source_set("wayland") { + "//third_party/wayland-protocols:xdg_foreign", + "//third_party/wayland-protocols:xdg_output_protocol", + "//third_party/wayland-protocols:xdg_shell_protocol", ++ "//third_party/wayland-protocols:xdg_toplevel_icon_protocol", + "//ui/base", + "//ui/base:buildflags", + "//ui/base:data_exchange", +diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc +index cab61aa4409ca5..e30367a19d7774 100644 +--- a/ui/ozone/platform/wayland/common/wayland_object.cc ++++ b/ui/ozone/platform/wayland/common/wayland_object.cc +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + + #include "base/logging.h" + +@@ -77,31 +78,36 @@ void delete_output(wl_output* output) { + } + + void delete_keyboard(wl_keyboard* keyboard) { +- if (wl::get_version_of_object(keyboard) >= WL_KEYBOARD_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(keyboard) >= ++ WL_KEYBOARD_RELEASE_SINCE_VERSION) { + wl_keyboard_release(keyboard); +- else ++ } else { + wl_keyboard_destroy(keyboard); ++ } + } + + void delete_pointer(wl_pointer* pointer) { +- if (wl::get_version_of_object(pointer) >= WL_POINTER_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(pointer) >= WL_POINTER_RELEASE_SINCE_VERSION) { + wl_pointer_release(pointer); +- else ++ } else { + wl_pointer_destroy(pointer); ++ } + } + + void delete_seat(wl_seat* seat) { +- if (wl::get_version_of_object(seat) >= WL_SEAT_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(seat) >= WL_SEAT_RELEASE_SINCE_VERSION) { + wl_seat_release(seat); +- else ++ } else { + wl_seat_destroy(seat); ++ } + } + + void delete_touch(wl_touch* touch) { +- if (wl::get_version_of_object(touch) >= WL_TOUCH_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(touch) >= WL_TOUCH_RELEASE_SINCE_VERSION) { + wl_touch_release(touch); +- else ++ } else { + wl_touch_destroy(touch); ++ } + } + + void delete_zaura_output_manager(zaura_output_manager* manager) { +@@ -113,39 +119,45 @@ void delete_zaura_output_manager_v2(zaura_output_manager_v2* manager) { + } + + void delete_zaura_shell(zaura_shell* shell) { +- if (wl::get_version_of_object(shell) >= ZAURA_SHELL_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(shell) >= ZAURA_SHELL_RELEASE_SINCE_VERSION) { + zaura_shell_release(shell); +- else ++ } else { + zaura_shell_destroy(shell); ++ } + } + + void delete_zaura_surface(zaura_surface* surface) { +- if (wl::get_version_of_object(surface) >= ZAURA_SURFACE_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(surface) >= ++ ZAURA_SURFACE_RELEASE_SINCE_VERSION) { + zaura_surface_release(surface); +- else ++ } else { + zaura_surface_destroy(surface); ++ } + } + + void delete_zaura_output(zaura_output* output) { +- if (wl::get_version_of_object(output) >= ZAURA_OUTPUT_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(output) >= ZAURA_OUTPUT_RELEASE_SINCE_VERSION) { + zaura_output_release(output); +- else ++ } else { + zaura_output_destroy(output); ++ } + } + + void delete_zaura_toplevel(zaura_toplevel* toplevel) { + if (wl::get_version_of_object(toplevel) >= +- ZAURA_TOPLEVEL_RELEASE_SINCE_VERSION) ++ ZAURA_TOPLEVEL_RELEASE_SINCE_VERSION) { + zaura_toplevel_release(toplevel); +- else ++ } else { + zaura_toplevel_destroy(toplevel); ++ } + } + + void delete_zaura_popup(zaura_popup* popup) { +- if (wl::get_version_of_object(popup) >= ZAURA_POPUP_RELEASE_SINCE_VERSION) ++ if (wl::get_version_of_object(popup) >= ZAURA_POPUP_RELEASE_SINCE_VERSION) { + zaura_popup_release(popup); +- else ++ } else { + zaura_popup_destroy(popup); ++ } + } + + } // namespace +@@ -245,6 +257,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_popup) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_positioner) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_surface) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel) ++IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) ++IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_wm_base) + IMPLEMENT_WAYLAND_OBJECT_TRAITS_WITH_DELETER(zaura_output_manager, + delete_zaura_output_manager) +diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h +index ed4902d29edb8f..38213eff64de40 100644 +--- a/ui/ozone/platform/wayland/common/wayland_object.h ++++ b/ui/ozone/platform/wayland/common/wayland_object.h +@@ -156,6 +156,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(xdg_popup) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_positioner) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_surface) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel) ++DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) ++DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(xdg_wm_base) + DECLARE_WAYLAND_OBJECT_TRAITS(zaura_output) + DECLARE_WAYLAND_OBJECT_TRAITS(zaura_output_manager) +diff --git a/ui/ozone/platform/wayland/host/toplevel_icon_manager.cc b/ui/ozone/platform/wayland/host/toplevel_icon_manager.cc +new file mode 100644 +index 00000000000000..44478f56c88a97 +--- /dev/null ++++ b/ui/ozone/platform/wayland/host/toplevel_icon_manager.cc +@@ -0,0 +1,44 @@ ++// Copyright 2024 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "ui/ozone/platform/wayland/host/toplevel_icon_manager.h" ++ ++#include ++ ++#include "base/check_op.h" ++#include "base/logging.h" ++#include "ui/ozone/platform/wayland/common/wayland_object.h" ++#include "ui/ozone/platform/wayland/host/wayland_connection.h" ++ ++namespace ui { ++ ++namespace { ++ ++constexpr uint32_t kMaxVersion = 1; ++ ++} // namespace ++ ++// static ++void ToplevelIconManager::Instantiate(WaylandConnection* connection, ++ wl_registry* registry, ++ uint32_t name, ++ const std::string& interface, ++ uint32_t version) { ++ CHECK_EQ(interface, kInterfaceName) << "Expected \"" << kInterfaceName ++ << "\" but got \"" << interface << "\""; ++ ++ if (connection->toplevel_icon_manager_v1_) { ++ return; ++ } ++ ++ auto instance = wl::Bind<::xdg_toplevel_icon_manager_v1>( ++ registry, name, std::min(version, kMaxVersion)); ++ if (!instance) { ++ LOG(ERROR) << "Failed to bind " << kInterfaceName; ++ return; ++ } ++ connection->toplevel_icon_manager_v1_ = std::move(instance); ++} ++ ++} // namespace ui +diff --git a/ui/ozone/platform/wayland/host/toplevel_icon_manager.h b/ui/ozone/platform/wayland/host/toplevel_icon_manager.h +new file mode 100644 +index 00000000000000..8525dd7cda62db +--- /dev/null ++++ b/ui/ozone/platform/wayland/host/toplevel_icon_manager.h +@@ -0,0 +1,29 @@ ++// Copyright 2024 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_TOPLEVEL_ICON_MANAGER_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_HOST_TOPLEVEL_ICON_MANAGER_H_ ++ ++#include "ui/ozone/platform/wayland/common/wayland_object.h" ++ ++namespace ui { ++ ++// Sets up the global xdg_toplevel_icon_manager_v1 instance. ++class ToplevelIconManager ++ : public wl::GlobalObjectRegistrar { ++ public: ++ static constexpr char kInterfaceName[] = "xdg_toplevel_icon_manager_v1"; ++ ++ static void Instantiate(WaylandConnection* connection, ++ wl_registry* registry, ++ uint32_t name, ++ const std::string& interface, ++ uint32_t version); ++ ++ ToplevelIconManager() = delete; ++}; ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_TOPLEVEL_ICON_MANAGER_H_ +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc +index fe695e355e26b8..51ca168a198bda 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.cc ++++ b/ui/ozone/platform/wayland/host/wayland_connection.cc +@@ -38,6 +38,7 @@ + #include "ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.h" + #include "ui/ozone/platform/wayland/host/single_pixel_buffer.h" + #include "ui/ozone/platform/wayland/host/surface_augmenter.h" ++#include "ui/ozone/platform/wayland/host/toplevel_icon_manager.h" + #include "ui/ozone/platform/wayland/host/wayland_buffer_factory.h" + #include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h" + #include "ui/ozone/platform/wayland/host/wayland_cursor.h" +@@ -152,6 +153,8 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) { + &SinglePixelBuffer::Instantiate); + RegisterGlobalObjectFactory(SurfaceAugmenter::kInterfaceName, + &SurfaceAugmenter::Instantiate); ++ RegisterGlobalObjectFactory(ToplevelIconManager::kInterfaceName, ++ &ToplevelIconManager::Instantiate); + RegisterGlobalObjectFactory(WaylandZAuraOutputManagerV2::kInterfaceName, + &WaylandZAuraOutputManagerV2::Instantiate); + RegisterGlobalObjectFactory(WaylandDataDeviceManager::kInterfaceName, +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h +index 54eb0c234a44fc..10fe500d24e33f 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.h ++++ b/ui/ozone/platform/wayland/host/wayland_connection.h +@@ -169,6 +169,10 @@ class WaylandConnection { + return fractional_scale_manager_v1_.get(); + } + ++ xdg_toplevel_icon_manager_v1* toplevel_icon_manager_v1() const { ++ return toplevel_icon_manager_v1_.get(); ++ } ++ + void SetPlatformCursor(wl_cursor* cursor_data, int buffer_scale); + + void SetCursorBufferListener(WaylandCursorBufferListener* listener); +@@ -384,6 +388,7 @@ class WaylandConnection { + friend class OverlayPrioritizer; + friend class SinglePixelBuffer; + friend class SurfaceAugmenter; ++ friend class ToplevelIconManager; + friend class WaylandDataDeviceManager; + friend class WaylandOutput; + friend class WaylandSeat; +@@ -489,6 +494,7 @@ class WaylandConnection { + wl::Object extended_drag_v1_; + wl::Object xdg_output_manager_; + wl::Object fractional_scale_manager_v1_; ++ wl::Object toplevel_icon_manager_v1_; + + // Manages Wayland windows. + WaylandWindowManager window_manager_{this}; diff --git a/wayland_connection-Wchanges-meaning.patch b/wayland_connection-Wchanges-meaning.patch new file mode 100644 index 0000000..f8a9ab0 --- /dev/null +++ b/wayland_connection-Wchanges-meaning.patch @@ -0,0 +1,61 @@ +From 04b25cdd531cf3826d7418141897492979d8f0fb Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz +Date: Thu, 19 Sep 2024 10:13:04 +0000 +Subject: [PATCH] GCC: avoid clash between type and getter in WaylandConnection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +WaylandConnection::xdg_toplevel_drag_manager_v1 getter clashes with +the xdg_toplevel_drag_manager_v1 type. Renamed getter to +toplevel_drag_manager_v1 following the decision with other types. + +Bug: 40565911 +Change-Id: I7331be4bcb00f47cd48a74b043067f044b40dcbc +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5875679 +Reviewed-by: Nick Yamane +Commit-Queue: José Dapena Paz +Cr-Commit-Position: refs/heads/main@{#1357526} +--- + ui/ozone/platform/wayland/host/wayland_connection.h | 2 +- + .../platform/wayland/host/wayland_window_drag_controller.cc | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h +index 79680db7189852..55a89735882ff7 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.h ++++ b/ui/ozone/platform/wayland/host/wayland_connection.h +@@ -160,7 +160,7 @@ class WaylandConnection { + zcr_extended_drag_v1* extended_drag_v1() const { + return extended_drag_v1_.get(); + } +- xdg_toplevel_drag_manager_v1* xdg_toplevel_drag_manager_v1() const { ++ xdg_toplevel_drag_manager_v1* toplevel_drag_manager_v1() const { + return xdg_toplevel_drag_manager_v1_.get(); + } + +diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +index 6184684e308154..6fbf3df07bfe68 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc ++++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +@@ -109,9 +109,9 @@ class WaylandWindowDragController::XdgToplevelDrag { + public: + XdgToplevelDrag(WaylandConnection& connection, wl_data_source* source) + : connection_(connection) { +- DCHECK(connection.xdg_toplevel_drag_manager_v1()); ++ DCHECK(connection.toplevel_drag_manager_v1()); + drag_.reset(xdg_toplevel_drag_manager_v1_get_xdg_toplevel_drag( +- connection.xdg_toplevel_drag_manager_v1(), source)); ++ connection.toplevel_drag_manager_v1(), source)); + DCHECK(drag_); + } + +@@ -737,7 +737,7 @@ bool WaylandWindowDragController::IsExtendedDragAvailable() const { + } + + bool WaylandWindowDragController::IsXdgToplevelDragAvailable() const { +- return !!connection_->xdg_toplevel_drag_manager_v1(); ++ return !!connection_->toplevel_drag_manager_v1(); + } + + bool WaylandWindowDragController::IsActiveDragAndDropSession() const { diff --git a/wayland_version.patch b/wayland_version.patch new file mode 100644 index 0000000..cd057bb --- /dev/null +++ b/wayland_version.patch @@ -0,0 +1,9 @@ +--- src/third_party/wayland/wayland_version.gni.orig 2025-01-02 22:24:04.094885287 +0100 ++++ src/third_party/wayland/wayland_version.gni 2025-01-04 20:36:25.262834108 +0100 +@@ -4,5 +4,5 @@ + # is true to check system wayland package version meets + # at least the version of third-party/wayland so that it won't + # make any compile error with chromium +-wayland_version = "1.23.0" ++wayland_version = "1.22.0" + wayland_egl_version = "18.1.0" diff --git a/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch b/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch new file mode 100644 index 0000000..dab99d8 --- /dev/null +++ b/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch @@ -0,0 +1,36 @@ +From 4860148c51cb673711a41bc26135659ad4e6cb9d Mon Sep 17 00:00:00 2001 +From: Dan Tan +Date: Wed, 31 Jan 2024 09:11:18 -0800 +Subject: [PATCH] Add WebRTC-LibaomAv1Encoder-MaxConsecFrameDrop parameter to + explicitly limit the maximum consecutive frame drop + +Bug: webrtc:15821 +Change-Id: Ib8be6827ea57e4e54269b94a0fc9ea81945af09f +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337020 +Reviewed-by: Marco Paniconi +Commit-Queue: Dan Tan +Reviewed-by: Sergey Silkin +Cr-Commit-Position: refs/heads/main@{#41648} +--- + experiments/field_trials.py | 3 +++ + .../codecs/av1/libaom_av1_encoder.cc | 18 ++++++++++++- + .../codecs/av1/libaom_av1_encoder_unittest.cc | 25 +++++++++++++++++++ + 3 files changed, 45 insertions(+), 1 deletion(-) + +diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +index 4ff22bfe34..03bb367fe0 100644 +--- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc ++++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +@@ -297,6 +307,12 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0); + } + ++ if (codec_settings->mode == VideoCodecMode::kRealtimeVideo && ++ encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) { ++ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, ++ max_consec_frame_drop_); ++ } ++ + if (cfg_.g_threads == 8) { + // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2() + // based. diff --git a/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch b/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch new file mode 100644 index 0000000..999ddd8 --- /dev/null +++ b/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch @@ -0,0 +1,250 @@ +From f7a15067031cae07b1dac031fa263a9f01902f1c Mon Sep 17 00:00:00 2001 +From: Sergey Silkin +Date: Tue, 9 Jul 2024 15:03:10 +0200 +Subject: [PATCH] Adjust max consecutive drops depending on target frame rate +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Current thresholds were tuned to guarantee no buffer overshoot in an extreme scenario (encoding a high complexity video in a low bitrate). + +Bug: b/337757868, webrtc:351644568 +Change-Id: I832b2564af6f18f06550338cc9b3618f8acdf831 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356580 +Reviewed-by: Dan Tan +Reviewed-by: Erik Språng +Commit-Queue: Sergey Silkin +Cr-Commit-Position: refs/heads/main@{#42620} +--- + experiments/field_trials.py | 6 +-- + modules/video_coding/codecs/av1/BUILD.gn | 2 + + .../codecs/av1/libaom_av1_encoder.cc | 42 +++++++++------ + .../codecs/av1/libaom_av1_encoder_unittest.cc | 53 ++++++++++++++----- + 4 files changed, 69 insertions(+), 34 deletions(-) + +diff --git a/modules/video_coding/codecs/av1/BUILD.gn b/modules/video_coding/codecs/av1/BUILD.gn +index 7d93de7a3a..197e1f3e19 100644 +--- a/third_party/webrtc/modules/video_coding/codecs/av1/BUILD.gn ++++ b/third_party/webrtc/modules/video_coding/codecs/av1/BUILD.gn +@@ -60,6 +60,7 @@ rtc_library("libaom_av1_encoder") { + "../../../../api/video_codecs:scalability_mode", + "../../../../api/video_codecs:video_codecs_api", + "../../../../common_video", ++ "../../../../modules/rtp_rtcp:rtp_rtcp_format", + "../../../../rtc_base:checks", + "../../../../rtc_base:logging", + "../../../../rtc_base:rtc_numerics", +@@ -104,6 +105,7 @@ if (rtc_include_tests) { + "../../../../api/units:data_size", + "../../../../api/units:time_delta", + "../../../../api/video:video_frame", ++ "../../../../modules/rtp_rtcp:rtp_rtcp_format", + "../../../../test:scoped_key_value_config", + "../../svc:scalability_mode_util", + "../../svc:scalability_structures", +diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +index 3a8830252d..258d3d3b88 100644 +--- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc ++++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +@@ -30,6 +30,7 @@ + #include "api/video_codecs/scalability_mode.h" + #include "api/video_codecs/video_codec.h" + #include "api/video_codecs/video_encoder.h" ++#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" + #include "modules/video_coding/include/video_codec_interface.h" + #include "modules/video_coding/include/video_error_codes.h" + #include "modules/video_coding/svc/create_scalability_structure.h" +@@ -65,7 +66,6 @@ constexpr int kLowQindex = 145; // Low qindex threshold for QP scaling. + constexpr int kHighQindex = 205; // High qindex threshold for QP scaling. + constexpr int kBitDepth = 8; + constexpr int kLagInFrames = 0; // No look ahead. +-constexpr int kRtpTicksPerSecond = 90000; + constexpr double kMinFrameRateFps = 1.0; + + aom_superblock_size_t GetSuperblockSize(int width, int height, int threads) { +@@ -133,7 +133,9 @@ class LibaomAv1Encoder final : public VideoEncoder { + double framerate_fps_; // Current target frame rate. + int64_t timestamp_; + const LibaomAv1EncoderInfoSettings encoder_info_override_; +- int max_consec_frame_drop_; ++ // TODO(webrtc:351644568): Remove this kill-switch after the feature is fully ++ // deployed. ++ bool adaptive_max_consec_drops_; + }; + + int32_t VerifyCodecSettings(const VideoCodec& codec_settings) { +@@ -164,12 +166,12 @@ int32_t VerifyCodecSettings(const VideoCodec& codec_settings) { + return WEBRTC_VIDEO_CODEC_OK; + } + +-int GetMaxConsecutiveFrameDrop(const FieldTrialsView& field_trials) { +- webrtc::FieldTrialParameter maxdrop("maxdrop", 0); +- webrtc::ParseFieldTrial( +- {&maxdrop}, +- field_trials.Lookup("WebRTC-LibaomAv1Encoder-MaxConsecFrameDrop")); +- return maxdrop; ++int GetMaxConsecDrops(double framerate_fps) { ++ // Consecutive frame drops result in a video freeze. We want to minimize the ++ // max number of consecutive drops and, at the same time, keep the value high ++ // enough to let encoder drain the buffer at overshoot. ++ constexpr double kMaxFreezeSeconds = 0.25; ++ return std::ceil(kMaxFreezeSeconds * framerate_fps); + } + + LibaomAv1Encoder::LibaomAv1Encoder(const Environment& env, +@@ -182,7 +184,8 @@ LibaomAv1Encoder::LibaomAv1Encoder(const Environment& env, + framerate_fps_(0), + timestamp_(0), + encoder_info_override_(env.field_trials()), +- max_consec_frame_drop_(GetMaxConsecutiveFrameDrop(env.field_trials())) {} ++ adaptive_max_consec_drops_(!env.field_trials().IsDisabled( ++ "WebRTC-LibaomAv1Encoder-AdaptiveMaxConsecDrops")) {} + + LibaomAv1Encoder::~LibaomAv1Encoder() { + Release(); +@@ -242,7 +245,7 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, + cfg_.g_threads = + NumberOfThreads(cfg_.g_w, cfg_.g_h, settings.number_of_cores); + cfg_.g_timebase.num = 1; +- cfg_.g_timebase.den = kRtpTicksPerSecond; ++ cfg_.g_timebase.den = kVideoPayloadTypeFrequency; + cfg_.rc_target_bitrate = encoder_settings_.startBitrate; // kilobits/sec. + cfg_.rc_dropframe_thresh = encoder_settings_.GetFrameDropEnabled() ? 30 : 0; + cfg_.g_input_bit_depth = kBitDepth; +@@ -304,12 +307,6 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, + SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0); + } + +- if (codec_settings->mode == VideoCodecMode::kRealtimeVideo && +- encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) { +- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, +- max_consec_frame_drop_); +- } +- + if (cfg_.g_threads == 8) { + // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2() + // based. +@@ -659,7 +656,7 @@ int32_t LibaomAv1Encoder::Encode( + return WEBRTC_VIDEO_CODEC_ENCODER_FAILURE; + } + +- const uint32_t duration = kRtpTicksPerSecond / framerate_fps_; ++ const uint32_t duration = kVideoPayloadTypeFrequency / framerate_fps_; + timestamp_ += duration; + + const size_t num_spatial_layers = +@@ -836,6 +833,17 @@ void LibaomAv1Encoder::SetRates(const RateControlParameters& parameters) { + SetEncoderControlParameters(AV1E_SET_SVC_PARAMS, &*svc_params_); + } + ++ if (adaptive_max_consec_drops_ && ++ (!rates_configured_ || framerate_fps_ != parameters.framerate_fps)) { ++ int max_consec_drops = GetMaxConsecDrops(parameters.framerate_fps); ++ if (!SetEncoderControlParameters(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, ++ max_consec_drops)) { ++ RTC_LOG(LS_WARNING) ++ << "Failed to set AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR to " ++ << max_consec_drops; ++ } ++ } ++ + framerate_fps_ = parameters.framerate_fps; + + rates_configured_ = true; +diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc +index abb6fce0cf..a00b03aeda 100644 +--- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc ++++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc +@@ -10,6 +10,7 @@ + + #include "modules/video_coding/codecs/av1/libaom_av1_encoder.h" + ++#include + #include + #include + #include +@@ -22,6 +23,7 @@ + #include "api/test/frame_generator_interface.h" + #include "api/video_codecs/video_codec.h" + #include "api/video_codecs/video_encoder.h" ++#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" + #include "modules/video_coding/codecs/test/encoded_video_frame_producer.h" + #include "modules/video_coding/include/video_error_codes.h" + #include "test/gmock.h" +@@ -37,6 +39,7 @@ using ::testing::Eq; + using ::testing::Field; + using ::testing::IsEmpty; + using ::testing::SizeIs; ++using ::testing::Values; + + VideoCodec DefaultCodecSettings() { + VideoCodec codec_settings; +@@ -199,32 +202,54 @@ TEST(LibaomAv1EncoderTest, CheckOddDimensionsWithSpatialLayers) { + ASSERT_THAT(encoded_frames, SizeIs(6)); + } + +-TEST(LibaomAv1EncoderTest, WithMaximumConsecutiveFrameDrop) { +- auto field_trials = std::make_unique( +- "WebRTC-LibaomAv1Encoder-MaxConsecFrameDrop/maxdrop:2/"); +- const Environment env = CreateEnvironment(std::move(field_trials)); ++class LibaomAv1EncoderMaxConsecDropTest ++ : public ::testing::TestWithParam {}; ++ ++TEST_P(LibaomAv1EncoderMaxConsecDropTest, MaxConsecDrops) { + VideoBitrateAllocation allocation; +- allocation.SetBitrate(0, 0, 1000); // some very low bitrate +- std::unique_ptr encoder = CreateLibaomAv1Encoder(env); ++ allocation.SetBitrate(0, 0, ++ 1000); // Very low bitrate to provoke frame drops. ++ std::unique_ptr encoder = ++ CreateLibaomAv1Encoder(CreateEnvironment()); + VideoCodec codec_settings = DefaultCodecSettings(); + codec_settings.SetFrameDropEnabled(true); + codec_settings.SetScalabilityMode(ScalabilityMode::kL1T1); + codec_settings.startBitrate = allocation.get_sum_kbps(); ++ codec_settings.maxFramerate = GetParam(); + ASSERT_EQ(encoder->InitEncode(&codec_settings, DefaultEncoderSettings()), + WEBRTC_VIDEO_CODEC_OK); + encoder->SetRates(VideoEncoder::RateControlParameters( + allocation, codec_settings.maxFramerate)); +- EncodedVideoFrameProducer evfp(*encoder); +- evfp.SetResolution( +- RenderResolution{codec_settings.width, codec_settings.height}); +- // We should code the first frame, skip two, then code another frame. + std::vector encoded_frames = +- evfp.SetNumInputFrames(4).Encode(); +- ASSERT_THAT(encoded_frames, SizeIs(2)); +- // The 4 frames have default Rtp-timestamps of 1000, 4000, 7000, 10000. +- ASSERT_THAT(encoded_frames[1].encoded_image.RtpTimestamp(), 10000); ++ EncodedVideoFrameProducer(*encoder) ++ .SetNumInputFrames(60) ++ .SetFramerateFps(codec_settings.maxFramerate) ++ .SetResolution(RenderResolution{320, 180}) ++ .Encode(); ++ ASSERT_GE(encoded_frames.size(), 2u); ++ ++ int max_consec_drops = 0; ++ for (size_t i = 1; i < encoded_frames.size(); ++i) { ++ uint32_t frame_duration_rtp = ++ encoded_frames[i].encoded_image.RtpTimestamp() - ++ encoded_frames[i - 1].encoded_image.RtpTimestamp(); ++ // X consecutive drops result in a freeze of (X + 1) frame duration. ++ // Subtract 1 to get pure number of drops. ++ int num_drops = frame_duration_rtp * codec_settings.maxFramerate / ++ kVideoPayloadTypeFrequency - ++ 1; ++ max_consec_drops = std::max(max_consec_drops, num_drops); ++ } ++ ++ const int expected_max_consec_drops = ++ std::ceil(0.25 * codec_settings.maxFramerate); ++ EXPECT_EQ(max_consec_drops, expected_max_consec_drops); + } + ++INSTANTIATE_TEST_SUITE_P(LibaomAv1EncoderMaxConsecDropTests, ++ LibaomAv1EncoderMaxConsecDropTest, ++ Values(1, 2, 5, 15, 30, 60)); ++ + TEST(LibaomAv1EncoderTest, EncoderInfoWithoutResolutionBitrateLimits) { + std::unique_ptr encoder = + CreateLibaomAv1Encoder(CreateEnvironment()); diff --git a/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch b/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch index d36a78c..eaaa199 100644 --- a/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch +++ b/zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch @@ -1,8 +1,8 @@ ---- src/third_party/zlib/google/zip_internal.cc.orig 2024-10-29 10:10:50.788206000 +0100 -+++ src/third_party/zlib/google/zip_internal.cc 2024-11-07 22:19:00.748569000 +0100 -@@ -9,6 +9,9 @@ - +--- src/third_party/zlib/google/zip_internal.cc.orig 2025-01-06 22:04:22.495198404 +0100 ++++ src/third_party/zlib/google/zip_internal.cc 2025-01-12 19:16:36.143995598 +0100 +@@ -10,6 +10,9 @@ #include + #include +#include +#include -- 2.51.1 From cacaaa99f37bc76a718848da69243bddf01f994ad88f30c1f79e85196de108e4 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 12 Jan 2025 20:48:45 +0000 Subject: [PATCH 31/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=183 --- nodejs-electron.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 985ff58..44922cc 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -67,6 +67,7 @@ Sun Jan 12 12:38:29 UTC 2025 - Bruno Pitrus * build-without-speech-service.patch * chromium-123-qrcode.patch * chromium-125-cloud_authenticator.patch + * chromium-127-cargo_crate.patch * chromium-127-crabby.patch * chromium-129-disable-H.264-video-parser-during-demuxing.patch * chromium-130-fontations.patch -- 2.51.1 From 266d9376d97553529f69a5e63dfbaafed6f90790332e005b0f4dc558dc918586 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Tue, 14 Jan 2025 20:03:42 +0000 Subject: [PATCH 32/80] Accepting request 1237929 from home:dziobian:gulgul-ultron:19 - Add MakeSbixTypeface-null-pointer-call.patch * fixes crash when handling SBIX color bitmap fonts (bsc#1235830) OBS-URL: https://build.opensuse.org/request/show/1237929 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=184 --- MakeSbixTypeface-null-pointer-call.patch | 12 ++++++++++++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 1 + 3 files changed, 19 insertions(+) create mode 100644 MakeSbixTypeface-null-pointer-call.patch diff --git a/MakeSbixTypeface-null-pointer-call.patch b/MakeSbixTypeface-null-pointer-call.patch new file mode 100644 index 0000000..046d4ab --- /dev/null +++ b/MakeSbixTypeface-null-pointer-call.patch @@ -0,0 +1,12 @@ +Actually disable the fontations code flag since we don't build that library. Otherwise chromium crashes with a null dereference + +--- src/third_party/blink/renderer/platform/runtime_enabled_features.json5.orig 2025-01-06 22:04:18.385199599 +0100 ++++ src/third_party/blink/renderer/platform/runtime_enabled_features.json5 2025-01-14 19:49:21.336897930 +0100 +@@ -2103,7 +2103,6 @@ + }, + { + name: "FontationsForSelectedFormats", +- status: "stable", + }, + { + name: "FontFamilyPostscriptMatchingCTMigration", diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 44922cc..a56bf83 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 14 18:51:39 UTC 2025 - Bruno Pitrus + +- Add MakeSbixTypeface-null-pointer-call.patch + * fixes crash when handling SBIX color bitmap fonts (bsc#1235830) + ------------------------------------------------------------------- Sun Jan 12 12:38:29 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index af9e3f6..cf688bd 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -285,6 +285,7 @@ Patch598: chromium-127-crabby.patch #End gentoo patches Patch599: remove-libphonenumber.patch Patch600: delete-old-language-detection-which-uses-tflite.patch +Patch601: MakeSbixTypeface-null-pointer-call.patch -- 2.51.1 From f1b26d612b4e9ea97132b03a423fb5bee3b4f89b6cb195a310a8d4ee27e6faee Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 17 Jan 2025 10:04:35 +0000 Subject: [PATCH 33/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=185 --- nodejs-electron.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index cf688bd..8bd1749 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -1053,13 +1053,9 @@ unset MALLOC_PERTURB_ %endif %if %{with lto} -%ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=2 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" -%else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" %endif -%endif %if %{with mold} export LDFLAGS="$LDFLAGS -fuse-ld=mold" -- 2.51.1 From ad53b513db0671059bd7b245b6adabd8ae88276b9adbbf76dd7b99466a7b3733 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 17 Jan 2025 21:32:41 +0000 Subject: [PATCH 34/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=186 --- nodejs-electron.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 8bd1749..0b2e875 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -1053,9 +1053,13 @@ unset MALLOC_PERTURB_ %endif %if %{with lto} +%ifarch aarch64 +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +%else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" %endif +%endif %if %{with mold} export LDFLAGS="$LDFLAGS -fuse-ld=mold" -- 2.51.1 From 561043863637647dd29551d207895bc70a0ebe15a47a3ed81242469ecb832b0f Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 18 Jan 2025 09:43:13 +0000 Subject: [PATCH 35/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=187 --- nodejs-electron.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0b2e875..0f7a10f 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -1001,7 +1001,7 @@ export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %ifarch aarch64 %if %{with lto} # Out of memory: Killed process 4016 (lto1-wpa) -export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g0 /g' -e 's/-g$/-g0/g')" +export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %endif %endif -- 2.51.1 From 59aa1ae529d524cae84f44b595d20f910c394e05018b64276d9343d93b853c86 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 23 Jan 2025 06:06:56 +0000 Subject: [PATCH 36/80] Accepting request 1239717 from home:dziobian:gulgul-ultron:19 - New upstream release 33.3.2 * Updated Chromium to 130.0.6723.191 * fix yellow background of composition text with wayland text-input-v3 * The avoidClosingConnections option for session.clearData now properly defaults to false when the dataTypes option is not set. * Fixed an issue where drag-dropping two directories would cause getAsFileSystemHandle to never resolve. * Fixed a potential crash in chrome.tabs.update(). * security fixes for CVE-2025-0434 CVE-2025-0436 CVE-2025-0437 (bsc#1235892) - Add string_view-incomplete-CodePointIterator.patch to fix build error OBS-URL: https://build.opensuse.org/request/show/1239717 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=188 --- electron-33.3.1.tar.zst | 3 - electron-33.3.2.tar.zst | 3 + nodejs-electron.changes | 14 +++++ nodejs-electron.spec | 10 +-- ...ng_view-incomplete-CodePointIterator.patch | 61 +++++++++++++++++++ 5 files changed, 83 insertions(+), 8 deletions(-) delete mode 100644 electron-33.3.1.tar.zst create mode 100644 electron-33.3.2.tar.zst create mode 100644 string_view-incomplete-CodePointIterator.patch diff --git a/electron-33.3.1.tar.zst b/electron-33.3.1.tar.zst deleted file mode 100644 index 0c5906c..0000000 --- a/electron-33.3.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8e988db1b85ffee080e397cca60b4dd66758a1eb681ca1bf014d5401a3541f3 -size 687262785 diff --git a/electron-33.3.2.tar.zst b/electron-33.3.2.tar.zst new file mode 100644 index 0000000..1861a8b --- /dev/null +++ b/electron-33.3.2.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59b159e1a65872d471ae93838de0e081fc1ebf6aba4c99c1b0fe17f9f1f4b488 +size 687877135 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index a56bf83..558fbed 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed Jan 22 22:41:56 UTC 2025 - Bruno Pitrus + +- New upstream release 33.3.2 + * Updated Chromium to 130.0.6723.191 + * fix yellow background of composition text with wayland text-input-v3 + * The avoidClosingConnections option for session.clearData now properly + defaults to false when the dataTypes option is not set. + * Fixed an issue where drag-dropping two directories would cause + getAsFileSystemHandle to never resolve. + * Fixed a potential crash in chrome.tabs.update(). + * security fixes for CVE-2025-0434 CVE-2025-0436 CVE-2025-0437 (bsc#1235892) +- Add string_view-incomplete-CodePointIterator.patch to fix build error + ------------------------------------------------------------------- Tue Jan 14 18:51:39 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0f7a10f..38e024e 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -201,7 +201,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.3.1 +Version: 33.3.2 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -389,6 +389,7 @@ Patch3182: css_attr_value_tainting-missing-once_flag.patch Patch3183: vtt_scanner-missing-variant.patch Patch3184: electron_usb_delegate-incomplete-UsbDeviceInfo.patch Patch3185: bsc1224178-font-gc.patch +Patch3186: string_view-incomplete-CodePointIterator.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -1195,10 +1196,9 @@ myconf_gn+=" v8_symbol_level=0" %endif %ifarch aarch64 %if %{with lto} -# linker OOM, sorry. -myconf_gn+=' symbol_level=0' -myconf_gn+=' blink_symbol_level=0' -myconf_gn+=' v8_symbol_level=0' +myconf_gn+=' symbol_level=1' +myconf_gn+=' blink_symbol_level=1' +myconf_gn+=' v8_symbol_level=1' %else myconf_gn+=' symbol_level=2' myconf_gn+=' blink_symbol_level=1' diff --git a/string_view-incomplete-CodePointIterator.patch b/string_view-incomplete-CodePointIterator.patch new file mode 100644 index 0000000..17bdf79 --- /dev/null +++ b/string_view-incomplete-CodePointIterator.patch @@ -0,0 +1,61 @@ +In file included from /usr/include/c++/15/string:55, + from /usr/include/c++/15/bits/locale_classes.h:42, + from /usr/include/c++/15/bits/ios_base.h:43, + from /usr/include/c++/15/ios:46, + from /usr/include/c++/15/ostream:42, + from /usr/include/c++/15/bits/unique_ptr.h:43, + from /usr/include/c++/15/memory:80, + from ../../base/check.h:9, + from ../../third_party/blink/renderer/platform/wtf/allocator/allocator.h:8, + from ../../third_party/blink/renderer/platform/wtf/text/atomic_string.h:30: +/usr/include/c++/15/bits/range_access.h: In instantiation of ‘constexpr decltype (__cont.begin()) std::begin(const _Container&) [with _Container = WTF::String; decltype (__cont.begin()) = WTF::CodePointIterator]’: +../../third_party/perfetto/include/perfetto/tracing/traced_value.h:386:25: required by substitution of ‘template typename perfetto::check_traced_value_support()))>::type perfetto::internal::WriteImpl(perfetto::base::priority_tag<1>, perfetto::TracedValue, T&&) [with T = const WTF::String&]’ + 386 | decltype(*std::begin(std::declval()))>::type + | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ +../../third_party/perfetto/include/perfetto/tracing/traced_value.h:427:24: required by substitution of ‘template using perfetto::check_traced_value_support_t = decltype ((perfetto::internal::WriteImpl(std::declval(), std::declval(), declval()), declval())) [with T = const WTF::String&; Result = int]’ + 427 | internal::WriteImpl( + | ~~~~~~~~~~~~~~~~~~~^ + 428 | std::declval>(), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 429 | std::declval(), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 430 | std::declval()), + | ~~~~~~~~~~~~~~~~~~ +../../third_party/perfetto/include/perfetto/tracing/traced_value.h:465:15: required by substitution of ‘template static char (& perfetto::internal::has_traced_value_support::check_support(perfetto::check_traced_value_support_t))[1] [with V = const WTF::String&]’ + 465 | static Yes& check_support(check_traced_value_support_t); + | ^~~~~~~~~~~~~ +../../third_party/perfetto/include/perfetto/tracing/traced_value.h:470:71: required from ‘constexpr const bool perfetto::internal::has_traced_value_support::value’ + 470 | static constexpr bool value = sizeof(Yes) == sizeof(check_support(0)); + | ~~~~~~~~~~~~~~~~~^~~~ +../../third_party/perfetto/include/perfetto/tracing/traced_value.h:480:46: required from ‘void perfetto::WriteIntoTracedValue(TracedValue, T&&) [with T = const WTF::String&]’ + 480 | internal::has_traced_value_support::value, + | ^~~~~ +../../third_party/blink/renderer/platform/wtf/text/atomic_string.cc:127:33: required from here + 127 | perfetto::WriteIntoTracedValue(std::move(context), GetString()); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/usr/include/c++/15/bits/range_access.h:66:67: error: invalid use of incomplete type ‘class WTF::CodePointIterator’ + 66 | begin(const _Container& __cont) noexcept(noexcept(__cont.begin())) + | ~~~~~~~~~~~~^~ +In file included from ../../third_party/blink/renderer/platform/wtf/text/atomic_string.h:35: +../../third_party/blink/renderer/platform/wtf/text/string_view.h:31:7: note: forward declaration of ‘class WTF::CodePointIterator’ + 31 | class CodePointIterator; + | ^~~~~~~~~~~~~~~~~ + +--- src/third_party/blink/renderer/platform/wtf/text/string_view.h.orig 2025-01-22 21:21:43.120141300 +0100 ++++ src/third_party/blink/renderer/platform/wtf/text/string_view.h 2025-01-22 23:39:31.542552700 +0100 +@@ -19,6 +19,7 @@ + #include "third_party/abseil-cpp/absl/base/attributes.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/get_ptr.h" ++#include "third_party/blink/renderer/platform/wtf/text/code_point_iterator.h" + #include "third_party/blink/renderer/platform/wtf/text/string_impl.h" + + #if DCHECK_IS_ON() +@@ -28,7 +29,6 @@ + namespace WTF { + + class AtomicString; +-class CodePointIterator; + class String; + + enum UTF8ConversionMode { -- 2.51.1 From d983b00a7b06e3dc9b44b492865366116269981f7905b2be8be4683bfe00c428 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 6 Feb 2025 21:22:54 +0000 Subject: [PATCH 37/80] Accepting request 1244012 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.0 * Added permission support for document.executeCommand("paste"). * Fixed crash in gin::wrappable::secondweakcallback. OBS-URL: https://build.opensuse.org/request/show/1244012 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=189 --- electron-33.3.2.tar.zst | 3 --- electron-33.4.0.tar.zst | 3 +++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 15 +-------------- 4 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 electron-33.3.2.tar.zst create mode 100644 electron-33.4.0.tar.zst diff --git a/electron-33.3.2.tar.zst b/electron-33.3.2.tar.zst deleted file mode 100644 index 1861a8b..0000000 --- a/electron-33.3.2.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:59b159e1a65872d471ae93838de0e081fc1ebf6aba4c99c1b0fe17f9f1f4b488 -size 687877135 diff --git a/electron-33.4.0.tar.zst b/electron-33.4.0.tar.zst new file mode 100644 index 0000000..bc83b17 --- /dev/null +++ b/electron-33.4.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c39438aef1893efadf3f402687e864d476445c3e1ede57d9859e1bbcc87ec0f +size 687392255 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 558fbed..93d0000 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Feb 6 21:20:53 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.0 + * Added permission support for document.executeCommand("paste"). + * Fixed crash in gin::wrappable::secondweakcallback. + ------------------------------------------------------------------- Wed Jan 22 22:41:56 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 38e024e..9055364 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -201,7 +201,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.3.2 +Version: 33.4.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -999,13 +999,6 @@ export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %endif -%ifarch aarch64 -%if %{with lto} -# Out of memory: Killed process 4016 (lto1-wpa) -export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" -%endif -%endif - #The chromium build process passes lots of .o files directly to the linker instead of using static libraries, #and relies on the linker eliminating unused sections. @@ -1195,16 +1188,10 @@ myconf_gn+=" blink_symbol_level=0" myconf_gn+=" v8_symbol_level=0" %endif %ifarch aarch64 -%if %{with lto} -myconf_gn+=' symbol_level=1' -myconf_gn+=' blink_symbol_level=1' -myconf_gn+=' v8_symbol_level=1' -%else myconf_gn+=' symbol_level=2' myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' %endif -%endif #symbol_level should not affect generated code. myconf_gn+=' enable_stack_trace_line_numbers=true' -- 2.51.1 From 8929d97857b7322fa4ef2a4da1381278fdca2b5cf7b3148d78c495fc82eb94c4 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 13 Feb 2025 11:42:43 +0000 Subject: [PATCH 38/80] Accepting request 1245612 from home:alarrosa:branches:devel:languages:nodejs - Add patch to fix build with pipewire 1.3.82: * fix-building-with-pipewire-1.3.82.patch OBS-URL: https://build.opensuse.org/request/show/1245612 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=190 --- fix-building-with-pipewire-1.3.82.patch | 22 ++++++++++++++++++++++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 1 + 3 files changed, 29 insertions(+) create mode 100644 fix-building-with-pipewire-1.3.82.patch diff --git a/fix-building-with-pipewire-1.3.82.patch b/fix-building-with-pipewire-1.3.82.patch new file mode 100644 index 0000000..72a1b19 --- /dev/null +++ b/fix-building-with-pipewire-1.3.82.patch @@ -0,0 +1,22 @@ +Index: src/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc +=================================================================== +--- src.orig/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc ++++ src/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc +@@ -85,7 +85,7 @@ PipeWireNode::PipeWireNode(PipeWireSessi + .param = OnNodeParam, + }; + +- pw_node_add_listener(proxy_, &node_listener_, &node_events, this); ++ pw_node_add_listener((struct pw_node*)proxy_, &node_listener_, &node_events, this); + } + + // static +@@ -117,7 +117,7 @@ void PipeWireNode::OnNodeInfo(void* data + uint32_t id = info->params[i].id; + if (id == SPA_PARAM_EnumFormat && + info->params[i].flags & SPA_PARAM_INFO_READ) { +- pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); ++ pw_node_enum_params((struct pw_node*)that->proxy_, 0, id, 0, UINT32_MAX, nullptr); + break; + } + } diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 93d0000..1649ce6 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 13 09:28:36 UTC 2025 - Antonio Larrosa + +- Add patch to fix build with pipewire 1.3.82: + * fix-building-with-pipewire-1.3.82.patch + ------------------------------------------------------------------- Thu Feb 6 21:20:53 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 9055364..574e123 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -358,6 +358,7 @@ Patch2059: disable-FFmpegAllowLists.patch Patch2060: chromium-129-disable-H.264-video-parser-during-demuxing.patch Patch2061: private_aggregation_host-uint128.patch Patch2062: wayland_version.patch +Patch2063: fix-building-with-pipewire-1.3.82.patch # PATCHES that should be submitted upstream verbatim or near-verbatim -- 2.51.1 From 3b0efb68e77e2ce93a3c6f1aaeaec42f0c70a4dca0cc7cff996e3b8960136428 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 16 Feb 2025 10:55:17 +0000 Subject: [PATCH 39/80] Accepting request 1246216 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.1 * Fixed crashes on aarch64 with 16KiB pages. * Fixed crash when accessing WebFrameMain frames and name attributes on destroyed frames. - Fedora 42+: use bundled vk_mem_alloc again to fix build error OBS-URL: https://build.opensuse.org/request/show/1246216 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=191 --- electron-33.4.0.tar.zst | 3 --- electron-33.4.1.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 10 +++++++--- 4 files changed, 18 insertions(+), 6 deletions(-) delete mode 100644 electron-33.4.0.tar.zst create mode 100644 electron-33.4.1.tar.zst diff --git a/electron-33.4.0.tar.zst b/electron-33.4.0.tar.zst deleted file mode 100644 index bc83b17..0000000 --- a/electron-33.4.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7c39438aef1893efadf3f402687e864d476445c3e1ede57d9859e1bbcc87ec0f -size 687392255 diff --git a/electron-33.4.1.tar.zst b/electron-33.4.1.tar.zst new file mode 100644 index 0000000..bb9b735 --- /dev/null +++ b/electron-33.4.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8af19b329b51fff55ac4ff61bbc4ad7c8413d1285296341a2cdb5d21def78e38 +size 687653317 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 1649ce6..a30a67f 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Feb 16 10:53:13 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.1 + * Fixed crashes on aarch64 with 16KiB pages. + * Fixed crash when accessing WebFrameMain frames and name attributes on destroyed frames. +- Fedora 42+: use bundled vk_mem_alloc again to fix build error + ------------------------------------------------------------------- Thu Feb 13 09:28:36 UTC 2025 - Antonio Larrosa diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 574e123..8975333 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -132,10 +132,8 @@ ExcludeArch: %arm %if 0%{?fedora} -%bcond_without system_vma %bcond_without system_ada %else -%bcond_with system_vma %bcond_with system_ada %endif @@ -147,6 +145,12 @@ ExcludeArch: %arm %bcond_with system_simdutf %endif +%if 0%{?fedora} && 0%{?fedora} < 42 +%bcond_without system_vma +%else +%bcond_with system_vma +%endif + #requires `imageSequenceTrackPresent` and `enableParsingGainMapMetadata` both of which are only in post-1.0.0 nightlies %bcond_with system_avif @@ -201,7 +205,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.0 +Version: 33.4.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 9df379feebd57dcb734d1d51599cb3f72162d3baf42f4976a272bc877d907a4f Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 27 Feb 2025 19:59:14 +0000 Subject: [PATCH 40/80] Accepting request 1249082 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.2 * Updated Node.js to v20.18.3 * Backported fix for a upstream bug that cause Offscreen Rendering to stutter. * Fixed WebFrameMain crash related to accessing speculative frames that have been destroyed. * Fixed v8.setHeapSnapshotNearHeapLimit api in main and utility process, along with support for --diagnostic-dir Node.js cli flag to specify the directory to save the heap snapshots. * Security fixes for V8: CVE-2025-0611 CVE-2025-0612 CVE-2025-0999. (bsc#1236306 bsc#1237343) - 15.6: revert upstream changes to build with c-ares 1.19 * node-cares-1.21.patch OBS-URL: https://build.opensuse.org/request/show/1249082 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=192 --- electron-33.4.1.tar.zst | 3 - electron-33.4.2.tar.zst | 3 + node-cares-1.21.patch | 155 ++++++++++++++++++++++++++++++++++++++++ nodejs-electron.changes | 13 ++++ nodejs-electron.spec | 13 +++- 5 files changed, 182 insertions(+), 5 deletions(-) delete mode 100644 electron-33.4.1.tar.zst create mode 100644 electron-33.4.2.tar.zst create mode 100644 node-cares-1.21.patch diff --git a/electron-33.4.1.tar.zst b/electron-33.4.1.tar.zst deleted file mode 100644 index bb9b735..0000000 --- a/electron-33.4.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8af19b329b51fff55ac4ff61bbc4ad7c8413d1285296341a2cdb5d21def78e38 -size 687653317 diff --git a/electron-33.4.2.tar.zst b/electron-33.4.2.tar.zst new file mode 100644 index 0000000..17c95ef --- /dev/null +++ b/electron-33.4.2.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81305945689d6851d6c1c254306bdccd08b5785d1ebf4946c9570afe5bfaddb1 +size 687306018 diff --git a/node-cares-1.21.patch b/node-cares-1.21.patch new file mode 100644 index 0000000..8d3096b --- /dev/null +++ b/node-cares-1.21.patch @@ -0,0 +1,155 @@ +From 8807549ed9f6eaf6842ae56b8ac55ab385951636 Mon Sep 17 00:00:00 2001 +From: Aviv Keller +Date: Wed, 30 Oct 2024 10:10:28 -0400 +Subject: [PATCH] dns: stop using deprecated `ares_query` + +PR-URL: https://github.com/nodejs/node/pull/55430 +Refs: https://github.com/nodejs/node/issues/52464 +Reviewed-By: Luigi Pinca +Reviewed-By: Matteo Collina +--- + src/cares_wrap.cc | 24 ++++++++++++------------ + src/cares_wrap.h | 35 +++++++++++++++++++---------------- + 2 files changed, 31 insertions(+), 28 deletions(-) + +diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc +index ac79eeaaf7b150..84d2ab2b065e5d 100644 +--- a/third_party/electron_node/src/cares_wrap.cc ++++ b/third_party/electron_node/src/cares_wrap.cc +@@ -830,62 +830,62 @@ void ChannelWrap::EnsureServers() { + } + + int AnyTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_any); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_ANY); + return ARES_SUCCESS; + } + + int ATraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_a); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_A); + return ARES_SUCCESS; + } + + int AaaaTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_aaaa); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_AAAA); + return ARES_SUCCESS; + } + + int CaaTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, T_CAA); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_CAA); + return ARES_SUCCESS; + } + + int CnameTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_cname); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_CNAME); + return ARES_SUCCESS; + } + + int MxTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_mx); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_MX); + return ARES_SUCCESS; + } + + int NsTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_ns); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_NS); + return ARES_SUCCESS; + } + + int TxtTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_txt); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_TXT); + return ARES_SUCCESS; + } + + int SrvTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_srv); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_SRV); + return ARES_SUCCESS; + } + + int PtrTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_ptr); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_PTR); + return ARES_SUCCESS; + } + + int NaptrTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_naptr); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_NAPTR); + return ARES_SUCCESS; + } + + int SoaTraits::Send(QueryWrap* wrap, const char* name) { +- wrap->AresQuery(name, ns_c_in, ns_t_soa); ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_SOA); + return ARES_SUCCESS; + } + +diff --git a/src/cares_wrap.h b/src/cares_wrap.h +index 021ef1c9de518e..4a5d22c0ef085f 100644 +--- a/third_party/electron_node/src/cares_wrap.h ++++ b/third_party/electron_node/src/cares_wrap.h +@@ -246,18 +246,20 @@ class QueryWrap final : public AsyncWrap { + return Traits::Send(this, name); + } + +- void AresQuery(const char* name, int dnsclass, int type) { ++ void AresQuery(const char* name, ++ ares_dns_class_t dnsclass, ++ ares_dns_rec_type_t type) { + channel_->EnsureServers(); + TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( + TRACING_CATEGORY_NODE2(dns, native), trace_name_, this, + "name", TRACE_STR_COPY(name)); +- ares_query( +- channel_->cares_channel(), +- name, +- dnsclass, +- type, +- Callback, +- MakeCallbackPointer()); ++ ares_query_dnsrec(channel_->cares_channel(), ++ name, ++ dnsclass, ++ type, ++ Callback, ++ MakeCallbackPointer(), ++ nullptr); + } + + void ParseError(int status) { +@@ -304,19 +306,20 @@ class QueryWrap final : public AsyncWrap { + return wrap; + } + +- static void Callback( +- void* arg, +- int status, +- int timeouts, +- unsigned char* answer_buf, +- int answer_len) { ++ static void Callback(void* arg, ++ ares_status_t status, ++ size_t timeouts, ++ const ares_dns_record_t* dnsrec) { + QueryWrap* wrap = FromCallbackPointer(arg); + if (wrap == nullptr) return; + + unsigned char* buf_copy = nullptr; ++ size_t answer_len = 0; + if (status == ARES_SUCCESS) { +- buf_copy = node::Malloc(answer_len); +- memcpy(buf_copy, answer_buf, answer_len); ++ // No need to explicitly call ares_free_string here, ++ // as it is a wrapper around free, which is already ++ // invoked when MallocedBuffer is destructed. ++ ares_dns_write(dnsrec, &buf_copy, &answer_len); + } + + wrap->response_data_ = std::make_unique(); diff --git a/nodejs-electron.changes b/nodejs-electron.changes index a30a67f..7715652 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Feb 27 19:50:15 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.2 + * Updated Node.js to v20.18.3 + * Backported fix for a upstream bug that cause Offscreen Rendering to stutter. + * Fixed WebFrameMain crash related to accessing speculative frames that have been destroyed. + * Fixed v8.setHeapSnapshotNearHeapLimit api in main and utility process, + along with support for --diagnostic-dir Node.js cli flag to specify the directory to save the heap snapshots. + * Security fixes for V8: CVE-2025-0611 CVE-2025-0612 CVE-2025-0999. (bsc#1236306 bsc#1237343) +- 15.6: revert upstream changes to build with c-ares 1.19 + * node-cares-1.21.patch + ------------------------------------------------------------------- Sun Feb 16 10:53:13 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 8975333..c852401 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -111,12 +111,14 @@ ExcludeArch: %arm %bcond_without ffmpeg_6 %bcond_without wayland_34 %bcond_without system_vk_headers +%bcond_without cares_21 %else %bcond_with system_vpx %bcond_with bro_11 %bcond_with ffmpeg_6 %bcond_with wayland_34 %bcond_with system_vk_headers +%bcond_with cares_21 %endif @@ -205,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.1 +Version: 33.4.2 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -234,6 +236,8 @@ Source421: wayland-protocol-toplevel-icon-2.patch Source422: wayland-protocol-toplevel-drag.patch # and abseil 2401 Source460: quiche-absl-HexStringToBytes.patch +# and c-ares 1.19 +Source470: node-cares-1.21.patch @@ -402,8 +406,9 @@ Patch5000: more-locales.patch Patch5006: chromium-vaapi.patch BuildRequires: brotli -%if %{with system_cares} BuildRequires: c-ares-devel +%if %{with cares_21} +BuildRequires: c-ares-devel >= 1.21 %endif BuildRequires: cmake(Crc32c) BuildRequires: double-conversion-devel @@ -759,6 +764,10 @@ patch -R -p1 < %SOURCE421 patch -R -p1 < %SOURCE420 %endif +%if %{without cares_21} +patch -R -p1 < %SOURCE470 +%endif + %if %{with ffmpeg_6} -- 2.51.1 From bf8a27cc470dac225a596161b2efad6499831c90be1dd0a597e1f6316c3bc1cb Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 9 Mar 2025 21:51:59 +0000 Subject: [PATCH 41/80] Accepting request 1251577 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.3 * Fix use after free in V8 CVE-2025-0445 (bsc#1236806) * Other security fixes for V8: CVE-2025-0995 CVE-2025-0998 (bsc#1237121) OBS-URL: https://build.opensuse.org/request/show/1251577 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=193 --- electron-16-system-node-headers.patch | 8 ++++---- electron-33.4.2.tar.zst | 3 --- electron-33.4.3.tar.zst | 3 +++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) delete mode 100644 electron-33.4.2.tar.zst create mode 100644 electron-33.4.3.tar.zst diff --git a/electron-16-system-node-headers.patch b/electron-16-system-node-headers.patch index 80106bc..875fec5 100644 --- a/electron-16-system-node-headers.patch +++ b/electron-16-system-node-headers.patch @@ -1,9 +1,9 @@ Index: electron-17.1.0/third_party/electron_node/common.gypi =================================================================== ---- electron-17.1.0.orig/third_party/electron_node/common.gypi 2022-03-07 17:39:13.557371769 +0100 -+++ electron-17.1.0/third_party/electron_node/common.gypi 2022-03-09 08:29:08.214665848 +0100 -@@ -405,6 +405,10 @@ - 'BUILDING_UV_SHARED=1', +--- src/third_party/electron_node/common.gypi.orig 2025-03-06 22:25:15.650295769 +0100 ++++ src/third_party/electron_node/common.gypi 2025-03-07 07:06:10.532421547 +0100 +@@ -486,6 +486,10 @@ + 'NOMINMAX', ], }], + [ 'OS in "linux"', { diff --git a/electron-33.4.2.tar.zst b/electron-33.4.2.tar.zst deleted file mode 100644 index 17c95ef..0000000 --- a/electron-33.4.2.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81305945689d6851d6c1c254306bdccd08b5785d1ebf4946c9570afe5bfaddb1 -size 687306018 diff --git a/electron-33.4.3.tar.zst b/electron-33.4.3.tar.zst new file mode 100644 index 0000000..1ead261 --- /dev/null +++ b/electron-33.4.3.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:818091e6e6189e072d104632c7ff8aae4a6016e7c132488bc9c191894d9b9856 +size 687402532 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 7715652..87e353b 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Mar 9 21:47:42 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.3 + * Fix use after free in V8 CVE-2025-0445 (bsc#1236806) + * Other security fixes for V8: CVE-2025-0995 CVE-2025-0998 (bsc#1237121) + ------------------------------------------------------------------- Thu Feb 27 19:50:15 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index c852401..c30c22f 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.2 +Version: 33.4.3 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -1062,7 +1062,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=3 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" -- 2.51.1 From be950d80905a89b87bf552b4e01d02122b6d274e0ff450db28d88764f4c140e7 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 10 Mar 2025 10:15:57 +0000 Subject: [PATCH 42/80] Accepting request 1251741 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.4 * no user-visible changes OBS-URL: https://build.opensuse.org/request/show/1251741 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=194 --- electron-33.4.3.tar.zst | 3 --- electron-33.4.4.tar.zst | 3 +++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 electron-33.4.3.tar.zst create mode 100644 electron-33.4.4.tar.zst diff --git a/electron-33.4.3.tar.zst b/electron-33.4.3.tar.zst deleted file mode 100644 index 1ead261..0000000 --- a/electron-33.4.3.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:818091e6e6189e072d104632c7ff8aae4a6016e7c132488bc9c191894d9b9856 -size 687402532 diff --git a/electron-33.4.4.tar.zst b/electron-33.4.4.tar.zst new file mode 100644 index 0000000..3000c16 --- /dev/null +++ b/electron-33.4.4.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b9fdea5066bbe56d62600523ab1fd0daeb71a02f8d8e5e0536563915b5c396b +size 687705461 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 87e353b..4f7c10f 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 10 05:45:21 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.4 + * no user-visible changes + ------------------------------------------------------------------- Sun Mar 9 21:47:42 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index c30c22f..d5fa3c1 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.3 +Version: 33.4.4 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 1506ad6934f9ed600b65cbfa38b8134af2a86d752ff1b2d5f7a1c6ba56e20600 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 14 Mar 2025 06:47:06 +0000 Subject: [PATCH 43/80] Accepting request 1252970 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.5 * no user-visible changes OBS-URL: https://build.opensuse.org/request/show/1252970 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=195 --- electron-33.4.4.tar.zst | 3 --- electron-33.4.5.tar.zst | 3 +++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 electron-33.4.4.tar.zst create mode 100644 electron-33.4.5.tar.zst diff --git a/electron-33.4.4.tar.zst b/electron-33.4.4.tar.zst deleted file mode 100644 index 3000c16..0000000 --- a/electron-33.4.4.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2b9fdea5066bbe56d62600523ab1fd0daeb71a02f8d8e5e0536563915b5c396b -size 687705461 diff --git a/electron-33.4.5.tar.zst b/electron-33.4.5.tar.zst new file mode 100644 index 0000000..7c82fc0 --- /dev/null +++ b/electron-33.4.5.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c2a725effec028976b8ef0b3bd237fdc6f731e23c7ab105c07a21021826304f +size 687849513 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 4f7c10f..5c2b989 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 13 19:58:07 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.5 + * no user-visible changes + ------------------------------------------------------------------- Mon Mar 10 05:45:21 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index d5fa3c1..4a8ac1b 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.4 +Version: 33.4.5 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From bf22ec9f4dcd1087d5218a223148216bfbd38349c1b6223356d0561839117a75 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 20 Mar 2025 12:53:28 +0000 Subject: [PATCH 44/80] Accepting request 1254724 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.6 * Fixed incorrect titlebar in file save dialogs * Fix type confusion in V8 (CVE-2025-1920 bsc#1239216) - Drop chromium-94-ffmpeg-roll.patch to fix ftbfs on Leap OBS-URL: https://build.opensuse.org/request/show/1254724 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=196 --- chromium-94-ffmpeg-roll.patch | 12 ------------ electron-33.4.5.tar.zst | 3 --- electron-33.4.6.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 11 ++--------- 5 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 chromium-94-ffmpeg-roll.patch delete mode 100644 electron-33.4.5.tar.zst create mode 100644 electron-33.4.6.tar.zst diff --git a/chromium-94-ffmpeg-roll.patch b/chromium-94-ffmpeg-roll.patch deleted file mode 100644 index 7878a01..0000000 --- a/chromium-94-ffmpeg-roll.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn -index 16e20744706..6a079b32221 100644 ---- a/build/linux/unbundle/ffmpeg.gn -+++ b/build/linux/unbundle/ffmpeg.gn -@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") { - "libavformat", - "libavutil", - ] -+ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ] - } - - buildflag_header("ffmpeg_features") { diff --git a/electron-33.4.5.tar.zst b/electron-33.4.5.tar.zst deleted file mode 100644 index 7c82fc0..0000000 --- a/electron-33.4.5.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c2a725effec028976b8ef0b3bd237fdc6f731e23c7ab105c07a21021826304f -size 687849513 diff --git a/electron-33.4.6.tar.zst b/electron-33.4.6.tar.zst new file mode 100644 index 0000000..a090b6c --- /dev/null +++ b/electron-33.4.6.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:968d88a4b326e51ad509e4fde91a8c4ffee1c0e84ca8a0c3b58c2e51d2f4ede0 +size 691743471 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 5c2b989..5735703 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Mar 20 10:47:25 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.6 + * Fixed incorrect titlebar in file save dialogs + * Fix type confusion in V8 (CVE-2025-1920 bsc#1239216) +- Drop chromium-94-ffmpeg-roll.patch to fix ftbfs on Leap + ------------------------------------------------------------------- Thu Mar 13 19:58:07 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 4a8ac1b..0b79331 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.5 +Version: 33.4.6 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -329,11 +329,6 @@ Patch1090: cr130-absl-base.patch # PATCHES to fix interaction with third-party software Patch2010: chromium-93-ffmpeg-4.4.patch -#Since ffmpeg 5, there is no longer first_dts member in AVFormat. Chromium upstream (and Tumbleweed) patches ffmpeg to add a av_stream_get_first_dts function. -#Upstream ref: https://chromium-review.googlesource.com/c/chromium/src/+/3525614 -#This patch is only for Leap which uses ffmpeg 4. It makes chromium use the old api and does not work with ffmpeg 5. -Patch2012: chromium-94-ffmpeg-roll.patch - # Fixe builds with older clang versions that do not allow # nomerge attributes on declaration. Otherwise, the following error # is produced: @@ -770,9 +765,7 @@ patch -R -p1 < %SOURCE470 -%if %{with ffmpeg_6} -patch -R -p1 < %PATCH2012 -%else +%if %{without ffmpeg_6} patch -R -p1 < %SOURCE403 patch -R -p1 < %SOURCE402 patch -R -p1 < %SOURCE400 -- 2.51.1 From 0bbca7d8daa490185fa80374a0f4aae5b87147e31ddbda22426be7d65d2cab98 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 27 Mar 2025 10:21:11 +0000 Subject: [PATCH 45/80] Accepting request 1256427 from home:dziobian:gulgul-ultron:19 - New upsatream release 33.4.7 * Fixed an issue where the resizing border didn't work as expected on Wayland windows OBS-URL: https://build.opensuse.org/request/show/1256427 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=197 --- electron-33.4.6.tar.zst | 3 --- electron-33.4.7.tar.zst | 3 +++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 electron-33.4.6.tar.zst create mode 100644 electron-33.4.7.tar.zst diff --git a/electron-33.4.6.tar.zst b/electron-33.4.6.tar.zst deleted file mode 100644 index a090b6c..0000000 --- a/electron-33.4.6.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:968d88a4b326e51ad509e4fde91a8c4ffee1c0e84ca8a0c3b58c2e51d2f4ede0 -size 691743471 diff --git a/electron-33.4.7.tar.zst b/electron-33.4.7.tar.zst new file mode 100644 index 0000000..216fa74 --- /dev/null +++ b/electron-33.4.7.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29a6b2d95c93127b8b339c05bc0777e073384e894a21795fcddd615aa99f8431 +size 688246617 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 5735703..bcf2626 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 27 10:19:49 UTC 2025 - Bruno Pitrus + +- New upsatream release 33.4.7 + * Fixed an issue where the resizing border didn't work as expected on Wayland windows + ------------------------------------------------------------------- Thu Mar 20 10:47:25 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 0b79331..b154303 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.6 +Version: 33.4.7 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From e5df81258e10027e217da97c0377fc50da9a374cf01de3c30131e9f388e18533 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 27 Mar 2025 10:22:13 +0000 Subject: [PATCH 46/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=198 --- nodejs-electron.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index bcf2626..d9f3026 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Thu Mar 27 10:19:49 UTC 2025 - Bruno Pitrus -- New upsatream release 33.4.7 +- New upstream release 33.4.7 * Fixed an issue where the resizing border didn't work as expected on Wayland windows ------------------------------------------------------------------- -- 2.51.1 From 9d3e221bdc50b697667ab2f79cde2f09139ddea97a2dccefa2bb8d4a36465afd Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 10 Apr 2025 09:33:30 +0000 Subject: [PATCH 47/80] Accepting request 1268351 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.8 * No user-visible changes - Add swiftshader-llvm20-absoluteSymbols.patch to fix FTBFS on aarch64 OBS-URL: https://build.opensuse.org/request/show/1268351 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=199 --- electron-33.4.7.tar.zst | 3 --- electron-33.4.9.tar.zst | 3 +++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 3 ++- swiftshader-llvm20-absoluteSymbols.patch | 14 ++++++++++++++ 5 files changed, 26 insertions(+), 4 deletions(-) delete mode 100644 electron-33.4.7.tar.zst create mode 100644 electron-33.4.9.tar.zst create mode 100644 swiftshader-llvm20-absoluteSymbols.patch diff --git a/electron-33.4.7.tar.zst b/electron-33.4.7.tar.zst deleted file mode 100644 index 216fa74..0000000 --- a/electron-33.4.7.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29a6b2d95c93127b8b339c05bc0777e073384e894a21795fcddd615aa99f8431 -size 688246617 diff --git a/electron-33.4.9.tar.zst b/electron-33.4.9.tar.zst new file mode 100644 index 0000000..7340e09 --- /dev/null +++ b/electron-33.4.9.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:085d0b2133b4aab994c7390739927d07a54278408822f1bdfd7da994b82324ae +size 688412702 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index d9f3026..44f1873 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 9 18:46:20 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.8 + * No user-visible changes +- Add swiftshader-llvm20-absoluteSymbols.patch to fix FTBFS on aarch64 + ------------------------------------------------------------------- Thu Mar 27 10:19:49 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index b154303..c27ea85 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.7 +Version: 33.4.9 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -394,6 +394,7 @@ Patch3183: vtt_scanner-missing-variant.patch Patch3184: electron_usb_delegate-incomplete-UsbDeviceInfo.patch Patch3185: bsc1224178-font-gc.patch Patch3186: string_view-incomplete-CodePointIterator.patch +Patch3187: swiftshader-llvm20-absoluteSymbols.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. diff --git a/swiftshader-llvm20-absoluteSymbols.patch b/swiftshader-llvm20-absoluteSymbols.patch new file mode 100644 index 0000000..ba70a30 --- /dev/null +++ b/swiftshader-llvm20-absoluteSymbols.patch @@ -0,0 +1,14 @@ +--- src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp.orig 2025-04-09 20:33:23.551038841 +0200 ++++ src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 2025-04-09 21:13:20.546410219 +0200 +@@ -73,6 +73,11 @@ __pragma(warning(push)) + # include "llvm/Transforms/IPO.h" + #endif + ++ ++#if LLVM_VERSION_MAJOR >= 20 // https://github.com/llvm/llvm-project/commit/dc11c0601577afb8f67513d041ee25dabe3555b9 ++#include "llvm/ExecutionEngine/Orc/AbsoluteSymbols.h" ++#endif ++ + #ifdef _MSC_VER + __pragma(warning(pop)) + #endif -- 2.51.1 From f22e84d060b064c6ef76fbd02ed8da8476423a59db1fd54be7b8fd8100d3f8b9 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 10 Apr 2025 09:33:59 +0000 Subject: [PATCH 48/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=200 --- nodejs-electron.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 44f1873..26de73f 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Wed Apr 9 18:46:20 UTC 2025 - Bruno Pitrus -- New upstream release 33.4.8 +- New upstream release 33.4.9 * No user-visible changes - Add swiftshader-llvm20-absoluteSymbols.patch to fix FTBFS on aarch64 -- 2.51.1 From 096668bf3484048a1f3a51ccc70b0ddc8cd1aa5cbafe8ce3406afcb0b5936485 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sun, 20 Apr 2025 16:07:52 +0000 Subject: [PATCH 49/80] Accepting request 1271080 from home:dziobian:gulgul-ultron:19 - New upstream release 33.4.10 * Fixed ElectronAccessibilityUI bug. * Fixed an inverted conditional that caused broken window borders on Wayland. OBS-URL: https://build.opensuse.org/request/show/1271080 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=201 --- electron-33.4.10.tar.zst | 3 +++ electron-33.4.9.tar.zst | 3 --- nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 electron-33.4.10.tar.zst delete mode 100644 electron-33.4.9.tar.zst diff --git a/electron-33.4.10.tar.zst b/electron-33.4.10.tar.zst new file mode 100644 index 0000000..d3194b5 --- /dev/null +++ b/electron-33.4.10.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cea37fe7429268baea5169fde8341775d510c1a2450d924fe85315d58b14cfb7 +size 691226562 diff --git a/electron-33.4.9.tar.zst b/electron-33.4.9.tar.zst deleted file mode 100644 index 7340e09..0000000 --- a/electron-33.4.9.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:085d0b2133b4aab994c7390739927d07a54278408822f1bdfd7da994b82324ae -size 688412702 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 26de73f..a10b2f3 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Apr 19 08:45:19 UTC 2025 - Bruno Pitrus + +- New upstream release 33.4.10 + * Fixed ElectronAccessibilityUI bug. + * Fixed an inverted conditional that caused broken window borders on Wayland. + ------------------------------------------------------------------- Wed Apr 9 18:46:20 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index c27ea85..88002e9 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -207,7 +207,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.9 +Version: 33.4.10 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -1056,7 +1056,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=3 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=6 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" -- 2.51.1 From bfff7443fb3df6c31aa48a462421c988f12df93b1d60e321d26aac5be8967be5 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 26 Apr 2025 10:14:41 +0000 Subject: [PATCH 50/80] Accepting request 1272836 from home:dziobian:gulgul-ultron:19 - Update to 35.2.1 * Chromium 134.0.6998.205 * Node 22.14.0 * V8 13.4 * Removed AVIF image format * Added excludeUrls to webRequest filter and deprecated the use of empty arrays in urls property. * Added fromVersionID on ServiceWorkers to get an instance of ServiceWorkerMain. * Deprecated getPreloads and setPreloads on Session. * Moved 'console-message' arguments into event object. * Added ServiceWorkerMain class to interact with service workers in the main process. * Added contextBridge.executeInMainWorld to safely execute code across world boundaries. * Added frame to 'console-message' event. * Added optional animation parameter to BrowserWindow.setVibrancy. * Added permission support for document.executeCommand("paste"). * Added support for service worker preload scripts. * Support Portal's globalShortcuts. Electron must be run with --enable-features=GlobalShortcutsPortal in order to have the feature working. * see https://github.com/electron/electron/releases/tag/v35.0.0 and https://www.electronjs.org/blog/electron-35-0 for more - Remove Fedora 40 support * drop bundled-minizip.patch * drop quiche-absl-HexStringToBytes.patch - Leap 15.6: use backported wayland-protocols * drop wayland-protocol-toplevel-icon.patch * drop wayland-protocol-toplevel-icon-2.patch * drop wayland-protocol-toplevel-drag.patch - Build with LTO also on 15.6 (so now we enable it everywhere) - Fedora: use system simdjson * merge system-ada-url.patch into use-system-libraries-in-node.patch - Drop no longer applicable patches * account_id-missing-optional.patch * blink-platform-INSIDE_BLINK-Wodr.patch * boringssl-internal-addc-cxx.patch * build-without-extensions.patch * css_attr_value_tainting-missing-once_flag.patch * electron-13-fix-base-check-nomerge.patch * exception_context-missing-variant.patch * fix-build-without-safebrowsing.patch * fix-build-without-service-discovery.patch * ip_protection_data_types-missing-optional.patch * node-compiler.patch * skia_image_decoder_base-missing-stack.patch * vtt_scanner-missing-variant.patch * wayland_connection-Wchanges-meaning.patch - Add backported or upstreamable patches * ax_platform_node_id-fpermissive.patch * browser_process_impl-fix-safe_browsing_mode-0.patch * content_browser_client-incomplete-WebUIController.patch * css_shape_value-constructor.patch * exception_state-constexpr-initializer.patch * fix-build-without-pdf.patch * fix-build-without-video-effects.patch * media_session_uma_helper-missing-optional.patch * object_paint_properties-explicit-specialization-in-non-namespace-scope.patch * perfetto-ThreadTrack-Current-null-dereference.patch * picture_in_picture_window_manager_uma_helper-missing-optional.patch * plugin_utils-build-without-electron_extensions.patch * raw_ptr-fpermissive.patch * resource_response-Wchanges-meaning.patch * resource-Wchanges-meaning.patch * string-hasher-flax-vector-conversions.patch * string_truncator-convert.patch * style_scope-unqualified-To.patch * to_vector-std-projected-gcc119888.patch * unexportable_key_service_impl-Wlto-type-mismatch.patch * xml_document_parser-Wmissing-template-keyword.patch - merge remove-libphonenumber.patch & delete-old-language-detection-which-uses-tflite.patch into remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch - Revert upstream change which breaks build with old abseil * webrtc-make_ref_counted-absl2024-nullability.patch - Conditionally (15.6) remove feature change which needs new spirv * angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch - Use system sqlite in node (except 15.6) * system-sqlite.patch - Remove more rust code * chromium-132-no-rust.patch - Actually disable AVIF support without disabling AV1 video * disable-avif-really.patch - Various other build fixes * absl_strings-missing-headers.patch * blink-shape_result-highway.patch * build-without-mesage-center.patch * fix-system-highway.patch * gn-logspam-breaks-install.patch * permission-gcc14.2.patch OBS-URL: https://build.opensuse.org/request/show/1272836 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=202 --- Cr122-ffmpeg-new-channel-layout.patch | 4 +- MakeSbixTypeface-null-pointer-call.patch | 10 +- absl_strings-missing-headers.patch | 40 + ..._BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch | 62 ++ ax_platform_node_id-fpermissive.patch | 12 + base-system-nspr.patch | 10 +- blink-shape_result-highway.patch | 16 + ...rocess_impl-fix-safe_browsing_mode-0.patch | 45 + build-without-mesage-center.patch | 10 + build-without-speech-service.patch | 4 +- chromium-102-compiler.patch | 58 +- chromium-127-crabby.patch | 75 +- ...e-H.264-video-parser-during-demuxing.patch | 36 +- chromium-130-fontations.patch | 69 +- chromium-132-no-rust.patch | 290 +++++++ chromium-93-ffmpeg-4.4.patch | 40 +- chromium-vaapi.patch | 52 +- common.gypi-compiler.patch | 17 +- ...er_client-incomplete-WebUIController.patch | 10 + cr130-abseil-remove-unused-deps.patch | 36 +- create_tarball.sh | 15 +- css_shape_value-constructor.patch | 11 + ...language-detection-which-uses-tflite.patch | 119 --- disable-FFmpegAllowLists.patch | 23 +- disable-avif-really.patch | 39 + disable-catapult.patch | 30 +- disable-webspeech.patch | 29 +- electron-33.4.10.tar.zst | 3 - electron-35.2.1.tar.zst | 3 + exception_state-constexpr-initializer.patch | 15 + fix-build-without-pdf.patch | 19 + fix-build-without-screen-ai.patch | 90 +- fix-build-without-supervised-users.patch | 6 +- fix-build-without-video-effects.patch | 40 + fix-system-highway.patch | 8 + fpic.patch | 10 +- gn-logspam-breaks-install.patch | 21 + ...pecialization-in-non-namespace-scope.patch | 26 + ..._session_uma_helper-missing-optional.patch | 35 + no-zlib-headers.patch | 16 +- nodejs-electron.spec | 254 +++--- ...pecialization-in-non-namespace-scope.patch | 99 +++ ...ThreadTrack-Current-null-dereference.patch | 42 + permission-gcc14.2.patch | 13 + ..._manager_uma_helper-missing-optional.patch | 35 + ...ls-build-without-electron_extensions.patch | 20 + private_aggregation_host-uint128.patch | 28 +- raw_ptr-fpermissive.patch | 48 + ...h-requires-tflite-and-libphonenumber.patch | 373 ++++++++ remove-dawn.patch | 12 +- remove-libphonenumber.patch | 22 - remove-password-manager-and-policy.patch | 106 +-- remove-rust.patch | 44 +- remove-sync.patch | 65 +- resource-Wchanges-meaning.patch | 11 + resource_response-Wchanges-meaning.patch | 11 + string-hasher-flax-vector-conversions.patch | 23 + string_truncator-convert.patch | 20 + ...ng_view-incomplete-CodePointIterator.patch | 8 +- style_scope-unqualified-To.patch | 11 + system-ada-url.patch | 49 +- system-gtest.patch | 100 +-- system-libdrm.patch | 8 +- system-pydeps.patch | 19 +- system-simdutf.patch | 87 +- system-sqlite.patch | 50 ++ to_vector-std-projected-gcc119888.patch | 11 + ..._key_service_impl-Wlto-type-mismatch.patch | 32 + use-system-libraries-in-node.patch | 138 +++ v8-macro-assembler-riscv-leaptiering.patch | 818 ++++++++++++++++++ ...ake_ref_counted-absl2024-nullability.patch | 30 + ...ent_parser-Wmissing-template-keyword.patch | 13 + 72 files changed, 3252 insertions(+), 802 deletions(-) create mode 100644 absl_strings-missing-headers.patch create mode 100644 angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch create mode 100644 ax_platform_node_id-fpermissive.patch create mode 100644 blink-shape_result-highway.patch create mode 100644 browser_process_impl-fix-safe_browsing_mode-0.patch create mode 100644 build-without-mesage-center.patch create mode 100644 chromium-132-no-rust.patch create mode 100644 content_browser_client-incomplete-WebUIController.patch create mode 100644 css_shape_value-constructor.patch create mode 100644 disable-avif-really.patch delete mode 100644 electron-33.4.10.tar.zst create mode 100644 electron-35.2.1.tar.zst create mode 100644 exception_state-constexpr-initializer.patch create mode 100644 fix-build-without-pdf.patch create mode 100644 fix-build-without-video-effects.patch create mode 100644 fix-system-highway.patch create mode 100644 gn-logspam-breaks-install.patch create mode 100644 macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch create mode 100644 media_session_uma_helper-missing-optional.patch create mode 100644 object_paint_properties-explicit-specialization-in-non-namespace-scope.patch create mode 100644 perfetto-ThreadTrack-Current-null-dereference.patch create mode 100644 permission-gcc14.2.patch create mode 100644 picture_in_picture_window_manager_uma_helper-missing-optional.patch create mode 100644 plugin_utils-build-without-electron_extensions.patch create mode 100644 raw_ptr-fpermissive.patch create mode 100644 remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch delete mode 100644 remove-libphonenumber.patch create mode 100644 resource-Wchanges-meaning.patch create mode 100644 resource_response-Wchanges-meaning.patch create mode 100644 string-hasher-flax-vector-conversions.patch create mode 100644 string_truncator-convert.patch create mode 100644 style_scope-unqualified-To.patch create mode 100644 system-sqlite.patch create mode 100644 to_vector-std-projected-gcc119888.patch create mode 100644 unexportable_key_service_impl-Wlto-type-mismatch.patch create mode 100644 use-system-libraries-in-node.patch create mode 100644 v8-macro-assembler-riscv-leaptiering.patch create mode 100644 webrtc-make_ref_counted-absl2024-nullability.patch create mode 100644 xml_document_parser-Wmissing-template-keyword.patch diff --git a/Cr122-ffmpeg-new-channel-layout.patch b/Cr122-ffmpeg-new-channel-layout.patch index 4b450d6..b7dc4d8 100644 --- a/Cr122-ffmpeg-new-channel-layout.patch +++ b/Cr122-ffmpeg-new-channel-layout.patch @@ -271,7 +271,7 @@ index 3c97e4a6cf4c7..a55e4ab51d5b3 100644 - // Treat dolby vision contents as dolby vision codec only if the - // device support clear DV decoding, otherwise use the original - // HEVC or AVC codec and profile. -- if (media::IsSupportedVideoType(type)) { +- if (media::IsDecoderSupportedVideoType(type)) { - codec = type.codec; - profile = type.profile; - } @@ -307,7 +307,7 @@ index 3c97e4a6cf4c7..a55e4ab51d5b3 100644 + // Treat dolby vision contents as dolby vision codec only if the + // device support clear DV decoding, otherwise use the original + // HEVC or AVC codec and profile. -+ if (media::IsSupportedVideoType(type)) { ++ if (media::IsDecoderSupportedVideoType(type)) { + codec = type.codec; + profile = type.profile; + } diff --git a/MakeSbixTypeface-null-pointer-call.patch b/MakeSbixTypeface-null-pointer-call.patch index 046d4ab..8017a64 100644 --- a/MakeSbixTypeface-null-pointer-call.patch +++ b/MakeSbixTypeface-null-pointer-call.patch @@ -1,8 +1,12 @@ Actually disable the fontations code flag since we don't build that library. Otherwise chromium crashes with a null dereference ---- src/third_party/blink/renderer/platform/runtime_enabled_features.json5.orig 2025-01-06 22:04:18.385199599 +0100 -+++ src/third_party/blink/renderer/platform/runtime_enabled_features.json5 2025-01-14 19:49:21.336897930 +0100 -@@ -2103,7 +2103,6 @@ +--- src/third_party/blink/renderer/platform/runtime_enabled_features.json5.orig 2025-04-21 18:29:28.190307211 +0200 ++++ src/third_party/blink/renderer/platform/runtime_enabled_features.json5 2025-04-21 23:33:49.257769003 +0200 +@@ -2165,11 +2165,9 @@ + }, + { + name: "FontationsFontBackend", +- status: "stable", }, { name: "FontationsForSelectedFormats", diff --git a/absl_strings-missing-headers.patch b/absl_strings-missing-headers.patch new file mode 100644 index 0000000..543cd28 --- /dev/null +++ b/absl_strings-missing-headers.patch @@ -0,0 +1,40 @@ +--- src/build/linux/unbundle/absl_strings.gn.orig 2025-04-12 17:15:17.061420294 +0200 ++++ src/build/linux/unbundle/absl_strings.gn 2025-04-15 20:16:58.452941199 +0200 +@@ -5,6 +5,10 @@ pkg_config("system_absl_cord") { + packages = [ "absl_cord" ] + } + ++pkg_config("system_absl_has_ostream_operator") { ++ packages = [ "absl_has_ostream_operator" ] ++} ++ + pkg_config("system_absl_strings") { + packages = [ "absl_strings" ] + } +@@ -35,6 +39,9 @@ shim_headers("strings_shim") { + "ascii.h", + "charconv.h", + "escaping.h", ++ "has_absl_stringify.h", ++ "internal/damerau_levenshtein_distance.h", ++ "internal/string_constant.h", + "match.h", + "numbers.h", + "str_cat.h", +@@ -74,8 +81,15 @@ source_set("string_view") { + public_configs = [ ":system_absl_string_view" ] + } + ++shim_headers("has_ostream_operator_shim") { ++ root_path = "." ++ prefix = "absl/strings/" ++ headers = [ "has_ostream_operator.h" ] ++} ++ + source_set("has_ostream_operator") { +- # Dummy — unavailable with abseil 202308 and chromium 122 does not use it ++ deps = [ ":has_ostream_operator_shim" ] ++ public_configs = [ ":system_absl_has_ostream_operator" ] + } + + source_set("ascii_test") { diff --git a/angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch b/angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch new file mode 100644 index 0000000..7d7fda2 --- /dev/null +++ b/angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch @@ -0,0 +1,62 @@ +From 397eb7c81ee996027470b2453b787e4947cdc8c0 Mon Sep 17 00:00:00 2001 +From: Shahbaz Youssefi +Date: Sat, 29 Jun 2024 00:22:42 -0400 +Subject: [PATCH] Vulkan: Easier to read SPIR-V disassembly + +Bug: angleproject:349994211 +Change-Id: I9d8da4a9fa336e1f5ecdfa39c33959ecebb2c6ea +Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5667081 +Auto-Submit: Shahbaz Youssefi +Reviewed-by: Amirali Abdolrashidi +Commit-Queue: Shahbaz Youssefi +--- + samples/shader_translator/shader_translator.cpp | 4 +++- + src/common/spirv/angle_spirv_utils.cpp | 4 +++- + src/compiler/translator/spirv/OutputSPIRV.cpp | 4 +++- + 3 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/samples/shader_translator/shader_translator.cpp b/samples/shader_translator/shader_translator.cpp +index 64f4df372f0..3d6aa709ce1 100644 +--- a/third_party/angle/samples/shader_translator/shader_translator.cpp ++++ b/third_party/angle/samples/shader_translator/shader_translator.cpp +@@ -928,7 +928,9 @@ static void PrintSpirv(const sh::BinaryBlob &blob) + spvtools::SpirvTools spirvTools(SPV_ENV_VULKAN_1_1); + + std::string readableSpirv; +- spirvTools.Disassemble(blob, &readableSpirv, 0); ++ spirvTools.Disassemble(blob, &readableSpirv, ++ SPV_BINARY_TO_TEXT_OPTION_COMMENT | SPV_BINARY_TO_TEXT_OPTION_INDENT | ++ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT); + + puts(readableSpirv.c_str()); + #endif +diff --git a/src/common/spirv/angle_spirv_utils.cpp b/src/common/spirv/angle_spirv_utils.cpp +index 5082b3c7341..fc83582eb48 100644 +--- a/third_party/angle/src/common/spirv/angle_spirv_utils.cpp ++++ b/third_party/angle/src/common/spirv/angle_spirv_utils.cpp +@@ -62,7 +62,9 @@ void Print(const Blob &blob) + { + spvtools::SpirvTools spirvTools(GetEnv(blob)); + std::string readableSpirv; +- spirvTools.Disassemble(blob, &readableSpirv, 0); ++ spirvTools.Disassemble(blob, &readableSpirv, ++ SPV_BINARY_TO_TEXT_OPTION_COMMENT | SPV_BINARY_TO_TEXT_OPTION_INDENT | ++ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT); + INFO() << "Disassembled SPIR-V:\n" << readableSpirv.c_str(); + } + +diff --git a/src/compiler/translator/spirv/OutputSPIRV.cpp b/src/compiler/translator/spirv/OutputSPIRV.cpp +index ad5c12e07fe..1ed6b264622 100644 +--- a/third_party/angle/src/compiler/translator/spirv/OutputSPIRV.cpp ++++ b/third_party/angle/src/compiler/translator/spirv/OutputSPIRV.cpp +@@ -6550,7 +6550,9 @@ spirv::Blob OutputSPIRVTraverser::getSpirv() + spvtools::SpirvTools spirvTools(mCompileOptions.emitSPIRV14 ? SPV_ENV_VULKAN_1_1_SPIRV_1_4 + : SPV_ENV_VULKAN_1_1); + std::string readableSpirv; +- spirvTools.Disassemble(result, &readableSpirv, 0); ++ spirvTools.Disassemble(result, &readableSpirv, ++ SPV_BINARY_TO_TEXT_OPTION_COMMENT | SPV_BINARY_TO_TEXT_OPTION_INDENT | ++ SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT); + fprintf(stderr, "%s\n", readableSpirv.c_str()); + #endif // ANGLE_DEBUG_SPIRV_GENERATION + diff --git a/ax_platform_node_id-fpermissive.patch b/ax_platform_node_id-fpermissive.patch new file mode 100644 index 0000000..3b4fbb4 --- /dev/null +++ b/ax_platform_node_id-fpermissive.patch @@ -0,0 +1,12 @@ +--- src/ui/accessibility/platform/ax_platform_node_id.h.orig 2025-04-16 14:36:44.316067879 +0200 ++++ src/ui/accessibility/platform/ax_platform_node_id.h 2025-04-17 12:14:07.150992641 +0200 +@@ -55,9 +55,7 @@ class AXPlatformNodeId + + } // namespace ui + +-namespace std { + template <> + struct std::hash + : std::hash> {}; +-} // namespace std + #endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_ID_H_ diff --git a/base-system-nspr.patch b/base-system-nspr.patch index e5d54c8..1e0335e 100644 --- a/base-system-nspr.patch +++ b/base-system-nspr.patch @@ -9,8 +9,8 @@ #include "base/time/time_override.h" #include "build/build_config.h" ---- src/base/BUILD.gn.orig 2024-12-08 18:43:52.881356091 +0100 -+++ src/base/BUILD.gn 2024-12-18 13:19:11.049201868 +0100 +--- src/base/BUILD.gn.orig 2025-04-11 12:12:20.504331178 +0200 ++++ src/base/BUILD.gn 2025-04-11 20:49:30.979616277 +0200 @@ -1,3 +1,8 @@ +import("//build/config/linux/pkg_config.gni") + @@ -20,7 +20,7 @@ # Copyright 2013 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -@@ -809,8 +814,6 @@ component("base") { +@@ -797,8 +802,6 @@ component("base") { "task/updateable_sequenced_task_runner.h", "test/scoped_logging_settings.h", "test/spin_wait.h", @@ -29,10 +29,10 @@ "thread_annotations.h", "threading/hang_watcher.cc", "threading/hang_watcher.h", -@@ -1028,6 +1031,7 @@ component("base") { +@@ -1014,6 +1017,7 @@ component("base") { + "//build/config/compiler:prevent_unsafe_narrowing", "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", - "//electron/build/config:mas_build", + ":system_nspr", ] diff --git a/blink-shape_result-highway.patch b/blink-shape_result-highway.patch new file mode 100644 index 0000000..7e2ab22 --- /dev/null +++ b/blink-shape_result-highway.patch @@ -0,0 +1,16 @@ +--- src/third_party/blink/renderer/platform/fonts/shaping/shape_result.h.orig 2025-04-23 20:35:41.224982139 +0200 ++++ src/third_party/blink/renderer/platform/fonts/shaping/shape_result.h 2025-04-23 21:44:29.556139260 +0200 +@@ -54,9 +54,13 @@ + #include "ui/gfx/geometry/rect_f.h" + #include "ui/gfx/geometry/vector2d_f.h" + ++#include ++ + #if defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARM64) ++#if HWY_MAJOR > 1 || (HWY_MAJOR == 1 && HWY_MINOR >= 1) + #define USE_SIMD_FOR_COMPUTING_GLYPH_BOUNDS 1 + #endif ++#endif + + struct hb_buffer_t; + diff --git a/browser_process_impl-fix-safe_browsing_mode-0.patch b/browser_process_impl-fix-safe_browsing_mode-0.patch new file mode 100644 index 0000000..a8e99aa --- /dev/null +++ b/browser_process_impl-fix-safe_browsing_mode-0.patch @@ -0,0 +1,45 @@ +--- src/electron/shell/browser/browser_process_impl.h.orig 2025-04-16 14:34:09.211257279 +0200 ++++ src/electron/shell/browser/browser_process_impl.h 2025-04-18 21:20:48.780761049 +0200 +@@ -16,6 +16,7 @@ + #include "chrome/browser/browser_process.h" + #include "components/embedder_support/origin_trials/origin_trials_settings_storage.h" + #include "components/prefs/value_map_pref_store.h" ++#include "components/safe_browsing/buildflags.h" + #include "printing/buildflags/buildflags.h" + #include "services/network/public/cpp/network_quality_tracker.h" + #include "services/network/public/cpp/shared_url_loader_factory.h" +@@ -104,7 +105,9 @@ class BrowserProcessImpl : public Browse + DownloadRequestLimiter* download_request_limiter() override; + BackgroundModeManager* background_mode_manager() override; + StatusTray* status_tray() override; ++#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) + safe_browsing::SafeBrowsingService* safe_browsing_service() override; ++#endif + subresource_filter::RulesetService* subresource_filter_ruleset_service() + override; + component_updater::ComponentUpdateService* component_updater() override; +--- src/electron/BUILD.gn.orig 2025-04-16 14:34:09.140868383 +0200 ++++ src/electron/BUILD.gn 2025-04-18 21:29:07.278572174 +0200 +@@ -465,6 +465,7 @@ source_set("electron_lib") { + "//components/os_crypt/sync", + "//components/pref_registry", + "//components/prefs", ++ "//components/safe_browsing:buildflags", + "//components/security_state/content", + "//components/upload_list", + "//components/user_prefs", +--- src/electron/shell/browser/browser_process_impl.cc.orig 2025-04-16 14:34:09.211257279 +0200 ++++ src/electron/shell/browser/browser_process_impl.cc 2025-04-18 21:32:53.957517063 +0200 +@@ -257,10 +257,12 @@ StatusTray* BrowserProcessImpl::status_t + return nullptr; + } + ++#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) + safe_browsing::SafeBrowsingService* + BrowserProcessImpl::safe_browsing_service() { + return nullptr; + } ++#endif + + subresource_filter::RulesetService* + BrowserProcessImpl::subresource_filter_ruleset_service() { diff --git a/build-without-mesage-center.patch b/build-without-mesage-center.patch new file mode 100644 index 0000000..6daa1ae --- /dev/null +++ b/build-without-mesage-center.patch @@ -0,0 +1,10 @@ +--- src/components/global_media_controls/BUILD.gn 2025-04-16 14:36:27.043179983 +0200 ++++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/nodejs-electron-35.1.5-build/src/components/global_media_controls/BUILD.gn 2025-04-18 14:41:32.341441955 +0200 +@@ -48,7 +48,6 @@ component("global_media_controls") { + } + + public_deps = [ +- "//components/media_message_center", + "//services/media_session/public/cpp", + "//services/media_session/public/mojom", + "//ui/views", diff --git a/build-without-speech-service.patch b/build-without-speech-service.patch index 3e27f84..d9b4dfc 100644 --- a/build-without-speech-service.patch +++ b/build-without-speech-service.patch @@ -1,9 +1,9 @@ --- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 +++ src/chrome/test/BUILD.gn 2025-01-01 21:35:00.776064485 +0100 @@ -8317,7 +8317,6 @@ test("unit_tests") { - "//chrome/browser/ui/zoom:unit_tests", + "//chrome/browser/user_annotations", "//chrome/browser/web_applications:web_applications_test_support", - "//chrome/common/accessibility:mojo_bindings", + "//chrome/common/read_anything:mojo_bindings", - "//chrome/services/speech:unit_tests", "//components/app_constants", "//components/color", diff --git a/chromium-102-compiler.patch b/chromium-102-compiler.patch index 6996d3b..4f59637 100644 --- a/chromium-102-compiler.patch +++ b/chromium-102-compiler.patch @@ -21,9 +21,9 @@ Subject: [PATCH] Disable various compiler configs build/config/compiler/BUILD.gn | 114 +++++---------------------------- 1 file changed, 17 insertions(+), 97 deletions(-) ---- src/build/config/compiler/BUILD.gn.orig 2024-12-08 18:34:51.744673228 +0100 -+++ src/build/config/compiler/BUILD.gn 2024-12-18 11:06:05.334038035 +0100 -@@ -310,9 +310,7 @@ config("compiler") { +--- src/build/config/compiler/BUILD.gn.orig 2025-04-21 18:29:05.106306929 +0200 ++++ src/build/config/compiler/BUILD.gn 2025-04-22 20:59:45.689108303 +0200 +@@ -308,9 +308,7 @@ config("compiler") { configs += [ # See the definitions below. @@ -33,7 +33,23 @@ Subject: [PATCH] Disable various compiler configs ":compiler_codegen", ":compiler_deterministic", ] -@@ -342,7 +340,12 @@ config("compiler") { +@@ -325,7 +323,6 @@ config("compiler") { + # See: https://gcc.gnu.org/PR97913 + # TODO(mpdenton): remove is_clang once GCC bug is fixed. + if ((!is_nacl || is_nacl_saigo) && !is_ubsan && is_clang) { +- cflags += [ "-fno-delete-null-pointer-checks" ] + } + + # Make signed overflow and pointer overflowdefined to wrap. +@@ -335,7 +332,6 @@ config("compiler") { + if (is_win) { + cflags += [ "/clang:-fwrapv" ] + } else { +- cflags += [ "-fwrapv" ] + } + } + +@@ -351,7 +347,12 @@ config("compiler") { if (!is_win) { # Common POSIX compiler flags setup. # -------------------------------- @@ -47,7 +63,7 @@ Subject: [PATCH] Disable various compiler configs # Stack protection. ShadowCallStack and Stack protector address the same # problems. Therefore, we only enable one or the other. Clang advertises SCS as -@@ -487,10 +490,6 @@ config("compiler") { +@@ -498,10 +499,6 @@ config("compiler") { # Linux/Android/Fuchsia common flags setup. # --------------------------------- if (is_linux || is_chromeos || is_android || is_fuchsia) { @@ -58,7 +74,7 @@ Subject: [PATCH] Disable various compiler configs if (!is_clang) { # Use pipes for communicating between sub-processes. Faster. -@@ -1107,11 +1106,6 @@ config("libcxx_hardening") { +@@ -1124,11 +1121,6 @@ config("libcxx_hardening") { defines = [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ] } @@ -70,7 +86,7 @@ Subject: [PATCH] Disable various compiler configs } # The BUILDCONFIG file sets this config on targets by default, which means when -@@ -1177,7 +1171,8 @@ config("thinlto_optimize_max") { +@@ -1194,7 +1186,8 @@ config("thinlto_optimize_max") { # without using everything that "compiler" brings in. Options that # tweak code generation for a particular CPU do not belong here! # See "compiler_codegen", below. @@ -80,7 +96,7 @@ Subject: [PATCH] Disable various compiler configs cflags = [] ldflags = [] defines = [] -@@ -1811,7 +1806,8 @@ config("treat_warnings_as_errors") { +@@ -1824,7 +1817,8 @@ config("treat_warnings_as_errors") { # Collects all warning flags that are used by default. This is used as a # subconfig of both chromium_code and no_chromium_code. This way these # flags are guaranteed to appear on the compile command line after -Wall. @@ -90,7 +106,7 @@ Subject: [PATCH] Disable various compiler configs cflags = [] cflags_c = [] cflags_cc = [] -@@ -2064,11 +2060,7 @@ config("chromium_code") { +@@ -2071,11 +2065,7 @@ config("chromium_code") { defines = [ "_HAS_NODISCARD" ] } } else { @@ -103,7 +119,7 @@ Subject: [PATCH] Disable various compiler configs # In Chromium code, we define __STDC_foo_MACROS in order to get the # C99 macros on Mac and Linux. -@@ -2077,24 +2069,6 @@ config("chromium_code") { +@@ -2084,24 +2074,6 @@ config("chromium_code") { "__STDC_FORMAT_MACROS", ] @@ -128,7 +144,7 @@ Subject: [PATCH] Disable various compiler configs if (is_apple) { cflags_objc = [ "-Wimplicit-retain-self" ] cflags_objcc = [ "-Wimplicit-retain-self" ] -@@ -2245,7 +2219,6 @@ config("no_rtti") { +@@ -2268,7 +2240,6 @@ config("no_rtti") { config("export_dynamic") { # TODO(crbug.com/40118868): Revisit after target_os flip is completed. if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) { @@ -136,7 +152,7 @@ Subject: [PATCH] Disable various compiler configs } } -@@ -2333,7 +2306,8 @@ config("wexit_time_destructors") { +@@ -2366,7 +2337,8 @@ config("wexit_time_destructors") { # gcc 4.9 and earlier had no way of suppressing this warning without # suppressing the rest of them. Here we centralize the identification of # the gcc 4.9 toolchains. @@ -146,7 +162,7 @@ Subject: [PATCH] Disable various compiler configs cflags = [] if (is_clang) { cflags += [ "-Wno-incompatible-pointer-types" ] -@@ -2451,7 +2425,8 @@ if (is_win) { +@@ -2483,7 +2455,8 @@ if (is_win) { common_optimize_on_cflags += [ "-fno-math-errno" ] } @@ -156,7 +172,7 @@ Subject: [PATCH] Disable various compiler configs if (!is_win) { if (enable_frame_pointers) { cflags = [ "-fno-omit-frame-pointer" ] -@@ -2492,7 +2467,8 @@ config("default_stack_frames") { +@@ -2524,7 +2497,8 @@ config("default_stack_frames") { # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000 # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000 # [2]: https://crrev.com/c/5447532 @@ -166,7 +182,7 @@ Subject: [PATCH] Disable various compiler configs if (is_win) { # clang-cl's /O2 corresponds to clang's -O3, and really want -O2 for # consistency with the other platforms. -@@ -2541,7 +2517,8 @@ config("optimize") { +@@ -2573,7 +2547,8 @@ config("optimize") { } # Turn off optimizations. @@ -176,7 +192,7 @@ Subject: [PATCH] Disable various compiler configs if (is_win) { cflags = [ "/Od", # Disable optimization. -@@ -2581,7 +2558,8 @@ config("no_optimize") { +@@ -2613,7 +2588,8 @@ config("no_optimize") { # Turns up the optimization level. Used to explicitly enable -O2 instead of # -Os for select targets on platforms that use optimize_for_size. No-op # elsewhere. @@ -186,7 +202,7 @@ Subject: [PATCH] Disable various compiler configs if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2614,7 +2592,8 @@ config("optimize_max") { +@@ -2646,7 +2622,8 @@ config("optimize_max") { # # TODO(crbug.com/41259697) - rework how all of these configs are related # so that we don't need this disclaimer. @@ -196,7 +212,7 @@ Subject: [PATCH] Disable various compiler configs if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2643,7 +2622,8 @@ config("optimize_speed") { +@@ -2675,7 +2652,8 @@ config("optimize_speed") { } } @@ -206,7 +222,7 @@ Subject: [PATCH] Disable various compiler configs cflags = [ "-O1" ] + common_optimize_on_cflags rustflags = [ "-Copt-level=1" ] ldflags = common_optimize_on_ldflags -@@ -2774,7 +2754,8 @@ config("win_pdbaltpath") { +@@ -2806,7 +2784,8 @@ config("win_pdbaltpath") { } # Full symbols. @@ -216,7 +232,7 @@ Subject: [PATCH] Disable various compiler configs rustflags = [] configs = [] if (is_win) { -@@ -2936,7 +2917,8 @@ config("symbols") { +@@ -2968,7 +2947,8 @@ config("symbols") { # Minimal symbols. # This config guarantees to hold symbol for stack trace which are shown to user # when crash happens in unittests running on buildbot. @@ -226,7 +242,7 @@ Subject: [PATCH] Disable various compiler configs rustflags = [] if (is_win) { # Functions, files, and line tables only. -@@ -3021,7 +3003,8 @@ config("minimal_symbols") { +@@ -3053,7 +3033,8 @@ config("minimal_symbols") { # This configuration contains function names only. That is, the compiler is # told to not generate debug information and the linker then just puts function # names in the final debug information. diff --git a/chromium-127-crabby.patch b/chromium-127-crabby.patch index 9883b31..4455037 100644 --- a/chromium-127-crabby.patch +++ b/chromium-127-crabby.patch @@ -1,49 +1,54 @@ --- a/third_party/blink/renderer/platform/image-decoders/BUILD.gn +++ b/third_party/blink/renderer/platform/image-decoders/BUILD.gn -@@ -74,12 +74,9 @@ - sources += [ - "avif/avif_image_decoder.cc", - "avif/avif_image_decoder.h", +@@ -77,14 +77,6 @@ + "//ui/gfx/geometry:geometry_skia", + ] + +- if (enable_av1_decoder) { +- sources += [ - "avif/crabbyavif_image_decoder.cc", - "avif/crabbyavif_image_decoder.h", - ] +- ] +- +- deps += [ "//third_party/crabbyavif" ] +- } - deps += [ -- "//third_party/crabbyavif", - "//third_party/libavif", - "//third_party/libavifinfo", - ] + if (enable_rust_png) { + sources += [ --- a/third_party/blink/renderer/platform/image-decoders/image_decoder.cc +++ b/third_party/blink/renderer/platform/image-decoders/image_decoder.cc -@@ -47,7 +47,6 @@ +@@ -51,9 +51,6 @@ + #include "ui/gfx/geometry/size.h" + #include "ui/gfx/geometry/size_conversions.h" - #if BUILDFLAG(ENABLE_AV1_DECODER) - #include "third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.h" +-#if BUILDFLAG(ENABLE_AV1_DECODER) -#include "third_party/blink/renderer/platform/image-decoders/avif/crabbyavif_image_decoder.h" - #endif +-#endif namespace blink { -@@ -192,9 +191,7 @@ + +@@ -196,11 +193,6 @@ + if (MatchesBMPSignature(contents)) { return "image/bmp"; } - #if BUILDFLAG(ENABLE_AV1_DECODER) -- if (base::FeatureList::IsEnabled(blink::features::kCrabbyAvif) -- ? CrabbyAVIFImageDecoder::MatchesAVIFSignature(fast_reader) -- : AVIFImageDecoder::MatchesAVIFSignature(fast_reader)) { -+ if (AVIFImageDecoder::MatchesAVIFSignature(fast_reader)) { - return "image/avif"; - } - #endif -@@ -300,11 +300,7 @@ +-#if BUILDFLAG(ENABLE_AV1_DECODER) +- if (CrabbyAVIFImageDecoder::MatchesAVIFSignature(fast_reader)) { +- return "image/avif"; +- } +-#endif + + return String(); + } +@@ -305,12 +297,6 @@ + } else if (mime_type == "image/bmp" || mime_type == "image/x-xbitmap") { + decoder = std::make_unique(alpha_option, color_behavior, max_decoded_bytes); - #if BUILDFLAG(ENABLE_AV1_DECODER) - } else if (mime_type == "image/avif") { -- if (base::FeatureList::IsEnabled(blink::features::kCrabbyAvif)) { -- decoder = std::make_unique( -- alpha_option, high_bit_depth_decoding_option, color_behavior, -- max_decoded_bytes, animation_option); -- } else { -+ if (true) { - decoder = std::make_unique( - alpha_option, high_bit_depth_decoding_option, color_behavior, - max_decoded_bytes, animation_option); +-#if BUILDFLAG(ENABLE_AV1_DECODER) +- } else if (mime_type == "image/avif") { +- decoder = std::make_unique( +- alpha_option, high_bit_depth_decoding_option, color_behavior, aux_image, +- max_decoded_bytes, animation_option); +-#endif + } + + if (decoder) { diff --git a/chromium-129-disable-H.264-video-parser-during-demuxing.patch b/chromium-129-disable-H.264-video-parser-during-demuxing.patch index b4398bb..a1b787e 100644 --- a/chromium-129-disable-H.264-video-parser-during-demuxing.patch +++ b/chromium-129-disable-H.264-video-parser-during-demuxing.patch @@ -1,32 +1,12 @@ -diff -up chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc.me chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc ---- chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc.me 2024-09-15 22:12:33.945186323 +0200 -+++ chromium-129.0.6668.42.old/media/filters/ffmpeg_glue.cc 2024-09-16 10:53:13.334970539 +0200 -@@ -17,14 +17,11 @@ +diff -up chromium-133.0.6943.53/media/filters/ffmpeg_glue.cc.me chromium-133.0.6943.53/media/filters/ffmpeg_glue.cc +--- chromium-133.0.6943.53/media/filters/ffmpeg_glue.cc.me 2025-02-05 13:28:17.782881439 +0100 ++++ chromium-133.0.6943.53/media/filters/ffmpeg_glue.cc 2025-02-05 13:33:15.256928027 +0100 +@@ -111,7 +111,7 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol - namespace media { + // We don't allow H.264 parsing during demuxing since we have our own parser + // and the ffmpeg one increases memory usage unnecessarily. +- format_context_->flags |= AVFMT_FLAG_NOH264PARSE; ++ // format_context_->flags |= AVFMT_FLAG_NOH264PARSE; --// Kill switches in case things explode. Remove after M132. -+// Kill switch in case things explode. Remove after M132. - // TODO(crbug.com/355485812): Re-enable this flag. - BASE_FEATURE(kAllowOnlyAudioCodecsDuringDemuxing, - "AllowOnlyAudioCodecsDuringDemuxing", - base::FEATURE_ENABLED_BY_DEFAULT); --BASE_FEATURE(kForbidH264ParsingDuringDemuxing, -- "ForbidH264ParsingDuringDemuxing", -- base::FEATURE_ENABLED_BY_DEFAULT); - - // Internal buffer size used by AVIO for reading. - // TODO(dalecurtis): Experiment with this buffer size and measure impact on -@@ -118,12 +115,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol - // Enable fast, but inaccurate seeks for MP3. - format_context_->flags |= AVFMT_FLAG_FAST_SEEK; - -- // We don't allow H.264 parsing during demuxing since we have our own parser -- // and the ffmpeg one increases memory usage unnecessarily. -- if (base::FeatureList::IsEnabled(kForbidH264ParsingDuringDemuxing)) { -- format_context_->flags |= AVFMT_FLAG_NOH264PARSE; -- } -- // Ensures format parsing errors will bail out. From an audit on 11/2017, all // instances were real failures. Solves bugs like http://crbug.com/710791. - format_context_->error_recognition |= AV_EF_EXPLODE; diff --git a/chromium-130-fontations.patch b/chromium-130-fontations.patch index 7805bed..601314c 100644 --- a/chromium-130-fontations.patch +++ b/chromium-130-fontations.patch @@ -1,14 +1,14 @@ ---- a/skia/BUILD.gn -+++ b/skia/BUILD.gn -@@ -8,7 +8,6 @@ +--- src/skia/BUILD.gn.orig 2025-04-11 12:05:22.085153891 +0200 ++++ src/skia/BUILD.gn 2025-04-11 20:35:59.999827501 +0200 +@@ -8,7 +8,6 @@ import("//build/config/features.gni") import("//build/config/freetype/freetype.gni") import("//build/config/rust.gni") import("//build/config/sanitizers/sanitizers.gni") -import("//build/rust/rust_static_library.gni") import("//gpu/vulkan/features.gni") - import("//testing/test.gni") - import("//third_party/skia/gn/shared_sources.gni") -@@ -47,27 +46,6 @@ + import("//skia/skia.gni") + import("//testing/libfuzzer/fuzzer_test.gni") +@@ -37,27 +36,6 @@ buildflag_header("buildflags") { ] } @@ -23,9 +23,9 @@ - cxx_bindings = skia_fontations_bridge_sources - deps = [ - ":path_bridge", -- "//third_party/rust/font_types/v0_7:lib", -- "//third_party/rust/read_fonts/v0_22:lib", -- "//third_party/rust/skrifa/v0_22:lib", +- "//third_party/rust/font_types/v0_8:lib", +- "//third_party/rust/read_fonts/v0_25:lib", +- "//third_party/rust/skrifa/v0_26:lib", - ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ @@ -36,14 +36,21 @@ # External-facing config for dependent code. config("skia_config") { -@@ -394,15 +373,9 @@ - # See SK_TYPEFACE_FACTORY_FREETYPE - sources += skia_ports_freetype_sources - sources += skia_ports_fontmgr_custom_sources +@@ -182,7 +160,6 @@ config("skia_library_config") { + if (use_blink && enable_freetype) { + defines += [ + "SK_TYPEFACE_FACTORY_FREETYPE", +- "SK_TYPEFACE_FACTORY_FONTATIONS", + "SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE", + ] + } +@@ -417,14 +394,6 @@ component("skia") { + public += skia_ports_fontmgr_empty_public + } + sources += skia_ports_typeface_proxy_sources - sources += skia_ports_typeface_fontations_sources - sources += skia_ports_fontmgr_empty_sources - public += skia_ports_fontmgr_empty_public - +- sources += skia_ports_fontmgr_fontations_sources +- - # Fontations Rust/C++ bridge interfaces. - deps += [ - ":bridge_rust_side", @@ -52,17 +59,32 @@ } if (is_win) { ---- a/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc -+++ b/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc -@@ -12,7 +12,6 @@ - #include "third_party/blink/renderer/platform/fonts/opentype/font_format_check.h" +@@ -719,13 +688,7 @@ skia_source_set("skia_core_and_effects") + # skia_core_and_effects rather than the other way around. + public_deps = [ "//third_party/dawn/include/dawn:cpp_headers" ] + } +- if (use_blink) { +- # Fontations Rust/C++ bridge interfaces, needed by SkTypeface. +- deps += [ +- ":bridge_rust_side", +- ":path_bridge", +- ] +- } ++ + visibility = [ ":skia" ] + } + +--- src/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc.orig 2025-04-11 12:05:22.929220697 +0200 ++++ src/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc 2025-04-11 20:35:59.999827501 +0200 +@@ -13,7 +13,6 @@ + #include "third_party/freetype_buildflags.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkTypeface_fontations.h" #if BUILDFLAG(IS_WIN) #include "third_party/blink/renderer/platform/fonts/win/dwrite_font_format_support.h" -@@ -54,7 +53,7 @@ +@@ -55,7 +54,7 @@ bool IsFreeTypeSystemRasterizer() { } sk_sp MakeTypefaceDefaultFontMgr(sk_sp data) { @@ -71,7 +93,7 @@ if (RuntimeEnabledFeatures::FontationsFontBackendEnabled()) { std::unique_ptr stream(new SkMemoryStream(data)); return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); -@@ -82,10 +81,6 @@ +@@ -83,10 +82,6 @@ sk_sp MakeTypefaceFallback(s } #endif @@ -82,7 +104,7 @@ sk_sp MakeVariationsTypeface( sk_sp data, -@@ -187,7 +182,6 @@ +@@ -188,7 +183,6 @@ bool WebFontTypefaceFactory::CreateTypef const FontFormatCheck format_check(data); const FontInstantiator instantiator = { MakeTypefaceDefaultFontMgr, @@ -90,4 +112,3 @@ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) MakeTypefaceFallback, #endif - diff --git a/chromium-132-no-rust.patch b/chromium-132-no-rust.patch new file mode 100644 index 0000000..e33894e --- /dev/null +++ b/chromium-132-no-rust.patch @@ -0,0 +1,290 @@ +--- a/base/BUILD.gn ++++ b/base/BUILD.gn +@@ -38,8 +38,6 @@ + import("//build/config/sysroot.gni") + import("//build/config/ui.gni") + import("//build/nocompile.gni") +-import("//build/rust/rust_bindgen.gni") +-import("//build/rust/rust_static_library.gni") + import("//build/timestamp.gni") + import("//build/util/process_version.gni") + import("//build_overrides/build.gni") +@@ -1022,11 +1020,6 @@ + # Used by metrics/crc32, except on NaCl builds. + deps += [ "//third_party/zlib" ] + +- # NaCl does not support Rust. +- deps += [ +- ":rust_logger", +- "//third_party/rust/serde_json_lenient/v0_2/wrapper", +- ] + } + + # `raw_ptr` cannot be made a component due to CRT symbol issues. +@@ -1063,7 +1056,7 @@ + "//third_party/abseil-cpp:absl", + ] + +- if (!is_nacl) { ++ if (is_nacl) { + sources += [ + "containers/span_rust.h", + "strings/string_view_rust.h", +@@ -1543,8 +1536,6 @@ + "files/scoped_temp_file.h", + "json/json_file_value_serializer.cc", + "json/json_file_value_serializer.h", +- "logging/rust_log_integration.cc", +- "logging/rust_log_integration.h", + "memory/discardable_memory.cc", + "memory/discardable_memory.h", + "memory/discardable_memory_allocator.cc", +@@ -2447,40 +2438,6 @@ + } + } + +-rust_bindgen("logging_log_severity_bindgen") { +- # TODO(danakj): Maybe combine all base bindgen targets, or all base/logging +- # ones even) into a single GN target? But the GN rule needs to handle multiple +- # headers then. +- header = "logging/log_severity.h" +- cpp = true +- visibility = [ ":*" ] +- +- # Transitive generated header dependency. +- deps = [ ":debugging_buildflags" ] +-} +- +-rust_bindgen("logging_rust_log_integration_bindgen") { +- header = "logging/rust_log_integration.h" +- cpp = true +- visibility = [ ":*" ] +- +- # Transitive generated header dependency. +- deps = [ ":debugging_buildflags" ] +-} +- +-rust_static_library("rust_logger") { +- allow_unsafe = true # Unsafe needed for FFI. +- deps = [ +- ":logging_log_severity_bindgen", +- ":logging_rust_log_integration_bindgen", +- "//third_party/rust/log/v0_4:lib", +- ] +- visibility = [ ":base" ] +- sources = [ "logging/rust_logger.rs" ] +- crate_root = "logging/rust_logger.rs" +- +- cxx_bindings = [ "logging/rust_logger.rs" ] +-} + + if (is_linux || is_chromeos) { + # Split out as a separate target for two reasons: +@@ -3564,7 +3521,7 @@ + sources += [ "location_unittest.cc" ] + } + +- if (!is_nacl) { ++ if (is_nacl) { + sources += [ + "containers/span_rust_unittest.cc", + "strings/string_piece_rust_unittest.cc", +@@ -3617,7 +3574,7 @@ + deps += [ "allocator/partition_allocator/src/partition_alloc:unittests" ] + } + +- if (!is_nacl) { ++ if (is_nacl) { + deps += [ "//build/rust:cxx_cppdeps" ] + } + +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -28,7 +28,6 @@ + import("//gpu/vulkan/features.gni") + import("//media/gpu/args.gni") + import("//media/media_options.gni") +-import("//mojo/public/rust/rust.gni") + import("//pdf/features.gni") + import("//ppapi/buildflags/buildflags.gni") + import("//printing/buildflags/buildflags.gni") +@@ -888,12 +887,9 @@ + + deps = [ + ":rust_build_tests", +- "//base:base_unittests", # There is rust stuff in here. +- "//testing/rust_gtest_interop:rust_gtest_interop_unittests", +- "//third_party/cloud_authenticator/processor", + ] + +- if (enable_rust_mojo) { ++ if (false) { + deps += [ + "//mojo/public/rust:mojo_rust", + "//mojo/public/rust:mojo_rust_integration_unittests", +--- a/base/test/BUILD.gn ++++ b/base/test/BUILD.gn +@@ -7,7 +7,6 @@ + import("//build/config/features.gni") + import("//build/config/nacl/config.gni") + import("//build/config/ui.gni") +-import("//build/rust/rust_static_library.gni") + import("//build_overrides/build.gni") + import("//third_party/protobuf/proto_library.gni") + +@@ -39,16 +38,6 @@ + ] + } + +-rust_static_library("test_rust_logger_consumer") { +- allow_unsafe = true # Unsafe needed for FFI +- testonly = true +- deps = [ "//third_party/rust/log/v0_4:lib" ] +- sources = [ "logging/test_rust_logger_consumer.rs" ] +- +- crate_root = "logging/test_rust_logger_consumer.rs" +- +- cxx_bindings = [ "logging/test_rust_logger_consumer.rs" ] +-} + + static_library("test_support") { + testonly = true +@@ -189,7 +178,6 @@ + + public_deps = [ + ":test_config", +- ":test_rust_logger_consumer", + "//base", + "//base:base_static", + "//base:i18n", +--- a/third_party/blink/common/BUILD.gn ++++ b/third_party/blink/common/BUILD.gn +@@ -341,7 +341,6 @@ + "//services/metrics/public/cpp:ukm_builders", + "//services/metrics/public/mojom:mojom", + "//services/network/public/cpp:cpp", +- "//third_party/blink/common/rust_crash", + "//third_party/blink/public/common:buildflags", + "//third_party/re2", + "//ui/base:base", +--- a/third_party/breakpad/BUILD.gn ++++ b/third_party/breakpad/BUILD.gn +@@ -494,11 +494,6 @@ + # For breakpad/src/common/stabs_reader.h. + defines = [ "HAVE_MACH_O_NLIST_H" ] + +- # Rust demangle support. +- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ] +- defines += [ "HAVE_RUSTC_DEMANGLE" ] +- include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include" ] +- sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include/rustc_demangle.h" ] + } + test("breakpad_unittests") { + sources = [ "breakpad/src/common/module_unittest.cc" ] +@@ -742,11 +737,6 @@ + + include_dirs = [ "breakpad/src" ] + +- # Rust demangle support. +- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ] +- defines += [ "HAVE_RUSTC_DEMANGLE" ] +- include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include" ] +- sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include/rustc_demangle.h" ] + + libs = [ "z" ] + } +--- a/base/json/json_reader.cc ++++ b/base/json/json_reader.cc +@@ -13,7 +13,7 @@ + #include "base/metrics/histogram_macros.h" + #include "build/build_config.h" + +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + #include "base/strings/string_view_rust.h" + #include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h" + #include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h" +@@ -23,7 +23,7 @@ + + // TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just + // run in-process there. Don't compile base::JSONReader on NaCL at all. +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + + namespace { + using serde_json_lenient::ContextPointer; +@@ -140,7 +140,7 @@ + std::optional JSONReader::Read(std::string_view json, + int options, + size_t max_depth) { +-#if BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) + internal::JSONParser parser(options, max_depth); + return parser.Parse(json); + #else // BUILDFLAG(IS_NACL) +@@ -173,7 +173,7 @@ + JSONReader::Result JSONReader::ReadAndReturnValueWithError( + std::string_view json, + int options) { +-#if BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) + internal::JSONParser parser(options); + auto value = parser.Parse(json); + if (!value) { +@@ -213,7 +213,7 @@ + if (!base::FeatureList::GetInstance()) { + return false; + } +-#if BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) + return false; + #else + return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser); +--- a/base/logging.cc ++++ b/base/logging.cc +@@ -126,7 +126,7 @@ + #include "base/fuchsia/scoped_fx_logger.h" + #endif + +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + #include "base/logging/rust_logger.rs.h" + #endif + +@@ -526,7 +526,7 @@ + } + #endif + +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + // Connects Rust logging with the //base logging functionality. + internal::init_rust_log_crate(); + #endif +--- a/third_party/blink/common/chrome_debug_urls.cc ++++ b/third_party/blink/common/chrome_debug_urls.cc +@@ -11,7 +11,6 @@ + #include "base/threading/platform_thread.h" + #include "build/build_config.h" + #include "third_party/blink/common/crash_helpers.h" +-#include "third_party/blink/common/rust_crash/src/lib.rs.h" + #include "url/gurl.h" + + #if BUILDFLAG(IS_WIN) +@@ -117,7 +116,7 @@ + // Ensure that ASAN works even in Rust code. + LOG(ERROR) << "Intentionally causing ASAN heap overflow in Rust" + << " because user navigated to " << url.spec(); +- crash_in_rust_with_overflow(); ++ //crash_in_rust_with_overflow(); + } + } + #endif // ADDRESS_SANITIZER +@@ -137,7 +136,7 @@ + } else if (url == kChromeUICrashRustURL) { + // Cause a typical crash in Rust code, so we can test that call stack + // collection and symbol mangling work across the language boundary. +- crash_in_rust(); ++ //crash_in_rust(); + } else if (url == kChromeUIDumpURL) { + // This URL will only correctly create a crash dump file if content is + // hosted in a process that has correctly called diff --git a/chromium-93-ffmpeg-4.4.patch b/chromium-93-ffmpeg-4.4.patch index 9abb104..78a584b 100644 --- a/chromium-93-ffmpeg-4.4.patch +++ b/chromium-93-ffmpeg-4.4.patch @@ -21,40 +21,32 @@ Signed-off-by: Marek Behún media/filters/ffmpeg_demuxer.cc | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) -Index: electron-17.1.2/media/filters/audio_decoder_unittest.cc +Index: chromium-126.0.6478.8/media/filters/ffmpeg_demuxer.cc =================================================================== ---- electron-17.1.2.orig/media/filters/audio_decoder_unittest.cc 2022-03-11 08:49:30.740949416 +0100 -+++ electron-17.1.2/media/filters/audio_decoder_unittest.cc 2022-03-11 09:17:36.916088893 +0100 -@@ -102,7 +102,11 @@ void SetDiscardPadding(AVPacket* packet, - } +--- chromium-126.0.6478.8.orig/media/filters/ffmpeg_demuxer.cc ++++ chromium-126.0.6478.8/media/filters/ffmpeg_demuxer.cc +@@ -343,11 +343,19 @@ + } - // If the timestamp is positive, try to use FFmpeg's discard data. + base::span GetSideData(const AVPacket* packet) { +#if LIBAVUTIL_VERSION_MAJOR < 57 -+ int skip_samples_size = 0; ++ int side_data_size = 0; +#else - size_t skip_samples_size = 0; + size_t side_data_size = 0; +#endif - const uint32_t* skip_samples_ptr = - reinterpret_cast(av_packet_get_side_data( - packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); -Index: chromium-118.0.5993.18/media/filters/ffmpeg_demuxer.cc -=================================================================== ---- chromium-118.0.5993.18.orig/media/filters/ffmpeg_demuxer.cc -+++ chromium-118.0.5993.18/media/filters/ffmpeg_demuxer.cc -@@ -398,7 +398,11 @@ void FFmpegDemuxerStream::EnqueuePacket( - - scoped_refptr buffer; + uint8_t* side_data = av_packet_get_side_data( + packet, AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); +#if LIBAVUTIL_VERSION_MAJOR < 57 -+ int side_data_size = 0; ++ return base::span(side_data, base::checked_cast(side_data_size)); +#else - size_t side_data_size = 0; + return base::span(side_data, side_data_size); +#endif - uint8_t* side_data = av_packet_get_side_data( - packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); + } -@@ -461,7 +465,11 @@ void FFmpegDemuxerStream::EnqueuePacket( - side_data + side_data_size); + void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { +@@ -474,7 +482,11 @@ + base::HeapArray::CopiedFrom(side_data); } +#if LIBAVUTIL_VERSION_MAJOR < 57 diff --git a/chromium-vaapi.patch b/chromium-vaapi.patch index 4cb7b10..a9e257d 100644 --- a/chromium-vaapi.patch +++ b/chromium-vaapi.patch @@ -1,71 +1,69 @@ -Index: electron-17.1.0/chrome/browser/about_flags.cc -=================================================================== ---- electron-17.1.0.orig/chrome/browser/about_flags.cc 2022-03-07 17:20:30.424811477 +0100 -+++ electron-17.1.0/chrome/browser/about_flags.cc 2022-03-09 08:25:19.662417046 +0100 -@@ -3822,12 +3822,12 @@ const FeatureEntry kFeatureEntries[] = { +--- src/chrome/browser/about_flags.cc.orig 2025-04-11 12:05:16.388151477 +0200 ++++ src/chrome/browser/about_flags.cc 2025-04-12 12:45:36.431775614 +0200 +@@ -5590,12 +5590,12 @@ const FeatureEntry kFeatureEntries[] = { #endif #endif // BUILDFLAG(IS_ANDROID) #endif // ENABLE_VR --#if BUILDFLAG(IS_CHROMEOS_ASH) -+#if BUILDFLAG(IS_CHROMEOS_ASH) || (defined(OS_LINUX) && !defined(OS_ANDROID)) +-#if BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_CHROMEOS_) || (defined(OS_LINUX) && !defined(OS_ANDROID)) {"disable-accelerated-mjpeg-decode", flag_descriptions::kAcceleratedMjpegDecodeName, - flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS, + flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)}, --#endif // BUILDFLAG(IS_CHROMEOS_ASH) -+#endif // BUILDFLAG(IS_CHROMEOS_ASH) || (defined(OS_LINUX) && !defined(OS_ANDROID)) +-#endif // BUILDFLAG(IS_CHROMEOS) ++#endif // BUILDFLAG(IS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID)) {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)}, ---- src/chrome/browser/flag_descriptions.cc.orig 2024-12-08 18:34:53.268006605 +0100 -+++ src/chrome/browser/flag_descriptions.cc 2025-01-01 20:24:47.007188847 +0100 -@@ -5838,12 +5838,24 @@ const char kUseAngleGL[] = "OpenGL"; +--- src/chrome/browser/flag_descriptions.cc.orig 2025-04-11 12:05:16.849151673 +0200 ++++ src/chrome/browser/flag_descriptions.cc 2025-04-12 12:46:16.943776292 +0200 +@@ -5708,12 +5708,24 @@ const char kUseAngleDefault[] = "Default - #if BUILDFLAG(IS_CHROMEOS_ASH) + #if BUILDFLAG(IS_CHROMEOS) +#endif + +// Chrome OS and Linux -------------------------------------------------------- + -+#if BUILDFLAG(IS_CHROMEOS_ASH) || (defined(OS_LINUX) && !defined(OS_ANDROID)) ++#if BUILDFLAG(IS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID)) + const char kAcceleratedMjpegDecodeName[] = "Hardware-accelerated mjpeg decode for captured frame"; const char kAcceleratedMjpegDecodeDescription[] = - "Enable hardware-accelerated mjpeg decode for captured frame where " + "Enable hardware-accelerated MJPEG decode for captured frame where " "available."; +#endif + +// Chrome OS ------------------------------------------------------------------ + -+#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS) + - const char kAccessibilityFilterKeysName[] = "Filter keys"; - const char kAccessibilityFilterKeysDescription[] = - "Enables settings to filter key presses in various ways, such as slow keys " ---- src/chrome/browser/flag_descriptions.h.orig 2024-12-08 18:34:53.268006605 +0100 -+++ src/chrome/browser/flag_descriptions.h 2025-01-01 20:26:07.993071516 +0100 -@@ -3375,9 +3375,21 @@ extern const char kUseAngleGL[]; + const char kAccessibilityBounceKeysName[] = "Bounce keys"; + const char kAccessibilityBounceKeysDescription[] = + "Enables accessibility settings for bounce keys, which ignores quickly " +--- src/chrome/browser/flag_descriptions.h.orig 2025-04-11 12:05:16.850151673 +0200 ++++ src/chrome/browser/flag_descriptions.h 2025-04-12 12:47:00.923776530 +0200 +@@ -3340,9 +3340,21 @@ extern const char kUseAngleDefault[]; - #if BUILDFLAG(IS_CHROMEOS_ASH) + #if BUILDFLAG(IS_CHROMEOS) +#endif + +// Chrome OS and Linux -------------------------------------------------------- + -+#if BUILDFLAG(IS_CHROMEOS_ASH) || (defined(OS_LINUX) && !defined(OS_ANDROID)) ++#if BUILDFLAG(IS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID)) + extern const char kAcceleratedMjpegDecodeName[]; extern const char kAcceleratedMjpegDecodeDescription[]; +#endif + -+#if BUILDFLAG(IS_CHROMEOS_ASH) ++#if BUILDFLAG(IS_CHROMEOS) + +// Chrome OS ------------------------------------------------------------------ + - extern const char kAccessibilityFilterKeysName[]; - extern const char kAccessibilityFilterKeysDescription[]; + extern const char kAccessibilityBounceKeysName[]; + extern const char kAccessibilityBounceKeysDescription[]; diff --git a/common.gypi-compiler.patch b/common.gypi-compiler.patch index 93c376a..c67f1d7 100644 --- a/common.gypi-compiler.patch +++ b/common.gypi-compiler.patch @@ -1,6 +1,6 @@ ---- src/third_party/electron_node/common.gypi.orig 2024-12-08 18:45:44.261359453 +0100 -+++ src/third_party/electron_node/common.gypi 2024-12-18 11:12:53.414653184 +0100 -@@ -487,10 +487,15 @@ +--- src/third_party/electron_node/common.gypi.orig 2025-04-10 20:07:02.154742467 +0200 ++++ src/third_party/electron_node/common.gypi 2025-04-11 11:45:57.996110023 +0200 +@@ -514,15 +514,19 @@ 'ldflags': [ '-pthread' ], }], [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { @@ -11,14 +11,19 @@ + # `-fvisibility=hidden` is something we're adding to fix downstream overzealous exports. + # The electron headers annotate their visibility correctly, but many third-party code does not which leads to bloated builds. + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-fpic', '-fno-semantic-interposition', '-fvisibility=hidden' ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++20' ], + 'cflags_cc': [ + '-fno-rtti', + '-fno-exceptions', +- '-fno-strict-aliasing', + '-std=gnu++20', + ], 'defines': [ '__STDC_FORMAT_MACROS' ], - 'ldflags': [ '-rdynamic' ], -+ #'ldflags': [ '-rdynamic' ], this is totally bogus — we are building a plugin, not a plugin host ++ #'ldflags': [ '-rdynamic' ], this is totally bogus — we are building a plugin, not a plugin host 'target_conditions': [ # The 1990s toolchain on SmartOS can't handle thin archives. ['_type=="static_library" and OS=="solaris"', { -@@ -670,29 +675,7 @@ +@@ -700,29 +704,7 @@ '-Wl,--export-dynamic', ], }], diff --git a/content_browser_client-incomplete-WebUIController.patch b/content_browser_client-incomplete-WebUIController.patch new file mode 100644 index 0000000..75e3a46 --- /dev/null +++ b/content_browser_client-incomplete-WebUIController.patch @@ -0,0 +1,10 @@ +--- src/content/public/browser/content_browser_client.cc.orig 2025-04-16 14:45:09.657704679 +0200 ++++ src/content/public/browser/content_browser_client.cc 2025-04-17 16:18:19.395831947 +0200 +@@ -53,6 +53,7 @@ + #include "content/public/browser/vpn_service_proxy.h" + #include "content/public/browser/web_contents.h" + #include "content/public/browser/web_contents_view_delegate.h" ++#include "content/public/browser/web_ui_controller.h" + #include "content/public/common/alternative_error_page_override_info.mojom.h" + #include "content/public/common/content_features.h" + #include "content/public/common/url_utils.h" diff --git a/cr130-abseil-remove-unused-deps.patch b/cr130-abseil-remove-unused-deps.patch index 15bc602..348a89a 100644 --- a/cr130-abseil-remove-unused-deps.patch +++ b/cr130-abseil-remove-unused-deps.patch @@ -1,6 +1,6 @@ ---- src/third_party/abseil-cpp/BUILD.gn.orig 2024-12-08 18:35:00.641340155 +0100 -+++ src/third_party/abseil-cpp/BUILD.gn 2025-01-01 21:58:32.559624434 +0100 -@@ -84,13 +83,9 @@ group("absl_component_deps") { +--- src/third_party/abseil-cpp/BUILD.gn.orig 2025-04-11 12:05:22.125274194 +0200 ++++ src/third_party/abseil-cpp/BUILD.gn 2025-04-12 14:23:17.763743696 +0200 +@@ -84,13 +84,9 @@ group("absl_component_deps") { "//third_party/abseil-cpp/absl/hash", "//third_party/abseil-cpp/absl/log:absl_check", "//third_party/abseil-cpp/absl/log:absl_log", @@ -14,7 +14,7 @@ "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/numeric:bits", -@@ -305,8 +288,6 @@ if (absl_build_tests) { +@@ -290,8 +286,6 @@ if (absl_build_tests) { "absl/container:flat_hash_set_test", "absl/container:hash_function_defaults_test", "absl/container:inlined_vector_test", @@ -23,7 +23,7 @@ "absl/container:node_slot_policy_test", "absl/container:raw_hash_set_allocator_test", "absl/container:raw_hash_set_test", -@@ -315,11 +296,8 @@ if (absl_build_tests) { +@@ -300,11 +294,8 @@ if (absl_build_tests) { "absl/crc:crc_cord_state_test", "absl/crc:crc_memcpy_test", "absl/crc:non_temporal_memcpy_test", @@ -35,7 +35,31 @@ "absl/flags:flag_test", "absl/functional:any_invocable_test", "absl/functional:function_ref_test", -@@ -382,11 +360,7 @@ if (absl_build_tests) { +@@ -328,7 +319,6 @@ if (absl_build_tests) { + "absl/log:vlog_is_on_test", + "absl/log/internal:fnmatch_test", + "absl/log/internal:stderr_log_sink_test", +- "absl/log/internal:structured_proto_test", + "absl/memory:memory_test", + "absl/meta:type_traits_test", + "absl/numeric:int128_test", +@@ -336,7 +326,6 @@ if (absl_build_tests) { + "absl/profiling:periodic_sampler_test", + "absl/random:distributions_test", + "absl/random:mock_distributions_test", +- "absl/random/internal:nonsecure_base_test", + "absl/status:status_matchers_test", + "absl/status:status_test", + "absl/status:statusor_test", +@@ -359,7 +348,6 @@ if (absl_build_tests) { + "absl/strings:has_absl_stringify_test", + "absl/strings:has_ostream_operator_test", + "absl/strings:match_test", +- "absl/strings:str_cat_test", + "absl/strings:str_format_arg_test", + "absl/strings:str_format_bind_test", + "absl/strings:str_format_checker_test", +@@ -370,11 +358,7 @@ if (absl_build_tests) { "absl/strings:str_format_test", "absl/strings:str_replace_test", "absl/strings:string_view_test", diff --git a/create_tarball.sh b/create_tarball.sh index 98714b7..110d427 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -232,10 +232,8 @@ keeplibs=( third_party/hunspell #heavily forked version third_party/inspector_protocol #integral part of chrome third_party/ipcz #not in any distro - third_party/jstemplate #javascript third_party/khronos #Modified to add ANGLE definitions third_party/leveldatabase #use of private headers - third_party/libavif #bleeding-edge nightly. try unbundling again when 1.1 gets released third_party/libgav1 #Usage of private headers (ObuFrameHeader from utils/types.h) third_party/libsrtp #Needs to be built against boringssl, not openssl third_party/libsync #not yet in any distro @@ -276,9 +274,11 @@ keeplibs=( third_party/rapidhash #Fork third_party/re2 # fedora too old third_party/rnnoise #use of private headers + third_party/search_engines_data #integral part of chromium (but should not be?). was under components/ before E35, see https://github.com/chromium/chromium/commit/b8a327a1aa0227cf96dbbe0ad55f1c2773b23c23 + third_party/simdutf #Not in Factory third_party/skia #integral part of chrome third_party/speech-dispatcher #Headers for a delay-loaded optional dependency - third_party/spirv-headers + third_party/spirv-headers #15.6 too old third_party/sqlite #heavily forked version third_party/swiftshader #not available as a shared library third_party/swiftshader/third_party/astc-encoder #not in rawhide or factory. Debian has it (astc-encoder) @@ -307,14 +307,14 @@ keeplibs=( third_party/wayland-protocols/unstable #unknown origin. not in wayland-protocol-devel or elsewhere third_party/wuffs #not in any distro third_party/x11proto #derived code, not vendored dep - third_party/zlib/contrib/minizip #https://bugzilla.redhat.com/show_bug.cgi?id=2240599 https://github.com/zlib-ng/minizip-ng/issues/447 third_party/zlib/google #derived code, not vendored dep url/third_party/mozilla #derived code, not vendored dep - v8/src/third_party/siphash #derived code, not vendored dep - v8/src/third_party/utf8-decoder #derived code, not vendored dep - v8/src/third_party/valgrind #incompatible definition of VALGRIND_DISCARD_TRANSLATIONS v8/third_party/inspector_protocol #integral part of chrome + v8/third_party/rapidhash-v8 #derived code, not vendored dep + v8/third_party/siphash #derived code, not vendored dep + v8/third_party/utf8-decoder #derived code, not vendored dep v8/third_party/v8 #derived code, not vendored dep + v8/third_party/valgrind #incompatible definition of VALGRIND_DISCARD_TRANSLATIONS ) build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove if [ $? -ne 0 ]; then @@ -330,6 +330,7 @@ find third_party/electron_node/deps/cares -type f ! -name "*.gn" -a ! -name "*.g find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/ngtcp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete rm -rvf third_party/electron_node/deps/v8/tools ln -srv v8/tools -t third_party/electron_node/deps/v8/ diff --git a/css_shape_value-constructor.patch b/css_shape_value-constructor.patch new file mode 100644 index 0000000..693ebe3 --- /dev/null +++ b/css_shape_value-constructor.patch @@ -0,0 +1,11 @@ +--- src/third_party/blink/renderer/core/css/css_shape_value.h.orig 2025-04-16 14:36:32.392070147 +0200 ++++ src/third_party/blink/renderer/core/css/css_shape_value.h 2025-04-16 22:22:56.896578913 +0200 +@@ -96,7 +96,7 @@ using CSSShapeControlPoint = std::pair + class CSSShapeCurveCommand : public CSSShapeCommand { + public: +- CSSShapeCurveCommand<1>(Type type, ++ CSSShapeCurveCommand(Type type, + const CSSValuePair& end_point, + const CSSShapeControlPoint control_point) + : CSSShapeCommand(type, end_point), control_points_{control_point} {} diff --git a/delete-old-language-detection-which-uses-tflite.patch b/delete-old-language-detection-which-uses-tflite.patch index b5b5214..75b42e3 100644 --- a/delete-old-language-detection-which-uses-tflite.patch +++ b/delete-old-language-detection-which-uses-tflite.patch @@ -55,122 +55,3 @@ index 21470f0869cfda..21772fce07cc5e 100644 "language_translator.cc", "language_translator.h", "translation.cc", -diff --git a/third_party/blink/renderer/modules/on_device_translation/translation.h b/third_party/blink/renderer/modules/on_device_translation/translation.h -index 0a0f54be56787a..e19db842628997 100644 ---- a/third_party/blink/renderer/modules/on_device_translation/translation.h -+++ b/third_party/blink/renderer/modules/on_device_translation/translation.h -@@ -18,7 +18,6 @@ - #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" - - namespace blink { --class LanguageDetector; - class LanguageTranslator; - class V8TranslationAvailability; - -@@ -43,12 +42,6 @@ class Translation final : public ScriptWrappable, - ScriptState* script_state, - TranslationLanguageOptions* options, - ExceptionState& exception_state); -- ScriptPromise canDetect( -- ScriptState* script_state, -- ExceptionState& exception_state); -- ScriptPromise createDetector( -- ScriptState* script_state, -- ExceptionState& exception_state); - - private: - HeapMojoRemote& -diff --git a/third_party/blink/renderer/modules/on_device_translation/translation.idl b/third_party/blink/renderer/modules/on_device_translation/translation.idl -index a27472ece123df..b9c74c41d4c406 100644 ---- a/third_party/blink/renderer/modules/on_device_translation/translation.idl -+++ b/third_party/blink/renderer/modules/on_device_translation/translation.idl -@@ -31,20 +31,4 @@ interface Translation { - Promise createTranslator( - TranslationLanguageOptions options - ); -- [ -- RuntimeEnabled=LanguageDetectionAPI, -- Exposed=Window, -- Measure, -- CallWith=ScriptState, -- RaisesException -- ] -- Promise canDetect(); -- [ -- RuntimeEnabled=LanguageDetectionAPI, -- Exposed=Window, -- Measure, -- CallWith=ScriptState, -- RaisesException -- ] -- Promise createDetector(); - }; ---- src/third_party/blink/renderer/modules/on_device_translation/language_detector.idl.orig 2025-01-02 22:23:59.384885429 +0100 -+++ src/third_party/blink/renderer/modules/on_device_translation/language_detector.idl 2025-01-03 22:57:39.104809606 +0100 -@@ -8,16 +8,3 @@ dictionary LanguageDetectionResult { - DOMString? detectedLanguage; - double confidence; - }; -- --[ -- RuntimeEnabled=LanguageDetectionAPI, -- Exposed=Window --] --interface LanguageDetector { -- [ -- Measure, -- CallWith=ScriptState, -- RaisesException -- ] -- Promise> detect(DOMString input); --}; ---- src/third_party/blink/renderer/modules/on_device_translation/translation.cc.orig 2025-01-02 22:23:59.384885429 +0100 -+++ src/third_party/blink/renderer/modules/on_device_translation/translation.cc 2025-01-03 23:11:15.414694080 +0100 -@@ -10,7 +10,6 @@ - #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" - #include "third_party/blink/renderer/bindings/modules/v8/v8_translation_language_options.h" - #include "third_party/blink/renderer/core/execution_context/execution_context.h" --#include "third_party/blink/renderer/modules/on_device_translation/language_detector.h" - #include "third_party/blink/renderer/modules/on_device_translation/language_translator.h" - #include "third_party/blink/renderer/platform/bindings/exception_state.h" - #include "third_party/blink/renderer/platform/bindings/script_state.h" -@@ -116,39 +115,4 @@ ScriptPromise Transl - return promise; - } - --ScriptPromise Translation::canDetect( -- ScriptState* script_state, -- ExceptionState& exception_state) { -- if (!script_state->ContextIsValid()) { -- exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, -- "The execution context is not valid."); -- return ScriptPromise(); -- } -- -- auto* resolver = -- MakeGarbageCollected>( -- script_state); -- auto promise = resolver->Promise(); -- -- resolver->Resolve( -- V8TranslationAvailability(V8TranslationAvailability::Enum::kReadily)); -- -- return promise; --} -- --ScriptPromise Translation::createDetector( -- ScriptState* script_state, -- ExceptionState& exception_state) { -- if (!script_state->ContextIsValid()) { -- exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, -- "The execution context is not valid."); -- return ScriptPromise(); -- } -- -- auto* resolver = -- MakeGarbageCollected>( -- script_state); -- resolver->Resolve(MakeGarbageCollected()); -- return resolver->Promise(); --} - } // namespace blink diff --git a/disable-FFmpegAllowLists.patch b/disable-FFmpegAllowLists.patch index cf28a81..e04934a 100644 --- a/disable-FFmpegAllowLists.patch +++ b/disable-FFmpegAllowLists.patch @@ -1,12 +1,11 @@ -diff -up chromium-125.0.6422.41/media/base/media_switches.cc.disable-FFmpegAllowLists chromium-125.0.6422.41/media/base/media_switches.cc ---- chromium-125.0.6422.41/media/base/media_switches.cc.disable-FFmpegAllowLists 2024-05-12 21:28:43.694027396 +0200 -+++ chromium-125.0.6422.41/media/base/media_switches.cc 2024-05-12 21:32:48.155063623 +0200 -@@ -1753,7 +1753,7 @@ BASE_FEATURE(kUseWindowBoundsForPip, - // Enables FFmpeg allow lists for supported codecs / containers. - BASE_FEATURE(kFFmpegAllowLists, - "FFmpegAllowLists", -- base::FEATURE_ENABLED_BY_DEFAULT); -+ base::FEATURE_DISABLED_BY_DEFAULT); - - #if BUILDFLAG(IS_WIN) - // Enables audio offload when supported by endpoints. +--- src/media/ffmpeg/ffmpeg_common.cc.orig 2025-04-11 12:05:21.289638236 +0200 ++++ src/media/ffmpeg/ffmpeg_common.cc 2025-04-12 12:23:36.647784415 +0200 +@@ -76,7 +76,7 @@ const char* GetAllowedVideoDecoders() { + void ApplyCodecContextSecuritySettings(AVCodecContext* codec_context) { + // Future versions of ffmpeg may copy the allow list from the format + // context. +- if (!codec_context->codec_whitelist) { ++ if (false) { + // Note: FFmpeg will try to free this string, so we must duplicate it. + codec_context->codec_whitelist = + av_strdup(codec_context->codec_type == AVMEDIA_TYPE_AUDIO diff --git a/disable-avif-really.patch b/disable-avif-really.patch new file mode 100644 index 0000000..c8f2a38 --- /dev/null +++ b/disable-avif-really.patch @@ -0,0 +1,39 @@ +Cleanup after chromium-127-crabby.patch +Do not advertise AVIF support to allow for graceful degradation. + +diff '--color=auto' -urp src/content/common/content_constants_internal.cc src.new/content/common/content_constants_internal.cc +--- src/content/common/content_constants_internal.cc 2025-04-21 18:29:19.250307076 +0200 ++++ src.new/content/common/content_constants_internal.cc 2025-04-23 18:12:33.518743675 +0200 +@@ -11,7 +11,7 @@ namespace content { + // 20MiB + const size_t kMaxLengthOfDataURLString = 1024 * 1024 * 20; + +-#if BUILDFLAG(ENABLE_AV1_DECODER) ++#if 0 + const char kFrameAcceptHeaderValue[] = + "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif," + "image/webp,image/apng,*/*;q=0.8"; +diff '--color=auto' -urp src/third_party/blink/common/loader/network_utils.cc src.new/third_party/blink/common/loader/network_utils.cc +--- src/third_party/blink/common/loader/network_utils.cc 2025-04-21 18:29:25.994307178 +0200 ++++ src.new/third_party/blink/common/loader/network_utils.cc 2025-04-23 18:12:48.166740983 +0200 +@@ -34,7 +34,7 @@ bool AlwaysAccessNetwork( + } + + const char* ImageAcceptHeader() { +-#if BUILDFLAG(ENABLE_AV1_DECODER) ++#if 0 + return "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"; + #else + return "image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"; +diff '--color=auto' -urp src/third_party/blink/common/mime_util/mime_util.cc src.new/third_party/blink/common/mime_util/mime_util.cc +--- src/third_party/blink/common/mime_util/mime_util.cc 2025-04-21 18:29:26.002307178 +0200 ++++ src.new/third_party/blink/common/mime_util/mime_util.cc 2025-04-23 18:13:01.090738191 +0200 +@@ -41,7 +41,7 @@ constexpr auto kSupportedImageTypes = ba + "image/x-icon", // ico + "image/x-xbitmap", // xbm + "image/x-png", +-#if BUILDFLAG(ENABLE_AV1_DECODER) ++#if 0 + "image/avif", + #endif + }); diff --git a/disable-catapult.patch b/disable-catapult.patch index 56eba04..115c0e4 100644 --- a/disable-catapult.patch +++ b/disable-catapult.patch @@ -144,21 +144,19 @@ author: Michael Gilbert ] data_deps = [ "//testing:test_scripts_shared" ] } ---- a/tools/gritsettings/resource_ids.spec -+++ b/tools/gritsettings/resource_ids.spec -@@ -755,12 +755,6 @@ - "content/test/web_ui_mojo_test_resources.grd": { - "includes": [7340], +--- src/tools/gritsettings/resource_ids.spec.orig 2025-04-11 12:29:49.277239656 +0200 ++++ src/tools/gritsettings/resource_ids.spec 2025-04-11 12:30:15.524243417 +0200 +@@ -1248,10 +1248,6 @@ + "META": {"sizes": {"includes": [20]}}, + "includes": [8280], }, -- -- # This file is generated during the build. - "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": { - "META": {"sizes": {"includes": [20],}}, -- "includes": [7360], +- "includes": [8300], - }, - # END content/ section. - - # START "everything else" section. + "<(SHARED_INTERMEDIATE_DIR)/content/browser/webrtc/resources/resources.grd": { + "META": {"sizes": {"includes": [20],}}, + "includes": [8320], --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -2530,7 +2530,6 @@ source_set("browser") { @@ -315,17 +313,17 @@ author: Michael Gilbert "//third_party/perfetto/src/trace_processor:trace_processor_shell", ] data = [ ---- a/electron/electron_paks.gni -+++ b/electron/electron_paks.gni -@@ -57,7 +57,6 @@ - "$root_gen_dir/chrome/dev_ui_browser_resources.pak", +--- src/electron/electron_paks.gni.orig 2025-04-11 12:02:41.243100651 +0200 ++++ src/electron/electron_paks.gni 2025-04-11 12:28:19.897748625 +0200 +@@ -57,7 +57,6 @@ template("electron_extra_paks") { + "$root_gen_dir/chrome/common_resources.pak", "$root_gen_dir/components/components_resources.pak", "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak", - "$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak", "$root_gen_dir/content/content_resources.pak", "$root_gen_dir/content/gpu_resources.pak", -@@ -73,7 +72,6 @@ +@@ -76,7 +75,6 @@ template("electron_extra_paks") { "//content/browser/resources/gpu:resources", "//content/browser/resources/media:resources", "//content/browser/resources/process:resources", diff --git a/disable-webspeech.patch b/disable-webspeech.patch index 06f4b00..774d8a7 100644 --- a/disable-webspeech.patch +++ b/disable-webspeech.patch @@ -101,9 +101,9 @@ Reviewed-by: Allan Sandfeld Jensen if ((is_linux || is_chromeos) && use_dbus) { deps += [ "//dbus" ] } ---- src/content/browser/browser_interface_binders.cc.orig 2024-12-08 18:34:57.541340064 +0100 -+++ src/content/browser/browser_interface_binders.cc 2024-12-18 12:22:33.827251622 +0100 -@@ -59,7 +59,9 @@ +-- src/content/browser/browser_interface_binders.cc.orig 2025-04-11 12:05:19.980351905 +0200 ++++ src/content/browser/browser_interface_binders.cc 2025-04-11 19:48:15.944587282 +0200 +@@ -61,7 +61,9 @@ #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/service_worker/service_worker_host.h" #include "content/browser/shared_storage/shared_storage_worklet_host.h" @@ -113,7 +113,7 @@ Reviewed-by: Allan Sandfeld Jensen #include "content/browser/storage_access/storage_access_handle.h" #include "content/browser/tracing/trace_report/trace_report.mojom.h" #include "content/browser/tracing/trace_report/trace_report_internals_ui.h" -@@ -98,7 +100,9 @@ +@@ -100,7 +102,9 @@ #include "media/mojo/mojom/media_metrics_provider.mojom.h" #include "media/mojo/mojom/media_player.mojom.h" #include "media/mojo/mojom/remoting.mojom.h" @@ -123,7 +123,7 @@ Reviewed-by: Allan Sandfeld Jensen #include "media/mojo/mojom/video_decode_perf_history.mojom.h" #include "media/mojo/mojom/video_encoder_metrics_provider.mojom.h" #include "media/mojo/mojom/webrtc_video_perf.mojom.h" -@@ -203,7 +207,9 @@ +@@ -206,7 +210,9 @@ #else // BUILDFLAG(IS_ANDROID) #include "content/browser/direct_sockets/direct_sockets_service_impl.h" #include "media/mojo/mojom/renderer_extensions.mojom.h" @@ -133,20 +133,21 @@ Reviewed-by: Allan Sandfeld Jensen #include "third_party/blink/public/mojom/hid/hid.mojom.h" #include "third_party/blink/public/mojom/installedapp/installed_app_provider.mojom.h" #include "third_party/blink/public/mojom/serial/serial.mojom.h" -@@ -860,10 +866,12 @@ void PopulateFrameBinders(RenderFrameHos +@@ -865,11 +871,13 @@ void PopulateFrameBinders(RenderFrameHos map->Add( base::BindRepeating(&BindSharedWorkerConnector, base::Unretained(host))); +#if BUILDFLAG(ENABLE_WEB_SPEECH) map->Add( base::BindRepeating(&SpeechRecognitionDispatcherHost::Create, - host->GetProcess()->GetID(), host->GetRoutingID()), + host->GetProcess()->GetDeprecatedID(), + host->GetRoutingID()), GetIOThreadTaskRunner({})); +#endif map->Add(base::BindRepeating( &RenderFrameHostImpl::GetSpeechSynthesis, base::Unretained(host))); -@@ -1163,6 +1171,7 @@ void PopulateBinderMapWithContext( +@@ -1197,6 +1205,7 @@ void PopulateBinderMapWithContext( #if !BUILDFLAG(IS_ANDROID) map->Add( base::BindRepeating(&DirectSocketsServiceImpl::CreateForFrame)); @@ -154,7 +155,7 @@ Reviewed-by: Allan Sandfeld Jensen map->Add(base::BindRepeating( &EmptyBinderForFrame)); map->Add( -@@ -1174,6 +1183,7 @@ void PopulateBinderMapWithContext( +@@ -1208,6 +1217,7 @@ void PopulateBinderMapWithContext( map->Add(base::BindRepeating( &EmptyBinderForFrame)); #endif @@ -236,12 +237,12 @@ index 3a2e713ccc3..6af5afde20e 100644 {wrf::EnableSharedWorker, switches::kDisableSharedWorkers, false}, diff --git a/chromium/media/BUILD.gn b/chromium/media/BUILD.gn index 01e0910666e..6ce78127e3f 100644 ---- a/media/BUILD.gn -+++ b/media/BUILD.gn -@@ -47,6 +47,7 @@ buildflag_header("media_buildflags") { - "ENABLE_PLATFORM_MPEG_H_AUDIO=$enable_platform_mpeg_h_audio", +--- src/media/BUILD.gn 2025-04-11 12:05:21.244153535 +0200 ++++ src/media/BUILD.gn 2025-04-11 19:48:51.764578046 +0200 +@@ -61,6 +61,7 @@ buildflag_header("media_buildflags") { "ENABLE_MSE_MPEG2TS_STREAM_PARSER=$enable_mse_mpeg2ts_stream_parser", - "PLATFORM_HAS_OPTIONAL_HEVC_SUPPORT=$platform_has_optional_hevc_support", + "PLATFORM_HAS_OPTIONAL_HEVC_DECODE_SUPPORT=$platform_has_optional_hevc_decode_support", + "PLATFORM_HAS_OPTIONAL_HEVC_ENCODE_SUPPORT=$platform_has_optional_hevc_encode_support", + "ENABLE_WEB_SPEECH=$enable_web_speech", "USE_ARC_PROTECTED_MEDIA=$use_arc_protected_media", "USE_CHROMEOS_MEDIA_ACCELERATION=$use_vaapi||$use_v4l2_codec", diff --git a/electron-33.4.10.tar.zst b/electron-33.4.10.tar.zst deleted file mode 100644 index d3194b5..0000000 --- a/electron-33.4.10.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cea37fe7429268baea5169fde8341775d510c1a2450d924fe85315d58b14cfb7 -size 691226562 diff --git a/electron-35.2.1.tar.zst b/electron-35.2.1.tar.zst new file mode 100644 index 0000000..2ba9052 --- /dev/null +++ b/electron-35.2.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88c862afb7258a3c9b2ca823f4d6077e59065ba830d0edf974a8b7ecfceaf022 +size 753660040 diff --git a/exception_state-constexpr-initializer.patch b/exception_state-constexpr-initializer.patch new file mode 100644 index 0000000..0359f2d --- /dev/null +++ b/exception_state-constexpr-initializer.patch @@ -0,0 +1,15 @@ +In file included from ../../third_party/blink/renderer/platform/bindings/bigint.cc:7: +../../third_party/blink/renderer/platform/bindings/exception_state.h:136:37: error: ‘constexpr’ static data member ‘kEmptyContext’ must have an initializer + 136 | static constexpr ExceptionContext kEmptyContext; + +--- src/third_party/blink/renderer/platform/bindings/exception_state.h.orig 2025-04-16 14:36:33.017070028 +0200 ++++ src/third_party/blink/renderer/platform/bindings/exception_state.h 2025-04-16 20:05:07.925331205 +0200 +@@ -133,7 +133,7 @@ class PLATFORM_EXPORT ExceptionState { + // Delegated constructor for DummyExceptionStateForTesting + explicit ExceptionState(DummyExceptionStateForTesting& dummy_derived); + +- static constexpr ExceptionContext kEmptyContext; ++ static constexpr ExceptionContext kEmptyContext{}; + + private: + void SetExceptionInfo(ExceptionCode, const String&); diff --git a/fix-build-without-pdf.patch b/fix-build-without-pdf.patch new file mode 100644 index 0000000..20ac0c8 --- /dev/null +++ b/fix-build-without-pdf.patch @@ -0,0 +1,19 @@ +--- src/chrome/browser/ui/lens/BUILD.gn.orig 2025-04-11 12:05:17.505799730 +0200 ++++ src/chrome/browser/ui/lens/BUILD.gn 2025-04-12 13:42:57.195753884 +0200 +@@ -276,13 +276,15 @@ source_set("interactive_ui_tests") { + "//components/feature_engagement/public", + "//components/lens:enterprise_policy", + "//components/lens:features", +- "//components/pdf/browser:browser", + "//components/prefs", + "//components/search_engines", + "//components/user_education/views", + "//content/test:test_support", + "//testing/gtest", + ] ++ if (enable_pdf) { ++ deps += [ "//components/pdf/browser:browser" ] ++ } + } + + source_set("unit_tests") { diff --git a/fix-build-without-screen-ai.patch b/fix-build-without-screen-ai.patch index e344356..296f303 100644 --- a/fix-build-without-screen-ai.patch +++ b/fix-build-without-screen-ai.patch @@ -1,6 +1,6 @@ ---- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 -+++ src/chrome/test/BUILD.gn 2025-01-01 20:54:36.278270275 +0100 -@@ -1959,9 +1959,6 @@ if (!is_android) { +--- src/chrome/test/BUILD.gn.orig 2025-04-11 12:13:12.932314099 +0200 ++++ src/chrome/test/BUILD.gn 2025-04-12 13:00:11.499771987 +0200 +@@ -2079,9 +2079,6 @@ if (!is_android) { "//chrome/browser/resource_coordinator:tab_manager_features", "//chrome/browser/safe_browsing:advanced_protection", "//chrome/browser/safe_browsing:verdict_cache_manager_factory", @@ -10,7 +10,7 @@ "//chrome/browser/search", "//chrome/browser/search_engines", "//chrome/browser/segmentation_platform:test_utils", -@@ -2334,9 +2331,6 @@ if (!is_android) { +@@ -2485,9 +2482,6 @@ if (!is_android) { "//services/network/public/proto:sct_audit_report_proto", "//services/preferences/public/cpp", "//services/preferences/public/cpp/tracked", @@ -20,7 +20,15 @@ "//services/service_manager/public/cpp", "//services/strings", "//services/test/echo/public/mojom", -@@ -8373,7 +8367,6 @@ test("unit_tests") { +@@ -8027,7 +8021,6 @@ test("unit_tests") { + + # Non-android deps for "unit_tests" target. + deps += [ +- "../browser/screen_ai:screen_ai_install_state", + "//chrome/browser/apps:icon_standardizer", + "//chrome/browser/apps/app_service", + "//chrome/browser/apps/app_service:app_registry_cache_waiter", +@@ -8172,7 +8165,6 @@ test("unit_tests") { "//services/device/public/cpp/bluetooth", "//services/metrics/public/cpp:ukm_builders", "//services/network:test_support", @@ -28,9 +36,36 @@ "//services/video_effects/test:test_support", "//third_party/crashpad/crashpad/util", "//third_party/libaddressinput", ---- src/chrome/browser/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 -+++ src/chrome/browser/BUILD.gn 2025-01-01 21:05:47.125477818 +0100 -@@ -4343,9 +4343,6 @@ static_library("browser") { +@@ -8445,7 +8437,6 @@ test("unit_tests") { + "//chrome/browser/push_notification", + "//chrome/browser/push_notification:test_support", + "//chrome/browser/push_notification/protos:proto", +- "//chrome/browser/screen_ai/public:test_support", + "//chrome/browser/smart_card:smart_card", + "//chrome/browser/task_manager:impl", + "//chrome/browser/ui/ash:test_support", +@@ -8591,7 +8582,6 @@ test("unit_tests") { + "//chrome/browser/nearby_sharing/contacts:unit_tests", + "//chrome/browser/nearby_sharing/local_device_data:unit_tests", + "//chrome/browser/policy:unit_tests", +- "//chrome/browser/screen_ai:unit_tests", + "//chrome/browser/smart_card:unit_tests", + "//chrome/browser/support_tool/ash:unit_tests", + "//chrome/browser/ui/ash:unit_tests", +--- src/chrome/browser/BUILD.gn.orig 2025-04-11 12:13:12.927314100 +0200 ++++ src/chrome/browser/BUILD.gn 2025-04-12 13:12:42.819768051 +0200 +@@ -4228,10 +4228,6 @@ static_library("browser") { + "//chrome/browser/new_tab_page/chrome_colors", + "//chrome/browser/policy:path_parser", + "//chrome/browser/resources:component_extension_resources", +- "//chrome/browser/screen_ai:prefs", +- "//chrome/browser/screen_ai:screen_ai_install_state", +- "//chrome/browser/screen_ai:screen_ai_service_router_factory", +- "//chrome/browser/screen_ai/public:optical_character_recognizer", + "//chrome/browser/search/background", + "//chrome/browser/smart_card", + "//chrome/browser/themes", +@@ -4357,9 +4353,6 @@ static_library("browser") { "//components/webauthn/core/browser:passkey_model", "//services/device/public/cpp/bluetooth", "//services/device/public/cpp/hid", @@ -98,3 +133,42 @@ ] configs += [ "//build/config/compiler:wexit_time_destructors" ] +--- src/chrome/browser/profiles/BUILD.gn.orig 2025-04-11 12:05:17.028151748 +0200 ++++ src/chrome/browser/profiles/BUILD.gn 2025-04-12 13:17:59.379764245 +0200 +@@ -302,7 +302,6 @@ source_set("profiles_extra_parts_impl") + "//chrome/browser/feedback", + "//chrome/browser/hid", + "//chrome/browser/media/router/discovery/access_code:access_code_sink_service", +- "//chrome/browser/screen_ai:screen_ai_service_router_factory", + "//chrome/browser/search", + "//chrome/browser/search/background", + "//chrome/browser/search_engine_choice", +--- src/chrome/browser/prefs/BUILD.gn.orig 2025-04-11 12:05:17.010048233 +0200 ++++ src/chrome/browser/prefs/BUILD.gn 2025-04-12 13:20:41.959768617 +0200 +@@ -265,7 +265,6 @@ source_set("impl") { + } else { + deps += [ + "//chrome/browser/promos:utils", +- "//chrome/browser/screen_ai:prefs", + "//chrome/browser/search/background", + "//chrome/browser/search_engine_choice", + "//chrome/browser/search_engines", +--- src/chrome/browser/ui/BUILD.gn.orig 2025-04-11 12:05:17.331313863 +0200 ++++ src/chrome/browser/ui/BUILD.gn 2025-04-12 13:26:46.759762260 +0200 +@@ -1705,8 +1705,6 @@ static_library("ui") { + "//chrome/browser/reading_list", + "//chrome/browser/safe_browsing", + "//chrome/browser/safe_browsing:advanced_protection", +- "//chrome/browser/screen_ai:screen_ai_install_state", +- "//chrome/browser/screen_ai:screen_ai_service_router_factory", + "//chrome/browser/smart_card:smart_card", + "//chrome/browser/tab_group_sync:utils", + "//chrome/browser/themes", +@@ -2376,7 +2374,6 @@ static_library("ui") { + "//chrome/browser/policy:onc", + "//chrome/browser/policy:system_features_disable_list", + "//chrome/browser/push_notification:push_notification", +- "//chrome/browser/screen_ai/public:optical_character_recognizer", + "//chrome/browser/ui/ash/accessibility", + "//chrome/browser/ui/ash/app_access", + "//chrome/browser/ui/ash/arc", diff --git a/fix-build-without-supervised-users.patch b/fix-build-without-supervised-users.patch index 7b77871..bd2d9e5 100644 --- a/fix-build-without-supervised-users.patch +++ b/fix-build-without-supervised-users.patch @@ -48,12 +48,12 @@ assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") generate_allowlist_from_histograms_file("webui_name_variants") { ---- src/chrome/browser/extensions/BUILD.gn.orig 2024-12-08 18:34:53.171339936 +0100 -+++ src/chrome/browser/extensions/BUILD.gn 2024-12-18 13:09:34.948061857 +0100 +--- src/chrome/browser/extensions/BUILD.gn.orig 2025-04-11 12:05:16.772151640 +0200 ++++ src/chrome/browser/extensions/BUILD.gn 2025-04-11 20:28:31.291951121 +0200 @@ -20,7 +20,6 @@ import("//testing/libfuzzer/fuzzer_test. import("//third_party/protobuf/proto_library.gni") - assert(enable_extensions) + assert(enable_extensions_core) -assert(enable_supervised_users) assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome") diff --git a/fix-build-without-video-effects.patch b/fix-build-without-video-effects.patch new file mode 100644 index 0000000..40c3fe9 --- /dev/null +++ b/fix-build-without-video-effects.patch @@ -0,0 +1,40 @@ +From 09a3abf8f4aca3b00ccbabc860b0819d7e3ea206 Mon Sep 17 00:00:00 2001 +From: Yunsik Jung +Date: Fri, 21 Mar 2025 08:12:22 -0700 +Subject: [PATCH] Fix build error when "enable_video_effects=false" in Linux + +kVideoEffects is engaged even when ENABLE_VIDEO_EFFECTS is false. +(https://crrev.com/c/5898146) +However, "video_effects_sandbox_hook_linux.h" is not included when +ENABLE_VIDEO_EFFECTS is false which caused build error. + +Thus, include "video_effects_sandbox_hook_linux.h" in Linux regardless +of ENABLE_VIDEO_EFFECTS. + +Bug: N/A +Change-Id: If0bb3f1b391a7960ee8ff9ad83d8c858a24cedb5 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6380633 +Reviewed-by: Rakina Zata Amni +Reviewed-by: Dave Tapuska +Commit-Queue: Dave Tapuska +Cr-Commit-Position: refs/heads/main@{#1436051} +--- + content/utility/utility_main.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc +index 7456eab4558962..ffb16be8ce8541 100644 +--- a/content/utility/utility_main.cc ++++ b/content/utility/utility_main.cc +@@ -66,9 +66,9 @@ + + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + +-#if BUILDFLAG(ENABLE_VIDEO_EFFECTS) && BUILDFLAG(IS_LINUX) ++#if BUILDFLAG(IS_LINUX) + #include "services/video_effects/video_effects_sandbox_hook_linux.h" // nogncheck +-#endif // BUILDFLAG(ENABLE_VIDEO_EFFECTS) && BUILDFLAG(IS_LINUX) ++#endif // BUILDFLAG(IS_LINUX) + + #if BUILDFLAG(IS_CHROMEOS) + #include "chromeos/ash/components/assistant/buildflags.h" diff --git a/fix-system-highway.patch b/fix-system-highway.patch new file mode 100644 index 0000000..42f4f90 --- /dev/null +++ b/fix-system-highway.patch @@ -0,0 +1,8 @@ +--- src/build/linux/unbundle/highway.gn.orig 2025-04-11 12:05:15.714160237 +0200 ++++ src/build/linux/unbundle/highway.gn 2025-04-12 14:26:12.155738961 +0200 +@@ -18,3 +18,5 @@ source_set("libhwy") { + public_configs = [ ":libhwy_external_config" ] + public_deps = [ ":libhwy_shim" ] + } ++ ++source_set("highway_tests") {} diff --git a/fpic.patch b/fpic.patch index e14a8fb..06aefb2 100644 --- a/fpic.patch +++ b/fpic.patch @@ -73,9 +73,9 @@ Use -fpic for code which goes only in dlls (gives smaller code), sources = [ "compression_utils_portable.cc", "compression_utils_portable.h", ---- src/ui/qt/BUILD.gn.old 2022-12-02 23:49:17.792117400 +0100 -+++ src/ui/qt/BUILD.gn 2022-12-04 14:32:48.407196100 +0100 -@@ -43,6 +43,8 @@ +--- src/ui/qt/BUILD.gn.orig 2025-04-10 19:56:03.150817690 +0200 ++++ src/ui/qt/BUILD.gn 2025-04-11 11:42:11.904342754 +0200 +@@ -39,6 +39,8 @@ source_set("qt_interface") { # target instead. public = [ "qt_interface.h" ] sources = [ "qt_interface.cc" ] @@ -84,7 +84,7 @@ Use -fpic for code which goes only in dlls (gives smaller code), } template("qt_shim") { -@@ -76,6 +78,8 @@ +@@ -99,6 +101,8 @@ template("qt_shim") { sources += get_target_outputs(":generate_moc" + invoker.qt_version) deps += [ ":generate_moc" + invoker.qt_version ] } @@ -92,7 +92,7 @@ Use -fpic for code which goes only in dlls (gives smaller code), + asmflags = ["-fpic", "-fno-semantic-interposition"] } } - qt_shim("qt5_shim") { + if (use_qt5) { --- src/third_party/abseil-cpp/BUILD.gn.old +++ src/third_party/abseil-cpp/BUILD.gn @@ -132,6 +132,8 @@ config("absl_define_config") { diff --git a/gn-logspam-breaks-install.patch b/gn-logspam-breaks-install.patch new file mode 100644 index 0000000..5734d5e --- /dev/null +++ b/gn-logspam-breaks-install.patch @@ -0,0 +1,21 @@ +Threatening downstream maintainers on stdout may be fun, but it breaks `gn desc` which we call in %install + +--- src/build/config/c++/c++.gni 2025-04-16 14:36:21.927410223 +0200 ++++ src/build/config/c++/c++.gni 2025-04-19 00:11:43.759874434 +0200 +@@ -110,16 +110,3 @@ assert(!(is_ios && libcxx_is_shared), + + # Chromium will require using its libc++ library implementation. Warn if the + # current configuration is not using it. +-if ((!use_custom_libcxx || !use_custom_libcxx_for_host) && +- # Standalone use of //build outside of Chromium can disable libc++. +- build_with_chromium && +- # Try to avoid spamming the console lots. It's not actually +- # toolchain-specific. +- current_toolchain == default_toolchain) { +- print("*********************************************************************") +- print("WARNING: Support for linking against a C++ standard library other ") +- print(" than the one in-tree (buildtools/third_party/libc++) is deprecated") +- print(" and support for this will end. We plan to remove this option in ") +- print(" M138.") +- print("*********************************************************************") +-} diff --git a/macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch b/macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch new file mode 100644 index 0000000..02b860c --- /dev/null +++ b/macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch @@ -0,0 +1,26 @@ +--- src/v8/src/codegen/riscv/macro-assembler-riscv.h.orig 2025-04-24 18:27:30.451008724 +0200 ++++ src/v8/src/codegen/riscv/macro-assembler-riscv.h 2025-04-24 23:48:27.554835902 +0200 +@@ -400,10 +400,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : + push_helper(rs...); + } + +- template <> +- void push_helper(Register r) { +- StoreWord(r, MemOperand(sp, 0)); +- } ++ void push_helper() {} + + public: + // Push a number of registers. The leftmost register first (to the highest +@@ -548,10 +545,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : + LoadWord(r, MemOperand(sp, sizeof...(rs) * kSystemPointerSize)); + } + +- template <> +- void pop_helper(Register r) { +- LoadWord(r, MemOperand(sp, 0)); +- } ++ void pop_helper() {} + + public: + // Pop a number of registers. The leftmost register last (from the highest diff --git a/media_session_uma_helper-missing-optional.patch b/media_session_uma_helper-missing-optional.patch new file mode 100644 index 0000000..bd6df81 --- /dev/null +++ b/media_session_uma_helper-missing-optional.patch @@ -0,0 +1,35 @@ +From 4ca8cffec2e6dea43de24a6a9d88095b73ab10f4 Mon Sep 17 00:00:00 2001 +From: Ivan Murashov +Date: Wed, 19 Feb 2025 22:59:45 -0800 +Subject: [PATCH] IWYU: Add missing include for std::optional usage in + media_session_uma_helper.h + +In the CL https://crrev.com/c/6204145 used std::optional in +the content/browser/media/session/media_session_uma_helper.h, +but corresponding include was missed. +Added missing include for std::optional usage. + +Bug: 41455655 +Change-Id: I482a496f6f72762f02e8e6e1484a7eae58147148 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6279927 +Reviewed-by: Colin Blundell +Commit-Queue: Ivan Murashov +Reviewed-by: Tommy Steimel +Cr-Commit-Position: refs/heads/main@{#1422370} +--- + content/browser/media/session/media_session_uma_helper.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/content/browser/media/session/media_session_uma_helper.h b/content/browser/media/session/media_session_uma_helper.h +index 70000267af9687..51dd098826020c 100644 +--- a/content/browser/media/session/media_session_uma_helper.h ++++ b/content/browser/media/session/media_session_uma_helper.h +@@ -5,6 +5,8 @@ + #ifndef CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_UMA_HELPER_H_ + #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_UMA_HELPER_H_ + ++#include ++ + #include "base/memory/raw_ptr.h" + #include "base/time/clock.h" + #include "base/time/time.h" diff --git a/no-zlib-headers.patch b/no-zlib-headers.patch index eccce1c..49b10fc 100644 --- a/no-zlib-headers.patch +++ b/no-zlib-headers.patch @@ -1,11 +1,11 @@ Do not ship bundled zlib headers. Electron uses the system zlib, and anyone compiling against it should also. ---- src/electron/BUILD.gn.orig -+++ src/electron/BUILD.gn -@@ -1582,7 +1582,6 @@ group("copy_node_headers") { - public_deps = header_groups + [ - ":node_gypi_headers", - ":node_version_header", -- ":zlib_headers", - ] +--- src/electron/BUILD.gn.orig 2025-04-11 12:02:41.207130337 +0200 ++++ src/electron/BUILD.gn 2025-04-11 20:58:52.999468971 +0200 +@@ -1569,7 +1569,6 @@ group("copy_node_headers") { + ":generate_node_headers", + ":node_gypi_headers", + ":node_version_header", +- ":zlib_headers", + ] } diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 88002e9..ebe55dc 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -20,7 +20,7 @@ %define mod_name electron # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json -%define abi_version 130 +%define abi_version 133 # Do not provide libEGL.so, etc… %define __provides_exclude ^lib.*\\.so.*$ @@ -73,34 +73,14 @@ ExcludeArch: %arm %bcond_without gdbjit %endif -%ifnarch %ix86 %arm -%if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}) +#We no longer support 32-bit. %bcond_without lto -%else -%bcond_with lto -%endif -%endif -%ifarch %ix86 %arm -%bcond_with lto -%endif - -%ifarch aarch64 -#Linker overflows without LTO. -%bcond_without lto -%endif %bcond_with mold -%if 0%{?suse_version} || 0%{?fedora} >= 41 -%bcond_without system_minizip -%else -%bcond_with system_minizip -%endif - - %bcond_with system_yuv @@ -109,16 +89,19 @@ ExcludeArch: %arm %bcond_without system_vpx %bcond_without bro_11 %bcond_without ffmpeg_6 -%bcond_without wayland_34 %bcond_without system_vk_headers +%bcond_without spirv_2024 %bcond_without cares_21 +#sqlite requires being compiled with session support, not a specific version. +%bcond_without system_sqlite %else %bcond_with system_vpx %bcond_with bro_11 %bcond_with ffmpeg_6 -%bcond_with wayland_34 %bcond_with system_vk_headers +%bcond_with spirv_2024 %bcond_with cares_21 +%bcond_with system_sqlite %endif @@ -127,9 +110,11 @@ ExcludeArch: %arm %if 0%{?fedora} %bcond_without system_llhttp %bcond_without system_histogram +%bcond_without system_simdjson %else %bcond_with system_llhttp %bcond_with system_histogram +%bcond_with system_simdjson %endif @@ -140,8 +125,8 @@ ExcludeArch: %arm %endif -# requires `run_convert_utf8_to_latin1_with_errors` -%if 0%{?fedora} >= 41 +# requires `base64_options` +%if 0%{?fedora} >= 42 %bcond_without system_simdutf %else %bcond_with system_simdutf @@ -153,9 +138,6 @@ ExcludeArch: %arm %bcond_with system_vma %endif -#requires `imageSequenceTrackPresent` and `enableParsingGainMapMetadata` both of which are only in post-1.0.0 nightlies -%bcond_with system_avif - # Some chromium code assumes absl::string_view is a typedef for std::string_view. This is not true on GCC7 systems such as Leap. %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_abseil @@ -207,11 +189,11 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 33.4.10 +Version: 35.2.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -License: Apache-2.0 AND blessing AND BSD-2-Clause AND BSD-3-Clause AND BSD-Source-Code AND bzip2-1.0.6 AND ISC AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND MIT-CMU AND MIT-open-group AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later) AND MPL-2.0 AND OpenSSL AND SGI-B-2.0 AND SUSE-Public-Domain AND X11%{!?with_system_minizip: AND Zlib} +License: Apache-2.0 AND blessing AND BSD-2-Clause AND BSD-3-Clause AND BSD-Source-Code AND bzip2-1.0.6 AND ISC AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND MIT-CMU AND MIT-open-group AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later) AND MPL-2.0 AND OpenSSL AND SGI-B-2.0 AND SUSE-Public-Domain AND X11 Group: Development/Languages/NodeJS URL: https://github.com/electron/electron Source0: %{mod_name}-%{tag_version}.tar.zst @@ -231,13 +213,18 @@ Source411: aom3.10-AV1E_SET_AUTO_TILES.patch Source412: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch Source413: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch # and wayland protocol 1.32 -Source420: wayland-protocol-toplevel-icon.patch -Source421: wayland-protocol-toplevel-icon-2.patch -Source422: wayland-protocol-toplevel-drag.patch -# and abseil 2401 -Source460: quiche-absl-HexStringToBytes.patch +#Source420: wayland-protocol-toplevel-icon.patch +#Source421: wayland-protocol-toplevel-icon-2.patch +#Source422: wayland-protocol-toplevel-drag.patch +#Source423: wayland_connection-Wchanges-meaning.patch +# and abseil 2407 +#Source460: quiche-absl-HexStringToBytes.patch +Source461: webrtc-make_ref_counted-absl2024-nullability.patch +#Source462: quiche-absl-HexStringToBytes-2.patch # and c-ares 1.19 Source470: node-cares-1.21.patch +# and spirv 2023 +Source480: angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch @@ -257,11 +244,12 @@ Patch75: gcc-asmflags.patch Patch77: angle_link_glx.patch Patch78: rdynamic.patch Patch80: icon.patch -Patch82: node-compiler.patch +#Patch82: node-compiler.patch Patch84: aarch64-Xclang.patch Patch85: devtools-frontend-compress_files-oom.patch Patch86: enable_stack_trace_line_numbers-symbol_level.patch Patch97: chromium-127-cargo_crate.patch +Patch98: gn-logspam-breaks-install.patch # PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors, @@ -281,7 +269,7 @@ Patch586: aom-vpx-no-thread-wrapper.patch Patch588: remove-password-manager-and-policy.patch Patch589: remove-puffin.patch Patch590: remove-sync.patch -Patch591: fix-build-without-safebrowsing.patch +#Patch591: fix-build-without-safebrowsing.patch Patch592: fix-build-without-supervised-users.patch Patch593: fix-build-without-screen-ai.patch Patch594: build-without-speech-service.patch @@ -290,10 +278,15 @@ Patch595: chromium-123-qrcode.patch Patch596: chromium-130-fontations.patch Patch597: chromium-125-cloud_authenticator.patch Patch598: chromium-127-crabby.patch +Patch599: chromium-132-no-rust.patch #End gentoo patches -Patch599: remove-libphonenumber.patch -Patch600: delete-old-language-detection-which-uses-tflite.patch -Patch601: MakeSbixTypeface-null-pointer-call.patch +#Patch600: remove-libphonenumber.patch +#Patch601: delete-old-language-detection-which-uses-tflite.patch +Patch601: MakeSbixTypeface-null-pointer-call.patch +Patch602: remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch +Patch603: build-without-mesage-center.patch +Patch604: disable-avif-really.patch +Patch605: permission-gcc14.2.patch @@ -320,10 +313,14 @@ Patch1078: system-simdutf.patch Patch1079: system-libm.patch Patch1085: webp-no-sharpyuv.patch Patch1086: zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch -Patch1087: system-ada-url.patch +#Patch1087: system-ada-url.patch Patch1088: cr130-abseil-remove-unused-deps.patch Patch1089: system-absl_algorithm.patch Patch1090: cr130-absl-base.patch +Patch1091: use-system-libraries-in-node.patch +Patch1092: fix-system-highway.patch +Patch1093: system-sqlite.patch +Patch1094: absl_strings-missing-headers.patch # PATCHES to fix interaction with third-party software @@ -334,12 +331,12 @@ Patch2010: chromium-93-ffmpeg-4.4.patch # is produced: # 'nomerge' attribute cannot be applied to a declaration # See https://reviews.llvm.org/D92800 -Patch2022: electron-13-fix-base-check-nomerge.patch +#Patch2022: electron-13-fix-base-check-nomerge.patch Patch2032: seccomp_bpf-no-lto.patch Patch2034: swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch Patch2035: RenderFrameHostImpl-use-after-free.patch # https://github.com/electron/electron/pull/40032 -Patch2040: build-without-extensions.patch +#Patch2040: build-without-extensions.patch %if %{without bro_11} Patch2042: brotli-remove-shared-dictionary.patch %else @@ -347,11 +344,7 @@ Source2042: brotli-remove-shared-dictionary.patch %endif Patch2045: libxml-2.12-xmlCtxtGetLastError-const.patch Patch2046: chromium-118-sigtrap_system_ffmpeg.patch -%if %{with system_minizip} -Source2047: bundled-minizip.patch -%else -Patch2047: bundled-minizip.patch -%endif +#Patch2047: bundled-minizip.patch Patch2048: absl2023-encapsulated_web_transport-StrCat.patch #Work around gcc14 overly aggressive optimizer. Patch2058: v8-strict-aliasing.patch @@ -362,6 +355,8 @@ Patch2060: chromium-129-disable-H.264-video-parser-during-demuxing.patch Patch2061: private_aggregation_host-uint128.patch Patch2062: wayland_version.patch Patch2063: fix-building-with-pipewire-1.3.82.patch +#Conditionably disable feature which requires new highway +Patch2064: blink-shape_result-highway.patch # PATCHES that should be submitted upstream verbatim or near-verbatim @@ -378,23 +373,45 @@ Patch3134: swiftshader-llvm18-LLVMJIT-Host.patch Patch3135: swiftshader-llvm18-LLVMJIT-CodeGenOptLevel.patch Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch Patch3144: mt21_util-flax-vector-conversions.patch -Patch3149: boringssl-internal-addc-cxx.patch +#Patch3149: boringssl-internal-addc-cxx.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch -Patch3173: blink-platform-INSIDE_BLINK-Wodr.patch +#Patch3173: blink-platform-INSIDE_BLINK-Wodr.patch Patch3174: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch Patch3175: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch -Patch3176: fix-build-without-service-discovery.patch -Patch3177: wayland_connection-Wchanges-meaning.patch -Patch3178: ip_protection_data_types-missing-optional.patch -Patch3179: account_id-missing-optional.patch -Patch3180: skia_image_decoder_base-missing-stack.patch -Patch3181: exception_context-missing-variant.patch -Patch3182: css_attr_value_tainting-missing-once_flag.patch -Patch3183: vtt_scanner-missing-variant.patch +#Patch3176: fix-build-without-service-discovery.patch +#Patch3178: ip_protection_data_types-missing-optional.patch +#Patch3179: account_id-missing-optional.patch +#Patch3180: skia_image_decoder_base-missing-stack.patch +#Patch3181: exception_context-missing-variant.patch +#Patch3182: css_attr_value_tainting-missing-once_flag.patch +#Patch3183: vtt_scanner-missing-variant.patch Patch3184: electron_usb_delegate-incomplete-UsbDeviceInfo.patch Patch3185: bsc1224178-font-gc.patch Patch3186: string_view-incomplete-CodePointIterator.patch Patch3187: swiftshader-llvm20-absoluteSymbols.patch +Patch3188: fix-build-without-pdf.patch +Patch3189: raw_ptr-fpermissive.patch +Patch3190: exception_state-constexpr-initializer.patch +Patch3191: resource_response-Wchanges-meaning.patch +Patch3192: perfetto-ThreadTrack-Current-null-dereference.patch +Patch3193: resource-Wchanges-meaning.patch +Patch3194: string_truncator-convert.patch +Patch3195: object_paint_properties-explicit-specialization-in-non-namespace-scope.patch +Patch3196: css_shape_value-constructor.patch +Patch3197: xml_document_parser-Wmissing-template-keyword.patch +Patch3198: ax_platform_node_id-fpermissive.patch +Patch3199: style_scope-unqualified-To.patch +Patch3200: content_browser_client-incomplete-WebUIController.patch +Patch3201: fix-build-without-video-effects.patch +Patch3202: media_session_uma_helper-missing-optional.patch +Patch3203: picture_in_picture_window_manager_uma_helper-missing-optional.patch +Patch3204: browser_process_impl-fix-safe_browsing_mode-0.patch +Patch3205: plugin_utils-build-without-electron_extensions.patch +Patch3206: string-hasher-flax-vector-conversions.patch +Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch +Patch3208: to_vector-std-projected-gcc119888.patch +Patch3209: macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch +Patch3210: v8-macro-assembler-riscv-leaptiering.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -455,14 +472,15 @@ BuildRequires: ninja >= 1.7.2 %else BuildRequires: ninja-build >= 1.7.2 %endif -%if 0%{?fedora} >= 37 +%if 0%{?fedora} BuildRequires: nodejs-npm +#otherwise electron-typescript-definitions crashes like https://github.com/nodejs/node/issues/51752 +BuildRequires: nodejs-full-i18n %else BuildRequires: npm %endif -%if 0%{?suse_version} -BuildRequires: nodejs-packaging -%endif +BuildRequires: npm(rollup) +BuildRequires: nodejs-packaging BuildRequires: pkgconfig BuildRequires: plasma-wayland-protocols BuildRequires: python3-json5 @@ -475,7 +493,7 @@ BuildRequires: (python3-setuptools if python3 >= 3.12) %endif BuildRequires: python%{PYVER}-six %if %{with system_simdutf} -BuildRequires: simdutf-devel >= 3.2.17 +BuildRequires: simdutf-devel >= 5 %endif BuildRequires: snappy-devel %if 0%{?suse_version} @@ -519,13 +537,14 @@ BuildRequires: pkgconfig(absl_int128) BuildRequires: pkgconfig(absl_memory) BuildRequires: pkgconfig(absl_node_hash_map) BuildRequires: pkgconfig(absl_node_hash_set) +BuildRequires: pkgconfig(absl_nullability) BuildRequires: pkgconfig(absl_optional) BuildRequires: pkgconfig(absl_random_random) BuildRequires: pkgconfig(absl_span) BuildRequires: pkgconfig(absl_stacktrace) BuildRequires: pkgconfig(absl_status) BuildRequires: pkgconfig(absl_statusor) -BuildRequires: pkgconfig(absl_strings) +BuildRequires: pkgconfig(absl_strings) >= 20240700 BuildRequires: pkgconfig(absl_str_format) BuildRequires: pkgconfig(absl_symbolize) BuildRequires: pkgconfig(absl_synchronization) @@ -568,10 +587,6 @@ BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) >= 58 BuildRequires: pkgconfig(libavutil) %endif -%if %{with system_avif} -# Needs avifRGBImage::maxThreads -BuildRequires: pkgconfig(libavif) >= 1 -%endif %if %{with bro_11} BuildRequires: pkgconfig(libbrotlicommon) >= 1.1~ %endif @@ -580,7 +595,6 @@ BuildRequires: pkgconfig(libbrotlienc) BuildRequires: pkgconfig(libcares) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libdrm) -BuildRequires: pkgconfig(libevent) BuildRequires: pkgconfig(libhwy) >= 1 BuildRequires: pkgconfig(libnghttp2) BuildRequires: pkgconfig(libnotify) @@ -605,13 +619,7 @@ BuildRequires: pkgconfig(libyuv) >= 1894 BuildRequires: pkgconfig(libyuv) %endif BuildRequires: pkgconfig(libzstd) -%if %{with system_minizip} -%if 0%{?fedora} -BuildRequires: minizip-compat-devel -%else BuildRequires: pkgconfig(minizip) -%endif -%endif BuildRequires: pkgconfig(nspr) >= 4.9.5 BuildRequires: pkgconfig(nss) >= 3.26 BuildRequires: pkgconfig(opus) >= 1.3.1 @@ -626,17 +634,21 @@ BuildRequires: pkgconfig(Qt6Widgets) #re2-11 has abseil as a public dependency. If you use system re2 you must use system abseil. BuildRequires: cmake(re2) >= 11 %endif +%if %{with system_simdjson} +BuildRequires: pkgconfig(simdjson) +%endif %if 0%{?suse_version} BuildRequires: spirv-headers %else BuildRequires: spirv-headers-devel %endif -BuildRequires: pkgconfig(SPIRV-Tools) >= 2022.2 -BuildRequires: pkgconfig(vulkan) >= 1.3 -%if %{with wayland_34} -BuildRequires: pkgconfig(wayland-protocols) >= 1.33 +%if %{with spirv_2024} +BuildRequires: pkgconfig(SPIRV-Tools) >= 2024 %endif -BuildRequires: pkgconfig(wayland-protocols) >= 1.32 +BuildRequires: pkgconfig(SPIRV-Tools) >= 2022.2 +BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(vulkan) >= 1.3 +BuildRequires: pkgconfig(wayland-protocols) >= 1.37 BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xshmfence) BuildRequires: pkgconfig(zlib) @@ -753,13 +765,6 @@ patch -R -p1 < %SOURCE412 patch -R -p1 < %SOURCE413 %endif -%if %{without wayland_34} -patch -R -p1 < %PATCH3177 -patch -R -p1 < %SOURCE422 -patch -R -p1 < %SOURCE421 -patch -R -p1 < %SOURCE420 -%endif - %if %{without cares_21} patch -R -p1 < %SOURCE470 %endif @@ -773,20 +778,24 @@ patch -R -p1 < %SOURCE400 patch -R -p1 < %SOURCE401 %endif +%if %{without spirv_2024} +patch -R -p1 < %SOURCE480 +%endif + +%if %{without system_sqlite} +patch -R -p1 < %PATCH1093 +%endif +# This one just removes compatibility with old abseil and does not add anything, reverting unconditionally. +patch -R -p1 < %SOURCE461 - - - - -# This one depends on an abseil nightly, reverting unconditionally. -patch -R -p1 < %SOURCE460 - #Replace non-free rollup 4.x with rollup 3.x. This probably won't last for long and we will have to figure out how to build rollup 4 rm -rf third_party/node/node_modules/@rollup/wasm-node/ -ln -srvT third_party/devtools-frontend/src/node_modules/rollup third_party/node/node_modules/@rollup/wasm-node +rm -rf third_party/devtools-frontend/src/node_modules/@rollup/wasm-node/ +cp -arvT %{nodejs_sitelib}/rollup third_party/node/node_modules/@rollup/wasm-node +cp -alrvT third_party/node/node_modules/@rollup/wasm-node third_party/devtools-frontend/src/node_modules/@rollup/wasm-node # Link system wayland-protocols-devel into where chrome expects them @@ -828,7 +837,6 @@ gn_system_libraries=( jsoncpp libaom libdrm - libevent libjpeg libpng libsecret @@ -876,18 +884,10 @@ gn_system_libraries+=( -%if %{with system_avif} -find third_party/libavif -type f ! -name "*.gn" -a ! -name "*.gni" -delete -gn_system_libraries+=( libavif ) -%endif -%if %{with system_minizip} -find third_party/zlib/contrib -type f ! -name "*.gn" -a ! -name "*.gni" -delete -%endif - %if %{with system_re2} find third_party/re2 -type f ! -name "*.gn" -a ! -name "*.gni" -delete @@ -917,6 +917,11 @@ find third_party/libyuv -type f ! -name "*.gn" -a ! -name "*.gni" -delete gn_system_libraries+=( libyuv ) %endif +%if %{with system_simdutf} +find third_party/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +gn_system_libraries+=( simdutf ) +%endif + build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]} @@ -932,8 +937,12 @@ find third_party/electron_node/deps/llhttp -type f ! -name "*.gn" -a ! -name "*. find third_party/electron_node/deps/histogram -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete %endif -%if %{with system_simdutf} -find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +%if %{with system_simdjson} +find third_party/electron_node/deps/simdjson -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +%endif + +%if %{with system_sqlite} +find third_party/electron_node/deps/sqlite -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete %endif @@ -1056,7 +1065,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=6 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=4 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" @@ -1071,6 +1080,9 @@ export LDFLAGS="$LDFLAGS -fuse-ld=mold" export CCACHE_COMPRESS=1 ccache -o max_size=0 || true +#see generate_node_headers.py +export ELECTRON_OUT_DIR=Release + # Create the configuration for GN # Available options: out/Release/gn args --list out/Release/ myconf_gn="" @@ -1150,6 +1162,7 @@ myconf_gn+=' angle_enable_swiftshader=true' # do not build PDF support +myconf_gn+=' enable_glic=false' myconf_gn+=" enable_pdf=false" myconf_gn+=' enable_pdf_ink2=false' myconf_gn+=" enable_pdf_viewer=false" @@ -1169,6 +1182,7 @@ myconf_gn+=' content_enable_legacy_ipc=true' #do not build webextensions support myconf_gn+=' enable_electron_extensions=false' +myconf_gn+=' enable_platform_apps=false' # The option below get overriden by whatever is in CFLAGS/CXXFLAGS, so they affect only C++ code. # symbol_level=2 is full debug @@ -1251,12 +1265,13 @@ myconf_gn+=' structured_metrics_enabled=false' myconf_gn+=' structured_metrics_debug_enabled=false' myconf_gn+=' build_dawn_tests=false' myconf_gn+=' enable_compute_pressure=false' -myconf_fn+=' enable_guest_view=false' + #FIXME: possibly enable this when skia gets built with rust code by default. #Need to patch in optflags and possibly FFI LTO hacks (see signal-desktop package for how it's done) myconf_gn+=' enable_rust=false' +myconf_gn+=' enable_rust_png=false' myconf_gn+=' enable_chromium_prelude=false' myconf_gn+=' chrome_root_store_cert_management_ui=false' @@ -1265,7 +1280,6 @@ myconf_gn+=' use_kerberos=false' myconf_gn+=' disable_histogram_support=true' - #Do not build Chromecast myconf_gn+=" enable_remoting=false" myconf_gn+=" enable_media_remoting=false" @@ -1283,6 +1297,18 @@ myconf_gn+=' enable_perfetto_trace_processor_json=false' myconf_gn+=' enable_perfetto_trace_processor_httpd=false' myconf_gn+=' enable_perfetto_zlib=false' +#Otherwise mksnapshot crashes +#0 perfetto::ThreadTrack::Current () at ../../third_party/perfetto/src/tracing/track.cc:105 +#1 0x0000555555815084 in v8::internal::GCTracer::GCTracer () at ../../v8/src/heap/gc-tracer.cc:184 +#2 v8::internal::Heap::SetUpSpaces (this=0x555557507788, new_allocation_info=..., old_allocation_info=...) at ../../v8/src/heap/heap.cc:5788 +#3 0x000055555704895b in v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [clone .isra.0] () at ../../v8/src/execution/isolate.cc:5556 +#4 0x0000555555b51ad3 in v8::internal::Isolate::InitWithoutSnapshot () at ../../v8/src/execution/isolate.cc:5184 +#5 v8::internal::SnapshotCreatorImpl::InitInternal (this=0x55555750c130, blob=0x0) at ../../v8/src/snapshot/snapshot.cc:868 +#6 0x0000555555654b15 in v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl () at ../../v8/src/snapshot/snapshot.cc:929 +#7 v8::SnapshotCreator::SnapshotCreator () at ../../v8/src/api/api.cc:552 +#8 main (argc=1465209528, argv=0x3ff0000000000000) at ../../v8/src/snapshot/mksnapshot.cc:298 +#myconf_gn+=' v8_use_perfetto=false' + myconf_gn+=' dawn_complete_static_libs=true' @@ -1340,8 +1366,8 @@ myconf_gn+=" use_system_llhttp=true" %if %{with system_histogram} myconf_gn+=" use_system_histogram=true" %endif -%if %{with system_simdutf} -myconf_gn+=' use_system_simdutf=true' +%if %{with system_simdjson} +myconf_gn+=' use_system_simdjson=true' %endif myconf_gn+=" is_clang=false" @@ -1378,8 +1404,6 @@ myconf_gn+=' skia_use_dawn=false' myconf_gn+=" proprietary_codecs=true" myconf_gn+=" ffmpeg_branding=\"Chrome\"" - - # GN does not support passing cflags: # https://bugs.chromium.org/p/chromium/issues/detail?id=642016 gn gen out/Release --testonly=false --args="import(\"//electron/build/args/release.gn\") ${myconf_gn}" @@ -1464,7 +1488,7 @@ cp /dev/stdin %{buildroot}%{_rpmconfigdir}/macros.d/macros.electron <<"EOF" # Build native modules against Electron. This should be done as the first step in ‰build. You must set CFLAGS/LDFLAGS previously. # You can call it multiple times in different directories and pass more parameters to it (seen in vscode) -%%electron_rebuild %{?jitless} PATH="%{_libexecdir}/electron-node:$PATH" npm rebuild --verbose --foreground-scripts --nodedir=%{_includedir}/electron +%%electron_rebuild PATH="%{_libexecdir}/electron-node:$PATH" npm rebuild --verbose --foreground-scripts --nodedir=%{_includedir}/electron # Sanity check that native modules load. You must include this in ‰check if the package includes native modules (possibly in addition to actual test suites) # These do, in order: diff --git a/object_paint_properties-explicit-specialization-in-non-namespace-scope.patch b/object_paint_properties-explicit-specialization-in-non-namespace-scope.patch new file mode 100644 index 0000000..3f6260f --- /dev/null +++ b/object_paint_properties-explicit-specialization-in-non-namespace-scope.patch @@ -0,0 +1,99 @@ +--- src/third_party/blink/renderer/core/paint/object_paint_properties.h.orig 2025-04-16 14:36:32.662070096 +0200 ++++ src/third_party/blink/renderer/core/paint/object_paint_properties.h 2025-04-16 22:12:50.444628128 +0200 +@@ -174,47 +174,6 @@ class CORE_EXPORT ObjectPaintProperties + template + struct NodeIdRange {}; + +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstTransform; +- static constexpr NodeId kLast = NodeId::kClipAlias; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstTransform; +- static constexpr NodeId kLast = NodeId::kTransformAlias; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstTransform; +- static constexpr NodeId kLast = NodeId::kLastTransform; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstScroll; +- static constexpr NodeId kLast = NodeId::kLastScroll; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstEffect; +- static constexpr NodeId kLast = NodeId::kEffectAlias; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstEffect; +- static constexpr NodeId kLast = NodeId::kLastEffect; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstClip; +- static constexpr NodeId kLast = NodeId::kClipAlias; +- }; +- template <> +- struct NodeIdRange { +- static constexpr NodeId kFirst = NodeId::kFirstClip; +- static constexpr NodeId kLast = NodeId::kLastClip; +- }; +- + public: + template + bool HasNode() const { +@@ -579,6 +538,48 @@ class CORE_EXPORT ObjectPaintProperties + #endif + }; + ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstTransform; ++ static constexpr NodeId kLast = NodeId::kClipAlias; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstTransform; ++ static constexpr NodeId kLast = NodeId::kTransformAlias; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstTransform; ++ static constexpr NodeId kLast = NodeId::kLastTransform; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstScroll; ++ static constexpr NodeId kLast = NodeId::kLastScroll; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstEffect; ++ static constexpr NodeId kLast = NodeId::kEffectAlias; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstEffect; ++ static constexpr NodeId kLast = NodeId::kLastEffect; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstClip; ++ static constexpr NodeId kLast = NodeId::kClipAlias; ++}; ++template <> ++struct ObjectPaintProperties::NodeIdRange { ++ static constexpr NodeId kFirst = NodeId::kFirstClip; ++ static constexpr NodeId kLast = NodeId::kLastClip; ++}; ++ ++ + } // namespace blink + + #endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_OBJECT_PAINT_PROPERTIES_H_ diff --git a/perfetto-ThreadTrack-Current-null-dereference.patch b/perfetto-ThreadTrack-Current-null-dereference.patch new file mode 100644 index 0000000..314d417 --- /dev/null +++ b/perfetto-ThreadTrack-Current-null-dereference.patch @@ -0,0 +1,42 @@ +#Otherwise mksnapshot crashes +#0 perfetto::ThreadTrack::Current () at ../../third_party/perfetto/src/tracing/track.cc:105 +#1 0x0000555555815084 in v8::internal::GCTracer::GCTracer () at ../../v8/src/heap/gc-tracer.cc:184 +#2 v8::internal::Heap::SetUpSpaces (this=0x555557507788, new_allocation_info=..., old_allocation_info=...) at ../../v8/src/heap/heap.cc:5788 +#3 0x000055555704895b in v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [clone .isra.0] () at ../../v8/src/execution/isolate.cc:5556 +#4 0x0000555555b51ad3 in v8::internal::Isolate::InitWithoutSnapshot () at ../../v8/src/execution/isolate.cc:5184 +#5 v8::internal::SnapshotCreatorImpl::InitInternal (this=0x55555750c130, blob=0x0) at ../../v8/src/snapshot/snapshot.cc:868 +#6 0x0000555555654b15 in v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl () at ../../v8/src/snapshot/snapshot.cc:929 +#7 v8::SnapshotCreator::SnapshotCreator () at ../../v8/src/api/api.cc:552 +#8 main (argc=1465209528, argv=0x3ff0000000000000) at ../../v8/src/snapshot/mksnapshot.cc:298 + + +--- src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.h.orig 2025-04-16 14:38:49.066064367 +0200 ++++ src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.h 2025-04-16 21:06:46.592994525 +0200 +@@ -44,11 +44,7 @@ class TracingMuxerFake : public TracingM + ~TracingMuxerFake() override; + + static constexpr TracingMuxerFake* Get() { +-#if PERFETTO_HAS_NO_DESTROY() + return &instance; +-#else +- return nullptr; +-#endif + } + + // TracingMuxer implementation. +--- src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.cc.orig 2025-04-16 14:38:49.066064367 +0200 ++++ src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.cc 2025-04-16 21:13:09.044959936 +0200 +@@ -27,13 +27,11 @@ PERFETTO_NORETURN void FailUninitialized + + } // namespace + +-#if PERFETTO_HAS_NO_DESTROY() + // static + PERFETTO_NO_DESTROY TracingMuxerFake::FakePlatform + TracingMuxerFake::FakePlatform::instance{}; + // static + PERFETTO_NO_DESTROY TracingMuxerFake TracingMuxerFake::instance{}; +-#endif // PERFETTO_HAS_NO_DESTROY() + + TracingMuxerFake::~TracingMuxerFake() = default; + diff --git a/permission-gcc14.2.patch b/permission-gcc14.2.patch new file mode 100644 index 0000000..44b08c5 --- /dev/null +++ b/permission-gcc14.2.patch @@ -0,0 +1,13 @@ +This file fails to compile under gcc 14.2 but should be entirely dead code + +--- src/components/services/app_service/public/cpp/BUILD.gn.orig 2025-04-21 18:29:17.630307050 +0200 ++++ src/components/services/app_service/public/cpp/BUILD.gn 2025-04-23 18:18:14.510674646 +0200 +@@ -28,8 +28,6 @@ component("app_types") { + "menu.h", + "package_id.cc", + "package_id.h", +- "permission.cc", +- "permission.h", + "preferred_app.cc", + "preferred_app.h", + "run_on_os_login_types.cc", diff --git a/picture_in_picture_window_manager_uma_helper-missing-optional.patch b/picture_in_picture_window_manager_uma_helper-missing-optional.patch new file mode 100644 index 0000000..a94461d --- /dev/null +++ b/picture_in_picture_window_manager_uma_helper-missing-optional.patch @@ -0,0 +1,35 @@ +From 1e7508ce083f6c7e43011f899faf10537a6379e2 Mon Sep 17 00:00:00 2001 +From: Ivan Murashov +Date: Thu, 20 Feb 2025 10:37:19 -0800 +Subject: [PATCH] IWYU: Add missing include for std::optional usage in + picture_in_picture_window_manager_uma_helper.h + +In the CL https://crrev.com/c/6191230 used std::optional in the +chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h, +but corresponding include was missed. +Added missing include for std::optional usage. + +Bug: 41455655 +Change-Id: I70f67c4a06481875d4602b16a97532cdad2a63b0 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6275068 +Reviewed-by: Vasilii Sukhanov +Commit-Queue: Ivan Murashov +Reviewed-by: Tommy Steimel +Cr-Commit-Position: refs/heads/main@{#1422669} +--- + .../picture_in_picture_window_manager_uma_helper.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h b/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h +index cb826fc5a20598..866670224c8a38 100644 +--- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h ++++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h +@@ -5,6 +5,8 @@ + #ifndef CHROME_BROWSER_PICTURE_IN_PICTURE_PICTURE_IN_PICTURE_WINDOW_MANAGER_UMA_HELPER_H_ + #define CHROME_BROWSER_PICTURE_IN_PICTURE_PICTURE_IN_PICTURE_WINDOW_MANAGER_UMA_HELPER_H_ + ++#include ++ + #include "base/memory/raw_ptr.h" + #include "base/time/clock.h" + #include "base/time/time.h" diff --git a/plugin_utils-build-without-electron_extensions.patch b/plugin_utils-build-without-electron_extensions.patch new file mode 100644 index 0000000..b54e491 --- /dev/null +++ b/plugin_utils-build-without-electron_extensions.patch @@ -0,0 +1,20 @@ +--- src/electron/shell/browser/plugins/plugin_utils.cc.orig 2025-04-16 14:34:09.220241915 +0200 ++++ src/electron/shell/browser/plugins/plugin_utils.cc 2025-04-18 21:59:05.472058588 +0200 +@@ -33,6 +33,8 @@ std::string PluginUtils::GetExtensionIdF + base::flat_map + PluginUtils::GetMimeTypeToExtensionIdMap( + content::BrowserContext* browser_context) { ++ base::flat_map mime_type_to_extension_id_map; ++ + #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) + const auto& allowed_extension_ids = MimeTypesHandler::GetMIMETypeAllowlist(); + if (allowed_extension_ids.empty()) +@@ -41,8 +43,6 @@ PluginUtils::GetMimeTypeToExtensionIdMap + const extensions::ExtensionSet& enabled_extensions = + extensions::ExtensionRegistry::Get(browser_context)->enabled_extensions(); + +- base::flat_map mime_type_to_extension_id_map; +- + // Go through the white-listed extensions and try to use them to intercept + // the URL request. + for (const std::string& id : allowed_extension_ids) { diff --git a/private_aggregation_host-uint128.patch b/private_aggregation_host-uint128.patch index 4f34619..a6c0f37 100644 --- a/private_aggregation_host-uint128.patch +++ b/private_aggregation_host-uint128.patch @@ -21,22 +21,22 @@ In file included from /usr/include/c++/14/string:49, 143 | absl::uint128 bucket; | ^~~~~~ ---- src/content/browser/private_aggregation/private_aggregation_host.cc 2025-01-02 22:23:57.594885484 +0100 -+++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/src/content/browser/private_aggregation/private_aggregation_host.cc 2025-01-03 21:33:27.795544465 +0100 -@@ -51,7 +51,6 @@ - #include "mojo/public/cpp/bindings/pending_receiver.h" - #include "mojo/public/cpp/bindings/receiver_set.h" - #include "services/network/public/cpp/is_potentially_trustworthy.h" +--- src/content/browser/private_aggregation/private_aggregation_pending_contributions.h.orig 2025-04-16 14:36:28.649070859 +0200 ++++ src/content/browser/private_aggregation/private_aggregation_pending_contributions.h 2025-04-17 16:33:05.731832452 +0200 +@@ -11,7 +11,6 @@ + #include + + #include "content/common/content_export.h" -#include "third_party/abseil-cpp/absl/numeric/int128.h" - #include "third_party/blink/public/common/features.h" + #include "third_party/abseil-cpp/absl/types/variant.h" #include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom.h" - #include "third_party/blink/public/mojom/private_aggregation/private_aggregation_host.mojom.h" -@@ -140,7 +139,7 @@ struct ContributionMergeKey { - auto operator<=>(const ContributionMergeKey& a) const = default; +@@ -41,7 +40,7 @@ class CONTENT_EXPORT PrivateAggregationP -- absl::uint128 bucket; -+ unsigned __int128 bucket; - uint64_t filtering_id; - }; + auto operator<=>(const ContributionMergeKey& a) const = default; + +- absl::uint128 bucket; ++ unsigned __int128 bucket; + uint64_t filtering_id; + }; diff --git a/raw_ptr-fpermissive.patch b/raw_ptr-fpermissive.patch new file mode 100644 index 0000000..1aa4c34 --- /dev/null +++ b/raw_ptr-fpermissive.patch @@ -0,0 +1,48 @@ +From f12e128221d2011c57448032d67309da94f55dde Mon Sep 17 00:00:00 2001 +From: Marshall Greenblatt +Date: Thu, 13 Feb 2025 17:47:09 -0800 +Subject: [PATCH] Fix extra qualification on member 'basic_common_reference' + +Fixes the following errors when building on Windows with +use_custom_libcxx=false. + +In file included from ../..\base/memory/raw_ptr.h:11: +../../base/allocator/partition_allocator/src\partition_alloc/pointers/raw_ptr.h(1274,13): error: extra qualification on member 'basic_common_reference' [-Werror,-Wextra-qualification] + 1274 | struct std::basic_common_reference, T*, TQ, UQ> { + | ^ +../../base/allocator/partition_allocator/src\partition_alloc/pointers/raw_ptr.h(1284,13): error: extra qualification on member 'basic_common_reference' [-Werror,-Wextra-qualification] + 1284 | struct std::basic_common_reference, TQ, UQ> { + | ^ +2 errors generated. + +Change-Id: I86f92b206fdcba8d0e820c7a625e1c28518f02a0 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6265643 +Commit-Queue: Peter Kasting +Reviewed-by: Peter Kasting +Cr-Commit-Position: refs/heads/main@{#1420246} +--- + .../src/partition_alloc/pointers/raw_ptr.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h +index c3ac11523410fb..2a3d3bc4d1f342 100644 +--- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h ++++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h +@@ -1271,7 +1271,7 @@ template + typename UQ> +-struct std::basic_common_reference, T*, TQ, UQ> { ++struct basic_common_reference, T*, TQ, UQ> { + using type = T*; + }; + +@@ -1281,7 +1281,7 @@ template + typename UQ> +-struct std::basic_common_reference, TQ, UQ> { ++struct basic_common_reference, TQ, UQ> { + using type = T*; + }; + diff --git a/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch b/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch new file mode 100644 index 0000000..8ff1837 --- /dev/null +++ b/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch @@ -0,0 +1,373 @@ +--- src/third_party/blink/renderer/modules/ai/ai.cc.orig 2025-04-16 14:36:32.771242661 +0200 ++++ src/third_party/blink/renderer/modules/ai/ai.cc 2025-04-17 16:44:52.883833032 +0200 +@@ -30,7 +30,6 @@ void AI::Trace(Visitor* visitor) const { + visitor->Trace(ai_summarizer_factory_); + visitor->Trace(ai_writer_factory_); + visitor->Trace(ai_rewriter_factory_); +- visitor->Trace(ai_language_detector_factory_); + visitor->Trace(ai_translator_factory_); + } + +@@ -78,15 +77,6 @@ AIRewriterFactory* AI::rewriter() { + return ai_rewriter_factory_.Get(); + } + +-AILanguageDetectorFactory* AI::languageDetector() { +- if (!ai_language_detector_factory_) { +- ai_language_detector_factory_ = +- MakeGarbageCollected(GetExecutionContext(), +- task_runner_); +- } +- return ai_language_detector_factory_.Get(); +-} +- + AITranslatorFactory* AI::translator() { + if (!ai_translator_factory_) { + ai_translator_factory_ = +--- src/third_party/blink/renderer/modules/ai/ai.h.orig 2025-04-16 14:36:32.771242661 +0200 ++++ src/third_party/blink/renderer/modules/ai/ai.h 2025-04-17 16:45:08.367832844 +0200 +@@ -10,7 +10,6 @@ + #include "third_party/blink/public/mojom/ai/ai_manager.mojom-blink.h" + #include "third_party/blink/renderer/core/execution_context/execution_context.h" + #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" +-#include "third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector_factory.h" + #include "third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.h" + #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" + #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +@@ -37,7 +36,6 @@ class AI final : public ScriptWrappable, + AISummarizerFactory* summarizer(); + AIRewriterFactory* rewriter(); + AIWriterFactory* writer(); +- AILanguageDetectorFactory* languageDetector(); + AITranslatorFactory* translator(); + + HeapMojoRemote& GetAIRemote(); +@@ -51,7 +49,6 @@ class AI final : public ScriptWrappable, + Member ai_summarizer_factory_; + Member ai_writer_factory_; + Member ai_rewriter_factory_; +- Member ai_language_detector_factory_; + Member ai_translator_factory_; + }; + +--- src/third_party/blink/renderer/modules/ai/ai.idl 2025-04-16 14:36:32.771242661 +0200 ++++ src/third_party/blink/renderer/modules/ai/ai.idl 2025-04-18 13:52:33.485440478 +0200 +@@ -40,11 +40,6 @@ interface AI { + readonly attribute AIRewriterFactory rewriter; + + [ +- RuntimeEnabled=LanguageDetectionAPI +- ] +- readonly attribute AILanguageDetectorFactory languageDetector; +- +- [ + RuntimeEnabled=TranslationAPI + ] + readonly attribute AITranslatorFactory translator; +--- src/third_party/blink/renderer/modules/ai/BUILD.gn 2025-04-16 14:36:32.771172881 +0200 ++++ src/third_party/blink/renderer/modules/ai/BUILD.gn 2025-04-18 21:41:05.606552171 +0200 +@@ -41,16 +41,8 @@ blink_modules_sources("ai") { + "exception_helpers.h", + "model_execution_responder.cc", + "model_execution_responder.h", +- "on_device_translation/ai_language_detector.cc", +- "on_device_translation/ai_language_detector.h", +- "on_device_translation/ai_language_detector_capabilities.cc", +- "on_device_translation/ai_language_detector_capabilities.h", +- "on_device_translation/ai_language_detector_factory.cc", +- "on_device_translation/ai_language_detector_factory.h", + "on_device_translation/ai_translator.cc", + "on_device_translation/ai_translator.h", +- "on_device_translation/ai_translator_capabilities.cc", +- "on_device_translation/ai_translator_capabilities.h", + "on_device_translation/ai_translator_factory.cc", + "on_device_translation/ai_translator_factory.h", + ] +@@ -60,7 +52,5 @@ blink_modules_sources("ai") { + deps = [ + "//components/language_detection/content/common", + "//components/language_detection/content/common:common_blink", +- "//components/language_detection/content/renderer", +- "//components/language_detection/core", + ] + } +--- src/third_party/blink/renderer/platform/BUILD.gn.orig 2025-04-12 14:33:45.435739667 +0200 ++++ src/third_party/blink/renderer/platform/BUILD.gn 2025-04-12 15:58:59.809440918 +0200 +@@ -1239,8 +1239,6 @@ component("platform") { + "keyboard_codes.h", + "language.cc", + "language.h", +- "language_detection/language_detection_model.cc", +- "language_detection/language_detection_model.h", + "link_hash.cc", + "link_hash.h", + "media/media_player_client.h", +@@ -1757,11 +1755,8 @@ component("platform") { + "//cc/mojo_embedder", + "//components/language_detection/content/common", + "//components/language_detection/content/common:common_blink", +- "//components/language_detection/content/renderer", +- "//components/language_detection/core", + "//components/paint_preview/common", + "//components/search_engines:search_engine_utils", +- "//components/translate/core/language_detection:language_detection", + "//components/viz/client", + "//components/viz/common", + "//components/webrtc:net_address_utils", +--- src/components/translate/core/common/BUILD.gn.orig 2025-04-12 14:33:35.535738956 +0200 ++++ src/components/translate/core/common/BUILD.gn 2025-04-12 16:04:56.897440792 +0200 +@@ -23,7 +23,6 @@ static_library("common") { + deps = [ + "//base", + "//components/language/core/common", +- "//components/language_detection/core:core", + "//third_party/metrics_proto", + "//url", + ] +--- src/third_party/blink/renderer/modules/BUILD.gn 2025-04-16 14:36:32.763311004 +0200 ++++ src/third_party/blink/renderer/modules/BUILD.gn 2025-04-18 14:17:17.869441496 +0200 +@@ -128,7 +128,6 @@ component("modules") { + "//third_party/blink/renderer/modules/netinfo", + "//third_party/blink/renderer/modules/nfc", + "//third_party/blink/renderer/modules/notifications", +- "//third_party/blink/renderer/modules/on_device_translation", + "//third_party/blink/renderer/modules/payments", + "//third_party/blink/renderer/modules/payments/goods", + "//third_party/blink/renderer/modules/peerconnection", +--- src/third_party/blink/renderer/bindings/idl_in_modules.gni 2025-04-16 14:36:32.335223804 +0200 ++++ src/third_party/blink/renderer/bindings/idl_in_modules.gni 2025-04-18 21:39:21.064884303 +0200 +@@ -28,12 +28,8 @@ static_idl_files_in_modules = [ + "//third_party/blink/renderer/modules/ai/ai_summarizer_factory.idl", + "//third_party/blink/renderer/modules/ai/ai_writer.idl", + "//third_party/blink/renderer/modules/ai/ai_writer_factory.idl", +- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector.idl", +- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector_factory.idl", +- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector_capabilities.idl", + "//third_party/blink/renderer/modules/ai/on_device_translation/ai_translator.idl", + "//third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.idl", +- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_capabilities.idl", + "//third_party/blink/renderer/modules/ai/window_or_worker_global_scope_ai.idl", + "//third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.idl", + "//third_party/blink/renderer/modules/animationworklet/css_animation_worklet.idl", +@@ -542,10 +538,6 @@ static_idl_files_in_modules = [ + "//third_party/blink/renderer/modules/notifications/service_worker_global_scope_notifications.idl", + "//third_party/blink/renderer/modules/notifications/service_worker_registration_notifications.idl", + "//third_party/blink/renderer/modules/notifications/timestamp_trigger.idl", +- "//third_party/blink/renderer/modules/on_device_translation/language_translator.idl", +- "//third_party/blink/renderer/modules/on_device_translation/translation_language_options.idl", +- "//third_party/blink/renderer/modules/on_device_translation/translation.idl", +- "//third_party/blink/renderer/modules/on_device_translation/window_or_worker_global_scope_translation.idl", + "//third_party/blink/renderer/modules/payments/abort_payment_event.idl", + "//third_party/blink/renderer/modules/payments/address_errors.idl", + "//third_party/blink/renderer/modules/payments/address_init.idl", +--- src/third_party/blink/renderer/bindings/generated_in_modules.gni 2025-04-16 14:36:32.335223804 +0200 ++++ src/third_party/blink/renderer/bindings/generated_in_modules.gni 2025-04-18 15:55:02.121445718 +0200 +@@ -148,10 +148,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_initial_prompt.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_prompt_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_prompt_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_create_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_detect_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_detect_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_rewrite_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_rewrite_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_create_core_options.cc", +@@ -728,8 +724,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_key_system_track_configuration.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_landmark.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_landmark.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detection_result.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detection_result.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_lock_info.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_lock_info.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_lock_manager_snapshot.cc", +@@ -922,8 +916,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_triangular_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_where_support_limits.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_where_support_limits.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_language_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_language_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_multi_cache_query_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_multi_cache_query_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_navigation_preload_state.cc", +@@ -1552,8 +1544,6 @@ generated_enumeration_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gamepad_haptics_result.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gamepad_mapping_type.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gamepad_mapping_type.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_availability.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_availability.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_address_mode.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_address_mode.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_auto_layout_mode.cc", +@@ -1956,12 +1946,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_factory.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_create_monitor.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_create_monitor.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_capabilities.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_capabilities.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_factory.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_factory.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_factory.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_factory.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter.cc", +@@ -1972,8 +1956,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_summarizer_factory.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_summarizer.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_summarizer.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_capabilities.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_capabilities.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_factory.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_factory.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator.cc", +@@ -2466,8 +2448,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_keyboard_layout_map.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_khr_parallel_shader_compile.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_khr_parallel_shader_compile.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_translator.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_translator.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_launch_params.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_launch_params.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_launch_queue.cc", +@@ -2924,8 +2904,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_usb.cc", +--- src/third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.idl 2025-04-16 14:36:32.773113846 +0200 ++++ src/third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.idl 2025-04-18 21:45:18.481187932 +0200 +@@ -11,11 +11,6 @@ interface AITranslatorFactory { + ] + Promise create(AITranslatorCreateOptions options); + // TODO(crbug.com/390459310): Replace with availability. +- [ +- CallWith=ScriptState, +- RaisesException +- ] +- Promise capabilities(); + }; + + dictionary AITranslatorCreateCoreOptions { +--- src/content/public/browser/content_browser_client.cc 2025-04-17 16:18:19.395831947 +0200 ++++ src/content/public/browser/content_browser_client.cc 2025-04-18 22:48:04.297289260 +0200 +@@ -1882,15 +1882,6 @@ GetContentLanguageDetectionDriver() { + } + } // namespace + +-void ContentBrowserClient::BindLanguageDetectionDriver( +- content::BrowserContext* browser_context, +- base::SupportsUserData* context_user_data, +- mojo::PendingReceiver< +- language_detection::mojom::ContentLanguageDetectionDriver> receiver) { +- if (base::FeatureList::IsEnabled(blink::features::kLanguageDetectionAPI)) { +- GetContentLanguageDetectionDriver().AddReceiver(std::move(receiver)); +- } +-} + + #if !BUILDFLAG(IS_ANDROID) + void ContentBrowserClient::QueryInstalledWebAppsByManifestId( +--- src/content/browser/browser_interface_binders.cc 2025-04-16 14:36:28.520070884 +0200 ++++ src/content/browser/browser_interface_binders.cc 2025-04-18 23:10:18.079235856 +0200 +@@ -1156,19 +1164,6 @@ void PopulateFrameBinders(RenderFrameHos + base::Unretained(host))); + } + +- if (base::FeatureList::IsEnabled(blink::features::kLanguageDetectionAPI)) { +- map->Add( +- base::BindRepeating( +- [](RenderFrameHostImpl* host, +- mojo::PendingReceiver< +- language_detection::mojom::ContentLanguageDetectionDriver> +- receiver) { +- GetContentClient()->browser()->BindLanguageDetectionDriver( +- host->GetBrowserContext(), &host->document_associated_data(), +- std::move(receiver)); +- }, +- base::Unretained(host))); +- } + } + + void PopulateBinderMapWithContext( +@@ -1446,19 +1443,6 @@ void PopulateDedicatedWorkerBinders(Dedi + }, + base::Unretained(host))); + } +- if (base::FeatureList::IsEnabled(blink::features::kLanguageDetectionAPI)) { +- map->Add( +- base::BindRepeating( +- [](DedicatedWorkerHost* host, +- mojo::PendingReceiver< +- language_detection::mojom::ContentLanguageDetectionDriver> +- receiver) { +- GetContentClient()->browser()->BindLanguageDetectionDriver( +- host->GetProcessHost()->GetBrowserContext(), host, +- std::move(receiver)); +- }, +- base::Unretained(host))); +- } + } + + void PopulateBinderMapWithContext( +@@ -1549,19 +1533,6 @@ void PopulateSharedWorkerBinders(SharedW + }, + base::Unretained(host))); + } +- if (base::FeatureList::IsEnabled(blink::features::kLanguageDetectionAPI)) { +- map->Add( +- base::BindRepeating( +- [](SharedWorkerHost* host, +- mojo::PendingReceiver< +- language_detection::mojom::ContentLanguageDetectionDriver> +- receiver) { +- GetContentClient()->browser()->BindLanguageDetectionDriver( +- host->GetProcessHost()->GetBrowserContext(), host, +- std::move(receiver)); +- }, +- base::Unretained(host))); +- } + + // RenderProcessHost binders + map->Add(BindWorkerReceiver( +@@ -1704,22 +1675,6 @@ void PopulateServiceWorkerBinders(Servic + }, + base::Unretained(host))); + } +- if (base::FeatureList::IsEnabled(blink::features::kLanguageDetectionAPI)) { +- map->Add( +- base::BindRepeating( +- [](ServiceWorkerHost* host, +- mojo::PendingReceiver< +- language_detection::mojom::ContentLanguageDetectionDriver> +- receiver) { +- if (auto* process_host = static_cast( +- RenderProcessHost::FromID(host->worker_process_id()))) { +- GetContentClient()->browser()->BindLanguageDetectionDriver( +- process_host->GetBrowserContext(), host, +- std::move(receiver)); +- } +- }, +- base::Unretained(host))); +- } + + // RenderProcessHost binders + map->Add(BindServiceWorkerReceiver( +--- src/content/public/browser/content_browser_client.h 2025-04-16 14:45:28.636752215 +0200 ++++ src/content/public/browser/content_browser_client.h 2025-04-18 23:30:15.399851141 +0200 +@@ -3144,11 +3144,6 @@ class CONTENT_EXPORT ContentBrowserClien + // Binds to a singleton new instance of + // `language_detection::ContentLanguageDetectionDriver` which receives the + // model from a local file specified by a flag param.. +- virtual void BindLanguageDetectionDriver( +- BrowserContext* browser_context, +- base::SupportsUserData* context_user_data, +- mojo::PendingReceiver< +- language_detection::mojom::ContentLanguageDetectionDriver> receiver); + + #if !BUILDFLAG(IS_ANDROID) + // Given the last committed URL of the RenderFrameHost, |frame_url|, and the diff --git a/remove-dawn.patch b/remove-dawn.patch index 3c16294..a64f114 100644 --- a/remove-dawn.patch +++ b/remove-dawn.patch @@ -45,17 +45,17 @@ Remove this unused component which brings a huge dependency on //third_party/daw #if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS) services.Add(RunShapeDetectionService); ---- src/content/utility/utility_main.cc.orig 2024-12-08 18:34:58.184673416 +0100 -+++ src/content/utility/utility_main.cc 2024-12-18 12:43:43.314689968 +0100 +--- src/content/utility/utility_main.cc.orig 2025-04-11 12:05:20.386081545 +0200 ++++ src/content/utility/utility_main.cc 2025-04-11 19:56:46.620452510 +0200 @@ -32,7 +32,6 @@ #include "sandbox/policy/mojom/sandbox.mojom.h" #include "sandbox/policy/sandbox.h" #include "sandbox/policy/sandbox_type.h" -#include "services/on_device_model/on_device_model_service.h" - #include "services/screen_ai/buildflags/buildflags.h" #include "services/tracing/public/cpp/trace_startup.h" + #include "services/video_effects/public/cpp/buildflags.h" -@@ -238,9 +237,6 @@ int UtilityMain(MainFunctionParams param +@@ -243,9 +242,6 @@ int UtilityMain(MainFunctionParams param } } @@ -65,7 +65,7 @@ Remove this unused component which brings a huge dependency on //third_party/daw #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // Thread type delegate of the process should be registered before first -@@ -275,11 +271,6 @@ int UtilityMain(MainFunctionParams param +@@ -278,11 +274,6 @@ int UtilityMain(MainFunctionParams param case sandbox::mojom::Sandbox::kAudio: pre_sandbox_hook = base::BindOnce(&audio::AudioPreSandboxHook); break; @@ -77,7 +77,7 @@ Remove this unused component which brings a huge dependency on //third_party/daw case sandbox::mojom::Sandbox::kSpeechRecognition: pre_sandbox_hook = base::BindOnce(&speech::SpeechRecognitionPreSandboxHook); -@@ -440,9 +431,6 @@ int UtilityMain(MainFunctionParams param +@@ -454,9 +445,6 @@ int UtilityMain(MainFunctionParams param run_loop.Run(); diff --git a/remove-libphonenumber.patch b/remove-libphonenumber.patch deleted file mode 100644 index 75c7172..0000000 --- a/remove-libphonenumber.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- src/third_party/blink/renderer/platform/BUILD.gn.orig 2025-01-02 22:23:59.424885429 +0100 -+++ src/third_party/blink/renderer/platform/BUILD.gn 2025-01-03 19:03:30.286845650 +0100 -@@ -1243,8 +1243,6 @@ component("platform") { - "keyboard_codes.h", - "language.cc", - "language.h", -- "language_detection/detect.cc", -- "language_detection/detect.h", - "link_hash.cc", - "link_hash.h", - "media/web_audio_source_provider_client.h", -@@ -1754,10 +1752,8 @@ component("platform") { - "//cc", - "//cc/ipc", - "//cc/mojo_embedder", -- "//components/language_detection/core:language_detection", - "//components/paint_preview/common", - "//components/search_engines:search_engine_utils", -- "//components/translate/core/language_detection:language_detection", - "//components/viz/client", - "//components/viz/common", - "//components/webrtc:net_address_utils", diff --git a/remove-password-manager-and-policy.patch b/remove-password-manager-and-policy.patch index b19124b..71f9b89 100644 --- a/remove-password-manager-and-policy.patch +++ b/remove-password-manager-and-policy.patch @@ -1,48 +1,3 @@ -From 54ec71011a6ebb873590802a70b2bc07578ba201 Mon Sep 17 00:00:00 2001 -From: Szabolcs David -Date: Mon, 10 Oct 2022 17:20:43 +0200 -Subject: Make user agent helpers buildable without unwanted dependencies - -"//components/policy" is enormously large with its resource files and -we don't want to build it for only one preference name. - -User agent utils are required to fill -navigator.userAgentData members in JavaScript. - -Task-number: QTBUG-107260 -Task-number: QTBUG-107451 -Change-Id: I752df68a8095ddb3f598a71f0419c1a2c9c408bb -Reviewed-by: Allan Sandfeld Jensen ---- - chromium/components/embedder_support/user_agent_utils.cc | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/chromium/components/embedder_support/user_agent_utils.cc b/chromium/components/embedder_support/user_agent_utils.cc -index c957a691efc..408fb837d80 100644 ---- a/components/embedder_support/user_agent_utils.cc -+++ b/components/embedder_support/user_agent_utils.cc -@@ -446,12 +446,14 @@ blink::UserAgentMetadata GetUserAgentMetadata(const PrefService* pref_service, - bool enable_updated_grease_by_policy = true; - // TODO(crbug.com/40838057): Remove this after M126 which deprecates the - // policy. -+#if 0 - if (pref_service) { - if (pref_service->HasPrefPath( - policy::policy_prefs::kUserAgentClientHintsGREASEUpdateEnabled)) - enable_updated_grease_by_policy = pref_service->GetBoolean( - policy::policy_prefs::kUserAgentClientHintsGREASEUpdateEnabled); - } -+#endif - - // Low entropy client hints. - metadata.brand_version_list = --- -cgit v1.2.3 - - - -…and now come Electron—specific changes to support the above: - --- src/components/browsing_data/core/BUILD.gn.old +++ src/components/browsing_data/core/BUILD.gn @@ -36,9 +36,7 @@ static_library("core") { @@ -91,19 +46,19 @@ cgit v1.2.3 "//components/prefs", "//components/version_info", "//content/public/browser", ---- src/components/permissions/BUILD.gn.old -+++ src/components/permissions/BUILD.gn -@@ -109,10 +109,7 @@ source_set("permissions") { +--- src/components/permissions/BUILD.gn.orig 2025-04-11 12:05:19.206024144 +0200 ++++ src/components/permissions/BUILD.gn 2025-04-11 20:04:52.832323166 +0200 +@@ -119,10 +119,7 @@ source_set("permissions") { + ] deps = [ "//base", - "//build:chromeos_buildflags", - "//components/back_forward_cache", - "//components/content_settings/browser", "//components/content_settings/core/browser", - "//components/content_settings/core/browser:cookie_settings", "//components/favicon/core:core", + "//components/guest_view/buildflags", "//components/keyed_service/content", - "//components/permissions/prediction_service", --- src/components/proxy_config/BUILD.gn.old +++ src/components/proxy_config/BUILD.gn @@ -23,9 +23,6 @@ component("proxy_config") { @@ -191,20 +146,24 @@ cgit v1.2.3 "//device/vr/buildflags", ] } ---- src/components/search_engines/BUILD.gn.orig 2024-12-08 18:34:56.928006713 +0100 -+++ src/components/search_engines/BUILD.gn 2024-12-18 12:48:04.888029763 +0100 -@@ -16,45 +16,23 @@ static_library("search_engines") { - "default_search_manager.cc", - "default_search_manager.h", - "eea_countries_ids.h", +--- src/components/search_engines/BUILD.gn.orig 2025-04-11 12:05:19.397475381 +0200 ++++ src/components/search_engines/BUILD.gn 2025-04-11 20:05:37.960311107 +0200 +@@ -12,49 +12,21 @@ if (is_android) { + static_library("search_engines") { + sources = [ + "choice_made_location.h", +- "default_search_manager.cc", +- "default_search_manager.h", - "enterprise/default_search_policy_handler.cc", - "enterprise/default_search_policy_handler.h", - "enterprise/enterprise_site_search_manager.cc", - "enterprise/enterprise_site_search_manager.h", + "enterprise/enterprise_search_manager.cc", + "enterprise/enterprise_search_manager.h", - "keyword_table.cc", - "keyword_table.h", "keyword_web_data_service.cc", "keyword_web_data_service.h", +- "reconciling_template_url_data_holder.cc", +- "reconciling_template_url_data_holder.h", "search_engine_choice/search_engine_choice_metrics_service_accessor.h", - "search_engine_choice/search_engine_choice_service.cc", - "search_engine_choice/search_engine_choice_service.h", @@ -219,8 +178,8 @@ cgit v1.2.3 - "template_url.h", "template_url_data.cc", "template_url_data.h", - "template_url_data_util.cc", - "template_url_data_util.h", +- "template_url_data_util.cc", +- "template_url_data_util.h", - "template_url_fetcher.cc", - "template_url_fetcher.h", "template_url_id.h", @@ -239,15 +198,15 @@ cgit v1.2.3 ] public_deps = [ -@@ -69,7 +47,6 @@ static_library("search_engines") { +@@ -68,7 +46,6 @@ static_library("search_engines") { "//components/sync", "//components/webdata/common", "//third_party/metrics_proto", - "//third_party/omnibox_proto", + "//third_party/search_engines_data:prepopulated_engines", ] - deps = [ -@@ -77,15 +54,9 @@ static_library("search_engines") { +@@ -77,16 +47,10 @@ static_library("search_engines") { "//components/country_codes", "//components/crash/core/common:crash_key", "//components/database_utils", @@ -259,11 +218,12 @@ cgit v1.2.3 - "//components/policy:generated", - "//components/policy/core/browser", "//components/pref_registry", + "//components/regional_capabilities", - "//components/search_provider_logos:switches", "//components/signin/public/base", "//components/strings", "//components/url_formatter", -@@ -97,7 +68,6 @@ static_library("search_engines") { +@@ -98,7 +62,6 @@ static_library("search_engines") { "//services/network/public/mojom", "//sql", "//third_party/metrics_proto", @@ -271,7 +231,7 @@ cgit v1.2.3 "//ui/base", "//ui/gfx", "//ui/gfx/geometry", -@@ -123,7 +93,7 @@ static_library("search_engines") { +@@ -124,7 +87,7 @@ static_library("search_engines") { ] } @@ -280,15 +240,15 @@ cgit v1.2.3 sources += [ "search_engine_choice/generated_marketing_snippets.cc" ] deps += [ ":generate_search_engine_icons", -@@ -132,7 +102,7 @@ static_library("search_engines") { +@@ -133,7 +96,7 @@ static_library("search_engines") { ] } - if (is_linux || is_win || is_mac || is_chromeos) { + if (false) { sources += [ - "enterprise/site_search_policy_handler.cc", - "enterprise/site_search_policy_handler.h", + "enterprise/search_aggregator_policy_handler.cc", + "enterprise/search_aggregator_policy_handler.h", --- src/components/search/BUILD.gn.old +++ src/components/search/BUILD.gn @@ -6,10 +6,6 @@ static_library("search") { @@ -302,9 +262,9 @@ cgit v1.2.3 ] deps = [ ---- src/extensions/common/BUILD.gn.orig -+++ src/extensions/common/BUILD.gn -@@ -301,8 +301,6 @@ static_library("common") { +--- src/extensions/common/BUILD.gn.orig 2025-04-11 12:05:20.590871749 +0200 ++++ src/extensions/common/BUILD.gn 2025-04-11 20:05:59.704305366 +0200 +@@ -313,8 +313,6 @@ static_library("common") { "extension_set.cc", "extension_set.h", "extension_updater_uma.h", @@ -313,10 +273,10 @@ cgit v1.2.3 "extension_utility_types.h", "extensions_client.cc", "extensions_client.h", -@@ -498,8 +496,6 @@ static_library("common") { - "//components/crash/core/common", +@@ -524,8 +522,6 @@ static_library("common") { "//components/crx_file", "//components/nacl/common:buildflags", + "//components/pdf/common:util", - "//components/safe_browsing/core/common", - "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils", "//components/url_formatter", diff --git a/remove-rust.patch b/remove-rust.patch index 679ae39..082e88a 100644 --- a/remove-rust.patch +++ b/remove-rust.patch @@ -1,26 +1,26 @@ Remove this dead code which brings a dependency on rustc ---- src/components/BUILD.gn.orig 2024-03-27 16:30:09.189645288 +0100 -+++ src/components/BUILD.gn 2024-03-28 23:11:14.847582213 +0100 -@@ -282,7 +282,6 @@ test("components_unittests") { +--- src/components/BUILD.gn.orig 2025-04-11 12:05:18.743943100 +0200 ++++ src/components/BUILD.gn 2025-04-11 19:52:11.508526413 +0200 +@@ -297,7 +297,6 @@ test("components_unittests") { "//components/profile_metrics:unit_tests", "//components/proxy_config:unit_tests", "//components/push_notification:unit_tests", - "//components/qr_code_generator:unit_tests", "//components/query_parser:unit_tests", "//components/reading_list/core:unit_tests", - "//components/reporting/client:unit_tests", ---- src/chrome/browser/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 -+++ src/chrome/browser/BUILD.gn 2024-12-18 12:38:43.758015814 +0100 -@@ -1798,7 +1798,6 @@ static_library("browser") { + "//components/regional_capabilities:unit_tests", +--- src/chrome/browser/BUILD.gn.orig 2025-04-11 12:13:12.927314100 +0200 ++++ src/chrome/browser/BUILD.gn 2025-04-11 19:52:48.976512203 +0200 +@@ -1777,7 +1777,6 @@ static_library("browser") { "//chrome/browser/profiling_host", # TODO(crbug.com/40228447): break this dep when favicon is in its own target - "//chrome/browser/share", - "//chrome/browser/ui", # TODO(358041220): There is a circular_dependency of `cookie_controls:impl` module -@@ -1950,7 +1949,6 @@ static_library("browser") { + # with "//chrome/browser" due to the inclusion of //c/b/policy/profile_policy_connector.h +@@ -1935,7 +1934,6 @@ static_library("browser") { "//chrome/browser/search_engine_choice", "//chrome/browser/search_engine_choice:impl", "//chrome/browser/search_engines", @@ -28,7 +28,7 @@ Remove this dead code which brings a dependency on rustc "//chrome/browser/sharing:buildflags", "//chrome/browser/signin", "//chrome/browser/signin:identity_manager_provider", -@@ -8566,7 +8564,6 @@ static_library("browser_generated_files" +@@ -8426,7 +8424,6 @@ static_library("browser_generated_files" "//chrome/browser/new_tab_page/modules/v2/calendar:mojo_bindings", "//chrome/browser/new_tab_page/modules/v2/most_relevant_tab_resumption:mojo_bindings", "//chrome/browser/profile_resetter:profile_reset_report_proto", @@ -36,7 +36,7 @@ Remove this dead code which brings a dependency on rustc "//chrome/browser/support_tool:support_tool_proto", "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto", "//chrome/browser/ui:webui_name_variants", -@@ -9024,7 +9021,6 @@ static_library("test_support") { +@@ -8877,7 +8874,6 @@ static_library("test_support") { "//chrome/browser/policy/messaging_layer/proto:crd_event_proto", "//chrome/browser/search_engine_choice", "//chrome/browser/search_engines", @@ -62,17 +62,17 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser", "//components/reading_list/core", "//components/reading_list/features:flags", ---- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 -+++ src/chrome/test/BUILD.gn 2024-12-18 12:39:55.361350918 +0100 -@@ -2013,7 +2013,6 @@ if (!is_android) { +--- src/chrome/test/BUILD.gn.orig 2025-04-11 12:13:12.932314099 +0200 ++++ src/chrome/test/BUILD.gn 2025-04-11 19:53:28.092504094 +0200 +@@ -2163,7 +2163,6 @@ if (!is_android) { "//chrome/browser/web_applications:prevent_close_test_support", "//chrome/browser/web_applications:web_applications_test_support", "//chrome/browser/webaudio:browser_tests", - "//chrome/browser/webauthn:test_support", "//chrome/common:version_header", - "//chrome/common/companion/visual_query:flags", "//chrome/common/privacy_budget:test_support", -@@ -2186,7 +2185,6 @@ if (!is_android) { + "//chrome/renderer", +@@ -2337,7 +2336,6 @@ if (!is_android) { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", "//components/proxy_config", @@ -80,7 +80,7 @@ Remove this dead code which brings a dependency on rustc "//components/reading_list/core", "//components/reading_list/features:flags", "//components/resources", -@@ -6855,7 +6853,6 @@ test("unit_tests") { +@@ -6648,7 +6646,6 @@ test("unit_tests") { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", "//components/proxy_config", @@ -88,7 +88,7 @@ Remove this dead code which brings a dependency on rustc "//components/query_parser", "//components/reading_list/core", "//components/reading_list/core:test_support", -@@ -7029,7 +7026,6 @@ test("unit_tests") { +@@ -6829,7 +6826,6 @@ test("unit_tests") { "//third_party/metrics_proto", "//third_party/microsoft_webauthn", "//third_party/re2", @@ -96,12 +96,12 @@ Remove this dead code which brings a dependency on rustc "//third_party/webrtc_overrides:webrtc_component", "//third_party/widevine/cdm:headers", "//third_party/zlib/google:compression_utils", -@@ -8314,8 +8310,6 @@ test("unit_tests") { - "//chrome/browser/ui/zoom", - "//chrome/browser/ui/zoom:unit_tests", +@@ -8115,8 +8111,6 @@ test("unit_tests") { + "//chrome/browser/upgrade_detector:build_state_observer", + "//chrome/browser/user_annotations", "//chrome/browser/web_applications:web_applications_test_support", - "//chrome/browser/webauthn:test_support", - "//chrome/browser/webauthn/proto", - "//chrome/common/accessibility:mojo_bindings", + "//chrome/common/read_anything:mojo_bindings", "//chrome/services/speech:unit_tests", "//components/app_constants", diff --git a/remove-sync.patch b/remove-sync.patch index 920fc15..58d67ba 100644 --- a/remove-sync.patch +++ b/remove-sync.patch @@ -6,20 +6,20 @@ Inspired by: * https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=8a9d741f4c4cf8170d5c50a336d51fe5d1b16ce8 * https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit?h=122-based&id=6a11e9169f5889883bf63a3522d0c3f8f23552b0 ---- src/components/search_engines/BUILD.gn.orig -+++ src/components/search_engines/BUILD.gn -@@ -66,7 +66,6 @@ static_library("search_engines") { +--- src/components/search_engines/BUILD.gn.orig 2025-04-11 12:05:19.397475381 +0200 ++++ src/components/search_engines/BUILD.gn 2025-04-11 20:18:41.424101555 +0200 +@@ -65,7 +65,6 @@ static_library("search_engines") { "//components/google/core/common", "//components/keyed_service/core", "//components/prefs", - "//components/sync", "//components/webdata/common", "//third_party/metrics_proto", - ] ---- src/electron/BUILD.gn.orig -+++ src/electron/BUILD.gn -@@ -1204,6 +1204,8 @@ if (is_mac) { - "//electron/buildflags", + "//third_party/search_engines_data:prepopulated_engines", +--- src/electron/BUILD.gn.orig 2025-04-11 12:02:41.207130337 +0200 ++++ src/electron/BUILD.gn 2025-04-11 20:18:41.424101555 +0200 +@@ -1210,6 +1210,8 @@ if (is_mac) { + "//third_party/electron_node:libnode", "//ui/strings", ] + @@ -178,12 +178,15 @@ Inspired by: // True if the dictionary has been loaded. Otherwise false. bool is_loaded_; ---- src/device/fido/BUILD.gn.orig 2024-12-08 18:34:58.231340083 +0100 -+++ src/device/fido/BUILD.gn 2024-12-18 12:59:49.294713941 +0100 -@@ -163,36 +163,6 @@ component("fido") { +--- src/device/fido/BUILD.gn.orig 2025-04-11 12:05:20.416153184 +0200 ++++ src/device/fido/BUILD.gn 2025-04-11 20:19:44.976088243 +0200 +@@ -159,25 +159,6 @@ component("fido") { "device_operation.h", "device_response_converter.cc", "device_response_converter.h", +- "enclave/attestation.cc", +- "enclave/attestation.h", +- "enclave/attestation_report.h", - "enclave/constants.cc", - "enclave/constants.h", - "enclave/enclave_authenticator.cc", @@ -200,42 +203,28 @@ Inspired by: - "enclave/transact.h", - "enclave/types.cc", - "enclave/types.h", -- "enclave/verify/amd.cc", -- "enclave/verify/amd.h", -- "enclave/verify/attestation_report.cc", -- "enclave/verify/attestation_report.h", -- "enclave/verify/claim.cc", -- "enclave/verify/claim.h", -- "enclave/verify/endorsement.cc", -- "enclave/verify/endorsement.h", -- "enclave/verify/rekor.cc", -- "enclave/verify/rekor.h", -- "enclave/verify/utils.cc", -- "enclave/verify/utils.h", -- "enclave/verify/verifier.cc", -- "enclave/verify/verifier.h", "fido_authenticator.cc", "fido_authenticator.h", "fido_device.cc", -@@ -257,7 +227,6 @@ component("fido") { +@@ -242,7 +223,6 @@ component("fido") { ] deps += [ - "//components/sync/protocol:protocol", - "//device/fido/enclave/verify/proto:proto", + "//device/fido/enclave/proto:proto", "//services/device/public/cpp/hid", "//services/device/public/cpp/usb", ---- src/device/fido/fido_discovery_factory.cc.orig 2024-12-08 18:34:58.241340085 +0100 -+++ src/device/fido/fido_discovery_factory.cc 2024-12-18 13:01:00.958049095 +0100 -@@ -13,7 +13,6 @@ - #include "device/fido/aoa/android_accessory_discovery.h" +--- src/device/fido/fido_discovery_factory.cc.orig 2025-04-11 12:05:20.421153186 +0200 ++++ src/device/fido/fido_discovery_factory.cc 2025-04-11 20:18:43.280101088 +0200 +@@ -12,7 +12,6 @@ + #include "device/bluetooth/bluetooth_adapter_factory.h" #include "device/fido/cable/fido_cable_discovery.h" #include "device/fido/cable/v2_discovery.h" -#include "device/fido/enclave/enclave_discovery.h" #include "device/fido/features.h" #include "device/fido/fido_discovery_base.h" #include "device/fido/hid/fido_hid_discovery.h" -@@ -124,12 +123,7 @@ std::vector> FidoDiscoveryFactory::MaybeCreateEnclaveDiscovery() { @@ -268,3 +257,15 @@ Inspired by: "//components/variations", "//components/variations/field_trial_config", "//components/variations/proto", +--- src/content/public/browser/BUILD.gn.orig 2025-04-11 12:05:20.173348334 +0200 ++++ src/content/public/browser/BUILD.gn 2025-04-12 14:17:07.499743022 +0200 +@@ -584,9 +584,7 @@ source_set("browser_sources") { + deps = [ + "//cc", + "//components/input", +- "//components/language_detection/content/browser", + "//components/language_detection/content/common", +- "//components/language_detection/core/browser:language_detection_model_service", + "//components/services/storage/public/cpp", + "//components/variations:variations", + "//components/viz/host", diff --git a/resource-Wchanges-meaning.patch b/resource-Wchanges-meaning.patch new file mode 100644 index 0000000..0f3d132 --- /dev/null +++ b/resource-Wchanges-meaning.patch @@ -0,0 +1,11 @@ +--- src/third_party/blink/renderer/platform/loader/fetch/resource.h.orig 2025-04-16 14:36:33.086070015 +0200 ++++ src/third_party/blink/renderer/platform/loader/fetch/resource.h 2025-04-16 21:57:27.672717364 +0200 +@@ -363,7 +363,7 @@ class PLATFORM_EXPORT Resource : public + // attributes. + bool ForceIntegrityChecks() const; + +- const IntegrityReport& IntegrityReport() const { return integrity_report_; } ++ const blink::IntegrityReport& IntegrityReport() const { return integrity_report_; } + bool MustRefetchDueToIntegrityMetadata(const FetchParameters&) const; + + bool IsAlive() const { return is_alive_; } diff --git a/resource_response-Wchanges-meaning.patch b/resource_response-Wchanges-meaning.patch new file mode 100644 index 0000000..4b16a2d --- /dev/null +++ b/resource_response-Wchanges-meaning.patch @@ -0,0 +1,11 @@ +--- src/third_party/blink/renderer/platform/loader/fetch/resource_response.h.orig 2025-04-16 14:36:33.089070014 +0200 ++++ src/third_party/blink/renderer/platform/loader/fetch/resource_response.h 2025-04-16 21:43:33.972794371 +0200 +@@ -174,7 +174,7 @@ class PLATFORM_EXPORT ResourceResponse f + std::optional LastModified(UseCounter&) const; + // Will always return values >= 0. + base::TimeDelta CacheControlStaleWhileRevalidate() const; +- std::optional UnencodedDigest() const; ++ std::optional UnencodedDigest() const; + + unsigned ConnectionID() const; + void SetConnectionID(unsigned); diff --git a/string-hasher-flax-vector-conversions.patch b/string-hasher-flax-vector-conversions.patch new file mode 100644 index 0000000..83bf574 --- /dev/null +++ b/string-hasher-flax-vector-conversions.patch @@ -0,0 +1,23 @@ +--- src/v8/src/strings/string-hasher.cc.orig 2025-04-20 12:05:55.016195134 +0200 ++++ src/v8/src/strings/string-hasher.cc 2025-04-20 12:10:16.788185381 +0200 +@@ -27,7 +27,7 @@ struct ConvertTo8BitHashReader { + __m128i x = _mm_loadu_si128(reinterpret_cast(p)); + return _mm_cvtsi128_si64(_mm_packus_epi16(x, x)); + #elif defined(__ARM_NEON__) +- int16x8_t x; ++ uint16x8_t x; + memcpy(&x, p, sizeof(x)); + return vget_lane_u64(vreinterpret_u64_u8(vmovn_u16(x)), 0); + #else +@@ -48,9 +48,9 @@ struct ConvertTo8BitHashReader { + __m128i x = _mm_loadu_si64(reinterpret_cast(p)); + return _mm_cvtsi128_si64(_mm_packus_epi16(x, x)); + #elif defined(__ARM_NEON__) +- int8x8_t x; ++ uint16x4_t x; + memcpy(&x, p, sizeof(x)); +- int16x8_t x_wide = vcombine_u64(x, x); ++ uint16x8_t x_wide = vcombine_u16(x, x); + return vget_lane_u32(vreinterpret_u32_u8(vmovn_u16(x_wide)), 0); + #else + return (uint64_t{p[0]}) | (uint64_t{p[1]} << 8) | (uint64_t{p[2]} << 16) | diff --git a/string_truncator-convert.patch b/string_truncator-convert.patch new file mode 100644 index 0000000..cb4381e --- /dev/null +++ b/string_truncator-convert.patch @@ -0,0 +1,20 @@ +--- src/third_party/blink/renderer/platform/fonts/string_truncator.cc.orig 2025-04-16 14:36:33.038422986 +0200 ++++ src/third_party/blink/renderer/platform/fonts/string_truncator.cc 2025-04-16 22:05:13.224674254 +0200 +@@ -168,7 +168,7 @@ static String TruncateString(const Strin + DCHECK_LT(keep_count, keep_count_for_smallest_known_to_not_fit); + DCHECK_GT(keep_count, keep_count_for_largest_known_to_fit); + +- truncated_string = truncate_to_buffer(string, keep_count, string_buffer); ++ truncated_string = truncate_to_buffer(string, keep_count, base::span(string_buffer)); + + width = StringWidth(font, truncated_string); + if (width <= max_width) { +@@ -185,7 +185,7 @@ static String TruncateString(const Strin + + if (keep_count != keep_count_for_largest_known_to_fit) { + keep_count = keep_count_for_largest_known_to_fit; +- truncated_string = truncate_to_buffer(string, keep_count, string_buffer); ++ truncated_string = truncate_to_buffer(string, keep_count, base::span(string_buffer)); + } + + return String(truncated_string); diff --git a/string_view-incomplete-CodePointIterator.patch b/string_view-incomplete-CodePointIterator.patch index 17bdf79..cc6b891 100644 --- a/string_view-incomplete-CodePointIterator.patch +++ b/string_view-incomplete-CodePointIterator.patch @@ -41,10 +41,10 @@ In file included from ../../third_party/blink/renderer/platform/wtf/text/atomic_ 31 | class CodePointIterator; | ^~~~~~~~~~~~~~~~~ ---- src/third_party/blink/renderer/platform/wtf/text/string_view.h.orig 2025-01-22 21:21:43.120141300 +0100 -+++ src/third_party/blink/renderer/platform/wtf/text/string_view.h 2025-01-22 23:39:31.542552700 +0100 +--- src/third_party/blink/renderer/platform/wtf/text/string_view.h.orig 2025-04-20 19:22:39.910671377 +0200 ++++ src/third_party/blink/renderer/platform/wtf/text/string_view.h 2025-04-20 21:05:46.878482748 +0200 @@ -19,6 +19,7 @@ - #include "third_party/abseil-cpp/absl/base/attributes.h" + #include "base/numerics/safe_conversions.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/get_ptr.h" +#include "third_party/blink/renderer/platform/wtf/text/code_point_iterator.h" @@ -58,4 +58,4 @@ In file included from ../../third_party/blink/renderer/platform/wtf/text/atomic_ -class CodePointIterator; class String; - enum UTF8ConversionMode { + enum class Utf8ConversionMode : uint8_t { diff --git a/style_scope-unqualified-To.patch b/style_scope-unqualified-To.patch new file mode 100644 index 0000000..0682572 --- /dev/null +++ b/style_scope-unqualified-To.patch @@ -0,0 +1,11 @@ +--- src/third_party/blink/renderer/core/css/style_scope.cc 2025-04-16 14:36:32.429070140 +0200 ++++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/nodejs-electron-35.1.5-build/src/third_party/blink/renderer/core/css/style_scope.cc 2025-04-17 16:02:10.183836430 +0200 +@@ -32,7 +32,7 @@ StyleScope* StyleScope::CopyWithParent(c + + const StyleScope* StyleScope::Renest(StyleRule* new_parent) const { + StyleRule* reparented_from = +- from_ ? To(from_->Renest(new_parent)) : nullptr; ++ from_ ? blink::To(from_->Renest(new_parent)) : nullptr; + if (from_ == reparented_from) { + return this; + } diff --git a/system-ada-url.patch b/system-ada-url.patch index 14ed615..b6a9268 100644 --- a/system-ada-url.patch +++ b/system-ada-url.patch @@ -1,30 +1,19 @@ ---- src/third_party/electron_node/BUILD.gn.orig 2024-11-12 22:51:23.369659000 +0100 -+++ src/third_party/electron_node/BUILD.gn 2024-11-12 23:46:45.817651900 +0100 -@@ -40,6 +40,7 @@ declare_args() { - node_release_urlbase = "" - - # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries. -+ use_system_ada = false - use_system_cares = false - use_system_nghttp2 = false - use_system_llhttp = false -@@ -260,7 +261,6 @@ component("node_lib") { - deps = [ - ":node_js2c_exec", - "deps/googletest:gtest", -- "deps/ada", - "deps/base64", - "deps/simdutf", - "deps/uvwasi", -@@ -291,6 +291,11 @@ component("node_lib") { - "deps/postject" - ] - libs = [] -+ if (use_system_ada) { -+ libs += [ "ada" ] -+ } else { -+ deps += [ "deps/ada" ] -+ } - if (use_system_llhttp) { - libs += [ "llhttp" ] - } else { +--- src/third_party/electron_node/unofficial.gni.orig 2025-04-11 21:14:18.899221050 +0200 ++++ src/third_party/electron_node/unofficial.gni 2025-04-11 21:14:28.715218444 +0200 +@@ -143,7 +143,6 @@ template("node_gn_build") { + "deps/googletest:googletest_config", + ] + public_deps = [ +- "deps/ada", + "deps/uv", + "//electron:electron_js2c", + "deps/simdjson", +@@ -183,6 +182,8 @@ template("node_gn_build") { + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] + } ++ libs = [ "ada" ] ++ include_dirs = [] + if (use_system_llhttp) { + libs += [ "llhttp" ] + } else { diff --git a/system-gtest.patch b/system-gtest.patch index 6902354..969862a 100644 --- a/system-gtest.patch +++ b/system-gtest.patch @@ -10,72 +10,42 @@ We don't need this huge test-only dependency in the tarball. Only one header is +#include #endif // TESTING_GTEST_INCLUDE_GTEST_GTEST_PROD_H_ ---- a/third_party/electron_node/deps/googletest/BUILD.gn 2022-07-22 14:56:38.984761919 +0200 -+++ b/third_party/electron_node/deps/googletest/BUILD.gn 2022-07-29 19:21:57.655767809 +0200 -@@ -1,61 +1,11 @@ --config("gtest_config") { -- include_dirs = [ "include" ] -- defines = [ "UNIT_TEST" ] --} +--- src/third_party/electron_node/deps/googletest/unofficial.gni.orig 2025-04-11 12:06:33.194184022 +0200 ++++ src/third_party/electron_node/deps/googletest/unofficial.gni 2025-04-11 20:55:32.455520889 +0200 +@@ -1,3 +1,5 @@ +import("//build/config/linux/pkg_config.gni") ++ + # This file is used by GN for building, which is NOT the build system used for + # building official binaries. + # Please edit the gyp files if you are making changes to build system. +@@ -5,27 +7,14 @@ + # The actual configurations are put inside a template in unofficial.gni to + # prevent accidental edits from contributors. + template("googletest_gn_build") { +- config("googletest_config") { +- include_dirs = [ "include" ] ++ pkg_config("googletest_config") { ++ packages = [ "gtest" ] + } --static_library("gtest") { -- include_dirs = [ -- "include", -- "." # src -- ] -+pkg_config("gtest_config") { -+ packages = [ "gtest" ] -+} +- gypi_values = exec_script("../../tools/gypi_to_gn.py", +- [ rebase_path("googletest.gyp") ], +- "scope", +- [ "googletest.gyp" ]) -+source_set("gtest") { - public_configs = [ ":gtest_config" ] -- -- cflags_cc = [ -- "-Wno-c++98-compat-extra-semi", -- "-Wno-unused-const-variable", -- "-Wno-unreachable-code-return", -- ] -- -- defines = [ -- "GTEST_HAS_POSIX_RE=0", -- "GTEST_LANG_CXX11=1", -- ] -- -- sources = [ -- "include/gtest/gtest_pred_impl.h", -- "include/gtest/gtest_prod.h", -- "include/gtest/gtest-death-test.h", -- "include/gtest/gtest-matchers.h", -- "include/gtest/gtest-message.h", -- "include/gtest/gtest-param-test.h", -- "include/gtest/gtest-printers.h", -- "include/gtest/gtest-spi.h", -- "include/gtest/gtest-test-part.h", -- "include/gtest/gtest-typed-test.h", -- "include/gtest/gtest.h", -- "include/gtest/internal/gtest-death-test-internal.h", -- "include/gtest/internal/gtest-filepath.h", -- "include/gtest/internal/gtest-internal.h", -- "include/gtest/internal/gtest-param-util.h", -- "include/gtest/internal/gtest-port-arch.h", -- "include/gtest/internal/gtest-port.h", -- "include/gtest/internal/gtest-string.h", -- "include/gtest/internal/gtest-type-util.h", -- "include/gtest/internal/custom/gtest-port.h", -- "include/gtest/internal/custom/gtest-printers.h", -- "include/gtest/internal/custom/gtest.h", -- "src/gtest-all.cc", -- "src/gtest-death-test.cc", -- "src/gtest-filepath.cc", -- "src/gtest-internal-inl.h", -- "src/gtest-matchers.cc", -- "src/gtest-port.cc", -- "src/gtest-printers.cc", -- "src/gtest-test-part.cc", -- "src/gtest-typed-test.cc", -- "src/gtest.cc", -- ] - } + source_set(target_name) { + forward_variables_from(invoker, "*") +- testonly = true +- include_dirs = [ +- "include", +- ".", +- ] +- defines = [ +- "GTEST_HAS_POSIX_RE=0", +- "GTEST_LANG_CXX11=1", +- ] +- sources = gypi_values.googletest_sources ++ public_configs = [ ":googletest_config" ] + } - static_library("gtest_main") { + source_set("gtest_main") { diff --git a/system-libdrm.patch b/system-libdrm.patch index f5fed9d..8488f70 100644 --- a/system-libdrm.patch +++ b/system-libdrm.patch @@ -29,11 +29,11 @@ Index: chromium-98.0.4758.80/ui/ozone/platform/drm/gpu/crtc_controller.h #include "ui/ozone/platform/drm/common/scoped_drm_types.h" Index: chromium-98.0.4758.80/ui/ozone/platform/drm/gpu/hardware_display_controller.cc =================================================================== ---- chromium-98.0.4758.80.orig/ui/ozone/platform/drm/gpu/hardware_display_controller.cc -+++ chromium-98.0.4758.80/ui/ozone/platform/drm/gpu/hardware_display_controller.cc -@@ -20,7 +20,7 @@ +--- src/ui/ozone/platform/drm/gpu/hardware_display_controller.cc.orig 2025-04-11 12:05:30.840157601 +0200 ++++ src/ui/ozone/platform/drm/gpu/hardware_display_controller.cc 2025-04-11 20:45:59.075673214 +0200 +@@ -18,7 +18,7 @@ + #include "base/logging.h" #include "base/metrics/histogram_macros.h" - #include "base/ranges/algorithm.h" #include "base/trace_event/typed_macros.h" -#include "third_party/libdrm/src/include/drm/drm_fourcc.h" +#include diff --git a/system-pydeps.patch b/system-pydeps.patch index bfeaadd..90463bd 100644 --- a/system-pydeps.patch +++ b/system-pydeps.patch @@ -116,9 +116,9 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. ../../build/scripts/blinkbuild/__init__.py ../../build/scripts/blinkbuild/name_style_converter.py validate_web_idl.py ---- a/mojo/public/tools/bindings/mojom.gni -+++ b/mojo/public/tools/bindings/mojom.gni -@@ -699,7 +699,7 @@ +--- src/mojo/public/tools/bindings/mojom.gni.orig 2025-04-11 12:05:21.530272509 +0200 ++++ src/mojo/public/tools/bindings/mojom.gni 2025-04-11 20:56:50.579500868 +0200 +@@ -802,7 +802,7 @@ template("mojom") { remote_worker = "large" custom_processor = "mojom_parser" script = mojom_parser_script @@ -126,7 +126,7 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. + inputs = mojom_parser_sources + [ build_metadata_filename ] sources = sources_list public_deps = parser_deps - outputs = [] + outputs = action_outputs --- src/third_party/blink/renderer/build/scripts/scripts.gni.orig 2024-12-08 18:35:01.138006834 +0100 +++ src/third_party/blink/renderer/build/scripts/scripts.gni 2024-12-18 13:24:36.436191575 +0100 @@ -18,10 +18,6 @@ if (is_ios) { @@ -164,3 +164,14 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. "//third_party/jinja2/__init__.py", "//third_party/jinja2/_identifier.py", "//third_party/jinja2/async_utils.py", +--- src/third_party/blink/renderer/core/sanitizer/builtins_all_known.py.orig 2025-04-16 14:36:32.677312629 +0200 ++++ src/third_party/blink/renderer/core/sanitizer/builtins_all_known.py 2025-04-16 21:52:51.840741724 +0200 +@@ -13,7 +13,7 @@ namespace that Blink's C++ implementatio + import json + import optparse + import sys +-from pyjson5.src import json5 ++import json5 + + + def error(context, *infos): diff --git a/system-simdutf.patch b/system-simdutf.patch index 4740c62..3ee8c01 100644 --- a/system-simdutf.patch +++ b/system-simdutf.patch @@ -1,35 +1,56 @@ ---- src/third_party/electron_node/deps/simdutf/BUILD.gn.old 2023-10-13 11:35:11.896370000 +0200 -+++ src/third_party/electron_node/deps/simdutf/BUILD.gn 2023-10-17 19:29:35.882793400 +0200 -@@ -1,15 +1,26 @@ -+declare_args() { -+ use_system_simdutf = false +From 3fb3bab213348955edc18a051f9c3f86241309e8 Mon Sep 17 00:00:00 2001 +From: LN Liberda +Date: Thu, 13 Mar 2025 20:01:32 -0700 +Subject: [PATCH] unbundle: add simdutf + +Bug: none +Change-Id: Idae290112561e5658c614f5eae8895abfe996124 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6333513 +Reviewed-by: Thomas Anderson +Commit-Queue: Thomas Anderson +Reviewed-by: Lei Zhang +Cr-Commit-Position: refs/heads/main@{#1432518} +--- + build/linux/unbundle/replace_gn_files.py | 1 + + build/linux/unbundle/simdutf.gn | 20 ++++++++++++++++++++ + 2 files changed, 21 insertions(+) + create mode 100644 build/linux/unbundle/simdutf.gn + +diff --git a/build/linux/unbundle/replace_gn_files.py b/build/linux/unbundle/replace_gn_files.py +index 9ee6fda6547d90..f5db9d23c886b7 100755 +--- a/build/linux/unbundle/replace_gn_files.py ++++ b/build/linux/unbundle/replace_gn_files.py +@@ -67,6 +67,7 @@ + 'openh264': 'third_party/openh264/BUILD.gn', + 'opus': 'third_party/opus/BUILD.gn', + 're2': 'third_party/re2/BUILD.gn', ++ 'simdutf': 'third_party/simdutf/BUILD.gn', + 'snappy': 'third_party/snappy/BUILD.gn', + # Use system libSPIRV-Tools in Swiftshader. + # These two shims MUST be used together. +diff --git a/build/linux/unbundle/simdutf.gn b/build/linux/unbundle/simdutf.gn +new file mode 100644 +index 00000000000000..67d86cb3b3e5f9 +--- /dev/null ++++ b/build/linux/unbundle/simdutf.gn +@@ -0,0 +1,20 @@ ++# 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/config/linux/pkg_config.gni") ++import("//build/shim_headers.gni") ++ ++shim_headers("header") { ++ root_path = "." ++ headers = [ "simdutf.h" ] +} + - config("simdutf_config") { -+ if(use_system_simdutf) { -+ libs = ["simdutf"] -+ } else { - include_dirs = [ "." ] -+ } - } - - static_library("simdutf") { -+ if(!use_system_simdutf) { - include_dirs = [ "." ] - sources = [ - "simdutf.cpp", - ] -+ } - - public_configs = [ ":simdutf_config" ] - -+ if(!use_system_simdutf) { - cflags_cc = [ - "-Wno-ambiguous-reversed-operator", - "-Wno-c++98-compat-extra-semi", -@@ -17,4 +28,5 @@ static_library("simdutf") { - "-Wno-unused-const-variable", - "-Wno-unused-function", - ] -+ } - } ++pkg_config("system_simdutf") { ++ packages = [ "simdutf" ] ++} ++ ++source_set("simdutf") { ++ public_configs = [ ":system_simdutf" ] ++ public_deps = [ ":header" ] ++} diff --git a/system-sqlite.patch b/system-sqlite.patch new file mode 100644 index 0000000..e3af0cd --- /dev/null +++ b/system-sqlite.patch @@ -0,0 +1,50 @@ +Unbundle Node's sqlite copy. Note that this is NOT the sqlite used by Chromium, which is a fork. +(Yes, there are two instances of sqlite in Electron) + +--- src/third_party/electron_node/deps/sqlite/unofficial.gni 2025-04-16 14:39:35.699035282 +0200 ++++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/nodejs-electron-35.1.5-build/src/third_party/electron_node/deps/sqlite/unofficial.gni 2025-04-18 15:46:13.417442111 +0200 +@@ -1,3 +1,4 @@ ++import("//build/config/linux/pkg_config.gni") + # This file is used by GN for building, which is NOT the build system used for + # building official binaries. + # Please edit the gyp files if you are making changes to build system. +@@ -5,8 +6,8 @@ + # The actual configurations are put inside a template in unofficial.gni to + # prevent accidental edits from contributors. + template("sqlite_gn_build") { +- config("sqlite_config") { +- include_dirs = [ "." ] ++ pkg_config("sqlite_config") { ++ packages = ["sqlite3"] + defines = [ + "SQLITE_ENABLE_MATH_FUNCTIONS", + "SQLITE_ENABLE_SESSION", +@@ -14,28 +15,9 @@ template("sqlite_gn_build") { + ] + } + +- gypi_values = exec_script("../../tools/gypi_to_gn.py", +- [ rebase_path("sqlite.gyp") ], +- "scope", +- [ "sqlite.gyp" ]) + + source_set(target_name) { + forward_variables_from(invoker, "*") + public_configs = [ ":sqlite_config" ] +- sources = gypi_values.sqlite_sources +- cflags_c = [ +- "-Wno-implicit-fallthrough", +- "-Wno-unreachable-code-return", +- "-Wno-unreachable-code-break", +- "-Wno-unreachable-code", +- ] +- if (is_win) { +- cflags_c += [ +- "-Wno-sign-compare", +- "-Wno-unused-but-set-variable", +- "-Wno-unused-function", +- "-Wno-unused-variable", +- ] +- } + } + } diff --git a/to_vector-std-projected-gcc119888.patch b/to_vector-std-projected-gcc119888.patch new file mode 100644 index 0000000..a371ad1 --- /dev/null +++ b/to_vector-std-projected-gcc119888.patch @@ -0,0 +1,11 @@ +--- src/base/containers/to_vector.h.orig 2025-04-21 18:29:04.778306927 +0200 ++++ src/base/containers/to_vector.h 2025-04-22 06:32:55.415046071 +0200 +@@ -29,7 +29,7 @@ template > + auto ToVector(Range&& range, Proj proj = {}) { + using ProjectedType = +- std::projected, Proj>::value_type; ++ std::indirectly_readable_traits, Proj> >::value_type; + std::vector container; + container.reserve(std::ranges::size(range)); + std::ranges::transform(std::forward(range), diff --git a/unexportable_key_service_impl-Wlto-type-mismatch.patch b/unexportable_key_service_impl-Wlto-type-mismatch.patch new file mode 100644 index 0000000..27bf675 --- /dev/null +++ b/unexportable_key_service_impl-Wlto-type-mismatch.patch @@ -0,0 +1,32 @@ +--- src/components/unexportable_keys/unexportable_key_service_impl.cc.orig 2025-04-20 19:22:29.934671387 +0200 ++++ src/components/unexportable_keys/unexportable_key_service_impl.cc 2025-04-21 14:22:30.891412928 +0200 +@@ -19,8 +19,6 @@ + + namespace unexportable_keys { + +-namespace { +- + // Class holding either an `UnexportableKeyId` or a list of callbacks waiting + // for the key creation. + class MaybePendingUnexportableKeyId { +@@ -105,8 +103,6 @@ MaybePendingUnexportableKeyId::GetCallba + return absl::get>(key_id_or_pending_callbacks_); + } + +-} // namespace +- + UnexportableKeyServiceImpl::UnexportableKeyServiceImpl( + UnexportableKeyTaskManager& task_manager) + : task_manager_(task_manager) {} +--- src/components/unexportable_keys/unexportable_key_service_impl.h.orig 2025-04-20 19:22:29.934671387 +0200 ++++ src/components/unexportable_keys/unexportable_key_service_impl.h 2025-04-21 14:22:00.963413744 +0200 +@@ -23,9 +23,7 @@ + + namespace unexportable_keys { + +-namespace { + class MaybePendingUnexportableKeyId; +-} + + class UnexportableKeyTaskManager; + diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch new file mode 100644 index 0000000..f4ac452 --- /dev/null +++ b/use-system-libraries-in-node.patch @@ -0,0 +1,138 @@ +--- src/third_party/electron_node/node.gni.orig 2025-04-20 10:49:28.656330018 +0200 ++++ src/third_party/electron_node/node.gni 2025-04-20 19:08:01.482693254 +0200 +@@ -73,10 +73,12 @@ declare_args() { + node_use_amaro = true + + # Allows downstream packagers (eg. Linux distributions) to build against system shared libraries. ++ use_system_ada = false + use_system_cares = false + use_system_nghttp2 = false + use_system_llhttp = false + use_system_histogram = false ++ use_system_simdjson = false + } + + assert(!node_enable_inspector || node_use_openssl, +--- src/third_party/electron_node/unofficial.gni.orig 2025-04-20 10:49:28.656330018 +0200 ++++ src/third_party/electron_node/unofficial.gni 2025-04-20 19:16:09.442680896 +0200 +@@ -9,6 +9,35 @@ import("$node_v8_path/gni/v8.gni") + # The actual configurations are put inside a template in unofficial.gni to + # prevent accidental edits from contributors. + template("node_gn_build") { ++ if (is_linux) { ++ import("//build/config/linux/pkg_config.gni") ++ if (use_system_cares) { ++ pkg_config("system_cares") { ++ packages = [ "libcares" ] ++ } ++ } ++ if (use_system_histogram) { ++ pkg_config("system_histogram") { ++ packages = [ "hdr_histogram" ] ++ } ++ } ++ if (use_system_llhttp) { ++ pkg_config("system_llhttp") { ++ packages = [ "libllhttp" ] ++ } ++ } ++ if (use_system_nghttp2) { ++ pkg_config("system_nghttp2") { ++ packages = [ "libnghttp2" ] ++ } ++ } ++ if (use_system_simdjson) { ++ pkg_config("system_simdjson") { ++ packages = [ "simdjson" ] ++ } ++ } ++ } ++ + config("node_features") { + defines = [] + if (is_component_build) { +@@ -138,23 +167,19 @@ template("node_gn_build") { + + source_set("libnode") { + configs += [ ":node_internal_config" ] ++ libs = [] + public_configs = [ + ":node_external_config", + "deps/googletest:googletest_config", + ] + public_deps = [ +- "deps/ada", + "deps/uv", + "//electron:electron_js2c", +- "deps/simdjson", + "$node_v8_path", + ] + deps = [ + ":run_node_js2c", +- "deps/cares", +- "deps/histogram", + "deps/nbytes", +- "deps/nghttp2", + "deps/postject", + "deps/sqlite", + "deps/uvwasi", +@@ -183,17 +208,36 @@ template("node_gn_build") { + configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] + configs += [ "//build/config/gcc:symbol_visibility_default" ] + } ++ if (use_system_ada) { ++ libs += ["ada"] ++ } else { ++ public_deps += [ "deps/ada" ] ++ } ++ if (use_system_cares) { ++ configs += [ ":system_cares" ] ++ } else { ++ deps += [ "deps/cares" ] ++ } + if (use_system_llhttp) { +- libs += [ "llhttp" ] ++ configs += [ ":system_llhttp" ] + } else { + deps += [ "deps/llhttp" ] + } + if (use_system_histogram) { +- libs += [ "hdr_histogram" ] +- include_dirs += [ "/usr/include/hdr" ] ++ configs += [":system_histogram"] + } else { + deps += [ "deps/histogram" ] + } ++ if (use_system_nghttp2) { ++ configs += [":system_nghttp2"] ++ } else { ++ deps += [ "deps/nghttp2" ] ++ } ++ if (use_system_simdjson) { ++ public_configs += [":system_simdjson"] ++ } else { ++ public_deps += [ "deps/simdjson" ] ++ } + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +@@ -222,19 +266,6 @@ template("node_gn_build") { + sources += node_inspector.node_inspector_sources + + node_inspector.node_inspector_generated_sources + } +- if (is_linux) { +- import("//build/config/linux/pkg_config.gni") +- if (use_system_cares) { +- pkg_config("cares") { +- packages = [ "libcares" ] +- } +- } +- if (use_system_nghttp2) { +- pkg_config("nghttp2") { +- packages = [ "libnghttp2" ] +- } +- } +- } + } + + executable(target_name) { diff --git a/v8-macro-assembler-riscv-leaptiering.patch b/v8-macro-assembler-riscv-leaptiering.patch new file mode 100644 index 0000000..962fadb --- /dev/null +++ b/v8-macro-assembler-riscv-leaptiering.patch @@ -0,0 +1,818 @@ +From 4d24761fae4b1de87a1ba7a507e98be157a64bf4 Mon Sep 17 00:00:00 2001 +From: Alexey Pavlyutkin +Date: Thu, 13 Feb 2025 11:40:23 +0000 +Subject: [PATCH] [riscv][leaptiering] Enable leaptiering support + +Fix RISC-V build broken by unconditional enabling of leaptiering (see +6207491). + +Change-Id: I72db70b09b98410ae83d40b3251495b8bcbda207 +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6249680 +Reviewed-by: Yahan Lu (LuYahan) +Reviewed-by: Ji Qiu +Commit-Queue: Ji Qiu +Cr-Commit-Position: refs/heads/main@{#98693} +--- + src/builtins/riscv/builtins-riscv.cc | 27 +- + src/codegen/riscv/macro-assembler-riscv.cc | 321 +++++++++++------- + src/codegen/riscv/macro-assembler-riscv.h | 48 ++- + src/codegen/riscv/register-riscv.h | 3 +- + .../backend/riscv/code-generator-riscv.cc | 41 ++- + src/maglev/riscv/maglev-assembler-riscv.cc | 3 + + 6 files changed, 286 insertions(+), 157 deletions(-) + +diff --git a/src/builtins/riscv/builtins-riscv.cc b/src/builtins/riscv/builtins-riscv.cc +index 4d637bd281ee..54960a8cb0ef 100644 +--- a/v8/src/builtins/riscv/builtins-riscv.cc ++++ b/v8/src/builtins/riscv/builtins-riscv.cc +@@ -996,6 +996,7 @@ void Builtins::Generate_BaselineOutOfLinePrologueDeopt(MacroAssembler* masm) { + } + + void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { ++ ASM_CODE_COMMENT(masm); + UseScratchRegisterScope temps(masm); + temps.Include({kScratchReg, kScratchReg2, s1}); + auto descriptor = +@@ -1016,11 +1017,14 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { + __ AssertFeedbackVector(feedback_vector, type); + } + ++#ifndef V8_ENABLE_LEAPTIERING + // Check for an tiering state. + Label flags_need_processing; + Register flags = temps.Acquire(); + __ LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( + flags, feedback_vector, CodeKind::BASELINE, &flags_need_processing); ++#endif ++ + { + UseScratchRegisterScope temps(masm); + ResetFeedbackVectorOsrUrgency(masm, feedback_vector, temps.Acquire()); +@@ -1096,6 +1100,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { + // TODO(v8:11429): Document this frame setup better. + __ Ret(); + ++#ifndef V8_ENABLE_LEAPTIERING + __ bind(&flags_need_processing); + { + ASM_CODE_COMMENT_STRING(masm, "Optimized marker check"); +@@ -1104,6 +1109,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { + __ OptimizeCodeOrTailCallOptimizedCodeSlot(flags, feedback_vector); + __ Trap(); + } ++#endif + + __ bind(&call_stack_guard); + { +@@ -1157,15 +1163,16 @@ void Builtins::Generate_InterpreterEntryTrampoline( + __ LoadFeedbackVector(feedback_vector, closure, a4, &push_stack_frame); + + #ifndef V8_JITLESS ++#ifndef V8_ENABLE_LEAPTIERING + // If feedback vector is valid, check for optimized code and update invocation + // count. +- + // Check the tiering state. + Label flags_need_processing; + Register flags = a4; + __ LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( + flags, feedback_vector, CodeKind::INTERPRETED_FUNCTION, + &flags_need_processing); ++#endif // V8_ENABLE_LEAPTIERING + ResetFeedbackVectorOsrUrgency(masm, feedback_vector, a4); + + // Increment invocation count for the function. +@@ -1323,10 +1330,13 @@ void Builtins::Generate_InterpreterEntryTrampoline( + __ Branch(&after_stack_check_interrupt); + + #ifndef V8_JITLESS ++#ifndef V8_ENABLE_LEAPTIERING + __ bind(&flags_need_processing); + __ OptimizeCodeOrTailCallOptimizedCodeSlot(flags, feedback_vector); ++#endif //! V8_ENABLE_LEAPTIERING + __ bind(&is_baseline); + { ++#ifndef V8_ENABLE_LEAPTIERING + // Load the feedback vector from the closure. + __ LoadTaggedField( + feedback_vector, +@@ -1347,7 +1357,6 @@ void Builtins::Generate_InterpreterEntryTrampoline( + __ LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( + flags, feedback_vector, CodeKind::BASELINE, &flags_need_processing); + +-#ifndef V8_ENABLE_LEAPTIERING + // TODO(olivf, 42204201): This fastcase is difficult to support with the + // sandbox as it requires getting write access to the dispatch table. See + // `JSFunction::UpdateCode`. We might want to remove it for all +@@ -1357,9 +1366,9 @@ void Builtins::Generate_InterpreterEntryTrampoline( + static_assert(kJavaScriptCallCodeStartRegister == a2, "ABI mismatch"); + __ ReplaceClosureCodeWithOptimizedCode(a2, closure); + __ JumpCodeObject(a2, kJSEntrypointTag); +-#endif // V8_ENABLE_LEAPTIERING +- + __ bind(&install_baseline_code); ++#endif // !V8_ENABLE_LEAPTIERING ++ + __ GenerateTailCallToReturnedCode(Runtime::kInstallBaselineCode); + } + #endif // !V8_JITLESS +@@ -2630,9 +2639,13 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, + // -- cp : the function context. + // ----------------------------------- + ++#ifdef V8_ENABLE_LEAPTIERING ++ __ InvokeFunctionCode(a1, no_reg, a0, InvokeType::kJump); ++#else + __ Lhu(a2, + FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); + __ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump); ++#endif + } + + namespace { +@@ -5084,9 +5097,13 @@ void Builtins::Generate_RestartFrameTrampoline(MacroAssembler* masm) { + // Pop return address and frame. + __ LeaveFrame(StackFrame::INTERPRETED); + ++#ifdef V8_ENABLE_LEAPTIERING ++ __ InvokeFunction(a1, a0, InvokeType::kJump, ++ ArgumentAdaptionMode::kDontAdapt); ++#else + __ li(a2, Operand(kDontAdaptArgumentsSentinel)); +- + __ InvokeFunction(a1, a2, a0, InvokeType::kJump); ++#endif + } + + #undef __ +diff --git a/src/codegen/riscv/macro-assembler-riscv.cc b/src/codegen/riscv/macro-assembler-riscv.cc +index aca1e993183f..ae86dddd6777 100644 +--- a/v8/src/codegen/riscv/macro-assembler-riscv.cc ++++ b/v8/src/codegen/riscv/macro-assembler-riscv.cc +@@ -209,24 +209,7 @@ void MacroAssembler::GenerateTailCallToReturnedCode( + Jump(a2); + } + +-Condition MacroAssembler::LoadFeedbackVectorFlagsAndCheckIfNeedsProcessing( +- Register flags, Register feedback_vector, Register result, +- CodeKind current_code_kind) { +- ASM_CODE_COMMENT(this); +- DCHECK(!AreAliased(flags, feedback_vector)); +- DCHECK(CodeKindCanTierUp(current_code_kind)); +- +- Lhu(flags, FieldMemOperand(feedback_vector, FeedbackVector::kFlagsOffset)); +- uint32_t kFlagsMask = FeedbackVector::kFlagsTieringStateIsAnyRequested | +- FeedbackVector::kFlagsMaybeHasTurbofanCode | +- FeedbackVector::kFlagsLogNextExecution; +- if (current_code_kind != CodeKind::MAGLEV) { +- kFlagsMask |= FeedbackVector::kFlagsMaybeHasMaglevCode; +- } +- And(result, flags, Operand(kFlagsMask)); +- return ne; +-} +- ++#ifndef V8_ENABLE_LEAPTIERING + // Read off the flags in the feedback vector and check if there + // is optimized code or a tiering state that needs to be processed. + void MacroAssembler::LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( +@@ -248,22 +231,6 @@ void MacroAssembler::OptimizeCodeOrTailCallOptimizedCodeSlot( + Register flags, Register feedback_vector) { + ASM_CODE_COMMENT(this); + DCHECK(!AreAliased(flags, feedback_vector)); +-#ifdef V8_ENABLE_LEAPTIERING +- // In the leaptiering case, we don't load optimized code from the feedback +- // vector so only need to call CompileOptimized or FunctionLogNextExecution +- // here. See also LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing above. +- Label needs_logging; +- { +- UseScratchRegisterScope temps(this); +- Register scratch = temps.Acquire(); +- And(scratch, flags, +- Operand(FeedbackVector::kFlagsTieringStateIsAnyRequested)); +- Branch(&needs_logging, eq, scratch, Operand(zero_reg)); +- } +- GenerateTailCallToReturnedCode(Runtime::kCompileOptimized); +- bind(&needs_logging); +- GenerateTailCallToReturnedCode(Runtime::kFunctionLogNextExecution); +-#else + UseScratchRegisterScope temps(this); + temps.Include(t0, t1); + Label maybe_has_optimized_code, maybe_needs_logging; +@@ -296,8 +263,8 @@ void MacroAssembler::OptimizeCodeOrTailCallOptimizedCodeSlot( + FeedbackVector::kMaybeOptimizedCodeOffset)); + TailCallOptimizedCodeSlot(this, optimized_code_entry, temps.Acquire(), + temps.Acquire()); +-#endif // V8_ENABLE_LEAPTIERING + } ++#endif // V8_ENABLE_LEAPTIERING + + void MacroAssembler::LoadIsolateField(const Register& rd, IsolateFieldId id) { + li(rd, ExternalReference::Create(id)); +@@ -5630,7 +5597,7 @@ void MacroAssembler::StackOverflowCheck(Register num_args, Register scratch1, + + void MacroAssembler::InvokePrologue(Register expected_parameter_count, + Register actual_parameter_count, +- Label* done, InvokeType type) { ++ InvokeType type) { + Label regular_invoke; + + // a0: actual arguments count +@@ -5649,8 +5616,7 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count, + Label stack_overflow; + { + UseScratchRegisterScope temps(this); +- StackOverflowCheck(expected_parameter_count, temps.Acquire(), +- temps.Acquire(), &stack_overflow); ++ StackOverflowCheck(expected_parameter_count, t0, t1, &stack_overflow); + } + // Underapplication. Move the arguments already in the stack, including the + // receiver and the return address. +@@ -5694,90 +5660,150 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count, + bind(®ular_invoke); + } + +-void MacroAssembler::CheckDebugHook(Register fun, Register new_target, +- Register expected_parameter_count, +- Register actual_parameter_count) { +- Label skip_hook; +- { +- UseScratchRegisterScope temps(this); +- Register scratch = temps.Acquire(); +- li(scratch, +- ExternalReference::debug_hook_on_function_call_address(isolate())); +- Lb(scratch, MemOperand(scratch)); +- Branch(&skip_hook, eq, scratch, Operand(zero_reg)); ++void MacroAssembler::CallDebugOnFunctionCall( ++ Register fun, Register new_target, ++ Register expected_parameter_count_or_dispatch_handle, ++ Register actual_parameter_count) { ++ ASM_CODE_COMMENT(this); ++ DCHECK(!AreAliased(t0, fun, new_target, ++ expected_parameter_count_or_dispatch_handle, ++ actual_parameter_count)); ++ ++ // Load receiver to pass it later to DebugOnFunctionCall hook. ++ LoadReceiver(t0); ++ FrameScope frame( ++ this, has_frame() ? StackFrame::NO_FRAME_TYPE : StackFrame::INTERNAL); ++ ++ SmiTag(expected_parameter_count_or_dispatch_handle); ++ SmiTag(actual_parameter_count); ++ Push(expected_parameter_count_or_dispatch_handle, actual_parameter_count); ++ ++ if (new_target.is_valid()) { ++ Push(new_target); ++ } ++ Push(fun, fun, t0); ++ CallRuntime(Runtime::kDebugOnFunctionCall); ++ Pop(fun); ++ if (new_target.is_valid()) { ++ Pop(new_target); + } +- { +- // Load receiver to pass it later to DebugOnFunctionCall hook. +- UseScratchRegisterScope temps(this); +- Register receiver = temps.Acquire(); +- LoadReceiver(receiver); + +- FrameScope frame( +- this, has_frame() ? StackFrame::NO_FRAME_TYPE : StackFrame::INTERNAL); +- SmiTag(expected_parameter_count); +- Push(expected_parameter_count); ++ Pop(expected_parameter_count_or_dispatch_handle, actual_parameter_count); ++ SmiUntag(actual_parameter_count); ++ SmiUntag(expected_parameter_count_or_dispatch_handle); ++} + +- SmiTag(actual_parameter_count); +- Push(actual_parameter_count); ++#ifdef V8_ENABLE_LEAPTIERING ++void MacroAssembler::InvokeFunction( ++ Register function, Register actual_parameter_count, InvokeType type, ++ ArgumentAdaptionMode argument_adaption_mode) { ++ ASM_CODE_COMMENT(this); ++ // You can't call a function without a valid frame. ++ DCHECK(type == InvokeType::kJump || has_frame()); + +- if (new_target.is_valid()) { +- Push(new_target); +- } +- Push(fun); +- Push(fun); +- Push(receiver); +- CallRuntime(Runtime::kDebugOnFunctionCall); +- Pop(fun); +- if (new_target.is_valid()) { +- Pop(new_target); +- } ++ // Contract with called JS functions requires that function is passed in a1. ++ // (See FullCodeGenerator::Generate().) ++ DCHECK_EQ(function, a1); + +- Pop(actual_parameter_count); +- SmiUntag(actual_parameter_count); ++ // Set up the context. ++ LoadTaggedField(cp, FieldMemOperand(function, JSFunction::kContextOffset)); + +- Pop(expected_parameter_count); +- SmiUntag(expected_parameter_count); +- } +- bind(&skip_hook); ++ InvokeFunctionCode(function, no_reg, actual_parameter_count, type, ++ argument_adaption_mode); + } + +-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, +- Register expected_parameter_count, +- Register actual_parameter_count, +- InvokeType type) { ++void MacroAssembler::InvokeFunctionWithNewTarget( ++ Register function, Register new_target, Register actual_parameter_count, ++ InvokeType type) { ++ ASM_CODE_COMMENT(this); ++ // You can't call a function without a valid frame. ++ DCHECK(type == InvokeType::kJump || has_frame()); ++ ++ // Contract with called JS functions requires that function is passed in a1. ++ // (See FullCodeGenerator::Generate().) ++ DCHECK_EQ(function, a1); ++ ++ LoadTaggedField(cp, FieldMemOperand(function, JSFunction::kContextOffset)); ++ ++ InvokeFunctionCode(function, new_target, actual_parameter_count, type); ++} ++ ++void MacroAssembler::InvokeFunctionCode( ++ Register function, Register new_target, Register actual_parameter_count, ++ InvokeType type, ArgumentAdaptionMode argument_adaption_mode) { ++ ASM_CODE_COMMENT(this); + // You can't call a function without a valid frame. + DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); + DCHECK_EQ(function, a1); + DCHECK_IMPLIES(new_target.is_valid(), new_target == a3); + ++ Register dispatch_handle = kJavaScriptCallDispatchHandleRegister; ++ Lw(dispatch_handle, ++ FieldMemOperand(function, JSFunction::kDispatchHandleOffset)); ++ + // On function call, call into the debugger if necessary. +- CheckDebugHook(function, new_target, expected_parameter_count, +- actual_parameter_count); ++ Label debug_hook, continue_after_hook; ++ { ++ li(t0, ExternalReference::debug_hook_on_function_call_address(isolate())); ++ Lb(t0, MemOperand(t0, 0)); ++ BranchShort(&debug_hook, ne, t0, Operand(zero_reg)); ++ } ++ bind(&continue_after_hook); + + // Clear the new.target register if not given. + if (!new_target.is_valid()) { + LoadRoot(a3, RootIndex::kUndefinedValue); + } + +- Label done; +- InvokePrologue(expected_parameter_count, actual_parameter_count, &done, type); ++ Register scratch = s1; ++ if (argument_adaption_mode == ArgumentAdaptionMode::kAdapt) { ++ Register expected_parameter_count = a2; ++ LoadParameterCountFromJSDispatchTable(expected_parameter_count, ++ dispatch_handle, scratch); ++ InvokePrologue(expected_parameter_count, actual_parameter_count, type); ++ } ++ + // We call indirectly through the code field in the function to + // allow recompilation to take effect without changing any of the + // call sites. +- constexpr int unused_argument_count = 0; ++ LoadEntrypointFromJSDispatchTable(kJavaScriptCallCodeStartRegister, ++ dispatch_handle, scratch); + switch (type) { + case InvokeType::kCall: +- CallJSFunction(function, unused_argument_count); ++ Call(kJavaScriptCallCodeStartRegister); + break; + case InvokeType::kJump: +- JumpJSFunction(function); ++ Jump(kJavaScriptCallCodeStartRegister); + break; + } ++ Label done; ++ Branch(&done); ++ ++ // Deferred debug hook. ++ bind(&debug_hook); ++ CallDebugOnFunctionCall(function, new_target, dispatch_handle, ++ actual_parameter_count); ++ Branch(&continue_after_hook); + +- // Continue here if InvokePrologue does handle the invocation due to +- // mismatched parameter counts. + bind(&done); + } ++#else // !V8_ENABLE_LEAPTIERING ++void MacroAssembler::InvokeFunction(Register function, ++ Register expected_parameter_count, ++ Register actual_parameter_count, ++ InvokeType type) { ++ // You can't call a function without a valid frame. ++ DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); ++ ++ // Contract with called JS functions requires that function is passed in a1. ++ DCHECK_EQ(function, a1); ++ ++ // Get the function and setup the context. ++ LoadTaggedField(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); ++ ++ InvokeFunctionCode(a1, no_reg, expected_parameter_count, ++ actual_parameter_count, type); ++} + + void MacroAssembler::InvokeFunctionWithNewTarget( + Register function, Register new_target, Register actual_parameter_count, +@@ -5804,23 +5830,44 @@ void MacroAssembler::InvokeFunctionWithNewTarget( + actual_parameter_count, type); + } + +-void MacroAssembler::InvokeFunction(Register function, +- Register expected_parameter_count, +- Register actual_parameter_count, +- InvokeType type) { ++void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, ++ Register expected_parameter_count, ++ Register actual_parameter_count, ++ InvokeType type) { + // You can't call a function without a valid frame. + DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); +- +- // Contract with called JS functions requires that function is passed in a1. + DCHECK_EQ(function, a1); ++ DCHECK_IMPLIES(new_target.is_valid(), new_target == a3); + +- // Get the function and setup the context. +- LoadTaggedField(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); ++ // On function call, call into the debugger if necessary. ++ CheckDebugHook(function, new_target, expected_parameter_count, ++ actual_parameter_count); + +- InvokeFunctionCode(a1, no_reg, expected_parameter_count, +- actual_parameter_count, type); +-} ++ // Clear the new.target register if not given. ++ if (!new_target.is_valid()) { ++ LoadRoot(a3, RootIndex::kUndefinedValue); ++ } ++ ++ Label done; ++ InvokePrologue(expected_parameter_count, actual_parameter_count, &done, type); ++ // We call indirectly through the code field in the function to ++ // allow recompilation to take effect without changing any of the ++ // call sites. ++ constexpr int unused_argument_count = 0; ++ switch (type) { ++ case InvokeType::kCall: ++ CallJSFunction(function, unused_argument_count); ++ break; ++ case InvokeType::kJump: ++ JumpJSFunction(function); ++ break; ++ } + ++ // Continue here if InvokePrologue does handle the invocation due to ++ // mismatched parameter counts. ++ bind(&done); ++} ++#endif // V8_ENABLE_LEAPTIERING + // --------------------------------------------------------------------------- + // Support functions. + +@@ -7240,14 +7287,30 @@ void MacroAssembler::ComputeCodeStartAddress(Register dst) { + // 2. test kMarkedForDeoptimizationBit in those flags; and + // 3. if it is not zero then it jumps to the builtin. + void MacroAssembler::BailoutIfDeoptimized() { +- int offset = InstructionStream::kCodeOffset - InstructionStream::kHeaderSize; +- LoadProtectedPointerField( +- kScratchReg, MemOperand(kJavaScriptCallCodeStartRegister, offset)); +- Lw(kScratchReg, FieldMemOperand(kScratchReg, Code::kFlagsOffset)); +- And(kScratchReg, kScratchReg, +- Operand(1 << Code::kMarkedForDeoptimizationBit)); +- TailCallBuiltin(Builtin::kCompileLazyDeoptimizedCode, ne, kScratchReg, ++ ASM_CODE_COMMENT(this); ++ UseScratchRegisterScope temps(this); ++ Register scratch = temps.Acquire(); ++ if (v8_flags.debug_code || !V8_ENABLE_LEAPTIERING_BOOL) { ++ int offset = ++ InstructionStream::kCodeOffset - InstructionStream::kHeaderSize; ++ LoadProtectedPointerField( ++ scratch, MemOperand(kJavaScriptCallCodeStartRegister, offset)); ++ Lw(scratch, FieldMemOperand(scratch, Code::kFlagsOffset)); ++ } ++ ++#ifdef V8_ENABLE_LEAPTIERING ++ if (v8_flags.debug_code) { ++ Label not_deoptimized; ++ And(scratch, scratch, Operand(1 << Code::kMarkedForDeoptimizationBit)); ++ Branch(¬_deoptimized, eq, scratch, Operand(zero_reg)); ++ Abort(AbortReason::kInvalidDeoptimizedCode); ++ bind(¬_deoptimized); ++ } ++#else ++ And(scratch, scratch, Operand(1 << Code::kMarkedForDeoptimizationBit)); ++ TailCallBuiltin(Builtin::kCompileLazyDeoptimizedCode, ne, scratch, + Operand(zero_reg)); ++#endif + } + + void MacroAssembler::CallForDeoptimization(Builtin target, int, Label* exit, +@@ -7303,22 +7366,20 @@ void MacroAssembler::JumpCodeObject(Register code_object, CodeEntrypointTag tag, + } + + void MacroAssembler::CallJSFunction(Register function_object, +- uint16_t argument_count) { +- DCHECK_WITH_MSG(!V8_ENABLE_LEAPTIERING_BOOL, +- "argument_count is only used with Leaptiering"); ++ [[maybe_unused]] uint16_t argument_count) { + ASM_CODE_COMMENT(this); + Register code = kJavaScriptCallCodeStartRegister; + #ifdef V8_ENABLE_LEAPTIERING +- UseScratchRegisterScope temps(this); +- Register dispatch_handle = t0; ++ Register dispatch_handle = kJavaScriptCallDispatchHandleRegister; + Register parameter_count = t1; ++ UseScratchRegisterScope temps(this); + Register scratch = temps.Acquire(); + Lw(dispatch_handle, + FieldMemOperand(function_object, JSFunction::kDispatchHandleOffset)); + LoadEntrypointAndParameterCountFromJSDispatchTable(code, parameter_count, + dispatch_handle, scratch); + Label match; +- Branch(&match, le, parameter_count, Immediate(argument_count)); ++ Branch(&match, le, parameter_count, Operand(argument_count)); + // If the parameter count doesn't match, we force a safe crash by setting the + // code entrypoint to zero, causing a nullptr dereference during the call. + mv(code, zero_reg); +@@ -7366,13 +7427,14 @@ void MacroAssembler::JumpJSFunction(Register function_object, + ASM_CODE_COMMENT(this); + Register code = kJavaScriptCallCodeStartRegister; + #ifdef V8_ENABLE_LEAPTIERING +- LoadCodeEntrypointFromJSDispatchTable( +- code, +- FieldMemOperand(function_object, JSFunction::kDispatchHandleOffset)); ++ Register dispatch_handle = kJavaScriptCallDispatchHandleRegister; ++ UseScratchRegisterScope temps(this); ++ Register scratch = temps.Acquire(); ++ Lw(dispatch_handle, ++ FieldMemOperand(function_object, JSFunction::kDispatchHandleOffset)); ++ LoadEntrypointFromJSDispatchTable(code, dispatch_handle, scratch); + DCHECK_EQ(jump_mode, JumpMode::kJump); +- DCHECK_NE(code, t6); +- mv(t6, code); +- Jump(t6); ++ Jump(code); + #elif V8_ENABLE_SANDBOX + // When the sandbox is enabled, we can directly fetch the entrypoint pointer + // from the code pointer table instead of going through the Code object. In +@@ -7465,11 +7527,13 @@ void MacroAssembler::LoadEntrypointFromJSDispatchTable(Register destination, + Register scratch) { + DCHECK(!AreAliased(destination, scratch)); + ASM_CODE_COMMENT(this); ++ Register index = destination; + li(scratch, ExternalReference::js_dispatch_table_address()); + srli(index, dispatch_handle, kJSDispatchHandleShift); + slli(index, index, kJSDispatchTableEntrySizeLog2); + AddWord(scratch, scratch, index); +- Ld(destination, MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); ++ LoadWord(destination, ++ MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); + } + + void MacroAssembler::LoadEntrypointFromJSDispatchTable( +@@ -7486,7 +7550,7 @@ void MacroAssembler::LoadEntrypointFromJSDispatchTable( + static_assert(!JSDispatchTable::kSupportsCompaction); + int offset = JSDispatchTable::OffsetOfEntry(dispatch_handle) + + JSDispatchEntry::kEntrypointOffset; +- Ld(destination, MemOperand(scratch, offset)); ++ LoadWord(destination, MemOperand(scratch, offset)); + } + + void MacroAssembler::LoadParameterCountFromJSDispatchTable( +@@ -7494,12 +7558,14 @@ void MacroAssembler::LoadParameterCountFromJSDispatchTable( + DCHECK(!AreAliased(destination, scratch)); + ASM_CODE_COMMENT(this); + Register index = destination; +- li(scratch, ExternalReference::js_dispatch_table_address()); + srli(index, dispatch_handle, kJSDispatchHandleShift); + slli(index, index, kJSDispatchTableEntrySizeLog2); ++ li(scratch, ExternalReference::js_dispatch_table_address()); + AddWord(scratch, scratch, index); ++#ifdef V8_TARGET_ARCH_64_BIT + static_assert(JSDispatchEntry::kParameterCountMask == 0xffff); +- Lh(destination, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); ++#endif ++ Lhu(destination, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); + } + + void MacroAssembler::LoadEntrypointAndParameterCountFromJSDispatchTable( +@@ -7512,10 +7578,11 @@ void MacroAssembler::LoadEntrypointAndParameterCountFromJSDispatchTable( + srli(index, dispatch_handle, kJSDispatchHandleShift); + slli(index, index, kJSDispatchTableEntrySizeLog2); + AddWord(scratch, scratch, index); +- +- Ld(entrypoint, MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); ++ LoadWord(entrypoint, MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); ++#ifdef V8_TARGET_ARCH_64_BIT + static_assert(JSDispatchEntry::kParameterCountMask == 0xffff); +- Lh(parameter_count, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); ++#endif ++ Lhu(parameter_count, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); + } + #endif + +diff --git a/src/codegen/riscv/macro-assembler-riscv.h b/src/codegen/riscv/macro-assembler-riscv.h +index 12988bdf00c6..ca91407d21f0 100644 +--- a/v8/src/codegen/riscv/macro-assembler-riscv.h ++++ b/v8/src/codegen/riscv/macro-assembler-riscv.h +@@ -1600,23 +1600,47 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { + // ------------------------------------------------------------------------- + // JavaScript invokes. + +- // Invoke the JavaScript function code by either calling or jumping. +- void InvokeFunctionCode(Register function, Register new_target, +- Register expected_parameter_count, +- Register actual_parameter_count, InvokeType type); ++ // On function call, call into the debugger. ++ void CallDebugOnFunctionCall( ++ Register fun, Register new_target, ++ Register expected_parameter_count_or_dispatch_handle, ++ Register actual_parameter_count); + +- // On function call, call into the debugger if necessary. +- void CheckDebugHook(Register fun, Register new_target, +- Register expected_parameter_count, +- Register actual_parameter_count); ++ // The way we invoke JSFunctions differs depending on whether leaptiering is ++ // enabled. As such, these functions exist in two variants. In the future, ++ // leaptiering will be used on all platforms. At that point, the ++ // non-leaptiering variants will disappear. + ++#ifdef V8_ENABLE_LEAPTIERING + // Invoke the JavaScript function in the given register. Changes the + // current context to the context in the function before invoking. ++ void InvokeFunction(Register function, Register actual_parameter_count, ++ InvokeType type, ++ ArgumentAdaptionMode argument_adaption_mode = ++ ArgumentAdaptionMode::kAdapt); ++ // Invoke the JavaScript function in the given register. ++ // Changes the current context to the context in the function before invoking. + void InvokeFunctionWithNewTarget(Register function, Register new_target, + Register actual_parameter_count, + InvokeType type); ++ // Invoke the JavaScript function code by either calling or jumping. ++ void InvokeFunctionCode(Register function, Register new_target, ++ Register actual_parameter_count, InvokeType type, ++ ArgumentAdaptionMode argument_adaption_mode = ++ ArgumentAdaptionMode::kAdapt); ++#else + void InvokeFunction(Register function, Register expected_parameter_count, + Register actual_parameter_count, InvokeType type); ++ // Invoke the JavaScript function in the given register. Changes the ++ // current context to the context in the function before invoking. ++ void InvokeFunctionWithNewTarget(Register function, Register new_target, ++ Register actual_parameter_count, ++ InvokeType type); ++ // Invoke the JavaScript function code by either calling or jumping. ++ void InvokeFunctionCode(Register function, Register new_target, ++ Register expected_parameter_count, ++ Register actual_parameter_count, InvokeType type); ++#endif + + // ---- InstructionStream generation helpers ---- + +@@ -1657,14 +1681,13 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { + Register closure); + void GenerateTailCallToReturnedCode(Runtime::FunctionId function_id); + +- Condition LoadFeedbackVectorFlagsAndCheckIfNeedsProcessing( +- Register flags, Register feedback_vector, Register result, +- CodeKind current_code_kind); ++#ifndef V8_ENABLE_LEAPTIERING + void LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( + Register flags, Register feedback_vector, CodeKind current_code_kind, + Label* flags_need_processing); + void OptimizeCodeOrTailCallOptimizedCodeSlot(Register flags, + Register feedback_vector); ++#endif + + // ------------------------------------------------------------------------- + // Support functions. +@@ -1883,8 +1906,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { + + // Helper functions for generating invokes. + void InvokePrologue(Register expected_parameter_count, +- Register actual_parameter_count, Label* done, +- InvokeType type); ++ Register actual_parameter_count, InvokeType type); + + // Compute memory operands for safepoint stack slots. + static int SafepointRegisterStackIndex(int reg_code); +diff --git a/src/codegen/riscv/register-riscv.h b/src/codegen/riscv/register-riscv.h +index ddf2f879d495..67321defed53 100644 +--- a/v8/src/codegen/riscv/register-riscv.h ++++ b/v8/src/codegen/riscv/register-riscv.h +@@ -301,8 +301,7 @@ constexpr Register kJavaScriptCallCodeStartRegister = a2; + constexpr Register kJavaScriptCallTargetRegister = kJSFunctionRegister; + constexpr Register kJavaScriptCallNewTargetRegister = a3; + constexpr Register kJavaScriptCallExtraArg1Register = a2; +-// Leaptiering is not currently available on riscv64. +-constexpr Register kJavaScriptCallDispatchHandleRegister = no_reg; ++constexpr Register kJavaScriptCallDispatchHandleRegister = a4; + + constexpr Register kRuntimeCallFunctionRegister = a1; + constexpr Register kRuntimeCallArgCountRegister = a0; +diff --git a/src/compiler/backend/riscv/code-generator-riscv.cc b/src/compiler/backend/riscv/code-generator-riscv.cc +index 744123ebb283..678d661e58fc 100644 +--- a/v8/src/compiler/backend/riscv/code-generator-riscv.cc ++++ b/v8/src/compiler/backend/riscv/code-generator-riscv.cc +@@ -706,6 +706,36 @@ void CodeGenerator::AssembleCodeStartRegisterCheck() { + kJavaScriptCallCodeStartRegister, Operand(kScratchReg)); + } + ++#ifdef V8_ENABLE_LEAPTIERING ++// Check that {kJavaScriptCallDispatchHandleRegister} is correct. ++void CodeGenerator::AssembleDispatchHandleRegisterCheck() { ++ DCHECK(linkage()->GetIncomingDescriptor()->IsJSFunctionCall()); ++ ++ // We currently don't check this for JS builtins as those are sometimes ++ // called directly (e.g. from other builtins) and not through the dispatch ++ // table. This is fine as builtin functions don't use the dispatch handle, ++ // but we could enable this check in the future if we make sure to pass the ++ // kInvalidDispatchHandle whenever we do a direct call to a JS builtin. ++ if (Builtins::IsBuiltinId(info()->builtin())) { ++ return; ++ } ++ ++ // For now, we only ensure that the register references a valid dispatch ++ // entry with the correct parameter count. In the future, we may also be able ++ // to check that the entry points back to this code. ++ UseScratchRegisterScope temps(masm()); ++ Register actual_parameter_count = temps.Acquire(); ++ { ++ UseScratchRegisterScope temps(masm()); ++ Register scratch = temps.Acquire(); ++ __ LoadParameterCountFromJSDispatchTable( ++ actual_parameter_count, kJavaScriptCallDispatchHandleRegister, scratch); ++ } ++ __ Assert(eq, AbortReason::kWrongFunctionDispatchHandle, ++ actual_parameter_count, Operand(parameter_count_)); ++} ++#endif // V8_ENABLE_LEAPTIERING ++ + // Check if the code object is marked for deoptimization. If it is, then it + // jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need + // to: +@@ -713,16 +743,7 @@ void CodeGenerator::AssembleCodeStartRegisterCheck() { + // the flags in the referenced {Code} object; + // 2. test kMarkedForDeoptimizationBit in those flags; and + // 3. if it is not zero then it jumps to the builtin. +-void CodeGenerator::BailoutIfDeoptimized() { +- int offset = InstructionStream::kCodeOffset - InstructionStream::kHeaderSize; +- __ LoadProtectedPointerField( +- kScratchReg, MemOperand(kJavaScriptCallCodeStartRegister, offset)); +- __ Lw(kScratchReg, FieldMemOperand(kScratchReg, Code::kFlagsOffset)); +- __ And(kScratchReg, kScratchReg, +- Operand(1 << Code::kMarkedForDeoptimizationBit)); +- __ TailCallBuiltin(Builtin::kCompileLazyDeoptimizedCode, ne, kScratchReg, +- Operand(zero_reg)); +-} ++void CodeGenerator::BailoutIfDeoptimized() { __ BailoutIfDeoptimized(); } + + // Assembles an instruction after register allocation, producing machine code. + CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( +diff --git a/src/maglev/riscv/maglev-assembler-riscv.cc b/src/maglev/riscv/maglev-assembler-riscv.cc +index 9611e33d6b01..8fb87746e697 100644 +--- a/v8/src/maglev/riscv/maglev-assembler-riscv.cc ++++ b/v8/src/maglev/riscv/maglev-assembler-riscv.cc +@@ -127,6 +127,7 @@ void MaglevAssembler::OSRPrologue(Graph* graph) { + } + + void MaglevAssembler::Prologue(Graph* graph) { ++ ASM_CODE_COMMENT(this); + MaglevAssembler::TemporaryRegisterScope temps(this); + // We add two extra registers to the scope. Ideally we could add all the + // allocatable general registers, except Context, JSFunction, NewTarget and +@@ -147,6 +148,7 @@ void MaglevAssembler::Prologue(Graph* graph) { + } + + // Tiering support. ++#ifndef V8_ENABLE_LEAPTIERING + if (v8_flags.turbofan) { + using D = MaglevOptimizeCodeOrTailCallOptimizedCodeSlotDescriptor; + Register flags = D::GetRegisterParameter(D::kFlags); +@@ -169,6 +171,7 @@ void MaglevAssembler::Prologue(Graph* graph) { + TailCallBuiltin(Builtin::kMaglevOptimizeCodeOrTailCallOptimizedCodeSlot, + needs_processing, flag_reg, Operand(zero_reg)); + } ++#endif + + EnterFrame(StackFrame::MAGLEV); + // Save arguments in frame. diff --git a/webrtc-make_ref_counted-absl2024-nullability.patch b/webrtc-make_ref_counted-absl2024-nullability.patch new file mode 100644 index 0000000..dc6540a --- /dev/null +++ b/webrtc-make_ref_counted-absl2024-nullability.patch @@ -0,0 +1,30 @@ +From 36a764f13dc04d0c06b89d9e5a205224eb2784c8 Mon Sep 17 00:00:00 2001 +From: Danil Chapovalov +Date: Thu, 24 Oct 2024 11:12:57 +0200 +Subject: [PATCH] Remove nullability compatible tag in scoped_refptr as + obsolete + +As of https://github.com/abseil/abseil-cpp/commit/485f2be7c1d2f1a2ad2d89f6aef308dd7bfede8d, this no longer has any effect; instead, the ABSL_NULLABILITY_COMPATIBLE attribute which is already present on the class determines whether a class is compatible with nullability annotations. + +Bug: None +Change-Id: I5aeca86c86c2b6eadb2644695ee3621e92f1f568 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366601 +Reviewed-by: Harald Alvestrand +Commit-Queue: Danil Chapovalov +Cr-Commit-Position: refs/heads/main@{#43532} +--- + api/scoped_refptr.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/api/scoped_refptr.h b/api/scoped_refptr.h +index c6fb5605ca..e3274741cc 100644 +--- a/third_party/webrtc/api/scoped_refptr.h ++++ b/third_party/webrtc/api/scoped_refptr.h +@@ -73,7 +73,6 @@ namespace webrtc { + template + class ABSL_NULLABILITY_COMPATIBLE scoped_refptr { + public: +- using absl_nullability_compatible = void; + using element_type = T; + + scoped_refptr() : ptr_(nullptr) {} diff --git a/xml_document_parser-Wmissing-template-keyword.patch b/xml_document_parser-Wmissing-template-keyword.patch new file mode 100644 index 0000000..de8ff39 --- /dev/null +++ b/xml_document_parser-Wmissing-template-keyword.patch @@ -0,0 +1,13 @@ +--- src/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc.orig 2025-04-16 14:36:32.758721824 +0200 ++++ src/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc 2025-04-17 12:06:42.394992144 +0200 +@@ -1507,8 +1507,8 @@ static base::span Cop + base::span expanded_entity_chars) { + auto entity_buffer = + base::as_writable_chars(base::span(g_shared_xhtml_entity_result)); +- entity_buffer.first().copy_from(expanded_entity_chars); +- return entity_buffer.first(); ++ entity_buffer.template first().copy_from(expanded_entity_chars); ++ return entity_buffer.template first(); + } + + static base::span ConvertUTF16EntityToUTF8( -- 2.51.1 From aee6a35a0ee583567c44d0d6ebab416ff9923a7989b4a79b8c4986c77930f82a Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 26 Apr 2025 10:25:13 +0000 Subject: [PATCH 51/80] Accepting request 1272843 from home:dziobian:gulgul-ultron:19 - Update to 35.2.1 * Chromium 134.0.6998.205 * Node 22.14.0 * V8 13.4 * Removed AVIF image format * Added excludeUrls to webRequest filter and deprecated the use of empty arrays in urls property. * Added fromVersionID on ServiceWorkers to get an instance of ServiceWorkerMain. * Deprecated getPreloads and setPreloads on Session. * Moved 'console-message' arguments into event object. * Added ServiceWorkerMain class to interact with service workers in the main process. * Added contextBridge.executeInMainWorld to safely execute code across world boundaries. * Added frame to 'console-message' event. * Added optional animation parameter to BrowserWindow.setVibrancy. * Added permission support for document.executeCommand("paste"). * Added support for service worker preload scripts. * Support Portal's globalShortcuts. Electron must be run with --enable-features=GlobalShortcutsPortal in order to have the feature working. * see https://github.com/electron/electron/releases/tag/v35.0.0 and https://www.electronjs.org/blog/electron-35-0 for more - Remove Fedora 40 support * drop bundled-minizip.patch * drop quiche-absl-HexStringToBytes.patch - Leap 15.6: use backported wayland-protocols * drop wayland-protocol-toplevel-icon.patch * drop wayland-protocol-toplevel-icon-2.patch * drop wayland-protocol-toplevel-drag.patch - Build with LTO also on 15.6 (so now we enable it everywhere) - Fedora: use system simdjson * merge system-ada-url.patch into use-system-libraries-in-node.patch - Drop no longer applicable patches * account_id-missing-optional.patch * blink-platform-INSIDE_BLINK-Wodr.patch * boringssl-internal-addc-cxx.patch * build-without-extensions.patch * css_attr_value_tainting-missing-once_flag.patch * electron-13-fix-base-check-nomerge.patch * exception_context-missing-variant.patch * fix-build-without-safebrowsing.patch * fix-build-without-service-discovery.patch * ip_protection_data_types-missing-optional.patch * node-compiler.patch * skia_image_decoder_base-missing-stack.patch * vtt_scanner-missing-variant.patch * wayland_connection-Wchanges-meaning.patch - Add backported or upstreamable patches * ax_platform_node_id-fpermissive.patch * browser_process_impl-fix-safe_browsing_mode-0.patch * content_browser_client-incomplete-WebUIController.patch * css_shape_value-constructor.patch * exception_state-constexpr-initializer.patch * fix-build-without-pdf.patch * fix-build-without-video-effects.patch * media_session_uma_helper-missing-optional.patch * object_paint_properties-explicit-specialization-in-non-namespace-scope.patch * perfetto-ThreadTrack-Current-null-dereference.patch * picture_in_picture_window_manager_uma_helper-missing-optional.patch * plugin_utils-build-without-electron_extensions.patch * raw_ptr-fpermissive.patch * resource_response-Wchanges-meaning.patch * resource-Wchanges-meaning.patch * string-hasher-flax-vector-conversions.patch * string_truncator-convert.patch * style_scope-unqualified-To.patch * to_vector-std-projected-gcc119888.patch * unexportable_key_service_impl-Wlto-type-mismatch.patch * xml_document_parser-Wmissing-template-keyword.patch - merge remove-libphonenumber.patch & delete-old-language-detection-which-uses-tflite.patch into remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch - Revert upstream change which breaks build with old abseil * webrtc-make_ref_counted-absl2024-nullability.patch - Conditionally (15.6) remove feature change which needs new spirv * angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch - Use system sqlite in node (except 15.6) * system-sqlite.patch - Remove more rust code * chromium-132-no-rust.patch - Actually disable AVIF support without disabling AV1 video * disable-avif-really.patch - Various other build fixes * absl_strings-missing-headers.patch * blink-shape_result-highway.patch * build-without-mesage-center.patch * fix-system-highway.patch * gn-logspam-breaks-install.patch * permission-gcc14.2.patch OBS-URL: https://build.opensuse.org/request/show/1272843 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=203 --- account_id-missing-optional.patch | 33 - blink-platform-INSIDE_BLINK-Wodr.patch | 45 - boringssl-internal-addc-cxx.patch | 60 -- build-without-extensions.patch | 29 - bundled-minizip.patch | 43 - ...ttr_value_tainting-missing-once_flag.patch | 32 - ...language-detection-which-uses-tflite.patch | 57 -- electron-13-fix-base-check-nomerge.patch | 14 - exception_context-missing-variant.patch | 32 - fix-build-without-safebrowsing.patch | 31 - fix-build-without-service-discovery.patch | 10 - ...otection_data_types-missing-optional.patch | 32 - ...pecialization-in-non-namespace-scope.patch | 26 - node-compiler.patch | 93 -- nodejs-electron.changes | 88 ++ nodejs-electron.spec | 48 - quiche-absl-HexStringToBytes.patch | 116 --- skia_image_decoder_base-missing-stack.patch | 28 - system-ada-url.patch | 19 - v8-macro-assembler-riscv-leaptiering.patch | 818 ------------------ vtt_scanner-missing-variant.patch | 39 - wayland-protocol-toplevel-drag.patch | 434 ---------- wayland-protocol-toplevel-icon-2.patch | 545 ------------ wayland-protocol-toplevel-icon.patch | 335 ------- wayland_connection-Wchanges-meaning.patch | 61 -- 25 files changed, 88 insertions(+), 2980 deletions(-) delete mode 100644 account_id-missing-optional.patch delete mode 100644 blink-platform-INSIDE_BLINK-Wodr.patch delete mode 100644 boringssl-internal-addc-cxx.patch delete mode 100644 build-without-extensions.patch delete mode 100644 bundled-minizip.patch delete mode 100644 css_attr_value_tainting-missing-once_flag.patch delete mode 100644 delete-old-language-detection-which-uses-tflite.patch delete mode 100644 electron-13-fix-base-check-nomerge.patch delete mode 100644 exception_context-missing-variant.patch delete mode 100644 fix-build-without-safebrowsing.patch delete mode 100644 fix-build-without-service-discovery.patch delete mode 100644 ip_protection_data_types-missing-optional.patch delete mode 100644 macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch delete mode 100644 node-compiler.patch delete mode 100644 quiche-absl-HexStringToBytes.patch delete mode 100644 skia_image_decoder_base-missing-stack.patch delete mode 100644 system-ada-url.patch delete mode 100644 v8-macro-assembler-riscv-leaptiering.patch delete mode 100644 vtt_scanner-missing-variant.patch delete mode 100644 wayland-protocol-toplevel-drag.patch delete mode 100644 wayland-protocol-toplevel-icon-2.patch delete mode 100644 wayland-protocol-toplevel-icon.patch delete mode 100644 wayland_connection-Wchanges-meaning.patch diff --git a/account_id-missing-optional.patch b/account_id-missing-optional.patch deleted file mode 100644 index 7d02078..0000000 --- a/account_id-missing-optional.patch +++ /dev/null @@ -1,33 +0,0 @@ -From dc9db222b929f5da415216134b77d7f3bf141813 Mon Sep 17 00:00:00 2001 -From: Ivan Murashov -Date: Wed, 18 Sep 2024 19:25:42 +0000 -Subject: [PATCH] IWYU: Add missing include for std::optional usage in - account_id.h - -In the CL https://crrev.com/c/5834683 used std::optional in the -components/account_id/account_id.h, but corresponding include -was missed. Added missing include for std::optional usage. - -Bug: 41455655 -Change-Id: Ifea71ffb41a8c83051ce95763d9cb836488ca86f -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872821 -Commit-Queue: Ivan Murashov -Reviewed-by: Hidehiko Abe -Reviewed-by: Xiyuan Xia -Cr-Commit-Position: refs/heads/main@{#1357262} ---- - components/account_id/account_id.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/components/account_id/account_id.h b/components/account_id/account_id.h -index 9804f179139063..e03b974cb481ba 100644 ---- a/components/account_id/account_id.h -+++ b/components/account_id/account_id.h -@@ -8,6 +8,7 @@ - #include - - #include -+#include - #include - #include - #include diff --git a/blink-platform-INSIDE_BLINK-Wodr.patch b/blink-platform-INSIDE_BLINK-Wodr.patch deleted file mode 100644 index 0d3ec9e..0000000 --- a/blink-platform-INSIDE_BLINK-Wodr.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- src/third_party/blink/public/platform/web_crypto_algorithm.h.orig 2024-07-24 12:50:54.735798500 +0200 -+++ src/third_party/blink/public/platform/web_crypto_algorithm.h 2024-08-04 16:11:13.938867200 +0200 -@@ -74,18 +74,14 @@ enum WebCryptoAlgorithmId { - kWebCryptoAlgorithmIdPbkdf2, - kWebCryptoAlgorithmIdEd25519, - kWebCryptoAlgorithmIdX25519, --#if INSIDE_BLINK - kWebCryptoAlgorithmIdLast = kWebCryptoAlgorithmIdX25519, --#endif - }; - - enum WebCryptoNamedCurve { - kWebCryptoNamedCurveP256, - kWebCryptoNamedCurveP384, - kWebCryptoNamedCurveP521, --#if INSIDE_BLINK - kWebCryptoNamedCurveLast = kWebCryptoNamedCurveP521, --#endif - }; - - enum WebCryptoAlgorithmParamsType { -@@ -153,11 +149,9 @@ class WebCryptoAlgorithmPrivate; - // methods on it (other than destruction, assignment, or IsNull()). - class BLINK_PLATFORM_EXPORT WebCryptoAlgorithm { - public: --#if INSIDE_BLINK - WebCryptoAlgorithm() = default; - WebCryptoAlgorithm(WebCryptoAlgorithmId, - std::unique_ptr); --#endif - - static WebCryptoAlgorithm CreateNull(); - static WebCryptoAlgorithm AdoptParamsAndCreate(WebCryptoAlgorithmId, ---- src/third_party/blink/public/platform/web_crypto_key.h.orig 2024-07-24 12:50:54.735798500 +0200 -+++ src/third_party/blink/public/platform/web_crypto_key.h 2024-08-04 16:11:34.638017900 +0200 -@@ -51,9 +51,7 @@ enum WebCryptoKeyUsage { - kWebCryptoKeyUsageWrapKey = 1 << 5, - kWebCryptoKeyUsageUnwrapKey = 1 << 6, - kWebCryptoKeyUsageDeriveBits = 1 << 7, --#if INSIDE_BLINK - kEndOfWebCryptoKeyUsage, --#endif - }; - - // A bitfield of WebCryptoKeyUsage diff --git a/boringssl-internal-addc-cxx.patch b/boringssl-internal-addc-cxx.patch deleted file mode 100644 index 0b6871e..0000000 --- a/boringssl-internal-addc-cxx.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- webrtc-6261b/third_party/boringssl/src/crypto/internal.h.orig 2024-03-13 22:27:36.595241500 +0000 -+++ webrtc-6261b/third_party/boringssl/src/crypto/internal.h 2024-03-14 19:45:48.047485200 +0000 -@@ -1146,11 +1146,28 @@ static inline uint64_t CRYPTO_rotr_u64(u - // bit. |carry| must be zero or one. - #if OPENSSL_HAS_BUILTIN(__builtin_addc) - -+#ifdef __cplusplus -+extern "C++" { -+static constexpr unsigned CRYPTO_GENERIC_ADDC(unsigned x, unsigned y, -+ unsigned carry, unsigned *out_carry){ -+ return __builtin_addc(x, y, carry, out_carry); -+} -+static constexpr unsigned long CRYPTO_GENERIC_ADDC(unsigned long x, unsigned long y, -+ unsigned long carry, unsigned long *out_carry){ -+ return __builtin_addcl(x, y, carry, out_carry); -+} -+static constexpr unsigned long long CRYPTO_GENERIC_ADDC(unsigned long long x, unsigned long long y, -+ unsigned long long carry, unsigned long long *out_carry){ -+ return __builtin_addcll(x, y, carry, out_carry); -+} -+} -+#else - #define CRYPTO_GENERIC_ADDC(x, y, carry, out_carry) \ - (_Generic((x), \ - unsigned: __builtin_addc, \ - unsigned long: __builtin_addcl, \ - unsigned long long: __builtin_addcll))((x), (y), (carry), (out_carry)) -+#endif - - static inline uint32_t CRYPTO_addc_u32(uint32_t x, uint32_t y, uint32_t carry, - uint32_t *out_carry) { -@@ -1198,11 +1215,28 @@ static inline uint64_t CRYPTO_addc_u64(u - // bit. |borrow| must be zero or one. - #if OPENSSL_HAS_BUILTIN(__builtin_subc) - -+#ifdef __cplusplus -+extern "C++" { -+static constexpr unsigned CRYPTO_GENERIC_SUBC(unsigned x, unsigned y, -+ unsigned borrow, unsigned *out_borrow){ -+ return __builtin_subc(x, y, borrow, out_borrow); -+} -+static constexpr unsigned long CRYPTO_GENERIC_SUBC(unsigned long x, unsigned long y, -+ unsigned long borrow, unsigned long *out_borrow){ -+ return __builtin_subcl(x, y, borrow, out_borrow); -+} -+static constexpr unsigned long long CRYPTO_GENERIC_SUBC(unsigned long long x, unsigned long long y, -+ unsigned long long borrow, unsigned long long *out_borrow){ -+ return __builtin_subcll(x, y, borrow, out_borrow); -+} -+} -+#else - #define CRYPTO_GENERIC_SUBC(x, y, borrow, out_borrow) \ - (_Generic((x), \ - unsigned: __builtin_subc, \ - unsigned long: __builtin_subcl, \ - unsigned long long: __builtin_subcll))((x), (y), (borrow), (out_borrow)) -+#endif - - static inline uint32_t CRYPTO_subc_u32(uint32_t x, uint32_t y, uint32_t borrow, - uint32_t *out_borrow) { diff --git a/build-without-extensions.patch b/build-without-extensions.patch deleted file mode 100644 index 91346db..0000000 --- a/build-without-extensions.patch +++ /dev/null @@ -1,29 +0,0 @@ -Work around this linker error: - -[ 9463s] /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: obj/electron/chromium_src/chrome/extension_navigation_ui_data.o: warning: relocation against `_ZN10extensions12WebViewGuest4TypeE' in read-only section `.text' -[ 9463s] /usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: obj/electron/chromium_src/chrome/extension_navigation_ui_data.o: in function `guest_view::GuestView::AsDerivedGuest(guest_view::GuestViewBase*)': -[ 9463s] /home/abuild/rpmbuild/BUILD/src/out/Release/../../components/guest_view/browser/guest_view.h:67:(.text+0xdd): undefined reference to `extensions::WebViewGuest::Type' - -This is not upstreamable as the problem is due to Electron changes to chromium, and is in dead code that would be removed in LTO builds. - ---- src/extensions/browser/guest_view/web_view/web_view_guest.cc.old 2023-09-28 10:14:03.660044621 +0200 -+++ src/extensions/browser/guest_view/web_view/web_view_guest.cc 2023-09-29 08:05:41.827245244 +0200 -@@ -285,7 +285,6 @@ std::string WebViewGuest::GetPartitionID - } - - // static --const char WebViewGuest::Type[] = "webview"; - const guest_view::GuestViewHistogramValue WebViewGuest::HistogramValue = - guest_view::GuestViewHistogramValue::kWebView; - ---- src/extensions/browser/guest_view/web_view/web_view_guest.h.old 2023-09-28 10:14:03.660044621 +0200 -+++ src/extensions/browser/guest_view/web_view/web_view_guest.h 2023-09-29 08:06:13.200529820 +0200 -@@ -49,7 +49,7 @@ class WebViewGuest : public guest_view:: - int embedder_process_id, - int view_instance_id); - -- static const char Type[]; -+ constexpr static const char Type[] = "webview"; - static const guest_view::GuestViewHistogramValue HistogramValue; - - // Returns the WebView partition ID associated with the render process diff --git a/bundled-minizip.patch b/bundled-minizip.patch deleted file mode 100644 index 5fca49d..0000000 --- a/bundled-minizip.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- src/build/linux/unbundle/zlib.gn.orig 2024-02-21 20:06:19.015040200 +0000 -+++ src/build/linux/unbundle/zlib.gn 2024-02-23 18:40:02.635135600 +0000 -@@ -23,21 +23,27 @@ source_set("zlib") { - public_configs = [ ":system_zlib" ] - } - --shim_headers("minizip_shim") { -- root_path = "contrib" -- headers = [ -- "minizip/crypt.h", -- "minizip/ioapi.h", -- "minizip/iowin32.h", -- "minizip/mztools.h", -- "minizip/unzip.h", -- "minizip/zip.h", -+static_library("minizip") { -+ include_dirs = [ -+ ".", -+ "//third_party/zlib", - ] --} - --source_set("minizip") { -- deps = [ ":minizip_shim" ] -- libs = [ "minizip" ] -+ sources = [ -+ "contrib/minizip/ioapi.c", -+ "contrib/minizip/ioapi.h", -+ "contrib/minizip/unzip.c", -+ "contrib/minizip/unzip.h", -+ "contrib/minizip/zip.c", -+ "contrib/minizip/zip.h", -+ ] -+ -+ deps = [ ":zlib" ] -+ -+ configs -= [ "//build/config/compiler:chromium_code" ] -+ configs += [ "//build/config/compiler:no_chromium_code" ] -+ -+ public_configs = [ ":zlib_config" ] - } - - static_library("zip") { diff --git a/css_attr_value_tainting-missing-once_flag.patch b/css_attr_value_tainting-missing-once_flag.patch deleted file mode 100644 index fd27169..0000000 --- a/css_attr_value_tainting-missing-once_flag.patch +++ /dev/null @@ -1,32 +0,0 @@ -From c502d310d8cb91f1c1098a7287e75114023e57f0 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 19 Sep 2024 10:55:23 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::once_flag in - css_attr_value_tainting.cc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: I8a8d486c1ee3b2a162accb41faaadaaa0664595f -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872634 -Reviewed-by: Steinar H Gunderson -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1357539} ---- - third_party/blink/renderer/core/css/css_attr_value_tainting.cc | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/renderer/core/css/css_attr_value_tainting.cc b/third_party/blink/renderer/core/css/css_attr_value_tainting.cc -index 42525e92307f8b..a44ffc15be2335 100644 ---- a/third_party/blink/renderer/core/css/css_attr_value_tainting.cc -+++ b/third_party/blink/renderer/core/css/css_attr_value_tainting.cc -@@ -4,6 +4,8 @@ - - #include "third_party/blink/renderer/core/css/css_attr_value_tainting.h" - -+#include -+ - #include "base/containers/span.h" - #include "base/unguessable_token.h" - #include "third_party/blink/renderer/core/css/parser/css_parser_token_stream.h" diff --git a/delete-old-language-detection-which-uses-tflite.patch b/delete-old-language-detection-which-uses-tflite.patch deleted file mode 100644 index 75b42e3..0000000 --- a/delete-old-language-detection-which-uses-tflite.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 12e89eee78a2dea41591fedc7937ca83e68c9168 Mon Sep 17 00:00:00 2001 -From: Fergal Daly -Date: Tue, 17 Dec 2024 22:06:08 -0800 -Subject: [PATCH] Delete the old language detection API. - -Bug: 349927087 -Change-Id: I41458da3cf03e78ec9c25fe3fddea343c3e982d6 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054825 -Reviewed-by: Jiacheng Guo -Commit-Queue: Fergal Daly -Cr-Commit-Position: refs/heads/main@{#1397739} ---- - .../bindings/generated_in_modules.gni | 2 - - .../renderer/bindings/idl_in_modules.gni | 1 - - .../ai_language_detector.idl | 5 ++ - .../modules/on_device_translation/BUILD.gn | 2 - - .../language_detector.cc | 52 ---------------- - .../on_device_translation/language_detector.h | 41 ------------- - .../language_detector.idl | 23 -------- - .../on_device_translation/translation.cc | 59 ------------------- - .../on_device_translation/translation.h | 7 --- - .../on_device_translation/translation.idl | 16 ----- - .../canDetect.tentative.window.js | 9 --- - .../detect-en.tentative.window.js | 14 ----- - 12 files changed, 5 insertions(+), 226 deletions(-) - delete mode 100644 third_party/blink/renderer/modules/on_device_translation/language_detector.cc - delete mode 100644 third_party/blink/renderer/modules/on_device_translation/language_detector.h - delete mode 100644 third_party/blink/renderer/modules/on_device_translation/language_detector.idl - delete mode 100644 third_party/blink/web_tests/external/wpt/ai/language_detection/canDetect.tentative.window.js - delete mode 100644 third_party/blink/web_tests/external/wpt/ai/language_detection/detect-en.tentative.window.js - -diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni -index 05b8fe33432374..0fa149cc2101ac 100644 ---- a/third_party/blink/renderer/bindings/generated_in_modules.gni -+++ b/third_party/blink/renderer/bindings/generated_in_modules.gni -@@ -2827,8 +2825,6 @@ generated_interface_sources_in_modules = [ - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.h", -diff --git a/third_party/blink/renderer/modules/on_device_translation/BUILD.gn b/third_party/blink/renderer/modules/on_device_translation/BUILD.gn -index 21470f0869cfda..21772fce07cc5e 100644 ---- a/third_party/blink/renderer/modules/on_device_translation/BUILD.gn -+++ b/third_party/blink/renderer/modules/on_device_translation/BUILD.gn -@@ -8,8 +8,6 @@ blink_modules_sources("on_device_translation") { - sources = [ - "dom_translation.cc", - "dom_translation.h", -- "language_detector.cc", -- "language_detector.h", - "language_translator.cc", - "language_translator.h", - "translation.cc", diff --git a/electron-13-fix-base-check-nomerge.patch b/electron-13-fix-base-check-nomerge.patch deleted file mode 100644 index 307d4ac..0000000 --- a/electron-13-fix-base-check-nomerge.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: electron-17.1.0/base/compiler_specific.h -=================================================================== ---- electron-17.1.0.orig/base/compiler_specific.h 2022-03-07 17:20:29.460807562 +0100 -+++ electron-17.1.0/base/compiler_specific.h 2022-03-09 08:28:51.902933750 +0100 -@@ -366,7 +366,8 @@ inline constexpr bool AnalyzerAssumeTrue - #endif // defined(__clang_analyzer__) - - // Use nomerge attribute to disable optimization of merging multiple same calls. --#if defined(__clang__) && HAS_ATTRIBUTE(nomerge) -+#if defined(__clang__) && (__clang_major__ >= 12) && \ -+ __has_attribute(nomerge) && !defined(OS_CHROMEOS) - #define NOMERGE [[clang::nomerge]] - #else - #define NOMERGE diff --git a/exception_context-missing-variant.patch b/exception_context-missing-variant.patch deleted file mode 100644 index 4c31044..0000000 --- a/exception_context-missing-variant.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 47fb59539e5744467eb6f7aae52f5a169910d56c Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 19 Sep 2024 11:04:49 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::variant in - exception_context.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: I7c4a26c28481de40b22646f5a9f018235079dbca -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872753 -Commit-Queue: José Dapena Paz -Reviewed-by: Michael Lippautz -Cr-Commit-Position: refs/heads/main@{#1357540} ---- - .../blink/renderer/platform/bindings/exception_context.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/renderer/platform/bindings/exception_context.h b/third_party/blink/renderer/platform/bindings/exception_context.h -index 82d20a29326432..afa27f00d03924 100644 ---- a/third_party/blink/renderer/platform/bindings/exception_context.h -+++ b/third_party/blink/renderer/platform/bindings/exception_context.h -@@ -5,6 +5,8 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_EXCEPTION_CONTEXT_H_ - #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_EXCEPTION_CONTEXT_H_ - -+#include -+ - #include "base/check_op.h" - #include "base/dcheck_is_on.h" - #include "base/notreached.h" diff --git a/fix-build-without-safebrowsing.patch b/fix-build-without-safebrowsing.patch deleted file mode 100644 index 3875b64..0000000 --- a/fix-build-without-safebrowsing.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc.orig 2024-12-08 18:44:40.908024234 +0100 -+++ src/chrome/browser/ui/exclusive_access/fullscreen_controller.cc 2024-12-18 13:07:47.764725866 +0100 -@@ -20,7 +20,6 @@ - #include "chrome/browser/browser_process.h" - #include "chrome/browser/history/history_service_factory.h" - #include "chrome/browser/profiles/profile.h" --#include "chrome/browser/safe_browsing/safe_browsing_service.h" - #if 0 - #include "chrome/browser/ui/blocked_content/popunder_preventer.h" - #endif -@@ -117,20 +116,6 @@ void RecordWebsiteStateAtApiRequest(hist - void CheckUrlForAllowlistAndRecordMetric( - const GURL& url, - history::HistoryLastVisitResult result) { -- if (!g_browser_process->safe_browsing_service() || -- !g_browser_process->safe_browsing_service()->database_manager()) { -- RecordWebsiteStateAtApiRequest(result, std::nullopt); -- return; -- } -- g_browser_process->safe_browsing_service() -- ->database_manager() -- ->CheckUrlForHighConfidenceAllowlist( -- url, -- base::BindOnce( -- [](history::HistoryLastVisitResult result, bool on_allowlist) { -- RecordWebsiteStateAtApiRequest(result, on_allowlist); -- }, -- result)); - } - - } // namespace diff --git a/fix-build-without-service-discovery.patch b/fix-build-without-service-discovery.patch deleted file mode 100644 index 8c0ff9c..0000000 --- a/fix-build-without-service-discovery.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/chrome/browser/extensions/api/BUILD.gn.orig 2024-12-08 18:34:53.171339936 +0100 -+++ src/chrome/browser/extensions/api/BUILD.gn 2025-01-01 21:24:35.512530556 +0100 -@@ -34,7 +34,6 @@ group("api_implementations") { - "//chrome/browser/extensions/api/downloads_internal", - "//chrome/browser/extensions/api/experimental_ai_data", - "//chrome/browser/extensions/api/font_settings", -- "//chrome/browser/extensions/api/mdns", - "//chrome/browser/extensions/api/module", - "//chrome/browser/extensions/api/networking_private", - "//chrome/browser/extensions/api/omnibox", diff --git a/ip_protection_data_types-missing-optional.patch b/ip_protection_data_types-missing-optional.patch deleted file mode 100644 index 8b52ac0..0000000 --- a/ip_protection_data_types-missing-optional.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 7e28832cd3320d2b603e6ef9468581e1c65c14f1 Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 19 Sep 2024 15:05:26 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::optional in - ip_protection_data_types.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Bug: 41455655 -Change-Id: Id26fc5bc3a4bde79c2f9a3134d18eeaab68603ad -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5873261 -Commit-Queue: José Dapena Paz -Reviewed-by: Dustin Mitchell -Cr-Commit-Position: refs/heads/main@{#1357601} ---- - components/ip_protection/common/ip_protection_data_types.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/components/ip_protection/common/ip_protection_data_types.h b/components/ip_protection/common/ip_protection_data_types.h -index 35648110915fc4..978dfac4ac74a5 100644 ---- a/components/ip_protection/common/ip_protection_data_types.h -+++ b/components/ip_protection/common/ip_protection_data_types.h -@@ -5,6 +5,8 @@ - #ifndef COMPONENTS_IP_PROTECTION_COMMON_IP_PROTECTION_DATA_TYPES_H_ - #define COMPONENTS_IP_PROTECTION_COMMON_IP_PROTECTION_DATA_TYPES_H_ - -+#include -+ - #include "base/time/time.h" - - namespace ip_protection { diff --git a/macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch b/macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch deleted file mode 100644 index 02b860c..0000000 --- a/macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- src/v8/src/codegen/riscv/macro-assembler-riscv.h.orig 2025-04-24 18:27:30.451008724 +0200 -+++ src/v8/src/codegen/riscv/macro-assembler-riscv.h 2025-04-24 23:48:27.554835902 +0200 -@@ -400,10 +400,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : - push_helper(rs...); - } - -- template <> -- void push_helper(Register r) { -- StoreWord(r, MemOperand(sp, 0)); -- } -+ void push_helper() {} - - public: - // Push a number of registers. The leftmost register first (to the highest -@@ -548,10 +545,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : - LoadWord(r, MemOperand(sp, sizeof...(rs) * kSystemPointerSize)); - } - -- template <> -- void pop_helper(Register r) { -- LoadWord(r, MemOperand(sp, 0)); -- } -+ void pop_helper() {} - - public: - // Pop a number of registers. The leftmost register last (from the highest diff --git a/node-compiler.patch b/node-compiler.patch deleted file mode 100644 index 98ac6e0..0000000 --- a/node-compiler.patch +++ /dev/null @@ -1,93 +0,0 @@ -Disable various compiler configs (currently warning suppression). Like chromium-102-compiler.patch but for node - ---- src/third_party/electron_node/BUILD.gn.old -+++ src/third_party/electron_node/BUILD.gn -@@ -142,12 +142,6 @@ config("node_lib_config") { - config("node_lib_config") { - include_dirs = [ "src" ] - -- cflags = [ -- "-Wno-shadow", -- # FIXME(deepak1556): include paths should be corrected, -- # refer https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.g71ecd450e_2_702 -- "-Wno-microsoft-include", -- ] - - configs = [ ":node_features" ] - -@@ -250,17 +249,6 @@ component("node_lib") { - deps += [ "deps/histogram" ] - } - frameworks = [] -- cflags_cc = [ -- "-Wno-deprecated-declarations", -- "-Wno-implicit-fallthrough", -- "-Wno-return-type", -- "-Wno-sometimes-uninitialized", -- "-Wno-string-plus-int", -- "-Wno-unused-function", -- "-Wno-unused-label", -- "-Wno-unused-private-field", -- "-Wno-unused-variable", -- ] - - if (v8_enable_i18n_support) { - deps += [ "//third_party/icu" ] -@@ -353,6 +340,5 @@ component("node_lib") { - "src/node_crypto.cc", - "src/node_crypto.h", - ] -- cflags_cc += [ "-Wno-sign-compare" ] - } - } ---- src/third_party/electron_node/deps/histogram/BUILD.gn.old -+++ src/third_party/electron_node/deps/histogram/BUILD.gn -@@ -1,12 +1,6 @@ - config("histogram_config") { - include_dirs = [ "include" ] - -- cflags = [ -- "-Wno-implicit-function-declaration", -- "-Wno-incompatible-pointer-types", -- "-Wno-unused-function", -- "-Wno-atomic-alignment", -- ] - } - - static_library("histogram") { ---- src/third_party/electron_node/deps/llhttp/BUILD.gn.old -+++ src/third_party/electron_node/deps/llhttp/BUILD.gn -@@ -1,6 +1,5 @@ - config("llhttp_config") { - include_dirs = [ "include" ] -- cflags = [ "-Wno-unreachable-code" ] - } - - static_library("llhttp") { ---- src/third_party/electron_node/deps/uv/BUILD.gn.old -+++ src/third_party/electron_node/deps/uv/BUILD.gn -@@ -32,24 +32,6 @@ static_library("uv") { - # This only has an effect on Windows, where it will cause libuv's symbols to be exported in node.lib - defines += [ "BUILDING_UV_SHARED=1" ] - -- cflags_c = [ -- "-Wno-incompatible-pointer-types", -- "-Wno-bitwise-op-parentheses", -- "-Wno-implicit-fallthrough", -- "-Wno-implicit-function-declaration", -- "-Wno-missing-braces", -- "-Wno-sign-compare", -- "-Wno-sometimes-uninitialized", -- "-Wno-string-conversion", -- "-Wno-switch", -- "-Wno-unused-function", -- "-Wno-unused-result", -- "-Wno-unused-variable", -- "-Wno-unreachable-code", -- "-Wno-unreachable-code-return", -- "-Wno-unused-but-set-variable", -- "-Wno-shadow", -- ] - - libs = [] - diff --git a/nodejs-electron.changes b/nodejs-electron.changes index a10b2f3..7b8a3a3 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,91 @@ +------------------------------------------------------------------- +Sat Apr 26 09:53:27 UTC 2025 - Bruno Pitrus + +- Update to 35.2.1 + * Chromium 134.0.6998.205 + * Node 22.14.0 + * V8 13.4 + * Removed AVIF image format + * Added excludeUrls to webRequest filter and deprecated the use of empty arrays in urls property. + * Added fromVersionID on ServiceWorkers to get an instance of ServiceWorkerMain. + * Deprecated getPreloads and setPreloads on Session. + * Moved 'console-message' arguments into event object. + * Added ServiceWorkerMain class to interact with service workers in the main process. + * Added contextBridge.executeInMainWorld to safely execute code across world boundaries. + * Added frame to 'console-message' event. + * Added optional animation parameter to BrowserWindow.setVibrancy. + * Added permission support for document.executeCommand("paste"). + * Added support for service worker preload scripts. + * Support Portal's globalShortcuts. + Electron must be run with --enable-features=GlobalShortcutsPortal in order to have the feature working. + * see https://github.com/electron/electron/releases/tag/v35.0.0 and https://www.electronjs.org/blog/electron-35-0 for more +- Remove Fedora 40 support + * drop bundled-minizip.patch + * drop quiche-absl-HexStringToBytes.patch +- Leap 15.6: use backported wayland-protocols + * drop wayland-protocol-toplevel-icon.patch + * drop wayland-protocol-toplevel-icon-2.patch + * drop wayland-protocol-toplevel-drag.patch +- Build with LTO also on 15.6 (so now we enable it everywhere) +- Fedora: use system simdjson + * merge system-ada-url.patch into use-system-libraries-in-node.patch +- Drop no longer applicable patches + * account_id-missing-optional.patch + * blink-platform-INSIDE_BLINK-Wodr.patch + * boringssl-internal-addc-cxx.patch + * build-without-extensions.patch + * css_attr_value_tainting-missing-once_flag.patch + * electron-13-fix-base-check-nomerge.patch + * exception_context-missing-variant.patch + * fix-build-without-safebrowsing.patch + * fix-build-without-service-discovery.patch + * ip_protection_data_types-missing-optional.patch + * node-compiler.patch + * skia_image_decoder_base-missing-stack.patch + * vtt_scanner-missing-variant.patch + * wayland_connection-Wchanges-meaning.patch +- Add backported or upstreamable patches + * ax_platform_node_id-fpermissive.patch + * browser_process_impl-fix-safe_browsing_mode-0.patch + * content_browser_client-incomplete-WebUIController.patch + * css_shape_value-constructor.patch + * exception_state-constexpr-initializer.patch + * fix-build-without-pdf.patch + * fix-build-without-video-effects.patch + * media_session_uma_helper-missing-optional.patch + * object_paint_properties-explicit-specialization-in-non-namespace-scope.patch + * perfetto-ThreadTrack-Current-null-dereference.patch + * picture_in_picture_window_manager_uma_helper-missing-optional.patch + * plugin_utils-build-without-electron_extensions.patch + * raw_ptr-fpermissive.patch + * resource_response-Wchanges-meaning.patch + * resource-Wchanges-meaning.patch + * string-hasher-flax-vector-conversions.patch + * string_truncator-convert.patch + * style_scope-unqualified-To.patch + * to_vector-std-projected-gcc119888.patch + * unexportable_key_service_impl-Wlto-type-mismatch.patch + * xml_document_parser-Wmissing-template-keyword.patch +- merge remove-libphonenumber.patch & delete-old-language-detection-which-uses-tflite.patch + into remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch +- Revert upstream change which breaks build with old abseil + * webrtc-make_ref_counted-absl2024-nullability.patch +- Conditionally (15.6) remove feature change which needs new spirv + * angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch +- Use system sqlite in node (except 15.6) + * system-sqlite.patch +- Remove more rust code + * chromium-132-no-rust.patch +- Actually disable AVIF support without disabling AV1 video + * disable-avif-really.patch +- Various other build fixes + * absl_strings-missing-headers.patch + * blink-shape_result-highway.patch + * build-without-mesage-center.patch + * fix-system-highway.patch + * gn-logspam-breaks-install.patch + * permission-gcc14.2.patch + ------------------------------------------------------------------- Sat Apr 19 08:45:19 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index ebe55dc..df00d8a 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -212,15 +212,8 @@ Source410: aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch Source411: aom3.10-AV1E_SET_AUTO_TILES.patch Source412: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch Source413: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch -# and wayland protocol 1.32 -#Source420: wayland-protocol-toplevel-icon.patch -#Source421: wayland-protocol-toplevel-icon-2.patch -#Source422: wayland-protocol-toplevel-drag.patch -#Source423: wayland_connection-Wchanges-meaning.patch # and abseil 2407 -#Source460: quiche-absl-HexStringToBytes.patch Source461: webrtc-make_ref_counted-absl2024-nullability.patch -#Source462: quiche-absl-HexStringToBytes-2.patch # and c-ares 1.19 Source470: node-cares-1.21.patch # and spirv 2023 @@ -244,7 +237,6 @@ Patch75: gcc-asmflags.patch Patch77: angle_link_glx.patch Patch78: rdynamic.patch Patch80: icon.patch -#Patch82: node-compiler.patch Patch84: aarch64-Xclang.patch Patch85: devtools-frontend-compress_files-oom.patch Patch86: enable_stack_trace_line_numbers-symbol_level.patch @@ -269,7 +261,6 @@ Patch586: aom-vpx-no-thread-wrapper.patch Patch588: remove-password-manager-and-policy.patch Patch589: remove-puffin.patch Patch590: remove-sync.patch -#Patch591: fix-build-without-safebrowsing.patch Patch592: fix-build-without-supervised-users.patch Patch593: fix-build-without-screen-ai.patch Patch594: build-without-speech-service.patch @@ -280,8 +271,6 @@ Patch597: chromium-125-cloud_authenticator.patch Patch598: chromium-127-crabby.patch Patch599: chromium-132-no-rust.patch #End gentoo patches -#Patch600: remove-libphonenumber.patch -#Patch601: delete-old-language-detection-which-uses-tflite.patch Patch601: MakeSbixTypeface-null-pointer-call.patch Patch602: remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch Patch603: build-without-mesage-center.patch @@ -313,7 +302,6 @@ Patch1078: system-simdutf.patch Patch1079: system-libm.patch Patch1085: webp-no-sharpyuv.patch Patch1086: zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch -#Patch1087: system-ada-url.patch Patch1088: cr130-abseil-remove-unused-deps.patch Patch1089: system-absl_algorithm.patch Patch1090: cr130-absl-base.patch @@ -325,18 +313,9 @@ Patch1094: absl_strings-missing-headers.patch # PATCHES to fix interaction with third-party software Patch2010: chromium-93-ffmpeg-4.4.patch - -# Fixe builds with older clang versions that do not allow -# nomerge attributes on declaration. Otherwise, the following error -# is produced: -# 'nomerge' attribute cannot be applied to a declaration -# See https://reviews.llvm.org/D92800 -#Patch2022: electron-13-fix-base-check-nomerge.patch Patch2032: seccomp_bpf-no-lto.patch Patch2034: swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch Patch2035: RenderFrameHostImpl-use-after-free.patch -# https://github.com/electron/electron/pull/40032 -#Patch2040: build-without-extensions.patch %if %{without bro_11} Patch2042: brotli-remove-shared-dictionary.patch %else @@ -344,7 +323,6 @@ Source2042: brotli-remove-shared-dictionary.patch %endif Patch2045: libxml-2.12-xmlCtxtGetLastError-const.patch Patch2046: chromium-118-sigtrap_system_ffmpeg.patch -#Patch2047: bundled-minizip.patch Patch2048: absl2023-encapsulated_web_transport-StrCat.patch #Work around gcc14 overly aggressive optimizer. Patch2058: v8-strict-aliasing.patch @@ -373,18 +351,9 @@ Patch3134: swiftshader-llvm18-LLVMJIT-Host.patch Patch3135: swiftshader-llvm18-LLVMJIT-CodeGenOptLevel.patch Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch Patch3144: mt21_util-flax-vector-conversions.patch -#Patch3149: boringssl-internal-addc-cxx.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch -#Patch3173: blink-platform-INSIDE_BLINK-Wodr.patch Patch3174: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch Patch3175: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch -#Patch3176: fix-build-without-service-discovery.patch -#Patch3178: ip_protection_data_types-missing-optional.patch -#Patch3179: account_id-missing-optional.patch -#Patch3180: skia_image_decoder_base-missing-stack.patch -#Patch3181: exception_context-missing-variant.patch -#Patch3182: css_attr_value_tainting-missing-once_flag.patch -#Patch3183: vtt_scanner-missing-variant.patch Patch3184: electron_usb_delegate-incomplete-UsbDeviceInfo.patch Patch3185: bsc1224178-font-gc.patch Patch3186: string_view-incomplete-CodePointIterator.patch @@ -410,8 +379,6 @@ Patch3205: plugin_utils-build-without-electron_extensions.patch Patch3206: string-hasher-flax-vector-conversions.patch Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch Patch3208: to_vector-std-projected-gcc119888.patch -Patch3209: macro-assembler-riscv-explicit-specialization-in-non-namespace-scope.patch -Patch3210: v8-macro-assembler-riscv-leaptiering.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -751,10 +718,6 @@ providing better integration with desktop environments such as KDE. # Sanity check if macro corresponds to the actual ABI test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = %abi_version -%if %{without system_abseil} -#patch -R -p1 < %PATCH1076 -%endif - #These ones depend on an aom nightly, reverting unconditionally patch -R -p1 < %SOURCE411 @@ -1297,17 +1260,6 @@ myconf_gn+=' enable_perfetto_trace_processor_json=false' myconf_gn+=' enable_perfetto_trace_processor_httpd=false' myconf_gn+=' enable_perfetto_zlib=false' -#Otherwise mksnapshot crashes -#0 perfetto::ThreadTrack::Current () at ../../third_party/perfetto/src/tracing/track.cc:105 -#1 0x0000555555815084 in v8::internal::GCTracer::GCTracer () at ../../v8/src/heap/gc-tracer.cc:184 -#2 v8::internal::Heap::SetUpSpaces (this=0x555557507788, new_allocation_info=..., old_allocation_info=...) at ../../v8/src/heap/heap.cc:5788 -#3 0x000055555704895b in v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [clone .isra.0] () at ../../v8/src/execution/isolate.cc:5556 -#4 0x0000555555b51ad3 in v8::internal::Isolate::InitWithoutSnapshot () at ../../v8/src/execution/isolate.cc:5184 -#5 v8::internal::SnapshotCreatorImpl::InitInternal (this=0x55555750c130, blob=0x0) at ../../v8/src/snapshot/snapshot.cc:868 -#6 0x0000555555654b15 in v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl () at ../../v8/src/snapshot/snapshot.cc:929 -#7 v8::SnapshotCreator::SnapshotCreator () at ../../v8/src/api/api.cc:552 -#8 main (argc=1465209528, argv=0x3ff0000000000000) at ../../v8/src/snapshot/mksnapshot.cc:298 -#myconf_gn+=' v8_use_perfetto=false' diff --git a/quiche-absl-HexStringToBytes.patch b/quiche-absl-HexStringToBytes.patch deleted file mode 100644 index 1bf870c..0000000 --- a/quiche-absl-HexStringToBytes.patch +++ /dev/null @@ -1,116 +0,0 @@ -From a484a561d3d36beca0d4dc9f5d4a2c083be03e1f Mon Sep 17 00:00:00 2001 -From: awillia -Date: Tue, 19 Mar 2024 17:22:54 -0700 -Subject: [PATCH] Replace deprecated version of absl::HexStringToBytes in test - programs and remaining quic/ tests - -Replaces the deprecated version of absl::HexStringToBytes that returns std::string with the version that returns bool and populates a passed in std::string. This CL isn't expected to change the behavior of any code used in production. - -This allows the Chrome build of QUICHE to build without the `-Wno-deprecated-declarations` clang flag. - -PiperOrigin-RevId: 617342915 ---- - .../web_transport_fingerprint_proof_verifier.cc | 12 ++++++++++-- - quiche/quic/masque/masque_client_bin.cc | 7 ++++++- - quiche/quic/masque/masque_server_backend.cc | 5 ++++- - quiche/quic/tools/crypto_message_printer_bin.cc | 6 +++++- - quiche/quic/tools/quic_packet_printer_bin.cc | 6 +++++- - quiche/quic/tools/quic_toy_client.cc | 17 +++++++++-------- - 6 files changed, 39 insertions(+), 14 deletions(-) - -diff --git a/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc b/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc -index 167e4efc4..fc8cffd40 100644 ---- a/net/third_party/quiche/src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc -+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/web_transport_fingerprint_proof_verifier.cc -@@ -18,6 +20,7 @@ - #include "quiche/quic/core/quic_types.h" - #include "quiche/quic/core/quic_utils.h" - #include "quiche/quic/platform/api/quic_bug_tracker.h" -+#include "quiche/quic/platform/api/quic_logging.h" - #include "quiche/common/quiche_text_utils.h" - - namespace quic { -@@ -83,8 +86,13 @@ bool WebTransportFingerprintProofVerifier::AddFingerprint( - - std::string normalized = - absl::StrReplaceAll(fingerprint.fingerprint, {{":", ""}}); -- hashes_.push_back(WebTransportHash{fingerprint.algorithm, -- absl::HexStringToBytes(normalized)}); -+ std::string normalized_bytes; -+ if (!absl::HexStringToBytes(normalized, &normalized_bytes)) { -+ QUIC_DLOG(WARNING) << "Fingerprint hexadecimal is invalid"; -+ return false; -+ } -+ hashes_.push_back( -+ WebTransportHash{fingerprint.algorithm, std::move(normalized_bytes)}); - return true; - } - -diff --git a/quiche/quic/masque/masque_client_bin.cc b/quiche/quic/masque/masque_client_bin.cc -index eefd002dc..06e6ed2b7 100644 ---- a/net/third_party/quiche/src/quiche/quic/masque/masque_client_bin.cc -+++ b/net/third_party/quiche/src/quiche/quic/masque/masque_client_bin.cc -@@ -281,7 +281,12 @@ int RunMasqueClient(int argc, char* argv[]) { - QUIC_LOG(ERROR) << "Concealed authentication key ID cannot be empty"; - return 1; - } -- private_key_seed = absl::HexStringToBytes(concealed_auth_param_split[1]); -+ if (!absl::HexStringToBytes(concealed_auth_param_split[1], -+ &private_key_seed)) { -+ QUIC_LOG(ERROR) << "Concealed authentication key hex value is invalid"; -+ return 1; -+ } -+ - if (private_key_seed.size() != kEd25519Rfc8032PrivateKeySize) { - QUIC_LOG(ERROR) - << "Invalid Concealed authentication private key length " -diff --git a/quiche/quic/masque/masque_server_backend.cc b/quiche/quic/masque/masque_server_backend.cc -index f4ff2e0ed..66ca13c96 100644 ---- a/net/third_party/quiche/src/quiche/quic/masque/masque_server_backend.cc -+++ b/net/third_party/quiche/src/quiche/quic/masque/masque_server_backend.cc -@@ -193,7 +193,10 @@ void MasqueServerBackend::SetSignatureAuth(absl::string_view signature_auth) { - quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&kv[1]); - ConcealedAuthCredential credential; - credential.key_id = std::string(kv[0]); -- std::string public_key = absl::HexStringToBytes(kv[1]); -+ std::string public_key; -+ if (!absl::HexStringToBytes(kv[1], &public_key)) { -+ QUIC_LOG(FATAL) << "Invalid concealed auth public key hex " << kv[1]; -+ } - if (public_key.size() != sizeof(credential.public_key)) { - QUIC_LOG(FATAL) << "Invalid concealed auth public key length " - << public_key.size(); -diff --git a/quiche/quic/tools/crypto_message_printer_bin.cc b/quiche/quic/tools/crypto_message_printer_bin.cc -index eb7393d54..82850d94a 100644 ---- a/net/third_party/quiche/src/quiche/quic/tools/crypto_message_printer_bin.cc -+++ b/net/third_party/quiche/src/quiche/quic/tools/crypto_message_printer_bin.cc -@@ -48,7 +48,11 @@ int main(int argc, char* argv[]) { - quic::CryptoFramer framer; - framer.set_visitor(&printer); - framer.set_process_truncated_messages(true); -- std::string input = absl::HexStringToBytes(messages[0]); -+ std::string input; -+ if (!absl::HexStringToBytes(messages[0], &input)) { -+ cerr << "Invalid hex string provided" << endl; -+ return 1; -+ } - if (!framer.ProcessInput(input)) { - return 1; - } -diff --git a/quiche/quic/tools/quic_packet_printer_bin.cc b/quiche/quic/tools/quic_packet_printer_bin.cc -index 5ed77010a..314cc20ea 100644 ---- a/net/third_party/quiche/src/quiche/quic/tools/quic_packet_printer_bin.cc -+++ b/net/third_party/quiche/src/quiche/quic/tools/quic_packet_printer_bin.cc -@@ -270,7 +270,11 @@ int main(int argc, char* argv[]) { - quiche::QuichePrintCommandLineFlagHelp(usage); - return 1; - } -- std::string hex = absl::HexStringToBytes(args[1]); -+ std::string hex; -+ if (!absl::HexStringToBytes(args[1], &hex)) { -+ std::cerr << "Invalid hex string" << std::endl; -+ return 1; -+ } - quic::ParsedQuicVersionVector versions = quic::AllSupportedVersions(); - // Fake a time since we're not actually generating acks. - quic::QuicTime start(quic::QuicTime::Zero()); diff --git a/skia_image_decoder_base-missing-stack.patch b/skia_image_decoder_base-missing-stack.patch deleted file mode 100644 index 0f1a6b7..0000000 --- a/skia_image_decoder_base-missing-stack.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 39583ff118920284de516d262979960e7159bcfc Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 19 Sep 2024 15:44:36 +0000 -Subject: [PATCH] IWYU: missing include for usage of std::stack in - skia_image_decoder_base.cc - -Bug: 41455655 -Change-Id: Id9c09f951dacc34d46aadc4badc6b3fd250ad38b -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872492 -Reviewed-by: Peter Kasting -Commit-Queue: Peter Kasting -Cr-Commit-Position: refs/heads/main@{#1357626} ---- - .../platform/image-decoders/skia/skia_image_decoder_base.cc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc b/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc -index 1d002cc258ae8b..84fd71c1e46139 100644 ---- a/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc -+++ b/third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc -@@ -5,6 +5,7 @@ - #include "third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.h" - - #include -+#include - - #include "third_party/blink/renderer/platform/image-decoders/segment_stream.h" - #include "third_party/skia/include/codec/SkCodec.h" diff --git a/system-ada-url.patch b/system-ada-url.patch deleted file mode 100644 index b6a9268..0000000 --- a/system-ada-url.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- src/third_party/electron_node/unofficial.gni.orig 2025-04-11 21:14:18.899221050 +0200 -+++ src/third_party/electron_node/unofficial.gni 2025-04-11 21:14:28.715218444 +0200 -@@ -143,7 +143,6 @@ template("node_gn_build") { - "deps/googletest:googletest_config", - ] - public_deps = [ -- "deps/ada", - "deps/uv", - "//electron:electron_js2c", - "deps/simdjson", -@@ -183,6 +182,8 @@ template("node_gn_build") { - configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] - configs += [ "//build/config/gcc:symbol_visibility_default" ] - } -+ libs = [ "ada" ] -+ include_dirs = [] - if (use_system_llhttp) { - libs += [ "llhttp" ] - } else { diff --git a/v8-macro-assembler-riscv-leaptiering.patch b/v8-macro-assembler-riscv-leaptiering.patch deleted file mode 100644 index 962fadb..0000000 --- a/v8-macro-assembler-riscv-leaptiering.patch +++ /dev/null @@ -1,818 +0,0 @@ -From 4d24761fae4b1de87a1ba7a507e98be157a64bf4 Mon Sep 17 00:00:00 2001 -From: Alexey Pavlyutkin -Date: Thu, 13 Feb 2025 11:40:23 +0000 -Subject: [PATCH] [riscv][leaptiering] Enable leaptiering support - -Fix RISC-V build broken by unconditional enabling of leaptiering (see -6207491). - -Change-Id: I72db70b09b98410ae83d40b3251495b8bcbda207 -Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6249680 -Reviewed-by: Yahan Lu (LuYahan) -Reviewed-by: Ji Qiu -Commit-Queue: Ji Qiu -Cr-Commit-Position: refs/heads/main@{#98693} ---- - src/builtins/riscv/builtins-riscv.cc | 27 +- - src/codegen/riscv/macro-assembler-riscv.cc | 321 +++++++++++------- - src/codegen/riscv/macro-assembler-riscv.h | 48 ++- - src/codegen/riscv/register-riscv.h | 3 +- - .../backend/riscv/code-generator-riscv.cc | 41 ++- - src/maglev/riscv/maglev-assembler-riscv.cc | 3 + - 6 files changed, 286 insertions(+), 157 deletions(-) - -diff --git a/src/builtins/riscv/builtins-riscv.cc b/src/builtins/riscv/builtins-riscv.cc -index 4d637bd281ee..54960a8cb0ef 100644 ---- a/v8/src/builtins/riscv/builtins-riscv.cc -+++ b/v8/src/builtins/riscv/builtins-riscv.cc -@@ -996,6 +996,7 @@ void Builtins::Generate_BaselineOutOfLinePrologueDeopt(MacroAssembler* masm) { - } - - void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { -+ ASM_CODE_COMMENT(masm); - UseScratchRegisterScope temps(masm); - temps.Include({kScratchReg, kScratchReg2, s1}); - auto descriptor = -@@ -1016,11 +1017,14 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { - __ AssertFeedbackVector(feedback_vector, type); - } - -+#ifndef V8_ENABLE_LEAPTIERING - // Check for an tiering state. - Label flags_need_processing; - Register flags = temps.Acquire(); - __ LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( - flags, feedback_vector, CodeKind::BASELINE, &flags_need_processing); -+#endif -+ - { - UseScratchRegisterScope temps(masm); - ResetFeedbackVectorOsrUrgency(masm, feedback_vector, temps.Acquire()); -@@ -1096,6 +1100,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { - // TODO(v8:11429): Document this frame setup better. - __ Ret(); - -+#ifndef V8_ENABLE_LEAPTIERING - __ bind(&flags_need_processing); - { - ASM_CODE_COMMENT_STRING(masm, "Optimized marker check"); -@@ -1104,6 +1109,7 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { - __ OptimizeCodeOrTailCallOptimizedCodeSlot(flags, feedback_vector); - __ Trap(); - } -+#endif - - __ bind(&call_stack_guard); - { -@@ -1157,15 +1163,16 @@ void Builtins::Generate_InterpreterEntryTrampoline( - __ LoadFeedbackVector(feedback_vector, closure, a4, &push_stack_frame); - - #ifndef V8_JITLESS -+#ifndef V8_ENABLE_LEAPTIERING - // If feedback vector is valid, check for optimized code and update invocation - // count. -- - // Check the tiering state. - Label flags_need_processing; - Register flags = a4; - __ LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( - flags, feedback_vector, CodeKind::INTERPRETED_FUNCTION, - &flags_need_processing); -+#endif // V8_ENABLE_LEAPTIERING - ResetFeedbackVectorOsrUrgency(masm, feedback_vector, a4); - - // Increment invocation count for the function. -@@ -1323,10 +1330,13 @@ void Builtins::Generate_InterpreterEntryTrampoline( - __ Branch(&after_stack_check_interrupt); - - #ifndef V8_JITLESS -+#ifndef V8_ENABLE_LEAPTIERING - __ bind(&flags_need_processing); - __ OptimizeCodeOrTailCallOptimizedCodeSlot(flags, feedback_vector); -+#endif //! V8_ENABLE_LEAPTIERING - __ bind(&is_baseline); - { -+#ifndef V8_ENABLE_LEAPTIERING - // Load the feedback vector from the closure. - __ LoadTaggedField( - feedback_vector, -@@ -1347,7 +1357,6 @@ void Builtins::Generate_InterpreterEntryTrampoline( - __ LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( - flags, feedback_vector, CodeKind::BASELINE, &flags_need_processing); - --#ifndef V8_ENABLE_LEAPTIERING - // TODO(olivf, 42204201): This fastcase is difficult to support with the - // sandbox as it requires getting write access to the dispatch table. See - // `JSFunction::UpdateCode`. We might want to remove it for all -@@ -1357,9 +1366,9 @@ void Builtins::Generate_InterpreterEntryTrampoline( - static_assert(kJavaScriptCallCodeStartRegister == a2, "ABI mismatch"); - __ ReplaceClosureCodeWithOptimizedCode(a2, closure); - __ JumpCodeObject(a2, kJSEntrypointTag); --#endif // V8_ENABLE_LEAPTIERING -- - __ bind(&install_baseline_code); -+#endif // !V8_ENABLE_LEAPTIERING -+ - __ GenerateTailCallToReturnedCode(Runtime::kInstallBaselineCode); - } - #endif // !V8_JITLESS -@@ -2630,9 +2639,13 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, - // -- cp : the function context. - // ----------------------------------- - -+#ifdef V8_ENABLE_LEAPTIERING -+ __ InvokeFunctionCode(a1, no_reg, a0, InvokeType::kJump); -+#else - __ Lhu(a2, - FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); - __ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump); -+#endif - } - - namespace { -@@ -5084,9 +5097,13 @@ void Builtins::Generate_RestartFrameTrampoline(MacroAssembler* masm) { - // Pop return address and frame. - __ LeaveFrame(StackFrame::INTERPRETED); - -+#ifdef V8_ENABLE_LEAPTIERING -+ __ InvokeFunction(a1, a0, InvokeType::kJump, -+ ArgumentAdaptionMode::kDontAdapt); -+#else - __ li(a2, Operand(kDontAdaptArgumentsSentinel)); -- - __ InvokeFunction(a1, a2, a0, InvokeType::kJump); -+#endif - } - - #undef __ -diff --git a/src/codegen/riscv/macro-assembler-riscv.cc b/src/codegen/riscv/macro-assembler-riscv.cc -index aca1e993183f..ae86dddd6777 100644 ---- a/v8/src/codegen/riscv/macro-assembler-riscv.cc -+++ b/v8/src/codegen/riscv/macro-assembler-riscv.cc -@@ -209,24 +209,7 @@ void MacroAssembler::GenerateTailCallToReturnedCode( - Jump(a2); - } - --Condition MacroAssembler::LoadFeedbackVectorFlagsAndCheckIfNeedsProcessing( -- Register flags, Register feedback_vector, Register result, -- CodeKind current_code_kind) { -- ASM_CODE_COMMENT(this); -- DCHECK(!AreAliased(flags, feedback_vector)); -- DCHECK(CodeKindCanTierUp(current_code_kind)); -- -- Lhu(flags, FieldMemOperand(feedback_vector, FeedbackVector::kFlagsOffset)); -- uint32_t kFlagsMask = FeedbackVector::kFlagsTieringStateIsAnyRequested | -- FeedbackVector::kFlagsMaybeHasTurbofanCode | -- FeedbackVector::kFlagsLogNextExecution; -- if (current_code_kind != CodeKind::MAGLEV) { -- kFlagsMask |= FeedbackVector::kFlagsMaybeHasMaglevCode; -- } -- And(result, flags, Operand(kFlagsMask)); -- return ne; --} -- -+#ifndef V8_ENABLE_LEAPTIERING - // Read off the flags in the feedback vector and check if there - // is optimized code or a tiering state that needs to be processed. - void MacroAssembler::LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( -@@ -248,22 +231,6 @@ void MacroAssembler::OptimizeCodeOrTailCallOptimizedCodeSlot( - Register flags, Register feedback_vector) { - ASM_CODE_COMMENT(this); - DCHECK(!AreAliased(flags, feedback_vector)); --#ifdef V8_ENABLE_LEAPTIERING -- // In the leaptiering case, we don't load optimized code from the feedback -- // vector so only need to call CompileOptimized or FunctionLogNextExecution -- // here. See also LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing above. -- Label needs_logging; -- { -- UseScratchRegisterScope temps(this); -- Register scratch = temps.Acquire(); -- And(scratch, flags, -- Operand(FeedbackVector::kFlagsTieringStateIsAnyRequested)); -- Branch(&needs_logging, eq, scratch, Operand(zero_reg)); -- } -- GenerateTailCallToReturnedCode(Runtime::kCompileOptimized); -- bind(&needs_logging); -- GenerateTailCallToReturnedCode(Runtime::kFunctionLogNextExecution); --#else - UseScratchRegisterScope temps(this); - temps.Include(t0, t1); - Label maybe_has_optimized_code, maybe_needs_logging; -@@ -296,8 +263,8 @@ void MacroAssembler::OptimizeCodeOrTailCallOptimizedCodeSlot( - FeedbackVector::kMaybeOptimizedCodeOffset)); - TailCallOptimizedCodeSlot(this, optimized_code_entry, temps.Acquire(), - temps.Acquire()); --#endif // V8_ENABLE_LEAPTIERING - } -+#endif // V8_ENABLE_LEAPTIERING - - void MacroAssembler::LoadIsolateField(const Register& rd, IsolateFieldId id) { - li(rd, ExternalReference::Create(id)); -@@ -5630,7 +5597,7 @@ void MacroAssembler::StackOverflowCheck(Register num_args, Register scratch1, - - void MacroAssembler::InvokePrologue(Register expected_parameter_count, - Register actual_parameter_count, -- Label* done, InvokeType type) { -+ InvokeType type) { - Label regular_invoke; - - // a0: actual arguments count -@@ -5649,8 +5616,7 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count, - Label stack_overflow; - { - UseScratchRegisterScope temps(this); -- StackOverflowCheck(expected_parameter_count, temps.Acquire(), -- temps.Acquire(), &stack_overflow); -+ StackOverflowCheck(expected_parameter_count, t0, t1, &stack_overflow); - } - // Underapplication. Move the arguments already in the stack, including the - // receiver and the return address. -@@ -5694,90 +5660,150 @@ void MacroAssembler::InvokePrologue(Register expected_parameter_count, - bind(®ular_invoke); - } - --void MacroAssembler::CheckDebugHook(Register fun, Register new_target, -- Register expected_parameter_count, -- Register actual_parameter_count) { -- Label skip_hook; -- { -- UseScratchRegisterScope temps(this); -- Register scratch = temps.Acquire(); -- li(scratch, -- ExternalReference::debug_hook_on_function_call_address(isolate())); -- Lb(scratch, MemOperand(scratch)); -- Branch(&skip_hook, eq, scratch, Operand(zero_reg)); -+void MacroAssembler::CallDebugOnFunctionCall( -+ Register fun, Register new_target, -+ Register expected_parameter_count_or_dispatch_handle, -+ Register actual_parameter_count) { -+ ASM_CODE_COMMENT(this); -+ DCHECK(!AreAliased(t0, fun, new_target, -+ expected_parameter_count_or_dispatch_handle, -+ actual_parameter_count)); -+ -+ // Load receiver to pass it later to DebugOnFunctionCall hook. -+ LoadReceiver(t0); -+ FrameScope frame( -+ this, has_frame() ? StackFrame::NO_FRAME_TYPE : StackFrame::INTERNAL); -+ -+ SmiTag(expected_parameter_count_or_dispatch_handle); -+ SmiTag(actual_parameter_count); -+ Push(expected_parameter_count_or_dispatch_handle, actual_parameter_count); -+ -+ if (new_target.is_valid()) { -+ Push(new_target); -+ } -+ Push(fun, fun, t0); -+ CallRuntime(Runtime::kDebugOnFunctionCall); -+ Pop(fun); -+ if (new_target.is_valid()) { -+ Pop(new_target); - } -- { -- // Load receiver to pass it later to DebugOnFunctionCall hook. -- UseScratchRegisterScope temps(this); -- Register receiver = temps.Acquire(); -- LoadReceiver(receiver); - -- FrameScope frame( -- this, has_frame() ? StackFrame::NO_FRAME_TYPE : StackFrame::INTERNAL); -- SmiTag(expected_parameter_count); -- Push(expected_parameter_count); -+ Pop(expected_parameter_count_or_dispatch_handle, actual_parameter_count); -+ SmiUntag(actual_parameter_count); -+ SmiUntag(expected_parameter_count_or_dispatch_handle); -+} - -- SmiTag(actual_parameter_count); -- Push(actual_parameter_count); -+#ifdef V8_ENABLE_LEAPTIERING -+void MacroAssembler::InvokeFunction( -+ Register function, Register actual_parameter_count, InvokeType type, -+ ArgumentAdaptionMode argument_adaption_mode) { -+ ASM_CODE_COMMENT(this); -+ // You can't call a function without a valid frame. -+ DCHECK(type == InvokeType::kJump || has_frame()); - -- if (new_target.is_valid()) { -- Push(new_target); -- } -- Push(fun); -- Push(fun); -- Push(receiver); -- CallRuntime(Runtime::kDebugOnFunctionCall); -- Pop(fun); -- if (new_target.is_valid()) { -- Pop(new_target); -- } -+ // Contract with called JS functions requires that function is passed in a1. -+ // (See FullCodeGenerator::Generate().) -+ DCHECK_EQ(function, a1); - -- Pop(actual_parameter_count); -- SmiUntag(actual_parameter_count); -+ // Set up the context. -+ LoadTaggedField(cp, FieldMemOperand(function, JSFunction::kContextOffset)); - -- Pop(expected_parameter_count); -- SmiUntag(expected_parameter_count); -- } -- bind(&skip_hook); -+ InvokeFunctionCode(function, no_reg, actual_parameter_count, type, -+ argument_adaption_mode); - } - --void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, -- Register expected_parameter_count, -- Register actual_parameter_count, -- InvokeType type) { -+void MacroAssembler::InvokeFunctionWithNewTarget( -+ Register function, Register new_target, Register actual_parameter_count, -+ InvokeType type) { -+ ASM_CODE_COMMENT(this); -+ // You can't call a function without a valid frame. -+ DCHECK(type == InvokeType::kJump || has_frame()); -+ -+ // Contract with called JS functions requires that function is passed in a1. -+ // (See FullCodeGenerator::Generate().) -+ DCHECK_EQ(function, a1); -+ -+ LoadTaggedField(cp, FieldMemOperand(function, JSFunction::kContextOffset)); -+ -+ InvokeFunctionCode(function, new_target, actual_parameter_count, type); -+} -+ -+void MacroAssembler::InvokeFunctionCode( -+ Register function, Register new_target, Register actual_parameter_count, -+ InvokeType type, ArgumentAdaptionMode argument_adaption_mode) { -+ ASM_CODE_COMMENT(this); - // You can't call a function without a valid frame. - DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); - DCHECK_EQ(function, a1); - DCHECK_IMPLIES(new_target.is_valid(), new_target == a3); - -+ Register dispatch_handle = kJavaScriptCallDispatchHandleRegister; -+ Lw(dispatch_handle, -+ FieldMemOperand(function, JSFunction::kDispatchHandleOffset)); -+ - // On function call, call into the debugger if necessary. -- CheckDebugHook(function, new_target, expected_parameter_count, -- actual_parameter_count); -+ Label debug_hook, continue_after_hook; -+ { -+ li(t0, ExternalReference::debug_hook_on_function_call_address(isolate())); -+ Lb(t0, MemOperand(t0, 0)); -+ BranchShort(&debug_hook, ne, t0, Operand(zero_reg)); -+ } -+ bind(&continue_after_hook); - - // Clear the new.target register if not given. - if (!new_target.is_valid()) { - LoadRoot(a3, RootIndex::kUndefinedValue); - } - -- Label done; -- InvokePrologue(expected_parameter_count, actual_parameter_count, &done, type); -+ Register scratch = s1; -+ if (argument_adaption_mode == ArgumentAdaptionMode::kAdapt) { -+ Register expected_parameter_count = a2; -+ LoadParameterCountFromJSDispatchTable(expected_parameter_count, -+ dispatch_handle, scratch); -+ InvokePrologue(expected_parameter_count, actual_parameter_count, type); -+ } -+ - // We call indirectly through the code field in the function to - // allow recompilation to take effect without changing any of the - // call sites. -- constexpr int unused_argument_count = 0; -+ LoadEntrypointFromJSDispatchTable(kJavaScriptCallCodeStartRegister, -+ dispatch_handle, scratch); - switch (type) { - case InvokeType::kCall: -- CallJSFunction(function, unused_argument_count); -+ Call(kJavaScriptCallCodeStartRegister); - break; - case InvokeType::kJump: -- JumpJSFunction(function); -+ Jump(kJavaScriptCallCodeStartRegister); - break; - } -+ Label done; -+ Branch(&done); -+ -+ // Deferred debug hook. -+ bind(&debug_hook); -+ CallDebugOnFunctionCall(function, new_target, dispatch_handle, -+ actual_parameter_count); -+ Branch(&continue_after_hook); - -- // Continue here if InvokePrologue does handle the invocation due to -- // mismatched parameter counts. - bind(&done); - } -+#else // !V8_ENABLE_LEAPTIERING -+void MacroAssembler::InvokeFunction(Register function, -+ Register expected_parameter_count, -+ Register actual_parameter_count, -+ InvokeType type) { -+ // You can't call a function without a valid frame. -+ DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); -+ -+ // Contract with called JS functions requires that function is passed in a1. -+ DCHECK_EQ(function, a1); -+ -+ // Get the function and setup the context. -+ LoadTaggedField(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); -+ -+ InvokeFunctionCode(a1, no_reg, expected_parameter_count, -+ actual_parameter_count, type); -+} - - void MacroAssembler::InvokeFunctionWithNewTarget( - Register function, Register new_target, Register actual_parameter_count, -@@ -5804,23 +5830,44 @@ void MacroAssembler::InvokeFunctionWithNewTarget( - actual_parameter_count, type); - } - --void MacroAssembler::InvokeFunction(Register function, -- Register expected_parameter_count, -- Register actual_parameter_count, -- InvokeType type) { -+void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, -+ Register expected_parameter_count, -+ Register actual_parameter_count, -+ InvokeType type) { - // You can't call a function without a valid frame. - DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); -- -- // Contract with called JS functions requires that function is passed in a1. - DCHECK_EQ(function, a1); -+ DCHECK_IMPLIES(new_target.is_valid(), new_target == a3); - -- // Get the function and setup the context. -- LoadTaggedField(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); -+ // On function call, call into the debugger if necessary. -+ CheckDebugHook(function, new_target, expected_parameter_count, -+ actual_parameter_count); - -- InvokeFunctionCode(a1, no_reg, expected_parameter_count, -- actual_parameter_count, type); --} -+ // Clear the new.target register if not given. -+ if (!new_target.is_valid()) { -+ LoadRoot(a3, RootIndex::kUndefinedValue); -+ } -+ -+ Label done; -+ InvokePrologue(expected_parameter_count, actual_parameter_count, &done, type); -+ // We call indirectly through the code field in the function to -+ // allow recompilation to take effect without changing any of the -+ // call sites. -+ constexpr int unused_argument_count = 0; -+ switch (type) { -+ case InvokeType::kCall: -+ CallJSFunction(function, unused_argument_count); -+ break; -+ case InvokeType::kJump: -+ JumpJSFunction(function); -+ break; -+ } - -+ // Continue here if InvokePrologue does handle the invocation due to -+ // mismatched parameter counts. -+ bind(&done); -+} -+#endif // V8_ENABLE_LEAPTIERING - // --------------------------------------------------------------------------- - // Support functions. - -@@ -7240,14 +7287,30 @@ void MacroAssembler::ComputeCodeStartAddress(Register dst) { - // 2. test kMarkedForDeoptimizationBit in those flags; and - // 3. if it is not zero then it jumps to the builtin. - void MacroAssembler::BailoutIfDeoptimized() { -- int offset = InstructionStream::kCodeOffset - InstructionStream::kHeaderSize; -- LoadProtectedPointerField( -- kScratchReg, MemOperand(kJavaScriptCallCodeStartRegister, offset)); -- Lw(kScratchReg, FieldMemOperand(kScratchReg, Code::kFlagsOffset)); -- And(kScratchReg, kScratchReg, -- Operand(1 << Code::kMarkedForDeoptimizationBit)); -- TailCallBuiltin(Builtin::kCompileLazyDeoptimizedCode, ne, kScratchReg, -+ ASM_CODE_COMMENT(this); -+ UseScratchRegisterScope temps(this); -+ Register scratch = temps.Acquire(); -+ if (v8_flags.debug_code || !V8_ENABLE_LEAPTIERING_BOOL) { -+ int offset = -+ InstructionStream::kCodeOffset - InstructionStream::kHeaderSize; -+ LoadProtectedPointerField( -+ scratch, MemOperand(kJavaScriptCallCodeStartRegister, offset)); -+ Lw(scratch, FieldMemOperand(scratch, Code::kFlagsOffset)); -+ } -+ -+#ifdef V8_ENABLE_LEAPTIERING -+ if (v8_flags.debug_code) { -+ Label not_deoptimized; -+ And(scratch, scratch, Operand(1 << Code::kMarkedForDeoptimizationBit)); -+ Branch(¬_deoptimized, eq, scratch, Operand(zero_reg)); -+ Abort(AbortReason::kInvalidDeoptimizedCode); -+ bind(¬_deoptimized); -+ } -+#else -+ And(scratch, scratch, Operand(1 << Code::kMarkedForDeoptimizationBit)); -+ TailCallBuiltin(Builtin::kCompileLazyDeoptimizedCode, ne, scratch, - Operand(zero_reg)); -+#endif - } - - void MacroAssembler::CallForDeoptimization(Builtin target, int, Label* exit, -@@ -7303,22 +7366,20 @@ void MacroAssembler::JumpCodeObject(Register code_object, CodeEntrypointTag tag, - } - - void MacroAssembler::CallJSFunction(Register function_object, -- uint16_t argument_count) { -- DCHECK_WITH_MSG(!V8_ENABLE_LEAPTIERING_BOOL, -- "argument_count is only used with Leaptiering"); -+ [[maybe_unused]] uint16_t argument_count) { - ASM_CODE_COMMENT(this); - Register code = kJavaScriptCallCodeStartRegister; - #ifdef V8_ENABLE_LEAPTIERING -- UseScratchRegisterScope temps(this); -- Register dispatch_handle = t0; -+ Register dispatch_handle = kJavaScriptCallDispatchHandleRegister; - Register parameter_count = t1; -+ UseScratchRegisterScope temps(this); - Register scratch = temps.Acquire(); - Lw(dispatch_handle, - FieldMemOperand(function_object, JSFunction::kDispatchHandleOffset)); - LoadEntrypointAndParameterCountFromJSDispatchTable(code, parameter_count, - dispatch_handle, scratch); - Label match; -- Branch(&match, le, parameter_count, Immediate(argument_count)); -+ Branch(&match, le, parameter_count, Operand(argument_count)); - // If the parameter count doesn't match, we force a safe crash by setting the - // code entrypoint to zero, causing a nullptr dereference during the call. - mv(code, zero_reg); -@@ -7366,13 +7427,14 @@ void MacroAssembler::JumpJSFunction(Register function_object, - ASM_CODE_COMMENT(this); - Register code = kJavaScriptCallCodeStartRegister; - #ifdef V8_ENABLE_LEAPTIERING -- LoadCodeEntrypointFromJSDispatchTable( -- code, -- FieldMemOperand(function_object, JSFunction::kDispatchHandleOffset)); -+ Register dispatch_handle = kJavaScriptCallDispatchHandleRegister; -+ UseScratchRegisterScope temps(this); -+ Register scratch = temps.Acquire(); -+ Lw(dispatch_handle, -+ FieldMemOperand(function_object, JSFunction::kDispatchHandleOffset)); -+ LoadEntrypointFromJSDispatchTable(code, dispatch_handle, scratch); - DCHECK_EQ(jump_mode, JumpMode::kJump); -- DCHECK_NE(code, t6); -- mv(t6, code); -- Jump(t6); -+ Jump(code); - #elif V8_ENABLE_SANDBOX - // When the sandbox is enabled, we can directly fetch the entrypoint pointer - // from the code pointer table instead of going through the Code object. In -@@ -7465,11 +7527,13 @@ void MacroAssembler::LoadEntrypointFromJSDispatchTable(Register destination, - Register scratch) { - DCHECK(!AreAliased(destination, scratch)); - ASM_CODE_COMMENT(this); -+ Register index = destination; - li(scratch, ExternalReference::js_dispatch_table_address()); - srli(index, dispatch_handle, kJSDispatchHandleShift); - slli(index, index, kJSDispatchTableEntrySizeLog2); - AddWord(scratch, scratch, index); -- Ld(destination, MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); -+ LoadWord(destination, -+ MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); - } - - void MacroAssembler::LoadEntrypointFromJSDispatchTable( -@@ -7486,7 +7550,7 @@ void MacroAssembler::LoadEntrypointFromJSDispatchTable( - static_assert(!JSDispatchTable::kSupportsCompaction); - int offset = JSDispatchTable::OffsetOfEntry(dispatch_handle) + - JSDispatchEntry::kEntrypointOffset; -- Ld(destination, MemOperand(scratch, offset)); -+ LoadWord(destination, MemOperand(scratch, offset)); - } - - void MacroAssembler::LoadParameterCountFromJSDispatchTable( -@@ -7494,12 +7558,14 @@ void MacroAssembler::LoadParameterCountFromJSDispatchTable( - DCHECK(!AreAliased(destination, scratch)); - ASM_CODE_COMMENT(this); - Register index = destination; -- li(scratch, ExternalReference::js_dispatch_table_address()); - srli(index, dispatch_handle, kJSDispatchHandleShift); - slli(index, index, kJSDispatchTableEntrySizeLog2); -+ li(scratch, ExternalReference::js_dispatch_table_address()); - AddWord(scratch, scratch, index); -+#ifdef V8_TARGET_ARCH_64_BIT - static_assert(JSDispatchEntry::kParameterCountMask == 0xffff); -- Lh(destination, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); -+#endif -+ Lhu(destination, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); - } - - void MacroAssembler::LoadEntrypointAndParameterCountFromJSDispatchTable( -@@ -7512,10 +7578,11 @@ void MacroAssembler::LoadEntrypointAndParameterCountFromJSDispatchTable( - srli(index, dispatch_handle, kJSDispatchHandleShift); - slli(index, index, kJSDispatchTableEntrySizeLog2); - AddWord(scratch, scratch, index); -- -- Ld(entrypoint, MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); -+ LoadWord(entrypoint, MemOperand(scratch, JSDispatchEntry::kEntrypointOffset)); -+#ifdef V8_TARGET_ARCH_64_BIT - static_assert(JSDispatchEntry::kParameterCountMask == 0xffff); -- Lh(parameter_count, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); -+#endif -+ Lhu(parameter_count, MemOperand(scratch, JSDispatchEntry::kCodeObjectOffset)); - } - #endif - -diff --git a/src/codegen/riscv/macro-assembler-riscv.h b/src/codegen/riscv/macro-assembler-riscv.h -index 12988bdf00c6..ca91407d21f0 100644 ---- a/v8/src/codegen/riscv/macro-assembler-riscv.h -+++ b/v8/src/codegen/riscv/macro-assembler-riscv.h -@@ -1600,23 +1600,47 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { - // ------------------------------------------------------------------------- - // JavaScript invokes. - -- // Invoke the JavaScript function code by either calling or jumping. -- void InvokeFunctionCode(Register function, Register new_target, -- Register expected_parameter_count, -- Register actual_parameter_count, InvokeType type); -+ // On function call, call into the debugger. -+ void CallDebugOnFunctionCall( -+ Register fun, Register new_target, -+ Register expected_parameter_count_or_dispatch_handle, -+ Register actual_parameter_count); - -- // On function call, call into the debugger if necessary. -- void CheckDebugHook(Register fun, Register new_target, -- Register expected_parameter_count, -- Register actual_parameter_count); -+ // The way we invoke JSFunctions differs depending on whether leaptiering is -+ // enabled. As such, these functions exist in two variants. In the future, -+ // leaptiering will be used on all platforms. At that point, the -+ // non-leaptiering variants will disappear. - -+#ifdef V8_ENABLE_LEAPTIERING - // Invoke the JavaScript function in the given register. Changes the - // current context to the context in the function before invoking. -+ void InvokeFunction(Register function, Register actual_parameter_count, -+ InvokeType type, -+ ArgumentAdaptionMode argument_adaption_mode = -+ ArgumentAdaptionMode::kAdapt); -+ // Invoke the JavaScript function in the given register. -+ // Changes the current context to the context in the function before invoking. - void InvokeFunctionWithNewTarget(Register function, Register new_target, - Register actual_parameter_count, - InvokeType type); -+ // Invoke the JavaScript function code by either calling or jumping. -+ void InvokeFunctionCode(Register function, Register new_target, -+ Register actual_parameter_count, InvokeType type, -+ ArgumentAdaptionMode argument_adaption_mode = -+ ArgumentAdaptionMode::kAdapt); -+#else - void InvokeFunction(Register function, Register expected_parameter_count, - Register actual_parameter_count, InvokeType type); -+ // Invoke the JavaScript function in the given register. Changes the -+ // current context to the context in the function before invoking. -+ void InvokeFunctionWithNewTarget(Register function, Register new_target, -+ Register actual_parameter_count, -+ InvokeType type); -+ // Invoke the JavaScript function code by either calling or jumping. -+ void InvokeFunctionCode(Register function, Register new_target, -+ Register expected_parameter_count, -+ Register actual_parameter_count, InvokeType type); -+#endif - - // ---- InstructionStream generation helpers ---- - -@@ -1657,14 +1681,13 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { - Register closure); - void GenerateTailCallToReturnedCode(Runtime::FunctionId function_id); - -- Condition LoadFeedbackVectorFlagsAndCheckIfNeedsProcessing( -- Register flags, Register feedback_vector, Register result, -- CodeKind current_code_kind); -+#ifndef V8_ENABLE_LEAPTIERING - void LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing( - Register flags, Register feedback_vector, CodeKind current_code_kind, - Label* flags_need_processing); - void OptimizeCodeOrTailCallOptimizedCodeSlot(Register flags, - Register feedback_vector); -+#endif - - // ------------------------------------------------------------------------- - // Support functions. -@@ -1883,8 +1906,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : public MacroAssemblerBase { - - // Helper functions for generating invokes. - void InvokePrologue(Register expected_parameter_count, -- Register actual_parameter_count, Label* done, -- InvokeType type); -+ Register actual_parameter_count, InvokeType type); - - // Compute memory operands for safepoint stack slots. - static int SafepointRegisterStackIndex(int reg_code); -diff --git a/src/codegen/riscv/register-riscv.h b/src/codegen/riscv/register-riscv.h -index ddf2f879d495..67321defed53 100644 ---- a/v8/src/codegen/riscv/register-riscv.h -+++ b/v8/src/codegen/riscv/register-riscv.h -@@ -301,8 +301,7 @@ constexpr Register kJavaScriptCallCodeStartRegister = a2; - constexpr Register kJavaScriptCallTargetRegister = kJSFunctionRegister; - constexpr Register kJavaScriptCallNewTargetRegister = a3; - constexpr Register kJavaScriptCallExtraArg1Register = a2; --// Leaptiering is not currently available on riscv64. --constexpr Register kJavaScriptCallDispatchHandleRegister = no_reg; -+constexpr Register kJavaScriptCallDispatchHandleRegister = a4; - - constexpr Register kRuntimeCallFunctionRegister = a1; - constexpr Register kRuntimeCallArgCountRegister = a0; -diff --git a/src/compiler/backend/riscv/code-generator-riscv.cc b/src/compiler/backend/riscv/code-generator-riscv.cc -index 744123ebb283..678d661e58fc 100644 ---- a/v8/src/compiler/backend/riscv/code-generator-riscv.cc -+++ b/v8/src/compiler/backend/riscv/code-generator-riscv.cc -@@ -706,6 +706,36 @@ void CodeGenerator::AssembleCodeStartRegisterCheck() { - kJavaScriptCallCodeStartRegister, Operand(kScratchReg)); - } - -+#ifdef V8_ENABLE_LEAPTIERING -+// Check that {kJavaScriptCallDispatchHandleRegister} is correct. -+void CodeGenerator::AssembleDispatchHandleRegisterCheck() { -+ DCHECK(linkage()->GetIncomingDescriptor()->IsJSFunctionCall()); -+ -+ // We currently don't check this for JS builtins as those are sometimes -+ // called directly (e.g. from other builtins) and not through the dispatch -+ // table. This is fine as builtin functions don't use the dispatch handle, -+ // but we could enable this check in the future if we make sure to pass the -+ // kInvalidDispatchHandle whenever we do a direct call to a JS builtin. -+ if (Builtins::IsBuiltinId(info()->builtin())) { -+ return; -+ } -+ -+ // For now, we only ensure that the register references a valid dispatch -+ // entry with the correct parameter count. In the future, we may also be able -+ // to check that the entry points back to this code. -+ UseScratchRegisterScope temps(masm()); -+ Register actual_parameter_count = temps.Acquire(); -+ { -+ UseScratchRegisterScope temps(masm()); -+ Register scratch = temps.Acquire(); -+ __ LoadParameterCountFromJSDispatchTable( -+ actual_parameter_count, kJavaScriptCallDispatchHandleRegister, scratch); -+ } -+ __ Assert(eq, AbortReason::kWrongFunctionDispatchHandle, -+ actual_parameter_count, Operand(parameter_count_)); -+} -+#endif // V8_ENABLE_LEAPTIERING -+ - // Check if the code object is marked for deoptimization. If it is, then it - // jumps to the CompileLazyDeoptimizedCode builtin. In order to do this we need - // to: -@@ -713,16 +743,7 @@ void CodeGenerator::AssembleCodeStartRegisterCheck() { - // the flags in the referenced {Code} object; - // 2. test kMarkedForDeoptimizationBit in those flags; and - // 3. if it is not zero then it jumps to the builtin. --void CodeGenerator::BailoutIfDeoptimized() { -- int offset = InstructionStream::kCodeOffset - InstructionStream::kHeaderSize; -- __ LoadProtectedPointerField( -- kScratchReg, MemOperand(kJavaScriptCallCodeStartRegister, offset)); -- __ Lw(kScratchReg, FieldMemOperand(kScratchReg, Code::kFlagsOffset)); -- __ And(kScratchReg, kScratchReg, -- Operand(1 << Code::kMarkedForDeoptimizationBit)); -- __ TailCallBuiltin(Builtin::kCompileLazyDeoptimizedCode, ne, kScratchReg, -- Operand(zero_reg)); --} -+void CodeGenerator::BailoutIfDeoptimized() { __ BailoutIfDeoptimized(); } - - // Assembles an instruction after register allocation, producing machine code. - CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( -diff --git a/src/maglev/riscv/maglev-assembler-riscv.cc b/src/maglev/riscv/maglev-assembler-riscv.cc -index 9611e33d6b01..8fb87746e697 100644 ---- a/v8/src/maglev/riscv/maglev-assembler-riscv.cc -+++ b/v8/src/maglev/riscv/maglev-assembler-riscv.cc -@@ -127,6 +127,7 @@ void MaglevAssembler::OSRPrologue(Graph* graph) { - } - - void MaglevAssembler::Prologue(Graph* graph) { -+ ASM_CODE_COMMENT(this); - MaglevAssembler::TemporaryRegisterScope temps(this); - // We add two extra registers to the scope. Ideally we could add all the - // allocatable general registers, except Context, JSFunction, NewTarget and -@@ -147,6 +148,7 @@ void MaglevAssembler::Prologue(Graph* graph) { - } - - // Tiering support. -+#ifndef V8_ENABLE_LEAPTIERING - if (v8_flags.turbofan) { - using D = MaglevOptimizeCodeOrTailCallOptimizedCodeSlotDescriptor; - Register flags = D::GetRegisterParameter(D::kFlags); -@@ -169,6 +171,7 @@ void MaglevAssembler::Prologue(Graph* graph) { - TailCallBuiltin(Builtin::kMaglevOptimizeCodeOrTailCallOptimizedCodeSlot, - needs_processing, flag_reg, Operand(zero_reg)); - } -+#endif - - EnterFrame(StackFrame::MAGLEV); - // Save arguments in frame. diff --git a/vtt_scanner-missing-variant.patch b/vtt_scanner-missing-variant.patch deleted file mode 100644 index 99e34a6..0000000 --- a/vtt_scanner-missing-variant.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 40c273b2c0f5f26e16e67428ceaafd8b339bb61f Mon Sep 17 00:00:00 2001 -From: Ivan Murashov -Date: Fri, 20 Sep 2024 08:03:22 +0000 -Subject: [PATCH] IWYU: Add missing include for std::variant usage in - vtt_scanner.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In the CLs https://crrev.com/c/5832540 and https://crrev.com/c/5842227 -used std::variant in the -third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h, but -corresponding include was missed. -Added missing include for std::variant usage. - -Bug: 41455655 -Change-Id: I90d07b12239f8d58e32c8011c710b6c7ea31fb5b -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872861 -Reviewed-by: Anders Hartvoll Ruud -Reviewed-by: Fredrik Söderquist -Commit-Queue: Anders Hartvoll Ruud -Cr-Commit-Position: refs/heads/main@{#1358046} ---- - third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h b/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h -index 78fc6657e38824..1b466bc9c5f8c3 100644 ---- a/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h -+++ b/third_party/blink/renderer/core/html/track/vtt/vtt_scanner.h -@@ -30,6 +30,8 @@ - #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_SCANNER_H_ - #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_TRACK_VTT_VTT_SCANNER_H_ - -+#include -+ - #include "base/check_op.h" - #include "third_party/blink/renderer/core/core_export.h" - #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" diff --git a/wayland-protocol-toplevel-drag.patch b/wayland-protocol-toplevel-drag.patch deleted file mode 100644 index e051ca4..0000000 --- a/wayland-protocol-toplevel-drag.patch +++ /dev/null @@ -1,434 +0,0 @@ -From 8f45d25c2f8f4849b66136b14734b79e2b4fe9c1 Mon Sep 17 00:00:00 2001 -From: Robert Mader -Date: Thu, 12 Sep 2024 19:11:15 +0000 -Subject: [PATCH] ozone/wayland: Add support for xdg-toplevel-drag - -Rebased and slighty updated version of https://chromium-review.googlesource.com/c/chromium/src/+/4400967 - -This implements a new protocol landed in wayland-protocols 1.34 that can -be found at -https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/xdg-toplevel-drag/xdg-toplevel-drag-v1.xml - -It is intended to be a drop-in replacement for extended-drag-unstable-v1 -with some features removed that were never implemented in Exo/Chromium. - -If both the `extended-drag` and `xdg-toplevel-drag` protocols are -supported by the compositor - i.e. in Exo - the former is kept being -used by default. The later can be enabled via the -`WaylandXdgToplevelDrag` feature. - -Original author: David Redondo - -Bug: b:315000518 -Bug: b:324170129 -Change-Id: If251ac9944ec4395f2d8630b7c4ac74ca56a662d -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5088752 -Reviewed-by: Thomas Anderson -Reviewed-by: Antonio Gomes -Commit-Queue: Nick Yamane -Reviewed-by: Nick Yamane -Cr-Commit-Position: refs/heads/main@{#1354718} ---- - AUTHORS | 1 + - ui/ozone/common/features.cc | 16 ++++ - ui/ozone/common/features.h | 1 + - ui/ozone/platform/wayland/BUILD.gn | 1 + - .../platform/wayland/common/wayland_object.cc | 3 + - .../platform/wayland/common/wayland_object.h | 2 + - .../wayland/host/wayland_connection.cc | 10 +++ - .../wayland/host/wayland_connection.h | 4 + - .../wayland/host/wayland_toplevel_window.cc | 13 +-- - .../host/wayland_window_drag_controller.cc | 85 ++++++++++++++++--- - .../host/wayland_window_drag_controller.h | 4 + - .../wayland/host/xdg_toplevel_wrapper_impl.h | 1 + - 12 files changed, 121 insertions(+), 20 deletions(-) - -diff --git a/AUTHORS b/AUTHORS -index 52d075125b8126..bd9327b5b477f2 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -337,6 +337,7 @@ David Leen - David Manouchehri - David McAllister - David Michael Barr -+David Redondo - David Sanders - David Spellman - David Valachovic -diff --git a/ui/ozone/common/features.cc b/ui/ozone/common/features.cc -index bd13d0e17f39a3..74ffde0cf5b85c 100644 ---- a/ui/ozone/common/features.cc -+++ b/ui/ozone/common/features.cc -@@ -37,6 +37,18 @@ BASE_FEATURE(kWaylandFractionalScaleV1, - #endif - ); - -+// Controls whether support for the xdg-toplevel-drag protocol should be -+// enabled. On Lacros it will then be used even if the Exo-only extended-drag -+// protocol is supported. -+BASE_FEATURE(kWaylandXdgToplevelDrag, -+ "WaylandXdgToplevelDrag", -+#if BUILDFLAG(IS_LINUX) -+ base::FEATURE_ENABLED_BY_DEFAULT -+#else -+ base::FEATURE_DISABLED_BY_DEFAULT -+#endif -+); -+ - // This debug/dev flag pretty-prints DRM modeset configuration logs for ease - // of reading. For more information, see: http://b/233006802 - BASE_FEATURE(kPrettyPrintDrmModesetConfigLogs, -@@ -62,6 +74,10 @@ bool IsWaylandFractionalScaleV1Enabled() { - return base::FeatureList::IsEnabled(kWaylandFractionalScaleV1); - } - -+bool IsWaylandXdgToplevelDragEnabled() { -+ return base::FeatureList::IsEnabled(kWaylandXdgToplevelDrag); -+} -+ - bool IsPrettyPrintDrmModesetConfigLogsEnabled() { - return base::FeatureList::IsEnabled(kPrettyPrintDrmModesetConfigLogs); - } -diff --git a/ui/ozone/common/features.h b/ui/ozone/common/features.h -index 5d4c3c42af9ca7..1f88055f8975bc 100644 ---- a/ui/ozone/common/features.h -+++ b/ui/ozone/common/features.h -@@ -18,6 +18,7 @@ BASE_DECLARE_FEATURE(kUseDynamicCursorSize); - bool IsWaylandSurfaceSubmissionInPixelCoordinatesEnabled(); - bool IsWaylandOverlayDelegationEnabled(); - bool IsWaylandFractionalScaleV1Enabled(); -+bool IsWaylandXdgToplevelDragEnabled(); - bool IsPrettyPrintDrmModesetConfigLogsEnabled(); - bool IsUseDynamicCursorSizeEnabled(); - -diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn -index 6d3ec34101498d..b87a7b5d2903f0 100644 ---- a/ui/ozone/platform/wayland/BUILD.gn -+++ b/ui/ozone/platform/wayland/BUILD.gn -@@ -294,6 +294,7 @@ source_set("wayland") { - "//third_party/wayland-protocols:xdg_foreign", - "//third_party/wayland-protocols:xdg_output_protocol", - "//third_party/wayland-protocols:xdg_shell_protocol", -+ "//third_party/wayland-protocols:xdg_toplevel_drag_protocol", - "//third_party/wayland-protocols:xdg_toplevel_icon_protocol", - "//ui/base", - "//ui/base:buildflags", -diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc -index e30367a19d7774..1534a735855dd3 100644 ---- a/ui/ozone/platform/wayland/common/wayland_object.cc -+++ b/ui/ozone/platform/wayland/common/wayland_object.cc -@@ -44,6 +44,7 @@ - #include - #include - #include -+#include - #include - - #include "base/logging.h" -@@ -257,6 +258,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_popup) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_positioner) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_surface) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel) -+IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_v1) -+IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_manager_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_wm_base) -diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h -index 38213eff64de40..b279424d14784d 100644 ---- a/ui/ozone/platform/wayland/common/wayland_object.h -+++ b/ui/ozone/platform/wayland/common/wayland_object.h -@@ -156,6 +156,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(xdg_popup) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_positioner) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_surface) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel) -+DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_v1) -+DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_drag_manager_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_wm_base) -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc -index a1584eb682adf3..e595f500758492 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.cc -+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc -@@ -91,6 +91,7 @@ constexpr uint32_t kMaxExplicitSyncVersion = 2; - constexpr uint32_t kMaxAlphaCompositingVersion = 1; - constexpr uint32_t kMaxXdgDecorationVersion = 1; - constexpr uint32_t kMaxExtendedDragVersion = 1; -+constexpr uint32_t kMaxXdgToplevelDragVersion = 1; - constexpr uint32_t kMaxXdgOutputManagerVersion = 3; - constexpr uint32_t kMaxKeyboardShortcutsInhibitManagerVersion = 1; - constexpr uint32_t kMaxStylusVersion = 2; -@@ -745,6 +746,15 @@ void WaylandConnection::HandleGlobal(wl_registry* registry, - LOG(ERROR) << "Failed to bind to zcr_extended_drag_v1 global"; - return; - } -+ } else if (!xdg_toplevel_drag_manager_v1_ && -+ strcmp(interface, "xdg_toplevel_drag_manager_v1") == 0 && -+ IsWaylandXdgToplevelDragEnabled()) { -+ xdg_toplevel_drag_manager_v1_ = wl::Bind<::xdg_toplevel_drag_manager_v1>( -+ registry, name, std::min(version, kMaxXdgToplevelDragVersion)); -+ if (!xdg_toplevel_drag_manager_v1_) { -+ LOG(ERROR) << "Failed to bind to xdg_toplevel_drag_manager_v1 global"; -+ return; -+ } - } else if (!xdg_output_manager_ && - strcmp(interface, "zxdg_output_manager_v1") == 0) { - // Responsibilities of zxdg_output_manager_v1 have been subsumed into the -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h -index b4633ad03c4508..79680db7189852 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection.h -@@ -160,6 +160,9 @@ class WaylandConnection { - zcr_extended_drag_v1* extended_drag_v1() const { - return extended_drag_v1_.get(); - } -+ xdg_toplevel_drag_manager_v1* xdg_toplevel_drag_manager_v1() const { -+ return xdg_toplevel_drag_manager_v1_.get(); -+ } - - zxdg_output_manager_v1* xdg_output_manager_v1() const { - return xdg_output_manager_.get(); -@@ -500,6 +503,7 @@ class WaylandConnection { - linux_explicit_synchronization_; - wl::Object xdg_decoration_manager_; - wl::Object extended_drag_v1_; -+ wl::Object<::xdg_toplevel_drag_manager_v1> xdg_toplevel_drag_manager_v1_; - wl::Object xdg_output_manager_; - wl::Object fractional_scale_manager_v1_; - wl::Object toplevel_icon_manager_v1_; -diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -index 204e65c90ec374..5af9efc0d8acbf 100644 ---- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -+++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -@@ -858,7 +858,8 @@ void WaylandToplevelWindow::HideTooltip() { - bool WaylandToplevelWindow::IsClientControlledWindowMovementSupported() const { - auto* window_drag_controller = connection()->window_drag_controller(); - DCHECK(window_drag_controller); -- return window_drag_controller->IsExtendedDragAvailable(); -+ return window_drag_controller->IsExtendedDragAvailable() || -+ window_drag_controller->IsXdgToplevelDragAvailable(); - } - - bool WaylandToplevelWindow::ShouldReleaseCaptureForDrag( -@@ -882,11 +883,11 @@ void WaylandToplevelWindow::StartWindowDraggingSessionIfNeeded( - ui::mojom::DragEventSource event_source, - bool allow_system_drag) { - DCHECK(connection()->window_drag_controller()); -- // If extended drag is not available and |allow_system_drag| is set, this is -- // no-op and WaylandDataDragController is assumed to be used instead. i.e: -- // Fallback to a simpler window drag UX based on regular system drag-and-drop. -- if (!connection()->window_drag_controller()->IsExtendedDragAvailable() && -- allow_system_drag) { -+ // If extended-drag and xdg-toplevel-drag are not available and -+ // |allow_system_drag| is set, this is no-op and WaylandDataDragController is -+ // assumed to be used instead. i.e: Fallback to a simpler window drag UX based -+ // on regular system drag-and-drop. -+ if (!IsClientControlledWindowMovementSupported() && allow_system_drag) { - return; - } - connection()->window_drag_controller()->StartDragSession(this, event_source); -diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -index 2e95a32417a4c1..6184684e308154 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -@@ -6,6 +6,7 @@ - - #include - #include -+#include - - #include - #include -@@ -36,8 +37,10 @@ - #include "ui/gfx/geometry/point_conversions.h" - #include "ui/gfx/geometry/point_f.h" - #include "ui/gfx/geometry/vector2d.h" -+#include "ui/ozone/common/features.h" - #include "ui/ozone/platform/wayland/common/wayland_object.h" - #include "ui/ozone/platform/wayland/host/dump_util.h" -+#include "ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h" - #include "ui/ozone/platform/wayland/host/wayland_connection.h" - #include "ui/ozone/platform/wayland/host/wayland_cursor_position.h" - #include "ui/ozone/platform/wayland/host/wayland_data_device_manager.h" -@@ -51,6 +54,7 @@ - #include "ui/ozone/platform/wayland/host/wayland_surface.h" - #include "ui/ozone/platform/wayland/host/wayland_window.h" - #include "ui/ozone/platform/wayland/host/wayland_window_manager.h" -+#include "ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h" - #include "ui/platform_window/platform_window_init_properties.h" - - namespace ui { -@@ -101,6 +105,39 @@ class WaylandWindowDragController::ExtendedDragSource { - const raw_ref connection_; - }; - -+class WaylandWindowDragController::XdgToplevelDrag { -+ public: -+ XdgToplevelDrag(WaylandConnection& connection, wl_data_source* source) -+ : connection_(connection) { -+ DCHECK(connection.xdg_toplevel_drag_manager_v1()); -+ drag_.reset(xdg_toplevel_drag_manager_v1_get_xdg_toplevel_drag( -+ connection.xdg_toplevel_drag_manager_v1(), source)); -+ DCHECK(drag_); -+ } -+ -+ void SetDraggedWindow(WaylandToplevelWindow* window, -+ const gfx::Vector2d& offset) { -+ if (!window) { -+ // Detaching happens implicitly via wl_data_source.dnd_drop_performed (see -+ // OnDataSourceDropPerformed()) or when the toplevel gets unmapped. -+ return; -+ } -+ DCHECK(window->shell_toplevel() && -+ window->shell_toplevel()->AsXDGToplevelWrapper()); -+ -+ auto* toplevel = -+ window->shell_toplevel()->AsXDGToplevelWrapper()->xdg_toplevel_.get(); -+ DCHECK(toplevel); -+ -+ xdg_toplevel_drag_v1_attach(drag_.get(), toplevel, offset.x(), offset.y()); -+ connection_->Flush(); -+ } -+ -+ private: -+ wl::Object drag_; -+ const raw_ref connection_; -+}; -+ - WaylandWindowDragController::WaylandWindowDragController( - WaylandConnection* connection, - WaylandDataDeviceManager* device_manager, -@@ -165,12 +202,16 @@ bool WaylandWindowDragController::StartDragSession( - data_source_->Offer({kMimeTypeChromiumWindow}); - data_source_->SetDndActions(kDndActionWindowDrag); - -- if (IsExtendedDragAvailableInternal()) { -+ if (IsXdgToplevelDragAvailable()) { -+ xdg_toplevel_drag_ = std::make_unique( -+ *connection_, data_source_->data_source()); -+ } else if (IsExtendedDragAvailableInternal()) { - extended_drag_source_ = std::make_unique( - *connection_, data_source_->data_source()); - } else { -- LOG(ERROR) << "zcr_extended_drag_v1 extension not available! " -- << "Window/Tab dragging won't be fully functional."; -+ LOG(ERROR) -+ << "zcr_extended_drag_v1 and xdg_toplevel_drag_v1 extensions " -+ "not available! Window/Tab dragging won't be fully functional."; - } - - data_device_->StartDrag(*data_source_, *origin_window_, serial->value, -@@ -441,17 +482,24 @@ void WaylandWindowDragController::OnDataSourceFinish(WaylandDataSource* source, - data_offer_.reset(); - data_source_.reset(); - extended_drag_source_.reset(); -+ xdg_toplevel_drag_.reset(); - origin_surface_.reset(); - origin_window_ = nullptr; - has_received_enter_ = false; - -- // When extended-drag is available and the drop happens while a non-null -- // surface was being dragged (i.e: detached mode) which had pointer focus -- // before the drag session, we must reset focus to it, otherwise it would be -- // wrongly kept to the latest surface received through wl_data_device::enter -- // (see OnDragEnter function). -- // In case of touch, though, we simply reset the focus altogether. -- if (IsExtendedDragAvailableInternal() && dragged_window_) { -+ // When extended-drag or xdg-toplevel-drag is available and the drop happens -+ // while a non-null surface was being dragged (i.e: detached mode) which had -+ // pointer focus before the drag session, we must reset focus to it, otherwise -+ // it would be wrongly kept to the latest surface received through -+ // wl_data_device::enter (see OnDragEnter function). In case of touch, though, -+ // we simply reset the focus altogether. -+ // -+ // TODO(crbug.com/324170129): Move drop handling logic below into -+ // OnDataSourceDropPerformed instead, otherwise dropping outside target -+ // surfaces will results in drag cancellation when xdg-toplevel-drag is used. -+ bool is_protocol_available = -+ IsExtendedDragAvailableInternal() || IsXdgToplevelDragAvailable(); -+ if (is_protocol_available && dragged_window_) { - if (*drag_source_ == DragEventSource::kMouse) { - // TODO: check if this usage is correct. - -@@ -467,9 +515,11 @@ void WaylandWindowDragController::OnDataSourceFinish(WaylandDataSource* source, - // Transition to |kDropped| state and determine the next action to take. If - // drop happened while the move loop was running (i.e: kDetached), ask to quit - // the loop, otherwise notify session end and reset state right away. -+ is_protocol_available = -+ IsExtendedDragAvailable() || IsXdgToplevelDragAvailable(); - State state_when_dropped = std::exchange( -- state_, completed || !IsExtendedDragAvailable() ? State::kDropped -- : State::kCancelled); -+ state_, completed || !is_protocol_available ? State::kDropped -+ : State::kCancelled); - if (state_when_dropped == State::kDetached) { - VLOG(1) << "Quiting Loop : Detached"; - QuitLoop(); -@@ -673,9 +723,12 @@ void WaylandWindowDragController::SetDraggedWindow( - dragged_window_ = window; - drag_offset_ = offset; - -- // TODO(crbug.com/40598679): Fallback when extended-drag is not available. -- if (extended_drag_source_) -+ // TODO(crbug.com/40598679): Fallback when no window drag protocol available. -+ if (extended_drag_source_) { - extended_drag_source_->SetDraggedWindow(dragged_window_, drag_offset_); -+ } else if (xdg_toplevel_drag_) { -+ xdg_toplevel_drag_->SetDraggedWindow(dragged_window_, drag_offset_); -+ } - } - - bool WaylandWindowDragController::IsExtendedDragAvailable() const { -@@ -683,6 +736,10 @@ bool WaylandWindowDragController::IsExtendedDragAvailable() const { - IsExtendedDragAvailableInternal(); - } - -+bool WaylandWindowDragController::IsXdgToplevelDragAvailable() const { -+ return !!connection_->xdg_toplevel_drag_manager_v1(); -+} -+ - bool WaylandWindowDragController::IsActiveDragAndDropSession() const { - return !!data_source_; - } -diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h -index de94ea22590990..fe523b85a2b340 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h -+++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.h -@@ -88,6 +88,8 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, - - // Tells if "extended drag" extension is available. - bool IsExtendedDragAvailable() const; -+ // Tells if "xdg toplevel drag" extension is available. -+ bool IsXdgToplevelDragAvailable() const; - - // Returns true if there there is currently an active drag-and-drop session. - // This is true if the `data_source_` exists (the session ends when this is -@@ -118,6 +120,7 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, - - private: - class ExtendedDragSource; -+ class XdgToplevelDrag; - - friend class WaylandWindowDragControllerTest; - FRIEND_TEST_ALL_PREFIXES(WaylandWindowDragControllerTest, -@@ -204,6 +207,7 @@ class WaylandWindowDragController : public WaylandDataDevice::DragDelegate, - std::unique_ptr data_offer_; - - std::unique_ptr extended_drag_source_; -+ std::unique_ptr xdg_toplevel_drag_; - - // The current toplevel window being dragged, when in detached mode. - raw_ptr dragged_window_ = nullptr; -diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h -index f34cc782ffc82e..280efa771c3fe3 100644 ---- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h -+++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h -@@ -88,6 +88,7 @@ class XDGToplevelWrapperImpl : public ShellToplevelWrapper { - XDGSurfaceWrapperImpl* xdg_surface_wrapper() const; - - private: -+ friend class WaylandWindowDragController; - // xdg_toplevel_listener callbacks: - static void OnToplevelConfigure(void* data, - xdg_toplevel* toplevel, diff --git a/wayland-protocol-toplevel-icon-2.patch b/wayland-protocol-toplevel-icon-2.patch deleted file mode 100644 index aedf039..0000000 --- a/wayland-protocol-toplevel-icon-2.patch +++ /dev/null @@ -1,545 +0,0 @@ -From 900160bc0e224746bd4b7c30c63433dad66b95f6 Mon Sep 17 00:00:00 2001 -From: Tom Anderson -Date: Thu, 8 Aug 2024 07:28:26 +0000 -Subject: [PATCH] [Wayland] Implement setting icons with XDG toplevel icon - -Note that this is untested since no compositors currently support -the protocol, though there is a merge request for server support in -KWin and merge requests for client support in QT, and SDL, and merged -client support in GameScope. - -Once compositor support is added, this change can be tested by -installing the Youtube PWA and verifying that the icon changes -to the Youtube logo. - - -R=nickdiego - -Change-Id: I6135d72879ecc025c26e7c65b68eb557dd72e854 -Fixed: 356424077 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5755162 -Auto-Submit: Thomas Anderson -Code-Coverage: findit-for-me@appspot.gserviceaccount.com -Reviewed-by: Maksim Sisov -Commit-Queue: Maksim Sisov -Reviewed-by: Nick Yamane -Cr-Commit-Position: refs/heads/main@{#1338910} ---- - ui/ozone/platform/wayland/BUILD.gn | 4 + - .../wayland/host/shell_toplevel_wrapper.h | 3 + - .../wayland/host/wayland_toplevel_window.cc | 14 +++ - .../wayland/host/wayland_toplevel_window.h | 2 + - .../host/xdg_toplevel_icon_unittest.cc | 47 +++++++++ - .../wayland/host/xdg_toplevel_wrapper_impl.cc | 53 ++++++++++- - .../wayland/host/xdg_toplevel_wrapper_impl.h | 1 + - .../wayland/test/mock_xdg_toplevel_icon.cc | 95 +++++++++++++++++++ - .../wayland/test/mock_xdg_toplevel_icon.h | 79 +++++++++++++++ - .../test/test_wayland_server_thread.cc | 3 + - .../wayland/test/test_wayland_server_thread.h | 6 ++ - 11 files changed, 303 insertions(+), 4 deletions(-) - create mode 100644 ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc - create mode 100644 ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc - create mode 100644 ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h - -diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn -index 4ba36222f03906..4f22bf74dd8d34 100644 ---- a/ui/ozone/platform/wayland/BUILD.gn -+++ b/ui/ozone/platform/wayland/BUILD.gn -@@ -432,6 +432,8 @@ source_set("test_support") { - "test/mock_xdg_shell.h", - "test/mock_xdg_surface.cc", - "test/mock_xdg_surface.h", -+ "test/mock_xdg_toplevel_icon.cc", -+ "test/mock_xdg_toplevel_icon.h", - "test/mock_zcr_extended_text_input.cc", - "test/mock_zcr_extended_text_input.h", - "test/mock_zwp_linux_dmabuf.cc", -@@ -576,6 +578,7 @@ source_set("test_support") { - "//third_party/wayland-protocols:xdg_activation", - "//third_party/wayland-protocols:xdg_output_protocol", - "//third_party/wayland-protocols:xdg_shell_protocol", -+ "//third_party/wayland-protocols:xdg_toplevel_icon_protocol", - "//ui/display:test_support", - "//ui/gfx/geometry:geometry", - ] -@@ -608,6 +611,7 @@ source_set("wayland_unittests") { - "host/wayland_zcr_color_manager_unittest.cc", - "host/wayland_zwp_pointer_gestures_unittest.cc", - "host/xdg_activation_unittest.cc", -+ "host/xdg_toplevel_icon_unittest.cc", - "host/zwp_text_input_wrapper_v1_unittest.cc", - "host/zwp_text_input_wrapper_v3_unittest.cc", - "mojom/wayland_overlay_config_mojom_traits_unittest.cc", -diff --git a/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h b/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h -index 735a218e6b5667..63b68902a7addd 100644 ---- a/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h -+++ b/ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h -@@ -12,6 +12,7 @@ - #include "ui/platform_window/extensions/wayland_extension.h" - - namespace gfx { -+class ImageSkia; - class Rect; - class RoundedCornersF; - } -@@ -210,6 +211,8 @@ class ShellToplevelWrapper { - - virtual void AckRotateFocus(uint32_t serial, uint32_t handled) = 0; - -+ virtual void SetIcon(const gfx::ImageSkia& icon) = 0; -+ - // Casts `this` to XDGToplevelWrapperImpl, if it is of that type. - virtual XDGToplevelWrapperImpl* AsXDGToplevelWrapper(); - }; -diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -index 7ba2d52b575a21..204e65c90ec374 100644 ---- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -+++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -@@ -363,6 +363,20 @@ void WaylandToplevelWindow::Deactivate() { - WaylandWindow::Deactivate(); - } - -+void WaylandToplevelWindow::SetWindowIcons(const gfx::ImageSkia& window_icon, -+ const gfx::ImageSkia& app_icon) { -+ if (!shell_toplevel_) { -+ return; -+ } -+ // Let the app icon take precedence over the window icon. -+ if (!app_icon.isNull()) { -+ shell_toplevel_->SetIcon(app_icon); -+ } else { -+ shell_toplevel_->SetIcon(window_icon); -+ } -+ root_surface()->Commit(/*flush=*/true); -+} -+ - void WaylandToplevelWindow::SizeConstraintsChanged() { - // Size constraints only make sense for normal windows. - if (!shell_toplevel_) -diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h -index 40e16fef05f985..3491798f4c19da 100644 ---- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h -+++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h -@@ -126,6 +126,8 @@ class WaylandToplevelWindow : public WaylandWindow, - void Restore() override; - void Activate() override; - void Deactivate() override; -+ void SetWindowIcons(const gfx::ImageSkia& window_icon, -+ const gfx::ImageSkia& app_icon) override; - void SizeConstraintsChanged() override; - // `SetZOrderLevel()` must be called on `z_order_` in - // `SetUpShellIntegration()`. -diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc b/ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc -new file mode 100644 -index 00000000000000..bd91e0641a7395 ---- /dev/null -+++ b/ui/ozone/platform/wayland/host/xdg_toplevel_icon_unittest.cc -@@ -0,0 +1,47 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#include "ui/ozone/platform/wayland/test/wayland_test.h" -+ -+namespace ui { -+ -+using XdgToplevelIconTest = WaylandTestSimple; -+ -+TEST_F(XdgToplevelIconTest, Basic) { -+ SkBitmap bitmap; -+ bitmap.allocN32Pixels(128, 128); -+ gfx::ImageSkia icon = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); -+ window_->SetWindowIcons(gfx::ImageSkia(), icon); -+ -+ PostToServerAndWait([&](wl::TestWaylandServerThread* server) { -+ auto* const manager = server->xdg_toplevel_icon_manager_v1(); -+ ASSERT_TRUE(manager); -+ wl::XdgToplevelIconResources expected_resources = { -+ wl::XdgToplevelIconResource(gfx::Size(128, 128), 1)}; -+ EXPECT_EQ(manager->resources(), expected_resources); -+ }); -+} -+ -+TEST_F(XdgToplevelIconTest, AppIconTakesPrecedence) { -+ SkBitmap app_bitmap; -+ app_bitmap.allocN32Pixels(128, 128); -+ gfx::ImageSkia app_icon = gfx::ImageSkia::CreateFrom1xBitmap(app_bitmap); -+ -+ SkBitmap window_bitmap; -+ window_bitmap.allocN32Pixels(64, 64); -+ gfx::ImageSkia window_icon = -+ gfx::ImageSkia::CreateFrom1xBitmap(window_bitmap); -+ -+ window_->SetWindowIcons(window_icon, app_icon); -+ -+ PostToServerAndWait([&](wl::TestWaylandServerThread* server) { -+ auto* const manager = server->xdg_toplevel_icon_manager_v1(); -+ ASSERT_TRUE(manager); -+ wl::XdgToplevelIconResources expected_resources = { -+ wl::XdgToplevelIconResource(gfx::Size(128, 128), 1)}; -+ EXPECT_EQ(manager->resources(), expected_resources); -+ }); -+} -+ -+} // namespace ui -diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc -index 78a81356a5f01e..a716b337518f8c 100644 ---- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc -+++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc -@@ -6,6 +6,7 @@ - - #include - #include -+#include - - #include - -@@ -15,6 +16,7 @@ - #include "base/strings/utf_string_conversions.h" - #include "ui/base/hit_test.h" - #include "ui/base/ui_base_features.h" -+#include "ui/gfx/image/image_skia_rep_default.h" - #include "ui/ozone/common/features.h" - #include "ui/ozone/platform/wayland/common/wayland_object.h" - #include "ui/ozone/platform/wayland/common/wayland_util.h" -@@ -25,6 +27,7 @@ - #include "ui/ozone/platform/wayland/host/wayland_output_manager.h" - #include "ui/ozone/platform/wayland/host/wayland_seat.h" - #include "ui/ozone/platform/wayland/host/wayland_serial_tracker.h" -+#include "ui/ozone/platform/wayland/host/wayland_shm_buffer.h" - #include "ui/ozone/platform/wayland/host/wayland_toplevel_window.h" - #include "ui/ozone/platform/wayland/host/wayland_window.h" - #include "ui/ozone/platform/wayland/host/wayland_zaura_shell.h" -@@ -104,8 +107,9 @@ bool XDGToplevelWrapperImpl::Initialize() { - return false; - } - -- if (!xdg_surface_wrapper_) -+ if (!xdg_surface_wrapper_) { - return false; -+ } - - xdg_toplevel_.reset( - xdg_surface_get_toplevel(xdg_surface_wrapper_->xdg_surface())); -@@ -233,9 +237,10 @@ void XDGToplevelWrapperImpl::SetMinimized() { - - void XDGToplevelWrapperImpl::SurfaceMove(WaylandConnection* connection) { - DCHECK(xdg_toplevel_); -- if (auto serial = GetSerialForMoveResize(connection)) -+ if (auto serial = GetSerialForMoveResize(connection)) { - xdg_toplevel_move(xdg_toplevel_.get(), connection->seat()->wl_object(), - serial->value); -+ } - } - - void XDGToplevelWrapperImpl::SurfaceResize(WaylandConnection* connection, -@@ -261,8 +266,9 @@ void XDGToplevelWrapperImpl::SetTitle(const std::u16string& title) { - // length of the string so it would fit the message with some margin. - const size_t kMaxLengh = 4000; - auto short_title = base::UTF16ToUTF8(title); -- if (short_title.size() > kMaxLengh) -+ if (short_title.size() > kMaxLengh) { - short_title.resize(kMaxLengh); -+ } - xdg_toplevel_set_title(xdg_toplevel_.get(), short_title.c_str()); - } - -@@ -470,8 +476,9 @@ void XDGToplevelWrapperImpl::OnConfigureOcclusionState( - - void XDGToplevelWrapperImpl::SetTopLevelDecorationMode( - DecorationMode requested_mode) { -- if (!zxdg_toplevel_decoration_ || requested_mode == decoration_mode_) -+ if (!zxdg_toplevel_decoration_ || requested_mode == decoration_mode_) { - return; -+ } - - zxdg_toplevel_decoration_v1_set_mode(zxdg_toplevel_decoration_.get(), - ToInt32(requested_mode)); -@@ -769,6 +776,44 @@ void XDGToplevelWrapperImpl::AckRotateFocus(uint32_t serial, uint32_t handled) { - connection_->Flush(); - } - -+void XDGToplevelWrapperImpl::SetIcon(const gfx::ImageSkia& icon) { -+ auto* manager = connection_->toplevel_icon_manager_v1(); -+ if (!manager) { -+ return; -+ } -+ -+ if (icon.isNull()) { -+ xdg_toplevel_icon_manager_v1_set_icon(manager, xdg_toplevel_.get(), -+ nullptr); -+ return; -+ } -+ -+ std::vector> buffers; -+ auto* xdg_icon = xdg_toplevel_icon_manager_v1_create_icon(manager); -+ for (const auto& rep : icon.image_reps()) { -+ const auto& bitmap = rep.GetBitmap(); -+ gfx::Size image_size = gfx::SkISizeToSize(bitmap.dimensions()); -+ if (image_size.IsEmpty() || image_size.width() != image_size.height()) { -+ // The toplevel icon protocol requires square icons. -+ continue; -+ } -+ -+ WaylandShmBuffer buffer(connection_->buffer_factory(), image_size); -+ if (!buffer.IsValid()) { -+ LOG(ERROR) << "Failed to create SHM buffer for icon Bitmap."; -+ return; -+ } -+ -+ wl::DrawBitmap(bitmap, &buffer); -+ buffers.emplace_back(std::move(buffer), rep.scale()); -+ } -+ for (const auto& [buffer, scale] : buffers) { -+ xdg_toplevel_icon_v1_add_buffer(xdg_icon, buffer.get(), scale); -+ } -+ xdg_toplevel_icon_manager_v1_set_icon(manager, xdg_toplevel_.get(), xdg_icon); -+ xdg_toplevel_icon_v1_destroy(xdg_icon); -+} -+ - XDGToplevelWrapperImpl* XDGToplevelWrapperImpl::AsXDGToplevelWrapper() { - return this; - } -diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h -index 99db31788888b8..f34cc782ffc82e 100644 ---- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h -+++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h -@@ -81,6 +81,7 @@ class XDGToplevelWrapperImpl : public ShellToplevelWrapper { - void SetPersistable(bool persistable) const override; - void SetShape(std::unique_ptr shape_rects) override; - void AckRotateFocus(uint32_t serial, uint32_t handled) override; -+ void SetIcon(const gfx::ImageSkia& icon) override; - - XDGToplevelWrapperImpl* AsXDGToplevelWrapper() override; - -diff --git a/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc -new file mode 100644 -index 00000000000000..464884e9e1124b ---- /dev/null -+++ b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.cc -@@ -0,0 +1,95 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#include "ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h" -+ -+#include -+ -+#include "base/check_op.h" -+#include "ui/ozone/platform/wayland/host/wayland_shm_buffer.h" -+#include "ui/ozone/platform/wayland/test/server_object.h" -+ -+namespace wl { -+ -+namespace { -+ -+void DestroyManager(struct wl_client* client, struct wl_resource* resource) {} -+ -+void CreateIcon(struct wl_client* client, -+ struct wl_resource* resource, -+ uint32_t id) { -+ auto* global = GetUserDataAs(resource); -+ wl_resource* icon = CreateResourceWithImpl( -+ client, &xdg_toplevel_icon_v1_interface, 1, &kMockXdgToplevelIconImpl, id, -+ global); -+ global->set_icon(GetUserDataAs(icon)); -+} -+ -+void SetIcon(struct wl_client* client, -+ struct wl_resource* resource, -+ struct wl_resource* toplevel, -+ struct wl_resource* icon) { -+ auto* manager = GetUserDataAs(resource); -+ ASSERT_TRUE(manager); -+ auto* toplevel_icon = GetUserDataAs(icon); -+ ASSERT_TRUE(toplevel_icon); -+ manager->resources() = toplevel_icon->resources(); -+} -+ -+} // namespace -+ -+const struct xdg_toplevel_icon_manager_v1_interface -+ kMockXdgToplevelIconManagerImpl = { -+ .destroy = DestroyManager, -+ .create_icon = CreateIcon, -+ .set_icon = SetIcon, -+}; -+ -+MockXdgToplevelIconManagerV1::MockXdgToplevelIconManagerV1() -+ : GlobalObject(&xdg_toplevel_icon_manager_v1_interface, -+ &kMockXdgToplevelIconManagerImpl, -+ 1) {} -+ -+MockXdgToplevelIconManagerV1::~MockXdgToplevelIconManagerV1() = default; -+ -+namespace { -+ -+void DestroyIcon(struct wl_client* client, struct wl_resource* resource) {} -+ -+void SetName(struct wl_client* client, -+ struct wl_resource* resource, -+ const char* icon_name) {} -+ -+void AddBuffer(struct wl_client* client, -+ struct wl_resource* resource, -+ struct wl_resource* buffer, -+ int32_t scale) { -+ auto* icon = GetUserDataAs(resource); -+ ASSERT_TRUE(icon); -+ wl_shm_buffer* shm_buffer = wl_shm_buffer_get(buffer); -+ ASSERT_TRUE(buffer); -+ auto width = wl_shm_buffer_get_width(shm_buffer); -+ auto height = wl_shm_buffer_get_height(shm_buffer); -+ icon->resources().emplace_back(gfx::Size(width, height), scale); -+} -+ -+} // namespace -+ -+const struct xdg_toplevel_icon_v1_interface kMockXdgToplevelIconImpl = { -+ .destroy = DestroyIcon, -+ .set_name = SetName, -+ .add_buffer = AddBuffer, -+}; -+ -+MockXdgToplevelIconV1::MockXdgToplevelIconV1( -+ wl_resource* resource, -+ MockXdgToplevelIconManagerV1* global) -+ : ServerObject(resource), global_(global) {} -+ -+MockXdgToplevelIconV1::~MockXdgToplevelIconV1() { -+ CHECK_EQ(global_->icon(), this); -+ global_->set_icon(nullptr); -+} -+ -+} // namespace wl -diff --git a/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h -new file mode 100644 -index 00000000000000..4272f362be0d18 ---- /dev/null -+++ b/ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h -@@ -0,0 +1,79 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_XDG_TOPLEVEL_ICON_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_XDG_TOPLEVEL_ICON_H_ -+ -+#include -+ -+#include -+ -+#include "base/check.h" -+#include "base/memory/raw_ptr.h" -+#include "testing/gmock/include/gmock/gmock.h" -+#include "ui/gfx/geometry/size.h" -+#include "ui/ozone/platform/wayland/test/global_object.h" -+#include "ui/ozone/platform/wayland/test/server_object.h" -+ -+namespace wl { -+ -+class MockXdgToplevelIconV1; -+ -+struct XdgToplevelIconResource { -+ gfx::Size size; -+ int32_t scale; -+ -+ bool operator==(const XdgToplevelIconResource& other) const { -+ return size == other.size && scale == other.scale; -+ } -+}; -+ -+using XdgToplevelIconResources = std::vector; -+ -+extern const struct xdg_toplevel_icon_manager_v1_interface -+ kMockXdgToplevelIconManagerImpl; -+extern const struct xdg_toplevel_icon_v1_interface kMockXdgToplevelIconImpl; -+ -+class MockXdgToplevelIconManagerV1 : public GlobalObject { -+ public: -+ MockXdgToplevelIconManagerV1(); -+ -+ MockXdgToplevelIconManagerV1(const MockXdgToplevelIconManagerV1&) = delete; -+ MockXdgToplevelIconManagerV1& operator=(const MockXdgToplevelIconManagerV1&) = -+ delete; -+ -+ ~MockXdgToplevelIconManagerV1() override; -+ -+ void set_icon(MockXdgToplevelIconV1* icon) { icon_ = icon; } -+ MockXdgToplevelIconV1* icon() { return icon_; } -+ -+ XdgToplevelIconResources& resources() { return resources_; } -+ -+ private: -+ raw_ptr icon_ = nullptr; -+ -+ XdgToplevelIconResources resources_; -+}; -+ -+class MockXdgToplevelIconV1 : public ServerObject { -+ public: -+ MockXdgToplevelIconV1(wl_resource* resource, -+ MockXdgToplevelIconManagerV1* global); -+ -+ MockXdgToplevelIconV1(const MockXdgToplevelIconV1&) = delete; -+ MockXdgToplevelIconV1& operator=(const MockXdgToplevelIconV1&) = delete; -+ -+ ~MockXdgToplevelIconV1() override; -+ -+ XdgToplevelIconResources& resources() { return resources_; } -+ -+ private: -+ raw_ptr global_ = nullptr; -+ -+ XdgToplevelIconResources resources_; -+}; -+ -+} // namespace wl -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_XDG_TOPLEVEL_ICON_H_ -diff --git a/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc b/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc -index ab6f43e4a0cdb6..c925b27eb31cb4 100644 ---- a/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc -+++ b/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc -@@ -171,6 +171,9 @@ bool TestWaylandServerThread::Start() { - if (!xdg_activation_v1_.Initialize(display_.get())) { - return false; - } -+ if (!xdg_toplevel_icon_manager_v1_.Initialize(display_.get())) { -+ return false; -+ } - - client_ = wl_client_create(display_.get(), server_fd.release()); - if (!client_) -diff --git a/ui/ozone/platform/wayland/test/test_wayland_server_thread.h b/ui/ozone/platform/wayland/test/test_wayland_server_thread.h -index d17deea735bc01..dd8f538ea23c18 100644 ---- a/ui/ozone/platform/wayland/test/test_wayland_server_thread.h -+++ b/ui/ozone/platform/wayland/test/test_wayland_server_thread.h -@@ -23,6 +23,7 @@ - #include "ui/ozone/platform/wayland/test/mock_wp_presentation.h" - #include "ui/ozone/platform/wayland/test/mock_xdg_activation_v1.h" - #include "ui/ozone/platform/wayland/test/mock_xdg_shell.h" -+#include "ui/ozone/platform/wayland/test/mock_xdg_toplevel_icon.h" - #include "ui/ozone/platform/wayland/test/mock_zwp_linux_dmabuf.h" - #include "ui/ozone/platform/wayland/test/test_alpha_compositing.h" - #include "ui/ozone/platform/wayland/test/test_compositor.h" -@@ -187,6 +188,10 @@ class TestWaylandServerThread : public TestOutput::Delegate, - - MockXdgActivationV1* xdg_activation_v1() { return &xdg_activation_v1_; } - -+ MockXdgToplevelIconManagerV1* xdg_toplevel_icon_manager_v1() { -+ return &xdg_toplevel_icon_manager_v1_; -+ } -+ - void set_output_delegate(OutputDelegate* delegate) { - output_delegate_ = delegate; - } -@@ -260,6 +265,7 @@ class TestWaylandServerThread : public TestOutput::Delegate, - MockWpPresentation wp_presentation_; - TestWpPointerGestures wp_pointer_gestures_; - MockXdgActivationV1 xdg_activation_v1_; -+ MockXdgToplevelIconManagerV1 xdg_toplevel_icon_manager_v1_; - std::unique_ptr primary_selection_device_manager_; - - std::vector> globals_; diff --git a/wayland-protocol-toplevel-icon.patch b/wayland-protocol-toplevel-icon.patch deleted file mode 100644 index dfb40a8..0000000 --- a/wayland-protocol-toplevel-icon.patch +++ /dev/null @@ -1,335 +0,0 @@ -From 6185a6e178fc236aad3502fbc969ddd38aabf020 Mon Sep 17 00:00:00 2001 -From: Tom Anderson -Date: Tue, 6 Aug 2024 00:27:29 +0000 -Subject: [PATCH] [Wayland] Add ToplevelIconManager - -This CL is just the boilerplate. Actual implementation to follow. - -R=nickdiego - -Change-Id: I135d5366761fcbb132405d782738d6c09f52bdd8 -Bug: 356424077 -Low-Coverage-Reason: TESTS_IN_SEPARATE_CL: This CL adds the boilerplate. Tests will be added in a followup. -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5752291 -Commit-Queue: Thomas Anderson -Auto-Submit: Thomas Anderson -Reviewed-by: Nick Yamane -Cr-Commit-Position: refs/heads/main@{#1337593} ---- - third_party/wayland-protocols/BUILD.gn | 4 ++ - ui/ozone/platform/wayland/BUILD.gn | 3 ++ - .../platform/wayland/common/wayland_object.cc | 50 ++++++++++++------- - .../platform/wayland/common/wayland_object.h | 2 + - .../wayland/host/toplevel_icon_manager.cc | 44 ++++++++++++++++ - .../wayland/host/toplevel_icon_manager.h | 29 +++++++++++ - .../wayland/host/wayland_connection.cc | 3 ++ - .../wayland/host/wayland_connection.h | 6 +++ - 8 files changed, 123 insertions(+), 18 deletions(-) - create mode 100644 ui/ozone/platform/wayland/host/toplevel_icon_manager.cc - create mode 100644 ui/ozone/platform/wayland/host/toplevel_icon_manager.h - -diff --git a/third_party/wayland-protocols/BUILD.gn b/third_party/wayland-protocols/BUILD.gn -index 67941c2c90cf5e..0bd73c2f56c380 100644 ---- a/third_party/wayland-protocols/BUILD.gn -+++ b/third_party/wayland-protocols/BUILD.gn -@@ -207,3 +207,7 @@ wayland_protocol("xdg_shell_protocol") { - wayland_protocol("xdg_toplevel_drag_protocol") { - sources = [ "src/staging/xdg-toplevel-drag/xdg-toplevel-drag-v1.xml" ] - } -+ -+wayland_protocol("xdg_toplevel_icon_protocol") { -+ sources = [ "src/staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml" ] -+} -diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn -index 0264365be7c6ce..4ba36222f03906 100644 ---- a/ui/ozone/platform/wayland/BUILD.gn -+++ b/ui/ozone/platform/wayland/BUILD.gn -@@ -77,6 +77,8 @@ source_set("wayland") { - "host/single_pixel_buffer.h", - "host/surface_augmenter.cc", - "host/surface_augmenter.h", -+ "host/toplevel_icon_manager.cc", -+ "host/toplevel_icon_manager.h", - "host/wayland_bubble.cc", - "host/wayland_bubble.h", - "host/wayland_buffer_backing.cc", -@@ -291,6 +293,7 @@ source_set("wayland") { - "//third_party/wayland-protocols:xdg_foreign", - "//third_party/wayland-protocols:xdg_output_protocol", - "//third_party/wayland-protocols:xdg_shell_protocol", -+ "//third_party/wayland-protocols:xdg_toplevel_icon_protocol", - "//ui/base", - "//ui/base:buildflags", - "//ui/base:data_exchange", -diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc -index cab61aa4409ca5..e30367a19d7774 100644 ---- a/ui/ozone/platform/wayland/common/wayland_object.cc -+++ b/ui/ozone/platform/wayland/common/wayland_object.cc -@@ -44,6 +44,7 @@ - #include - #include - #include -+#include - - #include "base/logging.h" - -@@ -77,31 +78,36 @@ void delete_output(wl_output* output) { - } - - void delete_keyboard(wl_keyboard* keyboard) { -- if (wl::get_version_of_object(keyboard) >= WL_KEYBOARD_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(keyboard) >= -+ WL_KEYBOARD_RELEASE_SINCE_VERSION) { - wl_keyboard_release(keyboard); -- else -+ } else { - wl_keyboard_destroy(keyboard); -+ } - } - - void delete_pointer(wl_pointer* pointer) { -- if (wl::get_version_of_object(pointer) >= WL_POINTER_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(pointer) >= WL_POINTER_RELEASE_SINCE_VERSION) { - wl_pointer_release(pointer); -- else -+ } else { - wl_pointer_destroy(pointer); -+ } - } - - void delete_seat(wl_seat* seat) { -- if (wl::get_version_of_object(seat) >= WL_SEAT_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(seat) >= WL_SEAT_RELEASE_SINCE_VERSION) { - wl_seat_release(seat); -- else -+ } else { - wl_seat_destroy(seat); -+ } - } - - void delete_touch(wl_touch* touch) { -- if (wl::get_version_of_object(touch) >= WL_TOUCH_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(touch) >= WL_TOUCH_RELEASE_SINCE_VERSION) { - wl_touch_release(touch); -- else -+ } else { - wl_touch_destroy(touch); -+ } - } - - void delete_zaura_output_manager(zaura_output_manager* manager) { -@@ -113,39 +119,45 @@ void delete_zaura_output_manager_v2(zaura_output_manager_v2* manager) { - } - - void delete_zaura_shell(zaura_shell* shell) { -- if (wl::get_version_of_object(shell) >= ZAURA_SHELL_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(shell) >= ZAURA_SHELL_RELEASE_SINCE_VERSION) { - zaura_shell_release(shell); -- else -+ } else { - zaura_shell_destroy(shell); -+ } - } - - void delete_zaura_surface(zaura_surface* surface) { -- if (wl::get_version_of_object(surface) >= ZAURA_SURFACE_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(surface) >= -+ ZAURA_SURFACE_RELEASE_SINCE_VERSION) { - zaura_surface_release(surface); -- else -+ } else { - zaura_surface_destroy(surface); -+ } - } - - void delete_zaura_output(zaura_output* output) { -- if (wl::get_version_of_object(output) >= ZAURA_OUTPUT_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(output) >= ZAURA_OUTPUT_RELEASE_SINCE_VERSION) { - zaura_output_release(output); -- else -+ } else { - zaura_output_destroy(output); -+ } - } - - void delete_zaura_toplevel(zaura_toplevel* toplevel) { - if (wl::get_version_of_object(toplevel) >= -- ZAURA_TOPLEVEL_RELEASE_SINCE_VERSION) -+ ZAURA_TOPLEVEL_RELEASE_SINCE_VERSION) { - zaura_toplevel_release(toplevel); -- else -+ } else { - zaura_toplevel_destroy(toplevel); -+ } - } - - void delete_zaura_popup(zaura_popup* popup) { -- if (wl::get_version_of_object(popup) >= ZAURA_POPUP_RELEASE_SINCE_VERSION) -+ if (wl::get_version_of_object(popup) >= ZAURA_POPUP_RELEASE_SINCE_VERSION) { - zaura_popup_release(popup); -- else -+ } else { - zaura_popup_destroy(popup); -+ } - } - - } // namespace -@@ -245,6 +257,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_popup) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_positioner) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_surface) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel) -+IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) -+IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) - IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_wm_base) - IMPLEMENT_WAYLAND_OBJECT_TRAITS_WITH_DELETER(zaura_output_manager, - delete_zaura_output_manager) -diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h -index ed4902d29edb8f..38213eff64de40 100644 ---- a/ui/ozone/platform/wayland/common/wayland_object.h -+++ b/ui/ozone/platform/wayland/common/wayland_object.h -@@ -156,6 +156,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(xdg_popup) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_positioner) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_surface) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel) -+DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_manager_v1) -+DECLARE_WAYLAND_OBJECT_TRAITS(xdg_toplevel_icon_v1) - DECLARE_WAYLAND_OBJECT_TRAITS(xdg_wm_base) - DECLARE_WAYLAND_OBJECT_TRAITS(zaura_output) - DECLARE_WAYLAND_OBJECT_TRAITS(zaura_output_manager) -diff --git a/ui/ozone/platform/wayland/host/toplevel_icon_manager.cc b/ui/ozone/platform/wayland/host/toplevel_icon_manager.cc -new file mode 100644 -index 00000000000000..44478f56c88a97 ---- /dev/null -+++ b/ui/ozone/platform/wayland/host/toplevel_icon_manager.cc -@@ -0,0 +1,44 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#include "ui/ozone/platform/wayland/host/toplevel_icon_manager.h" -+ -+#include -+ -+#include "base/check_op.h" -+#include "base/logging.h" -+#include "ui/ozone/platform/wayland/common/wayland_object.h" -+#include "ui/ozone/platform/wayland/host/wayland_connection.h" -+ -+namespace ui { -+ -+namespace { -+ -+constexpr uint32_t kMaxVersion = 1; -+ -+} // namespace -+ -+// static -+void ToplevelIconManager::Instantiate(WaylandConnection* connection, -+ wl_registry* registry, -+ uint32_t name, -+ const std::string& interface, -+ uint32_t version) { -+ CHECK_EQ(interface, kInterfaceName) << "Expected \"" << kInterfaceName -+ << "\" but got \"" << interface << "\""; -+ -+ if (connection->toplevel_icon_manager_v1_) { -+ return; -+ } -+ -+ auto instance = wl::Bind<::xdg_toplevel_icon_manager_v1>( -+ registry, name, std::min(version, kMaxVersion)); -+ if (!instance) { -+ LOG(ERROR) << "Failed to bind " << kInterfaceName; -+ return; -+ } -+ connection->toplevel_icon_manager_v1_ = std::move(instance); -+} -+ -+} // namespace ui -diff --git a/ui/ozone/platform/wayland/host/toplevel_icon_manager.h b/ui/ozone/platform/wayland/host/toplevel_icon_manager.h -new file mode 100644 -index 00000000000000..8525dd7cda62db ---- /dev/null -+++ b/ui/ozone/platform/wayland/host/toplevel_icon_manager.h -@@ -0,0 +1,29 @@ -+// Copyright 2024 The Chromium Authors -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_TOPLEVEL_ICON_MANAGER_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_HOST_TOPLEVEL_ICON_MANAGER_H_ -+ -+#include "ui/ozone/platform/wayland/common/wayland_object.h" -+ -+namespace ui { -+ -+// Sets up the global xdg_toplevel_icon_manager_v1 instance. -+class ToplevelIconManager -+ : public wl::GlobalObjectRegistrar { -+ public: -+ static constexpr char kInterfaceName[] = "xdg_toplevel_icon_manager_v1"; -+ -+ static void Instantiate(WaylandConnection* connection, -+ wl_registry* registry, -+ uint32_t name, -+ const std::string& interface, -+ uint32_t version); -+ -+ ToplevelIconManager() = delete; -+}; -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_TOPLEVEL_ICON_MANAGER_H_ -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc -index fe695e355e26b8..51ca168a198bda 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.cc -+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc -@@ -38,6 +38,7 @@ - #include "ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.h" - #include "ui/ozone/platform/wayland/host/single_pixel_buffer.h" - #include "ui/ozone/platform/wayland/host/surface_augmenter.h" -+#include "ui/ozone/platform/wayland/host/toplevel_icon_manager.h" - #include "ui/ozone/platform/wayland/host/wayland_buffer_factory.h" - #include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h" - #include "ui/ozone/platform/wayland/host/wayland_cursor.h" -@@ -152,6 +153,8 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) { - &SinglePixelBuffer::Instantiate); - RegisterGlobalObjectFactory(SurfaceAugmenter::kInterfaceName, - &SurfaceAugmenter::Instantiate); -+ RegisterGlobalObjectFactory(ToplevelIconManager::kInterfaceName, -+ &ToplevelIconManager::Instantiate); - RegisterGlobalObjectFactory(WaylandZAuraOutputManagerV2::kInterfaceName, - &WaylandZAuraOutputManagerV2::Instantiate); - RegisterGlobalObjectFactory(WaylandDataDeviceManager::kInterfaceName, -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h -index 54eb0c234a44fc..10fe500d24e33f 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection.h -@@ -169,6 +169,10 @@ class WaylandConnection { - return fractional_scale_manager_v1_.get(); - } - -+ xdg_toplevel_icon_manager_v1* toplevel_icon_manager_v1() const { -+ return toplevel_icon_manager_v1_.get(); -+ } -+ - void SetPlatformCursor(wl_cursor* cursor_data, int buffer_scale); - - void SetCursorBufferListener(WaylandCursorBufferListener* listener); -@@ -384,6 +388,7 @@ class WaylandConnection { - friend class OverlayPrioritizer; - friend class SinglePixelBuffer; - friend class SurfaceAugmenter; -+ friend class ToplevelIconManager; - friend class WaylandDataDeviceManager; - friend class WaylandOutput; - friend class WaylandSeat; -@@ -489,6 +494,7 @@ class WaylandConnection { - wl::Object extended_drag_v1_; - wl::Object xdg_output_manager_; - wl::Object fractional_scale_manager_v1_; -+ wl::Object toplevel_icon_manager_v1_; - - // Manages Wayland windows. - WaylandWindowManager window_manager_{this}; diff --git a/wayland_connection-Wchanges-meaning.patch b/wayland_connection-Wchanges-meaning.patch deleted file mode 100644 index f8a9ab0..0000000 --- a/wayland_connection-Wchanges-meaning.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 04b25cdd531cf3826d7418141897492979d8f0fb Mon Sep 17 00:00:00 2001 -From: Jose Dapena Paz -Date: Thu, 19 Sep 2024 10:13:04 +0000 -Subject: [PATCH] GCC: avoid clash between type and getter in WaylandConnection -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -WaylandConnection::xdg_toplevel_drag_manager_v1 getter clashes with -the xdg_toplevel_drag_manager_v1 type. Renamed getter to -toplevel_drag_manager_v1 following the decision with other types. - -Bug: 40565911 -Change-Id: I7331be4bcb00f47cd48a74b043067f044b40dcbc -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5875679 -Reviewed-by: Nick Yamane -Commit-Queue: José Dapena Paz -Cr-Commit-Position: refs/heads/main@{#1357526} ---- - ui/ozone/platform/wayland/host/wayland_connection.h | 2 +- - .../platform/wayland/host/wayland_window_drag_controller.cc | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h -index 79680db7189852..55a89735882ff7 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection.h -@@ -160,7 +160,7 @@ class WaylandConnection { - zcr_extended_drag_v1* extended_drag_v1() const { - return extended_drag_v1_.get(); - } -- xdg_toplevel_drag_manager_v1* xdg_toplevel_drag_manager_v1() const { -+ xdg_toplevel_drag_manager_v1* toplevel_drag_manager_v1() const { - return xdg_toplevel_drag_manager_v1_.get(); - } - -diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -index 6184684e308154..6fbf3df07bfe68 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -@@ -109,9 +109,9 @@ class WaylandWindowDragController::XdgToplevelDrag { - public: - XdgToplevelDrag(WaylandConnection& connection, wl_data_source* source) - : connection_(connection) { -- DCHECK(connection.xdg_toplevel_drag_manager_v1()); -+ DCHECK(connection.toplevel_drag_manager_v1()); - drag_.reset(xdg_toplevel_drag_manager_v1_get_xdg_toplevel_drag( -- connection.xdg_toplevel_drag_manager_v1(), source)); -+ connection.toplevel_drag_manager_v1(), source)); - DCHECK(drag_); - } - -@@ -737,7 +737,7 @@ bool WaylandWindowDragController::IsExtendedDragAvailable() const { - } - - bool WaylandWindowDragController::IsXdgToplevelDragAvailable() const { -- return !!connection_->xdg_toplevel_drag_manager_v1(); -+ return !!connection_->toplevel_drag_manager_v1(); - } - - bool WaylandWindowDragController::IsActiveDragAndDropSession() const { -- 2.51.1 From 91803406aa2e3baa382a983026b434768a1cdc2a132ce95dad359b6e436f97f6 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 30 Apr 2025 20:21:53 +0000 Subject: [PATCH 52/80] Accepting request 1273736 from home:dziobian:gulgul-ultron:19 - Remove spurious exports of internal functions bloating binary due to incorrectly building libnode with -fvisibility=default * add this bit to use-system-libraries-in-node.patch OBS-URL: https://build.opensuse.org/request/show/1273736 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=204 --- nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- use-system-libraries-in-node.patch | 20 +++++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 7b8a3a3..1fc4861 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 29 09:33:21 UTC 2025 - Bruno Pitrus + +- Remove spurious exports of internal functions bloating binary due to incorrectly building libnode with -fvisibility=default + * add this bit to use-system-libraries-in-node.patch + ------------------------------------------------------------------- Sat Apr 26 09:53:27 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index df00d8a..4f485c5 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -1028,7 +1028,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=4 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=3 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch index f4ac452..1c5f6e1 100644 --- a/use-system-libraries-in-node.patch +++ b/use-system-libraries-in-node.patch @@ -1,3 +1,6 @@ +Also remove spurious exports of internal functions bloating binary due to incorrectly building libnode with -fvisibility=default +Both this and the unbundle flags should be upstreamed but probably separately. + --- src/third_party/electron_node/node.gni.orig 2025-04-20 10:49:28.656330018 +0200 +++ src/third_party/electron_node/node.gni 2025-04-20 19:08:01.482693254 +0200 @@ -73,10 +73,12 @@ declare_args() { @@ -13,8 +16,8 @@ } assert(!node_enable_inspector || node_use_openssl, ---- src/third_party/electron_node/unofficial.gni.orig 2025-04-20 10:49:28.656330018 +0200 -+++ src/third_party/electron_node/unofficial.gni 2025-04-20 19:16:09.442680896 +0200 +--- src/third_party/electron_node/unofficial.gni 2025-04-24 18:36:09.022852136 +0200 ++++ src/third_party/electron_node/unofficial.gni 2025-04-29 11:31:11.474026894 +0200 @@ -9,6 +9,35 @@ import("$node_v8_path/gni/v8.gni") # The actual configurations are put inside a template in unofficial.gni to # prevent accidental edits from contributors. @@ -76,10 +79,13 @@ "deps/postject", "deps/sqlite", "deps/uvwasi", -@@ -183,17 +208,36 @@ template("node_gn_build") { - configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] - configs += [ "//build/config/gcc:symbol_visibility_default" ] +@@ -179,21 +204,36 @@ template("node_gn_build") { + if (is_mac) { + frameworks = [ "CoreFoundation.framework" ] } +- if (is_posix) { +- configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] +- configs += [ "//build/config/gcc:symbol_visibility_default" ] + if (use_system_ada) { + libs += ["ada"] + } else { @@ -89,7 +95,7 @@ + configs += [ ":system_cares" ] + } else { + deps += [ "deps/cares" ] -+ } + } if (use_system_llhttp) { - libs += [ "llhttp" ] + configs += [ ":system_llhttp" ] @@ -116,7 +122,7 @@ if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] } -@@ -222,19 +266,6 @@ template("node_gn_build") { +@@ -222,19 +262,6 @@ template("node_gn_build") { sources += node_inspector.node_inspector_sources + node_inspector.node_inspector_generated_sources } -- 2.51.1 From e678e42116050270fefffaf06f965e5e6e39171af170848cf39a38a59a100a6b Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 1 May 2025 21:03:38 +0000 Subject: [PATCH 53/80] Accepting request 1273879 from home:dziobian:gulgul-ultron:19 - New upstream release 35.2.2 * Fixed electron.shell.openExternal and electron.shell.openPath to honor user-defined system defaults on Linux. * Fixed a possible crash when using navigator.bluetooth.requestDevice and the select-bluetooth-device event. * Fixed a potential crash when closing a window with child windows. * Fixed crash when renderer process crashes while webview is reloading. * Fixed the visibleOnAllWorkspaces property on Linux. - Drop electron_usb_delegate-incomplete-UsbDeviceInfo.patch applied upstream OBS-URL: https://build.opensuse.org/request/show/1273879 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=205 --- electron-35.2.1.tar.zst | 3 - electron-35.2.2.tar.zst | 3 + ...sb_delegate-incomplete-UsbDeviceInfo.patch | 63 ------------------- nodejs-electron.changes | 11 ++++ nodejs-electron.spec | 24 +------ 5 files changed, 17 insertions(+), 87 deletions(-) delete mode 100644 electron-35.2.1.tar.zst create mode 100644 electron-35.2.2.tar.zst delete mode 100644 electron_usb_delegate-incomplete-UsbDeviceInfo.patch diff --git a/electron-35.2.1.tar.zst b/electron-35.2.1.tar.zst deleted file mode 100644 index 2ba9052..0000000 --- a/electron-35.2.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:88c862afb7258a3c9b2ca823f4d6077e59065ba830d0edf974a8b7ecfceaf022 -size 753660040 diff --git a/electron-35.2.2.tar.zst b/electron-35.2.2.tar.zst new file mode 100644 index 0000000..42c6d4c --- /dev/null +++ b/electron-35.2.2.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70934d91a46e8cf5c465acb4d3ab05a9f38921ba8690405d8cace976152578ff +size 753696447 diff --git a/electron_usb_delegate-incomplete-UsbDeviceInfo.patch b/electron_usb_delegate-incomplete-UsbDeviceInfo.patch deleted file mode 100644 index 42bd8ca..0000000 --- a/electron_usb_delegate-incomplete-UsbDeviceInfo.patch +++ /dev/null @@ -1,63 +0,0 @@ -In file included from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr_backup_ref_impl.h:13, - from ../../base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h:50, - from ../../base/memory/raw_ptr.h:11, - from ../../base/memory/weak_ptr.h:82, - from ../../electron/shell/browser/usb/electron_usb_delegate.h:14, - from ../../electron/shell/browser/usb/electron_usb_delegate.cc:5: -../../base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h:279:3: warning: multi-line comment [-Wcomment] - 279 | // \ - | ^ -../../base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h:281:3: warning: multi-line comment [-Wcomment] - 281 | // \ - | ^ -In file included from /usr/include/c++/14/memory:78, - from ../../electron/shell/browser/usb/electron_usb_delegate.h:8: -/usr/include/c++/14/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = device::mojom::UsbDeviceInfo]’: -/usr/include/c++/14/bits/unique_ptr.h:399:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = device::mojom::UsbDeviceInfo; _Dp = std::default_delete]’ - 399 | get_deleter()(std::move(__ptr)); - | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ -../../mojo/public/cpp/bindings/struct_ptr.h:48:3: required from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = mojo::StructPtr]’ - 48 | ~StructPtr() = default; - | ^ -/usr/include/c++/14/bits/stl_construct.h:149:22: required from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = mojo::StructPtr]’ - 149 | std::destroy_at(__pointer); - | ~~~~~~~~~~~~~~~^~~~~~~~~~~ -/usr/include/c++/14/bits/stl_construct.h:163:19: required from ‘static constexpr void std::_Destroy_aux< >::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = mojo::StructPtr*; bool = false]’ - 163 | std::_Destroy(std::__addressof(*__first)); - | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/usr/include/c++/14/bits/stl_construct.h:193:44: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = mojo::StructPtr*]’ - 193 | return std::_Destroy_aux::__destroy(__first, __last); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ -/usr/include/c++/14/bits/alloc_traits.h:981:20: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = mojo::StructPtr*; _Tp = mojo::StructPtr]’ - 981 | std::_Destroy(__first, __last); - | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ -/usr/include/c++/14/bits/stl_vector.h:735:15: required from ‘constexpr std::vector<_Tp, _Alloc>::~vector() [with _Tp = mojo::StructPtr; _Alloc = std::allocator >]’ - 735 | std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, - | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 736 | _M_get_Tp_allocator()); - | ~~~~~~~~~~~~~~~~~~~~~~ -../../electron/shell/browser/usb/electron_usb_delegate.cc:231:74: required from here - 231 | std::move(callback).Run(std::vector()); - | ^ -/usr/include/c++/14/bits/unique_ptr.h:91:23: error: invalid application of ‘sizeof’ to incomplete type ‘device::mojom::UsbDeviceInfo’ - 91 | static_assert(sizeof(_Tp)>0, - | ^~~~~~~~~~~ - ---- src/electron/shell/browser/usb/electron_usb_delegate.cc.orig 2025-01-02 22:20:04.494886103 +0100 -+++ src/electron/shell/browser/usb/electron_usb_delegate.cc 2025-01-03 23:05:03.664747897 +0100 -@@ -13,6 +13,7 @@ - #include "content/public/browser/render_frame_host.h" - #include "content/public/browser/web_contents.h" - #include "electron/buildflags/buildflags.h" -+#include "services/device/public/mojom/usb_device.mojom.h" - #include "services/device/public/mojom/usb_enumeration_options.mojom.h" - #include "shell/browser/electron_browser_context.h" - #include "shell/browser/electron_permission_manager.h" -@@ -28,7 +29,6 @@ - #include "extensions/browser/guest_view/web_view/web_view_guest.h" - #include "extensions/common/constants.h" - #include "extensions/common/extension.h" --#include "services/device/public/mojom/usb_device.mojom.h" - #endif - - namespace { diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 1fc4861..af8c0b1 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu May 1 08:58:10 UTC 2025 - Bruno Pitrus + +- New upstream release 35.2.2 + * Fixed electron.shell.openExternal and electron.shell.openPath to honor user-defined system defaults on Linux. + * Fixed a possible crash when using navigator.bluetooth.requestDevice and the select-bluetooth-device event. + * Fixed a potential crash when closing a window with child windows. + * Fixed crash when renderer process crashes while webview is reloading. + * Fixed the visibleOnAllWorkspaces property on Linux. +- Drop electron_usb_delegate-incomplete-UsbDeviceInfo.patch applied upstream + ------------------------------------------------------------------- Tue Apr 29 09:33:21 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 4f485c5..d958d9f 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -189,7 +189,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.2.1 +Version: 35.2.2 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -354,7 +354,6 @@ Patch3144: mt21_util-flax-vector-conversions.patch Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch Patch3174: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch Patch3175: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch -Patch3184: electron_usb_delegate-incomplete-UsbDeviceInfo.patch Patch3185: bsc1224178-font-gc.patch Patch3186: string_view-incomplete-CodePointIterator.patch Patch3187: swiftshader-llvm20-absoluteSymbols.patch @@ -1152,31 +1151,14 @@ myconf_gn+=' enable_platform_apps=false' # symbol_level=1 is enough info for stacktraces # symbol_level=0 no debuginfo (only function names in private symbols) # blink (HTML engine) and v8 (js engine) are template-heavy, trying to compile them with full debug leads to linker errors due to inherent limitations of the DWARF format. -%ifnarch %ix86 %arm aarch64 + %if 0%{?fedora} -# [10675s] lto1: internal compiler error: in build_abbrev_table, at dwarf2out.cc:9244 -myconf_gn+=' symbol_level=1' -%else -%if %{without lto} -myconf_gn+=' symbol_level=1' # relocation truncated to fit +myconf_gn+=' symbol_level=1' #OOM during linking %else myconf_gn+=' symbol_level=2' %endif -%endif myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' -%endif -%ifarch %ix86 %arm -#Sorry, no debug on 32bit. -myconf_gn+=" symbol_level=1" -myconf_gn+=" blink_symbol_level=0" -myconf_gn+=" v8_symbol_level=0" -%endif -%ifarch aarch64 -myconf_gn+=' symbol_level=2' -myconf_gn+=' blink_symbol_level=1' -myconf_gn+=' v8_symbol_level=1' -%endif #symbol_level should not affect generated code. myconf_gn+=' enable_stack_trace_line_numbers=true' -- 2.51.1 From ffdea395ff422d8e2ed1efee11872151bf77dcb219eb36d038de0ad0060ed13b Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 8 May 2025 09:52:27 +0000 Subject: [PATCH 54/80] Accepting request 1275461 from home:dziobian:gulgul-ultron:19 - New upstream release 35.3.0 * Fixed xdg portal version detection for file dialogs - Add file_dialog-missing-uint32_t.patch to fix build error OBS-URL: https://build.opensuse.org/request/show/1275461 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=206 --- electron-35.2.2.tar.zst | 3 --- electron-35.3.0.tar.zst | 3 +++ file_dialog-missing-uint32_t.patch | 10 ++++++++++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 3 ++- 5 files changed, 22 insertions(+), 4 deletions(-) delete mode 100644 electron-35.2.2.tar.zst create mode 100644 electron-35.3.0.tar.zst create mode 100644 file_dialog-missing-uint32_t.patch diff --git a/electron-35.2.2.tar.zst b/electron-35.2.2.tar.zst deleted file mode 100644 index 42c6d4c..0000000 --- a/electron-35.2.2.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70934d91a46e8cf5c465acb4d3ab05a9f38921ba8690405d8cace976152578ff -size 753696447 diff --git a/electron-35.3.0.tar.zst b/electron-35.3.0.tar.zst new file mode 100644 index 0000000..26ca254 --- /dev/null +++ b/electron-35.3.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b388e0da5ed13e0fc0a84b12584ddccdc52fc64faf48e5794fb9257a16185b09 +size 752065773 diff --git a/file_dialog-missing-uint32_t.patch b/file_dialog-missing-uint32_t.patch new file mode 100644 index 0000000..2b77116 --- /dev/null +++ b/file_dialog-missing-uint32_t.patch @@ -0,0 +1,10 @@ +--- src/electron/shell/browser/ui/file_dialog.h.orig 2025-05-07 19:52:05.453848300 +0200 ++++ src/electron/shell/browser/ui/file_dialog.h 2025-05-07 22:41:30.703083100 +0200 +@@ -5,6 +5,7 @@ + #ifndef ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ + #define ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ + ++#include + #include + #include + #include diff --git a/nodejs-electron.changes b/nodejs-electron.changes index af8c0b1..ffd8fa2 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu May 8 09:50:05 UTC 2025 - Bruno Pitrus + +- New upstream release 35.3.0 + * Fixed xdg portal version detection for file dialogs +- Add file_dialog-missing-uint32_t.patch to fix build error + ------------------------------------------------------------------- Thu May 1 08:58:10 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index d958d9f..09387ee 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -189,7 +189,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.2.2 +Version: 35.3.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -378,6 +378,7 @@ Patch3205: plugin_utils-build-without-electron_extensions.patch Patch3206: string-hasher-flax-vector-conversions.patch Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch Patch3208: to_vector-std-projected-gcc119888.patch +Patch3209: file_dialog-missing-uint32_t.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. -- 2.51.1 From b6143914b571e65ad7aa39b4c017cfdf166dd0c77fde6a676d18f02af1376bca Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 8 May 2025 14:18:43 +0000 Subject: [PATCH 55/80] Accepting request 1275595 from devel:languages:nodejs revert due to crashes OBS-URL: https://build.opensuse.org/request/show/1275595 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=207 --- electron-35.2.2.tar.zst | 3 +++ electron-35.3.0.tar.zst | 3 --- file_dialog-missing-uint32_t.patch | 10 ---------- nodejs-electron.changes | 7 ------- nodejs-electron.spec | 3 +-- 5 files changed, 4 insertions(+), 22 deletions(-) create mode 100644 electron-35.2.2.tar.zst delete mode 100644 electron-35.3.0.tar.zst delete mode 100644 file_dialog-missing-uint32_t.patch diff --git a/electron-35.2.2.tar.zst b/electron-35.2.2.tar.zst new file mode 100644 index 0000000..42c6d4c --- /dev/null +++ b/electron-35.2.2.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70934d91a46e8cf5c465acb4d3ab05a9f38921ba8690405d8cace976152578ff +size 753696447 diff --git a/electron-35.3.0.tar.zst b/electron-35.3.0.tar.zst deleted file mode 100644 index 26ca254..0000000 --- a/electron-35.3.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b388e0da5ed13e0fc0a84b12584ddccdc52fc64faf48e5794fb9257a16185b09 -size 752065773 diff --git a/file_dialog-missing-uint32_t.patch b/file_dialog-missing-uint32_t.patch deleted file mode 100644 index 2b77116..0000000 --- a/file_dialog-missing-uint32_t.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/electron/shell/browser/ui/file_dialog.h.orig 2025-05-07 19:52:05.453848300 +0200 -+++ src/electron/shell/browser/ui/file_dialog.h 2025-05-07 22:41:30.703083100 +0200 -@@ -5,6 +5,7 @@ - #ifndef ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ - #define ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ - -+#include - #include - #include - #include diff --git a/nodejs-electron.changes b/nodejs-electron.changes index ffd8fa2..af8c0b1 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,10 +1,3 @@ -------------------------------------------------------------------- -Thu May 8 09:50:05 UTC 2025 - Bruno Pitrus - -- New upstream release 35.3.0 - * Fixed xdg portal version detection for file dialogs -- Add file_dialog-missing-uint32_t.patch to fix build error - ------------------------------------------------------------------- Thu May 1 08:58:10 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 09387ee..d958d9f 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -189,7 +189,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.3.0 +Version: 35.2.2 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -378,7 +378,6 @@ Patch3205: plugin_utils-build-without-electron_extensions.patch Patch3206: string-hasher-flax-vector-conversions.patch Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch Patch3208: to_vector-std-projected-gcc119888.patch -Patch3209: file_dialog-missing-uint32_t.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. -- 2.51.1 From 9b00ebd3be04c18e6422880115c573aff03e79c017ef0f126499222171a3e7e3 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 9 May 2025 20:23:34 +0000 Subject: [PATCH 56/80] Accepting request 1276327 from home:dziobian:gulgul-ultron:19 - Fix reproducible builds (bsc#1041090) * html_permission_element_strings_map-reproducible.patch - New upstream release 35.3.0 * Fixed xdg portal version detection for file dialogs - Add file_dialog-missing-uint32_t.patch to fix build error - Add backported CheckPortalAvailabilityOnBusThread-UaF-crash.patch to fix gh#electron/electron#47007 - Enable debuginfo in Torque code (torque-debuginfo.patch) - Fix headers installed in wrong location causing node-gyp unable to find config.gypi OBS-URL: https://build.opensuse.org/request/show/1276327 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=208 --- ...talAvailabilityOnBusThread-UaF-crash.patch | 24 +++++++ electron-35.2.2.tar.zst | 3 - electron-35.3.0.tar.zst | 3 + file_dialog-missing-uint32_t.patch | 10 +++ ...ion_element_strings_map-reproducible.patch | 63 +++++++++++++++++++ nodejs-electron.changes | 16 +++++ nodejs-electron.spec | 9 ++- torque-debuginfo.patch | 61 ++++++++++++++++++ 8 files changed, 184 insertions(+), 5 deletions(-) create mode 100644 CheckPortalAvailabilityOnBusThread-UaF-crash.patch delete mode 100644 electron-35.2.2.tar.zst create mode 100644 electron-35.3.0.tar.zst create mode 100644 file_dialog-missing-uint32_t.patch create mode 100644 html_permission_element_strings_map-reproducible.patch create mode 100644 torque-debuginfo.patch diff --git a/CheckPortalAvailabilityOnBusThread-UaF-crash.patch b/CheckPortalAvailabilityOnBusThread-UaF-crash.patch new file mode 100644 index 0000000..eb66b2b --- /dev/null +++ b/CheckPortalAvailabilityOnBusThread-UaF-crash.patch @@ -0,0 +1,24 @@ +From 41cfb13e3fd199108130e4b29ccb54b52ae82bbb Mon Sep 17 00:00:00 2001 +From: deepak1556 +Date: Fri, 9 May 2025 01:07:04 +0900 +Subject: [PATCH] fix: use-after-move of bus connection in xdg portal detection + +--- + shell/browser/ui/file_dialog_linux_portal.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/shell/browser/ui/file_dialog_linux_portal.cc b/shell/browser/ui/file_dialog_linux_portal.cc +index 298ee25caffb4..7dd520d92bdfa 100644 +--- a/electron/shell/browser/ui/file_dialog_linux_portal.cc ++++ b/electron/shell/browser/ui/file_dialog_linux_portal.cc +@@ -86,8 +86,9 @@ void CheckPortalAvailabilityOnBusThread() { + << (g_portal_available ? "yes" : "no"); + flag->Set(); + bus->ShutdownAndBlock(); ++ bus.reset(); + }, +- std::move(bus), flag)); ++ bus, flag)); + } + + } // namespace diff --git a/electron-35.2.2.tar.zst b/electron-35.2.2.tar.zst deleted file mode 100644 index 42c6d4c..0000000 --- a/electron-35.2.2.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70934d91a46e8cf5c465acb4d3ab05a9f38921ba8690405d8cace976152578ff -size 753696447 diff --git a/electron-35.3.0.tar.zst b/electron-35.3.0.tar.zst new file mode 100644 index 0000000..26ca254 --- /dev/null +++ b/electron-35.3.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b388e0da5ed13e0fc0a84b12584ddccdc52fc64faf48e5794fb9257a16185b09 +size 752065773 diff --git a/file_dialog-missing-uint32_t.patch b/file_dialog-missing-uint32_t.patch new file mode 100644 index 0000000..2b77116 --- /dev/null +++ b/file_dialog-missing-uint32_t.patch @@ -0,0 +1,10 @@ +--- src/electron/shell/browser/ui/file_dialog.h.orig 2025-05-07 19:52:05.453848300 +0200 ++++ src/electron/shell/browser/ui/file_dialog.h 2025-05-07 22:41:30.703083100 +0200 +@@ -5,6 +5,7 @@ + #ifndef ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ + #define ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ + ++#include + #include + #include + #include diff --git a/html_permission_element_strings_map-reproducible.patch b/html_permission_element_strings_map-reproducible.patch new file mode 100644 index 0000000..c052a66 --- /dev/null +++ b/html_permission_element_strings_map-reproducible.patch @@ -0,0 +1,63 @@ +--- src/third_party/blink/renderer/build/scripts/generate_permission_element_grd.py 2025-05-07 19:56:08.225814691 +0200 ++++ src/third_party/blink/renderer/build/scripts/generate_permission_element_grd.py 2025-05-09 17:27:22.302946256 +0200 +@@ -148,6 +148,18 @@ def generate_grd_file(id_map, file_list, + with open(output_file_path, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + ++# Generate the shortest string containing both `long` and `short` as substrings. ++# The full n-string problem is NP-complete, but we only use a crude greedy heuristic. ++def superstring(long, short): ++ if long.find(short) >= 0: ++ return long ++ for i in range(len(short), 0, -1): ++ if(long[-i:] == short[:i]): ++ return long + short[i:] ++ if(short[-i:] == long[:i]): ++ return short + long[i:] ++ return long + short ++ + + def generate_cpp_mapping(orderings, input_file_path, output_file_path): + doc = parse(input_file_path) +@@ -161,8 +173,8 @@ def generate_cpp_mapping(orderings, inpu + # this code will use `pt-pt` (Portuguese from Portugal). + custom_locale_mappings = {"en-gb": "en", "pt-pt": "pt", "zh-cn": "zh"} + +- langs = '' +- lang_map = {} ++ ++ locales = set() + message_map = [] + for message in messages: + message_name = message.getAttribute('name') +@@ -171,20 +183,18 @@ def generate_cpp_mapping(orderings, inpu + '_', 1)[1].lower().replace("_", "-") + if locale in custom_locale_mappings: + locale = custom_locale_mappings[locale] +- if locale not in lang_map: +- # String concatenation is inefficientin Python, since strings +- # are immutable. However, maintaining a list of chars and +- # re-implementing find() is also unpleasant. +- langs_idx = langs.find(locale) +- if langs_idx < 0: +- lang_map[locale] = (len(langs), len(locale)) +- langs += locale +- else: +- # If locale is already a substring in the existing list, +- # the substring can simply be reused to save some space. +- lang_map[locale] = (langs_idx, len(locale)) ++ locales.add(locale) # Need to add all locales at first because iteration order is non-deterministic + message_map.append((locale, base_message, message_name)) + ++ langs = '' ++ locales = sorted(locales, key=lambda x: (-len(x), x)) ++ for locale in locales: # Sort by length so that we add `ab-cd` before `ab` and `cd` ++ langs = superstring(langs, locale) ++ ++ lang_map = {} ++ for locale in locales: ++ lang_map[locale] = langs.find(locale), len(locale) ++ + output_file.write(kStringMapCcPrefix) + output_file.write(f' "{langs}";\n') + output_file.write(kStringMapCcMidfix) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index af8c0b1..4f95653 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Fri May 9 15:31:47 UTC 2025 - Bruno Pitrus + +- Fix reproducible builds (bsc#1041090) + * html_permission_element_strings_map-reproducible.patch + +------------------------------------------------------------------- +Thu May 8 21:03:32 UTC 2025 - Bruno Pitrus + +- New upstream release 35.3.0 + * Fixed xdg portal version detection for file dialogs +- Add file_dialog-missing-uint32_t.patch to fix build error +- Add backported CheckPortalAvailabilityOnBusThread-UaF-crash.patch to fix gh#electron/electron#47007 +- Enable debuginfo in Torque code (torque-debuginfo.patch) +- Fix headers installed in wrong location causing node-gyp unable to find config.gypi + ------------------------------------------------------------------- Thu May 1 08:58:10 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index d958d9f..3405be7 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -189,7 +189,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.2.2 +Version: 35.3.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -242,6 +242,7 @@ Patch85: devtools-frontend-compress_files-oom.patch Patch86: enable_stack_trace_line_numbers-symbol_level.patch Patch97: chromium-127-cargo_crate.patch Patch98: gn-logspam-breaks-install.patch +Patch99: torque-debuginfo.patch # PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors, @@ -378,6 +379,9 @@ Patch3205: plugin_utils-build-without-electron_extensions.patch Patch3206: string-hasher-flax-vector-conversions.patch Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch Patch3208: to_vector-std-projected-gcc119888.patch +Patch3209: file_dialog-missing-uint32_t.patch +Patch3210: CheckPortalAvailabilityOnBusThread-UaF-crash.patch +Patch3211: html_permission_element_strings_map-reproducible.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -1380,7 +1384,8 @@ popd -cp -lrvT out/Release/gen/node_headers/include/node %{buildroot}%{_includedir}/electron +cp -lrvT out/Release/gen/node_headers %{buildroot}%{_includedir}/electron + # Electron has a little known feature that make it work like a nodejs binary. # We make use of it in the %%electron_rebuild macro which builds all dependencies in node_modules against Electron's headers. diff --git a/torque-debuginfo.patch b/torque-debuginfo.patch new file mode 100644 index 0000000..270d2ac --- /dev/null +++ b/torque-debuginfo.patch @@ -0,0 +1,61 @@ +Adds debuginfo directives to embedded.S and torque-generated .cc files. + +This does not change the electron binary in any way (the text is identical), only makes the symbols better. + +Revert https://github.com/v8/v8/commit/28e0e97dfe0d2b4587cb8f9a809fcaeb4670546f + +reverted: +--- b/v8/src/snapshot/embedded/embedded-file-writer.cc ++++ a/v8/src/snapshot/embedded/embedded-file-writer.cc +@@ -77,10 +77,6 @@ void EmbeddedFileWriter::WriteBuiltin(Pl + v8::internal::SourcePositionTableIterator positions( + vpos, SourcePositionTableIterator::kExternalOnly); + +-#ifndef DEBUG +- CHECK(positions.done()); // Release builds must not contain debug infos. +-#endif +- + // Some builtins (InterpreterPushArgsThenFastConstructFunction, + // JSConstructStubGeneric) have entry points located in the middle of them, we + // need to store their addresses since they are part of the list of allowed +reverted: +--- b/v8/src/snapshot/embedded/embedded-file-writer.h ++++ a/v8/src/snapshot/embedded/embedded-file-writer.h +@@ -121,11 +121,6 @@ + } + + void WriteExternalFilenames(PlatformEmbeddedFileWriterBase* w) const { +-#ifndef DEBUG +- // Release builds must not contain debug infos. +- CHECK_EQ(external_filenames_by_index_.size(), 0); +-#endif +- + w->Comment( + "Source positions in the embedded blob refer to filenames by id."); + w->Comment("Assembly directives here map the id to a filename."); +--- src/v8/src/torque/torque-code-generator.cc.orig 2025-05-07 20:01:00.337777745 +0200 ++++ src/v8/src/torque/torque-code-generator.cc 2025-05-08 20:03:23.726364897 +0200 +@@ -26,11 +26,9 @@ bool TorqueCodeGenerator::IsEmptyInstruc + + void TorqueCodeGenerator::EmitInstruction(const Instruction& instruction, + Stack* stack) { +-#ifdef DEBUG + if (!IsEmptyInstruction(instruction)) { + EmitSourcePosition(instruction->pos); + } +-#endif + + switch (instruction.kind()) { + #define ENUM_ITEM(T) \ +--- src/v8/src/compiler/code-assembler.cc.orig 2025-05-07 20:01:00.165777775 +0200 ++++ src/v8/src/compiler/code-assembler.cc 2025-05-08 21:30:20.037471973 +0200 +@@ -100,7 +100,9 @@ void CodeAssemblerState::SetInitialDebug + int line) { + #if DEBUG + AssemblerDebugInfo debug_info = {msg, file, line}; ++#endif + raw_assembler_->SetCurrentExternalSourcePosition({file, line}); ++#if DEBUG + raw_assembler_->SetInitialDebugInformation(debug_info); + #endif // DEBUG + } -- 2.51.1 From af1bc92756d642826a50a032fafc470b9186f5027ebd59063389411ebb12250d Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 17 May 2025 09:23:17 +0000 Subject: [PATCH 57/80] Accepting request 1278124 from home:dziobian:gulgul-ultron:19 - New upstream release 35.4.0 * Node 22.15.0 * Added support for system-context-menu on Linux * Fixed a possible crash using the WebView tag and calling focus - Drop CheckPortalAvailabilityOnBusThread-UaF-crash.patch applied upstream - Add system-zstd-in-node.patch to fix build error - 15.6: reverse upstream changes to build with old cares * node-cares-1.21-2.patch * node-cares-1.21-3.patch OBS-URL: https://build.opensuse.org/request/show/1278124 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=209 --- ...talAvailabilityOnBusThread-UaF-crash.patch | 24 -- create_tarball.sh | 7 +- electron-35.3.0.tar.zst | 3 - electron-35.4.0.tar.zst | 3 + node-cares-1.21-2.patch | 261 ++++++++++++++++++ node-cares-1.21-3.patch | 31 +++ nodejs-electron.changes | 13 + nodejs-electron.spec | 8 +- system-zstd-in-node.patch | 10 + use-system-libraries-in-node.patch | 31 ++- 10 files changed, 352 insertions(+), 39 deletions(-) delete mode 100644 CheckPortalAvailabilityOnBusThread-UaF-crash.patch delete mode 100644 electron-35.3.0.tar.zst create mode 100644 electron-35.4.0.tar.zst create mode 100644 node-cares-1.21-2.patch create mode 100644 node-cares-1.21-3.patch create mode 100644 system-zstd-in-node.patch diff --git a/CheckPortalAvailabilityOnBusThread-UaF-crash.patch b/CheckPortalAvailabilityOnBusThread-UaF-crash.patch deleted file mode 100644 index eb66b2b..0000000 --- a/CheckPortalAvailabilityOnBusThread-UaF-crash.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 41cfb13e3fd199108130e4b29ccb54b52ae82bbb Mon Sep 17 00:00:00 2001 -From: deepak1556 -Date: Fri, 9 May 2025 01:07:04 +0900 -Subject: [PATCH] fix: use-after-move of bus connection in xdg portal detection - ---- - shell/browser/ui/file_dialog_linux_portal.cc | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/shell/browser/ui/file_dialog_linux_portal.cc b/shell/browser/ui/file_dialog_linux_portal.cc -index 298ee25caffb4..7dd520d92bdfa 100644 ---- a/electron/shell/browser/ui/file_dialog_linux_portal.cc -+++ b/electron/shell/browser/ui/file_dialog_linux_portal.cc -@@ -86,8 +86,9 @@ void CheckPortalAvailabilityOnBusThread() { - << (g_portal_available ? "yes" : "no"); - flag->Set(); - bus->ShutdownAndBlock(); -+ bus.reset(); - }, -- std::move(bus), flag)); -+ bus, flag)); - } - - } // namespace diff --git a/create_tarball.sh b/create_tarball.sh index 110d427..327b7f8 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -69,7 +69,7 @@ EOF export DEPOT_TOOLS_UPDATE=0 echo ">>>>>> Downloading electron-${ELECTRON_PKGVERSION}" -gclient sync -v --jobs $(nproc) --nohooks --no-history --shallow --revision=v"${ELECTRON_PKGVERSION}" +gclient sync -v --jobs 15 --nohooks --no-history --shallow --revision=v"${ELECTRON_PKGVERSION}" if [ $? -ne 0 ]; then echo "ERROR: gclient sync failed" cleanup_and_exit 1 @@ -332,9 +332,12 @@ find third_party/electron_node/deps/ngtcp2 -type f ! -name "*.gn" -a ! -name "*. find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete -rm -rvf third_party/electron_node/deps/v8/tools +rm -rvf third_party/electron_node/deps/v8/{tools,include} ln -srv v8/tools -t third_party/electron_node/deps/v8/ +ln -srv v8/include -t third_party/electron_node/deps/v8/ find third_party/electron_node/deps/zlib -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +find third_party/electron_node/deps/zstd -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete + # vendored system headers rm -rf build/linux/debian*sysroot diff --git a/electron-35.3.0.tar.zst b/electron-35.3.0.tar.zst deleted file mode 100644 index 26ca254..0000000 --- a/electron-35.3.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b388e0da5ed13e0fc0a84b12584ddccdc52fc64faf48e5794fb9257a16185b09 -size 752065773 diff --git a/electron-35.4.0.tar.zst b/electron-35.4.0.tar.zst new file mode 100644 index 0000000..7aacc84 --- /dev/null +++ b/electron-35.4.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcd37ad7b2b688512657708c5fbb7009763f53fff32f657f96d1cf0aa3f88bdf +size 753774373 diff --git a/node-cares-1.21-2.patch b/node-cares-1.21-2.patch new file mode 100644 index 0000000..163a12c --- /dev/null +++ b/node-cares-1.21-2.patch @@ -0,0 +1,261 @@ +From ef91595e2fc1f96b7c8eb51bfcc1408a5adaa4a9 Mon Sep 17 00:00:00 2001 +From: Rithvik Vibhu +Date: Tue, 14 May 2024 23:10:31 +0530 +Subject: [PATCH] dns: add TLSA record query and parsing + +PR-URL: https://github.com/nodejs/node/pull/52983 +Refs: https://github.com/nodejs/node/issues/39569 +Reviewed-By: Paolo Insogna +Reviewed-By: James M Snell +Reviewed-By: Rich Trott +Reviewed-By: Ethan Arrowood +--- + doc/api/dns.md | 71 ++++++++++++++++++ + lib/internal/dns/utils.js | 2 + + src/cares_wrap.cc | 96 +++++++++++++++++++++++++ + src/cares_wrap.h | 8 +++ + src/env_properties.h | 4 ++ + test/common/internet.js | 2 + + test/internet/test-dns-cares-domains.js | 1 + + test/internet/test-dns.js | 41 +++++++++++ + test/internet/test-trace-events-dns.js | 1 + + 9 files changed, 226 insertions(+) + +diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js +index 7d9e22d1c2458f..bcca83fd4fe54d 100644 +--- a/third_party/electron_node/lib/internal/dns/utils.js ++++ b/third_party/electron_node/lib/internal/dns/utils.js +@@ -235,6 +235,7 @@ const resolverKeys = [ + 'resolvePtr', + 'resolveSoa', + 'resolveSrv', ++ 'resolveTlsa', + 'resolveTxt', + 'reverse', + ]; +@@ -300,6 +301,7 @@ function createResolverClass(resolver) { + Resolver.prototype.resolveCname = resolveMap.CNAME = resolver('queryCname'); + Resolver.prototype.resolveMx = resolveMap.MX = resolver('queryMx'); + Resolver.prototype.resolveNs = resolveMap.NS = resolver('queryNs'); ++ Resolver.prototype.resolveTlsa = resolveMap.TLSA = resolver('queryTlsa'); + Resolver.prototype.resolveTxt = resolveMap.TXT = resolver('queryTxt'); + Resolver.prototype.resolveSrv = resolveMap.SRV = resolver('querySrv'); + Resolver.prototype.resolvePtr = resolveMap.PTR = resolver('queryPtr'); +diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc +index e79f43d1824b60..f43193c3ce0905 100644 +--- a/third_party/electron_node/src/cares_wrap.cc ++++ b/third_party/electron_node/src/cares_wrap.cc +@@ -40,6 +40,10 @@ + #include + #include + ++#ifndef T_TLSA ++#define T_TLSA 52 /* TLSA certificate association */ ++#endif ++ + #ifndef T_CAA + # define T_CAA 257 /* Certification Authority Authorization */ + #endif +@@ -57,6 +61,7 @@ namespace node { + namespace cares_wrap { + + using v8::Array; ++using v8::ArrayBuffer; + using v8::Context; + using v8::EscapableHandleScope; + using v8::Exception; +@@ -352,6 +357,65 @@ int ParseCaaReply( + return ARES_SUCCESS; + } + ++int ParseTlsaReply(Environment* env, ++ unsigned char* buf, ++ int len, ++ Local ret) { ++ EscapableHandleScope handle_scope(env->isolate()); ++ ++ ares_dns_record_t* dnsrec = nullptr; ++ ++ int status = ares_dns_parse(buf, len, 0, &dnsrec); ++ if (status != ARES_SUCCESS) { ++ ares_dns_record_destroy(dnsrec); ++ return status; ++ } ++ ++ uint32_t offset = ret->Length(); ++ size_t rr_count = ares_dns_record_rr_cnt(dnsrec, ARES_SECTION_ANSWER); ++ ++ for (size_t i = 0; i < rr_count; i++) { ++ const ares_dns_rr_t* rr = ++ ares_dns_record_rr_get(dnsrec, ARES_SECTION_ANSWER, i); ++ ++ if (ares_dns_rr_get_type(rr) != ARES_REC_TYPE_TLSA) continue; ++ ++ unsigned char certusage = ares_dns_rr_get_u8(rr, ARES_RR_TLSA_CERT_USAGE); ++ unsigned char selector = ares_dns_rr_get_u8(rr, ARES_RR_TLSA_SELECTOR); ++ unsigned char match = ares_dns_rr_get_u8(rr, ARES_RR_TLSA_MATCH); ++ size_t data_len; ++ const unsigned char* data = ++ ares_dns_rr_get_bin(rr, ARES_RR_TLSA_DATA, &data_len); ++ if (!data || data_len == 0) continue; ++ ++ Local data_ab = ArrayBuffer::New(env->isolate(), data_len); ++ memcpy(data_ab->Data(), data, data_len); ++ ++ Local tlsa_rec = Object::New(env->isolate()); ++ tlsa_rec ++ ->Set(env->context(), ++ env->cert_usage_string(), ++ Integer::NewFromUnsigned(env->isolate(), certusage)) ++ .Check(); ++ tlsa_rec ++ ->Set(env->context(), ++ env->selector_string(), ++ Integer::NewFromUnsigned(env->isolate(), selector)) ++ .Check(); ++ tlsa_rec ++ ->Set(env->context(), ++ env->match_string(), ++ Integer::NewFromUnsigned(env->isolate(), match)) ++ .Check(); ++ tlsa_rec->Set(env->context(), env->data_string(), data_ab).Check(); ++ ++ ret->Set(env->context(), offset + i, tlsa_rec).Check(); ++ } ++ ++ ares_dns_record_destroy(dnsrec); ++ return ARES_SUCCESS; ++} ++ + int ParseTxtReply( + Environment* env, + const unsigned char* buf, +@@ -861,6 +925,11 @@ int NsTraits::Send(QueryWrap* wrap, const char* name) { + return ARES_SUCCESS; + } + ++int TlsaTraits::Send(QueryWrap* wrap, const char* name) { ++ wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_TLSA); ++ return ARES_SUCCESS; ++} ++ + int TxtTraits::Send(QueryWrap* wrap, const char* name) { + wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_TXT); + return ARES_SUCCESS; +@@ -1045,6 +1114,10 @@ int AnyTraits::Parse( + if (!soa_record.IsEmpty()) + ret->Set(env->context(), ret->Length(), soa_record).Check(); + ++ /* Parse TLSA records */ ++ status = ParseTlsaReply(env, buf, len, ret); ++ if (status != ARES_SUCCESS && status != ARES_ENODATA) return status; ++ + /* Parse CAA records */ + status = ParseCaaReply(env, buf, len, ret, true); + if (status != ARES_SUCCESS && status != ARES_ENODATA) +@@ -1219,6 +1292,27 @@ int NsTraits::Parse( + return ARES_SUCCESS; + } + ++int TlsaTraits::Parse(QueryTlsaWrap* wrap, ++ const std::unique_ptr& response) { ++ if (response->is_host) [[unlikely]] { ++ return ARES_EBADRESP; ++ } ++ ++ unsigned char* buf = response->buf.data; ++ int len = response->buf.size; ++ ++ Environment* env = wrap->env(); ++ HandleScope handle_scope(env->isolate()); ++ Context::Scope context_scope(env->context()); ++ ++ Local tlsa_records = Array::New(env->isolate()); ++ int status = ParseTlsaReply(env, buf, len, tlsa_records); ++ if (status != ARES_SUCCESS) return status; ++ ++ wrap->CallOnComplete(tlsa_records); ++ return ARES_SUCCESS; ++} ++ + int TxtTraits::Parse( + QueryTxtWrap* wrap, + const std::unique_ptr& response) { +@@ -1998,6 +2092,7 @@ void Initialize(Local target, + SetProtoMethod(isolate, channel_wrap, "queryCname", Query); + SetProtoMethod(isolate, channel_wrap, "queryMx", Query); + SetProtoMethod(isolate, channel_wrap, "queryNs", Query); ++ SetProtoMethod(isolate, channel_wrap, "queryTlsa", Query); + SetProtoMethod(isolate, channel_wrap, "queryTxt", Query); + SetProtoMethod(isolate, channel_wrap, "querySrv", Query); + SetProtoMethod(isolate, channel_wrap, "queryPtr", Query); +@@ -2029,6 +2124,7 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) { + registry->Register(Query); + registry->Register(Query); + registry->Register(Query); ++ registry->Register(Query); + registry->Register(Query); + registry->Register(Query); + registry->Register(Query); +diff --git a/src/cares_wrap.h b/src/cares_wrap.h +index 4a5d22c0ef085f..6703a5fee3d529 100644 +--- a/third_party/electron_node/src/cares_wrap.h ++++ b/third_party/electron_node/src/cares_wrap.h +@@ -460,6 +460,13 @@ struct NsTraits final { + const std::unique_ptr& response); + }; + ++struct TlsaTraits final { ++ static constexpr const char* name = "resolveTlsa"; ++ static int Send(QueryWrap* wrap, const char* name); ++ static int Parse(QueryWrap* wrap, ++ const std::unique_ptr& response); ++}; ++ + struct TxtTraits final { + static constexpr const char* name = "resolveTxt"; + static int Send(QueryWrap* wrap, const char* name); +@@ -515,6 +522,7 @@ using QueryCaaWrap = QueryWrap; + using QueryCnameWrap = QueryWrap; + using QueryMxWrap = QueryWrap; + using QueryNsWrap = QueryWrap; ++using QueryTlsaWrap = QueryWrap; + using QueryTxtWrap = QueryWrap; + using QuerySrvWrap = QueryWrap; + using QueryPtrWrap = QueryWrap; +diff --git a/src/env_properties.h b/src/env_properties.h +index 9d22dc69754178..bc97dfc66c96f9 100644 +--- a/third_party/electron_node/src/env_properties.h ++++ b/third_party/electron_node/src/env_properties.h +@@ -91,6 +91,7 @@ + V(cached_data_rejected_string, "cachedDataRejected") \ + V(cached_data_string, "cachedData") \ + V(cache_key_string, "cacheKey") \ ++ V(cert_usage_string, "certUsage") \ + V(change_string, "change") \ + V(changes_string, "changes") \ + V(channel_string, "channel") \ +@@ -135,6 +136,7 @@ + V(dns_ptr_string, "PTR") \ + V(dns_soa_string, "SOA") \ + V(dns_srv_string, "SRV") \ ++ V(dns_tlsa_string, "TLSA") \ + V(dns_txt_string, "TXT") \ + V(done_string, "done") \ + V(duration_string, "duration") \ +@@ -237,6 +239,7 @@ + V(line_number_string, "lineNumber") \ + V(loop_count, "loopCount") \ + V(mac_string, "mac") \ ++ V(match_string, "match") \ + V(max_buffer_string, "maxBuffer") \ + V(max_concurrent_streams_string, "maxConcurrentStreams") \ + V(message_port_constructor_string, "MessagePort") \ +@@ -336,6 +339,7 @@ + V(scopeid_string, "scopeid") \ + V(script_id_string, "scriptId") \ + V(script_name_string, "scriptName") \ ++ V(selector_string, "selector") \ + V(serial_number_string, "serialNumber") \ + V(serial_string, "serial") \ + V(servername_string, "servername") \ diff --git a/node-cares-1.21-3.patch b/node-cares-1.21-3.patch new file mode 100644 index 0000000..21465a7 --- /dev/null +++ b/node-cares-1.21-3.patch @@ -0,0 +1,31 @@ +From b85505d450e3a401cf0d13c096abfc75a7932105 Mon Sep 17 00:00:00 2001 +From: Ethan Arrowood +Date: Mon, 7 Apr 2025 05:43:14 -0600 +Subject: [PATCH] dns: restore dns query cache ttl + +Fixes: https://github.com/nodejs/node/issues/57636 + +Co-authored-by: Robert Nagy +PR-URL: https://github.com/nodejs/node/pull/57640 +Reviewed-By: Matteo Collina +Reviewed-By: Robert Nagy +Reviewed-By: Tim Perry +Reviewed-By: Luigi Pinca +Reviewed-By: Ruben Bridgewater +Reviewed-By: James M Snell +--- + src/cares_wrap.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc +index e58f164ca5124a..fc8f361614ba5f 100644 +--- a/third_party/electron_node/src/cares_wrap.cc ++++ b/third_party/electron_node/src/cares_wrap.cc +@@ -778,6 +778,7 @@ void ChannelWrap::Setup() { + options.sock_state_cb_data = this; + options.timeout = timeout_; + options.tries = tries_; ++ options.qcache_max_ttl = 0; + + int r; + if (!library_inited_) { diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 4f95653..dad80df 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sat May 17 09:18:14 UTC 2025 - Bruno Pitrus + +- New upstream release 35.4.0 + * Node 22.15.0 + * Added support for system-context-menu on Linux + * Fixed a possible crash using the WebView tag and calling focus +- Drop CheckPortalAvailabilityOnBusThread-UaF-crash.patch applied upstream +- Add system-zstd-in-node.patch to fix build error +- 15.6: reverse upstream changes to build with old cares + * node-cares-1.21-2.patch + * node-cares-1.21-3.patch + ------------------------------------------------------------------- Fri May 9 15:31:47 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 3405be7..cd06a91 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -189,7 +189,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.3.0 +Version: 35.4.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -216,6 +216,8 @@ Source413: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch Source461: webrtc-make_ref_counted-absl2024-nullability.patch # and c-ares 1.19 Source470: node-cares-1.21.patch +Source471: node-cares-1.21-2.patch +Source472: node-cares-1.21-3.patch # and spirv 2023 Source480: angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch @@ -310,6 +312,7 @@ Patch1091: use-system-libraries-in-node.patch Patch1092: fix-system-highway.patch Patch1093: system-sqlite.patch Patch1094: absl_strings-missing-headers.patch +Patch1095: system-zstd-in-node.patch # PATCHES to fix interaction with third-party software @@ -380,7 +383,6 @@ Patch3206: string-hasher-flax-vector-conversions.patch Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch Patch3208: to_vector-std-projected-gcc119888.patch Patch3209: file_dialog-missing-uint32_t.patch -Patch3210: CheckPortalAvailabilityOnBusThread-UaF-crash.patch Patch3211: html_permission_element_strings_map-reproducible.patch # Patches to re-enable upstream force disabled features. @@ -732,6 +734,8 @@ patch -R -p1 < %SOURCE413 %endif %if %{without cares_21} +patch -R -p1 < %SOURCE472 +patch -R -p1 < %SOURCE471 patch -R -p1 < %SOURCE470 %endif diff --git a/system-zstd-in-node.patch b/system-zstd-in-node.patch new file mode 100644 index 0000000..195d20f --- /dev/null +++ b/system-zstd-in-node.patch @@ -0,0 +1,10 @@ +--- src/build/linux/unbundle/zstd.gn.orig 2025-05-15 00:07:52.687879791 +0200 ++++ src/build/linux/unbundle/zstd.gn 2025-05-15 00:52:47.403841155 +0200 +@@ -25,3 +25,7 @@ source_set("decompress") { + public_configs = [ ":system_zstd" ] + public_deps = [ ":zstd_headers" ] + } ++source_set("headers") { ++ public_configs = [ ":system_zstd" ] ++ public_deps = [ ":zstd_headers" ] ++} diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch index 1c5f6e1..91ca253 100644 --- a/use-system-libraries-in-node.patch +++ b/use-system-libraries-in-node.patch @@ -16,8 +16,8 @@ Both this and the unbundle flags should be upstreamed but probably separately. } assert(!node_enable_inspector || node_use_openssl, ---- src/third_party/electron_node/unofficial.gni 2025-04-24 18:36:09.022852136 +0200 -+++ src/third_party/electron_node/unofficial.gni 2025-04-29 11:31:11.474026894 +0200 +--- src/third_party/electron_node/unofficial.gni.orig 2025-05-14 23:39:11.439896657 +0200 ++++ src/third_party/electron_node/unofficial.gni 2025-05-15 00:49:20.743843435 +0200 @@ -9,6 +9,35 @@ import("$node_v8_path/gni/v8.gni") # The actual configurations are put inside a template in unofficial.gni to # prevent accidental edits from contributors. @@ -54,7 +54,7 @@ Both this and the unbundle flags should be upstreamed but probably separately. config("node_features") { defines = [] if (is_component_build) { -@@ -138,23 +167,19 @@ template("node_gn_build") { +@@ -139,24 +168,20 @@ template("node_gn_build") { source_set("libnode") { configs += [ ":node_internal_config" ] @@ -62,6 +62,7 @@ Both this and the unbundle flags should be upstreamed but probably separately. public_configs = [ ":node_external_config", "deps/googletest:googletest_config", + ":zstd_include_config" ] public_deps = [ - "deps/ada", @@ -79,9 +80,9 @@ Both this and the unbundle flags should be upstreamed but probably separately. "deps/postject", "deps/sqlite", "deps/uvwasi", -@@ -179,21 +204,36 @@ template("node_gn_build") { - if (is_mac) { - frameworks = [ "CoreFoundation.framework" ] +@@ -186,21 +211,36 @@ template("node_gn_build") { + "Security.framework", + ] } - if (is_posix) { - configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] @@ -122,7 +123,7 @@ Both this and the unbundle flags should be upstreamed but probably separately. if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] } -@@ -222,19 +262,6 @@ template("node_gn_build") { +@@ -229,19 +269,6 @@ template("node_gn_build") { sources += node_inspector.node_inspector_sources + node_inspector.node_inspector_generated_sources } @@ -141,4 +142,18 @@ Both this and the unbundle flags should be upstreamed but probably separately. - } } - executable(target_name) { + config("zstd_include_config") { +@@ -435,11 +462,13 @@ template("node_gn_build") { + ] + + sources = [ "src/node_snapshot_stub.cc" ] ++ if(false) { #Test only target, not sure why it breaks gn + sources += exec_script("./tools/search_files.py", + [ rebase_path(".", root_build_dir), + rebase_path("test/cctest", root_build_dir), + "cc" ], + "list lines") ++ } + + if (node_use_openssl) { + deps += [ "deps/ncrypto" ] -- 2.51.1 From 7a3d1476115f35bbf94d54adb4de37f94069244a279caf32a2a7412f1a6953a0 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 24 May 2025 15:29:19 +0000 Subject: [PATCH 58/80] - Fedora 43+: bacport change to fix build with llhttp 9.3 (node-llhttp9.3.patch) OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=210 --- node-llhttp9.3.patch | 54 +++++++++++++++++++++++++++++++++++++++++ nodejs-electron.changes | 5 ++++ nodejs-electron.spec | 18 ++++++++++++-- 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 node-llhttp9.3.patch diff --git a/node-llhttp9.3.patch b/node-llhttp9.3.patch new file mode 100644 index 0000000..68e8cf9 --- /dev/null +++ b/node-llhttp9.3.patch @@ -0,0 +1,54 @@ +From 4454d09e8f7225ec1b576ef86c8705bca63a136c Mon Sep 17 00:00:00 2001 +From: Fedor Indutny <238531+indutny@users.noreply.github.com> +Date: Wed, 7 May 2025 07:21:52 -0700 +Subject: [PATCH] deps: update llhttp to 9.3.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +llhttp@9.3.0 optimizes header value parsing on ARM Neon/WASM, and adds +support for a protocol callback for use outside of the typical HTTP +setting (RTSP/ICE). + +PR-URL: https://github.com/nodejs/node/pull/58144 +Reviewed-By: Rafael Gonzaga +Reviewed-By: Juan José Arboleda +Reviewed-By: Matteo Collina +Reviewed-By: Marco Ippolito +--- + deps/llhttp/CMakeLists.txt | 7 +- + deps/llhttp/LICENSE | 22 + + deps/llhttp/README.md | 9 +- + deps/llhttp/include/llhttp.h | 10 +- + deps/llhttp/libllhttp.pc.in | 8 +- + deps/llhttp/src/api.c | 45 +- + deps/llhttp/src/llhttp.c | 2841 ++++++++--------- + src/node_http_parser.cc | 6 + + test/parallel/test-http-client-parse-error.js | 2 +- + 9 files changed, 1459 insertions(+), 1491 deletions(-) + create mode 100644 deps/llhttp/LICENSE + +diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc +index acebdd952eb943..25aa204ee2c851 100644 +--- a/third_party/electron_node/src/node_http_parser.cc ++++ b/third_party/electron_node/src/node_http_parser.cc +@@ -1204,6 +1204,10 @@ void ConnectionsList::Expired(const FunctionCallbackInfo& args) { + + const llhttp_settings_t Parser::settings = { + Proxy::Raw, ++ ++ // on_protocol ++ nullptr, ++ + Proxy::Raw, + Proxy::Raw, + +@@ -1223,6 +1227,8 @@ const llhttp_settings_t Parser::settings = { + Proxy::Raw, + Proxy::Raw, + ++ // on_protocol_complete ++ nullptr, + // on_url_complete + nullptr, + // on_status_complete diff --git a/nodejs-electron.changes b/nodejs-electron.changes index dad80df..a275aa5 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat May 24 13:25:36 UTC 2025 - Bruno Pitrus + +- Fedora 43+: bacport change to fix build with llhttp 9.3 (node-llhttp9.3.patch) + ------------------------------------------------------------------- Sat May 17 09:18:14 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index cd06a91..3fe28aa 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -124,6 +124,11 @@ ExcludeArch: %arm %bcond_with system_ada %endif +%if 0%{?fedora} >= 43 +%bcond_without llhttp_93 +%else +%bcond_with llhttp_93 +%endif # requires `base64_options` %if 0%{?fedora} >= 42 @@ -339,7 +344,11 @@ Patch2062: wayland_version.patch Patch2063: fix-building-with-pipewire-1.3.82.patch #Conditionably disable feature which requires new highway Patch2064: blink-shape_result-highway.patch - +%if %{with system_llhttp} && %{with llhttp_93} +Patch2065: node-llhttp9.3.patch +%else +Source2065: node-llhttp9.3.patch +%endif # PATCHES that should be submitted upstream verbatim or near-verbatim # Fix blink nodestructor @@ -426,6 +435,11 @@ BuildRequires: libpng-devel BuildRequires: libXNVCtrl-devel %if %{with system_llhttp} BuildRequires: llhttp-devel >= 8 +%if %{with llhttp_93} +BuildRequires: llhttp-devel >= 9.3 +%else +BuildRequires: llhttp-devel < 9.3 +%endif %endif %if %{with swiftshader} && %{without subzero} BuildRequires: llvm-devel >= 16 @@ -1035,7 +1049,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=3 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=3 " %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" -- 2.51.1 From c921912f7b3df18507ea601591dc3bdc534a508a7ee59a7971243fd35f393b49 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 29 May 2025 17:44:28 +0000 Subject: [PATCH 59/80] Accepting request 1281188 from home:dziobian:gulgul-ultron:19 - New upstream release 35.5.0 * Node 22.15.1 * Added innerWidth and innerHeight options for window.open. #47045 (Also in 36, 37) * Added support for screen.dipToScreenPoint(point) and screen.screenToDipPoint(point) on Linux X11. * Added support for node option --experimental-network-inspection. * Security fixes for for CVE-2025-4609 CVE-2025-4664 (bsc#1243205) - Do not build Chromium extensions support as it's not used by us * reduce-gn-tree.patch * build-without-extensions.patch * build-without-guest-view.patch * extensions-common-assert.patch OBS-URL: https://build.opensuse.org/request/show/1281188 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=211 --- build-without-extensions.patch | 60 +++++++++++++++ build-without-guest-view.patch | 28 +++++++ electron-35.4.0.tar.zst | 3 - electron-35.5.0.tar.zst | 3 + extensions-common-assert.patch | 134 +++++++++++++++++++++++++++++++++ nodejs-electron.changes | 15 ++++ nodejs-electron.spec | 55 ++++++++++---- reduce-gn-tree.patch | 32 ++++++++ 8 files changed, 311 insertions(+), 19 deletions(-) create mode 100644 build-without-extensions.patch create mode 100644 build-without-guest-view.patch delete mode 100644 electron-35.4.0.tar.zst create mode 100644 electron-35.5.0.tar.zst create mode 100644 extensions-common-assert.patch create mode 100644 reduce-gn-tree.patch diff --git a/build-without-extensions.patch b/build-without-extensions.patch new file mode 100644 index 0000000..8ff154a --- /dev/null +++ b/build-without-extensions.patch @@ -0,0 +1,60 @@ +--- src/extensions/common/BUILD.gn.orig 2025-05-22 20:15:08.686176429 +0200 ++++ src/extensions/common/BUILD.gn 2025-05-24 11:58:30.839954172 +0200 +@@ -243,10 +243,6 @@ static_library("common") { + "api/commands/commands_handler.h", + "api/declarative/declarative_constants.cc", + "api/declarative/declarative_constants.h", +- "api/declarative/declarative_manifest_data.cc", +- "api/declarative/declarative_manifest_data.h", +- "api/declarative/declarative_manifest_handler.cc", +- "api/declarative/declarative_manifest_handler.h", + "api/declarative_net_request/constants.cc", + "api/declarative_net_request/constants.h", + "api/declarative_net_request/dnr_manifest_data.cc", +@@ -266,8 +262,6 @@ static_library("common") { + "api/printer_provider/usb_printer_manifest_data.h", + "api/printer_provider/usb_printer_manifest_handler.cc", + "api/printer_provider/usb_printer_manifest_handler.h", +- "api/scripts_internal/script_serialization.cc", +- "api/scripts_internal/script_serialization.h", + "api/sockets/sockets_manifest_data.cc", + "api/sockets/sockets_manifest_data.h", + "api/sockets/sockets_manifest_handler.cc", +@@ -378,8 +372,6 @@ static_library("common") { + "manifest_handlers/background_info.h", + "manifest_handlers/content_capabilities_handler.cc", + "manifest_handlers/content_capabilities_handler.h", +- "manifest_handlers/content_scripts_handler.cc", +- "manifest_handlers/content_scripts_handler.h", + "manifest_handlers/cross_origin_isolation_info.cc", + "manifest_handlers/cross_origin_isolation_info.h", + "manifest_handlers/csp_info.cc", +@@ -390,10 +382,6 @@ static_library("common") { + "manifest_handlers/extension_action_handler.h", + "manifest_handlers/externally_connectable.cc", + "manifest_handlers/externally_connectable.h", +- "manifest_handlers/file_handler_info.cc", +- "manifest_handlers/file_handler_info.h", +- "manifest_handlers/icon_variants_handler.cc", +- "manifest_handlers/icon_variants_handler.h", + "manifest_handlers/icons_handler.cc", + "manifest_handlers/icons_handler.h", + "manifest_handlers/incognito_info.cc", +@@ -422,8 +410,6 @@ static_library("common") { + "manifest_handlers/trial_tokens_handler.h", + "manifest_handlers/web_accessible_resources_info.cc", + "manifest_handlers/web_accessible_resources_info.h", +- "manifest_handlers/web_file_handlers_info.cc", +- "manifest_handlers/web_file_handlers_info.h", + "manifest_handlers/webview_info.cc", + "manifest_handlers/webview_info.h", + "manifest_url_handlers.cc", +@@ -481,8 +467,6 @@ static_library("common") { + "user_script.h", + "utils/base_string.cc", + "utils/base_string.h", +- "utils/content_script_utils.cc", +- "utils/content_script_utils.h", + "utils/extension_types_utils.cc", + "utils/extension_types_utils.h", + "utils/extension_utils.cc", diff --git a/build-without-guest-view.patch b/build-without-guest-view.patch new file mode 100644 index 0000000..1758ca1 --- /dev/null +++ b/build-without-guest-view.patch @@ -0,0 +1,28 @@ +--- src/components/permissions/permission_context_base.cc.orig 2025-05-22 20:15:04.346176805 +0200 ++++ src/components/permissions/permission_context_base.cc 2025-05-24 13:09:21.758872333 +0200 +@@ -26,6 +26,7 @@ + #include "components/content_settings/core/common/content_settings_pattern.h" + #include "components/content_settings/core/common/content_settings_types.h" + #include "components/content_settings/core/common/features.h" ++#include "components/guest_view/buildflags/buildflags.h" + #include "components/permissions/features.h" + #include "components/permissions/permission_context_base.h" + #include "components/permissions/permission_decision_auto_blocker.h" +@@ -46,7 +47,7 @@ + #include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom.h" + #include "url/gurl.h" + +-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) ++#if BUILDFLAG(ENABLE_GUEST_VIEW) + #include "components/guest_view/browser/guest_view_base.h" + #endif + +@@ -316,7 +317,7 @@ content::PermissionResult PermissionCont + } + } + +-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) ++#if BUILDFLAG(ENABLE_GUEST_VIEW) + guest_view::GuestViewBase* guest = + guest_view::GuestViewBase::FromRenderFrameHost(render_frame_host); + if (guest) { diff --git a/electron-35.4.0.tar.zst b/electron-35.4.0.tar.zst deleted file mode 100644 index 7aacc84..0000000 --- a/electron-35.4.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dcd37ad7b2b688512657708c5fbb7009763f53fff32f657f96d1cf0aa3f88bdf -size 753774373 diff --git a/electron-35.5.0.tar.zst b/electron-35.5.0.tar.zst new file mode 100644 index 0000000..88e5e09 --- /dev/null +++ b/electron-35.5.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e446c272aba7da2ae28bd752a26f891df0f81eb2edd1628f0d23abadf9a7a9cc +size 753856573 diff --git a/extensions-common-assert.patch b/extensions-common-assert.patch new file mode 100644 index 0000000..5fa45fa --- /dev/null +++ b/extensions-common-assert.patch @@ -0,0 +1,134 @@ +From cf0e064ce3b7c6b809861a6d299165b74cce109e Mon Sep 17 00:00:00 2001 +From: James Cook +Date: Thu, 22 May 2025 10:23:47 -0700 +Subject: [PATCH] extensions: Clean up ENABLE_EXTENSIONS in //extensions + +TestRuntimeApiDelegate can be safely added to the build now. +Also, replace ENABLE_EXTENSIONS || ENABLE_DESKTOP_ANDROID_EXTENSIONS +with ENABLE_EXTENSIONS_CORE, to be consistent with the rest of the +codebase. + +Bug: 356905053 +Change-Id: I616391c2843c6c5e20188803f2a51c6f83165927 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6576511 +Reviewed-by: Devlin Cronin +Commit-Queue: James Cook +Cr-Commit-Position: refs/heads/main@{#1464202} +--- + extensions/BUILD.gn | 12 ++---------- + extensions/browser/extension_registry.h | 3 +-- + extensions/browser/extension_system.h | 3 +-- + extensions/browser/test_extensions_browser_client.cc | 12 +----------- + extensions/common/extension.h | 3 +-- + 5 files changed, 6 insertions(+), 27 deletions(-) + +diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn +index 0ea291f16ba70b..586fd7461e4cd9 100644 +--- a/extensions/BUILD.gn ++++ b/extensions/BUILD.gn +@@ -111,6 +111,8 @@ static_library("test_support") { + "browser/test_image_loader.h", + "browser/test_management_policy.cc", + "browser/test_management_policy.h", ++ "browser/test_runtime_api_delegate.cc", ++ "browser/test_runtime_api_delegate.h", + "common/extension_builder.cc", + "common/extension_builder.h", + "common/manifest_test.cc", +@@ -198,16 +200,6 @@ static_library("test_support") { + deps += [ "//components/guest_view/browser:test_support" ] + } + +- # TODO(https://crbug.com/356905053): The following files don't compile cleanly +- # with desktop-android. Either make them compile, or determine they should +- # not be included and place them under a more appropriate if-block. +- if (enable_extensions) { +- sources += [ +- "browser/test_runtime_api_delegate.cc", +- "browser/test_runtime_api_delegate.h", +- ] +- } +- + # Generally, //extensions should not depend on //chromeos. However, a number + # of the APIs and the extensions shell already do. We should try to avoid + # expanding these dependencies. +diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h +index 4ed65fdce8af21..1ee1b70458a068 100644 +--- a/extensions/browser/extension_registry.h ++++ b/extensions/browser/extension_registry.h +@@ -19,8 +19,7 @@ + #include "extensions/common/extension_id.h" + #include "extensions/common/extension_set.h" + +-static_assert(BUILDFLAG(ENABLE_EXTENSIONS) || +- BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)); ++static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE)); + + namespace content { + class BrowserContext; +diff --git a/extensions/browser/extension_system.h b/extensions/browser/extension_system.h +index 369dad723495a4..eccf3b2d331724 100644 +--- a/extensions/browser/extension_system.h ++++ b/extensions/browser/extension_system.h +@@ -17,8 +17,7 @@ + #include "extensions/common/extension.h" + #include "extensions/common/extension_id.h" + +-static_assert(BUILDFLAG(ENABLE_EXTENSIONS) || +- BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)); ++static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE)); + + namespace base { + class OneShotEvent; +diff --git a/extensions/browser/test_extensions_browser_client.cc b/extensions/browser/test_extensions_browser_client.cc +index 88ce18dd343016..f914fae7205f88 100644 +--- a/extensions/browser/test_extensions_browser_client.cc ++++ b/extensions/browser/test_extensions_browser_client.cc +@@ -10,6 +10,7 @@ + #include "build/chromeos_buildflags.h" + #include "content/public/browser/browser_context.h" + #include "extensions/browser/extension_host_delegate.h" ++#include "extensions/browser/test_runtime_api_delegate.h" + #include "extensions/browser/updater/null_extension_cache.h" + #include "extensions/buildflags/buildflags.h" + #include "extensions/common/extension_id.h" +@@ -17,13 +18,6 @@ + #include "services/network/public/mojom/url_loader.mojom.h" + #include "ui/base/l10n/l10n_util.h" + +-// TODO(https://crbug.com/356905053): The following files don't compile cleanly +-// with desktop-android. Either make them compile, or determine they should +-// not be included and place them under a more appropriate if-block. +-#if BUILDFLAG(ENABLE_EXTENSIONS) +-#include "extensions/browser/test_runtime_api_delegate.h" +-#endif +- + #if BUILDFLAG(IS_CHROMEOS) + #include "chromeos/ash/components/login/login_state/login_state.h" + #endif +@@ -260,11 +254,7 @@ void TestExtensionsBrowserClient::RegisterBrowserInterfaceBindersForFrame( + std::unique_ptr + TestExtensionsBrowserClient::CreateRuntimeAPIDelegate( + content::BrowserContext* context) const { +-#if BUILDFLAG(ENABLE_EXTENSIONS) + return std::unique_ptr(new TestRuntimeAPIDelegate()); +-#else +- return nullptr; +-#endif + } + + const ComponentExtensionResourceManager* +diff --git a/extensions/common/extension.h b/extensions/common/extension.h +index ec776e6207057b..33a196f11a519a 100644 +--- a/extensions/common/extension.h ++++ b/extensions/common/extension.h +@@ -29,8 +29,7 @@ + #include "url/gurl.h" + #include "url/origin.h" + +-static_assert(BUILDFLAG(ENABLE_EXTENSIONS) || +- BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)); ++static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE)); + + namespace extensions { + class HashedExtensionId; diff --git a/nodejs-electron.changes b/nodejs-electron.changes index a275aa5..7f21847 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu May 29 17:37:49 UTC 2025 - Bruno Pitrus + +- New upstream release 35.5.0 + * Node 22.15.1 + * Added innerWidth and innerHeight options for window.open. #47045 (Also in 36, 37) + * Added support for screen.dipToScreenPoint(point) and screen.screenToDipPoint(point) on Linux X11. + * Added support for node option --experimental-network-inspection. + * Security fixes for for CVE-2025-4609 CVE-2025-4664 (bsc#1243205) +- Do not build Chromium extensions support as it's not used by us + * reduce-gn-tree.patch + * build-without-extensions.patch + * build-without-guest-view.patch + * extensions-common-assert.patch + ------------------------------------------------------------------- Sat May 24 13:25:36 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 3fe28aa..d8ad866 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -194,7 +194,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.4.0 +Version: 35.5.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -250,6 +250,7 @@ Patch86: enable_stack_trace_line_numbers-symbol_level.patch Patch97: chromium-127-cargo_crate.patch Patch98: gn-logspam-breaks-install.patch Patch99: torque-debuginfo.patch +Patch100: reduce-gn-tree.patch # PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors, @@ -284,6 +285,8 @@ Patch602: remove-ai-language-detection-factory-which-requires-tflite-and-l Patch603: build-without-mesage-center.patch Patch604: disable-avif-really.patch Patch605: permission-gcc14.2.patch +Patch606: build-without-extensions.patch +Patch607: build-without-guest-view.patch @@ -393,6 +396,7 @@ Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch Patch3208: to_vector-std-projected-gcc119888.patch Patch3209: file_dialog-missing-uint32_t.patch Patch3211: html_permission_element_strings_map-reproducible.patch +Patch3212: extensions-common-assert.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -1049,7 +1053,7 @@ unset MALLOC_PERTURB_ %if %{with lto} %ifarch aarch64 -export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=3 " +export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=4 " %else # x64 is fine with the the default settings (the machines have 30GB+ ram) export LDFLAGS="$LDFLAGS -flto=auto" @@ -1177,8 +1181,12 @@ myconf_gn+=' enable_platform_apps=false' %if 0%{?fedora} myconf_gn+=' symbol_level=1' #OOM during linking %else +%ifarch aarch64 #OOM or logidlelimit, pick your poison +myconf_gn+=' symbol_level=1' +%else myconf_gn+=' symbol_level=2' %endif +%endif myconf_gn+=' blink_symbol_level=1' myconf_gn+=' v8_symbol_level=1' @@ -1192,7 +1200,6 @@ myconf_gn+=' use_debug_fission=true' # do not build some chrome features not used by electron # (some of these only go to buildflag_headers and are dead code rn, but disabling them preemptively as long as they're visible) myconf_gn+=" enable_vr=false" -myconf_gn+=" enable_reading_list=false" myconf_gn+=" enable_reporting=false" myconf_gn+=" build_with_tflite_lib=false" myconf_gn+=" build_tflite_with_xnnpack=false" @@ -1210,7 +1217,6 @@ myconf_gn+=" enable_click_to_call=false" myconf_gn+=" enable_webui_tab_strip=false" myconf_gn+=" enable_webui_certificate_viewer=false" myconf_gn+=" enable_background_contents=false" -myconf_gn+=" enable_extractors=false" myconf_gn+=" ozone_platform_headless=false" myconf_gn+=" angle_enable_gl_null=false" myconf_gn+=" enable_paint_preview=false" @@ -1228,12 +1234,20 @@ myconf_gn+=' enterprise_content_analysis=true' myconf_gn+=' enable_video_effects=false' myconf_gn+=' use_fake_screen_ai=true' myconf_gn+=' webnn_use_tflite=false' -myconf_gn+=' structured_metrics_enabled=false' -myconf_gn+=' structured_metrics_debug_enabled=false' myconf_gn+=' build_dawn_tests=false' myconf_gn+=' enable_compute_pressure=false' +#These can only be disabled if we don't start at //... but at //electron:... +myconf_gn+=' absl_build_tests=false' +myconf_gn+=' build_with_model_execution=false' +myconf_gn+=' enable_extensions=false' +myconf_gn+=' enable_guest_view=false' +myconf_gn+=' enable_extensions_core=true' #cannot be disabled yet +myconf_gn+=' enable_on_device_translation=false' +myconf_gn+=' enable_session_service=false' + + #FIXME: possibly enable this when skia gets built with rust code by default. #Need to patch in optflags and possibly FFI LTO hacks (see signal-desktop package for how it's done) @@ -1244,8 +1258,6 @@ myconf_gn+=' enable_chromium_prelude=false' myconf_gn+=' chrome_root_store_cert_management_ui=false' myconf_gn+=' use_kerberos=false' -myconf_gn+=' disable_histogram_support=true' - #Do not build Chromecast myconf_gn+=" enable_remoting=false" @@ -1254,7 +1266,6 @@ myconf_gn+=" enable_service_discovery=false" myconf_gn+=' enable_mdns=false' #disable some debug/tracing hooks, they increase size and we do not build chrome://tracing anyway (see disable-catapult.patch) -myconf_gn+=" enable_trace_logging=false" myconf_gn+=" optional_trace_events_enabled=false" myconf_gn+=" rtc_disable_logging=true" myconf_gn+=" rtc_disable_metrics=true" @@ -1362,7 +1373,13 @@ myconf_gn+=" ffmpeg_branding=\"Chrome\"" # GN does not support passing cflags: # https://bugs.chromium.org/p/chromium/issues/detail?id=642016 -gn gen out/Release --testonly=false --args="import(\"//electron/build/args/release.gn\") ${myconf_gn}" +gn gen out/Release --testonly=false \ +--root-target=//electron:electron_app \ +--root-pattern=//electron:electron_app \ +--root-pattern=//electron:chromium_licenses \ +--root-pattern=//electron:copy_node_headers \ +--root-pattern=//electron:electron_version_file \ +--args="import(\"//electron/build/args/release.gn\") ${myconf_gn}" # dump the linker command line (if any) in case of failure @@ -1393,7 +1410,13 @@ desktop-file-install --dir %{buildroot}%{_datadir}/applications/ %{SOURCE11} pushd out/Release install -pm 0644 version -t %{buildroot}%{_libdir}/electron/ -gn desc . //electron:electron_app runtime_deps | grep -v ^gen/ | sort | uniq | xargs -t cp -a -v --parents -t %{buildroot}%{_libdir}/electron/ -- +gn desc \ +--root-target=//electron:electron_app \ +--root-pattern=//electron:electron_app \ +--root-pattern=//electron:chromium_licenses \ +--root-pattern=//electron:copy_node_headers \ +--root-pattern=//electron:electron_version_file \ +. //electron:electron_app runtime_deps | grep -v ^gen/ | sort | uniq | xargs -t cp -a -v --parents -t %{buildroot}%{_libdir}/electron/ -- popd @@ -1486,11 +1509,11 @@ EOF chmod -v 644 %{buildroot}%{_rpmconfigdir}/macros.d/macros.electron #help debugedit find the source files -ln -srv third_party/emoji-segmenter/src/emoji_presentation_scanner.c -t out/Release -ln -srv third_party/emoji-segmenter/src/emoji_presentation_scanner.rl -t out/Release -ln -srv third_party/angle/src/compiler/translator/glslang.l -t out/Release -ln -srv third_party/angle/src/compiler/preprocessor/preprocessor.l -t out/Release -ln -srv third_party -t out/Release +ln -srvf third_party/emoji-segmenter/src/emoji_presentation_scanner.c -t out/Release +ln -srvf third_party/emoji-segmenter/src/emoji_presentation_scanner.rl -t out/Release +ln -srvf third_party/angle/src/compiler/translator/glslang.l -t out/Release +ln -srvf third_party/angle/src/compiler/preprocessor/preprocessor.l -t out/Release +ln -srvf third_party -t out/Release %files %license electron/LICENSE out/Release/LICENSES.chromium.html diff --git a/reduce-gn-tree.patch b/reduce-gn-tree.patch new file mode 100644 index 0000000..bd7a2aa --- /dev/null +++ b/reduce-gn-tree.patch @@ -0,0 +1,32 @@ +Run gn starting at only the targets we want to build (//electron:blah), not at (//...) to avoid hitting asserts in dead code. +This makes this overriden build argument dead code which causes a warning during `gen` and more importantly `desc`. Remove it. + +--- src/electron/build/args/all.gn 2025-05-22 20:03:50.586242102 +0200 ++++ src/electron/build/args/all.gn 2025-05-22 21:32:07.485697337 +0200 +@@ -1,5 +1,4 @@ + 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 = 133 + +All gn list calls must be also fixed because otherwise they fail just as gn gen does + + +--- src/third_party/electron_node/tools/generate_config_gypi.py.orig 2025-05-22 20:19:41.558145459 +0200 ++++ src/third_party/electron_node/tools/generate_config_gypi.py 2025-05-22 22:01:23.213518671 +0200 +@@ -30,7 +30,13 @@ def bool_string_to_number(v): + def get_gn_config(out_dir): + # Read args from GN configurations. + gn_args = subprocess.check_output( +- [GN, 'args', '--list', '--short', '-C', out_dir]) ++ [GN, 'args', '--list', ++ '--root-target=//electron:electron_app', ++ '--root-pattern=//electron:electron_app', ++ '--root-pattern=//electron:chromium_licenses', ++ '--root-pattern=//electron:copy_node_headers', ++ '--root-pattern=//electron:electron_version_file', ++ '--short', '-C', out_dir]) + config = dict(re.findall(GN_RE, gn_args.decode())) + # Get napi_build_version from Node, which is not part of GN args. + config['napi_build_version'] = getnapibuildversion.get_napi_version() -- 2.51.1 From 65b12fafedcb70f72700a50ea0e76ad6679eed61685a20e1fe88e4fe6c71309d Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 5 Jun 2025 05:16:54 +0000 Subject: [PATCH 60/80] Accepting request 1282944 from home:dziobian:gulgul-ultron:19 - New upstream release 35.5.1 * Fixed addChildView() crashes when adding a closed WebContentsView. * Fixed crash when pausing in loops due to missing context when desugared. * Fixed out of bounds read and write in V8 (CVE-2025-5419 bsc#1244020) OBS-URL: https://build.opensuse.org/request/show/1282944 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=212 --- electron-35.5.0.tar.zst | 3 --- electron-35.5.1.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 6 ++++-- 4 files changed, 15 insertions(+), 5 deletions(-) delete mode 100644 electron-35.5.0.tar.zst create mode 100644 electron-35.5.1.tar.zst diff --git a/electron-35.5.0.tar.zst b/electron-35.5.0.tar.zst deleted file mode 100644 index 88e5e09..0000000 --- a/electron-35.5.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e446c272aba7da2ae28bd752a26f891df0f81eb2edd1628f0d23abadf9a7a9cc -size 753856573 diff --git a/electron-35.5.1.tar.zst b/electron-35.5.1.tar.zst new file mode 100644 index 0000000..62061c2 --- /dev/null +++ b/electron-35.5.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fbaca62a6a2e5c0a9fb1ab3b57fde1ec65c898498c9faf1794a75003d3b3775 +size 753862311 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 7f21847..abb164a 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jun 5 05:14:29 UTC 2025 - Bruno Pitrus + +- New upstream release 35.5.1 + * Fixed addChildView() crashes when adding a closed WebContentsView. + * Fixed crash when pausing in loops due to missing context when desugared. + * Fixed out of bounds read and write in V8 (CVE-2025-5419 bsc#1244020) + ------------------------------------------------------------------- Thu May 29 17:37:49 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index d8ad866..3d00677 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -194,7 +194,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.5.0 +Version: 35.5.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -1230,7 +1230,7 @@ myconf_gn+=' enable_compose=false' myconf_gn+=' enterprise_cloud_content_analysis=false' myconf_gn+=' enterprise_local_content_analysis=false' myconf_gn+=' enterprise_watermark=false' -myconf_gn+=' enterprise_content_analysis=true' +myconf_gn+=' enterprise_content_analysis=false' myconf_gn+=' enable_video_effects=false' myconf_gn+=' use_fake_screen_ai=true' myconf_gn+=' webnn_use_tflite=false' @@ -1246,6 +1246,8 @@ myconf_gn+=' enable_guest_view=false' myconf_gn+=' enable_extensions_core=true' #cannot be disabled yet myconf_gn+=' enable_on_device_translation=false' myconf_gn+=' enable_session_service=false' +myconf_gn+=' enterprise_client_certificates=false' +myconf_gn+=' enterprise_data_controls=false' -- 2.51.1 From ff0183dbe01d2a682f0547151d83750ac6794cd86f94d4172e1a5bc27160cd1a Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 26 Jun 2025 10:04:53 +0000 Subject: [PATCH 61/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=213 --- file_dialog-missing-uint32_t.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_dialog-missing-uint32_t.patch b/file_dialog-missing-uint32_t.patch index 2b77116..9fd808d 100644 --- a/file_dialog-missing-uint32_t.patch +++ b/file_dialog-missing-uint32_t.patch @@ -5,6 +5,6 @@ #define ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_ +#include + #include #include #include - #include -- 2.51.1 From 4103b69450287d99ffbd0eab26732c9f2c812b36b8ba010a7959b1e28403e3a3 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 26 Jun 2025 19:00:03 +0000 Subject: [PATCH 62/80] Accepting request 1288741 from home:dziobian:gulgul-ultron:19 - New upstream release 35.6.0 * Added support for --no-experimental-global-navigator flag * Fixed a potential crash using session.clearData. * Fixed an error when importing electron for the first time from an ESM module loaded by a CJS module. * Fixed an issue where calling Fetch.continueResponse via debugger with WebContentsView could cause a crash. * Fixed an issue where utility processes could leak file handles. - 15.6: use system sqlite in node - add backported python3.14-nodedownload-FancyURLopener.patch to fix build error OBS-URL: https://build.opensuse.org/request/show/1288741 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=214 --- create_tarball.sh | 1 + electron-35.5.1.tar.zst | 3 - electron-35.6.0.tar.zst | 3 + nodejs-electron.changes | 11 ++++ nodejs-electron.spec | 12 +--- python3.14-nodedownload-FancyURLopener.patch | 58 ++++++++++++++++++++ 6 files changed, 75 insertions(+), 13 deletions(-) delete mode 100644 electron-35.5.1.tar.zst create mode 100644 electron-35.6.0.tar.zst create mode 100644 python3.14-nodedownload-FancyURLopener.patch diff --git a/create_tarball.sh b/create_tarball.sh index 327b7f8..c963dbd 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -331,6 +331,7 @@ find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "* find third_party/electron_node/deps/ngtcp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/simdutf -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete +find third_party/electron_node/deps/sqlite -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete rm -rvf third_party/electron_node/deps/v8/{tools,include} ln -srv v8/tools -t third_party/electron_node/deps/v8/ diff --git a/electron-35.5.1.tar.zst b/electron-35.5.1.tar.zst deleted file mode 100644 index 62061c2..0000000 --- a/electron-35.5.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4fbaca62a6a2e5c0a9fb1ab3b57fde1ec65c898498c9faf1794a75003d3b3775 -size 753862311 diff --git a/electron-35.6.0.tar.zst b/electron-35.6.0.tar.zst new file mode 100644 index 0000000..db124a7 --- /dev/null +++ b/electron-35.6.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65b2084f481003d367ca536d8fb27592503b9f828b5754ae83942410143f7b2c +size 752288636 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index abb164a..03fc8b0 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Jun 26 17:30:59 UTC 2025 - Bruno Pitrus +- New upstream release 35.6.0 + * Added support for --no-experimental-global-navigator flag + * Fixed a potential crash using session.clearData. + * Fixed an error when importing electron for the first time from an ESM module loaded by a CJS module. + * Fixed an issue where calling Fetch.continueResponse via debugger with WebContentsView could cause a crash. + * Fixed an issue where utility processes could leak file handles. +- 15.6: use system sqlite in node +- add backported python3.14-nodedownload-FancyURLopener.patch to fix build error + ------------------------------------------------------------------- Thu Jun 5 05:14:29 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 3d00677..e205c59 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -92,8 +92,6 @@ ExcludeArch: %arm %bcond_without system_vk_headers %bcond_without spirv_2024 %bcond_without cares_21 -#sqlite requires being compiled with session support, not a specific version. -%bcond_without system_sqlite %else %bcond_with system_vpx %bcond_with bro_11 @@ -101,7 +99,6 @@ ExcludeArch: %arm %bcond_with system_vk_headers %bcond_with spirv_2024 %bcond_with cares_21 -%bcond_with system_sqlite %endif @@ -194,7 +191,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.5.1 +Version: 35.6.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -397,6 +394,7 @@ Patch3208: to_vector-std-projected-gcc119888.patch Patch3209: file_dialog-missing-uint32_t.patch Patch3211: html_permission_element_strings_map-reproducible.patch Patch3212: extensions-common-assert.patch +Patch3213: python3.14-nodedownload-FancyURLopener.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -770,9 +768,6 @@ patch -R -p1 < %SOURCE401 patch -R -p1 < %SOURCE480 %endif -%if %{without system_sqlite} -patch -R -p1 < %PATCH1093 -%endif # This one just removes compatibility with old abseil and does not add anything, reverting unconditionally. @@ -929,9 +924,6 @@ find third_party/electron_node/deps/histogram -type f ! -name "*.gn" -a ! -name find third_party/electron_node/deps/simdjson -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete %endif -%if %{with system_sqlite} -find third_party/electron_node/deps/sqlite -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete -%endif %build diff --git a/python3.14-nodedownload-FancyURLopener.patch b/python3.14-nodedownload-FancyURLopener.patch new file mode 100644 index 0000000..062caf8 --- /dev/null +++ b/python3.14-nodedownload-FancyURLopener.patch @@ -0,0 +1,58 @@ +From dfcb824ae3e7752abf3c809a3f226cb21dd2187a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= + +Date: Sun, 22 Jun 2025 07:49:14 +0200 +Subject: [PATCH] tools: make nodedownload module compatible with Python 3.14 + +FancyURLopener and URLopener have been deprecated since +Python 3.3 and they are removed completely from 3.14. + +Fixes: https://github.com/nodejs/node/issues/58740 +PR-URL: https://github.com/nodejs/node/pull/58752 +Reviewed-By: Luigi Pinca +Reviewed-By: Yagiz Nizipli +Reviewed-By: James M Snell +--- + tools/configure.d/nodedownload.py | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/tools/configure.d/nodedownload.py b/tools/configure.d/nodedownload.py +index 4f144e0e4b406c..0d65c33606b853 100644 +--- a/third_party/electron_node/tools/configure.d/nodedownload.py ++++ b/third_party/electron_node/tools/configure.d/nodedownload.py +@@ -7,10 +7,7 @@ + import zipfile + import tarfile + import contextlib +-try: +- from urllib.request import FancyURLopener, URLopener +-except ImportError: +- from urllib import FancyURLopener, URLopener ++from urllib.request import build_opener, install_opener, urlretrieve + + def formatSize(amt): + """Format a size as a string in MB""" +@@ -21,11 +18,6 @@ def spin(c): + spin = ".:|'" + return (spin[c % len(spin)]) + +-class ConfigOpener(FancyURLopener): +- """fancy opener used by retrievefile. Set a UA""" +- # append to existing version (UA) +- version = '%s node.js/configure' % URLopener.version +- + def reporthook(count, size, total): + """internal hook used by retrievefile""" + sys.stdout.write(' Fetch: %c %sMB total, %sMB downloaded \r' % +@@ -38,7 +30,10 @@ def retrievefile(url, targetfile): + try: + sys.stdout.write(' <%s>\nConnecting...\r' % url) + sys.stdout.flush() +- ConfigOpener().retrieve(url, targetfile, reporthook=reporthook) ++ opener = build_opener() ++ opener.addheaders = [('User-agent', f'Python-urllib/{sys.version_info.major}.{sys.version_info.minor} node.js/configure')] ++ install_opener(opener) ++ urlretrieve(url, targetfile, reporthook=reporthook) + print('') # clear the line + return targetfile + except IOError as err: -- 2.51.1 From a92060d0f1a3049a7fbd4a528d22810f7d5b8807335cb5ff135be4ecf2c20394 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 27 Jun 2025 04:47:11 +0000 Subject: [PATCH 63/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=215 --- nodejs-electron.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 03fc8b0..05a4e73 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,5 +1,6 @@ ------------------------------------------------------------------- Thu Jun 26 17:30:59 UTC 2025 - Bruno Pitrus + - New upstream release 35.6.0 * Added support for --no-experimental-global-navigator flag * Fixed a potential crash using session.clearData. -- 2.51.1 From 8106c81fb3d0b8a756f83b0716c6df064408c616a73a9fc50c89460407cb172d Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 3 Jul 2025 13:00:54 +0000 Subject: [PATCH 64/80] Accepting request 1290237 from home:dziobian:gulgul-ultron:19 - New upstream release 36.7.0 * update Node.js to 22.16.0 OBS-URL: https://build.opensuse.org/request/show/1290237 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=216 --- electron-35.6.0.tar.zst | 3 - electron-35.7.0.tar.zst | 3 + node-cares-1.21-2.patch | 163 +++++++++++++++++----------------------- nodejs-electron.changes | 6 ++ nodejs-electron.spec | 2 +- system-sqlite.patch | 4 +- 6 files changed, 83 insertions(+), 98 deletions(-) delete mode 100644 electron-35.6.0.tar.zst create mode 100644 electron-35.7.0.tar.zst diff --git a/electron-35.6.0.tar.zst b/electron-35.6.0.tar.zst deleted file mode 100644 index db124a7..0000000 --- a/electron-35.6.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65b2084f481003d367ca536d8fb27592503b9f828b5754ae83942410143f7b2c -size 752288636 diff --git a/electron-35.7.0.tar.zst b/electron-35.7.0.tar.zst new file mode 100644 index 0000000..98a2bb2 --- /dev/null +++ b/electron-35.7.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad4c8f4276ffce80db7317206ea75a846d66b6e3aab7c00220a4cd771b0b448f +size 749643533 diff --git a/node-cares-1.21-2.patch b/node-cares-1.21-2.patch index 163a12c..0ceecbd 100644 --- a/node-cares-1.21-2.patch +++ b/node-cares-1.21-2.patch @@ -41,10 +41,8 @@ index 7d9e22d1c2458f..bcca83fd4fe54d 100644 Resolver.prototype.resolveTxt = resolveMap.TXT = resolver('queryTxt'); Resolver.prototype.resolveSrv = resolveMap.SRV = resolver('querySrv'); Resolver.prototype.resolvePtr = resolveMap.PTR = resolver('queryPtr'); -diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc -index e79f43d1824b60..f43193c3ce0905 100644 ---- a/third_party/electron_node/src/cares_wrap.cc -+++ b/third_party/electron_node/src/cares_wrap.cc +--- src/third_party/electron_node/src/cares_wrap.cc 2025-07-03 13:55:28.684461768 +0200 ++++ src/third_party/electron_node/src/cares_wrap.cc.orig 2025-07-03 07:25:07.137463925 +0200 @@ -40,6 +40,10 @@ #include #include @@ -64,14 +62,14 @@ index e79f43d1824b60..f43193c3ce0905 100644 using v8::Context; using v8::EscapableHandleScope; using v8::Exception; -@@ -352,6 +357,65 @@ int ParseCaaReply( - return ARES_SUCCESS; +@@ -383,6 +388,69 @@ Maybe ParseCaaReply(Environment* en + return Just(ARES_SUCCESS); } -+int ParseTlsaReply(Environment* env, -+ unsigned char* buf, -+ int len, -+ Local ret) { ++Maybe ParseTlsaReply(Environment* env, ++ unsigned char* buf, ++ int len, ++ Local ret) { + EscapableHandleScope handle_scope(env->isolate()); + + ares_dns_record_t* dnsrec = nullptr; @@ -79,7 +77,7 @@ index e79f43d1824b60..f43193c3ce0905 100644 + int status = ares_dns_parse(buf, len, 0, &dnsrec); + if (status != ARES_SUCCESS) { + ares_dns_record_destroy(dnsrec); -+ return status; ++ return Just(status); + } + + uint32_t offset = ret->Length(); @@ -103,34 +101,38 @@ index e79f43d1824b60..f43193c3ce0905 100644 + memcpy(data_ab->Data(), data, data_len); + + Local tlsa_rec = Object::New(env->isolate()); -+ tlsa_rec -+ ->Set(env->context(), -+ env->cert_usage_string(), -+ Integer::NewFromUnsigned(env->isolate(), certusage)) -+ .Check(); -+ tlsa_rec -+ ->Set(env->context(), -+ env->selector_string(), -+ Integer::NewFromUnsigned(env->isolate(), selector)) -+ .Check(); -+ tlsa_rec -+ ->Set(env->context(), -+ env->match_string(), -+ Integer::NewFromUnsigned(env->isolate(), match)) -+ .Check(); -+ tlsa_rec->Set(env->context(), env->data_string(), data_ab).Check(); + -+ ret->Set(env->context(), offset + i, tlsa_rec).Check(); ++ if (tlsa_rec ++ ->Set(env->context(), ++ env->cert_usage_string(), ++ Integer::NewFromUnsigned(env->isolate(), certusage)) ++ .IsNothing() || ++ tlsa_rec ++ ->Set(env->context(), ++ env->selector_string(), ++ Integer::NewFromUnsigned(env->isolate(), selector)) ++ .IsNothing() || ++ tlsa_rec ++ ->Set(env->context(), ++ env->match_string(), ++ Integer::NewFromUnsigned(env->isolate(), match)) ++ .IsNothing() || ++ tlsa_rec->Set(env->context(), env->data_string(), data_ab) ++ .IsNothing() || ++ ret->Set(env->context(), offset + i, tlsa_rec).IsNothing()) { ++ ares_dns_record_destroy(dnsrec); ++ return Nothing(); ++ } + } + + ares_dns_record_destroy(dnsrec); -+ return ARES_SUCCESS; ++ return Just(ARES_SUCCESS); +} + - int ParseTxtReply( - Environment* env, - const unsigned char* buf, -@@ -861,6 +925,11 @@ int NsTraits::Send(QueryWrap* wrap, const char* name) { + Maybe ParseTxtReply(Environment* env, + const unsigned char* buf, + int len, +@@ -945,6 +1013,11 @@ int NsTraits::Send(QueryWrap* return ARES_SUCCESS; } @@ -142,25 +144,29 @@ index e79f43d1824b60..f43193c3ce0905 100644 int TxtTraits::Send(QueryWrap* wrap, const char* name) { wrap->AresQuery(name, ARES_CLASS_IN, ARES_REC_TYPE_TXT); return ARES_SUCCESS; -@@ -1045,6 +1114,10 @@ int AnyTraits::Parse( - if (!soa_record.IsEmpty()) - ret->Set(env->context(), ret->Length(), soa_record).Check(); +@@ -1156,6 +1229,14 @@ Maybe AnyTraits::Parse(QueryAnyWrap + } + } + /* Parse TLSA records */ -+ status = ParseTlsaReply(env, buf, len, ret); -+ if (status != ARES_SUCCESS && status != ARES_ENODATA) return status; ++ if (!ParseTlsaReply(env, buf, len, ret).To(&status)) { ++ return Nothing(); ++ } ++ if (status != ARES_SUCCESS && status != ARES_ENODATA) { ++ return Just(status); ++ } + /* Parse CAA records */ - status = ParseCaaReply(env, buf, len, ret, true); - if (status != ARES_SUCCESS && status != ARES_ENODATA) -@@ -1219,6 +1292,27 @@ int NsTraits::Parse( - return ARES_SUCCESS; + if (!ParseCaaReply(env, buf, len, ret, true).To(&status)) { + return Nothing(); +@@ -1339,6 +1420,32 @@ Maybe NsTraits::Parse(QueryNsWrap* + return Just(ARES_SUCCESS); } -+int TlsaTraits::Parse(QueryTlsaWrap* wrap, -+ const std::unique_ptr& response) { ++Maybe TlsaTraits::Parse(QueryTlsaWrap* wrap, ++ const std::unique_ptr& response) { + if (response->is_host) [[unlikely]] { -+ return ARES_EBADRESP; ++ return Just(ARES_EBADRESP); + } + + unsigned char* buf = response->buf.data; @@ -171,58 +177,31 @@ index e79f43d1824b60..f43193c3ce0905 100644 + Context::Scope context_scope(env->context()); + + Local tlsa_records = Array::New(env->isolate()); -+ int status = ParseTlsaReply(env, buf, len, tlsa_records); -+ if (status != ARES_SUCCESS) return status; ++ int status; ++ if (!ParseTlsaReply(env, buf, len, tlsa_records).To(&status)) { ++ return Nothing(); ++ } ++ if (status != ARES_SUCCESS) { ++ return Just(status); ++ } + + wrap->CallOnComplete(tlsa_records); -+ return ARES_SUCCESS; ++ return Just(ARES_SUCCESS); +} + - int TxtTraits::Parse( - QueryTxtWrap* wrap, - const std::unique_ptr& response) { -@@ -1998,6 +2092,7 @@ void Initialize(Local target, - SetProtoMethod(isolate, channel_wrap, "queryCname", Query); - SetProtoMethod(isolate, channel_wrap, "queryMx", Query); - SetProtoMethod(isolate, channel_wrap, "queryNs", Query); -+ SetProtoMethod(isolate, channel_wrap, "queryTlsa", Query); - SetProtoMethod(isolate, channel_wrap, "queryTxt", Query); - SetProtoMethod(isolate, channel_wrap, "querySrv", Query); - SetProtoMethod(isolate, channel_wrap, "queryPtr", Query); -@@ -2029,6 +2124,7 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) { - registry->Register(Query); - registry->Register(Query); - registry->Register(Query); -+ registry->Register(Query); - registry->Register(Query); - registry->Register(Query); - registry->Register(Query); -diff --git a/src/cares_wrap.h b/src/cares_wrap.h -index 4a5d22c0ef085f..6703a5fee3d529 100644 ---- a/third_party/electron_node/src/cares_wrap.h -+++ b/third_party/electron_node/src/cares_wrap.h -@@ -460,6 +460,13 @@ struct NsTraits final { - const std::unique_ptr& response); - }; + Maybe TxtTraits::Parse(QueryTxtWrap* wrap, + const std::unique_ptr& response) { + if (response->is_host) [[unlikely]] { +--- src/third_party/electron_node/src/cares_wrap.h 2025-07-03 13:50:26.156515766 +0200 ++++ src/third_party/electron_node/src/cares_wrap.h.orig 2025-07-03 07:25:07.009463947 +0200 +@@ -419,6 +419,7 @@ class QueryWrap final : public AsyncWrap + V(Ptr, resolvePtr, queryPtr) \ + V(Srv, resolveSrv, querySrv) \ + V(Soa, resolveSoa, querySoa) \ ++ V(Tlsa, resolveTlsa, queryTlsa) \ + V(Txt, resolveTxt, queryTxt) -+struct TlsaTraits final { -+ static constexpr const char* name = "resolveTlsa"; -+ static int Send(QueryWrap* wrap, const char* name); -+ static int Parse(QueryWrap* wrap, -+ const std::unique_ptr& response); -+}; -+ - struct TxtTraits final { - static constexpr const char* name = "resolveTxt"; - static int Send(QueryWrap* wrap, const char* name); -@@ -515,6 +522,7 @@ using QueryCaaWrap = QueryWrap; - using QueryCnameWrap = QueryWrap; - using QueryMxWrap = QueryWrap; - using QueryNsWrap = QueryWrap; -+using QueryTlsaWrap = QueryWrap; - using QueryTxtWrap = QueryWrap; - using QuerySrvWrap = QueryWrap; - using QueryPtrWrap = QueryWrap; + // All query type handlers share the same basic structure, so we can simplify diff --git a/src/env_properties.h b/src/env_properties.h index 9d22dc69754178..bc97dfc66c96f9 100644 --- a/third_party/electron_node/src/env_properties.h diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 05a4e73..6bc8744 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 2 21:04:03 UTC 2025 - Bruno Pitrus + +- New upstream release 36.7.0 + * update Node.js to 22.16.0 + ------------------------------------------------------------------- Thu Jun 26 17:30:59 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index e205c59..787aa83 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -191,7 +191,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.6.0 +Version: 35.7.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS diff --git a/system-sqlite.patch b/system-sqlite.patch index e3af0cd..1f818b3 100644 --- a/system-sqlite.patch +++ b/system-sqlite.patch @@ -17,8 +17,8 @@ Unbundle Node's sqlite copy. Note that this is NOT the sqlite used by Chromium, + pkg_config("sqlite_config") { + packages = ["sqlite3"] defines = [ - "SQLITE_ENABLE_MATH_FUNCTIONS", - "SQLITE_ENABLE_SESSION", + "SQLITE_ENABLE_COLUMN_METADATA", + "SQLITE_ENABLE_DBSTAT_VTAB", @@ -14,28 +15,9 @@ template("sqlite_gn_build") { ] } -- 2.51.1 From 4d8400a0a763ad1c01ef8e5b9c96c5361b49a265c76a0f2b536ba86983abbe17 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 14 Jul 2025 09:50:35 +0000 Subject: [PATCH 65/80] Accepting request 1293097 from home:dziobian:gulgul-ultron:19 - Enable accelerated video decoding (VAAPI) * vaapi-no-encoders.patch - Drop chromium-vaapi.patch which has been dead code for a while OBS-URL: https://build.opensuse.org/request/show/1293097 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=217 --- chromium-vaapi.patch | 69 ---------------------- nodejs-electron.changes | 7 +++ nodejs-electron.spec | 15 +---- vaapi-no-encoders.patch | 123 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 82 deletions(-) delete mode 100644 chromium-vaapi.patch create mode 100644 vaapi-no-encoders.patch diff --git a/chromium-vaapi.patch b/chromium-vaapi.patch deleted file mode 100644 index a9e257d..0000000 --- a/chromium-vaapi.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- src/chrome/browser/about_flags.cc.orig 2025-04-11 12:05:16.388151477 +0200 -+++ src/chrome/browser/about_flags.cc 2025-04-12 12:45:36.431775614 +0200 -@@ -5590,12 +5590,12 @@ const FeatureEntry kFeatureEntries[] = { - #endif - #endif // BUILDFLAG(IS_ANDROID) - #endif // ENABLE_VR --#if BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_CHROMEOS_) || (defined(OS_LINUX) && !defined(OS_ANDROID)) - {"disable-accelerated-mjpeg-decode", - flag_descriptions::kAcceleratedMjpegDecodeName, -- flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS, -+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux, - SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)}, --#endif // BUILDFLAG(IS_CHROMEOS) -+#endif // BUILDFLAG(IS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID)) - {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName, - flag_descriptions::kSystemKeyboardLockDescription, kOsDesktop, - FEATURE_VALUE_TYPE(features::kSystemKeyboardLock)}, ---- src/chrome/browser/flag_descriptions.cc.orig 2025-04-11 12:05:16.849151673 +0200 -+++ src/chrome/browser/flag_descriptions.cc 2025-04-12 12:46:16.943776292 +0200 -@@ -5708,12 +5708,24 @@ const char kUseAngleDefault[] = "Default - - #if BUILDFLAG(IS_CHROMEOS) - -+#endif -+ -+// Chrome OS and Linux -------------------------------------------------------- -+ -+#if BUILDFLAG(IS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID)) -+ - const char kAcceleratedMjpegDecodeName[] = - "Hardware-accelerated mjpeg decode for captured frame"; - const char kAcceleratedMjpegDecodeDescription[] = - "Enable hardware-accelerated MJPEG decode for captured frame where " - "available."; - -+#endif -+ -+// Chrome OS ------------------------------------------------------------------ -+ -+#if BUILDFLAG(IS_CHROMEOS) -+ - const char kAccessibilityBounceKeysName[] = "Bounce keys"; - const char kAccessibilityBounceKeysDescription[] = - "Enables accessibility settings for bounce keys, which ignores quickly " ---- src/chrome/browser/flag_descriptions.h.orig 2025-04-11 12:05:16.850151673 +0200 -+++ src/chrome/browser/flag_descriptions.h 2025-04-12 12:47:00.923776530 +0200 -@@ -3340,9 +3340,21 @@ extern const char kUseAngleDefault[]; - - #if BUILDFLAG(IS_CHROMEOS) - -+#endif -+ -+// Chrome OS and Linux -------------------------------------------------------- -+ -+#if BUILDFLAG(IS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID)) -+ - extern const char kAcceleratedMjpegDecodeName[]; - extern const char kAcceleratedMjpegDecodeDescription[]; - -+#endif -+ -+#if BUILDFLAG(IS_CHROMEOS) -+ -+// Chrome OS ------------------------------------------------------------------ -+ - extern const char kAccessibilityBounceKeysName[]; - extern const char kAccessibilityBounceKeysDescription[]; - diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 6bc8744..c50b222 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jul 11 17:53:15 UTC 2025 - Bruno Pitrus + +- Enable accelerated video decoding (VAAPI) + * vaapi-no-encoders.patch +- Drop chromium-vaapi.patch which has been dead code for a while + ------------------------------------------------------------------- Wed Jul 2 21:04:03 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 787aa83..d73767c 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -51,21 +51,10 @@ ExcludeArch: %arm %bcond_with qt -%ifarch aarch64 riscv64 #Video acceleration API to support. Useful for e.g. signal messenger. #One cannot enable both, unfortunately. -#Apparently more arm hardware supports v4l2 than vaapi, -#but that code does not build on armv{6,7}hl due to too high cpu requirements. -#bcond_without v4l2 -#bcond_with vaapi -%else -#bcond_with v4l2 -#bcond_without vaapi -%endif - -#DISABLING THIS — cannot use video acceleration with system aom/vpx %bcond_with v4l2 -%bcond_with vaapi +%bcond_without vaapi %ifarch %arm aarch64 riscv64 %bcond_with gdbjit @@ -284,6 +273,7 @@ Patch604: disable-avif-really.patch Patch605: permission-gcc14.2.patch Patch606: build-without-extensions.patch Patch607: build-without-guest-view.patch +Patch608: vaapi-no-encoders.patch @@ -399,7 +389,6 @@ Patch3213: python3.14-nodedownload-FancyURLopener.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. Patch5000: more-locales.patch -Patch5006: chromium-vaapi.patch BuildRequires: brotli BuildRequires: c-ares-devel diff --git a/vaapi-no-encoders.patch b/vaapi-no-encoders.patch new file mode 100644 index 0000000..a817ca0 --- /dev/null +++ b/vaapi-no-encoders.patch @@ -0,0 +1,123 @@ +These encoders: +* are supported by ~no hardware +* i can't think of any actual use for them in the apps we ship, and +* most importantly, fail to build with system aom/vpx. + +The hardware *decoders*, on the other hand, are useful for Signal Messenger, and should work now. + +--- src/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.orig 2025-07-02 22:10:56.136470571 +0200 ++++ src/media/gpu/vaapi/vaapi_video_encode_accelerator.cc 2025-07-11 18:16:04.978530973 +0200 +@@ -43,13 +43,10 @@ + #include "media/gpu/gpu_video_encode_accelerator_helpers.h" + #include "media/gpu/h264_dpb.h" + #include "media/gpu/macros.h" +-#include "media/gpu/vaapi/av1_vaapi_video_encoder_delegate.h" + #include "media/gpu/vaapi/h264_vaapi_video_encoder_delegate.h" + #include "media/gpu/vaapi/vaapi_common.h" + #include "media/gpu/vaapi/vaapi_utils.h" + #include "media/gpu/vaapi/vaapi_wrapper.h" +-#include "media/gpu/vaapi/vp8_vaapi_video_encoder_delegate.h" +-#include "media/gpu/vaapi/vp9_vaapi_video_encoder_delegate.h" + #include "media/gpu/vp8_reference_frame_vector.h" + #include "media/gpu/vp9_reference_frame_vector.h" + +@@ -230,8 +227,7 @@ bool VaapiVideoEncodeAccelerator::Initia + } + + const VideoCodec codec = VideoCodecProfileToVideoCodec(config.output_profile); +- if (codec != VideoCodec::kH264 && codec != VideoCodec::kVP8 && +- codec != VideoCodec::kVP9 && codec != VideoCodec::kAV1) { ++ if (codec != VideoCodec::kH264) { + MEDIA_LOG(ERROR, media_log.get()) + << "Unsupported profile: " << GetProfileName(config.output_profile); + return false; +@@ -321,11 +317,6 @@ void VaapiVideoEncodeAccelerator::Initia + : VaapiWrapper::kEncodeVariableBitrate; + } + break; +- case VideoCodec::kVP8: +- case VideoCodec::kVP9: +- case VideoCodec::kAV1: +- mode = VaapiWrapper::kEncodeConstantQuantizationParameter; +- break; + default: + NotifyError({EncoderStatus::Codes::kEncoderUnsupportedCodec, + "Unsupported codec: " + GetCodecName(output_codec_)}); +@@ -377,24 +368,6 @@ void VaapiVideoEncodeAccelerator::Initia + } + } + break; +- case VideoCodec::kVP8: +- if (!IsConfiguredForTesting()) { +- encoder_ = std::make_unique( +- vaapi_wrapper_, error_cb); +- } +- break; +- case VideoCodec::kVP9: +- if (!IsConfiguredForTesting()) { +- encoder_ = std::make_unique( +- vaapi_wrapper_, error_cb); +- } +- break; +- case VideoCodec::kAV1: +- if (!IsConfiguredForTesting()) { +- encoder_ = std::make_unique( +- vaapi_wrapper_, error_cb); +- } +- break; + default: + NOTREACHED() << "Unsupported codec type " << GetCodecName(output_codec_); + } +@@ -893,19 +866,6 @@ VaapiVideoEncodeAccelerator::CreateEncod + picture = new VaapiH264Picture( + reconstructed_surface->ReleaseAsVASurfaceHandle()); + break; +- case VideoCodec::kVP8: +- picture = new VaapiVP8Picture( +- reconstructed_surface->ReleaseAsVASurfaceHandle()); +- break; +- case VideoCodec::kVP9: +- picture = new VaapiVP9Picture( +- reconstructed_surface->ReleaseAsVASurfaceHandle()); +- break; +- case VideoCodec::kAV1: +- picture = new VaapiAV1Picture( +- /*display_va_surface=*/nullptr, +- reconstructed_surface->ReleaseAsVASurfaceHandle()); +- break; + default: + return nullptr; + } +--- src/media/gpu/vaapi/BUILD.gn.orig 2025-07-02 22:10:56.132470571 +0200 ++++ src/media/gpu/vaapi/BUILD.gn 2025-07-11 18:17:18.866524759 +0200 +@@ -36,8 +36,6 @@ source_set("vaapi") { + sources = [ + "av1_vaapi_video_decoder_delegate.cc", + "av1_vaapi_video_decoder_delegate.h", +- "av1_vaapi_video_encoder_delegate.cc", +- "av1_vaapi_video_encoder_delegate.h", + "h264_vaapi_video_decoder_delegate.cc", + "h264_vaapi_video_decoder_delegate.h", + "h264_vaapi_video_encoder_delegate.cc", +@@ -67,12 +65,8 @@ source_set("vaapi") { + "vaapi_webp_decoder.h", + "vp8_vaapi_video_decoder_delegate.cc", + "vp8_vaapi_video_decoder_delegate.h", +- "vp8_vaapi_video_encoder_delegate.cc", +- "vp8_vaapi_video_encoder_delegate.h", + "vp9_vaapi_video_decoder_delegate.cc", + "vp9_vaapi_video_decoder_delegate.h", +- "vp9_vaapi_video_encoder_delegate.cc", +- "vp9_vaapi_video_encoder_delegate.h", + ] + if (enable_hevc_parser_and_hw_decoder) { + sources += [ +@@ -96,8 +90,6 @@ source_set("vaapi") { + "//media/gpu:video_frame_mapper_common", + "//media/gpu/chromeos:common", + "//mojo/public/cpp/bindings", +- "//third_party/libaom:libaomrc", +- "//third_party/libvpx:libvpxrc", + "//third_party/libyuv", + "//ui/gfx", + "//ui/gfx/geometry", -- 2.51.1 From a58fd7c395d9bef2245b3012036bd66e50627f962e42f661d150c677539f2bdc Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 13 Aug 2025 17:04:25 +0000 Subject: [PATCH 66/80] fix leap 16 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=218 --- nodejs-electron.spec | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index d73767c..3aea2f9 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -638,13 +638,18 @@ BuildRequires: libjpeg-turbo-devel # requires VP9E_SET_QUANTIZER_ONE_PASS BuildRequires: pkgconfig(vpx) >= 1.13~ %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} +%if 0%{?suse_version} >= 1650 || 0%{?fedora} BuildRequires: gcc >= 14 BuildRequires: gcc-c++ >= 14 %else +%if 0%{?suse_version} >= 1550 +BuildRequires: gcc15-PIE +BuildRequires: gcc15-c++ +%else BuildRequires: gcc14-PIE BuildRequires: gcc14-c++ %endif +%endif %if %{with pipewire} BuildRequires: pkgconfig(libpipewire-0.3) @@ -1003,19 +1008,27 @@ export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif #ifarch ix86 arm -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} +%if 0%{?suse_version} >= 1650 || 0%{?fedora} export CC=gcc export CXX=g++ export AR=gcc-ar export NM=gcc-nm export RANLIB=gcc-ranlib %else +%if 0%{?suse_version} >= 1550 +export CC=gcc-15 +export CXX=g++-15 +export AR=gcc-ar-15 +export NM=gcc-nm-15 +export RANLIB=gcc-ranlib-15 +%else export CC=gcc-14 export CXX=g++-14 export AR=gcc-ar-14 export NM=gcc-nm-14 export RANLIB=gcc-ranlib-14 %endif +%endif -- 2.51.1 From 39e08e2f0a309529739cb331727bb1c8a4cfd8eea0d64f80d72b3a105e197510 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 20 Aug 2025 07:32:21 +0000 Subject: [PATCH 67/80] Accepting request 1300418 from home:dziobian:gulgul-ultron:19 - New upstream release 35.7.5 * Fixed an issue where shell.openPath was not non-blocking as expected. - Leap 16: compile v8 code with x86-64-v2 instructions since the system requires them * v8-assume-x86-64-v2-support.patch - Fix build on Leap 16 OBS-URL: https://build.opensuse.org/request/show/1300418 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=219 --- electron-35.7.0.tar.zst | 3 -- electron-35.7.5.tar.zst | 3 ++ nodejs-electron.changes | 13 ++++++++ nodejs-electron.spec | 14 ++++++++- v8-assume-x86-64-v2-support.patch | 51 +++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 4 deletions(-) delete mode 100644 electron-35.7.0.tar.zst create mode 100644 electron-35.7.5.tar.zst create mode 100644 v8-assume-x86-64-v2-support.patch diff --git a/electron-35.7.0.tar.zst b/electron-35.7.0.tar.zst deleted file mode 100644 index 98a2bb2..0000000 --- a/electron-35.7.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad4c8f4276ffce80db7317206ea75a846d66b6e3aab7c00220a4cd771b0b448f -size 749643533 diff --git a/electron-35.7.5.tar.zst b/electron-35.7.5.tar.zst new file mode 100644 index 0000000..12b9c6f --- /dev/null +++ b/electron-35.7.5.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df37ac15120556d9387cfe00f8fc2b2e218683e2f6ae4b846f6f7a5541861d3f +size 749983220 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index c50b222..73ad680 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Aug 19 17:11:54 UTC 2025 - Bruno Pitrus + +- New upstream release 35.7.5 + * Fixed an issue where shell.openPath was not non-blocking as expected. +- Leap 16: compile v8 code with x86-64-v2 instructions since the system requires them + * v8-assume-x86-64-v2-support.patch + +------------------------------------------------------------------- +Wed Aug 13 16:54:43 UTC 2025 - Bruno Pitrus + +- Fix build on Leap 16 + ------------------------------------------------------------------- Fri Jul 11 17:53:15 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 3aea2f9..43f0b05 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -74,6 +74,13 @@ ExcludeArch: %arm %bcond_with system_yuv +#CPU level. Leap 16 requires x86-64-v2 so we may force it inside V8. +%if 0%{?suse_version} >= 1550 && 0%{?suse_version} < 1650 +%bcond_without v2 +%else +%bcond_with v2 +%endif + %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_vpx %bcond_without bro_11 @@ -180,7 +187,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.7.0 +Version: 35.7.5 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -237,6 +244,11 @@ Patch97: chromium-127-cargo_crate.patch Patch98: gn-logspam-breaks-install.patch Patch99: torque-debuginfo.patch Patch100: reduce-gn-tree.patch +%if %{with v2} +Patch101: v8-assume-x86-64-v2-support.patch +%else +Source101: v8-assume-x86-64-v2-support.patch +%endif # PATCHES that remove code we don't want. Most of them can be reused verbatim by other distributors, diff --git a/v8-assume-x86-64-v2-support.patch b/v8-assume-x86-64-v2-support.patch new file mode 100644 index 0000000..2062e0d --- /dev/null +++ b/v8-assume-x86-64-v2-support.patch @@ -0,0 +1,51 @@ +--- src/v8/src/codegen/cpu-features.h.orig 2025-08-19 18:33:53.729236588 +0200 ++++ src/v8/src/codegen/cpu-features.h 2025-08-19 19:06:19.769049465 +0200 +@@ -122,6 +122,12 @@ class V8_EXPORT_PRIVATE CpuFeatures : pu + } + + static bool IsSupported(CpuFeature f) { ++ if(f == SSE4_2) return true; ++ if(f == SSE4_1) return true; ++ if(f == SSSE3) return true; ++ if(f == SSE3) return true; ++ if(f == SAHF) return true; ++ if(f == POPCNT) return true; + return (supported_ & (1u << f)) != 0; + } + +--- src/v8/src/base/cpu.h.orig 2025-08-19 18:33:53.705236589 +0200 ++++ src/v8/src/base/cpu.h 2025-08-19 19:09:47.921029664 +0200 +@@ -73,15 +73,15 @@ class V8_BASE_EXPORT CPU final { + static const int kUnknownCacheLineSize = 0; + + // x86 features +- bool has_cmov() const { return has_cmov_; } +- bool has_sahf() const { return has_sahf_; } +- bool has_mmx() const { return has_mmx_; } +- bool has_sse() const { return has_sse_; } +- bool has_sse2() const { return has_sse2_; } +- bool has_sse3() const { return has_sse3_; } +- bool has_ssse3() const { return has_ssse3_; } +- bool has_sse41() const { return has_sse41_; } +- bool has_sse42() const { return has_sse42_; } ++ bool has_cmov() const { return true; } ++ bool has_sahf() const { return true; } ++ bool has_mmx() const { return true; } ++ bool has_sse() const { return true; } ++ bool has_sse2() const { return true; } ++ bool has_sse3() const { return true; } ++ bool has_ssse3() const { return true; } ++ bool has_sse41() const { return true; } ++ bool has_sse42() const { return true; } + bool has_osxsave() const { return has_osxsave_; } + bool has_avx() const { return has_avx_; } + bool has_avx2() const { return has_avx2_; } +@@ -92,7 +92,7 @@ class V8_BASE_EXPORT CPU final { + bool has_bmi1() const { return has_bmi1_; } + bool has_bmi2() const { return has_bmi2_; } + bool has_lzcnt() const { return has_lzcnt_; } +- bool has_popcnt() const { return has_popcnt_; } ++ bool has_popcnt() const { return true; } + bool is_atom() const { return is_atom_; } + bool has_intel_jcc_erratum() const { return has_intel_jcc_erratum_; } + bool has_cetss() const { return has_cetss_; } -- 2.51.1 From 7a97a83a97706c2b7a6997db46dc2d05eb5f7a695913fbb4c3cd6ffe1b5aa845 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 23 Aug 2025 18:33:03 +0000 Subject: [PATCH 68/80] Accepting request 1301087 from home:dziobian:gulgul-ultron:19 electron 37 OBS-URL: https://build.opensuse.org/request/show/1301087 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=220 --- ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch | 229 +++++++++ BlobCache-Success.patch | 26 + MakeSbixTypeface-null-pointer-call.patch | 16 - angle-BlobCache-Success.patch | 14 + aom3.10-AV1E_SET_AUTO_TILES.patch | 44 -- ...V1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch | 66 --- brotli-remove-shared-dictionary.patch | 18 +- build-without-extensions.patch | 2 +- build-without-speech-service.patch | 10 - chromium-102-compiler.patch | 62 +-- chromium-130-fontations.patch | 148 +++++- chromium-132-no-rust.patch | 321 +++++++------ common.gypi-compiler.patch | 10 +- ...n.gypi-remove-fno-omit-frame-pointer.patch | 2 +- ...er_client-incomplete-WebUIController.patch | 10 - cr130-abseil-remove-unused-deps.patch | 46 +- create_tarball.sh | 8 +- css_shape_value-constructor.patch | 11 - disable-catapult.patch | 18 +- disable-devtools-tests.patch | 10 - disable-webspeech.patch | 38 +- ...es_128_fixed_key_hash-missing-StrCat.patch | 10 - ...functions-evaluate_prg_hwy-signature.patch | 27 -- do-not-build-libvulkan.so.patch | 6 +- ...-13-blink-gcc-ambiguous-nodestructor.patch | 17 - electron-16-system-node-headers.patch | 2 +- electron-35.7.5.tar.zst | 3 - electron-37.3.1.tar.zst | 3 + event_record-optional-initializer.patch | 11 + exception_state-constexpr-initializer.patch | 15 - extensions-common-assert.patch | 134 ------ ffmpeg-4-AV_PROFILE.patch | 215 +++++++++ ffmpeg-new-channel-layout.patch | 27 -- fix-build-without-pdf.patch | 19 - fix-build-without-screen-ai.patch | 30 +- fix-build-without-video-effects.patch | 40 -- fix-building-with-pipewire-1.3.82.patch | 22 - fpic.patch | 16 +- ...ion_element_strings_map-reproducible.patch | 63 --- ...ount-incomplete-IdentityProviderData.patch | 227 +++++++++ ...xed_flat_map-conflicting-declaration.patch | 25 + llhttp-lax-vector-conversions.patch | 88 ++++ ...ad_mutexattr_setprotocol-conflicting.patch | 19 + masked_domain_list-flatbuffers.patch | 25 + ..._session_uma_helper-missing-optional.patch | 35 -- node-cares-1.21-4.patch | 35 ++ ...kParentNodeTag-constexpr-initializer.patch | 14 + node-llhttp9.3.patch | 54 --- node-nghttp-1.50.patch | 78 +++ node-version-ck.patch | 27 ++ nodejs-electron.changes | 85 ++++ nodejs-electron.spec | 154 +++--- ...pecialization-in-non-namespace-scope.patch | 99 ---- ...creen_canvas-incomplete-LayoutLocale.patch | 10 + partition_alloc-strict-aliasing.patch | 51 ++ ...ThreadTrack-Current-null-dereference.patch | 42 -- ...kIndexSequence-constexpr-initializer.patch | 11 + ...picture_events_info-string-constexpr.patch | 19 + ..._manager_uma_helper-missing-optional.patch | 35 -- ...ls-build-without-electron_extensions.patch | 20 - private_aggregation_host-uint128.patch | 14 +- python3.14-nodedownload-FancyURLopener.patch | 58 --- raw_ptr-fpermissive.patch | 48 -- reduce-gn-tree.patch | 6 +- ...h-requires-tflite-and-libphonenumber.patch | 453 ++++++++++-------- remove-date-reproducible-builds.patch | 10 +- remove-password-manager-and-policy.patch | 76 ++- ...-which-uses-private-join-and-compute.patch | 32 ++ remove-rust.patch | 10 +- remove-sync.patch | 7 +- resource-Wchanges-meaning.patch | 11 - resource_response-Wchanges-meaning.patch | 11 - sandboxed_vfs_file_impl-missing-memset.patch | 11 + seccomp_bpf-no-lto.patch | 13 +- string-hasher-flax-vector-conversions.patch | 23 - string_truncator-convert.patch | 20 - style_scope-unqualified-To.patch | 11 - system-dragonbox.patch | 11 + system-libdrm.patch | 13 - system-pydeps.patch | 4 +- system-simdutf.patch | 56 --- to_vector-std-projected-gcc119888.patch | 11 - ..._key_service_impl-Wlto-type-mismatch.patch | 32 -- use-system-libraries-in-node.patch | 2 +- v8-highway-1.1.patch | 150 ++++++ v8-simd-flax-vector-conversions.patch | 55 +++ vaapi-no-encoders.patch | 24 +- ...pu_base-incomplete-StaticBitmapImage.patch | 10 + webrtc-138-Wchanges-meaning.patch | 33 ++ ...AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch | 36 -- ...8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch | 250 ---------- ...ent_parser-Wmissing-template-keyword.patch | 13 - ...p_chain-incomplete-StaticBitmapImage.patch | 10 + 93 files changed, 2384 insertions(+), 2062 deletions(-) create mode 100644 ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch create mode 100644 BlobCache-Success.patch delete mode 100644 MakeSbixTypeface-null-pointer-call.patch create mode 100644 angle-BlobCache-Success.patch delete mode 100644 aom3.10-AV1E_SET_AUTO_TILES.patch delete mode 100644 aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch delete mode 100644 build-without-speech-service.patch delete mode 100644 content_browser_client-incomplete-WebUIController.patch delete mode 100644 css_shape_value-constructor.patch delete mode 100644 disable-devtools-tests.patch delete mode 100644 distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch delete mode 100644 distributed_point_functions-evaluate_prg_hwy-signature.patch delete mode 100644 electron-13-blink-gcc-ambiguous-nodestructor.patch delete mode 100644 electron-35.7.5.tar.zst create mode 100644 electron-37.3.1.tar.zst create mode 100644 event_record-optional-initializer.patch delete mode 100644 exception_state-constexpr-initializer.patch delete mode 100644 extensions-common-assert.patch create mode 100644 ffmpeg-4-AV_PROFILE.patch delete mode 100644 fix-build-without-pdf.patch delete mode 100644 fix-build-without-video-effects.patch delete mode 100644 fix-building-with-pipewire-1.3.82.patch delete mode 100644 html_permission_element_strings_map-reproducible.patch create mode 100644 identity_request_account-incomplete-IdentityProviderData.patch create mode 100644 json_to_struct-fixed_flat_map-conflicting-declaration.patch create mode 100644 llhttp-lax-vector-conversions.patch create mode 100644 lock_impl_posix-pthread_mutexattr_setprotocol-conflicting.patch create mode 100644 masked_domain_list-flatbuffers.patch delete mode 100644 media_session_uma_helper-missing-optional.patch create mode 100644 node-cares-1.21-4.patch create mode 100644 node-kParentNodeTag-constexpr-initializer.patch delete mode 100644 node-llhttp9.3.patch create mode 100644 node-nghttp-1.50.patch create mode 100644 node-version-ck.patch delete mode 100644 object_paint_properties-explicit-specialization-in-non-namespace-scope.patch create mode 100644 offscreen_canvas-incomplete-LayoutLocale.patch create mode 100644 partition_alloc-strict-aliasing.patch delete mode 100644 perfetto-ThreadTrack-Current-null-dereference.patch create mode 100644 pickle_traits-kIndexSequence-constexpr-initializer.patch create mode 100644 picture_in_picture_events_info-string-constexpr.patch delete mode 100644 picture_in_picture_window_manager_uma_helper-missing-optional.patch delete mode 100644 plugin_utils-build-without-electron_extensions.patch delete mode 100644 python3.14-nodedownload-FancyURLopener.patch delete mode 100644 raw_ptr-fpermissive.patch create mode 100644 remove-probabilistic-token-which-uses-private-join-and-compute.patch delete mode 100644 resource-Wchanges-meaning.patch delete mode 100644 resource_response-Wchanges-meaning.patch create mode 100644 sandboxed_vfs_file_impl-missing-memset.patch delete mode 100644 string-hasher-flax-vector-conversions.patch delete mode 100644 string_truncator-convert.patch delete mode 100644 style_scope-unqualified-To.patch create mode 100644 system-dragonbox.patch delete mode 100644 system-simdutf.patch delete mode 100644 to_vector-std-projected-gcc119888.patch delete mode 100644 unexportable_key_service_impl-Wlto-type-mismatch.patch create mode 100644 v8-highway-1.1.patch create mode 100644 v8-simd-flax-vector-conversions.patch create mode 100644 webgl_rendering_context_webgpu_base-incomplete-StaticBitmapImage.patch create mode 100644 webrtc-138-Wchanges-meaning.patch delete mode 100644 webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch delete mode 100644 webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch delete mode 100644 xml_document_parser-Wmissing-template-keyword.patch create mode 100644 xr_webgl_swap_chain-incomplete-StaticBitmapImage.patch diff --git a/ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch b/ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch new file mode 100644 index 0000000..b2039c5 --- /dev/null +++ b/ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch @@ -0,0 +1,229 @@ +This collides with an abseil macro causing ODR miscompiles + +diff '--color=auto' -urp src.old/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h src/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h +--- src.old/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h 2025-08-15 17:32:29.517405064 +0200 ++++ src/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h 2025-08-17 14:47:13.834152160 +0200 +@@ -100,9 +100,9 @@ HeapVectorBacking::~HeapVecto + const size_t length = object_size / sizeof(T); + using ByteBuffer = uint8_t*; + ByteBuffer payload = reinterpret_cast(this); +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + ANNOTATE_CHANGE_SIZE(payload, length * sizeof(T), 0, length * sizeof(T)); +-#endif // ANNOTATE_CONTIGUOUS_CONTAINER ++#endif // WTF_ANNOTATE_CONTIGUOUS_CONTAINER + // HeapVectorBacking calls finalizers for unused slots and expects them to be + // no-ops. + if (std::is_polymorphic::value) { +@@ -176,11 +176,11 @@ struct TraceInCollectionTrait::GetSize( + *reinterpret_cast(self)) / + sizeof(T); +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + // As commented above, HeapVectorBacking can trace unused slots (which are + // already zeroed out). + ANNOTATE_CHANGE_SIZE(array, length, 0, length); +-#endif // ANNOTATE_CONTIGUOUS_CONTAINER ++#endif // WTF_ANNOTATE_CONTIGUOUS_CONTAINER + if constexpr (IsTraceable::value) { + for (unsigned i = 0; i < length; ++i) { + if (!std::is_polymorphic_v || +diff '--color=auto' -urp src.old/third_party/blink/renderer/platform/heap/test/heap_test.cc src/third_party/blink/renderer/platform/heap/test/heap_test.cc +--- src.old/third_party/blink/renderer/platform/heap/test/heap_test.cc 2025-08-15 17:32:29.517405064 +0200 ++++ src/third_party/blink/renderer/platform/heap/test/heap_test.cc 2025-08-17 14:47:13.834152160 +0200 +@@ -854,7 +854,7 @@ TEST_F(HeapTest, HeapVectorShrinkInlineC + // Vector inline buffers are disabled; that constraint should be attempted + // removed, but until that time, disable testing handling of capacities + // of inline buffers. +-#if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) ++#if !defined(WTF_ANNOTATE_CONTIGUOUS_CONTAINER) + // Shrinking switches the buffer from the external one to the inline one. + vector1.Shrink(kInlineCapacity - 1); + vector1.shrink_to_fit(); +@@ -2446,7 +2446,7 @@ class InlinedVectorObjectWithVtableWrapp + + // TODO(Oilpan): when Vector.h's contiguous container support no longer disables + // Vector<>s with inline capacity, enable this test. +-#if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) ++#if !defined(WTF_ANNOTATE_CONTIGUOUS_CONTAINER) + TEST_F(HeapTest, VectorDestructorsWithVtable) { + ClearOutOldGarbage(); + InlinedVectorObjectWithVtable::destructor_calls_ = 0; +diff '--color=auto' -urp src.old/third_party/blink/renderer/platform/sparse_vector_test.cc src/third_party/blink/renderer/platform/sparse_vector_test.cc +--- src.old/third_party/blink/renderer/platform/sparse_vector_test.cc 2025-08-15 17:32:29.549405057 +0200 ++++ src/third_party/blink/renderer/platform/sparse_vector_test.cc 2025-08-17 14:47:13.846152160 +0200 +@@ -240,9 +240,9 @@ TEST(SparseVectorPtrTest, SettingToNullp + EXPECT_FALSE(sparse_vector.HasField(FieldId::kFoo)); + } + +-// WTF::Vector always uses 0 inline capacity when ANNOTATE_CONTIGUOUS_CONTAINER ++// WTF::Vector always uses 0 inline capacity when WTF_ANNOTATE_CONTIGUOUS_CONTAINER + // is defined. +-#ifndef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifndef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + TEST(SparseVectorInlineCapacityTest, Basic) { + SparseVector sparse_vector; + EXPECT_EQ(16u, sparse_vector.capacity()); +diff '--color=auto' -urp src.old/third_party/blink/renderer/platform/wtf/container_annotations.h src/third_party/blink/renderer/platform/wtf/container_annotations.h +--- src.old/third_party/blink/renderer/platform/wtf/container_annotations.h 2025-08-15 17:32:29.573405052 +0200 ++++ src/third_party/blink/renderer/platform/wtf/container_annotations.h 2025-08-17 14:47:13.842152160 +0200 +@@ -18,7 +18,7 @@ + // documentation: + // https://github.com/llvm-mirror/compiler-rt/blob/master/include/sanitizer/common_interface_defs.h#L154 + +-#define ANNOTATE_CONTIGUOUS_CONTAINER ++#define WTF_ANNOTATE_CONTIGUOUS_CONTAINER + + #define ANNOTATE_NEW_BUFFER(buffer, capacity, newSize) \ + if (buffer) { \ +diff '--color=auto' -urp src.old/third_party/blink/renderer/platform/wtf/size_assertions.cc src/third_party/blink/renderer/platform/wtf/size_assertions.cc +--- src.old/third_party/blink/renderer/platform/wtf/size_assertions.cc 2025-08-15 17:32:29.577405052 +0200 ++++ src/third_party/blink/renderer/platform/wtf/size_assertions.cc 2025-08-17 14:47:13.838152160 +0200 +@@ -61,7 +61,7 @@ struct SameSizeAsVectorWithInlineCapacit + template + struct SameSizeAsVectorWithInlineCapacity { + SameSizeAsVectorWithInlineCapacity base_capacity; +-#if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) ++#if !defined(WTF_ANNOTATE_CONTIGUOUS_CONTAINER) + T inline_buffer[inlineCapacity]; + #endif + }; +diff '--color=auto' -urp src.old/third_party/blink/renderer/platform/wtf/vector.h src/third_party/blink/renderer/platform/wtf/vector.h +--- src.old/third_party/blink/renderer/platform/wtf/vector.h 2025-08-15 17:32:29.581405051 +0200 ++++ src/third_party/blink/renderer/platform/wtf/vector.h 2025-08-17 14:47:13.842152160 +0200 +@@ -59,7 +59,7 @@ + + // For ASAN builds, disable inline buffers completely as they cause various + // issues. +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + #define INLINE_CAPACITY 0 + #else + #define INLINE_CAPACITY InlineCapacity +@@ -471,7 +471,7 @@ class VectorBufferBase { + } + + void CheckUnusedSlots(const T* from, const T* to) { +-#if DCHECK_IS_ON() && !defined(ANNOTATE_CONTIGUOUS_CONTAINER) ++#if DCHECK_IS_ON() && !defined(WTF_ANNOTATE_CONTIGUOUS_CONTAINER) + if constexpr (NeedsToClearUnusedSlots()) { + const unsigned char* unused_area = + reinterpret_cast(from); +@@ -606,7 +606,7 @@ class VectorBuffer : pr + DCHECK(buffer_); + DCHECK_LT(new_capacity, capacity()); + size_t size_to_allocate = AllocationSize(new_capacity); +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + ANNOTATE_DELETE_BUFFER(buffer_, capacity_, size_); + #endif + bool succeeded = false; +@@ -615,7 +615,7 @@ class VectorBuffer : pr + capacity_ = static_cast(size_to_allocate / sizeof(T)); + succeeded = true; + } +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + MARKING_AWARE_ANNOTATE_NEW_BUFFER(Allocator, buffer_, capacity_, size_); + #endif + return succeeded; +@@ -740,7 +740,7 @@ class VectorBuffer : protected VectorBuf + DCHECK_NE(buffer_, InlineBuffer()); + size_t new_size = AllocationSize(new_capacity); + bool succeeded = false; +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + ANNOTATE_DELETE_BUFFER(buffer_, capacity_, size_); + #endif + if (Allocator::ShrinkVectorBacking(buffer_, AllocationSize(capacity()), +@@ -748,7 +748,7 @@ class VectorBuffer : protected VectorBuf + capacity_ = static_cast(new_size / sizeof(T)); + succeeded = true; + } +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + MARKING_AWARE_ANNOTATE_NEW_BUFFER(Allocator, buffer_, capacity_, size_); + #endif + return succeeded; +@@ -2145,7 +2145,7 @@ void Vector 0) { +@@ -2160,7 +2160,7 @@ void Vector + ALWAYS_INLINE void Vector::UncheckedAppend( + U&& val) { +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + // Vectors in ASAN builds don't have InlineCapacity. + push_back(std::forward(val)); + #else +@@ -2460,10 +2460,10 @@ void TraceInlinedBuffer(VisitorDispatche + const T* buffer_begin, + size_t capacity) { + const T* buffer_end = buffer_begin + capacity; +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + // Vector can trace unused slots (which are already zeroed out). + ANNOTATE_CHANGE_SIZE(buffer_begin, capacity, 0, capacity); +-#endif // ANNOTATE_CONTIGUOUS_CONTAINER ++#endif // WTF_ANNOTATE_CONTIGUOUS_CONTAINER + for (const T* buffer_entry = buffer_begin; buffer_entry != buffer_end; + buffer_entry++) { + Allocator::template Trace>(visitor, *buffer_entry); +@@ -2542,7 +2542,7 @@ void Vector vector_a; + vector_a.push_back(10); +@@ -415,7 +415,7 @@ TEST(VectorTest, ContainerAnnotations) { + volatile int* int_pointer_b3 = vector_b.data(); + EXPECT_DEATH((void)int_pointer_b3[2], "container-overflow"); + } +-#endif // defined(ANNOTATE_CONTIGUOUS_CONTAINER) ++#endif // defined(WTF_ANNOTATE_CONTIGUOUS_CONTAINER) + + class Comparable {}; + bool operator==(const Comparable& a, const Comparable& b) { +--- src/third_party/blink/renderer/core/html/parser/literal_buffer.h.orig 2025-08-15 17:32:29.197405123 +0200 ++++ src/third_party/blink/renderer/core/html/parser/literal_buffer.h 2025-08-17 16:56:06.586499195 +0200 +@@ -22,7 +22,7 @@ + + // For ASAN builds, disable inline buffers completely as they cause various + // issues. +-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER ++#ifdef WTF_ANNOTATE_CONTIGUOUS_CONTAINER + #define BUFFER_INLINE_CAPACITY 0 + #else + #define BUFFER_INLINE_CAPACITY kInlineSize diff --git a/BlobCache-Success.patch b/BlobCache-Success.patch new file mode 100644 index 0000000..a0ad93f --- /dev/null +++ b/BlobCache-Success.patch @@ -0,0 +1,26 @@ +--- src/third_party/angle/src/common/vulkan/vk_headers.h.orig 2025-08-15 17:33:15.429396781 +0200 ++++ src/third_party/angle/src/common/vulkan/vk_headers.h 2025-08-15 21:42:41.534691644 +0200 +@@ -10,6 +10,9 @@ + #ifndef LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ + #define LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ + ++//Work around for conflicting definition of "Success" ++#include "libANGLE/BlobCache.h" ++ + #if ANGLE_SHARED_LIBVULKAN + # include + #else +--- src/third_party/angle/src/common/vulkan/vk_headers.h.orig 2025-08-15 17:33:15.429396781 +0200 ++++ src/third_party/angle/src/common/vulkan/vk_headers.h 2025-08-15 21:45:06.096818856 +0200 +@@ -10,6 +10,11 @@ + #ifndef LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ + #define LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ + ++//Work around for conflicting definition of "Success" ++#include "libANGLE/BlobCache.h" ++//and "None" ++#include "libANGLE/renderer/vulkan/vk_cache_utils.h" ++ + #if ANGLE_SHARED_LIBVULKAN + # include + #else diff --git a/MakeSbixTypeface-null-pointer-call.patch b/MakeSbixTypeface-null-pointer-call.patch deleted file mode 100644 index 8017a64..0000000 --- a/MakeSbixTypeface-null-pointer-call.patch +++ /dev/null @@ -1,16 +0,0 @@ -Actually disable the fontations code flag since we don't build that library. Otherwise chromium crashes with a null dereference - ---- src/third_party/blink/renderer/platform/runtime_enabled_features.json5.orig 2025-04-21 18:29:28.190307211 +0200 -+++ src/third_party/blink/renderer/platform/runtime_enabled_features.json5 2025-04-21 23:33:49.257769003 +0200 -@@ -2165,11 +2165,9 @@ - }, - { - name: "FontationsFontBackend", -- status: "stable", - }, - { - name: "FontationsForSelectedFormats", -- status: "stable", - }, - { - name: "FontFamilyPostscriptMatchingCTMigration", diff --git a/angle-BlobCache-Success.patch b/angle-BlobCache-Success.patch new file mode 100644 index 0000000..c971278 --- /dev/null +++ b/angle-BlobCache-Success.patch @@ -0,0 +1,14 @@ +--- src/third_party/angle/src/common/vulkan/vk_headers.h.orig 2025-08-15 17:33:15.429396781 +0200 ++++ src/third_party/angle/src/common/vulkan/vk_headers.h 2025-08-15 21:50:06.831979165 +0200 +@@ -16,6 +16,11 @@ + # include + #endif + ++// braindead change https://chromium-review.googlesource.com/c/angle/angle/+/5273491 ++#undef Success ++#undef None ++#undef Always ++ + #if !defined(ANGLE_SHARED_LIBVULKAN) + + namespace rx diff --git a/aom3.10-AV1E_SET_AUTO_TILES.patch b/aom3.10-AV1E_SET_AUTO_TILES.patch deleted file mode 100644 index c56daf4..0000000 --- a/aom3.10-AV1E_SET_AUTO_TILES.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0b4b5b0ae81dca83d3d602e905732e2c82bd340d Mon Sep 17 00:00:00 2001 -From: Sergey Silkin -Date: Fri, 30 Aug 2024 13:37:32 +0200 -Subject: [PATCH] Use AV1E_SET_AUTO_TILES - -Delegate control over number of times to encoder using AV1E_SET_AUTO_TILES that was added in https://aomedia-review.googlesource.com/c/aom/+/191102. - -Bug: webrtc:351644568 -Change-Id: I87ed11734e907c7f6c6508ac7389c84ececf5b21 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361140 -Commit-Queue: Sergey Silkin -Reviewed-by: Marco Paniconi -Cr-Commit-Position: refs/heads/main@{#42903} ---- - .../codecs/av1/libaom_av1_encoder.cc | 16 +--------------- - 1 file changed, 1 insertion(+), 15 deletions(-) - -diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -index db9238477d..c06792207e 100644 ---- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -+++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -@@ -307,21 +307,7 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0); - } - -- if (cfg_.g_threads == 8) { -- // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2() -- // based. -- // Use 4 tile columns x 2 tile rows for 8 threads. -- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_ROWS, 1); -- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, 2); -- } else if (cfg_.g_threads == 4) { -- // Use 2 tile columns x 2 tile rows for 4 threads. -- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_ROWS, 1); -- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, 1); -- } else { -- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, -- static_cast(log2(cfg_.g_threads))); -- } -- -+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_AUTO_TILES, 1); - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ROW_MT, 1); - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_OBMC, 0); - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_NOISE_SENSITIVITY, 0); diff --git a/aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch b/aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch deleted file mode 100644 index c2bb1d7..0000000 --- a/aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 84273f56d92953f15269cdb1d95d1851f83a8fe9 Mon Sep 17 00:00:00 2001 -From: Sergey Silkin -Date: Fri, 30 Aug 2024 12:32:52 +0200 -Subject: [PATCH] Specify max number of consecutive drops using time units - -AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR was added in https://aomedia-review.googlesource.com/c/aom/+/192402. It allows to configure max number of consecutive frame drops using time units. Use it instead of AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR. - -Bug: webrtc:351644568 -Change-Id: I73265d5258d681926eb5b65e32c2a61b26c310ba -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360842 -Commit-Queue: Sergey Silkin -Reviewed-by: Marco Paniconi -Cr-Commit-Position: refs/heads/main@{#42995} ---- - .../codecs/av1/libaom_av1_encoder.cc | 24 ++++--------------- - 1 file changed, 5 insertions(+), 19 deletions(-) - -diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -index 6b71874c3f..262cb9d36b 100644 ---- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -+++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -@@ -166,14 +166,6 @@ int32_t VerifyCodecSettings(const VideoCodec& codec_settings) { - return WEBRTC_VIDEO_CODEC_OK; - } - --int GetMaxConsecDrops(double framerate_fps) { -- // Consecutive frame drops result in a video freeze. We want to minimize the -- // max number of consecutive drops and, at the same time, keep the value high -- // enough to let encoder drain the buffer at overshoot. -- constexpr double kMaxFreezeSeconds = 0.25; -- return std::ceil(kMaxFreezeSeconds * framerate_fps); --} -- - LibaomAv1Encoder::LibaomAv1Encoder(const Environment& env, - LibaomAv1EncoderSettings settings) - : inited_(false), -@@ -339,6 +331,11 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_TX64, 0); - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_REFERENCE_FRAMES, 3); - -+ if (adaptive_max_consec_drops_) { -+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR, -+ 250); -+ } -+ - return WEBRTC_VIDEO_CODEC_OK; - } - -@@ -815,17 +812,6 @@ void LibaomAv1Encoder::SetRates(const RateControlParameters& parameters) { - SetEncoderControlParameters(AV1E_SET_SVC_PARAMS, &*svc_params_); - } - -- if (adaptive_max_consec_drops_ && -- (!rates_configured_ || framerate_fps_ != parameters.framerate_fps)) { -- int max_consec_drops = GetMaxConsecDrops(parameters.framerate_fps); -- if (!SetEncoderControlParameters(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, -- max_consec_drops)) { -- RTC_LOG(LS_WARNING) -- << "Failed to set AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR to " -- << max_consec_drops; -- } -- } -- - framerate_fps_ = parameters.framerate_fps; - - rates_configured_ = true; diff --git a/brotli-remove-shared-dictionary.patch b/brotli-remove-shared-dictionary.patch index 95f85e0..bfd9ee7 100644 --- a/brotli-remove-shared-dictionary.patch +++ b/brotli-remove-shared-dictionary.patch @@ -2,28 +2,28 @@ Partially revert https://github.com/chromium/chromium/commit/c1dc375391403442935 and disable dependent code. This removes `brs` from Accept-Encoding list. This feature does not build with brotli < 1.1 ---- src/net/filter/brotli_source_stream.cc.orig 2024-07-24 12:50:53.542464800 +0200 -+++ src/net/filter/brotli_source_stream.cc 2024-08-04 21:07:52.674333900 +0200 -@@ -12,7 +12,6 @@ - #include "base/metrics/histogram_macros.h" +--- src/net/filter/brotli_source_stream.cc.orig 2025-08-21 17:44:48.616409315 +0200 ++++ src/net/filter/brotli_source_stream.cc 2025-08-22 18:23:03.535047458 +0200 +@@ -18,7 +18,6 @@ #include "net/base/io_buffer.h" + #include "net/filter/source_stream_type.h" #include "third_party/brotli/include/brotli/decode.h" -#include "third_party/brotli/include/brotli/shared_dictionary.h" namespace net { -@@ -24,21 +23,11 @@ const char kBrotli[] = "BROTLI"; +@@ -30,21 +29,11 @@ const char kBrotli[] = "BROTLI"; // Brotli format specification: http://www.ietf.org/id/draft-alakuijala-brotli. class BrotliSourceStream : public FilterSourceStream { public: - explicit BrotliSourceStream(std::unique_ptr upstream, - scoped_refptr dictionary = nullptr, - size_t dictionary_size = 0u) -- : FilterSourceStream(SourceStream::TYPE_BROTLI, std::move(upstream)), +- : FilterSourceStream(SourceStreamType::kBrotli, std::move(upstream)), - dictionary_(std::move(dictionary)), - dictionary_size_(dictionary_size) { + explicit BrotliSourceStream(std::unique_ptr upstream) -+ : FilterSourceStream(SourceStream::TYPE_BROTLI, std::move(upstream)) { ++ : FilterSourceStream(SourceStreamType::kBrotli, std::move(upstream)) { brotli_state_ = BrotliDecoderCreateInstance(AllocateMemory, FreeMemory, this); CHECK(brotli_state_); @@ -36,7 +36,7 @@ This feature does not build with brotli < 1.1 } BrotliSourceStream(const BrotliSourceStream&) = delete; -@@ -174,9 +163,6 @@ class BrotliSourceStream : public Filter +@@ -180,9 +169,6 @@ class BrotliSourceStream : public Filter free(&array[-1]); } @@ -46,7 +46,7 @@ This feature does not build with brotli < 1.1 raw_ptr brotli_state_; DecodingStatus decoding_status_ = DecodingStatus::DECODING_IN_PROGRESS; -@@ -198,8 +184,7 @@ std::unique_ptr Crea +@@ -204,8 +190,7 @@ std::unique_ptr Crea std::unique_ptr previous, scoped_refptr dictionary, size_t dictionary_size) { diff --git a/build-without-extensions.patch b/build-without-extensions.patch index 8ff154a..8439877 100644 --- a/build-without-extensions.patch +++ b/build-without-extensions.patch @@ -50,7 +50,7 @@ "manifest_handlers/webview_info.h", "manifest_url_handlers.cc", @@ -481,8 +467,6 @@ static_library("common") { - "user_script.h", + "user_scripts_availability.h", "utils/base_string.cc", "utils/base_string.h", - "utils/content_script_utils.cc", diff --git a/build-without-speech-service.patch b/build-without-speech-service.patch deleted file mode 100644 index d9b4dfc..0000000 --- a/build-without-speech-service.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/chrome/test/BUILD.gn.orig 2024-12-08 18:44:32.671357320 +0100 -+++ src/chrome/test/BUILD.gn 2025-01-01 21:35:00.776064485 +0100 -@@ -8317,7 +8317,6 @@ test("unit_tests") { - "//chrome/browser/user_annotations", - "//chrome/browser/web_applications:web_applications_test_support", - "//chrome/common/read_anything:mojo_bindings", -- "//chrome/services/speech:unit_tests", - "//components/app_constants", - "//components/color", - "//components/commerce/core:account_checker_test_support", diff --git a/chromium-102-compiler.patch b/chromium-102-compiler.patch index 4f59637..2261f4e 100644 --- a/chromium-102-compiler.patch +++ b/chromium-102-compiler.patch @@ -21,9 +21,9 @@ Subject: [PATCH] Disable various compiler configs build/config/compiler/BUILD.gn | 114 +++++---------------------------- 1 file changed, 17 insertions(+), 97 deletions(-) ---- src/build/config/compiler/BUILD.gn.orig 2025-04-21 18:29:05.106306929 +0200 -+++ src/build/config/compiler/BUILD.gn 2025-04-22 20:59:45.689108303 +0200 -@@ -308,9 +308,7 @@ config("compiler") { +--- src/build/config/compiler/BUILD.gn.orig 2025-07-19 11:32:29.581980058 +0200 ++++ src/build/config/compiler/BUILD.gn 2025-07-19 16:12:37.505818698 +0200 +@@ -310,9 +310,7 @@ config("compiler") { configs += [ # See the definitions below. @@ -32,8 +32,8 @@ Subject: [PATCH] Disable various compiler configs - ":compiler_cpu_abi", ":compiler_codegen", ":compiler_deterministic", - ] -@@ -325,7 +323,6 @@ config("compiler") { + ":clang_warning_suppression", +@@ -338,7 +336,6 @@ config("compiler") { # See: https://gcc.gnu.org/PR97913 # TODO(mpdenton): remove is_clang once GCC bug is fixed. if ((!is_nacl || is_nacl_saigo) && !is_ubsan && is_clang) { @@ -41,15 +41,15 @@ Subject: [PATCH] Disable various compiler configs } # Make signed overflow and pointer overflowdefined to wrap. -@@ -335,7 +332,6 @@ config("compiler") { +@@ -348,7 +345,6 @@ config("compiler") { if (is_win) { - cflags += [ "/clang:-fwrapv" ] + cflags += [ "/clang:-fno-strict-overflow" ] } else { -- cflags += [ "-fwrapv" ] +- cflags += [ "-fno-strict-overflow" ] } } -@@ -351,7 +347,12 @@ config("compiler") { +@@ -364,7 +360,12 @@ config("compiler") { if (!is_win) { # Common POSIX compiler flags setup. # -------------------------------- @@ -63,7 +63,7 @@ Subject: [PATCH] Disable various compiler configs # Stack protection. ShadowCallStack and Stack protector address the same # problems. Therefore, we only enable one or the other. Clang advertises SCS as -@@ -498,10 +499,6 @@ config("compiler") { +@@ -500,10 +501,6 @@ config("compiler") { # Linux/Android/Fuchsia common flags setup. # --------------------------------- if (is_linux || is_chromeos || is_android || is_fuchsia) { @@ -74,7 +74,7 @@ Subject: [PATCH] Disable various compiler configs if (!is_clang) { # Use pipes for communicating between sub-processes. Faster. -@@ -1124,11 +1121,6 @@ config("libcxx_hardening") { +@@ -1148,11 +1145,6 @@ config("libcxx_hardening") { defines = [ "_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE" ] } @@ -86,7 +86,7 @@ Subject: [PATCH] Disable various compiler configs } # The BUILDCONFIG file sets this config on targets by default, which means when -@@ -1194,7 +1186,8 @@ config("thinlto_optimize_max") { +@@ -1218,7 +1210,8 @@ config("thinlto_optimize_max") { # without using everything that "compiler" brings in. Options that # tweak code generation for a particular CPU do not belong here! # See "compiler_codegen", below. @@ -96,17 +96,17 @@ Subject: [PATCH] Disable various compiler configs cflags = [] ldflags = [] defines = [] -@@ -1824,7 +1817,8 @@ config("treat_warnings_as_errors") { - # Collects all warning flags that are used by default. This is used as a - # subconfig of both chromium_code and no_chromium_code. This way these +@@ -1994,7 +1987,8 @@ config("tot_warnings") { + # Collects all warning flags that are used by default. This is used as a + # subconfig of both chromium_code and no_chromium_code. This way these # flags are guaranteed to appear on the compile command line after -Wall. -config("default_warnings") { +config("default_warnings") { } +config("xdefault_warnings") { cflags = [] - cflags_c = [] cflags_cc = [] -@@ -2071,11 +2065,7 @@ config("chromium_code") { + ldflags = [] +@@ -2262,11 +2256,7 @@ config("chromium_code") { defines = [ "_HAS_NODISCARD" ] } } else { @@ -119,7 +119,7 @@ Subject: [PATCH] Disable various compiler configs # In Chromium code, we define __STDC_foo_MACROS in order to get the # C99 macros on Mac and Linux. -@@ -2084,24 +2074,6 @@ config("chromium_code") { +@@ -2275,24 +2265,6 @@ config("chromium_code") { "__STDC_FORMAT_MACROS", ] @@ -144,15 +144,15 @@ Subject: [PATCH] Disable various compiler configs if (is_apple) { cflags_objc = [ "-Wimplicit-retain-self" ] cflags_objcc = [ "-Wimplicit-retain-self" ] -@@ -2268,7 +2240,6 @@ config("no_rtti") { +@@ -2451,7 +2423,6 @@ config("no_rtti") { + # to heap-allocated memory are passed over shared library boundaries. config("export_dynamic") { - # TODO(crbug.com/40118868): Revisit after target_os flip is completed. - if (is_linux || is_chromeos_lacros || export_libcxxabi_from_executables) { + if (is_linux || export_libcxxabi_from_executables) { - ldflags = [ "-rdynamic" ] } } -@@ -2366,7 +2337,8 @@ config("wexit_time_destructors") { +@@ -2550,7 +2521,8 @@ config("wexit_time_destructors") { # gcc 4.9 and earlier had no way of suppressing this warning without # suppressing the rest of them. Here we centralize the identification of # the gcc 4.9 toolchains. @@ -162,7 +162,7 @@ Subject: [PATCH] Disable various compiler configs cflags = [] if (is_clang) { cflags += [ "-Wno-incompatible-pointer-types" ] -@@ -2483,7 +2455,8 @@ if (is_win) { +@@ -2667,7 +2639,8 @@ if (is_win) { common_optimize_on_cflags += [ "-fno-math-errno" ] } @@ -172,7 +172,7 @@ Subject: [PATCH] Disable various compiler configs if (!is_win) { if (enable_frame_pointers) { cflags = [ "-fno-omit-frame-pointer" ] -@@ -2524,7 +2497,8 @@ config("default_stack_frames") { +@@ -2708,7 +2681,8 @@ config("default_stack_frames") { # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000 # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000 # [2]: https://crrev.com/c/5447532 @@ -182,7 +182,7 @@ Subject: [PATCH] Disable various compiler configs if (is_win) { # clang-cl's /O2 corresponds to clang's -O3, and really want -O2 for # consistency with the other platforms. -@@ -2573,7 +2547,8 @@ config("optimize") { +@@ -2757,7 +2731,8 @@ config("optimize") { } # Turn off optimizations. @@ -192,7 +192,7 @@ Subject: [PATCH] Disable various compiler configs if (is_win) { cflags = [ "/Od", # Disable optimization. -@@ -2613,7 +2588,8 @@ config("no_optimize") { +@@ -2792,7 +2767,8 @@ config("no_optimize") { # Turns up the optimization level. Used to explicitly enable -O2 instead of # -Os for select targets on platforms that use optimize_for_size. No-op # elsewhere. @@ -202,7 +202,7 @@ Subject: [PATCH] Disable various compiler configs if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2646,7 +2622,8 @@ config("optimize_max") { +@@ -2825,7 +2801,8 @@ config("optimize_max") { # # TODO(crbug.com/41259697) - rework how all of these configs are related # so that we don't need this disclaimer. @@ -212,7 +212,7 @@ Subject: [PATCH] Disable various compiler configs if (is_nacl && is_nacl_irt) { # The NaCl IRT is a special case and always wants its own config. # Various components do: -@@ -2675,7 +2652,8 @@ config("optimize_speed") { +@@ -2854,7 +2831,8 @@ config("optimize_speed") { } } @@ -222,7 +222,7 @@ Subject: [PATCH] Disable various compiler configs cflags = [ "-O1" ] + common_optimize_on_cflags rustflags = [ "-Copt-level=1" ] ldflags = common_optimize_on_ldflags -@@ -2806,7 +2784,8 @@ config("win_pdbaltpath") { +@@ -2985,7 +2963,8 @@ config("win_pdbaltpath") { } # Full symbols. @@ -232,7 +232,7 @@ Subject: [PATCH] Disable various compiler configs rustflags = [] configs = [] if (is_win) { -@@ -2968,7 +2947,8 @@ config("symbols") { +@@ -3159,7 +3138,8 @@ config("symbols") { # Minimal symbols. # This config guarantees to hold symbol for stack trace which are shown to user # when crash happens in unittests running on buildbot. @@ -242,7 +242,7 @@ Subject: [PATCH] Disable various compiler configs rustflags = [] if (is_win) { # Functions, files, and line tables only. -@@ -3053,7 +3033,8 @@ config("minimal_symbols") { +@@ -3244,7 +3224,8 @@ config("minimal_symbols") { # This configuration contains function names only. That is, the compiler is # told to not generate debug information and the linker then just puts function # names in the final debug information. diff --git a/chromium-130-fontations.patch b/chromium-130-fontations.patch index 601314c..a0af593 100644 --- a/chromium-130-fontations.patch +++ b/chromium-130-fontations.patch @@ -1,5 +1,5 @@ ---- src/skia/BUILD.gn.orig 2025-04-11 12:05:22.085153891 +0200 -+++ src/skia/BUILD.gn 2025-04-11 20:35:59.999827501 +0200 +--- a/skia/BUILD.gn ++++ b/skia/BUILD.gn @@ -8,7 +8,6 @@ import("//build/config/features.gni") import("//build/config/freetype/freetype.gni") import("//build/config/rust.gni") @@ -19,13 +19,13 @@ -rust_static_library("bridge_rust_side") { - allow_unsafe = true - crate_root = skia_fontations_bridge_root -- sources = skia_fontations_bridge_sources -- cxx_bindings = skia_fontations_bridge_sources +- sources = skia_ports_fontations_bridge_rust_side_sources +- cxx_bindings = [ skia_fontations_bridge_root ] - deps = [ - ":path_bridge", - "//third_party/rust/font_types/v0_8:lib", -- "//third_party/rust/read_fonts/v0_25:lib", -- "//third_party/rust/skrifa/v0_26:lib", +- "//third_party/rust/read_fonts/v0_27:lib", +- "//third_party/rust/skrifa/v0_29:lib", - ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ @@ -36,7 +36,7 @@ # External-facing config for dependent code. config("skia_config") { -@@ -182,7 +160,6 @@ config("skia_library_config") { +@@ -190,7 +168,6 @@ config("skia_library_config") { if (use_blink && enable_freetype) { defines += [ "SK_TYPEFACE_FACTORY_FREETYPE", @@ -44,7 +44,7 @@ "SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE", ] } -@@ -417,14 +394,6 @@ component("skia") { +@@ -428,14 +405,6 @@ component("skia") { public += skia_ports_fontmgr_empty_public } sources += skia_ports_typeface_proxy_sources @@ -59,7 +59,7 @@ } if (is_win) { -@@ -719,13 +688,7 @@ skia_source_set("skia_core_and_effects") +@@ -730,13 +699,7 @@ skia_source_set("skia_core_and_effects") # skia_core_and_effects rather than the other way around. public_deps = [ "//third_party/dawn/include/dawn:cpp_headers" ] } @@ -74,37 +74,139 @@ visibility = [ ":skia" ] } ---- src/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc.orig 2025-04-11 12:05:22.929220697 +0200 -+++ src/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc 2025-04-11 20:35:59.999827501 +0200 -@@ -13,7 +13,6 @@ +--- a/skia/ext/font_utils.cc ++++ b/skia/ext/font_utils.cc +@@ -69,13 +69,7 @@ static sk_sp fontmgr_factory( + return SkFontMgr_New_CoreText(nullptr); + #elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) + sk_sp fci(SkFontConfigInterface::RefGlobal()); +- if (base::FeatureList::IsEnabled(skia::kFontationsLinuxSystemFonts)) { +- return fci ? SkFontMgr_New_FCI(std::move(fci), +- SkFontScanner_Make_Fontations()) +- : nullptr; +- } else { +- return fci ? SkFontMgr_New_FCI(std::move(fci)) : nullptr; +- } ++ return fci ? SkFontMgr_New_FCI(std::move(fci)) : nullptr; + #elif BUILDFLAG(IS_FUCHSIA) + fuchsia::fonts::ProviderSyncPtr provider; + base::ComponentContextForProcess()->svc()->Connect(provider.NewRequest()); +--- a/third_party/blink/renderer/platform/fonts/skia/sktypeface_factory.cc ++++ b/third_party/blink/renderer/platform/fonts/skia/sktypeface_factory.cc +@@ -29,11 +29,7 @@ sk_sp SkTypeface_Factory::Fr + font_identity.fID = config_id; + font_identity.fTTCIndex = ttc_index; + +- if (base::FeatureList::IsEnabled(skia::kFontationsLinuxSystemFonts)) { +- return fci->makeTypeface(font_identity, SkFontMgr_New_Fontations_Empty()); +- } else { + return fci->makeTypeface(font_identity, skia::DefaultFontMgr()); +- } + #else + NOTREACHED(); + #endif +@@ -46,12 +42,7 @@ sk_sp SkTypeface_Factory::Fr + #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \ + !BUILDFLAG(IS_APPLE) + +- if (base::FeatureList::IsEnabled(skia::kFontationsLinuxSystemFonts)) { +- return SkFontMgr_New_Fontations_Empty()->makeFromFile(filename.c_str(), +- ttc_index); +- } else { + return skia::DefaultFontMgr()->makeFromFile(filename.c_str(), ttc_index); +- } + #else + NOTREACHED(); + #endif +--- a/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc ++++ b/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc +@@ -12,7 +12,6 @@ + #include "third_party/blink/renderer/platform/fonts/opentype/font_format_check.h" #include "third_party/freetype_buildflags.h" - #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkTypeface_fontations.h" #if BUILDFLAG(IS_WIN) #include "third_party/blink/renderer/platform/fonts/win/dwrite_font_format_support.h" -@@ -55,7 +54,7 @@ bool IsFreeTypeSystemRasterizer() { +@@ -38,11 +37,7 @@ bool IsWin() { + } + + bool IsFreeTypeSystemRasterizer() { +-#if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_APPLE) + return true; +-#else +- return false; +-#endif } sk_sp MakeTypefaceDefaultFontMgr(sk_sp data) { +@@ -50,13 +45,7 @@ sk_sp MakeTypefaceDefaultFon + return FontCache::Get().FontManager()->makeFromData(data, 0); + #endif + +-#if BUILDFLAG(IS_APPLE) + return skia::DefaultFontMgr()->makeFromData(data, 0); +-#endif +- -#if !(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)) -+#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)) - if (RuntimeEnabledFeatures::FontationsFontBackendEnabled()) { - std::unique_ptr stream(new SkMemoryStream(data)); - return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); -@@ -83,10 +82,6 @@ sk_sp MakeTypefaceFallback(s +- return SkTypeface_Make_Fontations(data, SkFontArguments()); +-#endif + } + + #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) +@@ -65,10 +54,6 @@ sk_sp MakeTypefaceFallback(s } #endif -sk_sp MakeTypefaceFontations(sk_sp data) { -- std::unique_ptr stream(new SkMemoryStream(data)); -- return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments()); +- return SkTypeface_Make_Fontations(data, SkFontArguments()); -} - +- sk_sp MakeVariationsTypeface( sk_sp data, -@@ -188,7 +183,6 @@ bool WebFontTypefaceFactory::CreateTypef + const WebFontTypefaceFactory::FontInstantiator& instantiator) { +@@ -88,9 +73,6 @@ sk_sp MakeSbixTypeface( + const WebFontTypefaceFactory::FontInstantiator& instantiator) { + // If we're on a OS with FreeType as backend, or on Windows, where we used to + // use FreeType for SBIX, switch to Fontations for SBIX. +- if (IsFreeTypeSystemRasterizer() || IsWin()) { +- return instantiator.make_fontations(data); +- } + + // Remaining case, on Mac, CoreText can handle creating SBIX fonts. + return instantiator.make_system(data); +@@ -99,29 +81,21 @@ sk_sp MakeSbixTypeface( + sk_sp MakeColrV0Typeface( + sk_sp data, + const WebFontTypefaceFactory::FontInstantiator& instantiator) { +- if (IsWin()) { + // On Windows Skia's DirectWrite + // backend handles COLRv0. + return instantiator.make_system(data); +- } +- return instantiator.make_fontations(data); + } + + sk_sp MakeColrV0VariationsTypeface( + sk_sp data, + const WebFontTypefaceFactory::FontInstantiator& instantiator) { +-#if BUILDFLAG(IS_WIN) +- if (DWriteVersionSupportsVariations()) { + return instantiator.make_system(data); +- } +-#endif +- return instantiator.make_fontations(data); + } + + sk_sp MakeFontationsFallbackPreferred( + sk_sp data, + const WebFontTypefaceFactory::FontInstantiator& instantiator) { +- return instantiator.make_fontations(data); ++ return instantiator.make_system(data); + } + + } // namespace +@@ -131,7 +105,6 @@ bool WebFontTypefaceFactory::CreateTypef const FontFormatCheck format_check(data); const FontInstantiator instantiator = { MakeTypefaceDefaultFontMgr, diff --git a/chromium-132-no-rust.patch b/chromium-132-no-rust.patch index e33894e..9d165fe 100644 --- a/chromium-132-no-rust.patch +++ b/chromium-132-no-rust.patch @@ -1,15 +1,44 @@ +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -27,7 +27,6 @@ import("//extensions/buildflags/buildfla + import("//gpu/vulkan/features.gni") + import("//media/gpu/args.gni") + import("//media/media_options.gni") +-import("//mojo/public/rust/rust.gni") + import("//pdf/features.gni") + import("//ppapi/buildflags/buildflags.gni") + import("//printing/buildflags/buildflags.gni") +@@ -885,17 +884,10 @@ group("all_rust") { + + deps = [ + ":rust_build_tests", +- "//base:base_unittests", # There is rust stuff in here. +- "//third_party/cloud_authenticator/processor", + ] + +- # TODO(https://crbug.com/405379314): This fails to build on some iOS ASAN +- # builders. +- if (!is_ios || !is_asan) { +- deps += [ "//testing/rust_gtest_interop:rust_gtest_interop_unittests" ] +- } + +- if (enable_rust_mojo) { ++ if (false) { + deps += [ + "//mojo/public/rust:mojo_rust", + "//mojo/public/rust:mojo_rust_integration_unittests", --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -38,8 +38,6 @@ +@@ -36,8 +36,6 @@ import("//build/config/sanitizers/saniti import("//build/config/sysroot.gni") import("//build/config/ui.gni") import("//build/nocompile.gni") -import("//build/rust/rust_bindgen.gni") -import("//build/rust/rust_static_library.gni") - import("//build/timestamp.gni") import("//build/util/process_version.gni") import("//build_overrides/build.gni") -@@ -1022,11 +1020,6 @@ + import("//testing/libfuzzer/fuzzer_test.gni") +@@ -1053,11 +1051,6 @@ component("base") { # Used by metrics/crc32, except on NaCl builds. deps += [ "//third_party/zlib" ] @@ -21,7 +50,7 @@ } # `raw_ptr` cannot be made a component due to CRT symbol issues. -@@ -1063,7 +1056,7 @@ +@@ -1093,7 +1086,7 @@ component("base") { "//third_party/abseil-cpp:absl", ] @@ -30,7 +59,7 @@ sources += [ "containers/span_rust.h", "strings/string_view_rust.h", -@@ -1543,8 +1536,6 @@ +@@ -1598,8 +1591,6 @@ component("base") { "files/scoped_temp_file.h", "json/json_file_value_serializer.cc", "json/json_file_value_serializer.h", @@ -39,7 +68,7 @@ "memory/discardable_memory.cc", "memory/discardable_memory.h", "memory/discardable_memory_allocator.cc", -@@ -2447,40 +2438,6 @@ +@@ -2542,62 +2533,6 @@ component("base") { } } @@ -55,21 +84,43 @@ - deps = [ ":debugging_buildflags" ] -} - --rust_bindgen("logging_rust_log_integration_bindgen") { -- header = "logging/rust_log_integration.h" -- cpp = true -- visibility = [ ":*" ] -- -- # Transitive generated header dependency. -- deps = [ ":debugging_buildflags" ] --} -- -rust_static_library("rust_logger") { - allow_unsafe = true # Unsafe needed for FFI. - deps = [ - ":logging_log_severity_bindgen", -- ":logging_rust_log_integration_bindgen", +- ":tracing_buildflags", +- "//build:chromeos_buildflags", - "//third_party/rust/log/v0_4:lib", +- +- # Needed because of circular dependency: base depends on this target and by +- # extension the cxx-generated C++ code, but the cxx-generated code includes +- # base headers and calls base code. This seems to generally not cause +- # issues, except for partition_alloc which applies configs when depended on. +- # +- # This allows the generated C++ code to transitively include partition alloc +- # headers without issue. +- # +- # TODO(collinbaker): determine how to handle these cxx bindings-induced +- # circular dependencies more robustly. +- "//base/allocator/partition_allocator:raw_ptr", +- +- # Needed because logging/rust_logger.rs contains: +- # include!("base/logging/rust_log_integration.h"); +- # rust_log_integration.h ends up transitively #including +- # debug/debugging_buildflags.h, which is a generated header that needs to +- # be written first. +- # +- # Technically it would be more correct to depend on :base, which is the +- # target for rust_log_integration.h, but that's not possible due to circular +- # dependencies. +- # +- # Note if this is removed the build may still work by accident because +- # debug/debugging_buildflags.h still ends up being generated through a +- # dependency chain via :logging_log_severity_bindgen. But we should not +- # rely on that. +- # +- # See also https://crbug.com/406267472. +- ":debugging_buildflags", - ] - visibility = [ ":base" ] - sources = [ "logging/rust_logger.rs" ] @@ -80,7 +131,7 @@ if (is_linux || is_chromeos) { # Split out as a separate target for two reasons: -@@ -3564,7 +3521,7 @@ +@@ -3736,7 +3671,7 @@ test("base_unittests") { sources += [ "location_unittest.cc" ] } @@ -89,7 +140,7 @@ sources += [ "containers/span_rust_unittest.cc", "strings/string_piece_rust_unittest.cc", -@@ -3617,7 +3574,7 @@ +@@ -3791,7 +3726,7 @@ test("base_unittests") { deps += [ "allocator/partition_allocator/src/partition_alloc:unittests" ] } @@ -98,33 +149,67 @@ deps += [ "//build/rust:cxx_cppdeps" ] } ---- a/BUILD.gn -+++ b/BUILD.gn -@@ -28,7 +28,6 @@ - import("//gpu/vulkan/features.gni") - import("//media/gpu/args.gni") - import("//media/media_options.gni") --import("//mojo/public/rust/rust.gni") - import("//pdf/features.gni") - import("//ppapi/buildflags/buildflags.gni") - import("//printing/buildflags/buildflags.gni") -@@ -888,12 +887,9 @@ +--- a/base/json/json_reader.cc ++++ b/base/json/json_reader.cc +@@ -13,7 +13,7 @@ + #include "base/strings/string_number_conversions.h" + #include "build/build_config.h" - deps = [ - ":rust_build_tests", -- "//base:base_unittests", # There is rust stuff in here. -- "//testing/rust_gtest_interop:rust_gtest_interop_unittests", -- "//third_party/cloud_authenticator/processor", - ] +-#if BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) + #include "base/json/json_parser.h" + #else + #include "base/strings/string_view_rust.h" +@@ -23,7 +23,7 @@ -- if (enable_rust_mojo) { -+ if (false) { - deps += [ - "//mojo/public/rust:mojo_rust", - "//mojo/public/rust:mojo_rust_integration_unittests", + // TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just + // run in-process there. Don't compile base::JSONReader on NaCL at all. +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + + namespace { + const char kSecurityJsonParsingTime[] = "Security.JSONParser.ParsingTime"; +@@ -144,7 +144,7 @@ std::string JSONReader::Error::ToString( + std::optional JSONReader::Read(std::string_view json, + int options, + size_t max_depth) { +-#if BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) + internal::JSONParser parser(options, max_depth); + return parser.Parse(json); + #else // BUILDFLAG(IS_NACL) +@@ -185,7 +185,7 @@ std::optional JSONReader::R + JSONReader::Result JSONReader::ReadAndReturnValueWithError( + std::string_view json, + int options) { +-#if BUILDFLAG(IS_NACL) ++#if !BUILDFLAG(IS_NACL) + internal::JSONParser parser(options); + auto value = parser.Parse(json); + if (!value) { +--- a/base/logging.cc ++++ b/base/logging.cc +@@ -117,7 +117,7 @@ typedef FILE* FileHandle; + #include "base/fuchsia/scoped_fx_logger.h" + #endif + +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + #include "base/logging/rust_logger.rs.h" + #endif + +@@ -529,7 +529,7 @@ bool BaseInitLoggingImpl(const LoggingSe + } + #endif + +-#if !BUILDFLAG(IS_NACL) ++#if BUILDFLAG(IS_NACL) + // Connects Rust logging with the //base logging functionality. + internal::init_rust_log_crate(); + #endif --- a/base/test/BUILD.gn +++ b/base/test/BUILD.gn -@@ -7,7 +7,6 @@ +@@ -6,7 +6,6 @@ import("//build/compiled_action.gni") import("//build/config/features.gni") import("//build/config/nacl/config.gni") import("//build/config/ui.gni") @@ -132,7 +217,7 @@ import("//build_overrides/build.gni") import("//third_party/protobuf/proto_library.gni") -@@ -39,16 +38,6 @@ +@@ -38,16 +37,6 @@ static_library("test_config") { ] } @@ -149,7 +234,7 @@ static_library("test_support") { testonly = true -@@ -189,7 +178,6 @@ +@@ -192,7 +181,6 @@ static_library("test_support") { public_deps = [ ":test_config", @@ -157,109 +242,36 @@ "//base", "//base:base_static", "//base:i18n", +--- a/services/on_device_model/ml/BUILD.gn ++++ b/services/on_device_model/ml/BUILD.gn +@@ -71,7 +71,6 @@ if (use_blink || (is_ios && build_with_i + ] + if (enable_constraints) { + defines += [ "ENABLE_ON_DEVICE_CONSTRAINTS" ] +- deps += [ "//third_party/rust/llguidance/v0_7:lib" ] + } + if (use_blink) { + deps += [ "//gpu/config" ] +--- a/services/on_device_model/ml/chrome_ml.cc ++++ b/services/on_device_model/ml/chrome_ml.cc +@@ -24,7 +24,6 @@ + #include "third_party/dawn/include/dawn/dawn_proc.h" + #include "third_party/dawn/include/dawn/native/DawnNative.h" + #include "third_party/dawn/include/dawn/webgpu_cpp.h" +-#include "third_party/rust/chromium_crates_io/vendor/llguidance-v0_7/llguidance.h" + + #if !BUILDFLAG(IS_IOS) + #include "gpu/config/gpu_info_collector.h" --- a/third_party/blink/common/BUILD.gn +++ b/third_party/blink/common/BUILD.gn -@@ -341,7 +341,6 @@ - "//services/metrics/public/cpp:ukm_builders", +@@ -311,7 +311,6 @@ source_set("common") { "//services/metrics/public/mojom:mojom", "//services/network/public/cpp:cpp", + "//services/network/public/mojom:mojom_permissions_policy", - "//third_party/blink/common/rust_crash", "//third_party/blink/public/common:buildflags", "//third_party/re2", "//ui/base:base", ---- a/third_party/breakpad/BUILD.gn -+++ b/third_party/breakpad/BUILD.gn -@@ -494,11 +494,6 @@ - # For breakpad/src/common/stabs_reader.h. - defines = [ "HAVE_MACH_O_NLIST_H" ] - -- # Rust demangle support. -- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ] -- defines += [ "HAVE_RUSTC_DEMANGLE" ] -- include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include" ] -- sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include/rustc_demangle.h" ] - } - test("breakpad_unittests") { - sources = [ "breakpad/src/common/module_unittest.cc" ] -@@ -742,11 +737,6 @@ - - include_dirs = [ "breakpad/src" ] - -- # Rust demangle support. -- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ] -- defines += [ "HAVE_RUSTC_DEMANGLE" ] -- include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include" ] -- sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-0.1.0/include/rustc_demangle.h" ] - - libs = [ "z" ] - } ---- a/base/json/json_reader.cc -+++ b/base/json/json_reader.cc -@@ -13,7 +13,7 @@ - #include "base/metrics/histogram_macros.h" - #include "build/build_config.h" - --#if !BUILDFLAG(IS_NACL) -+#if BUILDFLAG(IS_NACL) - #include "base/strings/string_view_rust.h" - #include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h" - #include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h" -@@ -23,7 +23,7 @@ - - // TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just - // run in-process there. Don't compile base::JSONReader on NaCL at all. --#if !BUILDFLAG(IS_NACL) -+#if BUILDFLAG(IS_NACL) - - namespace { - using serde_json_lenient::ContextPointer; -@@ -140,7 +140,7 @@ - std::optional JSONReader::Read(std::string_view json, - int options, - size_t max_depth) { --#if BUILDFLAG(IS_NACL) -+#if !BUILDFLAG(IS_NACL) - internal::JSONParser parser(options, max_depth); - return parser.Parse(json); - #else // BUILDFLAG(IS_NACL) -@@ -173,7 +173,7 @@ - JSONReader::Result JSONReader::ReadAndReturnValueWithError( - std::string_view json, - int options) { --#if BUILDFLAG(IS_NACL) -+#if !BUILDFLAG(IS_NACL) - internal::JSONParser parser(options); - auto value = parser.Parse(json); - if (!value) { -@@ -213,7 +213,7 @@ - if (!base::FeatureList::GetInstance()) { - return false; - } --#if BUILDFLAG(IS_NACL) -+#if !BUILDFLAG(IS_NACL) - return false; - #else - return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser); ---- a/base/logging.cc -+++ b/base/logging.cc -@@ -126,7 +126,7 @@ - #include "base/fuchsia/scoped_fx_logger.h" - #endif - --#if !BUILDFLAG(IS_NACL) -+#if BUILDFLAG(IS_NACL) - #include "base/logging/rust_logger.rs.h" - #endif - -@@ -526,7 +526,7 @@ - } - #endif - --#if !BUILDFLAG(IS_NACL) -+#if BUILDFLAG(IS_NACL) - // Connects Rust logging with the //base logging functionality. - internal::init_rust_log_crate(); - #endif --- a/third_party/blink/common/chrome_debug_urls.cc +++ b/third_party/blink/common/chrome_debug_urls.cc @@ -11,7 +11,6 @@ @@ -270,7 +282,7 @@ #include "url/gurl.h" #if BUILDFLAG(IS_WIN) -@@ -117,7 +116,7 @@ +@@ -117,7 +116,7 @@ NOINLINE void MaybeTriggerAsanError(cons // Ensure that ASAN works even in Rust code. LOG(ERROR) << "Intentionally causing ASAN heap overflow in Rust" << " because user navigated to " << url.spec(); @@ -279,7 +291,7 @@ } } #endif // ADDRESS_SANITIZER -@@ -137,7 +136,7 @@ +@@ -137,7 +136,7 @@ void HandleChromeDebugURL(const GURL& ur } else if (url == kChromeUICrashRustURL) { // Cause a typical crash in Rust code, so we can test that call stack // collection and symbol mangling work across the language boundary. @@ -288,3 +300,32 @@ } else if (url == kChromeUIDumpURL) { // This URL will only correctly create a crash dump file if content is // hosted in a process that has correctly called +--- a/third_party/breakpad/BUILD.gn ++++ b/third_party/breakpad/BUILD.gn +@@ -494,12 +494,7 @@ if (is_mac) { + # For breakpad/src/common/stabs_reader.h. + defines = [ "HAVE_MACH_O_NLIST_H" ] + +- # Rust demangle support. +- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ] +- defines += [ "HAVE_RUSTC_DEMANGLE" ] +- include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-v0_1/include" ] +- sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-v0_1/include/rustc_demangle.h" ] +- } ++ } + test("breakpad_unittests") { + sources = [ "breakpad/src/common/module_unittest.cc" ] + deps = [ +@@ -742,12 +737,6 @@ if (is_linux || is_chromeos || is_androi + + include_dirs = [ "breakpad/src" ] + +- # Rust demangle support. +- deps = [ "//third_party/rust/rustc_demangle_capi/v0_1:lib" ] +- defines += [ "HAVE_RUSTC_DEMANGLE" ] +- include_dirs += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-v0_1/include" ] +- sources += [ "//third_party/rust/chromium_crates_io/vendor/rustc-demangle-capi-v0_1/include/rustc_demangle.h" ] +- + libs = [ "z" ] + } + } else if (current_toolchain == default_toolchain) { diff --git a/common.gypi-compiler.patch b/common.gypi-compiler.patch index c67f1d7..0b16167 100644 --- a/common.gypi-compiler.patch +++ b/common.gypi-compiler.patch @@ -1,9 +1,9 @@ ---- src/third_party/electron_node/common.gypi.orig 2025-04-10 20:07:02.154742467 +0200 -+++ src/third_party/electron_node/common.gypi 2025-04-11 11:45:57.996110023 +0200 -@@ -514,15 +514,19 @@ +--- src/third_party/electron_node/common.gypi.orig 2025-07-19 11:44:59.181882205 +0200 ++++ src/third_party/electron_node/common.gypi 2025-07-19 16:21:44.297731896 +0200 +@@ -534,15 +534,19 @@ 'ldflags': [ '-pthread' ], }], - [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { + [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony"', { - 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], + # Add some useful flags which need to be specified on all modules anyway. + # `-fpic -fno-semantic-interposition` is the best relocation model for code that will live in a dlopened library @@ -23,7 +23,7 @@ 'target_conditions': [ # The 1990s toolchain on SmartOS can't handle thin archives. ['_type=="static_library" and OS=="solaris"', { -@@ -700,29 +704,7 @@ +@@ -720,29 +724,7 @@ '-Wl,--export-dynamic', ], }], diff --git a/common.gypi-remove-fno-omit-frame-pointer.patch b/common.gypi-remove-fno-omit-frame-pointer.patch index ffc063c..98b60cd 100644 --- a/common.gypi-remove-fno-omit-frame-pointer.patch +++ b/common.gypi-remove-fno-omit-frame-pointer.patch @@ -14,6 +14,6 @@ since we compile everything with -fasynchronous-unwind-tables anyway. - # frames otherwise, even with --call-graph dwarf. - 'cflags': [ '-fno-omit-frame-pointer' ], - }], - ['OS=="linux"', { + ['OS=="linux" or OS=="openharmony"', { 'conditions': [ ['enable_pgo_generate=="true"', { diff --git a/content_browser_client-incomplete-WebUIController.patch b/content_browser_client-incomplete-WebUIController.patch deleted file mode 100644 index 75e3a46..0000000 --- a/content_browser_client-incomplete-WebUIController.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/content/public/browser/content_browser_client.cc.orig 2025-04-16 14:45:09.657704679 +0200 -+++ src/content/public/browser/content_browser_client.cc 2025-04-17 16:18:19.395831947 +0200 -@@ -53,6 +53,7 @@ - #include "content/public/browser/vpn_service_proxy.h" - #include "content/public/browser/web_contents.h" - #include "content/public/browser/web_contents_view_delegate.h" -+#include "content/public/browser/web_ui_controller.h" - #include "content/public/common/alternative_error_page_override_info.mojom.h" - #include "content/public/common/content_features.h" - #include "content/public/common/url_utils.h" diff --git a/cr130-abseil-remove-unused-deps.patch b/cr130-abseil-remove-unused-deps.patch index 348a89a..61b3a07 100644 --- a/cr130-abseil-remove-unused-deps.patch +++ b/cr130-abseil-remove-unused-deps.patch @@ -1,6 +1,14 @@ ---- src/third_party/abseil-cpp/BUILD.gn.orig 2025-04-11 12:05:22.125274194 +0200 -+++ src/third_party/abseil-cpp/BUILD.gn 2025-04-12 14:23:17.763743696 +0200 -@@ -84,13 +84,9 @@ group("absl_component_deps") { +--- src/third_party/abseil-cpp/BUILD.gn.orig 2025-07-19 11:32:36.617980004 +0200 ++++ src/third_party/abseil-cpp/BUILD.gn 2025-08-15 17:20:46.305540851 +0200 +@@ -62,7 +62,6 @@ group("absl_component_deps") { + "//third_party/abseil-cpp/absl/base", + "//third_party/abseil-cpp/absl/base:config", + "//third_party/abseil-cpp/absl/base:core_headers", +- "//third_party/abseil-cpp/absl/base:fast_type_id", + "//third_party/abseil-cpp/absl/base:log_severity", + "//third_party/abseil-cpp/absl/base:no_destructor", + "//third_party/abseil-cpp/absl/base:nullability", +@@ -85,13 +84,9 @@ group("absl_component_deps") { "//third_party/abseil-cpp/absl/hash", "//third_party/abseil-cpp/absl/log:absl_check", "//third_party/abseil-cpp/absl/log:absl_log", @@ -14,7 +22,23 @@ "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/numeric:bits", -@@ -290,8 +286,6 @@ if (absl_build_tests) { +@@ -102,7 +97,6 @@ group("absl_component_deps") { + "//third_party/abseil-cpp/absl/status", + "//third_party/abseil-cpp/absl/status:statusor", + "//third_party/abseil-cpp/absl/strings", +- "//third_party/abseil-cpp/absl/strings:charset", + "//third_party/abseil-cpp/absl/strings:cord", + "//third_party/abseil-cpp/absl/strings:has_ostream_operator", + "//third_party/abseil-cpp/absl/strings:str_format", +@@ -125,7 +119,6 @@ group("absl_component_deps") { + "//third_party/abseil-cpp/absl/base:raw_logging_internal", + + # absl internal utilities used by protobuf. +- "//third_party/abseil-cpp/absl/container:layout", + ] + + if (is_component_build) { +@@ -295,8 +288,6 @@ if (absl_build_tests) { "absl/container:flat_hash_set_test", "absl/container:hash_function_defaults_test", "absl/container:inlined_vector_test", @@ -22,8 +46,8 @@ - "absl/container:node_hash_set_test", "absl/container:node_slot_policy_test", "absl/container:raw_hash_set_allocator_test", - "absl/container:raw_hash_set_test", -@@ -300,11 +294,8 @@ if (absl_build_tests) { + "absl/container:raw_hash_set_resize_impl_test", +@@ -305,11 +296,8 @@ if (absl_build_tests) { "absl/crc:crc_cord_state_test", "absl/crc:crc_memcpy_test", "absl/crc:non_temporal_memcpy_test", @@ -35,7 +59,7 @@ "absl/flags:flag_test", "absl/functional:any_invocable_test", "absl/functional:function_ref_test", -@@ -328,7 +319,6 @@ if (absl_build_tests) { +@@ -333,7 +321,6 @@ if (absl_build_tests) { "absl/log:vlog_is_on_test", "absl/log/internal:fnmatch_test", "absl/log/internal:stderr_log_sink_test", @@ -43,7 +67,7 @@ "absl/memory:memory_test", "absl/meta:type_traits_test", "absl/numeric:int128_test", -@@ -336,7 +326,6 @@ if (absl_build_tests) { +@@ -341,7 +328,6 @@ if (absl_build_tests) { "absl/profiling:periodic_sampler_test", "absl/random:distributions_test", "absl/random:mock_distributions_test", @@ -51,7 +75,7 @@ "absl/status:status_matchers_test", "absl/status:status_test", "absl/status:statusor_test", -@@ -359,7 +348,6 @@ if (absl_build_tests) { +@@ -367,7 +353,6 @@ if (absl_build_tests) { "absl/strings:has_absl_stringify_test", "absl/strings:has_ostream_operator_test", "absl/strings:match_test", @@ -59,7 +83,7 @@ "absl/strings:str_format_arg_test", "absl/strings:str_format_bind_test", "absl/strings:str_format_checker_test", -@@ -370,11 +358,7 @@ if (absl_build_tests) { +@@ -378,11 +363,7 @@ if (absl_build_tests) { "absl/strings:str_format_test", "absl/strings:str_replace_test", "absl/strings:string_view_test", @@ -70,4 +94,4 @@ - "absl/synchronization:per_thread_sem_test", "absl/synchronization:waiter_test", "absl/time:time_test", - "absl/types:optional_test", + "absl/types:span_test", diff --git a/create_tarball.sh b/create_tarball.sh index c963dbd..cb116d3 100644 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -221,7 +221,6 @@ keeplibs=( third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/parsel-js third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs third_party/devtools-frontend/src/third_party/i18n #javascript - third_party/distributed_point_functions #not in any distro third_party/dom_distiller_js #javascript #third_party/eigen3 #Used only by tflite which is not used in electron third_party/electron_node #Integral part of electron @@ -234,6 +233,11 @@ keeplibs=( third_party/ipcz #not in any distro third_party/khronos #Modified to add ANGLE definitions third_party/leveldatabase #use of private headers + third_party/libaom #15.6 too old + third_party/libaom/source/libaom/third_party/fastfeat + third_party/libaom/source/libaom/third_party/SVT-AV1 + third_party/libaom/source/libaom/third_party/vector + third_party/libaom/source/libaom/third_party/x86inc third_party/libgav1 #Usage of private headers (ObuFrameHeader from utils/types.h) third_party/libsrtp #Needs to be built against boringssl, not openssl third_party/libsync #not yet in any distro @@ -271,6 +275,7 @@ keeplibs=( third_party/pffft #not in any distro, also heavily patched third_party/polymer #javascript third_party/protobuf #Heavily forked. Apparently was officially unbundlable back in the GYP days, and may be again in the future. + third_party/protobuf/third_party/utf8_range # Integral part of protobuf third_party/rapidhash #Fork third_party/re2 # fedora too old third_party/rnnoise #use of private headers @@ -297,7 +302,6 @@ keeplibs=( third_party/webrtc/modules/third_party/fft #derived code, not vendored dep third_party/webrtc/modules/third_party/g711 #Fork. Original is from spandsp. Might be debundled if upstream ever accepts WebRTC's patches. third_party/webrtc/modules/third_party/g722 #Fork. Original is from spandsp. - third_party/webrtc/rtc_base/third_party/base64 #derived code, not vendored dep third_party/webrtc/rtc_base/third_party/sigslot #derived code, not vendored dep third_party/webrtc_overrides #Integral part of chrome third_party/widevine #Integral part of chrome. Needed. diff --git a/css_shape_value-constructor.patch b/css_shape_value-constructor.patch deleted file mode 100644 index 693ebe3..0000000 --- a/css_shape_value-constructor.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/third_party/blink/renderer/core/css/css_shape_value.h.orig 2025-04-16 14:36:32.392070147 +0200 -+++ src/third_party/blink/renderer/core/css/css_shape_value.h 2025-04-16 22:22:56.896578913 +0200 -@@ -96,7 +96,7 @@ using CSSShapeControlPoint = std::pair - class CSSShapeCurveCommand : public CSSShapeCommand { - public: -- CSSShapeCurveCommand<1>(Type type, -+ CSSShapeCurveCommand(Type type, - const CSSValuePair& end_point, - const CSSShapeControlPoint control_point) - : CSSShapeCommand(type, end_point), control_points_{control_point} {} diff --git a/disable-catapult.patch b/disable-catapult.patch index 115c0e4..f30a6c5 100644 --- a/disable-catapult.patch +++ b/disable-catapult.patch @@ -167,21 +167,21 @@ author: Michael Gilbert "//media/mojo/mojom:speech_recognition", "//ui/base", ] ---- src/chrome/chrome_paks.gni.orig 2024-12-08 18:34:54.604673311 +0100 -+++ src/chrome/chrome_paks.gni 2024-12-18 12:15:07.247395616 +0100 -@@ -202,8 +202,6 @@ template("chrome_extra_paks") { +--- src/chrome/chrome_paks.gni.orig 2025-07-19 11:32:31.785979797 +0200 ++++ src/chrome/chrome_paks.gni 2025-07-19 16:32:46.337623073 +0200 +@@ -230,8 +230,6 @@ template("chrome_extra_paks") { + "$root_gen_dir/chrome/web_app_internals_resources.pak", "$root_gen_dir/chrome/webui_gallery_resources.pak", "$root_gen_dir/chrome/whats_new_resources.pak", - "$root_gen_dir/content/browser/devtools/devtools_resources.pak", - "$root_gen_dir/content/browser/tracing/tracing_resources.pak", - "$root_gen_dir/content/traces_internals_resources.pak", ] deps += [ - "//chrome/browser/resources:component_extension_resources", -@@ -215,7 +213,6 @@ template("chrome_extra_paks") { + "//chrome/browser/resources:dev_ui_paks", +@@ -241,7 +239,6 @@ template("chrome_extra_paks") { "//chrome/browser/resources/lens/shared:resources", "//chrome/browser/resources/search_engine_choice:resources", - "//content/browser/devtools:devtools_resources", + "//chrome/browser/resources/tabs/tab_group_home:resources", - "//content/browser/tracing:resources", ] if (is_chrome_branded) { @@ -313,8 +313,8 @@ author: Michael Gilbert "//third_party/perfetto/src/trace_processor:trace_processor_shell", ] data = [ ---- src/electron/electron_paks.gni.orig 2025-04-11 12:02:41.243100651 +0200 -+++ src/electron/electron_paks.gni 2025-04-11 12:28:19.897748625 +0200 +--- src/electron/build/electron_paks.gni.orig 2025-04-11 12:02:41.243100651 +0200 ++++ src/electron/build/electron_paks.gni 2025-04-11 12:28:19.897748625 +0200 @@ -57,7 +57,6 @@ template("electron_extra_paks") { "$root_gen_dir/chrome/common_resources.pak", "$root_gen_dir/components/components_resources.pak", diff --git a/disable-devtools-tests.patch b/disable-devtools-tests.patch deleted file mode 100644 index cd79eb7..0000000 --- a/disable-devtools-tests.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/third_party/devtools-frontend/src/BUILD.gn.orig 2024-12-08 18:36:42.531343187 +0100 -+++ src/third_party/devtools-frontend/src/BUILD.gn 2024-12-18 12:29:53.036757634 +0100 -@@ -16,7 +16,6 @@ import("./third_party/blink/public/publi - devtools_frontend_resources_deps = [ - ":favicon", - "front_end", -- "test", - ] - - group("devtools_all_files") { diff --git a/disable-webspeech.patch b/disable-webspeech.patch index 774d8a7..83434ce 100644 --- a/disable-webspeech.patch +++ b/disable-webspeech.patch @@ -101,9 +101,9 @@ Reviewed-by: Allan Sandfeld Jensen if ((is_linux || is_chromeos) && use_dbus) { deps += [ "//dbus" ] } --- src/content/browser/browser_interface_binders.cc.orig 2025-04-11 12:05:19.980351905 +0200 -+++ src/content/browser/browser_interface_binders.cc 2025-04-11 19:48:15.944587282 +0200 -@@ -61,7 +61,9 @@ +--- src/content/browser/browser_interface_binders.cc.orig 2025-07-19 11:32:34.193979827 +0200 ++++ src/content/browser/browser_interface_binders.cc 2025-07-20 14:51:05.789212478 +0200 +@@ -62,7 +62,9 @@ #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/service_worker/service_worker_host.h" #include "content/browser/shared_storage/shared_storage_worklet_host.h" @@ -113,7 +113,7 @@ Reviewed-by: Allan Sandfeld Jensen #include "content/browser/storage_access/storage_access_handle.h" #include "content/browser/tracing/trace_report/trace_report.mojom.h" #include "content/browser/tracing/trace_report/trace_report_internals_ui.h" -@@ -100,7 +102,9 @@ +@@ -101,7 +103,9 @@ #include "media/mojo/mojom/media_metrics_provider.mojom.h" #include "media/mojo/mojom/media_player.mojom.h" #include "media/mojo/mojom/remoting.mojom.h" @@ -123,7 +123,7 @@ Reviewed-by: Allan Sandfeld Jensen #include "media/mojo/mojom/video_decode_perf_history.mojom.h" #include "media/mojo/mojom/video_encoder_metrics_provider.mojom.h" #include "media/mojo/mojom/webrtc_video_perf.mojom.h" -@@ -206,7 +210,9 @@ +@@ -209,7 +213,9 @@ #else // BUILDFLAG(IS_ANDROID) #include "content/browser/direct_sockets/direct_sockets_service_impl.h" #include "media/mojo/mojom/renderer_extensions.mojom.h" @@ -132,7 +132,7 @@ Reviewed-by: Allan Sandfeld Jensen +#endif #include "third_party/blink/public/mojom/hid/hid.mojom.h" #include "third_party/blink/public/mojom/installedapp/installed_app_provider.mojom.h" - #include "third_party/blink/public/mojom/serial/serial.mojom.h" + #endif // BUILDFLAG(IS_ANDROID) @@ -865,11 +871,13 @@ void PopulateFrameBinders(RenderFrameHos map->Add( base::BindRepeating(&BindSharedWorkerConnector, base::Unretained(host))); @@ -147,7 +147,7 @@ Reviewed-by: Allan Sandfeld Jensen map->Add(base::BindRepeating( &RenderFrameHostImpl::GetSpeechSynthesis, base::Unretained(host))); -@@ -1197,6 +1205,7 @@ void PopulateBinderMapWithContext( +@@ -1194,6 +1202,7 @@ void PopulateBinderMapWithContext( #if !BUILDFLAG(IS_ANDROID) map->Add( base::BindRepeating(&DirectSocketsServiceImpl::CreateForFrame)); @@ -155,7 +155,7 @@ Reviewed-by: Allan Sandfeld Jensen map->Add(base::BindRepeating( &EmptyBinderForFrame)); map->Add( -@@ -1208,6 +1217,7 @@ void PopulateBinderMapWithContext( +@@ -1205,6 +1214,7 @@ void PopulateBinderMapWithContext( map->Add(base::BindRepeating( &EmptyBinderForFrame)); #endif @@ -163,13 +163,11 @@ Reviewed-by: Allan Sandfeld Jensen #if BUILDFLAG(ENABLE_UNHANDLED_TAP) map->Add(base::BindRepeating( &EmptyBinderForFrame)); -diff --git a/chromium/content/browser/browser_main_loop.cc b/chromium/content/browser/browser_main_loop.cc -index aaa752bec61..b3a1ed50d20 100644 ---- a/content/browser/browser_main_loop.cc -+++ b/content/browser/browser_main_loop.cc -@@ -87,7 +87,9 @@ - #include "content/browser/screenlock_monitor/screenlock_monitor.h" +--- src/content/browser/browser_main_loop.cc.orig 2025-07-19 11:32:34.193979827 +0200 ++++ src/content/browser/browser_main_loop.cc 2025-07-20 14:51:05.789212478 +0200 +@@ -91,7 +91,9 @@ #include "content/browser/screenlock_monitor/screenlock_monitor_device_source.h" + #include "content/browser/service_host/utility_process_host.h" #include "content/browser/sms/sms_provider.h" +#if BUILDFLAG(ENABLE_WEB_SPEECH) #include "content/browser/speech/speech_recognition_manager_impl.h" @@ -177,7 +175,7 @@ index aaa752bec61..b3a1ed50d20 100644 #include "content/browser/speech/tts_controller_impl.h" #include "content/browser/startup_data_impl.h" #include "content/browser/startup_task_runner.h" -@@ -1114,12 +1116,14 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { +@@ -1162,12 +1164,14 @@ void BrowserMainLoop::ShutdownThreadsAnd midi_service_->Shutdown(); } @@ -192,7 +190,7 @@ index aaa752bec61..b3a1ed50d20 100644 TtsControllerImpl::GetInstance()->Shutdown(); -@@ -1364,13 +1368,14 @@ void BrowserMainLoop::PostCreateThreadsImpl() { +@@ -1405,13 +1409,14 @@ void BrowserMainLoop::PostCreateThreadsI media_stream_manager_ = std::make_unique(audio_system_.get()); } @@ -235,18 +233,16 @@ index 3a2e713ccc3..6af5afde20e 100644 {wrf::EnableScriptedSpeechSynthesis, switches::kDisableSpeechSynthesisAPI, false}, {wrf::EnableSharedWorker, switches::kDisableSharedWorkers, false}, -diff --git a/chromium/media/BUILD.gn b/chromium/media/BUILD.gn -index 01e0910666e..6ce78127e3f 100644 ---- src/media/BUILD.gn 2025-04-11 12:05:21.244153535 +0200 -+++ src/media/BUILD.gn 2025-04-11 19:48:51.764578046 +0200 +--- src/media/BUILD.gn.orig 2025-07-19 11:32:35.633979930 +0200 ++++ src/media/BUILD.gn 2025-07-20 14:51:07.213212462 +0200 @@ -61,6 +61,7 @@ buildflag_header("media_buildflags") { "ENABLE_MSE_MPEG2TS_STREAM_PARSER=$enable_mse_mpeg2ts_stream_parser", "PLATFORM_HAS_OPTIONAL_HEVC_DECODE_SUPPORT=$platform_has_optional_hevc_decode_support", "PLATFORM_HAS_OPTIONAL_HEVC_ENCODE_SUPPORT=$platform_has_optional_hevc_encode_support", + "ENABLE_WEB_SPEECH=$enable_web_speech", "USE_ARC_PROTECTED_MEDIA=$use_arc_protected_media", - "USE_CHROMEOS_MEDIA_ACCELERATION=$use_vaapi||$use_v4l2_codec", "USE_CHROMEOS_PROTECTED_AV1=$use_chromeos_protected_av1", + "USE_CHROMEOS_PROTECTED_MEDIA=$use_chromeos_protected_media", diff --git a/chromium/media/media_options.gni b/chromium/media/media_options.gni index 5667cac61f3..48ea95a99a6 100644 --- a/media/media_options.gni diff --git a/distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch b/distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch deleted file mode 100644 index 2cc19bb..0000000 --- a/distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/third_party/distributed_point_functions/code/dpf/aes_128_fixed_key_hash.cc.old 2024-04-02 11:53:27.644284500 +0200 -+++ src/third_party/distributed_point_functions/code/dpf/aes_128_fixed_key_hash.cc 2024-04-02 22:24:29.350771600 +0200 -@@ -26,6 +26,7 @@ - #include "absl/numeric/int128.h" - #include "absl/status/status.h" - #include "absl/status/statusor.h" -+#include "absl/strings/str_cat.h" - #include "absl/types/span.h" - #include "openssl/err.h" - diff --git a/distributed_point_functions-evaluate_prg_hwy-signature.patch b/distributed_point_functions-evaluate_prg_hwy-signature.patch deleted file mode 100644 index 18303f6..0000000 --- a/distributed_point_functions-evaluate_prg_hwy-signature.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- src/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc.old 2024-04-02 11:53:27.644284500 +0200 -+++ src/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc 2024-04-02 22:35:43.377586600 +0200 -@@ -50,16 +50,18 @@ namespace hn = hwy::HWY_NAMESPACE; - #if HWY_TARGET == HWY_SCALAR - - absl::Status EvaluateSeedsHwy( -- int64_t num_seeds, int num_levels, const absl::uint128* seeds_in, -- const bool* control_bits_in, const absl::uint128* paths, -+ int64_t num_seeds, int num_levels, int num_correction_words, -+ const absl::uint128* seeds_in, const bool* control_bits_in, -+ const absl::uint128* paths, int paths_rightshift, - const absl::uint128* correction_seeds, const bool* correction_controls_left, - const bool* correction_controls_right, const Aes128FixedKeyHash& prg_left, - const Aes128FixedKeyHash& prg_right, absl::uint128* seeds_out, - bool* control_bits_out) { -- return EvaluateSeedsNoHwy(num_seeds, num_levels, seeds_in, control_bits_in, -- paths, correction_seeds, correction_controls_left, -- correction_controls_right, prg_left, prg_right, -- seeds_out, control_bits_out); -+ return EvaluateSeedsNoHwy( -+ num_seeds, num_levels, num_correction_words, seeds_in, control_bits_in, -+ paths, paths_rightshift, correction_seeds, correction_controls_left, -+ correction_controls_right, prg_left, prg_right, seeds_out, -+ control_bits_out); - } - - #else diff --git a/do-not-build-libvulkan.so.patch b/do-not-build-libvulkan.so.patch index dfb9f5c..fad66ec 100644 --- a/do-not-build-libvulkan.so.patch +++ b/do-not-build-libvulkan.so.patch @@ -3,10 +3,10 @@ Do not try to build a private copy of a DLL which is already available on every --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -1789,8 +1790,9 @@ - - deps = [ "//third_party/angle:libGLESv2" ] + deps = [ "//third_party/angle:libGLESv2" ] + } } -- if (!is_chromeos) { +- if (!is_chromeos && angle_shared_libvulkan) { + source_set("angle_libvulkan_symbols") {} + if (false) { extract_symbols("angle_libvulkan_symbols") { diff --git a/electron-13-blink-gcc-ambiguous-nodestructor.patch b/electron-13-blink-gcc-ambiguous-nodestructor.patch deleted file mode 100644 index 3828e92..0000000 --- a/electron-13-blink-gcc-ambiguous-nodestructor.patch +++ /dev/null @@ -1,17 +0,0 @@ -Index: electron-16.0.6/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc -=================================================================== ---- electron-16.0.6.orig/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc 2022-01-10 16:24:28.724461941 +0100 -+++ electron-16.0.6/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc 2022-01-13 16:04:50.310112542 +0100 -@@ -63,10 +63,10 @@ const int kUpdateBufferSizeFrequency = 3 - constexpr base::TimeDelta kSeekDelay = base::Milliseconds(20); - - std::vector* GetStreamingSchemes() { -- static base::NoDestructor> streaming_schemes({ -+ static base::NoDestructor> streaming_schemes{{ - url::kHttpsScheme, - url::kHttpScheme -- }); -+ }}; - return streaming_schemes.get(); - } - diff --git a/electron-16-system-node-headers.patch b/electron-16-system-node-headers.patch index 875fec5..9502c4f 100644 --- a/electron-16-system-node-headers.patch +++ b/electron-16-system-node-headers.patch @@ -10,6 +10,6 @@ Index: electron-17.1.0/third_party/electron_node/common.gypi + 'cflags': [ '-I/usr/include/electron' ], + 'libraries': [ '-lz' ], + }], - [ 'OS in "linux freebsd openbsd solaris aix os400"', { + [ 'OS in "linux freebsd openbsd solaris aix os400 openharmony"', { 'cflags': [ '-pthread' ], 'ldflags': [ '-pthread' ], diff --git a/electron-35.7.5.tar.zst b/electron-35.7.5.tar.zst deleted file mode 100644 index 12b9c6f..0000000 --- a/electron-35.7.5.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:df37ac15120556d9387cfe00f8fc2b2e218683e2f6ae4b846f6f7a5541861d3f -size 749983220 diff --git a/electron-37.3.1.tar.zst b/electron-37.3.1.tar.zst new file mode 100644 index 0000000..e8fd572 --- /dev/null +++ b/electron-37.3.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edd5a8f5c9d5b2830aed3b564f239eed1a28c244ab0f5f870014161291a60a53 +size 1071121847 diff --git a/event_record-optional-initializer.patch b/event_record-optional-initializer.patch new file mode 100644 index 0000000..d7264f7 --- /dev/null +++ b/event_record-optional-initializer.patch @@ -0,0 +1,11 @@ +--- src/services/network/public/cpp/ad_auction/event_record.cc.orig 2025-08-15 17:32:28.601405234 +0200 ++++ src/services/network/public/cpp/ad_auction/event_record.cc 2025-08-16 10:18:19.106421517 +0200 +@@ -49,7 +49,7 @@ std::optional> + const auto it = dict.find("eligible-origins"); + if (it == dict.end()) { + // "eligible-origins" is optional, so just return an empty list. +- return {{}}; ++ return std::optional>(std::in_place); + } + const net::structured_headers::ParameterizedMember& parameterized_member = + it->second; diff --git a/exception_state-constexpr-initializer.patch b/exception_state-constexpr-initializer.patch deleted file mode 100644 index 0359f2d..0000000 --- a/exception_state-constexpr-initializer.patch +++ /dev/null @@ -1,15 +0,0 @@ -In file included from ../../third_party/blink/renderer/platform/bindings/bigint.cc:7: -../../third_party/blink/renderer/platform/bindings/exception_state.h:136:37: error: ‘constexpr’ static data member ‘kEmptyContext’ must have an initializer - 136 | static constexpr ExceptionContext kEmptyContext; - ---- src/third_party/blink/renderer/platform/bindings/exception_state.h.orig 2025-04-16 14:36:33.017070028 +0200 -+++ src/third_party/blink/renderer/platform/bindings/exception_state.h 2025-04-16 20:05:07.925331205 +0200 -@@ -133,7 +133,7 @@ class PLATFORM_EXPORT ExceptionState { - // Delegated constructor for DummyExceptionStateForTesting - explicit ExceptionState(DummyExceptionStateForTesting& dummy_derived); - -- static constexpr ExceptionContext kEmptyContext; -+ static constexpr ExceptionContext kEmptyContext{}; - - private: - void SetExceptionInfo(ExceptionCode, const String&); diff --git a/extensions-common-assert.patch b/extensions-common-assert.patch deleted file mode 100644 index 5fa45fa..0000000 --- a/extensions-common-assert.patch +++ /dev/null @@ -1,134 +0,0 @@ -From cf0e064ce3b7c6b809861a6d299165b74cce109e Mon Sep 17 00:00:00 2001 -From: James Cook -Date: Thu, 22 May 2025 10:23:47 -0700 -Subject: [PATCH] extensions: Clean up ENABLE_EXTENSIONS in //extensions - -TestRuntimeApiDelegate can be safely added to the build now. -Also, replace ENABLE_EXTENSIONS || ENABLE_DESKTOP_ANDROID_EXTENSIONS -with ENABLE_EXTENSIONS_CORE, to be consistent with the rest of the -codebase. - -Bug: 356905053 -Change-Id: I616391c2843c6c5e20188803f2a51c6f83165927 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6576511 -Reviewed-by: Devlin Cronin -Commit-Queue: James Cook -Cr-Commit-Position: refs/heads/main@{#1464202} ---- - extensions/BUILD.gn | 12 ++---------- - extensions/browser/extension_registry.h | 3 +-- - extensions/browser/extension_system.h | 3 +-- - extensions/browser/test_extensions_browser_client.cc | 12 +----------- - extensions/common/extension.h | 3 +-- - 5 files changed, 6 insertions(+), 27 deletions(-) - -diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn -index 0ea291f16ba70b..586fd7461e4cd9 100644 ---- a/extensions/BUILD.gn -+++ b/extensions/BUILD.gn -@@ -111,6 +111,8 @@ static_library("test_support") { - "browser/test_image_loader.h", - "browser/test_management_policy.cc", - "browser/test_management_policy.h", -+ "browser/test_runtime_api_delegate.cc", -+ "browser/test_runtime_api_delegate.h", - "common/extension_builder.cc", - "common/extension_builder.h", - "common/manifest_test.cc", -@@ -198,16 +200,6 @@ static_library("test_support") { - deps += [ "//components/guest_view/browser:test_support" ] - } - -- # TODO(https://crbug.com/356905053): The following files don't compile cleanly -- # with desktop-android. Either make them compile, or determine they should -- # not be included and place them under a more appropriate if-block. -- if (enable_extensions) { -- sources += [ -- "browser/test_runtime_api_delegate.cc", -- "browser/test_runtime_api_delegate.h", -- ] -- } -- - # Generally, //extensions should not depend on //chromeos. However, a number - # of the APIs and the extensions shell already do. We should try to avoid - # expanding these dependencies. -diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h -index 4ed65fdce8af21..1ee1b70458a068 100644 ---- a/extensions/browser/extension_registry.h -+++ b/extensions/browser/extension_registry.h -@@ -19,8 +19,7 @@ - #include "extensions/common/extension_id.h" - #include "extensions/common/extension_set.h" - --static_assert(BUILDFLAG(ENABLE_EXTENSIONS) || -- BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)); -+static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE)); - - namespace content { - class BrowserContext; -diff --git a/extensions/browser/extension_system.h b/extensions/browser/extension_system.h -index 369dad723495a4..eccf3b2d331724 100644 ---- a/extensions/browser/extension_system.h -+++ b/extensions/browser/extension_system.h -@@ -17,8 +17,7 @@ - #include "extensions/common/extension.h" - #include "extensions/common/extension_id.h" - --static_assert(BUILDFLAG(ENABLE_EXTENSIONS) || -- BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)); -+static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE)); - - namespace base { - class OneShotEvent; -diff --git a/extensions/browser/test_extensions_browser_client.cc b/extensions/browser/test_extensions_browser_client.cc -index 88ce18dd343016..f914fae7205f88 100644 ---- a/extensions/browser/test_extensions_browser_client.cc -+++ b/extensions/browser/test_extensions_browser_client.cc -@@ -10,6 +10,7 @@ - #include "build/chromeos_buildflags.h" - #include "content/public/browser/browser_context.h" - #include "extensions/browser/extension_host_delegate.h" -+#include "extensions/browser/test_runtime_api_delegate.h" - #include "extensions/browser/updater/null_extension_cache.h" - #include "extensions/buildflags/buildflags.h" - #include "extensions/common/extension_id.h" -@@ -17,13 +18,6 @@ - #include "services/network/public/mojom/url_loader.mojom.h" - #include "ui/base/l10n/l10n_util.h" - --// TODO(https://crbug.com/356905053): The following files don't compile cleanly --// with desktop-android. Either make them compile, or determine they should --// not be included and place them under a more appropriate if-block. --#if BUILDFLAG(ENABLE_EXTENSIONS) --#include "extensions/browser/test_runtime_api_delegate.h" --#endif -- - #if BUILDFLAG(IS_CHROMEOS) - #include "chromeos/ash/components/login/login_state/login_state.h" - #endif -@@ -260,11 +254,7 @@ void TestExtensionsBrowserClient::RegisterBrowserInterfaceBindersForFrame( - std::unique_ptr - TestExtensionsBrowserClient::CreateRuntimeAPIDelegate( - content::BrowserContext* context) const { --#if BUILDFLAG(ENABLE_EXTENSIONS) - return std::unique_ptr(new TestRuntimeAPIDelegate()); --#else -- return nullptr; --#endif - } - - const ComponentExtensionResourceManager* -diff --git a/extensions/common/extension.h b/extensions/common/extension.h -index ec776e6207057b..33a196f11a519a 100644 ---- a/extensions/common/extension.h -+++ b/extensions/common/extension.h -@@ -29,8 +29,7 @@ - #include "url/gurl.h" - #include "url/origin.h" - --static_assert(BUILDFLAG(ENABLE_EXTENSIONS) || -- BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)); -+static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE)); - - namespace extensions { - class HashedExtensionId; diff --git a/ffmpeg-4-AV_PROFILE.patch b/ffmpeg-4-AV_PROFILE.patch new file mode 100644 index 0000000..7fb3811 --- /dev/null +++ b/ffmpeg-4-AV_PROFILE.patch @@ -0,0 +1,215 @@ +From 129f48501a7c3fa4236234f2fa0aee490a845b59 Mon Sep 17 00:00:00 2001 +From: Thomas Guilbert +Date: Fri, 2 May 2025 08:58:47 -0700 +Subject: [PATCH] Roll src/third_party/ffmpeg/ 01f23648c..dcdd0fa51 (552 + commits) + +This CL rolls ffmpeg for M138. + +This roll includes the removal of many deprecated APIs: some FF_* +macros were consolidated as equivalent AV_* macros under +libavcodec/def.h + +https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/01f23648c6b8..dcdd0fa51b65 + +$ git log 01f23648c..dcdd0fa51 --date=short --no-merges --format='%ad %ae %s' +2025-05-01 tguilbert Remove deprecated av_stream_get_side_data() +2025-05-01 tguilbert README.chromium file +2025-05-01 tguilbert GN Configuration +2025-04-29 jamrial avcodec/cbs_apv: don't return an error when reading empty buffers +2025-04-27 sw fate: Add test for APV 422-10 profile +(...) +2025-03-18 andreas.rheinhardt avcodec/Makefile: Only compile executor when VVC decoder is enabled +2025-03-18 andreas.rheinhardt avcodec/vvc/Makefile: Move VVC decoder->h2645data dep to lavc/Makefile +2025-03-17 ffmpeg ffbuild: use response files only if ar accepts them +2025-03-18 timo avcodec/tableprint_vlc: fix build with --enable-hardcoded-tables +2025-03-18 timo avcodec/Makefile: fix build of exr decoder in odd configs + +Created with: + roll-dep src/third_party/ffmpeg + +Bug: 415118707 +Change-Id: Iae943ce996031d5a6f7dbbd2915ad9cfabadf4d6 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6506529 +Reviewed-by: Dale Curtis +Commit-Queue: Dale Curtis +Auto-Submit: Thomas Guilbert +Cr-Commit-Position: refs/heads/main@{#1455010} +--- + DEPS | 2 +- + media/ffmpeg/ffmpeg_common.cc | 44 +++++++++---------- + .../filters/ffmpeg_aac_bitstream_converter.cc | 12 ++--- + ...ffmpeg_aac_bitstream_converter_unittest.cc | 6 +-- + third_party/ffmpeg | 2 +- + 5 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/DEPS b/DEPS +index b80ab0a6d81811..9b247c02d2a202 100644 +--- a/DEPS ++++ b/DEPS +@@ -515,7 +515,7 @@ vars = { + # Three lines of non-changing comments so that + # the commit queue can handle CLs rolling ffmpeg + # and whatever else without interference from each other. +- 'ffmpeg_revision': '01f23648c6b84de6c0f717fa4e1816f53b9ee72e', ++ 'ffmpeg_revision': 'dcdd0fa51b65a0b1688ff6b8f0cc81908f09ded2', + # Three lines of non-changing comments so that + # the commit queue can handle CLs rolling webpagereplay + # and whatever else without interference from each other. +diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc +index cfd0552ee31088..610be2d37b351f 100644 +--- a/media/ffmpeg/ffmpeg_common.cc ++++ b/media/ffmpeg/ffmpeg_common.cc +@@ -263,22 +263,22 @@ AVCodecID VideoCodecToCodecID(VideoCodec video_codec) { + static VideoCodecProfile ProfileIDToVideoCodecProfile(int profile) { + // Clear out the CONSTRAINED & INTRA flags which are strict subsets of the + // corresponding profiles with which they're used. +- profile &= ~FF_PROFILE_H264_CONSTRAINED; +- profile &= ~FF_PROFILE_H264_INTRA; ++ profile &= ~AV_PROFILE_H264_CONSTRAINED; ++ profile &= ~AV_PROFILE_H264_INTRA; + switch (profile) { +- case FF_PROFILE_H264_BASELINE: ++ case AV_PROFILE_H264_BASELINE: + return H264PROFILE_BASELINE; +- case FF_PROFILE_H264_MAIN: ++ case AV_PROFILE_H264_MAIN: + return H264PROFILE_MAIN; +- case FF_PROFILE_H264_EXTENDED: ++ case AV_PROFILE_H264_EXTENDED: + return H264PROFILE_EXTENDED; +- case FF_PROFILE_H264_HIGH: ++ case AV_PROFILE_H264_HIGH: + return H264PROFILE_HIGH; +- case FF_PROFILE_H264_HIGH_10: ++ case AV_PROFILE_H264_HIGH_10: + return H264PROFILE_HIGH10PROFILE; +- case FF_PROFILE_H264_HIGH_422: ++ case AV_PROFILE_H264_HIGH_422: + return H264PROFILE_HIGH422PROFILE; +- case FF_PROFILE_H264_HIGH_444_PREDICTIVE: ++ case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + return H264PROFILE_HIGH444PREDICTIVEPROFILE; + default: + DVLOG(1) << "Unknown profile id: " << profile; +@@ -289,23 +289,23 @@ static VideoCodecProfile ProfileIDToVideoCodecProfile(int profile) { + static int VideoCodecProfileToProfileID(VideoCodecProfile profile) { + switch (profile) { + case H264PROFILE_BASELINE: +- return FF_PROFILE_H264_BASELINE; ++ return AV_PROFILE_H264_BASELINE; + case H264PROFILE_MAIN: +- return FF_PROFILE_H264_MAIN; ++ return AV_PROFILE_H264_MAIN; + case H264PROFILE_EXTENDED: +- return FF_PROFILE_H264_EXTENDED; ++ return AV_PROFILE_H264_EXTENDED; + case H264PROFILE_HIGH: +- return FF_PROFILE_H264_HIGH; ++ return AV_PROFILE_H264_HIGH; + case H264PROFILE_HIGH10PROFILE: +- return FF_PROFILE_H264_HIGH_10; ++ return AV_PROFILE_H264_HIGH_10; + case H264PROFILE_HIGH422PROFILE: +- return FF_PROFILE_H264_HIGH_422; ++ return AV_PROFILE_H264_HIGH_422; + case H264PROFILE_HIGH444PREDICTIVEPROFILE: +- return FF_PROFILE_H264_HIGH_444_PREDICTIVE; ++ return AV_PROFILE_H264_HIGH_444_PREDICTIVE; + default: + DVLOG(1) << "Unknown VideoCodecProfile: " << profile; + } +- return FF_PROFILE_UNKNOWN; ++ return AV_PROFILE_UNKNOWN; + } + + SampleFormat AVSampleFormatToSampleFormat(AVSampleFormat sample_format, +@@ -443,7 +443,7 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, + // TODO(dalecurtis): Just use the profile from the codec context if ffmpeg + // ever starts supporting xHE-AAC. + // FFmpeg provides the (defined_profile - 1) for AVCodecContext::profile +- if (codec_context->profile == FF_PROFILE_UNKNOWN || ++ if (codec_context->profile == AV_PROFILE_UNKNOWN || + codec_context->profile == mp4::AAC::kXHeAAcType - 1) { + // Errors aren't fatal here, so just drop any MediaLog messages. + NullMediaLog media_log; +@@ -661,16 +661,16 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, + break; + case VideoCodec::kVP9: + switch (codec_context->profile) { +- case FF_PROFILE_VP9_0: ++ case AV_PROFILE_VP9_0: + profile = VP9PROFILE_PROFILE0; + break; +- case FF_PROFILE_VP9_1: ++ case AV_PROFILE_VP9_1: + profile = VP9PROFILE_PROFILE1; + break; +- case FF_PROFILE_VP9_2: ++ case AV_PROFILE_VP9_2: + profile = VP9PROFILE_PROFILE2; + break; +- case FF_PROFILE_VP9_3: ++ case AV_PROFILE_VP9_3: + profile = VP9PROFILE_PROFILE3; + break; + default: +diff --git a/media/filters/ffmpeg_aac_bitstream_converter.cc b/media/filters/ffmpeg_aac_bitstream_converter.cc +index 7fd37e90b7e475..c00ac262dabb19 100644 +--- a/media/filters/ffmpeg_aac_bitstream_converter.cc ++++ b/media/filters/ffmpeg_aac_bitstream_converter.cc +@@ -68,17 +68,17 @@ bool GenerateAdtsHeader(int codec, + hdr[1] |= 1; + + switch (audio_profile) { +- case FF_PROFILE_AAC_MAIN: ++ case AV_PROFILE_AAC_MAIN: + break; +- case FF_PROFILE_AAC_HE: +- case FF_PROFILE_AAC_HE_V2: +- case FF_PROFILE_AAC_LOW: ++ case AV_PROFILE_AAC_HE: ++ case AV_PROFILE_AAC_HE_V2: ++ case AV_PROFILE_AAC_LOW: + hdr[2] |= (1 << 6); + break; +- case FF_PROFILE_AAC_SSR: ++ case AV_PROFILE_AAC_SSR: + hdr[2] |= (2 << 6); + break; +- case FF_PROFILE_AAC_LTP: ++ case AV_PROFILE_AAC_LTP: + hdr[2] |= (3 << 6); + break; + default: +diff --git a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +index 0e56a6ea5b5cb4..2a6ccb8c910f6c 100644 +--- a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc ++++ b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +@@ -41,7 +41,7 @@ class FFmpegAACBitstreamConverterTest : public testing::Test { + // Set up reasonable aac parameters + memset(&test_parameters_, 0, sizeof(AVCodecParameters)); + test_parameters_.codec_id = AV_CODEC_ID_AAC; +- test_parameters_.profile = FF_PROFILE_AAC_MAIN; ++ test_parameters_.profile = AV_PROFILE_AAC_MAIN; + test_parameters_.ch_layout.nb_channels = 2; + test_parameters_.extradata = extradata_header_; + test_parameters_.extradata_size = sizeof(extradata_header_); +@@ -131,7 +131,7 @@ TEST_F(FFmpegAACBitstreamConverterTest, Conversion_AudioProfileType) { + + EXPECT_EQ(profile, kAacMainProfile); + +- test_parameters_.profile = FF_PROFILE_AAC_HE; ++ test_parameters_.profile = AV_PROFILE_AAC_HE; + FFmpegAACBitstreamConverter converter_he(&test_parameters_); + + test_packet = ScopedAVPacket::Allocate(); +@@ -143,7 +143,7 @@ TEST_F(FFmpegAACBitstreamConverterTest, Conversion_AudioProfileType) { + + EXPECT_EQ(profile, kAacLowComplexityProfile); + +- test_parameters_.profile = FF_PROFILE_AAC_ELD; ++ test_parameters_.profile = AV_PROFILE_AAC_ELD; + FFmpegAACBitstreamConverter converter_eld(&test_parameters_); + + test_packet = ScopedAVPacket::Allocate(); diff --git a/ffmpeg-new-channel-layout.patch b/ffmpeg-new-channel-layout.patch index 70d59f5..78cd149 100644 --- a/ffmpeg-new-channel-layout.patch +++ b/ffmpeg-new-channel-layout.patch @@ -236,19 +236,6 @@ index 6f231c85729..ca5e5fb927d 100644 frame_length_ = header_plus_packet_size; } -diff --git a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -index 1fd4c5ccd7d..f59bcd8fdaf 100644 ---- a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -+++ b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -@@ -34,7 +34,7 @@ class FFmpegAACBitstreamConverterTest : public testing::Test { - memset(&test_parameters_, 0, sizeof(AVCodecParameters)); - test_parameters_.codec_id = AV_CODEC_ID_AAC; - test_parameters_.profile = FF_PROFILE_AAC_MAIN; -- test_parameters_.channels = 2; -+ test_parameters_.ch_layout.nb_channels = 2; - test_parameters_.extradata = extradata_header_; - test_parameters_.extradata_size = sizeof(extradata_header_); - } diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc index 6a56c675f7d..4615fdeb3fb 100644 --- a/media/filters/ffmpeg_audio_decoder.cc @@ -271,20 +258,6 @@ index 6a56c675f7d..4615fdeb3fb 100644 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { channel_layout = CHANNEL_LAYOUT_DISCRETE; -@@ -348,11 +348,11 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { - // Success! - av_sample_format_ = codec_context_->sample_fmt; - -- if (codec_context_->channels != config.channels()) { -+ if (codec_context_->ch_layout.nb_channels != config.channels()) { - MEDIA_LOG(ERROR, media_log_) - << "Audio configuration specified " << config.channels() - << " channels, but FFmpeg thinks the file contains " -- << codec_context_->channels << " channels"; -+ << codec_context_->ch_layout.nb_channels << " channels"; - ReleaseFFmpegResources(); - state_ = DecoderState::kUninitialized; - return false; @@ -403,7 +403,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, if (frame->nb_samples <= 0) return AVERROR(EINVAL); diff --git a/fix-build-without-pdf.patch b/fix-build-without-pdf.patch deleted file mode 100644 index 20ac0c8..0000000 --- a/fix-build-without-pdf.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- src/chrome/browser/ui/lens/BUILD.gn.orig 2025-04-11 12:05:17.505799730 +0200 -+++ src/chrome/browser/ui/lens/BUILD.gn 2025-04-12 13:42:57.195753884 +0200 -@@ -276,13 +276,15 @@ source_set("interactive_ui_tests") { - "//components/feature_engagement/public", - "//components/lens:enterprise_policy", - "//components/lens:features", -- "//components/pdf/browser:browser", - "//components/prefs", - "//components/search_engines", - "//components/user_education/views", - "//content/test:test_support", - "//testing/gtest", - ] -+ if (enable_pdf) { -+ deps += [ "//components/pdf/browser:browser" ] -+ } - } - - source_set("unit_tests") { diff --git a/fix-build-without-screen-ai.patch b/fix-build-without-screen-ai.patch index 296f303..9a22974 100644 --- a/fix-build-without-screen-ai.patch +++ b/fix-build-without-screen-ai.patch @@ -21,53 +21,45 @@ "//services/strings", "//services/test/echo/public/mojom", @@ -8027,7 +8021,6 @@ test("unit_tests") { - - # Non-android deps for "unit_tests" target. + # + # TODO(crbug.com/417513088): Maybe merge with the non-android `deps` declaration above? deps += [ - "../browser/screen_ai:screen_ai_install_state", "//chrome/browser/apps:icon_standardizer", "//chrome/browser/apps/app_service", "//chrome/browser/apps/app_service:app_registry_cache_waiter", @@ -8172,7 +8165,6 @@ test("unit_tests") { - "//services/device/public/cpp/bluetooth", + "//components/webapps/browser", "//services/metrics/public/cpp:ukm_builders", "//services/network:test_support", - "//services/screen_ai:test_support", - "//services/video_effects/test:test_support", "//third_party/crashpad/crashpad/util", "//third_party/libaddressinput", + "//third_party/lzma_sdk/google:unit_tests", @@ -8445,7 +8437,6 @@ test("unit_tests") { "//chrome/browser/push_notification", "//chrome/browser/push_notification:test_support", "//chrome/browser/push_notification/protos:proto", - "//chrome/browser/screen_ai/public:test_support", + "//chrome/browser/sharesheet", "//chrome/browser/smart_card:smart_card", "//chrome/browser/task_manager:impl", - "//chrome/browser/ui/ash:test_support", -@@ -8591,7 +8582,6 @@ test("unit_tests") { - "//chrome/browser/nearby_sharing/contacts:unit_tests", - "//chrome/browser/nearby_sharing/local_device_data:unit_tests", - "//chrome/browser/policy:unit_tests", -- "//chrome/browser/screen_ai:unit_tests", - "//chrome/browser/smart_card:unit_tests", - "//chrome/browser/support_tool/ash:unit_tests", - "//chrome/browser/ui/ash:unit_tests", --- src/chrome/browser/BUILD.gn.orig 2025-04-11 12:13:12.927314100 +0200 +++ src/chrome/browser/BUILD.gn 2025-04-12 13:12:42.819768051 +0200 @@ -4228,10 +4228,6 @@ static_library("browser") { + "//chrome/browser/metrics/desktop_session_duration", "//chrome/browser/new_tab_page/chrome_colors", "//chrome/browser/policy:path_parser", - "//chrome/browser/resources:component_extension_resources", - "//chrome/browser/screen_ai:prefs", - "//chrome/browser/screen_ai:screen_ai_install_state", - "//chrome/browser/screen_ai:screen_ai_service_router_factory", - "//chrome/browser/screen_ai/public:optical_character_recognizer", "//chrome/browser/search/background", + "//chrome/browser/sharing_hub", "//chrome/browser/smart_card", - "//chrome/browser/themes", @@ -4357,9 +4353,6 @@ static_library("browser") { + "//components/webauthn/core/browser", "//components/webauthn/core/browser:passkey_model", - "//services/device/public/cpp/bluetooth", "//services/device/public/cpp/hid", - "//services/screen_ai", - "//services/screen_ai/public/cpp:utilities", @@ -96,8 +88,8 @@ "//skia", "//sql", @@ -145,7 +144,6 @@ static_library("utility") { - "//chrome/common/importer:interfaces", "//components/autofill/core/common", + "//components/user_data_importer/common", "//services/proxy_resolver:lib", - "//services/screen_ai", ] @@ -114,8 +106,8 @@ ] @@ -68,9 +67,6 @@ source_set("screen_ai_service_router_fac - "//chrome/browser/profiles:profile", "//components/keyed_service/core", + "//components/performance_manager:performance_manager", "//content/public/browser", - "//services/screen_ai/public/cpp:utilities", - "//services/screen_ai/public/mojom:factory", @@ -156,7 +148,7 @@ --- src/chrome/browser/ui/BUILD.gn.orig 2025-04-11 12:05:17.331313863 +0200 +++ src/chrome/browser/ui/BUILD.gn 2025-04-12 13:26:46.759762260 +0200 @@ -1705,8 +1705,6 @@ static_library("ui") { - "//chrome/browser/reading_list", + "//chrome/browser/regional_capabilities", "//chrome/browser/safe_browsing", "//chrome/browser/safe_browsing:advanced_protection", - "//chrome/browser/screen_ai:screen_ai_install_state", diff --git a/fix-build-without-video-effects.patch b/fix-build-without-video-effects.patch deleted file mode 100644 index 40c3fe9..0000000 --- a/fix-build-without-video-effects.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 09a3abf8f4aca3b00ccbabc860b0819d7e3ea206 Mon Sep 17 00:00:00 2001 -From: Yunsik Jung -Date: Fri, 21 Mar 2025 08:12:22 -0700 -Subject: [PATCH] Fix build error when "enable_video_effects=false" in Linux - -kVideoEffects is engaged even when ENABLE_VIDEO_EFFECTS is false. -(https://crrev.com/c/5898146) -However, "video_effects_sandbox_hook_linux.h" is not included when -ENABLE_VIDEO_EFFECTS is false which caused build error. - -Thus, include "video_effects_sandbox_hook_linux.h" in Linux regardless -of ENABLE_VIDEO_EFFECTS. - -Bug: N/A -Change-Id: If0bb3f1b391a7960ee8ff9ad83d8c858a24cedb5 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6380633 -Reviewed-by: Rakina Zata Amni -Reviewed-by: Dave Tapuska -Commit-Queue: Dave Tapuska -Cr-Commit-Position: refs/heads/main@{#1436051} ---- - content/utility/utility_main.cc | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc -index 7456eab4558962..ffb16be8ce8541 100644 ---- a/content/utility/utility_main.cc -+++ b/content/utility/utility_main.cc -@@ -66,9 +66,9 @@ - - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) - --#if BUILDFLAG(ENABLE_VIDEO_EFFECTS) && BUILDFLAG(IS_LINUX) -+#if BUILDFLAG(IS_LINUX) - #include "services/video_effects/video_effects_sandbox_hook_linux.h" // nogncheck --#endif // BUILDFLAG(ENABLE_VIDEO_EFFECTS) && BUILDFLAG(IS_LINUX) -+#endif // BUILDFLAG(IS_LINUX) - - #if BUILDFLAG(IS_CHROMEOS) - #include "chromeos/ash/components/assistant/buildflags.h" diff --git a/fix-building-with-pipewire-1.3.82.patch b/fix-building-with-pipewire-1.3.82.patch deleted file mode 100644 index 72a1b19..0000000 --- a/fix-building-with-pipewire-1.3.82.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: src/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc -=================================================================== ---- src.orig/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc -+++ src/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc -@@ -85,7 +85,7 @@ PipeWireNode::PipeWireNode(PipeWireSessi - .param = OnNodeParam, - }; - -- pw_node_add_listener(proxy_, &node_listener_, &node_events, this); -+ pw_node_add_listener((struct pw_node*)proxy_, &node_listener_, &node_events, this); - } - - // static -@@ -117,7 +117,7 @@ void PipeWireNode::OnNodeInfo(void* data - uint32_t id = info->params[i].id; - if (id == SPA_PARAM_EnumFormat && - info->params[i].flags & SPA_PARAM_INFO_READ) { -- pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); -+ pw_node_enum_params((struct pw_node*)that->proxy_, 0, id, 0, UINT32_MAX, nullptr); - break; - } - } diff --git a/fpic.patch b/fpic.patch index 06aefb2..a8f5665 100644 --- a/fpic.patch +++ b/fpic.patch @@ -73,26 +73,26 @@ Use -fpic for code which goes only in dlls (gives smaller code), sources = [ "compression_utils_portable.cc", "compression_utils_portable.h", ---- src/ui/qt/BUILD.gn.orig 2025-04-10 19:56:03.150817690 +0200 -+++ src/ui/qt/BUILD.gn 2025-04-11 11:42:11.904342754 +0200 +--- src/ui/qt/BUILD.gn.orig 2025-07-19 11:32:45.537979340 +0200 ++++ src/ui/qt/BUILD.gn 2025-07-19 16:18:57.173759933 +0200 @@ -39,6 +39,8 @@ source_set("qt_interface") { # target instead. public = [ "qt_interface.h" ] sources = [ "qt_interface.cc" ] + cflags = ["-fpic", "-fno-semantic-interposition"] + asmflags = ["-fpic", "-fno-semantic-interposition"] - } - template("qt_shim") { -@@ -99,6 +101,8 @@ template("qt_shim") { + # Don't use libc++ modules as this depends on libstdc++. + use_libcxx_modules = false +@@ -102,6 +104,8 @@ template("qt_shim") { sources += get_target_outputs(":generate_moc" + invoker.qt_version) deps += [ ":generate_moc" + invoker.qt_version ] } + cflags = ["-fpic", "-fno-semantic-interposition"] + asmflags = ["-fpic", "-fno-semantic-interposition"] - } - } - if (use_qt5) { + + # Don't depend on libcxx modules. This binary doesn't depend on the standard + # library in libcxx. Instead it depends on the libcxx in the sysroot, so --- src/third_party/abseil-cpp/BUILD.gn.old +++ src/third_party/abseil-cpp/BUILD.gn @@ -132,6 +132,8 @@ config("absl_define_config") { diff --git a/html_permission_element_strings_map-reproducible.patch b/html_permission_element_strings_map-reproducible.patch deleted file mode 100644 index c052a66..0000000 --- a/html_permission_element_strings_map-reproducible.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- src/third_party/blink/renderer/build/scripts/generate_permission_element_grd.py 2025-05-07 19:56:08.225814691 +0200 -+++ src/third_party/blink/renderer/build/scripts/generate_permission_element_grd.py 2025-05-09 17:27:22.302946256 +0200 -@@ -148,6 +148,18 @@ def generate_grd_file(id_map, file_list, - with open(output_file_path, 'wb') as output_file: - output_file.write(doc.toxml(encoding='UTF-8')) - -+# Generate the shortest string containing both `long` and `short` as substrings. -+# The full n-string problem is NP-complete, but we only use a crude greedy heuristic. -+def superstring(long, short): -+ if long.find(short) >= 0: -+ return long -+ for i in range(len(short), 0, -1): -+ if(long[-i:] == short[:i]): -+ return long + short[i:] -+ if(short[-i:] == long[:i]): -+ return short + long[i:] -+ return long + short -+ - - def generate_cpp_mapping(orderings, input_file_path, output_file_path): - doc = parse(input_file_path) -@@ -161,8 +173,8 @@ def generate_cpp_mapping(orderings, inpu - # this code will use `pt-pt` (Portuguese from Portugal). - custom_locale_mappings = {"en-gb": "en", "pt-pt": "pt", "zh-cn": "zh"} - -- langs = '' -- lang_map = {} -+ -+ locales = set() - message_map = [] - for message in messages: - message_name = message.getAttribute('name') -@@ -171,20 +183,18 @@ def generate_cpp_mapping(orderings, inpu - '_', 1)[1].lower().replace("_", "-") - if locale in custom_locale_mappings: - locale = custom_locale_mappings[locale] -- if locale not in lang_map: -- # String concatenation is inefficientin Python, since strings -- # are immutable. However, maintaining a list of chars and -- # re-implementing find() is also unpleasant. -- langs_idx = langs.find(locale) -- if langs_idx < 0: -- lang_map[locale] = (len(langs), len(locale)) -- langs += locale -- else: -- # If locale is already a substring in the existing list, -- # the substring can simply be reused to save some space. -- lang_map[locale] = (langs_idx, len(locale)) -+ locales.add(locale) # Need to add all locales at first because iteration order is non-deterministic - message_map.append((locale, base_message, message_name)) - -+ langs = '' -+ locales = sorted(locales, key=lambda x: (-len(x), x)) -+ for locale in locales: # Sort by length so that we add `ab-cd` before `ab` and `cd` -+ langs = superstring(langs, locale) -+ -+ lang_map = {} -+ for locale in locales: -+ lang_map[locale] = langs.find(locale), len(locale) -+ - output_file.write(kStringMapCcPrefix) - output_file.write(f' "{langs}";\n') - output_file.write(kStringMapCcMidfix) diff --git a/identity_request_account-incomplete-IdentityProviderData.patch b/identity_request_account-incomplete-IdentityProviderData.patch new file mode 100644 index 0000000..01398f8 --- /dev/null +++ b/identity_request_account-incomplete-IdentityProviderData.patch @@ -0,0 +1,227 @@ +--- src/content/public/browser/identity_request_dialog_controller.h.orig 2025-08-15 17:32:26.573405615 +0200 ++++ src/content/public/browser/identity_request_dialog_controller.h 2025-08-16 00:53:34.120821675 +0200 +@@ -14,7 +14,6 @@ + #include "base/memory/ref_counted.h" + #include "content/common/content_export.h" + #include "content/public/browser/identity_request_account.h" +-#include "third_party/blink/public/mojom/webid/federated_auth_request.mojom-forward.h" + #include "third_party/skia/include/core/SkColor.h" + #include "url/gurl.h" + #include "url/origin.h" +@@ -22,35 +21,6 @@ + namespace content { + class WebContents; + +-// A Java counterpart will be generated for this enum. +-// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.webid +-// GENERATED_JAVA_CLASS_NAME_OVERRIDE: IdentityRequestDialogDisclosureField +-enum class IdentityRequestDialogDisclosureField { +- kName, +- kEmail, +- kPicture, +- kPhoneNumber, +- kUsername +-}; +- +-// The client metadata that will be used to display a FedCM dialog. This data is +-// extracted from the client metadata endpoint from the FedCM API, where +-// 'client' is essentially the relying party which invoked the API. +-struct CONTENT_EXPORT ClientMetadata { +- ClientMetadata(const GURL& terms_of_service_url, +- const GURL& privacy_policy_url, +- const GURL& brand_icon_url, +- const gfx::Image& brand_decoded_icon); +- ClientMetadata(const ClientMetadata& other); +- ~ClientMetadata(); +- +- GURL terms_of_service_url; +- GURL privacy_policy_url; +- GURL brand_icon_url; +- // This will be an empty image if the fetching never happened or if it failed. +- gfx::Image brand_decoded_icon; +-}; +- + // The information about an error that will be used to display a FedCM dialog. + // This data is extracted from the error object returned by the identity + // provider when the user attempts to login via the FedCM API and an error +@@ -60,70 +30,6 @@ struct CONTENT_EXPORT IdentityCredential + GURL url; + }; + +-// The metadata about the identity provider that will be used to display a FedCM +-// dialog. This data is extracted from the config file which is fetched when the +-// FedCM API is invoked. +-struct CONTENT_EXPORT IdentityProviderMetadata { +- IdentityProviderMetadata(); +- IdentityProviderMetadata(const IdentityProviderMetadata& other); +- ~IdentityProviderMetadata(); +- +- std::optional brand_text_color; +- std::optional brand_background_color; +- GURL brand_icon_url; +- GURL idp_login_url; +- std::string requested_label; +- // For registered IdPs, the type is used to only show the accounts when the +- // RP is compatible. +- std::vector types; +- // The token formats that are supported. +- std::vector formats; +- // The URL of the configuration endpoint. This is stored in +- // IdentityProviderMetadata so that the UI code can pass it along when an +- // Account is selected by the user. +- GURL config_url; +- // Whether this IdP supports signing in to additional accounts. +- bool supports_add_account{false}; +- // Whether this IdP has any filtered out account. This is reset to false each +- // time the accounts dialog is shown and recomputed then. +- bool has_filtered_out_account{false}; +- // This will be an empty image if fetching failed. +- gfx::Image brand_decoded_icon; +-}; +- +-// This class contains all of the data specific to an identity provider that is +-// going to be used to display a FedCM dialog. This data is gathered from +-// endpoints fetched when the FedCM API is invoked as well as from the +-// parameters provided by the relying party when the API is invoked. +-class CONTENT_EXPORT IdentityProviderData +- : public base::RefCounted { +- public: +- IdentityProviderData(const std::string& idp_for_display, +- const IdentityProviderMetadata& idp_metadata, +- const ClientMetadata& client_metadata, +- blink::mojom::RpContext rp_context, +- std::optional format, +- const std::vector& +- disclosure_fields, +- bool has_login_status_mismatch); +- +- std::string idp_for_display; +- IdentityProviderMetadata idp_metadata; +- ClientMetadata client_metadata; +- blink::mojom::RpContext rp_context; +- std::optional format; +- // For which fields should the dialog request permission for (assuming +- // this is for signup). +- std::vector disclosure_fields; +- // Whether there was some login status API mismatch when fetching the IDP's +- // accounts. +- bool has_login_status_mismatch; +- +- private: +- friend class base::RefCounted; +- +- ~IdentityProviderData(); +-}; + + // The relying party data that will be used to display a FedCM dialog. This data + // is extracted from the website which invoked the API, not from the FedCM +--- src/content/public/browser/identity_request_account.h.orig 2025-08-15 17:32:26.573405615 +0200 ++++ src/content/public/browser/identity_request_account.h 2025-08-16 00:53:42.592813124 +0200 +@@ -13,13 +13,106 @@ + #include "base/time/time.h" + #include "content/common/content_export.h" + #include "third_party/blink/public/common/webid/login_status_account.h" ++#include "third_party/blink/public/mojom/webid/federated_auth_request.mojom-forward.h" + #include "third_party/skia/include/core/SkColor.h" + #include "ui/gfx/image/image.h" + #include "url/gurl.h" + + namespace content { + +-class IdentityProviderData; ++// A Java counterpart will be generated for this enum. ++// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.webid ++// GENERATED_JAVA_CLASS_NAME_OVERRIDE: IdentityRequestDialogDisclosureField ++enum class IdentityRequestDialogDisclosureField { ++ kName, ++ kEmail, ++ kPicture, ++ kPhoneNumber, ++ kUsername ++}; ++ ++// The client metadata that will be used to display a FedCM dialog. This data is ++// extracted from the client metadata endpoint from the FedCM API, where ++// 'client' is essentially the relying party which invoked the API. ++struct CONTENT_EXPORT ClientMetadata { ++ ClientMetadata(const GURL& terms_of_service_url, ++ const GURL& privacy_policy_url, ++ const GURL& brand_icon_url, ++ const gfx::Image& brand_decoded_icon); ++ ClientMetadata(const ClientMetadata& other); ++ ~ClientMetadata(); ++ ++ GURL terms_of_service_url; ++ GURL privacy_policy_url; ++ GURL brand_icon_url; ++ // This will be an empty image if the fetching never happened or if it failed. ++ gfx::Image brand_decoded_icon; ++}; ++ ++// The metadata about the identity provider that will be used to display a FedCM ++// dialog. This data is extracted from the config file which is fetched when the ++// FedCM API is invoked. ++struct CONTENT_EXPORT IdentityProviderMetadata { ++ IdentityProviderMetadata(); ++ IdentityProviderMetadata(const IdentityProviderMetadata& other); ++ ~IdentityProviderMetadata(); ++ ++ std::optional brand_text_color; ++ std::optional brand_background_color; ++ GURL brand_icon_url; ++ GURL idp_login_url; ++ std::string requested_label; ++ // For registered IdPs, the type is used to only show the accounts when the ++ // RP is compatible. ++ std::vector types; ++ // The token formats that are supported. ++ std::vector formats; ++ // The URL of the configuration endpoint. This is stored in ++ // IdentityProviderMetadata so that the UI code can pass it along when an ++ // Account is selected by the user. ++ GURL config_url; ++ // Whether this IdP supports signing in to additional accounts. ++ bool supports_add_account{false}; ++ // Whether this IdP has any filtered out account. This is reset to false each ++ // time the accounts dialog is shown and recomputed then. ++ bool has_filtered_out_account{false}; ++ // This will be an empty image if fetching failed. ++ gfx::Image brand_decoded_icon; ++}; ++ ++// This class contains all of the data specific to an identity provider that is ++// going to be used to display a FedCM dialog. This data is gathered from ++// endpoints fetched when the FedCM API is invoked as well as from the ++// parameters provided by the relying party when the API is invoked. ++class CONTENT_EXPORT IdentityProviderData ++ : public base::RefCounted { ++ public: ++ IdentityProviderData(const std::string& idp_for_display, ++ const IdentityProviderMetadata& idp_metadata, ++ const ClientMetadata& client_metadata, ++ blink::mojom::RpContext rp_context, ++ std::optional format, ++ const std::vector& ++ disclosure_fields, ++ bool has_login_status_mismatch); ++ ++ std::string idp_for_display; ++ IdentityProviderMetadata idp_metadata; ++ ClientMetadata client_metadata; ++ blink::mojom::RpContext rp_context; ++ std::optional format; ++ // For which fields should the dialog request permission for (assuming ++ // this is for signup). ++ std::vector disclosure_fields; ++ // Whether there was some login status API mismatch when fetching the IDP's ++ // accounts. ++ bool has_login_status_mismatch; ++ ++ private: ++ friend class base::RefCounted; ++ ++ ~IdentityProviderData(); ++}; + + // Represents a federated user account which is used when displaying the FedCM + // account selector. diff --git a/json_to_struct-fixed_flat_map-conflicting-declaration.patch b/json_to_struct-fixed_flat_map-conflicting-declaration.patch new file mode 100644 index 0000000..89e2f81 --- /dev/null +++ b/json_to_struct-fixed_flat_map-conflicting-declaration.patch @@ -0,0 +1,25 @@ +--- src/tools/json_to_struct/aggregation.py.orig 2025-08-15 17:32:37.009403662 +0200 ++++ src/tools/json_to_struct/aggregation.py 2025-08-16 00:58:01.264590353 +0200 +@@ -134,7 +134,9 @@ def _GenerateCCArray(type_name: str, agg + Returns: + str: The generated C++ array aggregation code. + """ +- res = f'\nconst auto {aggregation.name} =\n' ++ res = '\n const ' ++ res += f'std::array ' ++ res += f'{aggregation.name} =\n' + res += f' std::array' + + res += '({{\n' +@@ -157,7 +159,10 @@ def _GenerateCCMap(type_name: str, aggre + """ + key_type = aggregation.map_key_type + +- res = f'\nconst auto {aggregation.name} =\n' ++ res = f'\nconst ' ++ res += f'base::fixed_flat_map<{aggregation.map_key_type}, ' ++ res += f'const {type_name}*, {len(aggregation.GetSortedMapElements())}> ' ++ res += f'{aggregation.name} =\n' + res += f' base::MakeFixedFlatMap<{key_type}, const {type_name}*>' + + res += '({\n' diff --git a/llhttp-lax-vector-conversions.patch b/llhttp-lax-vector-conversions.patch new file mode 100644 index 0000000..15a35a0 --- /dev/null +++ b/llhttp-lax-vector-conversions.patch @@ -0,0 +1,88 @@ +It makes no sense fixing this since llhttp's code is partly generated. + +../../third_party/electron_node/deps/llhttp/src/llhttp.c: In function ‘llhttp__internal__run’: +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2645:9: note: use ‘-flax-vector-conversions’ to permit conversions between vectors with differing element types or numbers of subparts + 2645 | ); + | ^ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2643:11: error: incompatible type for argument 1 of ‘vandq_u16’ + 2643 | vcgeq_u8(input, vdupq_n_u8(' ')), + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | + | uint8x16_t +In file included from ../../third_party/electron_node/deps/llhttp/src/llhttp.c:14: +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1088:23: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1088 | vandq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2644:11: error: incompatible type for argument 2 of ‘vandq_u16’ + 2644 | vcleq_u8(input, vdupq_n_u8('~')) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1088:39: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1088 | vandq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2646:26: error: incompatible type for argument 1 of ‘vorrq_u16’ + 2646 | mask = vorrq_u16(mask, single); + | ^~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1200:23: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1200 | vorrq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2646:32: error: incompatible type for argument 2 of ‘vorrq_u16’ + 2646 | mask = vorrq_u16(mask, single); + | ^~~~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1200:39: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1200 | vorrq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2648:11: error: incompatible type for argument 1 of ‘vandq_u16’ + 2648 | vcgeq_u8(input, vdupq_n_u8(0x80)), + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1088:23: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1088 | vandq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2649:11: error: incompatible type for argument 2 of ‘vandq_u16’ + 2649 | vcleq_u8(input, vdupq_n_u8(0xff)) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1088:39: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1088 | vandq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2651:26: error: incompatible type for argument 1 of ‘vorrq_u16’ + 2651 | mask = vorrq_u16(mask, single); + | ^~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1200:23: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1200 | vorrq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2651:32: error: incompatible type for argument 2 of ‘vorrq_u16’ + 2651 | mask = vorrq_u16(mask, single); + | ^~~~~~ + | | + | uint8x16_t +/usr/lib64/gcc/aarch64-suse-linux/15/include/arm_neon.h:1200:39: note: expected ‘uint16x8_t’ but argument is of type ‘uint8x16_t’ + 1200 | vorrq_u16 (uint16x8_t __a, uint16x8_t __b) + | ~~~~~~~~~~~^~~ +../../third_party/electron_node/deps/llhttp/src/llhttp.c:2652:30: error: incompatible type for argument 1 of ‘vshrn_n_u16’ + 2652 | narrow = vshrn_n_u16(mask, 4); + | ^~~~ + | | + | uint8x16_t + + +--- src/third_party/electron_node/deps/llhttp/unofficial.gni.orig 2025-08-15 17:33:00.577399458 +0200 ++++ src/third_party/electron_node/deps/llhttp/unofficial.gni 2025-08-18 17:28:08.494515274 +0200 +@@ -19,6 +19,7 @@ template("llhttp_gn_build") { + public_configs = [ ":llhttp_config" ] + include_dirs = [ "include" ] + sources = gypi_values.llhttp_sources ++ cflags = ["-flax-vector-conversions"] + if (is_clang || !is_win) { + cflags_c = [ + "-Wno-implicit-fallthrough", diff --git a/lock_impl_posix-pthread_mutexattr_setprotocol-conflicting.patch b/lock_impl_posix-pthread_mutexattr_setprotocol-conflicting.patch new file mode 100644 index 0000000..9bcbad3 --- /dev/null +++ b/lock_impl_posix-pthread_mutexattr_setprotocol-conflicting.patch @@ -0,0 +1,19 @@ +--- src/base/synchronization/lock_impl_posix.cc.orig 2025-08-15 17:32:21.581406552 +0200 ++++ src/base/synchronization/lock_impl_posix.cc 2025-08-15 21:57:54.242385089 +0200 +@@ -20,6 +20,8 @@ + #include "base/system/sys_info.h" + #include "build/build_config.h" + ++ ++#if BUILDFLAG(IS_ANDROID) + // On Android, `pthread_mutexattr_setprotocol()` is only defined in bionic + // starting with API level 28. Make it a weak import, so that we can compile. + extern "C" { +@@ -27,6 +29,7 @@ int __attribute__((weak)) pthread_mutexa + pthread_mutexattr_t* _Nonnull __attr, + int __protocol); + } ++#endif + + namespace base { + diff --git a/masked_domain_list-flatbuffers.patch b/masked_domain_list-flatbuffers.patch new file mode 100644 index 0000000..9d7dc5a --- /dev/null +++ b/masked_domain_list-flatbuffers.patch @@ -0,0 +1,25 @@ +This code fails to build but is gated by a disabled feature flag, disabling it unconditionally + + +--- src/components/ip_protection/common/masked_domain_list_manager.cc.orig 2025-08-22 20:17:46.149834100 +0200 ++++ src/components/ip_protection/common/masked_domain_list_manager.cc 2025-08-23 01:07:33.078746196 +0200 +@@ -41,8 +41,7 @@ using ::masked_domain_list::ResourceOwne + using ::network::mojom::IpProtectionProxyBypassPolicy; + + bool UseFlatbuffer() { +- return base::FeatureList::IsEnabled( +- network::features::kMaskedDomainListFlatbufferImpl); ++ return false; + } + + bool RestrictTopLevelSiteSchemes( +--- src/components/ip_protection/common/BUILD.gn.orig 2025-08-22 20:17:46.149834100 +0200 ++++ src/components/ip_protection/common/BUILD.gn 2025-08-23 01:06:48.134754665 +0200 +@@ -479,7 +479,6 @@ source_set("masked_domain_list_manager") + "masked_domain_list_manager.h", + ] + public_deps = [ +- ":masked_domain_list", + ":url_matcher_with_bypass", + "//base", + "//components/privacy_sandbox/masked_domain_list:masked_domain_list_proto", diff --git a/media_session_uma_helper-missing-optional.patch b/media_session_uma_helper-missing-optional.patch deleted file mode 100644 index bd6df81..0000000 --- a/media_session_uma_helper-missing-optional.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4ca8cffec2e6dea43de24a6a9d88095b73ab10f4 Mon Sep 17 00:00:00 2001 -From: Ivan Murashov -Date: Wed, 19 Feb 2025 22:59:45 -0800 -Subject: [PATCH] IWYU: Add missing include for std::optional usage in - media_session_uma_helper.h - -In the CL https://crrev.com/c/6204145 used std::optional in -the content/browser/media/session/media_session_uma_helper.h, -but corresponding include was missed. -Added missing include for std::optional usage. - -Bug: 41455655 -Change-Id: I482a496f6f72762f02e8e6e1484a7eae58147148 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6279927 -Reviewed-by: Colin Blundell -Commit-Queue: Ivan Murashov -Reviewed-by: Tommy Steimel -Cr-Commit-Position: refs/heads/main@{#1422370} ---- - content/browser/media/session/media_session_uma_helper.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/content/browser/media/session/media_session_uma_helper.h b/content/browser/media/session/media_session_uma_helper.h -index 70000267af9687..51dd098826020c 100644 ---- a/content/browser/media/session/media_session_uma_helper.h -+++ b/content/browser/media/session/media_session_uma_helper.h -@@ -5,6 +5,8 @@ - #ifndef CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_UMA_HELPER_H_ - #define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_UMA_HELPER_H_ - -+#include -+ - #include "base/memory/raw_ptr.h" - #include "base/time/clock.h" - #include "base/time/time.h" diff --git a/node-cares-1.21-4.patch b/node-cares-1.21-4.patch new file mode 100644 index 0000000..4825724 --- /dev/null +++ b/node-cares-1.21-4.patch @@ -0,0 +1,35 @@ +From 2be863be08ff9f16eae6bb907388c354c55c3bfc Mon Sep 17 00:00:00 2001 +From: Ethan Arrowood +Date: Mon, 2 Jun 2025 09:29:36 -0600 +Subject: [PATCH] dns: fix dns query cache implementation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +PR-URL: https://github.com/nodejs/node/pull/58404 +Refs: https://github.com/nodejs/node/pull/57640 +Reviewed-By: Juan José Arboleda +Reviewed-By: Matteo Collina +Reviewed-By: Tim Perry +--- + src/cares_wrap.cc | 6 +++--- + test/parallel/test-dns.js | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc +index 6290bcd37f3411..5016c3d51dac66 100644 +--- a/third_party/electron_node/src/cares_wrap.cc ++++ b/third_party/electron_node/src/cares_wrap.cc +@@ -879,9 +879,9 @@ void ChannelWrap::Setup() { + } + + /* We do the call to ares_init_option for caller. */ +- const int optmask = +- ARES_OPT_FLAGS | ARES_OPT_TIMEOUTMS | +- ARES_OPT_SOCK_STATE_CB | ARES_OPT_TRIES; ++ const int optmask = ARES_OPT_FLAGS | ARES_OPT_TIMEOUTMS | ++ ARES_OPT_SOCK_STATE_CB | ARES_OPT_TRIES | ++ ARES_OPT_QUERY_CACHE; + r = ares_init_options(&channel_, &options, optmask); + + if (r != ARES_SUCCESS) { diff --git a/node-kParentNodeTag-constexpr-initializer.patch b/node-kParentNodeTag-constexpr-initializer.patch new file mode 100644 index 0000000..f9cae55 --- /dev/null +++ b/node-kParentNodeTag-constexpr-initializer.patch @@ -0,0 +1,14 @@ +--- src/third_party/blink/renderer/core/dom/node.h.orig 2025-08-15 17:32:29.121405137 +0200 ++++ src/third_party/blink/renderer/core/dom/node.h 2025-08-15 23:15:58.713118795 +0200 +@@ -1259,9 +1259,9 @@ class CORE_EXPORT Node : public EventTar + + private: + static constexpr struct ParentNodeTag { +- } kParentNodeTag; ++ } kParentNodeTag {}; + static constexpr struct ShadowHostTag { +- } kShadowHostTag; ++ } kShadowHostTag {}; + + using TaggedParentOrShadowHostNode = + subtle::TaggedUncompressedMember; diff --git a/node-llhttp9.3.patch b/node-llhttp9.3.patch deleted file mode 100644 index 68e8cf9..0000000 --- a/node-llhttp9.3.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 4454d09e8f7225ec1b576ef86c8705bca63a136c Mon Sep 17 00:00:00 2001 -From: Fedor Indutny <238531+indutny@users.noreply.github.com> -Date: Wed, 7 May 2025 07:21:52 -0700 -Subject: [PATCH] deps: update llhttp to 9.3.0 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -llhttp@9.3.0 optimizes header value parsing on ARM Neon/WASM, and adds -support for a protocol callback for use outside of the typical HTTP -setting (RTSP/ICE). - -PR-URL: https://github.com/nodejs/node/pull/58144 -Reviewed-By: Rafael Gonzaga -Reviewed-By: Juan José Arboleda -Reviewed-By: Matteo Collina -Reviewed-By: Marco Ippolito ---- - deps/llhttp/CMakeLists.txt | 7 +- - deps/llhttp/LICENSE | 22 + - deps/llhttp/README.md | 9 +- - deps/llhttp/include/llhttp.h | 10 +- - deps/llhttp/libllhttp.pc.in | 8 +- - deps/llhttp/src/api.c | 45 +- - deps/llhttp/src/llhttp.c | 2841 ++++++++--------- - src/node_http_parser.cc | 6 + - test/parallel/test-http-client-parse-error.js | 2 +- - 9 files changed, 1459 insertions(+), 1491 deletions(-) - create mode 100644 deps/llhttp/LICENSE - -diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc -index acebdd952eb943..25aa204ee2c851 100644 ---- a/third_party/electron_node/src/node_http_parser.cc -+++ b/third_party/electron_node/src/node_http_parser.cc -@@ -1204,6 +1204,10 @@ void ConnectionsList::Expired(const FunctionCallbackInfo& args) { - - const llhttp_settings_t Parser::settings = { - Proxy::Raw, -+ -+ // on_protocol -+ nullptr, -+ - Proxy::Raw, - Proxy::Raw, - -@@ -1223,6 +1227,8 @@ const llhttp_settings_t Parser::settings = { - Proxy::Raw, - Proxy::Raw, - -+ // on_protocol_complete -+ nullptr, - // on_url_complete - nullptr, - // on_status_complete diff --git a/node-nghttp-1.50.patch b/node-nghttp-1.50.patch new file mode 100644 index 0000000..8468861 --- /dev/null +++ b/node-nghttp-1.50.patch @@ -0,0 +1,78 @@ +From 02a1505efcf7099498240e83327f7c0d71696f47 Mon Sep 17 00:00:00 2001 +From: Carlos Fuentes +Date: Thu, 5 Jun 2025 14:30:07 +0200 +Subject: [PATCH] http2: add lenient flag for RFC-9113 + +PR-URL: https://github.com/nodejs/node/pull/58116 +Reviewed-By: Tim Perry +Reviewed-By: Matteo Collina +Reviewed-By: Benjamin Gruenbaum +--- + doc/api/http2.md | 12 +++ + lib/internal/http2/util.js | 10 ++- + src/node_http2.cc | 6 ++ + src/node_http2_state.h | 1 + + .../test-http2-server-rfc-9113-client.js | 80 ++++++++++++++++++ + .../test-http2-server-rfc-9113-server.js | 83 +++++++++++++++++++ + .../test-http2-util-update-options-buffer.js | 6 +- + 7 files changed, 196 insertions(+), 2 deletions(-) + create mode 100644 test/parallel/test-http2-server-rfc-9113-client.js + create mode 100644 test/parallel/test-http2-server-rfc-9113-server.js + +diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js +index 75312e5aa57c5f..396623d3b9d06f 100644 +--- a/third_party/electron_node/lib/internal/http2/util.js ++++ b/third_party/electron_node/lib/internal/http2/util.js +@@ -229,7 +229,8 @@ const IDX_OPTIONS_MAX_SESSION_MEMORY = 8; + const IDX_OPTIONS_MAX_SETTINGS = 9; + const IDX_OPTIONS_STREAM_RESET_RATE = 10; + const IDX_OPTIONS_STREAM_RESET_BURST = 11; +-const IDX_OPTIONS_FLAGS = 12; ++const IDX_OPTIONS_STRICT_HTTP_FIELD_WHITESPACE_VALIDATION = 12; ++const IDX_OPTIONS_FLAGS = 13; + + function updateOptionsBuffer(options) { + let flags = 0; +@@ -293,6 +294,13 @@ function updateOptionsBuffer(options) { + optionsBuffer[IDX_OPTIONS_STREAM_RESET_BURST] = + MathMax(1, options.streamResetBurst); + } ++ ++ if (typeof options.strictFieldWhitespaceValidation === 'boolean') { ++ flags |= (1 << IDX_OPTIONS_STRICT_HTTP_FIELD_WHITESPACE_VALIDATION); ++ optionsBuffer[IDX_OPTIONS_STRICT_HTTP_FIELD_WHITESPACE_VALIDATION] = ++ options.strictFieldWhitespaceValidation === true ? 0 : 1; ++ } ++ + optionsBuffer[IDX_OPTIONS_FLAGS] = flags; + } + +diff --git a/src/node_http2.cc b/src/node_http2.cc +index 449ecdba807945..8e51129930f2cd 100644 +--- a/third_party/electron_node/src/node_http2.cc ++++ b/third_party/electron_node/src/node_http2.cc +@@ -159,6 +159,12 @@ Http2Options::Http2Options(Http2State* http2_state, SessionType type) { + buffer[IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS]); + } + ++ // Validate headers in accordance to RFC-9113 ++ if (flags & (1 << IDX_OPTIONS_STRICT_HTTP_FIELD_WHITESPACE_VALIDATION)) { ++ nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation( ++ option, buffer[IDX_OPTIONS_STRICT_HTTP_FIELD_WHITESPACE_VALIDATION]); ++ } ++ + // The padding strategy sets the mechanism by which we determine how much + // additional frame padding to apply to DATA and HEADERS frames. Currently + // this is set on a per-session basis, but eventually we may switch to +diff --git a/src/node_http2_state.h b/src/node_http2_state.h +index 2957a2827f370e..914ad011e021f1 100644 +--- a/third_party/electron_node/src/node_http2_state.h ++++ b/third_party/electron_node/src/node_http2_state.h +@@ -60,6 +60,7 @@ namespace http2 { + IDX_OPTIONS_MAX_SETTINGS, + IDX_OPTIONS_STREAM_RESET_RATE, + IDX_OPTIONS_STREAM_RESET_BURST, ++ IDX_OPTIONS_STRICT_HTTP_FIELD_WHITESPACE_VALIDATION, + IDX_OPTIONS_FLAGS + }; + diff --git a/node-version-ck.patch b/node-version-ck.patch new file mode 100644 index 0000000..c28de12 --- /dev/null +++ b/node-version-ck.patch @@ -0,0 +1,27 @@ +author: Andres Salomon +description: disable the node version check + +https://chromium-review.googlesource.com/c/chromium/src/+/6334038 added +a node version check, but we don't want that as we're using debian's +packaged node. + +--- a/third_party/node/node.gni ++++ b/third_party/node/node.gni +@@ -44,7 +44,6 @@ template("node") { + if (!defined(deps)) { + deps = [] + } +- deps += [ "//third_party/node:check_version" ] + } + } + } +--- a/third_party/protobuf/proto_library.gni ++++ b/third_party/protobuf/proto_library.gni +@@ -562,7 +562,6 @@ template("proto_library") { + _protoc_gen_ts_path, + "//tools/protoc_wrapper/protoc-gen-ts_proto.py", + ] + _protoc_gen_ts_runtime_deps +- deps += [ "//third_party/node:check_version" ] + } + + if (_generate_with_plugin) { diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 73ad680..59de664 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,88 @@ +------------------------------------------------------------------- +Sat Aug 23 18:11:15 UTC 2025 - Bruno Pitrus + +- Update to 37.3.1 (bsc#1248464) + * Chromium 138.0.7204.235 + * Node 22.18.0 + * V8 13.8 + * Added scriptURL property to ServiceWorkerMain. + * Added a CSS rule for smooth corners. + * Utility Process unhandled rejection behavior change + * process.exit() kills utility process synchronously + * WebUSB and WebSerial Blocklist Support + * Removed: null value for session property in ProtocolResponse + * BrowserWindow.IsVisibleOnAllWorkspaces() on Linux + * see https://www.electronjs.org/blog/electron-37-0 + and https://github.com/electron/electron/releases/tag/v37.0.0 for more +- Leap 15.6: use bundled aom + * drop aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch + * drop aom3.10-AV1E_SET_AUTO_TILES.patch + * drop webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch + * drop webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch +- Fedora <=42: use bundled llhttp +- Fedora: use bundled simdutf +- Merge MakeSbixTypeface-null-pointer-call.patch into chromium-130-fontations.patch' +- drop no longer needed patches + * build-without-speech-service.patch + * content_browser_client-incomplete-WebUIController.patch + * css_shape_value-constructor.patch + * disable-devtools-tests.patch + * distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch + * distributed_point_functions-evaluate_prg_hwy-signature.patch + * electron-13-blink-gcc-ambiguous-nodestructor.patch + * exception_state-constexpr-initializer.patch + * extensions-common-assert.patch + * fix-building-with-pipewire-1.3.82.patch + * fix-build-without-pdf.patch + * fix-build-without-video-effects.patch + * html_permission_element_strings_map-reproducible.patch + * MakeSbixTypeface-null-pointer-call.patch + * media_session_uma_helper-missing-optional.patch + * node-llhttp9.3.patch + * object_paint_properties-explicit-specialization-in-non-namespace-scope.patch + * perfetto-ThreadTrack-Current-null-dereference.patch + * picture_in_picture_window_manager_uma_helper-missing-optional.patch + * plugin_utils-build-without-electron_extensions.patch + * python3.14-nodedownload-FancyURLopener.patch + * raw_ptr-fpermissive.patch + * resource_response-Wchanges-meaning.patch + * resource-Wchanges-meaning.patch + * string-hasher-flax-vector-conversions.patch + * string_truncator-convert.patch + * style_scope-unqualified-To.patch + * system-simdutf.patch + * to_vector-std-projected-gcc119888.patch + * unexportable_key_service_impl-Wlto-type-mismatch.patch + * xml_document_parser-Wmissing-template-keyword.patch +- Conditionally revert upstream changes to fix build on 15.6 + * ffmpeg-4-AV_PROFILE.patch + * node-cares-1.21-4.patch + * node-nghttp-1.50.patch + * v8-highway-1.1.patch +- Add patches to fix build errors + * angle-BlobCache-Success.patch + * llhttp-lax-vector-conversions.patch + * masked_domain_list-flatbuffers.patch + * node-version-ck.patch + * partition_alloc-strict-aliasing.patch + * remove-probabilistic-token-which-uses-private-join-and-compute.patch + * system-dragonbox.patch +- Add patches that should be upstreamed + * ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch + * event_record-optional-initializer.patch + * identity_request_account-incomplete-IdentityProviderData.patch + * json_to_struct-fixed_flat_map-conflicting-declaration.patch + * lock_impl_posix-pthread_mutexattr_setprotocol-conflicting.patch + * node-kParentNodeTag-constexpr-initializer.patch + * offscreen_canvas-incomplete-LayoutLocale.patch + * pickle_traits-kIndexSequence-constexpr-initializer.patch + * picture_in_picture_events_info-string-constexpr.patch + * sandboxed_vfs_file_impl-missing-memset.patch + * v8-simd-flax-vector-conversions.patch + * webgl_rendering_context_webgpu_base-incomplete-StaticBitmapImage.patch + * webrtc-138-Wchanges-meaning.patch + * xr_webgl_swap_chain-incomplete-StaticBitmapImage.patch + ------------------------------------------------------------------- Tue Aug 19 17:11:54 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 43f0b05..608d7ca 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -20,7 +20,7 @@ %define mod_name electron # https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json -%define abi_version 133 +%define abi_version 136 # Do not provide libEGL.so, etc… %define __provides_exclude ^lib.*\\.so.*$ @@ -83,29 +83,34 @@ ExcludeArch: %arm %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_vpx +%bcond_without system_aom %bcond_without bro_11 %bcond_without ffmpeg_6 %bcond_without system_vk_headers %bcond_without spirv_2024 %bcond_without cares_21 +%bcond_without nghttp_50 +%bcond_without highway_1_1 %else %bcond_with system_vpx +%bcond_with system_aom %bcond_with bro_11 %bcond_with ffmpeg_6 %bcond_with system_vk_headers %bcond_with spirv_2024 %bcond_with cares_21 +%bcond_with nghttp_50 +%bcond_with highway_1_1 %endif %if 0%{?fedora} -%bcond_without system_llhttp + %bcond_without system_histogram %bcond_without system_simdjson %else -%bcond_with system_llhttp %bcond_with system_histogram %bcond_with system_simdjson %endif @@ -118,17 +123,13 @@ ExcludeArch: %arm %endif %if 0%{?fedora} >= 43 -%bcond_without llhttp_93 +%bcond_without system_llhttp %else -%bcond_with llhttp_93 +%bcond_with system_llhttp %endif -# requires `base64_options` -%if 0%{?fedora} >= 42 -%bcond_without system_simdutf -%else +# requires built with `SIMDUTF_ATOMIC_REF` %bcond_with system_simdutf -%endif %if 0%{?fedora} && 0%{?fedora} < 42 %bcond_without system_vma @@ -139,10 +140,8 @@ ExcludeArch: %arm # Some chromium code assumes absl::string_view is a typedef for std::string_view. This is not true on GCC7 systems such as Leap. %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} %bcond_without system_abseil -%bcond_without aom_38 %else %bcond_with system_abseil -%bcond_with aom_38 %endif %if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 41 @@ -187,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 35.7.5 +Version: 37.3.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -205,20 +204,20 @@ Source400: ffmpeg-new-channel-layout.patch Source401: audio_file_reader-ffmpeg-AVFrame-duration.patch Source402: Cr122-ffmpeg-new-channel-layout.patch Source403: ffmpeg-7-ffmpeg_video_decoder-reordered_opaque.patch -# and against aom 3.9 -Source410: aom3.10-AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR.patch -Source411: aom3.10-AV1E_SET_AUTO_TILES.patch -Source412: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch -Source413: webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch +Source404: ffmpeg-4-AV_PROFILE.patch # and abseil 2407 Source461: webrtc-make_ref_counted-absl2024-nullability.patch # and c-ares 1.19 Source470: node-cares-1.21.patch Source471: node-cares-1.21-2.patch Source472: node-cares-1.21-3.patch +Source473: node-cares-1.21-4.patch # and spirv 2023 Source480: angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch - +#and nghttp 1.40 +Source490: node-nghttp-1.50.patch +#and highway 1.0 +Source500: v8-highway-1.1.patch # PATCHES for openSUSE-specific things (compiler flags, paths, etc.) @@ -260,7 +259,6 @@ Patch570: disable-fuses.patch # https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?h=102-based&id=d617766b236a93749ddbb50b75573dd35238ffc9 Patch573: disable-webspeech.patch # https://sources.debian.org/patches/chromium/108.0.5359.124-1/disable/tests.patch/ -Patch576: disable-devtools-tests.patch Patch581: disable-tests.patch Patch583: remove-rust.patch Patch585: remove-dawn.patch @@ -270,7 +268,6 @@ Patch589: remove-puffin.patch Patch590: remove-sync.patch Patch592: fix-build-without-supervised-users.patch Patch593: fix-build-without-screen-ai.patch -Patch594: build-without-speech-service.patch #patches disabling rust features from Gentoo: https://data.gpo.zugaina.org/pf4public/dev-util/electron/files/ Patch595: chromium-123-qrcode.patch Patch596: chromium-130-fontations.patch @@ -278,7 +275,6 @@ Patch597: chromium-125-cloud_authenticator.patch Patch598: chromium-127-crabby.patch Patch599: chromium-132-no-rust.patch #End gentoo patches -Patch601: MakeSbixTypeface-null-pointer-call.patch Patch602: remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch Patch603: build-without-mesage-center.patch Patch604: disable-avif-really.patch @@ -286,6 +282,8 @@ Patch605: permission-gcc14.2.patch Patch606: build-without-extensions.patch Patch607: build-without-guest-view.patch Patch608: vaapi-no-encoders.patch +Patch609: remove-probabilistic-token-which-uses-private-join-and-compute.patch +Patch610: masked_domain_list-flatbuffers.patch @@ -308,7 +306,6 @@ Patch1072: node-system-icu.patch Patch1073: system-nasm.patch Patch1074: no-zlib-headers.patch Patch1077: system-wayland.patch -Patch1078: system-simdutf.patch Patch1079: system-libm.patch Patch1085: webp-no-sharpyuv.patch Patch1086: zip_internal-missing-uLong-Z_DEFAULT_COMPRESSION.patch @@ -320,6 +317,8 @@ Patch1092: fix-system-highway.patch Patch1093: system-sqlite.patch Patch1094: absl_strings-missing-headers.patch Patch1095: system-zstd-in-node.patch +Patch1036: node-version-ck.patch +Patch1037: system-dragonbox.patch # PATCHES to fix interaction with third-party software @@ -343,18 +342,14 @@ Patch2059: disable-FFmpegAllowLists.patch Patch2060: chromium-129-disable-H.264-video-parser-during-demuxing.patch Patch2061: private_aggregation_host-uint128.patch Patch2062: wayland_version.patch -Patch2063: fix-building-with-pipewire-1.3.82.patch #Conditionably disable feature which requires new highway Patch2064: blink-shape_result-highway.patch -%if %{with system_llhttp} && %{with llhttp_93} -Patch2065: node-llhttp9.3.patch -%else -Source2065: node-llhttp9.3.patch -%endif +#Patch2065: node-llhttp9.3.patch +Patch2066: angle-BlobCache-Success.patch +Patch2067: partition_alloc-strict-aliasing.patch +Patch2068: llhttp-lax-vector-conversions.patch # PATCHES that should be submitted upstream verbatim or near-verbatim -# Fix blink nodestructor -Patch3023: electron-13-blink-gcc-ambiguous-nodestructor.patch Patch3027: electron-16-freetype-visibility-list.patch Patch3028: electron-16-third_party-symbolize-missing-include.patch # From https://git.droidware.info/wchen342/ungoogled-chromium-fedora @@ -364,39 +359,29 @@ Patch3096: remove-date-reproducible-builds.patch Patch3133: swiftshader-llvm18-LLVMReactor-getInt8PtrTy.patch Patch3134: swiftshader-llvm18-LLVMJIT-Host.patch Patch3135: swiftshader-llvm18-LLVMJIT-CodeGenOptLevel.patch -Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch Patch3144: mt21_util-flax-vector-conversions.patch -Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch Patch3174: swiftshader-llvm19-LLVMJIT-getHostCPUFeatures.patch Patch3175: swiftshader-llvm19-LLVMReactor-incomplete-Module.patch Patch3185: bsc1224178-font-gc.patch Patch3186: string_view-incomplete-CodePointIterator.patch Patch3187: swiftshader-llvm20-absoluteSymbols.patch -Patch3188: fix-build-without-pdf.patch -Patch3189: raw_ptr-fpermissive.patch -Patch3190: exception_state-constexpr-initializer.patch -Patch3191: resource_response-Wchanges-meaning.patch -Patch3192: perfetto-ThreadTrack-Current-null-dereference.patch -Patch3193: resource-Wchanges-meaning.patch -Patch3194: string_truncator-convert.patch -Patch3195: object_paint_properties-explicit-specialization-in-non-namespace-scope.patch -Patch3196: css_shape_value-constructor.patch -Patch3197: xml_document_parser-Wmissing-template-keyword.patch Patch3198: ax_platform_node_id-fpermissive.patch -Patch3199: style_scope-unqualified-To.patch -Patch3200: content_browser_client-incomplete-WebUIController.patch -Patch3201: fix-build-without-video-effects.patch -Patch3202: media_session_uma_helper-missing-optional.patch -Patch3203: picture_in_picture_window_manager_uma_helper-missing-optional.patch Patch3204: browser_process_impl-fix-safe_browsing_mode-0.patch -Patch3205: plugin_utils-build-without-electron_extensions.patch -Patch3206: string-hasher-flax-vector-conversions.patch -Patch3207: unexportable_key_service_impl-Wlto-type-mismatch.patch -Patch3208: to_vector-std-projected-gcc119888.patch Patch3209: file_dialog-missing-uint32_t.patch -Patch3211: html_permission_element_strings_map-reproducible.patch -Patch3212: extensions-common-assert.patch -Patch3213: python3.14-nodedownload-FancyURLopener.patch +Patch3210: webrtc-138-Wchanges-meaning.patch +Patch3211: sandboxed_vfs_file_impl-missing-memset.patch +Patch3212: lock_impl_posix-pthread_mutexattr_setprotocol-conflicting.patch +Patch3213: node-kParentNodeTag-constexpr-initializer.patch +Patch3214: pickle_traits-kIndexSequence-constexpr-initializer.patch +Patch3215: offscreen_canvas-incomplete-LayoutLocale.patch +Patch3216: identity_request_account-incomplete-IdentityProviderData.patch +Patch3217: xr_webgl_swap_chain-incomplete-StaticBitmapImage.patch +Patch3218: json_to_struct-fixed_flat_map-conflicting-declaration.patch +Patch3219: webgl_rendering_context_webgpu_base-incomplete-StaticBitmapImage.patch +Patch3220: picture_in_picture_events_info-string-constexpr.patch +Patch3221: event_record-optional-initializer.patch +Patch3222: ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch +Patch3223: v8-simd-flax-vector-conversions.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. @@ -410,6 +395,7 @@ BuildRequires: c-ares-devel >= 1.21 BuildRequires: cmake(Crc32c) BuildRequires: double-conversion-devel BuildRequires: desktop-file-utils +BuildRequires: dragonbox-devel %if 0%{?fedora} BuildRequires: flatbuffers-compiler %endif @@ -428,21 +414,14 @@ BuildRequires: libatomic %if %{with system_ada} BuildRequires: cmake(ada) %endif -%if %{with aom_38} +%if %{with system_aom} BuildRequires: libaom-devel >= 3.8~ %endif -# requires AV1E_SET_QUANTIZER_ONE_PASS -BuildRequires: libaom-devel >= 3.7~ BuildRequires: libbsd-devel BuildRequires: libpng-devel BuildRequires: libXNVCtrl-devel %if %{with system_llhttp} -BuildRequires: llhttp-devel >= 8 -%if %{with llhttp_93} BuildRequires: llhttp-devel >= 9.3 -%else -BuildRequires: llhttp-devel < 9.3 -%endif %endif %if %{with swiftshader} && %{without subzero} BuildRequires: llvm-devel >= 16 @@ -584,7 +563,15 @@ BuildRequires: pkgconfig(libbrotlienc) BuildRequires: pkgconfig(libcares) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libdrm) +%if %{with highway_1_1} +# requires SumsOf2 +BuildRequires: pkgconfig(libhwy) >= 1.1 +%endif BuildRequires: pkgconfig(libhwy) >= 1 +%if %{with nghttp_50} +# needs nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation +BuildRequires: pkgconfig(libnghttp2) >= 1.50 +%endif BuildRequires: pkgconfig(libnghttp2) BuildRequires: pkgconfig(libnotify) BuildRequires: pkgconfig(libpci) @@ -746,19 +733,14 @@ providing better integration with desktop environments such as KDE. test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = %abi_version -#These ones depend on an aom nightly, reverting unconditionally -patch -R -p1 < %SOURCE411 -patch -R -p1 < %SOURCE410 -%if %{without aom_38} -patch -R -p1 < %SOURCE412 -patch -R -p1 < %SOURCE413 -%endif + %if %{without cares_21} patch -R -p1 < %SOURCE472 patch -R -p1 < %SOURCE471 patch -R -p1 < %SOURCE470 +patch -R -p1 < %SOURCE473 %endif @@ -768,12 +750,20 @@ patch -R -p1 < %SOURCE403 patch -R -p1 < %SOURCE402 patch -R -p1 < %SOURCE400 patch -R -p1 < %SOURCE401 +patch -R -p1 < %SOURCE404 %endif %if %{without spirv_2024} patch -R -p1 < %SOURCE480 %endif +%if %{without nghttp_50} +patch -R -p1 < %SOURCE490 +%endif + +%if %{without highway_1_1} +patch -R -p1 < %SOURCE500 +%endif # This one just removes compatibility with old abseil and does not add anything, reverting unconditionally. @@ -824,7 +814,6 @@ gn_system_libraries=( highway icu jsoncpp - libaom libdrm libjpeg libpng @@ -872,6 +861,10 @@ gn_system_libraries+=( %endif +%if %{with system_aom} +find third_party/libaom -type f ! -name "*.gn" -a ! -name "*.gni" -delete +gn_system_libraries+=( libaom ) +%endif @@ -981,6 +974,12 @@ ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')" # for wayland export CXXFLAGS="${ARCH_FLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon" + +#no pkgconfig, only cmake. add the include path manually +%if 0%{?fedora} +export CXXFLAGS="${CXXFLAGS} -I$(echo /usr/include/dragonbox-*)" +%endif + export CFLAGS="${CXXFLAGS}" # Google has a bad coding style, using a macro `NOTREACHED()` that is not properly detected by GCC @@ -998,6 +997,9 @@ export CXXFLAGS="${CXXFLAGS} -Wno-template-id-cdtor -Wno-non-virtual-dtor" # REDUCE DEBUG for C++ as it gets TOO large due to “heavy hemplate use in Blink”. See symbol_level below and chromium-102-compiler.patch export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-g / /g' -e 's/-g$//g')" +#Fix build with abseil < 2025 +export CXXFLAGS="$CXXFLAGS -Dabsl_nullable= -Dabsl_nonnull= " + %ifarch %ix86 %arm export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-g /-g1 /g' -e 's/-g$/-g1/g')" %endif @@ -1087,6 +1089,8 @@ myconf_gn+=' electron_vendor_version="microsoft-build:Electron for openSUSE"' myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" myconf_gn+=" use_custom_libcxx=false" +myconf_gn+=' use_safe_libstdcxx=false' +myconf_gn+=' use_llvm_libatomic=false' %ifarch %ix86 myconf_gn+=" host_cpu=\"x86\"" %endif @@ -1209,12 +1213,15 @@ myconf_gn+=" enable_vr=false" myconf_gn+=" enable_reporting=false" myconf_gn+=" build_with_tflite_lib=false" myconf_gn+=" build_tflite_with_xnnpack=false" +myconf_gn+=' build_tflite_with_opencl=false' myconf_gn+=" safe_browsing_mode=0" +myconf_gn+=' safe_browsing_use_unrar=false' myconf_gn+=" enable_captive_portal_detection=false" myconf_gn+=" enable_browser_speech_service=false" myconf_gn+=" enable_speech_service=false" myconf_gn+=" enable_screen_ai_service=false" myconf_gn+=' enable_screen_ai_browsertests=false' +myconf_gn+=' enable_constraints=false' myconf_gn+=" include_transport_security_state_preload_list=false" myconf_gn+=" enable_web_speech=false" myconf_gn+=" chrome_wide_echo_cancellation_supported=false" @@ -1254,6 +1261,7 @@ myconf_gn+=' enable_on_device_translation=false' myconf_gn+=' enable_session_service=false' myconf_gn+=' enterprise_client_certificates=false' myconf_gn+=' enterprise_data_controls=false' +myconf_gn+=' enterprise_telomere_reporting=false' @@ -1262,8 +1270,10 @@ myconf_gn+=' enterprise_data_controls=false' myconf_gn+=' enable_rust=false' myconf_gn+=' enable_rust_png=false' myconf_gn+=' enable_chromium_prelude=false' +myconf_gn+=' rtc_rusty_base64=false' +myconf_gn+=' v8_enable_temporal_support=false' -myconf_gn+=' chrome_root_store_cert_management_ui=false' +#myconf_gn+=' chrome_root_store_cert_management_ui=false' myconf_gn+=' use_kerberos=false' diff --git a/object_paint_properties-explicit-specialization-in-non-namespace-scope.patch b/object_paint_properties-explicit-specialization-in-non-namespace-scope.patch deleted file mode 100644 index 3f6260f..0000000 --- a/object_paint_properties-explicit-specialization-in-non-namespace-scope.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- src/third_party/blink/renderer/core/paint/object_paint_properties.h.orig 2025-04-16 14:36:32.662070096 +0200 -+++ src/third_party/blink/renderer/core/paint/object_paint_properties.h 2025-04-16 22:12:50.444628128 +0200 -@@ -174,47 +174,6 @@ class CORE_EXPORT ObjectPaintProperties - template - struct NodeIdRange {}; - -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstTransform; -- static constexpr NodeId kLast = NodeId::kClipAlias; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstTransform; -- static constexpr NodeId kLast = NodeId::kTransformAlias; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstTransform; -- static constexpr NodeId kLast = NodeId::kLastTransform; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstScroll; -- static constexpr NodeId kLast = NodeId::kLastScroll; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstEffect; -- static constexpr NodeId kLast = NodeId::kEffectAlias; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstEffect; -- static constexpr NodeId kLast = NodeId::kLastEffect; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstClip; -- static constexpr NodeId kLast = NodeId::kClipAlias; -- }; -- template <> -- struct NodeIdRange { -- static constexpr NodeId kFirst = NodeId::kFirstClip; -- static constexpr NodeId kLast = NodeId::kLastClip; -- }; -- - public: - template - bool HasNode() const { -@@ -579,6 +538,48 @@ class CORE_EXPORT ObjectPaintProperties - #endif - }; - -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstTransform; -+ static constexpr NodeId kLast = NodeId::kClipAlias; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstTransform; -+ static constexpr NodeId kLast = NodeId::kTransformAlias; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstTransform; -+ static constexpr NodeId kLast = NodeId::kLastTransform; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstScroll; -+ static constexpr NodeId kLast = NodeId::kLastScroll; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstEffect; -+ static constexpr NodeId kLast = NodeId::kEffectAlias; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstEffect; -+ static constexpr NodeId kLast = NodeId::kLastEffect; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstClip; -+ static constexpr NodeId kLast = NodeId::kClipAlias; -+}; -+template <> -+struct ObjectPaintProperties::NodeIdRange { -+ static constexpr NodeId kFirst = NodeId::kFirstClip; -+ static constexpr NodeId kLast = NodeId::kLastClip; -+}; -+ -+ - } // namespace blink - - #endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_OBJECT_PAINT_PROPERTIES_H_ diff --git a/offscreen_canvas-incomplete-LayoutLocale.patch b/offscreen_canvas-incomplete-LayoutLocale.patch new file mode 100644 index 0000000..4ada564 --- /dev/null +++ b/offscreen_canvas-incomplete-LayoutLocale.patch @@ -0,0 +1,10 @@ +--- src/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h.orig 2025-08-15 17:32:29.249405113 +0200 ++++ src/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h 2025-08-16 00:00:02.342263133 +0200 +@@ -23,6 +23,7 @@ + #include "third_party/blink/renderer/platform/graphics/dom_node_id.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/heap/prefinalizer.h" ++#include "third_party/blink/renderer/platform/text/layout_locale.h" + #include "ui/gfx/geometry/size.h" + + namespace blink { diff --git a/partition_alloc-strict-aliasing.patch b/partition_alloc-strict-aliasing.patch new file mode 100644 index 0000000..b9e7a09 --- /dev/null +++ b/partition_alloc-strict-aliasing.patch @@ -0,0 +1,51 @@ +#0 partition_alloc::internal::SlotSpanMetadata<(partition_alloc::internal::MetadataKind)0>::Free(unsigned long, partition_alloc::PartitionRoot*)::{lambda()#1}::operator()() const (__closure=, __closure=) + at ../../base/allocator/partition_allocator/src/partition_alloc/partition_page.h:805 +#1 partition_alloc::internal::SlotSpanMetadata<(partition_alloc::internal::MetadataKind)0>::Free (this=, slot_start=, + root=, this=, slot_start=, root=) + at ../../base/allocator/partition_allocator/src/partition_alloc/partition_page.h:805 +#2 partition_alloc::PartitionRoot::FreeInSlotSpan (this=, slot_start=, slot_span=, this=, + slot_start=, slot_span=) at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1607 +#3 partition_alloc::PartitionRoot::RawFree (this=, slot_start=, slot_span=, this=, + slot_start=, slot_span=) at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1673 +#4 partition_alloc::PartitionRoot::RawFreeWithThreadCache (this=, slot_start=, slot_start_ptr=, + slot_span=, this=, slot_start=, slot_start_ptr=, slot_span=) + at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1740 +#5 partition_alloc::PartitionRoot::FreeNoHooksImmediate (this=, object=, slot_span=, + slot_start=, this=, object=, slot_span=, slot_start=) + at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1598 +#6 partition_alloc::PartitionRoot::FreeInline<(partition_alloc::internal::FreeFlags)2> (this=, object=, + this=, object=) at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1514 +#7 partition_alloc::PartitionRoot::FreeInlineInUnknownRoot<(partition_alloc::internal::FreeFlags)2> (object=0x5a000024fa0) + at ../../base/allocator/partition_allocator/src/partition_alloc/partition_root.h:1446 +#8 allocator_shim::internal::PartitionAllocFunctionsInternal<(partition_alloc::internal::AllocFlags)16, (partition_alloc::internal::FreeFlags)2>::Free ( + object=0x5a000024fa0, context=) + at ../../base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.cc:434 +#9 0x0000555555561755 in std::__new_allocator::deallocate (this=0x7fffffffdb10, __p=, __n=) + at /usr/include/c++/15/bits/new_allocator.h:172 +#10 std::allocator::deallocate (this=0x7fffffffdb10, __p=, __n=) at /usr/include/c++/15/bits/allocator.h:215 +#11 std::allocator_traits >::deallocate (__a=..., __p=, __n=) + at /usr/include/c++/15/bits/alloc_traits.h:649 +#12 std::__cxx11::basic_string, std::allocator >::_M_destroy (this=0x7fffffffdb10, __size=) + at /usr/include/c++/15/bits/basic_string.h:305 +#13 std::__cxx11::basic_string, std::allocator >::_M_dispose (this=0x7fffffffdb10) + at /usr/include/c++/15/bits/basic_string.h:299 +#14 std::__cxx11::basic_string, std::allocator >::~basic_string (this=, this=) + at /usr/include/c++/15/bits/basic_string.h:896 +#15 base::CommandLine::AppendSwitchesAndArguments (this=, argv=...) at ../../base/command_line.cc:657 +#16 base::CommandLine::InitFromArgv (this=, argv=...) at ../../base/command_line.cc:333 +#17 base::CommandLine::InitFromArgv (this=, argc=, argv=) at ../../base/command_line.cc:324 +#18 base::CommandLine::Init (argc=, argv=) at ../../base/command_line.cc:275 +#19 base::CommandLine::Init (argc=, argv=) at ../../base/command_line.cc:262 +#20 main (argc=, argv=) at ../../components/url_formatter/spoof_checks/top_domains/top_domain_generator.cc:88 + + +--- src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.orig 2025-08-15 17:32:21.517406564 +0200 ++++ src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn 2025-08-16 16:11:37.214993083 +0200 +@@ -266,6 +266,7 @@ if (is_clang_or_gcc) { + config("partition_alloc_implementation") { + # See also: `partition_alloc_base/component_export.h` + defines = [ "IS_PARTITION_ALLOC_IMPL" ] ++ cflags = ["-fno-strict-aliasing"] + } + + config("partition_alloc_base_implementation") { diff --git a/perfetto-ThreadTrack-Current-null-dereference.patch b/perfetto-ThreadTrack-Current-null-dereference.patch deleted file mode 100644 index 314d417..0000000 --- a/perfetto-ThreadTrack-Current-null-dereference.patch +++ /dev/null @@ -1,42 +0,0 @@ -#Otherwise mksnapshot crashes -#0 perfetto::ThreadTrack::Current () at ../../third_party/perfetto/src/tracing/track.cc:105 -#1 0x0000555555815084 in v8::internal::GCTracer::GCTracer () at ../../v8/src/heap/gc-tracer.cc:184 -#2 v8::internal::Heap::SetUpSpaces (this=0x555557507788, new_allocation_info=..., old_allocation_info=...) at ../../v8/src/heap/heap.cc:5788 -#3 0x000055555704895b in v8::internal::Isolate::Init(v8::internal::SnapshotData*, v8::internal::SnapshotData*, v8::internal::SnapshotData*, bool) [clone .isra.0] () at ../../v8/src/execution/isolate.cc:5556 -#4 0x0000555555b51ad3 in v8::internal::Isolate::InitWithoutSnapshot () at ../../v8/src/execution/isolate.cc:5184 -#5 v8::internal::SnapshotCreatorImpl::InitInternal (this=0x55555750c130, blob=0x0) at ../../v8/src/snapshot/snapshot.cc:868 -#6 0x0000555555654b15 in v8::internal::SnapshotCreatorImpl::SnapshotCreatorImpl () at ../../v8/src/snapshot/snapshot.cc:929 -#7 v8::SnapshotCreator::SnapshotCreator () at ../../v8/src/api/api.cc:552 -#8 main (argc=1465209528, argv=0x3ff0000000000000) at ../../v8/src/snapshot/mksnapshot.cc:298 - - ---- src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.h.orig 2025-04-16 14:38:49.066064367 +0200 -+++ src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.h 2025-04-16 21:06:46.592994525 +0200 -@@ -44,11 +44,7 @@ class TracingMuxerFake : public TracingM - ~TracingMuxerFake() override; - - static constexpr TracingMuxerFake* Get() { --#if PERFETTO_HAS_NO_DESTROY() - return &instance; --#else -- return nullptr; --#endif - } - - // TracingMuxer implementation. ---- src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.cc.orig 2025-04-16 14:38:49.066064367 +0200 -+++ src/third_party/perfetto/src/tracing/internal/tracing_muxer_fake.cc 2025-04-16 21:13:09.044959936 +0200 -@@ -27,13 +27,11 @@ PERFETTO_NORETURN void FailUninitialized - - } // namespace - --#if PERFETTO_HAS_NO_DESTROY() - // static - PERFETTO_NO_DESTROY TracingMuxerFake::FakePlatform - TracingMuxerFake::FakePlatform::instance{}; - // static - PERFETTO_NO_DESTROY TracingMuxerFake TracingMuxerFake::instance{}; --#endif // PERFETTO_HAS_NO_DESTROY() - - TracingMuxerFake::~TracingMuxerFake() = default; - diff --git a/pickle_traits-kIndexSequence-constexpr-initializer.patch b/pickle_traits-kIndexSequence-constexpr-initializer.patch new file mode 100644 index 0000000..4811040 --- /dev/null +++ b/pickle_traits-kIndexSequence-constexpr-initializer.patch @@ -0,0 +1,11 @@ +--- src/net/base/pickle_traits.h.orig 2025-08-15 17:32:28.209405309 +0200 ++++ src/net/base/pickle_traits.h 2025-08-15 23:39:04.010398326 +0200 +@@ -563,7 +563,7 @@ struct PickleTraits { + } + + static constexpr std::make_index_sequence> +- kIndexSequence; ++ kIndexSequence {}; + }; + + // bool is treated specially by base::Pickle. diff --git a/picture_in_picture_events_info-string-constexpr.patch b/picture_in_picture_events_info-string-constexpr.patch new file mode 100644 index 0000000..74f1a5f --- /dev/null +++ b/picture_in_picture_events_info-string-constexpr.patch @@ -0,0 +1,19 @@ +--- src/media/base/picture_in_picture_events_info.cc.orig 2025-08-15 17:32:27.805405385 +0200 ++++ src/media/base/picture_in_picture_events_info.cc 2025-08-16 10:13:19.526480207 +0200 +@@ -5,6 +5,7 @@ + #include "media/base/picture_in_picture_events_info.h" + + #include ++#include + + #include "base/notreached.h" + #include "base/strings/stringprintf.h" +@@ -34,7 +35,7 @@ std::string PictureInPictureEventsInfo:: + // static + std::string PictureInPictureEventsInfo::AutoPipInfoToString( + AutoPipInfo auto_pip_info) { +- constexpr std::array bool_to_string{"false", "true"}; ++ constexpr std::array bool_to_string{"false", "true"}; + return base::StringPrintf( + "{reason: %s, has audio focus: %s, is_playing: %s, was recently audible: " + "%s, has safe url: %s, meets media engagement conditions: %s, blocked " diff --git a/picture_in_picture_window_manager_uma_helper-missing-optional.patch b/picture_in_picture_window_manager_uma_helper-missing-optional.patch deleted file mode 100644 index a94461d..0000000 --- a/picture_in_picture_window_manager_uma_helper-missing-optional.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 1e7508ce083f6c7e43011f899faf10537a6379e2 Mon Sep 17 00:00:00 2001 -From: Ivan Murashov -Date: Thu, 20 Feb 2025 10:37:19 -0800 -Subject: [PATCH] IWYU: Add missing include for std::optional usage in - picture_in_picture_window_manager_uma_helper.h - -In the CL https://crrev.com/c/6191230 used std::optional in the -chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h, -but corresponding include was missed. -Added missing include for std::optional usage. - -Bug: 41455655 -Change-Id: I70f67c4a06481875d4602b16a97532cdad2a63b0 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6275068 -Reviewed-by: Vasilii Sukhanov -Commit-Queue: Ivan Murashov -Reviewed-by: Tommy Steimel -Cr-Commit-Position: refs/heads/main@{#1422669} ---- - .../picture_in_picture_window_manager_uma_helper.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h b/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h -index cb826fc5a20598..866670224c8a38 100644 ---- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h -+++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager_uma_helper.h -@@ -5,6 +5,8 @@ - #ifndef CHROME_BROWSER_PICTURE_IN_PICTURE_PICTURE_IN_PICTURE_WINDOW_MANAGER_UMA_HELPER_H_ - #define CHROME_BROWSER_PICTURE_IN_PICTURE_PICTURE_IN_PICTURE_WINDOW_MANAGER_UMA_HELPER_H_ - -+#include -+ - #include "base/memory/raw_ptr.h" - #include "base/time/clock.h" - #include "base/time/time.h" diff --git a/plugin_utils-build-without-electron_extensions.patch b/plugin_utils-build-without-electron_extensions.patch deleted file mode 100644 index b54e491..0000000 --- a/plugin_utils-build-without-electron_extensions.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- src/electron/shell/browser/plugins/plugin_utils.cc.orig 2025-04-16 14:34:09.220241915 +0200 -+++ src/electron/shell/browser/plugins/plugin_utils.cc 2025-04-18 21:59:05.472058588 +0200 -@@ -33,6 +33,8 @@ std::string PluginUtils::GetExtensionIdF - base::flat_map - PluginUtils::GetMimeTypeToExtensionIdMap( - content::BrowserContext* browser_context) { -+ base::flat_map mime_type_to_extension_id_map; -+ - #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) - const auto& allowed_extension_ids = MimeTypesHandler::GetMIMETypeAllowlist(); - if (allowed_extension_ids.empty()) -@@ -41,8 +43,6 @@ PluginUtils::GetMimeTypeToExtensionIdMap - const extensions::ExtensionSet& enabled_extensions = - extensions::ExtensionRegistry::Get(browser_context)->enabled_extensions(); - -- base::flat_map mime_type_to_extension_id_map; -- - // Go through the white-listed extensions and try to use them to intercept - // the URL request. - for (const std::string& id : allowed_extension_ids) { diff --git a/private_aggregation_host-uint128.patch b/private_aggregation_host-uint128.patch index a6c0f37..b9396b7 100644 --- a/private_aggregation_host-uint128.patch +++ b/private_aggregation_host-uint128.patch @@ -21,17 +21,17 @@ In file included from /usr/include/c++/14/string:49, 143 | absl::uint128 bucket; | ^~~~~~ ---- src/content/browser/private_aggregation/private_aggregation_pending_contributions.h.orig 2025-04-16 14:36:28.649070859 +0200 -+++ src/content/browser/private_aggregation/private_aggregation_pending_contributions.h 2025-04-17 16:33:05.731832452 +0200 -@@ -11,7 +11,6 @@ - #include - +--- src/content/browser/private_aggregation/private_aggregation_pending_contributions.h.orig 2025-08-15 17:32:26.465405636 +0200 ++++ src/content/browser/private_aggregation/private_aggregation_pending_contributions.h 2025-08-16 09:29:24.094983368 +0200 +@@ -18,7 +18,6 @@ + #include "base/numerics/safe_conversions.h" + #include "content/browser/private_aggregation/private_aggregation_budgeter.h" #include "content/common/content_export.h" -#include "third_party/abseil-cpp/absl/numeric/int128.h" - #include "third_party/abseil-cpp/absl/types/variant.h" #include "third_party/blink/public/mojom/aggregation_service/aggregatable_report.mojom.h" + #include "third_party/blink/public/mojom/private_aggregation/private_aggregation_host.mojom.h" -@@ -41,7 +40,7 @@ class CONTENT_EXPORT PrivateAggregationP +@@ -53,7 +52,7 @@ class CONTENT_EXPORT PrivateAggregationP auto operator<=>(const ContributionMergeKey& a) const = default; diff --git a/python3.14-nodedownload-FancyURLopener.patch b/python3.14-nodedownload-FancyURLopener.patch deleted file mode 100644 index 062caf8..0000000 --- a/python3.14-nodedownload-FancyURLopener.patch +++ /dev/null @@ -1,58 +0,0 @@ -From dfcb824ae3e7752abf3c809a3f226cb21dd2187a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= - -Date: Sun, 22 Jun 2025 07:49:14 +0200 -Subject: [PATCH] tools: make nodedownload module compatible with Python 3.14 - -FancyURLopener and URLopener have been deprecated since -Python 3.3 and they are removed completely from 3.14. - -Fixes: https://github.com/nodejs/node/issues/58740 -PR-URL: https://github.com/nodejs/node/pull/58752 -Reviewed-By: Luigi Pinca -Reviewed-By: Yagiz Nizipli -Reviewed-By: James M Snell ---- - tools/configure.d/nodedownload.py | 15 +++++---------- - 1 file changed, 5 insertions(+), 10 deletions(-) - -diff --git a/tools/configure.d/nodedownload.py b/tools/configure.d/nodedownload.py -index 4f144e0e4b406c..0d65c33606b853 100644 ---- a/third_party/electron_node/tools/configure.d/nodedownload.py -+++ b/third_party/electron_node/tools/configure.d/nodedownload.py -@@ -7,10 +7,7 @@ - import zipfile - import tarfile - import contextlib --try: -- from urllib.request import FancyURLopener, URLopener --except ImportError: -- from urllib import FancyURLopener, URLopener -+from urllib.request import build_opener, install_opener, urlretrieve - - def formatSize(amt): - """Format a size as a string in MB""" -@@ -21,11 +18,6 @@ def spin(c): - spin = ".:|'" - return (spin[c % len(spin)]) - --class ConfigOpener(FancyURLopener): -- """fancy opener used by retrievefile. Set a UA""" -- # append to existing version (UA) -- version = '%s node.js/configure' % URLopener.version -- - def reporthook(count, size, total): - """internal hook used by retrievefile""" - sys.stdout.write(' Fetch: %c %sMB total, %sMB downloaded \r' % -@@ -38,7 +30,10 @@ def retrievefile(url, targetfile): - try: - sys.stdout.write(' <%s>\nConnecting...\r' % url) - sys.stdout.flush() -- ConfigOpener().retrieve(url, targetfile, reporthook=reporthook) -+ opener = build_opener() -+ opener.addheaders = [('User-agent', f'Python-urllib/{sys.version_info.major}.{sys.version_info.minor} node.js/configure')] -+ install_opener(opener) -+ urlretrieve(url, targetfile, reporthook=reporthook) - print('') # clear the line - return targetfile - except IOError as err: diff --git a/raw_ptr-fpermissive.patch b/raw_ptr-fpermissive.patch deleted file mode 100644 index 1aa4c34..0000000 --- a/raw_ptr-fpermissive.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f12e128221d2011c57448032d67309da94f55dde Mon Sep 17 00:00:00 2001 -From: Marshall Greenblatt -Date: Thu, 13 Feb 2025 17:47:09 -0800 -Subject: [PATCH] Fix extra qualification on member 'basic_common_reference' - -Fixes the following errors when building on Windows with -use_custom_libcxx=false. - -In file included from ../..\base/memory/raw_ptr.h:11: -../../base/allocator/partition_allocator/src\partition_alloc/pointers/raw_ptr.h(1274,13): error: extra qualification on member 'basic_common_reference' [-Werror,-Wextra-qualification] - 1274 | struct std::basic_common_reference, T*, TQ, UQ> { - | ^ -../../base/allocator/partition_allocator/src\partition_alloc/pointers/raw_ptr.h(1284,13): error: extra qualification on member 'basic_common_reference' [-Werror,-Wextra-qualification] - 1284 | struct std::basic_common_reference, TQ, UQ> { - | ^ -2 errors generated. - -Change-Id: I86f92b206fdcba8d0e820c7a625e1c28518f02a0 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6265643 -Commit-Queue: Peter Kasting -Reviewed-by: Peter Kasting -Cr-Commit-Position: refs/heads/main@{#1420246} ---- - .../src/partition_alloc/pointers/raw_ptr.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h -index c3ac11523410fb..2a3d3bc4d1f342 100644 ---- a/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h -+++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h -@@ -1271,7 +1271,7 @@ template - typename UQ> --struct std::basic_common_reference, T*, TQ, UQ> { -+struct basic_common_reference, T*, TQ, UQ> { - using type = T*; - }; - -@@ -1281,7 +1281,7 @@ template - typename UQ> --struct std::basic_common_reference, TQ, UQ> { -+struct basic_common_reference, TQ, UQ> { - using type = T*; - }; - diff --git a/reduce-gn-tree.patch b/reduce-gn-tree.patch index bd7a2aa..4a6afd7 100644 --- a/reduce-gn-tree.patch +++ b/reduce-gn-tree.patch @@ -1,14 +1,14 @@ Run gn starting at only the targets we want to build (//electron:blah), not at (//...) to avoid hitting asserts in dead code. This makes this overriden build argument dead code which causes a warning during `gen` and more importantly `desc`. Remove it. ---- src/electron/build/args/all.gn 2025-05-22 20:03:50.586242102 +0200 -+++ src/electron/build/args/all.gn 2025-05-22 21:32:07.485697337 +0200 +--- src/electron/build/args/all.gn.orig 2025-07-19 11:30:22.309996384 +0200 ++++ src/electron/build/args/all.gn 2025-07-19 16:27:55.565670609 +0200 @@ -1,5 +1,4 @@ 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 = 133 + node_module_version = 136 All gn list calls must be also fixed because otherwise they fail just as gn gen does diff --git a/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch b/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch index 8ff1837..da14645 100644 --- a/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch +++ b/remove-ai-language-detection-factory-which-requires-tflite-and-libphonenumber.patch @@ -1,96 +1,60 @@ ---- src/third_party/blink/renderer/modules/ai/ai.cc.orig 2025-04-16 14:36:32.771242661 +0200 -+++ src/third_party/blink/renderer/modules/ai/ai.cc 2025-04-17 16:44:52.883833032 +0200 -@@ -30,7 +30,6 @@ void AI::Trace(Visitor* visitor) const { - visitor->Trace(ai_summarizer_factory_); - visitor->Trace(ai_writer_factory_); - visitor->Trace(ai_rewriter_factory_); -- visitor->Trace(ai_language_detector_factory_); - visitor->Trace(ai_translator_factory_); - } - -@@ -78,15 +77,6 @@ AIRewriterFactory* AI::rewriter() { - return ai_rewriter_factory_.Get(); - } - --AILanguageDetectorFactory* AI::languageDetector() { -- if (!ai_language_detector_factory_) { -- ai_language_detector_factory_ = -- MakeGarbageCollected(GetExecutionContext(), -- task_runner_); -- } -- return ai_language_detector_factory_.Get(); --} -- - AITranslatorFactory* AI::translator() { - if (!ai_translator_factory_) { - ai_translator_factory_ = ---- src/third_party/blink/renderer/modules/ai/ai.h.orig 2025-04-16 14:36:32.771242661 +0200 -+++ src/third_party/blink/renderer/modules/ai/ai.h 2025-04-17 16:45:08.367832844 +0200 -@@ -10,7 +10,6 @@ - #include "third_party/blink/public/mojom/ai/ai_manager.mojom-blink.h" - #include "third_party/blink/renderer/core/execution_context/execution_context.h" - #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" --#include "third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector_factory.h" - #include "third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.h" - #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" - #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" -@@ -37,7 +36,6 @@ class AI final : public ScriptWrappable, - AISummarizerFactory* summarizer(); - AIRewriterFactory* rewriter(); - AIWriterFactory* writer(); -- AILanguageDetectorFactory* languageDetector(); - AITranslatorFactory* translator(); - - HeapMojoRemote& GetAIRemote(); -@@ -51,7 +49,6 @@ class AI final : public ScriptWrappable, - Member ai_summarizer_factory_; - Member ai_writer_factory_; - Member ai_rewriter_factory_; -- Member ai_language_detector_factory_; - Member ai_translator_factory_; - }; - ---- src/third_party/blink/renderer/modules/ai/ai.idl 2025-04-16 14:36:32.771242661 +0200 -+++ src/third_party/blink/renderer/modules/ai/ai.idl 2025-04-18 13:52:33.485440478 +0200 -@@ -40,11 +40,6 @@ interface AI { - readonly attribute AIRewriterFactory rewriter; - - [ -- RuntimeEnabled=LanguageDetectionAPI -- ] -- readonly attribute AILanguageDetectorFactory languageDetector; -- -- [ - RuntimeEnabled=TranslationAPI - ] - readonly attribute AITranslatorFactory translator; ---- src/third_party/blink/renderer/modules/ai/BUILD.gn 2025-04-16 14:36:32.771172881 +0200 -+++ src/third_party/blink/renderer/modules/ai/BUILD.gn 2025-04-18 21:41:05.606552171 +0200 -@@ -41,16 +41,8 @@ blink_modules_sources("ai") { +--- src/third_party/blink/renderer/modules/ai/BUILD.gn.orig 2025-08-15 17:32:29.337405097 +0200 ++++ src/third_party/blink/renderer/modules/ai/BUILD.gn 2025-08-16 17:57:26.885671869 +0200 +@@ -7,45 +7,19 @@ import("//third_party/blink/renderer/mod + blink_modules_sources("ai") { + sources = [ + "ai_context_observer.h", +- "ai_interface_proxy.cc", +- "ai_interface_proxy.h", + "ai_metrics.cc", + "ai_metrics.h", +- "ai_utils.cc", +- "ai_utils.h", + "ai_writing_assistance_base.h", + "ai_writing_assistance_create_client.h", + "availability.cc", + "availability.h", +- "create_monitor.cc", +- "create_monitor.h", + "exception_helpers.cc", "exception_helpers.h", +- "language_model.cc", +- "language_model.h", +- "language_model_create_client.cc", +- "language_model_create_client.h", + "language_model_params.cc", + "language_model_params.h", +- "language_model_prompt_builder.cc", +- "language_model_prompt_builder.h", "model_execution_responder.cc", "model_execution_responder.h", -- "on_device_translation/ai_language_detector.cc", -- "on_device_translation/ai_language_detector.h", -- "on_device_translation/ai_language_detector_capabilities.cc", -- "on_device_translation/ai_language_detector_capabilities.h", -- "on_device_translation/ai_language_detector_factory.cc", -- "on_device_translation/ai_language_detector_factory.h", - "on_device_translation/ai_translator.cc", - "on_device_translation/ai_translator.h", -- "on_device_translation/ai_translator_capabilities.cc", -- "on_device_translation/ai_translator_capabilities.h", - "on_device_translation/ai_translator_factory.cc", - "on_device_translation/ai_translator_factory.h", +- "on_device_translation/create_translator_client.cc", +- "on_device_translation/create_translator_client.h", +- "on_device_translation/language_detector.cc", +- "on_device_translation/language_detector.h", + "on_device_translation/resolver_with_abort_signal.h", +- "on_device_translation/translator.cc", +- "on_device_translation/translator.h", +- "proofreader.cc", +- "proofreader.h", +- "rewriter.cc", +- "rewriter.h", +- "summarizer.cc", +- "summarizer.h", +- "writer.cc", +- "writer.h", ] -@@ -60,7 +52,5 @@ blink_modules_sources("ai") { + + public_deps = [ "//third_party/blink/public/mojom:mojom_modules_blink" ] +@@ -53,8 +27,6 @@ blink_modules_sources("ai") { deps = [ "//components/language_detection/content/common", "//components/language_detection/content/common:common_blink", - "//components/language_detection/content/renderer", - "//components/language_detection/core", + "//third_party/blink/renderer/modules/canvas", + "//third_party/blink/renderer/modules/webaudio", ] - } --- src/third_party/blink/renderer/platform/BUILD.gn.orig 2025-04-12 14:33:45.435739667 +0200 +++ src/third_party/blink/renderer/platform/BUILD.gn 2025-04-12 15:58:59.809440918 +0200 @@ -1239,8 +1239,6 @@ component("platform") { @@ -124,136 +88,227 @@ "//third_party/metrics_proto", "//url", ] ---- src/third_party/blink/renderer/modules/BUILD.gn 2025-04-16 14:36:32.763311004 +0200 -+++ src/third_party/blink/renderer/modules/BUILD.gn 2025-04-18 14:17:17.869441496 +0200 -@@ -128,7 +128,6 @@ component("modules") { - "//third_party/blink/renderer/modules/netinfo", - "//third_party/blink/renderer/modules/nfc", - "//third_party/blink/renderer/modules/notifications", -- "//third_party/blink/renderer/modules/on_device_translation", - "//third_party/blink/renderer/modules/payments", - "//third_party/blink/renderer/modules/payments/goods", - "//third_party/blink/renderer/modules/peerconnection", ---- src/third_party/blink/renderer/bindings/idl_in_modules.gni 2025-04-16 14:36:32.335223804 +0200 -+++ src/third_party/blink/renderer/bindings/idl_in_modules.gni 2025-04-18 21:39:21.064884303 +0200 -@@ -28,12 +28,8 @@ static_idl_files_in_modules = [ - "//third_party/blink/renderer/modules/ai/ai_summarizer_factory.idl", - "//third_party/blink/renderer/modules/ai/ai_writer.idl", - "//third_party/blink/renderer/modules/ai/ai_writer_factory.idl", -- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector.idl", -- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector_factory.idl", -- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_language_detector_capabilities.idl", - "//third_party/blink/renderer/modules/ai/on_device_translation/ai_translator.idl", - "//third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.idl", -- "//third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_capabilities.idl", - "//third_party/blink/renderer/modules/ai/window_or_worker_global_scope_ai.idl", +--- src/third_party/blink/renderer/bindings/idl_in_modules.gni.orig 2025-08-15 17:32:29.049405150 +0200 ++++ src/third_party/blink/renderer/bindings/idl_in_modules.gni 2025-08-16 14:55:26.743869183 +0200 +@@ -19,15 +19,8 @@ static_idl_files_in_modules = [ + "//third_party/blink/renderer/modules/ad_auction/storage_interest_group.idl", + "//third_party/blink/renderer/modules/ai/availability.idl", + "//third_party/blink/renderer/modules/ai/create_monitor.idl", +- "//third_party/blink/renderer/modules/ai/language_model.idl", + "//third_party/blink/renderer/modules/ai/language_model_create_options.idl", + "//third_party/blink/renderer/modules/ai/language_model_params.idl", +- "//third_party/blink/renderer/modules/ai/on_device_translation/language_detector.idl", +- "//third_party/blink/renderer/modules/ai/on_device_translation/translator.idl", +- "//third_party/blink/renderer/modules/ai/proofreader.idl", +- "//third_party/blink/renderer/modules/ai/rewriter.idl", +- "//third_party/blink/renderer/modules/ai/summarizer.idl", +- "//third_party/blink/renderer/modules/ai/writer.idl", "//third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope.idl", "//third_party/blink/renderer/modules/animationworklet/css_animation_worklet.idl", -@@ -542,10 +538,6 @@ static_idl_files_in_modules = [ - "//third_party/blink/renderer/modules/notifications/service_worker_global_scope_notifications.idl", - "//third_party/blink/renderer/modules/notifications/service_worker_registration_notifications.idl", - "//third_party/blink/renderer/modules/notifications/timestamp_trigger.idl", -- "//third_party/blink/renderer/modules/on_device_translation/language_translator.idl", -- "//third_party/blink/renderer/modules/on_device_translation/translation_language_options.idl", -- "//third_party/blink/renderer/modules/on_device_translation/translation.idl", -- "//third_party/blink/renderer/modules/on_device_translation/window_or_worker_global_scope_translation.idl", - "//third_party/blink/renderer/modules/payments/abort_payment_event.idl", - "//third_party/blink/renderer/modules/payments/address_errors.idl", - "//third_party/blink/renderer/modules/payments/address_init.idl", ---- src/third_party/blink/renderer/bindings/generated_in_modules.gni 2025-04-16 14:36:32.335223804 +0200 -+++ src/third_party/blink/renderer/bindings/generated_in_modules.gni 2025-04-18 15:55:02.121445718 +0200 -@@ -148,10 +148,6 @@ generated_dictionary_sources_in_modules - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_initial_prompt.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_prompt_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_prompt_options.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_create_options.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_create_options.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_detect_options.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_detect_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_rewrite_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_rewrite_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_create_core_options.cc", -@@ -728,8 +724,6 @@ generated_dictionary_sources_in_modules + "//third_party/blink/renderer/modules/animationworklet/worklet_animation.idl", +--- src/third_party/blink/renderer/bindings/generated_in_modules.gni.orig 2025-08-15 17:32:29.049405150 +0200 ++++ src/third_party/blink/renderer/bindings/generated_in_modules.gni 2025-08-16 15:26:16.723512975 +0200 +@@ -682,18 +682,6 @@ generated_dictionary_sources_in_modules "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_key_system_track_configuration.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_landmark.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_landmark.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detection_result.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detection_result.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector_create_core_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector_create_core_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector_create_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector_detect_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector_detect_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_append_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_append_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_clone_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_clone_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_create_core_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_create_core_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_create_options.cc", +@@ -704,8 +692,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_message.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_message_content.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_message_content.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_prompt_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_prompt_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_lock_info.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_lock_info.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_lock_manager_snapshot.cc", -@@ -922,8 +916,6 @@ generated_dictionary_sources_in_modules - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_triangular_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_where_support_limits.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ml_where_support_limits.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_language_options.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_language_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_multi_cache_query_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_multi_cache_query_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_navigation_preload_state.cc", -@@ -1552,8 +1544,6 @@ generated_enumeration_sources_in_modules - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gamepad_haptics_result.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gamepad_mapping_type.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gamepad_mapping_type.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_availability.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation_availability.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_address_mode.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_address_mode.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_gpu_auto_layout_mode.cc", -@@ -1956,12 +1946,6 @@ generated_interface_sources_in_modules = - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_model_factory.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_create_monitor.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_create_monitor.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_capabilities.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_capabilities.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_factory.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector_factory.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_language_detector.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_factory.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_factory.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter.cc", -@@ -1972,8 +1956,6 @@ generated_interface_sources_in_modules = - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_summarizer_factory.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_summarizer.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_summarizer.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_capabilities.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_capabilities.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_factory.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator_factory.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_ai_translator.cc", -@@ -2466,8 +2448,6 @@ generated_interface_sources_in_modules = +@@ -1008,14 +994,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution_network.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofreader_create_core_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofreader_create_core_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofreader_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofreader_create_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofread_correction.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofread_correction.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofread_result.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofread_result.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_protected_audience_private_aggregation_config.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_protected_audience_private_aggregation_config.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_public_key_credential_creation_options.cc", +@@ -1064,12 +1042,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_remote_desktop_client_override.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_request_device_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_request_device_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_rewrite_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_rewrite_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_create_core_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_create_core_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_create_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_router_condition.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_router_condition.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_router_rule.cc", +@@ -1278,12 +1250,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_sub_apps_list_result.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_subsample_entry.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_subsample_entry.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_create_core_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_create_core_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_create_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_summarize_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_summarize_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_svc_output_metadata.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_svc_output_metadata.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_sync_event_init.cc", +@@ -1296,12 +1262,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_text_encoder_encode_into_result.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_top_level_storage_access_permission_descriptor.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_top_level_storage_access_permission_descriptor.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator_create_core_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator_create_core_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator_create_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator_translate_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator_translate_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_usb_connection_event_init.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_usb_connection_event_init.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_usb_control_transfer_parameters.cc", +@@ -1380,12 +1340,6 @@ generated_dictionary_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_websocket_stream_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_write_params.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_write_params.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_write_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_write_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_create_core_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_create_core_options.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_create_options.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_create_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_depth_state_init.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_depth_state_init.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_dom_overlay_init.cc", +@@ -1772,8 +1726,6 @@ generated_enumeration_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_presentation_connection_state.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution_event.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution_event.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_correction_type.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_correction_type.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_push_encryption_key_name.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_push_encryption_key_name.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_recording_state.cc", +@@ -1782,12 +1734,6 @@ generated_enumeration_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_red_eye_reduction.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_remote_playback_state.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_remote_playback_state.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_format.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_format.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_length.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_length.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_tone.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter_tone.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_router_source_enum.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_router_source_enum.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_bundle_policy.cc", +@@ -1868,12 +1814,6 @@ generated_enumeration_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_storage_bucket_durability.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_sub_apps_result_code.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_sub_apps_result_code.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_format.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_format.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_length.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_length.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_type.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer_type.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_display_media_include_or_exclude.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_display_media_include_or_exclude.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_type.cc", +@@ -1912,12 +1852,6 @@ generated_enumeration_sources_in_modules + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_well_known_directory.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_write_command_type.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_write_command_type.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_format.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_format.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_length.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_length.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_tone.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer_tone.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_depth_data_format.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_depth_data_format.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_depth_type.cc", +@@ -2464,12 +2398,8 @@ generated_interface_sources_in_modules = "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_keyboard_layout_map.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_khr_parallel_shader_compile.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_khr_parallel_shader_compile.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_translator.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_translator.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_detector.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_params.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model_params.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_language_model.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_launch_params.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_launch_params.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_launch_queue.cc", -@@ -2924,8 +2904,6 @@ generated_interface_sources_in_modules = +@@ -2708,8 +2638,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_aggregation.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_private_attribution.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofreader.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_proofreader.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_protected_audience.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_protected_audience.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_public_key_credential.cc", +@@ -2732,8 +2660,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_remote_playback.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_restriction_target.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_restriction_target.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rewriter.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_certificate.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_certificate.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_data_channel.cc", +@@ -2902,8 +2828,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_sub_apps.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_subtle_crypto.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_subtle_crypto.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_summarizer.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_svg_element.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_svg_element.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_sync_event.cc", +@@ -2926,8 +2850,6 @@ generated_interface_sources_in_modules = "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_track_default_list.h", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.cc", -- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translation.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_translator.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_url.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_usb.cc", ---- src/third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.idl 2025-04-16 14:36:32.773113846 +0200 -+++ src/third_party/blink/renderer/modules/ai/on_device_translation/ai_translator_factory.idl 2025-04-18 21:45:18.481187932 +0200 -@@ -11,11 +11,6 @@ interface AITranslatorFactory { - ] - Promise create(AITranslatorCreateOptions options); - // TODO(crbug.com/390459310): Replace with availability. -- [ -- CallWith=ScriptState, -- RaisesException -- ] -- Promise capabilities(); - }; - - dictionary AITranslatorCreateCoreOptions { +@@ -3100,8 +3022,6 @@ generated_interface_sources_in_modules = + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_worklet_animation_effect.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_worklet_group_effect.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_worklet_group_effect.h", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer.cc", +- "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_writer.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_anchor.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_anchor.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_xr_anchor_set.cc", --- src/content/public/browser/content_browser_client.cc 2025-04-17 16:18:19.395831947 +0200 +++ src/content/public/browser/content_browser_client.cc 2025-04-18 22:48:04.297289260 +0200 @@ -1882,15 +1882,6 @@ GetContentLanguageDetectionDriver() { @@ -272,9 +327,9 @@ #if !BUILDFLAG(IS_ANDROID) void ContentBrowserClient::QueryInstalledWebAppsByManifestId( ---- src/content/browser/browser_interface_binders.cc 2025-04-16 14:36:28.520070884 +0200 -+++ src/content/browser/browser_interface_binders.cc 2025-04-18 23:10:18.079235856 +0200 -@@ -1156,19 +1164,6 @@ void PopulateFrameBinders(RenderFrameHos +--- src/content/browser/browser_interface_binders.cc.orig 2025-07-20 14:51:05.789212478 +0200 ++++ src/content/browser/browser_interface_binders.cc 2025-08-15 20:15:02.320284607 +0200 +@@ -1161,19 +1161,6 @@ void PopulateFrameBinders(RenderFrameHos base::Unretained(host))); } @@ -294,7 +349,7 @@ } void PopulateBinderMapWithContext( -@@ -1446,19 +1443,6 @@ void PopulateDedicatedWorkerBinders(Dedi +@@ -1465,19 +1452,6 @@ void PopulateDedicatedWorkerBinders(Dedi }, base::Unretained(host))); } @@ -314,7 +369,7 @@ } void PopulateBinderMapWithContext( -@@ -1549,19 +1533,6 @@ void PopulateSharedWorkerBinders(SharedW +@@ -1575,19 +1549,6 @@ void PopulateSharedWorkerBinders(SharedW }, base::Unretained(host))); } @@ -332,9 +387,9 @@ - base::Unretained(host))); - } - // RenderProcessHost binders - map->Add(BindWorkerReceiver( -@@ -1704,22 +1675,6 @@ void PopulateServiceWorkerBinders(Servic + #if !BUILDFLAG(IS_ANDROID) + map->Add(base::BindRepeating( +@@ -1753,22 +1714,6 @@ void PopulateServiceWorkerBinders(Servic }, base::Unretained(host))); } diff --git a/remove-date-reproducible-builds.patch b/remove-date-reproducible-builds.patch index ff76370..eead439 100644 --- a/remove-date-reproducible-builds.patch +++ b/remove-date-reproducible-builds.patch @@ -12,18 +12,18 @@ GENERATED_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITION IN // %s // by tools/json_schema_compiler. ---- a/tools/json_to_struct/json_to_struct.py -+++ b/tools/json_to_struct/json_to_struct.py -@@ -74,7 +74,7 @@ - import java_element_generator +--- src/tools/json_to_struct/json_to_struct.py.orig 2025-07-19 11:32:45.069979393 +0200 ++++ src/tools/json_to_struct/json_to_struct.py 2025-08-15 15:02:55.044700914 +0200 +@@ -84,7 +84,7 @@ import java_element_generator import struct_generator + -HEAD = u"""// Copyright %d The Chromium Authors +HEAD = u"""// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@@ -227,7 +227,7 @@ +@@ -316,7 +316,7 @@ def GenerateStruct(basepath, output_root year: Year to display next to the copy-right in the header. """ year = int(year) if year else datetime.now().year diff --git a/remove-password-manager-and-policy.patch b/remove-password-manager-and-policy.patch index 71f9b89..097a3c4 100644 --- a/remove-password-manager-and-policy.patch +++ b/remove-password-manager-and-policy.patch @@ -1,12 +1,13 @@ --- src/components/browsing_data/core/BUILD.gn.old +++ src/components/browsing_data/core/BUILD.gn -@@ -36,9 +36,7 @@ static_library("core") { +@@ -36,10 +36,7 @@ static_library("core") { deps = [ "//base", "//components/autofill/core/browser", - "//components/bookmarks/browser", "//components/history/core/browser", - "//components/password_manager/core/browser", +- "//components/password_manager/core/browser/features:password_features", "//components/pref_registry", "//components/prefs", "//components/strings", @@ -18,8 +19,8 @@ "//components/sync/nigori", - "//components/sync/service", ] - if (is_chromeos) { - public_deps += [ "//components/sync/chromeos" ] + } + --- src/components/permissions/prediction_service/BUILD.gn.old +++ src/components/permissions/prediction_service/BUILD.gn @@ -31,8 +31,6 @@ source_set("prediction_service") { @@ -31,21 +32,34 @@ ] if (build_with_tflite_lib) { ---- src/components/embedder_support/BUILD.gn.old -+++ src/components/embedder_support/BUILD.gn -@@ -24,12 +24,8 @@ static_library("browser_util") { +--- src/components/embedder_support/BUILD.gn.orig 2025-07-19 11:32:33.129979749 +0200 ++++ src/components/embedder_support/BUILD.gn 2025-08-13 11:51:36.828843854 +0200 +@@ -19,9 +19,7 @@ static_library("content_settings") { + ] + deps = [ - ":embedder_support", - "//build:branding_buildflags", -- "//components/background_sync", - "//components/content_settings/browser", "//components/content_settings/core/browser", - "//components/content_settings/core/browser:cookie_settings", + "//content/public/browser", + "//net", + "//third_party/blink/public/mojom:mojom_platform_headers", +@@ -36,7 +34,6 @@ static_library("permissions") { + ] + + deps = [ +- "//components/background_sync", "//components/permissions", + "//device/vr/buildflags", + "//services/device/public/cpp:device_features", +@@ -58,7 +55,6 @@ static_library("user_agent") { + ":embedder_support", + "//build:branding_buildflags", + "//build/util:chromium_git_revision", - "//components/policy/core/common", "//components/prefs", "//components/version_info", - "//content/public/browser", + "//net", --- src/components/permissions/BUILD.gn.orig 2025-04-11 12:05:19.206024144 +0200 +++ src/components/permissions/BUILD.gn 2025-04-11 20:04:52.832323166 +0200 @@ -119,10 +119,7 @@ source_set("permissions") { @@ -82,15 +96,6 @@ "proxy_policy_handler.h", --- src/components/content_settings/core/browser/BUILD.gn.orig +++ src/components/content_settings/core/browser/BUILD.gn -@@ -69,7 +69,7 @@ static_library("browser") { - "//url", - ] - -- if (!is_ios) { -+ if (false) { - sources += [ - "insecure_private_network_policy_handler.cc", - "insecure_private_network_policy_handler.h", @@ -78,8 +78,6 @@ static_library("browser") { if (use_blink) { @@ -146,9 +151,9 @@ "//device/vr/buildflags", ] } ---- src/components/search_engines/BUILD.gn.orig 2025-04-11 12:05:19.397475381 +0200 -+++ src/components/search_engines/BUILD.gn 2025-04-11 20:05:37.960311107 +0200 -@@ -12,49 +12,21 @@ if (is_android) { +--- src/components/search_engines/BUILD.gn.orig 2025-07-19 11:32:33.625979784 +0200 ++++ src/components/search_engines/BUILD.gn 2025-08-13 11:58:08.964717036 +0200 +@@ -12,50 +12,20 @@ if (is_android) { static_library("search_engines") { sources = [ "choice_made_location.h", @@ -156,8 +161,8 @@ - "default_search_manager.h", - "enterprise/default_search_policy_handler.cc", - "enterprise/default_search_policy_handler.h", - "enterprise/enterprise_search_manager.cc", - "enterprise/enterprise_search_manager.h", +- "enterprise/enterprise_search_manager.cc", +- "enterprise/enterprise_search_manager.h", - "keyword_table.cc", - "keyword_table.h", "keyword_web_data_service.cc", @@ -169,7 +174,6 @@ - "search_engine_choice/search_engine_choice_service.h", - "search_engine_choice/search_engine_choice_utils.cc", - "search_engine_choice/search_engine_choice_utils.h", - "search_engines_pref_names.h", - "search_host_to_urls_map.cc", - "search_host_to_urls_map.h", "search_terms_data.cc", @@ -187,6 +191,8 @@ - "template_url_parser.h", - "template_url_prepopulate_data.cc", - "template_url_prepopulate_data.h", + "template_url_prepopulate_data_resolver.cc", + "template_url_prepopulate_data_resolver.h", - "template_url_service.cc", - "template_url_service.h", "template_url_service_client.h", @@ -198,7 +204,7 @@ ] public_deps = [ -@@ -68,7 +46,6 @@ static_library("search_engines") { +@@ -70,7 +42,6 @@ static_library("search_engines") { "//components/sync", "//components/webdata/common", "//third_party/metrics_proto", @@ -206,7 +212,7 @@ "//third_party/search_engines_data:prepopulated_engines", ] -@@ -77,16 +47,10 @@ static_library("search_engines") { +@@ -79,17 +50,11 @@ static_library("search_engines") { "//components/country_codes", "//components/crash/core/common:crash_key", "//components/database_utils", @@ -219,11 +225,12 @@ - "//components/policy/core/browser", "//components/pref_registry", "//components/regional_capabilities", + "//components/regional_capabilities:country_access_reason", - "//components/search_provider_logos:switches", "//components/signin/public/base", "//components/strings", "//components/url_formatter", -@@ -98,7 +62,6 @@ static_library("search_engines") { +@@ -101,7 +66,6 @@ static_library("search_engines") { "//services/network/public/mojom", "//sql", "//third_party/metrics_proto", @@ -231,17 +238,8 @@ "//ui/base", "//ui/gfx", "//ui/gfx/geometry", -@@ -124,7 +87,7 @@ static_library("search_engines") { - ] - } - -- if (!is_android) { -+ if (false) { - sources += [ "search_engine_choice/generated_marketing_snippets.cc" ] - deps += [ - ":generate_search_engine_icons", -@@ -133,7 +96,7 @@ static_library("search_engines") { - ] +@@ -141,7 +105,7 @@ static_library("search_engines") { + } } - if (is_linux || is_win || is_mac || is_chromeos) { diff --git a/remove-probabilistic-token-which-uses-private-join-and-compute.patch b/remove-probabilistic-token-which-uses-private-join-and-compute.patch new file mode 100644 index 0000000..56c2715 --- /dev/null +++ b/remove-probabilistic-token-which-uses-private-join-and-compute.patch @@ -0,0 +1,32 @@ +partially revert https://github.com/chromium/chromium/commit/43410138fb38ff4bdba9720ac57b26434443f761 + +--- src/components/ip_protection/common/BUILD.gn.orig 2025-08-15 17:32:25.445405827 +0200 ++++ src/components/ip_protection/common/BUILD.gn 2025-08-15 20:36:06.954140693 +0200 +@@ -63,7 +63,6 @@ source_set("ip_protection_core_impl") { + public_deps = [ + ":ip_protection_core", + ":ip_protection_data_types", +- ":ip_protection_probabilistic_reveal_token_manager", + ":ip_protection_proxy_config_manager", + ":ip_protection_token_manager", + ":masked_domain_list_manager", +@@ -108,7 +107,6 @@ source_set("ip_protection_core_impl_mojo + ] + deps = [ + ":ip_protection_core_host_remote", +- ":ip_protection_probabilistic_reveal_token_mojo_fetcher", + ":ip_protection_proxy_config_manager_impl", + ":ip_protection_proxy_config_mojo_fetcher", + ":ip_protection_token_manager_impl", +--- src/components/ip_protection/common/ip_protection_core_impl_mojo.cc.orig 2025-08-15 17:32:25.445405827 +0200 ++++ src/components/ip_protection/common/ip_protection_core_impl_mojo.cc 2025-08-16 19:10:17.599046225 +0200 +@@ -81,8 +81,7 @@ IpProtectionCoreImplMojo::IpProtectionCo + std::unique_ptr>(), + probabilistic_reveal_token_registry, + (core_host_remote && +- base::FeatureList::IsEnabled( +- net::features::kEnableProbabilisticRevealTokens)) ++ false) + ? std::make_unique( + std::make_unique< + IpProtectionProbabilisticRevealTokenMojoFetcher>( diff --git a/remove-rust.patch b/remove-rust.patch index 082e88a..6399989 100644 --- a/remove-rust.patch +++ b/remove-rust.patch @@ -21,9 +21,9 @@ Remove this dead code which brings a dependency on rustc # TODO(358041220): There is a circular_dependency of `cookie_controls:impl` module # with "//chrome/browser" due to the inclusion of //c/b/policy/profile_policy_connector.h @@ -1935,7 +1934,6 @@ static_library("browser") { - "//chrome/browser/search_engine_choice", - "//chrome/browser/search_engine_choice:impl", "//chrome/browser/search_engines", + "//chrome/browser/send_tab_to_self", + "//chrome/browser/serial", - "//chrome/browser/share", "//chrome/browser/sharing:buildflags", "//chrome/browser/signin", @@ -61,7 +61,7 @@ Remove this dead code which brings a dependency on rustc - "//components/qr_code_generator:bitmap_generator", "//components/query_parser", "//components/reading_list/core", - "//components/reading_list/features:flags", + "//components/renderer_context_menu", --- src/chrome/test/BUILD.gn.orig 2025-04-11 12:13:12.932314099 +0200 +++ src/chrome/test/BUILD.gn 2025-04-11 19:53:28.092504094 +0200 @@ -2163,7 +2163,6 @@ if (!is_android) { @@ -78,8 +78,8 @@ Remove this dead code which brings a dependency on rustc "//components/proxy_config", - "//components/qr_code_generator:bitmap_generator", "//components/reading_list/core", - "//components/reading_list/features:flags", "//components/resources", + "//components/safe_browsing:buildflags", @@ -6648,7 +6646,6 @@ test("unit_tests") { "//components/privacy_sandbox/privacy_sandbox_attestations:test_support", "//components/privacy_sandbox/privacy_sandbox_attestations/proto:proto", @@ -98,7 +98,7 @@ Remove this dead code which brings a dependency on rustc "//third_party/zlib/google:compression_utils", @@ -8115,8 +8111,6 @@ test("unit_tests") { "//chrome/browser/upgrade_detector:build_state_observer", - "//chrome/browser/user_annotations", + "//chrome/browser/web_applications:features", "//chrome/browser/web_applications:web_applications_test_support", - "//chrome/browser/webauthn:test_support", - "//chrome/browser/webauthn/proto", diff --git a/remove-sync.patch b/remove-sync.patch index 58d67ba..2da8031 100644 --- a/remove-sync.patch +++ b/remove-sync.patch @@ -224,12 +224,11 @@ Inspired by: #include "device/fido/features.h" #include "device/fido/fido_discovery_base.h" #include "device/fido/hid/fido_hid_discovery.h" -@@ -128,12 +127,7 @@ std::vector> FidoDiscoveryFactory::MaybeCreateEnclaveDiscovery() { -- if (!base::FeatureList::IsEnabled(kWebAuthnEnclaveAuthenticator) || -- !enclave_ui_request_stream_ || !network_context_factory_) { +- if (!enclave_ui_request_stream_ || !network_context_factory_) { return std::nullopt; - } - return std::make_unique( @@ -240,9 +239,9 @@ Inspired by: --- src/device/fido/fido_discovery_factory.h.orig +++ src/device/fido/fido_discovery_factory.h @@ -15,7 +15,6 @@ + #include "base/containers/span.h" #include "base/memory/raw_ptr.h" #include "build/build_config.h" - #include "build/chromeos_buildflags.h" -#include "components/sync/protocol/webauthn_credential_specifics.pb.h" #include "device/fido/cable/cable_discovery_data.h" #include "device/fido/cable/v2_constants.h" diff --git a/resource-Wchanges-meaning.patch b/resource-Wchanges-meaning.patch deleted file mode 100644 index 0f3d132..0000000 --- a/resource-Wchanges-meaning.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/third_party/blink/renderer/platform/loader/fetch/resource.h.orig 2025-04-16 14:36:33.086070015 +0200 -+++ src/third_party/blink/renderer/platform/loader/fetch/resource.h 2025-04-16 21:57:27.672717364 +0200 -@@ -363,7 +363,7 @@ class PLATFORM_EXPORT Resource : public - // attributes. - bool ForceIntegrityChecks() const; - -- const IntegrityReport& IntegrityReport() const { return integrity_report_; } -+ const blink::IntegrityReport& IntegrityReport() const { return integrity_report_; } - bool MustRefetchDueToIntegrityMetadata(const FetchParameters&) const; - - bool IsAlive() const { return is_alive_; } diff --git a/resource_response-Wchanges-meaning.patch b/resource_response-Wchanges-meaning.patch deleted file mode 100644 index 4b16a2d..0000000 --- a/resource_response-Wchanges-meaning.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/third_party/blink/renderer/platform/loader/fetch/resource_response.h.orig 2025-04-16 14:36:33.089070014 +0200 -+++ src/third_party/blink/renderer/platform/loader/fetch/resource_response.h 2025-04-16 21:43:33.972794371 +0200 -@@ -174,7 +174,7 @@ class PLATFORM_EXPORT ResourceResponse f - std::optional LastModified(UseCounter&) const; - // Will always return values >= 0. - base::TimeDelta CacheControlStaleWhileRevalidate() const; -- std::optional UnencodedDigest() const; -+ std::optional UnencodedDigest() const; - - unsigned ConnectionID() const; - void SetConnectionID(unsigned); diff --git a/sandboxed_vfs_file_impl-missing-memset.patch b/sandboxed_vfs_file_impl-missing-memset.patch new file mode 100644 index 0000000..d909b54 --- /dev/null +++ b/sandboxed_vfs_file_impl-missing-memset.patch @@ -0,0 +1,11 @@ +--- src/sql/sandboxed_vfs_file_impl.cc.orig 2025-08-15 17:32:28.681405220 +0200 ++++ src/sql/sandboxed_vfs_file_impl.cc 2025-08-15 21:55:09.415178758 +0200 +@@ -9,6 +9,8 @@ + + #include "sql/sandboxed_vfs_file_impl.h" + ++#include ++ + #include "base/notreached.h" + #include "sql/sandboxed_vfs.h" + diff --git a/seccomp_bpf-no-lto.patch b/seccomp_bpf-no-lto.patch index d8e6abe..954e9b6 100644 --- a/seccomp_bpf-no-lto.patch +++ b/seccomp_bpf-no-lto.patch @@ -1,6 +1,6 @@ ---- src/sandbox/linux/BUILD.gn.old 2022-10-12 18:06:31.399406000 +0200 -+++ src/sandbox/linux/BUILD.gn 2022-10-22 11:55:59.621396300 +0200 -@@ -196,6 +196,27 @@ +--- src/sandbox/linux/BUILD.gn.orig 2025-08-15 17:32:28.529405249 +0200 ++++ src/sandbox/linux/BUILD.gn 2025-08-16 19:07:14.523083090 +0200 +@@ -205,6 +205,26 @@ test("sandbox_linux_unittests") { } } @@ -17,7 +17,6 @@ + deps = [ + ":sandbox_services", + "//base", -+ "//build:chromeos_buildflags", + "//sandbox:sandbox_buildflags", + ] + if (gcc_lto) { @@ -28,7 +27,7 @@ component("seccomp_bpf") { sources = [ "bpf_dsl/bpf_dsl.cc", -@@ -227,8 +247,6 @@ +@@ -236,8 +256,6 @@ component("seccomp_bpf") { "seccomp-bpf/die.h", "seccomp-bpf/sandbox_bpf.cc", "seccomp-bpf/sandbox_bpf.h", @@ -37,11 +36,11 @@ "seccomp-bpf/trap.cc", "seccomp-bpf/trap.h", ] -@@ -240,6 +258,7 @@ +@@ -249,6 +267,7 @@ component("seccomp_bpf") { ] deps = [ ":sandbox_services", + ":seccomp_bpf_asm", "//base", - "//build:chromeos_buildflags", "//sandbox:sandbox_buildflags", + ] diff --git a/string-hasher-flax-vector-conversions.patch b/string-hasher-flax-vector-conversions.patch deleted file mode 100644 index 83bf574..0000000 --- a/string-hasher-flax-vector-conversions.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- src/v8/src/strings/string-hasher.cc.orig 2025-04-20 12:05:55.016195134 +0200 -+++ src/v8/src/strings/string-hasher.cc 2025-04-20 12:10:16.788185381 +0200 -@@ -27,7 +27,7 @@ struct ConvertTo8BitHashReader { - __m128i x = _mm_loadu_si128(reinterpret_cast(p)); - return _mm_cvtsi128_si64(_mm_packus_epi16(x, x)); - #elif defined(__ARM_NEON__) -- int16x8_t x; -+ uint16x8_t x; - memcpy(&x, p, sizeof(x)); - return vget_lane_u64(vreinterpret_u64_u8(vmovn_u16(x)), 0); - #else -@@ -48,9 +48,9 @@ struct ConvertTo8BitHashReader { - __m128i x = _mm_loadu_si64(reinterpret_cast(p)); - return _mm_cvtsi128_si64(_mm_packus_epi16(x, x)); - #elif defined(__ARM_NEON__) -- int8x8_t x; -+ uint16x4_t x; - memcpy(&x, p, sizeof(x)); -- int16x8_t x_wide = vcombine_u64(x, x); -+ uint16x8_t x_wide = vcombine_u16(x, x); - return vget_lane_u32(vreinterpret_u32_u8(vmovn_u16(x_wide)), 0); - #else - return (uint64_t{p[0]}) | (uint64_t{p[1]} << 8) | (uint64_t{p[2]} << 16) | diff --git a/string_truncator-convert.patch b/string_truncator-convert.patch deleted file mode 100644 index cb4381e..0000000 --- a/string_truncator-convert.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- src/third_party/blink/renderer/platform/fonts/string_truncator.cc.orig 2025-04-16 14:36:33.038422986 +0200 -+++ src/third_party/blink/renderer/platform/fonts/string_truncator.cc 2025-04-16 22:05:13.224674254 +0200 -@@ -168,7 +168,7 @@ static String TruncateString(const Strin - DCHECK_LT(keep_count, keep_count_for_smallest_known_to_not_fit); - DCHECK_GT(keep_count, keep_count_for_largest_known_to_fit); - -- truncated_string = truncate_to_buffer(string, keep_count, string_buffer); -+ truncated_string = truncate_to_buffer(string, keep_count, base::span(string_buffer)); - - width = StringWidth(font, truncated_string); - if (width <= max_width) { -@@ -185,7 +185,7 @@ static String TruncateString(const Strin - - if (keep_count != keep_count_for_largest_known_to_fit) { - keep_count = keep_count_for_largest_known_to_fit; -- truncated_string = truncate_to_buffer(string, keep_count, string_buffer); -+ truncated_string = truncate_to_buffer(string, keep_count, base::span(string_buffer)); - } - - return String(truncated_string); diff --git a/style_scope-unqualified-To.patch b/style_scope-unqualified-To.patch deleted file mode 100644 index 0682572..0000000 --- a/style_scope-unqualified-To.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/third_party/blink/renderer/core/css/style_scope.cc 2025-04-16 14:36:32.429070140 +0200 -+++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/nodejs-electron-35.1.5-build/src/third_party/blink/renderer/core/css/style_scope.cc 2025-04-17 16:02:10.183836430 +0200 -@@ -32,7 +32,7 @@ StyleScope* StyleScope::CopyWithParent(c - - const StyleScope* StyleScope::Renest(StyleRule* new_parent) const { - StyleRule* reparented_from = -- from_ ? To(from_->Renest(new_parent)) : nullptr; -+ from_ ? blink::To(from_->Renest(new_parent)) : nullptr; - if (from_ == reparented_from) { - return this; - } diff --git a/system-dragonbox.patch b/system-dragonbox.patch new file mode 100644 index 0000000..cc823e8 --- /dev/null +++ b/system-dragonbox.patch @@ -0,0 +1,11 @@ +--- src/v8/src/numbers/conversions.cc.orig 2025-08-15 17:36:40.101358286 +0200 ++++ src/v8/src/numbers/conversions.cc 2025-08-16 14:28:06.284178438 +0200 +@@ -23,7 +23,7 @@ + #include "src/objects/string-inl.h" + #include "src/strings/char-predicates-inl.h" + #include "src/utils/allocation.h" +-#include "third_party/dragonbox/src/include/dragonbox/dragonbox.h" ++#include + #include "third_party/fast_float/src/include/fast_float/fast_float.h" + #include "third_party/fast_float/src/include/fast_float/float_common.h" + diff --git a/system-libdrm.patch b/system-libdrm.patch index 8488f70..07ba642 100644 --- a/system-libdrm.patch +++ b/system-libdrm.patch @@ -40,16 +40,3 @@ Index: chromium-98.0.4758.80/ui/ozone/platform/drm/gpu/hardware_display_controll #include "third_party/perfetto/include/perfetto/tracing/traced_value.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImage.h" -Index: chromium-98.0.4758.80/media/gpu/chromeos/video_decoder_pipeline_unittest.cc -=================================================================== ---- chromium-98.0.4758.80.orig/media/gpu/chromeos/video_decoder_pipeline_unittest.cc -+++ chromium-98.0.4758.80/media/gpu/chromeos/video_decoder_pipeline_unittest.cc -@@ -23,7 +23,7 @@ - #include "media/gpu/chromeos/dmabuf_video_frame_pool.h" - #include "testing/gmock/include/gmock/gmock.h" - #include "testing/gtest/include/gtest/gtest.h" --#include "third_party/libdrm/src/include/drm/drm_fourcc.h" -+#include - - #if BUILDFLAG(IS_CHROMEOS_ASH) - // gn check does not account for BUILDFLAG(), so including this header will diff --git a/system-pydeps.patch b/system-pydeps.patch index 90463bd..5dd82c7 100644 --- a/system-pydeps.patch +++ b/system-pydeps.patch @@ -119,8 +119,8 @@ Unbundle assorted lexing/parsing/transpiling tools written in Python. --- src/mojo/public/tools/bindings/mojom.gni.orig 2025-04-11 12:05:21.530272509 +0200 +++ src/mojo/public/tools/bindings/mojom.gni 2025-04-11 20:56:50.579500868 +0200 @@ -802,7 +802,7 @@ template("mojom") { - remote_worker = "large" - custom_processor = "mojom_parser" + + action("${parser_target_name}_action") { script = mojom_parser_script - inputs = mojom_parser_sources + ply_sources + [ build_metadata_filename ] + inputs = mojom_parser_sources + [ build_metadata_filename ] diff --git a/system-simdutf.patch b/system-simdutf.patch deleted file mode 100644 index 3ee8c01..0000000 --- a/system-simdutf.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 3fb3bab213348955edc18a051f9c3f86241309e8 Mon Sep 17 00:00:00 2001 -From: LN Liberda -Date: Thu, 13 Mar 2025 20:01:32 -0700 -Subject: [PATCH] unbundle: add simdutf - -Bug: none -Change-Id: Idae290112561e5658c614f5eae8895abfe996124 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6333513 -Reviewed-by: Thomas Anderson -Commit-Queue: Thomas Anderson -Reviewed-by: Lei Zhang -Cr-Commit-Position: refs/heads/main@{#1432518} ---- - build/linux/unbundle/replace_gn_files.py | 1 + - build/linux/unbundle/simdutf.gn | 20 ++++++++++++++++++++ - 2 files changed, 21 insertions(+) - create mode 100644 build/linux/unbundle/simdutf.gn - -diff --git a/build/linux/unbundle/replace_gn_files.py b/build/linux/unbundle/replace_gn_files.py -index 9ee6fda6547d90..f5db9d23c886b7 100755 ---- a/build/linux/unbundle/replace_gn_files.py -+++ b/build/linux/unbundle/replace_gn_files.py -@@ -67,6 +67,7 @@ - 'openh264': 'third_party/openh264/BUILD.gn', - 'opus': 'third_party/opus/BUILD.gn', - 're2': 'third_party/re2/BUILD.gn', -+ 'simdutf': 'third_party/simdutf/BUILD.gn', - 'snappy': 'third_party/snappy/BUILD.gn', - # Use system libSPIRV-Tools in Swiftshader. - # These two shims MUST be used together. -diff --git a/build/linux/unbundle/simdutf.gn b/build/linux/unbundle/simdutf.gn -new file mode 100644 -index 00000000000000..67d86cb3b3e5f9 ---- /dev/null -+++ b/build/linux/unbundle/simdutf.gn -@@ -0,0 +1,20 @@ -+# 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/config/linux/pkg_config.gni") -+import("//build/shim_headers.gni") -+ -+shim_headers("header") { -+ root_path = "." -+ headers = [ "simdutf.h" ] -+} -+ -+pkg_config("system_simdutf") { -+ packages = [ "simdutf" ] -+} -+ -+source_set("simdutf") { -+ public_configs = [ ":system_simdutf" ] -+ public_deps = [ ":header" ] -+} diff --git a/to_vector-std-projected-gcc119888.patch b/to_vector-std-projected-gcc119888.patch deleted file mode 100644 index a371ad1..0000000 --- a/to_vector-std-projected-gcc119888.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/base/containers/to_vector.h.orig 2025-04-21 18:29:04.778306927 +0200 -+++ src/base/containers/to_vector.h 2025-04-22 06:32:55.415046071 +0200 -@@ -29,7 +29,7 @@ template > - auto ToVector(Range&& range, Proj proj = {}) { - using ProjectedType = -- std::projected, Proj>::value_type; -+ std::indirectly_readable_traits, Proj> >::value_type; - std::vector container; - container.reserve(std::ranges::size(range)); - std::ranges::transform(std::forward(range), diff --git a/unexportable_key_service_impl-Wlto-type-mismatch.patch b/unexportable_key_service_impl-Wlto-type-mismatch.patch deleted file mode 100644 index 27bf675..0000000 --- a/unexportable_key_service_impl-Wlto-type-mismatch.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- src/components/unexportable_keys/unexportable_key_service_impl.cc.orig 2025-04-20 19:22:29.934671387 +0200 -+++ src/components/unexportable_keys/unexportable_key_service_impl.cc 2025-04-21 14:22:30.891412928 +0200 -@@ -19,8 +19,6 @@ - - namespace unexportable_keys { - --namespace { -- - // Class holding either an `UnexportableKeyId` or a list of callbacks waiting - // for the key creation. - class MaybePendingUnexportableKeyId { -@@ -105,8 +103,6 @@ MaybePendingUnexportableKeyId::GetCallba - return absl::get>(key_id_or_pending_callbacks_); - } - --} // namespace -- - UnexportableKeyServiceImpl::UnexportableKeyServiceImpl( - UnexportableKeyTaskManager& task_manager) - : task_manager_(task_manager) {} ---- src/components/unexportable_keys/unexportable_key_service_impl.h.orig 2025-04-20 19:22:29.934671387 +0200 -+++ src/components/unexportable_keys/unexportable_key_service_impl.h 2025-04-21 14:22:00.963413744 +0200 -@@ -23,9 +23,7 @@ - - namespace unexportable_keys { - --namespace { - class MaybePendingUnexportableKeyId; --} - - class UnexportableKeyTaskManager; - diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch index 91ca253..7dc6c29 100644 --- a/use-system-libraries-in-node.patch +++ b/use-system-libraries-in-node.patch @@ -78,8 +78,8 @@ Both this and the unbundle flags should be upstreamed but probably separately. "deps/nbytes", - "deps/nghttp2", "deps/postject", - "deps/sqlite", "deps/uvwasi", + "//third_party/zlib", @@ -186,21 +211,36 @@ template("node_gn_build") { "Security.framework", ] diff --git a/v8-highway-1.1.patch b/v8-highway-1.1.patch new file mode 100644 index 0000000..6e6c04c --- /dev/null +++ b/v8-highway-1.1.patch @@ -0,0 +1,150 @@ +From 1cb68a06f8c0ea3ad29cab6efe5ac673817596ce Mon Sep 17 00:00:00 2001 +From: pthier +Date: Tue, 6 May 2025 10:28:03 +0200 +Subject: [PATCH] Reland "[regexp] Simdify global atom match with single + character pattern" + +This is a reland of commit 36f07e9a04484dd4b97713f8e821d3b83ade8f53 + +Changes since revert: Accumulate number of matches after a cache hit +instead of overwriting them. + +Original change's description: +> [regexp] Simdify global atom match with single character pattern +> +> Use highway to find matching characters for RegExp with a single +> character atom pattern. +> +> Bug: 413411337 +> Change-Id: I9bf686aca2da37025613a9227eb0ec69176a676f +> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6487695 +> Reviewed-by: Jakob Linke +> Commit-Queue: Patrick Thier +> Cr-Commit-Position: refs/heads/main@{#100006} + +Fixed: 414857029 +Bug: 413411337 +Change-Id: I3ebd72f3b91ce5e7b603e43540cd4e10090c1868 +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6513551 +Reviewed-by: Camillo Bruni +Commit-Queue: Patrick Thier +Cr-Commit-Position: refs/heads/main@{#100088} +--- + src/runtime/runtime-regexp.cc | 95 ++++++++++++++++++++++++++++++++--- + test/mjsunit/regexp-global.js | 24 +++++++++ + 2 files changed, 112 insertions(+), 7 deletions(-) + +diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc +index 5689cdc8d1db..e5cee437d1c3 100644 +--- a/v8/src/runtime/runtime-regexp.cc ++++ b/v8/src/runtime/runtime-regexp.cc +@@ -3,7 +3,9 @@ + // found in the LICENSE file. + + #include ++#include + ++#include "hwy/highway.h" + #include "src/base/small-vector.h" + #include "src/base/strings.h" + #include "src/common/message-template.h" +@@ -2164,13 +2166,92 @@ inline void RegExpMatchGlobalAtom_OneCharPattern( + Isolate* isolate, base::Vector subject, const PChar pattern, + int start_index, int* number_of_matches, int* last_match_index, + const DisallowGarbageCollection& no_gc) { +- for (int i = start_index; i < subject.length(); i++) { +- // Subtle: the valid variants are {SChar,PChar} in: +- // {uint8_t,uint8_t}, {uc16,uc16}, {uc16,uint8_t}. In the latter case, +- // we cast the uint8_t pattern to uc16 for the comparison. +- if (subject[i] != static_cast(pattern)) continue; +- (*number_of_matches)++; +- (*last_match_index) = i; ++ static_assert(std::is_unsigned_v); ++ static_assert(std::is_unsigned_v); ++ // We can utilize SIMD to check multiple characters at once. ++ // Since the pattern is a single char, we create a mask setting each lane in ++ // the vector to the pattern char. ++ // Since reductions from a vector to a general purpose register (i.e. ++ // ReduceSum in this algorithm) are expensive, we keep a count for each lane ++ // in a vector until the count could potentially overflow and only reduce to ++ // a general purpose register then. I.e. if SChar is uint8_t, we have a ++ // 16xuint8_t vector to count matches, which we reduce to an int every 255 ++ // blocks. ++ namespace hw = hwy::HWY_NAMESPACE; ++ hw::ScalableTag tag; ++ // We need a wider tag to avoid overflows on lanes when summing up submatches. ++ using WidenedTag = hw::RepartitionToWide; ++ WidenedTag sum_tag; ++ static constexpr size_t stride = hw::Lanes(tag); ++ // Subtle: the valid variants are {SChar,PChar} in: ++ // {uint8_t,uint8_t}, {uc16,uc16}, {uc16,uint8_t}. In the latter case, ++ // we cast the uint8_t pattern to uc16 for the comparison. ++ const auto mask = hw::Set(tag, static_cast(pattern)); ++ ++ int matches = 0; ++ auto submatches = hw::Zero(tag); ++ const SChar* last_match_block = nullptr; ++ hw::Mask last_match_vec; ++ ++ const SChar* block = subject.data() + start_index; ++ const SChar* end = subject.data() + subject.length(); ++ ++ // ReduceSum is expensive, so we gather matches into a vector. max_count is ++ // the maximum number of matches we can count in the vector before it ++ // overflows. ++ int max_count = std::numeric_limits::max(); ++ while (block + stride * max_count <= end) { ++ for (int i = 0; i < max_count; i++, block += stride) { ++ const auto input = hw::LoadU(tag, block); ++ const auto match = input == mask; ++ // Lanes with matches have all bits set, so we subtract to increase the ++ // count by 1. ++ submatches = hw::Sub(submatches, hw::VecFromMask(tag, match)); ++ if (!hw::AllFalse(tag, match)) { ++ last_match_block = block; ++ last_match_vec = match; ++ } ++ } ++ // SumsOf2 promotes the sum of 2 consecutive lanes into a wider lane. ++ auto promoted_submatches = hw::SumsOf2(submatches); ++ // Wider lane sums can be reduces without overflows. ++ matches += hw::ReduceSum(sum_tag, promoted_submatches); ++ submatches = hw::Zero(tag); ++ } ++ ++ // For blocks shorter than stride * max_count, lanes in submatches can't ++ // overflow. ++ DCHECK_LT(end - block, stride * max_count); ++ for (; block + stride <= end; block += stride) { ++ const auto input = hw::LoadU(tag, block); ++ const auto match = input == mask; ++ submatches = hw::Sub(submatches, hw::VecFromMask(tag, match)); ++ if (!hw::AllFalse(tag, match)) { ++ last_match_block = block; ++ last_match_vec = match; ++ } ++ } ++ auto promoted_submatches = hw::SumsOf2(submatches); ++ matches += hw::ReduceSum(sum_tag, promoted_submatches); ++ ++ // Handle remaining chars. ++ // last_match_block already contains the last match position, so use a special ++ // vector with lane 0 set to extract the last_match_index later. ++ const auto scalar_last_match_vec = hw::FirstN(tag, 1); ++ for (SChar c = *block; block < end; c = *(++block)) { ++ if (c != static_cast(pattern)) continue; ++ matches++; ++ last_match_block = block; ++ last_match_vec = scalar_last_match_vec; ++ } ++ ++ // Store results. ++ *number_of_matches += matches; ++ if (last_match_block != nullptr) { ++ DCHECK(!hw::AllFalse(tag, last_match_vec)); ++ *last_match_index = static_cast( ++ last_match_block + hw::FindKnownLastTrue(tag, last_match_vec) - ++ subject.data()); + } + } + diff --git a/v8-simd-flax-vector-conversions.patch b/v8-simd-flax-vector-conversions.patch new file mode 100644 index 0000000..ab55951 --- /dev/null +++ b/v8-simd-flax-vector-conversions.patch @@ -0,0 +1,55 @@ +--- src/v8/src/objects/simd.cc.orig 2025-08-15 17:36:40.113358284 +0200 ++++ src/v8/src/objects/simd.cc 2025-08-17 16:29:26.826424105 +0200 +@@ -953,7 +953,7 @@ bool Uint8ArrayFromHexWithNeon(const bas + uint8x16_t second_part_first_batch = + vld1q_u8(reinterpret_cast(&input_vector[i + 8])); + first_batch = +- vmovn_high_u16(vmovn_u16(first_batch), second_part_first_batch); ++ vmovn_high_u16(vmovn_u16(vreinterpretq_u16_u8(first_batch)), vreinterpretq_u16_u8(second_part_first_batch)); + } + + // Load second batch of 16 hex characters into a Neon register +@@ -966,20 +966,20 @@ bool Uint8ArrayFromHexWithNeon(const bas + uint8x16_t second_part_second_batch = + vld1q_u8(reinterpret_cast(&input_vector[i + 24])); + second_batch = +- vmovn_high_u16(vmovn_u16(second_batch), second_part_second_batch); ++ vmovn_high_u16(vmovn_u16(vreinterpretq_u16_u8(second_batch)), vreinterpretq_u16_u8(second_part_second_batch)); + } + + // low nibbles are values with even indexes in fist_batch. + // (0x36, 0x00, 0x66, 0x00, 0x46, 0x00, 0x32, 0x00, 0x31, 0x00, 0x32, 0x00, + // 0x31, 0x00, 0x32, 0x00) +- uint8x16_t first_batch_lo_nibbles = +- vreinterpretq_u8_u16(vshrq_n_u16(vreinterpretq_u16_u8(first_batch), 8)); ++ uint16x8_t first_batch_lo_nibbles = ++ vshrq_n_u16(vreinterpretq_u16_u8(first_batch), 8); + + // low nibbles are values with even indexes in second_batch. + // (0x36, 0x00, 0x66, 0x00, 0x66, 0x00, 0x32, 0x00, 0x31, 0x00, 0x32, 0x00, + // 0x31, 0x00, 0x66, 0x00) +- uint8x16_t second_batch_lo_nibbles = vreinterpretq_u8_u16( +- vshrq_n_u16(vreinterpretq_u16_u8(second_batch), 8)); ++ uint16x8_t second_batch_lo_nibbles = ++ vshrq_n_u16(vreinterpretq_u16_u8(second_batch), 8); + + // Append low nibbles of first batch and second batch and remove 0x00s. + // (0x36, 0x66, 0x46, 0x32, 0x31, 0x32, 0x31, 0x32, 0x36, 0x66, 0x66, 0x32, +@@ -992,7 +992,7 @@ bool Uint8ArrayFromHexWithNeon(const bas + // significant byte. (0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x37, 0x36, + // 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x66) + uint8x16_t hi_nibbles = +- vmovn_high_u16(vmovn_u16(first_batch), second_batch); ++ vmovn_high_u16(vmovn_u16(vreinterpretq_u16_u8(first_batch)), vreinterpretq_u16_u8(second_batch)); + + // mapping low nibbles to uint8_t values. + // (0x06, 0x0f, 0x0f, 0x02, 0x01, 0x02, 0x01, 0x02, 0x06, 0x0f, 0x0f, 0x02, +@@ -1023,7 +1023,7 @@ bool Uint8ArrayFromHexWithNeon(const bas + // (0x60, 0x60, 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x60, 0x60, 0x60, 0x60, + // 0x60, 0x70, 0x60, 0xf0) + uint8x16_t uint8_shifted_high_nibbles = +- vshlq_n_u64(vreinterpretq_u64_u8(uint8_high_nibbles), 4); ++ vreinterpretq_u8_u64(vshlq_n_u64(vreinterpretq_u64_u8(uint8_high_nibbles), 4)); + + // final result of combining pairs of uint8_t values of low and high + // nibbles. diff --git a/vaapi-no-encoders.patch b/vaapi-no-encoders.patch index a817ca0..d2ed155 100644 --- a/vaapi-no-encoders.patch +++ b/vaapi-no-encoders.patch @@ -5,9 +5,9 @@ These encoders: The hardware *decoders*, on the other hand, are useful for Signal Messenger, and should work now. ---- src/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.orig 2025-07-02 22:10:56.136470571 +0200 -+++ src/media/gpu/vaapi/vaapi_video_encode_accelerator.cc 2025-07-11 18:16:04.978530973 +0200 -@@ -43,13 +43,10 @@ +--- src/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.orig 2025-07-19 11:32:35.717979936 +0200 ++++ src/media/gpu/vaapi/vaapi_video_encode_accelerator.cc 2025-08-15 14:42:43.908933011 +0200 +@@ -46,13 +46,10 @@ #include "media/gpu/gpu_video_encode_accelerator_helpers.h" #include "media/gpu/h264_dpb.h" #include "media/gpu/macros.h" @@ -21,7 +21,7 @@ The hardware *decoders*, on the other hand, are useful for Signal Messenger, and #include "media/gpu/vp8_reference_frame_vector.h" #include "media/gpu/vp9_reference_frame_vector.h" -@@ -230,8 +227,7 @@ bool VaapiVideoEncodeAccelerator::Initia +@@ -233,8 +230,7 @@ EncoderStatus VaapiVideoEncodeAccelerato } const VideoCodec codec = VideoCodecProfileToVideoCodec(config.output_profile); @@ -30,8 +30,8 @@ The hardware *decoders*, on the other hand, are useful for Signal Messenger, and + if (codec != VideoCodec::kH264) { MEDIA_LOG(ERROR, media_log.get()) << "Unsupported profile: " << GetProfileName(config.output_profile); - return false; -@@ -321,11 +317,6 @@ void VaapiVideoEncodeAccelerator::Initia + return {EncoderStatus::Codes::kEncoderInitializationError}; +@@ -324,11 +320,6 @@ void VaapiVideoEncodeAccelerator::Initia : VaapiWrapper::kEncodeVariableBitrate; } break; @@ -43,7 +43,7 @@ The hardware *decoders*, on the other hand, are useful for Signal Messenger, and default: NotifyError({EncoderStatus::Codes::kEncoderUnsupportedCodec, "Unsupported codec: " + GetCodecName(output_codec_)}); -@@ -377,24 +368,6 @@ void VaapiVideoEncodeAccelerator::Initia +@@ -380,24 +371,6 @@ void VaapiVideoEncodeAccelerator::Initia } } break; @@ -68,20 +68,20 @@ The hardware *decoders*, on the other hand, are useful for Signal Messenger, and default: NOTREACHED() << "Unsupported codec type " << GetCodecName(output_codec_); } -@@ -893,19 +866,6 @@ VaapiVideoEncodeAccelerator::CreateEncod - picture = new VaapiH264Picture( +@@ -896,19 +869,6 @@ VaapiVideoEncodeAccelerator::CreateEncod + picture = base::MakeRefCounted( reconstructed_surface->ReleaseAsVASurfaceHandle()); break; - case VideoCodec::kVP8: -- picture = new VaapiVP8Picture( +- picture = base::MakeRefCounted( - reconstructed_surface->ReleaseAsVASurfaceHandle()); - break; - case VideoCodec::kVP9: -- picture = new VaapiVP9Picture( +- picture = base::MakeRefCounted( - reconstructed_surface->ReleaseAsVASurfaceHandle()); - break; - case VideoCodec::kAV1: -- picture = new VaapiAV1Picture( +- picture = base::MakeRefCounted( - /*display_va_surface=*/nullptr, - reconstructed_surface->ReleaseAsVASurfaceHandle()); - break; diff --git a/webgl_rendering_context_webgpu_base-incomplete-StaticBitmapImage.patch b/webgl_rendering_context_webgpu_base-incomplete-StaticBitmapImage.patch new file mode 100644 index 0000000..51183e4 --- /dev/null +++ b/webgl_rendering_context_webgpu_base-incomplete-StaticBitmapImage.patch @@ -0,0 +1,10 @@ +--- src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_webgpu_base.cc.orig 2025-08-15 17:32:29.453405076 +0200 ++++ src/third_party/blink/renderer/modules/webgl/webgl_rendering_context_webgpu_base.cc 2025-08-16 09:32:54.602946843 +0200 +@@ -10,6 +10,7 @@ + #include "third_party/blink/renderer/platform/graphics/gpu/dawn_control_client_holder.h" + #include "third_party/blink/renderer/platform/graphics/gpu/webgpu_callback.h" + #include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h" ++#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" + #include "third_party/blink/renderer/platform/graphics/web_graphics_context_3d_provider_util.h" + #include "third_party/blink/renderer/platform/weborigin/kurl.h" + #include "third_party/blink/renderer/platform/wtf/functional.h" diff --git a/webrtc-138-Wchanges-meaning.patch b/webrtc-138-Wchanges-meaning.patch new file mode 100644 index 0000000..4a74ee1 --- /dev/null +++ b/webrtc-138-Wchanges-meaning.patch @@ -0,0 +1,33 @@ +--- webrtc-7204a/third_party/webrtc/pc/codec_vendor.h.orig 2025-08-10 20:30:35.548562304 +0200 ++++ webrtc-7204a/third_party/webrtc/pc/codec_vendor.h 2025-08-10 21:06:25.516311580 +0200 +@@ -119,7 +119,7 @@ class CodecVendor { + class CodecLookupHelper { + public: + virtual ~CodecLookupHelper() = default; +- virtual PayloadTypeSuggester* PayloadTypeSuggester() = 0; ++ virtual webrtc::PayloadTypeSuggester* PayloadTypeSuggester() = 0; + // Look up the codec vendor to use, depending on context. + // This call may get additional arguments in the future, to aid + // in selection of the correct context. +--- webrtc-7204a/third_party/webrtc/pc/jsep_transport.h.orig 2025-08-10 20:30:35.552562303 +0200 ++++ webrtc-7204a/third_party/webrtc/pc/jsep_transport.h 2025-08-10 21:10:32.100282629 +0200 +@@ -214,7 +214,7 @@ class JsepTransport { + return rtp_dtls_transport_; + } + +- scoped_refptr SctpTransport() const { return sctp_transport_; } ++ scoped_refptr SctpTransport() const { return sctp_transport_; } + + // TODO(bugs.webrtc.org/9719): Delete method, update callers to use + // SctpTransport() instead. +--- webrtc-7204a/third_party/webrtc/p2p/base/port_interface.h.orig 2025-08-10 20:30:35.544562305 +0200 ++++ webrtc-7204a/third_party/webrtc/p2p/base/port_interface.h 2025-08-10 20:58:44.792364738 +0200 +@@ -55,7 +55,7 @@ class PortInterface { + virtual ~PortInterface(); + + virtual IceCandidateType Type() const = 0; +- virtual const Network* Network() const = 0; ++ virtual const webrtc::Network* Network() const = 0; + + // Methods to set/get ICE role and tiebreaker values. + virtual void SetIceRole(IceRole role) = 0; diff --git a/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch b/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch deleted file mode 100644 index dab99d8..0000000 --- a/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR-2.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4860148c51cb673711a41bc26135659ad4e6cb9d Mon Sep 17 00:00:00 2001 -From: Dan Tan -Date: Wed, 31 Jan 2024 09:11:18 -0800 -Subject: [PATCH] Add WebRTC-LibaomAv1Encoder-MaxConsecFrameDrop parameter to - explicitly limit the maximum consecutive frame drop - -Bug: webrtc:15821 -Change-Id: Ib8be6827ea57e4e54269b94a0fc9ea81945af09f -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337020 -Reviewed-by: Marco Paniconi -Commit-Queue: Dan Tan -Reviewed-by: Sergey Silkin -Cr-Commit-Position: refs/heads/main@{#41648} ---- - experiments/field_trials.py | 3 +++ - .../codecs/av1/libaom_av1_encoder.cc | 18 ++++++++++++- - .../codecs/av1/libaom_av1_encoder_unittest.cc | 25 +++++++++++++++++++ - 3 files changed, 45 insertions(+), 1 deletion(-) - -diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -index 4ff22bfe34..03bb367fe0 100644 ---- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -+++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -@@ -297,6 +307,12 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0); - } - -+ if (codec_settings->mode == VideoCodecMode::kRealtimeVideo && -+ encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) { -+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, -+ max_consec_frame_drop_); -+ } -+ - if (cfg_.g_threads == 8) { - // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2() - // based. diff --git a/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch b/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch deleted file mode 100644 index 999ddd8..0000000 --- a/webrtc-aom3.8-AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.patch +++ /dev/null @@ -1,250 +0,0 @@ -From f7a15067031cae07b1dac031fa263a9f01902f1c Mon Sep 17 00:00:00 2001 -From: Sergey Silkin -Date: Tue, 9 Jul 2024 15:03:10 +0200 -Subject: [PATCH] Adjust max consecutive drops depending on target frame rate -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Current thresholds were tuned to guarantee no buffer overshoot in an extreme scenario (encoding a high complexity video in a low bitrate). - -Bug: b/337757868, webrtc:351644568 -Change-Id: I832b2564af6f18f06550338cc9b3618f8acdf831 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356580 -Reviewed-by: Dan Tan -Reviewed-by: Erik Språng -Commit-Queue: Sergey Silkin -Cr-Commit-Position: refs/heads/main@{#42620} ---- - experiments/field_trials.py | 6 +-- - modules/video_coding/codecs/av1/BUILD.gn | 2 + - .../codecs/av1/libaom_av1_encoder.cc | 42 +++++++++------ - .../codecs/av1/libaom_av1_encoder_unittest.cc | 53 ++++++++++++++----- - 4 files changed, 69 insertions(+), 34 deletions(-) - -diff --git a/modules/video_coding/codecs/av1/BUILD.gn b/modules/video_coding/codecs/av1/BUILD.gn -index 7d93de7a3a..197e1f3e19 100644 ---- a/third_party/webrtc/modules/video_coding/codecs/av1/BUILD.gn -+++ b/third_party/webrtc/modules/video_coding/codecs/av1/BUILD.gn -@@ -60,6 +60,7 @@ rtc_library("libaom_av1_encoder") { - "../../../../api/video_codecs:scalability_mode", - "../../../../api/video_codecs:video_codecs_api", - "../../../../common_video", -+ "../../../../modules/rtp_rtcp:rtp_rtcp_format", - "../../../../rtc_base:checks", - "../../../../rtc_base:logging", - "../../../../rtc_base:rtc_numerics", -@@ -104,6 +105,7 @@ if (rtc_include_tests) { - "../../../../api/units:data_size", - "../../../../api/units:time_delta", - "../../../../api/video:video_frame", -+ "../../../../modules/rtp_rtcp:rtp_rtcp_format", - "../../../../test:scoped_key_value_config", - "../../svc:scalability_mode_util", - "../../svc:scalability_structures", -diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -index 3a8830252d..258d3d3b88 100644 ---- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -+++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc -@@ -30,6 +30,7 @@ - #include "api/video_codecs/scalability_mode.h" - #include "api/video_codecs/video_codec.h" - #include "api/video_codecs/video_encoder.h" -+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" - #include "modules/video_coding/include/video_codec_interface.h" - #include "modules/video_coding/include/video_error_codes.h" - #include "modules/video_coding/svc/create_scalability_structure.h" -@@ -65,7 +66,6 @@ constexpr int kLowQindex = 145; // Low qindex threshold for QP scaling. - constexpr int kHighQindex = 205; // High qindex threshold for QP scaling. - constexpr int kBitDepth = 8; - constexpr int kLagInFrames = 0; // No look ahead. --constexpr int kRtpTicksPerSecond = 90000; - constexpr double kMinFrameRateFps = 1.0; - - aom_superblock_size_t GetSuperblockSize(int width, int height, int threads) { -@@ -133,7 +133,9 @@ class LibaomAv1Encoder final : public VideoEncoder { - double framerate_fps_; // Current target frame rate. - int64_t timestamp_; - const LibaomAv1EncoderInfoSettings encoder_info_override_; -- int max_consec_frame_drop_; -+ // TODO(webrtc:351644568): Remove this kill-switch after the feature is fully -+ // deployed. -+ bool adaptive_max_consec_drops_; - }; - - int32_t VerifyCodecSettings(const VideoCodec& codec_settings) { -@@ -164,12 +166,12 @@ int32_t VerifyCodecSettings(const VideoCodec& codec_settings) { - return WEBRTC_VIDEO_CODEC_OK; - } - --int GetMaxConsecutiveFrameDrop(const FieldTrialsView& field_trials) { -- webrtc::FieldTrialParameter maxdrop("maxdrop", 0); -- webrtc::ParseFieldTrial( -- {&maxdrop}, -- field_trials.Lookup("WebRTC-LibaomAv1Encoder-MaxConsecFrameDrop")); -- return maxdrop; -+int GetMaxConsecDrops(double framerate_fps) { -+ // Consecutive frame drops result in a video freeze. We want to minimize the -+ // max number of consecutive drops and, at the same time, keep the value high -+ // enough to let encoder drain the buffer at overshoot. -+ constexpr double kMaxFreezeSeconds = 0.25; -+ return std::ceil(kMaxFreezeSeconds * framerate_fps); - } - - LibaomAv1Encoder::LibaomAv1Encoder(const Environment& env, -@@ -182,7 +184,8 @@ LibaomAv1Encoder::LibaomAv1Encoder(const Environment& env, - framerate_fps_(0), - timestamp_(0), - encoder_info_override_(env.field_trials()), -- max_consec_frame_drop_(GetMaxConsecutiveFrameDrop(env.field_trials())) {} -+ adaptive_max_consec_drops_(!env.field_trials().IsDisabled( -+ "WebRTC-LibaomAv1Encoder-AdaptiveMaxConsecDrops")) {} - - LibaomAv1Encoder::~LibaomAv1Encoder() { - Release(); -@@ -242,7 +245,7 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, - cfg_.g_threads = - NumberOfThreads(cfg_.g_w, cfg_.g_h, settings.number_of_cores); - cfg_.g_timebase.num = 1; -- cfg_.g_timebase.den = kRtpTicksPerSecond; -+ cfg_.g_timebase.den = kVideoPayloadTypeFrequency; - cfg_.rc_target_bitrate = encoder_settings_.startBitrate; // kilobits/sec. - cfg_.rc_dropframe_thresh = encoder_settings_.GetFrameDropEnabled() ? 30 : 0; - cfg_.g_input_bit_depth = kBitDepth; -@@ -304,12 +307,6 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, - SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0); - } - -- if (codec_settings->mode == VideoCodecMode::kRealtimeVideo && -- encoder_settings_.GetFrameDropEnabled() && max_consec_frame_drop_ > 0) { -- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, -- max_consec_frame_drop_); -- } -- - if (cfg_.g_threads == 8) { - // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2() - // based. -@@ -659,7 +656,7 @@ int32_t LibaomAv1Encoder::Encode( - return WEBRTC_VIDEO_CODEC_ENCODER_FAILURE; - } - -- const uint32_t duration = kRtpTicksPerSecond / framerate_fps_; -+ const uint32_t duration = kVideoPayloadTypeFrequency / framerate_fps_; - timestamp_ += duration; - - const size_t num_spatial_layers = -@@ -836,6 +833,17 @@ void LibaomAv1Encoder::SetRates(const RateControlParameters& parameters) { - SetEncoderControlParameters(AV1E_SET_SVC_PARAMS, &*svc_params_); - } - -+ if (adaptive_max_consec_drops_ && -+ (!rates_configured_ || framerate_fps_ != parameters.framerate_fps)) { -+ int max_consec_drops = GetMaxConsecDrops(parameters.framerate_fps); -+ if (!SetEncoderControlParameters(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, -+ max_consec_drops)) { -+ RTC_LOG(LS_WARNING) -+ << "Failed to set AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR to " -+ << max_consec_drops; -+ } -+ } -+ - framerate_fps_ = parameters.framerate_fps; - - rates_configured_ = true; -diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc -index abb6fce0cf..a00b03aeda 100644 ---- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc -+++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc -@@ -10,6 +10,7 @@ - - #include "modules/video_coding/codecs/av1/libaom_av1_encoder.h" - -+#include - #include - #include - #include -@@ -22,6 +23,7 @@ - #include "api/test/frame_generator_interface.h" - #include "api/video_codecs/video_codec.h" - #include "api/video_codecs/video_encoder.h" -+#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" - #include "modules/video_coding/codecs/test/encoded_video_frame_producer.h" - #include "modules/video_coding/include/video_error_codes.h" - #include "test/gmock.h" -@@ -37,6 +39,7 @@ using ::testing::Eq; - using ::testing::Field; - using ::testing::IsEmpty; - using ::testing::SizeIs; -+using ::testing::Values; - - VideoCodec DefaultCodecSettings() { - VideoCodec codec_settings; -@@ -199,32 +202,54 @@ TEST(LibaomAv1EncoderTest, CheckOddDimensionsWithSpatialLayers) { - ASSERT_THAT(encoded_frames, SizeIs(6)); - } - --TEST(LibaomAv1EncoderTest, WithMaximumConsecutiveFrameDrop) { -- auto field_trials = std::make_unique( -- "WebRTC-LibaomAv1Encoder-MaxConsecFrameDrop/maxdrop:2/"); -- const Environment env = CreateEnvironment(std::move(field_trials)); -+class LibaomAv1EncoderMaxConsecDropTest -+ : public ::testing::TestWithParam {}; -+ -+TEST_P(LibaomAv1EncoderMaxConsecDropTest, MaxConsecDrops) { - VideoBitrateAllocation allocation; -- allocation.SetBitrate(0, 0, 1000); // some very low bitrate -- std::unique_ptr encoder = CreateLibaomAv1Encoder(env); -+ allocation.SetBitrate(0, 0, -+ 1000); // Very low bitrate to provoke frame drops. -+ std::unique_ptr encoder = -+ CreateLibaomAv1Encoder(CreateEnvironment()); - VideoCodec codec_settings = DefaultCodecSettings(); - codec_settings.SetFrameDropEnabled(true); - codec_settings.SetScalabilityMode(ScalabilityMode::kL1T1); - codec_settings.startBitrate = allocation.get_sum_kbps(); -+ codec_settings.maxFramerate = GetParam(); - ASSERT_EQ(encoder->InitEncode(&codec_settings, DefaultEncoderSettings()), - WEBRTC_VIDEO_CODEC_OK); - encoder->SetRates(VideoEncoder::RateControlParameters( - allocation, codec_settings.maxFramerate)); -- EncodedVideoFrameProducer evfp(*encoder); -- evfp.SetResolution( -- RenderResolution{codec_settings.width, codec_settings.height}); -- // We should code the first frame, skip two, then code another frame. - std::vector encoded_frames = -- evfp.SetNumInputFrames(4).Encode(); -- ASSERT_THAT(encoded_frames, SizeIs(2)); -- // The 4 frames have default Rtp-timestamps of 1000, 4000, 7000, 10000. -- ASSERT_THAT(encoded_frames[1].encoded_image.RtpTimestamp(), 10000); -+ EncodedVideoFrameProducer(*encoder) -+ .SetNumInputFrames(60) -+ .SetFramerateFps(codec_settings.maxFramerate) -+ .SetResolution(RenderResolution{320, 180}) -+ .Encode(); -+ ASSERT_GE(encoded_frames.size(), 2u); -+ -+ int max_consec_drops = 0; -+ for (size_t i = 1; i < encoded_frames.size(); ++i) { -+ uint32_t frame_duration_rtp = -+ encoded_frames[i].encoded_image.RtpTimestamp() - -+ encoded_frames[i - 1].encoded_image.RtpTimestamp(); -+ // X consecutive drops result in a freeze of (X + 1) frame duration. -+ // Subtract 1 to get pure number of drops. -+ int num_drops = frame_duration_rtp * codec_settings.maxFramerate / -+ kVideoPayloadTypeFrequency - -+ 1; -+ max_consec_drops = std::max(max_consec_drops, num_drops); -+ } -+ -+ const int expected_max_consec_drops = -+ std::ceil(0.25 * codec_settings.maxFramerate); -+ EXPECT_EQ(max_consec_drops, expected_max_consec_drops); - } - -+INSTANTIATE_TEST_SUITE_P(LibaomAv1EncoderMaxConsecDropTests, -+ LibaomAv1EncoderMaxConsecDropTest, -+ Values(1, 2, 5, 15, 30, 60)); -+ - TEST(LibaomAv1EncoderTest, EncoderInfoWithoutResolutionBitrateLimits) { - std::unique_ptr encoder = - CreateLibaomAv1Encoder(CreateEnvironment()); diff --git a/xml_document_parser-Wmissing-template-keyword.patch b/xml_document_parser-Wmissing-template-keyword.patch deleted file mode 100644 index de8ff39..0000000 --- a/xml_document_parser-Wmissing-template-keyword.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- src/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc.orig 2025-04-16 14:36:32.758721824 +0200 -+++ src/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc 2025-04-17 12:06:42.394992144 +0200 -@@ -1507,8 +1507,8 @@ static base::span Cop - base::span expanded_entity_chars) { - auto entity_buffer = - base::as_writable_chars(base::span(g_shared_xhtml_entity_result)); -- entity_buffer.first().copy_from(expanded_entity_chars); -- return entity_buffer.first(); -+ entity_buffer.template first().copy_from(expanded_entity_chars); -+ return entity_buffer.template first(); - } - - static base::span ConvertUTF16EntityToUTF8( diff --git a/xr_webgl_swap_chain-incomplete-StaticBitmapImage.patch b/xr_webgl_swap_chain-incomplete-StaticBitmapImage.patch new file mode 100644 index 0000000..8a6518e --- /dev/null +++ b/xr_webgl_swap_chain-incomplete-StaticBitmapImage.patch @@ -0,0 +1,10 @@ +--- src/third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.h.orig 2025-08-15 17:32:29.469405073 +0200 ++++ src/third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.h 2025-08-16 00:08:44.433036412 +0200 +@@ -8,6 +8,7 @@ + #include "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h" + #include "third_party/blink/renderer/modules/webgl/webgl_unowned_texture.h" + #include "third_party/blink/renderer/modules/xr/xr_swap_chain.h" ++#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/heap/member.h" + -- 2.51.1 From 0c3ec4b73853a2d5092f6774a127d38fe1d8c0badc8ce1d8e99af639def365b5 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 25 Aug 2025 07:08:39 +0000 Subject: [PATCH 69/80] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=221 --- BlobCache-Success.patch | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 BlobCache-Success.patch diff --git a/BlobCache-Success.patch b/BlobCache-Success.patch deleted file mode 100644 index a0ad93f..0000000 --- a/BlobCache-Success.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- src/third_party/angle/src/common/vulkan/vk_headers.h.orig 2025-08-15 17:33:15.429396781 +0200 -+++ src/third_party/angle/src/common/vulkan/vk_headers.h 2025-08-15 21:42:41.534691644 +0200 -@@ -10,6 +10,9 @@ - #ifndef LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ - #define LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ - -+//Work around for conflicting definition of "Success" -+#include "libANGLE/BlobCache.h" -+ - #if ANGLE_SHARED_LIBVULKAN - # include - #else ---- src/third_party/angle/src/common/vulkan/vk_headers.h.orig 2025-08-15 17:33:15.429396781 +0200 -+++ src/third_party/angle/src/common/vulkan/vk_headers.h 2025-08-15 21:45:06.096818856 +0200 -@@ -10,6 +10,11 @@ - #ifndef LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ - #define LIBANGLE_RENDERER_VULKAN_VK_HEADERS_H_ - -+//Work around for conflicting definition of "Success" -+#include "libANGLE/BlobCache.h" -+//and "None" -+#include "libANGLE/renderer/vulkan/vk_cache_utils.h" -+ - #if ANGLE_SHARED_LIBVULKAN - # include - #else -- 2.51.1 From ac573703ab65e8f43f99eb523f1130201fff5992408858d42a9c6ca7b2ceb394 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 28 Aug 2025 14:03:55 +0000 Subject: [PATCH 70/80] Accepting request 1301811 from home:dziobian:gulgul-ultron:19 - New upstream release 37.4.0 * Updated Chromium to 138.0.7204.243 * Fixed an issue where net.isOnline() always returned true in utilityProcesses OBS-URL: https://build.opensuse.org/request/show/1301811 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=222 --- electron-37.3.1.tar.zst | 3 --- electron-37.4.0.tar.zst | 3 +++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 electron-37.3.1.tar.zst create mode 100644 electron-37.4.0.tar.zst diff --git a/electron-37.3.1.tar.zst b/electron-37.3.1.tar.zst deleted file mode 100644 index e8fd572..0000000 --- a/electron-37.3.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:edd5a8f5c9d5b2830aed3b564f239eed1a28c244ab0f5f870014161291a60a53 -size 1071121847 diff --git a/electron-37.4.0.tar.zst b/electron-37.4.0.tar.zst new file mode 100644 index 0000000..f0ebdcc --- /dev/null +++ b/electron-37.4.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:085b6bc731179f06dd327f7594b962457a51b75155cefd02769e13d836c55aee +size 1070535466 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 59de664..6acb8b6 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Aug 27 20:12:09 UTC 2025 - Bruno Pitrus + +- New upstream release 37.4.0 + * Updated Chromium to 138.0.7204.243 + * Fixed an issue where net.isOnline() always returned true in utilityProcesses + ------------------------------------------------------------------- Sat Aug 23 18:11:15 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 608d7ca..698a09d 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.3.1 +Version: 37.4.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 189cddfcaec297d022121c31b466201739c5bfa7581593335ea7aa91ef1adb2c Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 12 Sep 2025 05:02:21 +0000 Subject: [PATCH 71/80] Accepting request 1304190 from home:dziobian:gulgul-ultron:19 - New upstream release 37.5.0 * Updated Chromium to 138.0.7204.251 * Updated Node.js to v22.19.0 - 15.6: revert upstream changes to build with old cares (node-cares-1.21-5.patch) - add system-ffmpeg.patch to fix build error - remove useless single executable builder to fix build error (remove-node-sea.patch) OBS-URL: https://build.opensuse.org/request/show/1304190 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=223 --- electron-37.4.0.tar.zst | 3 - electron-37.5.0.tar.zst | 3 + node-cares-1.21-5.patch | 167 ++++++++++++++++++++++++++++++++++++++++ nodejs-electron.changes | 10 +++ nodejs-electron.spec | 11 ++- reduce-gn-tree.patch | 9 ++- remove-node-sea.patch | 46 +++++++++++ system-ffmpeg.patch | 15 ++++ 8 files changed, 255 insertions(+), 9 deletions(-) delete mode 100644 electron-37.4.0.tar.zst create mode 100644 electron-37.5.0.tar.zst create mode 100644 node-cares-1.21-5.patch create mode 100644 remove-node-sea.patch create mode 100644 system-ffmpeg.patch diff --git a/electron-37.4.0.tar.zst b/electron-37.4.0.tar.zst deleted file mode 100644 index f0ebdcc..0000000 --- a/electron-37.4.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:085b6bc731179f06dd327f7594b962457a51b75155cefd02769e13d836c55aee -size 1070535466 diff --git a/electron-37.5.0.tar.zst b/electron-37.5.0.tar.zst new file mode 100644 index 0000000..51f7f16 --- /dev/null +++ b/electron-37.5.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec1719138bb63f78512d4f18c73c1b7e801e6cbd0201ffb4e94e94d52aeb3cb1 +size 1070452159 diff --git a/node-cares-1.21-5.patch b/node-cares-1.21-5.patch new file mode 100644 index 0000000..490944d --- /dev/null +++ b/node-cares-1.21-5.patch @@ -0,0 +1,167 @@ +From c44fa8d0b65d3550157c2fd4b0636fb269764f3e Mon Sep 17 00:00:00 2001 +From: theanarkh +Date: Thu, 10 Jul 2025 23:50:43 +0800 +Subject: [PATCH] dns: support max timeout + +PR-URL: https://github.com/nodejs/node/pull/58440 +Reviewed-By: Luigi Pinca +Reviewed-By: Matteo Collina +--- + doc/api/dns.md | 2 + + lib/internal/dns/utils.js | 20 +++-- + src/cares_wrap.cc | 30 +++++--- + src/cares_wrap.h | 11 +-- + .../parallel/test-dns-resolver-max-timeout.js | 77 +++++++++++++++++++ + 5 files changed, 118 insertions(+), 22 deletions(-) + create mode 100644 test/parallel/test-dns-resolver-max-timeout.js + +diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js +index 55f0b5268abf9d..d036c4c7255eab 100644 +--- a/third_party/electron_node/lib/internal/dns/utils.js ++++ b/third_party/electron_node/lib/internal/dns/utils.js +@@ -25,6 +25,7 @@ const { + validateInt32, + validateOneOf, + validateString, ++ validateUint32, + } = require('internal/validators'); + let binding; + function lazyBinding() { +@@ -49,6 +50,12 @@ function validateTimeout(options) { + return timeout; + } + ++function validateMaxTimeout(options) { ++ const { maxTimeout = 0 } = { ...options }; ++ validateUint32(maxTimeout, 'options.maxTimeout'); ++ return maxTimeout; ++} ++ + function validateTries(options) { + const { tries = 4 } = { ...options }; + validateInt32(tries, 'options.tries', 1); +@@ -67,17 +74,18 @@ class ResolverBase { + constructor(options = undefined) { + const timeout = validateTimeout(options); + const tries = validateTries(options); ++ const maxTimeout = validateMaxTimeout(options); + // If we are building snapshot, save the states of the resolver along + // the way. + if (isBuildingSnapshot()) { +- this[kSnapshotStates] = { timeout, tries }; ++ this[kSnapshotStates] = { timeout, tries, maxTimeout }; + } +- this[kInitializeHandle](timeout, tries); ++ this[kInitializeHandle](timeout, tries, maxTimeout); + } + +- [kInitializeHandle](timeout, tries) { ++ [kInitializeHandle](timeout, tries, maxTimeout) { + const { ChannelWrap } = lazyBinding(); +- this._handle = new ChannelWrap(timeout, tries); ++ this._handle = new ChannelWrap(timeout, tries, maxTimeout); + } + + cancel() { +@@ -187,8 +195,8 @@ class ResolverBase { + } + + [kDeserializeResolver]() { +- const { timeout, tries, localAddress, servers } = this[kSnapshotStates]; +- this[kInitializeHandle](timeout, tries); ++ const { timeout, tries, maxTimeout, localAddress, servers } = this[kSnapshotStates]; ++ this[kInitializeHandle](timeout, tries, maxTimeout); + if (localAddress) { + const { ipv4, ipv6 } = localAddress; + this._handle.setLocalAddress(ipv4, ipv6); +diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc +index 7773314fa53bc1..e9516b03ec8960 100644 +--- a/third_party/electron_node/src/cares_wrap.cc ++++ b/third_party/electron_node/src/cares_wrap.cc +@@ -787,14 +787,15 @@ Maybe ParseSoaReply(Environment* env, + } + } // anonymous namespace + +-ChannelWrap::ChannelWrap( +- Environment* env, +- Local object, +- int timeout, +- int tries) ++ChannelWrap::ChannelWrap(Environment* env, ++ Local object, ++ int timeout, ++ int tries, ++ int max_timeout) + : AsyncWrap(env, object, PROVIDER_DNSCHANNEL), + timeout_(timeout), +- tries_(tries) { ++ tries_(tries), ++ max_timeout_(max_timeout) { + MakeWeak(); + + Setup(); +@@ -808,13 +809,15 @@ void ChannelWrap::MemoryInfo(MemoryTracker* tracker) const { + + void ChannelWrap::New(const FunctionCallbackInfo& args) { + CHECK(args.IsConstructCall()); +- CHECK_EQ(args.Length(), 2); ++ CHECK_EQ(args.Length(), 3); + CHECK(args[0]->IsInt32()); + CHECK(args[1]->IsInt32()); ++ CHECK(args[2]->IsInt32()); + const int timeout = args[0].As()->Value(); + const int tries = args[1].As()->Value(); ++ const int max_timeout = args[2].As()->Value(); + Environment* env = Environment::GetCurrent(args); +- new ChannelWrap(env, args.This(), timeout, tries); ++ new ChannelWrap(env, args.This(), timeout, tries, max_timeout); + } + + GetAddrInfoReqWrap::GetAddrInfoReqWrap(Environment* env, +@@ -879,9 +882,14 @@ void ChannelWrap::Setup() { + } + + /* We do the call to ares_init_option for caller. */ +- const int optmask = ARES_OPT_FLAGS | ARES_OPT_TIMEOUTMS | +- ARES_OPT_SOCK_STATE_CB | ARES_OPT_TRIES | +- ARES_OPT_QUERY_CACHE; ++ int optmask = ARES_OPT_FLAGS | ARES_OPT_TIMEOUTMS | ARES_OPT_SOCK_STATE_CB | ++ ARES_OPT_TRIES | ARES_OPT_QUERY_CACHE; ++ ++ if (max_timeout_ > 0) { ++ options.maxtimeout = max_timeout_; ++ optmask |= ARES_OPT_MAXTIMEOUTMS; ++ } ++ + r = ares_init_options(&channel_, &options, optmask); + + if (r != ARES_SUCCESS) { +diff --git a/src/cares_wrap.h b/src/cares_wrap.h +index 876ec745d4fcc5..fd66a67164b3d3 100644 +--- a/third_party/electron_node/src/cares_wrap.h ++++ b/third_party/electron_node/src/cares_wrap.h +@@ -152,11 +152,11 @@ struct NodeAresTask final : public MemoryRetainer { + + class ChannelWrap final : public AsyncWrap { + public: +- ChannelWrap( +- Environment* env, +- v8::Local object, +- int timeout, +- int tries); ++ ChannelWrap(Environment* env, ++ v8::Local object, ++ int timeout, ++ int tries, ++ int max_timeout); + ~ChannelWrap() override; + + static void New(const v8::FunctionCallbackInfo& args); +@@ -191,6 +191,7 @@ class ChannelWrap final : public AsyncWrap { + bool library_inited_ = false; + int timeout_; + int tries_; ++ int max_timeout_; + int active_query_count_ = 0; + NodeAresTask::List task_list_; + }; diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 6acb8b6..123c221 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Sep 11 10:08:41 UTC 2025 - Bruno Pitrus + +- New upstream release 37.5.0 + * Updated Chromium to 138.0.7204.251 + * Updated Node.js to v22.19.0 +- 15.6: revert upstream changes to build with old cares (node-cares-1.21-5.patch) +- add system-ffmpeg.patch to fix build error +- remove useless single executable builder to fix build error (remove-node-sea.patch) + ------------------------------------------------------------------- Wed Aug 27 20:12:09 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 698a09d..75ece09 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.4.0 +Version: 37.5.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -212,6 +212,7 @@ Source470: node-cares-1.21.patch Source471: node-cares-1.21-2.patch Source472: node-cares-1.21-3.patch Source473: node-cares-1.21-4.patch +Source474: node-cares-1.21-5.patch # and spirv 2023 Source480: angle-SPV_BINARY_TO_TEXT_OPTION_NESTED_INDENT.patch #and nghttp 1.40 @@ -284,12 +285,15 @@ Patch607: build-without-guest-view.patch Patch608: vaapi-no-encoders.patch Patch609: remove-probabilistic-token-which-uses-private-join-and-compute.patch Patch610: masked_domain_list-flatbuffers.patch +Patch611: remove-node-sea.patch # PATCHES to use system libs Patch1000: do-not-build-libvulkan.so.patch Patch1017: system-libdrm.patch +Patch1036: node-version-ck.patch +Patch1037: system-dragonbox.patch # http://svnweb.mageia.org/packages/updates/7/chromium-browser-stable/current/SOURCES/chromium-74-pdfium-system-libopenjpeg2.patch?view=markup Patch1038: pdfium-fix-system-libs.patch Patch1045: angle-system-xxhash.patch @@ -317,8 +321,7 @@ Patch1092: fix-system-highway.patch Patch1093: system-sqlite.patch Patch1094: absl_strings-missing-headers.patch Patch1095: system-zstd-in-node.patch -Patch1036: node-version-ck.patch -Patch1037: system-dragonbox.patch +Patch1096: system-ffmpeg.patch # PATCHES to fix interaction with third-party software @@ -344,7 +347,6 @@ Patch2061: private_aggregation_host-uint128.patch Patch2062: wayland_version.patch #Conditionably disable feature which requires new highway Patch2064: blink-shape_result-highway.patch -#Patch2065: node-llhttp9.3.patch Patch2066: angle-BlobCache-Success.patch Patch2067: partition_alloc-strict-aliasing.patch Patch2068: llhttp-lax-vector-conversions.patch @@ -740,6 +742,7 @@ test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = patch -R -p1 < %SOURCE472 patch -R -p1 < %SOURCE471 patch -R -p1 < %SOURCE470 +patch -R -p1 < %SOURCE474 patch -R -p1 < %SOURCE473 %endif diff --git a/reduce-gn-tree.patch b/reduce-gn-tree.patch index 4a6afd7..8fddbec 100644 --- a/reduce-gn-tree.patch +++ b/reduce-gn-tree.patch @@ -1,14 +1,19 @@ Run gn starting at only the targets we want to build (//electron:blah), not at (//...) to avoid hitting asserts in dead code. This makes this overriden build argument dead code which causes a warning during `gen` and more importantly `desc`. Remove it. ---- src/electron/build/args/all.gn.orig 2025-07-19 11:30:22.309996384 +0200 -+++ src/electron/build/args/all.gn 2025-07-19 16:27:55.565670609 +0200 +--- src/electron/build/args/all.gn.orig 2025-09-10 22:18:06.769733598 +0200 ++++ src/electron/build/args/all.gn 2025-09-10 22:54:05.929977283 +0200 @@ -1,5 +1,4 @@ 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 = 136 +@@ -75,4 +74,3 @@ enterprise_cloud_content_analysis = fals + content_enable_legacy_ipc = true + + # We don't use anything from here, and it causes target collisions +-enable_linux_installer = false All gn list calls must be also fixed because otherwise they fail just as gn gen does diff --git a/remove-node-sea.patch b/remove-node-sea.patch new file mode 100644 index 0000000..fe82f4b --- /dev/null +++ b/remove-node-sea.patch @@ -0,0 +1,46 @@ +Do not build single-executable builder, it is useless on distro electron and fails to compile + +--- src/third_party/electron_node/src/node_sea.cc.orig 2025-09-10 22:20:53.329753565 +0200 ++++ src/third_party/electron_node/src/node_sea.cc 2025-09-11 12:06:23.007498591 +0200 +@@ -289,6 +289,7 @@ struct SeaConfig { + std::unordered_map assets; + }; + ++#if 0 + std::optional ParseSingleExecutableConfig( + const std::string& config_path) { + std::string config; +@@ -432,6 +433,7 @@ std::optional ParseSingleExec + + return result; + } ++#endif + + ExitCode GenerateSnapshotForSEA(const SeaConfig& config, + const std::vector& args, +@@ -627,6 +629,7 @@ ExitCode GenerateSingleExecutableBlob( + + } // anonymous namespace + ++#if 0 + ExitCode BuildSingleExecutableBlob(const std::string& config_path, + const std::vector& args, + const std::vector& exec_args) { +@@ -640,6 +643,7 @@ ExitCode BuildSingleExecutableBlob(const + + return ExitCode::kGenericUserError; + } ++#endif + + void GetAsset(const FunctionCallbackInfo& args) { + CHECK_EQ(args.Length(), 1); +--- src/third_party/electron_node/unofficial.gni.orig 2025-09-10 22:31:58.561822889 +0200 ++++ src/third_party/electron_node/unofficial.gni 2025-09-11 12:03:47.577452435 +0200 +@@ -48,6 +48,7 @@ template("node_gn_build") { + if (v8_enable_i18n_support) { + defines += [ "NODE_HAVE_I18N_SUPPORT=1" ] + } ++ defines += ["DISABLE_SINGLE_EXECUTABLE_APPLICATION=1"] + } + + config("node_external_config") { diff --git a/system-ffmpeg.patch b/system-ffmpeg.patch new file mode 100644 index 0000000..1a9c465 --- /dev/null +++ b/system-ffmpeg.patch @@ -0,0 +1,15 @@ +--- src/electron/BUILD.gn.orig 2025-09-10 22:18:06.769733598 +0200 ++++ src/electron/BUILD.gn 2025-09-10 22:58:47.594001652 +0200 +@@ -1650,11 +1650,7 @@ if (is_linux && is_official_build) { + deps = [ "//third_party/angle:libGLESv2" ] + } + +- strip_binary("strip_libffmpeg_shlib") { +- binary_input = "$root_out_dir/libffmpeg.so" +- symbol_output = "$root_out_dir/debug/libffmpeg.so.debug" +- compress_debug_sections = true +- deps = [ "//third_party/ffmpeg" ] ++ source_set("strip_libffmpeg_shlib") { + } + + strip_binary("strip_libvk_swiftshader_shlib") { -- 2.51.1 From 02ea4d4d147e91fb596a1776374f60632f2160f5fe407d541bec9737417756c1 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Mon, 15 Sep 2025 17:53:14 +0000 Subject: [PATCH 72/80] Accepting request 1305014 from home:dziobian:gulgul-ultron:19 - aarch64: add swiftshader-llvm21.patch to fix ftbfs with new LLVM OBS-URL: https://build.opensuse.org/request/show/1305014 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=224 --- nodejs-electron.changes | 5 +++++ nodejs-electron.spec | 1 + swiftshader-llvm21.patch | 43 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 swiftshader-llvm21.patch diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 123c221..7ab6cdb 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 15 17:51:55 UTC 2025 - Bruno Pitrus + +- aarch64: add swiftshader-llvm21.patch to fix ftbfs with new LLVM + ------------------------------------------------------------------- Thu Sep 11 10:08:41 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 75ece09..dc788c9 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -384,6 +384,7 @@ Patch3220: picture_in_picture_events_info-string-constexpr.patch Patch3221: event_record-optional-initializer.patch Patch3222: ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch Patch3223: v8-simd-flax-vector-conversions.patch +Patch3224: swiftshader-llvm21.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. diff --git a/swiftshader-llvm21.patch b/swiftshader-llvm21.patch new file mode 100644 index 0000000..6f7d367 --- /dev/null +++ b/swiftshader-llvm21.patch @@ -0,0 +1,43 @@ +--- src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 2025-09-15 18:56:08.652126119 +0200 ++++ /var/tmp/build-root/openSUSE_Tumbleweed-x86_64/home/abuild/rpmbuild/BUILD/nodejs-electron-37.5.0-build/src/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 2025-09-15 19:25:40.331977649 +0200 +@@ -78,6 +78,10 @@ __pragma(warning(push)) + #include "llvm/ExecutionEngine/Orc/AbsoluteSymbols.h" + #endif + ++#if LLVM_VERSION_MAJOR >= 21 // https://github.com/llvm/llvm-project/commit/0faa181434cf959110651fe974bef31e7390eba8 ++#include "llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h" ++#endif ++ + #ifdef _MSC_VER + __pragma(warning(pop)) + #endif +@@ -820,7 +824,11 @@ public: + , session(std::move(Unwrap(llvm::orc::SelfExecutorProcessControl::Create()))) + #endif + #if USE_LEGACY_OBJECT_LINKING_LAYER +- , objectLayer(session, [this]() { ++ , objectLayer(session, [this]( ++#if LLVM_VERSION_MAJOR >= 21 // https://github.com/llvm/llvm-project/commit/cd585864c0bbbd74ed2a2b1ccc191eed4d1c8f90 ++ const llvm::MemoryBuffer & ++#endif ++ ) { + return std::make_unique(&memoryMapper); + }) + #else +@@ -959,7 +967,15 @@ JITBuilder::JITBuilder() + , module(new llvm::Module("", *context)) + , builder(new llvm::IRBuilder<>(*context)) + { +- module->setTargetTriple(LLVM_DEFAULT_TARGET_TRIPLE); ++ module->setTargetTriple( ++#if LLVM_VERSION_MAJOR >= 21 // https://github.com/llvm/llvm-project/commit/979c275097a642e9b96c6b0a12f013c831af3a6e ++ llvm::Triple( ++#endif ++ LLVM_DEFAULT_TARGET_TRIPLE ++#if LLVM_VERSION_MAJOR >= 21 ++ ) ++#endif ++ ); + module->setDataLayout(JITGlobals::get()->getDataLayout()); + + msanInstrumentation = getPragmaState(MemorySanitizerInstrumentation); -- 2.51.1 From 78f342634018652bcaf9774844d7f7d7a08950ffa18de9ffe312d2566915de5e Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 17 Sep 2025 08:33:57 +0000 Subject: [PATCH 73/80] Accepting request 1305306 from home:dziobian:gulgul-ultron:19 - New upstream release 37.5.1 * v8: Don't assume that upper 32-bit of Int32MulOvfCheck are 0 OBS-URL: https://build.opensuse.org/request/show/1305306 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=225 --- electron-37.5.0.tar.zst | 3 --- electron-37.5.1.tar.zst | 3 +++ nodejs-electron.changes | 6 ++++++ nodejs-electron.spec | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 electron-37.5.0.tar.zst create mode 100644 electron-37.5.1.tar.zst diff --git a/electron-37.5.0.tar.zst b/electron-37.5.0.tar.zst deleted file mode 100644 index 51f7f16..0000000 --- a/electron-37.5.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ec1719138bb63f78512d4f18c73c1b7e801e6cbd0201ffb4e94e94d52aeb3cb1 -size 1070452159 diff --git a/electron-37.5.1.tar.zst b/electron-37.5.1.tar.zst new file mode 100644 index 0000000..baf679c --- /dev/null +++ b/electron-37.5.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6600bc0f1db2d67cbddd8f4c3308d3160d940e7636b9aaeaa0e1b637f35bee9e +size 1070017015 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 7ab6cdb..b4c2224 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 17 05:33:20 UTC 2025 - Bruno Pitrus + +- New upstream release 37.5.1 + * v8: Don't assume that upper 32-bit of Int32MulOvfCheck are 0 + ------------------------------------------------------------------- Mon Sep 15 17:51:55 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index dc788c9..7d59d2f 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.5.0 +Version: 37.5.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From ced10808c1e09e901a1f38a663b4e974d40bbbde492242243698d8ef79295ea7 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 8 Oct 2025 20:31:57 +0200 Subject: [PATCH 74/80] Electron 37.6.1 --- electron-37.5.1.tar.zst | 3 --- electron-37.6.1.tar.zst | 3 +++ nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 electron-37.5.1.tar.zst create mode 100644 electron-37.6.1.tar.zst diff --git a/electron-37.5.1.tar.zst b/electron-37.5.1.tar.zst deleted file mode 100644 index baf679c..0000000 --- a/electron-37.5.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6600bc0f1db2d67cbddd8f4c3308d3160d940e7636b9aaeaa0e1b637f35bee9e -size 1070017015 diff --git a/electron-37.6.1.tar.zst b/electron-37.6.1.tar.zst new file mode 100644 index 0000000..3c86218 --- /dev/null +++ b/electron-37.6.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6ebdb6b2958c0cbd8103fd81036edad9ad8f71adee7128de79a6fd2ed6cf428 +size 1070653819 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index b4c2224..42c471b 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Oct 8 06:11:24 UTC 2025 - Bruno Pitrus + +- New upstream release 37.6.1 + * fix: runtime JS error that crashes GetPackageJSON +- New upstream release 37.6.0 + * Allowed for persisting File System API grant status within a given session + ------------------------------------------------------------------- Wed Sep 17 05:33:20 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 7d59d2f..f55ac5d 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.5.1 +Version: 37.6.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 644b232121562c5929b59fdabbeaa2542fb62a8a454ab54b456d7023fc7fe52a Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Thu, 16 Oct 2025 22:00:55 +0200 Subject: [PATCH 75/80] 37.7.0 --- electron-37.6.1.tar.zst | 3 --- electron-37.7.0.tar.zst | 3 +++ nodejs-electron.changes | 9 +++++++++ nodejs-electron.spec | 9 +++++---- remove-node-sea.patch | 14 +++++++------- 5 files changed, 24 insertions(+), 14 deletions(-) delete mode 100644 electron-37.6.1.tar.zst create mode 100644 electron-37.7.0.tar.zst diff --git a/electron-37.6.1.tar.zst b/electron-37.6.1.tar.zst deleted file mode 100644 index 3c86218..0000000 --- a/electron-37.6.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e6ebdb6b2958c0cbd8103fd81036edad9ad8f71adee7128de79a6fd2ed6cf428 -size 1070653819 diff --git a/electron-37.7.0.tar.zst b/electron-37.7.0.tar.zst new file mode 100644 index 0000000..8b760a0 --- /dev/null +++ b/electron-37.7.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a4d02bfd591b0fef856d382f33bc2fbeeff73f310df0ba33e78f5114032d97a +size 1073123903 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 42c471b..b5bbed6 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Oct 16 19:56:42 UTC 2025 - Bruno Pitrus + +- New upstream release 37.7.0 + * NodeJS 22.20.0 + * Fixed addBrowserView to prevent unnecessary removal and re-adding of the same BrowserView + * Fixed an issue where authentication via websockets can crash +- Fedora: use bundled simdjson due to system version being too old + ------------------------------------------------------------------- Wed Oct 8 06:11:24 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index f55ac5d..3b9d571 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -73,6 +73,7 @@ ExcludeArch: %arm %bcond_with system_yuv +%bcond_with system_simdjson #CPU level. Leap 16 requires x86-64-v2 so we may force it inside V8. %if 0%{?suse_version} >= 1550 && 0%{?suse_version} < 1650 @@ -109,10 +110,9 @@ ExcludeArch: %arm %if 0%{?fedora} %bcond_without system_histogram -%bcond_without system_simdjson %else %bcond_with system_histogram -%bcond_with system_simdjson + %endif @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.6.1 +Version: 37.7.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -614,7 +614,8 @@ BuildRequires: pkgconfig(Qt6Widgets) BuildRequires: cmake(re2) >= 11 %endif %if %{with system_simdjson} -BuildRequires: pkgconfig(simdjson) +# requires https://github.com/simdjson/simdjson/commit/f64c004cb71b08fdadb9881e2f0525800a0356e2 +BuildRequires: pkgconfig(simdjson) >= 3.13 %endif %if 0%{?suse_version} BuildRequires: spirv-headers diff --git a/remove-node-sea.patch b/remove-node-sea.patch index fe82f4b..993180d 100644 --- a/remove-node-sea.patch +++ b/remove-node-sea.patch @@ -1,16 +1,16 @@ Do not build single-executable builder, it is useless on distro electron and fails to compile ---- src/third_party/electron_node/src/node_sea.cc.orig 2025-09-10 22:20:53.329753565 +0200 -+++ src/third_party/electron_node/src/node_sea.cc 2025-09-11 12:06:23.007498591 +0200 -@@ -289,6 +289,7 @@ struct SeaConfig { - std::unordered_map assets; +--- src/third_party/electron_node/src/node_sea.cc.orig 2025-10-15 11:27:25.079700709 +0200 ++++ src/third_party/electron_node/src/node_sea.cc 2025-10-15 12:04:33.977861545 +0200 +@@ -384,6 +384,7 @@ struct SeaConfig { + std::vector exec_argv; }; +#if 0 std::optional ParseSingleExecutableConfig( const std::string& config_path) { std::string config; -@@ -432,6 +433,7 @@ std::optional ParseSingleExec +@@ -571,6 +572,7 @@ std::optional ParseSingleExec return result; } @@ -18,7 +18,7 @@ Do not build single-executable builder, it is useless on distro electron and fai ExitCode GenerateSnapshotForSEA(const SeaConfig& config, const std::vector& args, -@@ -627,6 +629,7 @@ ExitCode GenerateSingleExecutableBlob( +@@ -772,6 +774,7 @@ ExitCode GenerateSingleExecutableBlob( } // anonymous namespace @@ -26,7 +26,7 @@ Do not build single-executable builder, it is useless on distro electron and fai ExitCode BuildSingleExecutableBlob(const std::string& config_path, const std::vector& args, const std::vector& exec_args) { -@@ -640,6 +643,7 @@ ExitCode BuildSingleExecutableBlob(const +@@ -785,6 +788,7 @@ ExitCode BuildSingleExecutableBlob(const return ExitCode::kGenericUserError; } -- 2.51.1 From 965fbce4923aaf81e6b21161d4d22ceeab018a266a20cf181bbe646c9804aa26 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 22 Oct 2025 21:40:42 +0200 Subject: [PATCH 76/80] 37.7.1 + pipewire fix --- electron-37.7.0.tar.zst | 3 -- electron-37.7.1.tar.zst | 3 ++ nodejs-electron.changes | 8 ++++ nodejs-electron.spec | 3 +- ...ion-missing-spa_pod_object_find_prop.patch | 44 +++++++++++++++++++ 5 files changed, 57 insertions(+), 4 deletions(-) delete mode 100644 electron-37.7.0.tar.zst create mode 100644 electron-37.7.1.tar.zst create mode 100644 webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch diff --git a/electron-37.7.0.tar.zst b/electron-37.7.0.tar.zst deleted file mode 100644 index 8b760a0..0000000 --- a/electron-37.7.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a4d02bfd591b0fef856d382f33bc2fbeeff73f310df0ba33e78f5114032d97a -size 1073123903 diff --git a/electron-37.7.1.tar.zst b/electron-37.7.1.tar.zst new file mode 100644 index 0000000..288b5ff --- /dev/null +++ b/electron-37.7.1.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b854e26ec0b793e87cf8ce6a7bb8731968c60152e37b5c1eef9c8d722960e88f +size 1073582693 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index b5bbed6..59c430d 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Oct 22 19:32:18 UTC 2025 - Bruno Pitrus + +- New upstream release 37.7.1 + * Fixed an issue where changing the resizable property on a window would break the styles of a transparent window + * Fixed white flash on call to BrowserWindow.show +- Add webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch to fix build error with new pipewire + ------------------------------------------------------------------- Thu Oct 16 19:56:42 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 3b9d571..075eaa4 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.7.0 +Version: 37.7.1 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -385,6 +385,7 @@ Patch3221: event_record-optional-initializer.patch Patch3222: ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch Patch3223: v8-simd-flax-vector-conversions.patch Patch3224: swiftshader-llvm21.patch +Patch3225: webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. diff --git a/webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch b/webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch new file mode 100644 index 0000000..381fdbb --- /dev/null +++ b/webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch @@ -0,0 +1,44 @@ +From 97a8bd200d63ab96786ef1064de0195bccadcbed Mon Sep 17 00:00:00 2001 +From: Your Name +Date: Fri, 10 Oct 2025 16:48:14 +0300 +Subject: [PATCH] fix pipewire headers + + 8:26.15 In file included from Unified_cpp_ure_internal_impl_gn0.cpp:38: + 8:26.16 firefox-143.0.3/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc:149:10: error: use of undeclared identifier 'spa_pod_object_find_prop'; did you mean 'spa_pod_object_body'? + 8:26.16 149 | prop = spa_pod_object_find_prop(obj, prop, SPA_FORMAT_VIDEO_framerate); + 8:26.16 | ^ + 8:26.16 /usr/include/spa-0.2/spa/pod/pod.h:164:8: note: 'spa_pod_object_body' declared here + 8:26.16 164 | struct spa_pod_object_body { + 8:26.16 | ^ + 8:26.16 In file included from Unified_cpp_ure_internal_impl_gn0.cpp:38: + 8:26.16 firefox-143.0.3/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc:151:11: error: use of undeclared identifier 'spa_pod_get_values' + 8:26.16 151 | val = spa_pod_get_values(&prop->value, &n_items, &choice); + 8:26.16 | ^ + 8:26.16 firefox-143.0.3/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc:170:10: error: use of undeclared identifier 'spa_pod_object_find_prop'; did you mean 'spa_pod_object_body'? + 8:26.16 170 | prop = spa_pod_object_find_prop(obj, prop, SPA_FORMAT_VIDEO_size); + 8:26.16 | ^ + 8:26.17 /usr/include/spa-0.2/spa/pod/pod.h:164:8: note: 'spa_pod_object_body' declared here + 8:26.17 164 | struct spa_pod_object_body { + 8:26.17 | ^ + 8:26.17 In file included from Unified_cpp_ure_internal_impl_gn0.cpp:38: + 8:26.17 /var/tmp/portage/www-client/firefox-143.0.3/work/firefox-143.0.3/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc:174:9: error: use of undeclared identifier 'spa_pod_get_values' + 8:26.17 174 | val = spa_pod_get_values(&prop->value, &n_items, &choice); +--- + .../libwebrtc/modules/video_capture/linux/pipewire_session.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +index 25c4dfa..7216874 100644 +--- a/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + + #include +-- +2.49.0 + -- 2.51.1 From 2676b72572dcf3a2d6744e55ef52929bb1980bc5a3a413967681656c23e98c84 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Wed, 29 Oct 2025 21:15:47 +0100 Subject: [PATCH 77/80] 37.8.0 --- electron-37.7.1.tar.zst | 3 --- electron-37.8.0.tar.zst | 3 +++ linux_seccomp-SYS_SECCOMP.patch | 36 +++++++++++++++++++++++++++++++++ nodejs-electron.changes | 7 +++++++ nodejs-electron.spec | 3 ++- 5 files changed, 48 insertions(+), 4 deletions(-) delete mode 100644 electron-37.7.1.tar.zst create mode 100644 electron-37.8.0.tar.zst create mode 100644 linux_seccomp-SYS_SECCOMP.patch diff --git a/electron-37.7.1.tar.zst b/electron-37.7.1.tar.zst deleted file mode 100644 index 288b5ff..0000000 --- a/electron-37.7.1.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b854e26ec0b793e87cf8ce6a7bb8731968c60152e37b5c1eef9c8d722960e88f -size 1073582693 diff --git a/electron-37.8.0.tar.zst b/electron-37.8.0.tar.zst new file mode 100644 index 0000000..3dab457 --- /dev/null +++ b/electron-37.8.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06a41094039c15b5a946d1e4265f651b844f83733f6a67c4af07f082f716f20a +size 1070499795 diff --git a/linux_seccomp-SYS_SECCOMP.patch b/linux_seccomp-SYS_SECCOMP.patch new file mode 100644 index 0000000..66f5ab4 --- /dev/null +++ b/linux_seccomp-SYS_SECCOMP.patch @@ -0,0 +1,36 @@ +If signal.h is included after this header, this results in a confusing error: +In file included from ../../sandbox/linux/bpf_dsl/trap_registry.h:13, + from ../../sandbox/linux/bpf_dsl/bpf_dsl.h:18, + from ../../sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc:17: +../../sandbox/linux/system_headers/linux_seccomp.h:218:39: error: expected identifier before numeric constant + 218 | #define SYS_SECCOMP 1 + | ^ +../../sandbox/linux/system_headers/linux_seccomp.h:218:39: error: expected '}' before numeric constant +In file included from /usr/include/signal.h:58, + from ../../sandbox/linux/services/syscall_wrappers.h:8, + from ../../sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc:22: +/usr/include/bits/siginfo-consts.h:218:1: note: to match this '{' + 218 | { + | ^ +../../sandbox/linux/system_headers/linux_seccomp.h:218:39: error: expected unqualified-id before numeric constant + 218 | #define SYS_SECCOMP 1 + | ^ +In file included from /usr/include/features.h:524, + from /usr/include/sys/types.h:25, + from ../../sandbox/linux/seccomp-bpf-helpers/baseline_policy.h:8, + from ../../sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc:5: +/usr/include/signal.h:393:1: error: expected declaration before '}' token + 393 | __END_DECLS + | ^~~~~~~~~~~ + + +--- src/sandbox/linux/system_headers/linux_seccomp.h.orig 2025-10-29 07:16:45.191080342 +0100 ++++ src/sandbox/linux/system_headers/linux_seccomp.h 2025-10-29 20:08:39.559745669 +0100 +@@ -5,6 +5,7 @@ + #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SECCOMP_H_ + #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SECCOMP_H_ + ++#include + #include + #include + diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 59c430d..012be84 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 29 20:14:09 UTC 2025 - Bruno Pitrus + +- New upstream release 37.8.0 + * Support dynamic ESM imports in non-context isolated preloads +- Add linux_seccomp-SYS_SECCOMP.patch to fix ftbfs with new glibc + ------------------------------------------------------------------- Wed Oct 22 19:32:18 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index 075eaa4..a4ddfea 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.7.1 +Version: 37.8.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS @@ -386,6 +386,7 @@ Patch3222: ANNOTATE_CONTIGUOUS_CONTAINER-Wodr.patch Patch3223: v8-simd-flax-vector-conversions.patch Patch3224: swiftshader-llvm21.patch Patch3225: webrtc-pipewire_session-missing-spa_pod_object_find_prop.patch +Patch3226: linux_seccomp-SYS_SECCOMP.patch # Patches to re-enable upstream force disabled features. # There's no sense in submitting them but they may be reused as-is by other packagers. -- 2.51.1 From 3716f4120053e684c705d62b137e0642ba862300da8e492b583d59a2aaa7beff Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 8 Nov 2025 19:40:56 +0100 Subject: [PATCH 78/80] 37.9.0 --- electron-37.8.0.tar.zst | 3 --- electron-37.9.0.tar.zst | 3 +++ nodejs-electron.changes | 9 +++++++++ nodejs-electron.spec | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) delete mode 100644 electron-37.8.0.tar.zst create mode 100644 electron-37.9.0.tar.zst diff --git a/electron-37.8.0.tar.zst b/electron-37.8.0.tar.zst deleted file mode 100644 index 3dab457..0000000 --- a/electron-37.8.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:06a41094039c15b5a946d1e4265f651b844f83733f6a67c4af07f082f716f20a -size 1070499795 diff --git a/electron-37.9.0.tar.zst b/electron-37.9.0.tar.zst new file mode 100644 index 0000000..c7801f9 --- /dev/null +++ b/electron-37.9.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1185db77071cc214fbf5c4ff1079f92f5d282ca32908f78b488a2d5654d1c22b +size 1070553117 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 012be84..2a2f53d 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Nov 8 18:37:21 UTC 2025 - Bruno Pitrus + +- New upstream release 37.9.0 + * Node 22.21.1 + * Fixed an issue on Wayland where right-clicking in the titlebar could break mouse interactions. + * fix crash when inspector agent attempts to evaluate on provisional frames + * Fixed draw smoothing round corner issue + ------------------------------------------------------------------- Wed Oct 29 20:14:09 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index a4ddfea..c371a23 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.8.0 +Version: 37.9.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1 From 4e8df4ba7675109b39932c5a57b88a5896639e6cfe4f2279a12c9520c2212124 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Sat, 8 Nov 2025 19:49:16 +0100 Subject: [PATCH 79/80] fix rawhide --- nodejs-electron.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nodejs-electron.spec b/nodejs-electron.spec index c371a23..e333436 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -413,6 +413,9 @@ BuildRequires: HdrHistogram_c-devel BuildRequires: hicolor-icon-theme BuildRequires: hwdata BuildRequires: ImageMagick +%if 0%{?fedora} >= 34 +BuildRequires: increase-file-max +%endif %if 0%{?fedora} BuildRequires: libatomic %endif -- 2.51.1 From 782dc774d78325ef6222cc76ed1b43212e5d7852b7b2c31e4cab8f89ee45e811 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Fri, 14 Nov 2025 19:59:14 +0100 Subject: [PATCH 80/80] 37.10.0 --- electron-37.10.0.tar.zst | 3 +++ electron-37.9.0.tar.zst | 3 --- nodejs-electron.changes | 8 ++++++++ nodejs-electron.spec | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 electron-37.10.0.tar.zst delete mode 100644 electron-37.9.0.tar.zst diff --git a/electron-37.10.0.tar.zst b/electron-37.10.0.tar.zst new file mode 100644 index 0000000..1b090d2 --- /dev/null +++ b/electron-37.10.0.tar.zst @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30ad663b798f0e403820b2862fe7d3fd9c34ce0b72b1091c251e7a04261755f2 +size 1070430959 diff --git a/electron-37.9.0.tar.zst b/electron-37.9.0.tar.zst deleted file mode 100644 index c7801f9..0000000 --- a/electron-37.9.0.tar.zst +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1185db77071cc214fbf5c4ff1079f92f5d282ca32908f78b488a2d5654d1c22b -size 1070553117 diff --git a/nodejs-electron.changes b/nodejs-electron.changes index 2a2f53d..a97cb44 100644 --- a/nodejs-electron.changes +++ b/nodejs-electron.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Nov 14 18:57:41 UTC 2025 - Bruno Pitrus + +- New upstream release 37.10.0 + * Added app.isHardwareAccelerationEnabled(). + * Automatically focus DevTools when element is inspected or breakpoint is triggered. + * v8: Preserve field repr in property array extension + ------------------------------------------------------------------- Sat Nov 8 18:37:21 UTC 2025 - Bruno Pitrus diff --git a/nodejs-electron.spec b/nodejs-electron.spec index e333436..16c957a 100644 --- a/nodejs-electron.spec +++ b/nodejs-electron.spec @@ -186,7 +186,7 @@ ExcludeArch: %arm Name: nodejs-electron -Version: 37.9.0 +Version: 37.10.0 %global tag_version %version Release: 0 Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS -- 2.51.1