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

Unified Diff: chrome/common/extensions/features/simple_feature.cc

Issue 12846011: Implement API features for the Extension API feature system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed memory leak Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/features/simple_feature.cc
diff --git a/chrome/common/extensions/features/simple_feature.cc b/chrome/common/extensions/features/simple_feature.cc
index de973400d097079d874b5e5ad51ab3fdaeb4029a..9011e351af160a70027e37e98b3405181ddf5432 100644
--- a/chrome/common/extensions/features/simple_feature.cc
+++ b/chrome/common/extensions/features/simple_feature.cc
@@ -208,9 +208,10 @@ bool SimpleFeature::Equals(const SimpleFeature& other) const {
channel_ == other.channel_;
}
-void SimpleFeature::Parse(const DictionaryValue* value) {
+std::string SimpleFeature::Parse(const DictionaryValue* value) {
ParseURLPatterns(value, "matches", &matches_);
ParseSet(value, "whitelist", &whitelist_);
+ ParseSet(value, "dependencies", &dependencies_);
ParseEnumSet<Manifest::Type>(value, "extension_types", &extension_types_,
g_mappings.Get().extension_types);
ParseEnumSet<Context>(value, "contexts", &contexts_,
@@ -224,6 +225,11 @@ void SimpleFeature::Parse(const DictionaryValue* value) {
ParseEnum<VersionInfo::Channel>(
value, "channel", &channel_,
g_mappings.Get().channels);
+ if (matches_.is_empty() && contexts_.count(WEB_PAGE_CONTEXT) != 0) {
+ return name() + ": Allowing web_page contexts requires supplying a value " +
+ "for matches.";
+ }
+ return "";
}
Feature::Availability SimpleFeature::IsAvailableToManifest(

Powered by Google App Engine
This is Rietveld 408576698