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

Unified Diff: mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl

Issue 1648803006: Expose Service Describer in Dart mojo package (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase Retest and Update Mojoms Created 4 years, 10 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
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 2367a585e0b31bb0916ddaae618b2a215c95f279..f10ff5078f4ce05f244d46707d7846fea347f49b 100644
--- a/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
@@ -15,19 +15,22 @@ const int _{{interface|name}}_{{method|name}}Name = {{method.ordinal}};
class _{{interface|name}}ServiceDescription implements {{descpkg}}ServiceDescription {
{%- if should_gen_mojom_types %}
dynamic getTopLevelInterface([Function responseFactory]) =>
- _{{interface|mojom_type_identifier|lower_camel}}();
+ responseFactory(_{{interface|mojom_type_identifier|lower_camel}}());
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
- getAllMojomTypeDefinitions()[typeKey];
+ responseFactory(getAllMojomTypeDefinitions()[typeKey]);
dynamic getAllTypeDefinitions([Function responseFactory]) =>
- getAllMojomTypeDefinitions();
+ responseFactory(getAllMojomTypeDefinitions());
{%- else %}
- dynamic getTopLevelInterface([Function responseFactory]) => null;
+ dynamic getTopLevelInterface([Function responseFactory]) =>
+ responseFactory(null);
- dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
+ dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
+ responseFactory(null);
- dynamic getAllTypeDefinitions([Function responseFactory]) => null;
+ dynamic getAllTypeDefinitions([Function responseFactory]) =>
+ responseFactory(null);
{%- endif %}
}
@@ -325,6 +328,6 @@ class {{interface|name}}Stub extends bindings.Stub {
int get version => {{interface.version}};
- {{descpkg}}ServiceDescription get serviceDescription =>
+ static {{descpkg}}ServiceDescription get serviceDescription =>
new _{{interface|name}}ServiceDescription();
}

Powered by Google App Engine
This is Rietveld 408576698