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

Unified Diff: tools/json_schema_compiler/cpp_type_generator.py

Issue 10700194: Represent BINARY properties using std::string instead of BinaryValue, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo values.h change. Created 8 years, 5 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/json_schema_compiler/cc_generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cpp_type_generator.py
diff --git a/tools/json_schema_compiler/cpp_type_generator.py b/tools/json_schema_compiler/cpp_type_generator.py
index 28967b06fcbb8102d5675b774ed616b3a63bab57..430b154c52292759f194df5cf14862a8fa216245 100644
--- a/tools/json_schema_compiler/cpp_type_generator.py
+++ b/tools/json_schema_compiler/cpp_type_generator.py
@@ -118,7 +118,6 @@ class CppTypeGenerator(object):
optional.
"""
cpp_type = None
- force_wrapping = False
if prop.type_ == PropertyType.REF:
dependency_namespace = self._ResolveTypeNamespace(prop.ref_type)
if not dependency_namespace:
@@ -156,17 +155,13 @@ class CppTypeGenerator(object):
cpp_type = cpp_type % self.GetType(
prop.item_type, pad_for_generics=True)
elif prop.type_ == PropertyType.BINARY:
- # Since base::BinaryValue's are immutable, we wrap them in a scoped_ptr to
- # allow them to be modified after the fact.
- force_wrapping = True
- cpp_type = 'base::BinaryValue'
+ cpp_type = 'std::string'
else:
raise NotImplementedError(prop.type_)
# Enums aren't wrapped because C++ won't allow it. Optional enums have a
# NONE value generated instead.
- if force_wrapping or (wrap_optional and prop.optional and prop.type_ !=
- PropertyType.ENUM):
+ if wrap_optional and prop.optional and prop.type_ != PropertyType.ENUM:
cpp_type = 'scoped_ptr<%s> ' % cpp_type
if pad_for_generics:
return cpp_type
« no previous file with comments | « tools/json_schema_compiler/cc_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698