Index: mojo/public/tools/bindings/generators/go_templates/interface.tmpl |
diff --git a/mojo/public/tools/bindings/generators/go_templates/interface.tmpl b/mojo/public/tools/bindings/generators/go_templates/interface.tmpl |
index 8fa02ee767f6193916ff10de483db8d94eb1b8b9..bb018eb3ee343df1f239cb0a7947331ccdfb37a3 100644 |
--- a/mojo/public/tools/bindings/generators/go_templates/interface.tmpl |
+++ b/mojo/public/tools/bindings/generators/go_templates/interface.tmpl |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
{% import "struct.tmpl" as struct_macros %} |
+{% import "mojom_util_macros.tmpl" as util %} |
{%- macro declare_params(struct) %} |
{%- for field in struct.fields -%} |
@@ -35,7 +36,7 @@ |
-{% macro define(interface) %} |
+{% macro define(interface, typepkg, pkg) %} |
type {{interface|name}} interface { |
{% for method in interface.methods %} |
{{method|name}}{{declare_request_params(method)}} |
@@ -101,9 +102,9 @@ func (p *{{interface|name}}_Proxy) Close_Proxy() { |
} |
{% for method in interface.methods %} |
-{{struct_macros.define(method.param_struct, False)}} |
+{{struct_macros.define(method.param_struct, typepkg, pkg, False)}} |
{%- if method.response_parameters %} |
-{{struct_macros.define(method.response_param_struct, False)}} |
+{{struct_macros.define(method.response_param_struct, typepkg, pkg, False)}} |
{%- endif %} |
func (p *{{interface|name}}_Proxy) {{method|name}}{{declare_request_params(method)}} { |
payload := &{{method.param_struct|name(False)}}{ |
@@ -170,6 +171,22 @@ func New{{interface|name}}Stub(r {{interface|name}}_Request, impl {{interface|na |
return bindings.NewStub(connector, &{{interface|name(False)}}_Stub{connector, impl}) |
} |
+var {{util.interfaceName(interface, typepkg, pkg)}} = {{typepkg}}MojomInterface{ |
+ DeclData: nil, |
+ Methods: map[uint32]{{typepkg}}MojomMethod{ |
+{%- for method in interface.methods -%} |
+ {{interface|name(False)}}_{{method|name}}_Name: {{typepkg}}MojomMethod{ |
+ DeclData: nil, |
+ Parameters: {{util.structName(method.param_struct, typepkg, pkg)}}, |
+ {%- if method.response_parameters -%} |
+ ResponseParams: &{{util.structName(method.response_param_struct, typepkg, pkg)}}, |
+ {%- endif -%} |
+ }, |
+{%- endfor -%} |
+ }, |
+} |
+ |
+ |
func (s *{{interface|name(False)}}_Stub) Accept(message *bindings.Message) (err error) { |
switch message.Header.Type { |
{% for method in interface.methods %} |