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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1151393003: Add ref-count on RenderViewHost for each new RenderFrameProxyHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Nick's review. Created 5 years, 7 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_proxy_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 964255d6087aff23f2e20a01efd6ec2904d3fcfb..150d9f0dd018bc80c8fc884ed1b0eb44883df4be 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -459,11 +459,24 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CleanupCrossSiteIframe) {
EXPECT_EQ(foo_url, observer.last_navigation_url());
// Ensure that we have created a new process for the subframes.
- ASSERT_EQ(2U, root->child_count());
- EXPECT_NE(shell()->web_contents()->GetSiteInstance(),
- root->child_at(0)->current_frame_host()->GetSiteInstance());
- EXPECT_EQ(root->child_at(0)->current_frame_host()->GetSiteInstance(),
- root->child_at(1)->current_frame_host()->GetSiteInstance());
+ EXPECT_EQ(
+ " Site A ------------ proxies for B\n"
+ " |--Site B ------- proxies for A\n"
+ " +--Site B ------- proxies for A\n"
+ "Where A = http://127.0.0.1/\n"
+ " B = http://foo.com/",
+ DepictFrameTree(root));
+
+ int subframe_process_id = root->child_at(0)
+ ->current_frame_host()
+ ->GetSiteInstance()
+ ->GetProcess()
+ ->GetID();
+ int subframe_rvh_id = root->child_at(0)
+ ->current_frame_host()
+ ->render_view_host()
+ ->GetRoutingID();
+ EXPECT_TRUE(RenderViewHost::FromID(subframe_process_id, subframe_rvh_id));
// Use Javascript in the parent to remove one of the frames and ensure that
// the subframe goes away.
@@ -477,6 +490,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CleanupCrossSiteIframe) {
GURL new_url(embedded_test_server()->GetURL("/title1.html"));
NavigateToURL(shell(), new_url);
ASSERT_EQ(0U, root->child_count());
+
+ // Ensure the RVH for the subframe gets cleaned up when the frame goes away.
+ EXPECT_FALSE(RenderViewHost::FromID(subframe_process_id, subframe_rvh_id));
}
// Ensure that root frames cannot be detached.
« no previous file with comments | « content/browser/frame_host/render_frame_proxy_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698