Index: content/browser/frame_host/render_frame_host_manager.cc |
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
index 612868ecc20d6f8dde95c092e9849d5acc81b5fd..17b5b634448bc56cf45bf4348eda7e9ec66f6cfd 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -1000,7 +1000,14 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation( |
// Reuse the current RFH if its SiteInstance matches the the navigation's |
// or if this is a subframe navigation. We only swap RFHs for subframes when |
// --site-per-process is enabled. |
- CleanUpNavigation(); |
+ |
+ // There might be a pending WebUI in the current RenderFrameHost from a |
+ // previous call of this function in the same navigation and it should be |
+ // maintained for the next call to UpdatePendingWebUI. So instead of calling |
clamy
2015/10/22 16:51:39
nit: RenderFrameHostImpl::UpdatePendingWebUI.
carlosk
2015/10/26 10:33:23
Done.
|
+ // CleanUpNavigation, only the speculative RenderFrameHost is discarded. |
clamy
2015/10/22 16:51:39
nit: s/the speculative RenderFrameHost is discarde
carlosk
2015/10/26 10:33:23
Done.
|
+ if (speculative_render_frame_host_) |
+ DiscardUnusedFrame(UnsetSpeculativeRenderFrameHost()); |
+ |
navigation_rfh = render_frame_host_.get(); |
// As SiteInstances are the same, make the RFH update its possible pending |
@@ -1092,8 +1099,6 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation( |
void RenderFrameHostManager::CleanUpNavigation() { |
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kEnableBrowserSideNavigation)); |
- // TODO(carlosk): the discarding of the current RFH WebUI and the cleanup of |
- // the speculative RFH should not always happen together. |
render_frame_host_->DiscardPendingWebUI(); |
if (speculative_render_frame_host_) |
DiscardUnusedFrame(UnsetSpeculativeRenderFrameHost()); |