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

Unified Diff: extensions/common/manifest_handlers/shared_module_info.h

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 | « extensions/common/manifest_constants.cc ('k') | extensions/common/manifest_handlers/shared_module_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handlers/shared_module_info.h
diff --git a/extensions/common/manifest_handlers/shared_module_info.h b/extensions/common/manifest_handlers/shared_module_info.h
index 4240ed7a81778e24e7e31718627d691158facb91..72fd506b21066e13e9a209461779458e705ba4a8 100644
--- a/extensions/common/manifest_handlers/shared_module_info.h
+++ b/extensions/common/manifest_handlers/shared_module_info.h
@@ -36,6 +36,11 @@ class SharedModuleInfo : public Extension::ManifestData {
static bool IsSharedModule(const Extension* extension);
static bool IsExportAllowed(const Extension* extension,
const std::string& relative_path);
+ // Check against the shared module's whitelist to see if |other_id| can import
+ // its resources. If no whitelist is specified, all extensions can import this
+ // extension.
+ static bool IsExportAllowedByWhitelist(const Extension* extension,
+ const std::string& other_id);
// Functions relating to importing resources.
static bool ImportsExtensionById(const Extension* extension,
@@ -47,6 +52,9 @@ class SharedModuleInfo : public Extension::ManifestData {
// This extension exports the following resources to other extensions.
URLPatternSet exported_set_;
+ // Optional list of extensions from which importing is allowed.
+ std::set<std::string> export_whitelist_;
+
// Optional list of module imports of other extensions.
std::vector<ImportInfo> imports_;
};
« no previous file with comments | « extensions/common/manifest_constants.cc ('k') | extensions/common/manifest_handlers/shared_module_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698