| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/input/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 std::unique_ptr<blink::WebInputEvent> event_in_viewport = | 425 std::unique_ptr<blink::WebInputEvent> event_in_viewport = |
| 426 ui::ScaleWebInputEvent(input_event, device_scale_factor_); | 426 ui::ScaleWebInputEvent(input_event, device_scale_factor_); |
| 427 const WebInputEvent* event_to_send = | 427 const WebInputEvent* event_to_send = |
| 428 event_in_viewport ? event_in_viewport.get() : &input_event; | 428 event_in_viewport ? event_in_viewport.get() : &input_event; |
| 429 | 429 |
| 430 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, | 430 if (Send(new InputMsg_HandleInputEvent(routing_id(), event_to_send, |
| 431 latency_info, dispatch_type))) { | 431 latency_info, dispatch_type))) { |
| 432 // Ack messages for ignored ack event types should never be sent by the | 432 // Ack messages for ignored ack event types should never be sent by the |
| 433 // renderer. Consequently, such event types should not affect event time | 433 // renderer. Consequently, such event types should not affect event time |
| 434 // or in-flight event count metrics. | 434 // or in-flight event count metrics. |
| 435 if (dispatch_type == InputEventDispatchType::DISPATCH_TYPE_BLOCKING) { | 435 if (dispatch_type == InputEventDispatchType::DISPATCH_TYPE_BLOCKING) |
| 436 input_event_start_time_ = TimeTicks::Now(); | |
| 437 client_->IncrementInFlightEventCount(); | 436 client_->IncrementInFlightEventCount(); |
| 438 } | |
| 439 return true; | 437 return true; |
| 440 } | 438 } |
| 441 return false; | 439 return false; |
| 442 } | 440 } |
| 443 | 441 |
| 444 void InputRouterImpl::OnInputEventAck(const InputEventAck& ack) { | 442 void InputRouterImpl::OnInputEventAck(const InputEventAck& ack) { |
| 445 client_->DecrementInFlightEventCount(); | 443 client_->DecrementInFlightEventCount(); |
| 446 // Log the time delta for processing an input event. | |
| 447 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; | |
| 448 UMA_HISTOGRAM_TIMES("MPArch.IIR_InputEventDelta", delta); | |
| 449 | 444 |
| 450 if (ack.overscroll) { | 445 if (ack.overscroll) { |
| 451 DCHECK(ack.type == WebInputEvent::MouseWheel || | 446 DCHECK(ack.type == WebInputEvent::MouseWheel || |
| 452 ack.type == WebInputEvent::GestureScrollUpdate); | 447 ack.type == WebInputEvent::GestureScrollUpdate); |
| 453 OnDidOverscroll(*ack.overscroll); | 448 OnDidOverscroll(*ack.overscroll); |
| 454 } | 449 } |
| 455 | 450 |
| 456 ProcessInputEventAck(ack.type, ack.state, ack.latency, | 451 ProcessInputEventAck(ack.type, ack.state, ack.latency, |
| 457 ack.unique_touch_event_id, RENDERER); | 452 ack.unique_touch_event_id, RENDERER); |
| 458 } | 453 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 629 |
| 635 flush_requested_ = false; | 630 flush_requested_ = false; |
| 636 client_->DidFlush(); | 631 client_->DidFlush(); |
| 637 } | 632 } |
| 638 | 633 |
| 639 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 634 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 640 frame_tree_node_id_ = frameTreeNodeId; | 635 frame_tree_node_id_ = frameTreeNodeId; |
| 641 } | 636 } |
| 642 | 637 |
| 643 } // namespace content | 638 } // namespace content |
| OLD | NEW |