diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index ace47f0eaad77..04e413a68bb29 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -91,6 +91,7 @@ class DartIsolate : public UIDartState { /// isolate and start over. /// enum class Phase { + // NOLINTBEGIN(readability-identifier-naming) //-------------------------------------------------------------------------- /// The initial phase of all Dart isolates. This is an internal phase and /// callers can never get a reference to a Dart isolate in this phase. @@ -132,6 +133,7 @@ class DartIsolate : public UIDartState { /// reference to a Dart isolate in this phase. /// Shutdown, + // NOLINTEND(readability-identifier-naming) }; //---------------------------------------------------------------------------- diff --git a/runtime/dart_vm_lifecycle.h b/runtime/dart_vm_lifecycle.h index c5b016be89cad..0b7189fe5dc74 100644 --- a/runtime/dart_vm_lifecycle.h +++ b/runtime/dart_vm_lifecycle.h @@ -71,6 +71,7 @@ class DartVMRef { return vm_.get(); } + // NOLINTNEXTLINE(google-runtime-operator) DartVM* operator&() { FML_DCHECK(vm_); return vm_.get(); diff --git a/shell/common/animator_unittests.cc b/shell/common/animator_unittests.cc index 80fd30596b9b1..a1f96e7992376 100644 --- a/shell/common/animator_unittests.cc +++ b/shell/common/animator_unittests.cc @@ -104,7 +104,7 @@ TEST_F(ShellTest, VSyncTargetTime) { platform_task.wait(); on_target_time_latch.Wait(); const auto vsync_waiter_target_time = - ConstantFiringVsyncWaiter::frame_target_time; + ConstantFiringVsyncWaiter::kFrameTargetTime; ASSERT_EQ(vsync_waiter_target_time.ToEpochDelta().ToMicroseconds(), target_time); diff --git a/shell/common/engine.h b/shell/common/engine.h index 17ba3cc6fd884..abe4978295ea5 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -76,6 +76,7 @@ class Engine final : public RuntimeDelegate, PointerDataDispatcher::Delegate { /// @brief Indicates the result of the call to `Engine::Run`. /// enum class RunStatus { + // NOLINTBEGIN(readability-identifier-naming) //-------------------------------------------------------------------------- /// The call to |Engine::Run| was successful and the root isolate is in the /// `DartIsolate::Phase::Running` phase with its entry-point invocation @@ -125,6 +126,7 @@ class Engine final : public RuntimeDelegate, PointerDataDispatcher::Delegate { /// AOT mode operation of the Dart VM. /// Failure, + // NOLINTEND(readability-identifier-naming) }; //---------------------------------------------------------------------------- diff --git a/shell/common/pipeline.h b/shell/common/pipeline.h index 72401eec40cd5..2657d96689a23 100644 --- a/shell/common/pipeline.h +++ b/shell/common/pipeline.h @@ -27,9 +27,11 @@ struct PipelineProduceResult { }; enum class PipelineConsumeResult { + // NOLINTBEGIN(readability-identifier-naming) NoneAvailable, Done, MoreAvailable, + // NOLINTEND(readability-identifier-naming) }; size_t GetNextPipelineTraceID(); diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 523bf53d350b6..7106a8aaae534 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -42,11 +42,9 @@ static constexpr std::chrono::milliseconds kSkiaCleanupExpiration(15000); Rasterizer::Rasterizer(Delegate& delegate, MakeGpuImageBehavior gpu_image_behavior) - : is_torn_down_(false), - delegate_(delegate), + : delegate_(delegate), gpu_image_behavior_(gpu_image_behavior), compositor_context_(std::make_unique(*this)), - user_override_resource_cache_bytes_(false), snapshot_controller_( SnapshotController::Make(*this, delegate.GetSettings())), weak_factory_(this) { diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index e5acbaf8357a9..d2d3c40dede64 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -344,6 +344,7 @@ class Rasterizer final : public SnapshotDelegate, /// rendered layer tree. /// enum class ScreenshotType { + // NOLINTBEGIN(readability-identifier-naming) //-------------------------------------------------------------------------- /// A format used to denote a Skia picture. A Skia picture is a serialized /// representation of an `SkPicture` that can be used to introspect the @@ -373,6 +374,7 @@ class Rasterizer final : public SnapshotDelegate, /// is determined from the surface. This is the only way to read wide gamut /// color data, but isn't supported everywhere. SurfaceData, + // NOLINTEND(readability-identifier-naming) }; //---------------------------------------------------------------------------- @@ -711,7 +713,7 @@ class Rasterizer final : public SnapshotDelegate, static bool ShouldResubmitFrame(const DoDrawResult& result); static DrawStatus ToDrawStatus(DoDrawStatus status); - bool is_torn_down_; + bool is_torn_down_ = false; Delegate& delegate_; MakeGpuImageBehavior gpu_image_behavior_; std::weak_ptr impeller_context_; @@ -720,7 +722,7 @@ class Rasterizer final : public SnapshotDelegate, std::unique_ptr compositor_context_; std::unordered_map view_records_; fml::closure next_frame_callback_; - bool user_override_resource_cache_bytes_; + bool user_override_resource_cache_bytes_ = false; std::optional max_cache_bytes_; fml::RefPtr raster_thread_merger_; std::shared_ptr external_view_embedder_; diff --git a/shell/common/resource_cache_limit_calculator.h b/shell/common/resource_cache_limit_calculator.h index 89ef8fd7da86c..27965475baa0a 100644 --- a/shell/common/resource_cache_limit_calculator.h +++ b/shell/common/resource_cache_limit_calculator.h @@ -24,13 +24,14 @@ class ResourceCacheLimitItem { class ResourceCacheLimitCalculator { public: - ResourceCacheLimitCalculator(size_t max_bytes_threshold) + explicit ResourceCacheLimitCalculator(size_t max_bytes_threshold) : max_bytes_threshold_(max_bytes_threshold) {} ~ResourceCacheLimitCalculator() = default; // This will be called on the platform thread. - void AddResourceCacheLimitItem(fml::WeakPtr item) { + void AddResourceCacheLimitItem( + const fml::WeakPtr& item) { items_.push_back(item); } diff --git a/shell/common/shell.h b/shell/common/shell.h index 9eb5bd1e9b226..1e2574f943567 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -45,6 +45,7 @@ namespace flutter { /// Error exit codes for the Dart isolate. enum class DartErrorCode { + // NOLINTBEGIN(readability-identifier-naming) /// No error has occurred. NoError = 0, /// The Dart error code for an API error. @@ -53,6 +54,7 @@ enum class DartErrorCode { CompilationError = 254, /// The Dart error code for an unknown error. UnknownError = 255 + // NOLINTEND(readability-identifier-naming) }; /// Values for |Shell::SetGpuAvailability|. diff --git a/shell/common/shell_test_platform_view.h b/shell/common/shell_test_platform_view.h index fdbe870fb6039..0caac65a8fc44 100644 --- a/shell/common/shell_test_platform_view.h +++ b/shell/common/shell_test_platform_view.h @@ -36,7 +36,7 @@ class ShellTestPlatformView : public PlatformView { protected: ShellTestPlatformView(PlatformView::Delegate& delegate, - TaskRunners task_runners) + const TaskRunners& task_runners) : PlatformView(delegate, task_runners) {} FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformView); @@ -53,7 +53,7 @@ class ShellTestPlatformViewBuilder { ShellTestPlatformView::BackendType::kDefaultBackend; }; - ShellTestPlatformViewBuilder(Config config); + explicit ShellTestPlatformViewBuilder(Config config); ~ShellTestPlatformViewBuilder() = default; // Override operator () to make this class assignable to std::function. diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h index cc423cd027b1d..89b0e8f61821c 100644 --- a/shell/common/thread_host.h +++ b/shell/common/thread_host.h @@ -20,11 +20,13 @@ using ThreadConfigSetter = fml::Thread::ThreadConfigSetter; /// The collection of all the threads used by the engine. struct ThreadHost { enum Type { + // NOLINTBEGIN(readability-identifier-naming) Platform = 1 << 0, UI = 1 << 1, RASTER = 1 << 2, IO = 1 << 3, Profiler = 1 << 4, + // NOLINTEND(readability-identifier-naming) }; /// The collection of all the thread configures, and we create custom thread diff --git a/shell/common/vsync_waiters_test.cc b/shell/common/vsync_waiters_test.cc index ff26cc6775270..3c237959df547 100644 --- a/shell/common/vsync_waiters_test.cc +++ b/shell/common/vsync_waiters_test.cc @@ -60,7 +60,7 @@ void ConstantFiringVsyncWaiter::AwaitVSync() { FML_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); auto async_wait = std::async([this]() { task_runners_.GetPlatformTaskRunner()->PostTask( - [this]() { FireCallback(frame_begin_time, frame_target_time); }); + [this]() { FireCallback(kFrameBeginTime, kFrameTargetTime); }); }); } diff --git a/shell/common/vsync_waiters_test.h b/shell/common/vsync_waiters_test.h index 80fa3abfb6c24..b141077a30e08 100644 --- a/shell/common/vsync_waiters_test.h +++ b/shell/common/vsync_waiters_test.h @@ -7,6 +7,8 @@ #ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITERS_TEST_H_ #define FLUTTER_SHELL_COMMON_VSYNC_WAITERS_TEST_H_ +#include + #include "flutter/shell/common/shell.h" namespace flutter { @@ -30,9 +32,9 @@ class ShellTestVsyncClock { class ShellTestVsyncWaiter : public VsyncWaiter { public: - ShellTestVsyncWaiter(TaskRunners task_runners, + ShellTestVsyncWaiter(const TaskRunners& task_runners, std::shared_ptr clock) - : VsyncWaiter(std::move(task_runners)), clock_(clock) {} + : VsyncWaiter(task_runners), clock_(std::move(clock)) {} protected: void AwaitVSync() override; @@ -44,13 +46,13 @@ class ShellTestVsyncWaiter : public VsyncWaiter { class ConstantFiringVsyncWaiter : public VsyncWaiter { public: // both of these are set in the past so as to fire immediately. - static constexpr fml::TimePoint frame_begin_time = + static constexpr fml::TimePoint kFrameBeginTime = fml::TimePoint::FromEpochDelta(fml::TimeDelta::FromSeconds(0)); - static constexpr fml::TimePoint frame_target_time = + static constexpr fml::TimePoint kFrameTargetTime = fml::TimePoint::FromEpochDelta(fml::TimeDelta::FromSeconds(100)); - explicit ConstantFiringVsyncWaiter(TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)) {} + explicit ConstantFiringVsyncWaiter(const TaskRunners& task_runners) + : VsyncWaiter(task_runners) {} protected: void AwaitVSync() override;