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

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

Issue 2435153004: Change Service contract to pass ServiceInfo instead of Identity (Closed)
Patch Set: . Created 4 years, 1 month 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
« no previous file with comments | « services/catalog/catalog.h ('k') | services/file/file_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 void Catalog::ScanSystemPackageDir() { 109 void Catalog::ScanSystemPackageDir() {
110 base::FilePath system_package_dir; 110 base::FilePath system_package_dir;
111 PathService::Get(base::DIR_MODULE, &system_package_dir); 111 PathService::Get(base::DIR_MODULE, &system_package_dir);
112 system_package_dir = system_package_dir.AppendASCII(kPackagesDirName); 112 system_package_dir = system_package_dir.AppendASCII(kPackagesDirName);
113 system_reader_->Read(system_package_dir, &system_cache_, 113 system_reader_->Read(system_package_dir, &system_cache_,
114 base::Bind(&Catalog::SystemPackageDirScanned, 114 base::Bind(&Catalog::SystemPackageDirScanned,
115 weak_factory_.GetWeakPtr())); 115 weak_factory_.GetWeakPtr()));
116 } 116 }
117 117
118 bool Catalog::OnConnect(const service_manager::Identity& remote_identity, 118 bool Catalog::OnConnect(const service_manager::ServiceInfo& remote_info,
119 service_manager::InterfaceRegistry* registry) { 119 service_manager::InterfaceRegistry* registry) {
120 registry->AddInterface<mojom::Catalog>(this); 120 registry->AddInterface<mojom::Catalog>(this);
121 registry->AddInterface<mojom::CatalogControl>(this); 121 registry->AddInterface<mojom::CatalogControl>(this);
122 registry->AddInterface<filesystem::mojom::Directory>(this); 122 registry->AddInterface<filesystem::mojom::Directory>(this);
123 registry->AddInterface<service_manager::mojom::Resolver>(this); 123 registry->AddInterface<service_manager::mojom::Resolver>(this);
124 return true; 124 return true;
125 } 125 }
126 126
127 void Catalog::Create(const service_manager::Identity& remote_identity, 127 void Catalog::Create(const service_manager::Identity& remote_identity,
128 service_manager::mojom::ResolverRequest request) { 128 service_manager::mojom::ResolverRequest request) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return instance; 176 return instance;
177 } 177 }
178 178
179 void Catalog::SystemPackageDirScanned() { 179 void Catalog::SystemPackageDirScanned() {
180 loaded_ = true; 180 loaded_ = true;
181 for (auto& instance : instances_) 181 for (auto& instance : instances_)
182 instance.second->CacheReady(&system_cache_); 182 instance.second->CacheReady(&system_cache_);
183 } 183 }
184 184
185 } // namespace catalog 185 } // namespace catalog
OLDNEW
« no previous file with comments | « services/catalog/catalog.h ('k') | services/file/file_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698