Flutter Engine
 
Loading...
Searching...
No Matches
flutter_runner::ComponentV2 Class Referencefinal

#include <component_v2.h>

Inheritance diagram for flutter_runner::ComponentV2:
flutter_runner::Engine::Delegate

Public Types

using TerminationCallback = fit::function< void(const ComponentV2 *)>
 

Public Member Functions

 ~ComponentV2 ()
 
const std::string & GetDebugLabel () const
 
void WriteProfileToTrace () const
 
void handle_unknown_method (uint64_t ordinal, bool method_has_response) override
 

Static Public Member Functions

static ActiveComponentV2 Create (TerminationCallback termination_callback, fuchsia::component::runner::ComponentStartInfo start_info, std::shared_ptr< sys::ServiceDirectory > runner_incoming_services, fidl::InterfaceRequest< fuchsia::component::runner::ComponentController > controller)
 
static ProgramMetadata ParseProgramMetadata (const fuchsia::data::Dictionary &program_metadata)
 

Detailed Description

Definition at line 56 of file component_v2.h.

Member Typedef Documentation

◆ TerminationCallback

Definition at line 61 of file component_v2.h.

Constructor & Destructor Documentation

◆ ~ComponentV2()

flutter_runner::ComponentV2::~ComponentV2 ( )
default

Member Function Documentation

◆ Create()

ActiveComponentV2 flutter_runner::ComponentV2::Create ( TerminationCallback  termination_callback,
fuchsia::component::runner::ComponentStartInfo  start_info,
std::shared_ptr< sys::ServiceDirectory >  runner_incoming_services,
fidl::InterfaceRequest< fuchsia::component::runner::ComponentController >  controller 
)
static

Definition at line 129 of file component_v2.cc.

134 {
135 auto thread = std::make_unique<fml::Thread>();
136 std::unique_ptr<ComponentV2> component;
137
139 thread->GetTaskRunner()->PostTask([&]() mutable {
140 component.reset(
141 new ComponentV2(std::move(termination_callback), std::move(start_info),
142 runner_incoming_services, std::move(controller)));
143 latch.Signal();
144 });
145
146 latch.Wait();
147 return {.platform_thread = std::move(thread),
148 .component = std::move(component)};
149}

References fml::AutoResetWaitableEvent::Signal(), and fml::AutoResetWaitableEvent::Wait().

◆ GetDebugLabel()

const std::string & flutter_runner::ComponentV2::GetDebugLabel ( ) const

Definition at line 535 of file component_v2.cc.

535 {
536 return debug_label_;
537}

◆ handle_unknown_method()

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

Definition at line 664 of file component_v2.cc.

665 {
666 FML_LOG(ERROR) << "Unknown method called on ComponentV2. Ordinal: "
667 << ordinal;
668}
#define FML_LOG(severity)
Definition logging.h:101

References FML_LOG.

◆ ParseProgramMetadata()

ProgramMetadata flutter_runner::ComponentV2::ParseProgramMetadata ( const fuchsia::data::Dictionary &  program_metadata)
static

Parses the program metadata that was provided for the component.

|old_gen_heap_size| will be set to -1 if no value was specified.

Definition at line 107 of file component_v2.cc.

108 {
109 ProgramMetadata result;
110
111 for (const auto& entry : program_metadata.entries()) {
112 if (entry.key.compare(kDataKey) == 0 && entry.value != nullptr) {
113 result.data_path = "pkg/" + entry.value->str();
114 } else if (entry.key.compare(kAssetsKey) == 0 && entry.value != nullptr) {
115 result.assets_path = "pkg/" + entry.value->str();
116 } else if (entry.key.compare(kArgsKey) == 0 && entry.value != nullptr) {
117 ParseArgs(entry.value->str_vec(), &result);
118 }
119 }
120
121 // assets_path defaults to the same as data_path if omitted.
122 if (result.assets_path.empty()) {
123 result.assets_path = result.data_path;
124 }
125
126 return result;
127}
static constexpr char kArgsKey[]

References flutter_runner::ProgramMetadata::assets_path, flutter_runner::ProgramMetadata::data_path, and kArgsKey.

◆ WriteProfileToTrace()

void flutter_runner::ComponentV2::WriteProfileToTrace ( ) const

Definition at line 657 of file component_v2.cc.

657 {
658 for (const auto& engine : shell_holders_) {
659 engine->WriteProfileToTrace();
660 }
661}
FlutterEngine engine
Definition main.cc:84

References engine.


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