Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-land "Make fml/... compatible with .clang_tidy #48030

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,24 @@ targets:
config_name: linux_benchmarks
timeout: 60

- name: Linux Fuchsia
bringup: true
recipe: engine/engine
properties:
build_fuchsia: "true"
fuchsia_ctl_version: version:0.0.27
# ensure files from pre-production Fuchsia SDK tests are purged from cache
clobber: "true"
timeout: 90
runIfNot:
- lib/web_ui/**
- shell/platform/android/**
- shell/platform/darwin/**
- shell/platform/glfw/**
- shell/platform/linux/**
- shell/platform/windows/**
- web_sdk/**

- name: Linux Fuchsia FEMU
recipe: engine/femu_test
properties:
Expand Down
3 changes: 1 addition & 2 deletions fml/memory/ref_counted_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ inline RefCountedThreadSafeBase::RefCountedThreadSafeBase()
: ref_count_(1u)
#ifndef NDEBUG
,
adoption_required_(true),
destruction_started_(false)
adoption_required_(true)
#endif
{
}
Expand Down
2 changes: 1 addition & 1 deletion fml/memory/weak_ptr_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WeakPtrFlag : public fml::RefCountedThreadSafe<WeakPtrFlag> {
void Invalidate();

private:
bool is_valid_;
bool is_valid_ = false;

FML_DISALLOW_COPY_AND_ASSIGN(WeakPtrFlag);
};
Expand Down
3 changes: 1 addition & 2 deletions fml/message_loop_task_queues.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
Expand Down
2 changes: 1 addition & 1 deletion fml/message_loop_task_queues.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class MessageLoopTaskQueues {
mutable std::mutex queue_mutex_;
std::map<TaskQueueId, std::unique_ptr<TaskQueueEntry>> queue_entries_;

size_t task_queue_id_counter_;
size_t task_queue_id_counter_ = 0;

std::atomic_int order_;

Expand Down
3 changes: 1 addition & 2 deletions fml/platform/android/message_loop_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion fml/platform/android/message_loop_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MessageLoopAndroid : public MessageLoopImpl {
private:
fml::UniqueObject<ALooper*, UniqueLooperTraits> looper_;
fml::UniqueFD timer_fd_;
bool running_;
bool running_ = false;

MessageLoopAndroid();

Expand Down
2 changes: 1 addition & 1 deletion fml/shared_thread_merger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
10 changes: 5 additions & 5 deletions fml/synchronization/semaphore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion fml/synchronization/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Semaphore {
void Signal();

private:
std::unique_ptr<PlatformSemaphore> _impl;
std::unique_ptr<PlatformSemaphore> impl_;

FML_DISALLOW_COPY_AND_ASSIGN(Semaphore);
};
Expand Down