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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: 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 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/cpp_util.py » ('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 dcd28ce58b5f7b379969df57b6fa5ec03601eb34..57104678d0ae61691e66c73085e9b51a81d6b969 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -307,7 +307,7 @@ class _Generator(object):
self._util_cc_helper.GetValueTypeString('value'))))
.Append('return false;'))
elif type_.property_type == PropertyType.OBJECT:
- (c.Sblock('if (!value.IsType(base::Value::TYPE_DICTIONARY)) {')
+ (c.Sblock('if (!value.IsType(base::Value::Type::DICTIONARY)) {')
.Concat(self._GenerateError(
'"expected dictionary, got " + ' +
self._util_cc_helper.GetValueTypeString('value')))
@@ -713,7 +713,7 @@ class _Generator(object):
value_var = param.unix_name + '_value'
(c.Append('const base::Value* %(value_var)s = NULL;')
.Append('if (args.Get(%(i)s, &%(value_var)s) &&')
- .Sblock(' !%(value_var)s->IsType(base::Value::TYPE_NULL)) {')
+ .Sblock(' !%(value_var)s->IsType(base::Value::Type::NONE)) {')
.Concat(self._GeneratePopulatePropertyFromValue(
param, value_var, 'params', failure_value))
.Eblock('}')
@@ -888,7 +888,7 @@ class _Generator(object):
failure_value))
elif underlying_type.property_type == PropertyType.BINARY:
(c.Append('const base::BinaryValue* binary_value = NULL;')
- .Sblock('if (!%(src_var)s->IsType(base::Value::TYPE_BINARY)) {')
+ .Sblock('if (!%(src_var)s->IsType(base::Value::Type::BINARY)) {')
.Concat(self._GenerateError(
'"\'%%(key)s\': expected binary, got " + ' +
self._util_cc_helper.GetValueTypeString('%%(src_var)s', True)))
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698