| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |