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

Unified Diff: content/renderer/input/render_widget_input_handler.cc

Issue 1907803002: Add metric to determine the benefit of forcing an event listener to be passive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_touch_scroll_intervention_uma
Patch Set: Pull metric into check for high resolution Created 4 years, 8 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/render_widget_input_handler.cc
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index 3d793bb66e161b15a01cc1f6732cdcf50c3fe820..3dfbf9c13101f105c5889b5608f7aa32d7cf85ae 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -117,11 +117,6 @@ void LogInputEventLatencyUma(const WebInputEvent& event, base::TimeTicks now) {
#undef CASE_TYPE
}
-void LogPassiveLatency(int64_t latency) {
- UMA_HISTOGRAM_CUSTOM_COUNTS("Event.PassiveListeners.Latency", latency, 1,
- 10000000, 100);
-}
-
void LogPassiveEventListenersUma(WebInputEventResult result,
WebInputEvent::DispatchType dispatch_type,
double event_timestamp,
@@ -163,10 +158,18 @@ void LogPassiveEventListenersUma(WebInputEventResult result,
UMA_HISTOGRAM_ENUMERATION("Event.PassiveListeners", enum_value,
PASSIVE_LISTENER_UMA_ENUM_COUNT);
- if (enum_value == PASSIVE_LISTENER_UMA_ENUM_CANCELABLE &&
- base::TimeTicks::IsHighResolution()) {
- base::TimeTicks now = base::TimeTicks::Now();
- LogPassiveLatency(GetEventLatencyMicros(event_timestamp, now));
+ if (base::TimeTicks::IsHighResolution()) {
+ if (enum_value == PASSIVE_LISTENER_UMA_ENUM_CANCELABLE) {
+ base::TimeTicks now = base::TimeTicks::Now();
tdresser 2016/04/21 20:54:52 Move computation of now outside of conditional.
dtapuska 2016/04/21 21:02:41 this is an if, else if.. since it avoids a costly
tdresser 2016/04/21 21:03:27 Sorry, I was thinking this was an "if/else" not "i
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Event.PassiveListeners.Latency",
+ GetEventLatencyMicros(event_timestamp, now),
+ 1, 10000000, 100);
+ } else if (enum_value == PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING) {
+ base::TimeTicks now = base::TimeTicks::Now();
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.PassiveListeners.ForcedNonBlockingLatency",
+ GetEventLatencyMicros(event_timestamp, now), 1, 10000000, 100);
+ }
}
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698