Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 419fb8c

Browse files
Reverts "[engine] always force platform channel responses to schedule a task. (#54975)" (#55000)
Reverts: #54975 Initiated by: jtmcdole Reason for reverting: I believe this change caused flutter/flutter to break in an engine roll. It was one of two changes - the other being a webui change. Tests broken: module_test_ios: testDualCold router test: ``` [2024-09-05 17:43:20.837343] [STDOUT] stderr: [ +135 ms] VMServiceFlutterDriver: Connected to Flutter application. [2024-09-05 17:43:20.841927] [STDOUT] stdout: [ +4 ms] 00:00 �[32m+0�[0m: Original PR Author: jonahwilliams Reviewed By: {jason-simmons, johnmccutchan} This change reverts the following previous change: If we use runNowOrPostTask on platform channel responses, then we may not wake up the dart message loop. If nothing else wakes it up, then the embedder may hang on platform channel responses. This fixes several google3 integration tests when run in merged thread mode.
1 parent b5ff6b0 commit 419fb8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shell/common/shell.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,10 +1076,10 @@ void Shell::OnPlatformViewDispatchPlatformMessage(
10761076

10771077
// The static leak checker gets confused by the use of fml::MakeCopyable.
10781078
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
1079-
// This logic must always explicitly post a task so that we are guaranteed
1080-
// to wake up the UI message loop to flush tasks.
1081-
task_runners_.GetUITaskRunner()->PostTask(fml::MakeCopyable(
1082-
[engine = engine_->GetWeakPtr(), message = std::move(message)]() mutable {
1079+
fml::TaskRunner::RunNowOrPostTask(
1080+
task_runners_.GetUITaskRunner(),
1081+
fml::MakeCopyable([engine = engine_->GetWeakPtr(),
1082+
message = std::move(message)]() mutable {
10831083
if (engine) {
10841084
engine->DispatchPlatformMessage(std::move(message));
10851085
}

0 commit comments

Comments
 (0)