Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: mojo/public/cpp/bindings/lib/bindings_internal.h

Issue 1518293002: [mojo] Add Mojo bindings support for IPC::ParamTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pickle4
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
7 7
8 #include "mojo/public/cpp/bindings/lib/interface_id.h" 8 #include "mojo/public/cpp/bindings/lib/interface_id.h"
9 #include "mojo/public/cpp/bindings/lib/template_util.h" 9 #include "mojo/public/cpp/bindings/lib/template_util.h"
10 #include "mojo/public/cpp/bindings/struct_ptr.h" 10 #include "mojo/public/cpp/bindings/struct_ptr.h"
(...skipping 20 matching lines...) Expand all
31 static_assert(sizeof(ArrayHeader) == 8, "Bad_sizeof(ArrayHeader)"); 31 static_assert(sizeof(ArrayHeader) == 8, "Bad_sizeof(ArrayHeader)");
32 32
33 template <typename T> 33 template <typename T>
34 union StructPointer { 34 union StructPointer {
35 uint64_t offset; 35 uint64_t offset;
36 T* ptr; 36 T* ptr;
37 }; 37 };
38 static_assert(sizeof(StructPointer<char>) == 8, "Bad_sizeof(StructPointer)"); 38 static_assert(sizeof(StructPointer<char>) == 8, "Bad_sizeof(StructPointer)");
39 39
40 template <typename T> 40 template <typename T>
41 union NativePointer {
42 uint64_t offset;
43 Array_Data<uint8_t>* ptr;
44 };
45 static_assert(sizeof(NativePointer<char>) == sizeof(StructPointer<char>),
46 "Bad_sizeof(NativePointer)");
47
48 template <typename T>
41 union ArrayPointer { 49 union ArrayPointer {
42 uint64_t offset; 50 uint64_t offset;
43 Array_Data<T>* ptr; 51 Array_Data<T>* ptr;
44 }; 52 };
45 static_assert(sizeof(ArrayPointer<char>) == 8, "Bad_sizeof(ArrayPointer)"); 53 static_assert(sizeof(ArrayPointer<char>) == 8, "Bad_sizeof(ArrayPointer)");
46 54
47 using StringPointer = ArrayPointer<char>; 55 using StringPointer = ArrayPointer<char>;
48 static_assert(sizeof(StringPointer) == 8, "Bad_sizeof(StringPointer)"); 56 static_assert(sizeof(StringPointer) == 8, "Bad_sizeof(StringPointer)");
49 57
50 58
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 }; 131 };
124 template <typename S> 132 template <typename S>
125 struct WrapperTraits<S, true> { 133 struct WrapperTraits<S, true> {
126 typedef typename S::Data_* DataType; 134 typedef typename S::Data_* DataType;
127 }; 135 };
128 136
129 } // namespace internal 137 } // namespace internal
130 } // namespace mojo 138 } // namespace mojo
131 139
132 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 140 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/bindings/lib/buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698