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

Unified Diff: content/browser/frame_host/frame_tree_node.cc

Issue 1080073004: PlzNavigate: move ownership of the NavigationRequest to the FrameTreeNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index daf4a71255d6b8a9c6f30493364f25644dd18620..da50265bf5ac55f198abd82c4a93fdb789737cda 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -71,10 +71,6 @@ FrameTreeNode::~FrameTreeNode() {
frame_tree_->FrameRemoved(this);
g_frame_tree_node_id_map.Get().erase(frame_tree_node_id_);
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableBrowserSideNavigation)) {
- navigator_->CancelNavigation(this);
- }
}
bool FrameTreeNode::IsMainFrame() const {
@@ -174,4 +170,25 @@ bool FrameTreeNode::CommitPendingSandboxFlags() {
return did_change_flags;
}
+void FrameTreeNode::SetNavigationRequest(
+ scoped_ptr<NavigationRequest> navigation_request) {
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation));
+ ResetNavigationRequest(false);
+ // TODO(clamy): perform the StartLoading logic here.
+ navigation_request_ = navigation_request.Pass();
+}
+
+void FrameTreeNode::ResetNavigationRequest(bool is_commit) {
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation));
+ // If there is an ongoing navigation, clean up any state that could have been
+ // created in the RenderFrameHostManager.
+ if (navigation_request_ && !is_commit) {
+ // TODO(clamy): perform the StopLoading logic.
nasko 2015/04/15 20:36:03 Why does it matter whether this is a commit or not
clamy 2015/04/16 12:12:30 On commit we reset the navigation request because
+ render_manager_.CleanUpNavigation();
+ }
+ navigation_request_.reset();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698