Flutter Engine
The Flutter Engine
|
Utility methods for interacting with the DartVM managed service isolate present in debug and profile runtime modes. More...
#include <dart_service_isolate.h>
Public Types | |
using | CallbackHandle = ptrdiff_t |
using | DartVMServiceServerStateCallback = std::function< void(const std::string &vm_service_uri)> |
Static Public Member Functions | |
static bool | Startup (const std::string &server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, bool disable_origin_check, bool disable_service_auth_codes, bool enable_service_port_fallback, char **error) |
Start the service isolate. This call may only be made in the Dart VM initiated isolate creation callback. It is only valid to make this call when the VM explicitly requests the creation of the service isolate. The VM does this by specifying the script URI to be DART_VM_SERVICE_ISOLATE_NAME . The isolate to be designated as the service isolate must already be created (but not running) when this call is made. More... | |
static CallbackHandle | AddServerStatusCallback (const DartVMServiceServerStateCallback &callback) |
Add a callback that will get invoked when the VM Service starts up. If the VM Service has already started before this call is made, the callback is invoked immediately. More... | |
static bool | RemoveServerStatusCallback (CallbackHandle handle) |
Removed a callback previously registered via AddServiceStatusCallback . More... | |
Utility methods for interacting with the DartVM managed service isolate present in debug and profile runtime modes.
Definition at line 22 of file dart_service_isolate.h.
using flutter::DartServiceIsolate::CallbackHandle = ptrdiff_t |
The handle used to refer to callbacks registered with the service isolate.
Definition at line 27 of file dart_service_isolate.h.
using flutter::DartServiceIsolate::DartVMServiceServerStateCallback = std::function<void(const std::string& vm_service_uri)> |
A callback made by the Dart VM when the VM Service is ready. The argument indicates the VM Service URI.
Definition at line 33 of file dart_service_isolate.h.
|
static |
Add a callback that will get invoked when the VM Service starts up. If the VM Service has already started before this call is made, the callback is invoked immediately.
This method is thread safe.
[in] | callback | The callback with information about the VM Service. |
RemoveServerStatusCallback
. Definition at line 84 of file dart_service_isolate.cc.
|
static |
Removed a callback previously registered via AddServiceStatusCallback
.
This method is thread safe.
[in] | handle | The handle |
Definition at line 108 of file dart_service_isolate.cc.
|
static |
Start the service isolate. This call may only be made in the Dart VM initiated isolate creation callback. It is only valid to make this call when the VM explicitly requests the creation of the service isolate. The VM does this by specifying the script URI to be DART_VM_SERVICE_ISOLATE_NAME
. The isolate to be designated as the service isolate must already be created (but not running) when this call is made.
[in] | server_ip | The service protocol IP address. |
[in] | server_port | The service protocol port. |
[in] | embedder_tag_handler | The library tag handler. |
[in] | disable_origin_check | If websocket origin checks must be enabled. |
[in] | disable_service_auth_codes | If service auth codes must be enabled. |
[in] | enable_service_port_fallback | If fallback to port 0 must be enabled when the bind fails. |
error | The error when this method returns false. This string must be freed by the caller using free . |
error
for details on failure. Definition at line 129 of file dart_service_isolate.cc.