| 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_EVENTS_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ | 5 #ifndef UI_EVENTS_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ |
| 6 #define UI_EVENTS_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ | 6 #define UI_EVENTS_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "ui/events/latency_info.h" | 8 #include "ui/events/latency_info.h" |
| 9 #include "ui/events/mojo/latency_info.mojom.h" | 9 #include "ui/events/mojo/latency_info.mojom.h" |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // TODO(fsamuel): We should add a common ArrayTraits<CArray<T>> utility struct. | 37 // TODO(fsamuel): We should add a common ArrayTraits<CArray<T>> utility struct. |
| 38 template <> | 38 template <> |
| 39 struct ArrayTraits<InputCoordinateArray> { | 39 struct ArrayTraits<InputCoordinateArray> { |
| 40 using Element = ui::LatencyInfo::InputCoordinate; | 40 using Element = ui::LatencyInfo::InputCoordinate; |
| 41 static size_t GetSize(const InputCoordinateArray& b); | 41 static size_t GetSize(const InputCoordinateArray& b); |
| 42 static Element* GetData(InputCoordinateArray& b); | 42 static Element* GetData(InputCoordinateArray& b); |
| 43 static const Element* GetData(const InputCoordinateArray& b); | 43 static const Element* GetData(const InputCoordinateArray& b); |
| 44 static Element& GetAt(InputCoordinateArray& b, size_t i); | 44 static Element& GetAt(InputCoordinateArray& b, size_t i); |
| 45 static const Element& GetAt(const InputCoordinateArray& b, size_t i); | 45 static const Element& GetAt(const InputCoordinateArray& b, size_t i); |
| 46 static void Resize(InputCoordinateArray& b, size_t size); | 46 static bool Resize(InputCoordinateArray& b, size_t size); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 template <> | 49 template <> |
| 50 struct StructTraits<ui::mojom::LatencyComponent, | 50 struct StructTraits<ui::mojom::LatencyComponent, |
| 51 ui::LatencyInfo::LatencyComponent> { | 51 ui::LatencyInfo::LatencyComponent> { |
| 52 static int64_t sequence_number( | 52 static int64_t sequence_number( |
| 53 const ui::LatencyInfo::LatencyComponent& component); | 53 const ui::LatencyInfo::LatencyComponent& component); |
| 54 static base::TimeTicks event_time( | 54 static base::TimeTicks event_time( |
| 55 const ui::LatencyInfo::LatencyComponent& component); | 55 const ui::LatencyInfo::LatencyComponent& component); |
| 56 static uint32_t event_count( | 56 static uint32_t event_count( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 81 static InputCoordinateArray input_coordinates(const ui::LatencyInfo& info); | 81 static InputCoordinateArray input_coordinates(const ui::LatencyInfo& info); |
| 82 static int64_t trace_id(const ui::LatencyInfo& info); | 82 static int64_t trace_id(const ui::LatencyInfo& info); |
| 83 static bool coalesced(const ui::LatencyInfo& info); | 83 static bool coalesced(const ui::LatencyInfo& info); |
| 84 static bool terminated(const ui::LatencyInfo& info); | 84 static bool terminated(const ui::LatencyInfo& info); |
| 85 static bool Read(ui::mojom::LatencyInfoDataView data, ui::LatencyInfo* out); | 85 static bool Read(ui::mojom::LatencyInfoDataView data, ui::LatencyInfo* out); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace mojo | 88 } // namespace mojo |
| 89 | 89 |
| 90 #endif // UI_EVENTS_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ | 90 #endif // UI_EVENTS_MOJO_LATENCY_INFO_STRUCT_TRAITS_H_ |
| OLD | NEW |