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

Side by Side Diff: mojo/services/catalog/entry.h

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 unified diff | Download patch
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 #ifndef MOJO_SERVICES_CATALOG_ENTRY_H_ 5 #ifndef MOJO_SERVICES_CATALOG_ENTRY_H_
6 #define MOJO_SERVICES_CATALOG_ENTRY_H_ 6 #define MOJO_SERVICES_CATALOG_ENTRY_H_
7 7
8 #include <set>
8 #include <string> 9 #include <string>
9 10
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "mojo/shell/public/cpp/capabilities.h" 12 #include "mojo/shell/public/cpp/capabilities.h"
12 13
13 namespace base { 14 namespace base {
14 class DictionaryValue; 15 class DictionaryValue;
15 } 16 }
16 17
17 namespace catalog { 18 namespace catalog {
18 19
19 // Static information about an application package known to the Catalog. 20 // Static information about an application package known to the Catalog.
20 class Entry { 21 class Entry {
21 public: 22 public:
22 Entry(); 23 Entry();
23 explicit Entry(const Entry& other); 24 explicit Entry(const Entry& other);
24 ~Entry(); 25 ~Entry();
25 26
26 scoped_ptr<base::DictionaryValue> Serialize() const; 27 scoped_ptr<base::DictionaryValue> Serialize() const;
27 static scoped_ptr<Entry> Deserialize(const base::DictionaryValue& value); 28 static scoped_ptr<Entry> Deserialize(const base::DictionaryValue& value);
28 29
29 bool operator==(const Entry& other) const; 30 bool operator==(const Entry& other) const;
31 bool operator<(const Entry& other) const;
30 32
31 const std::string& name() const { return name_; } 33 const std::string& name() const { return name_; }
32 void set_name(const std::string& name) { name_ = name; } 34 void set_name(const std::string& name) { name_ = name; }
33 const std::string& qualifier() const { return qualifier_; } 35 const std::string& qualifier() const { return qualifier_; }
34 void set_qualifier(const std::string& qualifier) { qualifier_ = qualifier; } 36 void set_qualifier(const std::string& qualifier) { qualifier_ = qualifier; }
35 const std::string& display_name() const { return display_name_; } 37 const std::string& display_name() const { return display_name_; }
36 void set_display_name(const std::string& display_name) { 38 void set_display_name(const std::string& display_name) {
37 display_name_ = display_name; 39 display_name_ = display_name;
38 } 40 }
39 const mojo::CapabilitySpec& capabilities() const { return capabilities_; } 41 const mojo::CapabilitySpec& capabilities() const { return capabilities_; }
40 void set_capabilities(const mojo::CapabilitySpec& capabilities) { 42 void set_capabilities(const mojo::CapabilitySpec& capabilities) {
41 capabilities_ = capabilities; 43 capabilities_ = capabilities;
42 } 44 }
45 const std::set<Entry>& applications() { return applications_; }
43 46
44 private: 47 private:
45 std::string name_; 48 std::string name_;
46 std::string qualifier_; 49 std::string qualifier_;
47 std::string display_name_; 50 std::string display_name_;
48 mojo::CapabilitySpec capabilities_; 51 mojo::CapabilitySpec capabilities_;
52 std::set<Entry> applications_;
49 }; 53 };
50 54
51 } // namespace catalog 55 } // namespace catalog
52 56
53 #endif // MOJO_SERVICES_CATALOG_ENTRY_H_ 57 #endif // MOJO_SERVICES_CATALOG_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698