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

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

Issue 2210673002: Improve gfx::Transform StructTraits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 {%- import "validation_macros.tmpl" as validation_macros %} 1 {%- import "validation_macros.tmpl" as validation_macros %}
2 {%- set class_name = struct.name ~ "_Data" %} 2 {%- set class_name = struct.name ~ "_Data" %}
3 3
4 // static 4 // static
5 bool {{class_name}}::Validate( 5 bool {{class_name}}::Validate(
6 const void* data, 6 const void* data,
7 mojo::internal::ValidationContext* validation_context) { 7 mojo::internal::ValidationContext* validation_context) {
8 if (!data) 8 if (!data)
9 return true; 9 return true;
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return true; 61 return true;
62 {%- endif %} 62 {%- endif %}
63 {%- set field_expr = "object->" ~ packed_field.field.name %} 63 {%- set field_expr = "object->" ~ packed_field.field.name %}
64 {{validation_macros.validate_field(packed_field.field, field_expr, struct.name, true)}} 64 {{validation_macros.validate_field(packed_field.field, field_expr, struct.name, true)}}
65 {%- endif %} 65 {%- endif %}
66 {%- endfor %} 66 {%- endfor %}
67 67
68 return true; 68 return true;
69 } 69 }
70 70
71 {{class_name}}::{{class_name}}() {
72 header_.num_bytes = sizeof(*this);
73 header_.version = {{struct.versions[-1].version}};
74 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698