#include <ui_dart_state.h>
|
struct | Context |
| The subset of state which is owned by the shell or engine and passed through the RuntimeController into DartIsolates. If a shell-owned resource needs to be exposed to the framework via UIDartState, a pointer to the resource can be added to this struct with appropriate default construction. More...
|
|
Definition at line 36 of file ui_dart_state.h.
◆ UIDartState()
Definition at line 58 of file ui_dart_state.cc.
67 : add_callback_(std::move(add_callback)),
68 remove_callback_(std::move(remove_callback)),
70 is_root_isolate_(is_root_isolate),
72 log_message_callback_(std::move(log_message_callback)),
73 isolate_name_server_(std::move(isolate_name_server)),
74 context_(context) {
75 AddOrRemoveTaskObserver(true );
76}
UnhandledExceptionCallback unhandled_exception_callback() const
const std::string & logger_prefix() const
◆ ~UIDartState()
flutter::UIDartState::~UIDartState |
( |
| ) |
|
|
overrideprotected |
Definition at line 78 of file ui_dart_state.cc.
78 {
79 AddOrRemoveTaskObserver(false );
80}
◆ CreatePlatformIsolate()
◆ Current()
Definition at line 119 of file ui_dart_state.cc.
119 {
120 return static_cast<UIDartState*
>(DartState::Current());
121}
UIDartState(TaskObserverAdd add_callback, TaskObserverRemove remove_callback, std::string logger_prefix, UnhandledExceptionCallback unhandled_exception_callback, LogMessageCallback log_message_callback, std::shared_ptr< IsolateNameServer > isolate_name_server, bool is_root_isolate_, const UIDartState::Context &context)
◆ debug_name()
const std::string & flutter::UIDartState::debug_name |
( |
| ) |
const |
|
inline |
◆ FlushMicrotasksNow()
void flutter::UIDartState::FlushMicrotasksNow |
( |
| ) |
|
◆ GetAdvisoryScriptURI()
const std::string & flutter::UIDartState::GetAdvisoryScriptURI |
( |
| ) |
const |
|
protected |
◆ GetConcurrentTaskRunner()
Definition at line 157 of file ui_dart_state.cc.
157 {
159}
std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner
◆ GetImageDecoder()
Definition at line 194 of file ui_dart_state.cc.
194 {
196}
fml::WeakPtr< ImageDecoder > image_decoder
The image decoder.
◆ GetImageGeneratorRegistry()
Definition at line 198 of file ui_dart_state.cc.
199 {
201}
fml::WeakPtr< ImageGeneratorRegistry > image_generator_registry
◆ GetIOManager()
Definition at line 143 of file ui_dart_state.cc.
143 {
145}
fml::WeakPtr< IOManager > io_manager
The IO manager used by the isolate for asynchronous texture uploads.
◆ GetIsolateNameServer()
std::shared_ptr< IsolateNameServer > flutter::UIDartState::GetIsolateNameServer |
( |
| ) |
const |
◆ GetLastError()
Definition at line 207 of file ui_dart_state.cc.
207 {
211 }
213}
DartErrorHandleType isolate_last_error() const
DartErrorHandleType GetLastError()
DartMessageHandler & message_handler()
const uint8_t uint32_t uint32_t GError ** error
◆ GetRootIsolateToken()
int64_t flutter::UIDartState::GetRootIsolateToken |
( |
| ) |
const |
Returns a enumeration that uniquely represents this root isolate. Returns 0
if called from a non-root isolate.
Definition at line 261 of file ui_dart_state.cc.
261 {
262 return IsRootIsolate() ?
reinterpret_cast<int64_t
>(
this) : 0;
263}
bool IsRootIsolate() const
◆ GetRuntimeStageBackend()
The expected type for runtime stage shaders.
Definition at line 90 of file ui_dart_state.cc.
90 {
92}
impeller::RuntimeStageBackend runtime_stage_backend
The expected backend for runtime stage shaders.
◆ GetSkiaUnrefQueue()
Definition at line 147 of file ui_dart_state.cc.
147 {
149}
fml::RefPtr< SkiaUnrefQueue > unref_queue
◆ GetSnapshotDelegate()
Definition at line 190 of file ui_dart_state.cc.
190 {
192}
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate
◆ GetTaskRunners()
const TaskRunners & flutter::UIDartState::GetTaskRunners |
( |
| ) |
const |
◆ GetVolatilePathTracker()
Definition at line 151 of file ui_dart_state.cc.
152 {
154}
std::shared_ptr< VolatilePathTracker > volatile_path_tracker
Cache for tracking path volatility.
◆ HandlePlatformMessage()
Definition at line 242 of file ui_dart_state.cc.
243 {
244 if (platform_configuration_) {
245 platform_configuration_->client()->HandlePlatformMessage(
247 } else {
248 std::shared_ptr<PlatformMessageHandler> handler =
249 platform_message_handler_.lock();
250 if (handler) {
251 handler->HandlePlatformMessage(std::move(
message));
252 } else {
254 "No platform channel handler registered for background isolate.");
255 }
256 }
257
259}
DART_EXPORT Dart_Handle Dart_Null(void)
Dart_Handle ToDart(const T &object)
◆ IsImpellerEnabled()
bool flutter::UIDartState::IsImpellerEnabled |
( |
| ) |
const |
Whether Impeller is enabled for this application.
Definition at line 86 of file ui_dart_state.cc.
86 {
88}
bool enable_impeller
Whether Impeller is enabled or not.
◆ IsRootIsolate()
bool flutter::UIDartState::IsRootIsolate |
( |
| ) |
const |
|
inline |
◆ logger_prefix()
const std::string & flutter::UIDartState::logger_prefix |
( |
| ) |
const |
|
inline |
◆ LogMessage()
void flutter::UIDartState::LogMessage |
( |
const std::string & |
tag, |
|
|
const std::string & |
message |
|
) |
| const |
Definition at line 215 of file ui_dart_state.cc.
216 {
217 if (log_message_callback_) {
218 log_message_callback_(tag,
message);
219 } else {
220
221#if defined(FML_OS_ANDROID)
222 __android_log_print(ANDROID_LOG_INFO, tag.c_str(), "%.*s",
224#elif defined(FML_OS_IOS)
226 if (!tag.empty()) {
228 }
231 syslog(1 ,
"%.*s",
static_cast<int>(
log.size()),
233#else
234 if (!tag.empty()) {
235 std::cout << tag << ": ";
236 }
237 std::cout <<
message << std::endl;
238#endif
239 }
240}
◆ main_port()
Dart_Port flutter::UIDartState::main_port |
( |
| ) |
const |
|
inline |
◆ platform_configuration()
Definition at line 120 of file ui_dart_state.h.
120 {
121 return platform_configuration_.get();
122 }
◆ ScheduleMicrotask()
void flutter::UIDartState::ScheduleMicrotask |
( |
Dart_Handle |
handle | ) |
|
Definition at line 161 of file ui_dart_state.cc.
161 {
163 return;
164 }
165
167}
void ScheduleMicrotask(Dart_Handle callback)
DART_EXPORT bool Dart_IsClosure(Dart_Handle object)
std::function< void()> closure
bool CheckAndHandleError(Dart_Handle handle)
◆ SetDebugName()
void flutter::UIDartState::SetDebugName |
( |
const std::string & |
name | ) |
|
Definition at line 111 of file ui_dart_state.cc.
111 {
113 if (platform_configuration_) {
114 platform_configuration_->client()->UpdateIsolateDescription(debug_name_,
115 main_port_);
116 }
117}
const std::string & debug_name() const
◆ SetPlatformConfiguration()
void flutter::UIDartState::SetPlatformConfiguration |
( |
std::unique_ptr< PlatformConfiguration > |
platform_configuration | ) |
|
|
protected |
Definition at line 123 of file ui_dart_state.cc.
124 {
127 if (platform_configuration_) {
128 platform_configuration_->client()->UpdateIsolateDescription(debug_name_,
129 main_port_);
130 }
131}
PlatformConfiguration * platform_configuration() const
#define FML_DCHECK(condition)
◆ SetPlatformMessageHandler()
Definition at line 133 of file ui_dart_state.cc.
134 {
136 platform_message_handler_ = std::move(handler);
137}
◆ ThrowIfUIOperationsProhibited()
void flutter::UIDartState::ThrowIfUIOperationsProhibited |
( |
| ) |
|
|
static |
Definition at line 103 of file ui_dart_state.cc.
103 {
107 tonic::ToDart(
"UI actions are only available on root isolate."));
108 }
109}
static UIDartState * Current()
DART_EXPORT void Dart_EnterScope(void)
DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception)
◆ unhandled_exception_callback()
Definition at line 160 of file ui_dart_state.h.
160 {
161 return unhandled_exception_callback_;
162 }
The documentation for this class was generated from the following files: