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

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
Index: mojo/services/catalog/entry.cc
diff --git a/mojo/services/catalog/entry.cc b/mojo/services/catalog/entry.cc
index 528eee49d51f91cd9b6770bdedde7e28d1c8f004..2f1671f8e1f2455897d96e173b2fc0c29fd04cb6 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 other.name_ < name_ || other.qualifier_ < qualifier_ ||
sky 2016/03/22 23:47:46 Don't you only want to compare subsequent values i
+ other.display_name_ < display_name_ ||
+ other.capabilities_ < capabilities_;
+}
+
} // catalog

Powered by Google App Engine
This is Rietveld 408576698