Chromium Code Reviews| Index: mojo/public/cpp/bindings/lib/validate_params.h |
| diff --git a/mojo/public/cpp/bindings/lib/validate_params.h b/mojo/public/cpp/bindings/lib/validate_params.h |
| index 3a21812af8f9a0fdc7ca3d3a297a3efd22bdea5c..c1f67b5f790dfb9f67bcdaab72c229cde4c01863 100644 |
| --- a/mojo/public/cpp/bindings/lib/validate_params.h |
| +++ b/mojo/public/cpp/bindings/lib/validate_params.h |
| @@ -14,16 +14,15 @@ namespace internal { |
| using ValidateEnumFunc = bool (*)(int32_t); |
| -// TODO(tibell): Rename to ContainerValidateParams. |
| -class ArrayValidateParams { |
| +class ContainerValidateParams { |
| public: |
| // Validate a map. A map is validated as a pair of arrays, one for the keys |
| // and one for the values. Both arguments must be non-null. |
| // |
| - // ArrayValidateParams takes ownership of |in_key_validate params| and |
| + // ContainerValidateParams takes ownership of |in_key_validate params| and |
| // |in_element_validate params|. |
| - ArrayValidateParams(ArrayValidateParams* in_key_validate_params, |
| - ArrayValidateParams* in_element_validate_params) |
| + ContainerValidateParams(ContainerValidateParams* in_key_validate_params, |
| + ContainerValidateParams* in_element_validate_params) |
| : expected_num_elements(0), |
| element_is_nullable(false), |
| key_validate_params(in_key_validate_params), |
| @@ -37,10 +36,10 @@ class ArrayValidateParams { |
| // Validate an array. |
| // |
| - // ArrayValidateParams takes ownership of |in_element_validate params|. |
| - ArrayValidateParams(uint32_t in_expected_num_elements, |
| + // ContainerValidateParams takes ownership of |in_element_validate params|. |
| + ContainerValidateParams(uint32_t in_expected_num_elements, |
| bool in_element_is_nullable, |
|
yzshen1
2016/06/02 19:57:03
incorrect indent. Have you run "git cl format"?
tibell
2016/06/03 00:01:30
Done.
|
| - ArrayValidateParams* in_element_validate_params) |
| + ContainerValidateParams* in_element_validate_params) |
| : expected_num_elements(in_expected_num_elements), |
| element_is_nullable(in_element_is_nullable), |
| key_validate_params(nullptr), |
| @@ -48,7 +47,7 @@ class ArrayValidateParams { |
| validate_enum_func(nullptr) {} |
| // Validates an array of enums. |
| - ArrayValidateParams(uint32_t in_expected_num_elements, |
| + ContainerValidateParams(uint32_t in_expected_num_elements, |
| ValidateEnumFunc in_validate_enum_func) |
| : expected_num_elements(in_expected_num_elements), |
| element_is_nullable(false), |
| @@ -56,7 +55,7 @@ class ArrayValidateParams { |
| element_validate_params(nullptr), |
| validate_enum_func(in_validate_enum_func) {} |
| - ~ArrayValidateParams() { |
| + ~ContainerValidateParams() { |
| if (element_validate_params) |
| delete element_validate_params; |
| if (key_validate_params) |
| @@ -71,19 +70,20 @@ class ArrayValidateParams { |
| bool element_is_nullable; |
| // Validation information for map key. It is either a pointer to another |
| - // instance of ArrayValidateParams (if keys are arrays or maps), or nullptr. |
| - ArrayValidateParams* key_validate_params; |
| + // instance of ContainerValidateParams (if keys are arrays or maps), or |
| + // nullptr. |
| + ContainerValidateParams* key_validate_params; |
| // Validation information for elements. It is either a pointer to another |
| - // instance of ArrayValidateParams (if elements are arrays or maps), or |
| + // instance of ContainerValidateParams (if elements are arrays or maps), or |
| // nullptr. In the case of maps, this is used to validate the value array. |
| - ArrayValidateParams* element_validate_params; |
| + ContainerValidateParams* element_validate_params; |
| // Validation function for enum elements. |
| ValidateEnumFunc validate_enum_func; |
| private: |
| - DISALLOW_COPY_AND_ASSIGN(ArrayValidateParams); |
| + DISALLOW_COPY_AND_ASSIGN(ContainerValidateParams); |
| }; |
| } // namespace internal |