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 #ifndef MOJO_GENERATED_BINDINGS_SAMPLE_FOO_SERIALIZATION_H_ | 5 #ifndef MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_SERIALIZATION_H_ |
6 #define MOJO_GENERATED_BINDINGS_SAMPLE_FOO_SERIALIZATION_H_ | 6 #define MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_SERIALIZATION_H_ |
| 7 |
| 8 #include <string.h> |
7 | 9 |
8 #include "mojo/public/bindings/lib/bindings_serialization.h" | 10 #include "mojo/public/bindings/lib/bindings_serialization.h" |
9 | 11 #include "mojo/public/bindings/sample/generated/sample_service.h" |
10 namespace sample { | |
11 class Foo; | |
12 } | |
13 | 12 |
14 namespace mojo { | 13 namespace mojo { |
15 namespace internal { | 14 namespace internal { |
16 | 15 |
17 template <> | 16 template <> |
| 17 class ObjectTraits<sample::Bar> { |
| 18 public: |
| 19 static size_t ComputeSizeOf(const sample::Bar* bar); |
| 20 static sample::Bar* Clone(const sample::Bar* bar, Buffer* buf); |
| 21 static void EncodePointersAndHandles(sample::Bar* bar, |
| 22 std::vector<mojo::Handle>* handles); |
| 23 static bool DecodePointersAndHandles(sample::Bar* bar, |
| 24 const mojo::Message& message); |
| 25 }; |
| 26 |
| 27 template <> |
18 class ObjectTraits<sample::Foo> { | 28 class ObjectTraits<sample::Foo> { |
19 public: | 29 public: |
20 static size_t ComputeSizeOf(const sample::Foo* foo); | 30 static size_t ComputeSizeOf(const sample::Foo* foo); |
21 static sample::Foo* Clone(const sample::Foo* foo, Buffer* buf); | 31 static sample::Foo* Clone(const sample::Foo* foo, Buffer* buf); |
22 static void EncodePointersAndHandles(sample::Foo* foo, | 32 static void EncodePointersAndHandles(sample::Foo* foo, |
23 std::vector<mojo::Handle>* handles); | 33 std::vector<mojo::Handle>* handles); |
24 static bool DecodePointersAndHandles(sample::Foo* foo, | 34 static bool DecodePointersAndHandles(sample::Foo* foo, |
25 const mojo::Message& message); | 35 const mojo::Message& message); |
26 }; | 36 }; |
27 | 37 |
28 } // namespace internal | 38 } // namespace internal |
29 } // namespace mojo | 39 } // namespace mojo |
30 | 40 |
31 #endif // MOJO_GENERATED_BINDINGS_SAMPLE_FOO_SERIALIZATION_H_ | 41 #endif // MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_SERIALIZATION_H_ |
OLD | NEW |