diff --git a/chromium-123-rust-clap_lex.patch b/chromium-123-rust-clap_lex.patch deleted file mode 100644 index 61bd1943..00000000 --- a/chromium-123-rust-clap_lex.patch +++ /dev/null @@ -1,133 +0,0 @@ -diff -Nur chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs.me chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs ---- chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs.me 2024-03-13 20:36:17.000000000 +0100 -+++ chromium-123.0.6312.46/third_party/rust/chromium_crates_io/vendor/clap_lex-0.7.0/src/ext.rs 2024-03-13 00:38:18.000000000 +0100 -@@ -2,9 +2,6 @@ - - pub trait OsStrExt: private::Sealed { - /// Converts to a string slice. -- /// -- /// The Utf8Error is guaranteed to have a valid UTF8 boundary -- /// in its `valid_up_to()` - fn try_str(&self) -> Result<&str, std::str::Utf8Error>; - /// Returns `true` if the given pattern matches a sub-slice of - /// this string slice. -@@ -183,7 +180,7 @@ - - impl OsStrExt for OsStr { - fn try_str(&self) -> Result<&str, std::str::Utf8Error> { -- let bytes = self.as_encoded_bytes(); -+ let bytes = to_bytes(self); - std::str::from_utf8(bytes) - } - -@@ -192,22 +189,22 @@ - } - - fn find(&self, needle: &str) -> Option { -- let bytes = self.as_encoded_bytes(); -+ let bytes = to_bytes(self); - (0..=self.len().checked_sub(needle.len())?) - .find(|&x| bytes[x..].starts_with(needle.as_bytes())) - } - - fn strip_prefix(&self, prefix: &str) -> Option<&OsStr> { -- let bytes = self.as_encoded_bytes(); -+ let bytes = to_bytes(self); - bytes.strip_prefix(prefix.as_bytes()).map(|s| { - // SAFETY: -- // - This came from `as_encoded_bytes` -- // - Since `prefix` is `&str`, any split will be along UTF-8 boundary -- unsafe { OsStr::from_encoded_bytes_unchecked(s) } -+ // - This came from `to_bytes` -+ // - Since `prefix` is `&str`, any split will be along UTF-8 boundarie -+ unsafe { to_os_str_unchecked(s) } - }) - } - fn starts_with(&self, prefix: &str) -> bool { -- let bytes = self.as_encoded_bytes(); -+ let bytes = to_bytes(self); - bytes.starts_with(prefix.as_bytes()) - } - -@@ -222,18 +219,13 @@ - fn split_once(&self, needle: &'_ str) -> Option<(&OsStr, &OsStr)> { - let start = self.find(needle)?; - let end = start + needle.len(); -- let haystack = self.as_encoded_bytes(); -+ let haystack = to_bytes(self); - let first = &haystack[0..start]; - let second = &haystack[end..]; - // SAFETY: -- // - This came from `as_encoded_bytes` -- // - Since `needle` is `&str`, any split will be along UTF-8 boundary -- unsafe { -- Some(( -- OsStr::from_encoded_bytes_unchecked(first), -- OsStr::from_encoded_bytes_unchecked(second), -- )) -- } -+ // - This came from `to_bytes` -+ // - Since `needle` is `&str`, any split will be along UTF-8 boundarie -+ unsafe { Some((to_os_str_unchecked(first), to_os_str_unchecked(second))) } - } - } - -@@ -243,6 +235,45 @@ - impl Sealed for std::ffi::OsStr {} - } - -+/// Allow access to raw bytes -+/// -+/// As the non-UTF8 encoding is not defined, the bytes only make sense when compared with -+/// 7-bit ASCII or `&str` -+/// -+/// # Compatibility -+/// -+/// There is no guarantee how non-UTF8 bytes will be encoded, even within versions of this crate -+/// (since its dependent on rustc) -+fn to_bytes(s: &OsStr) -> &[u8] { -+ // SAFETY: -+ // - Lifetimes are the same -+ // - Types are compatible (`OsStr` is effectively a transparent wrapper for `[u8]`) -+ // - The primary contract is that the encoding for invalid surrogate code points is not -+ // guaranteed which isn't a problem here -+ // -+ // There is a proposal to support this natively (https://github.com/rust-lang/rust/pull/95290) -+ // but its in limbo -+ unsafe { std::mem::transmute(s) } -+} -+ -+/// Restore raw bytes as `OsStr` -+/// -+/// # Safety -+/// -+/// - `&[u8]` must either by a `&str` or originated with `to_bytes` within the same binary -+/// - Any splits of the original `&[u8]` must be done along UTF-8 boundaries -+unsafe fn to_os_str_unchecked(s: &[u8]) -> &OsStr { -+ // SAFETY: -+ // - Lifetimes are the same -+ // - Types are compatible (`OsStr` is effectively a transparent wrapper for `[u8]`) -+ // - The primary contract is that the encoding for invalid surrogate code points is not -+ // guaranteed which isn't a problem here -+ // -+ // There is a proposal to support this natively (https://github.com/rust-lang/rust/pull/95290) -+ // but its in limbo -+ std::mem::transmute(s) -+} -+ - pub struct Split<'s, 'n> { - haystack: Option<&'s OsStr>, - needle: &'n str, -@@ -275,10 +306,7 @@ - /// - /// `index` must be at a valid UTF-8 boundary - pub(crate) unsafe fn split_at(os: &OsStr, index: usize) -> (&OsStr, &OsStr) { -- let bytes = os.as_encoded_bytes(); -+ let bytes = to_bytes(os); - let (first, second) = bytes.split_at(index); -- ( -- OsStr::from_encoded_bytes_unchecked(first), -- OsStr::from_encoded_bytes_unchecked(second), -- ) -+ (to_os_str_unchecked(first), to_os_str_unchecked(second)) - } diff --git a/chromium-125-el-NativeValueTraits-p1.patch b/chromium-125-el-NativeValueTraits-p1.patch deleted file mode 100644 index ad0c8a86..00000000 --- a/chromium-125-el-NativeValueTraits-p1.patch +++ /dev/null @@ -1,739 +0,0 @@ -revert as workaround for compiler error with old clang < 17 - -commit 940af9f2c87b436559b97c53763aa9eaaf1254eb -Author: Jeremy Roman -Date: Wed Nov 15 16:24:54 2023 +0000 - - Use C++20 features to simplify blink::NativeValueTraitsBase. - - These allow some of the metaprogramming bits to be simplified a little. - - Change-Id: I052b4397586d21348401616e1792afdb9662f975 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5030335 - Reviewed-by: Yuki Shiino - Commit-Queue: Jeremy Roman - Cr-Commit-Position: refs/heads/main@{#1224978} - ---- 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 @@ class ExceptionState; - // return toInt32(isolate, value, exceptionState, NormalConversion); - // } - // } --template -+template - struct NativeValueTraits; - - // This declaration serves only as a blueprint for specializations: the -@@ -46,15 +45,22 @@ struct NativeValueTraits; - - 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 @@ struct ImplTypeFor { - // 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; - - // This should only be true for certain subclasses of ScriptWrappable - // that satisfy the assumptions of CreateIDLSequenceFromV8ArraySlow() with ---- 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 { -@@ -698,11 +697,12 @@ DOMArrayBufferBase* NativeValueTraits< - // 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, -@@ -711,12 +711,13 @@ NotShared NativeValueTraits -- 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, -@@ -727,11 +728,12 @@ NotShared NativeValueTraits -- 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, -@@ -740,12 +742,13 @@ MaybeShared NativeValueTraits -- 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, -@@ -756,12 +759,12 @@ MaybeShared NativeValueTraits -- 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, -@@ -770,12 +773,13 @@ NativeValueTraits -- 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, -@@ -786,11 +790,12 @@ MaybeShared NativeValueTraits -- 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, -@@ -799,12 +804,13 @@ NotShared NativeValueTraits -- 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, -@@ -815,11 +821,12 @@ NotShared NativeValueTraits -- 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, -@@ -828,12 +835,13 @@ MaybeShared NativeValueTraits -- 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, -@@ -844,9 +852,9 @@ MaybeShared NativeValueTraits -- 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, -@@ -861,11 +869,13 @@ NativeValueTraits -- 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, -@@ -877,12 +887,13 @@ T NativeValueTraits::ArgumentValue(v8 - // 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, -@@ -893,12 +904,13 @@ T NativeValueTraits -- 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,7 @@ - #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 - - #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 +716,9 @@ struct CORE_EXPORT NativeValueTraits< - }; - - 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 +730,9 @@ struct NativeValueTraits { - }; - - 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 +744,9 @@ struct NativeValueTraits> - }; - - 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 +759,9 @@ struct NativeValueTraits> - }; - - 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 +774,9 @@ struct NativeValueTraits -- 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 +789,9 @@ struct NativeValueTraits> - }; - - 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 +806,9 @@ struct NativeValueTraits -- 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 +821,9 @@ struct NativeValueTraits -- 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 +837,11 @@ struct NativeValueTraits< - }; - - 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 +854,10 @@ struct NativeValueTraits : public Nat - }; - - 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 +872,11 @@ struct NativeValueTraits -- 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, -@@ -1199,8 +1212,9 @@ NativeValueTraits>::Nativ - } - - 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*; - -@@ -1276,8 +1290,9 @@ struct NativeValueTraits> - : 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 -@@ -1407,8 +1422,10 @@ struct NativeValueTraits - - // 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) { -@@ -1431,8 +1448,9 @@ struct NativeValueTraits : public Nat - }; - - 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, -@@ -1461,8 +1479,10 @@ struct NativeValueTraits> - - // 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) { -@@ -1486,8 +1506,9 @@ struct NativeValueTraits : public Nat - - // Interface types - 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, -@@ -1516,8 +1537,11 @@ struct NativeValueTraits> - - // 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) { -@@ -1528,11 +1552,14 @@ struct NativeValueTraits : public Nat - // 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) { -@@ -1544,8 +1571,11 @@ struct NativeValueTraits> - - // 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) { -@@ -1555,8 +1585,10 @@ struct NativeValueTraits : public Nat - - // Interface types - template -- requires std::derived_from --struct NativeValueTraits : public NativeValueTraitsBase { -+struct NativeValueTraits< -+ T, -+ typename std::enable_if_t::value>> -+ : public NativeValueTraitsBase { - // This signifies that CreateIDLSequenceFromV8ArraySlow() may apply - // certain optimization based on assumptions about `NativeValue()` - // implementation below. For subclasses of ScriptWrappable that have -@@ -1593,8 +1625,9 @@ struct NativeValueTraits : public Nat - }; - - 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, -@@ -1629,8 +1662,10 @@ struct NativeValueTraits> - }; - - 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) { -@@ -1646,8 +1681,10 @@ struct NativeValueTraits : public Nat - }; - - 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) { -@@ -1668,8 +1705,9 @@ struct NativeValueTraits> - - // 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 = -@@ -1701,8 +1739,9 @@ struct NativeValueTraits -- 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; - -@@ -1724,8 +1763,9 @@ struct NativeValueTraits> - }; - - 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/chromium-125-el-NativeValueTraits-p2.patch b/chromium-125-el-NativeValueTraits-p2.patch deleted file mode 100644 index 477378b9..00000000 --- a/chromium-125-el-NativeValueTraits-p2.patch +++ /dev/null @@ -1,144 +0,0 @@ -revert as workaround for compiler error with old clang < 17 - -commit ce71348a09f6689dd01a68db64b172191d0182d8 -Author: Andrey Kosyakov -Date: Thu Dec 21 18:38:38 2023 +0000 - - [bindings] Use v8::Array::Iterate for converting script wrappables - - - This changes CreateIDLSequenceFromV8Array to use the new - v8::Array::Iterate() operation. - This speeds up the "execBundles" part of the microbenchmark - at crbug.com/dawn/1858 by around 3x. - This depends on crrev.com/c/4846594 landing (and rolling) first. - - This is a slight re-work of https://crrev.com/c/4847447/3, - originally by jkummerow@chromium.org - - Bug: v8:14218, dawn:1858, 1511239 - Change-Id: Ia266556d05b4d53e6942e12609d1c08882b4ff0f - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5132129 - Commit-Queue: Andrey Kosyakov - Reviewed-by: Yuki Shiino - Cr-Commit-Position: refs/heads/main@{#1240236} - ---- a/third_party/blink/renderer/bindings/core/v8/native_value_traits.h 2024-05-13 20:23:41.165774029 +0200 -+++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits.h 2024-05-13 20:27:58.994663485 +0200 -@@ -110,12 +110,6 @@ struct NativeValueTraitsBase< - static constexpr bool has_null_value = - bindings::NativeValueTraitsHasNullValue::value; - -- // This should only be true for certain subclasses of ScriptWrappable -- // that satisfy the assumptions of CreateIDLSequenceFromV8ArraySlow() with -- // regards to how NativeValue() is implemented for the underlying type. -- static constexpr bool supports_scriptwrappable_specific_fast_array_iteration = -- false; -- - template - static decltype(auto) ArgumentValue(v8::Isolate* isolate, - int argument_index, ---- a/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h 2024-05-13 20:23:47.295915837 +0200 -+++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h 2024-05-13 20:27:21.649808564 +0200 -@@ -1050,87 +1050,11 @@ CreateIDLSequenceFromV8ArraySlow(v8::Iso - return {}; - } - -- using ResultType = typename NativeValueTraits>::ImplType; -- ResultType result; -+ typename NativeValueTraits>::ImplType result; - result.ReserveInitialCapacity(length); - v8::Local current_context = isolate->GetCurrentContext(); - v8::TryCatch try_block(isolate); - -- // Fast path -- we're creating a sequence of script wrappables, which can be -- // done by directly getting underlying object as long as array types are -- // homogeneous. With ScriptWrappables, we don't expect to enter JS during -- // iteration, so we can rely on v8::Array::Iterate() which is much faster than -- // iterating an array on the client side of the v8. Additionally, for most -- // subsptyes of ScriptWrappables, we can speed up type checks (see more on -- // that below next to supports_scriptwrappable_specific_fast_array_iteration -- // check. -- if constexpr (std::is_base_of_v) { -- struct CallbackData { -- STACK_ALLOCATED(); -- -- public: -- v8::Isolate* isolate; -- v8::TypecheckWitness witness; -- ResultType& result; -- ExceptionState& exception_state; -- CallbackData(v8::Isolate* isolate, -- ResultType& result, -- ExceptionState& exception_state) -- : isolate(isolate), -- witness(isolate), -- result(result), -- exception_state(exception_state) {} -- }; -- -- CallbackData callback_data(isolate, result, exception_state); -- v8::Array::IterationCallback callback = [](uint32_t index, -- v8::Local v8_element, -- void* data) { -- CallbackData* callback_data = reinterpret_cast(data); -- v8::Isolate* isolate = callback_data->isolate; -- // 3.4. Initialize Si to the result of converting nextItem to an IDL value -- // of type T. -- v8::TypecheckWitness& witness = callback_data->witness; -- // We can speed up type check by taking advantage of V8's type witness, -- // provided traits' NativeValue implementation doesn't have additional -- // logic beyond checking the type and calling ToScriptWrappable(). -- if constexpr ( -- NativeValueTraits< -- T>::supports_scriptwrappable_specific_fast_array_iteration) { -- if (witness.Matches(v8_element)) { -- auto&& value = ToScriptWrappable(isolate, v8_element.As()) -- ->template ToImpl(); -- callback_data->result.push_back(std::move(value)); -- return v8::Array::CallbackResult::kContinue; -- } -- } -- auto&& element = NativeValueTraits::NativeValue( -- isolate, v8_element, callback_data->exception_state); -- if (callback_data->exception_state.HadException()) { -- // It doesn't matter whether we return `kException` or `kBreak` here, -- // as that only affects the return value of `v8_array->Iterate()`, -- // which we are ignoring. -- return v8::Array::CallbackResult::kException; -- } -- if constexpr ( -- NativeValueTraits< -- T>::supports_scriptwrappable_specific_fast_array_iteration) { -- witness.Update(v8_element); -- } -- callback_data->result.push_back(std::move(element)); -- return v8::Array::CallbackResult::kContinue; -- }; -- if (!v8_array->Iterate(current_context, callback, &callback_data) -- .IsJust()) { -- if (try_block.HasCaught()) { -- exception_state.RethrowV8Exception(try_block.Exception()); -- } -- DCHECK(exception_state.HadException()); -- return {}; -- } -- return result; -- } -- - // Array length may change if array is mutated during iteration. - for (uint32_t i = 0; i < v8_array->Length(); ++i) { - v8::Local v8_element; -@@ -1590,12 +1514,6 @@ struct NativeValueTraits< - T, - typename std::enable_if_t::value>> - : public NativeValueTraitsBase { -- // This signifies that CreateIDLSequenceFromV8ArraySlow() may apply -- // certain optimization based on assumptions about `NativeValue()` -- // implementation below. For subclasses of ScriptWrappable that have -- // different implementation of NativeValue(), this should remain false. -- static constexpr bool supports_scriptwrappable_specific_fast_array_iteration = -- true; - - static inline T* NativeValue(v8::Isolate* isolate, - v8::Local value, diff --git a/chromium-126-clang16-buildflags.patch b/chromium-126-clang16-buildflags.patch deleted file mode 100644 index cba25fda..00000000 --- a/chromium-126-clang16-buildflags.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up chromium-126.0.6478.26/build/config/compiler/BUILD.gn.clang16-buildflag chromium-126.0.6478.26/build/config/compiler/BUILD.gn ---- chromium-126.0.6478.26/build/config/compiler/BUILD.gn.clang16-buildflag 2024-06-02 14:55:55.298242780 +0200 -+++ chromium-126.0.6478.26/build/config/compiler/BUILD.gn 2024-06-02 15:04:43.839882669 +0200 -@@ -1889,9 +1889,6 @@ config("default_warnings") { - - # TODO(crbug.com/40286317): Evaluate and possibly enable. - "-Wno-vla-extension", -- -- # TODO(crbug.com/40284799): Fix and re-enable. -- "-Wno-thread-safety-reference-return", - ] - - cflags_cc += [ -@@ -1902,7 +1899,7 @@ config("default_warnings") { - if (!is_nacl) { - cflags_cc += [ - # TODO(crbug.com/41486292): Fix and re-enable. -- "-Wno-c++11-narrowing-const-reference", -+ "-Wno-c++11-narrowing", - ] - } - } diff --git a/chromium-126-clang16-disable-auto-upgrade-debug-info.patch b/chromium-126-clang16-disable-auto-upgrade-debug-info.patch deleted file mode 100644 index f7915962..00000000 --- a/chromium-126-clang16-disable-auto-upgrade-debug-info.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-126.0.6478.26/build/config/compiler/BUILD.gn.clang16-disable-auto-upgrade-debug-info chromium-126.0.6478.26/build/config/compiler/BUILD.gn ---- chromium-126.0.6478.26/build/config/compiler/BUILD.gn.clang16-disable-auto-upgrade-debug-info 2024-06-02 18:00:17.914641767 +0200 -+++ chromium-126.0.6478.26/build/config/compiler/BUILD.gn 2024-06-02 18:02:32.153544892 +0200 -@@ -780,7 +780,7 @@ config("compiler") { - - # We only use one version of LLVM within a build so there's no need to - # upgrade debug info, which can be expensive since it runs the verifier. -- ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ] -+ ldflags += [ "" ] - } - - # TODO(crbug.com/335365324): Enable on other platforms. diff --git a/chromium.spec b/chromium.spec index 501f034c..a84931e6 100644 --- a/chromium.spec +++ b/chromium.spec @@ -377,21 +377,9 @@ Patch150: chromium-124-qt6.patch Patch305: chromium-124-arm64-memory_tagging.patch Patch306: chromium-126-ifunc-header.patch -# compiler errors on el7/el8 and f38 (clang <17) -Patch307: chromium-125-el-NativeValueTraits-p1.patch -Patch308: chromium-125-el-NativeValueTraits-p2.patch - # enable fstack-protector-strong Patch312: chromium-123-fstack-protector-strong.patch -# rust is old, function or associated item not found in `OsStr` -Patch313: chromium-123-rust-clap_lex.patch - -Patch314: chromium-126-clang16-buildflags.patch - -# remove ldflags -Wl,-mllvm,-disable-auto-upgrade-debug-info which is not supported -Patch315: chromium-126-clang16-disable-auto-upgrade-debug-info.patch - # add -ftrivial-auto-var-init=zero and -fwrapv Patch316: chromium-122-clang-build-flags.patch @@ -1125,19 +1113,8 @@ Qt6 UI for chromium. %endif %endif -%if 0%{?rhel} && 0%{?rhel} < 9 || 0%{?fedora} && 0%{?fedora} < 39 -%patch -P307 -p1 -b .el-NativeValueTraits-p1 -%patch -P308 -p1 -b .el-NativeValueTraits -%patch -P314 -p1 -b .clang16-buildflag -%patch -P315 -p1 -b .clang16-disable-auto-upgrade-debug-info -%endif - %patch -P312 -p1 -b .fstack-protector-strong -%if 0%{?rhel} && 0%{?rhel} < 10 -%patch -P313 -p1 -b .rust-clap_lex -%endif - %if 0%{?rhel} >= 8 || 0%{?fedora} %patch -P316 -p1 -b .clang-build-flags %endif