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

Unified Diff: mojo/public/tools/bindings/generate_type_mappings.py

Issue 2057603002: mojom: Error if multiple native types are mapped to the same mojom type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71ab62f4fcf718a1f9485dc5c380a018d4b7547c..25dc49a190acaf6356c9279a368e1b66cc9cc57e 100755
--- a/mojo/public/tools/bindings/generate_type_mappings.py
+++ b/mojo/public/tools/bindings/generate_type_mappings.py
@@ -101,6 +101,10 @@ def ParseTypemap(typemap):
pass_by_value = (match_result.group(3) and
match_result.group(3) == "pass_by_value")
+ assert mojom_type not in result, (
+ "Cannot map multiple native types (%s, %s) to the same mojom type: %s" %
+ (result[mojom_type]['typename'], native_type, mojom_type))
+
result[mojom_type] = {
'typename': native_type,
'pass_by_value': pass_by_value,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698