Chromium Code Reviews| Index: mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
| diff --git a/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
| index c8c10cd86b9001dc14e0fa72bb02c03395cdb18e..038ba69a8cb4aa284ef11c3e70eddf66462bec18 100644 |
| --- a/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
| +++ b/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl |
| @@ -5,9 +5,31 @@ const int _{{interface|name}}_{{method|name}}Name = {{method.ordinal}}; |
| {#--- Interface Enums #} |
| {%- from "enum_definition.tmpl" import enum_def -%} |
| {%- for enum in interface.enums %} |
| - {{ enum_def(enum) }} |
| + {{ enum_def(enum, typepkg, package) }} |
| {%- endfor %} |
| +{{ mojom_type_macros.writeMojomTypeDef(interface, typepkg, package) }} |
| + |
| +class _{{interface|name}}ServiceDescription implements {{descpkg}}ServiceDescription { |
| +{% if should_gen_mojom_types -%} |
| + dynamic getTopLevelInterface([Function responseFactory = null]) => |
|
zra
2016/01/27 18:15:12
Here and below, `= null` isn't necessary. If no de
alexfandrianto
2016/01/28 03:45:13
Done.
|
| + _{{interface|mojom_type_identifier|lower_camel}}(); |
|
zra
2016/01/27 18:15:12
4 space indent on a continued line.
alexfandrianto
2016/01/28 03:45:12
Done.
|
| + |
| + dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) => |
|
zra
2016/01/27 18:15:12
Long line.
alexfandrianto
2016/01/28 03:45:13
Done.
|
| + getAllMojomTypeDefinitions()[typeKey]; |
| + |
| + dynamic getAllTypeDefinitions([Function responseFactory = null]) => |
| + getAllMojomTypeDefinitions(); |
| +{%- else -%} |
| + dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| + |
| + dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) => |
|
zra
2016/01/27 18:15:12
Long line.
alexfandrianto
2016/01/28 03:45:13
Done.
|
| + null; |
| + |
| + dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| +{%- endif %} |
| +} |
| + |
| abstract class {{interface|name}} { |
| {%- if interface.service_name %} |
| static const String serviceName = "{{interface.service_name}}"; |
| @@ -53,6 +75,9 @@ class _{{interface|name}}ProxyImpl extends bindings.Proxy { |
| return new _{{interface|name}}ProxyImpl.fromEndpoint(endpoint); |
| } |
| + {{descpkg}}ServiceDescription get serviceDescription => |
| + new _{{interface|name}}ServiceDescription(); |
| + |
| void handleResponse(bindings.ServiceMessage message) { |
| switch (message.header.type) { |
| {%- for method in interface.methods %} |
| @@ -298,4 +323,7 @@ class {{interface|name}}Stub extends bindings.Stub { |
| } |
| int get version => {{interface.version}}; |
| + |
| + {{descpkg}}ServiceDescription get serviceDescription => |
| + new _{{interface|name}}ServiceDescription(); |
| } |