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