OLD | NEW |
| (Empty) |
1 // Copyright $YEAR 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 #include "$SERIALIZATION_HEADER" | |
6 | |
7 #include <string.h> | |
8 | |
9 $INCLUDES | |
10 | |
11 namespace mojo { | |
12 namespace internal { | |
13 | |
14 // static | |
15 size_t ObjectTraits<$CLASS>::ComputeSizeOf( | |
16 const $CLASS* $NAME) { | |
17 $SIZES | |
18 } | |
19 | |
20 // static | |
21 $CLASS* ObjectTraits<$CLASS>::Clone( | |
22 const $CLASS* $NAME, Buffer* buf) { | |
23 $CLASS* clone = $CLASS::New(buf); | |
24 memcpy(clone, $NAME, sizeof(*$NAME)); | |
25 | |
26 $CLONES | |
27 | |
28 return clone; | |
29 } | |
30 | |
31 $SERIALIZATION | |
32 | |
33 } // namespace internal | |
34 } // namespace mojo | |
OLD | NEW |