| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/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 "chrome/common/json_schema/json_schema_constants.h" | 16 #include "components/json_schema/json_schema_constants.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 18 | 18 |
| 19 namespace schema = json_schema_constants; | 19 namespace schema = json_schema_constants; |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 double GetNumberValue(const base::Value* value) { | 23 double GetNumberValue(const base::Value* value) { |
| 24 double result = 0; | 24 double result = 0; |
| 25 CHECK(value->GetAsDouble(&result)) | 25 CHECK(value->GetAsDouble(&result)) |
| 26 << "Unexpected value type: " << value->GetType(); | 26 << "Unexpected value type: " << value->GetType(); |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 | 718 |
| 719 if (*additional_properties_schema) { | 719 if (*additional_properties_schema) { |
| 720 std::string additional_properties_type(schema::kAny); | 720 std::string additional_properties_type(schema::kAny); |
| 721 CHECK((*additional_properties_schema)->GetString( | 721 CHECK((*additional_properties_schema)->GetString( |
| 722 schema::kType, &additional_properties_type)); | 722 schema::kType, &additional_properties_type)); |
| 723 return additional_properties_type == schema::kAny; | 723 return additional_properties_type == schema::kAny; |
| 724 } else { | 724 } else { |
| 725 return default_allow_additional_properties_; | 725 return default_allow_additional_properties_; |
| 726 } | 726 } |
| 727 } | 727 } |
| OLD | NEW |