OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 UI_LATENCY_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ | 5 #ifndef UI_LATENCY_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ |
6 #define UI_LATENCY_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ | 6 #define UI_LATENCY_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" | 8 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
9 #include "ui/latency/latency_info.h" | 9 #include "ui/latency/latency_info.h" |
10 #include "ui/latency/mojo/latency_info.mojom-shared.h" | 10 #include "ui/latency/mojo/latency_info.mojom-shared.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 | 13 |
14 using InputCoordinateArray = CArray<gfx::PointF>; | |
15 | |
16 template <> | 14 template <> |
17 struct ArrayTraits<ui::LatencyInfo::LatencyMap> { | 15 struct ArrayTraits<ui::LatencyInfo::LatencyMap> { |
18 using Element = ui::LatencyInfo::LatencyMap::value_type; | 16 using Element = ui::LatencyInfo::LatencyMap::value_type; |
19 using Iterator = ui::LatencyInfo::LatencyMap::iterator; | 17 using Iterator = ui::LatencyInfo::LatencyMap::iterator; |
20 using ConstIterator = ui::LatencyInfo::LatencyMap::const_iterator; | 18 using ConstIterator = ui::LatencyInfo::LatencyMap::const_iterator; |
21 | 19 |
22 static ConstIterator GetBegin(const ui::LatencyInfo::LatencyMap& input) { | 20 static ConstIterator GetBegin(const ui::LatencyInfo::LatencyMap& input) { |
23 return input.begin(); | 21 return input.begin(); |
24 } | 22 } |
25 static Iterator GetBegin(ui::LatencyInfo::LatencyMap& input) { | 23 static Iterator GetBegin(ui::LatencyInfo::LatencyMap& input) { |
(...skipping 52 matching lines...) Loading... |
78 static int64_t id(const std::pair<ui::LatencyComponentType, int64_t>& id); | 76 static int64_t id(const std::pair<ui::LatencyComponentType, int64_t>& id); |
79 static bool Read(ui::mojom::LatencyComponentIdDataView data, | 77 static bool Read(ui::mojom::LatencyComponentIdDataView data, |
80 std::pair<ui::LatencyComponentType, int64_t>* out); | 78 std::pair<ui::LatencyComponentType, int64_t>* out); |
81 }; | 79 }; |
82 | 80 |
83 template <> | 81 template <> |
84 struct StructTraits<ui::mojom::LatencyInfoDataView, ui::LatencyInfo> { | 82 struct StructTraits<ui::mojom::LatencyInfoDataView, ui::LatencyInfo> { |
85 static const std::string& trace_name(const ui::LatencyInfo& info); | 83 static const std::string& trace_name(const ui::LatencyInfo& info); |
86 static const ui::LatencyInfo::LatencyMap& latency_components( | 84 static const ui::LatencyInfo::LatencyMap& latency_components( |
87 const ui::LatencyInfo& info); | 85 const ui::LatencyInfo& info); |
88 static uint32_t input_coordinates_size(const ui::LatencyInfo& info); | |
89 static InputCoordinateArray input_coordinates(const ui::LatencyInfo& info); | |
90 static int64_t trace_id(const ui::LatencyInfo& info); | 86 static int64_t trace_id(const ui::LatencyInfo& info); |
91 static bool coalesced(const ui::LatencyInfo& info); | 87 static bool coalesced(const ui::LatencyInfo& info); |
92 static bool terminated(const ui::LatencyInfo& info); | 88 static bool terminated(const ui::LatencyInfo& info); |
93 static bool Read(ui::mojom::LatencyInfoDataView data, ui::LatencyInfo* out); | 89 static bool Read(ui::mojom::LatencyInfoDataView data, ui::LatencyInfo* out); |
94 }; | 90 }; |
95 | 91 |
96 } // namespace mojo | 92 } // namespace mojo |
97 | 93 |
98 #endif // UI_LATENCY_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ | 94 #endif // UI_LATENCY_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ |
OLD | NEW |