89 {
91
93 std::vector<fml::closure> secondary_callbacks;
94
95 {
96 std::scoped_lock lock(callback_mutex_);
98 for (auto& pair : secondary_callbacks_) {
99 secondary_callbacks.push_back(std::move(pair.second));
100 }
101 secondary_callbacks_.clear();
102 }
103
104 if (!
callback && secondary_callbacks.empty()) {
105
106
107
109 return;
110 }
111
114 if (pause_secondary_tasks) {
115 PauseDartEventLoopTasks();
116 }
117
118
119
120
121
123 1,
124 &flow_identifier);
125
127
130
132 [ui_task_queue_id,
callback, flow_identifier, frame_start_time,
133 frame_target_time, pause_secondary_tasks]() {
136 &flow_identifier, "StartTime", frame_start_time,
137 "TargetTime", frame_target_time);
138 std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder =
139 std::make_unique<FrameTimingsRecorder>();
140 frame_timings_recorder->RecordVsync(frame_start_time,
141 frame_target_time);
142 callback(std::move(frame_timings_recorder));
144 if (pause_secondary_tasks) {
145 ResumeDartEventLoopTasks(ui_task_queue_id);
146 }
147 });
148 }
149
150 for (auto& secondary_callback : secondary_callbacks) {
152 }
153}
fml::RefPtr< fml::TaskRunner > GetUITaskRunner() const
std::function< void(std::unique_ptr< FrameTimingsRecorder >)> Callback
virtual void PostTask(const fml::closure &task) override
virtual TaskQueueId GetTaskQueueId()
#define FML_DCHECK(condition)
static constexpr const char * kVsyncFlowName
static constexpr const char * kVsyncTraceName
#define TRACE_FLOW_BEGIN(category, name, id)
#define FML_TRACE_EVENT_WITH_FLOW_IDS(category_group, name, flow_id_count, flow_ids,...)
#define TRACE_FLOW_END(category, name, id)
#define TRACE_EVENT0_WITH_FLOW_IDS(category_group, name, flow_id_count, flow_ids)