Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1648)

Unified Diff: cc/base/latency_info_swap_promise_monitor.cc

Issue 921473003: Break down end-to-end scroll update latency UMA metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/base/latency_info_swap_promise_monitor.cc
diff --git a/cc/base/latency_info_swap_promise_monitor.cc b/cc/base/latency_info_swap_promise_monitor.cc
index dc2873988b3ef97b6bb355712e6adf13e68e4074..de065d185c0c8fcae8c8dc0a31a5e6f55d9f674c 100644
--- a/cc/base/latency_info_swap_promise_monitor.cc
+++ b/cc/base/latency_info_swap_promise_monitor.cc
@@ -12,12 +12,14 @@
namespace {
-bool AddRenderingScheduledComponent(ui::LatencyInfo* latency_info) {
- if (latency_info->FindLatency(
- ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, nullptr))
+bool AddRenderingScheduledComponent(ui::LatencyInfo* latency_info,
+ bool on_main) {
+ ui::LatencyComponentType type = on_main ?
+ ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT :
+ ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT;
+ if (latency_info->FindLatency(type, 0, nullptr))
return false;
- latency_info->AddLatencyNumber(
- ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, 0);
+ latency_info->AddLatencyNumber(type, 0, 0);
return true;
}
@@ -48,14 +50,14 @@ LatencyInfoSwapPromiseMonitor::LatencyInfoSwapPromiseMonitor(
LatencyInfoSwapPromiseMonitor::~LatencyInfoSwapPromiseMonitor() {}
void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() {
- if (AddRenderingScheduledComponent(latency_)) {
+ if (AddRenderingScheduledComponent(latency_, true /* on_main */)) {
scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_));
layer_tree_host_->QueueSwapPromise(swap_promise.Pass());
}
}
void LatencyInfoSwapPromiseMonitor::OnSetNeedsRedrawOnImpl() {
- if (AddRenderingScheduledComponent(latency_)) {
+ if (AddRenderingScheduledComponent(latency_, false /* on_main */)) {
scoped_ptr<SwapPromise> swap_promise(new LatencyInfoSwapPromise(*latency_));
layer_tree_host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass());
}
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | content/browser/renderer_host/render_widget_host_latency_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698