OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 define("{{module.path}}", [ | 5 define("{{module.path}}", [ |
6 "mojo/public/js/bindings/codec", | 6 "mojo/public/js/bindings/codec", |
7 "mojo/public/js/bindings/validator", | 7 "mojo/public/js/bindings/validator", |
8 {%- for import in imports %} | 8 {%- for import in imports %} |
9 "{{import.module.path}}", | 9 "{{import.module.path}}", |
10 {%- endfor %} | 10 {%- endfor %} |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 {#--- Enums #} | 22 {#--- Enums #} |
23 {%- from "enum_definition.tmpl" import enum_def %} | 23 {%- from "enum_definition.tmpl" import enum_def %} |
24 {%- for enum in enums %} | 24 {%- for enum in enums %} |
25 var {{ enum_def(enum.name, enum, module) }} | 25 var {{ enum_def(enum.name, enum, module) }} |
26 {%- endfor %} | 26 {%- endfor %} |
27 | 27 |
28 {#--- Struct definitions #} | 28 {#--- Struct definitions #} |
29 {% for struct in structs %} | 29 {% for struct in structs %} |
30 {%- include "struct_definition.tmpl" %} | 30 {%- include "struct_definition.tmpl" %} |
31 {%- endfor %} | 31 {%- endfor -%} |
32 | 32 |
33 {#--- Interface definitions #} | 33 {#--- Interface definitions #} |
34 {%- for interface in interfaces %} | 34 {%- for interface in interfaces -%} |
35 {%- include "interface_definition.tmpl" %} | 35 {%- include "interface_definition.tmpl" %} |
36 {%- endfor %} | 36 {%- endfor %} |
37 | 37 |
38 var exports = {}; | 38 var exports = {}; |
39 {% for constant in module.constants %} | 39 {%- for constant in module.constants %} |
40 exports.{{constant.name}} = {{constant.name}}; | 40 exports.{{constant.name}} = {{constant.name}}; |
41 {%- endfor %} | 41 {%- endfor %} |
42 {%- for enum in enums %} | 42 {%- for enum in enums %} |
43 exports.{{enum.name}} = {{enum.name}}; | 43 exports.{{enum.name}} = {{enum.name}}; |
44 {%- endfor %} | 44 {%- endfor %} |
45 {%- for struct in structs if struct.exported %} | 45 {%- for struct in structs if struct.exported %} |
46 exports.{{struct.name}} = {{struct.name}}; | 46 exports.{{struct.name}} = {{struct.name}}; |
47 {%- endfor %} | 47 {%- endfor %} |
48 {%- for interface in interfaces %} | 48 {%- for interface in interfaces %} |
49 exports.{{interface.name}}Proxy = {{interface.name}}Proxy; | 49 exports.{{interface.name}}Proxy = {{interface.name}}Proxy; |
50 exports.{{interface.name}}Stub = {{interface.name}}Stub; | 50 exports.{{interface.name}}Stub = {{interface.name}}Stub; |
51 exports.validate{{interface.name}}Request = validate{{interface.name}}Request; | |
52 exports.validate{{interface.name}}Response = validate{{interface.name}}Respons
e; | |
53 {%- endfor %} | 51 {%- endfor %} |
54 return exports; | 52 return exports; |
55 }); | 53 }); |
OLD | NEW |