Index: components/policy/core/common/schema.h |
diff --git a/components/policy/core/common/schema.h b/components/policy/core/common/schema.h |
index 169fff5bc3651459c653ecdf340ac9e677d28fbb..2450c8ab057e28af7b38a7a463359e7ba15f14a8 100644 |
--- a/components/policy/core/common/schema.h |
+++ b/components/policy/core/common/schema.h |
@@ -79,18 +79,21 @@ class POLICY_EXPORT Schema { |
// Validate |value| against current schema, |strategy| is the strategy to |
// handle unknown properties or invalid values. Allowed errors will be |
- // ignored. If |value| don't conform the schema, false will be returned and |
- // |error| will contain the detailed reason. |
+ // ignored. |error_path| and |error| will contain the last error location and |
+ // detailed message if |value| don't conform the schema strictly. If |value| |
Joao da Silva
2014/01/23 20:59:31
"if |value| doesn't strictly conform to the schema
binjin
2014/01/23 21:21:58
Done.
|
+ // don't conform the schema even within the allowance of |strategy|, false |
Joao da Silva
2014/01/23 20:59:31
"doesn't conform to the schema [...]"
binjin
2014/01/23 21:21:58
Done.
|
+ // will be returned and |error_path| and |error| will contain the |
+ // corresponding error caused the failure. |error_path| can be NULL and in |
Joao da Silva
2014/01/23 20:59:31
"[..] error that caused the failure."
binjin
2014/01/23 21:21:58
Done.
|
+ // that case no error path will be returned. |
bool Validate(const base::Value& value, |
SchemaOnErrorStrategy strategy, |
+ std::string* error_path, |
std::string* error) const; |
- // Validate |value| against current schema, |strategy| is the strategy to |
- // handle unknown properties or invalid values. Allowed errors will be |
- // dropped in place. If |value| don't conform the schema, false will be |
- // returned and |error| will contain the detailed message. |
+ // Same as Validate() but drop values with errors instead of ignoring them. |
bool Normalize(base::Value* value, |
SchemaOnErrorStrategy strategy, |
+ std::string* error_path, |
std::string* error) const; |
// Used to iterate over the known properties of TYPE_DICTIONARY schemas. |
@@ -152,7 +155,7 @@ class POLICY_EXPORT Schema { |
const internal::SchemaNode* node); |
bool ValidateIntegerRestriction(int index, int value) const; |
- bool ValidateStringRestriction(int index, const char *str) const; |
+ bool ValidateStringRestriction(int index, const char* str) const; |
scoped_refptr<const InternalStorage> storage_; |
const internal::SchemaNode* node_; |