| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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 maybeWriteStaticMojomTypeAccessor(typepkg, type) %} | |
| 6 {% if should_gen_mojom_types and type|mojom_type_key != "" %} | |
| 7 | |
| 8 // {{type|name(true)}}MojomType returns the UserDefinedType that describes the M
ojom | |
| 9 // type of {{type|name(true)}}. To obtain the UserDefinedType for Mojom types re
cursively | |
| 10 // contained in the returned UserDefinedType, look in the map returned | |
| 11 // by the function GetAllMojomTypeDefinitions(). | |
| 12 func {{type|name(true)}}MojomType() {{typepkg}}UserDefinedType { | |
| 13 return GetAllMojomTypeDefinitions()["{{type|mojom_type_key}}"] | |
| 14 } | |
| 15 | |
| 16 {% endif %} | |
| 17 {% endmacro %} | |
| 18 | |
| 19 | |
| 20 {% macro maybeWriteMojomTypeAccessor(typepkg, staticType, typeName) %} | |
| 21 {% if should_gen_mojom_types and staticType|mojom_type_key != "" %} | |
| 22 | |
| 23 // MojomType returns the UserDefinedType that describes the Mojom | |
| 24 // type of this object. To obtain the UserDefinedType for Mojom types recursivel
y | |
| 25 // contained in the returned UserDefinedType, look in the map returned | |
| 26 // by the function AllMojomTypes(). | |
| 27 func (*{{typeName}}) MojomType() {{typepkg}}UserDefinedType { | |
| 28 return {{staticType|name(true)}}MojomType() | |
| 29 } | |
| 30 | |
| 31 // AllMojomTypes returns a map that contains the UserDefinedType for | |
| 32 // all Mojom types in the complete type graph of the Mojom type of this object. | |
| 33 func (*{{typeName}}) AllMojomTypes() map[string]{{typepkg}}UserDefinedType { | |
| 34 return GetAllMojomTypeDefinitions() | |
| 35 } | |
| 36 {% endif %} | |
| 37 {% endmacro %} | |
| OLD | NEW |