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

Unified Diff: services/log/main.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/keyboard/linux/main.cc ('k') | services/media/audio/audio_server_app.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/log/main.cc
diff --git a/services/log/main.cc b/services/log/main.cc
index f87f0a38f3e3d09ad73e0c14a591f2f7d99b2fcf..2b5c92cb55dea590aecaaa2a7fbcd2c30ab723a0 100644
--- a/services/log/main.cc
+++ b/services/log/main.cc
@@ -10,7 +10,6 @@
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/services/log/interfaces/log.mojom.h"
#include "services/log/log_impl.h"
@@ -20,7 +19,7 @@ namespace log {
// Provides the mojo.log.Log service. Binds a new Log implementation for each
// Log interface request.
-class LogApp : public ApplicationDelegate, public InterfaceFactory<Log> {
+class LogApp : public ApplicationDelegate {
public:
LogApp() {}
~LogApp() override {}
@@ -28,20 +27,17 @@ class LogApp : public ApplicationDelegate, public InterfaceFactory<Log> {
private:
// |ApplicationDelegate| override:
bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
- connection->AddService<Log>(this);
+ connection->GetServiceProviderImpl().AddService<Log>(
+ [](const ConnectionContext& connection_context,
+ InterfaceRequest<Log> log_request) {
+ LogImpl::Create(connection_context, std::move(log_request),
+ [](const std::string& message) {
+ fprintf(stderr, "%s\n", message.c_str());
+ });
+ });
return true;
}
- // |InterfaceFactory<Log>| implementation:
- // We maintain a separate |LogImpl| for each incoming connection.
- void Create(const ConnectionContext& connection_context,
- InterfaceRequest<Log> request) override {
- LogImpl::Create(connection_context, std::move(request),
- [](const std::string& message) {
- fprintf(stderr, "%s\n", message.c_str());
- });
- }
-
MOJO_DISALLOW_COPY_AND_ASSIGN(LogApp);
};
« no previous file with comments | « services/keyboard/linux/main.cc ('k') | services/media/audio/audio_server_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698