| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 } | 992 } |
| 993 | 993 |
| 994 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( | 994 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( |
| 995 const blink::WebGestureEvent& gesture_event, | 995 const blink::WebGestureEvent& gesture_event, |
| 996 const ui::LatencyInfo& ui_latency) { | 996 const ui::LatencyInfo& ui_latency) { |
| 997 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardGestureEvent"); | 997 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardGestureEvent"); |
| 998 // Early out if necessary, prior to performing latency logic. | 998 // Early out if necessary, prior to performing latency logic. |
| 999 if (IgnoreInputEvents()) | 999 if (IgnoreInputEvents()) |
| 1000 return; | 1000 return; |
| 1001 | 1001 |
| 1002 if (delegate_->PreHandleGestureEvent(gesture_event)) |
| 1003 return; |
| 1004 |
| 1002 ui::LatencyInfo latency_info = | 1005 ui::LatencyInfo latency_info = |
| 1003 CreateRWHLatencyInfoIfNotExist(&ui_latency, gesture_event.type); | 1006 CreateRWHLatencyInfoIfNotExist(&ui_latency, gesture_event.type); |
| 1004 | 1007 |
| 1005 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate) { | 1008 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate) { |
| 1006 latency_info.AddLatencyNumber( | 1009 latency_info.AddLatencyNumber( |
| 1007 ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT, | 1010 ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT, |
| 1008 GetLatencyComponentId(), | 1011 GetLatencyComponentId(), |
| 1009 ++last_input_number_); | 1012 ++last_input_number_); |
| 1010 | 1013 |
| 1011 // Make a copy of the INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT with a | 1014 // Make a copy of the INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT with a |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 } | 2569 } |
| 2567 } | 2570 } |
| 2568 | 2571 |
| 2569 // Add newly generated components into the latency info | 2572 // Add newly generated components into the latency info |
| 2570 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2573 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
| 2571 latency_info->latency_components[lc->first] = lc->second; | 2574 latency_info->latency_components[lc->first] = lc->second; |
| 2572 } | 2575 } |
| 2573 } | 2576 } |
| 2574 | 2577 |
| 2575 } // namespace content | 2578 } // namespace content |
| OLD | NEW |