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

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

Issue 844433003: Revert "Generate some of the C++ bindings for mojom tagged unions." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/union_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/union_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/union_declaration.tmpl
deleted file mode 100644
index 5ff7172dca6229365b733e7c0b16c46bfad8826c..0000000000000000000000000000000000000000
--- a/mojo/public/tools/bindings/generators/cpp_templates/union_declaration.tmpl
+++ /dev/null
@@ -1,35 +0,0 @@
-{%- set class_name = union.name ~ "_Data" -%}
-{%- set enum_name = union.name ~ "_Tag" -%}
-{%- set union_name = union.name ~ "_Union" -%}
-
-class {{class_name}} {
- public:
- static {{class_name}}* New(mojo::internal::Buffer* buf);
-
- static bool Validate(const void* data,
- mojo::internal::BoundsChecker* bounds_checker);
-
- enum class {{enum_name}} : uint64_t {
-{% for field in union.fields %}
- {{field.name|upper}},
-{%- endfor %}
- };
-
- union MOJO_ALIGNAS(8) {{union_name}} {
-{% for field in union.fields %}
- {{field.kind|cpp_field_type}} {{field.name}};
-{%- endfor %}
- };
-
- {{enum_name}} tag;
- {{union_name}} data;
-
- void EncodePointersAndHandles(std::vector<mojo::Handle>* handles);
- void DecodePointersAndHandles(std::vector<mojo::Handle>* handles);
-
- private:
- {{class_name}}();
- ~{{class_name}}() = delete;
-};
-static_assert(sizeof({{class_name}}) == 16,
- "Bad sizeof({{class_name}})");

Powered by Google App Engine
This is Rietveld 408576698