Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
include
dart_embedder_api.h
Go to the documentation of this file.
1
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#ifndef RUNTIME_INCLUDE_DART_EMBEDDER_API_H_
6
#define RUNTIME_INCLUDE_DART_EMBEDDER_API_H_
7
8
#include "
include/dart_api.h
"
9
#include "
include/dart_tools_api.h
"
10
11
namespace
dart
{
12
namespace
embedder {
13
14
// Initialize all subsystems of the embedder.
15
//
16
// Must be called before the `Dart_Initialize()` call to initialize the
17
// Dart VM.
18
//
19
// Returns true on success and false otherwise, in which case error would
20
// contain error message.
21
DART_WARN_UNUSED_RESULT
bool
InitOnce
(
char
**
error
);
22
23
// Cleans up all subsystems of the embedder.
24
//
25
// Must be called after the `Dart_Cleanup()` call to initialize the
26
// Dart VM.
27
void
Cleanup
();
28
29
// Common arguments that are passed to isolate creation callback and to
30
// API methods that create isolates.
31
struct
IsolateCreationData
{
32
// URI for the main script that will be running in the isolate.
33
const
char
*
script_uri
;
34
35
// Advisory name of the main method that will be run by isolate.
36
// Only used for error messages.
37
const
char
*
main
;
38
39
// Isolate creation flags. Might be absent.
40
Dart_IsolateFlags
*
flags
;
41
42
// Isolate group callback data.
43
void
*
isolate_group_data
;
44
45
// Isolate callback data.
46
void
*
isolate_data
;
47
};
48
49
// Create and initialize kernel-service isolate. This method should be used
50
// when VM invokes isolate creation callback with DART_KERNEL_ISOLATE_NAME as
51
// script_uri.
52
// The isolate is created from the given snapshot (might be kernel data or
53
// app-jit snapshot).
54
DART_WARN_UNUSED_RESULT
Dart_Isolate
55
CreateKernelServiceIsolate
(
const
IsolateCreationData
&
data
,
56
const
uint8_t*
buffer
,
57
intptr_t
buffer_size
,
58
char
**
error
);
59
60
// Service isolate configuration.
61
struct
VmServiceConfiguration
{
62
enum
{
kBindHttpServerToAFreePort
= 0,
kDoNotAutoStartHttpServer
= -1 };
63
64
// Address to which HTTP server will be bound.
65
const
char
*
ip
;
66
67
// Default port. See enum above for special values.
68
int
port
;
69
70
// If non-null, connection information for the VM service will be output to a
71
// file in JSON format at the location specified.
72
const
char
*
write_service_info_filename
;
73
74
// TODO(vegorov) document these ones.
75
bool
dev_mode
;
76
bool
deterministic
;
77
bool
disable_auth_codes
;
78
};
79
80
// Create and initialize vm-service isolate from the given AOT snapshot, which
81
// is expected to contain all necessary 'vm-service' libraries.
82
// This method should be used when VM invokes isolate creation callback with
83
// DART_VM_SERVICE_ISOLATE_NAME as script_uri.
84
DART_WARN_UNUSED_RESULT
Dart_Isolate
85
CreateVmServiceIsolate
(
const
IsolateCreationData
&
data
,
86
const
VmServiceConfiguration
& config,
87
const
uint8_t* isolate_data,
88
const
uint8_t* isolate_instr,
89
char
**
error
);
90
91
// Create and initialize vm-service isolate from the given kernel binary, which
92
// is expected to contain all necessary 'vm-service' libraries.
93
// This method should be used when VM invokes isolate creation callback with
94
// DART_VM_SERVICE_ISOLATE_NAME as script_uri.
95
DART_WARN_UNUSED_RESULT
Dart_Isolate
96
CreateVmServiceIsolateFromKernel
(
const
IsolateCreationData
&
data
,
97
const
VmServiceConfiguration
& config,
98
const
uint8_t* kernel_buffer,
99
intptr_t kernel_buffer_size,
100
char
**
error
);
101
102
}
// namespace embedder
103
}
// namespace dart
104
105
#endif
// RUNTIME_INCLUDE_DART_EMBEDDER_API_H_
buffer_size
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
Definition
GrMtlPipelineStateBuilder.mm:382
dart_api.h
DART_WARN_UNUSED_RESULT
#define DART_WARN_UNUSED_RESULT
Definition
dart_api.h:66
Dart_Isolate
struct _Dart_Isolate * Dart_Isolate
Definition
dart_api.h:88
dart_tools_api.h
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
error
const uint8_t uint32_t uint32_t GError ** error
Definition
fl_pixel_buffer_texture_test.cc:40
dart::embedder::InitOnce
bool InitOnce(char **error)
Definition
dart_embedder_api_impl.cc:34
dart::embedder::CreateVmServiceIsolateFromKernel
Dart_Isolate CreateVmServiceIsolateFromKernel(const IsolateCreationData &data, const VmServiceConfiguration &config, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size, char **error)
Definition
dart_embedder_api_impl.cc:124
dart::embedder::CreateKernelServiceIsolate
Dart_Isolate CreateKernelServiceIsolate(const IsolateCreationData &data, const uint8_t *buffer, intptr_t buffer_size, char **error)
Definition
dart_embedder_api_impl.cc:60
dart::embedder::Cleanup
void Cleanup()
Definition
dart_embedder_api_impl.cc:50
dart::embedder::CreateVmServiceIsolate
Dart_Isolate CreateVmServiceIsolate(const IsolateCreationData &data, const VmServiceConfiguration &config, const uint8_t *isolate_data, const uint8_t *isolate_instr, char **error)
Definition
dart_embedder_api_impl.cc:86
dart
Definition
dart_vm.cc:33
dart::data
static int8_t data[kExtLength]
Definition
dart_api_impl_test.cc:2256
Dart_IsolateFlags
Definition
dart_api.h:584
dart::embedder::IsolateCreationData
Definition
dart_embedder_api.h:31
dart::embedder::IsolateCreationData::isolate_data
void * isolate_data
Definition
dart_embedder_api.h:46
dart::embedder::IsolateCreationData::flags
Dart_IsolateFlags * flags
Definition
dart_embedder_api.h:40
dart::embedder::IsolateCreationData::main
const char * main
Definition
dart_embedder_api.h:37
dart::embedder::IsolateCreationData::isolate_group_data
void * isolate_group_data
Definition
dart_embedder_api.h:43
dart::embedder::IsolateCreationData::script_uri
const char * script_uri
Definition
dart_embedder_api.h:33
dart::embedder::VmServiceConfiguration
Definition
dart_embedder_api.h:61
dart::embedder::VmServiceConfiguration::write_service_info_filename
const char * write_service_info_filename
Definition
dart_embedder_api.h:72
dart::embedder::VmServiceConfiguration::deterministic
bool deterministic
Definition
dart_embedder_api.h:76
dart::embedder::VmServiceConfiguration::port
int port
Definition
dart_embedder_api.h:68
dart::embedder::VmServiceConfiguration::ip
const char * ip
Definition
dart_embedder_api.h:65
dart::embedder::VmServiceConfiguration::disable_auth_codes
bool disable_auth_codes
Definition
dart_embedder_api.h:77
dart::embedder::VmServiceConfiguration::kBindHttpServerToAFreePort
@ kBindHttpServerToAFreePort
Definition
dart_embedder_api.h:62
dart::embedder::VmServiceConfiguration::kDoNotAutoStartHttpServer
@ kDoNotAutoStartHttpServer
Definition
dart_embedder_api.h:62
dart::embedder::VmServiceConfiguration::dev_mode
bool dev_mode
Definition
dart_embedder_api.h:75
Generated on Fri Apr 26 2024 06:14:44 for Flutter Engine by
1.9.8