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

Unified Diff: services/catalog/instance.h

Issue 2651953002: Revert of [Service Manager] Get rid of dynamic service discovery (Closed)
Patch Set: Created 3 years, 11 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 | « services/catalog/entry.cc ('k') | services/catalog/instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/catalog/instance.h
diff --git a/services/catalog/instance.h b/services/catalog/instance.h
index fa1a4cb153f28167987c36c4c440db0c9150968b..7c67b893b386316ee532e1d9623322466004f2ca 100644
--- a/services/catalog/instance.h
+++ b/services/catalog/instance.h
@@ -18,19 +18,20 @@
namespace catalog {
class EntryCache;
-class ManifestProvider;
+class Reader;
class Instance : public service_manager::mojom::Resolver,
public mojom::Catalog {
public:
- // Neither |system_cache| nor |service_manifest_provider| is owned.
- // |service_manifest_provider| may be null
- Instance(EntryCache* system_cache,
- ManifestProvider* service_manifest_provider);
+ // |manifest_provider| may be null.
+ explicit Instance(Reader* system_reader);
~Instance() override;
void BindResolver(service_manager::mojom::ResolverRequest request);
void BindCatalog(mojom::CatalogRequest request);
+
+ // Called when |cache| has been populated by a directory scan.
+ void CacheReady(EntryCache* cache);
private:
// service_manager::mojom::Resolver:
@@ -53,14 +54,18 @@
mojo::BindingSet<service_manager::mojom::Resolver> resolver_bindings_;
mojo::BindingSet<mojom::Catalog> catalog_bindings_;
+ Reader* system_reader_;
+
// A map of name -> Entry data structure for system-level packages (i.e. those
// that are visible to all users).
// TODO(beng): eventually add per-user applications.
- EntryCache* const system_cache_;
+ EntryCache* system_cache_ = nullptr;
- // A runtime interface the embedder can use to provide dynamic manifest data
- // to be queried on-demand if something can't be found in |system_cache_|.
- ManifestProvider* const service_manifest_provider_;
+ // We only bind requests for these interfaces once the catalog has been
+ // populated. These data structures queue requests until that happens.
+ std::vector<service_manager::mojom::ResolverRequest>
+ pending_resolver_requests_;
+ std::vector<mojom::CatalogRequest> pending_catalog_requests_;
DISALLOW_COPY_AND_ASSIGN(Instance);
};
« no previous file with comments | « services/catalog/entry.cc ('k') | services/catalog/instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698