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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/containers/small_map.h" | 12 #include "base/containers/small_map.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "ui/events/events_base_export.h" | 14 #include "ui/events/events_base_export.h" |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 enum LatencyComponentType { | 18 enum LatencyComponentType { |
19 // ---------------------------BEGIN COMPONENT------------------------------- | 19 // ---------------------------BEGIN COMPONENT------------------------------- |
20 // BEGIN COMPONENT is when we show the latency begin in chrome://tracing. | 20 // BEGIN COMPONENT is when we show the latency begin in chrome://tracing. |
21 // Timestamp when the input event is sent from RenderWidgetHost to renderer. | 21 // Timestamp when the input event is sent from RenderWidgetHost to renderer. |
22 INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 22 INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
23 // Timestamp when the input event is received in plugin. | |
24 INPUT_EVENT_LATENCY_BEGIN_PLUGIN_COMPONENT, | |
23 // ---------------------------NORMAL COMPONENT------------------------------- | 25 // ---------------------------NORMAL COMPONENT------------------------------- |
24 // Timestamp when the scroll update gesture event is sent from RWH to | 26 // Timestamp when the scroll update gesture event is sent from RWH to |
25 // renderer. In Aura, touch event's LatencyInfo is carried over to the gesture | 27 // renderer. In Aura, touch event's LatencyInfo is carried over to the gesture |
26 // event. So gesture event's INPUT_EVENT_LATENCY_RWH_COMPONENT is the | 28 // event. So gesture event's INPUT_EVENT_LATENCY_RWH_COMPONENT is the |
27 // timestamp when its original touch events is sent from RWH to renderer. | 29 // timestamp when its original touch events is sent from RWH to renderer. |
28 // In non-aura platform, INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT | 30 // In non-aura platform, INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT |
29 // is the same as INPUT_EVENT_LATENCY_RWH_COMPONENT. | 31 // is the same as INPUT_EVENT_LATENCY_RWH_COMPONENT. |
30 INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT, | 32 INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT, |
31 // The original timestamp of the touch event which converts to scroll update. | 33 // The original timestamp of the touch event which converts to scroll update. |
32 INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, | 34 INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, |
(...skipping 25 matching lines...) Expand all Loading... | |
58 INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, | 60 INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, |
59 // This component indicates that the input causes a commit to be scheduled | 61 // This component indicates that the input causes a commit to be scheduled |
60 // but the commit failed. | 62 // but the commit failed. |
61 INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT, | 63 INPUT_EVENT_LATENCY_TERMINATED_COMMIT_FAILED_COMPONENT, |
62 // This component indicates that the input causes a swap to be scheduled | 64 // This component indicates that the input causes a swap to be scheduled |
63 // but the swap failed. | 65 // but the swap failed. |
64 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, | 66 INPUT_EVENT_LATENCY_TERMINATED_SWAP_FAILED_COMPONENT, |
65 // This component indicates that the cached LatencyInfo number exceeds the | 67 // This component indicates that the cached LatencyInfo number exceeds the |
66 // maximal allowed size. | 68 // maximal allowed size. |
67 LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT, | 69 LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT, |
70 // Timestamp when the input event is considered not cause any rendering | |
71 // damage in plugin and thus terminated. | |
72 INPUT_EVENT_LATENCY_TERMINATED_PLUGIN_COMPONENT, | |
68 LATENCY_COMPONENT_TYPE_LAST = LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT | 73 LATENCY_COMPONENT_TYPE_LAST = LATENCY_INFO_LIST_TERMINATED_OVERFLOW_COMPONENT |
sadrul
2014/04/25 12:09:12
You need to update this.
Yufeng Shen (Slow to review)
2014/04/25 20:42:42
Done.
| |
69 }; | 74 }; |
70 | 75 |
71 struct EVENTS_BASE_EXPORT LatencyInfo { | 76 struct EVENTS_BASE_EXPORT LatencyInfo { |
72 struct LatencyComponent { | 77 struct LatencyComponent { |
73 // Nondecreasing number that can be used to determine what events happened | 78 // Nondecreasing number that can be used to determine what events happened |
74 // in the component at the time this struct was sent on to the next | 79 // in the component at the time this struct was sent on to the next |
75 // component. | 80 // component. |
76 int64 sequence_number; | 81 int64 sequence_number; |
77 // Average time of events that happened in this component. | 82 // Average time of events that happened in this component. |
78 base::TimeTicks event_time; | 83 base::TimeTicks event_time; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 LatencyMap latency_components; | 145 LatencyMap latency_components; |
141 // The unique id for matching the ASYNC_BEGIN/END trace event. | 146 // The unique id for matching the ASYNC_BEGIN/END trace event. |
142 int64 trace_id; | 147 int64 trace_id; |
143 // Whether a terminal component has been added. | 148 // Whether a terminal component has been added. |
144 bool terminated; | 149 bool terminated; |
145 }; | 150 }; |
146 | 151 |
147 } // namespace ui | 152 } // namespace ui |
148 | 153 |
149 #endif // UI_EVENTS_LATENCY_INFO_H_ | 154 #endif // UI_EVENTS_LATENCY_INFO_H_ |
OLD | NEW |