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

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

Issue 890843003: Revert of Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/mojom_cpp_generator.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
index 8b7e2197c08b35824826ac7498b79cd43c82ac03..34bba30e69be34948f5bd666dc76fbfc94388e61 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -283,9 +283,6 @@
return False
return True
-def ShouldInlineUnion(union):
- return not any(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)):
@@ -316,6 +313,8 @@
return "mojo::internal::ArrayValidateParams<0, %s,\n%s> " % (
'true' if element_is_nullable else 'false',
GetArrayValidateParams(value_kind))
+
+_HEADER_SIZE = 8
class Generator(generator.Generator):
@@ -335,7 +334,6 @@
"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,
@@ -349,13 +347,11 @@
"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):
@@ -367,7 +363,6 @@
"kinds": self.module.kinds,
"enums": self.module.enums,
"structs": self.GetStructs(),
- "unions": self.module.unions,
"interfaces": self.module.interfaces,
}

Powered by Google App Engine
This is Rietveld 408576698