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

Side by Side Diff: extensions/common/manifest_handlers/shared_module_info.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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/common/manifest_handlers/shared_module_info.h" 5 #include "extensions/common/manifest_handlers/shared_module_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 14 matching lines...) Expand all
25 namespace extensions { 25 namespace extensions {
26 26
27 namespace keys = manifest_keys; 27 namespace keys = manifest_keys;
28 namespace values = manifest_values; 28 namespace values = manifest_values;
29 namespace errors = manifest_errors; 29 namespace errors = manifest_errors;
30 30
31 namespace { 31 namespace {
32 32
33 const char kSharedModule[] = "shared_module"; 33 const char kSharedModule[] = "shared_module";
34 34
35 static base::LazyInstance<SharedModuleInfo> g_empty_shared_module_info = 35 static base::LazyInstance<SharedModuleInfo>::DestructorAtExit
36 LAZY_INSTANCE_INITIALIZER; 36 g_empty_shared_module_info = LAZY_INSTANCE_INITIALIZER;
37 37
38 const SharedModuleInfo& GetSharedModuleInfo(const Extension* extension) { 38 const SharedModuleInfo& GetSharedModuleInfo(const Extension* extension) {
39 SharedModuleInfo* info = static_cast<SharedModuleInfo*>( 39 SharedModuleInfo* info = static_cast<SharedModuleInfo*>(
40 extension->GetManifestData(kSharedModule)); 40 extension->GetManifestData(kSharedModule));
41 if (!info) 41 if (!info)
42 return g_empty_shared_module_info.Get(); 42 return g_empty_shared_module_info.Get();
43 return *info; 43 return *info;
44 } 44 }
45 45
46 } // namespace 46 } // namespace
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 const std::vector<std::string> SharedModuleHandler::Keys() const { 232 const std::vector<std::string> SharedModuleHandler::Keys() const {
233 static const char* keys[] = { 233 static const char* keys[] = {
234 keys::kExport, 234 keys::kExport,
235 keys::kImport 235 keys::kImport
236 }; 236 };
237 return std::vector<std::string>(keys, keys + arraysize(keys)); 237 return std::vector<std::string>(keys, keys + arraysize(keys));
238 } 238 }
239 239
240 } // namespace extensions 240 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/manifest_handlers/sandboxed_page_info.cc ('k') | extensions/common/message_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698