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

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

Issue 2164503006: Rename mojo_application GN templates to service* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « services/catalog/entry.h ('k') | services/catalog/reader.cc » ('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/entry.h" 5 #include "services/catalog/entry.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "services/catalog/store.h" 8 #include "services/catalog/store.h"
9 #include "services/shell/public/cpp/names.h" 9 #include "services/shell/public/cpp/names.h"
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 shell::CapabilitySpec spec; 226 shell::CapabilitySpec spec;
227 if (!BuildCapabilities(*capabilities, &spec)) { 227 if (!BuildCapabilities(*capabilities, &spec)) {
228 LOG(ERROR) << "Entry::Deserialize: failed to build capability spec for " 228 LOG(ERROR) << "Entry::Deserialize: failed to build capability spec for "
229 << entry->name(); 229 << entry->name();
230 return nullptr; 230 return nullptr;
231 } 231 }
232 entry->set_capabilities(spec); 232 entry->set_capabilities(spec);
233 233
234 if (value.HasKey(Store::kApplicationsKey)) { 234 if (value.HasKey(Store::kServicesKey)) {
235 const base::ListValue* applications = nullptr; 235 const base::ListValue* services = nullptr;
236 value.GetList(Store::kApplicationsKey, &applications); 236 value.GetList(Store::kServicesKey, &services);
237 for (size_t i = 0; i < applications->GetSize(); ++i) { 237 for (size_t i = 0; i < services->GetSize(); ++i) {
238 const base::DictionaryValue* application = nullptr; 238 const base::DictionaryValue* service = nullptr;
239 applications->GetDictionary(i, &application); 239 services->GetDictionary(i, &service);
240 std::unique_ptr<Entry> child = Entry::Deserialize(*application); 240 std::unique_ptr<Entry> child = Entry::Deserialize(*service);
241 if (child) { 241 if (child) {
242 child->set_package(entry.get()); 242 child->set_package(entry.get());
243 // Caller must assume ownership of these items. 243 // Caller must assume ownership of these items.
244 entry->applications_.insert(child.release()); 244 entry->services_.insert(child.release());
245 } 245 }
246 } 246 }
247 } 247 }
248 248
249 return entry; 249 return entry;
250 } 250 }
251 251
252 bool Entry::ProvidesClass(const std::string& clazz) const { 252 bool Entry::ProvidesClass(const std::string& clazz) const {
253 return capabilities_.provided.find(clazz) != capabilities_.provided.end(); 253 return capabilities_.provided.find(clazz) != capabilities_.provided.end();
254 } 254 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 catalog::mojom::EntryPtr 288 catalog::mojom::EntryPtr
289 TypeConverter<catalog::mojom::EntryPtr, catalog::Entry>::Convert( 289 TypeConverter<catalog::mojom::EntryPtr, catalog::Entry>::Convert(
290 const catalog::Entry& input) { 290 const catalog::Entry& input) {
291 catalog::mojom::EntryPtr result(catalog::mojom::Entry::New()); 291 catalog::mojom::EntryPtr result(catalog::mojom::Entry::New());
292 result->name = input.name(); 292 result->name = input.name();
293 result->display_name = input.display_name(); 293 result->display_name = input.display_name();
294 return result; 294 return result;
295 } 295 }
296 296
297 } // namespace mojo 297 } // namespace mojo
OLDNEW
« no previous file with comments | « services/catalog/entry.h ('k') | services/catalog/reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698