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

Unified Diff: mojo/public/tools/bindings/generate_type_mappings.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
Index: mojo/public/tools/bindings/generate_type_mappings.py
diff --git a/mojo/public/tools/bindings/generate_type_mappings.py b/mojo/public/tools/bindings/generate_type_mappings.py
index e2fbf315c5da4b071adf00865c92883b9fa71222..324731d52e8922399b8f7fecbf384163b1d68c14 100755
--- a/mojo/public/tools/bindings/generate_type_mappings.py
+++ b/mojo/public/tools/bindings/generate_type_mappings.py
@@ -97,8 +97,11 @@ def ParseTypemap(typemap):
mojom_type = match_result.group(1)
native_type = match_result.group(2)
- # The only attribute supported currently is "move_only".
+ # The only attribute supported currently is either "move_only" or
+ # "copyable_pass_by_value".
move_only = match_result.group(3) and match_result.group(3) == "move_only"
+ copyable_pass_by_value = (match_result.group(3) and
+ match_result.group(3) == "copyable_pass_by_value")
assert mojom_type not in result, (
"Cannot map multiple native types (%s, %s) to the same mojom type: %s" %
@@ -107,6 +110,7 @@ def ParseTypemap(typemap):
result[mojom_type] = {
'typename': native_type,
'move_only': move_only,
+ 'copyable_pass_by_value': copyable_pass_by_value,
'public_headers': values['public_headers'],
'traits_headers': values['traits_headers'],
}

Powered by Google App Engine
This is Rietveld 408576698