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 swapped out RVH for the new SiteInstance. This will create |
Charlie Reis
2016/03/11 21:56:56
Stale comment.
nasko
2016/03/11 22:35:33
Done.
| |
256 // a top-level swapped out RFH as well, which will then be wrapped by a | 256 // a top-level swapped out RFH as well, which will then be wrapped by a |
257 // RenderFrameProxyHost. | 257 // RenderFrameProxyHost. |
258 if (!source || !source->IsMainFrame()) { | 258 if (!source || !source->IsMainFrame()) { |
259 RenderViewHostImpl* render_view_host = GetRenderViewHost(site_instance); | 259 RenderViewHostImpl* render_view_host = GetRenderViewHost(site_instance); |
260 if (!render_view_host) { | 260 if (!render_view_host) { |
261 if (SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | 261 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 { | 262 } else { |
268 root()->render_manager()->EnsureRenderViewInitialized(render_view_host, | 263 root()->render_manager()->EnsureRenderViewInitialized(render_view_host, |
269 site_instance); | 264 site_instance); |
270 } | 265 } |
271 } | 266 } |
272 | 267 |
273 // Proxies are created in the FrameTree in response to a node navigating to a | 268 // 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 | 269 // new SiteInstance. Since |source|'s navigation will replace the currently |
275 // loaded document, the entire subtree under |source| will be removed. | 270 // loaded document, the entire subtree under |source| will be removed. |
276 for (FrameTreeNode* node : NodesExcept(source)) { | 271 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 | 498 // 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. | 499 // requests to set focus in main frame's SiteInstance are ignored. |
505 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { | 500 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { |
506 RenderFrameProxyHost* proxy = | 501 RenderFrameProxyHost* proxy = |
507 root_manager->GetRenderFrameProxyHost(instance); | 502 root_manager->GetRenderFrameProxyHost(instance); |
508 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); | 503 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); |
509 } | 504 } |
510 } | 505 } |
511 | 506 |
512 } // namespace content | 507 } // namespace content |
OLD | NEW |