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 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 delegate_->OnUserInteraction(this, event.type()); | 2095 delegate_->OnUserInteraction(this, event.type()); |
2096 } | 2096 } |
2097 } | 2097 } |
2098 | 2098 |
2099 return view_ ? view_->FilterInputEvent(event) | 2099 return view_ ? view_->FilterInputEvent(event) |
2100 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 2100 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
2101 } | 2101 } |
2102 | 2102 |
2103 void RenderWidgetHostImpl::IncrementInFlightEventCount( | 2103 void RenderWidgetHostImpl::IncrementInFlightEventCount( |
2104 blink::WebInputEvent::Type event_type) { | 2104 blink::WebInputEvent::Type event_type) { |
2105 ++in_flight_event_count_; | 2105 increment_in_flight_event_count(); |
2106 if (!is_hidden_) { | 2106 if (!is_hidden_) { |
2107 StartHangMonitorTimeout( | 2107 StartHangMonitorTimeout( |
2108 hung_renderer_delay_, event_type, | 2108 hung_renderer_delay_, event_type, |
2109 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_IN_FLIGHT_EVENTS); | 2109 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_IN_FLIGHT_EVENTS); |
2110 } | 2110 } |
2111 } | 2111 } |
2112 | 2112 |
2113 void RenderWidgetHostImpl::DecrementInFlightEventCount( | 2113 void RenderWidgetHostImpl::DecrementInFlightEventCount( |
2114 InputEventAckSource ack_source) { | 2114 InputEventAckSource ack_source) { |
2115 --in_flight_event_count_; | 2115 if (decrement_in_flight_event_count() <= 0) { |
2116 if (in_flight_event_count_ <= 0) { | |
2117 // Cancel pending hung renderer checks since the renderer is responsive. | 2116 // Cancel pending hung renderer checks since the renderer is responsive. |
2118 StopHangMonitorTimeout(); | 2117 StopHangMonitorTimeout(); |
2119 } else { | 2118 } else { |
2120 // Only restart the hang monitor timer if we got a response from the | 2119 // Only restart the hang monitor timer if we got a response from the |
2121 // main thread. | 2120 // main thread. |
2122 if (ack_source == InputEventAckSource::MAIN_THREAD) | 2121 if (ack_source == InputEventAckSource::MAIN_THREAD) |
2123 RestartHangMonitorTimeoutIfNecessary(); | 2122 RestartHangMonitorTimeoutIfNecessary(); |
2124 } | 2123 } |
2125 } | 2124 } |
2126 | 2125 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2506 // different from the receiver's. | 2505 // different from the receiver's. |
2507 file_system_file.url = | 2506 file_system_file.url = |
2508 GURL(storage::GetIsolatedFileSystemRootURIString( | 2507 GURL(storage::GetIsolatedFileSystemRootURIString( |
2509 file_system_url.origin(), filesystem_id, std::string()) | 2508 file_system_url.origin(), filesystem_id, std::string()) |
2510 .append(register_name)); | 2509 .append(register_name)); |
2511 file_system_file.filesystem_id = filesystem_id; | 2510 file_system_file.filesystem_id = filesystem_id; |
2512 } | 2511 } |
2513 } | 2512 } |
2514 | 2513 |
2515 } // namespace content | 2514 } // namespace content |
OLD | NEW |