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

Unified Diff: mojo/services/catalog/entry.cc

Issue 1821383002: Moves manifest parsing to a new class, Reader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@60catref
Patch Set: . Created 4 years, 9 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
« no previous file with comments | « mojo/services/catalog/entry.h ('k') | mojo/services/catalog/reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/catalog/entry.cc
diff --git a/mojo/services/catalog/entry.cc b/mojo/services/catalog/entry.cc
index 528eee49d51f91cd9b6770bdedde7e28d1c8f004..20dec2cf6925ce735c17ebc38f129a309e1bcb6d 100644
--- a/mojo/services/catalog/entry.cc
+++ b/mojo/services/catalog/entry.cc
@@ -179,6 +179,19 @@ scoped_ptr<Entry> Entry::Deserialize(const base::DictionaryValue& value) {
entry->set_capabilities(BuildCapabilitiesV0(*capabilities));
else
entry->set_capabilities(BuildCapabilitiesV1(*capabilities));
+
+ if (value.HasKey(Store::kApplicationsKey)) {
+ const base::ListValue* applications = nullptr;
+ value.GetList(Store::kApplicationsKey, &applications);
+ for (size_t i = 0; i < applications->GetSize(); ++i) {
+ const base::DictionaryValue* application = nullptr;
+ applications->GetDictionary(i, &application);
+ scoped_ptr<Entry> child = Entry::Deserialize(*application);
+ if (child)
+ entry->applications_.insert(*child);
+ }
+ }
+
return entry;
}
@@ -188,4 +201,10 @@ bool Entry::operator==(const Entry& other) const {
other.capabilities_ == capabilities_;
}
+bool Entry::operator<(const Entry& other) const {
+ return std::tie(name_, qualifier_, display_name_, capabilities_) <
+ std::tie(other.name_, other.qualifier_, other.display_name_,
+ other.capabilities_);
+}
+
} // catalog
« no previous file with comments | « mojo/services/catalog/entry.h ('k') | mojo/services/catalog/reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698