| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 838 |
| 839 // Any non-wheel input event cancels pending wheel events. | 839 // Any non-wheel input event cancels pending wheel events. |
| 840 if (input_event.type != WebInputEvent::MouseWheel) | 840 if (input_event.type != WebInputEvent::MouseWheel) |
| 841 coalesced_mouse_wheel_events_.clear(); | 841 coalesced_mouse_wheel_events_.clear(); |
| 842 | 842 |
| 843 // Any input event cancels a pending mouse move event. Note that | 843 // Any input event cancels a pending mouse move event. Note that |
| 844 // |next_mouse_move_| possibly owns |input_event|, so don't use |input_event| | 844 // |next_mouse_move_| possibly owns |input_event|, so don't use |input_event| |
| 845 // after this line. | 845 // after this line. |
| 846 next_mouse_move_.reset(); | 846 next_mouse_move_.reset(); |
| 847 | 847 |
| 848 in_flight_event_count_++; | 848 increment_in_flight_event_count(); |
| 849 StartHangMonitorTimeout( | 849 StartHangMonitorTimeout( |
| 850 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); | 850 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); |
| 851 } | 851 } |
| 852 | 852 |
| 853 void RenderWidgetHostImpl::ForwardTouchEvent( | 853 void RenderWidgetHostImpl::ForwardTouchEvent( |
| 854 const WebKit::WebTouchEvent& touch_event) { | 854 const WebKit::WebTouchEvent& touch_event) { |
| 855 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardTouchEvent"); | 855 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardTouchEvent"); |
| 856 if (ignore_input_events_ || process_->IgnoreInputEvents()) | 856 if (ignore_input_events_ || process_->IgnoreInputEvents()) |
| 857 return; | 857 return; |
| 858 | 858 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 | 1280 |
| 1281 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, | 1281 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, |
| 1282 bool processed) { | 1282 bool processed) { |
| 1283 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); | 1283 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); |
| 1284 | 1284 |
| 1285 // Log the time delta for processing an input event. | 1285 // Log the time delta for processing an input event. |
| 1286 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; | 1286 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; |
| 1287 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); | 1287 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); |
| 1288 | 1288 |
| 1289 // Cancel pending hung renderer checks since the renderer is responsive. | 1289 // Cancel pending hung renderer checks since the renderer is responsive. |
| 1290 if (--in_flight_event_count_ == 0) | 1290 if (decrement_in_flight_event_count() == 0) |
| 1291 StopHangMonitorTimeout(); | 1291 StopHangMonitorTimeout(); |
| 1292 | 1292 |
| 1293 int type = static_cast<int>(event_type); | 1293 int type = static_cast<int>(event_type); |
| 1294 if (type < WebInputEvent::Undefined) { | 1294 if (type < WebInputEvent::Undefined) { |
| 1295 RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); | 1295 RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); |
| 1296 process_->ReceivedBadMessage(); | 1296 process_->ReceivedBadMessage(); |
| 1297 } else if (type == WebInputEvent::MouseMove) { | 1297 } else if (type == WebInputEvent::MouseMove) { |
| 1298 mouse_move_pending_ = false; | 1298 mouse_move_pending_ = false; |
| 1299 | 1299 |
| 1300 // now, we can send the next mouse move event | 1300 // now, we can send the next mouse move event |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 // indicate that no callback is in progress (i.e. without this line | 1709 // indicate that no callback is in progress (i.e. without this line |
| 1710 // DelayedAutoResized will not get called again). | 1710 // DelayedAutoResized will not get called again). |
| 1711 new_auto_size_.SetSize(0, 0); | 1711 new_auto_size_.SetSize(0, 0); |
| 1712 if (!should_auto_resize_) | 1712 if (!should_auto_resize_) |
| 1713 return; | 1713 return; |
| 1714 | 1714 |
| 1715 OnRenderAutoResized(new_size); | 1715 OnRenderAutoResized(new_size); |
| 1716 } | 1716 } |
| 1717 | 1717 |
| 1718 } // namespace content | 1718 } // namespace content |
| OLD | NEW |