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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 } | 1772 } |
1773 | 1773 |
1774 void RenderWidgetHostImpl::IncrementInFlightEventCount() { | 1774 void RenderWidgetHostImpl::IncrementInFlightEventCount() { |
1775 StartHangMonitorTimeout( | 1775 StartHangMonitorTimeout( |
1776 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); | 1776 TimeDelta::FromMilliseconds(hung_renderer_delay_ms_)); |
1777 increment_in_flight_event_count(); | 1777 increment_in_flight_event_count(); |
1778 } | 1778 } |
1779 | 1779 |
1780 void RenderWidgetHostImpl::DecrementInFlightEventCount() { | 1780 void RenderWidgetHostImpl::DecrementInFlightEventCount() { |
1781 DCHECK_GE(in_flight_event_count_, 0); | 1781 DCHECK_GE(in_flight_event_count_, 0); |
1782 // Cancel pending hung renderer checks since the renderer is responsive. | 1782 if (decrement_in_flight_event_count() <= 0) { |
1783 if (decrement_in_flight_event_count() <= 0) | 1783 // Cancel pending hung renderer checks since the renderer is responsive. |
1784 StopHangMonitorTimeout(); | 1784 StopHangMonitorTimeout(); |
| 1785 } else { |
| 1786 // The renderer is responsive, but there are in-flight events to wait for. |
| 1787 RestartHangMonitorTimeout(); |
| 1788 } |
1785 } | 1789 } |
1786 | 1790 |
1787 void RenderWidgetHostImpl::OnHasTouchEventHandlers(bool has_handlers) { | 1791 void RenderWidgetHostImpl::OnHasTouchEventHandlers(bool has_handlers) { |
1788 has_touch_handler_ = has_handlers; | 1792 has_touch_handler_ = has_handlers; |
1789 } | 1793 } |
1790 | 1794 |
1791 void RenderWidgetHostImpl::DidFlush() { | 1795 void RenderWidgetHostImpl::DidFlush() { |
1792 if (synthetic_gesture_controller_) | 1796 if (synthetic_gesture_controller_) |
1793 synthetic_gesture_controller_->OnDidFlushInput(); | 1797 synthetic_gesture_controller_->OnDidFlushInput(); |
1794 if (view_) | 1798 if (view_) |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 } | 2315 } |
2312 #endif | 2316 #endif |
2313 | 2317 |
2314 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2318 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2315 if (view_) | 2319 if (view_) |
2316 return view_->PreferredReadbackFormat(); | 2320 return view_->PreferredReadbackFormat(); |
2317 return kN32_SkColorType; | 2321 return kN32_SkColorType; |
2318 } | 2322 } |
2319 | 2323 |
2320 } // namespace content | 2324 } // namespace content |
OLD | NEW |