提交 8cad3eca 编写于 作者: J James Robinson 提交者: GitHub

Updates for modular->app rename of //application interfaces (#3414)

上级 588d6a47
...@@ -26,7 +26,7 @@ void QuitMessageLoop() { ...@@ -26,7 +26,7 @@ void QuitMessageLoop() {
} // namespace } // namespace
App::App() { App::App() {
context_ = modular::ApplicationContext::CreateFromStartupInfo(); context_ = app::ApplicationContext::CreateFromStartupInfo();
tracing::InitializeTracer(context_.get(), {}); tracing::InitializeTracer(context_.get(), {});
...@@ -52,8 +52,8 @@ App::App() { ...@@ -52,8 +52,8 @@ App::App() {
blink::SetFontProvider( blink::SetFontProvider(
context_->ConnectToEnvironmentService<fonts::FontProvider>()); context_->ConnectToEnvironmentService<fonts::FontProvider>());
context_->outgoing_services()->AddService<modular::ApplicationRunner>( context_->outgoing_services()->AddService<app::ApplicationRunner>(
[this](fidl::InterfaceRequest<modular::ApplicationRunner> request) { [this](fidl::InterfaceRequest<app::ApplicationRunner> request) {
runner_bindings_.AddBinding(this, std::move(request)); runner_bindings_.AddBinding(this, std::move(request));
}); });
} }
...@@ -64,9 +64,9 @@ App::~App() { ...@@ -64,9 +64,9 @@ App::~App() {
} }
void App::StartApplication( void App::StartApplication(
modular::ApplicationPackagePtr application, app::ApplicationPackagePtr application,
modular::ApplicationStartupInfoPtr startup_info, app::ApplicationStartupInfoPtr startup_info,
fidl::InterfaceRequest<modular::ApplicationController> controller) { fidl::InterfaceRequest<app::ApplicationController> controller) {
std::unique_ptr<ApplicationControllerImpl> impl = std::unique_ptr<ApplicationControllerImpl> impl =
std::make_unique<ApplicationControllerImpl>(this, std::move(application), std::make_unique<ApplicationControllerImpl>(this, std::move(application),
std::move(startup_info), std::move(startup_info),
......
...@@ -16,25 +16,25 @@ ...@@ -16,25 +16,25 @@
namespace flutter_runner { namespace flutter_runner {
class App : public modular::ApplicationRunner { class App : public app::ApplicationRunner {
public: public:
App(); App();
~App(); ~App();
// |modular::ApplicationRunner| implementation: // |app::ApplicationRunner| implementation:
void StartApplication(modular::ApplicationPackagePtr application, void StartApplication(app::ApplicationPackagePtr application,
modular::ApplicationStartupInfoPtr startup_info, app::ApplicationStartupInfoPtr startup_info,
fidl::InterfaceRequest<modular::ApplicationController> fidl::InterfaceRequest<app::ApplicationController>
controller) override; controller) override;
void Destroy(ApplicationControllerImpl* controller); void Destroy(ApplicationControllerImpl* controller);
private: private:
std::unique_ptr<modular::ApplicationContext> context_; std::unique_ptr<app::ApplicationContext> context_;
std::unique_ptr<Thread> gpu_thread_; std::unique_ptr<Thread> gpu_thread_;
std::unique_ptr<Thread> io_thread_; std::unique_ptr<Thread> io_thread_;
fidl::BindingSet<modular::ApplicationRunner> runner_bindings_; fidl::BindingSet<app::ApplicationRunner> runner_bindings_;
std::unordered_map<ApplicationControllerImpl*, std::unordered_map<ApplicationControllerImpl*,
std::unique_ptr<ApplicationControllerImpl>> std::unique_ptr<ApplicationControllerImpl>>
controllers_; controllers_;
......
...@@ -16,9 +16,9 @@ namespace flutter_runner { ...@@ -16,9 +16,9 @@ namespace flutter_runner {
ApplicationControllerImpl::ApplicationControllerImpl( ApplicationControllerImpl::ApplicationControllerImpl(
App* app, App* app,
modular::ApplicationPackagePtr application, app::ApplicationPackagePtr application,
modular::ApplicationStartupInfoPtr startup_info, app::ApplicationStartupInfoPtr startup_info,
fidl::InterfaceRequest<modular::ApplicationController> controller) fidl::InterfaceRequest<app::ApplicationController> controller)
: app_(app), binding_(this) { : app_(app), binding_(this) {
if (controller.is_pending()) { if (controller.is_pending()) {
binding_.Bind(std::move(controller)); binding_.Bind(std::move(controller));
...@@ -74,7 +74,7 @@ void ApplicationControllerImpl::ConnectToService( ...@@ -74,7 +74,7 @@ void ApplicationControllerImpl::ConnectToService(
void ApplicationControllerImpl::CreateView( void ApplicationControllerImpl::CreateView(
fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request, fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
fidl::InterfaceRequest<modular::ServiceProvider> services) { fidl::InterfaceRequest<app::ServiceProvider> services) {
runtime_holder_->CreateView(url_, std::move(view_owner_request), runtime_holder_->CreateView(url_, std::move(view_owner_request),
std::move(services)); std::move(services));
} }
......
...@@ -19,24 +19,24 @@ namespace flutter_runner { ...@@ -19,24 +19,24 @@ namespace flutter_runner {
class App; class App;
class RuntimeHolder; class RuntimeHolder;
class ApplicationControllerImpl : public modular::ApplicationController, class ApplicationControllerImpl : public app::ApplicationController,
public modular::ServiceProvider, public app::ServiceProvider,
public mozart::ViewProvider { public mozart::ViewProvider {
public: public:
ApplicationControllerImpl( ApplicationControllerImpl(
App* app, App* app,
modular::ApplicationPackagePtr application, app::ApplicationPackagePtr application,
modular::ApplicationStartupInfoPtr startup_info, app::ApplicationStartupInfoPtr startup_info,
fidl::InterfaceRequest<modular::ApplicationController> controller); fidl::InterfaceRequest<app::ApplicationController> controller);
~ApplicationControllerImpl() override; ~ApplicationControllerImpl() override;
// |modular::ApplicationController| implementation // |app::ApplicationController| implementation
void Kill(const KillCallback& callback) override; void Kill(const KillCallback& callback) override;
void Detach() override; void Detach() override;
// |modular::ServiceProvider| implementation // |app::ServiceProvider| implementation
void ConnectToService(const fidl::String& service_name, void ConnectToService(const fidl::String& service_name,
mx::channel channel) override; mx::channel channel) override;
...@@ -45,16 +45,16 @@ class ApplicationControllerImpl : public modular::ApplicationController, ...@@ -45,16 +45,16 @@ class ApplicationControllerImpl : public modular::ApplicationController,
void CreateView( void CreateView(
fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request, fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
fidl::InterfaceRequest<modular::ServiceProvider> services) override; fidl::InterfaceRequest<app::ServiceProvider> services) override;
private: private:
void StartRuntimeIfReady(); void StartRuntimeIfReady();
App* app_; App* app_;
fidl::Binding<modular::ApplicationController> binding_; fidl::Binding<app::ApplicationController> binding_;
fidl::BindingSet<modular::ServiceProvider> service_provider_bindings_; fidl::BindingSet<app::ServiceProvider> service_provider_bindings_;
modular::ServiceProviderPtr dart_service_provider_; app::ServiceProviderPtr dart_service_provider_;
fidl::BindingSet<mozart::ViewProvider> view_provider_bindings_; fidl::BindingSet<mozart::ViewProvider> view_provider_bindings_;
......
...@@ -81,8 +81,8 @@ RuntimeHolder::~RuntimeHolder() { ...@@ -81,8 +81,8 @@ RuntimeHolder::~RuntimeHolder() {
} }
void RuntimeHolder::Init( void RuntimeHolder::Init(
fidl::InterfaceHandle<modular::ApplicationEnvironment> environment, fidl::InterfaceHandle<app::ApplicationEnvironment> environment,
fidl::InterfaceRequest<modular::ServiceProvider> outgoing_services, fidl::InterfaceRequest<app::ServiceProvider> outgoing_services,
std::vector<char> bundle) { std::vector<char> bundle) {
FTL_DCHECK(!rasterizer_); FTL_DCHECK(!rasterizer_);
rasterizer_ = Rasterizer::Create(); rasterizer_ = Rasterizer::Create();
...@@ -99,7 +99,7 @@ void RuntimeHolder::Init( ...@@ -99,7 +99,7 @@ void RuntimeHolder::Init(
void RuntimeHolder::CreateView( void RuntimeHolder::CreateView(
const std::string& script_uri, const std::string& script_uri,
fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request, fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
fidl::InterfaceRequest<modular::ServiceProvider> services) { fidl::InterfaceRequest<app::ServiceProvider> services) {
if (view_listener_binding_.is_bound()) { if (view_listener_binding_.is_bound()) {
// TODO(jeffbrown): Refactor this to support multiple view instances // TODO(jeffbrown): Refactor this to support multiple view instances
// sharing the same underlying root bundle (but with different runtimes). // sharing the same underlying root bundle (but with different runtimes).
...@@ -119,7 +119,7 @@ void RuntimeHolder::CreateView( ...@@ -119,7 +119,7 @@ void RuntimeHolder::CreateView(
std::move(view_owner_request), std::move(view_owner_request),
std::move(view_listener), script_uri); std::move(view_listener), script_uri);
modular::ServiceProviderPtr view_services; app::ServiceProviderPtr view_services;
view_->GetServiceProvider(GetProxy(&view_services)); view_->GetServiceProvider(GetProxy(&view_services));
// Listen for input events. // Listen for input events.
...@@ -200,7 +200,7 @@ void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) { ...@@ -200,7 +200,7 @@ void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) {
} }
void RuntimeHolder::InitFidlInternal() { void RuntimeHolder::InitFidlInternal() {
fidl::InterfaceHandle<modular::ApplicationEnvironment> environment; fidl::InterfaceHandle<app::ApplicationEnvironment> environment;
environment_->Duplicate(GetProxy(&environment)); environment_->Duplicate(GetProxy(&environment));
Dart_Handle fidl_internal = Dart_LookupLibrary(ToDart("dart:fidl.internal")); Dart_Handle fidl_internal = Dart_LookupLibrary(ToDart("dart:fidl.internal"));
......
...@@ -38,12 +38,12 @@ class RuntimeHolder : public blink::RuntimeDelegate, ...@@ -38,12 +38,12 @@ class RuntimeHolder : public blink::RuntimeDelegate,
RuntimeHolder(); RuntimeHolder();
~RuntimeHolder(); ~RuntimeHolder();
void Init(fidl::InterfaceHandle<modular::ApplicationEnvironment> environment, void Init(fidl::InterfaceHandle<app::ApplicationEnvironment> environment,
fidl::InterfaceRequest<modular::ServiceProvider> outgoing_services, fidl::InterfaceRequest<app::ServiceProvider> outgoing_services,
std::vector<char> bundle); std::vector<char> bundle);
void CreateView(const std::string& script_uri, void CreateView(const std::string& script_uri,
fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request, fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
fidl::InterfaceRequest<modular::ServiceProvider> services); fidl::InterfaceRequest<app::ServiceProvider> services);
private: private:
// |blink::RuntimeDelegate| implementation: // |blink::RuntimeDelegate| implementation:
...@@ -75,9 +75,9 @@ class RuntimeHolder : public blink::RuntimeDelegate, ...@@ -75,9 +75,9 @@ class RuntimeHolder : public blink::RuntimeDelegate,
void OnFrameComplete(); void OnFrameComplete();
void Invalidate(); void Invalidate();
modular::ApplicationEnvironmentPtr environment_; app::ApplicationEnvironmentPtr environment_;
modular::ServiceProviderPtr environment_services_; app::ServiceProviderPtr environment_services_;
fidl::InterfaceRequest<modular::ServiceProvider> outgoing_services_; fidl::InterfaceRequest<app::ServiceProvider> outgoing_services_;
std::vector<char> root_bundle_data_; std::vector<char> root_bundle_data_;
ftl::RefPtr<blink::ZipAssetStore> asset_store_; ftl::RefPtr<blink::ZipAssetStore> asset_store_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册