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

Side by Side Diff: components/json_schema/json_schema_validator.cc

Issue 2561963002: base: Remove the string logging from CHECK(). (Closed)
Patch Set: checkstring: rebase Created 4 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 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cfloat> 10 #include <cfloat>
(...skipping 11 matching lines...) Expand all
22 #include "base/values.h" 22 #include "base/values.h"
23 #include "components/json_schema/json_schema_constants.h" 23 #include "components/json_schema/json_schema_constants.h"
24 #include "third_party/re2/src/re2/re2.h" 24 #include "third_party/re2/src/re2/re2.h"
25 25
26 namespace schema = json_schema_constants; 26 namespace schema = json_schema_constants;
27 27
28 namespace { 28 namespace {
29 29
30 double GetNumberValue(const base::Value* value) { 30 double GetNumberValue(const base::Value* value) {
31 double result = 0; 31 double result = 0;
32 CHECK(value->GetAsDouble(&result)) 32 // Unexpected value type.
33 << "Unexpected value type: " << value->GetType(); 33 CHECK(value->GetAsDouble(&result));
34 return result; 34 return result;
35 } 35 }
36 36
37 bool IsValidType(const std::string& type) { 37 bool IsValidType(const std::string& type) {
38 static const char* kValidTypes[] = { 38 static const char* kValidTypes[] = {
39 schema::kAny, 39 schema::kAny,
40 schema::kArray, 40 schema::kArray,
41 schema::kBoolean, 41 schema::kBoolean,
42 schema::kInteger, 42 schema::kInteger,
43 schema::kNull, 43 schema::kNull,
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 841
842 if (*additional_properties_schema) { 842 if (*additional_properties_schema) {
843 std::string additional_properties_type(schema::kAny); 843 std::string additional_properties_type(schema::kAny);
844 CHECK((*additional_properties_schema)->GetString( 844 CHECK((*additional_properties_schema)->GetString(
845 schema::kType, &additional_properties_type)); 845 schema::kType, &additional_properties_type));
846 return additional_properties_type == schema::kAny; 846 return additional_properties_type == schema::kAny;
847 } else { 847 } else {
848 return default_allow_additional_properties_; 848 return default_allow_additional_properties_;
849 } 849 }
850 } 850 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698