Chromium Code Reviews| Index: mojo/common/common_custom_types_struct_traits.h |
| diff --git a/mojo/common/common_custom_types_struct_traits.h b/mojo/common/common_custom_types_struct_traits.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bce4edd1b1cd141ba2d2f18357957685a9145c94 |
| --- /dev/null |
| +++ b/mojo/common/common_custom_types_struct_traits.h |
| @@ -0,0 +1,25 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_ |
| +#define MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_ |
| + |
| +#include "mojo/common/common_custom_types.mojom.h" |
| + |
| +namespace base { |
| +class Version; |
| +} |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct StructTraits<mojo::common::mojom::Version, base::Version> { |
| + static std::vector<uint32_t> components(const base::Version& version); |
|
Fady Samuel
2016/07/18 15:59:39
const std::vector<uint32_t>&
Alex Z.
2016/07/19 15:13:19
Done.
|
| + static bool Read(mojo::common::mojom::VersionDataView data, |
| + base::Version* out); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_ |