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