Index: services/http_server/http_server_app.cc |
diff --git a/services/http_server/http_server_app.cc b/services/http_server/http_server_app.cc |
index 2f1af796347bda7d577b8580a9eab5024617237f..315e2c0fa6c1abae90f31542c312cbf6508cc1b3 100644 |
--- a/services/http_server/http_server_app.cc |
+++ b/services/http_server/http_server_app.cc |
@@ -5,45 +5,41 @@ |
#include <memory> |
#include "mojo/public/c/system/main.h" |
-#include "mojo/public/cpp/application/application_delegate.h" |
-#include "mojo/public/cpp/application/application_impl.h" |
-#include "mojo/public/cpp/application/application_runner.h" |
+#include "mojo/public/cpp/application/application_impl_base.h" |
+#include "mojo/public/cpp/application/run_application.h" |
+#include "mojo/public/cpp/application/service_provider_impl.h" |
#include "mojo/services/http_server/interfaces/http_server_factory.mojom.h" |
#include "services/http_server/http_server_factory_impl.h" |
#include "services/http_server/http_server_impl.h" |
namespace http_server { |
-class HttpServerApp : public mojo::ApplicationDelegate { |
+class HttpServerApp : public mojo::ApplicationImplBase { |
public: |
HttpServerApp() {} |
~HttpServerApp() override {} |
- void Initialize(mojo::ApplicationImpl* app) override { app_ = app; } |
- |
private: |
// ApplicationDelegate: |
- bool ConfigureIncomingConnection( |
+ bool OnAcceptConnection( |
mojo::ServiceProviderImpl* service_provider_impl) override { |
service_provider_impl->AddService<HttpServerFactory>([this]( |
const mojo::ConnectionContext& connection_context, |
mojo::InterfaceRequest<HttpServerFactory> http_server_factory_request) { |
if (!http_server_factory_) |
- http_server_factory_.reset(new HttpServerFactoryImpl(app_)); |
+ http_server_factory_.reset(new HttpServerFactoryImpl(shell())); |
http_server_factory_->AddBinding(http_server_factory_request.Pass()); |
}); |
return true; |
} |
- mojo::ApplicationImpl* app_; |
std::unique_ptr<HttpServerFactoryImpl> http_server_factory_; |
}; |
} // namespace http_server |
MojoResult MojoMain(MojoHandle application_request) { |
- mojo::ApplicationRunner runner(std::unique_ptr<http_server::HttpServerApp>( |
- new http_server::HttpServerApp())); |
- return runner.Run(application_request); |
+ http_server::HttpServerApp http_server_app; |
+ return mojo::RunMainApplication(application_request, &http_server_app); |
} |