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 f9e2bf976fcbe85f71d53b78f7fbd8fe5bcf37f9..065cf5adbba2d8ff859838bc3f51f0c729702916 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -1659,16 +1659,6 @@ void RenderFrameHostManager::CommitPending() { |
if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kSitePerProcess) && |
!is_main_frame) { |
- // If this is a subframe, it should have a CrossProcessFrameConnector |
- // created already. Use it to link the new RFH's view to the proxy that |
- // belongs to the parent frame's SiteInstance. |
- // Note: We do this after swapping out the old RFH because that may create |
- // the proxy we're looking for. |
- RenderFrameProxyHost* proxy_to_parent = GetProxyToParent(); |
- if (proxy_to_parent) { |
- proxy_to_parent->SetChildRWHView(render_frame_host_->GetView()); |
- } |
- |
// Since the new RenderFrameHost is now committed, there must be no proxies |
// for its SiteInstance. Delete any existing ones. |
RenderFrameProxyHostMap::iterator iter = |
@@ -1677,6 +1667,17 @@ void RenderFrameHostManager::CommitPending() { |
delete iter->second; |
proxy_hosts_.erase(iter); |
} |
+ |
+ // If this is a subframe, it should have a CrossProcessFrameConnector |
+ // created already. Use it to link the new RFH's view to the proxy that |
+ // belongs to the parent frame's SiteInstance. If this navigation causes |
+ // an out-of-process frame to return to the same process as its parent, the |
+ // proxy would have been removed from proxy_hosts_ above. |
+ // Note: We do this after swapping out the old RFH because that may create |
+ // the proxy we're looking for. |
+ RenderFrameProxyHost* proxy_to_parent = GetProxyToParent(); |
+ if (proxy_to_parent) |
+ proxy_to_parent->SetChildRWHView(render_frame_host_->GetView()); |
} |
// After all is done, there must never be a proxy in the list which has the |