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

Side by Side Diff: mojo/public/tools/bindings/generators/dart_templates/struct_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, 9 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 unified diff | Download patch
OLDNEW
1 {#--- Begin #} 1 {#--- Begin #}
2 {%- import "encoding_macros.tmpl" as encoding_macros %} 2 {%- import "encoding_macros.tmpl" as encoding_macros %}
3 {%- import "mojom_type_macros.tmpl" as mojom_type_macros %}
4 {%- macro struct_def(struct, typepkg, package) %} 3 {%- macro struct_def(struct, typepkg, package) %}
5 {#--- Enums #} 4 {#--- Enums #}
6 {%- from "enum_definition.tmpl" import enum_def %} 5 {%- from "enum_definition.tmpl" import enum_def %}
7 {%- for enum in struct.enums %} 6 {%- for enum in struct.enums %}
8 {{enum_def(enum, typepkg, package)}} 7 {{enum_def(enum, typepkg, package)}}
9 {%- endfor %} 8 {%- endfor %}
10 9
11 class {{struct|name}} extends bindings.Struct { 10 class {{struct|name}} extends bindings.Struct {
12 static const List<bindings.StructDataHeader> kVersions = const [ 11 static const List<bindings.StructDataHeader> kVersions = const [
13 {%- for version in struct.versions %} 12 {%- for version in struct.versions %}
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 map["{{packed_field.field|name}}"] = {{packed_field.field|name}}; 103 map["{{packed_field.field|name}}"] = {{packed_field.field|name}};
105 {%- endfor %} 104 {%- endfor %}
106 return map; 105 return map;
107 {%- else %} 106 {%- else %}
108 throw new bindings.MojoCodecError( 107 throw new bindings.MojoCodecError(
109 'Object containing handles cannot be encoded to JSON.'); 108 'Object containing handles cannot be encoded to JSON.');
110 {%- endif %} 109 {%- endif %}
111 } 110 }
112 } 111 }
113 112
114 {% if should_gen_mojom_types -%}
115 {{ mojom_type_macros.writeMojomTypeDef(struct, typepkg, package) }}
116 {%- endif -%}
117 {%- endmacro %} 113 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698