| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2297 ClearProxiesInSiteInstance(site_instance_id, frame_tree_node_); | 2297 ClearProxiesInSiteInstance(site_instance_id, frame_tree_node_); |
| 2298 | 2298 |
| 2299 // Use the safe RenderWidgetHost iterator for now to find all RenderViewHosts | 2299 // Use the safe RenderWidgetHost iterator for now to find all RenderViewHosts |
| 2300 // in the SiteInstance, then tell their respective FrameTrees to remove all | 2300 // in the SiteInstance, then tell their respective FrameTrees to remove all |
| 2301 // RenderFrameProxyHosts corresponding to them. | 2301 // RenderFrameProxyHosts corresponding to them. |
| 2302 // TODO(creis): Replace this with a RenderFrameHostIterator that protects | 2302 // TODO(creis): Replace this with a RenderFrameHostIterator that protects |
| 2303 // against use-after-frees if a later element is deleted before getting to it. | 2303 // against use-after-frees if a later element is deleted before getting to it. |
| 2304 scoped_ptr<RenderWidgetHostIterator> widgets( | 2304 scoped_ptr<RenderWidgetHostIterator> widgets( |
| 2305 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); | 2305 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); |
| 2306 while (RenderWidgetHost* widget = widgets->GetNextHost()) { | 2306 while (RenderWidgetHost* widget = widgets->GetNextHost()) { |
| 2307 if (!widget->IsRenderView()) | 2307 RenderViewHost* rvh = RenderViewHost::From(widget); |
| 2308 if (!rvh) |
| 2308 continue; | 2309 continue; |
| 2309 RenderViewHostImpl* rvh = | |
| 2310 static_cast<RenderViewHostImpl*>(RenderViewHost::From(widget)); | |
| 2311 if (site_instance_id == rvh->GetSiteInstance()->GetId()) { | 2310 if (site_instance_id == rvh->GetSiteInstance()->GetId()) { |
| 2312 // This deletes all RenderFrameHosts using the |rvh|, which then causes | 2311 // This deletes all RenderFrameHosts using the |rvh|, which then causes |
| 2313 // |rvh| to Shutdown. | 2312 // |rvh| to Shutdown. |
| 2314 FrameTree* tree = rvh->GetDelegate()->GetFrameTree(); | 2313 FrameTree* tree = rvh->GetDelegate()->GetFrameTree(); |
| 2315 tree->ForEach(base::Bind( | 2314 tree->ForEach(base::Bind( |
| 2316 &RenderFrameHostManager::ClearProxiesInSiteInstance, | 2315 &RenderFrameHostManager::ClearProxiesInSiteInstance, |
| 2317 site_instance_id)); | 2316 site_instance_id)); |
| 2318 } | 2317 } |
| 2319 } | 2318 } |
| 2320 } | 2319 } |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2661 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2660 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
| 2662 if (!frame_tree_node_->opener()) | 2661 if (!frame_tree_node_->opener()) |
| 2663 return MSG_ROUTING_NONE; | 2662 return MSG_ROUTING_NONE; |
| 2664 | 2663 |
| 2665 return frame_tree_node_->opener() | 2664 return frame_tree_node_->opener() |
| 2666 ->render_manager() | 2665 ->render_manager() |
| 2667 ->GetRoutingIdForSiteInstance(instance); | 2666 ->GetRoutingIdForSiteInstance(instance); |
| 2668 } | 2667 } |
| 2669 | 2668 |
| 2670 } // namespace content | 2669 } // namespace content |
| OLD | NEW |