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 #include "ui/events/mojo/latency_info_struct_traits.h" | 5 #include "ui/events/mojo/latency_info_struct_traits.h" |
6 | 6 |
7 #include "ipc/ipc_message_utils.h" | 7 #include "ipc/ipc_message_utils.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 | 10 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return component.event_time; | 168 return component.event_time; |
169 } | 169 } |
170 | 170 |
171 // static | 171 // static |
172 uint32_t StructTraits<ui::mojom::LatencyComponentDataView, | 172 uint32_t StructTraits<ui::mojom::LatencyComponentDataView, |
173 ui::LatencyInfo::LatencyComponent>:: | 173 ui::LatencyInfo::LatencyComponent>:: |
174 event_count(const ui::LatencyInfo::LatencyComponent& component) { | 174 event_count(const ui::LatencyInfo::LatencyComponent& component) { |
175 return component.event_count; | 175 return component.event_count; |
176 } | 176 } |
177 | 177 |
| 178 //static |
| 179 base::TimeTicks StructTraits<ui::mojom::LatencyComponentDataView, |
| 180 ui::LatencyInfo::LatencyComponent>:: |
| 181 first_event_time(const ui::LatencyInfo::LatencyComponent& component) { |
| 182 return component.first_event_time; |
| 183 } |
| 184 |
| 185 //static |
| 186 base::TimeTicks StructTraits<ui::mojom::LatencyComponentDataView, |
| 187 ui::LatencyInfo::LatencyComponent>:: |
| 188 last_event_time(const ui::LatencyInfo::LatencyComponent& component) { |
| 189 return component.last_event_time; |
| 190 } |
| 191 |
178 // static | 192 // static |
179 bool StructTraits<ui::mojom::LatencyComponentDataView, | 193 bool StructTraits<ui::mojom::LatencyComponentDataView, |
180 ui::LatencyInfo::LatencyComponent>:: | 194 ui::LatencyInfo::LatencyComponent>:: |
181 Read(ui::mojom::LatencyComponentDataView data, | 195 Read(ui::mojom::LatencyComponentDataView data, |
182 ui::LatencyInfo::LatencyComponent* out) { | 196 ui::LatencyInfo::LatencyComponent* out) { |
183 if (!data.ReadEventTime(&out->event_time)) | 197 if (!data.ReadEventTime(&out->event_time)) |
184 return false; | 198 return false; |
| 199 if (!data.ReadFirstEventTime(&out->first_event_time)) |
| 200 return false; |
| 201 if (!data.ReadLastEventTime(&out->last_event_time)) |
| 202 return false; |
185 out->sequence_number = data.sequence_number(); | 203 out->sequence_number = data.sequence_number(); |
186 out->event_count = data.event_count(); | 204 out->event_count = data.event_count(); |
187 return true; | 205 return true; |
188 } | 206 } |
189 | 207 |
190 // static | 208 // static |
191 ui::mojom::LatencyComponentType | 209 ui::mojom::LatencyComponentType |
192 StructTraits<ui::mojom::LatencyComponentIdDataView, | 210 StructTraits<ui::mojom::LatencyComponentIdDataView, |
193 std::pair<ui::LatencyComponentType, int64_t>>:: | 211 std::pair<ui::LatencyComponentType, int64_t>>:: |
194 type(const std::pair<ui::LatencyComponentType, int64_t>& id) { | 212 type(const std::pair<ui::LatencyComponentType, int64_t>& id) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 out->input_coordinates_size_ = | 291 out->input_coordinates_size_ = |
274 static_cast<uint32_t>(input_coordinate_array.size); | 292 static_cast<uint32_t>(input_coordinate_array.size); |
275 | 293 |
276 out->trace_id_ = data.trace_id(); | 294 out->trace_id_ = data.trace_id(); |
277 out->coalesced_ = data.coalesced(); | 295 out->coalesced_ = data.coalesced(); |
278 out->terminated_ = data.terminated(); | 296 out->terminated_ = data.terminated(); |
279 return true; | 297 return true; |
280 } | 298 } |
281 | 299 |
282 } // namespace mojo | 300 } // namespace mojo |
OLD | NEW |