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_LATENCY_LATENCY_INFO_H_ | 5 #ifndef UI_LATENCY_LATENCY_INFO_H_ |
6 #define UI_LATENCY_LATENCY_INFO_H_ | 6 #define UI_LATENCY_LATENCY_INFO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // but the swap failed. | 102 // but the swap failed. |
103 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, | 103 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, |
104 LATENCY_COMPONENT_TYPE_LAST = | 104 LATENCY_COMPONENT_TYPE_LAST = |
105 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, | 105 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, |
106 }; | 106 }; |
107 | 107 |
108 enum SourceEventType { | 108 enum SourceEventType { |
109 UNKNOWN, | 109 UNKNOWN, |
110 WHEEL, | 110 WHEEL, |
111 TOUCH, | 111 TOUCH, |
| 112 // This only includes key presses, as they're the most representative of user |
| 113 // perceived keyboard latency. |
| 114 KEY, |
112 OTHER, | 115 OTHER, |
113 SOURCE_EVENT_TYPE_LAST = OTHER, | 116 SOURCE_EVENT_TYPE_LAST = OTHER, |
114 }; | 117 }; |
115 | 118 |
116 class LatencyInfo { | 119 class LatencyInfo { |
117 public: | 120 public: |
118 struct LatencyComponent { | 121 struct LatencyComponent { |
119 // Nondecreasing number that can be used to determine what events happened | 122 // Nondecreasing number that can be used to determine what events happened |
120 // in the component at the time this struct was sent on to the next | 123 // in the component at the time this struct was sent on to the next |
121 // component. | 124 // component. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 251 |
249 // This is declared here for use in gtest-based unit tests, but is defined in | 252 // This is declared here for use in gtest-based unit tests, but is defined in |
250 // //ui/latency:test_support target. | 253 // //ui/latency:test_support target. |
251 // Without this the default PrintTo template in gtest tries to pass LatencyInfo | 254 // Without this the default PrintTo template in gtest tries to pass LatencyInfo |
252 // by value, which leads to an alignment compile error on Windows. | 255 // by value, which leads to an alignment compile error on Windows. |
253 void PrintTo(const LatencyInfo& latency, ::std::ostream* os); | 256 void PrintTo(const LatencyInfo& latency, ::std::ostream* os); |
254 | 257 |
255 } // namespace ui | 258 } // namespace ui |
256 | 259 |
257 #endif // UI_LATENCY_LATENCY_INFO_H_ | 260 #endif // UI_LATENCY_LATENCY_INFO_H_ |
OLD | NEW |