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

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

Issue 2012693002: Generate a templated Clone method for all mojo structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 d8e0491cc309d0f8475e7eab1b2139925e9b03b6..bb514d4fb73087ba702034d6c3344df5d435603b 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -136,7 +136,9 @@ def IsTypemappedKind(kind):
GetFullMojomNameForKind(kind) in _current_typemap
def IsCloneableKind(kind):
- return mojom.IsCloneableKind(kind, IsTypemappedKind)
+ return mojom.IsCloneableKind(
+ kind,
+ lambda kind : IsTypemappedKind(kind) and ShouldPassParamByValue(kind))
yzshen1 2016/05/26 16:24:14 I feel that the cloneable check should probably be
Sam McNally 2016/05/27 02:57:40 Done for structs.
def IsNativeOnlyKind(kind):
return mojom.IsStructKind(kind) and kind.native_only

Powered by Google App Engine
This is Rietveld 408576698