From 1692a5f722119bb6673eb36d5d4f3d98b208f189 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Wed, 2 Jun 2021 16:00:50 -0500 Subject: [PATCH] Guard task queue id for fuchsia (flutter/engine#26542) --- engine/src/flutter/shell/common/vsync_waiter.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/shell/common/vsync_waiter.cc b/engine/src/flutter/shell/common/vsync_waiter.cc index 8977facd00..bfbd64c133 100644 --- a/engine/src/flutter/shell/common/vsync_waiter.cc +++ b/engine/src/flutter/shell/common/vsync_waiter.cc @@ -129,8 +129,13 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time, TRACE_FLOW_BEGIN("flutter", kVsyncFlowName, flow_identifier); - fml::TaskQueueId ui_task_queue_id = - task_runners_.GetUITaskRunner()->GetTaskQueueId(); + fml::TaskQueueId ui_task_queue_id = fml::_kUnmerged; + if (pause_secondary_tasks) { + // Guarding `GetTaskQueueId` behind `pause_secondary_tasks` as on Fuchsia + // the task runners don't initialize message loop task queues. + // Once the migration to embedder API is done, this can be deleted. + ui_task_queue_id = task_runners_.GetUITaskRunner()->GetTaskQueueId(); + } task_runners_.GetUITaskRunner()->PostTaskForTime( [ui_task_queue_id, callback, flow_identifier, frame_start_time,