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

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: better test 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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 delegate_->OnUserInteraction(this, event.type()); 2099 delegate_->OnUserInteraction(this, event.type());
2100 } 2100 }
2101 } 2101 }
2102 2102
2103 return view_ ? view_->FilterInputEvent(event) 2103 return view_ ? view_->FilterInputEvent(event)
2104 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; 2104 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
2105 } 2105 }
2106 2106
2107 void RenderWidgetHostImpl::IncrementInFlightEventCount( 2107 void RenderWidgetHostImpl::IncrementInFlightEventCount(
2108 blink::WebInputEvent::Type event_type) { 2108 blink::WebInputEvent::Type event_type) {
2109 increment_in_flight_event_count(); 2109 ++in_flight_event_count_;
2110 if (!is_hidden_) 2110 if (!is_hidden_)
2111 StartHangMonitorTimeout(hung_renderer_delay_, event_type); 2111 StartHangMonitorTimeout(hung_renderer_delay_, event_type);
2112 } 2112 }
2113 2113
2114 void RenderWidgetHostImpl::DecrementInFlightEventCount( 2114 void RenderWidgetHostImpl::DecrementInFlightEventCount(
2115 InputEventAckSource ack_source) { 2115 InputEventAckSource ack_source) {
2116 if (decrement_in_flight_event_count() <= 0) { 2116 --in_flight_event_count_;
2117 if (in_flight_event_count_ <= 0) {
2117 // Cancel pending hung renderer checks since the renderer is responsive. 2118 // Cancel pending hung renderer checks since the renderer is responsive.
2118 StopHangMonitorTimeout(); 2119 StopHangMonitorTimeout();
2119 } else { 2120 } else {
2120 // Only restart the hang monitor timer if we got a response from the 2121 // Only restart the hang monitor timer if we got a response from the
2121 // main thread. 2122 // main thread.
2122 if (ack_source == InputEventAckSource::MAIN_THREAD) 2123 if (ack_source == InputEventAckSource::MAIN_THREAD)
2123 RestartHangMonitorTimeoutIfNecessary(); 2124 RestartHangMonitorTimeoutIfNecessary();
2124 } 2125 }
2125 } 2126 }
2126 2127
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2547 // different from the receiver's. 2548 // different from the receiver's.
2548 file_system_file.url = 2549 file_system_file.url =
2549 GURL(storage::GetIsolatedFileSystemRootURIString( 2550 GURL(storage::GetIsolatedFileSystemRootURIString(
2550 file_system_url.origin(), filesystem_id, std::string()) 2551 file_system_url.origin(), filesystem_id, std::string())
2551 .append(register_name)); 2552 .append(register_name));
2552 file_system_file.filesystem_id = filesystem_id; 2553 file_system_file.filesystem_id = filesystem_id;
2553 } 2554 }
2554 } 2555 }
2555 2556
2556 } // namespace content 2557 } // 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.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698