| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker
.h" | 5 #include "content/browser/renderer_host/input/render_widget_host_latency_tracker
.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 return; | 248 return; |
| 249 | 249 |
| 250 LatencyInfo::LatencyComponent original_component; | 250 LatencyInfo::LatencyComponent original_component; |
| 251 if (latency.FindLatency( | 251 if (latency.FindLatency( |
| 252 ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, | 252 ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT, |
| 253 latency_component_id, &original_component)) { | 253 latency_component_id, &original_component)) { |
| 254 // This UMA metric tracks the time between the final frame swap for the | 254 // This UMA metric tracks the time between the final frame swap for the |
| 255 // first scroll event in a sequence and the original timestamp of that | 255 // first scroll event in a sequence and the original timestamp of that |
| 256 // scroll event's underlying touch/wheel event. | 256 // scroll event's underlying touch/wheel event. |
| 257 UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY( | 257 UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY( |
| 258 "Event.Latency." + event_type_name + | 258 "Event.Latency.ScrollUpdate." + event_type_name + |
| 259 ".TimeToFirstScrollUpdateSwapBegin2", | 259 ".TimeToFirstScrollUpdateSwapBegin2", |
| 260 original_component, gpu_swap_begin_component); | 260 original_component, gpu_swap_begin_component); |
| 261 } else if (latency.FindLatency( | 261 } else if (latency.FindLatency( |
| 262 ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, | 262 ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT, |
| 263 latency_component_id, &original_component)) { | 263 latency_component_id, &original_component)) { |
| 264 // This UMA metric tracks the time from when the original touch event is | 264 // This UMA metric tracks the time from when the original touch event is |
| 265 // created to when the scroll gesture results in final frame swap. | 265 // created to when the scroll gesture results in final frame swap. |
| 266 // First scroll events are excluded from this metric. | 266 // First scroll events are excluded from this metric. |
| 267 if (event_type_name == "Touch") { | 267 if (event_type_name == "Touch") { |
| 268 UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY( | 268 UMA_HISTOGRAM_TOUCH_WHEEL_TO_SCROLL_LATENCY( |
| 269 "Event.Latency." + event_type_name + ".TimeToScrollUpdateSwapBegin2", | 269 "Event.Latency.ScrollUpdate." + event_type_name + |
| 270 ".TimeToScrollUpdateSwapBegin2", |
| 270 original_component, gpu_swap_begin_component); | 271 original_component, gpu_swap_begin_component); |
| 271 } | 272 } |
| 272 } else { | 273 } else { |
| 273 // No original component found. | 274 // No original component found. |
| 274 return; | 275 return; |
| 275 } | 276 } |
| 276 | 277 |
| 277 LatencyInfo::LatencyComponent rendering_scheduled_component; | 278 LatencyInfo::LatencyComponent rendering_scheduled_component; |
| 278 bool rendering_scheduled_on_main = latency.FindLatency( | 279 bool rendering_scheduled_on_main = latency.FindLatency( |
| 279 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, 0, | 280 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, 0, |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 if (!latency.FindLatency( | 713 if (!latency.FindLatency( |
| 713 ui::INPUT_EVENT_LATENCY_GENERATE_SCROLL_UPDATE_FROM_MOUSE_WHEEL, 0, | 714 ui::INPUT_EVENT_LATENCY_GENERATE_SCROLL_UPDATE_FROM_MOUSE_WHEEL, 0, |
| 714 &mouse_wheel_scroll_update_component)) { | 715 &mouse_wheel_scroll_update_component)) { |
| 715 ComputeScrollLatencyHistograms( | 716 ComputeScrollLatencyHistograms( |
| 716 gpu_swap_begin_component, gpu_swap_end_component, latency_component_id_, | 717 gpu_swap_begin_component, gpu_swap_end_component, latency_component_id_, |
| 717 latency, is_running_navigation_hint_task); | 718 latency, is_running_navigation_hint_task); |
| 718 } | 719 } |
| 719 } | 720 } |
| 720 | 721 |
| 721 } // namespace content | 722 } // namespace content |
| OLD | NEW |