Flutter Engine
 
Loading...
Searching...
No Matches
dart_isolate_group_data.cc
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
6
7#include <utility>
8
10
11namespace flutter {
12
14 const Settings& settings,
15 fml::RefPtr<const DartSnapshot> isolate_snapshot,
16 std::string advisory_script_uri,
17 std::string advisory_script_entrypoint,
18 const ChildIsolatePreparer& child_isolate_preparer,
19 const fml::closure& isolate_create_callback,
20 const fml::closure& isolate_shutdown_callback,
21 std::shared_ptr<NativeAssetsManager> native_assets_manager)
22 : settings_(settings),
23 isolate_snapshot_(std::move(isolate_snapshot)),
24 advisory_script_uri_(std::move(advisory_script_uri)),
25 advisory_script_entrypoint_(std::move(advisory_script_entrypoint)),
26 child_isolate_preparer_(child_isolate_preparer),
27 isolate_create_callback_(isolate_create_callback),
28 isolate_shutdown_callback_(isolate_shutdown_callback),
29 native_assets_manager_(std::move(native_assets_manager)) {
30 FML_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot.";
31}
32
34
36 return settings_;
37}
38
43
45 return advisory_script_uri_;
46}
47
49 return advisory_script_entrypoint_;
50}
51
53 std::scoped_lock lock(child_isolate_preparer_mutex_);
54 return child_isolate_preparer_;
55}
56
58 return isolate_create_callback_;
59}
60
62 return isolate_shutdown_callback_;
63}
64
66 const ChildIsolatePreparer& value) {
67 std::scoped_lock lock(child_isolate_preparer_mutex_);
68 child_isolate_preparer_ = value;
69}
70
71std::shared_ptr<NativeAssetsManager>
73 return native_assets_manager_;
74}
75
77 int64_t root_isolate_token,
78 std::weak_ptr<PlatformMessageHandler> handler) {
79 std::scoped_lock lock(platform_message_handlers_mutex_);
80 platform_message_handlers_[root_isolate_token] = handler;
81}
82
83std::weak_ptr<PlatformMessageHandler>
85 int64_t root_isolate_token) const {
86 std::scoped_lock lock(platform_message_handlers_mutex_);
87 auto it = platform_message_handlers_.find(root_isolate_token);
88 return it == platform_message_handlers_.end()
89 ? std::weak_ptr<PlatformMessageHandler>()
90 : it->second;
91}
92
94 const std::shared_ptr<const fml::Mapping>& buffer) {
95 kernel_buffers_.push_back(buffer);
96}
97
98std::vector<std::shared_ptr<const fml::Mapping>>
100 return kernel_buffers_;
101}
102
103} // namespace flutter
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, std::shared_ptr< NativeAssetsManager > native_assets_manager=nullptr)
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
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 fml::closure & GetIsolateCreateCallback() const
std::shared_ptr< NativeAssetsManager > GetNativeAssetsManager() const
void AddKernelBuffer(const std::shared_ptr< const fml::Mapping > &buffer)
Adds a kernel buffer mapping to the kernels loaded for this isolate group.
int32_t value
Settings settings_
const gchar FlBinaryMessengerMessageHandler handler
#define FML_DCHECK(condition)
Definition logging.h:122
std::function< bool(DartIsolate *)> ChildIsolatePreparer
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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98
std::function< void()> closure
Definition closure.h:14
Definition ref_ptr.h:261