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

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

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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 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 %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698