| 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__) | 5 #if defined(__clang__) |
| 6 #pragma clang diagnostic push | 6 #pragma clang diagnostic push |
| 7 #pragma clang diagnostic ignored "-Wunused-private-field" | 7 #pragma clang diagnostic ignored "-Wunused-private-field" |
| 8 #elif defined(_MSC_VER) | 8 #elif defined(_MSC_VER) |
| 9 #pragma warning(push) | 9 #pragma warning(push) |
| 10 #pragma warning(disable:4056) | 10 #pragma warning(disable:4056) |
| 11 #pragma warning(disable:4756) | 11 #pragma warning(disable:4756) |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include "{{module.path}}.h" | 14 #include "{{module.path}}.h" |
| 15 | 15 |
| 16 #include <math.h> | 16 #include <math.h> |
| 17 | 17 |
| 18 #include "mojo/public/cpp/bindings/lib/array_serialization.h" | 18 #include "mojo/public/cpp/bindings/lib/array_serialization.h" |
| 19 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" | 19 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" |
| 20 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" | 20 #include "mojo/public/cpp/bindings/lib/bounds_checker.h" |
| 21 #include "mojo/public/cpp/bindings/lib/map_data_internal.h" | 21 #include "mojo/public/cpp/bindings/lib/map_data_internal.h" |
| 22 #include "mojo/public/cpp/bindings/lib/map_serialization.h" | 22 #include "mojo/public/cpp/bindings/lib/map_serialization.h" |
| 23 #include "mojo/public/cpp/bindings/lib/message_builder.h" | 23 #include "mojo/public/cpp/bindings/lib/message_builder.h" |
| 24 #include "mojo/public/cpp/bindings/lib/string_serialization.h" | 24 #include "mojo/public/cpp/bindings/lib/string_serialization.h" |
| 25 #include "mojo/public/cpp/bindings/lib/validate_params.h" | 25 #include "mojo/public/cpp/bindings/lib/validate_params.h" |
| 26 #include "mojo/public/cpp/bindings/lib/validation_errors.h" | 26 #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| 27 #include "mojo/public/cpp/bindings/lib/union_accessor.h" | |
| 28 #include "mojo/public/cpp/environment/logging.h" | 27 #include "mojo/public/cpp/environment/logging.h" |
| 29 | 28 |
| 30 {%- for namespace in namespaces_as_array %} | 29 {%- for namespace in namespaces_as_array %} |
| 31 namespace {{namespace}} { | 30 namespace {{namespace}} { |
| 32 {%- endfor %} | 31 {%- endfor %} |
| 33 | 32 |
| 34 {#--- Constants #} | 33 {#--- Constants #} |
| 35 {% for constant in module.constants %} | 34 {% for constant in module.constants %} |
| 36 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_val
ue}}; | 35 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|constant_val
ue}}; |
| 37 {%- endfor %} | 36 {%- endfor %} |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 | 56 |
| 58 #pragma pack(pop) | 57 #pragma pack(pop) |
| 59 | 58 |
| 60 } // namespace | 59 } // namespace |
| 61 | 60 |
| 62 {#--- Struct definitions #} | 61 {#--- Struct definitions #} |
| 63 {% for struct in structs %} | 62 {% for struct in structs %} |
| 64 {%- include "struct_definition.tmpl" %} | 63 {%- include "struct_definition.tmpl" %} |
| 65 {%- endfor %} | 64 {%- endfor %} |
| 66 | 65 |
| 67 {#--- Union definitions #} | |
| 68 {% for union in unions %} | |
| 69 {%- include "union_definition.tmpl" %} | |
| 70 {%- endfor %} | |
| 71 | |
| 72 } // namespace internal | 66 } // namespace internal |
| 73 | 67 |
| 74 {#--- Struct Constants #} | 68 {#--- Struct Constants #} |
| 75 {%- for struct in structs %} | 69 {%- for struct in structs %} |
| 76 {% for constant in struct.constants %} | 70 {% for constant in struct.constants %} |
| 77 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons
tant|constant_value}}; | 71 const {{constant.kind|cpp_pod_type}} {{struct.name}}::{{constant.name}} = {{cons
tant|constant_value}}; |
| 78 {%- endfor %} | 72 {%- endfor %} |
| 79 {%- endfor %} | 73 {%- endfor %} |
| 80 | 74 |
| 81 {#--- Struct builder definitions #} | 75 {#--- Struct builder definitions #} |
| 82 {%- for struct in structs %} | 76 {%- for struct in structs %} |
| 83 {%- include "wrapper_class_definition.tmpl" %} | 77 {%- include "wrapper_class_definition.tmpl" %} |
| 84 {%- endfor %} | 78 {%- endfor %} |
| 85 | 79 |
| 86 {#--- Union builder definitions #} | |
| 87 {%- for union in unions %} | |
| 88 {%- include "wrapper_union_class_definition.tmpl" %} | |
| 89 {%- endfor %} | |
| 90 | |
| 91 {#--- Interface definitions #} | 80 {#--- Interface definitions #} |
| 92 {%- for interface in interfaces %} | 81 {%- for interface in interfaces %} |
| 93 {%- include "interface_definition.tmpl" %} | 82 {%- include "interface_definition.tmpl" %} |
| 94 {%- endfor %} | 83 {%- endfor %} |
| 95 | 84 |
| 96 {#--- Struct Serialization Helpers #} | 85 {#--- Struct Serialization Helpers #} |
| 97 {%- for struct in structs %} | 86 {%- for struct in structs %} |
| 98 {%- include "struct_serialization_definition.tmpl" %} | 87 {%- include "struct_serialization_definition.tmpl" %} |
| 99 {%- endfor %} | 88 {%- endfor %} |
| 100 | 89 |
| 101 {#--- Union Serialization Helpers #} | |
| 102 {%- for union in unions %} | |
| 103 {%- include "union_serialization_definition.tmpl" %} | |
| 104 {%- endfor %} | |
| 105 | |
| 106 {%- for namespace in namespaces_as_array|reverse %} | 90 {%- for namespace in namespaces_as_array|reverse %} |
| 107 } // namespace {{namespace}} | 91 } // namespace {{namespace}} |
| 108 {%- endfor %} | 92 {%- endfor %} |
| 109 | 93 |
| 110 #if defined(__clang__) | 94 #if defined(__clang__) |
| 111 #pragma clang diagnostic pop | 95 #pragma clang diagnostic pop |
| 112 #elif defined(_MSC_VER) | 96 #elif defined(_MSC_VER) |
| 113 #pragma warning(pop) | 97 #pragma warning(pop) |
| 114 #endif | 98 #endif |
| OLD | NEW |