| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return Send(message.release()); | 341 return Send(message.release()); |
| 342 } | 342 } |
| 343 | 343 |
| 344 bool InputRouterImpl::Send(IPC::Message* message) { | 344 bool InputRouterImpl::Send(IPC::Message* message) { |
| 345 return sender_->Send(message); | 345 return sender_->Send(message); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void InputRouterImpl::FilterAndSendWebInputEvent( | 348 void InputRouterImpl::FilterAndSendWebInputEvent( |
| 349 const WebInputEvent& input_event, | 349 const WebInputEvent& input_event, |
| 350 const ui::LatencyInfo& latency_info) { | 350 const ui::LatencyInfo& latency_info) { |
| 351 TRACE_EVENT1("input", | 351 TRACE_EVENT1("input", "InputRouterImpl::FilterAndSendWebInputEvent", "type", |
| 352 "InputRouterImpl::FilterAndSendWebInputEvent", | 352 WebInputEvent::GetName(input_event.type)); |
| 353 "type", | |
| 354 WebInputEventTraits::GetName(input_event.type)); | |
| 355 TRACE_EVENT_WITH_FLOW2("input,benchmark,devtools.timeline", | 353 TRACE_EVENT_WITH_FLOW2("input,benchmark,devtools.timeline", |
| 356 "LatencyInfo.Flow", | 354 "LatencyInfo.Flow", |
| 357 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), | 355 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), |
| 358 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 356 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
| 359 "step", "SendInputEventUI", | 357 "step", "SendInputEventUI", |
| 360 "frameTreeNodeId", frame_tree_node_id_); | 358 "frameTreeNodeId", frame_tree_node_id_); |
| 361 | 359 |
| 362 OfferToHandlers(input_event, latency_info); | 360 OfferToHandlers(input_event, latency_info); |
| 363 } | 361 } |
| 364 | 362 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 SignalFlushedIfNecessary(); | 513 SignalFlushedIfNecessary(); |
| 516 | 514 |
| 517 client_->DidStopFlinging(); | 515 client_->DidStopFlinging(); |
| 518 } | 516 } |
| 519 | 517 |
| 520 void InputRouterImpl::ProcessInputEventAck(WebInputEvent::Type event_type, | 518 void InputRouterImpl::ProcessInputEventAck(WebInputEvent::Type event_type, |
| 521 InputEventAckState ack_result, | 519 InputEventAckState ack_result, |
| 522 const ui::LatencyInfo& latency_info, | 520 const ui::LatencyInfo& latency_info, |
| 523 uint32_t unique_touch_event_id, | 521 uint32_t unique_touch_event_id, |
| 524 AckSource ack_source) { | 522 AckSource ack_source) { |
| 525 TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck", | 523 TRACE_EVENT2("input", "InputRouterImpl::ProcessInputEventAck", "type", |
| 526 "type", WebInputEventTraits::GetName(event_type), | 524 WebInputEvent::GetName(event_type), "ack", |
| 527 "ack", GetEventAckName(ack_result)); | 525 GetEventAckName(ack_result)); |
| 528 | 526 |
| 529 // Note: The keyboard ack must be treated carefully, as it may result in | 527 // Note: The keyboard ack must be treated carefully, as it may result in |
| 530 // synchronous destruction of |this|. Handling immediately guards against | 528 // synchronous destruction of |this|. Handling immediately guards against |
| 531 // future references to |this|, as with |auto_reset_current_ack_source| below. | 529 // future references to |this|, as with |auto_reset_current_ack_source| below. |
| 532 if (WebInputEvent::isKeyboardEventType(event_type)) { | 530 if (WebInputEvent::isKeyboardEventType(event_type)) { |
| 533 ProcessKeyboardAck(event_type, ack_result, latency_info); | 531 ProcessKeyboardAck(event_type, ack_result, latency_info); |
| 534 // WARNING: |this| may be deleted at this point. | 532 // WARNING: |this| may be deleted at this point. |
| 535 return; | 533 return; |
| 536 } | 534 } |
| 537 | 535 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 633 |
| 636 flush_requested_ = false; | 634 flush_requested_ = false; |
| 637 client_->DidFlush(); | 635 client_->DidFlush(); |
| 638 } | 636 } |
| 639 | 637 |
| 640 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 638 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 641 frame_tree_node_id_ = frameTreeNodeId; | 639 frame_tree_node_id_ = frameTreeNodeId; |
| 642 } | 640 } |
| 643 | 641 |
| 644 } // namespace content | 642 } // namespace content |
| OLD | NEW |