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

Unified Diff: extensions/common/features/json_feature_provider.cc

Issue 2150193002: [Extensions] Add a SimpleFeature::Validate function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Istiaque's Created 4 years, 5 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/features/api_feature.cc ('k') | extensions/common/features/manifest_feature.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/json_feature_provider.cc
diff --git a/extensions/common/features/json_feature_provider.cc b/extensions/common/features/json_feature_provider.cc
index 15eba689bc76c4d23d63a59d8c8ffe08d19968e5..11d95418ec46d0440f30e6733f7608f9d93f8429 100644
--- a/extensions/common/features/json_feature_provider.cc
+++ b/extensions/common/features/json_feature_provider.cc
@@ -35,10 +35,12 @@ bool ParseFeature(const base::DictionaryValue* value,
const std::string& name,
SimpleFeature* feature) {
feature->set_name(name);
- std::string error = feature->Parse(value);
- if (!error.empty())
+ feature->Parse(value);
+ std::string error;
+ bool valid = feature->Validate(&error);
+ if (!valid)
LOG(ERROR) << error;
- return error.empty();
+ return valid;
}
} // namespace
« no previous file with comments | « extensions/common/features/api_feature.cc ('k') | extensions/common/features/manifest_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698