Flutter Engine
Loading...
Searching...
No Matches
isolate_name_server.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_ISOLATE_NAME_SERVER_H_
6
#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_ISOLATE_NAME_SERVER_H_
7
8
#include <map>
9
#include <mutex>
10
#include <string>
11
12
#include "
flutter/fml/macros.h
"
13
#include "third_party/dart/runtime/include/dart_api.h"
14
15
namespace
flutter
{
16
17
class
IsolateNameServer
{
18
public
:
19
IsolateNameServer
();
20
21
~IsolateNameServer
();
22
23
// Looks up the Dart_Port associated with a given name. Returns ILLEGAL_PORT
24
// if the name does not exist.
25
Dart_PortEx
LookupIsolatePortByName
(
const
std::string&
name
);
26
27
// Registers a Dart_Port with a given name. Returns true if registration is
28
// successful, false if the name entry already exists.
29
bool
RegisterIsolatePortWithName
(Dart_PortEx port,
const
std::string&
name
);
30
31
// Removes a name to Dart_Port mapping given a name. Returns true if the
32
// mapping was successfully removed, false if the mapping does not exist.
33
bool
RemoveIsolateNameMapping
(
const
std::string&
name
);
34
35
private
:
36
Dart_PortEx LookupIsolatePortByNameUnprotected(
const
std::string&
name
);
37
38
mutable
std::mutex mutex_;
39
std::map<std::string, Dart_PortEx> port_mapping_;
40
41
FML_DISALLOW_COPY_AND_ASSIGN
(
IsolateNameServer
);
42
};
43
44
}
// namespace flutter
45
46
#endif
// FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_ISOLATE_NAME_SERVER_H_
flutter::IsolateNameServer
Definition
isolate_name_server.h:17
flutter::IsolateNameServer::RegisterIsolatePortWithName
bool RegisterIsolatePortWithName(Dart_PortEx port, const std::string &name)
Definition
isolate_name_server.cc:28
flutter::IsolateNameServer::LookupIsolatePortByName
Dart_PortEx LookupIsolatePortByName(const std::string &name)
Definition
isolate_name_server.cc:13
flutter::IsolateNameServer::RemoveIsolateNameMapping
bool RemoveIsolateNameMapping(const std::string &name)
Definition
isolate_name_server.cc:39
flutter::IsolateNameServer::IsolateNameServer
IsolateNameServer()
Definition
isolate_name_server.cc:9
flutter::IsolateNameServer::~IsolateNameServer
~IsolateNameServer()
macros.h
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
flutter
Definition
asset_manager.cc:10
flutter::name
DEF_SWITCHES_START aot vmservice shared library name
Definition
switch_defs.h:27
lib
ui
isolate_name_server
isolate_name_server.h
Generated on Thu Nov 6 2025 16:11:24 for Flutter Engine by
1.9.8