Flutter Engine
flutter::IsolateNameServerNatives Class Reference

#include <isolate_name_server_natives.h>

Static Public Member Functions

static Dart_Handle LookupPortByName (const std::string &name)
 
static Dart_Handle RegisterPortWithName (Dart_Handle port_handle, const std::string &name)
 
static Dart_Handle RemovePortNameMapping (const std::string &name)
 
static void RegisterNatives (tonic::DartLibraryNatives *natives)
 

Detailed Description

Definition at line 18 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.

References flutter::UIDartState::Current(), flutter::UIDartState::GetIsolateNameServer(), and flutter::port.

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 }
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory port
Definition: switches.h:75
const char * name
Definition: fuchsia.cc:50
std::shared_ptr< IsolateNameServer > GetIsolateNameServer() const
static UIDartState * Current()

◆ RegisterNatives()

void flutter::IsolateNameServerNatives::RegisterNatives ( tonic::DartLibraryNatives natives)
static

Definition at line 66 of file isolate_name_server_natives.cc.

References DART_REGISTER_NATIVE_STATIC_, FOR_EACH_BINDING, and tonic::DartLibraryNatives::Register().

Referenced by flutter::DartUI::InitForGlobal().

67  {
69 }
#define DART_REGISTER_NATIVE_STATIC_(CLASS, METHOD)
void Register(std::initializer_list< Entry > entries)
#define FOR_EACH_BINDING(V)

◆ RegisterPortWithName()

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

Definition at line 29 of file isolate_name_server_natives.cc.

References flutter::UIDartState::Current(), flutter::UIDartState::GetIsolateNameServer(), and flutter::port.

31  {
32  auto name_server = UIDartState::Current()->GetIsolateNameServer();
33  if (!name_server) {
34  return Dart_False();
35  }
36  Dart_Port port = ILLEGAL_PORT;
37  Dart_SendPortGetId(port_handle, &port);
38  if (!name_server->RegisterIsolatePortWithName(port, name)) {
39  return Dart_False();
40  }
41  return Dart_True();
42 }
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory port
Definition: switches.h:75
const char * name
Definition: fuchsia.cc:50
std::shared_ptr< IsolateNameServer > GetIsolateNameServer() const
static UIDartState * Current()

◆ RemovePortNameMapping()

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

Definition at line 44 of file isolate_name_server_natives.cc.

References flutter::UIDartState::Current(), and flutter::UIDartState::GetIsolateNameServer().

45  {
46  auto name_server = UIDartState::Current()->GetIsolateNameServer();
47  if (!name_server) {
48  return Dart_False();
49  }
50  if (!name_server->RemoveIsolateNameMapping(name)) {
51  return Dart_False();
52  }
53  return Dart_True();
54 }
const char * name
Definition: fuchsia.cc:50
std::shared_ptr< IsolateNameServer > GetIsolateNameServer() const
static UIDartState * Current()

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