mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Flutter implements the UI isolates message via posting to a UI task queue. That task queue has a primary and a secondary queue. The * primary is used for running tasks resulated to framework (e.g. draw frame) * secondary is used to run Dart event loop messages (e.g. received data on a socket) The Dart semantics requires running microtasks before processing the next event loop message. The way flutter implements by attaching an observer to the secondary queue. Every time a task from the queue is run, all observers are run and one of them is going to run pending microtasks. In some situations the engine pauses the dart event loop. The terminology used in the code is "microtask" when in reality what it means is "event loop". => This PR changes this terminology to reflect what actually happens.
29 lines
887 B
C++
29 lines
887 B
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_FML_TASK_SOURCE_GRADE_H_
|
|
#define FLUTTER_FML_TASK_SOURCE_GRADE_H_
|
|
|
|
namespace fml {
|
|
|
|
/**
|
|
* Categories of work dispatched to `MessageLoopTaskQueues` dispatcher. By
|
|
* specifying the `TaskSourceGrade`, you indicate the task's importance to the
|
|
* dispatcher.
|
|
*/
|
|
enum class TaskSourceGrade {
|
|
/// This `TaskSourceGrade` indicates that a task is critical to user
|
|
/// interaction.
|
|
kUserInteraction,
|
|
/// This `TaskSourceGrade` indicates that a task corresponds to servicing a
|
|
/// dart event loop task. These aren't critical to user interaction.
|
|
kDartEventLoop,
|
|
/// The absence of a specialized `TaskSourceGrade`.
|
|
kUnspecified,
|
|
};
|
|
|
|
} // namespace fml
|
|
|
|
#endif // FLUTTER_FML_TASK_SOURCE_GRADE_H_
|