From ed934568648d8bc0ff4616b240c317043f69b1db Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" Date: Fri, 6 Sep 2024 15:53:32 +0000 Subject: [PATCH] Revert "[engine] always force platform channel responses to schedule a task. (#54975)" This reverts commit 015f3b1dec53979cfb5d026e84891720c4dd48e9. --- shell/common/shell.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/common/shell.cc b/shell/common/shell.cc index a23bc5498efe6..79c532640a969 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -1076,10 +1076,10 @@ void Shell::OnPlatformViewDispatchPlatformMessage( // The static leak checker gets confused by the use of fml::MakeCopyable. // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) - // This logic must always explicitly post a task so that we are guaranteed - // to wake up the UI message loop to flush tasks. - task_runners_.GetUITaskRunner()->PostTask(fml::MakeCopyable( - [engine = engine_->GetWeakPtr(), message = std::move(message)]() mutable { + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetUITaskRunner(), + fml::MakeCopyable([engine = engine_->GetWeakPtr(), + message = std::move(message)]() mutable { if (engine) { engine->DispatchPlatformMessage(std::move(message)); }