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 <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 #include <utility> | 10 #include <utility> |
9 | 11 |
10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
11 #include "base/logging.h" | 13 #include "base/logging.h" |
12 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
13 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
14 #include "content/browser/child_process_security_policy_impl.h" | 16 #include "content/browser/child_process_security_policy_impl.h" |
15 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 17 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
16 #include "content/browser/frame_host/cross_site_transferring_request.h" | 18 #include "content/browser/frame_host/cross_site_transferring_request.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 return true; | 84 return true; |
83 } | 85 } |
84 | 86 |
85 } // namespace | 87 } // namespace |
86 | 88 |
87 // A helper class to hold all frame proxies and register as a | 89 // A helper class to hold all frame proxies and register as a |
88 // RenderProcessHostObserver for them. | 90 // RenderProcessHostObserver for them. |
89 class RenderFrameHostManager::RenderFrameProxyHostMap | 91 class RenderFrameHostManager::RenderFrameProxyHostMap |
90 : public RenderProcessHostObserver { | 92 : public RenderProcessHostObserver { |
91 public: | 93 public: |
92 using MapType = base::hash_map<int32, RenderFrameProxyHost*>; | 94 using MapType = base::hash_map<int32_t, RenderFrameProxyHost*>; |
93 | 95 |
94 RenderFrameProxyHostMap(RenderFrameHostManager* manager); | 96 RenderFrameProxyHostMap(RenderFrameHostManager* manager); |
95 ~RenderFrameProxyHostMap() override; | 97 ~RenderFrameProxyHostMap() override; |
96 | 98 |
97 // Read-only access to the underlying map of site instance ID to | 99 // Read-only access to the underlying map of site instance ID to |
98 // RenderFrameProxyHosts. | 100 // RenderFrameProxyHosts. |
99 MapType::const_iterator begin() const { return map_.begin(); } | 101 MapType::const_iterator begin() const { return map_.begin(); } |
100 MapType::const_iterator end() const { return map_.end(); } | 102 MapType::const_iterator end() const { return map_.end(); } |
101 bool empty() const { return map_.empty(); } | 103 bool empty() const { return map_.empty(); } |
102 | 104 |
103 // Returns the proxy with the specified ID, or nullptr if there is no such | 105 // Returns the proxy with the specified ID, or nullptr if there is no such |
104 // one. | 106 // one. |
105 RenderFrameProxyHost* Get(int32 id); | 107 RenderFrameProxyHost* Get(int32_t id); |
106 | 108 |
107 // Adds the specified proxy with the specified ID. It is an error (and fatal) | 109 // Adds the specified proxy with the specified ID. It is an error (and fatal) |
108 // to add more than one proxy with the specified ID. | 110 // to add more than one proxy with the specified ID. |
109 void Add(int32 id, scoped_ptr<RenderFrameProxyHost> proxy); | 111 void Add(int32_t id, scoped_ptr<RenderFrameProxyHost> proxy); |
110 | 112 |
111 // Removes the proxy with the specified site instance ID. | 113 // Removes the proxy with the specified site instance ID. |
112 void Remove(int32 id); | 114 void Remove(int32_t id); |
113 | 115 |
114 // Removes all proxies. | 116 // Removes all proxies. |
115 void Clear(); | 117 void Clear(); |
116 | 118 |
117 // RenderProcessHostObserver implementation. | 119 // RenderProcessHostObserver implementation. |
118 void RenderProcessWillExit(RenderProcessHost* host) override; | 120 void RenderProcessWillExit(RenderProcessHost* host) override; |
119 void RenderProcessExited(RenderProcessHost* host, | 121 void RenderProcessExited(RenderProcessHost* host, |
120 base::TerminationStatus status, | 122 base::TerminationStatus status, |
121 int exit_code) override; | 123 int exit_code) override; |
122 | 124 |
123 private: | 125 private: |
124 RenderFrameHostManager* manager_; | 126 RenderFrameHostManager* manager_; |
125 MapType map_; | 127 MapType map_; |
126 }; | 128 }; |
127 | 129 |
128 RenderFrameHostManager::RenderFrameProxyHostMap::RenderFrameProxyHostMap( | 130 RenderFrameHostManager::RenderFrameProxyHostMap::RenderFrameProxyHostMap( |
129 RenderFrameHostManager* manager) | 131 RenderFrameHostManager* manager) |
130 : manager_(manager) {} | 132 : manager_(manager) {} |
131 | 133 |
132 RenderFrameHostManager::RenderFrameProxyHostMap::~RenderFrameProxyHostMap() { | 134 RenderFrameHostManager::RenderFrameProxyHostMap::~RenderFrameProxyHostMap() { |
133 Clear(); | 135 Clear(); |
134 } | 136 } |
135 | 137 |
136 RenderFrameProxyHost* RenderFrameHostManager::RenderFrameProxyHostMap::Get( | 138 RenderFrameProxyHost* RenderFrameHostManager::RenderFrameProxyHostMap::Get( |
137 int32 id) { | 139 int32_t id) { |
138 auto it = map_.find(id); | 140 auto it = map_.find(id); |
139 if (it != map_.end()) | 141 if (it != map_.end()) |
140 return it->second; | 142 return it->second; |
141 return nullptr; | 143 return nullptr; |
142 } | 144 } |
143 | 145 |
144 void RenderFrameHostManager::RenderFrameProxyHostMap::Add( | 146 void RenderFrameHostManager::RenderFrameProxyHostMap::Add( |
145 int32 id, | 147 int32_t id, |
146 scoped_ptr<RenderFrameProxyHost> proxy) { | 148 scoped_ptr<RenderFrameProxyHost> proxy) { |
147 CHECK_EQ(0u, map_.count(id)) << "Inserting a duplicate item."; | 149 CHECK_EQ(0u, map_.count(id)) << "Inserting a duplicate item."; |
148 | 150 |
149 // If this is the first proxy that has this process host, observe the | 151 // If this is the first proxy that has this process host, observe the |
150 // process host. | 152 // process host. |
151 RenderProcessHost* host = proxy->GetProcess(); | 153 RenderProcessHost* host = proxy->GetProcess(); |
152 size_t count = | 154 size_t count = |
153 std::count_if(begin(), end(), [host](MapType::value_type item) { | 155 std::count_if(begin(), end(), [host](MapType::value_type item) { |
154 return item.second->GetProcess() == host; | 156 return item.second->GetProcess() == host; |
155 }); | 157 }); |
156 if (count == 0) | 158 if (count == 0) |
157 host->AddObserver(this); | 159 host->AddObserver(this); |
158 | 160 |
159 map_[id] = proxy.release(); | 161 map_[id] = proxy.release(); |
160 } | 162 } |
161 | 163 |
162 void RenderFrameHostManager::RenderFrameProxyHostMap::Remove(int32 id) { | 164 void RenderFrameHostManager::RenderFrameProxyHostMap::Remove(int32_t id) { |
163 auto it = map_.find(id); | 165 auto it = map_.find(id); |
164 if (it == map_.end()) | 166 if (it == map_.end()) |
165 return; | 167 return; |
166 | 168 |
167 // If this is the last proxy that has this process host, stop observing the | 169 // If this is the last proxy that has this process host, stop observing the |
168 // process host. | 170 // process host. |
169 RenderProcessHost* host = it->second->GetProcess(); | 171 RenderProcessHost* host = it->second->GetProcess(); |
170 size_t count = | 172 size_t count = |
171 std::count_if(begin(), end(), [host](MapType::value_type item) { | 173 std::count_if(begin(), end(), [host](MapType::value_type item) { |
172 return item.second->GetProcess() == host; | 174 return item.second->GetProcess() == host; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 // RenderFrameHost, since the CrossProcessFrameConnector (owned by | 254 // RenderFrameHost, since the CrossProcessFrameConnector (owned by |
253 // RenderFrameProxyHost) points to the RenderWidgetHostView associated with | 255 // RenderFrameProxyHost) points to the RenderWidgetHostView associated with |
254 // the current RenderFrameHost and uses it during its destructor. | 256 // the current RenderFrameHost and uses it during its destructor. |
255 ResetProxyHosts(); | 257 ResetProxyHosts(); |
256 | 258 |
257 // We should always have a current RenderFrameHost except in some tests. | 259 // We should always have a current RenderFrameHost except in some tests. |
258 SetRenderFrameHost(scoped_ptr<RenderFrameHostImpl>()); | 260 SetRenderFrameHost(scoped_ptr<RenderFrameHostImpl>()); |
259 } | 261 } |
260 | 262 |
261 void RenderFrameHostManager::Init(SiteInstance* site_instance, | 263 void RenderFrameHostManager::Init(SiteInstance* site_instance, |
262 int32 view_routing_id, | 264 int32_t view_routing_id, |
263 int32 frame_routing_id, | 265 int32_t frame_routing_id, |
264 int32 widget_routing_id) { | 266 int32_t widget_routing_id) { |
265 DCHECK(site_instance); | 267 DCHECK(site_instance); |
266 // TODO(avi): While RenderViewHostImpl is-a RenderWidgetHostImpl, this must | 268 // TODO(avi): While RenderViewHostImpl is-a RenderWidgetHostImpl, this must |
267 // hold true to avoid having two RenderWidgetHosts for the top-level frame. | 269 // hold true to avoid having two RenderWidgetHosts for the top-level frame. |
268 // https://crbug.com/545684 | 270 // https://crbug.com/545684 |
269 DCHECK(!frame_tree_node_->IsMainFrame() || | 271 DCHECK(!frame_tree_node_->IsMainFrame() || |
270 view_routing_id == widget_routing_id); | 272 view_routing_id == widget_routing_id); |
271 int flags = delegate_->IsHidden() ? CREATE_RF_HIDDEN : 0; | 273 int flags = delegate_->IsHidden() ? CREATE_RF_HIDDEN : 0; |
272 SetRenderFrameHost(CreateRenderFrameHost(site_instance, view_routing_id, | 274 SetRenderFrameHost(CreateRenderFrameHost(site_instance, view_routing_id, |
273 frame_routing_id, widget_routing_id, | 275 frame_routing_id, widget_routing_id, |
274 flags)); | 276 flags)); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // TODO(creis): Handle modal dialogs in subframe processes. | 832 // TODO(creis): Handle modal dialogs in subframe processes. |
831 old_render_frame_host->render_view_host()->SuppressDialogsUntilSwapOut(); | 833 old_render_frame_host->render_view_host()->SuppressDialogsUntilSwapOut(); |
832 | 834 |
833 // Now close any modal dialogs that would prevent us from swapping out. This | 835 // Now close any modal dialogs that would prevent us from swapping out. This |
834 // must be done separately from SwapOut, so that the PageGroupLoadDeferrer is | 836 // must be done separately from SwapOut, so that the PageGroupLoadDeferrer is |
835 // no longer on the stack when we send the SwapOut message. | 837 // no longer on the stack when we send the SwapOut message. |
836 delegate_->CancelModalDialogsForRenderManager(); | 838 delegate_->CancelModalDialogsForRenderManager(); |
837 | 839 |
838 // If the old RFH is not live, just return as there is no further work to do. | 840 // If the old RFH is not live, just return as there is no further work to do. |
839 // It will be deleted and there will be no proxy created. | 841 // It will be deleted and there will be no proxy created. |
840 int32 old_site_instance_id = | 842 int32_t old_site_instance_id = |
841 old_render_frame_host->GetSiteInstance()->GetId(); | 843 old_render_frame_host->GetSiteInstance()->GetId(); |
842 if (!old_render_frame_host->IsRenderFrameLive()) { | 844 if (!old_render_frame_host->IsRenderFrameLive()) { |
843 ShutdownProxiesIfLastActiveFrameInSiteInstance(old_render_frame_host.get()); | 845 ShutdownProxiesIfLastActiveFrameInSiteInstance(old_render_frame_host.get()); |
844 return; | 846 return; |
845 } | 847 } |
846 | 848 |
847 // If there are no active frames besides this one, we can delete the old | 849 // If there are no active frames besides this one, we can delete the old |
848 // RenderFrameHost once it runs its unload handler, without replacing it with | 850 // RenderFrameHost once it runs its unload handler, without replacing it with |
849 // a proxy. | 851 // a proxy. |
850 size_t active_frame_count = | 852 size_t active_frame_count = |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 BrowserContext* browser_context, | 1197 BrowserContext* browser_context, |
1196 GURL dest_url, | 1198 GURL dest_url, |
1197 bool related_to_current) | 1199 bool related_to_current) |
1198 : existing_site_instance(nullptr), | 1200 : existing_site_instance(nullptr), |
1199 new_is_related_to_current(related_to_current) { | 1201 new_is_related_to_current(related_to_current) { |
1200 new_site_url = SiteInstance::GetSiteForURL(browser_context, dest_url); | 1202 new_site_url = SiteInstance::GetSiteForURL(browser_context, dest_url); |
1201 } | 1203 } |
1202 | 1204 |
1203 // static | 1205 // static |
1204 bool RenderFrameHostManager::ClearProxiesInSiteInstance( | 1206 bool RenderFrameHostManager::ClearProxiesInSiteInstance( |
1205 int32 site_instance_id, | 1207 int32_t site_instance_id, |
1206 FrameTreeNode* node) { | 1208 FrameTreeNode* node) { |
1207 RenderFrameProxyHost* proxy = | 1209 RenderFrameProxyHost* proxy = |
1208 node->render_manager()->proxy_hosts_->Get(site_instance_id); | 1210 node->render_manager()->proxy_hosts_->Get(site_instance_id); |
1209 if (proxy) { | 1211 if (proxy) { |
1210 // Delete the proxy. If it is for a main frame (and thus the RFH is stored | 1212 // Delete the proxy. If it is for a main frame (and thus the RFH is stored |
1211 // in the proxy) and it was still pending swap out, move the RFH to the | 1213 // in the proxy) and it was still pending swap out, move the RFH to the |
1212 // pending deletion list first. | 1214 // pending deletion list first. |
1213 if (node->IsMainFrame() && | 1215 if (node->IsMainFrame() && |
1214 proxy->render_frame_host() && | 1216 proxy->render_frame_host() && |
1215 proxy->render_frame_host()->rfh_state() == | 1217 proxy->render_frame_host()->rfh_state() == |
1216 RenderFrameHostImpl::STATE_PENDING_SWAP_OUT) { | 1218 RenderFrameHostImpl::STATE_PENDING_SWAP_OUT) { |
1217 DCHECK(!SiteIsolationPolicy::IsSwappedOutStateForbidden()); | 1219 DCHECK(!SiteIsolationPolicy::IsSwappedOutStateForbidden()); |
1218 scoped_ptr<RenderFrameHostImpl> swapped_out_rfh = | 1220 scoped_ptr<RenderFrameHostImpl> swapped_out_rfh = |
1219 proxy->PassFrameHostOwnership(); | 1221 proxy->PassFrameHostOwnership(); |
1220 node->render_manager()->MoveToPendingDeleteHosts(swapped_out_rfh.Pass()); | 1222 node->render_manager()->MoveToPendingDeleteHosts(swapped_out_rfh.Pass()); |
1221 } | 1223 } |
1222 node->render_manager()->proxy_hosts_->Remove(site_instance_id); | 1224 node->render_manager()->proxy_hosts_->Remove(site_instance_id); |
1223 } | 1225 } |
1224 | 1226 |
1225 return true; | 1227 return true; |
1226 } | 1228 } |
1227 | 1229 |
1228 // static. | 1230 // static. |
1229 bool RenderFrameHostManager::ResetProxiesInSiteInstance(int32 site_instance_id, | 1231 bool RenderFrameHostManager::ResetProxiesInSiteInstance( |
1230 FrameTreeNode* node) { | 1232 int32_t site_instance_id, |
| 1233 FrameTreeNode* node) { |
1231 RenderFrameProxyHost* proxy = | 1234 RenderFrameProxyHost* proxy = |
1232 node->render_manager()->proxy_hosts_->Get(site_instance_id); | 1235 node->render_manager()->proxy_hosts_->Get(site_instance_id); |
1233 if (proxy) | 1236 if (proxy) |
1234 proxy->set_render_frame_proxy_created(false); | 1237 proxy->set_render_frame_proxy_created(false); |
1235 | 1238 |
1236 return true; | 1239 return true; |
1237 } | 1240 } |
1238 | 1241 |
1239 bool RenderFrameHostManager::ShouldTransitionCrossSite() { | 1242 bool RenderFrameHostManager::ShouldTransitionCrossSite() { |
1240 // The logic below is weaker than "are all sites isolated" -- it asks instead, | 1243 // The logic below is weaker than "are all sites isolated" -- it asks instead, |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 for (FrameTreeNode* ancestor = opener->parent(); ancestor; | 1728 for (FrameTreeNode* ancestor = opener->parent(); ancestor; |
1726 ancestor = ancestor->parent()) { | 1729 ancestor = ancestor->parent()) { |
1727 RenderFrameHostImpl* ancestor_rfh = ancestor->current_frame_host(); | 1730 RenderFrameHostImpl* ancestor_rfh = ancestor->current_frame_host(); |
1728 if (ancestor_rfh->GetSiteInstance() != current_instance) | 1731 if (ancestor_rfh->GetSiteInstance() != current_instance) |
1729 CreateRenderFrameProxy(ancestor_rfh->GetSiteInstance()); | 1732 CreateRenderFrameProxy(ancestor_rfh->GetSiteInstance()); |
1730 } | 1733 } |
1731 } | 1734 } |
1732 | 1735 |
1733 scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrameHost( | 1736 scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrameHost( |
1734 SiteInstance* site_instance, | 1737 SiteInstance* site_instance, |
1735 int32 view_routing_id, | 1738 int32_t view_routing_id, |
1736 int32 frame_routing_id, | 1739 int32_t frame_routing_id, |
1737 int32 widget_routing_id, | 1740 int32_t widget_routing_id, |
1738 int flags) { | 1741 int flags) { |
1739 if (frame_routing_id == MSG_ROUTING_NONE) | 1742 if (frame_routing_id == MSG_ROUTING_NONE) |
1740 frame_routing_id = site_instance->GetProcess()->GetNextRoutingID(); | 1743 frame_routing_id = site_instance->GetProcess()->GetNextRoutingID(); |
1741 | 1744 |
1742 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); | 1745 bool swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); |
1743 bool hidden = !!(flags & CREATE_RF_HIDDEN); | 1746 bool hidden = !!(flags & CREATE_RF_HIDDEN); |
1744 | 1747 |
1745 // Create a RVH for main frames, or find the existing one for subframes. | 1748 // Create a RVH for main frames, or find the existing one for subframes. |
1746 FrameTree* frame_tree = frame_tree_node_->frame_tree(); | 1749 FrameTree* frame_tree = frame_tree_node_->frame_tree(); |
1747 RenderViewHostImpl* render_view_host = nullptr; | 1750 RenderViewHostImpl* render_view_host = nullptr; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 // RenderWidgetHostView, we need to create one if this is the main frame. | 1848 // RenderWidgetHostView, we need to create one if this is the main frame. |
1846 if (render_view_host->IsRenderViewLive() && | 1849 if (render_view_host->IsRenderViewLive() && |
1847 !render_view_host->GetWidget()->GetView() && | 1850 !render_view_host->GetWidget()->GetView() && |
1848 frame_tree_node_->IsMainFrame()) { | 1851 frame_tree_node_->IsMainFrame()) { |
1849 delegate_->CreateRenderWidgetHostViewForRenderManager(render_view_host); | 1852 delegate_->CreateRenderWidgetHostViewForRenderManager(render_view_host); |
1850 } | 1853 } |
1851 } | 1854 } |
1852 } else { | 1855 } else { |
1853 // Create a new RenderFrameHost if we don't find an existing one. | 1856 // Create a new RenderFrameHost if we don't find an existing one. |
1854 | 1857 |
1855 int32 widget_routing_id = MSG_ROUTING_NONE; | 1858 int32_t widget_routing_id = MSG_ROUTING_NONE; |
1856 | 1859 |
1857 // A RenderFrame in a different process from its parent RenderFrame | 1860 // A RenderFrame in a different process from its parent RenderFrame |
1858 // requires a RenderWidget for input/layout/painting. | 1861 // requires a RenderWidget for input/layout/painting. |
1859 if (frame_tree_node_->parent() && | 1862 if (frame_tree_node_->parent() && |
1860 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance() != | 1863 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance() != |
1861 instance) { | 1864 instance) { |
1862 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 1865 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
1863 widget_routing_id = instance->GetProcess()->GetNextRoutingID(); | 1866 widget_routing_id = instance->GetProcess()->GetNextRoutingID(); |
1864 } | 1867 } |
1865 | 1868 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 if (!render_frame_host) | 2275 if (!render_frame_host) |
2273 return; | 2276 return; |
2274 if (!RenderFrameHostImpl::IsRFHStateActive(render_frame_host->rfh_state())) | 2277 if (!RenderFrameHostImpl::IsRFHStateActive(render_frame_host->rfh_state())) |
2275 return; | 2278 return; |
2276 if (render_frame_host->GetSiteInstance()->active_frame_count() > 1U) | 2279 if (render_frame_host->GetSiteInstance()->active_frame_count() > 1U) |
2277 return; | 2280 return; |
2278 | 2281 |
2279 // After |render_frame_host| goes away, there will be no active frames left in | 2282 // After |render_frame_host| goes away, there will be no active frames left in |
2280 // its SiteInstance, so we can delete all proxies created in that SiteInstance | 2283 // its SiteInstance, so we can delete all proxies created in that SiteInstance |
2281 // on behalf of frames anywhere in the BrowsingInstance. | 2284 // on behalf of frames anywhere in the BrowsingInstance. |
2282 int32 site_instance_id = render_frame_host->GetSiteInstance()->GetId(); | 2285 int32_t site_instance_id = render_frame_host->GetSiteInstance()->GetId(); |
2283 | 2286 |
2284 // First remove any proxies for this SiteInstance from our own list. | 2287 // First remove any proxies for this SiteInstance from our own list. |
2285 ClearProxiesInSiteInstance(site_instance_id, frame_tree_node_); | 2288 ClearProxiesInSiteInstance(site_instance_id, frame_tree_node_); |
2286 | 2289 |
2287 // Use the safe RenderWidgetHost iterator for now to find all RenderViewHosts | 2290 // Use the safe RenderWidgetHost iterator for now to find all RenderViewHosts |
2288 // in the SiteInstance, then tell their respective FrameTrees to remove all | 2291 // in the SiteInstance, then tell their respective FrameTrees to remove all |
2289 // RenderFrameProxyHosts corresponding to them. | 2292 // RenderFrameProxyHosts corresponding to them. |
2290 // TODO(creis): Replace this with a RenderFrameHostIterator that protects | 2293 // TODO(creis): Replace this with a RenderFrameHostIterator that protects |
2291 // against use-after-frees if a later element is deleted before getting to it. | 2294 // against use-after-frees if a later element is deleted before getting to it. |
2292 scoped_ptr<RenderWidgetHostIterator> widgets( | 2295 scoped_ptr<RenderWidgetHostIterator> widgets( |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2679 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2682 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
2680 if (!frame_tree_node_->opener()) | 2683 if (!frame_tree_node_->opener()) |
2681 return MSG_ROUTING_NONE; | 2684 return MSG_ROUTING_NONE; |
2682 | 2685 |
2683 return frame_tree_node_->opener() | 2686 return frame_tree_node_->opener() |
2684 ->render_manager() | 2687 ->render_manager() |
2685 ->GetRoutingIdForSiteInstance(instance); | 2688 ->GetRoutingIdForSiteInstance(instance); |
2686 } | 2689 } |
2687 | 2690 |
2688 } // namespace content | 2691 } // namespace content |
OLD | NEW |