OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_SAMPLE_SERVICE_MOJOM_INTERNAL_H_ |
| 6 #define MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_SAMPLE_SERVICE_MOJOM_INTERNAL_H_ |
| 7 |
| 8 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
| 9 #include "mojo/public/cpp/bindings/lib/buffer.h" |
| 10 #include "mojo/public/interfaces/bindings/tests/sample_import.mojom-internal.h" |
| 11 #include "mojo/public/interfaces/bindings/tests/sample_import2.mojom-internal.h" |
| 12 namespace sample { |
| 13 |
| 14 class Bar; |
| 15 class Foo; |
| 16 class DefaultsTestInner; |
| 17 class DefaultsTest; |
| 18 class StructWithHoleV1; |
| 19 class StructWithHoleV2; |
| 20 |
| 21 namespace internal { |
| 22 |
| 23 #pragma pack(push, 1) |
| 24 |
| 25 class Bar_Data { |
| 26 public: |
| 27 static Bar_Data* New(mojo::internal::Buffer* buf); |
| 28 |
| 29 mojo::internal::StructHeader header_; |
| 30 |
| 31 uint8_t alpha; |
| 32 uint8_t beta; |
| 33 uint8_t gamma; |
| 34 uint8_t pad2_[1]; |
| 35 int32_t type; |
| 36 |
| 37 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); |
| 38 bool DecodePointersAndHandles(mojo::Message* message); |
| 39 |
| 40 private: |
| 41 Bar_Data(); |
| 42 ~Bar_Data(); // NOT IMPLEMENTED |
| 43 }; |
| 44 MOJO_COMPILE_ASSERT(sizeof(Bar_Data) == 16, |
| 45 bad_sizeof_Bar_Data); |
| 46 |
| 47 class Foo_Data { |
| 48 public: |
| 49 static Foo_Data* New(mojo::internal::Buffer* buf); |
| 50 |
| 51 mojo::internal::StructHeader header_; |
| 52 |
| 53 int32_t x; |
| 54 int32_t y; |
| 55 uint8_t a : 1; |
| 56 uint8_t b : 1; |
| 57 uint8_t c : 1; |
| 58 uint8_t pad4_[3]; |
| 59 mojo::MessagePipeHandle source; |
| 60 mojo::internal::StructPointer<internal::Bar_Data> bar; |
| 61 mojo::internal::ArrayPointer<uint8_t> data; |
| 62 mojo::internal::ArrayPointer<internal::Bar_Data*> extra_bars; |
| 63 mojo::internal::StringPointer name; |
| 64 mojo::internal::ArrayPointer<mojo::DataPipeConsumerHandle> input_streams; |
| 65 mojo::internal::ArrayPointer<mojo::DataPipeProducerHandle> output_streams; |
| 66 mojo::internal::ArrayPointer<mojo::internal::Array_Data<bool>*> array_of_array
_of_bools; |
| 67 mojo::internal::ArrayPointer<mojo::internal::Array_Data<mojo::internal::Array_
Data<mojo::internal::String_Data*>*>*> multi_array_of_strings; |
| 68 |
| 69 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); |
| 70 bool DecodePointersAndHandles(mojo::Message* message); |
| 71 |
| 72 private: |
| 73 Foo_Data(); |
| 74 ~Foo_Data(); // NOT IMPLEMENTED |
| 75 }; |
| 76 MOJO_COMPILE_ASSERT(sizeof(Foo_Data) == 88, |
| 77 bad_sizeof_Foo_Data); |
| 78 |
| 79 class DefaultsTestInner_Data { |
| 80 public: |
| 81 static DefaultsTestInner_Data* New(mojo::internal::Buffer* buf); |
| 82 |
| 83 mojo::internal::StructHeader header_; |
| 84 |
| 85 int32_t x; |
| 86 uint8_t padfinal_[4]; |
| 87 |
| 88 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); |
| 89 bool DecodePointersAndHandles(mojo::Message* message); |
| 90 |
| 91 private: |
| 92 DefaultsTestInner_Data(); |
| 93 ~DefaultsTestInner_Data(); // NOT IMPLEMENTED |
| 94 }; |
| 95 MOJO_COMPILE_ASSERT(sizeof(DefaultsTestInner_Data) == 16, |
| 96 bad_sizeof_DefaultsTestInner_Data); |
| 97 |
| 98 class DefaultsTest_Data { |
| 99 public: |
| 100 static DefaultsTest_Data* New(mojo::internal::Buffer* buf); |
| 101 |
| 102 mojo::internal::StructHeader header_; |
| 103 |
| 104 int8_t a0; |
| 105 uint8_t a1; |
| 106 int16_t a2; |
| 107 uint16_t a3; |
| 108 uint8_t a11 : 1; |
| 109 uint8_t a12 : 1; |
| 110 uint8_t pad5_[1]; |
| 111 int32_t a4; |
| 112 uint32_t a5; |
| 113 int64_t a6; |
| 114 uint64_t a7; |
| 115 int32_t a8; |
| 116 int32_t a9; |
| 117 int32_t a10; |
| 118 float a13; |
| 119 double a14; |
| 120 double a15; |
| 121 double a16; |
| 122 double a17; |
| 123 mojo::internal::StructPointer<internal::DefaultsTestInner_Data> a18; |
| 124 mojo::internal::ArrayPointer<uint8_t> a19; |
| 125 mojo::internal::StringPointer a20; |
| 126 |
| 127 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); |
| 128 bool DecodePointersAndHandles(mojo::Message* message); |
| 129 |
| 130 private: |
| 131 DefaultsTest_Data(); |
| 132 ~DefaultsTest_Data(); // NOT IMPLEMENTED |
| 133 }; |
| 134 MOJO_COMPILE_ASSERT(sizeof(DefaultsTest_Data) == 112, |
| 135 bad_sizeof_DefaultsTest_Data); |
| 136 |
| 137 class StructWithHoleV1_Data { |
| 138 public: |
| 139 static StructWithHoleV1_Data* New(mojo::internal::Buffer* buf); |
| 140 |
| 141 mojo::internal::StructHeader header_; |
| 142 |
| 143 int32_t v1; |
| 144 uint8_t pad0_[4]; |
| 145 int64_t v2; |
| 146 |
| 147 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); |
| 148 bool DecodePointersAndHandles(mojo::Message* message); |
| 149 |
| 150 private: |
| 151 StructWithHoleV1_Data(); |
| 152 ~StructWithHoleV1_Data(); // NOT IMPLEMENTED |
| 153 }; |
| 154 MOJO_COMPILE_ASSERT(sizeof(StructWithHoleV1_Data) == 24, |
| 155 bad_sizeof_StructWithHoleV1_Data); |
| 156 |
| 157 class StructWithHoleV2_Data { |
| 158 public: |
| 159 static StructWithHoleV2_Data* New(mojo::internal::Buffer* buf); |
| 160 |
| 161 mojo::internal::StructHeader header_; |
| 162 |
| 163 int32_t v1; |
| 164 int32_t v3; |
| 165 int64_t v2; |
| 166 |
| 167 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); |
| 168 bool DecodePointersAndHandles(mojo::Message* message); |
| 169 |
| 170 private: |
| 171 StructWithHoleV2_Data(); |
| 172 ~StructWithHoleV2_Data(); // NOT IMPLEMENTED |
| 173 }; |
| 174 MOJO_COMPILE_ASSERT(sizeof(StructWithHoleV2_Data) == 24, |
| 175 bad_sizeof_StructWithHoleV2_Data); |
| 176 |
| 177 |
| 178 #pragma pack(pop) |
| 179 |
| 180 } // namespace internal |
| 181 } // namespace sample |
| 182 |
| 183 #endif // MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_SAMPLE_SERVICE_MOJOM_INTERNAL_H
_ |
OLD | NEW |