OLD | NEW |
| (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 -%} | |
OLD | NEW |