Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
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
 
virtual void OnEngineTerminate (const Engine *holder)=0
 

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 128 of file component_v2.cc.

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

◆ GetDebugLabel()

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

Definition at line 535 of file component_v2.cc.

535 {
536 return debug_label_;
537}

◆ 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 106 of file component_v2.cc.

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

◆ 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:68

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