Flutter Engine
Loading...
Searching...
No Matches
dart_invoke.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
5
#include "
tonic/logging/dart_invoke.h
"
6
7
#include "
tonic/common/macros.h
"
8
#include "
tonic/logging/dart_error.h
"
9
10
namespace
tonic
{
11
12
Dart_Handle
DartInvokeField
(Dart_Handle
target
,
13
const
char
*
name
,
14
std::initializer_list<Dart_Handle>
args
) {
15
Dart_Handle field = Dart_NewStringFromCString(
name
);
16
return
Dart_Invoke(
target
, field,
args
.size(),
17
const_cast<
Dart_Handle*
>
(
args
.begin()));
18
}
19
20
Dart_Handle
DartInvoke
(Dart_Handle closure,
21
std::initializer_list<Dart_Handle>
args
) {
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
}
28
29
Dart_Handle
DartInvokeVoid
(Dart_Handle closure) {
30
Dart_Handle handle = Dart_InvokeClosure(closure, 0,
nullptr
);
31
CheckAndHandleError
(handle);
32
return
handle;
33
}
34
35
}
// namespace tonic
dart_error.h
dart_invoke.h
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition
fl_event_channel.h:89
target
uint32_t * target
Definition
fl_texture_registrar_test.cc:41
name
const char * name
Definition
fuchsia.cc:49
argv
char ** argv
Definition
library.h:9
tonic
Definition
image_filter.h:15
tonic::DartInvoke
Dart_Handle DartInvoke(Dart_Handle closure, std::initializer_list< Dart_Handle > args)
Definition
dart_invoke.cc:20
tonic::DartInvokeVoid
Dart_Handle DartInvokeVoid(Dart_Handle closure)
Definition
dart_invoke.cc:29
tonic::CheckAndHandleError
bool CheckAndHandleError(Dart_Handle handle)
Definition
dart_error.cc:33
tonic::DartInvokeField
Dart_Handle DartInvokeField(Dart_Handle target, const char *name, std::initializer_list< Dart_Handle > args)
Definition
dart_invoke.cc:12
macros.h
third_party
tonic
logging
dart_invoke.cc
Generated on Wed Nov 5 2025 21:33:20 for Flutter Engine by
1.9.8