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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 2799093006: Remove base::BinaryValue (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/json_schema_compiler/util.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 26cab3635727ac31dac9973e08aa0d9366275bcf..aa22ea1b4072d66a12b1efe56f580397056ae518 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -46,6 +46,7 @@ class _Generator(object):
.Append('#include "base/memory/ptr_util.h"')
.Append('#include "base/strings/string_number_conversions.h"')
.Append('#include "base/strings/utf_string_conversions.h"')
+ .Append('#include "base/values.h"')
.Append('#include "%s/%s.h"' %
(self._namespace.source_file_dir, self._namespace.short_filename))
.Append('#include <set>')
@@ -638,7 +639,7 @@ class _Generator(object):
vardot = var + '->'
else:
vardot = var + '.'
- return ('base::BinaryValue::CreateWithCopiedBuffer('
+ return ('base::Value::CreateWithCopiedBuffer('
'%sdata(), %ssize())' % (vardot, vardot))
elif underlying_type.property_type == PropertyType.ARRAY:
return '%s' % self._util_cc_helper.CreateValueFromArray(
@@ -887,7 +888,7 @@ class _Generator(object):
dst_var,
failure_value))
elif underlying_type.property_type == PropertyType.BINARY:
- (c.Append('const base::BinaryValue* binary_value = NULL;')
+ (c.Append('const base::Value* binary_value = NULL;')
.Sblock('if (!%(src_var)s->IsType(base::Value::Type::BINARY)) {')
.Concat(self._GenerateError(
'"\'%%(key)s\': expected binary, got " + ' +
@@ -898,7 +899,7 @@ class _Generator(object):
(c.Eblock('}')
.Sblock('else {')
.Append(' binary_value =')
- .Append(' static_cast<const base::BinaryValue*>(%(src_var)s);')
+ .Append(' static_cast<const base::Value*>(%(src_var)s);')
)
if is_ptr:
(c.Append('%(dst_var)s.reset(new std::vector<char>(')
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698