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

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

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 years, 8 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 | « media/mojo/services/media_service.cc ('k') | services/catalog/catalog.cc » ('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 313a6249e212f5d4f33c80e10ae5e11cd48837a4..8f93331ea2a16ae0cd4d35d1674c3f6f46567248 100644
--- a/mojo/public/cpp/bindings/tests/versioning_test_service.cc
+++ b/mojo/public/cpp/bindings/tests/versioning_test_service.cc
@@ -11,6 +11,7 @@
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/interfaces/bindings/tests/versioning_test_service.mojom.h"
#include "services/service_manager/public/c/main.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/interface_factory.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_runner.h"
@@ -98,12 +99,16 @@ class HumanResourceSystemServer
: public service_manager::Service,
public InterfaceFactory<HumanResourceDatabase> {
public:
- HumanResourceSystemServer() {}
+ HumanResourceSystemServer() {
+ registry_.AddInterface<HumanResourceDatabase>(this);
+ }
// service_manager::Service implementation.
- bool OnConnect(Connection* connection) override {
- connection->AddInterface<HumanResourceDatabase>(this);
- return true;
+ void OnBindInterface(const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) override {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
// InterfaceFactory<HumanResourceDatabase> implementation.
@@ -113,6 +118,9 @@ class HumanResourceSystemServer
// connection error.
new HumanResourceDatabaseImpl(std::move(request));
}
+
+ private:
+ service_manager::BinderRegistry registry_;
};
} // namespace versioning
« no previous file with comments | « media/mojo/services/media_service.cc ('k') | services/catalog/catalog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698