| 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 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 | 898 |
| 899 // Any non-wheel input event cancels pending wheel events. | 899 // Any non-wheel input event cancels pending wheel events. |
| 900 if (input_event.type != WebInputEvent::MouseWheel) | 900 if (input_event.type != WebInputEvent::MouseWheel) |
| 901 coalesced_mouse_wheel_events_.clear(); | 901 coalesced_mouse_wheel_events_.clear(); |
| 902 | 902 |
| 903 // Any input event cancels a pending mouse move event. Note that | 903 // Any input event cancels a pending mouse move event. Note that |
| 904 // |next_mouse_move_| possibly owns |input_event|, so don't use |input_event| | 904 // |next_mouse_move_| possibly owns |input_event|, so don't use |input_event| |
| 905 // after this line. | 905 // after this line. |
| 906 next_mouse_move_.reset(); | 906 next_mouse_move_.reset(); |
| 907 | 907 |
| 908 in_flight_event_count_++; | 908 increment_in_flight_event_count(); |
| 909 StartHangMonitorTimeout( | 909 StartHangMonitorTimeout( |
| 910 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); | 910 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); |
| 911 } | 911 } |
| 912 | 912 |
| 913 void RenderWidgetHostImpl::ForwardTouchEvent( | 913 void RenderWidgetHostImpl::ForwardTouchEvent( |
| 914 const WebKit::WebTouchEvent& touch_event) { | 914 const WebKit::WebTouchEvent& touch_event) { |
| 915 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardTouchEvent"); | 915 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardTouchEvent"); |
| 916 if (ignore_input_events_ || process_->IgnoreInputEvents()) | 916 if (ignore_input_events_ || process_->IgnoreInputEvents()) |
| 917 return; | 917 return; |
| 918 | 918 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1364 |
| 1365 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, | 1365 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, |
| 1366 bool processed) { | 1366 bool processed) { |
| 1367 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); | 1367 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); |
| 1368 | 1368 |
| 1369 // Log the time delta for processing an input event. | 1369 // Log the time delta for processing an input event. |
| 1370 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; | 1370 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; |
| 1371 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); | 1371 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); |
| 1372 | 1372 |
| 1373 // Cancel pending hung renderer checks since the renderer is responsive. | 1373 // Cancel pending hung renderer checks since the renderer is responsive. |
| 1374 if (--in_flight_event_count_ == 0) | 1374 if (decrement_in_flight_event_count() == 0) |
| 1375 StopHangMonitorTimeout(); | 1375 StopHangMonitorTimeout(); |
| 1376 | 1376 |
| 1377 int type = static_cast<int>(event_type); | 1377 int type = static_cast<int>(event_type); |
| 1378 if (type < WebInputEvent::Undefined) { | 1378 if (type < WebInputEvent::Undefined) { |
| 1379 RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); | 1379 RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); |
| 1380 process_->ReceivedBadMessage(); | 1380 process_->ReceivedBadMessage(); |
| 1381 } else if (type == WebInputEvent::MouseMove) { | 1381 } else if (type == WebInputEvent::MouseMove) { |
| 1382 mouse_move_pending_ = false; | 1382 mouse_move_pending_ = false; |
| 1383 | 1383 |
| 1384 // now, we can send the next mouse move event | 1384 // now, we can send the next mouse move event |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 // indicate that no callback is in progress (i.e. without this line | 1780 // indicate that no callback is in progress (i.e. without this line |
| 1781 // DelayedAutoResized will not get called again). | 1781 // DelayedAutoResized will not get called again). |
| 1782 new_auto_size_.SetSize(0, 0); | 1782 new_auto_size_.SetSize(0, 0); |
| 1783 if (!should_auto_resize_) | 1783 if (!should_auto_resize_) |
| 1784 return; | 1784 return; |
| 1785 | 1785 |
| 1786 OnRenderAutoResized(new_size); | 1786 OnRenderAutoResized(new_size); |
| 1787 } | 1787 } |
| 1788 | 1788 |
| 1789 } // namespace content | 1789 } // namespace content |
| OLD | NEW |