| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/json_schema/json_schema_validator.h" | 5 #include "components/json_schema/json_schema_validator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cfloat> | 8 #include <cfloat> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "components/json_schema/json_schema_constants.h" | 16 #include "components/json_schema/json_schema_constants.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | |
| 18 | 17 |
| 19 namespace schema = json_schema_constants; | 18 namespace schema = json_schema_constants; |
| 20 | 19 |
| 21 namespace { | 20 namespace { |
| 22 | 21 |
| 23 double GetNumberValue(const base::Value* value) { | 22 double GetNumberValue(const base::Value* value) { |
| 24 double result = 0; | 23 double result = 0; |
| 25 CHECK(value->GetAsDouble(&result)) | 24 CHECK(value->GetAsDouble(&result)) |
| 26 << "Unexpected value type: " << value->GetType(); | 25 << "Unexpected value type: " << value->GetType(); |
| 27 return result; | 26 return result; |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 | 758 |
| 760 if (*additional_properties_schema) { | 759 if (*additional_properties_schema) { |
| 761 std::string additional_properties_type(schema::kAny); | 760 std::string additional_properties_type(schema::kAny); |
| 762 CHECK((*additional_properties_schema)->GetString( | 761 CHECK((*additional_properties_schema)->GetString( |
| 763 schema::kType, &additional_properties_type)); | 762 schema::kType, &additional_properties_type)); |
| 764 return additional_properties_type == schema::kAny; | 763 return additional_properties_type == schema::kAny; |
| 765 } else { | 764 } else { |
| 766 return default_allow_additional_properties_; | 765 return default_allow_additional_properties_; |
| 767 } | 766 } |
| 768 } | 767 } |
| OLD | NEW |