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

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

Issue 10383281: Merge 136701 - Disable the hang dialog detector when showModalDialog is running. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
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_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 delegate_(delegate), 133 delegate_(delegate),
134 instance_(static_cast<SiteInstanceImpl*>(instance)), 134 instance_(static_cast<SiteInstanceImpl*>(instance)),
135 waiting_for_drag_context_response_(false), 135 waiting_for_drag_context_response_(false),
136 enabled_bindings_(0), 136 enabled_bindings_(0),
137 guest_(false), 137 guest_(false),
138 pending_request_id_(-1), 138 pending_request_id_(-1),
139 navigations_suspended_(false), 139 navigations_suspended_(false),
140 suspended_nav_message_(NULL), 140 suspended_nav_message_(NULL),
141 is_swapped_out_(false), 141 is_swapped_out_(false),
142 run_modal_reply_msg_(NULL), 142 run_modal_reply_msg_(NULL),
143 run_modal_opener_id_(MSG_ROUTING_NONE),
143 is_waiting_for_beforeunload_ack_(false), 144 is_waiting_for_beforeunload_ack_(false),
144 is_waiting_for_unload_ack_(false), 145 is_waiting_for_unload_ack_(false),
145 unload_ack_is_for_cross_site_transition_(false), 146 unload_ack_is_for_cross_site_transition_(false),
146 are_javascript_messages_suppressed_(false), 147 are_javascript_messages_suppressed_(false),
147 sudden_termination_allowed_(false), 148 sudden_termination_allowed_(false),
148 session_storage_namespace_( 149 session_storage_namespace_(
149 static_cast<SessionStorageNamespaceImpl*>(session_storage)), 150 static_cast<SessionStorageNamespaceImpl*>(session_storage)),
150 save_accessibility_tree_for_testing_(false), 151 save_accessibility_tree_for_testing_(false),
151 send_accessibility_updated_notifications_(false), 152 send_accessibility_updated_notifications_(false),
152 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { 153 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) {
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 } 891 }
891 892
892 return handled; 893 return handled;
893 } 894 }
894 895
895 void RenderViewHostImpl::Shutdown() { 896 void RenderViewHostImpl::Shutdown() {
896 // If we are being run modally (see RunModal), then we need to cleanup. 897 // If we are being run modally (see RunModal), then we need to cleanup.
897 if (run_modal_reply_msg_) { 898 if (run_modal_reply_msg_) {
898 Send(run_modal_reply_msg_); 899 Send(run_modal_reply_msg_);
899 run_modal_reply_msg_ = NULL; 900 run_modal_reply_msg_ = NULL;
901 RenderViewHostImpl* opener =
902 RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_);
903 if (opener) {
904 opener->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(
905 hung_renderer_delay_ms_));
906 // Balance out the decrement when we got created.
907 opener->increment_in_flight_event_count();
908 }
909 run_modal_opener_id_ = MSG_ROUTING_NONE;
900 } 910 }
901 911
902 RenderWidgetHostImpl::Shutdown(); 912 RenderWidgetHostImpl::Shutdown();
903 } 913 }
904 914
905 bool RenderViewHostImpl::IsRenderView() const { 915 bool RenderViewHostImpl::IsRenderView() const {
906 return true; 916 return true;
907 } 917 }
908 918
909 void RenderViewHostImpl::CreateNewWindow( 919 void RenderViewHostImpl::CreateNewWindow(
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 963
954 void RenderViewHostImpl::OnMsgShowFullscreenWidget(int route_id) { 964 void RenderViewHostImpl::OnMsgShowFullscreenWidget(int route_id) {
955 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); 965 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
956 if (view) { 966 if (view) {
957 if (!is_swapped_out_) 967 if (!is_swapped_out_)
958 view->ShowCreatedFullscreenWidget(route_id); 968 view->ShowCreatedFullscreenWidget(route_id);
959 Send(new ViewMsg_Move_ACK(route_id)); 969 Send(new ViewMsg_Move_ACK(route_id));
960 } 970 }
961 } 971 }
962 972
963 void RenderViewHostImpl::OnMsgRunModal(IPC::Message* reply_msg) { 973 void RenderViewHostImpl::OnMsgRunModal(int opener_id, IPC::Message* reply_msg) {
964 DCHECK(!run_modal_reply_msg_); 974 DCHECK(!run_modal_reply_msg_);
965 run_modal_reply_msg_ = reply_msg; 975 run_modal_reply_msg_ = reply_msg;
976 run_modal_opener_id_ = opener_id;
966 977
967 content::RecordAction(UserMetricsAction("ShowModalDialog")); 978 content::RecordAction(UserMetricsAction("ShowModalDialog"));
968 979
980 RenderViewHostImpl* opener =
981 RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_);
982 opener->StopHangMonitorTimeout();
983 // The ack for the mouse down won't come until the dialog closes, so fake it
984 // so that we don't get a timeout.
985 opener->decrement_in_flight_event_count();
986
969 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in 987 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in
970 // an app-modal fashion. 988 // an app-modal fashion.
971 } 989 }
972 990
973 void RenderViewHostImpl::OnMsgRenderViewReady() { 991 void RenderViewHostImpl::OnMsgRenderViewReady() {
974 render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING; 992 render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING;
975 WasResized(); 993 WasResized();
976 delegate_->RenderViewReady(this); 994 delegate_->RenderViewReady(this);
977 } 995 }
978 996
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 // can cause navigations to be ignored in OnMsgNavigate. 1752 // can cause navigations to be ignored in OnMsgNavigate.
1735 is_waiting_for_beforeunload_ack_ = false; 1753 is_waiting_for_beforeunload_ack_ = false;
1736 is_waiting_for_unload_ack_ = false; 1754 is_waiting_for_unload_ack_ = false;
1737 } 1755 }
1738 1756
1739 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1757 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1740 STLDeleteValues(&power_save_blockers_); 1758 STLDeleteValues(&power_save_blockers_);
1741 } 1759 }
1742 1760
1743 } // namespace content 1761 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698