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

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

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 {%- elif kind|is_associated_kind %} 141 {%- elif kind|is_associated_kind %}
142 // TODO(yzshen): add deserialization logic for associated kinds. 142 // TODO(yzshen): add deserialization logic for associated kinds.
143 {%- elif kind|is_enum_kind %} 143 {%- elif kind|is_enum_kind %}
144 {{output_field}} = static_cast<{{kind|cpp_wrapper_type}}>({{input}}->{{name} }); 144 {{output_field}} = static_cast<{{kind|cpp_wrapper_type}}>({{input}}->{{name} });
145 {%- else %} 145 {%- else %}
146 {{output_field}} = {{input}}->{{name}}; 146 {{output_field}} = {{input}}->{{name}};
147 {%- endif %} 147 {%- endif %}
148 {%- endfor %} 148 {%- endfor %}
149 } while (false); 149 } while (false);
150 {%- endmacro %} 150 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698