Chromium Code Reviews| Index: chrome/common/json_schema/json_schema_validator.h |
| diff --git a/chrome/common/json_schema/json_schema_validator.h b/chrome/common/json_schema/json_schema_validator.h |
| index e9a1a928a314b7dd2c7eaf216c91a7f4e760e0d6..3b42444c64296ee52ee3f148ee39cac1dc693423 100644 |
| --- a/chrome/common/json_schema/json_schema_validator.h |
| +++ b/chrome/common/json_schema/json_schema_validator.h |
| @@ -10,6 +10,7 @@ |
| #include <vector> |
| #include "base/basictypes.h" |
| +#include "base/memory/scoped_ptr.h" |
| namespace base { |
| class DictionaryValue; |
| @@ -98,6 +99,15 @@ class JSONSchemaValidator { |
| const std::string& s1, |
| const std::string& s2); |
| + // Verifies if |schema| is a valid JSON v3 schema. When this validation passes |
| + // then |schema| is valid JSON that can be parsed into a DictionaryValue, |
| + // and that DictionaryValue can be used to build a JSONSchemaValidator. |
| + // Returns the parsed DictionaryValue when |schema| validated, otherwise |
| + // returns NULL. In that case, |error| contains an error description. |
| + static scoped_ptr<base::DictionaryValue> IsValidSchema( |
| + const std::string& schema, |
| + std::string* error); |
|
not at google - send to devlin
2013/05/16 17:08:20
a static Create method which takes a std::string s
Joao da Silva
2013/05/19 13:16:29
The returned DictionaryValue can be used to build
|
| + |
| // Creates a validator for the specified schema. |
| // |
| // NOTE: This constructor assumes that |schema| is well formed and valid. |