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

Unified Diff: services/catalog/catalog.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/catalog/catalog.cc
diff --git a/services/catalog/catalog.cc b/services/catalog/catalog.cc
index bdcb40af1034e9ba05c56f15afec7eb26adc75e8..b062eb41ca042b56fa5304799e740e4dc3184a9c 100644
--- a/services/catalog/catalog.cc
+++ b/services/catalog/catalog.cc
@@ -24,8 +24,8 @@
#include "services/catalog/constants.h"
#include "services/catalog/entry_cache.h"
#include "services/catalog/instance.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/connection.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service_context.h"
namespace catalog {
@@ -112,20 +112,24 @@ void LoadCatalogManifestIntoCache(const base::Value* root, EntryCache* cache) {
class Catalog::ServiceImpl : public service_manager::Service {
public:
- explicit ServiceImpl(Catalog* catalog) : catalog_(catalog) {}
+ explicit ServiceImpl(Catalog* catalog) : catalog_(catalog) {
+ registry_.AddInterface<mojom::Catalog>(catalog_);
+ registry_.AddInterface<filesystem::mojom::Directory>(catalog_);
+ registry_.AddInterface<service_manager::mojom::Resolver>(catalog_);
+ }
~ServiceImpl() override {}
// service_manager::Service:
- bool OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) override {
- registry->AddInterface<mojom::Catalog>(catalog_);
- registry->AddInterface<filesystem::mojom::Directory>(catalog_);
- registry->AddInterface<service_manager::mojom::Resolver>(catalog_);
- 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));
}
private:
Catalog* const catalog_;
+ service_manager::BinderRegistry registry_;
DISALLOW_COPY_AND_ASSIGN(ServiceImpl);
};
« no previous file with comments | « mojo/public/cpp/bindings/tests/versioning_test_service.cc ('k') | services/data_decoder/data_decoder_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698