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

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

Issue 332653002: Mojo: Fix the C++ bindings generator for methods taking imported interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl ('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 1b3e4aadef83adeb34c9b8e8897de235940c9d0a..812dd47c6095a081ec9166f101697a30734a85ae 100644
--- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -103,9 +103,9 @@ def GetCppResultWrapperType(kind):
if isinstance(kind, mojom.Array):
return "mojo::Array<%s>" % GetCppArrayArgWrapperType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "%sPtr" % kind.name
+ return "%sPtr" % GetNameForKind(kind)
if isinstance(kind, mojom.InterfaceRequest):
- return "mojo::InterfaceRequest<%s>" % kind.kind.name
+ return "mojo::InterfaceRequest<%s>" % GetNameForKind(kind.kind)
if kind.spec == 's':
return "mojo::String"
if kind.spec == 'h':
@@ -151,9 +151,9 @@ def GetCppConstWrapperType(kind):
if isinstance(kind, mojom.Array):
return "mojo::Array<%s>" % GetCppArrayArgWrapperType(kind.kind)
if isinstance(kind, mojom.Interface):
- return "%sPtr" % kind.name
+ return "%sPtr" % GetNameForKind(kind)
if isinstance(kind, mojom.InterfaceRequest):
- return "mojo::InterfaceRequest<%s>" % kind.kind.name
+ return "mojo::InterfaceRequest<%s>" % GetNameForKind(kind.kind)
if isinstance(kind, mojom.Enum):
return GetNameForKind(kind)
if kind.spec == 's':
@@ -237,6 +237,7 @@ class Generator(generator.Generator):
"cpp_wrapper_type": GetCppWrapperType,
"default_value": DefaultValue,
"expression_to_text": ExpressionToText,
+ "get_name_for_kind": GetNameForKind,
"get_pad": pack.GetPad,
"has_callbacks": HasCallbacks,
"should_inline": ShouldInlineStruct,
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698