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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl

Issue 459873003: Mojom generator: move Is.*Kind() functions into module.py and use them from all mojom_.*_generator.… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix java compilation Created 6 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
index 5d8b944fb1a5a359b29ab36245dfa39b1cec890c..f48cca72fb45734058cf6eda9554dc674c2d671a 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
@@ -18,7 +18,7 @@ void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buf,
Serialize_(mojo::internal::Forward(input->{{pf.field.name}}), buf, &result->{{pf.field.name}}.ptr);
{%- elif pf.field.kind|is_interface_kind %}
result->{{pf.field.name}} = input->{{pf.field.name}}.PassMessagePipe().release();
-{%- elif pf.field.kind|is_handle_kind %}
+{%- elif pf.field.kind|is_any_handle_kind %}
result->{{pf.field.name}} = input->{{pf.field.name}}.release();
{%- else %}
result->{{pf.field.name}} = input->{{pf.field.name}};
@@ -40,7 +40,7 @@ void Deserialize_(internal::{{struct.name}}_Data* input,
{%- elif pf.field.kind|is_interface_kind %}
if (input->{{pf.field.name}}.is_valid())
result->{{pf.field.name}}.Bind(mojo::MakeScopedHandle(mojo::internal::FetchAndReset(&input->{{pf.field.name}})));
-{%- elif pf.field.kind|is_handle_kind %}
+{%- elif pf.field.kind|is_any_handle_kind %}
result->{{pf.field.name}}.reset(mojo::internal::FetchAndReset(&input->{{pf.field.name}}));
{%- elif pf.field.kind|is_enum_kind %}
result->{{pf.field.name}} = static_cast<{{pf.field.kind|cpp_wrapper_type}}>(

Powered by Google App Engine
This is Rietveld 408576698