Index: content/browser/frame_host/navigation_entry_impl.h |
diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h |
index 646a0fb5223010a87eacedc69406ccbac7a0fe10..a5ce6fcf9f11657bf8155682a84d3f81c8953156 100644 |
--- a/content/browser/frame_host/navigation_entry_impl.h |
+++ b/content/browser/frame_host/navigation_entry_impl.h |
@@ -28,8 +28,8 @@ class CONTENT_EXPORT NavigationEntryImpl |
: public NON_EXPORTED_BASE(NavigationEntry) { |
public: |
// Represents a tree of FrameNavigationEntries that make up this joint session |
- // history item. The tree currently only tracks the main frame. |
- // TODO(creis): Populate the tree with subframe entries in --site-per-process. |
+ // history item. The tree currently only tracks the main frame by default, |
+ // and is populated with subframe nodes in --site-per-process mode. |
struct TreeNode { |
TreeNode(FrameNavigationEntry* frame_entry); |
~TreeNode(); |
@@ -37,12 +37,16 @@ class CONTENT_EXPORT NavigationEntryImpl |
// Returns whether this TreeNode corresponds to |frame_tree_node|. |
bool MatchesFrame(FrameTreeNode* frame_tree_node) const; |
- // Returns a deep copy of the tree with copies of each node's |
- // FrameNavigationEntries. We do not yet share FrameNavigationEntries |
- // across trees. |
+ // Recursively makes a deep copy of TreeNode with copies of each of the |
+ // FrameNavigationEntries in the subtree. Replaces the TreeNode |
+ // corresponding to |frame_tree_node| (and all of its children) with a new |
+ // TreeNode for |frame_navigation_entry|. Pass nullptr for both parameters |
+ // to make a complete clone. |
// TODO(creis): For --site-per-process, share FrameNavigationEntries between |
// NavigationEntries of the same tab. |
- TreeNode* Clone() const; |
+ scoped_ptr<TreeNode> CloneAndReplace( |
+ FrameTreeNode* frame_tree_node, |
+ FrameNavigationEntry* frame_navigation_entry) const; |
// Ref counted pointer that keeps the FrameNavigationEntry alive as long as |
// it is needed by this node's NavigationEntry. |
@@ -124,11 +128,16 @@ class CONTENT_EXPORT NavigationEntryImpl |
// Creates a copy of this NavigationEntryImpl that can be modified |
// independently from the original. Does not copy any value that would be |
// cleared in ResetForCommit. |
+ NavigationEntryImpl* Clone() const; |
+ |
+ // Like |Clone|, but replaces the FrameNavigationEntry corresponding to |
+ // |frame_tree_node| (and all its children) with |frame_entry|. |
// TODO(creis): Once we start sharing FrameNavigationEntries between |
// NavigationEntryImpls, we will need to support two versions of Clone: one |
// that shares the existing FrameNavigationEntries (for use within the same |
// tab) and one that draws them from a different pool (for use in a new tab). |
- NavigationEntryImpl* Clone() const; |
+ NavigationEntryImpl* CloneAndReplace(FrameTreeNode* frame_tree_node, |
+ FrameNavigationEntry* frame_entry) const; |
// Helper functions to construct NavigationParameters for a navigation to this |
// NavigationEntry. |