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

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

Issue 1968623002: Mojo C++ bindings: expose public <struct>DataView and StringDataView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@25_totally_new
Patch Set: Created 4 years, 7 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 {% endfor %} 119 {% endfor %}
120 120
121 {#--- Struct Forward Declarations -#} 121 {#--- Struct Forward Declarations -#}
122 {% for struct in structs %} 122 {% for struct in structs %}
123 {%- if struct|is_native_only_kind %} 123 {%- if struct|is_native_only_kind %}
124 using {{struct.name}} = mojo::NativeStruct; 124 using {{struct.name}} = mojo::NativeStruct;
125 using {{struct.name}}Ptr = mojo::NativeStructPtr; 125 using {{struct.name}}Ptr = mojo::NativeStructPtr;
126 {%- else %} 126 {%- else %}
127 class {{struct.name}}; 127 class {{struct.name}};
128 class {{struct.name}}_Reader; 128 class {{struct.name}}_Reader;
129 class {{struct.name}}DataView;
129 {%- if struct|should_inline %} 130 {%- if struct|should_inline %}
130 using {{struct.name}}Ptr = mojo::InlinedStructPtr<{{struct.name}}>; 131 using {{struct.name}}Ptr = mojo::InlinedStructPtr<{{struct.name}}>;
131 {%- else %} 132 {%- else %}
132 using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>; 133 using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>;
133 {%- endif %} 134 {%- endif %}
134 {%- endif %} 135 {%- endif %}
135 {% endfor %} 136 {% endfor %}
136 137
137 {#--- Union Forward Declarations -#} 138 {#--- Union Forward Declarations -#}
138 {% for union in unions %} 139 {% for union in unions %}
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 {% include "wrapper_union_class_declaration.tmpl" %} 176 {% include "wrapper_union_class_declaration.tmpl" %}
176 {%- endfor %} 177 {%- endfor %}
177 178
178 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #} 179 {#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #}
179 {#--- need to fully define inlined structs ahead of the others. #} 180 {#--- need to fully define inlined structs ahead of the others. #}
180 181
181 {#--- Inlined structs #} 182 {#--- Inlined structs #}
182 {% for struct in structs %} 183 {% for struct in structs %}
183 {% if struct|should_inline and not struct|is_native_only_kind %} 184 {% if struct|should_inline and not struct|is_native_only_kind %}
184 {% include "wrapper_class_declaration.tmpl" %} 185 {% include "wrapper_class_declaration.tmpl" %}
186 {% include "struct_data_view_declaration.tmpl" %}
185 {% endif %} 187 {% endif %}
186 {%- endfor %} 188 {%- endfor %}
187 189
188 {#--- Non-inlined structs #} 190 {#--- Non-inlined structs #}
189 {% for struct in structs %} 191 {% for struct in structs %}
190 {% 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 %}
191 {% include "wrapper_class_declaration.tmpl" %} 193 {% include "wrapper_class_declaration.tmpl" %}
194 {% include "struct_data_view_declaration.tmpl" %}
192 {% endif %} 195 {% endif %}
193 {%- endfor %} 196 {%- endfor %}
194 197
195 {%- for struct in structs %} 198 {%- for struct in structs %}
196 {%- for enum in struct.enums %} 199 {%- for enum in struct.enums %}
197 {{enum_stream_operator(enum)}} 200 {{enum_stream_operator(enum)}}
198 {{is_known_enum_value(enum)}} 201 {{is_known_enum_value(enum)}}
199 {%- endfor %} 202 {%- endfor %}
200 {%- endfor %} 203 {%- endfor %}
201 204
(...skipping 23 matching lines...) Expand all
225 {#--- Union Serialization Helpers -#} 228 {#--- Union Serialization Helpers -#}
226 {% if unions %} 229 {% if unions %}
227 {%- for union in unions %} 230 {%- for union in unions %}
228 {% include "union_serialization_declaration.tmpl" %} 231 {% include "union_serialization_declaration.tmpl" %}
229 {%- endfor %} 232 {%- endfor %}
230 {%- endif %} 233 {%- endif %}
231 234
232 } // namespace mojo 235 } // namespace mojo
233 236
234 #endif // {{header_guard}} 237 #endif // {{header_guard}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698