summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler
diff options
context:
space:
mode:
Diffstat (limited to 'tools/json_schema_compiler')
-rw-r--r--tools/json_schema_compiler/cc_generator.py4
-rw-r--r--tools/json_schema_compiler/util.cc8
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 2c55b1e..d7d565e 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -449,7 +449,7 @@ class _Generator(object):
var: variable or variable*
- E.g for std::string, generate base::Value::CreateStringValue(var)
+ E.g for std::string, generate new base::StringValue(var)
"""
underlying_type = self._type_helper.FollowRef(type_)
if (underlying_type.property_type == PropertyType.CHOICES or
@@ -466,7 +466,7 @@ class _Generator(object):
vardot = '(%s).' % var
return '%sDeepCopy()' % vardot
elif underlying_type.property_type == PropertyType.ENUM:
- return 'base::Value::CreateStringValue(ToString(%s))' % var
+ return 'new base::StringValue(ToString(%s))' % var
elif underlying_type.property_type == PropertyType.BINARY:
if is_ptr:
vardot = var + '->'
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index c03d076..d0e7765 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -45,19 +45,19 @@ bool GetItemFromList(const base::ListValue& from, int index,
}
void AddItemToList(const int from, base::ListValue* out) {
- out->Append(base::Value::CreateIntegerValue(from));
+ out->Append(new base::FundamentalValue(from));
}
void AddItemToList(const bool from, base::ListValue* out) {
- out->Append(base::Value::CreateBooleanValue(from));
+ out->Append(new base::FundamentalValue(from));
}
void AddItemToList(const double from, base::ListValue* out) {
- out->Append(base::Value::CreateDoubleValue(from));
+ out->Append(new base::FundamentalValue(from));
}
void AddItemToList(const std::string& from, base::ListValue* out) {
- out->Append(base::Value::CreateStringValue(from));
+ out->Append(new base::StringValue(from));
}
void AddItemToList(const linked_ptr<base::Value>& from,