From 0fd14f0f6a3079fca1a9e4ea1f64cf29957e9c89 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 14 Nov 2023 10:45:00 -0800 Subject: [PATCH 1/5] Revert "Reverts "Make `fml/...` compatible with `.clang_tidy`." (#48004)" This reverts commit 74a9de45f12858fe07a73ec8003bcba66f76b090. --- fml/memory/ref_counted_internal.h | 3 +-- fml/memory/weak_ptr_internal.h | 2 +- fml/message_loop_task_queues.h | 2 +- fml/platform/android/message_loop_android.h | 2 +- fml/shared_thread_merger.h | 2 +- fml/synchronization/semaphore.cc | 10 +++++----- fml/synchronization/semaphore.h | 2 +- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fml/memory/ref_counted_internal.h b/fml/memory/ref_counted_internal.h index 47bda01005ef9..95f9e6fe75d63 100644 --- a/fml/memory/ref_counted_internal.h +++ b/fml/memory/ref_counted_internal.h @@ -87,8 +87,7 @@ inline RefCountedThreadSafeBase::RefCountedThreadSafeBase() : ref_count_(1u) #ifndef NDEBUG , - adoption_required_(true), - destruction_started_(false) + adoption_required_(true) #endif { } diff --git a/fml/memory/weak_ptr_internal.h b/fml/memory/weak_ptr_internal.h index 28d1fca6d4f57..d94ce7c6fa588 100644 --- a/fml/memory/weak_ptr_internal.h +++ b/fml/memory/weak_ptr_internal.h @@ -30,7 +30,7 @@ class WeakPtrFlag : public fml::RefCountedThreadSafe { void Invalidate(); private: - bool is_valid_; + bool is_valid_ = false; FML_DISALLOW_COPY_AND_ASSIGN(WeakPtrFlag); }; diff --git a/fml/message_loop_task_queues.h b/fml/message_loop_task_queues.h index ba464493952c0..b3c9a63314af6 100644 --- a/fml/message_loop_task_queues.h +++ b/fml/message_loop_task_queues.h @@ -155,7 +155,7 @@ class MessageLoopTaskQueues { mutable std::mutex queue_mutex_; std::map> queue_entries_; - size_t task_queue_id_counter_; + size_t task_queue_id_counter_ = 0; std::atomic_int order_; diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index 6ff26be0fd373..a1bdad38a3840 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -29,7 +29,7 @@ class MessageLoopAndroid : public MessageLoopImpl { private: fml::UniqueObject looper_; fml::UniqueFD timer_fd_; - bool running_; + bool running_ = false; MessageLoopAndroid(); diff --git a/fml/shared_thread_merger.h b/fml/shared_thread_merger.h index 3f8ae9a6367f8..ed361edb7f062 100644 --- a/fml/shared_thread_merger.h +++ b/fml/shared_thread_merger.h @@ -59,7 +59,7 @@ class SharedThreadMerger fml::TaskQueueId subsumed_; fml::MessageLoopTaskQueues* task_queues_; std::mutex mutex_; - bool enabled_; + bool enabled_ = false; /// The |MergeWithLease| or |ExtendLeaseTo| method will record the caller /// into this lease_term_by_caller_ map, |UnMergeNowIfLastOne| diff --git a/fml/synchronization/semaphore.cc b/fml/synchronization/semaphore.cc index 8ffaab76cac29..9746c19f21f97 100644 --- a/fml/synchronization/semaphore.cc +++ b/fml/synchronization/semaphore.cc @@ -170,24 +170,24 @@ class PlatformSemaphore { namespace fml { -Semaphore::Semaphore(uint32_t count) : _impl(new PlatformSemaphore(count)) {} +Semaphore::Semaphore(uint32_t count) : impl_(new PlatformSemaphore(count)) {} Semaphore::~Semaphore() = default; bool Semaphore::IsValid() const { - return _impl->IsValid(); + return impl_->IsValid(); } bool Semaphore::Wait() { - return _impl->Wait(); + return impl_->Wait(); } bool Semaphore::TryWait() { - return _impl->TryWait(); + return impl_->TryWait(); } void Semaphore::Signal() { - return _impl->Signal(); + return impl_->Signal(); } } // namespace fml diff --git a/fml/synchronization/semaphore.h b/fml/synchronization/semaphore.h index 38d1488d64870..1207f59a6f3d2 100644 --- a/fml/synchronization/semaphore.h +++ b/fml/synchronization/semaphore.h @@ -78,7 +78,7 @@ class Semaphore { void Signal(); private: - std::unique_ptr _impl; + std::unique_ptr impl_; FML_DISALLOW_COPY_AND_ASSIGN(Semaphore); }; From fbf9fe7eabea4952490d574d3c9c873efe13f411 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 14 Nov 2023 10:57:00 -0800 Subject: [PATCH 2/5] Run postsubmits. --- .ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 2febae58e1e31..9ff9cf389b833 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -244,7 +244,7 @@ targets: - name: Linux linux_clang_tidy recipe: engine_v2/engine_v2 - presubmit: false + presubmit: true timeout: 120 properties: config_name: linux_clang_tidy @@ -399,7 +399,7 @@ targets: - name: Mac mac_clang_tidy recipe: engine_v2/engine_v2 - presubmit: false + presubmit: true timeout: 120 properties: config_name: mac_clang_tidy From 4123d9b309d7c664d48111ddc2fef5c969658a85 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 14 Nov 2023 12:44:21 -0800 Subject: [PATCH 3/5] ++ --- fml/message_loop_task_queues.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fml/message_loop_task_queues.cc b/fml/message_loop_task_queues.cc index f92dd86bfbf20..c5b6d76df5a0b 100644 --- a/fml/message_loop_task_queues.cc +++ b/fml/message_loop_task_queues.cc @@ -55,8 +55,7 @@ TaskQueueId MessageLoopTaskQueues::CreateTaskQueue() { return loop_id; } -MessageLoopTaskQueues::MessageLoopTaskQueues() - : task_queue_id_counter_(0), order_(0) { +MessageLoopTaskQueues::MessageLoopTaskQueues() : order_(0) { tls_task_source_grade.reset( new TaskSourceGradeHolder{TaskSourceGrade::kUnspecified}); } From 27e3aa36be26dd2ba69ffe95a2136ce35611dbff Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 14 Nov 2023 16:22:28 -0800 Subject: [PATCH 4/5] ++ --- fml/platform/android/message_loop_android.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fml/platform/android/message_loop_android.cc b/fml/platform/android/message_loop_android.cc index b4c5982181a54..747a5b4563dc8 100644 --- a/fml/platform/android/message_loop_android.cc +++ b/fml/platform/android/message_loop_android.cc @@ -30,8 +30,7 @@ static ALooper* AcquireLooperForThread() { MessageLoopAndroid::MessageLoopAndroid() : looper_(AcquireLooperForThread()), - timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)), - running_(false) { + timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)) { FML_CHECK(looper_.is_valid()); FML_CHECK(timer_fd_.is_valid()); From ae9364f392bc89485a314a2ecf2e705436260701 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 15 Nov 2023 12:28:04 -0800 Subject: [PATCH 5/5] Revert .ci.yaml change. --- .ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 9ff9cf389b833..1e0a19ec8790d 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -162,6 +162,7 @@ targets: timeout: 60 - name: Linux Fuchsia + bringup: true recipe: engine/engine properties: build_fuchsia: "true" @@ -219,7 +220,6 @@ targets: - web_sdk/** - name: Linux linux_fuchsia - bringup: true recipe: engine_v2/engine_v2 timeout: 60 properties: @@ -244,7 +244,7 @@ targets: - name: Linux linux_clang_tidy recipe: engine_v2/engine_v2 - presubmit: true + presubmit: false timeout: 120 properties: config_name: linux_clang_tidy @@ -399,7 +399,7 @@ targets: - name: Mac mac_clang_tidy recipe: engine_v2/engine_v2 - presubmit: true + presubmit: false timeout: 120 properties: config_name: mac_clang_tidy