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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl

Issue 1157843002: Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl
index 487d2a5cc137be900891db0b3d20dfc3f28d1541..087499a0d5d491fc7f65796ccf5563c8a1d37c83 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl
@@ -62,8 +62,12 @@ void {{class_name}}::EncodePointersAndHandles(
case {{enum_name}}::{{field.name|upper}}: {
{%- if field.kind|is_object_kind %}
mojo::internal::Encode(&data.f_{{field.name}}, handles);
-{%- elif field.kind|is_any_handle_kind or field.kind|is_interface_kind %}
+{%- elif field.kind|is_any_handle_kind %}
mojo::internal::EncodeHandle(&data.f_{{field.name}}, handles);
+{%- elif field.kind|is_interface_kind %}
+ mojo::internal::EncodeHandle(
+ reinterpret_cast<mojo::internal::Interface_Data*>(
+ &data.f_{{field.name}}), handles);
{%- endif %}
return;
}
@@ -78,8 +82,12 @@ void {{class_name}}::DecodePointersAndHandles(
case {{enum_name}}::{{field.name|upper}}: {
{%- if field.kind|is_object_kind %}
mojo::internal::Decode(&data.f_{{field.name}}, handles);
-{%- elif field.kind|is_any_handle_kind or field.kind|is_interface_kind %}
+{%- elif field.kind|is_any_handle_kind %}
mojo::internal::DecodeHandle(&data.f_{{field.name}}, handles);
+{%- elif field.kind|is_interface_kind %}
+ mojo::internal::DecodeHandle(
+ reinterpret_cast<mojo::internal::Interface_Data*>(
+ &data.f_{{field.name}}), handles);
{%- endif %}
return;
}

Powered by Google App Engine
This is Rietveld 408576698