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

Unified Diff: chrome/common/json_schema_validator.cc

Issue 6248026: Rename Real* to Double* in values.* and dependent files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More renames Created 9 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/json_schema_validator.cc
diff --git a/chrome/common/json_schema_validator.cc b/chrome/common/json_schema_validator.cc
index 7d435439f8c74fc723f777f7de9a833722d76743..7da218f825ed68519ccdab7a44c3eb4426d371b3 100644
--- a/chrome/common/json_schema_validator.cc
+++ b/chrome/common/json_schema_validator.cc
@@ -16,7 +16,7 @@ namespace {
double GetNumberValue(Value* value) {
double result = 0;
- if (value->GetAsReal(&result))
+ if (value->GetAsDouble(&result))
return result;
int int_result = 0;
@@ -30,7 +30,7 @@ double GetNumberValue(Value* value) {
bool GetNumberFromDictionary(DictionaryValue* value, const std::string& key,
double* number) {
- if (value->GetReal(key, number))
+ if (value->GetDouble(key, number))
return true;
int int_value = 0;
@@ -97,9 +97,9 @@ std::string JSONSchemaValidator::GetJSONSchemaType(Value* value) {
return "boolean";
case Value::TYPE_INTEGER:
return "integer";
- case Value::TYPE_REAL: {
+ case Value::TYPE_DOUBLE: {
double double_value = 0;
- value->GetAsReal(&double_value);
+ value->GetAsDouble(&double_value);
if (std::abs(double_value) <= std::pow(2.0, DBL_MANT_DIG) &&
double_value == floor(double_value)) {
return "integer";
@@ -269,9 +269,9 @@ void JSONSchemaValidator::ValidateEnum(Value* instance,
break;
case Value::TYPE_INTEGER:
- case Value::TYPE_REAL:
+ case Value::TYPE_DOUBLE:
if (instance->IsType(Value::TYPE_INTEGER) ||
- instance->IsType(Value::TYPE_REAL)) {
+ instance->IsType(Value::TYPE_DOUBLE)) {
if (GetNumberValue(choice) == GetNumberValue(instance))
return;
}

Powered by Google App Engine
This is Rietveld 408576698