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 8f9c4d5365547cb027c6b1c338f34f8683e70e27..a2ccc554d23fad58c6f00a608cc07fd55d0dca60 100644 |
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py |
@@ -183,8 +183,9 @@ def GetCppArrayArgWrapperType(kind): |
pattern = "mojo::WTFArray<%s>" if _for_blink else "mojo::Array<%s>" |
return pattern % GetCppArrayArgWrapperType(kind.kind) |
if mojom.IsMapKind(kind): |
- return "mojo::Map<%s, %s> " % (GetCppArrayArgWrapperType(kind.key_kind), |
- GetCppArrayArgWrapperType(kind.value_kind)) |
+ pattern = "mojo::WTFMap<%s, %s>" if _for_blink else "mojo::Map<%s, %s>" |
+ return pattern % (GetCppArrayArgWrapperType(kind.key_kind), |
+ GetCppArrayArgWrapperType(kind.value_kind)) |
if mojom.IsInterfaceKind(kind): |
raise Exception("Arrays of interfaces not yet supported!") |
if mojom.IsInterfaceRequestKind(kind): |
@@ -219,8 +220,9 @@ def GetCppWrapperType(kind): |
pattern = "mojo::WTFArray<%s>" if _for_blink else "mojo::Array<%s>" |
return pattern % GetCppArrayArgWrapperType(kind.kind) |
if mojom.IsMapKind(kind): |
- return "mojo::Map<%s, %s>" % (GetCppArrayArgWrapperType(kind.key_kind), |
- GetCppArrayArgWrapperType(kind.value_kind)) |
+ pattern = "mojo::WTFMap<%s, %s>" if _for_blink else "mojo::Map<%s, %s>" |
+ return pattern % (GetCppArrayArgWrapperType(kind.key_kind), |
+ GetCppArrayArgWrapperType(kind.value_kind)) |
if mojom.IsInterfaceKind(kind): |
return "%sPtr" % GetNameForKind(kind) |
if mojom.IsInterfaceRequestKind(kind): |