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

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

Issue 1753013002: Mojom runtime type info: New implementation for Dart. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: No changes to sha1s 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 8dc7d873f73db1c2a1a69f29676ed0f7b46332a5..433f1e383e566bcd63b696d9d4a9ca2473877955 100644
--- a/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
@@ -8,14 +8,13 @@ const int _{{interface|name}}_{{method|name}}Name = {{method.ordinal}};
{{ enum_def(enum, typepkg, package) }}
{%- endfor %}
-{% if should_gen_mojom_types -%}
-{{ mojom_type_macros.writeMojomTypeDef(interface, typepkg, package) }}
-{%- endif %}
-
class _{{interface|name}}ServiceDescription implements {{descpkg}}ServiceDescription {
-{%- if should_gen_mojom_types %}
- dynamic getTopLevelInterface([Function responseFactory]) =>
- responseFactory(_{{interface|mojom_type_identifier|lower_camel}}());
+{%- if should_gen_mojom_types and interface.service_name %}
+ dynamic getTopLevelInterface([Function responseFactory]){
+ var interfaceTypeKey = getRuntimeTypeInfo().servicesByName["{{interface.service_name}}"].topLevelInterface;
+ var userDefinedType = getAllMojomTypeDefinitions()[interfaceTypeKey];
+ return responseFactory(userDefinedType.interfaceType);
+ }
dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
responseFactory(getAllMojomTypeDefinitions()[typeKey]);

Powered by Google App Engine
This is Rietveld 408576698