Chromium Code Reviews| 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 3d307a9f0be77d775046ed226c764bf824da0b6b..24cbf612bc9a42d22717f87b50e35cb710f33403 100644 |
| --- a/tools/json_schema_compiler/cpp_type_generator.py |
| +++ b/tools/json_schema_compiler/cpp_type_generator.py |
| @@ -121,7 +121,12 @@ class CppTypeGenerator(object): |
| # TODO(kalman): change this - but it's an exceedingly far-reaching change. |
| if not self.FollowRef(type_).property_type == PropertyType.ENUM: |
| if is_in_container and (is_ptr or not self.IsCopyable(type_)): |
| - cpp_type = 'linked_ptr<%s>' % cpp_util.PadForGenerics(cpp_type) |
| + # Only wrap the object in a linked_ptr if this API isn't using movable |
| + # types. Since base::Values aren't yet movable, wrap them too. |
| + # TODO(devlin): Eventually, movable types should be the default. |
| + if (not 'use_movable_types' in type_.namespace.compiler_options or |
| + cpp_type == 'base::Value' or cpp_type == 'base::DictionaryValue'): |
|
asargent_no_longer_on_chrome
2016/03/21 21:03:14
should you also have base::ListValue here?
Devlin
2016/03/21 22:24:27
I don't think we ever use base::ListValue for a ge
asargent_no_longer_on_chrome
2016/03/21 22:45:24
Perhaps we don't. I did a quick grep for linked_pt
|
| + cpp_type = 'linked_ptr<%s>' % cpp_util.PadForGenerics(cpp_type) |
| elif is_ptr: |
| cpp_type = 'scoped_ptr<%s>' % cpp_util.PadForGenerics(cpp_type) |