Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
flutter::IsolateNameServerNatives Class Reference

#include <isolate_name_server_natives.h>

Static Public Member Functions

static Dart_Handle LookupPortByName (const std::string &name)
 
static bool RegisterPortWithName (Dart_Handle port_handle, const std::string &name)
 
static bool RemovePortNameMapping (const std::string &name)
 

Detailed Description

Definition at line 14 of file isolate_name_server_natives.h.

Member Function Documentation

◆ LookupPortByName()

Dart_Handle flutter::IsolateNameServerNatives::LookupPortByName ( const std::string &  name)
static

Definition at line 16 of file isolate_name_server_natives.cc.

17 {
18 auto name_server = UIDartState::Current()->GetIsolateNameServer();
19 if (!name_server) {
20 return Dart_Null();
21 }
22 Dart_Port port = name_server->LookupIsolatePortByName(name);
23 if (port == ILLEGAL_PORT) {
24 return Dart_Null();
25 }
26 return Dart_NewSendPort(port);
27}
std::shared_ptr< IsolateNameServer > GetIsolateNameServer() const
static UIDartState * Current()
#define ILLEGAL_PORT
Definition dart_api.h:1530
DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id)
int64_t Dart_Port
Definition dart_api.h:1524
DART_EXPORT Dart_Handle Dart_Null(void)
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
Definition switches.h:87
DEF_SWITCHES_START aot vmservice shared library name
Definition switches.h:32

◆ RegisterPortWithName()

bool flutter::IsolateNameServerNatives::RegisterPortWithName ( Dart_Handle  port_handle,
const std::string &  name 
)
static

Definition at line 29 of file isolate_name_server_natives.cc.

30 {
31 auto name_server = UIDartState::Current()->GetIsolateNameServer();
32 if (!name_server) {
33 return false;
34 }
36 Dart_SendPortGetId(port_handle, &port);
37 if (!name_server->RegisterIsolatePortWithName(port, name)) {
38 return false;
39 }
40 return true;
41}
DART_EXPORT Dart_Handle Dart_SendPortGetId(Dart_Handle port, Dart_Port *port_id)

◆ RemovePortNameMapping()

bool flutter::IsolateNameServerNatives::RemovePortNameMapping ( const std::string &  name)
static

Definition at line 43 of file isolate_name_server_natives.cc.

43 {
44 auto name_server = UIDartState::Current()->GetIsolateNameServer();
45 if (!name_server || !name_server->RemoveIsolateNameMapping(name)) {
46 return false;
47 }
48 return true;
49}

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