Chromium Code Reviews| 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 <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 int64 sequence_number; | 91 int64 sequence_number; |
| 92 // Average time of events that happened in this component. | 92 // Average time of events that happened in this component. |
| 93 base::TimeTicks event_time; | 93 base::TimeTicks event_time; |
| 94 // Count of events that happened in this component | 94 // Count of events that happened in this component |
| 95 uint32 event_count; | 95 uint32 event_count; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 // Empirically determined constant based on a typical scroll sequence. | 98 // Empirically determined constant based on a typical scroll sequence. |
| 99 enum { kTypicalMaxComponentsPerLatencyInfo = 6 }; | 99 enum { kTypicalMaxComponentsPerLatencyInfo = 6 }; |
| 100 | 100 |
| 101 enum { kMaxInputCoordinates = 2 }; | |
| 102 enum { kCoordinateDimensions = 2 }; | |
| 103 | |
|
jdduke (slow)
2014/09/17 17:43:34
If we can't use gfx::PointF, would this benefit fr
Sami
2014/09/18 14:52:37
Yes, that brings some well needed structure.
| |
| 104 typedef float InputCoordinates[kMaxInputCoordinates][kCoordinateDimensions]; | |
| 105 | |
| 101 // Map a Latency Component (with a component-specific int64 id) to a | 106 // Map a Latency Component (with a component-specific int64 id) to a |
| 102 // component info. | 107 // component info. |
| 103 typedef base::SmallMap< | 108 typedef base::SmallMap< |
| 104 std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>, | 109 std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>, |
| 105 kTypicalMaxComponentsPerLatencyInfo> LatencyMap; | 110 kTypicalMaxComponentsPerLatencyInfo> LatencyMap; |
| 106 | 111 |
| 107 LatencyInfo(); | 112 LatencyInfo(); |
| 108 | 113 |
| 109 ~LatencyInfo(); | 114 ~LatencyInfo(); |
| 110 | 115 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 int64 id, | 150 int64 id, |
| 146 LatencyComponent* output) const; | 151 LatencyComponent* output) const; |
| 147 | 152 |
| 148 void RemoveLatency(LatencyComponentType type); | 153 void RemoveLatency(LatencyComponentType type); |
| 149 | 154 |
| 150 void Clear(); | 155 void Clear(); |
| 151 | 156 |
| 152 // Records the |event_type| in trace buffer as TRACE_EVENT_ASYNC_STEP. | 157 // Records the |event_type| in trace buffer as TRACE_EVENT_ASYNC_STEP. |
| 153 void TraceEventType(const char* event_type); | 158 void TraceEventType(const char* event_type); |
| 154 | 159 |
| 155 LatencyMap latency_components; | 160 LatencyMap latency_components; |
|
jdduke (slow)
2014/09/17 17:43:34
Are all these members public to simplify serializa
Sami
2014/09/18 14:52:37
I guess that is the reason. Everything else mostly
| |
| 161 | |
| 162 // These coordinates represent window coordinates of the original input event. | |
| 163 size_t input_coordinates_size; | |
| 164 InputCoordinates input_coordinates; | |
| 165 | |
| 156 // The unique id for matching the ASYNC_BEGIN/END trace event. | 166 // The unique id for matching the ASYNC_BEGIN/END trace event. |
| 157 int64 trace_id; | 167 int64 trace_id; |
| 158 // Whether a terminal component has been added. | 168 // Whether a terminal component has been added. |
| 159 bool terminated; | 169 bool terminated; |
| 160 }; | 170 }; |
| 161 | 171 |
| 162 } // namespace ui | 172 } // namespace ui |
| 163 | 173 |
| 164 #endif // UI_EVENTS_LATENCY_INFO_H_ | 174 #endif // UI_EVENTS_LATENCY_INFO_H_ |
| OLD | NEW |