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_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. | 62 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. |
| 63 FrameTreeNode* FindByRoutingID(int routing_id, int process_id); | 63 FrameTreeNode* FindByRoutingID(int routing_id, int process_id); |
| 64 | 64 |
| 65 // Executes |on_node| on each node in the frame tree. If |on_node| returns | 65 // Executes |on_node| on each node in the frame tree. If |on_node| returns |
| 66 // false, terminates the iteration immediately. Returning false is useful | 66 // false, terminates the iteration immediately. Returning false is useful |
| 67 // if |on_node| is just doing a search over the tree. The iteration proceeds | 67 // if |on_node| is just doing a search over the tree. The iteration proceeds |
| 68 // top-down and visits a node before adding its children to the queue, making | 68 // top-down and visits a node before adding its children to the queue, making |
| 69 // it safe to remove children during the callback. | 69 // it safe to remove children during the callback. |
| 70 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node) const; | 70 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node) const; |
| 71 | 71 |
| 72 // A variation to the method above with a difference that the subtree starting | |
| 73 // at |skip_node| will not be recursed into. | |
| 74 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node, | |
|
awong
2014/09/03 21:58:38
Does this need to be public?
nasko
2014/09/03 23:50:19
No.
| |
| 75 FrameTreeNode* skip_node) const; | |
|
awong
2014/09/03 21:58:38
skip_node -> skip_this_subtree?
nasko
2014/09/03 23:50:19
Done.
| |
| 76 | |
| 72 // Frame tree manipulation routines. | 77 // Frame tree manipulation routines. |
| 73 RenderFrameHostImpl* AddFrame(FrameTreeNode* parent, | 78 RenderFrameHostImpl* AddFrame(FrameTreeNode* parent, |
| 74 int new_routing_id, | 79 int new_routing_id, |
| 75 const std::string& frame_name); | 80 const std::string& frame_name); |
| 76 void RemoveFrame(FrameTreeNode* child); | 81 void RemoveFrame(FrameTreeNode* child); |
| 77 | 82 |
| 78 // This method walks the entire frame tree and creates a RenderFrameProxyHost | 83 // This method walks the entire frame tree and creates a RenderFrameProxyHost |
| 79 // for the given |site_instance| in each node except the |source| one -- | 84 // for the given |site_instance| in each node except the |source| one -- |
| 80 // the source will have a RenderFrameHost. It assumes that no frame tree | 85 // the source will have a RenderFrameHost. It assumes that no frame tree |
| 81 // nodes already have RenderFrameProxyHost for the given |site_instance|. | 86 // nodes already have RenderFrameProxyHost for the given |site_instance|. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 int64 focused_frame_tree_node_id_; | 169 int64 focused_frame_tree_node_id_; |
| 165 | 170 |
| 166 base::Callback<void(RenderFrameHost*)> on_frame_removed_; | 171 base::Callback<void(RenderFrameHost*)> on_frame_removed_; |
| 167 | 172 |
| 168 DISALLOW_COPY_AND_ASSIGN(FrameTree); | 173 DISALLOW_COPY_AND_ASSIGN(FrameTree); |
| 169 }; | 174 }; |
| 170 | 175 |
| 171 } // namespace content | 176 } // namespace content |
| 172 | 177 |
| 173 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 178 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
| OLD | NEW |