5#ifndef FLUTTER_LIB_UI_UI_DART_STATE_H_
6#define FLUTTER_LIB_UI_UI_DART_STATE_H_
12#include "flutter/common/settings.h"
13#include "flutter/common/task_runners.h"
14#include "flutter/fml/build_config.h"
15#include "flutter/fml/memory/weak_ptr.h"
16#include "flutter/fml/synchronization/waitable_event.h"
17#include "flutter/lib/ui/io_manager.h"
18#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h"
19#include "flutter/lib/ui/painting/image_decoder.h"
20#include "flutter/lib/ui/snapshot_delegate.h"
21#include "flutter/lib/ui/volatile_path_tracker.h"
22#include "flutter/shell/common/platform_message_handler.h"
24#include "third_party/dart/runtime/include/dart_api.h"
32class ImageGeneratorRegistry;
33class PlatformConfiguration;
116 const std::string&
debug_name()
const {
return debug_name_; }
121 return platform_configuration_.get();
161 return unhandled_exception_callback_;
183 std::shared_ptr<IsolateNameServer> isolate_name_server,
184 bool is_root_isolate_,
195 void DidSetIsolate()
override;
199 const std::string logger_prefix_;
201 const bool is_root_isolate_;
202 std::string debug_name_;
203 std::unique_ptr<PlatformConfiguration> platform_configuration_;
204 std::weak_ptr<PlatformMessageHandler> platform_message_handler_;
208 const std::shared_ptr<IsolateNameServer> isolate_name_server_;
211 void AddOrRemoveTaskObserver(
bool add);
fml::RefPtr< flutter::SkiaUnrefQueue > GetSkiaUnrefQueue() const
std::shared_ptr< fml::ConcurrentTaskRunner > GetConcurrentTaskRunner() const
Dart_Port main_port() const
PlatformConfiguration * platform_configuration() const
fml::WeakPtr< ImageDecoder > GetImageDecoder() const
UnhandledExceptionCallback unhandled_exception_callback() const
bool IsRootIsolate() const
void FlushMicrotasksNow()
void SetPlatformConfiguration(std::unique_ptr< PlatformConfiguration > platform_configuration)
std::shared_ptr< VolatilePathTracker > GetVolatilePathTracker() const
const std::string & logger_prefix() const
tonic::DartErrorHandleType GetLastError()
fml::WeakPtr< IOManager > GetIOManager() const
const TaskRunners & GetTaskRunners() const
fml::WeakPtr< ImageGeneratorRegistry > GetImageGeneratorRegistry() const
virtual Dart_Isolate CreatePlatformIsolate(Dart_Handle entry_point, char **error)
bool IsImpellerEnabled() const
Whether Impeller is enabled for this application.
std::shared_ptr< IsolateNameServer > GetIsolateNameServer() const
void SetDebugName(const std::string &name)
int64_t GetRootIsolateToken() const
void ScheduleMicrotask(Dart_Handle handle)
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > GetSnapshotDelegate() const
const std::string & GetAdvisoryScriptURI() const
impeller::RuntimeStageBackend GetRuntimeStageBackend() const
The expected type for runtime stage shaders.
void LogMessage(const std::string &tag, const std::string &message) const
void SetPlatformMessageHandler(std::weak_ptr< PlatformMessageHandler > handler)
static UIDartState * Current()
static void ThrowIfUIOperationsProhibited()
Dart_Handle HandlePlatformMessage(std::unique_ptr< PlatformMessage > message)
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)
const std::string & debug_name() const
struct _Dart_Handle * Dart_Handle
struct _Dart_Isolate * Dart_Isolate
const uint8_t uint32_t uint32_t GError ** error
std::function< void(intptr_t)> TaskObserverRemove
std::function< void(intptr_t, fml::closure)> TaskObserverAdd
DEF_SWITCHES_START aot vmservice shared library name
std::function< bool(const std::string &, const std::string &)> UnhandledExceptionCallback
std::function< void(const std::string &, const std::string &)> LogMessageCallback
The subset of state which is owned by the shell or engine and passed through the RuntimeController in...
fml::RefPtr< SkiaUnrefQueue > unref_queue
fml::WeakPtr< ImageGeneratorRegistry > image_generator_registry
fml::WeakPtr< IOManager > io_manager
The IO manager used by the isolate for asynchronous texture uploads.
std::string advisory_script_uri
Context(const TaskRunners &task_runners)
const TaskRunners task_runners
std::shared_ptr< VolatilePathTracker > volatile_path_tracker
Cache for tracking path volatility.
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate
bool enable_impeller
Whether Impeller is enabled or not.
impeller::RuntimeStageBackend runtime_stage_backend
The expected backend for runtime stage shaders.
fml::WeakPtr< ImageDecoder > image_decoder
The image decoder.
std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner
std::string advisory_script_entrypoint