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/frame_tree.h" | 5 #include "content/browser/frame_host/frame_tree.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 NOTREACHED() << "Unexpected RemoveFrame call for main frame."; | 245 NOTREACHED() << "Unexpected RemoveFrame call for main frame."; |
246 return; | 246 return; |
247 } | 247 } |
248 | 248 |
249 parent->RemoveChild(child); | 249 parent->RemoveChild(child); |
250 } | 250 } |
251 | 251 |
252 void FrameTree::CreateProxiesForSiteInstance( | 252 void FrameTree::CreateProxiesForSiteInstance( |
253 FrameTreeNode* source, | 253 FrameTreeNode* source, |
254 SiteInstance* site_instance) { | 254 SiteInstance* site_instance) { |
255 // Create the swapped out RVH for the new SiteInstance. This will create | 255 // Create the RenderFrameProxyHost for the new SiteInstance. |
256 // a top-level swapped out RFH as well, which will then be wrapped by a | |
257 // RenderFrameProxyHost. | |
258 if (!source || !source->IsMainFrame()) { | 256 if (!source || !source->IsMainFrame()) { |
259 RenderViewHostImpl* render_view_host = GetRenderViewHost(site_instance); | 257 RenderViewHostImpl* render_view_host = GetRenderViewHost(site_instance); |
260 if (!render_view_host) { | 258 if (!render_view_host) { |
261 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | 259 root()->render_manager()->CreateRenderFrameProxy(site_instance); |
262 root()->render_manager()->CreateRenderFrameProxy(site_instance); | |
263 } else { | |
264 root()->render_manager()->CreateRenderFrame( | |
265 site_instance, CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN, nullptr); | |
266 } | |
267 } else { | 260 } else { |
268 root()->render_manager()->EnsureRenderViewInitialized(render_view_host, | 261 root()->render_manager()->EnsureRenderViewInitialized(render_view_host, |
269 site_instance); | 262 site_instance); |
270 } | 263 } |
271 } | 264 } |
272 | 265 |
273 // Proxies are created in the FrameTree in response to a node navigating to a | 266 // Proxies are created in the FrameTree in response to a node navigating to a |
274 // new SiteInstance. Since |source|'s navigation will replace the currently | 267 // new SiteInstance. Since |source|'s navigation will replace the currently |
275 // loaded document, the entire subtree under |source| will be removed. | 268 // loaded document, the entire subtree under |source| will be removed. |
276 for (FrameTreeNode* node : NodesExcept(source)) { | 269 for (FrameTreeNode* node : NodesExcept(source)) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // This is only used to set page-level focus in cross-process subframes, and | 496 // This is only used to set page-level focus in cross-process subframes, and |
504 // requests to set focus in main frame's SiteInstance are ignored. | 497 // requests to set focus in main frame's SiteInstance are ignored. |
505 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { | 498 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { |
506 RenderFrameProxyHost* proxy = | 499 RenderFrameProxyHost* proxy = |
507 root_manager->GetRenderFrameProxyHost(instance); | 500 root_manager->GetRenderFrameProxyHost(instance); |
508 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); | 501 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); |
509 } | 502 } |
510 } | 503 } |
511 | 504 |
512 } // namespace content | 505 } // namespace content |
OLD | NEW |