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

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

Issue 1635613002: [mojo-bindings] Support reuse of native enum classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more missing public_deps Created 4 years, 10 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 size_t GetSerializedSize_(const {{struct.name}}Ptr& input); 1 size_t GetSerializedSize_(const {{struct.name}}Ptr& input);
2 void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buffer, 2 void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buffer,
3 internal::{{struct.name}}_Data** output); 3 internal::{{struct.name}}_Data** output);
4 bool Deserialize_(internal::{{struct.name}}_Data* input, 4 bool Deserialize_(internal::{{struct.name}}_Data* input,
5 {{struct.name}}Ptr* output, 5 {{struct.name}}Ptr* output,
6 mojo::internal::SerializationContext* context); 6 mojo::internal::SerializationContext* context);
7 7
8 {%- if struct|is_native_only_kind and struct|is_typemapped_kind %} 8 {%- if struct|is_native_struct_kind and struct|is_typemapped_kind %}
9 {# This helps the array serializer understand how to serialize arrays of this 9 {# This helps the array serializer understand how to serialize arrays of this
10 native-only type. #} 10 native-only type. #}
11 11
12 {%- for namespace in namespaces_as_array|reverse %} 12 {%- for namespace in namespaces_as_array|reverse %}
13 } // namespace {{namespace}} 13 } // namespace {{namespace}}
14 {%- endfor %} 14 {%- endfor %}
15 {%- if variant %} 15 {%- if variant %}
16 } // namespace {{variant}} 16 } // namespace {{variant}}
17 {%- endif %} 17 {%- endif %}
18 18
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 static bool Deserialize(internal::{{struct.name}}_Data* input, 111 static bool Deserialize(internal::{{struct.name}}_Data* input,
112 NativeType* output, 112 NativeType* output,
113 mojo::internal::SerializationContext* context) { 113 mojo::internal::SerializationContext* context) {
114 return mojo::StructTraits<{{struct.name}}, NativeType>::Read( 114 return mojo::StructTraits<{{struct.name}}, NativeType>::Read(
115 {{struct.name}}_Reader(input, context), output); 115 {{struct.name}}_Reader(input, context), output);
116 } 116 }
117 }; 117 };
118 118
119 {%- endif %} {# not variant #} 119 {%- endif %} {# not variant #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698