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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT, | 47 INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT, |
| 48 // Frame number when a window snapshot was requested. The snapshot | 48 // Frame number when a window snapshot was requested. The snapshot |
| 49 // is taken when the rendering results actually reach the screen. | 49 // is taken when the rendering results actually reach the screen. |
| 50 WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 50 WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| 51 // Frame number for a snapshot requested via | 51 // Frame number for a snapshot requested via |
| 52 // gpuBenchmarking.beginWindowSnapshotPNG | 52 // gpuBenchmarking.beginWindowSnapshotPNG |
| 53 // TODO(vkuzkokov): remove when patch adding this hits Stable | 53 // TODO(vkuzkokov): remove when patch adding this hits Stable |
| 54 WINDOW_OLD_SNAPSHOT_FRAME_NUMBER_COMPONENT, | 54 WINDOW_OLD_SNAPSHOT_FRAME_NUMBER_COMPONENT, |
| 55 // Timestamp when a tab is requested to be shown. | 55 // Timestamp when a tab is requested to be shown. |
| 56 TAB_SHOW_COMPONENT, | 56 TAB_SHOW_COMPONENT, |
| 57 // Timestamp of when the Browser process began compositing | |
| 58 INPUT_EVENT_RENDERER_SWAP_RECEIVED_COMPONENT, | |
| 59 // Timestamp of when the Browser process began swap buffers | |
| 60 INPUT_EVENT_BROWSER_SWAP_BUFFER_COMPONENT, | |
| 61 // Timestamp of when the gpu service began swap buffers, unlike | |
| 62 // INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT which measure after | |
| 63 INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, | |
| 57 // ---------------------------TERMINAL COMPONENT----------------------------- | 64 // ---------------------------TERMINAL COMPONENT----------------------------- |
| 58 // TERMINAL COMPONENT is when we show the latency end in chrome://tracing. | 65 // TERMINAL COMPONENT is when we show the latency end in chrome://tracing. |
| 59 // Timestamp when the mouse event is acked from renderer and it does not | 66 // Timestamp when the mouse event is acked from renderer and it does not |
| 60 // cause any rendering scheduled. | 67 // cause any rendering scheduled. |
| 61 INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, | 68 INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, |
| 62 // Timestamp when the touch event is acked from renderer and it does not | 69 // Timestamp when the touch event is acked from renderer and it does not |
| 63 // cause any rendering schedueld and does not generate any gesture event. | 70 // cause any rendering schedueld and does not generate any gesture event. |
| 64 INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, | 71 INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, |
| 65 // Timestamp when the gesture event is acked from renderer, and it does not | 72 // Timestamp when the gesture event is acked from renderer, and it does not |
| 66 // cause any rendering schedueld. | 73 // cause any rendering schedueld. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 88 // Nondecreasing number that can be used to determine what events happened | 95 // Nondecreasing number that can be used to determine what events happened |
| 89 // in the component at the time this struct was sent on to the next | 96 // in the component at the time this struct was sent on to the next |
| 90 // component. | 97 // component. |
| 91 int64 sequence_number; | 98 int64 sequence_number; |
| 92 // Average time of events that happened in this component. | 99 // Average time of events that happened in this component. |
| 93 base::TimeTicks event_time; | 100 base::TimeTicks event_time; |
| 94 // Count of events that happened in this component | 101 // Count of events that happened in this component |
| 95 uint32 event_count; | 102 uint32 event_count; |
| 96 }; | 103 }; |
| 97 | 104 |
| 98 // Empirically determined constant based on a typical scroll sequence. | 105 // Empirically determined constant based on a typical scroll sequence. |
|
Yufeng Shen (Slow to review)
2014/10/01 21:46:19
Can you tune this number ?
orglofch
2014/10/02 00:46:04
Yep, I've made it 9 since all 3 of the new compone
| |
| 99 enum { kTypicalMaxComponentsPerLatencyInfo = 6 }; | 106 enum { kTypicalMaxComponentsPerLatencyInfo = 6 }; |
| 100 | 107 |
| 101 // Map a Latency Component (with a component-specific int64 id) to a | 108 // Map a Latency Component (with a component-specific int64 id) to a |
| 102 // component info. | 109 // component info. |
| 103 typedef base::SmallMap< | 110 typedef base::SmallMap< |
| 104 std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>, | 111 std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>, |
| 105 kTypicalMaxComponentsPerLatencyInfo> LatencyMap; | 112 kTypicalMaxComponentsPerLatencyInfo> LatencyMap; |
| 106 | 113 |
| 107 LatencyInfo(); | 114 LatencyInfo(); |
| 108 | 115 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 LatencyMap latency_components; | 162 LatencyMap latency_components; |
| 156 // The unique id for matching the ASYNC_BEGIN/END trace event. | 163 // The unique id for matching the ASYNC_BEGIN/END trace event. |
| 157 int64 trace_id; | 164 int64 trace_id; |
| 158 // Whether a terminal component has been added. | 165 // Whether a terminal component has been added. |
| 159 bool terminated; | 166 bool terminated; |
| 160 }; | 167 }; |
| 161 | 168 |
| 162 } // namespace ui | 169 } // namespace ui |
| 163 | 170 |
| 164 #endif // UI_EVENTS_LATENCY_INFO_H_ | 171 #endif // UI_EVENTS_LATENCY_INFO_H_ |
| OLD | NEW |