OLD | NEW |
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 SERVICES_CATALOG_ENTRY_H_ | 5 #ifndef SERVICES_CATALOG_ENTRY_H_ |
6 #define SERVICES_CATALOG_ENTRY_H_ | 6 #define SERVICES_CATALOG_ENTRY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace catalog { | 22 namespace catalog { |
23 | 23 |
24 // Static information about a service package known to the Catalog. | 24 // Static information about a service package known to the Catalog. |
25 class Entry { | 25 class Entry { |
26 public: | 26 public: |
27 Entry(); | 27 Entry(); |
28 explicit Entry(const std::string& name); | 28 explicit Entry(const std::string& name); |
29 ~Entry(); | 29 ~Entry(); |
30 | 30 |
31 std::unique_ptr<base::DictionaryValue> Serialize() const; | |
32 | |
33 static std::unique_ptr<Entry> Deserialize(const base::Value& manifest_root); | 31 static std::unique_ptr<Entry> Deserialize(const base::Value& manifest_root); |
34 | 32 |
35 bool ProvidesCapability(const std::string& capability) const; | 33 bool ProvidesCapability(const std::string& capability) const; |
36 | 34 |
37 bool operator==(const Entry& other) const; | 35 bool operator==(const Entry& other) const; |
38 | 36 |
39 const std::string& name() const { return name_; } | 37 const std::string& name() const { return name_; } |
40 void set_name(const std::string& name) { name_ = name; } | 38 void set_name(const std::string& name) { name_ = name; } |
41 | 39 |
42 const base::FilePath& path() const { return path_; } | 40 const base::FilePath& path() const { return path_; } |
(...skipping 16 matching lines...) Expand all Loading... |
59 } | 57 } |
60 | 58 |
61 void AddInterfaceProviderSpec( | 59 void AddInterfaceProviderSpec( |
62 const std::string& name, | 60 const std::string& name, |
63 const service_manager::InterfaceProviderSpec& spec); | 61 const service_manager::InterfaceProviderSpec& spec); |
64 const service_manager::InterfaceProviderSpecMap& | 62 const service_manager::InterfaceProviderSpecMap& |
65 interface_provider_specs() const { | 63 interface_provider_specs() const { |
66 return interface_provider_specs_; | 64 return interface_provider_specs_; |
67 } | 65 } |
68 | 66 |
| 67 void AddRequiredFileDescritor(const std::string& name, |
| 68 const std::string& path); |
| 69 const std::map<std::string, std::string>& required_file_paths() const { |
| 70 return required_file_paths_; |
| 71 } |
| 72 |
69 private: | 73 private: |
70 std::string name_; | 74 std::string name_; |
71 base::FilePath path_; | 75 base::FilePath path_; |
72 std::string display_name_; | 76 std::string display_name_; |
73 service_manager::InterfaceProviderSpecMap interface_provider_specs_; | 77 service_manager::InterfaceProviderSpecMap interface_provider_specs_; |
| 78 std::map<std::string, std::string> required_file_paths_; |
74 const Entry* parent_ = nullptr; | 79 const Entry* parent_ = nullptr; |
75 std::vector<std::unique_ptr<Entry>> children_; | 80 std::vector<std::unique_ptr<Entry>> children_; |
76 | 81 |
77 DISALLOW_COPY_AND_ASSIGN(Entry); | 82 DISALLOW_COPY_AND_ASSIGN(Entry); |
78 }; | 83 }; |
79 | 84 |
80 } // namespace catalog | 85 } // namespace catalog |
81 | 86 |
82 namespace mojo { | 87 namespace mojo { |
83 template <> | 88 template <> |
84 struct TypeConverter<service_manager::mojom::ResolveResultPtr, | 89 struct TypeConverter<service_manager::mojom::ResolveResultPtr, |
85 const catalog::Entry*> { | 90 const catalog::Entry*> { |
86 static service_manager::mojom::ResolveResultPtr Convert( | 91 static service_manager::mojom::ResolveResultPtr Convert( |
87 const catalog::Entry* input); | 92 const catalog::Entry* input); |
88 }; | 93 }; |
89 | 94 |
90 template<> | 95 template<> |
91 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { | 96 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { |
92 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); | 97 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); |
93 }; | 98 }; |
94 | 99 |
95 } // namespace mojo | 100 } // namespace mojo |
96 | 101 |
97 #endif // SERVICES_CATALOG_ENTRY_H_ | 102 #endif // SERVICES_CATALOG_ENTRY_H_ |
OLD | NEW |