| 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 #include "chromeos/network/onc/onc_validator.h" | 5 #include "chromeos/network/onc/onc_validator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 const OncFieldSignature* field_signature = | 252 const OncFieldSignature* field_signature = |
| 253 GetFieldSignature(object_signature, field_name); | 253 GetFieldSignature(object_signature, field_name); |
| 254 | 254 |
| 255 bool found_error = false; | 255 bool found_error = false; |
| 256 std::string error_cause; | 256 std::string error_cause; |
| 257 if (!field_signature) { | 257 if (!field_signature) { |
| 258 found_error = true; | 258 found_error = true; |
| 259 error_cause = "unknown"; | 259 error_cause = "unknown"; |
| 260 } else if (field_signature->value_signature->onc_type == | 260 } else if (field_signature->value_signature->onc_type == |
| 261 base::Value::TYPE_DICTIONARY) { | 261 base::Value::Type::DICTIONARY) { |
| 262 found_error = true; | 262 found_error = true; |
| 263 error_cause = "dictionary-typed"; | 263 error_cause = "dictionary-typed"; |
| 264 } | 264 } |
| 265 | 265 |
| 266 if (found_error) { | 266 if (found_error) { |
| 267 error_or_warning_found_ = true; | 267 error_or_warning_found_ = true; |
| 268 path_.push_back(::onc::kRecommended); | 268 path_.push_back(::onc::kRecommended); |
| 269 std::string message = MessageHeader() + "The " + error_cause + | 269 std::string message = MessageHeader() + "The " + error_cause + |
| 270 " field '" + field_name + "' cannot be recommended."; | 270 " field '" + field_name + "' cannot be recommended."; |
| 271 path_.pop_back(); | 271 path_.pop_back(); |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 std::string Validator::MessageHeader() { | 1018 std::string Validator::MessageHeader() { |
| 1019 std::string path = path_.empty() ? "toplevel" : base::JoinString(path_, "."); | 1019 std::string path = path_.empty() ? "toplevel" : base::JoinString(path_, "."); |
| 1020 std::string message = "At " + path + ": "; | 1020 std::string message = "At " + path + ": "; |
| 1021 return message; | 1021 return message; |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 } // namespace onc | 1024 } // namespace onc |
| 1025 } // namespace chromeos | 1025 } // namespace chromeos |
| OLD | NEW |