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

Unified Diff: components/policy/core/common/schema.cc

Issue 94043003: Ignore unknown attributes when parsing JSON schemas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added flag Created 7 years 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: components/policy/core/common/schema.cc
diff --git a/components/policy/core/common/schema.cc b/components/policy/core/common/schema.cc
index 0129094c75a0da6773318f81e40b3dfca581177c..bdeeaba624fc3add826060d897ad1308096fd2c8 100644
--- a/components/policy/core/common/schema.cc
+++ b/components/policy/core/common/schema.cc
@@ -500,9 +500,10 @@ bool Schema::Validate(const base::Value& value) const {
// static
Schema Schema::Parse(const std::string& content, std::string* error) {
- // Validate as a generic JSON schema.
+ // Validate as a generic JSON schema, and ignore unknown attributes; they
+ // may become used in a future version of the schema format.
scoped_ptr<base::DictionaryValue> dict =
- JSONSchemaValidator::IsValidSchema(content, error);
+ JSONSchemaValidator::IsValidSchema(content, false, error);
if (!dict)
return Schema();

Powered by Google App Engine
This is Rietveld 408576698