Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(969)

Side by Side Diff: chromeos/network/onc/onc_validator.h

Issue 11428078: Rejecting networks/certificates individually from ONC during validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@add_error_handling_to_validator
Patch Set: Addressed Steven's comment. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/network/onc/onc_mapper.h ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Compare |onc_value|s type with |onc_type| and validate/repair according to 90 // Compare |onc_value|s type with |onc_type| and validate/repair according to
91 // |signature|. On error returns NULL. 91 // |signature|. On error returns NULL.
92 virtual scoped_ptr<base::Value> MapValue( 92 virtual scoped_ptr<base::Value> MapValue(
93 const OncValueSignature& signature, 93 const OncValueSignature& signature,
94 const base::Value& onc_value, 94 const base::Value& onc_value,
95 bool* error) OVERRIDE; 95 bool* error) OVERRIDE;
96 96
97 // Dispatch to the right validation function according to 97 // Dispatch to the right validation function according to
98 // |signature|. Iterates over all fields and recursively validates/repairs 98 // |signature|. Iterates over all fields and recursively validates/repairs
99 // these. All valid fields are added to the result dictionary. Returns the 99 // these. All valid fields are added to the result dictionary. Returns the
100 // repaired dictionary. On error returns NULL. 100 // repaired dictionary. Only on error returns NULL.
101 virtual scoped_ptr<base::DictionaryValue> MapObject( 101 virtual scoped_ptr<base::DictionaryValue> MapObject(
102 const OncValueSignature& signature, 102 const OncValueSignature& signature,
103 const base::DictionaryValue& onc_object, 103 const base::DictionaryValue& onc_object,
104 bool* error) OVERRIDE; 104 bool* error) OVERRIDE;
105 105
106 // Pushes/pops the |field_name| to |path_|, otherwise like |Mapper::MapField|. 106 // Pushes/pops the |field_name| to |path_|, otherwise like |Mapper::MapField|.
107 virtual scoped_ptr<base::Value> MapField( 107 virtual scoped_ptr<base::Value> MapField(
108 const std::string& field_name, 108 const std::string& field_name,
109 const OncValueSignature& object_signature, 109 const OncValueSignature& object_signature,
110 const base::Value& onc_value, 110 const base::Value& onc_value,
111 bool* found_unknown_field, 111 bool* found_unknown_field,
112 bool* error) OVERRIDE; 112 bool* error) OVERRIDE;
113 113
114 // Ignores nested errors in NetworkConfigurations and Certificates, otherwise
115 // like |Mapper::MapArray|.
116 virtual scoped_ptr<base::ListValue> MapArray(
117 const OncValueSignature& array_signature,
118 const base::ListValue& onc_array,
119 bool* nested_error) OVERRIDE;
120
114 // Pushes/pops the index to |path_|, otherwise like |Mapper::MapEntry|. 121 // Pushes/pops the index to |path_|, otherwise like |Mapper::MapEntry|.
115 virtual scoped_ptr<base::Value> MapEntry( 122 virtual scoped_ptr<base::Value> MapEntry(
116 int index, 123 int index,
117 const OncValueSignature& signature, 124 const OncValueSignature& signature,
118 const base::Value& onc_value, 125 const base::Value& onc_value,
119 bool* error) OVERRIDE; 126 bool* error) OVERRIDE;
120 127
121 // This is the default validation of objects/dictionaries. Validates 128 // This is the default validation of objects/dictionaries. Validates
122 // |onc_object| according to |object_signature|. |result| must point to a 129 // |onc_object| according to |object_signature|. |result| must point to a
123 // dictionary into which the repaired fields are written. 130 // dictionary into which the repaired fields are written.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // function ValidateAndRepairObject. 219 // function ValidateAndRepairObject.
213 bool error_or_warning_found_; 220 bool error_or_warning_found_;
214 221
215 DISALLOW_COPY_AND_ASSIGN(Validator); 222 DISALLOW_COPY_AND_ASSIGN(Validator);
216 }; 223 };
217 224
218 } // namespace onc 225 } // namespace onc
219 } // namespace chromeos 226 } // namespace chromeos
220 227
221 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ 228 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_mapper.h ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698