Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter_runner::Runner Class Referencefinal

#include <runner.h>

Inheritance diagram for flutter_runner::Runner:

Public Member Functions

 Runner (fml::RefPtr< fml::TaskRunner > task_runner, sys::ComponentContext *context)
 
 ~Runner ()
 

Detailed Description

Publishes the CF v2 runner service.

Each component will be run on a separate thread dedicated to that component.

TODO(fxb/50694): Add unit tests for CF v2.

Definition at line 31 of file runner.h.

Constructor & Destructor Documentation

◆ Runner()

flutter_runner::Runner::Runner ( fml::RefPtr< fml::TaskRunner task_runner,
sys::ComponentContext *  context 
)

Definition at line 153 of file runner.cc.

155 : task_runner_(task_runner), context_(context) {
156#if !defined(DART_PRODUCT)
157 // The VM service isolate uses the process-wide namespace. It writes the
158 // vm service protocol port under /tmp. The VMServiceObject exposes that
159 // port number to The Hub.
160 context_->outgoing()->debug_dir()->AddEntry(
162 std::make_unique<dart_utils::VMServiceObject>());
163
164 inspect::Inspector* inspector = dart_utils::RootInspectNode::GetInspector();
165 inspector->GetRoot().CreateLazyValues(
166 "vmservice_port",
167 [&]() {
168 inspect::Inspector inspector;
169 dart_utils::VMServiceObject::LazyEntryVector out;
171 std::string name = "";
172 if (!out.empty()) {
173 name = out[0].name;
174 }
175 inspector.GetRoot().CreateString("vm_service_port", name, &inspector);
176 return fpromise::make_ok_promise(inspector);
177 },
178 inspector);
179
180 SetupTraceObserver();
181#endif // !defined(DART_PRODUCT)
182
184
185 SetupICU();
186
188
189 SetThreadName("io.flutter.runner.main");
190
191 context_->outgoing()
192 ->AddPublicService<fuchsia::component::runner::ComponentRunner>(
193 std::bind(&Runner::RegisterComponentV2, this, std::placeholders::_1));
194
195#if !defined(DART_PRODUCT)
197 RegisterProfilerSymbols("pkg/data/flutter_aot_runner.dartprofilersymbols",
198 "");
199 } else {
200 RegisterProfilerSymbols("pkg/data/flutter_jit_runner.dartprofilersymbols",
201 "");
202 }
203#endif // !defined(DART_PRODUCT)
204}
static void Init()
Definition: SkGraphics.cpp:22
static inspect::Inspector * GetInspector()
void GetContents(LazyEntryVector *out_vector) const override
static constexpr const char * kPortDirName
DART_EXPORT bool Dart_IsPrecompiledRuntime(void)
static void SetThreadName(const std::string &thread_name)
Definition: runner.cc:135
static void RegisterProfilerSymbols(const char *symbols_path, const char *dso_name)
Definition: runner.cc:142
static void SetProcessName()
Definition: runner.cc:119
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ ~Runner()

flutter_runner::Runner::~Runner ( )

Definition at line 206 of file runner.cc.

206 {
207 context_->outgoing()
208 ->RemovePublicService<fuchsia::component::runner::ComponentRunner>();
209
210#if !defined(DART_PRODUCT)
211 trace_observer_->Stop();
212#endif // !defined(DART_PRODUCT)
213}

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