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

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

Issue 1312643002: Plumb opener information when creating RenderFrames and RenderFrameProxies for subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opener-CreateOpenerProxiesIfNeeded
Patch Set: Add NewFrameProxy plumbing and test Created 5 years, 4 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 c94ce33e96601675bbb196dafbd43b20eb65def7..10de1f979478347593397d7e20bd37fd73e74d76 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1973,13 +1973,18 @@ bool RenderFrameHostManager::InitRenderFrame(
int parent_routing_id = MSG_ROUTING_NONE;
int previous_sibling_routing_id = MSG_ROUTING_NONE;
int proxy_routing_id = MSG_ROUTING_NONE;
-
+ SiteInstance* site_instance = render_frame_host->GetSiteInstance();
if (frame_tree_node_->parent()) {
- parent_routing_id = frame_tree_node_->parent()->render_manager()->
- GetRoutingIdForSiteInstance(render_frame_host->GetSiteInstance());
+ parent_routing_id = frame_tree_node_->parent()
+ ->render_manager()
+ ->GetRoutingIdForSiteInstance(site_instance);
CHECK_NE(parent_routing_id, MSG_ROUTING_NONE);
}
+ int opener_routing_id = MSG_ROUTING_NONE;
+ if (frame_tree_node_->opener())
+ opener_routing_id = GetOpenerRoutingID(site_instance);
+
// At this point, all RenderFrameProxies for sibling frames have already been
// created, including any proxies that come after this frame. To preserve
// correct order for indexed window access (e.g., window.frames[1]), pass the
@@ -1989,7 +1994,7 @@ bool RenderFrameHostManager::InitRenderFrame(
if (previous_sibling) {
previous_sibling_routing_id =
previous_sibling->render_manager()->GetRoutingIdForSiteInstance(
- render_frame_host->GetSiteInstance());
+ site_instance);
CHECK_NE(previous_sibling_routing_id, MSG_ROUTING_NONE);
}
@@ -2000,8 +2005,7 @@ bool RenderFrameHostManager::InitRenderFrame(
// SiteInstance as its RenderFrameHost. This is only the case until the
// RenderFrameHost commits, at which point it will replace and delete the
// RenderFrameProxyHost.
- RenderFrameProxyHost* existing_proxy =
- GetRenderFrameProxyHost(render_frame_host->GetSiteInstance());
+ RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance);
if (existing_proxy) {
proxy_routing_id = existing_proxy->GetRoutingID();
CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE);
@@ -2010,7 +2014,7 @@ bool RenderFrameHostManager::InitRenderFrame(
}
return delegate_->CreateRenderFrameForRenderManager(
render_frame_host, parent_routing_id, previous_sibling_routing_id,
- proxy_routing_id);
+ proxy_routing_id, opener_routing_id);
}
int RenderFrameHostManager::GetRoutingIdForSiteInstance(

Powered by Google App Engine
This is Rietveld 408576698