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

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

Issue 2738943002: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: rebase 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 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 delegate_->OnUserInteraction(this, event.type()); 2090 delegate_->OnUserInteraction(this, event.type());
2091 } 2091 }
2092 } 2092 }
2093 2093
2094 return view_ ? view_->FilterInputEvent(event) 2094 return view_ ? view_->FilterInputEvent(event)
2095 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; 2095 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
2096 } 2096 }
2097 2097
2098 void RenderWidgetHostImpl::IncrementInFlightEventCount( 2098 void RenderWidgetHostImpl::IncrementInFlightEventCount(
2099 blink::WebInputEvent::Type event_type) { 2099 blink::WebInputEvent::Type event_type) {
2100 increment_in_flight_event_count(); 2100 ++in_flight_event_count_;
2101 if (!is_hidden_) 2101 if (!is_hidden_)
2102 StartHangMonitorTimeout(hung_renderer_delay_, event_type); 2102 StartHangMonitorTimeout(hung_renderer_delay_, event_type);
2103 } 2103 }
2104 2104
2105 void RenderWidgetHostImpl::DecrementInFlightEventCount( 2105 void RenderWidgetHostImpl::DecrementInFlightEventCount(
2106 InputEventAckSource ack_source) { 2106 InputEventAckSource ack_source) {
2107 if (decrement_in_flight_event_count() <= 0) { 2107 --in_flight_event_count_;
2108 if (in_flight_event_count_ <= 0) {
2108 // Cancel pending hung renderer checks since the renderer is responsive. 2109 // Cancel pending hung renderer checks since the renderer is responsive.
2109 StopHangMonitorTimeout(); 2110 StopHangMonitorTimeout();
2110 } else { 2111 } else {
2111 // Only restart the hang monitor timer if we got a response from the 2112 // Only restart the hang monitor timer if we got a response from the
2112 // main thread. 2113 // main thread.
2113 if (ack_source == InputEventAckSource::MAIN_THREAD) 2114 if (ack_source == InputEventAckSource::MAIN_THREAD)
2114 RestartHangMonitorTimeoutIfNecessary(); 2115 RestartHangMonitorTimeoutIfNecessary();
2115 } 2116 }
2116 } 2117 }
2117 2118
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 // different from the receiver's. 2498 // different from the receiver's.
2498 file_system_file.url = 2499 file_system_file.url =
2499 GURL(storage::GetIsolatedFileSystemRootURIString( 2500 GURL(storage::GetIsolatedFileSystemRootURIString(
2500 file_system_url.origin(), filesystem_id, std::string()) 2501 file_system_url.origin(), filesystem_id, std::string())
2501 .append(register_name)); 2502 .append(register_name));
2502 file_system_file.filesystem_id = filesystem_id; 2503 file_system_file.filesystem_id = filesystem_id;
2503 } 2504 }
2504 } 2505 }
2505 2506
2506 } // namespace content 2507 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698