Chromium Code Reviews| Index: content/browser/renderer_host/render_view_host.cc |
| diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc |
| index d5c47471767d99897d1a8ce47300faaba2447f40..6861ed3fc92130bdfe67d1b047fe7b456b8fa35f 100644 |
| --- a/content/browser/renderer_host/render_view_host.cc |
| +++ b/content/browser/renderer_host/render_view_host.cc |
| @@ -292,8 +292,9 @@ void RenderViewHost::FirePageBeforeUnload(bool for_cross_site_transition) { |
| void RenderViewHost::ClosePage(bool for_cross_site_transition, |
| int new_render_process_host_id, |
| int new_request_id) { |
| - // In most cases, this will not be set to false afterward. Either the tab |
| - // will be closed, or a pending RenderViewHost will replace this one. |
| + // This will be set back to false in OnClosePageACK, just before we close the |
| + // tab or replace it with a pending RVH. There are some cases (such as 204 |
| + // errors) where we'll continue to show this RVH. |
| is_waiting_for_unload_ack_ = true; |
| // Start the hang monitor in case the renderer hangs in the unload handler. |
| StartHangMonitorTimeout(TimeDelta::FromMilliseconds(kUnloadTimeoutMS)); |
| @@ -319,6 +320,15 @@ void RenderViewHost::ClosePage(bool for_cross_site_transition, |
| } |
| } |
| +void RenderViewHost::OnClosePageACK(bool for_cross_site_transition) { |
| + StopHangMonitorTimeout(); |
| + is_waiting_for_unload_ack_ = false; |
| + |
| + if (!for_cross_site_transition) { |
|
brettw
2011/03/24 20:27:49
Can you add a comment here about why this conditio
Charlie Reis
2011/03/24 22:46:03
Done.
|
| + ClosePageIgnoringUnloadEvents(); |
| + } |
| +} |
| + |
| void RenderViewHost::ClosePageIgnoringUnloadEvents() { |
| StopHangMonitorTimeout(); |
| is_waiting_for_beforeunload_ack_ = false; |