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

Side by Side Diff: services/catalog/catalog.cc

Issue 2850743004: Replace ServiceInfo with BindSourceInfo. (Closed)
Patch Set: . Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/catalog/catalog.h" 5 #include "services/catalog/catalog.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 class Catalog::ServiceImpl : public service_manager::Service { 116 class Catalog::ServiceImpl : public service_manager::Service {
117 public: 117 public:
118 explicit ServiceImpl(Catalog* catalog) : catalog_(catalog) { 118 explicit ServiceImpl(Catalog* catalog) : catalog_(catalog) {
119 registry_.AddInterface<mojom::Catalog>(catalog_); 119 registry_.AddInterface<mojom::Catalog>(catalog_);
120 registry_.AddInterface<filesystem::mojom::Directory>(catalog_); 120 registry_.AddInterface<filesystem::mojom::Directory>(catalog_);
121 registry_.AddInterface<service_manager::mojom::Resolver>(catalog_); 121 registry_.AddInterface<service_manager::mojom::Resolver>(catalog_);
122 } 122 }
123 ~ServiceImpl() override {} 123 ~ServiceImpl() override {}
124 124
125 // service_manager::Service: 125 // service_manager::Service:
126 void OnBindInterface(const service_manager::ServiceInfo& source_info, 126 void OnBindInterface(const service_manager::BindSourceInfo& source_info,
127 const std::string& interface_name, 127 const std::string& interface_name,
128 mojo::ScopedMessagePipeHandle interface_pipe) override { 128 mojo::ScopedMessagePipeHandle interface_pipe) override {
129 registry_.BindInterface(source_info.identity, interface_name, 129 registry_.BindInterface(source_info.identity, interface_name,
130 std::move(interface_pipe)); 130 std::move(interface_pipe));
131 } 131 }
132 132
133 private: 133 private:
134 Catalog* const catalog_; 134 Catalog* const catalog_;
135 service_manager::BinderRegistry registry_; 135 service_manager::BinderRegistry registry_;
136 136
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (it != instances_.end()) 209 if (it != instances_.end())
210 return it->second.get(); 210 return it->second.get();
211 211
212 auto result = instances_.insert(std::make_pair( 212 auto result = instances_.insert(std::make_pair(
213 user_id, 213 user_id,
214 base::MakeUnique<Instance>(&system_cache_, service_manifest_provider_))); 214 base::MakeUnique<Instance>(&system_cache_, service_manifest_provider_)));
215 return result.first->second.get(); 215 return result.first->second.get();
216 } 216 }
217 217
218 } // namespace catalog 218 } // namespace catalog
OLDNEW
« 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