Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: content/browser/frame_host/frame_tree_node.cc

Issue 642813007: Drop CreateChildFrame messages when swapping out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of fixes. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 30 matching lines...) Expand all
41 switches::kEnableBrowserSideNavigation)) { 41 switches::kEnableBrowserSideNavigation)) {
42 navigator_->CancelNavigation(this); 42 navigator_->CancelNavigation(this);
43 } 43 }
44 } 44 }
45 45
46 bool FrameTreeNode::IsMainFrame() const { 46 bool FrameTreeNode::IsMainFrame() const {
47 return frame_tree_->root() == this; 47 return frame_tree_->root() == this;
48 } 48 }
49 49
50 void FrameTreeNode::AddChild(scoped_ptr<FrameTreeNode> child, 50 void FrameTreeNode::AddChild(scoped_ptr<FrameTreeNode> child,
51 int process_id,
51 int frame_routing_id) { 52 int frame_routing_id) {
53 // Child frame must always be created in the same process as the parent.
54 CHECK_EQ(process_id, render_manager_.current_host()->GetProcess()->GetID());
55
52 // Initialize the RenderFrameHost for the new node. We always create child 56 // Initialize the RenderFrameHost for the new node. We always create child
53 // frames in the same SiteInstance as the current frame, and they can swap to 57 // frames in the same SiteInstance as the current frame, and they can swap to
54 // a different one if they navigate away. 58 // a different one if they navigate away.
55 child->render_manager()->Init( 59 child->render_manager()->Init(
56 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(), 60 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(),
57 render_manager_.current_host()->GetSiteInstance(), 61 render_manager_.current_host()->GetSiteInstance(),
58 render_manager_.current_host()->GetRoutingID(), 62 render_manager_.current_host()->GetRoutingID(),
59 frame_routing_id); 63 frame_routing_id);
60 child->set_parent(this); 64 child->set_parent(this);
61 children_.push_back(child.release()); 65 children_.push_back(child.release());
(...skipping 24 matching lines...) Expand all
86 current_frame_host()->set_render_frame_created(false); 90 current_frame_host()->set_render_frame_created(false);
87 91
88 // The children may not have been cleared if a cross-process navigation 92 // The children may not have been cleared if a cross-process navigation
89 // commits before the old process cleans everything up. Make sure the child 93 // commits before the old process cleans everything up. Make sure the child
90 // nodes get deleted before swapping to a new process. 94 // nodes get deleted before swapping to a new process.
91 ScopedVector<FrameTreeNode> old_children = children_.Pass(); 95 ScopedVector<FrameTreeNode> old_children = children_.Pass();
92 old_children.clear(); // May notify observers. 96 old_children.clear(); // May notify observers.
93 } 97 }
94 98
95 } // namespace content 99 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/frame_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698