OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 bool* error) OVERRIDE; | 97 bool* error) OVERRIDE; |
98 | 98 |
99 // Pushes/pops the |field_name| to |path_|, otherwise like |Mapper::MapField|. | 99 // Pushes/pops the |field_name| to |path_|, otherwise like |Mapper::MapField|. |
100 virtual scoped_ptr<base::Value> MapField( | 100 virtual scoped_ptr<base::Value> MapField( |
101 const std::string& field_name, | 101 const std::string& field_name, |
102 const OncValueSignature& object_signature, | 102 const OncValueSignature& object_signature, |
103 const base::Value& onc_value, | 103 const base::Value& onc_value, |
104 bool* found_unknown_field, | 104 bool* found_unknown_field, |
105 bool* error) OVERRIDE; | 105 bool* error) OVERRIDE; |
106 | 106 |
| 107 // Ignores nested errors in NetworkConfigurations and Certificates, otherwise |
| 108 // like |Mapper::MapArray|. |
| 109 virtual scoped_ptr<base::ListValue> MapArray( |
| 110 const OncValueSignature& array_signature, |
| 111 const base::ListValue& onc_array, |
| 112 bool* nested_error) OVERRIDE; |
| 113 |
107 // Pushes/pops the index to |path_|, otherwise like |Mapper::MapEntry|. | 114 // Pushes/pops the index to |path_|, otherwise like |Mapper::MapEntry|. |
108 virtual scoped_ptr<base::Value> MapEntry( | 115 virtual scoped_ptr<base::Value> MapEntry( |
109 int index, | 116 int index, |
110 const OncValueSignature& signature, | 117 const OncValueSignature& signature, |
111 const base::Value& onc_value, | 118 const base::Value& onc_value, |
112 bool* error) OVERRIDE; | 119 bool* error) OVERRIDE; |
113 | 120 |
114 // This is the default validation of objects/dictionaries. Validates | 121 // This is the default validation of objects/dictionaries. Validates |
115 // |onc_object| according to |object_signature|. |result| must point to a | 122 // |onc_object| according to |object_signature|. |result| must point to a |
116 // dictionary into which the repaired fields are written. | 123 // dictionary into which the repaired fields are written. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // function ValidateAndRepairObject. | 212 // function ValidateAndRepairObject. |
206 bool error_or_warning_found_; | 213 bool error_or_warning_found_; |
207 | 214 |
208 DISALLOW_COPY_AND_ASSIGN(Validator); | 215 DISALLOW_COPY_AND_ASSIGN(Validator); |
209 }; | 216 }; |
210 | 217 |
211 } // namespace onc | 218 } // namespace onc |
212 } // namespace chromeos | 219 } // namespace chromeos |
213 | 220 |
214 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 221 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
OLD | NEW |