diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-09 20:38:38 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-09 20:38:38 +0000 |
commit | dfc21b80f87dc65b50e6f612cd47ead5b26251d1 (patch) | |
tree | 2abd44b286125f857780a6a66ae9bb3f0762e1e5 /content/browser | |
parent | 7a66b99fbf5cd967ba12e643fc0072fc20514990 (diff) | |
download | chromium_src-dfc21b80f87dc65b50e6f612cd47ead5b26251d1.zip chromium_src-dfc21b80f87dc65b50e6f612cd47ead5b26251d1.tar.gz chromium_src-dfc21b80f87dc65b50e6f612cd47ead5b26251d1.tar.bz2 |
Disable the hang dialog detector when showModalDialog is running.
BUG=122153
Review URL: https://chromiumcodereview.appspot.com/10377017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/renderer_host/render_view_host_impl.cc | 20 | ||||
-rw-r--r-- | content/browser/renderer_host/render_view_host_impl.h | 4 |
2 files changed, 22 insertions, 2 deletions
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 7d5235a..fb2a078 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -147,6 +147,7 @@ RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, suspended_nav_message_(NULL), is_swapped_out_(swapped_out), run_modal_reply_msg_(NULL), + run_modal_opener_id_(MSG_ROUTING_NONE), is_waiting_for_beforeunload_ack_(false), is_waiting_for_unload_ack_(false), has_timed_out_on_unload_(false), @@ -996,6 +997,15 @@ void RenderViewHostImpl::Shutdown() { if (run_modal_reply_msg_) { Send(run_modal_reply_msg_); run_modal_reply_msg_ = NULL; + RenderViewHostImpl* opener = + RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_); + if (opener) { + opener->StartHangMonitorTimeout(TimeDelta::FromMilliseconds( + hung_renderer_delay_ms_)); + // Balance out the decrement when we got created. + opener->increment_in_flight_event_count(); + } + run_modal_opener_id_ = MSG_ROUTING_NONE; } RenderWidgetHostImpl::Shutdown(); @@ -1059,12 +1069,20 @@ void RenderViewHostImpl::OnMsgShowFullscreenWidget(int route_id) { } } -void RenderViewHostImpl::OnMsgRunModal(IPC::Message* reply_msg) { +void RenderViewHostImpl::OnMsgRunModal(int opener_id, IPC::Message* reply_msg) { DCHECK(!run_modal_reply_msg_); run_modal_reply_msg_ = reply_msg; + run_modal_opener_id_ = opener_id; content::RecordAction(UserMetricsAction("ShowModalDialog")); + RenderViewHostImpl* opener = + RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_); + opener->StopHangMonitorTimeout(); + // The ack for the mouse down won't come until the dialog closes, so fake it + // so that we don't get a timeout. + opener->decrement_in_flight_event_count(); + // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in // an app-modal fashion. } diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h index 1bac85b..8667787 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h @@ -439,7 +439,7 @@ class CONTENT_EXPORT RenderViewHostImpl bool user_gesture); void OnMsgShowWidget(int route_id, const gfx::Rect& initial_pos); void OnMsgShowFullscreenWidget(int route_id); - void OnMsgRunModal(IPC::Message* reply_msg); + void OnMsgRunModal(int opener_id, IPC::Message* reply_msg); void OnMsgRenderViewReady(); void OnMsgRenderViewGone(int status, int error_code); void OnMsgDidStartProvisionalLoadForFrame(int64 frame_id, @@ -589,6 +589,8 @@ class CONTENT_EXPORT RenderViewHostImpl // If we were asked to RunModal, then this will hold the reply_msg that we // must return to the renderer to unblock it. IPC::Message* run_modal_reply_msg_; + // This will hold the routing id of the RenderView that opened us. + int run_modal_opener_id_; // Set to true when there is a pending ViewMsg_ShouldClose message. This // ensures we don't spam the renderer with multiple beforeunload requests. |