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

Side by Side Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl

Issue 2244363003: Mojo C++ bindings: disallow copy and assign for generated classes when necessary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the actual fix Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 {% from "enum_macros.tmpl" import enum_decl -%} 1 {% from "enum_macros.tmpl" import enum_decl -%}
2 2
3 class {{export_attribute}} {{struct.name}} { 3 class {{export_attribute}} {{struct.name}} {
4 public: 4 public:
5 using DataView = {{struct.name}}DataView; 5 using DataView = {{struct.name}}DataView;
6 using Data_ = internal::{{struct.name}}_Data; 6 using Data_ = internal::{{struct.name}}_Data;
7 7
8 {#--- Enums #} 8 {#--- Enums #}
9 {%- for enum in struct.enums -%} 9 {%- for enum in struct.enums -%}
10 {%- if enum|is_native_only_kind %} 10 {%- if enum|is_native_only_kind %}
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 {{struct.name}}Ptr, {{serialization_result_type}}>( 68 {{struct.name}}Ptr, {{serialization_result_type}}>(
69 input, output); 69 input, output);
70 } 70 }
71 71
72 {#--- Struct members #} 72 {#--- Struct members #}
73 {% for field in struct.fields %} 73 {% for field in struct.fields %}
74 {%- set type = field.kind|cpp_wrapper_type %} 74 {%- set type = field.kind|cpp_wrapper_type %}
75 {%- set name = field.name %} 75 {%- set name = field.name %}
76 {{type}} {{name}}; 76 {{type}} {{name}};
77 {%- endfor %} 77 {%- endfor %}
78
79 {%- if struct|contains_move_only_members %}
80 private:
81 DISALLOW_COPY_AND_ASSIGN({{struct.name}});
82 {%- endif %}
78 }; 83 };
79 84
OLDNEW
« no previous file with comments | « mojo/public/interfaces/bindings/tests/test_export.mojom ('k') | mojo/public/tools/bindings/generators/mojom_cpp_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698