Chromium Code Reviews| 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 "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 #include "url/origin.h" | |
| 18 | 20 |
| 19 namespace content { | 21 namespace content { |
| 20 | 22 |
| 21 class FrameTree; | 23 class FrameTree; |
| 22 class Navigator; | 24 class Navigator; |
| 23 class RenderFrameHostImpl; | 25 class RenderFrameHostImpl; |
| 24 | 26 |
| 25 // When a page contains iframes, its renderer process maintains a tree structure | 27 // When a page contains iframes, its renderer process maintains a tree structure |
| 26 // of those frames. We are mirroring this tree in the browser process. This | 28 // of those frames. We are mirroring this tree in the browser process. This |
| 27 // class represents a node in this tree and is a wrapper for all objects that | 29 // class represents a node in this tree and is a wrapper for all objects that |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 42 bool IsMainFrame() const; | 44 bool IsMainFrame() const; |
| 43 | 45 |
| 44 void AddChild(scoped_ptr<FrameTreeNode> child, | 46 void AddChild(scoped_ptr<FrameTreeNode> child, |
| 45 int process_id, | 47 int process_id, |
| 46 int frame_routing_id); | 48 int frame_routing_id); |
| 47 void RemoveChild(FrameTreeNode* child); | 49 void RemoveChild(FrameTreeNode* child); |
| 48 | 50 |
| 49 // Clears process specific-state in this node to prepare for a new process. | 51 // Clears process specific-state in this node to prepare for a new process. |
| 50 void ResetForNewProcess(); | 52 void ResetForNewProcess(); |
| 51 | 53 |
| 54 void SetOriginFromURL(const GURL& url); | |
|
Charlie Reis
2014/11/13 18:00:57
Perhaps this should be private and called from Set
alexmos
2014/11/18 18:25:32
This function isn't necessary anymore with the new
| |
| 55 | |
| 52 FrameTree* frame_tree() const { | 56 FrameTree* frame_tree() const { |
| 53 return frame_tree_; | 57 return frame_tree_; |
| 54 } | 58 } |
| 55 | 59 |
| 56 Navigator* navigator() { | 60 Navigator* navigator() { |
| 57 return navigator_.get(); | 61 return navigator_.get(); |
| 58 } | 62 } |
| 59 | 63 |
| 60 RenderFrameHostManager* render_manager() { | 64 RenderFrameHostManager* render_manager() { |
| 61 return &render_manager_; | 65 return &render_manager_; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 80 } | 84 } |
| 81 | 85 |
| 82 const GURL& current_url() const { | 86 const GURL& current_url() const { |
| 83 return current_url_; | 87 return current_url_; |
| 84 } | 88 } |
| 85 | 89 |
| 86 void set_current_url(const GURL& url) { | 90 void set_current_url(const GURL& url) { |
| 87 current_url_ = url; | 91 current_url_ = url; |
| 88 } | 92 } |
| 89 | 93 |
| 94 const FrameReplicationState& current_replication_state() const { | |
| 95 return replication_state_; | |
| 96 } | |
| 97 | |
| 90 RenderFrameHostImpl* current_frame_host() const { | 98 RenderFrameHostImpl* current_frame_host() const { |
| 91 return render_manager_.current_frame_host(); | 99 return render_manager_.current_frame_host(); |
| 92 } | 100 } |
| 93 | 101 |
| 94 private: | 102 private: |
| 95 void set_parent(FrameTreeNode* parent) { parent_ = parent; } | 103 void set_parent(FrameTreeNode* parent) { parent_ = parent; } |
| 96 | 104 |
| 97 // The next available browser-global FrameTreeNode ID. | 105 // The next available browser-global FrameTreeNode ID. |
| 98 static int64 next_frame_tree_node_id_; | 106 static int64 next_frame_tree_node_id_; |
| 99 | 107 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 124 | 132 |
| 125 // The immediate children of this specific frame. | 133 // The immediate children of this specific frame. |
| 126 ScopedVector<FrameTreeNode> children_; | 134 ScopedVector<FrameTreeNode> children_; |
| 127 | 135 |
| 128 // Track the current frame's last committed URL, so we can estimate the | 136 // Track the current frame's last committed URL, so we can estimate the |
| 129 // process impact of out-of-process iframes. | 137 // process impact of out-of-process iframes. |
| 130 // TODO(creis): Remove this when we can store subframe URLs in the | 138 // TODO(creis): Remove this when we can store subframe URLs in the |
| 131 // NavigationController. | 139 // NavigationController. |
| 132 GURL current_url_; | 140 GURL current_url_; |
| 133 | 141 |
| 142 // Track information that needs to be replicated to processes that are | |
| 143 // rendering this frame remotely. | |
|
Charlie Reis
2014/11/13 18:00:57
are rendering this frame remotely -> have proxies
alexmos
2014/11/18 18:25:32
Done.
| |
| 144 FrameReplicationState replication_state_; | |
| 145 | |
| 134 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 146 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
| 135 }; | 147 }; |
| 136 | 148 |
| 137 } // namespace content | 149 } // namespace content |
| 138 | 150 |
| 139 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 151 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
| OLD | NEW |