Flutter Engine
The Flutter Engine
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
15namespace flutter {
16
18 public:
20
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_
bool RegisterIsolatePortWithName(Dart_PortEx port, const std::string &name)
Dart_PortEx LookupIsolatePortByName(const std::string &name)
bool RemoveIsolateNameMapping(const std::string &name)
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