Flutter Engine
dart_class_provider.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
8 #include "tonic/dart_state.h"
10 
11 namespace tonic {
12 
14  const char* class_name) {
15  library_.Set(dart_state, Dart_LookupLibrary(ToDart(class_name)));
16 }
17 
19 
20 Dart_Handle DartClassProvider::GetClassByName(const char* class_name) {
21  Dart_Handle name_handle = ToDart(class_name);
22  Dart_Handle class_handle =
23  Dart_GetNonNullableType(library_.value(), name_handle, 0, nullptr);
24  TONIC_DCHECK(!Dart_IsError(class_handle));
25  return class_handle;
26 }
27 
28 } // namespace tonic
#define TONIC_DCHECK
Definition: macros.h:32
Dart_PersistentHandle value() const
void Set(DartState *dart_state, Dart_Handle value)
DartClassProvider(DartState *dart_state, const char *library_name)
Dart_Handle GetClassByName(const char *class_name)
Dart_Handle ToDart(const T &object)