OLD | NEW |
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 #include "services/catalog/catalog.h" | 5 #include "services/catalog/catalog.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace catalog { | 31 namespace catalog { |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 const char kCatalogServicesKey[] = "services"; | 35 const char kCatalogServicesKey[] = "services"; |
36 const char kCatalogServiceEmbeddedKey[] = "embedded"; | 36 const char kCatalogServiceEmbeddedKey[] = "embedded"; |
37 const char kCatalogServiceExecutableKey[] = "executable"; | 37 const char kCatalogServiceExecutableKey[] = "executable"; |
38 const char kCatalogServiceManifestKey[] = "manifest"; | 38 const char kCatalogServiceManifestKey[] = "manifest"; |
39 | 39 |
40 base::LazyInstance<std::unique_ptr<base::Value>> g_default_static_manifest = | 40 base::LazyInstance<std::unique_ptr<base::Value>>::DestructorAtExit |
41 LAZY_INSTANCE_INITIALIZER; | 41 g_default_static_manifest = LAZY_INSTANCE_INITIALIZER; |
42 | 42 |
43 void LoadCatalogManifestIntoCache(const base::Value* root, EntryCache* cache) { | 43 void LoadCatalogManifestIntoCache(const base::Value* root, EntryCache* cache) { |
44 DCHECK(root); | 44 DCHECK(root); |
45 const base::DictionaryValue* catalog = nullptr; | 45 const base::DictionaryValue* catalog = nullptr; |
46 if (!root->GetAsDictionary(&catalog)) { | 46 if (!root->GetAsDictionary(&catalog)) { |
47 LOG(ERROR) << "Catalog manifest is not a dictionary value."; | 47 LOG(ERROR) << "Catalog manifest is not a dictionary value."; |
48 return; | 48 return; |
49 } | 49 } |
50 DCHECK(catalog); | 50 DCHECK(catalog); |
51 | 51 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 if (it != instances_.end()) | 202 if (it != instances_.end()) |
203 return it->second.get(); | 203 return it->second.get(); |
204 | 204 |
205 auto result = instances_.insert(std::make_pair( | 205 auto result = instances_.insert(std::make_pair( |
206 user_id, | 206 user_id, |
207 base::MakeUnique<Instance>(&system_cache_, service_manifest_provider_))); | 207 base::MakeUnique<Instance>(&system_cache_, service_manifest_provider_))); |
208 return result.first->second.get(); | 208 return result.first->second.get(); |
209 } | 209 } |
210 | 210 |
211 } // namespace catalog | 211 } // namespace catalog |
OLD | NEW |