Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
dart_runner::DartRunner Class Reference

#include <dart_runner.h>

Inheritance diagram for dart_runner::DartRunner:

Public Member Functions

 DartRunner (sys::ComponentContext *context)
 
 ~DartRunner () override
 
void handle_unknown_method (uint64_t ordinal, bool method_has_response) override
 

Detailed Description

Definition at line 17 of file dart_runner.h.

Constructor & Destructor Documentation

◆ DartRunner()

dart_runner::DartRunner::DartRunner ( sys::ComponentContext *  context)
explicit

Definition at line 184 of file dart_runner.cc.

184 : context_(context) {
185 context_->outgoing()
186 ->AddPublicService<fuchsia::component::runner::ComponentRunner>(
187 [this](fidl::InterfaceRequest<
188 fuchsia::component::runner::ComponentRunner> request) {
189 component_runner_bindings_.AddBinding(this, std::move(request));
190 });
191
192#if !defined(DART_PRODUCT)
193 // The VM service isolate uses the process-wide namespace. It writes the
194 // vm service protocol port under /tmp. The VMServiceObject exposes that
195 // port number to The Hub.
196 context_->outgoing()->debug_dir()->AddEntry(
198 std::make_unique<dart_utils::VMServiceObject>());
199
200#endif // !defined(DART_PRODUCT)
201
202 dart::bin::BootstrapDartIo();
203
204 char* error =
205 Dart_SetVMFlags(dart_utils::ArraySize(kDartVMArgs), kDartVMArgs);
206 if (error) {
207 FML_LOG(FATAL) << "Dart_SetVMFlags failed: " << error;
208 }
209
210 Dart_InitializeParams params = {};
211 params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION;
212 params.create_group = IsolateGroupCreateCallback;
213 params.shutdown_isolate = IsolateShutdownCallback;
214 params.cleanup_group = IsolateGroupCleanupCallback;
215 params.entropy_source = EntropySource;
216 error = Dart_Initialize(&params);
217 if (error)
218 FML_LOG(FATAL) << "Dart_Initialize failed: " << error;
219}
static constexpr const char * kPortDirName
const EmbeddedViewParams * params
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
Definition logging.h:101
size_t ArraySize(T(&array)[SIZE])
Definition inlines.h:11
std::shared_ptr< ContextGLES > context

References dart_utils::ArraySize(), error, FML_LOG, dart_utils::VMServiceObject::kPortDirName, and params.

◆ ~DartRunner()

dart_runner::DartRunner::~DartRunner ( )
override

Definition at line 221 of file dart_runner.cc.

221 {
222 char* error = Dart_Cleanup();
223 if (error)
224 FML_LOG(FATAL) << "Dart_Cleanup failed: " << error;
225}

References error, and FML_LOG.

Member Function Documentation

◆ handle_unknown_method()

void dart_runner::DartRunner::handle_unknown_method ( uint64_t  ordinal,
bool  method_has_response 
)
override

Definition at line 261 of file dart_runner.cc.

262 {
263 FML_LOG(ERROR) << "Unknown method called on DartRunner. Ordinal: "
264 << ordinal;
265}

References FML_LOG.


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