From 8d58ed6d920f50e6886d9e9d6916ef8252c3f62e Mon Sep 17 00:00:00 2001 From: Chongyun Lee <45286352+licy183@users.noreply.github.com> Date: Tue, 6 Feb 2024 15:45:12 +0800 Subject: [PATCH] cr-patches: update for 6167 --- .../add-missing-typename-8/6167.patch | 19 + .../add-missing-typename-9/6167.patch | 11 + .../6167.patch | 122 +++ .../6167.patch | 31 + common-files/chromium-patches/metadata.json | 58 +- .../6167.patch | 36 + .../remove-xorg-from-build-deps/6167.patch | 12 + .../6167.patch | 14 + .../revert-blink-v8-cxx20/6167.patch | 725 ++++++++++++++++++ .../revert-rust-qr-scanner/6167.patch | 169 ++++ ...ee-way comparison-operator-for-vector.diff | 108 +++ .../sysroot-patches/libcxx-17-lwg3545.diff | 45 ++ .../libstdcxx3-10-lwg3545.diff | 163 ++++ .../use-std_to_address-from-libcxx/6167.patch | 30 + .../6167.patch | 15 + .../z-iwyu-blink-include-mutex/6167.patch | 10 + .../6167.patch | 10 + .../6167.patch | 10 + .../z-iwyu-gfx-include-bitset/6167.patch | 11 + 19 files changed, 1595 insertions(+), 4 deletions(-) create mode 100644 common-files/chromium-patches/add-missing-typename-8/6167.patch create mode 100644 common-files/chromium-patches/add-missing-typename-9/6167.patch create mode 100644 common-files/chromium-patches/blink-fix-structured-binding-declaration/6167.patch create mode 100644 common-files/chromium-patches/compiler-remove-unsupported-flags/6167.patch create mode 100644 common-files/chromium-patches/remove-usage-vector-three_way_compare/6167.patch create mode 100644 common-files/chromium-patches/remove-xorg-from-build-deps/6167.patch create mode 100644 common-files/chromium-patches/resource_attribution-query_params-no-constexpr-operator-equal/6167.patch create mode 100644 common-files/chromium-patches/revert-blink-v8-cxx20/6167.patch create mode 100644 common-files/chromium-patches/revert-rust-qr-scanner/6167.patch create mode 100644 common-files/chromium-patches/sysroot-patches/libcxx-17-impl-three-way comparison-operator-for-vector.diff create mode 100644 common-files/chromium-patches/sysroot-patches/libcxx-17-lwg3545.diff create mode 100644 common-files/chromium-patches/sysroot-patches/libstdcxx3-10-lwg3545.diff create mode 100644 common-files/chromium-patches/use-std_to_address-from-libcxx/6167.patch create mode 100644 common-files/chromium-patches/y-mime_util_xdg-file_info-consturctor/6167.patch create mode 100644 common-files/chromium-patches/z-iwyu-blink-include-mutex/6167.patch create mode 100644 common-files/chromium-patches/z-iwyu-crypto-hkdf-include-vector/6167.patch create mode 100644 common-files/chromium-patches/z-iwyu-display_color_management-include-string/6167.patch create mode 100644 common-files/chromium-patches/z-iwyu-gfx-include-bitset/6167.patch diff --git a/common-files/chromium-patches/add-missing-typename-8/6167.patch b/common-files/chromium-patches/add-missing-typename-8/6167.patch new file mode 100644 index 000000000..f85e131f0 --- /dev/null +++ b/common-files/chromium-patches/add-missing-typename-8/6167.patch @@ -0,0 +1,19 @@ +--- a/base/functional/bind_internal.h ++++ b/base/functional/bind_internal.h +@@ -1533,12 +1533,12 @@ + typename Param> + struct ParamCanBeBound { + private: +- using UnwrappedParam = BindArgument::template ForwardedAs< ++ using UnwrappedParam = typename BindArgument::template ForwardedAs< + Unwrapped>::template ToParamWithType; +- using ParamStorage = BindArgument::template ToParamWithType< ++ using ParamStorage = typename BindArgument::template ToParamWithType< + Param>::template StoredAs; +- using BoundStorage = +- BindArgument::template BoundAs::template StoredAs; ++ using BoundStorage = typename BindArgument::template BoundAs< ++ Arg>::template StoredAs; + + // We forbid callbacks from using raw_ptr as a parameter. However, we allow + // `MayBeDangling` iff the callback argument was created using diff --git a/common-files/chromium-patches/add-missing-typename-9/6167.patch b/common-files/chromium-patches/add-missing-typename-9/6167.patch new file mode 100644 index 000000000..f9ec67b1a --- /dev/null +++ b/common-files/chromium-patches/add-missing-typename-9/6167.patch @@ -0,0 +1,11 @@ +--- a/mojo/public/cpp/bindings/array_traits.h ++++ b/mojo/public/cpp/bindings/array_traits.h +@@ -90,7 +90,7 @@ + { c[i] } -> std::same_as; + } + struct ArrayTraits { +- using Element = Container::value_type; ++ using Element = typename Container::value_type; + + // vector-like containers have no built-in null. + static bool IsNull(const Container& c) { return false; } diff --git a/common-files/chromium-patches/blink-fix-structured-binding-declaration/6167.patch b/common-files/chromium-patches/blink-fix-structured-binding-declaration/6167.patch new file mode 100644 index 000000000..541ecb901 --- /dev/null +++ b/common-files/chromium-patches/blink-fix-structured-binding-declaration/6167.patch @@ -0,0 +1,122 @@ +--- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc ++++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc +@@ -691,8 +691,9 @@ + + if (const auto* layout_subtree = + GetConstraintSpace().GetGridLayoutSubtree()) { +- auto& [grid_items, layout_data, subtree_size] = +- sizing_tree.CreateSizingData(); ++ auto& sizing_data = sizing_tree.CreateSizingData(); ++ auto& grid_items = sizing_data.grid_items; ++ auto& layout_data = sizing_data.layout_data; + + const auto& node = Node(); + grid_items = +@@ -730,8 +731,9 @@ + const auto& track_collection = (track_direction == kForColumns) + ? layout_data.Columns() + : layout_data.Rows(); +- const auto& [begin_set_index, end_set_index] = +- grid_item.SetIndices(track_direction); ++ const auto& set_indices = grid_item.SetIndices(track_direction); ++ const auto& begin_set_index = set_indices.begin; ++ const auto& end_set_index = set_indices.end; + + return (grid_item.BaselineGroup(track_direction) == BaselineGroup::kMajor) + ? track_collection.MajorBaseline(begin_set_index) +@@ -1043,8 +1045,9 @@ + const auto& track_collection = (track_direction == kForColumns) + ? subgridded_item.Columns(writing_mode) + : subgridded_item.Rows(writing_mode); +- const auto& [begin_set_index, end_set_index] = +- subgridded_item->SetIndices(track_collection.Direction()); ++ const auto& set_indices = subgridded_item->SetIndices(track_collection.Direction()); ++ const auto& begin_set_index = set_indices.begin; ++ const auto& end_set_index = set_indices.end; + + const LayoutUnit extra_margin = + (subgridded_item->BaselineGroup(track_direction) == BaselineGroup::kMajor) +@@ -1236,8 +1239,9 @@ + : subgridded_item.Rows(writing_mode); + + const auto margins = ComputeMarginsFor(space, item_style, constraint_space); +- const auto& [begin_set_index, end_set_index] = +- subgridded_item->SetIndices(track_collection.Direction()); ++ const auto& set_indices = subgridded_item->SetIndices(track_collection.Direction()); ++ const auto& begin_set_index = set_indices.begin; ++ const auto& end_set_index = set_indices.end; + + const auto margin_sum = + (is_for_columns ? margins.InlineSum() : margins.BlockSum()) + +@@ -1656,8 +1660,10 @@ + // in first/last baseline alignment within its start-most/end-most shared + // alignment context along that axis" + // https://www.w3.org/TR/css-align-3/#baseline-sharing-group +- const auto& [begin_set_index, end_set_index] = +- grid_item.SetIndices(track_direction); ++ const auto& set_indices = grid_item.SetIndices(track_direction); ++ const auto& begin_set_index = set_indices.begin; ++ const auto& end_set_index = set_indices.end; ++ + if (grid_item.BaselineGroup(track_direction) == BaselineGroup::kMajor) { + track_collection.SetMajorBaseline(begin_set_index, baseline); + } else { +@@ -1917,8 +1923,9 @@ + bool* opt_needs_additional_pass) const { + DCHECK(sizing_subtree); + +- auto& [grid_items, layout_data, subtree_size] = +- sizing_subtree.SubtreeRootData(); ++ auto& sizing_data = sizing_subtree.SubtreeRootData(); ++ auto& grid_items = sizing_data.grid_items; ++ auto& layout_data = sizing_data.layout_data; + + const bool is_for_columns = track_direction == kForColumns; + const bool has_non_definite_track = +@@ -2062,8 +2069,10 @@ + const GridSizingSubtree& sizing_subtree, + const CallbackFunc& callback_func, + bool should_compute_min_max_sizes) const { +- auto& [grid_items, layout_data, subtree_size] = +- sizing_subtree.SubtreeRootData(); ++ auto& sizing_data = sizing_subtree.SubtreeRootData(); ++ auto& grid_items = sizing_data.grid_items; ++ auto& layout_data = sizing_data.layout_data; ++ auto& subtree_size = sizing_data.subtree_size; + + // If we know this subtree doesn't have nested subgrids we can exit early + // instead of iterating over every grid item looking for them. +@@ -3527,7 +3536,9 @@ + DCHECK(out_row_break_between); + + const auto& container_space = GetConstraintSpace(); +- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); ++ const auto& sizing_data = sizing_tree.TreeRootData(); ++ const auto& grid_items = sizing_data.grid_items; ++ const auto& layout_data = sizing_data.layout_data; + + const auto* cached_layout_subtree = container_space.GetGridLayoutSubtree(); + const auto container_writing_direction = +@@ -3691,7 +3702,9 @@ + + // TODO(ikilpatrick): Update |SetHasSeenAllChildren| and early exit if true. + const auto& constraint_space = GetConstraintSpace(); +- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); ++ const auto& sizing_data = sizing_tree.TreeRootData(); ++ const auto& grid_items = sizing_data.grid_items; ++ const auto& layout_data = sizing_data.layout_data; + + const auto* cached_layout_subtree = constraint_space.GetGridLayoutSubtree(); + const auto container_writing_direction = +@@ -4395,8 +4408,9 @@ + DCHECK(!grid_item.IsOutOfFlow()); + DCHECK(!grid_item.is_subgridded_to_parent_grid); + +- const auto& [begin_set_index, end_set_index] = +- grid_item.SetIndices(track_collection.Direction()); ++ const auto& set_indices = grid_item.SetIndices(track_collection.Direction()); ++ const auto& begin_set_index = set_indices.begin; ++ const auto& end_set_index = set_indices.end; + + if (start_offset) { + *start_offset = track_collection.GetSetOffset(begin_set_index); diff --git a/common-files/chromium-patches/compiler-remove-unsupported-flags/6167.patch b/common-files/chromium-patches/compiler-remove-unsupported-flags/6167.patch new file mode 100644 index 000000000..be427f44f --- /dev/null +++ b/common-files/chromium-patches/compiler-remove-unsupported-flags/6167.patch @@ -0,0 +1,31 @@ +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1861,28 +1861,6 @@ + # TODO(thakis): Only for no_chromium_code? http://crbug.com/912662 + "-Wno-ignored-pragma-optimize", + ] +- +- if (!is_nacl) { +- cflags += [ +- # TODO(crbug.com/1343975) Evaluate and possibly enable. +- "-Wno-deprecated-builtins", +- +- # TODO(crbug.com/1352183) Evaluate and possibly enable. +- "-Wno-bitfield-constant-conversion", +- +- # TODO(crbug.com/1412713) Evaluate and possibly enable. +- "-Wno-deprecated-this-capture", +- +- # TODO(https://crbug.com/1491833): Fix and re-enable. +- "-Wno-invalid-offsetof", +- +- # TODO(crbug.com/1494809): Evaluate and possibly enable. +- "-Wno-vla-extension", +- +- # TODO(https://crbug.com/1490607): Fix and re-enable. +- "-Wno-thread-safety-reference-return", +- ] +- } + } + + # Some builders, such as Cronet, use a different version of Clang than diff --git a/common-files/chromium-patches/metadata.json b/common-files/chromium-patches/metadata.json index 53f1bf71c..7ddeeba1f 100644 --- a/common-files/chromium-patches/metadata.json +++ b/common-files/chromium-patches/metadata.json @@ -25,6 +25,12 @@ "add-missing-typename-7/6099.patch": { "start": 6099 }, + "add-missing-typename-8/6167.patch": { + "start": 6167 + }, + "add-missing-typename-9/6167.patch": { + "start": 6167 + }, "angle-fix-atomic/5615.patch": { "start": 5615 }, @@ -35,7 +41,8 @@ "start": 4389 }, "atspi-mark-possibly-unused-gn-variables/6045.patch": { - "start": 6045 + "start": 6045, + "end": 6166 }, "autofill_i18n_api-no-constexpr-string/6099.patch": { "start": 6099 @@ -68,7 +75,11 @@ "end": 6098 }, "blink-fix-structured-binding-declaration/6099.patch": { - "start": 6099 + "start": 6099, + "end": 6166 + }, + "blink-fix-structured-binding-declaration/6167.patch": { + "start": 6167 }, "blink-font-constructor/5845.patch": { "start": 5845 @@ -316,7 +327,11 @@ "end": 6098 }, "compiler-remove-unsupported-flags/6099.patch": { - "start": 6099 + "start": 6099, + "end": 6166 + }, + "compiler-remove-unsupported-flags/6167.patch": { + "start": 6167 }, "compiler-use-android-target/4389.patch": { "start": 4389, @@ -445,7 +460,8 @@ "start": 5845 }, "partition_alloc-use-std_nullptr_t/6099.patch": { - "start": 6099 + "start": 6099, + "end": 6166 }, "perfetto-no-android-jni/5359.patch": { "start": 5359 @@ -463,6 +479,22 @@ "start": 4389, "end": 4389 }, + "remove-usage-vector-three_way_compare/6167.patch": { + "start": 6167 + }, + "remove-xorg-from-build-deps/6167.patch": { + "start": 6159, + "end": 6225 + }, + "resource_attribution-query_params-no-constexpr-operator-equal/6167.patch": { + "start": 6167 + }, + "revert-blink-v8-cxx20/6167.patch": { + "start": 6167 + }, + "revert-rust-qr-scanner/6167.patch": { + "start": 6167 + }, "revert-split-out-ios-shared-feed-protos/5615.patch": { "start": 5615, "end": 5615 @@ -521,6 +553,9 @@ "unrar-no-lutimes/4389.patch": { "start": 4389 }, + "use-std_to_address-from-libcxx/6167.patch": { + "start": 6167 + }, "v8-do-not-use-builtin-mul/5481.patch": { "start": 5481 }, @@ -597,6 +632,9 @@ "y-loss_based_bwe_v2_config-constructor/6099.patch": { "start": 6099 }, + "y-mime_util_xdg-file_info-consturctor/6167.patch": { + "start": 6167 + }, "y-race_network_request_info-constructor/6099.patch": { "start": 6099 }, @@ -614,6 +652,9 @@ "start": 4961, "end": 5005 }, + "z-iwyu-blink-include-mutex/6167.patch": { + "start": 6167 + }, "z-iwyu-blink-include-variant/5845.patch": { "start": 5845, "end": 5845 @@ -644,6 +685,15 @@ "start": 5735, "end": 5844 }, + "z-iwyu-crypto-hkdf-include-vector/6167.patch": { + "start": 6167 + }, + "z-iwyu-display_color_management-include-string/6167.patch": { + "start": 6167 + }, + "z-iwyu-gfx-include-bitset/6167.patch": { + "start": 6167 + }, "z-iwyu-ipcz-include-memory/5938.patch": { "start": 5938, "end": 5992 diff --git a/common-files/chromium-patches/remove-usage-vector-three_way_compare/6167.patch b/common-files/chromium-patches/remove-usage-vector-three_way_compare/6167.patch new file mode 100644 index 000000000..93c7ee976 --- /dev/null +++ b/common-files/chromium-patches/remove-usage-vector-three_way_compare/6167.patch @@ -0,0 +1,36 @@ +In libcxx, three-way comparison operator <=> in std::vector is implemented since commit [1], +which is not landed in NDK r26, so remove this usage. + +This reverts https://github.com/chromium/chromium/commit/0e55c3c70e8f492a83faa85e1af5053986c3167f. + +[1]: https://github.com/llvm/llvm-project/commit/55ec808a889726e0547b7e2f0aa12bc197f6d163 + +--- a/base/containers/flat_tree.h ++++ b/base/containers/flat_tree.h +@@ -350,8 +350,24 @@ + return lhs.body_ == rhs.body_; + } + +- friend auto operator<=>(const flat_tree& lhs, const flat_tree& rhs) { +- return lhs.body_ <=> rhs.body_; ++ friend bool operator!=(const flat_tree& lhs, const flat_tree& rhs) { ++ return !(lhs == rhs); ++ } ++ ++ friend bool operator<(const flat_tree& lhs, const flat_tree& rhs) { ++ return lhs.body_ < rhs.body_; ++ } ++ ++ friend bool operator>(const flat_tree& lhs, const flat_tree& rhs) { ++ return rhs < lhs; ++ } ++ ++ friend bool operator>=(const flat_tree& lhs, const flat_tree& rhs) { ++ return !(lhs < rhs); ++ } ++ ++ friend bool operator<=(const flat_tree& lhs, const flat_tree& rhs) { ++ return !(lhs > rhs); + } + + friend void swap(flat_tree& lhs, flat_tree& rhs) noexcept { lhs.swap(rhs); } diff --git a/common-files/chromium-patches/remove-xorg-from-build-deps/6167.patch b/common-files/chromium-patches/remove-xorg-from-build-deps/6167.patch new file mode 100644 index 000000000..30a8311f5 --- /dev/null +++ b/common-files/chromium-patches/remove-xorg-from-build-deps/6167.patch @@ -0,0 +1,12 @@ +https://github.com/chromium/chromium/commit/062769f739bb91aedbeeb396e5db9d92dbcc7c0e + +--- a/build/install-build-deps.py ++++ b/build/install-build-deps.py +@@ -374,7 +374,6 @@ def lib_list(): + "libxrender1", + "libxtst6", + "x11-utils", +- "xorg", # TODO(crbug.com/1417069): Experimental. + "xvfb", + "zlib1g", + ] diff --git a/common-files/chromium-patches/resource_attribution-query_params-no-constexpr-operator-equal/6167.patch b/common-files/chromium-patches/resource_attribution-query_params-no-constexpr-operator-equal/6167.patch new file mode 100644 index 000000000..23019c44b --- /dev/null +++ b/common-files/chromium-patches/resource_attribution-query_params-no-constexpr-operator-equal/6167.patch @@ -0,0 +1,14 @@ +error: defaulted definition of equality comparison operator cannot be declared constexpr because it invokes a non-constexpr comparison function + +--- a/components/performance_manager/resource_attribution/query_params.h ++++ b/components/performance_manager/resource_attribution/query_params.h +@@ -27,8 +27,7 @@ + QueryParams(const QueryParams& other); + QueryParams& operator=(const QueryParams& other); + +- friend constexpr bool operator==(const QueryParams&, +- const QueryParams&) = default; ++ friend bool operator==(const QueryParams&, const QueryParams&) = default; + + // Individual resource contexts to measure. + std::set resource_contexts; diff --git a/common-files/chromium-patches/revert-blink-v8-cxx20/6167.patch b/common-files/chromium-patches/revert-blink-v8-cxx20/6167.patch new file mode 100644 index 000000000..79e829cf9 --- /dev/null +++ b/common-files/chromium-patches/revert-blink-v8-cxx20/6167.patch @@ -0,0 +1,725 @@ +This reverts https://github.com/chromium/chromium/commit/940af9f2c87b436559b97c53763aa9eaaf1254eb + +--- a/third_party/blink/renderer/bindings/core/v8/native_value_traits.h ++++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits.h +@@ -5,7 +5,6 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_NATIVE_VALUE_TRAITS_H_ + #define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_NATIVE_VALUE_TRAITS_H_ + +-#include + #include + + #include "third_party/blink/renderer/bindings/core/v8/idl_types_base.h" +@@ -31,7 +30,7 @@ + // return toInt32(isolate, value, exceptionState, NormalConversion); + // } + // } +-template ++template + struct NativeValueTraits; + + // This declaration serves only as a blueprint for specializations: the +@@ -46,15 +45,22 @@ + + namespace bindings { + ++template ++struct NativeValueTraitsHasIsNull : std::false_type {}; ++ + template +-struct ImplTypeFor { +- using type = T; +-}; ++struct NativeValueTraitsHasIsNull< ++ T, ++ std::void_t().IsNull())>> : std::true_type {}; + + template +- requires std::derived_from +-struct ImplTypeFor { +- using type = typename T::ImplType; ++struct NativeValueTraitsHasNullValue { ++ // true if |T| supports IDL null value. ++ static constexpr bool value = ++ // ScriptValue, String, and union types have IsNull member function. ++ bindings::NativeValueTraitsHasIsNull::value || ++ // Pointer types have nullptr as IDL null value. ++ std::is_pointer::value; + }; + + } // namespace bindings +@@ -72,17 +78,37 @@ + // If present, |NullValue()| will be used when converting from the nullable type + // T?, and should be used if the impl type has an existing "null" state. If not + // present, WTF::Optional will be used to wrap the type. +-template ++template + struct NativeValueTraitsBase { + STATIC_ONLY(NativeValueTraitsBase); + +- using ImplType = bindings::ImplTypeFor::type; ++ using ImplType = T; ++ ++ static constexpr bool has_null_value = ++ bindings::NativeValueTraitsHasNullValue::value; ++ ++ template ++ static decltype(auto) ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state, ++ ExtraArgs... extra_args) { ++ return NativeValueTraits>::NativeValue( ++ isolate, value, exception_state, ++ std::forward(extra_args)...); ++ } ++}; ++ ++template ++struct NativeValueTraitsBase< ++ T, ++ std::enable_if_t::value>> { ++ STATIC_ONLY(NativeValueTraitsBase); ++ ++ using ImplType = typename T::ImplType; + +- // Pointer types have nullptr as IDL null value. +- // ScriptValue, String, and union types have IsNull member function. + static constexpr bool has_null_value = +- std::is_pointer_v || +- requires(ImplType value) { value.IsNull(); }; ++ bindings::NativeValueTraitsHasNullValue::value; + + template + static decltype(auto) ArgumentValue(v8::Isolate* isolate, +--- a/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc ++++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc +@@ -7,7 +7,6 @@ + #include "third_party/blink/renderer/core/core_export.h" + #include "third_party/blink/renderer/core/execution_context/execution_context.h" + #include "third_party/blink/renderer/core/frame/web_feature.h" +-#include "third_party/blink/renderer/core/typed_arrays/flexible_array_buffer_view.h" + #include "third_party/blink/renderer/core/typed_arrays/typed_flexible_array_buffer_view.h" + + namespace blink { +@@ -699,11 +698,12 @@ + // ArrayBufferView + + template +- requires std::derived_from +-NotShared NativeValueTraits>::NativeValue( +- v8::Isolate* isolate, +- v8::Local value, +- ExceptionState& exception_state) { ++NotShared NativeValueTraits< ++ NotShared, ++ typename std::enable_if_t::value>>:: ++ NativeValue(v8::Isolate* isolate, ++ v8::Local value, ++ ExceptionState& exception_state) { + return NativeValueImpl< + RecipeTrait>, ToDOMViewType, + Nullablity::kIsNotNullable, BufferSizeCheck::kCheck, +@@ -712,12 +712,13 @@ + } + + template +- requires std::derived_from +-NotShared NativeValueTraits>::ArgumentValue( +- v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++NotShared NativeValueTraits< ++ NotShared, ++ typename std::enable_if_t::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl< + RecipeTrait>, ToDOMViewType, + Nullablity::kIsNotNullable, BufferSizeCheck::kCheck, +@@ -728,11 +729,12 @@ + // [AllowShared] ArrayBufferView + + template +- requires std::derived_from +-MaybeShared NativeValueTraits>::NativeValue( +- v8::Isolate* isolate, +- v8::Local value, +- ExceptionState& exception_state) { ++MaybeShared NativeValueTraits< ++ MaybeShared, ++ typename std::enable_if_t::value>>:: ++ NativeValue(v8::Isolate* isolate, ++ v8::Local value, ++ ExceptionState& exception_state) { + return NativeValueImpl>, + ToDOMViewType, + Nullablity::kIsNotNullable, BufferSizeCheck::kCheck, +@@ -741,12 +743,13 @@ + } + + template +- requires std::derived_from +-MaybeShared NativeValueTraits>::ArgumentValue( +- v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++MaybeShared NativeValueTraits< ++ MaybeShared, ++ typename std::enable_if_t::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl>, + ToDOMViewType, + Nullablity::kIsNotNullable, BufferSizeCheck::kCheck, +@@ -757,12 +760,12 @@ + // [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBufferView + + template +- requires std::derived_from +-MaybeShared +-NativeValueTraits>>::NativeValue( +- v8::Isolate* isolate, +- v8::Local value, +- ExceptionState& exception_state) { ++MaybeShared NativeValueTraits< ++ IDLBufferSourceTypeNoSizeLimit>, ++ typename std::enable_if_t::value>>:: ++ NativeValue(v8::Isolate* isolate, ++ v8::Local value, ++ ExceptionState& exception_state) { + return NativeValueImpl< + RecipeTrait>, ToDOMViewType, + Nullablity::kIsNotNullable, BufferSizeCheck::kDoNotCheck, +@@ -771,12 +774,13 @@ + } + + template +- requires std::derived_from +-MaybeShared NativeValueTraits>>::ArgumentValue(v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++MaybeShared NativeValueTraits< ++ IDLBufferSourceTypeNoSizeLimit>, ++ typename std::enable_if_t::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl< + RecipeTrait>, ToDOMViewType, + Nullablity::kIsNotNullable, BufferSizeCheck::kDoNotCheck, +@@ -787,11 +791,12 @@ + // Nullable ArrayBufferView + + template +- requires std::derived_from +-NotShared NativeValueTraits>>::NativeValue( +- v8::Isolate* isolate, +- v8::Local value, +- ExceptionState& exception_state) { ++NotShared NativeValueTraits< ++ IDLNullable>, ++ typename std::enable_if_t::value>>:: ++ NativeValue(v8::Isolate* isolate, ++ v8::Local value, ++ ExceptionState& exception_state) { + return NativeValueImpl< + RecipeTrait>, ToDOMViewType, + Nullablity::kIsNullable, BufferSizeCheck::kCheck, +@@ -800,12 +805,13 @@ + } + + template +- requires std::derived_from +-NotShared NativeValueTraits>>::ArgumentValue( +- v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++NotShared NativeValueTraits< ++ IDLNullable>, ++ typename std::enable_if_t::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl< + RecipeTrait>, ToDOMViewType, + Nullablity::kIsNullable, BufferSizeCheck::kCheck, +@@ -816,11 +822,12 @@ + // Nullable [AllowShared] ArrayBufferView + + template +- requires std::derived_from +-MaybeShared NativeValueTraits>>::NativeValue( +- v8::Isolate* isolate, +- v8::Local value, +- ExceptionState& exception_state) { ++MaybeShared NativeValueTraits< ++ IDLNullable>, ++ typename std::enable_if_t::value>>:: ++ NativeValue(v8::Isolate* isolate, ++ v8::Local value, ++ ExceptionState& exception_state) { + return NativeValueImpl>, + ToDOMViewType, + Nullablity::kIsNullable, BufferSizeCheck::kCheck, +@@ -829,12 +836,13 @@ + } + + template +- requires std::derived_from +-MaybeShared NativeValueTraits>>::ArgumentValue( +- v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++MaybeShared NativeValueTraits< ++ IDLNullable>, ++ typename std::enable_if_t::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl>, + ToDOMViewType, + Nullablity::kIsNullable, BufferSizeCheck::kCheck, +@@ -845,9 +853,9 @@ + // Nullable [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBufferView + + template +- requires std::derived_from +-MaybeShared +-NativeValueTraits>>>:: ++MaybeShared NativeValueTraits< ++ IDLNullable>>, ++ typename std::enable_if_t::value>>:: + ArgumentValue(v8::Isolate* isolate, + int argument_index, + v8::Local value, +@@ -862,11 +870,13 @@ + // [AllowShared, FlexibleArrayBufferView] ArrayBufferView + + template +- requires std::derived_from +-T NativeValueTraits::ArgumentValue(v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++T NativeValueTraits::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl, ToFlexibleArrayBufferView, + Nullablity::kIsNotNullable, BufferSizeCheck::kCheck, + ResizableAllowance::kDisallowResizable, +@@ -878,12 +888,13 @@ + // ArrayBufferView + + template +- requires std::derived_from +-T NativeValueTraits>::ArgumentValue( +- v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++T NativeValueTraits, ++ typename std::enable_if_t< ++ std::is_base_of::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl< + RecipeTrait, ToFlexibleArrayBufferView, Nullablity::kIsNotNullable, + BufferSizeCheck::kDoNotCheck, ResizableAllowance::kDisallowResizable, +@@ -894,12 +905,13 @@ + // Nullable [AllowShared, FlexibleArrayBufferView] ArrayBufferView + + template +- requires std::derived_from +-T NativeValueTraits>::ArgumentValue( +- v8::Isolate* isolate, +- int argument_index, +- v8::Local value, +- ExceptionState& exception_state) { ++T NativeValueTraits, ++ typename std::enable_if_t< ++ std::is_base_of::value>>:: ++ ArgumentValue(v8::Isolate* isolate, ++ int argument_index, ++ v8::Local value, ++ ExceptionState& exception_state) { + return ArgumentValueImpl, ToFlexibleArrayBufferView, + Nullablity::kIsNullable, BufferSizeCheck::kCheck, + ResizableAllowance::kDisallowResizable, +--- a/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h ++++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h +@@ -5,9 +5,6 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_NATIVE_VALUE_TRAITS_IMPL_H_ + #define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_NATIVE_VALUE_TRAITS_IMPL_H_ + +-#include +-#include +- + #include "third_party/abseil-cpp/absl/types/optional.h" + #include "third_party/blink/renderer/bindings/core/v8/idl_types.h" + #include "third_party/blink/renderer/bindings/core/v8/native_value_traits.h" +@@ -718,8 +715,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t::value>> { + // NotShared or MaybeShared should be used instead. + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -731,8 +729,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> { ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t::value>> { + // NotShared or MaybeShared should be used instead. + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -744,8 +743,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> ++struct NativeValueTraits< ++ NotShared, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static NotShared NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -758,8 +758,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits>> ++struct NativeValueTraits< ++ IDLNullable>, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static NotShared NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -772,8 +773,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> ++struct NativeValueTraits< ++ MaybeShared, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static MaybeShared NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -786,8 +788,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits>> ++struct NativeValueTraits< ++ IDLBufferSourceTypeNoSizeLimit>, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + // FlexibleArrayBufferView uses this in its implementation, so we cannot + // delete it. +@@ -802,8 +805,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits>> ++struct NativeValueTraits< ++ IDLNullable>, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static MaybeShared NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -816,9 +820,9 @@ + }; + + template +- requires std::derived_from + struct NativeValueTraits< +- IDLNullable>>> ++ IDLNullable>>, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + // BufferSourceTypeNoSizeLimit must be used only as arguments. + static MaybeShared NativeValue(v8::Isolate* isolate, +@@ -832,8 +836,11 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t< ++ std::is_base_of::value>> ++ : public NativeValueTraitsBase { + // FlexibleArrayBufferView must be used only as arguments. + static T NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -846,8 +853,10 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> ++struct NativeValueTraits< ++ IDLBufferSourceTypeNoSizeLimit, ++ typename std::enable_if_t< ++ std::is_base_of::value>> + : public NativeValueTraitsBase { + // BufferSourceTypeNoSizeLimit and FlexibleArrayBufferView must be used only + // as arguments. +@@ -862,8 +871,11 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t< ++ std::is_base_of::value>> ++ : public NativeValueTraitsBase { + // FlexibleArrayBufferView must be used only as arguments. + static T NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -1122,8 +1134,9 @@ + } + + template +- requires NativeValueTraits>::has_null_value +-struct NativeValueTraits>> ++struct NativeValueTraits>, ++ typename std::enable_if_t< ++ NativeValueTraits>::has_null_value>> + : public NativeValueTraitsBase>*> { + using ImplType = typename NativeValueTraits>::ImplType*; + +@@ -1190,8 +1203,9 @@ + : public NativeValueTraits> {}; + + template +- requires NativeValueTraits>::has_null_value +-struct NativeValueTraits>> ++struct NativeValueTraits>, ++ typename std::enable_if_t< ++ NativeValueTraits>::has_null_value>> + : public NativeValueTraits>> {}; + + // Record types +@@ -1321,8 +1335,10 @@ + + // Callback function types + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t::value>> ++ : public NativeValueTraitsBase { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1345,8 +1361,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -1375,8 +1392,10 @@ + + // Callback interface types + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t::value>> ++ : public NativeValueTraitsBase { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1399,8 +1418,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -1429,8 +1449,11 @@ + + // Dictionary types + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t< ++ std::is_base_of::value>> ++ : public NativeValueTraitsBase { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1441,11 +1464,14 @@ + // We don't support nullable dictionary types in general since it's quite + // confusing and often misused. + template +- requires std::derived_from && +- (std::same_as || +- std::same_as || +- std::same_as) +-struct NativeValueTraits> : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t< ++ std::is_base_of::value && ++ (std::is_same::value || ++ std::is_same::value || ++ std::is_same::value)>> ++ : public NativeValueTraitsBase { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1457,8 +1483,11 @@ + + // Enumeration types + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t< ++ std::is_base_of::value>> ++ : public NativeValueTraitsBase { + static T NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1468,8 +1497,10 @@ + + // Interface types + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t::value>> ++ : public NativeValueTraitsBase { + static inline T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1497,8 +1528,9 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t::value>> + : public NativeValueTraitsBase> { + static inline T* NativeValue(v8::Isolate* isolate, + v8::Local value, +@@ -1533,8 +1565,10 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ T, ++ typename std::enable_if_t::value>> ++ : public NativeValueTraitsBase { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1550,8 +1584,10 @@ + }; + + template +- requires std::derived_from +-struct NativeValueTraits> : public NativeValueTraitsBase { ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t::value>> ++ : public NativeValueTraitsBase { + static T* NativeValue(v8::Isolate* isolate, + v8::Local value, + ExceptionState& exception_state) { +@@ -1572,8 +1608,9 @@ + + // Nullable types + template +- requires(!NativeValueTraits::has_null_value) +-struct NativeValueTraits> ++struct NativeValueTraits< ++ IDLNullable, ++ typename std::enable_if_t::has_null_value>> + : public NativeValueTraitsBase> { + // https://webidl.spec.whatwg.org/#es-nullable-type + using ImplType = +@@ -1605,8 +1642,9 @@ + + // Optional types + template +- requires std::is_arithmetic_v::ImplType> +-struct NativeValueTraits> ++struct NativeValueTraits, ++ typename std::enable_if_t::ImplType>::value>> + : public NativeValueTraitsBase::ImplType> { + using ImplType = typename NativeValueTraits::ImplType; + +@@ -1628,8 +1666,9 @@ + }; + + template +- requires std::is_pointer_v::ImplType> +-struct NativeValueTraits> ++struct NativeValueTraits, ++ typename std::enable_if_t::ImplType>::value>> + : public NativeValueTraitsBase::ImplType> { + using ImplType = typename NativeValueTraits::ImplType; + diff --git a/common-files/chromium-patches/revert-rust-qr-scanner/6167.patch b/common-files/chromium-patches/revert-rust-qr-scanner/6167.patch new file mode 100644 index 000000000..f60eb90f1 --- /dev/null +++ b/common-files/chromium-patches/revert-rust-qr-scanner/6167.patch @@ -0,0 +1,169 @@ +This reverts https://github.com/chromium/chromium/commit/bcf739b95713071687ff25010683248de0092f6a + +--- a/components/qr_code_generator/BUILD.gn ++++ b/components/qr_code_generator/BUILD.gn +@@ -11,6 +11,11 @@ + enable_qr_print = false + } + ++buildflag_header("rust_buildflags") { ++ header = "rust_buildflags.h" ++ flags = [ "ENABLE_RUST=$enable_rust" ] ++} ++ + # Separate target to: + # - Limit `visibility` (stricter than dir-level `DEPS` would allow) + # - Allow `//chrome/services/qr_code_generator_service/public/cpp` to check the +@@ -23,7 +28,10 @@ + "features.cc", + "features.h", + ] +- deps = [ "//base" ] ++ deps = [ ++ ":rust_buildflags", ++ "//base", ++ ] + visibility = [ + ":qr_code_generator", + ":unit_tests", +@@ -39,19 +47,27 @@ + ] + deps = [ + ":qr_code_generator_features", +- ":qr_code_generator_ffi_glue", ++ ":rust_buildflags", + "//base", + ] ++ if (enable_rust) { ++ deps += [ ++ ":qr_code_generator_ffi_glue", ++ "//build/rust:cxx_cppdeps", ++ ] ++ } + public_deps = [ "//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 = [ "//third_party/rust/qr_code/v2:lib" ] ++if (enable_rust) { ++ 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 = [ "//third_party/rust/qr_code/v2:lib" ] ++ } + } + + source_set("unit_tests") { +@@ -60,6 +76,7 @@ + deps = [ + ":qr_code_generator", + ":qr_code_generator_features", ++ ":rust_buildflags", + "//base", + "//base/test:test_support", + "//testing/gtest", +--- a/components/qr_code_generator/features.h ++++ b/components/qr_code_generator/features.h +@@ -6,6 +6,7 @@ + #define COMPONENTS_QR_CODE_GENERATOR_FEATURES_H_ + + #include "base/feature_list.h" ++#include "components/qr_code_generator/rust_buildflags.h" + + namespace qr_code_generator { + +@@ -13,8 +14,10 @@ + // but product code should instead use `IsRustyQrCodeGeneratorFeatureEnabled`. + BASE_DECLARE_FEATURE(kRustyQrCodeGeneratorFeature); + +-// Returns true if Rust should be used for QR code generation - i.e. if +-// the `"RustyQrCodeGenerator"` base::Feature has been enabled. ++// Returns true if Rust should be used for QR code generation: ++// 1) the GN-level `enable_rust` is true. ++// *and* ++// 2) the `"RustyQrCodeGenerator"` base::Feature has been enabled. + // + // If Rust is used for QR code generation then: + // 1) //components/qr_code_generator becomes a thin wrapper around a 3rd-party +@@ -26,7 +29,11 @@ + // See https://crbug.com/1431991 for more details about the feature and the + // Rust QR Code Generator project. + inline bool IsRustyQrCodeGeneratorFeatureEnabled() { ++#if BUILDFLAG(ENABLE_RUST) + return base::FeatureList::IsEnabled(kRustyQrCodeGeneratorFeature); ++#else ++ return false; ++#endif + } + + } // namespace qr_code_generator +--- a/components/qr_code_generator/qr_code_generator.cc ++++ b/components/qr_code_generator/qr_code_generator.cc +@@ -11,12 +11,15 @@ + #include + + #include "base/check_op.h" +-#include "base/containers/span_rust.h" + #include "base/memory/raw_ptr.h" + #include "base/notreached.h" + #include "base/numerics/safe_conversions.h" + #include "components/qr_code_generator/features.h" ++ ++#if BUILDFLAG(ENABLE_RUST) ++#include "base/containers/span_rust.h" + #include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h" ++#endif + + namespace qr_code_generator { + +@@ -572,6 +575,7 @@ + return sum; + } + ++#if BUILDFLAG(ENABLE_RUST) + absl::optional GenerateQrCodeUsingRust( + base::span in, + absl::optional min_version) { +@@ -596,6 +600,7 @@ + CHECK_EQ(code.data.size(), static_cast(code.qr_size * code.qr_size)); + return code; + } ++#endif + + } // namespace + +@@ -617,9 +622,11 @@ + return absl::nullopt; + } + ++#if BUILDFLAG(ENABLE_RUST) + if (IsRustyQrCodeGeneratorFeatureEnabled()) { + return GenerateQrCodeUsingRust(in, min_version); + } ++#endif + + std::vector segments; + const QRVersionInfo* version_info = nullptr; +--- a/components/qr_code_generator/qr_code_generator_unittest.cc ++++ b/components/qr_code_generator/qr_code_generator_unittest.cc +@@ -298,9 +298,12 @@ + ASSERT_FALSE(qr.Generate(huge_input, std::make_optional(-1))); + } + ++#if BUILDFLAG(ENABLE_RUST) + INSTANTIATE_TEST_SUITE_P(RustEnabled, + QRCodeGeneratorTest, + ::testing::Values(RustFeatureState::kRustEnabled)); ++#endif ++ + INSTANTIATE_TEST_SUITE_P(RustDisabled, + QRCodeGeneratorTest, + ::testing::Values(RustFeatureState::kRustDisabled)); diff --git a/common-files/chromium-patches/sysroot-patches/libcxx-17-impl-three-way comparison-operator-for-vector.diff b/common-files/chromium-patches/sysroot-patches/libcxx-17-impl-three-way comparison-operator-for-vector.diff new file mode 100644 index 000000000..86d4c180a --- /dev/null +++ b/common-files/chromium-patches/sysroot-patches/libcxx-17-impl-three-way comparison-operator-for-vector.diff @@ -0,0 +1,108 @@ +https://github.com/llvm/llvm-project/commit/55ec808a889726e0547b7e2f0aa12bc197f6d163 + +--- a/usr/include/c++/v1/vector ++++ b/usr/include/c++/v1/vector +@@ -269,12 +269,15 @@ template struct hash>; + +-template bool operator==(const vector& x, const vector& y); +-template bool operator< (const vector& x, const vector& y); +-template bool operator!=(const vector& x, const vector& y); +-template bool operator> (const vector& x, const vector& y); +-template bool operator>=(const vector& x, const vector& y); +-template bool operator<=(const vector& x, const vector& y); ++template bool operator==(const vector& x, const vector& y); // constexpr since C++20 ++template bool operator!=(const vector& x, const vector& y); // removed in C++20 ++template bool operator< (const vector& x, const vector& y); // removed in C++20 ++template bool operator> (const vector& x, const vector& y); // removed in C++20 ++template bool operator>=(const vector& x, const vector& y); // removed in C++20 ++template bool operator<=(const vector& x, const vector& y); // removed in C++20 ++template constexpr ++ constexpr synth-three-way-result operator<=>(const vector& x, ++ const vector& y); // since C++20 + + template + void swap(vector& x, vector& y) +@@ -282,10 +285,10 @@ void swap(vector& x, vector& y) + + template + typename vector::size_type +-erase(vector& c, const U& value); // C++20 ++erase(vector& c, const U& value); // since C++20 + template + typename vector::size_type +-erase_if(vector& c, Predicate pred); // C++20 ++erase_if(vector& c, Predicate pred); // since C++20 + + + template +@@ -303,6 +306,7 @@ template requires is-vector-bool-reference // Since C++ + #include <__algorithm/fill_n.h> + #include <__algorithm/iterator_operations.h> + #include <__algorithm/lexicographical_compare.h> ++#include <__algorithm/lexicographical_compare_three_way.h> + #include <__algorithm/remove.h> + #include <__algorithm/remove_if.h> + #include <__algorithm/rotate.h> +@@ -3441,8 +3445,9 @@ operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __ + return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin()); + } + ++#if _LIBCPP_STD_VER <= 17 ++ + template +-_LIBCPP_CONSTEXPR_SINCE_CXX20 + inline _LIBCPP_HIDE_FROM_ABI + bool + operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) +@@ -3451,7 +3456,6 @@ operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __ + } + + template +-_LIBCPP_CONSTEXPR_SINCE_CXX20 + inline _LIBCPP_HIDE_FROM_ABI + bool + operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) +@@ -3460,7 +3464,6 @@ operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __ + } + + template +-_LIBCPP_CONSTEXPR_SINCE_CXX20 + inline _LIBCPP_HIDE_FROM_ABI + bool + operator> (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) +@@ -3469,7 +3472,6 @@ operator> (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __ + } + + template +-_LIBCPP_CONSTEXPR_SINCE_CXX20 + inline _LIBCPP_HIDE_FROM_ABI + bool + operator>=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) +@@ -3478,7 +3480,6 @@ operator>=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __ + } + + template +-_LIBCPP_CONSTEXPR_SINCE_CXX20 + inline _LIBCPP_HIDE_FROM_ABI + bool + operator<=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) +@@ -3486,6 +3487,17 @@ operator<=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __ + return !(__y < __x); + } + ++#else // _LIBCPP_STD_VER <= 17 ++ ++template ++_LIBCPP_HIDE_FROM_ABI constexpr __synth_three_way_result<_Tp> ++operator<=>(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) { ++ return std::lexicographical_compare_three_way( ++ __x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>); ++} ++ ++#endif // _LIBCPP_STD_VER <= 17 ++ + template + _LIBCPP_CONSTEXPR_SINCE_CXX20 + inline _LIBCPP_HIDE_FROM_ABI diff --git a/common-files/chromium-patches/sysroot-patches/libcxx-17-lwg3545.diff b/common-files/chromium-patches/sysroot-patches/libcxx-17-lwg3545.diff new file mode 100644 index 000000000..dbedaab1a --- /dev/null +++ b/common-files/chromium-patches/sysroot-patches/libcxx-17-lwg3545.diff @@ -0,0 +1,45 @@ +https://github.com/ungoogled-software/ungoogled-chromium/pull/2681#issuecomment-1908371295 +https://github.com/llvm/llvm-project/issues/67449 +https://github.com/llvm/llvm-project/commit/078651b6de4b767b91e3e6a51e5df11a06d7bc4f + +--- a/usr/include/c++/v1/__memory/pointer_traits.h ++++ b/usr/include/c++/v1/__memory/pointer_traits.h +@@ -35,7 +35,7 @@ + struct __has_element_type<_Tp, __void_t > : true_type {}; + + template ::value> +-struct __pointer_traits_element_type; ++struct __pointer_traits_element_type {}; + + template + struct __pointer_traits_element_type<_Ptr, true> +@@ -111,12 +111,14 @@ + typedef _Sp<_Up, _Args...> type; + }; + ++template ++struct __pointer_traits_impl {}; ++ + template +-struct _LIBCPP_TEMPLATE_VIS pointer_traits +-{ +- typedef _Ptr pointer; +- typedef typename __pointer_traits_element_type::type element_type; +- typedef typename __pointer_traits_difference_type::type difference_type; ++struct __pointer_traits_impl<_Ptr, __void_t::type> > { ++ typedef _Ptr pointer; ++ typedef typename __pointer_traits_element_type::type element_type; ++ typedef typename __pointer_traits_difference_type::type difference_type; + + #ifndef _LIBCPP_CXX03_LANG + template using rebind = typename __pointer_traits_rebind::type; +@@ -133,6 +135,9 @@ + {return pointer::pointer_to(__r);} + }; + ++template ++struct _LIBCPP_TEMPLATE_VIS pointer_traits : __pointer_traits_impl<_Ptr> {}; ++ + template + struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*> + { diff --git a/common-files/chromium-patches/sysroot-patches/libstdcxx3-10-lwg3545.diff b/common-files/chromium-patches/sysroot-patches/libstdcxx3-10-lwg3545.diff new file mode 100644 index 000000000..bda75e7b6 --- /dev/null +++ b/common-files/chromium-patches/sysroot-patches/libstdcxx3-10-lwg3545.diff @@ -0,0 +1,163 @@ +https://github.com/gcc-mirror/gcc/commit/186aa6304570e15065f31482e9c27326a3a6679f +https://github.com/gcc-mirror/gcc/commit/8d3391d64799d490117ad48432a9ad2cf38b0091 + +--- a/usr/include/c++/10/bits/ptr_traits.h ++++ b/usr/include/c++/10/bits/ptr_traits.h +@@ -45,19 +45,6 @@ + + class __undefined; + +- // Given Template return T, otherwise invalid. +- template +- struct __get_first_arg +- { using type = __undefined; }; +- +- template class _Template, typename _Tp, +- typename... _Types> +- struct __get_first_arg<_Template<_Tp, _Types...>> +- { using type = _Tp; }; +- +- template +- using __get_first_arg_t = typename __get_first_arg<_Tp>::type; +- + // Given Template and U return Template, otherwise invalid. + template + struct __replace_first_arg +@@ -75,18 +62,45 @@ + using __make_not_void + = typename conditional::value, __undefined, _Tp>::type; + ++ template ++ struct __ptr_traits_elem_1 ++ { }; ++ ++ template class _SomePointer, typename _Tp, ++ typename... _Args> ++ struct __ptr_traits_elem_1<_SomePointer<_Tp, _Args...>> ++ { ++ using element_type = _Tp; ++ using pointer = _SomePointer<_Tp, _Args...>; ++ ++ static pointer ++ pointer_to(__make_not_void& __e) ++ { return pointer::pointer_to(__e); } ++ }; ++ ++ template ++ struct __ptr_traits_elem : __ptr_traits_elem_1<_Ptr> ++ { }; ++ ++ template ++ struct __ptr_traits_elem<_Ptr, __void_t> ++ { ++ using element_type = typename _Ptr::element_type; ++ ++ static _Ptr ++ pointer_to(__make_not_void& __e) ++ { return _Ptr::pointer_to(__e); } ++ }; ++ + /** + * @brief Uniform interface to all pointer-like types + * @ingroup pointer_abstractions + */ + template +- struct pointer_traits ++ struct pointer_traits : __ptr_traits_elem<_Ptr> + { + private: + template +- using __element_type = typename _Tp::element_type; +- +- template + using __difference_type = typename _Tp::difference_type; + + template +@@ -100,10 +114,6 @@ + /// The pointer type. + using pointer = _Ptr; + +- /// The type pointed to. +- using element_type +- = __detected_or_t<__get_first_arg_t<_Ptr>, __element_type, _Ptr>; +- + /// The type used to represent the difference between two pointers. + using difference_type + = __detected_or_t; +@@ -111,13 +121,6 @@ + /// A pointer to a different type. + template + using rebind = typename __rebind<_Ptr, _Up>::type; +- +- static _Ptr +- pointer_to(__make_not_void& __e) +- { return _Ptr::pointer_to(__e); } +- +- static_assert(!is_same::value, +- "pointer type defines element_type or is like SomePointer"); + }; + + /** +@@ -165,6 +168,7 @@ + __to_address(const _Ptr& __ptr) + { return std::__to_address(__ptr.operator->()); } + #else ++ + template + constexpr auto + __to_address(const _Ptr& __ptr) noexcept +--- a/usr/include/c++/10/bits/iterator_concepts.h ++++ b/usr/include/c++/10/bits/iterator_concepts.h +@@ -220,6 +220,15 @@ + template requires is_object_v<_Tp> + struct __cond_value_type<_Tp> + { using value_type = remove_cv_t<_Tp>; }; ++ ++ template ++ concept __has_member_value_type ++ = requires { typename _Tp::value_type; }; ++ ++ template ++ concept __has_member_element_type ++ = requires { typename _Tp::element_type; }; ++ + } // namespace __detail + + template struct indirectly_readable_traits { }; +@@ -238,16 +247,34 @@ + : indirectly_readable_traits<_Iter> + { }; + +- template requires requires { typename _Tp::value_type; } ++ template<__detail::__has_member_value_type _Tp> + struct indirectly_readable_traits<_Tp> + : __detail::__cond_value_type + { }; + +- template requires requires { typename _Tp::element_type; } ++ template<__detail::__has_member_element_type _Tp> + struct indirectly_readable_traits<_Tp> + : __detail::__cond_value_type + { }; + ++ ++ // _GLIBCXX_RESOLVE_LIB_DEFECTS ++ // 3446. indirectly_readable_traits ambiguity for types with both [...] ++ template<__detail::__has_member_value_type _Tp> ++ requires __detail::__has_member_element_type<_Tp> ++ && same_as, ++ remove_cv_t> ++ struct indirectly_readable_traits<_Tp> ++ : __detail::__cond_value_type ++ { }; ++ ++ // LWG 3446 doesn't add this, but it's needed for the case where ++ // value_type and element_type are both present, but not the same type. ++ template<__detail::__has_member_value_type _Tp> ++ requires __detail::__has_member_element_type<_Tp> ++ struct indirectly_readable_traits<_Tp> ++ { }; ++ + namespace __detail + { + template diff --git a/common-files/chromium-patches/use-std_to_address-from-libcxx/6167.patch b/common-files/chromium-patches/use-std_to_address-from-libcxx/6167.patch new file mode 100644 index 000000000..46ee48f32 --- /dev/null +++ b/common-files/chromium-patches/use-std_to_address-from-libcxx/6167.patch @@ -0,0 +1,30 @@ +https://sources.debian.org/patches/chromium/121.0.6167.139-1/fixes/std-to-address.patch + +--- a/mojo/public/cpp/bindings/type_converter.h ++++ b/mojo/public/cpp/bindings/type_converter.h +@@ -11,6 +11,11 @@ + #include + #include + ++namespace { ++template constexpr T *clang_to_address(T *P) { return P; } ++template auto clang_to_address(const T &P) -> decltype(P.operator->()) { return P.operator->(); } ++} ++ + namespace mojo { + + // NOTE: When possible, please consider using StructTraits / UnionTraits / +@@ -100,11 +105,11 @@ + inline T ConvertTo(const U& obj) { + if constexpr (requires { + { +- mojo::ConvertTo(std::to_address(obj)) ++ mojo::ConvertTo(::clang_to_address(obj)) + + } -> std::same_as; + }) { +- return mojo::ConvertTo(std::to_address(obj)); ++ return mojo::ConvertTo(::clang_to_address(obj)); + } else { + return TypeConverter::Convert(obj); + } diff --git a/common-files/chromium-patches/y-mime_util_xdg-file_info-consturctor/6167.patch b/common-files/chromium-patches/y-mime_util_xdg-file_info-consturctor/6167.patch new file mode 100644 index 000000000..6b7cfcb6b --- /dev/null +++ b/common-files/chromium-patches/y-mime_util_xdg-file_info-consturctor/6167.patch @@ -0,0 +1,15 @@ +--- a/base/nix/mime_util_xdg.cc ++++ b/base/nix/mime_util_xdg.cc +@@ -44,7 +44,11 @@ + constexpr uint8_t kDefaultGlobWeight = 50; + + // Path and last modified of mime.cache file. +-struct FileInfo { ++class FileInfo { ++ public: ++ FileInfo(FilePath path_, Time last_modified_) ++ : path(path_), last_modified(last_modified_) {} ++ + FilePath path; + Time last_modified; + }; diff --git a/common-files/chromium-patches/z-iwyu-blink-include-mutex/6167.patch b/common-files/chromium-patches/z-iwyu-blink-include-mutex/6167.patch new file mode 100644 index 000000000..9b2f1128f --- /dev/null +++ b/common-files/chromium-patches/z-iwyu-blink-include-mutex/6167.patch @@ -0,0 +1,10 @@ +--- a/third_party/blink/renderer/platform/fonts/simple_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/simple_font_data.h +@@ -25,6 +25,7 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SIMPLE_FONT_DATA_H_ + + #include ++#include + #include + + #include "build/build_config.h" diff --git a/common-files/chromium-patches/z-iwyu-crypto-hkdf-include-vector/6167.patch b/common-files/chromium-patches/z-iwyu-crypto-hkdf-include-vector/6167.patch new file mode 100644 index 000000000..f81f5d26d --- /dev/null +++ b/common-files/chromium-patches/z-iwyu-crypto-hkdf-include-vector/6167.patch @@ -0,0 +1,10 @@ +--- a/crypto/hkdf.h ++++ b/crypto/hkdf.h +@@ -9,6 +9,7 @@ + + #include + #include ++#include + + #include "base/containers/span.h" + #include "crypto/crypto_export.h" diff --git a/common-files/chromium-patches/z-iwyu-display_color_management-include-string/6167.patch b/common-files/chromium-patches/z-iwyu-display_color_management-include-string/6167.patch new file mode 100644 index 000000000..fab316e39 --- /dev/null +++ b/common-files/chromium-patches/z-iwyu-display_color_management-include-string/6167.patch @@ -0,0 +1,10 @@ +--- a/ui/display/types/display_color_management.h ++++ b/ui/display/types/display_color_management.h +@@ -5,6 +5,7 @@ + #ifndef UI_DISPLAY_TYPES_DISPLAY_COLOR_MANAGEMENT_H_ + #define UI_DISPLAY_TYPES_DISPLAY_COLOR_MANAGEMENT_H_ + ++#include + #include + + #include "third_party/skia/modules/skcms/skcms.h" diff --git a/common-files/chromium-patches/z-iwyu-gfx-include-bitset/6167.patch b/common-files/chromium-patches/z-iwyu-gfx-include-bitset/6167.patch new file mode 100644 index 000000000..e5f808245 --- /dev/null +++ b/common-files/chromium-patches/z-iwyu-gfx-include-bitset/6167.patch @@ -0,0 +1,11 @@ +--- a/ui/gfx/x/visual_manager.cc ++++ b/ui/gfx/x/visual_manager.cc +@@ -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 "ui/gfx/x/visual_manager.h" + + #include "base/strings/string_number_conversions.h"