OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ARRAY_SERIALIZATION_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_SERIALIZATION_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_SERIALIZATION_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_SERIALIZATION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string.h> // For |memcpy()|. |
yzshen1
2014/07/18 20:52:49
nit, optional: I think it is no need to explain wh
viettrungluu
2014/07/18 20:59:33
Generally, I agree with you, but since the require
yzshen1
2014/07/18 21:01:26
Okay. I don't have a string opinion on this one.
| |
9 | |
10 #include <vector> | |
9 | 11 |
10 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 12 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
11 #include "mojo/public/cpp/bindings/lib/string_serialization.h" | 13 #include "mojo/public/cpp/bindings/lib/string_serialization.h" |
12 | 14 |
13 namespace mojo { | 15 namespace mojo { |
14 | 16 |
15 template <typename E> | 17 template <typename E> |
16 inline size_t GetSerializedSize_(const Array<E>& input); | 18 inline size_t GetSerializedSize_(const Array<E>& input); |
17 | 19 |
18 template <typename E, typename F> | 20 template <typename E, typename F> |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 if (input) { | 172 if (input) { |
171 internal::ArraySerializer<E, F>::DeserializeElements(input, output); | 173 internal::ArraySerializer<E, F>::DeserializeElements(input, output); |
172 } else { | 174 } else { |
173 output->reset(); | 175 output->reset(); |
174 } | 176 } |
175 } | 177 } |
176 | 178 |
177 } // namespace mojo | 179 } // namespace mojo |
178 | 180 |
179 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_SERIALIZATION_H_ | 181 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ARRAY_SERIALIZATION_H_ |
OLD | NEW |