Flutter Engine
The Flutter Engine
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
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)
Definition: dart_vm.cc:33
static int8_t data[kExtLength]
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126