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); |
}; |