From 6957b322fa7ac9ba57f4db62133f187c0ea9bb92 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 20 Nov 2023 12:54:56 -0800 Subject: [PATCH 1/4] Make `{shell|lib/ui}/...` compatible with `.clang_tidy`. --- lib/ui/ui_benchmarks.cc | 8 +- shell/common/dart_native_benchmarks.cc | 4 +- shell/common/engine_unittests.cc | 4 +- shell/common/rasterizer_unittests.cc | 88 +++++++++++-------- shell/common/shell_benchmarks.cc | 6 +- shell/common/shell_test.cc | 4 +- shell/common/shell_unittests.cc | 44 +++++----- shell/common/thread_host.cc | 40 ++++----- shell/common/thread_host.h | 10 +-- .../android/android_context_gl_unittests.cc | 18 ++-- .../platform/android/android_shell_holder.cc | 6 +- .../android/jni/platform_view_android_jni.h | 4 +- .../include/flutter/texture_registrar.h | 2 +- .../ios/framework/Source/FlutterEngine.mm | 10 +-- .../ios/platform_message_handler_ios_test.mm | 6 +- .../platform/embedder/embedder_thread_host.cc | 4 +- .../platform_view_embedder_unittests.cc | 6 +- shell/platform/fuchsia/flutter/engine.cc | 4 +- .../fuchsia/flutter/vsync_waiter_unittest.cc | 4 +- .../flutter_linux/fl_binary_messenger.h | 2 + .../linux/public/flutter_linux/fl_value.h | 3 + shell/testing/tester_main.cc | 4 +- 22 files changed, 152 insertions(+), 129 deletions(-) diff --git a/lib/ui/ui_benchmarks.cc b/lib/ui/ui_benchmarks.cc index 1c906a4605c6a..66b9bd1f1fb7e 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::UI)); 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::UI)); 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..e762ae03c0049 100644 --- a/shell/common/dart_native_benchmarks.cc +++ b/shell/common/dart_native_benchmarks.cc @@ -44,7 +44,7 @@ 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::kPlatform | ThreadHost::Type::kIo | ThreadHost::Type::UI); TaskRunners task_runners( "test", @@ -81,7 +81,7 @@ 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::kPlatform | ThreadHost::Type::kIo | ThreadHost::Type::UI); TaskRunners task_runners( "test", diff --git a/shell/common/engine_unittests.cc b/shell/common/engine_unittests.cc index 7ffa0a6f7714a..767adb02983ff 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::UI | 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..095275e3f8104 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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::UI); 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..64d1ee8d42fd7 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::UI)); 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..5e777cef26321 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::UI | 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..eccd5ebfbe79d 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::UI)); 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); @@ -438,7 +438,7 @@ TEST_F(ShellTest, Settings settings = CreateSettingsForFixture(); ThreadHost thread_host( "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::RASTER | ThreadHost::Type::IO | ThreadHost::Type::UI); + ThreadHost::Type::kRaster | ThreadHost::Type::kIo | ThreadHost::Type::UI); 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::UI); 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::UI); 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,7 +4299,7 @@ TEST_F(ShellTest, NotifyIdleRejectsPastAndNearFuture) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::UI | + ThreadHost::Type::kPlatform | ThreadHost::UI | ThreadHost::IO | ThreadHost::RASTER); auto platform_task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), @@ -4344,7 +4344,7 @@ TEST_F(ShellTest, NotifyIdleNotCalledInLatencyMode) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::UI | + ThreadHost::Type::kPlatform | ThreadHost::UI | ThreadHost::IO | ThreadHost::RASTER); auto platform_task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), @@ -4387,7 +4387,7 @@ TEST_F(ShellTest, NotifyDestroyed) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::Platform | ThreadHost::UI | + ThreadHost::Type::kPlatform | ThreadHost::UI | ThreadHost::IO | ThreadHost::RASTER); auto platform_task_runner = thread_host.platform_thread->GetTaskRunner(); TaskRunners task_runners("test", thread_host.platform_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::UI)); 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::UI)); 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 cc423cd027b1d..eabd5eb92f137 100644 --- a/shell/common/thread_host.h +++ b/shell/common/thread_host.h @@ -20,11 +20,11 @@ using ThreadConfigSetter = fml::Thread::ThreadConfigSetter; /// The collection of all the threads used by the engine. struct ThreadHost { enum Type { - Platform = 1 << 0, - UI = 1 << 1, - RASTER = 1 << 2, - IO = 1 << 3, - Profiler = 1 << 4, + 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..73a4828150e10 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::UI | 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::UI | 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::UI | 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::UI | 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::UI | 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..bafa28300e197 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -90,7 +90,7 @@ AndroidShellHolder::AndroidShellHolder( auto thread_label = std::to_string(thread_host_count++); auto mask = - ThreadHost::Type::UI | ThreadHost::Type::RASTER | ThreadHost::Type::IO; + ThreadHost::Type::UI | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; flutter::ThreadHost::ThreadHostConfig host_config( thread_label, mask, AndroidPlatformThreadConfigSetter); @@ -100,11 +100,11 @@ AndroidShellHolder::AndroidShellHolder( 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..98063c2c8c14c 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::UI | 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, @@ -810,12 +810,12 @@ + (NSString*)generateThreadLabel:(NSString*)labelPrefix { 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 c1988bc2158f4..1ef47559fcce8 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::UI); 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::UI); 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::UI); 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..eb2a9b738f1e5 100644 --- a/shell/platform/embedder/embedder_thread_host.cc +++ b/shell/platform/embedder/embedder_thread_host.cc @@ -139,7 +139,7 @@ EmbedderThreadHost::CreateEmbedderManagedThreadHost( thread_host_config.SetUIConfig(MakeThreadConfig( ThreadHost::Type::UI, 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 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..e00748fa71997 100644 --- a/shell/platform/fuchsia/flutter/engine.cc +++ b/shell/platform/fuchsia/flutter/engine.cc @@ -185,7 +185,7 @@ 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( @@ -193,7 +193,7 @@ flutter::ThreadHost Engine::CreateThreadHost( 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..4b078954574d0 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 | + ThreadHost(prefix, flutter::ThreadHost::Type::kRaster | flutter::ThreadHost::Type::UI | - flutter::ThreadHost::Type::IO); + 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..6178751f3e0de 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::UI | ThreadHost::Type::kRaster); platform_task_runner = current_task_runner; raster_task_runner = threadhost->raster_thread->GetTaskRunner(); ui_task_runner = threadhost->ui_thread->GetTaskRunner(); From ffd11d64768fdf690eb7a85bf1dd8127d3450868 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 21 Nov 2023 10:23:10 -0800 Subject: [PATCH 2/4] Fix more ThreadHost::Type. --- shell/common/shell_unittests.cc | 28 +++++++++---------- .../platform/embedder/embedder_thread_host.cc | 8 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index eccd5ebfbe79d..00cfd4d10b541 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -389,7 +389,7 @@ TEST_F(ShellTest, InitializeWithDifferentThreads) { std::string name_prefix = "io.flutter.test." + GetCurrentTestName() + "."; ThreadHost thread_host(ThreadHost::ThreadHostConfig( name_prefix, ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI)); + ThreadHost::Type::kIo | ThreadHost::Type::kUi)); ASSERT_EQ(thread_host.name_prefix, name_prefix); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), @@ -436,9 +436,9 @@ TEST_F(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); - ThreadHost thread_host( - "io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::kRaster | ThreadHost::Type::kIo | 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(), @@ -497,7 +497,7 @@ TEST_F(ShellTest, InitializeWithGPUAndPlatformThreadsTheSame) { Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform @@ -1339,7 +1339,7 @@ TEST_F(ShellTest, OnPlatformViewDestroyWithStaticThreadMerging) { end_frame_callback, PostPrerollResult::kSuccess, true); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform @@ -4299,8 +4299,8 @@ TEST_F(ShellTest, NotifyIdleRejectsPastAndNearFuture) { ASSERT_FALSE(DartVMRef::IsInstanceRunning()); Settings settings = CreateSettingsForFixture(); ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".", - ThreadHost::Type::kPlatform | 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::kPlatform | 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::kPlatform | 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(), @@ -4541,7 +4541,7 @@ TEST_F(ShellTest, ShellCanAddViewOrRemoveView) { ThreadHost thread_host(ThreadHost::ThreadHostConfig( "io.flutter.test." + GetCurrentTestName() + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI)); + 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(), @@ -4622,7 +4622,7 @@ TEST_F(ShellTest, ShellFlushesPlatformStatesByMain) { ThreadHost thread_host(ThreadHost::ThreadHostConfig( "io.flutter.test." + GetCurrentTestName() + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI)); + 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/platform/embedder/embedder_thread_host.cc b/shell/platform/embedder/embedder_thread_host.cc index eb2a9b738f1e5..7cca136462ed5 100644 --- a/shell/platform/embedder/embedder_thread_host.cc +++ b/shell/platform/embedder/embedder_thread_host.cc @@ -137,7 +137,7 @@ 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::kIo, fml::Thread::ThreadPriority::kBackground)); @@ -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. From da6d7c830968533143c6a5a1702f1496085833ff Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 21 Nov 2023 10:30:06 -0800 Subject: [PATCH 3/4] ++ --- shell/testing/tester_main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index 6178751f3e0de..d7027ed096fe2 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -338,7 +338,7 @@ int RunTester(const flutter::Settings& settings, if (multithreaded) { threadhost = std::make_unique( thread_label, ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI | ThreadHost::Type::kRaster); + 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(); From 8829b86472bcdcd8c1c828aa0bdc7ada3474a2c7 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 21 Nov 2023 10:37:27 -0800 Subject: [PATCH 4/4] ++ --- lib/ui/ui_benchmarks.cc | 4 +-- shell/common/dart_native_benchmarks.cc | 4 +-- shell/common/engine_unittests.cc | 2 +- shell/common/rasterizer_unittests.cc | 36 +++++++++---------- shell/common/shell_benchmarks.cc | 6 ++-- shell/common/shell_test.cc | 2 +- .../android/android_context_gl_unittests.cc | 10 +++--- .../platform/android/android_shell_holder.cc | 4 +-- .../ios/framework/Source/FlutterEngine.mm | 4 +-- .../ios/platform_message_handler_ios_test.mm | 6 ++-- shell/platform/fuchsia/flutter/engine.cc | 2 +- .../fuchsia/flutter/vsync_waiter_unittest.cc | 2 +- 12 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/ui/ui_benchmarks.cc b/lib/ui/ui_benchmarks.cc index 66b9bd1f1fb7e..97cdaa97829c2 100644 --- a/lib/ui/ui_benchmarks.cc +++ b/lib/ui/ui_benchmarks.cc @@ -22,7 +22,7 @@ class Fixture : public testing::FixtureTest { static void BM_PlatformMessageResponseDartComplete(benchmark::State& state) { ThreadHost thread_host(ThreadHost::ThreadHostConfig( "test", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI)); + 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(), @@ -70,7 +70,7 @@ static void BM_PlatformMessageResponseDartComplete(benchmark::State& state) { static void BM_PathVolatilityTracker(benchmark::State& state) { ThreadHost thread_host(ThreadHost::ThreadHostConfig( "test", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI)); + 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 e762ae03c0049..ff3999eefe0ac 100644 --- a/shell/common/dart_native_benchmarks.cc +++ b/shell/common/dart_native_benchmarks.cc @@ -45,7 +45,7 @@ BENCHMARK_F(DartNativeBenchmarks, TimeToFirstNativeMessageFromIsolateInNewVM) ThreadHost thread_host("io.flutter.test.DartNativeBenchmarks.", ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners( "test", thread_host.platform_thread->GetTaskRunner(), // platform @@ -82,7 +82,7 @@ BENCHMARK_F(DartNativeBenchmarks, MultipleDartToNativeMessages) ThreadHost thread_host("io.flutter.test.DartNativeBenchmarks.", ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + 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 767adb02983ff..55e895d165dca 100644 --- a/shell/common/engine_unittests.cc +++ b/shell/common/engine_unittests.cc @@ -208,7 +208,7 @@ class EngineTest : public testing::FixtureTest { EngineTest() : thread_host_("EngineTest", ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI | ThreadHost::Type::kRaster), + 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 095275e3f8104..d800bbdb3a5ed 100644 --- a/shell/common/rasterizer_unittests.cc +++ b/shell/common/rasterizer_unittests.cc @@ -151,7 +151,7 @@ TEST(RasterizerTest, drawEmptyPipeline) { ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -182,7 +182,7 @@ TEST(RasterizerTest, ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -257,7 +257,7 @@ TEST( ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -326,7 +326,7 @@ TEST( ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); fml::MessageLoop::EnsureInitializedForCurrentThread(); TaskRunners task_runners("test", fml::MessageLoop::GetCurrent().GetTaskRunner(), @@ -397,7 +397,7 @@ TEST(RasterizerTest, ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); fml::MessageLoop::EnsureInitializedForCurrentThread(); TaskRunners task_runners("test", fml::MessageLoop::GetCurrent().GetTaskRunner(), @@ -482,7 +482,7 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet) { ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -530,7 +530,7 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNotUsedThisFrame) { ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -596,7 +596,7 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenPipelineIsEmpty) { ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -642,7 +642,7 @@ TEST(RasterizerTest, ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -703,7 +703,7 @@ TEST( ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -765,7 +765,7 @@ TEST( ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -826,7 +826,7 @@ TEST( ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -886,7 +886,7 @@ TEST( ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -945,7 +945,7 @@ TEST(RasterizerTest, ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1033,7 +1033,7 @@ TEST(RasterizerTest, TeardownFreesResourceCache) { ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1096,7 +1096,7 @@ TEST(RasterizerTest, TeardownNoSurface) { ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | ThreadHost::Type::kIo | - ThreadHost::Type::UI); + ThreadHost::Type::kUi); TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(), thread_host.raster_thread->GetTaskRunner(), thread_host.ui_thread->GetTaskRunner(), @@ -1122,7 +1122,7 @@ TEST(RasterizerTest, presentationTimeSetWhenVsyncTargetInFuture) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI); + 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(), @@ -1211,7 +1211,7 @@ TEST(RasterizerTest, presentationTimeNotSetWhenVsyncTargetInPast) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host("io.flutter.test." + test_name + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | ThreadHost::Type::UI); + 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 64d1ee8d42fd7..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::kPlatform | - ThreadHost::Type::kRaster | - ThreadHost::Type::kIo | 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 5e777cef26321..efcf43ce82668 100644 --- a/shell/common/shell_test.cc +++ b/shell/common/shell_test.cc @@ -58,7 +58,7 @@ FrameContent ViewContent::ImplicitView(double width, ShellTest::ShellTest() : thread_host_("io.flutter.test." + GetCurrentTestName() + ".", ThreadHost::Type::kPlatform | ThreadHost::Type::kIo | - ThreadHost::Type::UI | ThreadHost::Type::kRaster) {} + ThreadHost::Type::kUi | ThreadHost::Type::kRaster) {} void ShellTest::SendPlatformMessage(Shell* shell, std::unique_ptr message) { diff --git a/shell/platform/android/android_context_gl_unittests.cc b/shell/platform/android/android_context_gl_unittests.cc index 73a4828150e10..e1ee5ec89e6b5 100644 --- a/shell/platform/android/android_context_gl_unittests.cc +++ b/shell/platform/android/android_context_gl_unittests.cc @@ -36,7 +36,7 @@ TEST(AndroidContextGl, Create) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, ThreadHost::Type::UI | ThreadHost::Type::kRaster | + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( @@ -76,7 +76,7 @@ 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::kRaster | + 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( @@ -101,7 +101,7 @@ TEST(AndroidSurfaceGL, CreateSnapshopSurfaceWhenOnscreenSurfaceIsNull) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); auto mask = - ThreadHost::Type::UI | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; + ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; flutter::ThreadHost::ThreadHostConfig host_config(mask); ThreadHost thread_host(host_config); @@ -125,7 +125,7 @@ TEST(AndroidContextGl, DISABLED_MSAAx4) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, ThreadHost::Type::UI | ThreadHost::Type::kRaster | + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( @@ -147,7 +147,7 @@ TEST(AndroidContextGl, EnsureMakeCurrentChecksCurrentContextStatus) { ::testing::UnitTest::GetInstance()->current_test_info()->name(); ThreadHost thread_host(ThreadHost::ThreadHostConfig( - thread_label, ThreadHost::Type::UI | ThreadHost::Type::kRaster | + thread_label, ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo)); TaskRunners task_runners = MakeTaskRunners(thread_label, thread_host); auto context = std::make_unique( diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index bafa28300e197..8d2f349e3d87f 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -90,13 +90,13 @@ AndroidShellHolder::AndroidShellHolder( auto thread_label = std::to_string(thread_host_count++); auto mask = - ThreadHost::Type::UI | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; + 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( diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 98063c2c8c14c..8fa12218b8633 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -793,7 +793,7 @@ + (NSString*)generateThreadLabel:(NSString*)labelPrefix { // initialized. fml::MessageLoop::EnsureInitializedForCurrentThread(); - uint32_t threadHostType = flutter::ThreadHost::Type::UI | flutter::ThreadHost::Type::kRaster | + uint32_t threadHostType = flutter::ThreadHost::Type::kUi | flutter::ThreadHost::Type::kRaster | flutter::ThreadHost::Type::kIo; if ([FlutterEngine isProfilerEnabled]) { @@ -805,7 +805,7 @@ + (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 = 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 d79732ab26aae..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::kRaster | ThreadHost::Type::kIo | 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::kRaster | ThreadHost::Type::kIo | 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::kRaster | ThreadHost::Type::kIo | 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/fuchsia/flutter/engine.cc b/shell/platform/fuchsia/flutter/engine.cc index e00748fa71997..9aaddd203ad69 100644 --- a/shell/platform/fuchsia/flutter/engine.cc +++ b/shell/platform/fuchsia/flutter/engine.cc @@ -189,7 +189,7 @@ flutter::ThreadHost Engine::CreateThreadHost( 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( diff --git a/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc b/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc index 4b078954574d0..3be48a61aee6e 100644 --- a/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc +++ b/shell/platform/fuchsia/flutter/vsync_waiter_unittest.cc @@ -26,7 +26,7 @@ TEST(VSyncWaiterFuchsia, FrameScheduledForStartTime) { ThreadHost thread_host = ThreadHost(prefix, flutter::ThreadHost::Type::kRaster | - flutter::ThreadHost::Type::UI | + flutter::ThreadHost::Type::kUi | flutter::ThreadHost::Type::kIo); const flutter::TaskRunners task_runners( prefix, // Dart thread labels