| 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 MOJO_SERVICES_CATALOG_CATALOG_H_ | 5 #ifndef MOJO_SERVICES_CATALOG_CATALOG_H_ |
| 6 #define MOJO_SERVICES_CATALOG_CATALOG_H_ | 6 #define MOJO_SERVICES_CATALOG_CATALOG_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Attempts to load a manifest for |name|, reads it and adds its metadata to | 69 // Attempts to load a manifest for |name|, reads it and adds its metadata to |
| 70 // the catalog. | 70 // the catalog. |
| 71 void AddNameToCatalog(const std::string& name, | 71 void AddNameToCatalog(const std::string& name, |
| 72 const ResolveMojoNameCallback& callback); | 72 const ResolveMojoNameCallback& callback); |
| 73 | 73 |
| 74 // Populate/serialize the catalog from/to the supplied store. | 74 // Populate/serialize the catalog from/to the supplied store. |
| 75 void DeserializeCatalog(); | 75 void DeserializeCatalog(); |
| 76 void SerializeCatalog(); | 76 void SerializeCatalog(); |
| 77 | 77 |
| 78 // Construct a catalog entry from |dictionary|. | 78 // Construct a catalog entry from |dictionary|. |
| 79 const Entry& DeserializeApplication(const base::DictionaryValue* dictionary); | 79 Entry::DeserializeResult DeserializeApplication( |
| 80 const base::DictionaryValue* dictionary, |
| 81 Entry* out_entry); |
| 80 | 82 |
| 81 GURL GetManifestURL(const std::string& name); | 83 GURL GetManifestURL(const std::string& name); |
| 82 | 84 |
| 83 // Called once the manifest has been read. |pm| may be null at this point, | 85 // Called once the manifest has been read. |pm| may be null at this point, |
| 84 // but |callback| must be run. | 86 // but |callback| must be run. |
| 85 static void OnReadManifest(base::WeakPtr<Catalog> catalog, | 87 static void OnReadManifest(base::WeakPtr<Catalog> catalog, |
| 86 const std::string& name, | 88 const std::string& name, |
| 87 const ResolveMojoNameCallback& callback, | 89 const ResolveMojoNameCallback& callback, |
| 88 scoped_ptr<base::Value> manifest); | 90 scoped_ptr<base::Value> manifest); |
| 89 | 91 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 110 std::map<std::string, std::string> qualifiers_; | 112 std::map<std::string, std::string> qualifiers_; |
| 111 | 113 |
| 112 base::WeakPtrFactory<Catalog> weak_factory_; | 114 base::WeakPtrFactory<Catalog> weak_factory_; |
| 113 | 115 |
| 114 DISALLOW_COPY_AND_ASSIGN(Catalog); | 116 DISALLOW_COPY_AND_ASSIGN(Catalog); |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 } // namespace catalog | 119 } // namespace catalog |
| 118 | 120 |
| 119 #endif // MOJO_SERVICES_CATALOG_CATALOG_H_ | 121 #endif // MOJO_SERVICES_CATALOG_CATALOG_H_ |
| OLD | NEW |