Index: content/browser/renderer_host/frame_tree_node.h |
diff --git a/content/browser/web_contents/frame_tree_node.h b/content/browser/renderer_host/frame_tree_node.h |
similarity index 71% |
rename from content/browser/web_contents/frame_tree_node.h |
rename to content/browser/renderer_host/frame_tree_node.h |
index 76d2194d5c4f09116286306a656f04b2fc2a9b7a..517ec303e8dda540391cb53bbb69cb0d49bba88b 100644 |
--- a/content/browser/web_contents/frame_tree_node.h |
+++ b/content/browser/renderer_host/frame_tree_node.h |
@@ -8,25 +8,38 @@ |
#include <string> |
#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/memory/scoped_vector.h" |
#include "content/common/content_export.h" |
#include "url/gurl.h" |
namespace content { |
+class RenderFrameHostImpl; |
+ |
// Any page that contains iframes has a tree structure of the frames in the |
// renderer process. We are mirroring this tree in the browser process. This |
// class represents a node in this tree and is a wrapper for all objects that |
// are frame-specific (as opposed to page-specific). |
class CONTENT_EXPORT FrameTreeNode { |
public: |
- FrameTreeNode(int64 frame_id, const std::string& name); |
+ static const int64 kInvalidFrameId = -1; |
+ |
+ FrameTreeNode(int64 frame_id, const std::string& name, |
+ scoped_ptr<RenderFrameHostImpl> render_frame_host); |
~FrameTreeNode(); |
- // This method takes ownership of the child pointer. |
- void AddChild(FrameTreeNode* child); |
+ void AddChild(scoped_ptr<FrameTreeNode> child); |
void RemoveChild(int64 child_id); |
+ scoped_ptr<RenderFrameHostImpl> ResetRenderFrameHost( |
Charlie Reis
2013/09/11 22:25:04
Why Reset rather than Swap or Set?
awong
2013/09/21 01:19:56
Since it destroys the children, it's not just a se
|
+ scoped_ptr<RenderFrameHostImpl> new_render_frame_host); |
+ |
+ void set_frame_id(int64 frame_id) { |
+ DCHECK_EQ(frame_id_, kInvalidFrameId); |
+ frame_id_ = frame_id; |
+ } |
+ |
int64 frame_id() const { |
return frame_id_; |
} |
@@ -51,6 +64,10 @@ class CONTENT_EXPORT FrameTreeNode { |
current_url_ = url; |
} |
+ RenderFrameHostImpl* render_frame_host() const { |
+ return render_frame_host_.get(); |
+ } |
+ |
private: |
// The unique identifier for the frame in the page. |
int64 frame_id_; |
@@ -62,6 +79,10 @@ class CONTENT_EXPORT FrameTreeNode { |
// The immediate children of this specific frame. |
ScopedVector<FrameTreeNode> children_; |
+ // The active RenderFrameHost for this frame. |
+ // TODO(ajwong): Replace with RenderFrameHostManager. |
+ scoped_ptr<RenderFrameHostImpl> render_frame_host_; |
+ |
// Track the current frame's last committed URL, so we can estimate the |
// process impact of out-of-process iframes. |
// TODO(creis): Remove this when we can store subframe URLs in the |