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

Unified Diff: services/service_manager/background/tests/test_service.cc

Issue 2804373002: Eliminate Connector::Connect(), Connection, etc. (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/background/tests/test_service.cc
diff --git a/services/service_manager/background/tests/test_service.cc b/services/service_manager/background/tests/test_service.cc
index 96fd1522d22524fa9a06999b0788492631a5a799..1a4e59a03c53f1af099ab4a773d45bdd03a5b938 100644
--- a/services/service_manager/background/tests/test_service.cc
+++ b/services/service_manager/background/tests/test_service.cc
@@ -5,7 +5,7 @@
#include "mojo/public/cpp/bindings/binding_set.h"
#include "services/service_manager/background/tests/test.mojom.h"
#include "services/service_manager/public/c/main.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
+#include "services/service_manager/public/cpp/binder_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"
@@ -18,15 +18,16 @@ class TestClient : public Service,
public InterfaceFactory<mojom::TestService>,
public mojom::TestService {
public:
- TestClient() {}
+ TestClient() { registry_.AddInterface(this); }
~TestClient() override {}
private:
// Service:
- bool OnConnect(const ServiceInfo& remote_info,
- InterfaceRegistry* registry) override {
- registry->AddInterface(this);
- return true;
+ void OnBindInterface(const 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<mojom::TestService>:
@@ -42,6 +43,7 @@ class TestClient : public Service,
void Quit() override { context()->RequestQuit(); }
+ BinderRegistry registry_;
mojo::BindingSet<mojom::TestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(TestClient);

Powered by Google App Engine
This is Rietveld 408576698