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

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

Issue 910883002: Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply 9f87aeadbda22441b7d469e596f7bd7d0d73e2a8 (https://codereview.chromium.org/908973002/) Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
index 25449b7ca959bf481262ee2cb8024faca338ae0b..03120024fda3dda88c0df3f02b8b85892323b5a4 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
@@ -53,6 +53,16 @@ using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>;
{% endif %}
{% endfor %}
+{#--- Union Forward Declarations -#}
+{% for union in unions %}
+class {{union.name}};
+{% if union|should_inline_union %}
+typedef mojo::InlinedStructPtr<{{union.name}}> {{union.name}}Ptr;
+{% else %}
+typedef mojo::StructPtr<{{union.name}}> {{union.name}}Ptr;
+{% endif %}
+{%- endfor %}
+
{#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #}
{#--- need to fully define inlined structs ahead of the others. #}
@@ -70,6 +80,11 @@ using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>;
{% endif %}
{%- endfor %}
+{#--- Unions #}
+{% for union in unions %}
+{% include "wrapper_union_class_declaration.tmpl" %}
+{%- endfor %}
+
{#--- Interfaces -#}
{% for interface in interfaces %}
{% include "interface_declaration.tmpl" %}
@@ -95,10 +110,18 @@ using {{struct.name}}Ptr = mojo::StructPtr<{{struct.name}}>;
{% include "interface_response_validator_declaration.tmpl" %}
{%- endfor %}
+{%- import "serialization_macros.tmpl" as serialization_macros %}
{#--- Struct Serialization Helpers -#}
{% if structs %}
{% for struct in structs %}
-{% include "struct_serialization_declaration.tmpl" %}
+{{ serialization_macros.declare_serialization(struct.name) }}
+{%- endfor %}
+{%- endif %}
+
+{#--- Union Serialization Helpers -#}
+{% if unions %}
+{% for union in unions %}
+{{ serialization_macros.declare_serialization(union.name) }}
{%- endfor %}
{%- endif %}

Powered by Google App Engine
This is Rietveld 408576698