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

Unified Diff: mojo/public/cpp/bindings/tests/versioning_test_service.cc

Issue 1975253002: ApplicationConnection devolution, part 2.1. (Closed) Base URL: https://github.com/domokit/mojo.git@work792-x-work791_service_registry_spimpl
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 | « examples/native_run_app/native_run_app.cc ('k') | mojo/ui/content_viewer_app.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/versioning_test_service.cc
diff --git a/mojo/public/cpp/bindings/tests/versioning_test_service.cc b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
index 893a47d9a7f660d19fa76ee72f5f70462712e2b9..f8158899c4dfed3cd7436fdbff51fa0f053f4c34 100644
--- a/mojo/public/cpp/bindings/tests/versioning_test_service.cc
+++ b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
@@ -9,7 +9,6 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_runner.h"
-#include "mojo/public/cpp/application/interface_factory.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/interfaces/bindings/tests/versioning_test_service.mojom.h"
@@ -93,25 +92,21 @@ class HumanResourceDatabaseImpl : public HumanResourceDatabase {
StrongBinding<HumanResourceDatabase> strong_binding_;
};
-class HumanResourceSystemServer
- : public ApplicationDelegate,
- public InterfaceFactory<HumanResourceDatabase> {
+class HumanResourceSystemServer : public ApplicationDelegate {
public:
HumanResourceSystemServer() {}
// ApplicationDelegate implementation.
bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
- connection->AddService<HumanResourceDatabase>(this);
+ connection->GetServiceProviderImpl().AddService<HumanResourceDatabase>(
+ [](const ConnectionContext& connection_context,
+ InterfaceRequest<HumanResourceDatabase> hr_db_request) {
+ // It will be deleted automatically when the underlying pipe
+ // encounters a connection error.
+ new HumanResourceDatabaseImpl(hr_db_request.Pass());
+ });
return true;
}
-
- // InterfaceFactory<HumanResourceDatabase> implementation.
- void Create(const ConnectionContext& connection_context,
- InterfaceRequest<HumanResourceDatabase> request) override {
- // It will be deleted automatically when the underlying pipe encounters a
- // connection error.
- new HumanResourceDatabaseImpl(request.Pass());
- }
};
} // namespace versioning
« no previous file with comments | « examples/native_run_app/native_run_app.cc ('k') | mojo/ui/content_viewer_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698