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

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

Issue 2031823002: Mojo C++ bindings: more consistent Clone() and Equals(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 {%- if variant -%} 5 {%- if variant -%}
6 {%- set variant_path = "%s-%s"|format(module.path, variant) -%} 6 {%- set variant_path = "%s-%s"|format(module.path, variant) -%}
7 {%- else -%} 7 {%- else -%}
8 {%- set variant_path = module.path -%} 8 {%- set variant_path = module.path -%}
9 {%- endif -%} 9 {%- endif -%}
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 {#--- Interface Request Validators -#} 162 {#--- Interface Request Validators -#}
163 {% for interface in interfaces %} 163 {% for interface in interfaces %}
164 {% include "interface_request_validator_declaration.tmpl" %} 164 {% include "interface_request_validator_declaration.tmpl" %}
165 {%- endfor %} 165 {%- endfor %}
166 166
167 {#--- Interface Response Validators -#} 167 {#--- Interface Response Validators -#}
168 {% for interface in interfaces if interface|has_callbacks %} 168 {% for interface in interfaces if interface|has_callbacks %}
169 {% include "interface_response_validator_declaration.tmpl" %} 169 {% include "interface_response_validator_declaration.tmpl" %}
170 {%- endfor %} 170 {%- endfor %}
171 171
172 {#--- Unions must be declared first because they can be members of structs #} 172 {#--- NOTE: Unions and non-inlined structs may have pointers to inlined structs,
173 {#--- Unions #} 173 so we need to fully define inlined structs ahead of the others. #}
174 {% for union in unions %}
175 {% include "wrapper_union_class_declaration.tmpl" %}
176 {%- endfor %}
177
178 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #}
179 {#--- need to fully define inlined structs ahead of the others. #}
180 174
181 {#--- Inlined structs #} 175 {#--- Inlined structs #}
182 {% for struct in structs %} 176 {% for struct in structs %}
183 {% if struct|should_inline and not struct|is_native_only_kind %} 177 {% if struct|should_inline and not struct|is_native_only_kind %}
184 {% include "wrapper_class_declaration.tmpl" %} 178 {% include "wrapper_class_declaration.tmpl" %}
185 {% include "struct_data_view_declaration.tmpl" %} 179 {% include "struct_data_view_declaration.tmpl" %}
186 {% endif %} 180 {% endif %}
187 {%- endfor %} 181 {%- endfor %}
188 182
183 {#--- Unions must be declared before non-inlined structs because they can be
184 members of structs. #}
185 {#--- Unions #}
186 {% for union in unions %}
187 {% include "wrapper_union_class_declaration.tmpl" %}
188 {%- endfor %}
189
189 {#--- Non-inlined structs #} 190 {#--- Non-inlined structs #}
190 {% for struct in structs %} 191 {% for struct in structs %}
191 {% if not struct|should_inline and not struct|is_native_only_kind %} 192 {% if not struct|should_inline and not struct|is_native_only_kind %}
192 {% include "wrapper_class_declaration.tmpl" %} 193 {% include "wrapper_class_declaration.tmpl" %}
193 {% include "struct_data_view_declaration.tmpl" %} 194 {% include "struct_data_view_declaration.tmpl" %}
194 {% endif %} 195 {% endif %}
195 {%- endfor %} 196 {%- endfor %}
196 197
198 {%- for union in unions %}
199 {% include "wrapper_union_class_template_definition.tmpl" %}
200 {%- endfor %}
201
197 {%- for struct in structs %} 202 {%- for struct in structs %}
203 {%- if not struct|is_native_only_kind %}
204 {% include "wrapper_class_template_definition.tmpl" %}
205 {%- endif %}
206
198 {%- for enum in struct.enums %} 207 {%- for enum in struct.enums %}
199 {{enum_stream_operator(enum)}} 208 {{enum_stream_operator(enum)}}
200 {{is_known_enum_value(enum)}} 209 {{is_known_enum_value(enum)}}
201 {%- endfor %} 210 {%- endfor %}
202 {%- endfor %} 211 {%- endfor %}
203 212
204 {%- for interface in interfaces %} 213 {%- for interface in interfaces %}
205 {%- for enum in interface.enums %} 214 {%- for enum in interface.enums %}
206 {{enum_stream_operator(enum)}} 215 {{enum_stream_operator(enum)}}
207 {{is_known_enum_value(enum)}} 216 {{is_known_enum_value(enum)}}
(...skipping 19 matching lines...) Expand all
227 {#--- Union Serialization Helpers -#} 236 {#--- Union Serialization Helpers -#}
228 {% if unions %} 237 {% if unions %}
229 {%- for union in unions %} 238 {%- for union in unions %}
230 {% include "union_serialization_declaration.tmpl" %} 239 {% include "union_serialization_declaration.tmpl" %}
231 {%- endfor %} 240 {%- endfor %}
232 {%- endif %} 241 {%- endif %}
233 242
234 } // namespace mojo 243 } // namespace mojo
235 244
236 #endif // {{header_guard}} 245 #endif // {{header_guard}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698