7#include "third_party/dart/runtime/include/dart_api.h"
8#include "third_party/dart/runtime/include/dart_native_api.h"
9#include "third_party/dart/runtime/include/dart_tools_api.h"
17 : handled_first_message_(
false),
18 isolate_exited_(
false),
19 isolate_had_uncaught_exception_error_(
false),
20 isolate_had_fatal_error_(
false),
22 task_dispatcher_(nullptr) {}
39 auto weak_dart_state = dart_state->
GetWeakPtr();
41 if (
auto dart_state = weak_dart_state.lock()) {
42 dart_state->message_handler().OnHandleMessage(dart_state.get());
143void DartMessageHandler::MessageNotifyCallback(
Dart_Isolate dest_isolate) {
146 dart_state->message_handler().OnMessage(dart_state);
void OnHandleMessage(DartState *dart_state)
void UnhandledError(Dart_Handle error)
bool isolate_had_uncaught_exception_error_
std::function< void(std::function< void(void)>)> TaskDispatcher
bool isolate_had_fatal_error_
void OnMessage(DartState *dart_state)
DartErrorHandleType isolate_last_error_
void Initialize(TaskDispatcher dispatcher)
TaskDispatcher task_dispatcher_
void set_handled_first_message(bool handled_first_message)
bool handled_first_message() const
static DartState * From(Dart_Isolate isolate)
DartMessageHandler & message_handler()
void MessageEpilogue(Dart_Handle message_result)
bool has_set_return_code() const
std::weak_ptr< DartState > GetWeakPtr()
DART_EXPORT void Dart_SetPausedOnExit(bool paused)
DART_EXPORT void Dart_SetPausedOnStart(bool paused)
DART_EXPORT bool Dart_HandleServiceMessages(void)
DART_EXPORT bool Dart_HasServiceMessages(void)
DART_EXPORT void Dart_ShutdownIsolate(void)
DART_EXPORT bool Dart_ShouldPauseOnExit(void)
struct _Dart_Handle * Dart_Handle
DART_EXPORT bool Dart_IsPausedOnExit(void)
DART_EXPORT bool Dart_IsPausedOnStart(void)
struct _Dart_Isolate * Dart_Isolate
DART_EXPORT bool Dart_IsFatalError(Dart_Handle handle)
DART_EXPORT Dart_Isolate Dart_CurrentIsolate(void)
DART_EXPORT Dart_Handle Dart_Null(void)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT bool Dart_ShouldPauseOnStart(void)
DART_EXPORT void Dart_SetMessageNotifyCallback(Dart_MessageNotifyCallback message_notify_callback)
DART_EXPORT bool Dart_HasLivePorts(void)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage(void)
const uint8_t uint32_t uint32_t GError ** error
DartErrorHandleType GetErrorHandleType(Dart_Handle handle)
bool CheckAndHandleError(Dart_Handle handle)
#define TONIC_CHECK(condition)