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

Unified Diff: chrome/browser/extensions/crx_installer.cc

Issue 263703002: Allow shared modules to whitelist extensions that import them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/shared_module_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index f419eab38665ea39cbda5627996314b25a058d76..9a5e4ef6c0adddbe057327a420eb99c1bd36a0f0 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -491,7 +491,6 @@ void CrxInstaller::CheckImportsAndRequirements() {
SharedModuleInfo::GetImports(extension());
std::vector<SharedModuleInfo::ImportInfo>::const_iterator i;
for (i = imports.begin(); i != imports.end(); ++i) {
- Version version_required(i->minimum_version);
const Extension* imported_module =
service->GetExtensionById(i->extension_id, true);
if (imported_module &&
@@ -501,6 +500,14 @@ void CrxInstaller::CheckImportsAndRequirements() {
IDS_EXTENSION_INSTALL_DEPENDENCY_NOT_SHARED_MODULE,
base::ASCIIToUTF16(i->extension_id))));
return;
+ } else if (imported_module &&
+ !SharedModuleInfo::IsExportAllowedByWhitelist(imported_module,
+ extension()->id())) {
+ ReportFailureFromUIThread(
+ CrxInstallerError(l10n_util::GetStringFUTF16(
+ IDS_EXTENSION_INSTALL_DEPENDENCY_NOT_WHITELISTED,
+ base::ASCIIToUTF16(i->extension_id))));
+ return;
}
}
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/shared_module_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698