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

Unified Diff: services/service_manager/tests/service_manager/embedder.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
Index: services/service_manager/tests/service_manager/embedder.cc
diff --git a/services/service_manager/tests/service_manager/embedder.cc b/services/service_manager/tests/service_manager/embedder.cc
index dceb8f3ea526aa4646404ca21ee8cd31a585fc9c..26e7eb76ab89863430951c46a1a1d400acf9e669 100644
--- a/services/service_manager/tests/service_manager/embedder.cc
+++ b/services/service_manager/tests/service_manager/embedder.cc
@@ -11,8 +11,8 @@
#include "base/message_loop/message_loop.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"
@@ -28,10 +28,9 @@ class Singleton : public service_manager::Service {
private:
// service_manager::Service:
- bool OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) override {
- return false;
- }
+ void OnBindInterface(const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) override {}
DISALLOW_COPY_AND_ASSIGN(Singleton);
};
@@ -41,15 +40,18 @@ class Embedder : public service_manager::Service,
service_manager::mojom::ServiceFactory>,
public service_manager::mojom::ServiceFactory {
public:
- Embedder() {}
+ Embedder() {
+ registry_.AddInterface<service_manager::mojom::ServiceFactory>(this);
+ }
~Embedder() override {}
private:
// service_manager::Service:
- bool OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) override {
- registry->AddInterface<service_manager::mojom::ServiceFactory>(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));
}
bool OnServiceManagerConnectionLost() override {
@@ -73,6 +75,7 @@ class Embedder : public service_manager::Service,
}
std::unique_ptr<service_manager::ServiceContext> context_;
+ service_manager::BinderRegistry registry_;
mojo::BindingSet<service_manager::mojom::ServiceFactory>
service_factory_bindings_;
« no previous file with comments | « services/service_manager/tests/lifecycle/parent.cc ('k') | services/service_manager/tests/service_manager/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698