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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 class CONTENT_EXPORT NodeRange { | 70 class CONTENT_EXPORT NodeRange { |
| 71 public: | 71 public: |
| 72 NodeIterator begin(); | 72 NodeIterator begin(); |
| 73 NodeIterator end(); | 73 NodeIterator end(); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend class FrameTree; | 76 friend class FrameTree; |
| 77 | 77 |
| 78 NodeRange(FrameTree* tree, FrameTreeNode* node_to_skip); | 78 NodeRange(FrameTreeNode* root, FrameTreeNode* node_to_skip); |
| 79 | 79 |
| 80 FrameTree* const tree_; | 80 FrameTreeNode* const root_; |
| 81 FrameTreeNode* const node_to_skip_; | 81 FrameTreeNode* const node_to_skip_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 class CONTENT_EXPORT ConstNodeIterator { | 84 class CONTENT_EXPORT ConstNodeIterator { |
| 85 public: | 85 public: |
| 86 ~ConstNodeIterator(); | 86 ~ConstNodeIterator(); |
| 87 | 87 |
| 88 ConstNodeIterator& operator++(); | 88 ConstNodeIterator& operator++(); |
| 89 | 89 |
| 90 bool operator==(const ConstNodeIterator& rhs) const; | 90 bool operator==(const ConstNodeIterator& rhs) const; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 class CONTENT_EXPORT ConstNodeRange { | 106 class CONTENT_EXPORT ConstNodeRange { |
| 107 public: | 107 public: |
| 108 ConstNodeIterator begin(); | 108 ConstNodeIterator begin(); |
| 109 ConstNodeIterator end(); | 109 ConstNodeIterator end(); |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 friend class FrameTree; | 112 friend class FrameTree; |
| 113 | 113 |
| 114 ConstNodeRange(const FrameTree* tree); | 114 ConstNodeRange(const FrameTreeNode* root); |
| 115 | 115 |
| 116 const FrameTree* const tree_; | 116 const FrameTreeNode* const root_; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 // Each FrameTreeNode will default to using the given |navigator| for | 119 // Each FrameTreeNode will default to using the given |navigator| for |
| 120 // navigation tasks in the frame. | 120 // navigation tasks in the frame. |
| 121 // A set of delegates are remembered here so that we can create | 121 // A set of delegates are remembered here so that we can create |
| 122 // RenderFrameHostManagers. | 122 // RenderFrameHostManagers. |
| 123 // TODO(creis): This set of delegates will change as we move things to | 123 // TODO(creis): This set of delegates will change as we move things to |
| 124 // Navigator. | 124 // Navigator. |
| 125 FrameTree(Navigator* navigator, | 125 FrameTree(Navigator* navigator, |
| 126 RenderFrameHostDelegate* render_frame_delegate, | 126 RenderFrameHostDelegate* render_frame_delegate, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 141 // Returns the first frame in this tree with the given |name|, or the main | 141 // Returns the first frame in this tree with the given |name|, or the main |
| 142 // frame if |name| is empty. | 142 // frame if |name| is empty. |
| 143 // Note that this does NOT support pseudo-names like _self, _top, and _blank, | 143 // Note that this does NOT support pseudo-names like _self, _top, and _blank, |
| 144 // nor searching other FrameTrees (unlike blink::WebView::findFrameByName). | 144 // nor searching other FrameTrees (unlike blink::WebView::findFrameByName). |
| 145 FrameTreeNode* FindByName(const std::string& name); | 145 FrameTreeNode* FindByName(const std::string& name); |
| 146 | 146 |
| 147 // Returns a range to iterate over all FrameTreeNodes in the frame tree in | 147 // Returns a range to iterate over all FrameTreeNodes in the frame tree in |
| 148 // breadth-first traversal order. | 148 // breadth-first traversal order. |
| 149 NodeRange Nodes(); | 149 NodeRange Nodes(); |
| 150 | 150 |
| 151 // Returns a range to iterall over all FrameTreeNodes in a subtree of the | |
|
nasko
2016/03/22 13:56:54
s/iterall/iterate/? here and below.
kenrb
2016/03/22 15:40:20
Done.
| |
| 152 // frame tree, starting from |subtree_root|. | |
| 153 NodeRange SubtreeNodes(FrameTreeNode* subtree_root); | |
| 154 | |
| 151 // Returns a range to iterate over all FrameTreeNodes in the frame tree in | 155 // Returns a range to iterate over all FrameTreeNodes in the frame tree in |
| 152 // breadth-first traversal order. All FrameTreeNodes returned will be const. | 156 // breadth-first traversal order. All FrameTreeNodes returned will be const. |
| 153 ConstNodeRange ConstNodes() const; | 157 ConstNodeRange ConstNodes() const; |
| 154 | 158 |
| 159 // Returns a range to iterall over all FrameTreeNodes in a subtree of the | |
| 160 // frame tree, starting from |subtree_root|. All FrameTreeNodes returned | |
| 161 // will be const. | |
| 162 ConstNodeRange ConstSubtreeNodes(FrameTreeNode* subtree_root); | |
|
nasko
2016/03/22 13:56:54
Nick wanted to get rid of the const version. Maybe
kenrb
2016/03/22 15:40:20
Done.
| |
| 163 | |
| 155 // Adds a new child frame to the frame tree. |process_id| is required to | 164 // Adds a new child frame to the frame tree. |process_id| is required to |
| 156 // disambiguate |new_routing_id|, and it must match the process of the | 165 // disambiguate |new_routing_id|, and it must match the process of the |
| 157 // |parent| node. Otherwise no child is added and this method returns false. | 166 // |parent| node. Otherwise no child is added and this method returns false. |
| 158 bool AddFrame(FrameTreeNode* parent, | 167 bool AddFrame(FrameTreeNode* parent, |
| 159 int process_id, | 168 int process_id, |
| 160 int new_routing_id, | 169 int new_routing_id, |
| 161 blink::WebTreeScopeType scope, | 170 blink::WebTreeScopeType scope, |
| 162 const std::string& frame_name, | 171 const std::string& frame_name, |
| 163 const std::string& frame_unique_name, | 172 const std::string& frame_unique_name, |
| 164 blink::WebSandboxFlags sandbox_flags, | 173 blink::WebSandboxFlags sandbox_flags, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 | 299 |
| 291 // Overall load progress. | 300 // Overall load progress. |
| 292 double load_progress_; | 301 double load_progress_; |
| 293 | 302 |
| 294 DISALLOW_COPY_AND_ASSIGN(FrameTree); | 303 DISALLOW_COPY_AND_ASSIGN(FrameTree); |
| 295 }; | 304 }; |
| 296 | 305 |
| 297 } // namespace content | 306 } // namespace content |
| 298 | 307 |
| 299 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 308 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
| OLD | NEW |