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

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

Issue 1800753005: C++ bindings: A struct's Deserialize() now does validation before deserializing. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address comments. DeserializeWithoutValidation returns void, doesn't take in buf_size. Created 4 years, 9 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 {# TODO(yzshen): Make these templates more readable. #} 1 {# TODO(yzshen): Make these templates more readable. #}
2 2
3 {# Computes the serialized size for the specified struct. 3 {# Computes the serialized size for the specified struct.
4 |struct| is the struct definition. 4 |struct| is the struct definition.
5 |input_field_pattern| should be a pattern that contains one string 5 |input_field_pattern| should be a pattern that contains one string
6 placeholder, for example, "input->%s", "p_%s". The placeholder will be 6 placeholder, for example, "input->%s", "p_%s". The placeholder will be
7 substituted with struct field names to refer to the input fields. 7 substituted with struct field names to refer to the input fields.
8 This macro is expanded to compute seriailized size for both: 8 This macro is expanded to compute seriailized size for both:
9 - user-defined structs: the input is an instance of the corresponding struct 9 - user-defined structs: the input is an instance of the corresponding struct
10 wrapper class. 10 wrapper class.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 all generated structs: 273 all generated structs:
274 - user-defined mojo structs 274 - user-defined mojo structs
275 - interface method params/response params #} 275 - interface method params/response params #}
276 {%- macro structptr_forward_decl(struct) -%} 276 {%- macro structptr_forward_decl(struct) -%}
277 class {{struct.name}}; 277 class {{struct.name}};
278 {% if struct|should_inline %} 278 {% if struct|should_inline %}
279 using {{struct.name}}Ptr = mojo::InlinedStructPtr<{{struct.name}}>; 279 using {{struct.name}}Ptr = mojo::InlinedStructPtr<{{struct.name}}>;
280 {% else %} 280 {% else %}
281 using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>; 281 using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>;
282 {% endif %} 282 {% endif %}
283 {% endmacro %} 283 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698