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

Unified Diff: services/service_manager/tests/shutdown/shutdown_client_app.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/tests/shutdown/shutdown_client_app.cc
diff --git a/services/service_manager/tests/shutdown/shutdown_client_app.cc b/services/service_manager/tests/shutdown/shutdown_client_app.cc
index 9dd6942b3ab8418db08a0720340d64d8b9a01d28..bdac97a883a0d3fe8aeaf7074b533c398105d0d0 100644
--- a/services/service_manager/tests/shutdown/shutdown_client_app.cc
+++ b/services/service_manager/tests/shutdown/shutdown_client_app.cc
@@ -6,9 +6,9 @@
#include "base/run_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/connector.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"
@@ -22,15 +22,18 @@ class ShutdownClientApp
public mojom::ShutdownTestClientController,
public mojom::ShutdownTestClient {
public:
- ShutdownClientApp() {}
+ ShutdownClientApp() {
+ registry_.AddInterface<mojom::ShutdownTestClientController>(this);
+ }
~ShutdownClientApp() override {}
private:
// service_manager::Service:
- bool OnConnect(const ServiceInfo& remote_info,
- InterfaceRegistry* registry) override {
- registry->AddInterface<mojom::ShutdownTestClientController>(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::ShutdownTestClientController>:
@@ -60,6 +63,7 @@ class ShutdownClientApp
callback.Run();
}
+ BinderRegistry registry_;
mojo::BindingSet<mojom::ShutdownTestClientController> bindings_;
DISALLOW_COPY_AND_ASSIGN(ShutdownClientApp);

Powered by Google App Engine
This is Rietveld 408576698