未验证 提交 8cdfd674 编写于 作者: A Alhaad Gokhale 提交者: GitHub

[fuchsia] Rename 'namespace app' to 'namespace component'. (#4806)

上级 1348ab5b
......@@ -16,7 +16,7 @@
namespace flutter_runner {
AccessibilityBridge::AccessibilityBridge(app::ApplicationContext* context)
AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context)
: writer_(context->ConnectToEnvironmentService<maxwell::ContextWriter>()) {}
void AccessibilityBridge::UpdateSemantics(
......
......@@ -17,7 +17,7 @@ namespace flutter_runner {
// with the Context Service.
class AccessibilityBridge {
public:
explicit AccessibilityBridge(app::ApplicationContext* context);
explicit AccessibilityBridge(component::ApplicationContext* context);
// Update the internal representation of the semantics nodes, and write the
// semantics to Context Service.
......
......@@ -38,7 +38,7 @@ std::string GetLabelFromURL(const std::string& url) {
App::App() {
g_app = this;
context_ = app::ApplicationContext::CreateFromStartupInfo();
context_ = component::ApplicationContext::CreateFromStartupInfo();
gpu_thread_ = std::make_unique<fsl::Thread>();
io_thread_ = std::make_unique<fsl::Thread>();
......@@ -79,8 +79,8 @@ App::App() {
sk_make_sp<txt::FuchsiaFontManager>(std::move(font_provider)));
}
context_->outgoing_services()->AddService<app::ApplicationRunner>(
[this](f1dl::InterfaceRequest<app::ApplicationRunner> request) {
context_->outgoing_services()->AddService<component::ApplicationRunner>(
[this](f1dl::InterfaceRequest<component::ApplicationRunner> request) {
runner_bindings_.AddBinding(this, std::move(request));
});
}
......@@ -130,9 +130,9 @@ void App::WaitForPlatformViewsIdsUIThread(
}
void App::StartApplication(
app::ApplicationPackagePtr application,
app::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<app::ApplicationController> controller) {
component::ApplicationPackagePtr application,
component::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<component::ApplicationController> controller) {
if (controllers_.empty()) {
// Name this process after the url of the first application being launched.
base_label_ = "flutter:" + GetLabelFromURL(startup_info->launch_info->url);
......
......@@ -17,19 +17,19 @@
namespace flutter_runner {
class App : public app::ApplicationRunner {
class App : public component::ApplicationRunner {
public:
App();
~App();
static App& Shared();
// |app::ApplicationRunner| implementation:
// |component::ApplicationRunner| implementation:
void StartApplication(
app::ApplicationPackagePtr application,
app::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<app::ApplicationController> controller) override;
component::ApplicationPackagePtr application,
component::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<component::ApplicationController> controller) override;
void Destroy(ApplicationControllerImpl* controller);
......@@ -47,10 +47,10 @@ class App : public app::ApplicationRunner {
fxl::AutoResetWaitableEvent* latch);
void UpdateProcessLabel();
std::unique_ptr<app::ApplicationContext> context_;
std::unique_ptr<component::ApplicationContext> context_;
std::unique_ptr<fsl::Thread> gpu_thread_;
std::unique_ptr<fsl::Thread> io_thread_;
f1dl::BindingSet<app::ApplicationRunner> runner_bindings_;
f1dl::BindingSet<component::ApplicationRunner> runner_bindings_;
std::unordered_map<ApplicationControllerImpl*,
std::unique_ptr<ApplicationControllerImpl>>
controllers_;
......
......@@ -19,9 +19,9 @@ namespace flutter_runner {
ApplicationControllerImpl::ApplicationControllerImpl(
App* app,
app::ApplicationPackagePtr application,
app::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<app::ApplicationController> controller)
component::ApplicationPackagePtr application,
component::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<component::ApplicationController> controller)
: app_(app), binding_(this) {
if (controller.is_valid()) {
binding_.Bind(std::move(controller));
......@@ -52,7 +52,7 @@ ApplicationControllerImpl::ApplicationControllerImpl(
view_provider_bindings_.AddBinding(this, std::move(request));
});
app::ServiceProviderPtr service_provider;
component::ServiceProviderPtr service_provider;
auto request = service_provider.NewRequest();
service_provider_bridge_.set_backend(std::move(service_provider));
......@@ -66,7 +66,7 @@ ApplicationControllerImpl::ApplicationControllerImpl(
runtime_holder_.reset(new RuntimeHolder());
runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); });
runtime_holder_->Init(
fdio_ns, app::ApplicationContext::CreateFrom(std::move(startup_info)),
fdio_ns, component::ApplicationContext::CreateFrom(std::move(startup_info)),
std::move(request), std::move(bundle));
}
......@@ -75,7 +75,7 @@ ApplicationControllerImpl::~ApplicationControllerImpl() = default;
constexpr char kServiceRootPath[] = "/svc";
fdio_ns_t* ApplicationControllerImpl::SetupNamespace(
const app::FlatNamespacePtr& flat) {
const component::FlatNamespacePtr& flat) {
fdio_ns_t* fdio_namespc;
zx_status_t status = fdio_ns_create(&fdio_namespc);
if (status != ZX_OK) {
......@@ -126,7 +126,7 @@ void ApplicationControllerImpl::SendReturnCode(int32_t return_code) {
void ApplicationControllerImpl::CreateView(
f1dl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
f1dl::InterfaceRequest<app::ServiceProvider> services) {
f1dl::InterfaceRequest<component::ServiceProvider> services) {
runtime_holder_->CreateView(url_, std::move(view_owner_request),
std::move(services));
}
......
......@@ -24,18 +24,18 @@ namespace flutter_runner {
class App;
class RuntimeHolder;
class ApplicationControllerImpl : public app::ApplicationController,
class ApplicationControllerImpl : public component::ApplicationController,
public mozart::ViewProvider {
public:
ApplicationControllerImpl(
App* app,
app::ApplicationPackagePtr application,
app::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<app::ApplicationController> controller);
component::ApplicationPackagePtr application,
component::ApplicationStartupInfoPtr startup_info,
f1dl::InterfaceRequest<component::ApplicationController> controller);
~ApplicationControllerImpl() override;
// |app::ApplicationController| implementation
// |component::ApplicationController| implementation
void Kill() override;
void Detach() override;
......@@ -45,7 +45,7 @@ class ApplicationControllerImpl : public app::ApplicationController,
void CreateView(
f1dl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
f1dl::InterfaceRequest<app::ServiceProvider> services) override;
f1dl::InterfaceRequest<component::ServiceProvider> services) override;
Dart_Port GetUIIsolateMainPort();
std::string GetUIIsolateName();
......@@ -54,12 +54,12 @@ class ApplicationControllerImpl : public app::ApplicationController,
void StartRuntimeIfReady();
void SendReturnCode(int32_t return_code);
fdio_ns_t* SetupNamespace(const app::FlatNamespacePtr& flat);
fdio_ns_t* SetupNamespace(const component::FlatNamespacePtr& flat);
App* app_;
f1dl::Binding<app::ApplicationController> binding_;
f1dl::Binding<component::ApplicationController> binding_;
app::ServiceProviderBridge service_provider_bridge_;
component::ServiceProviderBridge service_provider_bridge_;
f1dl::BindingSet<mozart::ViewProvider> view_provider_bindings_;
......
......@@ -110,8 +110,8 @@ RuntimeHolder::~RuntimeHolder() {
void RuntimeHolder::Init(
fdio_ns_t* namespc,
std::unique_ptr<app::ApplicationContext> context,
f1dl::InterfaceRequest<app::ServiceProvider> outgoing_services,
std::unique_ptr<component::ApplicationContext> context,
f1dl::InterfaceRequest<component::ServiceProvider> outgoing_services,
std::vector<char> bundle) {
FXL_DCHECK(!rasterizer_);
rasterizer_ = Rasterizer::Create();
......@@ -194,7 +194,7 @@ void RuntimeHolder::Init(
void RuntimeHolder::CreateView(
const std::string& script_uri,
f1dl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
f1dl::InterfaceRequest<app::ServiceProvider> services) {
f1dl::InterfaceRequest<component::ServiceProvider> services) {
if (view_listener_binding_.is_bound()) {
// TODO(jeffbrown): Refactor this to support multiple view instances
// sharing the same underlying root bundle (but with different runtimes).
......@@ -228,7 +228,7 @@ void RuntimeHolder::CreateView(
std::move(export_token), // export token
script_uri // diagnostic label
);
app::ServiceProviderPtr view_services;
component::ServiceProviderPtr view_services;
view_->GetServiceProvider(view_services.NewRequest());
// Listen for input events.
......@@ -444,12 +444,12 @@ void RuntimeHolder::InitDartIoInternal() {
}
void RuntimeHolder::InitFuchsia() {
f1dl::InterfaceHandle<app::ApplicationEnvironment> environment;
f1dl::InterfaceHandle<component::ApplicationEnvironment> environment;
context_->ConnectToEnvironmentService(environment.NewRequest());
fuchsia::dart::Initialize(std::move(environment),
std::move(outgoing_services_));
app::ServiceProviderPtr parent_env_service_provider;
component::ServiceProviderPtr parent_env_service_provider;
context_->environment()->GetServices(
parent_env_service_provider.NewRequest());
ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest());
......
......@@ -47,12 +47,12 @@ class RuntimeHolder : public blink::RuntimeDelegate,
~RuntimeHolder();
void Init(fdio_ns_t* namespc,
std::unique_ptr<app::ApplicationContext> context,
f1dl::InterfaceRequest<app::ServiceProvider> outgoing_services,
std::unique_ptr<component::ApplicationContext> context,
f1dl::InterfaceRequest<component::ServiceProvider> outgoing_services,
std::vector<char> bundle);
void CreateView(const std::string& script_uri,
f1dl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
f1dl::InterfaceRequest<app::ServiceProvider> services);
f1dl::InterfaceRequest<component::ServiceProvider> services);
Dart_Port GetUIIsolateMainPort();
std::string GetUIIsolateName();
......@@ -111,8 +111,8 @@ class RuntimeHolder : public blink::RuntimeDelegate,
fdio_ns_t* namespc_;
int dirfd_;
std::unique_ptr<app::ApplicationContext> context_;
f1dl::InterfaceRequest<app::ServiceProvider> outgoing_services_;
std::unique_ptr<component::ApplicationContext> context_;
f1dl::InterfaceRequest<component::ServiceProvider> outgoing_services_;
std::vector<char> root_bundle_data_;
// TODO(zarah): Remove asset_store_ when flx is completely removed
fxl::RefPtr<blink::ZipAssetStore> asset_store_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册