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 #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/render_frame_host_impl.h" | 14 #include "content/browser/frame_host/render_frame_host_impl.h" |
15 #include "content/browser/frame_host/render_frame_host_manager.h" | 15 #include "content/browser/frame_host/render_frame_host_manager.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/frame_replication_state.h" | 17 #include "content/common/frame_replication_state.h" |
18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
19 #include "url/origin.h" | 19 #include "url/origin.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class FrameTree; | 23 class FrameTree; |
24 class NavigationRequest; | |
24 class Navigator; | 25 class Navigator; |
25 class RenderFrameHostImpl; | 26 class RenderFrameHostImpl; |
26 | 27 |
27 // When a page contains iframes, its renderer process maintains a tree structure | 28 // When a page contains iframes, its renderer process maintains a tree structure |
28 // of those frames. We are mirroring this tree in the browser process. This | 29 // of those frames. We are mirroring this tree in the browser process. This |
29 // class represents a node in this tree and is a wrapper for all objects that | 30 // class represents a node in this tree and is a wrapper for all objects that |
30 // are frame-specific (as opposed to page-specific). | 31 // are frame-specific (as opposed to page-specific). |
31 class CONTENT_EXPORT FrameTreeNode { | 32 class CONTENT_EXPORT FrameTreeNode { |
32 public: | 33 public: |
33 // These values indicate the loading progress status. The minimum progress | 34 // These values indicate the loading progress status. The minimum progress |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | |
Fabrice (no longer in Chrome)
2015/04/16 14:01:27
nit: s/Reset/Resets/
clamy
2015/04/16 16:14:05
Done.
| |
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 Loading... | |
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 an ongoing NavigationRequest until it is ready to commit. It will then | |
215 // be reset and the navigation will be owned by a RenderFrameHost. | |
nasko
2015/04/16 16:02:34
nit: s/navigation/NavigationRequest/. A navigation
clamy
2015/04/16 16:14:05
I've rephrased it. We cannot use NavigationRequest
| |
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_ |
OLD | NEW |