Flutter Engine
The Flutter Engine
Public Types | Static Public Member Functions | List of all members
dart::bin::Process Class Reference

#include <process.h>

Public Types

typedef void(* ExitHook) (int64_t exit_code)
 

Static Public Member Functions

static void Init ()
 
static void Cleanup ()
 
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)
 
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 void TerminateExitCodeHandler ()
 
static int GlobalExitCode ()
 
static void SetGlobalExitCode (int exit_code)
 
static void SetExitHook (ExitHook hook)
 
static void RunExitHook (int64_t exit_code)
 
static intptr_t CurrentProcessId ()
 
static intptr_t SetSignalHandler (intptr_t signal)
 
static void ClearSignalHandler (intptr_t signal, Dart_Port port)
 
static void ClearSignalHandlerByFd (intptr_t fd, Dart_Port port)
 
static void ClearAllSignalHandlers ()
 
static Dart_Handle GetProcessIdNativeField (Dart_Handle process, intptr_t *pid)
 
static Dart_Handle SetProcessIdNativeField (Dart_Handle process, intptr_t pid)
 
static int64_t CurrentRSS ()
 
static int64_t MaxRSS ()
 
static void GetRSSInformation (int64_t *max_rss, int64_t *current_rss)
 
static bool ModeIsAttached (ProcessStartMode mode)
 
static bool ModeHasStdio (ProcessStartMode mode)
 

Detailed Description

Definition at line 88 of file process.h.

Member Typedef Documentation

◆ ExitHook

typedef void(* dart::bin::Process::ExitHook) (int64_t exit_code)

Definition at line 134 of file process.h.

Member Function Documentation

◆ Cleanup()

static void dart::bin::Process::Cleanup ( )
static

◆ ClearAllSignalHandlers()

void dart::bin::Process::ClearAllSignalHandlers ( )
static

Definition at line 70 of file process.cc.

70 {
71 for (intptr_t i = 1; i <= kLastSignal; i++) {
73 }
74}
static void ClearSignalHandler(intptr_t signal, Dart_Port port)
#define ILLEGAL_PORT
Definition: dart_api.h:1535
@ kLastSignal
Definition: process.h:77

◆ ClearSignalHandler()

static void dart::bin::Process::ClearSignalHandler ( intptr_t  signal,
Dart_Port  port 
)
static

◆ ClearSignalHandlerByFd()

static void dart::bin::Process::ClearSignalHandlerByFd ( intptr_t  fd,
Dart_Port  port 
)
static

◆ CurrentProcessId()

static intptr_t dart::bin::Process::CurrentProcessId ( )
static

◆ CurrentRSS()

static int64_t dart::bin::Process::CurrentRSS ( )
static

◆ GetProcessIdNativeField()

Dart_Handle dart::bin::Process::GetProcessIdNativeField ( Dart_Handle  process,
intptr_t *  pid 
)
static

Definition at line 318 of file process.cc.

319 {
321}
static constexpr int kProcessIdNativeField
Definition: process.cc:20
DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, int index, intptr_t *value)
static void process(const char *inPath, const char *lexer, const char *token, const char *hPath, const char *cppPath)
Definition: Main.cpp:114

◆ GetRSSInformation()

void dart::bin::Process::GetRSSInformation ( int64_t *  max_rss,
int64_t *  current_rss 
)
static

Definition at line 393 of file process.cc.

393 {
394 ASSERT(max_rss != nullptr);
395 ASSERT(current_rss != nullptr);
396 // Max RSS should be queried after current RSS to produce
397 // consistent values as current RSS can grow beyond max RSS which
398 // was queried before.
399 *current_rss = Process::CurrentRSS();
400 *max_rss = Process::MaxRSS();
401}
static int64_t CurrentRSS()
static int64_t MaxRSS()
#define ASSERT(E)

◆ GlobalExitCode()

static int dart::bin::Process::GlobalExitCode ( )
inlinestatic

Definition at line 124 of file process.h.

124 {
125 MutexLocker ml(global_exit_code_mutex_);
126 return global_exit_code_;
127 }

◆ Init()

static void dart::bin::Process::Init ( )
static

◆ Kill()

static bool dart::bin::Process::Kill ( intptr_t  id,
int  signal 
)
static

◆ MaxRSS()

static int64_t dart::bin::Process::MaxRSS ( )
static

◆ ModeHasStdio()

bool dart::bin::Process::ModeHasStdio ( ProcessStartMode  mode)
static

Definition at line 66 of file process.cc.

66 {
67 return (mode == kNormal) || (mode == kDetachedWithStdio);
68}
@ kNormal
Definition: process.h:82
@ kDetachedWithStdio
Definition: process.h:85
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
Definition: switches.h:228

◆ ModeIsAttached()

bool dart::bin::Process::ModeIsAttached ( ProcessStartMode  mode)
static

Definition at line 62 of file process.cc.

62 {
63 return (mode == kNormal) || (mode == kInheritStdio);
64}
@ kInheritStdio
Definition: process.h:83

◆ RunExitHook()

static void dart::bin::Process::RunExitHook ( int64_t  exit_code)
inlinestatic

Definition at line 136 of file process.h.

136 {
137 if (exit_hook_ != nullptr) {
138 exit_hook_(exit_code);
139 }
140 }

◆ SetExitHook()

static void dart::bin::Process::SetExitHook ( ExitHook  hook)
inlinestatic

Definition at line 135 of file process.h.

135{ exit_hook_ = hook; }

◆ SetGlobalExitCode()

static void dart::bin::Process::SetGlobalExitCode ( int  exit_code)
inlinestatic

Definition at line 129 of file process.h.

129 {
130 MutexLocker ml(global_exit_code_mutex_);
131 global_exit_code_ = exit_code;
132 }

◆ SetProcessIdNativeField()

Dart_Handle dart::bin::Process::SetProcessIdNativeField ( Dart_Handle  process,
intptr_t  pid 
)
static

Definition at line 323 of file process.cc.

324 {
326}
DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj, int index, intptr_t value)

◆ SetSignalHandler()

static intptr_t dart::bin::Process::SetSignalHandler ( intptr_t  signal)
static

◆ Start()

static int dart::bin::Process::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 
)
static

◆ TerminateExitCodeHandler()

static void dart::bin::Process::TerminateExitCodeHandler ( )
static

◆ Wait()

static bool dart::bin::Process::Wait ( intptr_t  id,
intptr_t  in,
intptr_t  out,
intptr_t  err,
intptr_t  exit_handler,
ProcessResult result 
)
static

The documentation for this class was generated from the following files: