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

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

Issue 2684433003: Files required by a service now listed in manifest. (Closed)
Patch Set: Fix build. Created 3 years, 10 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
« no previous file with comments | « services/catalog/data/required_files ('k') | services/catalog/entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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>
11 11
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "services/catalog/public/interfaces/catalog.mojom.h" 14 #include "services/catalog/public/interfaces/catalog.mojom.h"
15 #include "services/service_manager/public/cpp/interface_provider_spec.h" 15 #include "services/service_manager/public/cpp/interface_provider_spec.h"
16 #include "services/service_manager/public/interfaces/resolver.mojom.h" 16 #include "services/service_manager/public/interfaces/resolver.mojom.h"
17 17
18 namespace base { 18 namespace base {
19 class DictionaryValue;
20 class Value; 19 class Value;
21 } 20 }
22 21
23 namespace catalog { 22 namespace catalog {
24 23
25 // Static information about a service package known to the Catalog. 24 // Static information about a service package known to the Catalog.
26 class Entry { 25 class Entry {
27 public: 26 public:
28 Entry(); 27 Entry();
29 explicit Entry(const std::string& name); 28 explicit Entry(const std::string& name);
30 ~Entry(); 29 ~Entry();
31 30
32 std::unique_ptr<base::DictionaryValue> Serialize() const;
33
34 static std::unique_ptr<Entry> Deserialize(const base::Value& manifest_root); 31 static std::unique_ptr<Entry> Deserialize(const base::Value& manifest_root);
35 32
36 bool ProvidesCapability(const std::string& capability) const; 33 bool ProvidesCapability(const std::string& capability) const;
37 34
38 bool operator==(const Entry& other) const; 35 bool operator==(const Entry& other) const;
39 36
40 const std::string& name() const { return name_; } 37 const std::string& name() const { return name_; }
41 void set_name(const std::string& name) { name_ = name; } 38 void set_name(const std::string& name) { name_ = name; }
42 39
43 const base::FilePath& path() const { return path_; } 40 const base::FilePath& path() const { return path_; }
(...skipping 16 matching lines...) Expand all
60 } 57 }
61 58
62 void AddInterfaceProviderSpec( 59 void AddInterfaceProviderSpec(
63 const std::string& name, 60 const std::string& name,
64 const service_manager::InterfaceProviderSpec& spec); 61 const service_manager::InterfaceProviderSpec& spec);
65 const service_manager::InterfaceProviderSpecMap& 62 const service_manager::InterfaceProviderSpecMap&
66 interface_provider_specs() const { 63 interface_provider_specs() const {
67 return interface_provider_specs_; 64 return interface_provider_specs_;
68 } 65 }
69 66
67 void AddRequiredFilePath(const std::string& name, const base::FilePath& path);
68 const std::map<std::string, base::FilePath>& required_file_paths() const {
69 return required_file_paths_;
70 }
71
70 private: 72 private:
71 std::string name_; 73 std::string name_;
72 base::FilePath path_; 74 base::FilePath path_;
73 std::string display_name_; 75 std::string display_name_;
74 service_manager::InterfaceProviderSpecMap interface_provider_specs_; 76 service_manager::InterfaceProviderSpecMap interface_provider_specs_;
77 std::map<std::string, base::FilePath> required_file_paths_;
75 const Entry* parent_ = nullptr; 78 const Entry* parent_ = nullptr;
76 std::vector<std::unique_ptr<Entry>> children_; 79 std::vector<std::unique_ptr<Entry>> children_;
77 80
78 DISALLOW_COPY_AND_ASSIGN(Entry); 81 DISALLOW_COPY_AND_ASSIGN(Entry);
79 }; 82 };
80 83
81 } // namespace catalog 84 } // namespace catalog
82 85
83 namespace mojo { 86 namespace mojo {
84 template <> 87 template <>
85 struct TypeConverter<service_manager::mojom::ResolveResultPtr, 88 struct TypeConverter<service_manager::mojom::ResolveResultPtr,
86 const catalog::Entry*> { 89 const catalog::Entry*> {
87 static service_manager::mojom::ResolveResultPtr Convert( 90 static service_manager::mojom::ResolveResultPtr Convert(
88 const catalog::Entry* input); 91 const catalog::Entry* input);
89 }; 92 };
90 93
91 template<> 94 template<>
92 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { 95 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> {
93 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); 96 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input);
94 }; 97 };
95 98
96 } // namespace mojo 99 } // namespace mojo
97 100
98 #endif // SERVICES_CATALOG_ENTRY_H_ 101 #endif // SERVICES_CATALOG_ENTRY_H_
OLDNEW
« no previous file with comments | « services/catalog/data/required_files ('k') | services/catalog/entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698