diff --git a/lib/ui/ui_benchmarks.cc b/lib/ui/ui_benchmarks.cc index 1c906a4605c6a..97cdaa97829c2 100644 --- a/lib/ui/ui_benchmarks.cc +++ b/lib/ui/ui_benchmarks.cc @@ -21,8 +21,8 @@ class Fixture : public testing::FixtureTest { static void BM_PlatformMessageResponseDartComplete(benchmark::State& state) { ThreadHost thread_host(ThreadHost::ThreadHostConfig( - "test", ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI)); + "test", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -69,8 +69,8 @@ static void BM_PlatformMessageResponseDartComplete(benchmark::State& state) { static void BM_PathVolatilityTracker(benchmark::State& state) { ThreadHost thread_host(ThreadHost::ThreadHostConfig( - "test", ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI)); + "test", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), diff --git a/shell/common/dart_native_benchmarks.cc b/shell/common/dart_native_benchmarks.cc index 30a08a4f879f2..ff3999eefe0ac 100644 --- a/shell/common/dart_native_benchmarks.cc +++ b/shell/common/dart_native_benchmarks.cc @@ -44,8 +44,8 @@ BENCHMARK_F(DartNativeBenchmarks, TimeToFirstNativeMessageFromIsolateInNewVM) DartVMRef vm_ref = DartVMRef::Create(settings); ThreadHost thread_host("io.flutter.test.DartNativeBenchmarks.", - ThreadHost::Type::Platform | ThreadHost::Type::IO | - ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform @@ -81,8 +81,8 @@ BENCHMARK_F(DartNativeBenchmarks, MultipleDartToNativeMessages) DartVMRef vm_ref = DartVMRef::Create(settings); ThreadHost thread_host("io.flutter.test.DartNativeBenchmarks.", - ThreadHost::Type::Platform | ThreadHost::Type::IO | - ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform diff --git a/shell/common/engine_unittests.cc b/shell/common/engine_unittests.cc index 7ffa0a6f7714a..55e895d165dca 100644 --- a/shell/common/engine_unittests.cc +++ b/shell/common/engine_unittests.cc @@ -207,8 +207,8 @@ class EngineTest : public testing::FixtureTest { public: EngineTest() : thread_host_("EngineTest", - ThreadHost::Type::Platform | ThreadHost::Type::IO | - ThreadHost::Type::UI | ThreadHost::Type::RASTER), + ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi | ThreadHost::Type::kRaster), task_runners_({ "EngineTest", thread_host_.platform_thread->GetTaskRunner(), // platform diff --git a/shell/common/rasterizer_unittests.cc b/shell/common/rasterizer_unittests.cc index 10085e66ade0e..d800bbdb3a5ed 100644 --- a/shell/common/rasterizer_unittests.cc +++ b/shell/common/rasterizer_unittests.cc @@ -149,8 +149,9 @@ TEST(RasterizerTest, drawEmptyPipeline) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -179,8 +180,9 @@ TEST(RasterizerTest, std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -253,8 +255,9 @@ TEST( std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -321,8 +324,9 @@ TEST( std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); fml::MessageLoop::EnsureInitializedForCurrentThread(); TaskRunners task_runners("test", fml::MessageLoop::GetCurrent().GetTaskRunner(), @@ -391,8 +395,9 @@ TEST(RasterizerTest, std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); fml::MessageLoop::EnsureInitializedForCurrentThread(); TaskRunners task_runners("test", fml::MessageLoop::GetCurrent().GetTaskRunner(), @@ -475,8 +480,9 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -522,8 +528,9 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNotUsedThisFrame) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -587,8 +594,9 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenPipelineIsEmpty) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -632,8 +640,9 @@ TEST(RasterizerTest, std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -692,8 +701,9 @@ TEST( std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -753,8 +763,9 @@ TEST( std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -813,8 +824,9 @@ TEST( std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -872,8 +884,9 @@ TEST( std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -930,8 +943,9 @@ TEST(RasterizerTest, std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1017,8 +1031,9 @@ TEST(RasterizerTest, TeardownFreesResourceCache) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1079,8 +1094,9 @@ TEST(RasterizerTest, TeardownNoSurface) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1105,8 +1121,8 @@ TEST(RasterizerTest, presentationTimeSetWhenVsyncTargetInFuture) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1194,8 +1210,8 @@ TEST(RasterizerTest, presentationTimeNotSetWhenVsyncTargetInPast) { std::string test_name = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), diff --git a/shell/common/shell_benchmarks.cc b/shell/common/shell_benchmarks.cc index efd53d0b31b54..a1bba720fe940 100644 --- a/shell/common/shell_benchmarks.cc +++ b/shell/common/shell_benchmarks.cc @@ -44,9 +44,9 @@ static void StartupAndShutdownShell(benchmark::State& state, } thread_host = std::make_unique(ThreadHost::ThreadHostConfig( - "io.flutter.bench.", ThreadHost::Type::Platform | - ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI)); + "io.flutter.bench.", + ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); TaskRunners task_runners("test", thread_host->platform_thread->GetTaskRunner(), diff --git a/shell/common/shell_test.cc b/shell/common/shell_test.cc index bd952747ca58f..efcf43ce82668 100644 --- a/shell/common/shell_test.cc +++ b/shell/common/shell_test.cc @@ -57,8 +57,8 @@ FrameContent ViewContent::ImplicitView(double width, ShellTest::ShellTest() : thread_host_("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::Type::IO | - ThreadHost::Type::UI | ThreadHost::Type::RASTER) {} + ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi | ThreadHost::Type::kRaster) {} void ShellTest::SendPlatformMessage(Shell* shell, std::unique_ptr message) { diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index d0c5b6dc1bda4..00cfd4d10b541 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -388,8 +388,8 @@ TEST_F(ShellTest, InitializeWithDifferentThreads) { Settings settings = CreateSettingsForFixture(); std::string name_prefix = "io.flutter.test." + GetCurrentTestName() + "."; ThreadHost thread_host(ThreadHost::ThreadHostConfig( - name_prefix, ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI)); + name_prefix, ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); ASSERT_EQ(thread_host.name_prefix, name_prefix); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), @@ -407,7 +407,7 @@ TEST_F(ShellTest, InitializeWithSingleThread) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); auto task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", task_runner, task_runner, task_runner, task_runner); @@ -436,9 +436,9 @@ TEST_F(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); - ThreadHost thread_host( - "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::RASTER | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); fml::MessageLoop::EnsureInitializedForCurrentThread(); TaskRunners task_runners("test", fml::MessageLoop::GetCurrent().GetTaskRunner(), @@ -471,7 +471,7 @@ TEST_F(ShellTest, InitializeWithDisabledGpu) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); auto task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", task_runner, task_runner, task_runner, task_runner); @@ -495,9 +495,9 @@ TEST_F(ShellTest, InitializeWithDisabledGpu) { TEST_F(ShellTest, InitializeWithGPUAndPlatformThreadsTheSame) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); - ThreadHost thread_host( - "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", + ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform @@ -1337,9 +1337,9 @@ TEST_F(ShellTest, OnPlatformViewDestroyWithStaticThreadMerging) { }; auto external_view_embedder = std::make_shared( end_frame_callback, PostPrerollResult::kSuccess, true); - ThreadHost thread_host( - "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", + ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform @@ -3699,7 +3699,7 @@ TEST_F(ShellTest, UpdateAssetResolverByTypeNull) { Settings settings = CreateSettingsForFixture(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform)); + ThreadHost::Type::kPlatform)); auto task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", task_runner, task_runner, task_runner, task_runner); @@ -4221,7 +4221,7 @@ TEST_F(ShellTest, PictureToImageSyncWithTrampledContext) { // make it easier to trample the GL context by running on a single task // runner. ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); auto task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", task_runner, task_runner, task_runner, task_runner); @@ -4299,8 +4299,8 @@ TEST_F(ShellTest, NotifyIdleRejectsPastAndNearFuture) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::UI | - ThreadHost::IO | ThreadHost::RASTER); + ThreadHost::Type::kPlatform | ThreadHost::kUi | + ThreadHost::kIo | ThreadHost::kRaster); auto platform_task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), @@ -4344,8 +4344,8 @@ TEST_F(ShellTest, NotifyIdleNotCalledInLatencyMode) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::UI | - ThreadHost::IO | ThreadHost::RASTER); + ThreadHost::Type::kPlatform | ThreadHost::kUi | + ThreadHost::kIo | ThreadHost::kRaster); auto platform_task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), @@ -4387,8 +4387,8 @@ TEST_F(ShellTest, NotifyDestroyed) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::UI | - ThreadHost::IO | ThreadHost::RASTER); + ThreadHost::Type::kPlatform | ThreadHost::kUi | + ThreadHost::kIo | ThreadHost::kRaster); auto platform_task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), @@ -4423,7 +4423,7 @@ TEST_F(ShellTest, PrintsErrorWhenPlatformMessageSentFromWrongThread) { #else Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); auto task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", task_runner, task_runner, task_runner, task_runner); @@ -4475,7 +4475,7 @@ TEST_F(ShellTest, DiesIfSoftwareRenderingAndImpellerAreEnabledDeathTest) { settings.enable_impeller = true; settings.enable_software_rendering = true; ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); auto task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", task_runner, task_runner, task_runner, task_runner); @@ -4540,8 +4540,8 @@ TEST_F(ShellTest, ShellCanAddViewOrRemoveView) { Settings settings = CreateSettingsForFixture(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI)); + ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -4621,8 +4621,8 @@ TEST_F(ShellTest, ShellFlushesPlatformStatesByMain) { Settings settings = CreateSettingsForFixture(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::Type::RASTER | - ThreadHost::Type::IO | ThreadHost::Type::UI)); + ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), diff --git a/shell/common/thread_host.cc b/shell/common/thread_host.cc index e1edd2bd5ccbe..3b90460cbc357 100644 --- a/shell/common/thread_host.cc +++ b/shell/common/thread_host.cc @@ -16,43 +16,43 @@ std::string ThreadHost::ThreadHostConfig::MakeThreadName( Type type, const std::string& prefix) { switch (type) { - case Type::Platform: + case Type::kPlatform: return prefix + ".platform"; - case Type::UI: + case Type::kUi: return prefix + ".ui"; - case Type::IO: + case Type::kIo: return prefix + ".io"; - case Type::RASTER: + case Type::kRaster: return prefix + ".raster"; - case Type::Profiler: + case Type::kProfiler: return prefix + ".profiler"; } } void ThreadHost::ThreadHostConfig::SetIOConfig(const ThreadConfig& config) { - type_mask |= ThreadHost::Type::IO; + type_mask |= ThreadHost::Type::kIo; io_config = config; } void ThreadHost::ThreadHostConfig::SetUIConfig(const ThreadConfig& config) { - type_mask |= ThreadHost::Type::UI; + type_mask |= ThreadHost::Type::kUi; ui_config = config; } void ThreadHost::ThreadHostConfig::SetPlatformConfig( const ThreadConfig& config) { - type_mask |= ThreadHost::Type::Platform; + type_mask |= ThreadHost::Type::kPlatform; platform_config = config; } void ThreadHost::ThreadHostConfig::SetRasterConfig(const ThreadConfig& config) { - type_mask |= ThreadHost::Type::RASTER; + type_mask |= ThreadHost::Type::kRaster; raster_config = config; } void ThreadHost::ThreadHostConfig::SetProfilerConfig( const ThreadConfig& config) { - type_mask |= ThreadHost::Type::Profiler; + type_mask |= ThreadHost::Type::kProfiler; profiler_config = config; } @@ -78,27 +78,27 @@ ThreadHost::ThreadHost(const std::string& name_prefix, uint64_t mask) ThreadHost::ThreadHost(const ThreadHostConfig& host_config) : name_prefix(host_config.name_prefix) { - if (host_config.isThreadNeeded(ThreadHost::Type::Platform)) { + if (host_config.isThreadNeeded(ThreadHost::Type::kPlatform)) { platform_thread = - CreateThread(Type::Platform, host_config.platform_config, host_config); + CreateThread(Type::kPlatform, host_config.platform_config, host_config); } - if (host_config.isThreadNeeded(ThreadHost::Type::UI)) { - ui_thread = CreateThread(Type::UI, host_config.ui_config, host_config); + if (host_config.isThreadNeeded(ThreadHost::Type::kUi)) { + ui_thread = CreateThread(Type::kUi, host_config.ui_config, host_config); } - if (host_config.isThreadNeeded(ThreadHost::Type::RASTER)) { + if (host_config.isThreadNeeded(ThreadHost::Type::kRaster)) { raster_thread = - CreateThread(Type::RASTER, host_config.raster_config, host_config); + CreateThread(Type::kRaster, host_config.raster_config, host_config); } - if (host_config.isThreadNeeded(ThreadHost::Type::IO)) { - io_thread = CreateThread(Type::IO, host_config.io_config, host_config); + if (host_config.isThreadNeeded(ThreadHost::Type::kIo)) { + io_thread = CreateThread(Type::kIo, host_config.io_config, host_config); } - if (host_config.isThreadNeeded(ThreadHost::Type::Profiler)) { + if (host_config.isThreadNeeded(ThreadHost::Type::kProfiler)) { profiler_thread = - CreateThread(Type::Profiler, host_config.profiler_config, host_config); + CreateThread(Type::kProfiler, host_config.profiler_config, host_config); } } diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h index 89b0e8f61821c..eabd5eb92f137 100644 --- a/shell/common/thread_host.h +++ b/shell/common/thread_host.h @@ -20,13 +20,11 @@ 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) + kPlatform = 1 << 0, + kUi = 1 << 1, + kRaster = 1 << 2, + kIo = 1 << 3, + kProfiler = 1 << 4, }; /// The collection of all the thread configures, and we create custom thread diff --git a/shell/platform/android/android_context_gl_unittests.cc b/shell/platform/android/android_context_gl_unittests.cc index 500ec7e74c313..e1ee5ec89e6b5 100644 --- a/shell/platform/android/android_context_gl_unittests.cc +++ b/shell/platform/android/android_context_gl_unittests.cc @@ -36,8 +36,8 @@ TEST(AndroidContextGl, Create) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); @@ -76,8 +76,8 @@ TEST(AndroidSurfaceGL, CreateSnapshopSurfaceWhenOnscreenSurfaceIsNotNull) { std::string thread_label = ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto android_context = std::make_shared( AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); @@ -101,7 +101,7 @@ TEST(AndroidSurfaceGL, CreateSnapshopSurfaceWhenOnscreenSurfaceIsNull) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); auto mask = - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO; + ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; flutter::ThreadHost::ThreadHostConfig host_config(mask); ThreadHost thread_host(host_config); @@ -125,8 +125,8 @@ TEST(AndroidContextGl, DISABLED_MSAAx4) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( AndroidRenderingAPI::kOpenGLES, environment, task_runners, 4); @@ -147,8 +147,8 @@ TEST(AndroidContextGl, EnsureMakeCurrentChecksCurrentContextStatus) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO)); + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | + ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( AndroidRenderingAPI::kOpenGLES, environment, task_runners, 0); diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index f4812ee463bfe..8d2f349e3d87f 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -90,21 +90,21 @@ AndroidShellHolder::AndroidShellHolder( auto thread_label = std::to_string(thread_host_count++); auto mask = - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO; + ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; flutter::ThreadHost::ThreadHostConfig host_config( thread_label, mask, AndroidPlatformThreadConfigSetter); host_config.ui_config = fml::Thread::ThreadConfig( flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::UI, thread_label), + flutter::ThreadHost::Type::kUi, thread_label), fml::Thread::ThreadPriority::kDisplay); host_config.raster_config = fml::Thread::ThreadConfig( flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::RASTER, thread_label), + flutter::ThreadHost::Type::kRaster, thread_label), fml::Thread::ThreadPriority::kRaster); host_config.io_config = fml::Thread::ThreadConfig( flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::IO, thread_label), + flutter::ThreadHost::Type::kIo, thread_label), fml::Thread::ThreadPriority::kNormal); thread_host_ = std::make_shared(host_config); diff --git a/shell/platform/android/jni/platform_view_android_jni.h b/shell/platform/android/jni/platform_view_android_jni.h index e87355a473336..2fd849078cb7e 100644 --- a/shell/platform/android/jni/platform_view_android_jni.h +++ b/shell/platform/android/jni/platform_view_android_jni.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_JNI_PLATFORM_VIEW_ANDROID_JNI_H_ #define FLUTTER_SHELL_PLATFORM_ANDROID_JNI_PLATFORM_VIEW_ANDROID_JNI_H_ +#include + #include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" @@ -179,7 +181,7 @@ class PlatformViewAndroidJNI { /// struct OverlayMetadata { OverlayMetadata(int id, fml::RefPtr window) - : id(id), window(window){}; + : id(id), window(std::move(window)){}; ~OverlayMetadata() = default; diff --git a/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h b/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h index 3f812d17406ce..a536dcfa01b87 100644 --- a/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h +++ b/shell/platform/common/client_wrapper/include/flutter/texture_registrar.h @@ -54,7 +54,7 @@ class GpuSurfaceTexture { GpuSurfaceTexture(FlutterDesktopGpuSurfaceType surface_type, ObtainDescriptorCallback obtain_descriptor_callback) : surface_type_(surface_type), - obtain_descriptor_callback_(obtain_descriptor_callback) {} + obtain_descriptor_callback_(std::move(obtain_descriptor_callback)) {} // Returns the callback-provided FlutterDesktopGpuSurfaceDescriptor that // contains the surface handle. The intended surface size is specified by diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 8d16c6d0d20de..8fa12218b8633 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -793,11 +793,11 @@ + (NSString*)generateThreadLabel:(NSString*)labelPrefix { // initialized. fml::MessageLoop::EnsureInitializedForCurrentThread(); - uint32_t threadHostType = flutter::ThreadHost::Type::UI | flutter::ThreadHost::Type::RASTER | - flutter::ThreadHost::Type::IO; + uint32_t threadHostType = flutter::ThreadHost::Type::kUi | flutter::ThreadHost::Type::kRaster | + flutter::ThreadHost::Type::kIo; if ([FlutterEngine isProfilerEnabled]) { - threadHostType = threadHostType | flutter::ThreadHost::Type::Profiler; + threadHostType = threadHostType | flutter::ThreadHost::Type::kProfiler; } flutter::ThreadHost::ThreadHostConfig host_config(threadLabel.UTF8String, threadHostType, @@ -805,17 +805,17 @@ + (NSString*)generateThreadLabel:(NSString*)labelPrefix { host_config.ui_config = fml::Thread::ThreadConfig(flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::UI, threadLabel.UTF8String), + flutter::ThreadHost::Type::kUi, threadLabel.UTF8String), fml::Thread::ThreadPriority::kDisplay); host_config.raster_config = fml::Thread::ThreadConfig(flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::RASTER, threadLabel.UTF8String), + flutter::ThreadHost::Type::kRaster, threadLabel.UTF8String), fml::Thread::ThreadPriority::kRaster); host_config.io_config = fml::Thread::ThreadConfig(flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::IO, threadLabel.UTF8String), + flutter::ThreadHost::Type::kIo, threadLabel.UTF8String), fml::Thread::ThreadPriority::kNormal); return (flutter::ThreadHost){host_config}; diff --git a/shell/platform/darwin/ios/platform_message_handler_ios_test.mm b/shell/platform/darwin/ios/platform_message_handler_ios_test.mm index 85560e5df7143..b1e59dd4ad157 100644 --- a/shell/platform/darwin/ios/platform_message_handler_ios_test.mm +++ b/shell/platform/darwin/ios/platform_message_handler_ios_test.mm @@ -52,7 +52,7 @@ TaskRunners task_runners("test", GetCurrentTaskRunner(), CreateNewThread("raster - (void)testSetAndCallHandler { ThreadHost thread_host("io.flutter.test." + std::string(self.name.UTF8String), - ThreadHost::Type::RASTER | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | ThreadHost::Type::kUi); TaskRunners task_runners( "test", GetCurrentTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), thread_host.io_thread->GetTaskRunner()); @@ -78,7 +78,7 @@ TaskRunners task_runners( - (void)testSetClearAndCallHandler { ThreadHost thread_host("io.flutter.test." + std::string(self.name.UTF8String), - ThreadHost::Type::RASTER | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | ThreadHost::Type::kUi); TaskRunners task_runners( "test", GetCurrentTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), thread_host.io_thread->GetTaskRunner()); @@ -106,7 +106,7 @@ TaskRunners task_runners( - (void)testSetAndCallHandlerTaskQueue { ThreadHost thread_host("io.flutter.test." + std::string(self.name.UTF8String), - ThreadHost::Type::RASTER | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | ThreadHost::Type::kUi); TaskRunners task_runners( "test", GetCurrentTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), thread_host.io_thread->GetTaskRunner()); diff --git a/shell/platform/embedder/embedder_thread_host.cc b/shell/platform/embedder/embedder_thread_host.cc index 03485090638a9..7cca136462ed5 100644 --- a/shell/platform/embedder/embedder_thread_host.cc +++ b/shell/platform/embedder/embedder_thread_host.cc @@ -137,9 +137,9 @@ EmbedderThreadHost::CreateEmbedderManagedThreadHost( // // If/when more task runners are exposed, this mask will need to be updated. thread_host_config.SetUIConfig(MakeThreadConfig( - ThreadHost::Type::UI, fml::Thread::ThreadPriority::kDisplay)); + ThreadHost::Type::kUi, fml::Thread::ThreadPriority::kDisplay)); thread_host_config.SetIOConfig(MakeThreadConfig( - ThreadHost::Type::IO, fml::Thread::ThreadPriority::kBackground)); + ThreadHost::Type::kIo, fml::Thread::ThreadPriority::kBackground)); auto platform_task_runner_pair = CreateEmbedderTaskRunner( SAFE_ACCESS(custom_task_runners, platform_task_runner, nullptr)); @@ -157,7 +157,7 @@ EmbedderThreadHost::CreateEmbedderManagedThreadHost( // created. if (!render_task_runner_pair.second) { thread_host_config.SetRasterConfig(MakeThreadConfig( - ThreadHost::Type::RASTER, fml::Thread::ThreadPriority::kRaster)); + ThreadHost::Type::kRaster, fml::Thread::ThreadPriority::kRaster)); } // If both the platform task runner and the raster task runner are specified @@ -227,11 +227,11 @@ EmbedderThreadHost::CreateEngineManagedThreadHost( // Crate a thraed host config, and specified the thread name and priority. auto thread_host_config = ThreadHost::ThreadHostConfig(config_setter); thread_host_config.SetUIConfig(MakeThreadConfig( - flutter::ThreadHost::UI, fml::Thread::ThreadPriority::kDisplay)); + flutter::ThreadHost::kUi, fml::Thread::ThreadPriority::kDisplay)); thread_host_config.SetRasterConfig(MakeThreadConfig( - flutter::ThreadHost::RASTER, fml::Thread::ThreadPriority::kRaster)); + flutter::ThreadHost::kRaster, fml::Thread::ThreadPriority::kRaster)); thread_host_config.SetIOConfig(MakeThreadConfig( - flutter::ThreadHost::IO, fml::Thread::ThreadPriority::kBackground)); + flutter::ThreadHost::kIo, fml::Thread::ThreadPriority::kBackground)); // Create a thread host with the current thread as the platform thread and all // other threads managed. diff --git a/shell/platform/embedder/platform_view_embedder_unittests.cc b/shell/platform/embedder/platform_view_embedder_unittests.cc index d5d2538a1ccdc..6f0e923e86043 100644 --- a/shell/platform/embedder/platform_view_embedder_unittests.cc +++ b/shell/platform/embedder/platform_view_embedder_unittests.cc @@ -94,7 +94,7 @@ class MockResponse : public PlatformMessageResponse { TEST(PlatformViewEmbedderTest, HasPlatformMessageHandler) { ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); flutter::TaskRunners task_runners = flutter::TaskRunners( "HasPlatformMessageHandler", thread_host.platform_thread->GetTaskRunner(), nullptr, nullptr, nullptr); @@ -116,7 +116,7 @@ TEST(PlatformViewEmbedderTest, HasPlatformMessageHandler) { TEST(PlatformViewEmbedderTest, Dispatches) { ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); flutter::TaskRunners task_runners = flutter::TaskRunners( "HasPlatformMessageHandler", thread_host.platform_thread->GetTaskRunner(), nullptr, nullptr, nullptr); @@ -161,7 +161,7 @@ TEST(PlatformViewEmbedderTest, Dispatches) { TEST(PlatformViewEmbedderTest, DeletionDisabledDispatch) { ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform); + ThreadHost::Type::kPlatform); flutter::TaskRunners task_runners = flutter::TaskRunners( "HasPlatformMessageHandler", thread_host.platform_thread->GetTaskRunner(), nullptr, nullptr, nullptr); diff --git a/shell/platform/fuchsia/flutter/engine.cc b/shell/platform/fuchsia/flutter/engine.cc index aea9781595495..9aaddd203ad69 100644 --- a/shell/platform/fuchsia/flutter/engine.cc +++ b/shell/platform/fuchsia/flutter/engine.cc @@ -185,15 +185,15 @@ flutter::ThreadHost Engine::CreateThreadHost( thread_host_config.SetRasterConfig( {flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::RASTER, name_prefix), + flutter::ThreadHost::Type::kRaster, name_prefix), fml::Thread::ThreadPriority::kRaster}); thread_host_config.SetUIConfig( {flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::UI, name_prefix), + flutter::ThreadHost::Type::kUi, name_prefix), fml::Thread::ThreadPriority::kDisplay}); thread_host_config.SetIOConfig( {flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::IO, name_prefix), + flutter::ThreadHost::Type::kIo, name_prefix), fml::Thread::ThreadPriority::kNormal}); return flutter::ThreadHost(thread_host_config); diff --git a/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc b/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc index f01a2a02c90c4..3be48a61aee6e 100644 --- a/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc +++ b/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc @@ -25,9 +25,9 @@ TEST(VSyncWaiterFuchsia, FrameScheduledForStartTime) { auto platform_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); ThreadHost thread_host = - ThreadHost(prefix, flutter::ThreadHost::Type::RASTER | - flutter::ThreadHost::Type::UI | - flutter::ThreadHost::Type::IO); + ThreadHost(prefix, flutter::ThreadHost::Type::kRaster | + flutter::ThreadHost::Type::kUi | + flutter::ThreadHost::Type::kIo); const flutter::TaskRunners task_runners( prefix, // Dart thread labels platform_task_runner, // platform diff --git a/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h b/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h index 9509d572c33c6..803dc6cc0120c 100644 --- a/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h +++ b/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h @@ -27,6 +27,8 @@ G_BEGIN_DECLS #define FL_BINARY_MESSENGER_ERROR fl_binary_messenger_codec_error_quark() typedef enum { + // Part of the public API, so fixing the name is a breaking change. + // NOLINTNEXTLINE(readability-identifier-naming) FL_BINARY_MESSENGER_ERROR_ALREADY_RESPONDED, } FlBinaryMessengerError; diff --git a/shell/platform/linux/public/flutter_linux/fl_value.h b/shell/platform/linux/public/flutter_linux/fl_value.h index 7365d464c25b9..224690c4ed78e 100644 --- a/shell/platform/linux/public/flutter_linux/fl_value.h +++ b/shell/platform/linux/public/flutter_linux/fl_value.h @@ -57,6 +57,8 @@ typedef struct _FlValue FlValue; * Types of #FlValue. */ typedef enum { + // Parts of the public API, so fixing the names is a breaking change. + // NOLINTBEGIN(readability-identifier-naming) FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_INT, @@ -69,6 +71,7 @@ typedef enum { FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_FLOAT32_LIST, + // NOLINTEND(readability-identifier-naming) } FlValueType; /** diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index a621dc86acf67..d7027ed096fe2 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -337,8 +337,8 @@ int RunTester(const flutter::Settings& settings, if (multithreaded) { threadhost = std::make_unique( - thread_label, ThreadHost::Type::Platform | ThreadHost::Type::IO | - ThreadHost::Type::UI | ThreadHost::Type::RASTER); + thread_label, ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | + ThreadHost::Type::kUi | ThreadHost::Type::kRaster); platform_task_runner = current_task_runner; raster_task_runner = threadhost->raster_thread->GetTaskRunner(); ui_task_runner = threadhost->ui_thread->GetTaskRunner();