| 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 24 matching lines...) Expand all Loading... |
| 35 static std::unique_ptr<Entry> Deserialize(const base::DictionaryValue& value); | 35 static std::unique_ptr<Entry> Deserialize(const base::DictionaryValue& value); |
| 36 | 36 |
| 37 bool ProvidesCapability(const std::string& capability) const; | 37 bool ProvidesCapability(const std::string& capability) const; |
| 38 | 38 |
| 39 bool operator==(const Entry& other) const; | 39 bool operator==(const Entry& other) const; |
| 40 | 40 |
| 41 const std::string& name() const { return name_; } | 41 const std::string& name() const { return name_; } |
| 42 void set_name(const std::string& name) { name_ = name; } | 42 void set_name(const std::string& name) { name_ = name; } |
| 43 const base::FilePath& path() const { return path_; } | 43 const base::FilePath& path() const { return path_; } |
| 44 void set_path(const base::FilePath& path) { path_ = path; } | 44 void set_path(const base::FilePath& path) { path_ = path; } |
| 45 const std::string& qualifier() const { return qualifier_; } | |
| 46 void set_qualifier(const std::string& qualifier) { qualifier_ = qualifier; } | |
| 47 const std::string& display_name() const { return display_name_; } | 45 const std::string& display_name() const { return display_name_; } |
| 48 void set_display_name(const std::string& display_name) { | 46 void set_display_name(const std::string& display_name) { |
| 49 display_name_ = display_name; | 47 display_name_ = display_name; |
| 50 } | 48 } |
| 51 void AddInterfaceProviderSpec( | 49 void AddInterfaceProviderSpec( |
| 52 const std::string& name, | 50 const std::string& name, |
| 53 const service_manager::InterfaceProviderSpec& spec); | 51 const service_manager::InterfaceProviderSpec& spec); |
| 54 const service_manager::InterfaceProviderSpecMap& | 52 const service_manager::InterfaceProviderSpecMap& |
| 55 interface_provider_specs() const { | 53 interface_provider_specs() const { |
| 56 return interface_provider_specs_; | 54 return interface_provider_specs_; |
| 57 } | 55 } |
| 58 const Entry* package() const { return package_; } | 56 const Entry* package() const { return package_; } |
| 59 void set_package(Entry* package) { package_ = package; } | 57 void set_package(Entry* package) { package_ = package; } |
| 60 | 58 |
| 61 std::vector<std::unique_ptr<Entry>> TakeChildren() { | 59 std::vector<std::unique_ptr<Entry>> TakeChildren() { |
| 62 return std::move(children_); | 60 return std::move(children_); |
| 63 } | 61 } |
| 64 | 62 |
| 65 private: | 63 private: |
| 66 std::string name_; | 64 std::string name_; |
| 67 base::FilePath path_; | 65 base::FilePath path_; |
| 68 std::string qualifier_; | |
| 69 std::string display_name_; | 66 std::string display_name_; |
| 70 service_manager::InterfaceProviderSpecMap interface_provider_specs_; | 67 service_manager::InterfaceProviderSpecMap interface_provider_specs_; |
| 71 Entry* package_ = nullptr; | 68 Entry* package_ = nullptr; |
| 72 std::vector<std::unique_ptr<Entry>> children_; | 69 std::vector<std::unique_ptr<Entry>> children_; |
| 73 }; | 70 }; |
| 74 | 71 |
| 75 } // namespace catalog | 72 } // namespace catalog |
| 76 | 73 |
| 77 namespace mojo { | 74 namespace mojo { |
| 78 template <> | 75 template <> |
| 79 struct TypeConverter<service_manager::mojom::ResolveResultPtr, catalog::Entry> { | 76 struct TypeConverter<service_manager::mojom::ResolveResultPtr, catalog::Entry> { |
| 80 static service_manager::mojom::ResolveResultPtr Convert( | 77 static service_manager::mojom::ResolveResultPtr Convert( |
| 81 const catalog::Entry& input); | 78 const catalog::Entry& input); |
| 82 }; | 79 }; |
| 83 | 80 |
| 84 template<> | 81 template<> |
| 85 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { | 82 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { |
| 86 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); | 83 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); |
| 87 }; | 84 }; |
| 88 | 85 |
| 89 } // namespace mojo | 86 } // namespace mojo |
| 90 | 87 |
| 91 #endif // SERVICES_CATALOG_ENTRY_H_ | 88 #endif // SERVICES_CATALOG_ENTRY_H_ |
| OLD | NEW |