| 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 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 delegate_->OnUserInteraction(this, event.type()); | 2104 delegate_->OnUserInteraction(this, event.type()); |
| 2105 } | 2105 } |
| 2106 } | 2106 } |
| 2107 | 2107 |
| 2108 return view_ ? view_->FilterInputEvent(event) | 2108 return view_ ? view_->FilterInputEvent(event) |
| 2109 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 2109 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 void RenderWidgetHostImpl::IncrementInFlightEventCount( | 2112 void RenderWidgetHostImpl::IncrementInFlightEventCount( |
| 2113 blink::WebInputEvent::Type event_type) { | 2113 blink::WebInputEvent::Type event_type) { |
| 2114 increment_in_flight_event_count(); | 2114 ++in_flight_event_count_; |
| 2115 if (!is_hidden_) { | 2115 if (!is_hidden_) { |
| 2116 StartHangMonitorTimeout( | 2116 StartHangMonitorTimeout( |
| 2117 hung_renderer_delay_, event_type, | 2117 hung_renderer_delay_, event_type, |
| 2118 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_IN_FLIGHT_EVENTS); | 2118 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_IN_FLIGHT_EVENTS); |
| 2119 } | 2119 } |
| 2120 } | 2120 } |
| 2121 | 2121 |
| 2122 void RenderWidgetHostImpl::DecrementInFlightEventCount( | 2122 void RenderWidgetHostImpl::DecrementInFlightEventCount( |
| 2123 InputEventAckSource ack_source) { | 2123 InputEventAckSource ack_source) { |
| 2124 if (decrement_in_flight_event_count() <= 0) { | 2124 --in_flight_event_count_; |
| 2125 if (in_flight_event_count_ <= 0) { |
| 2125 // Cancel pending hung renderer checks since the renderer is responsive. | 2126 // Cancel pending hung renderer checks since the renderer is responsive. |
| 2126 StopHangMonitorTimeout(); | 2127 StopHangMonitorTimeout(); |
| 2127 } else { | 2128 } else { |
| 2128 // Only restart the hang monitor timer if we got a response from the | 2129 // Only restart the hang monitor timer if we got a response from the |
| 2129 // main thread. | 2130 // main thread. |
| 2130 if (ack_source == InputEventAckSource::MAIN_THREAD) | 2131 if (ack_source == InputEventAckSource::MAIN_THREAD) |
| 2131 RestartHangMonitorTimeoutIfNecessary(); | 2132 RestartHangMonitorTimeoutIfNecessary(); |
| 2132 } | 2133 } |
| 2133 } | 2134 } |
| 2134 | 2135 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 // different from the receiver's. | 2515 // different from the receiver's. |
| 2515 file_system_file.url = | 2516 file_system_file.url = |
| 2516 GURL(storage::GetIsolatedFileSystemRootURIString( | 2517 GURL(storage::GetIsolatedFileSystemRootURIString( |
| 2517 file_system_url.origin(), filesystem_id, std::string()) | 2518 file_system_url.origin(), filesystem_id, std::string()) |
| 2518 .append(register_name)); | 2519 .append(register_name)); |
| 2519 file_system_file.filesystem_id = filesystem_id; | 2520 file_system_file.filesystem_id = filesystem_id; |
| 2520 } | 2521 } |
| 2521 } | 2522 } |
| 2522 | 2523 |
| 2523 } // namespace content | 2524 } // namespace content |
| OLD | NEW |