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

Side by Side Diff: mojo/common/common_custom_types_struct_traits.cc

Issue 2147693002: Struct traits used by GpuInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved Read() to .cc file Created 4 years, 4 months 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
(Empty)
1 // Copyright 2016 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 "mojo/common/common_custom_types_struct_traits.h"
6
7 #include <iterator>
8
9 #include "base/version.h"
10
11 namespace mojo {
12
13 // static
14 const std::vector<uint32_t>&
15 StructTraits<mojo::common::mojom::Version, base::Version>::components(
16 const base::Version& version) {
17 return version.components();
dcheng 2016/07/28 02:09:39 Assuming this isn't doing any implicit conversions
Alex Z. 2016/07/28 19:40:44 Done.
18 }
19
20 // static
21 bool StructTraits<mojo::common::mojom::Version, base::Version>::Read(
22 mojo::common::mojom::VersionDataView data,
23 base::Version* out) {
24 std::vector<uint32_t> components;
25 if (!data.ReadComponents(&components))
26 return false;
27
28 *out = base::Version(base::Version(std::move(components)));
29 return out->IsValid();
30 }
31
32 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698