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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 2084633002: json_schema_compiler: Don't use deprecated ListValue::Append(Value*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
« no previous file with comments | « no previous file | tools/json_schema_compiler/test/additional_properties_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cc_generator.py
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 267d9fe8f106a4368a726cd1432e3cb2e10344fe..dcd28ce58b5f7b379969df57b6fa5ec03601eb34 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -631,15 +631,15 @@ class _Generator(object):
maybe_namespace = ''
if type_.property_type == PropertyType.REF:
maybe_namespace = '%s::' % underlying_type.namespace.unix_name
- return 'base::WrapUnique(new base::StringValue(%sToString(%s)))' % (
+ return 'base::MakeUnique<base::StringValue>(%sToString(%s))' % (
maybe_namespace, var)
elif underlying_type.property_type == PropertyType.BINARY:
if is_ptr:
vardot = var + '->'
else:
vardot = var + '.'
- return ('base::BinaryValue::CreateWithCopiedBuffer(%sdata(),'
- ' %ssize())' % (vardot, vardot))
+ return ('base::BinaryValue::CreateWithCopiedBuffer('
+ '%sdata(), %ssize())' % (vardot, vardot))
elif underlying_type.property_type == PropertyType.ARRAY:
return '%s' % self._util_cc_helper.CreateValueFromArray(
var,
@@ -648,9 +648,9 @@ class _Generator(object):
if is_ptr:
var = '*%s' % var
if underlying_type.property_type == PropertyType.STRING:
- return 'base::WrapUnique(new base::StringValue(%s))' % var
+ return 'base::MakeUnique<base::StringValue>(%s)' % var
else:
- return 'base::WrapUnique(new base::FundamentalValue(%s))' % var
+ return 'base::MakeUnique<base::FundamentalValue>(%s)' % var
else:
raise NotImplementedError('Conversion of %s to base::Value not '
'implemented' % repr(type_.type_))
« no previous file with comments | « no previous file | tools/json_schema_compiler/test/additional_properties_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698