5#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_COMPONENT_V2_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_COMPONENT_V2_H_
12#include <fuchsia/component/runner/cpp/fidl.h>
13#include <fuchsia/io/cpp/fidl.h>
14#include <fuchsia/ui/app/cpp/fidl.h>
15#include <lib/async-loop/cpp/loop.h>
16#include <lib/async/default.h>
17#include <lib/fidl/cpp/binding_set.h>
18#include <lib/fidl/cpp/interface_request.h>
19#include <lib/fit/function.h>
20#include <lib/sys/cpp/service_directory.h>
21#include <lib/vfs/cpp/pseudo_dir.h>
22#include <lib/zx/eventpair.h>
24#include "flutter/common/settings.h"
25#include "flutter/fml/macros.h"
42 this->platform_thread.reset(other.platform_thread.release());
43 this->component.reset(other.component.release());
58 public fuchsia::component::runner::ComponentController,
59 public fuchsia::ui::app::ViewProvider {
68 fuchsia::component::runner::ComponentStartInfo start_info,
69 std::shared_ptr<sys::ServiceDirectory> runner_incoming_services,
70 fidl::InterfaceRequest<fuchsia::component::runner::ComponentController>
81 const fuchsia::data::Dictionary& program_metadata);
85#if !defined(DART_PRODUCT)
92 fuchsia::component::runner::ComponentStartInfo start_info,
93 std::shared_ptr<sys::ServiceDirectory> runner_incoming_services,
94 fidl::InterfaceRequest<fuchsia::component::runner::ComponentController>
107 void KillWithEpitaph(zx_status_t epitaph_status);
110 void Stop()
override;
113 void CreateView2(fuchsia::ui::app::CreateView2Args view_args)
override;
114 void CreateViewWithViewRef(
115 ::zx::eventpair token,
116 ::fuchsia::ui::views::ViewRefControl view_ref_control,
117 ::fuchsia::ui::views::ViewRef view_ref)
override {}
120 void OnEngineTerminate(
const Engine* holder)
override;
125 const std::string debug_label_;
130 fidl::Binding<fuchsia::component::runner::ComponentController>
131 component_controller_;
132 fuchsia::io::DirectoryPtr directory_ptr_;
133 fuchsia::io::NodePtr cloned_directory_ptr_;
134 fidl::InterfaceRequest<fuchsia::io::Directory> directory_request_;
135 std::unique_ptr<vfs::PseudoDir> outgoing_dir_;
136 std::unique_ptr<vfs::PseudoDir> runtime_dir_;
137 std::shared_ptr<sys::ServiceDirectory> svc_;
138 std::shared_ptr<sys::ServiceDirectory> runner_incoming_services_;
139 fidl::BindingSet<fuchsia::ui::app::ViewProvider> shells_bindings_;
142 std::set<std::unique_ptr<Engine>> shell_holders_;
143 std::pair<bool, uint32_t> last_return_code_;
void WriteProfileToTrace() const
static ProgramMetadata ParseProgramMetadata(const fuchsia::data::Dictionary &program_metadata)
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)
const std::string & GetDebugLabel() const
fit::function< void(const ComponentV2 *)> TerminationCallback
Dart_NativeFunction function
UniqueFDIONS UniqueFDIONSCreate()
std::unique_ptr< fml::Thread > platform_thread
ActiveComponentV2 & operator=(ActiveComponentV2 &&other) noexcept
std::unique_ptr< ComponentV2 > component
~ActiveComponentV2()=default