Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: services/http_server/http_server_app.cc

Issue 2012873003: More ApplicationDelegate/ApplicationRunner[Chromium] conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_run_app_options
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698