summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/input
diff options
context:
space:
mode:
authorjdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-20 22:42:15 +0000
committerjdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-20 22:42:15 +0000
commitf192ad752feea9d3ff275bc955b932add56b3fdd (patch)
treefd6ae85275f4478b6326d9002b847241a6dc157a /content/browser/renderer_host/input
parent0898a8e77d07a9638cc4a1ec6a6810b21bee6dd5 (diff)
downloadchromium_src-f192ad752feea9d3ff275bc955b932add56b3fdd.zip
chromium_src-f192ad752feea9d3ff275bc955b932add56b3fdd.tar.gz
chromium_src-f192ad752feea9d3ff275bc955b932add56b3fdd.tar.bz2
Fix input event timing metric in the InputRouter
Ack-ignoring event types do not require ack messages from the renderer. Consequently, any metrics dependent on such messages should not be affected by these events. Review URL: https://codereview.chromium.org/115693007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/input')
-rw-r--r--content/browser/renderer_host/input/input_router_impl.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index 54c45ed..741d145 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -444,12 +444,15 @@ bool InputRouterImpl::OfferToClient(const WebInputEvent& input_event,
bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event,
const ui::LatencyInfo& latency_info,
bool is_keyboard_shortcut) {
- input_event_start_time_ = TimeTicks::Now();
if (Send(new InputMsg_HandleInputEvent(
routing_id(), &input_event, latency_info, is_keyboard_shortcut))) {
- // Only increment the event count if we require an ACK for |input_event|.
- if (!WebInputEventTraits::IgnoresAckDisposition(input_event.type))
+ // Ack messages for ignored ack event types are not required, and might
+ // never be sent by the renderer. Consequently, such event types should not
+ // affect event timing or in-flight event count metrics.
+ if (!WebInputEventTraits::IgnoresAckDisposition(input_event.type)) {
+ input_event_start_time_ = TimeTicks::Now();
client_->IncrementInFlightEventCount();
+ }
return true;
}
return false;
@@ -458,17 +461,17 @@ bool InputRouterImpl::OfferToRenderer(const WebInputEvent& input_event,
void InputRouterImpl::OnInputEventAck(WebInputEvent::Type event_type,
InputEventAckState ack_result,
const ui::LatencyInfo& latency_info) {
- // Log the time delta for processing an input event.
- TimeDelta delta = TimeTicks::Now() - input_event_start_time_;
- UMA_HISTOGRAM_TIMES("MPArch.IIR_InputEventDelta", delta);
-
- // A synthetic ack will already have been sent for this event, and it will
- // not have affected the in-flight event count.
+ // A synthetic ack will already have been sent for this event, and it should
+ // not affect event timing or in-flight count metrics.
if (WebInputEventTraits::IgnoresAckDisposition(event_type))
return;
client_->DecrementInFlightEventCount();
+ // Log the time delta for processing an input event.
+ TimeDelta delta = TimeTicks::Now() - input_event_start_time_;
+ UMA_HISTOGRAM_TIMES("MPArch.IIR_InputEventDelta", delta);
+
ProcessInputEventAck(event_type, ack_result, latency_info, RENDERER);
// WARNING: |this| may be deleted at this point.