Flutter Engine
 
Loading...
Searching...
No Matches
tonic Namespace Reference

Namespaces

namespace  DartError
 

Classes

class  DartApiScope
 
struct  DartArgHolder
 
class  DartArgIterator
 
class  DartByteData
 
class  DartClassLibrary
 
class  DartClassProvider
 
struct  DartConverter
 
struct  DartConverter< bool >
 
struct  DartConverter< const char * >
 
struct  DartConverter< Dart_Handle >
 
struct  DartConverter< DartByteData >
 
struct  DartConverter< DartList >
 
struct  DartConverter< double >
 
struct  DartConverter< flutter::RRect >
 
struct  DartConverter< int >
 
struct  DartConverter< long int >
 
struct  DartConverter< long long >
 
struct  DartConverter< PTR< T > >
 
struct  DartConverter< std::string >
 
struct  DartConverter< std::u16string >
 
struct  DartConverter< std::vector< T > >
 
struct  DartConverter< T *, typename std::enable_if< std::is_convertible< T *, const DartWrappable * >::value >::type >
 
struct  DartConverter< T, typename std::enable_if< std::is_enum< T >::value >::type >
 
struct  DartConverter< TypedList< kTypeName, ElemType > >
 
struct  DartConverter< unsigned >
 
struct  DartConverter< unsigned long >
 
struct  DartConverter< unsigned long long >
 
struct  DartConverter< void >
 
struct  DartConverterInteger
 
struct  DartConverterTypes
 
struct  DartConverterWrappable
 
class  DartDispatcher
 
struct  DartDispatcher< IndicesHolder< indices... >, ResultType(*)(ArgTypes...)>
 
struct  DartDispatcher< IndicesHolder< indices... >, ResultType(C::*)(ArgTypes...)>
 
struct  DartDispatcher< IndicesHolder< indices... >, ReturnType(C::*)(ArgTypes...) const >
 
struct  DartDispatcher< IndicesHolder< indices... >, void(*)(ArgTypes...)>
 
struct  DartDispatcher< IndicesHolder< indices... >, void(C::*)(ArgTypes...)>
 
class  DartIsolateScope
 
class  DartLibraryNatives
 
class  DartList
 
struct  DartListFactory
 
class  DartMessageHandler
 
class  DartMicrotaskQueue
 
class  DartPersistentValue
 
class  DartState
 
class  DartWeakPersistentValue
 
class  DartWrappable
 
struct  DartWrapperInfo
 
struct  FfiDispatcher
 
struct  FfiDispatcher< C, Return(C::*)(Args...) const, method >
 
struct  FfiDispatcher< C, Return(C::*)(Args...), method >
 
struct  FfiDispatcher< C, void(C::*)(Args...), method >
 
struct  FfiDispatcher< void, Return(*)(Args...), function >
 
struct  FfiDispatcher< void, void(*)(Args...), function >
 
class  FileLoader
 
class  IndicesForSignature
 
struct  IndicesForSignature< ResultType(*)(ArgTypes...)>
 
struct  IndicesForSignature< ResultType(C::*)(ArgTypes...) const >
 
struct  IndicesForSignature< ResultType(C::*)(ArgTypes...)>
 
struct  IndicesGenerator
 
struct  IndicesGenerator< 0, indices... >
 
struct  IndicesHolder
 
class  PackagesMap
 
class  TypedList
 

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 Documentation

◆ DartWrappableAccepter

typedef void(* tonic::DartWrappableAccepter) (DartWrappable *)

Definition at line 13 of file dart_wrapper_info.h.

Enumeration Type Documentation

◆ DartErrorHandleType

Enumerator
kNoError 
kUnknownErrorType 
kApiErrorType 
kCompilationErrorType 

Definition at line 67 of file dart_error.h.

67 {
72};
@ kApiErrorType
Definition dart_error.h:70
@ kCompilationErrorType
Definition dart_error.h:71
@ kUnknownErrorType
Definition dart_error.h:69
@ kNoError
Definition dart_error.h:68

Function Documentation

◆ AllowedInLeafCall()

template<typename Arg , typename... Args>
bool tonic::AllowedInLeafCall ( )

◆ CheckAndHandleError()

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.

33 {
34 // Specifically handle UnhandledExceptionErrors first. These exclude fatal
35 // errors that are shutting down the vm and compilation errors in source code.
36 if (Dart_IsUnhandledExceptionError(handle)) {
37 Dart_Handle exception_handle = Dart_ErrorGetException(handle);
38 Dart_Handle stack_trace_handle = Dart_ErrorGetStackTrace(handle);
39
40 ReportUnhandledException(exception_handle, stack_trace_handle);
41 return true;
42 } else if (Dart_IsFatalError(handle)) {
43 // An UnwindError designed to shutdown isolates. This is thrown by
44 // Isolate.exit. This is ordinary API usage, not actually an error, so
45 // silently shut down the isolate. The actual isolate shutdown happens in
46 // DartMessageHandler::UnhandledError.
47 return true;
48 } else if (Dart_IsError(handle)) {
49 tonic::Log("Dart Error: %s", Dart_GetError(handle));
50 return true;
51 } else {
52 return false;
53 }
54}
void Log(const char *format,...)
Definition log.cc:19

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().

◆ CreateZeroInitializedDartObject()

template<typename T >
Dart_Handle tonic::CreateZeroInitializedDartObject ( Dart_Handle  type_handle_or_null = ::Dart_Null())

Definition at line 432 of file dart_converter.h.

433 {
434 if constexpr (std::is_same<std::string, T>::value) {
435 return ::Dart_EmptyString();
436 } else if constexpr (std::is_integral<T>::value) {
437 return ::Dart_NewIntegerFromUint64(0u);
438 } else if constexpr (std::is_floating_point<T>::value) {
439 return ::Dart_NewDouble(0.0);
440 } else {
441 auto object = ::Dart_New(type_handle_or_null, ::Dart_Null(), 0, nullptr);
442 CheckAndHandleError(object);
443 return object;
444 }
445 return ::Dart_Null();
446}
bool CheckAndHandleError(Dart_Handle handle)
Definition dart_error.cc:33

References CheckAndHandleError().

◆ DartCall()

template<typename Sig >
void tonic::DartCall ( Sig  func,
Dart_NativeArguments  args 
)

Definition at line 210 of file dart_args.h.

210 {
212 using Indices = typename IndicesForSignature<Sig>::type;
213 DartDispatcher<Indices, Sig> decoder(&it);
214 if (it.had_exception())
215 return;
216 decoder.Dispatch(func);
217}
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

References args, and tonic::DartArgIterator::had_exception().

◆ DartCallConstructor()

template<typename Sig >
void tonic::DartCallConstructor ( Sig  func,
Dart_NativeArguments  args 
)

Definition at line 230 of file dart_args.h.

230 {
232 using Indices = typename IndicesForSignature<Sig>::type;
233 using Wrappable = typename DartDispatcher<Indices, Sig>::CtorResultType;
234 Wrappable wrappable;
235 {
236 DartDispatcher<Indices, Sig> decoder(&it);
237 if (it.had_exception())
238 return;
239 wrappable = decoder.DispatchCtor(func);
240 }
241
242 Dart_Handle wrapper = Dart_GetNativeArgument(args, 0);
243 TONIC_CHECK(!CheckAndHandleError(wrapper));
244
245 intptr_t native_fields[DartWrappable::kNumberOfNativeFields];
246 TONIC_CHECK(!CheckAndHandleError(Dart_GetNativeFieldsOfArgument(
247 args, 0, DartWrappable::kNumberOfNativeFields, native_fields)));
248 TONIC_CHECK(!native_fields[DartWrappable::kPeerIndex]);
249
250 wrappable->AssociateWithDartWrapper(wrapper);
251}
#define TONIC_CHECK(condition)
Definition macros.h:23

References args, CheckAndHandleError(), tonic::DartArgIterator::had_exception(), tonic::DartWrappable::kNumberOfNativeFields, tonic::DartWrappable::kPeerIndex, and TONIC_CHECK.

◆ DartCallStatic()

template<typename Sig >
void tonic::DartCallStatic ( Sig  func,
Dart_NativeArguments  args 
)

Definition at line 220 of file dart_args.h.

220 {
221 DartArgIterator it(args, 0);
222 using Indices = typename IndicesForSignature<Sig>::type;
223 DartDispatcher<Indices, Sig> decoder(&it);
224 if (it.had_exception())
225 return;
226 decoder.Dispatch(func);
227}

References args, and tonic::DartArgIterator::had_exception().

◆ DartInvoke()

Dart_Handle tonic::DartInvoke ( Dart_Handle  closure,
std::initializer_list< Dart_Handle >  args 
)

Definition at line 20 of file dart_invoke.cc.

21 {
22 int argc = args.size();
23 Dart_Handle* argv = const_cast<Dart_Handle*>(args.begin());
24 Dart_Handle handle = Dart_InvokeClosure(closure, argc, argv);
25 CheckAndHandleError(handle);
26 return handle;
27}
char ** argv
Definition library.h:9

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().

◆ DartInvokeField()

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.

14 {
15 Dart_Handle field = Dart_NewStringFromCString(name);
16 return Dart_Invoke(target, field, args.size(),
17 const_cast<Dart_Handle*>(args.begin()));
18}
uint32_t * target
const char * name
Definition fuchsia.cc:49

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().

◆ DartInvokeVoid()

Dart_Handle tonic::DartInvokeVoid ( Dart_Handle  closure)

Definition at line 29 of file dart_invoke.cc.

29 {
30 Dart_Handle handle = Dart_InvokeClosure(closure, 0, nullptr);
31 CheckAndHandleError(handle);
32 return handle;
33}

References CheckAndHandleError().

Referenced by flutter::PlatformConfiguration::BeginFrame(), and flutter::DartIsolate::CreatePlatformIsolate().

◆ DartReturn()

◆ GetErrorExitCode()

int tonic::GetErrorExitCode ( Dart_Handle  handle)

Definition at line 68 of file dart_error.cc.

68 {
69 if (Dart_IsCompilationError(handle)) {
70 return 254; // dart::bin::kCompilationErrorExitCode
71 } else if (Dart_IsApiError(handle)) {
72 return 253; // dart::bin::kApiErrorExitCode
73 } else if (Dart_IsError(handle)) {
74 return 255; // dart::bin::kErrorExitCode
75 } else {
76 return 0;
77 }
78}

◆ GetErrorHandleType()

DartErrorHandleType tonic::GetErrorHandleType ( Dart_Handle  handle)

Definition at line 56 of file dart_error.cc.

56 {
57 if (Dart_IsCompilationError(handle)) {
59 } else if (Dart_IsApiError(handle)) {
60 return kApiErrorType;
61 } else if (Dart_IsError(handle)) {
62 return kUnknownErrorType;
63 } else {
64 return kNoError;
65 }
66}

References kApiErrorType, kCompilationErrorType, kNoError, and kUnknownErrorType.

Referenced by tonic::DartMicrotaskQueue::RunMicrotasks(), and tonic::DartMessageHandler::UnhandledError().

◆ GetReceiver()

template<typename T >
T * tonic::GetReceiver ( Dart_NativeArguments  args)
inline

Definition at line 198 of file dart_wrappable.h.

198 {
199 intptr_t receiver;
200 Dart_Handle result = Dart_GetNativeReceiver(args, &receiver);
201 TONIC_DCHECK(!Dart_IsError(result));
202 if (!receiver)
203 Dart_ThrowException(ToDart("Object has been disposed."));
204 return static_cast<T*>(reinterpret_cast<DartWrappable*>(receiver));
205}
Dart_Handle ToDart(const T &object)
#define TONIC_DCHECK
Definition macros.h:32

References args, ToDart(), and TONIC_DCHECK.

◆ Log()

void tonic::Log ( const char *  format,
  ... 
)

Definition at line 19 of file log.cc.

19 {
20 va_list ap;
21 va_start(ap, format);
22 int result = vsnprintf(nullptr, 0, format, ap);
23 va_end(ap);
24
25 if (result < 0) {
26 return;
27 }
28
29 int size = result + 1;
30 std::unique_ptr<char[]> message = std::make_unique<char[]>(size);
31 va_start(ap, format);
32 result = vsnprintf(message.get(), size, format, ap);
33 va_end(ap);
34
35 if (result < 0) {
36 return;
37 }
38
39 if (log_handler) {
40 log_handler(message.get());
41 } else {
42 printf("%s\n", message.get());
43 }
44}
G_BEGIN_DECLS GBytes * message

References format, and message.

Referenced by CheckAndHandleError(), and tonic::FileLoader::LoadPackagesMap().

◆ LookupNonNullableType()

Dart_Handle tonic::LookupNonNullableType ( const std::string &  library_name,
const std::string &  type_name 
)
inline

Definition at line 396 of file dart_converter.h.

397 {
398 auto library =
399 Dart_LookupLibrary(DartConverter<std::string>::ToDart(library_name));
400 if (CheckAndHandleError(library)) {
401 return library;
402 }
403 auto type_string = DartConverter<std::string>::ToDart(type_name);
404 if (CheckAndHandleError(type_string)) {
405 return type_string;
406 }
407 auto type = Dart_GetNonNullableType(library, type_string, 0, nullptr);
409 return type;
410 }
411 return type;
412}

References CheckAndHandleError(), and type.

Referenced by ToDartTypeHandle().

◆ SetLogHandler()

void tonic::SetLogHandler ( std::function< void(const char *)>  handler)

Definition at line 46 of file log.cc.

46 {
47 log_handler = handler;
48}
const gchar FlBinaryMessengerMessageHandler handler

References handler.

◆ SetUnhandledExceptionReporter()

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.

29 {
30 log_unhandled_exception.store(reporter);
31}

Referenced by DartVMInitializer::Initialize().

◆ StdStringFromDart()

◆ StdStringToDart()

Dart_Handle tonic::StdStringToDart ( const std::string &  val)
inline

Definition at line 586 of file dart_converter.h.

586 {
588}

Referenced by tonic::FileLoader::CanonicalizeURL().

◆ ToDart() [1/2]

Dart_Handle tonic::ToDart ( const char *  val)
inline

Definition at line 595 of file dart_converter.h.

595 {
596 return Dart_NewStringFromCString(val);
597}

References ToDart().

◆ ToDart() [2/2]

template<typename T >
Dart_Handle tonic::ToDart ( const T &  object)

Definition at line 579 of file dart_converter.h.

579 {
580 return DartConverter<T>::ToDart(object);
581}

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().

◆ ToDartTypeHandle()

template<typename T , std::enable_if_t< std::is_same< std::string, T >::value, int > = 0>
Dart_Handle tonic::ToDartTypeHandle ( )

Definition at line 416 of file dart_converter.h.

416 {
417 return LookupNonNullableType("dart:core", "String");
418}
Dart_Handle LookupNonNullableType(const std::string &library_name, const std::string &type_name)

References LookupNonNullableType().

◆ WriteDartArguments()

template<typename Arg , typename... Args>
void tonic::WriteDartArguments ( std::ostringstream *  stream)

Definition at line 283 of file dart_args.h.

283 {
284 *stream << tonic::DartConverter<
285 typename std::remove_const<typename std::remove_reference<Arg>::type>::
286 type>::GetDartRepresentation();
287 if constexpr (sizeof...(Args) > 0) {
288 *stream << ", ";
289 WriteDartArguments<Args...>(stream);
290 }
291}
void WriteDartArguments(std::ostringstream *stream)
Definition dart_args.h:283

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().

◆ WriteFfiArguments()

template<typename Arg , typename... Args>
void tonic::WriteFfiArguments ( std::ostringstream *  stream)

Definition at line 270 of file dart_args.h.

270 {
271 *stream << tonic::DartConverter<typename std::remove_const<
272 typename std::remove_reference<Arg>::type>::type>::GetFfiRepresentation();
273 if constexpr (sizeof...(Args) > 0) {
274 *stream << ", ";
275 WriteFfiArguments<Args...>(stream);
276 }
277}
void WriteFfiArguments(std::ostringstream *stream)
Definition dart_args.h:270

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().