Chromium Code Reviews| 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 986327751e78c559f7efbac1b789a3ca7490bf5a..c6393a650c7cffbaad754fb979909e983814eaf2 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager.cc |
| +++ b/content/browser/frame_host/render_frame_host_manager.cc |
| @@ -456,7 +456,8 @@ void RenderFrameHostManager::DidNavigateFrame( |
| // TODO(creis): Take in RenderFrameHost instead, since frames can have openers. |
|
Charlie Reis
2014/08/22 19:41:23
I thought about tackling this here as well, but I
|
| void RenderFrameHostManager::DidDisownOpener(RenderViewHost* render_view_host) { |
| - // Notify all swapped out hosts, including the pending RVH. |
|
Charlie Reis
2014/08/22 19:41:23
Bug 1: We wanted to notify the pending RVH, but we
|
| + // Notify all RenderViewHosts but the one that notified us. This is necessary |
| + // in case a process swap has occurred while the message was in flight. |
| for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); |
| iter != proxy_hosts_.end(); |
| ++iter) { |
| @@ -464,6 +465,14 @@ void RenderFrameHostManager::DidDisownOpener(RenderViewHost* render_view_host) { |
| current_frame_host()->GetSiteInstance()); |
| iter->second->GetRenderViewHost()->DisownOpener(); |
| } |
| + |
| + if (render_frame_host_->render_view_host() != render_view_host) |
| + render_frame_host_->render_view_host()->DisownOpener(); |
|
Charlie Reis
2014/08/22 19:41:23
Bug 2: It's possible for a cross-process navigatio
|
| + |
| + if (pending_render_frame_host_ && |
| + pending_render_frame_host_->render_view_host() != render_view_host) { |
| + pending_render_frame_host_->render_view_host()->DisownOpener(); |
| + } |
| } |
| void RenderFrameHostManager::RendererProcessClosing( |
| @@ -1052,7 +1061,7 @@ int RenderFrameHostManager::CreateRenderFrame(SiteInstance* instance, |
| // Check if we've already created an RFH for this SiteInstance. If so, try |
| // to re-use the existing one, which has already been initialized. We'll |
| - // remove it from the list of swapped out hosts if it commits. |
| + // remove it from the list of proxy hosts below if it will be active. |
| RenderFrameProxyHost* proxy = GetRenderFrameProxyHost(instance); |
| if (proxy) { |