git: cf43f81e2d25 - 2024Q4 - devel/electron31: fix build with clang 19

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Fri, 01 Nov 2024 20:52:31 UTC
The branch 2024Q4 has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cf43f81e2d25d27dc7f3e0f7fc54ed9f4c68350f

commit cf43f81e2d25d27dc7f3e0f7fc54ed9f4c68350f
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2024-11-01 20:50:10 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2024-11-01 20:52:17 +0000

    devel/electron31: fix build with clang 19
    
    PR:             282370
    Reported by:    madpilot
    MFH:            2024Q4
    
    (cherry picked from commit 2457237c15a3db2b496a1e5660e9f0d4a6d56e64)
---
 .../patch-electron_shell_common_keyboard__util.cc  | 11 +++++
 ...party_blink_renderer_platform_wtf_hash__table.h | 31 +++++++++++++
 ...o_tracing_internal_track__event__data__source.h | 54 ++++++++++++++++++++++
 3 files changed, 96 insertions(+)

diff --git a/devel/electron31/files/patch-electron_shell_common_keyboard__util.cc b/devel/electron31/files/patch-electron_shell_common_keyboard__util.cc
new file mode 100644
index 000000000000..977f0dea72a5
--- /dev/null
+++ b/devel/electron31/files/patch-electron_shell_common_keyboard__util.cc
@@ -0,0 +1,11 @@
+--- electron/shell/common/keyboard_util.cc.orig	2024-10-23 21:18:11 UTC
++++ electron/shell/common/keyboard_util.cc
+@@ -16,7 +16,7 @@ using CodeAndShiftedChar = std::pair<ui::KeyboardCode,
+ 
+ using CodeAndShiftedChar = std::pair<ui::KeyboardCode, std::optional<char16_t>>;
+ 
+-constexpr CodeAndShiftedChar KeyboardCodeFromKeyIdentifier(
++CodeAndShiftedChar KeyboardCodeFromKeyIdentifier(
+     const std::string_view str) {
+ #if BUILDFLAG(IS_MAC)
+   constexpr auto CommandOrControl = ui::VKEY_COMMAND;
diff --git a/devel/electron31/files/patch-third__party_blink_renderer_platform_wtf_hash__table.h b/devel/electron31/files/patch-third__party_blink_renderer_platform_wtf_hash__table.h
new file mode 100644
index 000000000000..831809a8e908
--- /dev/null
+++ b/devel/electron31/files/patch-third__party_blink_renderer_platform_wtf_hash__table.h
@@ -0,0 +1,31 @@
+--- third_party/blink/renderer/platform/wtf/hash_table.h.orig	2024-08-19 05:20:52 UTC
++++ third_party/blink/renderer/platform/wtf/hash_table.h
+@@ -1639,7 +1639,7 @@ HashTable<Key, Value, Extractor, Traits, KeyTraits, Al
+     }
+   }
+   table_ = temporary_table;
+-  Allocator::template BackingWriteBarrier(&table_);
++  Allocator::BackingWriteBarrier(&table_);
+ 
+   HashTableBucketInitializer<Traits, Allocator, Value>::InitializeTable(
+       original_table, new_table_size);
+@@ -1693,7 +1693,7 @@ Value* HashTable<Key, Value, Extractor, Traits, KeyTra
+   // This swaps the newly allocated buffer with the current one. The store to
+   // the current table has to be atomic to prevent races with concurrent marker.
+   AsAtomicPtr(&table_)->store(new_hash_table.table_, std::memory_order_relaxed);
+-  Allocator::template BackingWriteBarrier(&table_);
++  Allocator::BackingWriteBarrier(&table_);
+   table_size_ = new_table_size;
+ 
+   new_hash_table.table_ = old_table;
+@@ -1845,8 +1845,8 @@ void HashTable<Key, Value, Extractor, Traits, KeyTrait
+   // on the mutator thread, which is also the only one that writes to them, so
+   // there is *no* risk of data races when reading.
+   AtomicWriteSwap(table_, other.table_);
+-  Allocator::template BackingWriteBarrier(&table_);
+-  Allocator::template BackingWriteBarrier(&other.table_);
++  Allocator::BackingWriteBarrier(&table_);
++  Allocator::BackingWriteBarrier(&other.table_);
+   if (IsWeak<ValueType>::value) {
+     // Weak processing is omitted when no backing store is present. In case such
+     // an empty table is later on used it needs to be strongified.
diff --git a/devel/electron31/files/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__data__source.h b/devel/electron31/files/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__data__source.h
new file mode 100644
index 000000000000..96a551155ab9
--- /dev/null
+++ b/devel/electron31/files/patch-third__party_perfetto_include_perfetto_tracing_internal_track__event__data__source.h
@@ -0,0 +1,54 @@
+--- third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h.orig	2024-08-19 05:26:12 UTC
++++ third_party/perfetto/include/perfetto/tracing/internal/track_event_data_source.h
+@@ -328,13 +328,13 @@ class TrackEventDataSource
+   }
+ 
+   static void Flush() {
+-    Base::template Trace([](typename Base::TraceContext ctx) { ctx.Flush(); });
++    Base::Trace([](typename Base::TraceContext ctx) { ctx.Flush(); });
+   }
+ 
+   // Determine if *any* tracing category is enabled.
+   static bool IsEnabled() {
+     bool enabled = false;
+-    Base::template CallIfEnabled(
++    Base::CallIfEnabled(
+         [&](uint32_t /*instances*/) { enabled = true; });
+     return enabled;
+   }
+@@ -349,7 +349,7 @@ class TrackEventDataSource
+   static bool IsDynamicCategoryEnabled(
+       const DynamicCategory& dynamic_category) {
+     bool enabled = false;
+-    Base::template Trace([&](typename Base::TraceContext ctx) {
++    Base::Trace([&](typename Base::TraceContext ctx) {
+       enabled = enabled || IsDynamicCategoryEnabled(&ctx, dynamic_category);
+     });
+     return enabled;
+@@ -496,7 +496,7 @@ class TrackEventDataSource
+                                  const protos::gen::TrackDescriptor& desc) {
+     PERFETTO_DCHECK(track.uuid == desc.uuid());
+     TrackRegistry::Get()->UpdateTrack(track, desc.SerializeAsString());
+-    Base::template Trace([&](typename Base::TraceContext ctx) {
++    Base::Trace([&](typename Base::TraceContext ctx) {
+       TrackEventInternal::WriteTrackDescriptor(
+           track, ctx.tls_inst_->trace_writer.get(), ctx.GetIncrementalState(),
+           *ctx.GetCustomTlsState(), TrackEventInternal::GetTraceTime());
+@@ -1047,7 +1047,7 @@ class TrackEventDataSource
+                                  Lambda lambda) PERFETTO_ALWAYS_INLINE {
+     using CatTraits = CategoryTraits<CategoryType>;
+     if (CatTraits::kIsDynamic) {
+-      Base::template TraceWithInstances(instances, std::move(lambda));
++      Base::TraceWithInstances(instances, std::move(lambda));
+     } else {
+       Base::template TraceWithInstances<CategoryTracePointTraits>(
+           instances, std::move(lambda), {CatTraits::GetStaticIndex(category)});
+@@ -1061,7 +1061,7 @@ class TrackEventDataSource
+       const TrackType& track,
+       std::function<void(protos::pbzero::TrackDescriptor*)> callback) {
+     TrackRegistry::Get()->UpdateTrack(track, std::move(callback));
+-    Base::template Trace([&](typename Base::TraceContext ctx) {
++    Base::Trace([&](typename Base::TraceContext ctx) {
+       TrackEventInternal::WriteTrackDescriptor(
+           track, ctx.tls_inst_->trace_writer.get(), ctx.GetIncrementalState(),
+           *ctx.GetCustomTlsState(), TrackEventInternal::GetTraceTime());