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_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "mojo/public/cpp/bindings/interface_ptr.h" | |
11 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" | 10 #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
12 #include "mojo/public/cpp/system/core.h" | 11 #include "mojo/public/cpp/system/core.h" |
13 | 12 |
14 namespace mojo { | 13 namespace mojo { |
| 14 |
| 15 template <typename I> |
| 16 class InterfacePtr; |
| 17 |
| 18 template <typename I> |
| 19 class InterfacePtrInfo; |
| 20 |
15 namespace internal { | 21 namespace internal { |
16 | 22 |
17 // Please note that this is a different value than |mojo::kInvalidHandleValue|, | 23 // Please note that this is a different value than |mojo::kInvalidHandleValue|, |
18 // which is the "decoded" invalid handle. | 24 // which is the "decoded" invalid handle. |
19 const MojoHandle kEncodedInvalidHandleValue = static_cast<MojoHandle>(-1); | 25 const MojoHandle kEncodedInvalidHandleValue = static_cast<MojoHandle>(-1); |
20 | 26 |
21 size_t Align(size_t size); | 27 size_t Align(size_t size); |
22 char* AlignPointer(char* ptr); | 28 char* AlignPointer(char* ptr); |
23 | 29 |
24 bool IsAligned(const void* ptr); | 30 bool IsAligned(const void* ptr); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 inline void InterfaceDataToPointer(Interface_Data* input, | 88 inline void InterfaceDataToPointer(Interface_Data* input, |
83 InterfacePtr<T>* output) { | 89 InterfacePtr<T>* output) { |
84 output->Bind(InterfacePtrInfo<T>( | 90 output->Bind(InterfacePtrInfo<T>( |
85 MakeScopedHandle(FetchAndReset(&input->handle)), input->version)); | 91 MakeScopedHandle(FetchAndReset(&input->handle)), input->version)); |
86 } | 92 } |
87 | 93 |
88 } // namespace internal | 94 } // namespace internal |
89 } // namespace mojo | 95 } // namespace mojo |
90 | 96 |
91 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ | 97 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_SERIALIZATION_H_ |
OLD | NEW |