Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
10
11namespace dart {
12namespace 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.
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.
27void Cleanup();
28
29// Common arguments that are passed to isolate creation callback and to
30// API methods that create isolates.
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.
41
42 // Isolate group callback data.
44
45 // Isolate callback 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).
56 const uint8_t* buffer,
57 intptr_t buffer_size,
58 char** error);
59
60// Service isolate configuration.
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.
73
74 // TODO(vegorov) document these ones.
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.
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.
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_
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
#define DART_WARN_UNUSED_RESULT
Definition dart_api.h:66
struct _Dart_Isolate * Dart_Isolate
Definition dart_api.h:88
static const uint8_t buffer[]
const uint8_t uint32_t uint32_t GError ** error
bool InitOnce(char **error)
Dart_Isolate CreateVmServiceIsolateFromKernel(const IsolateCreationData &data, const VmServiceConfiguration &config, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size, char **error)
Dart_Isolate CreateKernelServiceIsolate(const IsolateCreationData &data, const uint8_t *buffer, intptr_t buffer_size, char **error)
Dart_Isolate CreateVmServiceIsolate(const IsolateCreationData &data, const VmServiceConfiguration &config, const uint8_t *isolate_data, const uint8_t *isolate_instr, char **error)
static int8_t data[kExtLength]