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

Side by Side Diff: mojo/public/tools/bindings/generators/go_templates/mojom_reference_macros.tmpl

Issue 1719873003: Mojom runtime type info: New implementation for Go. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebasing 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 {%- macro registerType(mapping, typepkg, pkg, type) -%}
6 {% if type|is_enum %}
7 {{mapping}}["{{type|mojom_type_identifier}}"] = &{{typepkg}}UserDefinedTypeEnu mType{
8 Value: {{type|mojom_type_identifier}}(),
9 }
10 {% elif type|is_struct %}
11 {{mapping}}["{{type|mojom_type_identifier}}"] = &{{typepkg}}UserDefinedTypeStr uctType{
12 Value: {{type|mojom_type_identifier}}(),
13 }
14 {% elif type|is_union %}
15 {{mapping}}["{{type|mojom_type_identifier}}"] = &{{typepkg}}UserDefinedTypeUni onType{
16 Value: {{type|mojom_type_identifier}}(),
17 }
18 {% elif type|is_interface %}
19 {{mapping}}["{{type|mojom_type_identifier}}"] = &{{typepkg}}UserDefinedTypeInt erfaceType{
20 Value: {{type|mojom_type_identifier}}(),
21 }
22 {% for method in type.methods %}
23 {{registerType(mapping, typepkg, pkg, method.param_struct)}}
24 {% if method.response_parameters -%}
25 {{registerType(mapping, typepkg, pkg, method.response_param_struct)}}
26 {%- endif %}
27 {%- endfor %}
28 {%- else -%}
29 {# Simple kinds, arrays, maps, and handles do not need to be registered. #}
30 {%- endif -%}
31 {%- endmacro -%}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698