Chromium Code Reviews| 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 8c3fbb5226c8a053583cf98c3ed0cec68ab707fc..6fd931a349e888678cdc45f677b630abf9810cba 100644 |
| --- a/content/browser/frame_host/navigation_entry_impl.h |
| +++ b/content/browser/frame_host/navigation_entry_impl.h |
| @@ -28,18 +28,25 @@ 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(); |
| + // 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. |
| + // FrameNavigationEntries. 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 for a complete clone. |
|
Avi (use Gerrit)
2015/05/19 16:34:13
I'm pondering this comment.
1. "with copies of ea
Charlie Reis
2015/05/19 17:59:24
We're not sharing FNEs just yet (hence the TODO be
|
| + // |
| // TODO(creis): For --site-per-process, share FrameNavigationEntries between |
| // NavigationEntries of the same tab. |
| - TreeNode* Clone() const; |
| + 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. |
| @@ -119,11 +126,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. |