Namespaces | |
| namespace | DartError |
Typedefs | |
| typedef void(* | DartWrappableAccepter) (DartWrappable *) |
Enumerations | |
| enum | DartErrorHandleType { kNoError , kUnknownErrorType , kApiErrorType , kCompilationErrorType } |
Functions | |
| void | Log (const char *format,...) |
| void | SetLogHandler (std::function< void(const char *)> handler) |
| Dart_Handle | LookupNonNullableType (const std::string &library_name, const std::string &type_name) |
| template<typename T , std::enable_if_t< std::is_same< std::string, T >::value, int > = 0> | |
| Dart_Handle | ToDartTypeHandle () |
| template<typename T > | |
| Dart_Handle | CreateZeroInitializedDartObject (Dart_Handle type_handle_or_null=::Dart_Null()) |
| template<typename T > | |
| Dart_Handle | ToDart (const T &object) |
| Dart_Handle | StdStringToDart (const std::string &val) |
| std::string | StdStringFromDart (Dart_Handle handle) |
| Dart_Handle | ToDart (const char *val) |
| template<typename T > | |
| void | DartReturn (T result, Dart_NativeArguments args) |
| template<typename Sig > | |
| void | DartCall (Sig func, Dart_NativeArguments args) |
| template<typename Sig > | |
| void | DartCallStatic (Sig func, Dart_NativeArguments args) |
| template<typename Sig > | |
| void | DartCallConstructor (Sig func, Dart_NativeArguments args) |
| template<typename Arg , typename... Args> | |
| void | WriteFfiArguments (std::ostringstream *stream) |
| template<typename Arg , typename... Args> | |
| void | WriteDartArguments (std::ostringstream *stream) |
| template<typename Arg , typename... Args> | |
| bool | AllowedInLeafCall () |
| template<typename T > | |
| T * | GetReceiver (Dart_NativeArguments args) |
| void | SetUnhandledExceptionReporter (DartError::UnhandledExceptionReporter reporter) |
| bool | CheckAndHandleError (Dart_Handle handle) |
| DartErrorHandleType | GetErrorHandleType (Dart_Handle handle) |
| int | GetErrorExitCode (Dart_Handle handle) |
| Dart_Handle | DartInvokeField (Dart_Handle target, const char *name, std::initializer_list< Dart_Handle > args) |
| Dart_Handle | DartInvoke (Dart_Handle closure, std::initializer_list< Dart_Handle > args) |
| Dart_Handle | DartInvokeVoid (Dart_Handle closure) |
| typedef void(* tonic::DartWrappableAccepter) (DartWrappable *) |
Definition at line 13 of file dart_wrapper_info.h.
| Enumerator | |
|---|---|
| kNoError | |
| kUnknownErrorType | |
| kApiErrorType | |
| kCompilationErrorType | |
Definition at line 67 of file dart_error.h.
| bool tonic::AllowedInLeafCall | ( | ) |
Definition at line 295 of file dart_args.h.
References AllowedInLeafCall(), and type.
Referenced by tonic::FfiDispatcher< void, Return(*)(Args...), function >::AllowedAsLeafCall(), tonic::FfiDispatcher< C, Return(C::*)(Args...), method >::AllowedAsLeafCall(), tonic::FfiDispatcher< C, Return(C::*)(Args...) const, method >::AllowedAsLeafCall(), tonic::FfiDispatcher< void, void(*)(Args...), function >::AllowedAsLeafCall(), tonic::FfiDispatcher< C, void(C::*)(Args...), method >::AllowedAsLeafCall(), and AllowedInLeafCall().
| bool tonic::CheckAndHandleError | ( | Dart_Handle | handle | ) |
Check if a Dart_Handle is an error or exception.
If it is an error or exception, this method will return true.
If it is an unhandled error or exception, the closure in |SetUnhandledExceptionReporter| is called. The DartVMInitializer provides that closure, which checks with UIDartState::Current() if it is available and falls back to simply printing the exception and stack to an error log if the settings callback is not provided.
If UIDartState::Current() is available, it can provide an onError callback that forwards to PlatformConfiguration.instance.onError. If that callback is not set, the callback from Settings.unhandled_exception_callback is invoked. If that callback is not set, a simple error log is printed.
If the PlatformDispatcher callback throws an exception, the at least two separate exceptions and stacktraces will be handled by either the Settings.unhandled_exception_callback or the error printer: one for the original exception, and one for the exception thrown in the callback. If the callback returns false, the original exception and stacktrace are logged. If it returns true, no additional logging is done.
Leaving the PlatformDispatcher.instance.onError callback unset or returning false from it matches the behavior of Flutter applications before the introduction of PlatformDispatcher.onError, which is to print to the error log.
Dart has errors that are not considered unhandled exceptions, such as Dart_* API usage errors. In these cases, Dart_IsUnhandledException returns false but Dart_IsError returns true. Such errors are logged to stderr or some similar mechanism provided by the platform such as logcat on Android. Depending on which type of error occurs, the process may crash and the Dart isolate may be unusable. Errors that fall into this category include compilation errors, Dart API errors, and unwind errors that will terminate the Dart VM.
Historically known as LogIfError.
Definition at line 33 of file dart_error.cc.
References CheckAndHandleError(), and Log().
Referenced by flutter::PlatformConfiguration::AddView(), tonic::DartWrappable::AssociateWithDartWrapper(), flutter::PlatformConfiguration::BeginFrame(), CheckAndHandleError(), tonic::DartWrappable::ClearDartWrapper(), tonic::DartWrappable::CreateDartWrapper(), flutter::DartIsolate::CreatePlatformIsolate(), CreateZeroInitializedDartObject(), tonic::DartByteData::DartByteData(), DartCallConstructor(), DartInvoke(), DartInvokeVoid(), flutter::PlatformConfiguration::DispatchPlatformMessage(), flutter::PlatformConfiguration::DispatchPointerDataPacket(), flutter::PlatformConfiguration::DispatchSemanticsAction(), flutter::ForceShutdownIsolate(), tonic::DartConverter< flutter::RRect >::FromArguments(), tonic::DartConverter< DartList >::FromArguments(), tonic::DartConverter< DartByteData >::FromArguments(), tonic::DartConverter< TypedList< kTypeName, ElemType > >::FromArguments(), flutter::Paragraph::getClosestGlyphInfo(), flutter::Paragraph::getGlyphInfoAt(), flutter::Paragraph::getLineMetricsAt(), impeller::testing::RendererDartTest::GetRenderedTextureFromDart(), dart_runner::InitBuiltinLibrariesForIsolate(), zircon::dart::Initialize(), fuchsia::dart::Initialize(), flutter::InvokeDartPluginRegistrantIfAvailable(), flutter::InvokeMainEntrypoint(), flutter::DartIsolate::LoadLibraryFromKernel(), flutter::DartIsolate::LoadLoadingUnit(), flutter::DartIsolate::LoadLoadingUnitError(), LookupNonNullableType(), tonic::DartListFactory< T, Enable >::NewList(), tonic::DartMessageHandler::OnHandleMessage(), flutter::PlatformConfiguration::RemoveView(), flutter::PlatformConfiguration::ReportTimings(), impeller::testing::RendererDartTest::RunDartFunction(), impeller::testing::RendererDartTest::RunDartFunctionWithWindowSize(), tonic::DartMicrotaskQueue::RunMicrotasks(), flutter::UIDartState::ScheduleMicrotask(), flutter::PlatformConfiguration::SendFocusEvent(), tonic::DartList::Set(), flutter::PlatformConfiguration::SetEngineId(), flutter::testing::TestDartNativeResolver::SetNativeResolverForIsolate(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), tonic::DartConverter< TypedList< kTypeName, ElemType > >::ToDart(), tonic::TypedList< kTypeName, ElemType >::TypedList(), flutter::PlatformConfiguration::UpdateAccessibilityFeatures(), flutter::PlatformConfiguration::UpdateDisplays(), flutter::PlatformConfiguration::UpdateInitialLifecycleState(), flutter::PlatformConfiguration::UpdateLocales(), flutter::PlatformConfiguration::UpdateSemanticsEnabled(), flutter::PlatformConfiguration::UpdateUserSettingsData(), flutter::PlatformConfiguration::UpdateViewMetrics(), and zircon::dart::System::VmoMap().
| Dart_Handle tonic::CreateZeroInitializedDartObject | ( | Dart_Handle | type_handle_or_null = ::Dart_Null() | ) |
Definition at line 432 of file dart_converter.h.
References CheckAndHandleError().
| void tonic::DartCall | ( | Sig | func, |
| Dart_NativeArguments | args | ||
| ) |
Definition at line 210 of file dart_args.h.
References args, and tonic::DartArgIterator::had_exception().
| void tonic::DartCallConstructor | ( | Sig | func, |
| Dart_NativeArguments | args | ||
| ) |
Definition at line 230 of file dart_args.h.
References args, CheckAndHandleError(), tonic::DartArgIterator::had_exception(), tonic::DartWrappable::kNumberOfNativeFields, tonic::DartWrappable::kPeerIndex, and TONIC_CHECK.
| void tonic::DartCallStatic | ( | Sig | func, |
| Dart_NativeArguments | args | ||
| ) |
Definition at line 220 of file dart_args.h.
References args, and tonic::DartArgIterator::had_exception().
| Dart_Handle tonic::DartInvoke | ( | Dart_Handle | closure, |
| std::initializer_list< Dart_Handle > | args | ||
| ) |
Definition at line 20 of file dart_invoke.cc.
References args, argv, CheckAndHandleError(), and DartInvoke().
Referenced by flutter::PlatformConfiguration::AddView(), flutter::PlatformConfiguration::BeginFrame(), DartInvoke(), flutter::PlatformConfiguration::DispatchPlatformMessage(), flutter::PlatformConfiguration::DispatchPointerDataPacket(), flutter::PlatformConfiguration::DispatchSemanticsAction(), flutter::Picture::DoRasterizeToImage(), flutter::SingleFrameCodec::getNextFrame(), flutter::ImmutableBuffer::init(), flutter::ImageDescriptor::initEncoded(), flutter::ImmutableBuffer::initFromAsset(), flutter::ImmutableBuffer::initFromFile(), InternalFlutterGpu_CommandBuffer_Submit(), flutter::InvokeNextFrameCallback(), flutter::FontCollection::LoadFontFromList(), flutter::PlatformConfiguration::RemoveView(), flutter::PlatformConfiguration::ReportTimings(), flutter::PlatformConfiguration::SendFocusEvent(), flutter::PlatformConfiguration::SetEngineId(), flutter::testing::TEST_F(), flutter::PlatformConfiguration::UpdateAccessibilityFeatures(), flutter::PlatformConfiguration::UpdateDisplays(), flutter::PlatformConfiguration::UpdateInitialLifecycleState(), flutter::PlatformConfiguration::UpdateLocales(), flutter::PlatformConfiguration::UpdateSemanticsEnabled(), flutter::PlatformConfiguration::UpdateUserSettingsData(), and flutter::PlatformConfiguration::UpdateViewMetrics().
| Dart_Handle tonic::DartInvokeField | ( | Dart_Handle | target, |
| const char * | name, | ||
| std::initializer_list< Dart_Handle > | args | ||
| ) |
Definition at line 12 of file dart_invoke.cc.
References args, DartInvokeField(), name, and target.
Referenced by flutter::CanvasImage::CreateOuterWrapping(), DartInvokeField(), flutter::InvokeDartPluginRegistrantIfAvailable(), flutter::InvokeMainEntrypoint(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| Dart_Handle tonic::DartInvokeVoid | ( | Dart_Handle | closure | ) |
Definition at line 29 of file dart_invoke.cc.
References CheckAndHandleError().
Referenced by flutter::PlatformConfiguration::BeginFrame(), and flutter::DartIsolate::CreatePlatformIsolate().
| void tonic::DartReturn | ( | T | result, |
| Dart_NativeArguments | args | ||
| ) |
Definition at line 99 of file dart_args.h.
References args.
Referenced by tonic::DartDispatcher< IndicesHolder< indices... >, ResultType(*)(ArgTypes...)>::Dispatch(), tonic::DartDispatcher< IndicesHolder< indices... >, ReturnType(C::*)(ArgTypes...) const >::Dispatch(), and tonic::DartDispatcher< IndicesHolder< indices... >, ResultType(C::*)(ArgTypes...)>::Dispatch().
| int tonic::GetErrorExitCode | ( | Dart_Handle | handle | ) |
Definition at line 68 of file dart_error.cc.
| DartErrorHandleType tonic::GetErrorHandleType | ( | Dart_Handle | handle | ) |
Definition at line 56 of file dart_error.cc.
References kApiErrorType, kCompilationErrorType, kNoError, and kUnknownErrorType.
Referenced by tonic::DartMicrotaskQueue::RunMicrotasks(), and tonic::DartMessageHandler::UnhandledError().
|
inline |
Definition at line 198 of file dart_wrappable.h.
References args, ToDart(), and TONIC_DCHECK.
| void tonic::Log | ( | const char * | format, |
| ... | |||
| ) |
Definition at line 19 of file log.cc.
References format, and message.
Referenced by CheckAndHandleError(), and tonic::FileLoader::LoadPackagesMap().
|
inline |
Definition at line 396 of file dart_converter.h.
References CheckAndHandleError(), and type.
Referenced by ToDartTypeHandle().
| void tonic::SetLogHandler | ( | std::function< void(const char *)> | handler | ) |
| void tonic::SetUnhandledExceptionReporter | ( | DartError::UnhandledExceptionReporter | reporter | ) |
The fallback mechanism to log errors if the platform configuration error handler returns false.
Normally, UIDartState registers with this method in its constructor.
Definition at line 28 of file dart_error.cc.
Referenced by DartVMInitializer::Initialize().
|
inline |
Definition at line 590 of file dart_converter.h.
Referenced by BindUniform(), tonic::FileLoader::CanonicalizeURL(), tonic::DartLibraryNatives::GetNativeFunction(), dart_utils::HandleIfException(), tonic::FileLoader::Import(), InternalFlutterGpu_RenderPass_BindTexture(), InternalFlutterGpu_Shader_GetUniformMemberOffset(), InternalFlutterGpu_Shader_GetUniformStructSize(), InternalFlutterGpu_ShaderLibrary_GetShader(), InternalFlutterGpu_ShaderLibrary_InitializeWithAsset(), tonic::FileLoader::Kernel(), and tonic::FileLoader::SetPackagesUrl().
|
inline |
Definition at line 586 of file dart_converter.h.
Referenced by tonic::FileLoader::CanonicalizeURL().
|
inline |
Definition at line 595 of file dart_converter.h.
References ToDart().
| Dart_Handle tonic::ToDart | ( | const T & | object | ) |
Definition at line 579 of file dart_converter.h.
References ToDart().
Referenced by flutter::ParagraphBuilder::addText(), flutter::CanvasImage::CreateOuterWrapping(), flutter::DartIsolate::CreatePlatformIsolate(), tonic::DartByteData::DartByteData(), tonic::DartClassProvider::DartClassProvider(), flutter::PlatformConfiguration::DidCreateIsolate(), flutter::Picture::DoRasterizeToImage(), flutter::FindAndInvokeDartPluginRegistrant(), flutter::ForceShutdownIsolate(), tonic::DartClassProvider::GetClassByName(), flutter::MultiFrameCodec::getNextFrame(), flutter::SingleFrameCodec::getNextFrame(), GetReceiver(), impeller::testing::RendererDartTest::GetRenderedTextureFromDart(), flutter::UIDartState::HandlePlatformMessage(), flutter::ImmutableBuffer::init(), flutter::ImageDescriptor::initEncoded(), flutter::FragmentProgram::initFromAsset(), flutter::ImmutableBuffer::initFromAsset(), flutter::ImmutableBuffer::initFromFile(), InternalFlutterGpu_CommandBuffer_Submit(), InternalFlutterGpu_Context_InitializeDefault(), InternalFlutterGpu_RenderPass_Begin(), InternalFlutterGpu_ShaderLibrary_GetShader(), InternalFlutterGpu_ShaderLibrary_InitializeWithAsset(), flutter::InvokeDartPluginRegistrantIfAvailable(), flutter::InvokeMainEntrypoint(), flutter::FontCollection::LoadFontFromList(), impeller::testing::RendererDartTest::RunDartFunction(), impeller::testing::RendererDartTest::RunDartFunctionWithWindowSize(), flutter::DartIsolate::RunFromLibrary(), flutter::PlatformConfigurationNativeApi::SendPlatformMessage(), flutter::PlatformConfigurationNativeApi::SendPortPlatformMessage(), flutter::ReusableFragmentShader::SetImageSampler(), tonic::DartConverter< const char * >::SetReturnValue(), tonic::DartConverter< std::string >::SetReturnValue(), tonic::DartConverter< std::u16string >::SetReturnValue(), tonic::DartConverter< std::vector< T > >::SetReturnValue(), flutter::PlatformIsolateNativeApi::Spawn(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::UIDartState::ThrowIfUIOperationsProhibited(), ToDart(), ToDart(), tonic::DartConverter< PTR< T > >::ToFfi(), tonic::DartConverter< std::string >::ToFfi(), tonic::DartConverter< std::u16string >::ToFfi(), tonic::DartConverter< std::vector< T > >::ToFfi(), flutter::Picture::toImage(), flutter::Scene::toImage(), flutter::Scene::toImageSync(), and tonic::TypedList< kTypeName, ElemType >::TypedList().
| Dart_Handle tonic::ToDartTypeHandle | ( | ) |
Definition at line 416 of file dart_converter.h.
References LookupNonNullableType().
| void tonic::WriteDartArguments | ( | std::ostringstream * | stream | ) |
Definition at line 283 of file dart_args.h.
References WriteDartArguments().
Referenced by WriteDartArguments(), tonic::FfiDispatcher< void, Return(*)(Args...), function >::WriteDartArguments(), tonic::FfiDispatcher< C, Return(C::*)(Args...), method >::WriteDartArguments(), tonic::FfiDispatcher< C, Return(C::*)(Args...) const, method >::WriteDartArguments(), tonic::FfiDispatcher< void, void(*)(Args...), function >::WriteDartArguments(), and tonic::FfiDispatcher< C, void(C::*)(Args...), method >::WriteDartArguments().
| void tonic::WriteFfiArguments | ( | std::ostringstream * | stream | ) |
Definition at line 270 of file dart_args.h.
References type, and WriteFfiArguments().
Referenced by WriteFfiArguments(), tonic::FfiDispatcher< void, Return(*)(Args...), function >::WriteFfiArguments(), tonic::FfiDispatcher< C, Return(C::*)(Args...), method >::WriteFfiArguments(), tonic::FfiDispatcher< C, Return(C::*)(Args...) const, method >::WriteFfiArguments(), tonic::FfiDispatcher< void, void(*)(Args...), function >::WriteFfiArguments(), and tonic::FfiDispatcher< C, void(C::*)(Args...), method >::WriteFfiArguments().