| 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_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void FrameTreeNode::AddChild(scoped_ptr<FrameTreeNode> child, | 124 void FrameTreeNode::AddChild(scoped_ptr<FrameTreeNode> child, |
| 125 int process_id, | 125 int process_id, |
| 126 int frame_routing_id) { | 126 int frame_routing_id) { |
| 127 // Child frame must always be created in the same process as the parent. | 127 // Child frame must always be created in the same process as the parent. |
| 128 CHECK_EQ(process_id, render_manager_.current_host()->GetProcess()->GetID()); | 128 CHECK_EQ(process_id, render_manager_.current_host()->GetProcess()->GetID()); |
| 129 | 129 |
| 130 // Initialize the RenderFrameHost for the new node. We always create child | 130 // Initialize the RenderFrameHost for the new node. We always create child |
| 131 // frames in the same SiteInstance as the current frame, and they can swap to | 131 // frames in the same SiteInstance as the current frame, and they can swap to |
| 132 // a different one if they navigate away. | 132 // a different one if they navigate away. |
| 133 child->render_manager()->Init( | 133 child->render_manager()->Init( |
| 134 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(), | |
| 135 render_manager_.current_host()->GetSiteInstance(), | 134 render_manager_.current_host()->GetSiteInstance(), |
| 136 render_manager_.current_host()->GetRoutingID(), frame_routing_id, | 135 render_manager_.current_host()->GetRoutingID(), frame_routing_id, |
| 137 MSG_ROUTING_NONE, 0 /* surface_id */); | 136 MSG_ROUTING_NONE, 0 /* surface_id */); |
| 138 child->set_parent(this); | 137 child->set_parent(this); |
| 139 | 138 |
| 140 // Other renderer processes in this BrowsingInstance may need to find out | 139 // Other renderer processes in this BrowsingInstance may need to find out |
| 141 // about the new frame. Create a proxy for the child frame in all | 140 // about the new frame. Create a proxy for the child frame in all |
| 142 // SiteInstances that have a proxy for the frame's parent, since all frames | 141 // SiteInstances that have a proxy for the frame's parent, since all frames |
| 143 // in a frame tree should have the same set of proxies. | 142 // in a frame tree should have the same set of proxies. |
| 144 // TODO(alexmos, nick): We ought to do this for non-oopif too, for openers. | 143 // TODO(alexmos, nick): We ought to do this for non-oopif too, for openers. |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // TODO(nasko): see if child frames should send IPCs in site-per-process | 377 // TODO(nasko): see if child frames should send IPCs in site-per-process |
| 379 // mode. | 378 // mode. |
| 380 if (!IsMainFrame()) | 379 if (!IsMainFrame()) |
| 381 return true; | 380 return true; |
| 382 | 381 |
| 383 render_manager_.Stop(); | 382 render_manager_.Stop(); |
| 384 return true; | 383 return true; |
| 385 } | 384 } |
| 386 | 385 |
| 387 } // namespace content | 386 } // namespace content |
| OLD | NEW |