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 #if defined(__clang__) |
| 6 #pragma clang diagnostic push |
| 7 #pragma clang diagnostic ignored "-Wunused-private-field" |
| 8 #endif |
| 9 |
5 #include "{{module.path}}.h" | 10 #include "{{module.path}}.h" |
6 | 11 |
7 #include "mojo/public/bindings/lib/bindings_serialization.h" | 12 #include "mojo/public/bindings/lib/bindings_serialization.h" |
8 #include "mojo/public/bindings/lib/message_builder.h" | 13 #include "mojo/public/bindings/lib/message_builder.h" |
9 | 14 |
10 namespace {{namespace}} { | 15 namespace {{namespace}} { |
11 namespace internal { | 16 namespace internal { |
12 namespace { | 17 namespace { |
13 | 18 |
14 #pragma pack(push, 1) | 19 #pragma pack(push, 1) |
15 #if defined(__clang__) | 20 |
16 #pragma clang diagnostic push | |
17 #pragma clang diagnostic ignored "-Wunused-private-field" | |
18 #endif | |
19 {#--- Interface parameter definitions #} | 21 {#--- Interface parameter definitions #} |
20 {%- for interface in interfaces %} | 22 {%- for interface in interfaces %} |
21 {%- for method in interface.methods %} | 23 {%- for method in interface.methods %} |
22 {%- set struct = interface|struct_from_method(method) %} | 24 {%- set method_name = "k%s_%s_Name"|format(interface.name, method.name) %} |
| 25 const uint32_t {{method_name}} = {{method.ordinal}}; |
| 26 {% set struct = interface|struct_from_method(method) %} |
23 {%- include "params_definition.tmpl" %} | 27 {%- include "params_definition.tmpl" %} |
| 28 {%- if method.response_parameters != None %} |
| 29 {%- set struct = interface|response_struct_from_method(method) %} |
| 30 {%- include "params_definition.tmpl" %} |
| 31 {%- endif %} |
24 {%- endfor %} | 32 {%- endfor %} |
25 {%- endfor %} | 33 {%- endfor %} |
26 #if defined(__clang__) | 34 |
27 #pragma clang diagnostic pop | |
28 #endif | |
29 #pragma pack(pop) | 35 #pragma pack(pop) |
30 | 36 |
31 } // namespace | 37 } // namespace |
32 | 38 |
33 {#--- Struct destructors #} | 39 {#--- Struct destructors #} |
34 {%- for struct in structs %} | 40 {%- for struct in structs %} |
35 {%- include "struct_destructor.tmpl" %} | 41 {%- include "struct_destructor.tmpl" %} |
36 {%- endfor %} | 42 {%- endfor %} |
37 | 43 |
38 {#--- Struct definitions #} | 44 {#--- Struct definitions #} |
39 {% for struct in structs %} | 45 {% for struct in structs %} |
40 {%- include "struct_definition.tmpl" %} | 46 {%- include "struct_definition.tmpl" %} |
41 {%- endfor %} | 47 {%- endfor %} |
42 | 48 |
43 } // namespace internal | 49 } // namespace internal |
44 | 50 |
45 {#--- Struct builder definitions #} | 51 {#--- Struct builder definitions #} |
46 {%- for struct in structs %} | 52 {%- for struct in structs %} |
47 {%- include "struct_builder_definition.tmpl" %} | 53 {%- include "struct_builder_definition.tmpl" %} |
48 {%- endfor %} | 54 {%- endfor %} |
49 | 55 |
50 {#--- Interface definitions #} | 56 {#--- Interface definitions #} |
51 {%- for interface in interfaces %} | 57 {%- for interface in interfaces %} |
52 {%- include "interface_definition.tmpl" %} | 58 {%- include "interface_definition.tmpl" %} |
53 {%- endfor %} | 59 {%- endfor %} |
54 } // namespace {{namespace}} | 60 } // namespace {{namespace}} |
| 61 |
| 62 #if defined(__clang__) |
| 63 #pragma clang diagnostic pop |
| 64 #endif |
OLD | NEW |