Chromium Code Reviews| 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.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 DCHECK(latencies); | 420 DCHECK(latencies); |
| 421 for (LatencyInfo& latency : *latencies) { | 421 for (LatencyInfo& latency : *latencies) { |
| 422 AddLatencyInfoComponentIds(&latency, latency_component_id_); | 422 AddLatencyInfoComponentIds(&latency, latency_component_id_); |
| 423 latency.AddLatencyNumber( | 423 latency.AddLatencyNumber( |
| 424 ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0, 0); | 424 ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0, 0); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 void RenderWidgetHostLatencyTracker::OnFrameSwapped( | 428 void RenderWidgetHostLatencyTracker::OnFrameSwapped( |
| 429 const LatencyInfo& latency) { | 429 const LatencyInfo& latency) { |
| 430 // Don't report frame latency on wheel events. Previously they were only | |
| 431 // reported on Touch metrics and we need to be consistent across reporting | |
|
tdresser
2016/04/22 17:55:59
nit: inconsistent capitalization.
Might as well "
dtapuska
2016/04/22 18:14:59
Done.
| |
| 432 // metrics. | |
| 433 LatencyInfo::LatencyComponent mouse_wheel_scroll_update_component; | |
| 434 if (latency.FindLatency( | |
| 435 ui::INPUT_EVENT_LATENCY_GENERATE_SCROLL_UPDATE_FROM_MOUSE_WHEEL, 0, | |
| 436 &mouse_wheel_scroll_update_component)) { | |
| 437 return; | |
| 438 } | |
| 439 | |
| 430 LatencyInfo::LatencyComponent gpu_swap_end_component; | 440 LatencyInfo::LatencyComponent gpu_swap_end_component; |
| 431 if (!latency.FindLatency( | 441 if (!latency.FindLatency( |
| 432 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, | 442 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, |
| 433 &gpu_swap_end_component)) { | 443 &gpu_swap_end_component)) { |
| 434 return; | 444 return; |
| 435 } | 445 } |
| 436 | 446 |
| 437 LatencyInfo::LatencyComponent gpu_swap_begin_component; | 447 LatencyInfo::LatencyComponent gpu_swap_begin_component; |
| 438 if (!latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, | 448 if (!latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, |
| 439 &gpu_swap_begin_component)) { | 449 &gpu_swap_begin_component)) { |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 454 latency_component_id_, nullptr)) { | 464 latency_component_id_, nullptr)) { |
| 455 return; | 465 return; |
| 456 } | 466 } |
| 457 | 467 |
| 458 ComputeScrollLatencyHistograms(gpu_swap_begin_component, | 468 ComputeScrollLatencyHistograms(gpu_swap_begin_component, |
| 459 gpu_swap_end_component, latency_component_id_, | 469 gpu_swap_end_component, latency_component_id_, |
| 460 latency); | 470 latency); |
| 461 } | 471 } |
| 462 | 472 |
| 463 } // namespace content | 473 } // namespace content |
| OLD | NEW |