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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 600553003: Enable swapping a frame back in to its parent process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remoteToLocal
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 proxy_routing_id, 1181 proxy_routing_id,
1182 for_main_frame_navigation); 1182 for_main_frame_navigation);
1183 } 1183 }
1184 1184
1185 bool RenderFrameHostManager::InitRenderFrame( 1185 bool RenderFrameHostManager::InitRenderFrame(
1186 RenderFrameHostImpl* render_frame_host) { 1186 RenderFrameHostImpl* render_frame_host) {
1187 if (render_frame_host->IsRenderFrameLive()) 1187 if (render_frame_host->IsRenderFrameLive())
1188 return true; 1188 return true;
1189 1189
1190 int parent_routing_id = MSG_ROUTING_NONE; 1190 int parent_routing_id = MSG_ROUTING_NONE;
1191 int proxy_routing_id = MSG_ROUTING_NONE;
1191 if (frame_tree_node_->parent()) { 1192 if (frame_tree_node_->parent()) {
1192 parent_routing_id = frame_tree_node_->parent()->render_manager()-> 1193 parent_routing_id = frame_tree_node_->parent()->render_manager()->
1193 GetRoutingIdForSiteInstance(render_frame_host->GetSiteInstance()); 1194 GetRoutingIdForSiteInstance(render_frame_host->GetSiteInstance());
1194 CHECK_NE(parent_routing_id, MSG_ROUTING_NONE); 1195 CHECK_NE(parent_routing_id, MSG_ROUTING_NONE);
1195 } 1196 }
1197 // Check whether there is an existing proxy for this frame in this
1198 // SiteInstance. If there is, the new RenderFrame needs to be able to talk to
Charlie Reis 2014/10/28 20:10:10 nit: talk to -> find
Nate Chapin 2014/10/30 19:00:51 Done.
1199 // the proxy it is replacing, so that it can fully intiialize itself.
Charlie Reis 2014/10/28 20:10:10 nit: initialize
Nate Chapin 2014/10/30 19:00:51 Done.
1200 // NOTE: This is the only time that a RenderFrameProxy can be in the same
nasko 2014/10/28 21:58:15 nit: Since this is code in the browser and SiteIns
Nate Chapin 2014/10/30 19:00:50 Done.
1201 // SiteInstance as its RenderFrame. This is only the case until the
1202 // RenderFrame commits, at which point it will replace and delete the
1203 // RenderFrameProxy.
1204 RenderFrameProxyHost* existing_proxy =
1205 GetRenderFrameProxyHost(render_frame_host->GetSiteInstance());
1206 if (existing_proxy) {
1207 proxy_routing_id = existing_proxy->GetRoutingID();
1208 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE);
1209 }
1196 return delegate_->CreateRenderFrameForRenderManager(render_frame_host, 1210 return delegate_->CreateRenderFrameForRenderManager(render_frame_host,
1197 parent_routing_id); 1211 parent_routing_id,
1212 proxy_routing_id);
1198 } 1213 }
1199 1214
1200 int RenderFrameHostManager::GetRoutingIdForSiteInstance( 1215 int RenderFrameHostManager::GetRoutingIdForSiteInstance(
1201 SiteInstance* site_instance) { 1216 SiteInstance* site_instance) {
1202 if (render_frame_host_->GetSiteInstance() == site_instance) 1217 if (render_frame_host_->GetSiteInstance() == site_instance)
1203 return render_frame_host_->GetRoutingID(); 1218 return render_frame_host_->GetRoutingID();
1204 1219
1205 RenderFrameProxyHostMap::iterator iter = 1220 RenderFrameProxyHostMap::iterator iter =
1206 proxy_hosts_.find(site_instance->GetId()); 1221 proxy_hosts_.find(site_instance->GetId());
1207 if (iter != proxy_hosts_.end()) 1222 if (iter != proxy_hosts_.end())
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 void RenderFrameHostManager::DeleteRenderFrameProxyHost( 1631 void RenderFrameHostManager::DeleteRenderFrameProxyHost(
1617 SiteInstance* instance) { 1632 SiteInstance* instance) {
1618 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); 1633 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId());
1619 if (iter != proxy_hosts_.end()) { 1634 if (iter != proxy_hosts_.end()) {
1620 delete iter->second; 1635 delete iter->second;
1621 proxy_hosts_.erase(iter); 1636 proxy_hosts_.erase(iter);
1622 } 1637 }
1623 } 1638 }
1624 1639
1625 } // namespace content 1640 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698