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

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

Issue 1818373003: Move serialize/deserialize logic onto Entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/catalog.cc ('k') | mojo/services/catalog/entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/catalog/entry.h
diff --git a/mojo/services/catalog/entry.h b/mojo/services/catalog/entry.h
index 4b7ffa803d5040feb7e22519b42e1e568bc33655..ac5ace5cde5970921a04e2c1c5756813a38b1f40 100644
--- a/mojo/services/catalog/entry.h
+++ b/mojo/services/catalog/entry.h
@@ -7,22 +7,45 @@
#include <string>
+#include "base/memory/scoped_ptr.h"
#include "mojo/shell/public/cpp/capabilities.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace catalog {
// Static information about an application package known to the Catalog.
-struct Entry {
+class Entry {
+ public:
Entry();
- Entry(const Entry& other);
+ explicit Entry(const Entry& other);
~Entry();
+ scoped_ptr<base::DictionaryValue> Serialize() const;
+ static scoped_ptr<Entry> Deserialize(const base::DictionaryValue& value);
+
bool operator==(const Entry& other) const;
- std::string name;
- std::string qualifier;
- std::string display_name;
- mojo::CapabilitySpec capabilities;
+ const std::string& name() const { return name_; }
+ void set_name(const std::string& name) { name_ = name; }
+ const std::string& qualifier() const { return qualifier_; }
+ void set_qualifier(const std::string& qualifier) { qualifier_ = qualifier; }
+ const std::string& display_name() const { return display_name_; }
+ void set_display_name(const std::string& display_name) {
+ display_name_ = display_name;
+ }
+ const mojo::CapabilitySpec& capabilities() const { return capabilities_; }
+ void set_capabilities(const mojo::CapabilitySpec& capabilities) {
+ capabilities_ = capabilities;
+ }
+
+ private:
+ std::string name_;
+ std::string qualifier_;
+ std::string display_name_;
+ mojo::CapabilitySpec capabilities_;
};
} // namespace catalog
« no previous file with comments | « mojo/services/catalog/catalog.cc ('k') | mojo/services/catalog/entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698