5#ifndef RUNTIME_BIN_PROCESS_H_
6#define RUNTIME_BIN_PROCESS_H_
16#if !defined(DART_HOST_OS_WINDOWS)
42 DISALLOW_ALLOCATION();
98 intptr_t arguments_length,
99 const char* working_directory,
101 intptr_t environment_length,
107 intptr_t* exit_handler,
108 char** os_error_message);
114 intptr_t exit_handler,
118 static bool Kill(intptr_t
id,
int signal);
126 return global_exit_code_;
131 global_exit_code_ = exit_code;
137 if (exit_hook_ !=
nullptr) {
138 exit_hook_(exit_code);
165 static int global_exit_code_;
166 static Mutex* global_exit_code_mutex_;
169 DISALLOW_ALLOCATION();
170 DISALLOW_IMPLICIT_CONSTRUCTORS(
Process);
188 if (next_ !=
nullptr) {
196 if (prev_ !=
nullptr) {
197 prev_->next_ = next_;
199 if (next_ !=
nullptr) {
200 next_->prev_ = prev_;
204 intptr_t
fd()
const {
return fd_; }
205 intptr_t
signal()
const {
return signal_; }
233 data_ =
new uint8_t[
size];
240 bool Valid()
const {
return data_ !=
nullptr; }
242 uint8_t*
data()
const {
return data_; }
255 : head_(nullptr), tail_(nullptr), data_size_(0), free_size_(0) {}
265 intptr_t buffer_position = 0;
275 current = current->
next()) {
287 bool IsEmpty()
const {
return (head_ ==
nullptr) && (tail_ ==
nullptr); }
294 if ((node ==
nullptr) || !node->
Valid()) {
299 if (head_ ==
nullptr) {
313 while (current !=
nullptr) {
315 current = current->
next();
340 BufferListNode* head_;
341 BufferListNode* tail_;
352#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) || \
353 defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS)
354class BufferList :
public BufferListBase {
358 bool Read(
int fd, intptr_t available) {
360 while (available > 0) {
361 if (free_size() == 0) {
370#if defined(DART_HOST_OS_FUCHSIA)
372 read(fd,
reinterpret_cast<void*
>(FreeSpaceAddress()), block_size));
375 read(fd,
reinterpret_cast<void*
>(FreeSpaceAddress()), block_size));
380 set_data_size(data_size() + bytes);
381 set_free_size(free_size() - bytes);
static bool read(SkStream *stream, void *buffer, size_t amount)
static const size_t kBufferSize
#define DEBUG_ASSERT(cond)
static T Minimum(T x, T y)
void set_next(BufferListNode *n)
BufferListNode(intptr_t size)
BufferListNode * next() const
BufferListNode * tail() const
static constexpr intptr_t kBufferSize
uint8_t * FreeSpaceAddress()
intptr_t free_size() const
intptr_t data_size() const
void set_free_size(intptr_t size)
BufferListNode * head() const
void set_data_size(intptr_t size)
static Dart_Handle NewDartOSError()
static Dart_Handle Allocate(intptr_t size, uint8_t **buffer)
Dart_Handle stderr_data()
void set_stdout_data(Dart_Handle stdout_data)
void set_stderr_data(Dart_Handle stderr_data)
Dart_Handle stdout_data()
void set_exit_code(intptr_t exit_code)
static bool ModeIsAttached(ProcessStartMode mode)
static void ClearSignalHandler(intptr_t signal, Dart_Port port)
static void ClearSignalHandlerByFd(intptr_t fd, Dart_Port port)
static void SetGlobalExitCode(int exit_code)
static bool ModeHasStdio(ProcessStartMode mode)
static Dart_Handle GetProcessIdNativeField(Dart_Handle process, intptr_t *pid)
static int64_t CurrentRSS()
static void GetRSSInformation(int64_t *max_rss, int64_t *current_rss)
static intptr_t CurrentProcessId()
static void TerminateExitCodeHandler()
static int GlobalExitCode()
static bool Wait(intptr_t id, intptr_t in, intptr_t out, intptr_t err, intptr_t exit_handler, ProcessResult *result)
static bool Kill(intptr_t id, int signal)
static intptr_t SetSignalHandler(intptr_t signal)
static void SetExitHook(ExitHook hook)
static Dart_Handle SetProcessIdNativeField(Dart_Handle process, intptr_t pid)
void(* ExitHook)(int64_t exit_code)
static void ClearAllSignalHandlers()
static void RunExitHook(int64_t exit_code)
static int Start(Namespace *namespc, const char *path, char *arguments[], intptr_t arguments_length, const char *working_directory, char *environment[], intptr_t environment_length, ProcessStartMode mode, intptr_t *in, intptr_t *out, intptr_t *err, intptr_t *id, intptr_t *exit_handler, char **os_error_message)
SignalInfo(intptr_t fd, intptr_t signal, sa_handler_t oldact, SignalInfo *next)
SignalInfo * next() const
sa_handler_t oldact() const
struct _Dart_Handle * Dart_Handle
SK_API bool Read(SkStreamSeekable *src, SkDocumentPage *dstArray, int dstArrayCount, const SkDeserialProcs *=nullptr)
void(* sa_handler_t)(int)
static dart::SimpleHashMap * environment
DART_EXPORT Dart_Port Dart_GetMainPortId()
static void * Allocate(uword size, Zone *zone)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
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 port
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
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
bool EMSCRIPTEN_KEEPALIVE IsEmpty(const SkPath &path)
#define NO_RETRY_EXPECTED(expression)
#define TEMP_FAILURE_RETRY(expression)
static void process(const char *inPath, const char *lexer, const char *token, const char *hPath, const char *cppPath)