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

Unified Diff: content/browser/security_exploit_browsertest.cc

Issue 1163303003: PlzNavigate: Create the speculative renderer earlier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Method renames and comment updates. Created 5 years, 6 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/security_exploit_browsertest.cc
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index cf3b7f759ddf469ae49594a9e222b8cb07d94a9f..b28dae0b944bb304d889f825f16d09f1e41cbefc 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -73,15 +73,22 @@ RenderViewHostImpl* PrepareToDuplicateHosts(Shell* shell,
Referrer(), CURRENT_TAB, false, true);
// Since the navigation above requires a cross-process swap, there will be a
- // pending RenderViewHost. Ensure it exists and is in a different process
- // than the initial page.
- RenderViewHostImpl* pending_rvh =
- wc->GetRenderManagerForTesting()->pending_render_view_host();
- EXPECT_TRUE(pending_rvh != NULL);
- EXPECT_NE(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
- pending_rvh->GetProcess()->GetID());
+ // speculative/pending RenderFrameHost. Ensure it exists and is in a different
+ // process than the initial page.
+ RenderFrameHostImpl* next_rfh;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ next_rfh =
+ wc->GetRenderManagerForTesting()->speculative_frame_host_for_testing();
+ } else {
+ next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host();
+ }
+
+ EXPECT_TRUE(next_rfh);
+ EXPECT_NE(shell->web_contents()->GetRenderProcessHost()->GetID(),
+ next_rfh->GetProcess()->GetID());
- return pending_rvh;
+ return next_rfh->render_view_host();
}
} // namespace
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698