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

Side by Side Diff: services/catalog/catalog.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 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 unified diff | Download patch
« no previous file with comments | « remoting/host/win/rdp_client_window.cc ('k') | services/file/user_id_map.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « remoting/host/win/rdp_client_window.cc ('k') | services/file/user_id_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698