Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2727253005: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: timeout values Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 increment_in_flight_event_count(); 2105 ++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 if (decrement_in_flight_event_count() <= 0) { 2115 --in_flight_event_count_;
2116 if (in_flight_event_count_ <= 0) {
2116 // Cancel pending hung renderer checks since the renderer is responsive. 2117 // Cancel pending hung renderer checks since the renderer is responsive.
2117 StopHangMonitorTimeout(); 2118 StopHangMonitorTimeout();
2118 } else { 2119 } else {
2119 // Only restart the hang monitor timer if we got a response from the 2120 // Only restart the hang monitor timer if we got a response from the
2120 // main thread. 2121 // main thread.
2121 if (ack_source == InputEventAckSource::MAIN_THREAD) 2122 if (ack_source == InputEventAckSource::MAIN_THREAD)
2122 RestartHangMonitorTimeoutIfNecessary(); 2123 RestartHangMonitorTimeoutIfNecessary();
2123 } 2124 }
2124 } 2125 }
2125 2126
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 // different from the receiver's. 2506 // different from the receiver's.
2506 file_system_file.url = 2507 file_system_file.url =
2507 GURL(storage::GetIsolatedFileSystemRootURIString( 2508 GURL(storage::GetIsolatedFileSystemRootURIString(
2508 file_system_url.origin(), filesystem_id, std::string()) 2509 file_system_url.origin(), filesystem_id, std::string())
2509 .append(register_name)); 2510 .append(register_name));
2510 file_system_file.filesystem_id = filesystem_id; 2511 file_system_file.filesystem_id = filesystem_id;
2511 } 2512 }
2512 } 2513 }
2513 2514
2514 } // namespace content 2515 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698