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

Unified Diff: ui/base/latency_info.cc

Issue 17757002: Add UMA/Telemetry stats for touch event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address some of sadrul's comments Created 7 years, 6 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
« no previous file with comments | « ui/base/latency_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/latency_info.cc
diff --git a/ui/base/latency_info.cc b/ui/base/latency_info.cc
index f87f6dfac23f6880d895fc7ed1632cdbd51380a3..459fc2ab689a3183eede3c51a43042c2542a1c83 100644
--- a/ui/base/latency_info.cc
+++ b/ui/base/latency_info.cc
@@ -58,10 +58,16 @@ void LatencyInfo::AddLatencyNumberWithTimestamp(LatencyComponentType component,
}
}
-bool LatencyInfo::HasLatencyComponent(LatencyComponentType type,
- int64 id) const {
- return latency_components.find(std::make_pair(type, id)) !=
- latency_components.end();
+bool LatencyInfo::FindLatency(LatencyComponentType type,
+ int64 id,
+ LatencyComponent* output) const {
+ LatencyMap::const_iterator it = latency_components.find(
+ std::make_pair(type, id));
+ if (it == latency_components.end())
+ return false;
+ if (output)
+ *output = it->second;
+ return true;
}
void LatencyInfo::Clear() {
« no previous file with comments | « ui/base/latency_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698