Flutter Engine
 
Loading...
Searching...
No Matches
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 ()
 
void handle_unknown_method (uint64_t ordinal, bool method_has_response) override
 

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
183 SkGraphics::Init();
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)
196 if (Dart_IsPrecompiledRuntime()) {
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 inspect::Inspector * GetInspector()
void GetContents(LazyEntryVector *out_vector) const override
static constexpr const char * kPortDirName
const char * name
Definition fuchsia.cc:49
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

References dart_utils::VMServiceObject::GetContents(), dart_utils::RootInspectNode::GetInspector(), dart_utils::VMServiceObject::kPortDirName, name, flutter_runner::RegisterProfilerSymbols(), flutter_runner::SetProcessName(), and flutter_runner::SetThreadName().

◆ ~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}

Member Function Documentation

◆ handle_unknown_method()

void flutter_runner::Runner::handle_unknown_method ( uint64_t  ordinal,
bool  method_has_response 
)
override

Definition at line 346 of file runner.cc.

346 {
347 FML_LOG(ERROR) << "Unknown method called on Runner. Ordinal: " << ordinal;
348}
#define FML_LOG(severity)
Definition logging.h:101

References FML_LOG.


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