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 <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/process/process_handle.h" | |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 #include "ui/events/events_base_export.h" | 14 #include "ui/events/events_base_export.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 enum LatencyComponentType { | 18 enum LatencyComponentType { |
18 // ---------------------------BEGIN COMPONENT------------------------------- | 19 // ---------------------------BEGIN COMPONENT------------------------------- |
19 // 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. |
20 // Timestamp when the input event is sent from RenderWidgetHost to renderer. | 21 // Timestamp when the input event is sent from RenderWidgetHost to renderer. |
21 INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, | 22 INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 int64 id, | 117 int64 id, |
117 LatencyComponent* output) const; | 118 LatencyComponent* output) const; |
118 | 119 |
119 void RemoveLatency(LatencyComponentType type); | 120 void RemoveLatency(LatencyComponentType type); |
120 | 121 |
121 void Clear(); | 122 void Clear(); |
122 | 123 |
123 // Records the |event_type| in trace buffer as TRACE_EVENT_ASYNC_STEP. | 124 // Records the |event_type| in trace buffer as TRACE_EVENT_ASYNC_STEP. |
124 void TraceEventType(const char* event_type); | 125 void TraceEventType(const char* event_type); |
125 | 126 |
127 static void AnnotateWithProcessId(std::vector<ui::LatencyInfo>& latency_info, | |
128 base::ProcessId process_id); | |
jamesr
2014/01/16 23:07:21
nit: i don't think that the ID used here is actual
| |
129 | |
130 // Some LatencyComponents generated in the renderer, specifically | |
131 // WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENTs, require a ProcessId to route | |
132 // notifications correctly. Since that cannot be given in the renderer | |
133 // this function patches the ProcessId in from the browser process. | |
134 void AnnotateComponentsWithProcessId(base::ProcessId process_id); | |
135 | |
126 LatencyMap latency_components; | 136 LatencyMap latency_components; |
127 // The unique id for matching the ASYNC_BEGIN/END trace event. | 137 // The unique id for matching the ASYNC_BEGIN/END trace event. |
128 int64 trace_id; | 138 int64 trace_id; |
129 // Whether a terminal component has been added. | 139 // Whether a terminal component has been added. |
130 bool terminated; | 140 bool terminated; |
131 }; | 141 }; |
132 | 142 |
133 } // namespace ui | 143 } // namespace ui |
134 | 144 |
135 #endif // UI_EVENTS_LATENCY_INFO_H_ | 145 #endif // UI_EVENTS_LATENCY_INFO_H_ |
OLD | NEW |