Chromium Code Reviews| Index: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
| diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
| index 8c61c86ab18527ffdcb80e789d8aee1a44c4e6a2..a53bb824209a8d4b6fc2b5a4b916e55490eea82f 100644 |
| --- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
| +++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl |
| @@ -25,7 +25,9 @@ |
| {{struct.name}}Ptr {{struct.name}}::Clone() const { |
| {{struct.name}}Ptr rv(New()); |
| {%- for field in struct.fields %} |
| -{%- if field.kind|is_object_kind and not field.kind|is_string_kind %} |
| +{%- if field.kind|is_typemapped_kind %} |
| + NOTREACHED() << "Object cloning not supported with typemapped fields."; |
|
yzshen1
2015/12/15 21:20:27
It seems reasonable to add support if the typemapp
Ken Rockot(use gerrit already)
2015/12/15 23:31:08
I agree we might want to, but I'd rather wait unti
|
| +{%- elif field.kind|is_object_kind and not field.kind|is_string_kind %} |
| rv->{{field.name}} = {{field.name}}.Clone(); |
| {%- else %} |
| rv->{{field.name}} = {{field.name}}; |
| @@ -37,8 +39,12 @@ |
| bool {{struct.name}}::Equals(const {{struct.name}}& other) const { |
| {%- for field in struct.fields %} |
| +{%- if field.kind|is_typemapped_kind %} |
| + NOTREACHED() << "Equality testing not supported with typemapped fields."; |
|
yzshen1
2015/12/15 21:20:27
Similarly, seems reasonable to add support if the
Ken Rockot(use gerrit already)
2015/12/15 23:31:08
Agreed
|
| +{%- else %} |
| if (!mojo::internal::ValueTraits<{{field.kind|cpp_wrapper_type}}>::Equals(this->{{field.name}}, other.{{field.name}})) |
| return false; |
| +{%- endif %} |
| {%- endfor %} |
| return true; |
| } |