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 38b219c61fa0a94ddd50efeec006ee9d5a88eb7f..79b3d3b00ffb195feb4e0ec54709dbbb619970a1 100644 |
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
@@ -227,8 +227,15 @@ def IsMoveOnlyKind(kind): |
return True |
return False |
+def IsCopyablePassByValue(kind): |
+ if not IsTypemappedKind(kind): |
+ return False |
+ return _current_typemap[GetFullMojomNameForKind(kind)][ |
+ "copyable_pass_by_value"] |
+ |
def ShouldPassParamByValue(kind): |
- return (not mojom.IsReferenceKind(kind)) or IsMoveOnlyKind(kind) |
+ return ((not mojom.IsReferenceKind(kind)) or IsMoveOnlyKind(kind) or |
+ IsCopyablePassByValue(kind)) |
def GetCppWrapperParamType(kind): |
cpp_wrapper_type = GetCppWrapperType(kind) |