Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1905)

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1417953002: PlzNavigate: Add tests to check WebUI navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Broken test into 3 separate ones. Other minor changes. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698