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

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

Issue 2146153002: Mojo typemap config: support "copyable_pass_by_value" attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@69_change_move_only
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « mojo/public/tools/bindings/generate_type_mappings.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « mojo/public/tools/bindings/generate_type_mappings.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698