| 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 |
| 11 #include "base/debug/debugger.h" |
| 12 // TODO: DO NOT SUBMIT: Remove ad-hoc debugging before submitting. |
| 13 #include "base/debug/stack_trace.h" |
| 14 |
| 11 #include "base/auto_reset.h" | 15 #include "base/auto_reset.h" |
| 12 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 13 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
| 14 #include "base/metrics/histogram_macros.h" | 18 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 16 #include "content/browser/renderer_host/input/gesture_event_queue.h" | 20 #include "content/browser/renderer_host/input/gesture_event_queue.h" |
| 17 #include "content/browser/renderer_host/input/input_ack_handler.h" | 21 #include "content/browser/renderer_host/input/input_ack_handler.h" |
| 18 #include "content/browser/renderer_host/input/input_router_client.h" | 22 #include "content/browser/renderer_host/input/input_router_client.h" |
| 19 #include "content/browser/renderer_host/input/legacy_touch_event_queue.h" | 23 #include "content/browser/renderer_host/input/legacy_touch_event_queue.h" |
| 20 #include "content/browser/renderer_host/input/touch_event_queue.h" | 24 #include "content/browser/renderer_host/input/touch_event_queue.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 event_in_viewport ? event_in_viewport.get() : &input_event; | 434 event_in_viewport ? event_in_viewport.get() : &input_event; |
| 431 | 435 |
| 432 if (Send(new InputMsg_HandleInputEvent( | 436 if (Send(new InputMsg_HandleInputEvent( |
| 433 routing_id(), event_to_send, std::vector<IPC::WebInputEventPointer>(), | 437 routing_id(), event_to_send, std::vector<IPC::WebInputEventPointer>(), |
| 434 latency_info, dispatch_type))) { | 438 latency_info, dispatch_type))) { |
| 435 // Ack messages for ignored ack event types should never be sent by the | 439 // Ack messages for ignored ack event types should never be sent by the |
| 436 // renderer. Consequently, such event types should not affect event time | 440 // renderer. Consequently, such event types should not affect event time |
| 437 // or in-flight event count metrics. | 441 // or in-flight event count metrics. |
| 438 if (dispatch_type == InputEventDispatchType::DISPATCH_TYPE_BLOCKING) | 442 if (dispatch_type == InputEventDispatchType::DISPATCH_TYPE_BLOCKING) |
| 439 client_->IncrementInFlightEventCount(input_event.type()); | 443 client_->IncrementInFlightEventCount(input_event.type()); |
| 444 |
| 445 if (WebInputEvent::isMouseEventType(input_event.type())) { |
| 446 const WebMouseEvent* me = static_cast<const WebMouseEvent*>(&input_event); |
| 447 LOG(ERROR) << "; button = " << static_cast<int>(me->button) |
| 448 << "; local = (" << me->x << ", " << me->y << ")" |
| 449 << "; global = (" << me->globalX << ", " << me->globalY << ")"; |
| 450 if (me->button == blink::WebPointerProperties::Button::NoButton && |
| 451 me->x == 55) { |
| 452 static int counter = 0; |
| 453 counter++; |
| 454 if (counter == 3) { |
| 455 LOG(ERROR) << "; stack = " << base::debug::StackTrace().ToString(); |
| 456 } |
| 457 } |
| 458 } |
| 459 |
| 440 return true; | 460 return true; |
| 441 } | 461 } |
| 462 |
| 463 LOG(ERROR) << "OfferToRenderer - Send returned false - !!!!!!!!!!!"; |
| 464 |
| 442 return false; | 465 return false; |
| 443 } | 466 } |
| 444 | 467 |
| 445 void InputRouterImpl::OnInputEventAck(const InputEventAck& ack) { | 468 void InputRouterImpl::OnInputEventAck(const InputEventAck& ack) { |
| 446 client_->DecrementInFlightEventCount(ack.source); | 469 client_->DecrementInFlightEventCount(ack.source); |
| 447 | 470 |
| 448 if (ack.overscroll) { | 471 if (ack.overscroll) { |
| 449 DCHECK(ack.type == WebInputEvent::MouseWheel || | 472 DCHECK(ack.type == WebInputEvent::MouseWheel || |
| 450 ack.type == WebInputEvent::GestureScrollUpdate); | 473 ack.type == WebInputEvent::GestureScrollUpdate); |
| 451 OnDidOverscroll(*ack.overscroll); | 474 OnDidOverscroll(*ack.overscroll); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 | 655 |
| 633 flush_requested_ = false; | 656 flush_requested_ = false; |
| 634 client_->DidFlush(); | 657 client_->DidFlush(); |
| 635 } | 658 } |
| 636 | 659 |
| 637 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { | 660 void InputRouterImpl::SetFrameTreeNodeId(int frameTreeNodeId) { |
| 638 frame_tree_node_id_ = frameTreeNodeId; | 661 frame_tree_node_id_ = frameTreeNodeId; |
| 639 } | 662 } |
| 640 | 663 |
| 641 } // namespace content | 664 } // namespace content |
| OLD | NEW |