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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 const LatencyMap& latency_components() const { return latency_components_; } | 202 const LatencyMap& latency_components() const { return latency_components_; } |
203 | 203 |
204 const SourceEventType& source_event_type() const { | 204 const SourceEventType& source_event_type() const { |
205 return source_event_type_; | 205 return source_event_type_; |
206 } | 206 } |
207 void set_source_event_type(SourceEventType type) { | 207 void set_source_event_type(SourceEventType type) { |
208 source_event_type_ = type; | 208 source_event_type_ = type; |
209 } | 209 } |
210 | 210 |
| 211 void set_expected_queueing_time_on_dispatch( |
| 212 base::TimeDelta expected_queueing_time) { |
| 213 expected_queueing_time_on_dispatch_ = expected_queueing_time; |
| 214 } |
| 215 |
| 216 base::TimeDelta expected_queueing_time_on_dispatch() const { |
| 217 return expected_queueing_time_on_dispatch_; |
| 218 } |
| 219 |
211 bool terminated() const { return terminated_; } | 220 bool terminated() const { return terminated_; } |
212 void set_coalesced() { coalesced_ = true; } | 221 void set_coalesced() { coalesced_ = true; } |
213 bool coalesced() const { return coalesced_; } | 222 bool coalesced() const { return coalesced_; } |
214 int64_t trace_id() const { return trace_id_; } | 223 int64_t trace_id() const { return trace_id_; } |
215 | 224 |
216 private: | 225 private: |
217 void AddLatencyNumberWithTimestampImpl(LatencyComponentType component, | 226 void AddLatencyNumberWithTimestampImpl(LatencyComponentType component, |
218 int64_t id, | 227 int64_t id, |
219 int64_t component_sequence_number, | 228 int64_t component_sequence_number, |
220 base::TimeTicks time, | 229 base::TimeTicks time, |
(...skipping 11 matching lines...) Expand all Loading... |
232 LatencyMap latency_components_; | 241 LatencyMap latency_components_; |
233 | 242 |
234 // The unique id for matching the ASYNC_BEGIN/END trace event. | 243 // The unique id for matching the ASYNC_BEGIN/END trace event. |
235 int64_t trace_id_; | 244 int64_t trace_id_; |
236 // Whether this event has been coalesced into another event. | 245 // Whether this event has been coalesced into another event. |
237 bool coalesced_; | 246 bool coalesced_; |
238 // Whether a terminal component has been added. | 247 // Whether a terminal component has been added. |
239 bool terminated_; | 248 bool terminated_; |
240 // Stores the type of the first source event. | 249 // Stores the type of the first source event. |
241 SourceEventType source_event_type_; | 250 SourceEventType source_event_type_; |
| 251 // The expected queueing time on the main thread when this event was |
| 252 // dispatched. |
| 253 base::TimeDelta expected_queueing_time_on_dispatch_; |
242 | 254 |
243 #if !defined(OS_IOS) | 255 #if !defined(OS_IOS) |
244 friend struct IPC::ParamTraits<ui::LatencyInfo>; | 256 friend struct IPC::ParamTraits<ui::LatencyInfo>; |
245 friend struct mojo::StructTraits<ui::mojom::LatencyInfoDataView, | 257 friend struct mojo::StructTraits<ui::mojom::LatencyInfoDataView, |
246 ui::LatencyInfo>; | 258 ui::LatencyInfo>; |
247 #endif | 259 #endif |
248 }; | 260 }; |
249 | 261 |
250 // This is declared here for use in gtest-based unit tests, but is defined in | 262 // This is declared here for use in gtest-based unit tests, but is defined in |
251 // //ui/latency:test_support target. | 263 // //ui/latency:test_support target. |
252 // Without this the default PrintTo template in gtest tries to pass LatencyInfo | 264 // Without this the default PrintTo template in gtest tries to pass LatencyInfo |
253 // by value, which leads to an alignment compile error on Windows. | 265 // by value, which leads to an alignment compile error on Windows. |
254 void PrintTo(const LatencyInfo& latency, ::std::ostream* os); | 266 void PrintTo(const LatencyInfo& latency, ::std::ostream* os); |
255 | 267 |
256 } // namespace ui | 268 } // namespace ui |
257 | 269 |
258 #endif // UI_LATENCY_LATENCY_INFO_H_ | 270 #endif // UI_LATENCY_LATENCY_INFO_H_ |
OLD | NEW |