Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_manager.h |
| diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h |
| index b58673e8aea3e94c123f585a6759d070878e8c75..95729d0534efeccc94920860e8f734cfdbe4b53f 100644 |
| --- a/content/browser/frame_host/render_frame_host_manager.h |
| +++ b/content/browser/frame_host/render_frame_host_manager.h |
| @@ -482,6 +482,9 @@ class CONTENT_EXPORT RenderFrameHostManager { |
| friend class RenderFrameHostManagerTest; |
| friend class TestWebContents; |
| + FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
| + TraverseComplexOpenerChain); |
|
Charlie Reis
2015/08/05 23:59:09
Maybe we can expose CollectOpenerFrameTrees via Re
alexmos
2015/08/06 17:05:39
Done.
|
| + |
| // Stores information regarding a SiteInstance targeted at a specific URL to |
| // allow for comparisons without having to actually create new instances. It |
| // can point to an existing one or store the details needed to create a new |
| @@ -618,6 +621,24 @@ class CONTENT_EXPORT RenderFrameHostManager { |
| // CreateOpenerProxies on it if it exists and returning otherwise. |
| void CreateOpenerProxiesIfNeeded(SiteInstance* instance); |
| + // Traverse the opener chain and populate |opener_frame_trees| with |
| + // all FrameTrees accessible by following frame openers of nodes in the |
| + // current node's FrameTree. |opener_frame_trees| is ordered so that openers |
| + // of smaller-indexed entries point to larger-indexed entries (i.e., this |
| + // node's FrameTree is at index 0, its opener's FrameTree is at index 1, |
| + // etc). If the traversal encounters a node with an opener pointing to a |
| + // FrameTree that has already been traversed (such as when there's a cycle), |
| + // the node is added to |nodes_with_back_links|. |
| + void CollectOpenerFrameTrees( |
| + std::vector<FrameTree*>* opener_frame_trees, |
| + base::hash_set<FrameTreeNode*>* nodes_with_back_links); |
| + |
| + // Create swapped out RenderViews and RenderFrameProxies in the given |
| + // SiteInstance for the current node's FrameTree. Used as a helper function |
| + // in CreateOpenerProxies for creating proxies in each FrameTree on the |
| + // opener chain. |
| + void CreateOpenerProxiesForFrameTree(SiteInstance* instance); |
| + |
| // Creates a RenderFrameHost and corresponding RenderViewHost if necessary. |
| scoped_ptr<RenderFrameHostImpl> CreateRenderFrameHost(SiteInstance* instance, |
| int view_routing_id, |