5#include "flutter/runtime/dart_isolate_group_data.h"
9#include "flutter/runtime/dart_snapshot.h"
16 std::string advisory_script_uri,
17 std::string advisory_script_entrypoint,
22 isolate_snapshot_(
std::move(isolate_snapshot)),
23 advisory_script_uri_(
std::move(advisory_script_uri)),
24 advisory_script_entrypoint_(
std::move(advisory_script_entrypoint)),
25 child_isolate_preparer_(child_isolate_preparer),
26 isolate_create_callback_(isolate_create_callback),
27 isolate_shutdown_callback_(isolate_shutdown_callback) {
28 FML_DCHECK(isolate_snapshot_) <<
"Must contain a valid isolate snapshot.";
39 return isolate_snapshot_;
43 return advisory_script_uri_;
47 return advisory_script_entrypoint_;
51 std::scoped_lock lock(child_isolate_preparer_mutex_);
52 return child_isolate_preparer_;
56 return isolate_create_callback_;
60 return isolate_shutdown_callback_;
65 std::scoped_lock lock(child_isolate_preparer_mutex_);
66 child_isolate_preparer_ =
value;
70 int64_t root_isolate_token,
71 std::weak_ptr<PlatformMessageHandler> handler) {
72 std::scoped_lock lock(platform_message_handlers_mutex_);
73 platform_message_handlers_[root_isolate_token] = handler;
76std::weak_ptr<PlatformMessageHandler>
78 int64_t root_isolate_token)
const {
79 std::scoped_lock lock(platform_message_handlers_mutex_);
80 auto it = platform_message_handlers_.find(root_isolate_token);
81 return it == platform_message_handlers_.end()
82 ? std::weak_ptr<PlatformMessageHandler>()
87 const std::shared_ptr<const fml::Mapping>&
buffer) {
88 kernel_buffers_.push_back(
buffer);
91std::vector<std::shared_ptr<const fml::Mapping>>
93 return kernel_buffers_;
fml::RefPtr< const DartSnapshot > GetIsolateSnapshot() const
const fml::closure & GetIsolateShutdownCallback() const
std::vector< std::shared_ptr< const fml::Mapping > > GetKernelBuffers() const
const std::string & GetAdvisoryScriptURI() const
DartIsolateGroupData(const Settings &settings, fml::RefPtr< const DartSnapshot > isolate_snapshot, std::string advisory_script_uri, std::string advisory_script_entrypoint, const ChildIsolatePreparer &child_isolate_preparer, const fml::closure &isolate_create_callback, const fml::closure &isolate_shutdown_callback)
const std::string & GetAdvisoryScriptEntrypoint() const
void SetChildIsolatePreparer(const ChildIsolatePreparer &value)
std::weak_ptr< PlatformMessageHandler > GetPlatformMessageHandler(int64_t root_isolate_token) const override
ChildIsolatePreparer GetChildIsolatePreparer() const
void SetPlatformMessageHandler(int64_t root_isolate_token, std::weak_ptr< PlatformMessageHandler > handler) override
const Settings & GetSettings() const
const fml::closure & GetIsolateCreateCallback() const
void AddKernelBuffer(const std::shared_ptr< const fml::Mapping > &buffer)
Adds a kernel buffer mapping to the kernels loaded for this isolate group.
#define FML_DCHECK(condition)
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 A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
std::function< bool(DartIsolate *)> ChildIsolatePreparer
std::function< void()> closure