| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LATENCY_INFO_H_ | 5 #ifndef UI_EVENTS_LATENCY_INFO_H_ |
| 6 #define UI_EVENTS_LATENCY_INFO_H_ | 6 #define UI_EVENTS_LATENCY_INFO_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 public: | 130 public: |
| 131 struct LatencyComponent { | 131 struct LatencyComponent { |
| 132 // Nondecreasing number that can be used to determine what events happened | 132 // Nondecreasing number that can be used to determine what events happened |
| 133 // in the component at the time this struct was sent on to the next | 133 // in the component at the time this struct was sent on to the next |
| 134 // component. | 134 // component. |
| 135 int64_t sequence_number; | 135 int64_t sequence_number; |
| 136 // Average time of events that happened in this component. | 136 // Average time of events that happened in this component. |
| 137 base::TimeTicks event_time; | 137 base::TimeTicks event_time; |
| 138 // Count of events that happened in this component | 138 // Count of events that happened in this component |
| 139 uint32_t event_count; | 139 uint32_t event_count; |
| 140 // Time of the oldest event that happened in this component. |
| 141 base::TimeTicks first_event_time; |
| 142 // Time of the most recent event that happened in this component. |
| 143 base::TimeTicks last_event_time; |
| 140 }; | 144 }; |
| 141 | 145 |
| 142 // Empirically determined constant based on a typical scroll sequence. | 146 // Empirically determined constant based on a typical scroll sequence. |
| 143 enum { kTypicalMaxComponentsPerLatencyInfo = 10 }; | 147 enum { kTypicalMaxComponentsPerLatencyInfo = 10 }; |
| 144 | 148 |
| 145 enum : size_t { kMaxInputCoordinates = 2 }; | 149 enum : size_t { kMaxInputCoordinates = 2 }; |
| 146 | 150 |
| 147 // Map a Latency Component (with a component-specific int64_t id) to a | 151 // Map a Latency Component (with a component-specific int64_t id) to a |
| 148 // component info. | 152 // component info. |
| 149 typedef base::SmallMap< | 153 typedef base::SmallMap< |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 #if !defined(OS_IOS) | 266 #if !defined(OS_IOS) |
| 263 friend struct IPC::ParamTraits<ui::LatencyInfo>; | 267 friend struct IPC::ParamTraits<ui::LatencyInfo>; |
| 264 friend struct mojo::StructTraits<ui::mojom::LatencyInfoDataView, | 268 friend struct mojo::StructTraits<ui::mojom::LatencyInfoDataView, |
| 265 ui::LatencyInfo>; | 269 ui::LatencyInfo>; |
| 266 #endif | 270 #endif |
| 267 }; | 271 }; |
| 268 | 272 |
| 269 } // namespace ui | 273 } // namespace ui |
| 270 | 274 |
| 271 #endif // UI_EVENTS_LATENCY_INFO_H_ | 275 #endif // UI_EVENTS_LATENCY_INFO_H_ |
| OLD | NEW |