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 "third_party/WebKit/public/web/WebFrameOwnerProperties.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; |
24 class NavigationRequest; | 25 class NavigationRequest; |
25 class Navigator; | 26 class Navigator; |
26 class RenderFrameHostImpl; | 27 class RenderFrameHostImpl; |
27 | 28 |
(...skipping 18 matching lines...) Expand all Loading... | |
46 static FrameTreeNode* GloballyFindByID(int frame_tree_node_id); | 47 static FrameTreeNode* GloballyFindByID(int frame_tree_node_id); |
47 | 48 |
48 FrameTreeNode(FrameTree* frame_tree, | 49 FrameTreeNode(FrameTree* frame_tree, |
49 Navigator* navigator, | 50 Navigator* navigator, |
50 RenderFrameHostDelegate* render_frame_delegate, | 51 RenderFrameHostDelegate* render_frame_delegate, |
51 RenderViewHostDelegate* render_view_delegate, | 52 RenderViewHostDelegate* render_view_delegate, |
52 RenderWidgetHostDelegate* render_widget_delegate, | 53 RenderWidgetHostDelegate* render_widget_delegate, |
53 RenderFrameHostManager::Delegate* manager_delegate, | 54 RenderFrameHostManager::Delegate* manager_delegate, |
54 blink::WebTreeScopeType scope, | 55 blink::WebTreeScopeType scope, |
55 const std::string& name, | 56 const std::string& name, |
56 blink::WebSandboxFlags sandbox_flags); | 57 blink::WebSandboxFlags sandbox_flags, |
58 const blink::WebFrameOwnerProperties& frame_owner_properties); | |
57 | 59 |
58 ~FrameTreeNode(); | 60 ~FrameTreeNode(); |
59 | 61 |
60 void AddObserver(Observer* observer); | 62 void AddObserver(Observer* observer); |
61 void RemoveObserver(Observer* observer); | 63 void RemoveObserver(Observer* observer); |
62 | 64 |
63 bool IsMainFrame() const; | 65 bool IsMainFrame() const; |
64 | 66 |
65 void AddChild(scoped_ptr<FrameTreeNode> child, | 67 void AddChild(scoped_ptr<FrameTreeNode> child, |
66 int process_id, | 68 int process_id, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 | 142 |
141 bool HasSameOrigin(const FrameTreeNode& node) const { | 143 bool HasSameOrigin(const FrameTreeNode& node) const { |
142 return replication_state_.origin.IsSameOriginWith( | 144 return replication_state_.origin.IsSameOriginWith( |
143 node.replication_state_.origin); | 145 node.replication_state_.origin); |
144 } | 146 } |
145 | 147 |
146 const FrameReplicationState& current_replication_state() const { | 148 const FrameReplicationState& current_replication_state() const { |
147 return replication_state_; | 149 return replication_state_; |
148 } | 150 } |
149 | 151 |
152 const blink::WebFrameOwnerProperties& frame_owner_properties() { | |
153 return frame_owner_properties_; | |
154 } | |
155 | |
156 void set_frame_owner_properties( | |
157 const blink::WebFrameOwnerProperties& frame_owner_properties) { | |
158 frame_owner_properties_ = frame_owner_properties; | |
159 } | |
160 | |
150 RenderFrameHostImpl* current_frame_host() const { | 161 RenderFrameHostImpl* current_frame_host() const { |
151 return render_manager_.current_frame_host(); | 162 return render_manager_.current_frame_host(); |
152 } | 163 } |
153 | 164 |
154 bool IsDescendantOf(FrameTreeNode* other) const; | 165 bool IsDescendantOf(FrameTreeNode* other) const; |
155 | 166 |
156 // Return the node immediately preceding this node in its parent's | 167 // Return the node immediately preceding this node in its parent's |
157 // |children_|, or nullptr if there is no such node. | 168 // |children_|, or nullptr if there is no such node. |
158 FrameTreeNode* PreviousSibling() const; | 169 FrameTreeNode* PreviousSibling() const; |
159 | 170 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 // Track the effective sandbox flags for this frame. When a parent frame | 280 // Track the effective sandbox flags for this frame. When a parent frame |
270 // dynamically updates sandbox flags for a child frame, the child's updated | 281 // dynamically updates sandbox flags for a child frame, the child's updated |
271 // sandbox flags are stored in replication_state_.sandbox_flags. However, the | 282 // sandbox flags are stored in replication_state_.sandbox_flags. However, the |
272 // update only takes effect on the next frame navigation, so the effective | 283 // update only takes effect on the next frame navigation, so the effective |
273 // sandbox flags are tracked separately here. When enforcing sandbox flags | 284 // sandbox flags are tracked separately here. When enforcing sandbox flags |
274 // directives in the browser process, |effective_sandbox_flags_| should be | 285 // directives in the browser process, |effective_sandbox_flags_| should be |
275 // used. |effective_sandbox_flags_| is updated with any pending sandbox | 286 // used. |effective_sandbox_flags_| is updated with any pending sandbox |
276 // flags when a navigation for this frame commits. | 287 // flags when a navigation for this frame commits. |
277 blink::WebSandboxFlags effective_sandbox_flags_; | 288 blink::WebSandboxFlags effective_sandbox_flags_; |
278 | 289 |
290 // Tracks the scrolling and margin properties for this frame. These | |
291 // properties affect the child renderer but are stored on its parent's | |
292 // frame element. When this frame's parent dynamically updates these | |
293 // properties, we store them here. | |
alexmos
2015/10/02 21:24:19
nit: last sentence makes it sound like the propert
lazyboy
2015/10/05 22:16:08
Changed "store" to "update".
| |
294 // | |
295 // Note that the update only takes effect on the next frame navigation, | |
alexmos
2015/10/02 21:24:19
nit: s/the update/dynamic updates/, s/takes/take/.
lazyboy
2015/10/05 22:16:08
Done.
| |
296 // to be consistent with current Blink implementation. | |
297 blink::WebFrameOwnerProperties frame_owner_properties_; | |
298 | |
279 // Used to track this node's loading progress (from 0 to 1). | 299 // Used to track this node's loading progress (from 0 to 1). |
280 double loading_progress_; | 300 double loading_progress_; |
281 | 301 |
282 // PlzNavigate | 302 // PlzNavigate |
283 // Owns an ongoing NavigationRequest until it is ready to commit. It will then | 303 // Owns an ongoing NavigationRequest until it is ready to commit. It will then |
284 // be reset and a RenderFrameHost will be responsible for the navigation. | 304 // be reset and a RenderFrameHost will be responsible for the navigation. |
285 scoped_ptr<NavigationRequest> navigation_request_; | 305 scoped_ptr<NavigationRequest> navigation_request_; |
286 | 306 |
287 // List of objects observing this FrameTreeNode. | 307 // List of objects observing this FrameTreeNode. |
288 base::ObserverList<Observer> observers_; | 308 base::ObserverList<Observer> observers_; |
289 | 309 |
290 base::TimeTicks last_focus_time_; | 310 base::TimeTicks last_focus_time_; |
291 | 311 |
292 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 312 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
293 }; | 313 }; |
294 | 314 |
295 } // namespace content | 315 } // namespace content |
296 | 316 |
297 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 317 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
OLD | NEW |