#include <service_isolate.h>
Definition at line 20 of file service_isolate.h.
◆ State
Enumerator |
---|
kStopped | |
kStarting | |
kStarted | |
kStopping | |
Definition at line 88 of file service_isolate.h.
◆ BootVmServiceLibrary()
void dart::ServiceIsolate::BootVmServiceLibrary |
( |
| ) |
|
|
static |
Definition at line 571 of file service_isolate.cc.
571 {
573 const Library& vmservice_library =
575 ASSERT(!vmservice_library.IsNull());
578 vmservice_library.LookupFunctionAllowPrivate(boot_function_name));
579 ASSERT(!boot_function.IsNull());
583 if (
result.IsUnwindError() ||
result.IsUnhandledException()) {
585 }
587 if (
result.IsReceivePort()) {
589 }
592}
static ObjectPtr InvokeFunction(const Function &function, const Array &arguments)
static DART_NORETURN void PropagateError(const Error &error)
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
static void SetServicePort(Dart_Port port)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static Thread * Current()
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
◆ ControlWebServer()
void dart::ServiceIsolate::ControlWebServer |
( |
const SendPort & |
sp, |
|
|
bool |
enable, |
|
|
const Bool & |
silenceOutput |
|
) |
| |
|
static |
Definition at line 121 of file service_isolate.cc.
123 {
129}
static bool PostMessage(std::unique_ptr< Message > message, bool before_events=false)
static ArrayPtr MakeServerControlMessage(const SendPort &sp, intptr_t code, bool enable, const Bool &silenceOutput)
std::unique_ptr< Message > WriteMessage(bool same_group, const Object &obj, Dart_Port dest_port, Message::Priority priority)
#define VM_SERVICE_WEB_SERVER_CONTROL_MESSAGE_ID
◆ create_group_callback()
Definition at line 82 of file service_isolate.h.
82 {
84 }
static Dart_IsolateGroupCreateCallback create_group_callback_
◆ Exists()
bool dart::ServiceIsolate::Exists |
( |
| ) |
|
|
static |
Definition at line 142 of file service_isolate.cc.
142 {
145}
static Monitor * monitor_
static Isolate * isolate_
◆ FinishedExiting()
void dart::ServiceIsolate::FinishedExiting |
( |
| ) |
|
|
staticprotected |
◆ FinishedInitializing()
void dart::ServiceIsolate::FinishedInitializing |
( |
| ) |
|
|
staticprotected |
◆ InitializingFailed()
void dart::ServiceIsolate::InitializingFailed |
( |
char * |
error | ) |
|
|
staticprotected |
Definition at line 336 of file service_isolate.cc.
336 {
342 ml.NotifyAll();
343}
static char * startup_failure_reason_
const uint8_t uint32_t uint32_t GError ** error
◆ IsRunning()
bool dart::ServiceIsolate::IsRunning |
( |
| ) |
|
|
static |
◆ IsServiceIsolate()
static bool dart::ServiceIsolate::IsServiceIsolate |
( |
const Isolate * |
isolate | ) |
|
|
static |
◆ IsServiceIsolateDescendant()
bool dart::ServiceIsolate::IsServiceIsolateDescendant |
( |
Isolate * |
isolate | ) |
|
|
static |
◆ MaybeMakeServiceIsolate()
void dart::ServiceIsolate::MaybeMakeServiceIsolate |
( |
Isolate * |
isolate | ) |
|
|
staticprotected |
Definition at line 304 of file service_isolate.cc.
304 {
309 if (!
I->is_service_isolate()) {
310
311 return;
312 }
314
315 return;
316 }
318}
static void SetServiceIsolate(Isolate *isolate)
◆ Port()
◆ RegisterRunningIsolates()
Definition at line 594 of file service_isolate.cc.
596 {
598 auto zone = thread->zone();
599
600 ASSERT(thread->isolate()->is_service_isolate());
601
602
603 const String& library_url = Symbols::DartVMService();
604 ASSERT(!library_url.IsNull());
605 const Library& library =
607 ASSERT(!library.IsNull());
611 const Function& register_function_ =
613 ASSERT(!register_function_.IsNull());
614
619
620 ASSERT(isolate_ports.
length() == isolate_names.length());
621 for (intptr_t
i = 0;
i < isolate_ports.
length(); ++
i) {
623 const String&
name = *isolate_names[
i];
624
627 args.SetAt(0, port_int);
628 args.SetAt(1, send_port);
631 if (FLAG_trace_service) {
633 name.ToCString(), port_id);
634 }
636 }
637}
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static SendPortPtr New(Dart_Port id, Heap::Space space=Heap::kNew)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const char *const function_name
◆ RequestServerInfo()
void dart::ServiceIsolate::RequestServerInfo |
( |
const SendPort & |
sp | ) |
|
|
static |
◆ Run()
void dart::ServiceIsolate::Run |
( |
| ) |
|
|
static |
Definition at line 489 of file service_isolate.cc.
489 {
490 {
494 ml.NotifyAll();
495 }
496
497
501 Utils::StrDup(
"The 'create_group' callback was not provided"));
502 return;
503 }
506}
static ThreadPool * thread_pool()
static Dart_IsolateGroupCreateCallback CreateGroupCallback()
friend class RunServiceTask
static void InitializingFailed(char *error)
bool Run(Args &&... args)
static char * StrDup(const char *s)
◆ SendIsolateShutdownMessage()
bool dart::ServiceIsolate::SendIsolateShutdownMessage |
( |
| ) |
|
|
static |
Definition at line 244 of file service_isolate.cc.
244 {
246 return false;
247 }
249 Isolate* isolate = thread->isolate();
250 if (isolate->is_vm_isolate()) {
251 return false;
252 }
253
254 Dart_Port main_port = isolate->main_port();
255 if (FLAG_trace_service) {
257 " deregistered.\n",
258 isolate->name(), main_port);
259 }
260 isolate->set_is_service_registered(false);
263 isolate->name());
264}
static bool SendServiceControlMessage(Thread *thread, Dart_Port port_id, intptr_t code, const char *name)
#define DART_VM_SERVICE_ISOLATE_NAME
#define VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID
◆ SendIsolateStartupMessage()
bool dart::ServiceIsolate::SendIsolateStartupMessage |
( |
| ) |
|
|
static |
Definition at line 221 of file service_isolate.cc.
221 {
223 return false;
224 }
226 Isolate* isolate = thread->isolate();
227 if (isolate->is_vm_isolate()) {
228 return false;
229 }
230
232 if (FLAG_trace_service) {
234 " registered.\n",
235 isolate->name(), main_port);
236 }
239 isolate->name());
240 isolate->set_is_service_registered(true);
242}
DART_EXPORT Dart_Port Dart_GetMainPortId()
#define VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID
◆ SendServiceControlMessage()
bool dart::ServiceIsolate::SendServiceControlMessage |
( |
Thread * |
thread, |
|
|
Dart_Port |
port_id, |
|
|
intptr_t |
code, |
|
|
const char * |
name |
|
) |
| |
|
static |
Definition at line 52 of file service_isolate.cc.
55 {
59
63
68
72
78
81 message.value.as_array.length = 4;
83
86}
std::unique_ptr< Message > WriteApiMessage(Zone *zone, Dart_CObject *obj, Dart_Port dest_port, Message::Priority priority)
struct _Dart_CObject::@86::@87 as_send_port
union _Dart_CObject::@86 value
◆ SendServiceExitMessage()
void dart::ServiceIsolate::SendServiceExitMessage |
( |
| ) |
|
|
static |
Definition at line 266 of file service_isolate.cc.
266 {
268 return;
269 }
270 if (FLAG_trace_service) {
272 ": sending service exit message.\n");
273 }
274
279
282 message.value.as_array.length = 1;
284
285 AllocOnlyStackZone zone;
288}
#define VM_SERVICE_ISOLATE_EXIT_MESSAGE_ID
◆ SendServiceRpc()
bool dart::ServiceIsolate::SendServiceRpc |
( |
uint8_t * |
request_json, |
|
|
intptr_t |
request_json_length, |
|
|
Dart_Port |
reply_port, |
|
|
char ** |
error |
|
) |
| |
|
static |
Definition at line 169 of file service_isolate.cc.
172 {
173
177
181 message.value.as_typed_data.length = request_json_length;
182 message.value.as_typed_data.values = request_json;
183
188
190 &opcode,
192 &send_port,
193 };
194
201 bool success = false;
204 if (!success &&
error !=
nullptr) {
206 }
207 } else {
208 if (
error !=
nullptr) {
211 "Service isolate failed to start up: %s.",
213 } else {
215 }
216 }
217 }
218 return success;
219}
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
static void WaitForServiceIsolateStartup()
@ Dart_CObject_kTypedData
DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject *message)
struct _Dart_CObject::@86::@89 as_array
struct _Dart_CObject ** values
#define VM_SERVICE_METHOD_CALL_FROM_NATIVE
#define ARRAY_SIZE(array)
◆ server_address()
static const char * dart::ServiceIsolate::server_address |
( |
| ) |
|
|
inlinestatic |
◆ SetServerAddress()
void dart::ServiceIsolate::SetServerAddress |
( |
const char * |
address | ) |
|
|
static |
Definition at line 131 of file service_isolate.cc.
131 {
135 }
136 if (address == nullptr) {
137 return;
138 }
140}
◆ SetServiceIsolate()
void dart::ServiceIsolate::SetServiceIsolate |
( |
Isolate * |
isolate | ) |
|
|
staticprotected |
◆ SetServicePort()
void dart::ServiceIsolate::SetServicePort |
( |
Dart_Port |
port | ) |
|
|
staticprotected |
◆ Shutdown()
void dart::ServiceIsolate::Shutdown |
( |
| ) |
|
|
static |
Definition at line 528 of file service_isolate.cc.
528 {
529 {
532 ml.Wait();
533 }
534 }
535
537 {
541 ml.NotifyAll();
542 }
544 {
547 ml.Wait();
548 }
550 }
551 } else {
553
554
555
556
557 KillServiceIsolate();
558 }
559 }
563 }
564
568 }
569}
static void SendServiceExitMessage()
◆ VisitObjectPointers()
◆ WaitForServiceIsolateStartup()
void dart::ServiceIsolate::WaitForServiceIsolateStartup |
( |
| ) |
|
|
static |
◆ Dart
◆ Isolate
◆ RunServiceTask
◆ ServiceIsolateNatives
friend class ServiceIsolateNatives |
|
friend |
◆ create_group_callback_
◆ isolate_
Isolate * dart::ServiceIsolate::isolate_ = nullptr |
|
staticprotected |
◆ kName
◆ monitor_
◆ origin_
◆ port_
◆ server_address_
char * dart::ServiceIsolate::server_address_ = nullptr |
|
staticprotected |
◆ startup_failure_reason_
char * dart::ServiceIsolate::startup_failure_reason_ = nullptr |
|
staticprotected |
◆ state_
The documentation for this class was generated from the following files: