Chromium Code Reviews| 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 56a7f1792c6bbe24465b54ca417b3a8d2edae688..34e252e72fbcf20334bfd04ad92da63984fa8a45 100644 |
| --- a/content/browser/frame_host/render_frame_host_impl.cc |
| +++ b/content/browser/frame_host/render_frame_host_impl.cc |
| @@ -2332,6 +2332,12 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation, |
| bool is_reload) { |
| DCHECK(for_navigation || !is_reload); |
| + if (IsBrowserSideNavigationEnabled() && !for_navigation) { |
| + // Cancel any pending navigations, to avoid their navigation commit/fail |
| + // event from wiping out the is_waiting_for_beforeunload_ack_ state. |
| + frame_tree_node_->ResetNavigationRequest(false); |
|
nasko
2016/10/05 21:25:17
If the beforeunload handler stops the tab from clo
|
| + } |
| + |
| // TODO(creis): Support beforeunload on subframes. For now just pretend that |
| // the handler ran and allowed the navigation to proceed. |
| if (!ShouldDispatchBeforeUnload()) { |