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

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

Issue 1818373003: Move serialize/deserialize logic onto Entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « mojo/services/catalog/builder_unittest.cc ('k') | mojo/services/catalog/catalog.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 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
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 scoped_ptr<Entry> DeserializeApplication(
80 const base::DictionaryValue* dictionary);
80 81
81 GURL GetManifestURL(const std::string& name); 82 GURL GetManifestURL(const std::string& name);
82 83
83 // Called once the manifest has been read. |pm| may be null at this point, 84 // Called once the manifest has been read. |pm| may be null at this point,
84 // but |callback| must be run. 85 // but |callback| must be run.
85 static void OnReadManifest(base::WeakPtr<Catalog> catalog, 86 static void OnReadManifest(base::WeakPtr<Catalog> catalog,
86 const std::string& name, 87 const std::string& name,
87 const ResolveMojoNameCallback& callback, 88 const ResolveMojoNameCallback& callback,
88 scoped_ptr<base::Value> manifest); 89 scoped_ptr<base::Value> manifest);
89 90
(...skipping 20 matching lines...) Expand all
110 std::map<std::string, std::string> qualifiers_; 111 std::map<std::string, std::string> qualifiers_;
111 112
112 base::WeakPtrFactory<Catalog> weak_factory_; 113 base::WeakPtrFactory<Catalog> weak_factory_;
113 114
114 DISALLOW_COPY_AND_ASSIGN(Catalog); 115 DISALLOW_COPY_AND_ASSIGN(Catalog);
115 }; 116 };
116 117
117 } // namespace catalog 118 } // namespace catalog
118 119
119 #endif // MOJO_SERVICES_CATALOG_CATALOG_H_ 120 #endif // MOJO_SERVICES_CATALOG_CATALOG_H_
OLDNEW
« no previous file with comments | « mojo/services/catalog/builder_unittest.cc ('k') | mojo/services/catalog/catalog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698