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

Unified Diff: services/catalog/catalog.cc

Issue 2573283002: Use a static catalog manifest for the standalone Mash runner (Closed)
Patch Set: . Created 4 years 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/catalog.h ('k') | services/catalog/instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/catalog/catalog.cc
diff --git a/services/catalog/catalog.cc b/services/catalog/catalog.cc
index 75a2e4e441f812f82ae28de5397ff26195099f44..1ebce997756d991691bcde3f601da023e203f2b8 100644
--- a/services/catalog/catalog.cc
+++ b/services/catalog/catalog.cc
@@ -86,18 +86,19 @@ class Catalog::ServiceImpl : public service_manager::Service {
DISALLOW_COPY_AND_ASSIGN(ServiceImpl);
};
+Catalog::Catalog(std::unique_ptr<base::Value> static_manifest) : Catalog() {
+ system_reader_.reset(new Reader(std::move(static_manifest), &system_cache_));
+ loaded_ = true;
+}
+
Catalog::Catalog(base::SequencedWorkerPool* worker_pool,
- std::unique_ptr<Store> store,
- ManifestProvider* manifest_provider)
- : Catalog(std::move(store)) {
+ ManifestProvider* manifest_provider) : Catalog() {
system_reader_.reset(new Reader(worker_pool, manifest_provider));
ScanSystemPackageDir();
}
Catalog::Catalog(base::SingleThreadTaskRunner* task_runner,
- std::unique_ptr<Store> store,
- ManifestProvider* manifest_provider)
- : Catalog(std::move(store)) {
+ ManifestProvider* manifest_provider) : Catalog() {
system_reader_.reset(new Reader(task_runner, manifest_provider));
ScanSystemPackageDir();
}
@@ -113,11 +114,10 @@ service_manager::mojom::ServicePtr Catalog::TakeService() {
return std::move(service_);
}
-Catalog::Catalog(std::unique_ptr<Store> store)
- : store_(std::move(store)), weak_factory_(this) {
- service_manager::mojom::ServiceRequest request(&service_);
+Catalog::Catalog() : weak_factory_(this) {
service_context_.reset(new service_manager::ServiceContext(
- base::MakeUnique<ServiceImpl>(this), std::move(request)));
+ base::MakeUnique<ServiceImpl>(this),
+ service_manager::mojom::ServiceRequest(&service_)));
}
void Catalog::ScanSystemPackageDir() {
@@ -172,8 +172,7 @@ Instance* Catalog::GetInstanceForUserId(const std::string& user_id) {
if (it != instances_.end())
return it->second.get();
- // TODO(beng): There needs to be a way to load the store from different users.
- Instance* instance = new Instance(std::move(store_), system_reader_.get());
+ Instance* instance = new Instance(system_reader_.get());
instances_[user_id] = base::WrapUnique(instance);
if (loaded_)
instance->CacheReady(&system_cache_);
« no previous file with comments | « services/catalog/catalog.h ('k') | services/catalog/instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698