Chromium Code Reviews| 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); |
| + } |
| } |
| } |