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

Unified Diff: services/http_server/http_server_app.cc

Issue 1981513002: ApplicationConnection devolution, part 2.2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
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
« no previous file with comments | « services/gfx/compositor/compositor_app.cc ('k') | services/icu_data/icu_data_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a1e6841e94d68cb81cb83959af8898f12d0b9e25..b449b732d0cf82efde44aeabecbd1904eb1ec003 100644
--- a/services/http_server/http_server_app.cc
+++ b/services/http_server/http_server_app.cc
@@ -8,15 +8,13 @@
#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/interface_factory.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,
- public mojo::InterfaceFactory<HttpServerFactory> {
+class HttpServerApp : public mojo::ApplicationDelegate {
public:
HttpServerApp() {}
~HttpServerApp() override {}
@@ -27,20 +25,17 @@ class HttpServerApp : public mojo::ApplicationDelegate,
// ApplicationDelegate:
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
- connection->AddService(this);
+ connection->GetServiceProviderImpl().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_->AddBinding(http_server_factory_request.Pass());
+ });
return true;
}
- // InterfaceFactory<HttpServerFactory>:
- void Create(const mojo::ConnectionContext& connection_context,
- mojo::InterfaceRequest<HttpServerFactory> request) override {
- if (!http_server_factory_) {
- http_server_factory_.reset(new HttpServerFactoryImpl(app_));
- }
-
- http_server_factory_->AddBinding(request.Pass());
- }
-
mojo::ApplicationImpl* app_;
std::unique_ptr<HttpServerFactoryImpl> http_server_factory_;
};
« no previous file with comments | « services/gfx/compositor/compositor_app.cc ('k') | services/icu_data/icu_data_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698