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

Side by Side Diff: mojo/public/bindings/generators/cpp_templates/struct_serialization.cc-template

Issue 65933002: Mojo: Unify the disparate source and header files into 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mistaken /n's Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698