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

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

Issue 759663004: ONC: add support for non-utf-8 SSIDs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 const std::vector<const char*>& valid_values); 175 const std::vector<const char*>& valid_values);
176 176
177 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, 177 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object,
178 const std::string &field_name, 178 const std::string &field_name,
179 int lower_bound, 179 int lower_bound,
180 int upper_bound); 180 int upper_bound);
181 181
182 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, 182 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object,
183 const std::string& field_name); 183 const std::string& field_name);
184 184
185 bool IsSSIDOrHexSSIDValid(const base::DictionaryValue& object,
186 const std::string& ssid_field_name,
187 const std::string& hex_ssid_field_name);
188
185 // Returns true if |key| is a key of |dict|. Otherwise, returns false and, 189 // Returns true if |key| is a key of |dict|. Otherwise, returns false and,
186 // depending on |error_on_missing_field_|, logs a message and sets 190 // depending on |error_on_missing_field_|, logs a message and sets
187 // |error_or_warning_found_|. 191 // |error_or_warning_found_|.
188 bool RequireField(const base::DictionaryValue& dict, const std::string& key); 192 bool RequireField(const base::DictionaryValue& dict, const std::string& key);
189 193
190 // Returns true if the GUID is unique or if the GUID is not a string 194 // Returns true if the GUID is unique or if the GUID is not a string
191 // and false otherwise. The function also adds the GUID to a set in 195 // and false otherwise. The function also adds the GUID to a set in
192 // order to identify duplicates. 196 // order to identify duplicates.
193 bool CheckGuidIsUniqueAndAddToSet(const base::DictionaryValue& dict, 197 bool CheckGuidIsUniqueAndAddToSet(const base::DictionaryValue& dict,
194 const std::string& kGUID, 198 const std::string& kGUID,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // function ValidateAndRepairObject. 231 // function ValidateAndRepairObject.
228 bool error_or_warning_found_; 232 bool error_or_warning_found_;
229 233
230 DISALLOW_COPY_AND_ASSIGN(Validator); 234 DISALLOW_COPY_AND_ASSIGN(Validator);
231 }; 235 };
232 236
233 } // namespace onc 237 } // namespace onc
234 } // namespace chromeos 238 } // namespace chromeos
235 239
236 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ 240 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698