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

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

Issue 615633005: PlzNavigate: Move the navigation logic to NavigatorImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@commit-nav
Patch Set: Addressed comment 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/stl_util.h" 10 #include "base/stl_util.h"
10 #include "content/browser/frame_host/frame_tree.h" 11 #include "content/browser/frame_host/frame_tree.h"
11 #include "content/browser/frame_host/navigator.h" 12 #include "content/browser/frame_host/navigator.h"
12 #include "content/browser/frame_host/render_frame_host_impl.h" 13 #include "content/browser/frame_host/render_frame_host_impl.h"
13 #include "content/browser/renderer_host/render_view_host_impl.h" 14 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/public/common/content_switches.h"
14 16
15 namespace content { 17 namespace content {
16 18
17 int64 FrameTreeNode::next_frame_tree_node_id_ = 1; 19 int64 FrameTreeNode::next_frame_tree_node_id_ = 1;
18 20
19 FrameTreeNode::FrameTreeNode(FrameTree* frame_tree, 21 FrameTreeNode::FrameTreeNode(FrameTree* frame_tree,
20 Navigator* navigator, 22 Navigator* navigator,
21 RenderFrameHostDelegate* render_frame_delegate, 23 RenderFrameHostDelegate* render_frame_delegate,
22 RenderViewHostDelegate* render_view_delegate, 24 RenderViewHostDelegate* render_view_delegate,
23 RenderWidgetHostDelegate* render_widget_delegate, 25 RenderWidgetHostDelegate* render_widget_delegate,
24 RenderFrameHostManager::Delegate* manager_delegate, 26 RenderFrameHostManager::Delegate* manager_delegate,
25 const std::string& name) 27 const std::string& name)
26 : frame_tree_(frame_tree), 28 : frame_tree_(frame_tree),
27 navigator_(navigator), 29 navigator_(navigator),
28 render_manager_(this, 30 render_manager_(this,
29 render_frame_delegate, 31 render_frame_delegate,
30 render_view_delegate, 32 render_view_delegate,
31 render_widget_delegate, 33 render_widget_delegate,
32 manager_delegate), 34 manager_delegate),
33 frame_tree_node_id_(next_frame_tree_node_id_++), 35 frame_tree_node_id_(next_frame_tree_node_id_++),
34 frame_name_(name), 36 frame_name_(name),
35 parent_(NULL) {} 37 parent_(NULL) {}
36 38
37 FrameTreeNode::~FrameTreeNode() { 39 FrameTreeNode::~FrameTreeNode() {
40 if (CommandLine::ForCurrentProcess()->HasSwitch(
41 switches::kEnableBrowserSideNavigation)) {
42 navigator_->CancelNavigation(this);
43 }
38 } 44 }
39 45
40 bool FrameTreeNode::IsMainFrame() const { 46 bool FrameTreeNode::IsMainFrame() const {
41 return frame_tree_->root() == this; 47 return frame_tree_->root() == this;
42 } 48 }
43 49
44 void FrameTreeNode::AddChild(scoped_ptr<FrameTreeNode> child, 50 void FrameTreeNode::AddChild(scoped_ptr<FrameTreeNode> child,
45 int frame_routing_id) { 51 int frame_routing_id) {
46 // Initialize the RenderFrameHost for the new node. We always create child 52 // Initialize the RenderFrameHost for the new node. We always create child
47 // frames in the same SiteInstance as the current frame, and they can swap to 53 // frames in the same SiteInstance as the current frame, and they can swap to
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 current_frame_host()->set_render_frame_created(false); 86 current_frame_host()->set_render_frame_created(false);
81 87
82 // The children may not have been cleared if a cross-process navigation 88 // The children may not have been cleared if a cross-process navigation
83 // commits before the old process cleans everything up. Make sure the child 89 // commits before the old process cleans everything up. Make sure the child
84 // nodes get deleted before swapping to a new process. 90 // nodes get deleted before swapping to a new process.
85 ScopedVector<FrameTreeNode> old_children = children_.Pass(); 91 ScopedVector<FrameTreeNode> old_children = children_.Pass();
86 old_children.clear(); // May notify observers. 92 old_children.clear(); // May notify observers.
87 } 93 }
88 94
89 } // namespace content 95 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698