| Index: extensions/common/manifest_handlers/shared_module_info.cc
|
| diff --git a/extensions/common/manifest_handlers/shared_module_info.cc b/extensions/common/manifest_handlers/shared_module_info.cc
|
| index 5f4416099271c38d4565c835eb2f68b9cbe65af0..ac95ee5b07440270e2afb9bb64272c2981473597 100644
|
| --- a/extensions/common/manifest_handlers/shared_module_info.cc
|
| +++ b/extensions/common/manifest_handlers/shared_module_info.cc
|
| @@ -84,6 +84,17 @@ bool SharedModuleInfo::IsExportAllowed(const Extension* extension,
|
| }
|
|
|
| // static
|
| +bool SharedModuleInfo::IsExportAllowedByWhitelist(const Extension* extension,
|
| + const std::string& other_id) {
|
| + const SharedModuleInfo& info = GetSharedModuleInfo(extension);
|
| + if (info.export_whitelist_.empty())
|
| + return true;
|
| + if (info.export_whitelist_.find(other_id) != info.export_whitelist_.end())
|
| + return true;
|
| + return false;
|
| +}
|
| +
|
| +// static
|
| bool SharedModuleInfo::ImportsExtensionById(const Extension* extension,
|
| const std::string& other_id) {
|
| const SharedModuleInfo& info = GetSharedModuleInfo(extension);
|
| @@ -128,6 +139,23 @@ bool SharedModuleInfo::Parse(const Extension* extension,
|
| *error = base::ASCIIToUTF16(errors::kInvalidExportResources);
|
| return false;
|
| }
|
| + if (export_value->HasKey(keys::kWhitelist)) {
|
| + const base::ListValue* whitelist = NULL;
|
| + if (!export_value->GetList(keys::kWhitelist, &whitelist)) {
|
| + *error = base::ASCIIToUTF16(errors::kInvalidExportWhitelist);
|
| + return false;
|
| + }
|
| + for (size_t i = 0; i < whitelist->GetSize(); ++i) {
|
| + std::string extension_id;
|
| + if (!whitelist->GetString(i, &extension_id) ||
|
| + !Extension::IdIsValid(extension_id)) {
|
| + *error = ErrorUtils::FormatErrorMessageUTF16(
|
| + errors::kInvalidExportWhitelistString, base::IntToString(i));
|
| + return false;
|
| + }
|
| + export_whitelist_.insert(extension_id);
|
| + }
|
| + }
|
| for (size_t i = 0; i < resources_list->GetSize(); ++i) {
|
| std::string resource_path;
|
| if (!resources_list->GetString(i, &resource_path)) {
|
|
|