Flutter Engine
The Flutter Engine
Classes | Public Types | Static Public Member Functions | List of all members
dart::bin::Builtin Class Reference

#include <builtin.h>

Public Types

enum  BuiltinLibraryId {
  kInvalidLibrary = -1 , kBuiltinLibrary = 0 , kIOLibrary , kHttpLibrary ,
  kCLILibrary
}
 

Static Public Member Functions

static void SetNativeResolver (BuiltinLibraryId id)
 
static Dart_Handle LoadAndCheckLibrary (BuiltinLibraryId id)
 

Detailed Description

Definition at line 24 of file builtin.h.

Member Enumeration Documentation

◆ BuiltinLibraryId

Enumerator
kInvalidLibrary 
kBuiltinLibrary 
kIOLibrary 
kHttpLibrary 
kCLILibrary 

Definition at line 28 of file builtin.h.

Member Function Documentation

◆ LoadAndCheckLibrary()

Dart_Handle dart::bin::Builtin::LoadAndCheckLibrary ( BuiltinLibraryId  id)
static

Definition at line 43 of file builtin.cc.

43 {
44 ASSERT(static_cast<int>(id) >= 0);
45 ASSERT(static_cast<int>(id) < num_libs_);
46
47 Dart_Handle url = DartUtils::NewString(builtin_libraries_[id].url_);
48 return Dart_LookupLibrary(url);
49}
static Dart_Handle NewString(const char *str)
Definition: dartutils.h:214
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
#define ASSERT(E)
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)

◆ SetNativeResolver()

void dart::bin::Builtin::SetNativeResolver ( BuiltinLibraryId  id)
static

Definition at line 28 of file builtin.cc.

28 {
29 ASSERT(static_cast<int>(id) >= 0);
30 ASSERT(static_cast<int>(id) < num_libs_);
31
32 if (builtin_libraries_[id].has_natives_) {
33 Dart_Handle url = DartUtils::NewString(builtin_libraries_[id].url_);
34 Dart_Handle library = Dart_LookupLibrary(url);
35 ASSERT(!Dart_IsError(library));
36 // Setup the native resolver for built in library functions.
38 Dart_SetNativeResolver(library, NativeLookup, NativeSymbol);
40 }
41}
GAsyncResult * result
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_SetNativeResolver(Dart_Handle library, Dart_NativeEntryResolver resolver, Dart_NativeEntrySymbol symbol)

The documentation for this class was generated from the following files: