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

Unified Diff: services/service_manager/tests/shutdown/shutdown_service_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_service_app.cc
diff --git a/services/service_manager/tests/shutdown/shutdown_service_app.cc b/services/service_manager/tests/shutdown/shutdown_service_app.cc
index 95134f7c38aeb79f1bcacc23080adda018978a3d..1e1c8c7f991cfd0df43eaf4d9433592d6005258c 100644
--- a/services/service_manager/tests/shutdown/shutdown_service_app.cc
+++ b/services/service_manager/tests/shutdown/shutdown_service_app.cc
@@ -5,9 +5,10 @@
#include "base/macros.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_info.h"
#include "services/service_manager/public/cpp/service_runner.h"
#include "services/service_manager/tests/shutdown/shutdown_unittest.mojom.h"
@@ -21,15 +22,18 @@ class ShutdownServiceApp
public InterfaceFactory<mojom::ShutdownTestService>,
public mojom::ShutdownTestService {
public:
- ShutdownServiceApp() {}
+ ShutdownServiceApp() {
+ registry_.AddInterface<mojom::ShutdownTestService>(this);
+ }
~ShutdownServiceApp() override {}
private:
// service_manager::Service:
- bool OnConnect(const ServiceInfo& remote_info,
- InterfaceRegistry* registry) override {
- registry->AddInterface<mojom::ShutdownTestService>(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::ShutdownTestService>:
@@ -42,6 +46,7 @@ class ShutdownServiceApp
void SetClient(mojom::ShutdownTestClientPtr client) override {}
void ShutDown() override { g_app->Quit(); }
+ BinderRegistry registry_;
mojo::BindingSet<mojom::ShutdownTestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(ShutdownServiceApp);
« no previous file with comments | « services/service_manager/tests/shutdown/shutdown_client_app.cc ('k') | services/service_manager/tests/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698