| Index: content/browser/frame_host/render_frame_host_impl.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
| index b2a69360a2dfc0e00c6ae67b7eae8e330d2826cc..1cbc21c45a3e545729ba08a44968c432bd7e456b 100644
|
| --- a/content/browser/frame_host/render_frame_host_impl.cc
|
| +++ b/content/browser/frame_host/render_frame_host_impl.cc
|
| @@ -2374,14 +2374,21 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation,
|
| // handler.
|
| is_waiting_for_beforeunload_ack_ = true;
|
| unload_ack_is_for_navigation_ = for_navigation;
|
| - // Increment the in-flight event count, to ensure that input events won't
|
| - // cancel the timeout timer.
|
| - render_view_host_->GetWidget()->increment_in_flight_event_count();
|
| - render_view_host_->GetWidget()->StartHangMonitorTimeout(
|
| - TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS),
|
| - RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_BEFORE_UNLOAD);
|
| - send_before_unload_start_time_ = base::TimeTicks::Now();
|
| - Send(new FrameMsg_BeforeUnload(routing_id_, is_reload));
|
| + if (render_view_host_->GetDelegate()->IsJavaScriptDialogShowing()) {
|
| + // If there is a JavaScript dialog up, don't bother sending the renderer
|
| + // the unload event because it is known unresponsive, waiting for the
|
| + // reply from the dialog.
|
| + SimulateBeforeUnloadAck();
|
| + } else {
|
| + // Increment the in-flight event count, to ensure that input events won't
|
| + // cancel the timeout timer.
|
| + render_view_host_->GetWidget()->increment_in_flight_event_count();
|
| + render_view_host_->GetWidget()->StartHangMonitorTimeout(
|
| + TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS),
|
| + RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_BEFORE_UNLOAD);
|
| + send_before_unload_start_time_ = base::TimeTicks::Now();
|
| + Send(new FrameMsg_BeforeUnload(routing_id_, is_reload));
|
| + }
|
| }
|
| }
|
|
|
|
|