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

Unified Diff: ui/events/latency_info.cc

Issue 2341413002: New scroll latency metrics added for touch and wheel. (Closed)
Patch Set: Created 4 years, 3 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: ui/events/latency_info.cc
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc
index 4ef3d9c6fb1e3ae53118085b6dd9517d9a1e7cbf..9293e170ff713fdf31746dd6ed88a7568f043bbc 100644
--- a/ui/events/latency_info.cc
+++ b/ui/events/latency_info.cc
@@ -279,7 +279,8 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl(
LatencyMap::key_type key = std::make_pair(component, id);
LatencyMap::iterator it = latency_components_.find(key);
if (it == latency_components_.end()) {
- LatencyComponent info = {component_sequence_number, time, event_count};
+ LatencyComponent info = {component_sequence_number, time, event_count, time,
+ time};
latency_components_[key] = info;
} else {
it->second.sequence_number = std::max(component_sequence_number,
@@ -292,6 +293,7 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl(
it->second.event_time += (time - it->second.event_time) * event_count /
new_count;
it->second.event_count = new_count;
+ it->second.last_event_time = std::max(it->second.last_event_time, time);
}
}

Powered by Google App Engine
This is Rietveld 408576698