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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 render_manager_(this, | 30 render_manager_(this, |
31 render_frame_delegate, | 31 render_frame_delegate, |
32 render_view_delegate, | 32 render_view_delegate, |
33 render_widget_delegate, | 33 render_widget_delegate, |
34 manager_delegate), | 34 manager_delegate), |
35 frame_tree_node_id_(next_frame_tree_node_id_++), | 35 frame_tree_node_id_(next_frame_tree_node_id_++), |
36 frame_name_(name), | 36 frame_name_(name), |
37 parent_(NULL) {} | 37 parent_(NULL) {} |
38 | 38 |
39 FrameTreeNode::~FrameTreeNode() { | 39 FrameTreeNode::~FrameTreeNode() { |
40 if (CommandLine::ForCurrentProcess()->HasSwitch( | 40 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
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 process_id, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 current_frame_host()->set_render_frame_created(false); | 90 current_frame_host()->set_render_frame_created(false); |
91 | 91 |
92 // 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 |
93 // 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 |
94 // nodes get deleted before swapping to a new process. | 94 // nodes get deleted before swapping to a new process. |
95 ScopedVector<FrameTreeNode> old_children = children_.Pass(); | 95 ScopedVector<FrameTreeNode> old_children = children_.Pass(); |
96 old_children.clear(); // May notify observers. | 96 old_children.clear(); // May notify observers. |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |