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

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: 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
Index: content/browser/security_exploit_browsertest.cc
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index 62d3b62c674820a133f13cd26ed52bbca5d346cc..5fca4aea055f7bff1d3a4f72894f891d68f99eb0 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -73,10 +73,19 @@ 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();
+ // speculative/pending RenderViewHost. Ensure it exists and is in a different
+ // process than the initial page.
+ RenderViewHostImpl* pending_rvh = nullptr;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ RenderFrameHostImpl* speculative_rfh =
+ wc->GetRenderManagerForTesting()->speculative_frame_host_for_testing();
+ if (speculative_rfh)
+ pending_rvh = speculative_rfh->render_view_host();
+ } else {
+ pending_rvh = wc->GetRenderManagerForTesting()->pending_render_view_host();
carlosk 2015/06/08 18:32:43 I didn't create an equivalent RFHM::speculative_re
+ }
+
EXPECT_TRUE(pending_rvh != NULL);
EXPECT_NE(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
pending_rvh->GetProcess()->GetID());

Powered by Google App Engine
This is Rietveld 408576698