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

Unified Diff: services/service_manager/tests/connect/connect_test_exe.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 | « services/service_manager/service_manager.cc ('k') | services/service_manager/tests/lifecycle/package.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/tests/connect/connect_test_exe.cc
diff --git a/services/service_manager/tests/connect/connect_test_exe.cc b/services/service_manager/tests/connect/connect_test_exe.cc
index 128eacd844b51a4f4989b24b5e21f417223695f1..bfede0fe2ece50d2469581a76faec48f8fd4e99d 100644
--- a/services/service_manager/tests/connect/connect_test_exe.cc
+++ b/services/service_manager/tests/connect/connect_test_exe.cc
@@ -8,8 +8,8 @@
#include "base/memory/ptr_util.h"
#include "mojo/public/cpp/bindings/binding_set.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/interface_registry.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_context.h"
#include "services/service_manager/public/cpp/service_runner.h"
@@ -24,15 +24,16 @@ class Target : public service_manager::Service,
public service_manager::InterfaceFactory<ConnectTestService>,
public ConnectTestService {
public:
- Target() {}
+ Target() { registry_.AddInterface<ConnectTestService>(this); }
~Target() override {}
private:
// service_manager::Service:
- bool OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) override {
- registry->AddInterface<ConnectTestService>(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));
}
// service_manager::InterfaceFactory<ConnectTestService>:
@@ -50,6 +51,7 @@ class Target : public service_manager::Service,
callback.Run(context()->identity().instance());
}
+ service_manager::BinderRegistry registry_;
mojo::BindingSet<ConnectTestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(Target);
« no previous file with comments | « services/service_manager/service_manager.cc ('k') | services/service_manager/tests/lifecycle/package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698