Chromium Code Reviews| Index: components/json_schema/json_schema_validator.cc |
| diff --git a/components/json_schema/json_schema_validator.cc b/components/json_schema/json_schema_validator.cc |
| index eadba17b06b8be6e2128015a6ae0fc066d02d0bf..3fc51d2631f4c0de51520f6938a09c6782f91659 100644 |
| --- a/components/json_schema/json_schema_validator.cc |
| +++ b/components/json_schema/json_schema_validator.cc |
| @@ -162,7 +162,10 @@ bool IsValidSchema(const base::DictionaryValue* dict, |
| return false; |
| } |
| - if (!it.value().IsType(entry->type)) { |
| + // Integer can be converted to double. |
| + if (!(it.value().IsType(entry->type) || |
| + it.value().IsType(base::Value::TYPE_INTEGER) && |
| + entry->type == base::Value::TYPE_DOUBLE)) { |
|
Joao da Silva
2014/01/16 10:56:34
This is correct, but add an extra pair of parenthe
binjin
2014/01/17 14:29:01
Done.
|
| *error = base::StringPrintf("Invalid value for %s attribute", |
| it.key().c_str()); |
| return false; |