Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 0a748f1078548df692d61e70b33952ee0b2ec6dc..948721bf3adfebeac585ea6203fac806b7cc62da 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -4690,7 +4690,9 @@ void WebContentsImpl::OnDialogClosed(int render_process_id, |
| render_frame_id); |
| last_dialog_suppressed_ = dialog_was_suppressed; |
| - if (is_showing_before_unload_dialog_ && !success) { |
| + // It is possible for the RenderFrameHost to have been swapped out in the |
| + // meantime. Do not reset the navigation state in that case. |
| + if (is_showing_before_unload_dialog_ && !success && rfh == GetMainFrame()) { |
|
Charlie Reis
2016/03/24 21:50:41
This won't work for subframes. (I know we have so
clamy
2016/03/25 13:43:48
I don't quite see which NavigationHandle I should
Charlie Reis
2016/03/25 23:59:43
Ok. I hadn't looked closely enough to see which R
clamy
2016/03/29 13:01:50
Done.
|
| if (rfh) |
| rfh->frame_tree_node()->BeforeUnloadCanceled(); |
| controller_.DiscardNonCommittedEntries(); |