diff --git a/engine/src/flutter/flow/texture.h b/engine/src/flutter/flow/texture.h index f5e4430834..0e8b3eaeb2 100644 --- a/engine/src/flutter/flow/texture.h +++ b/engine/src/flutter/flow/texture.h @@ -7,7 +7,8 @@ #include -#include "lib/fxl/synchronization/waitable_event.h" +#include "flutter/fml/synchronization/waitable_event.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { diff --git a/engine/src/flutter/fml/message_loop_unittests.cc b/engine/src/flutter/fml/message_loop_unittests.cc index cd2acd308b..e154c1d4ad 100644 --- a/engine/src/flutter/fml/message_loop_unittests.cc +++ b/engine/src/flutter/fml/message_loop_unittests.cc @@ -7,9 +7,9 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/task_runner.h" #include "gtest/gtest.h" -#include "lib/fxl/synchronization/waitable_event.h" #define TIME_SENSITIVE(x) TimeSensitiveTest_##x #if OS_WIN @@ -28,8 +28,8 @@ TEST(MessageLoop, GetCurrent) { TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) { fml::MessageLoop* loop1 = nullptr; - fxl::AutoResetWaitableEvent latch1; - fxl::AutoResetWaitableEvent term1; + fml::AutoResetWaitableEvent latch1; + fml::AutoResetWaitableEvent term1; std::thread thread1([&loop1, &latch1, &term1]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); loop1 = &fml::MessageLoop::GetCurrent(); @@ -38,8 +38,8 @@ TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) { }); fml::MessageLoop* loop2 = nullptr; - fxl::AutoResetWaitableEvent latch2; - fxl::AutoResetWaitableEvent term2; + fml::AutoResetWaitableEvent latch2; + fml::AutoResetWaitableEvent term2; std::thread thread2([&loop2, &latch2, &term2]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); loop2 = &fml::MessageLoop::GetCurrent(); @@ -135,7 +135,7 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) { TEST(MessageLoop, CheckRunsTaskOnCurrentThread) { fxl::RefPtr runner; - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; std::thread thread([&runner, &latch]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); diff --git a/engine/src/flutter/fml/thread.cc b/engine/src/flutter/fml/thread.cc index ea1060db03..2f71c07ffc 100644 --- a/engine/src/flutter/fml/thread.cc +++ b/engine/src/flutter/fml/thread.cc @@ -18,12 +18,12 @@ #include #include "flutter/fml/message_loop.h" -#include "lib/fxl/synchronization/waitable_event.h" +#include "flutter/fml/synchronization/waitable_event.h" namespace fml { Thread::Thread(const std::string& name) : joined_(false) { - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); diff --git a/engine/src/flutter/runtime/service_protocol.cc b/engine/src/flutter/runtime/service_protocol.cc index 3994b78ef3..bbb30aeb53 100644 --- a/engine/src/flutter/runtime/service_protocol.cc +++ b/engine/src/flutter/runtime/service_protocol.cc @@ -13,7 +13,7 @@ #include #include -#include "lib/fxl/synchronization/waitable_event.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" #include "third_party/dart/runtime/include/dart_tools_api.h" @@ -138,7 +138,7 @@ static bool HandleMessageOnHandler( const ServiceProtocol::Handler::ServiceProtocolMap& params, rapidjson::Document& document) { FXL_DCHECK(handler); - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; bool result = false; fml::TaskRunner::RunNowOrPostTask( handler->GetServiceProtocolHandlerTaskRunner(method), @@ -240,7 +240,7 @@ bool ServiceProtocol::HandleListViewsMethod( std::lock_guard lock(handlers_mutex_); std::vector> descriptions; for (const auto& handler : handlers_) { - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; Handler::Description description; fml::TaskRunner::RunNowOrPostTask( diff --git a/engine/src/flutter/shell/common/platform_view.cc b/engine/src/flutter/shell/common/platform_view.cc index 5ae0f2d5db..2f0aee3f37 100644 --- a/engine/src/flutter/shell/common/platform_view.cc +++ b/engine/src/flutter/shell/common/platform_view.cc @@ -6,11 +6,11 @@ #include +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" diff --git a/engine/src/flutter/shell/common/rasterizer.h b/engine/src/flutter/shell/common/rasterizer.h index 873b817f8d..482ecbef3c 100644 --- a/engine/src/flutter/shell/common/rasterizer.h +++ b/engine/src/flutter/shell/common/rasterizer.h @@ -11,10 +11,10 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/surface.h" #include "flutter/synchronization/pipeline.h" #include "lib/fxl/functional/closure.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/engine/src/flutter/shell/common/shell.cc b/engine/src/flutter/shell/common/shell.cc index caa67d6a37..ec39d96ab7 100644 --- a/engine/src/flutter/shell/common/shell.cc +++ b/engine/src/flutter/shell/common/shell.cc @@ -67,7 +67,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( // first because it has state that the other subsystems depend on. It must // first be booted and the necessary references obtained to initialize the // other subsystems. - fxl::AutoResetWaitableEvent io_latch; + fml::AutoResetWaitableEvent io_latch; std::unique_ptr io_manager; fml::WeakPtr resource_context; fxl::RefPtr unref_queue; @@ -90,7 +90,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( io_latch.Wait(); // Create the rasterizer on the GPU thread. - fxl::AutoResetWaitableEvent gpu_latch; + fml::AutoResetWaitableEvent gpu_latch; std::unique_ptr rasterizer; fml::TaskRunner::RunNowOrPostTask( task_runners.GetGPUTaskRunner(), [&gpu_latch, // @@ -105,7 +105,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( }); // Create the engine on the UI thread. - fxl::AutoResetWaitableEvent ui_latch; + fml::AutoResetWaitableEvent ui_latch; std::unique_ptr engine; fml::TaskRunner::RunNowOrPostTask( shell->GetTaskRunners().GetUITaskRunner(), @@ -237,7 +237,7 @@ std::unique_ptr Shell::Create( return nullptr; } - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; std::unique_ptr shell; fml::TaskRunner::RunNowOrPostTask( task_runners.GetPlatformTaskRunner(), @@ -304,7 +304,7 @@ Shell::~Shell() { vm->GetServiceProtocol().RemoveHandler(this); } - fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; + fml::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; fml::TaskRunner::RunNowOrPostTask( task_runners_.GetUITaskRunner(), @@ -415,7 +415,7 @@ void Shell::OnPlatformViewCreated(const PlatformView& view, // setup/suspension of all activities that may be interacting with the GPU in // a synchronous fashion. - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // surface = std::move(surface), // &latch]() mutable { @@ -456,7 +456,7 @@ void Shell::OnPlatformViewDestroyed(const PlatformView& view) { // setup/suspension of all activities that may be interacting with the GPU in // a synchronous fashion. - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; auto io_task = [io_manager = io_manager_.get(), &latch]() { // Execute any pending Skia object deletions while GPU access is still @@ -974,7 +974,7 @@ Rasterizer::Screenshot Shell::Screenshot( Rasterizer::ScreenshotType screenshot_type, bool base64_encode) { TRACE_EVENT0("flutter", "Shell::Screenshot"); - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; Rasterizer::Screenshot screenshot; fml::TaskRunner::RunNowOrPostTask( task_runners_.GetGPUTaskRunner(), [&latch, // diff --git a/engine/src/flutter/shell/common/shell.h b/engine/src/flutter/shell/common/shell.h index f755f67e97..4f4876734f 100644 --- a/engine/src/flutter/shell/common/shell.h +++ b/engine/src/flutter/shell/common/shell.h @@ -13,6 +13,7 @@ #include "flutter/flow/texture.h" #include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/thread.h" #include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/lib/ui/semantics/semantics_node.h" @@ -31,7 +32,6 @@ #include "lib/fxl/strings/string_view.h" #include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/engine/src/flutter/shell/common/shell_unittests.cc b/engine/src/flutter/shell/common/shell_unittests.cc index c68c76d802..e422f47826 100644 --- a/engine/src/flutter/shell/common/shell_unittests.cc +++ b/engine/src/flutter/shell/common/shell_unittests.cc @@ -9,12 +9,12 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/thread_host.h" #include "gtest/gtest.h" -#include "lib/fxl/synchronization/waitable_event.h" #define CURRENT_TEST_NAME \ std::string { \ diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.cc b/engine/src/flutter/shell/platform/android/platform_view_android.cc index a72a85200d..0dec68ca9a 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -7,13 +7,13 @@ #include #include +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" #include "flutter/shell/platform/android/platform_message_response_android.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { @@ -45,7 +45,7 @@ void PlatformViewAndroid::NotifyDestroyed() { } void PlatformViewAndroid::NotifyChanged(const SkISize& size) { - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; fml::TaskRunner::RunNowOrPostTask( task_runners_.GetGPUTaskRunner(), // [&latch, surface = android_surface_.get(), size]() { diff --git a/engine/src/flutter/shell/platform/darwin/desktop/platform_view_mac.mm b/engine/src/flutter/shell/platform/darwin/desktop/platform_view_mac.mm index f25fa6945a..d3657dea26 100644 --- a/engine/src/flutter/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/engine/src/flutter/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,13 +7,13 @@ #include #include +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/io_manager.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 1f49acd7e6..32c54f6329 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -8,6 +8,7 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/platform/darwin/cf_utils.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" @@ -15,7 +16,6 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_surface_software.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" @interface FlutterView () diff --git a/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm b/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm index df960dc2fd..04d664dfc6 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/platform_view_ios.mm @@ -9,11 +9,11 @@ #include #include "flutter/common/task_runners.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/engine/src/flutter/shell/testing/tester_main.cc b/engine/src/flutter/shell/testing/tester_main.cc index 099774f614..9763bd8dd7 100644 --- a/engine/src/flutter/shell/testing/tester_main.cc +++ b/engine/src/flutter/shell/testing/tester_main.cc @@ -11,6 +11,7 @@ #include "flutter/fml/file.h" #include "flutter/fml/message_loop.h" #include "flutter/fml/paths.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/task_runner.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" @@ -19,7 +20,6 @@ #include "flutter/shell/common/thread_host.h" #include "lib/fxl/files/path.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/dart/runtime/bin/embedded_dart_io.h" #ifdef ERROR @@ -177,7 +177,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) { bool engine_did_run = false; - fxl::AutoResetWaitableEvent sync_run_latch; + fml::AutoResetWaitableEvent sync_run_latch; fml::TaskRunner::RunNowOrPostTask( shell->GetTaskRunners().GetUITaskRunner(), fxl::MakeCopyable([&sync_run_latch, &completion_observer, @@ -208,7 +208,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) { // Cleanup the completion observer synchronously as it is living on the // stack. - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; fml::TaskRunner::RunNowOrPostTask( shell->GetTaskRunners().GetUITaskRunner(), [&latch, &completion_observer] {