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

Unified Diff: mojo/public/tools/bindings/generators/mojom_cpp_generator.py

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/mojom_cpp_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 03c9b6c97ba807c2c8dab357295ec8e477ebc51d..34bba30e69be34948f5bd666dc76fbfc94388e61 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -283,9 +283,6 @@ def ShouldInlineStruct(struct):
return False
return True
-def ShouldInlineUnion(union):
- return not all(not mojom.IsMoveOnlyKind(field.kind) for field in union.fields)
-
def GetArrayValidateParams(kind):
if (not mojom.IsArrayKind(kind) and not mojom.IsMapKind(kind) and
not mojom.IsStringKind(kind)):
@@ -337,7 +334,6 @@ class Generator(generator.Generator):
"get_pad": pack.GetPad,
"has_callbacks": mojom.HasCallbacks,
"should_inline": ShouldInlineStruct,
- "should_inline_union": ShouldInlineUnion,
"is_array_kind": mojom.IsArrayKind,
"is_cloneable_kind": mojom.IsCloneableKind,
"is_enum_kind": mojom.IsEnumKind,
@@ -351,13 +347,11 @@ class Generator(generator.Generator):
"is_string_kind": mojom.IsStringKind,
"is_struct_kind": mojom.IsStructKind,
"is_struct_with_handles": IsStructWithHandles,
- "is_union_kind": mojom.IsUnionKind,
"struct_size": lambda ps: ps.GetTotalSize() + _HEADER_SIZE,
"struct_from_method": generator.GetStructFromMethod,
"response_struct_from_method": generator.GetResponseStructFromMethod,
"stylize_method": generator.StudlyCapsToCamel,
"to_all_caps": generator.CamelCaseToAllCaps,
- "under_to_camel": generator.UnderToCamel,
}
def GetJinjaExports(self):
@@ -369,7 +363,6 @@ class Generator(generator.Generator):
"kinds": self.module.kinds,
"enums": self.module.enums,
"structs": self.GetStructs(),
- "unions": self.module.unions,
"interfaces": self.module.interfaces,
}
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl ('k') | mojo/public/tools/bindings/mojom.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698