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

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

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 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 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/scoped_vector.h" 13 #include "base/memory/scoped_vector.h"
14 #include "content/browser/frame_host/navigation_request.h"
Fabrice (no longer in Chrome) 2015/04/15 12:44:50 nit: I think we can forward-declare here. We are a
clamy 2015/04/16 12:12:30 Done.
14 #include "content/browser/frame_host/render_frame_host_impl.h" 15 #include "content/browser/frame_host/render_frame_host_impl.h"
15 #include "content/browser/frame_host/render_frame_host_manager.h" 16 #include "content/browser/frame_host/render_frame_host_manager.h"
16 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
17 #include "content/common/frame_replication_state.h" 18 #include "content/common/frame_replication_state.h"
18 #include "url/gurl.h" 19 #include "url/gurl.h"
19 #include "url/origin.h" 20 #include "url/origin.h"
20 21
21 namespace content { 22 namespace content {
22 23
23 class FrameTree; 24 class FrameTree;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 bool IsLoading() const; 136 bool IsLoading() const;
136 137
137 // Sets this node's loading progress (from 0 to 1). 138 // Sets this node's loading progress (from 0 to 1).
138 void set_loading_progress(double loading_progress) { 139 void set_loading_progress(double loading_progress) {
139 loading_progress_ = loading_progress; 140 loading_progress_ = loading_progress;
140 } 141 }
141 142
142 // Returns this node's loading progress. 143 // Returns this node's loading progress.
143 double loading_progress() const { return loading_progress_; } 144 double loading_progress() const { return loading_progress_; }
144 145
146 NavigationRequest* navigation_request() { return navigation_request_.get(); }
147
148 // PlzNavigate
149 // Takes ownership of |navigation_request| and makes it the current
150 // NavigationRequest of this frame. This corresponds to the start of a new
151 // navigation. If there was an ongoing navigation request before calling this
152 // function, it is canceled. |navigation_request| should not be null.
153 void SetNavigationRequest(scoped_ptr<NavigationRequest> navigation_request);
154
155 // PlzNavigate
156 // Reset the current navigation request. |is_commit| is true if the reset is
157 // due to the commit of the navigation.
158 void ResetNavigationRequest(bool is_commit);
159
145 private: 160 private:
146 void set_parent(FrameTreeNode* parent) { parent_ = parent; } 161 void set_parent(FrameTreeNode* parent) { parent_ = parent; }
147 162
148 // The next available browser-global FrameTreeNode ID. 163 // The next available browser-global FrameTreeNode ID.
149 static int64 next_frame_tree_node_id_; 164 static int64 next_frame_tree_node_id_;
150 165
151 // The FrameTree that owns us. 166 // The FrameTree that owns us.
152 FrameTree* frame_tree_; // not owned. 167 FrameTree* frame_tree_; // not owned.
153 168
154 // The Navigator object responsible for managing navigations at this node 169 // The Navigator object responsible for managing navigations at this node
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // update only takes effect on the next frame navigation, so the effective 203 // update only takes effect on the next frame navigation, so the effective
189 // sandbox flags are tracked separately here. When enforcing sandbox flags 204 // sandbox flags are tracked separately here. When enforcing sandbox flags
190 // directives in the browser process, |effective_sandbox_flags_| should be 205 // directives in the browser process, |effective_sandbox_flags_| should be
191 // used. |effective_sandbox_flags_| is updated with any pending sandbox 206 // used. |effective_sandbox_flags_| is updated with any pending sandbox
192 // flags when a navigation for this frame commits. 207 // flags when a navigation for this frame commits.
193 SandboxFlags effective_sandbox_flags_; 208 SandboxFlags effective_sandbox_flags_;
194 209
195 // Used to track this node's loading progress (from 0 to 1). 210 // Used to track this node's loading progress (from 0 to 1).
196 double loading_progress_; 211 double loading_progress_;
197 212
213 // PlzNavigate
214 // Owns a navigation happening in this node until it is ready to commit (it
nasko 2015/04/15 20:36:04 nit: s/a navigation happening/ongoing NavigationRe
clamy 2015/04/16 12:12:30 Done.
215 // will then be owned by the current RenderFrameHost).
nasko 2015/04/15 20:36:04 nit: It might not be the current RFH, but the spec
clamy 2015/04/16 12:12:30 Done. I've also modified the comment to clarify th
216 scoped_ptr<NavigationRequest> navigation_request_;
217
198 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); 218 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
199 }; 219 };
200 220
201 } // namespace content 221 } // namespace content
202 222
203 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 223 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/frame_tree_node.cc » ('j') | content/browser/frame_host/frame_tree_node.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698