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

Unified Diff: mojo/services/catalog/catalog.h

Issue 1821383002: Moves manifest parsing to a new class, Reader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@60catref
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/catalog/BUILD.gn ('k') | mojo/services/catalog/catalog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/catalog/catalog.h
diff --git a/mojo/services/catalog/catalog.h b/mojo/services/catalog/catalog.h
index e4bc6a547e54a160f018882ab27a2f81edea3ede..8f949c3219be4aecde56e63ca02e57f197eff21c 100644
--- a/mojo/services/catalog/catalog.h
+++ b/mojo/services/catalog/catalog.h
@@ -13,10 +13,10 @@
#include "mojo/services/catalog/entry.h"
#include "mojo/services/catalog/public/interfaces/catalog.mojom.h"
#include "mojo/services/catalog/public/interfaces/resolver.mojom.h"
+#include "mojo/services/catalog/reader.h"
#include "mojo/services/catalog/store.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/interfaces/shell_resolver.mojom.h"
-#include "url/gurl.h"
namespace catalog {
@@ -65,36 +65,26 @@ class Catalog : public mojom::Resolver,
bool IsNameInCatalog(const std::string& name) const;
- // Called from ResolveMojoName().
- // Attempts to load a manifest for |name|, reads it and adds its metadata to
- // the catalog.
- void AddNameToCatalog(const std::string& name,
- const ResolveMojoNameCallback& callback);
-
// Populate/serialize the catalog from/to the supplied store.
void DeserializeCatalog();
void SerializeCatalog();
+ // Callback for Reader, receives an Entry constructed from the manifest for
+ // |name|.
+ static void OnReadEntry(base::WeakPtr<Catalog> catalog,
+ const std::string& name,
+ const ResolveMojoNameCallback& callback,
+ scoped_ptr<Entry> entry);
+ void OnReadEntryImpl(const std::string& name,
+ const ResolveMojoNameCallback& callback,
+ scoped_ptr<Entry> entry);
+
// Construct a catalog entry from |dictionary|.
scoped_ptr<Entry> DeserializeApplication(
const base::DictionaryValue* dictionary);
- GURL GetManifestURL(const std::string& name);
-
- // Called once the manifest has been read. |pm| may be null at this point,
- // but |callback| must be run.
- static void OnReadManifest(base::WeakPtr<Catalog> catalog,
- const std::string& name,
- const ResolveMojoNameCallback& callback,
- scoped_ptr<base::Value> manifest);
-
- // Called once the manifest is read and |this| hasn't been deleted.
- void OnReadManifestImpl(const std::string& name,
- const ResolveMojoNameCallback& callback,
- scoped_ptr<base::Value> manifest);
-
- base::TaskRunner* blocking_pool_;
- GURL system_package_dir_;
+ scoped_ptr<Reader> reader_;
+ base::FilePath package_path_;
mojo::BindingSet<mojom::Resolver> resolver_bindings_;
mojo::BindingSet<mojo::shell::mojom::ShellResolver> shell_resolver_bindings_;
« no previous file with comments | « mojo/services/catalog/BUILD.gn ('k') | mojo/services/catalog/catalog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698