Index: content/browser/renderer_host/render_widget_host_impl.cc |
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
index 7476989ec27f02a40b198ad4f5fde1eaa86d9125..992c4f5a1b4c699bb7ad977e552b30ae779cecf2 100644 |
--- a/content/browser/renderer_host/render_widget_host_impl.cc |
+++ b/content/browser/renderer_host/render_widget_host_impl.cc |
@@ -628,9 +628,12 @@ void RenderWidgetHostImpl::StartHangMonitorTimeout(TimeDelta delay) { |
return; |
} |
- // Set time_when_considered_hung_ if it's null. |
+ // Set time_when_considered_hung_ if it's null, or if it is further in the |
Charlie Reis
2012/04/06 22:34:14
nit: Split this into a separate sentence to make i
nasko
2012/04/10 00:16:37
No, there is no unit test for this particular case
|
+ // future than the current request, update it to the shorter duration. This |
+ // will have the side effect that the existing timeout will be forgotten. |
Time requested_end_time = Time::Now() + delay; |
- if (time_when_considered_hung_.is_null()) |
+ if (time_when_considered_hung_.is_null() || |
+ time_when_considered_hung_ > requested_end_time) |
time_when_considered_hung_ = requested_end_time; |
// If we already have a timer with the same or shorter duration, then we can |
@@ -845,7 +848,7 @@ void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event, |
// after this line. |
next_mouse_move_.reset(); |
- in_flight_event_count_++; |
+ IncrementInFlightEventCount(); |
StartHangMonitorTimeout( |
TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); |
} |
@@ -1287,7 +1290,7 @@ void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, |
UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); |
// Cancel pending hung renderer checks since the renderer is responsive. |
- if (--in_flight_event_count_ == 0) |
+ if (DecrementInFlightEventCount() == 0) |
StopHangMonitorTimeout(); |
int type = static_cast<int>(event_type); |